[
  {
    "path": ".codecov.yml",
    "content": "ignore:\n  # ignore auto-generated code\n  - \"github/github-accessors.go\"\n  # ignore experimental scrape package\n  - \"scrape\"\n  # ignore tools\n  - \"tools\"\n"
  },
  {
    "path": ".custom-gcl.yml",
    "content": "version: v2.10.1 # this is the version of golangci-lint\nplugins:\n  - module: \"github.com/google/go-github/v84/tools/extraneousnew\"\n    path: ./tools/extraneousnew\n  - module: \"github.com/google/go-github/v84/tools/fmtpercentv\"\n    path: ./tools/fmtpercentv\n  - module: \"github.com/google/go-github/v84/tools/sliceofpointers\"\n    path: ./tools/sliceofpointers\n  - module: \"github.com/google/go-github/v84/tools/structfield\"\n    path: ./tools/structfield\n"
  },
  {
    "path": ".github/dependabot.yml",
    "content": "version: 2\nupdates:\n- package-ecosystem: gomod\n  directory: /\n  schedule:\n    interval: weekly\n- package-ecosystem: gomod\n  directory: otel\n  schedule:\n    interval: weekly\n- package-ecosystem: gomod\n  directory: scrape\n  schedule:\n    interval: weekly\n- package-ecosystem: gomod\n  directories:\n    - /tools\n    - /tools/**\n  schedule:\n    interval: weekly\n- package-ecosystem: gomod\n  directory: example\n  schedule:\n    interval: weekly\n- package-ecosystem: github-actions\n  directory: /\n  schedule:\n    interval: weekly\n  groups:\n    actions:\n      patterns:\n      - \"actions/*\"\n"
  },
  {
    "path": ".github/workflows/linter.yml",
    "content": "on: [push, pull_request]\nname: linter\n\npermissions:\n  contents: read\n\njobs:\n  lint:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n    - uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0\n      with:\n        go-version: stable\n        cache-dependency-path: \"**/go.sum\"\n    - uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4\n      with:\n        path: |\n          bin/golangci-lint\n          bin/custom-gcl\n        key: ${{ runner.os }}-${{ runner.arch }}-tools-${{ hashFiles('.custom-gcl.yml', 'tools/**/go.mod', 'tools/**/go.sum', 'tools/**/*.go') }}\n    - run: script/lint.sh\n      env:\n        CHECK_GITHUB_OPENAPI: 1\n        GITHUB_TOKEN: ${{ github.token }}\n"
  },
  {
    "path": ".github/workflows/tests.yml",
    "content": "concurrency:\n  group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}\n  cancel-in-progress: true\n\non:\n  push:\n    branches:\n      - master\n  pull_request:\n    branches:\n      - master\n\nname: tests\nenv:\n  GO111MODULE: on\n\npermissions:\n  contents: read\n\njobs:\n  test:\n    permissions:\n      contents: read\n      id-token: write\n    defaults:\n      run:\n        shell: bash\n    strategy:\n      matrix:\n        go-version: [stable, oldstable] # test with N and the .0 release of N-1\n        platform: [ubuntu-latest]\n        include:\n          # include windows, but only with the latest Go version, since there\n          # is very little in the library that is platform specific\n          - go-version: stable\n            platform: windows-latest\n\n          # only update test coverage stats with the most recent go version on linux\n          - go-version: stable\n            platform: ubuntu-latest\n            update-coverage: true\n    runs-on: ${{ matrix.platform }}\n\n    steps:\n      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2\n      - uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0\n        with:\n          go-version: ${{ matrix.go-version }}\n          cache-dependency-path: \"**/go.sum\"\n\n      - name: Run go test\n        run: |\n          if [ -n \"${{ matrix.update-coverage }}\" ]; then\n            script/test.sh -race -covermode atomic -coverprofile coverage.txt ./...\n            exit\n          fi\n          script/test.sh -race -covermode atomic ./...\n\n      - name: Ensure integration tests build\n        # don't actually run tests since they hit live GitHub API\n        run: go test -v -tags=integration -run=^$ ./test/integration\n\n      - name: Upload coverage to Codecov\n        if: ${{ matrix.update-coverage }}\n        uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3\n        with:\n          use_oidc: true\n"
  },
  {
    "path": ".gitignore",
    "content": "*.sh\n!/script/*.sh\n*.test\n.*.local\ncoverage.out\n/bin\n# intellij files\n.idea/\nvendor/\n.DS_Store\n.vscode\n.claude/\n# vim temp files\n*.swp\n\n# goenv local version. See https://github.com/syndbg/goenv/blob/master/COMMANDS.md#goenv-local for more info.\n.go-version\n\n# golangci-lint -v custom generates the following local file:\ncustom-gcl\ncustom-gcl.exe\n"
  },
  {
    "path": ".golangci.yml",
    "content": "version: \"2\"\nrun:\n  build-tags:\n    - integration\n  allow-parallel-runners: true\nlinters:\n  default: none\n  enable:\n    - canonicalheader\n    - dogsled\n    - dupl\n    - errcheck\n    - errorlint\n    - extraneousnew\n    - fmtpercentv\n    - forbidigo\n    - gocritic\n    - godot\n    - goheader\n    - gosec\n    - govet\n    - ineffassign\n    - misspell\n    - modernize\n    - musttag\n    - nakedret\n    - nolintlint\n    - paralleltest\n    - perfsprint\n    - revive\n    - sliceofpointers\n    - staticcheck\n    - structfield\n    - tparallel\n    - unconvert\n    - unparam\n    - unused\n    - usetesting\n    - whitespace\n  settings:\n    errorlint:\n      errorf: false\n      asserts: true\n      comparison: true\n    forbidigo:\n      forbid:\n        - pattern: ^fmt\\.Print.*$\n          msg: \"Do not use fmt.Print statements.\"\n        - pattern: ^reflect\\.DeepEqual$\n          msg: \"Use cmp.Equal instead of reflect.DeepEqual\"\n        - pattern: \"^http\\\\.Method[A-Z][a-z]*$\"\n          msg: \"Use string literals instead of http.Method constants (https://pkg.go.dev/net/http#pkg-constants)\"\n        - pattern: ^sort\\..*$\n          msg: \"Use sorting functions from the slices package instead.\"\n    gocritic:\n      disable-all: true\n      enabled-checks:\n        - commentedOutCode\n        - commentFormatting\n        - deprecatedComment\n        - paramTypeCombine\n    goheader:\n      values:\n        regexp:\n          CopyrightDate: 'Copyright \\d{4} '\n      template: |-\n        {{CopyrightDate}}The go-github AUTHORS. All rights reserved.\n\n        Use of this source code is governed by a BSD-style\n        license that can be found in the LICENSE file.\n    gosec:\n      excludes:\n        # duplicates errcheck\n        - G104\n        # int(os.Stdin.Fd())\n        - G115\n        # false positive\n        - G704\n        # false positive on valid struct fields \"AccessToken\", \"ClientSecret\", \"Secret\", \"Password\"\n        - G117\n    govet:\n      enable-all: true\n      disable:\n        - fieldalignment\n        - shadow\n    ineffassign:\n      check-escaping-errors: true\n    misspell:\n      locale: US\n      # extra words from https://go.dev/wiki/Spelling\n      extra-words:\n        - typo: marshall\n          correction: marshal\n        - typo: marshalled\n          correction: marshaled\n        - typo: marshalling\n          correction: marshaling\n        - typo: unmarshall\n          correction: unmarshal\n        - typo: unmarshalling\n          correction: unmarshaling\n        - typo: unmarshalled\n          correction: unmarshaled\n        - typo: unmarshalling\n          correction: unmarshaling\n      ignore-rules:\n        - analyses # returned by the GitHub API\n        - cancelled # returned by the GitHub API\n    nolintlint:\n      allow-unused: true\n      require-specific: true\n    perfsprint:\n      errorf: true\n      strconcat: false\n    revive:\n      # Set below 0.8 to enable error-strings rule.\n      confidence: 0.6\n      rules:\n        - name: blank-imports\n        - name: bool-literal-in-expr\n        - name: context-as-argument\n        - name: context-keys-type\n        - name: dot-imports\n        - name: early-return\n        - name: empty-block\n        - name: error-naming\n        - name: error-return\n        - name: error-strings\n        - name: errorf\n        - name: exported\n          arguments:\n            - disableChecksOnConstants\n            - disableChecksOnVariables\n            - disableStutteringCheck\n        - name: filename-format\n          arguments:\n            - ^[_a-z][_a-z0-9]*.go$\n        - name: forbidden-call-in-wg-go\n        - name: identical-branches\n        - name: identical-ifelseif-branches\n        - name: identical-ifelseif-conditions\n        - name: identical-switch-branches\n        - name: identical-switch-conditions\n        - name: if-return\n        - name: increment-decrement\n        - name: indent-error-flow\n        - name: inefficient-map-lookup\n        - name: package-comments\n        - name: range\n        - name: receiver-naming\n        - name: redefines-builtin-id\n        - name: superfluous-else\n        - name: time-equal\n        - name: time-naming\n        - name: unexported-naming\n        - name: unexported-return\n        - name: unnecessary-format\n        - name: unnecessary-if\n        - name: unnecessary-stmt\n        - name: unreachable-code\n        - name: unused-parameter\n        - name: use-any\n        - name: use-errors-new\n        - name: use-fmt-print\n        - name: use-slices-sort\n        - name: use-waitgroup-go\n        - name: var-declaration\n        - name: var-naming\n    staticcheck:\n      checks:\n        - \"all\"\n        - \"-QF1008\" # allow embedded field in selector\n    unparam:\n      check-exported: true\n    usetesting:\n      context-background: true\n      context-todo: true\n      os-chdir: true\n      os-mkdir-temp: true\n      os-setenv: true\n      os-create-temp: true\n      os-temp-dir: true\n    custom:\n      extraneousnew:\n        type: module\n        description: Reports problematic usage of 'new' or '&SomeStruct{}' when a more idiomatic 'var' pointer would be more appropriate.\n        original-url: github.com/google/go-github/v84/tools/extraneousnew\n        settings:\n          ignored-methods:\n            - RateLimitService.Get\n            - RepositoriesService.ReplaceAllTopics\n      fmtpercentv:\n        type: module\n        description: Reports usage of %d or %s in format strings.\n        original-url: github.com/google/go-github/v84/tools/fmtpercentv\n      sliceofpointers:\n        type: module\n        description: Reports usage of []*string and slices of structs without pointers.\n        original-url: github.com/google/go-github/v84/tools/sliceofpointers\n      structfield:\n        type: module\n        description: Reports mismatches between Go field and JSON, URL tag names and types.\n        original-url: github.com/google/go-github/v84/tools/structfield\n        settings:\n          allowed-tag-names:\n            - ActionsCacheUsageList.RepoCacheUsage # TODO: RepoCacheUsages ?\n            - AuditEntry.ExternalIdentityNameID\n            - AuditEntry.Timestamp\n            - CheckSuite.AfterSHA\n            - CheckSuite.BeforeSHA\n            - CodeSearchResult.CodeResults\n            - CodeSearchResult.Total\n            - CommitAuthor.Login\n            - CommitsSearchResult.Commits\n            - CommitsSearchResult.Total\n            - CreateOrgInvitationOptions.TeamID # TODO: TeamIDs\n            - DependencyGraphSnapshot.Sha # TODO: SHA\n            - Discussion.DiscussionCategory # TODO: Category ?\n            - EditOwner.OwnerInfo\n            - EnterpriseLicensedUsers.GithubComSamlNameID # TODO: GithubComSAMLNameID\n            - Event.RawPayload\n            - HookRequest.RawPayload\n            - HookResponse.RawPayload\n            - Issue.PullRequestLinks # TODO: PullRequest\n            - IssueImportRequest.IssueImport # TODO: Issue\n            - IssuesSearchResult.Issues # TODO: Items\n            - IssuesSearchResult.Total\n            - LabelsSearchResult.Labels # TODO: Items\n            - LabelsSearchResult.Total\n            - ListCheckRunsResults.Total\n            - ListCheckSuiteResults.Total\n            - ListCustomDeploymentRuleIntegrationsResponse.AvailableIntegrations\n            - ListDeploymentProtectionRuleResponse.ProtectionRules\n            - ListIDPGroupsOptions.Query\n            - ListProjectsOptions.Query\n            - OrganizationCustomRepoRoles.CustomRepoRoles # TODO: CustomRoles\n            - OrganizationCustomRoles.CustomRepoRoles # TODO: Roles\n            - PreReceiveHook.ConfigURL\n            - ProjectV2ItemEvent.ProjectV2Item # TODO: ProjectsV2Item\n            - Protection.RequireLinearHistory # TODO: RequiredLinearHistory\n            - ProtectionRequest.RequireLinearHistory # TODO: RequiredLinearHistory\n            - PullRequestComment.InReplyTo # TODO: InReplyToID\n            - PullRequestReviewsEnforcementRequest.BypassPullRequestAllowancesRequest # TODO: BypassPullRequestAllowances\n            - PullRequestReviewsEnforcementRequest.DismissalRestrictionsRequest # TODO: DismissalRestrictions\n            - PullRequestReviewsEnforcementUpdate.BypassPullRequestAllowancesRequest # TODO: BypassPullRequestAllowances\n            - PullRequestReviewsEnforcementUpdate.DismissalRestrictionsRequest # TODO: DismissalRestrictions\n            - Reactions.MinusOne\n            - Reactions.PlusOne\n            - RepositoriesSearchResult.Repositories\n            - RepositoriesSearchResult.Total\n            - RepositoryVulnerabilityAlert.GitHubSecurityAdvisoryID\n            - SecretScanningAlertLocationDetails.Startline # TODO: StartLine\n            - SecretScanningPatternOverride.Bypassrate # TODO: BypassRate\n            - StarredRepository.Repository # TODO: Repo\n            - Timeline.Requester # TODO: ReviewRequester\n            - Timeline.Reviewer # TODO: RequestedReviewer\n            - TopicsSearchResult.Topics # TODO: Items\n            - TopicsSearchResult.Total\n            - TotalCacheUsage.TotalActiveCachesUsageSizeInBytes # TODO: TotalActiveCachesSizeInBytes\n            - TransferRequest.TeamID # TODO: TeamIDs\n            - Tree.Entries\n            - User.LdapDn # TODO: LDAPDN\n            - UsersSearchResult.Total\n            - UsersSearchResult.Users\n            - WeeklyStats.Additions\n            - WeeklyStats.Commits\n            - WeeklyStats.Deletions\n            - WeeklyStats.Week\n          allowed-tag-types:\n            - APIMetaArtifactAttestations.TrustDomain # TODO: Meta\n            - ActionsCacheListOptions.Direction\n            - ActionsCacheListOptions.Key\n            - ActionsCacheListOptions.Ref\n            - ActionsCacheListOptions.Sort\n            - ActiveCommittersListOptions.AdvancedSecurityProduct\n            - AnalysesListOptions.Ref\n            - AnalysesListOptions.SarifID\n            - BranchListOptions.Protected\n            - CodespaceGetDefaultAttributesOptions.ClientIP\n            - CodespaceGetDefaultAttributesOptions.Ref\n            - CommitsListOptions.Since # TODO: Repositories\n            - CommitsListOptions.Until # TODO: Repositories\n            - ConfigApplyEventsOptions.LastRequestID\n            - CreateTag.Message # TODO: Git\n            - CreateTag.Object # TODO: Git\n            - CreateTag.Tag # TODO: Git\n            - CreateTag.Type # TODO: Git\n            - DependabotEncryptedSecret.SelectedRepositoryIDs # TODO: Dependabot\n            - DependabotEncryptedSecret.Visibility # TODO: Dependabot\n            - DeploymentRequest.RequiredContexts # TODO: Deployments\n            - DismissalRestrictionsRequest.Apps # TODO: Repositories\n            - DismissalRestrictionsRequest.Teams # TODO: Repositories\n            - DismissalRestrictionsRequest.Users # TODO: Repositories\n            - EncryptedSecret.SelectedRepositoryIDs # TODO: Actions\n            - EncryptedSecret.Visibility # TODO: Actions\n            - ErrorBlock.Reason # TODO: Common\n            - ErrorResponse.DocumentationURL # TODO: Common\n            - GetAuditLogOptions.Include\n            - GetAuditLogOptions.Order\n            - GetAuditLogOptions.Phrase\n            - GetProvisionedSCIMGroupEnterpriseOptions.ExcludedAttributes\n            - GistListOptions.Since # TODO: Gists\n            - IssueEvent.Action # TODO: Issues\n            - IssueListByOrgOptions.Since\n            - IssueListByRepoOptions.Since # TODO: Issues\n            - IssueListCommentsOptions.Direction\n            - IssueListCommentsOptions.Sort\n            - IssueRequest.Assignees # TODO: Issues\n            - IssueRequest.Labels # TODO: Issues\n            - License.Conditions # TODO: Licenses\n            - License.Limitations # TODO: Licenses\n            - License.Permissions # TODO: Licenses\n            - ListAlertsOptions.Direction\n            - ListAlertsOptions.Ecosystem\n            - ListAlertsOptions.Package\n            - ListAlertsOptions.Scope\n            - ListAlertsOptions.Severity\n            - ListAlertsOptions.Sort\n            - ListAlertsOptions.State\n            - ListAllIssuesOptions.Since\n            - ListArtifactsOptions.Name\n            - ListCheckRunsOptions.AppID\n            - ListCheckRunsOptions.CheckName\n            - ListCheckRunsOptions.Filter\n            - ListCheckRunsOptions.Status\n            - ListCheckSuiteOptions.AppID\n            - ListCheckSuiteOptions.CheckName\n            - ListCostCenterOptions.State\n            - ListExternalGroupsOptions.DisplayName\n            - ListGlobalSecurityAdvisoriesOptions.Affects\n            - ListGlobalSecurityAdvisoriesOptions.CVEID\n            - ListGlobalSecurityAdvisoriesOptions.Ecosystem\n            - ListGlobalSecurityAdvisoriesOptions.GHSAID\n            - ListGlobalSecurityAdvisoriesOptions.IsWithdrawn\n            - ListGlobalSecurityAdvisoriesOptions.Modified\n            - ListGlobalSecurityAdvisoriesOptions.Published\n            - ListGlobalSecurityAdvisoriesOptions.Severity\n            - ListGlobalSecurityAdvisoriesOptions.Type\n            - ListGlobalSecurityAdvisoriesOptions.Updated\n            - ListLicensesOptions.Featured\n            - ListProvisionedSCIMGroupsEnterpriseOptions.Count # TODO: Enterprise\n            - ListProvisionedSCIMGroupsEnterpriseOptions.ExcludedAttributes # TODO: Enterprise\n            - ListProvisionedSCIMGroupsEnterpriseOptions.Filter # TODO: Enterprise\n            - ListProvisionedSCIMGroupsEnterpriseOptions.StartIndex # TODO: Enterprise\n            - ListProvisionedSCIMUsersEnterpriseOptions.Count\n            - ListProvisionedSCIMUsersEnterpriseOptions.Filter\n            - ListProvisionedSCIMUsersEnterpriseOptions.StartIndex\n            - ListRepoMachineTypesOptions.ClientIP\n            - ListRepoMachineTypesOptions.Location\n            - ListRepoMachineTypesOptions.Ref\n            - ListRunnersOptions.Name\n            - ListSCIMProvisionedIdentitiesOptions.Count\n            - ListSCIMProvisionedIdentitiesOptions.Filter\n            - ListSCIMProvisionedIdentitiesOptions.StartIndex\n            - ListUserIssuesOptions.Since\n            - LockIssueOptions.LockReason # TODO: Issues\n            - MarketplacePlan.Bullets # TODO: Marketplaces\n            - NodeQueryOptions.ClusterRoles\n            - NodeQueryOptions.UUID\n            - NotificationListOptions.Before # TODO: Activities\n            - NotificationListOptions.Since # TODO: Activities\n            - PackageListOptions.PackageType\n            - PackageListOptions.State\n            - PackageListOptions.Visibility\n            - PremiumRequestUsageReportOptions.Day\n            - PremiumRequestUsageReportOptions.Model\n            - PremiumRequestUsageReportOptions.Month\n            - PremiumRequestUsageReportOptions.Product\n            - PremiumRequestUsageReportOptions.User\n            - PremiumRequestUsageReportOptions.Year\n            - PullRequestListCommentsOptions.Since # TODO: PullRequests\n            - Rate.Resource # TODO: Common\n            - RepositoryAddCollaboratorOptions.Permission # TODO: Repositories\n            - RepositoryCreateForkOptions.DefaultBranchOnly # TODO: Repositories\n            - RepositoryCreateForkOptions.Name # TODO: Repositories\n            - RepositoryCreateForkOptions.Organization # TODO: Repositories\n            - RepositoryListRulesetsOptions.IncludesParents\n            - RequiredStatusChecks.Checks # TODO: Repositories\n            - RequiredStatusChecks.Contexts # TODO: Repositories\n            - SearchOptions.AdvancedSearch\n            - Secret.SelectedRepositoriesURL # TODO: Actions\n            - Secret.Visibility # TODO: Actions\n            - TeamAddTeamMembershipOptions.Role # TODO: Teams\n            - TeamAddTeamRepoOptions.Permission # TODO: Teams\n            - UpdateRuleParameters.UpdateAllowsFetchAndMerge # TODO: Rules\n            - UsageReportOptions.Day\n            - UsageReportOptions.Hour\n            - UsageReportOptions.Month\n            - UsageReportOptions.Year\n            - WorkflowRunAttemptOptions.ExcludePullRequests\n  exclusions:\n    rules:\n      - linters:\n          - dogsled\n          - dupl\n          - gosec\n          - unparam\n        path: _test\\.go\n\n      # Allow fmt.Print in examples, internal tools, and tests.\n      - linters: [forbidigo]\n        path: ^(example|tools|test|scrape)\\/\n        text: 'fmt\\.Print'\n\n      # We need to pass nil Context in order to test DoBare erroring on nil ctx.\n      - linters: [staticcheck]\n        path: _test\\.go\n        text: 'SA1012: do not pass a nil Context'\n\n      # We need to use sha1 for validating signatures\n      - linters: [gosec]\n        text: 'G505: Blocklisted import crypto/sha1: weak cryptographic primitive'\n\n      # This is adapted from golangci-lint's default exclusions. It disables linting for error checks on\n      # os.RemoveAll, fmt.Fprint*, fmt.Scanf, and any function ending in \"Close\".\n      - linters: [errcheck]\n        text: Error return value of .(.*Close|fmt\\.Fprint.*|fmt\\.Scanf|os\\.Remove(All)?). is not checked\n\n      # We don't care about gosec issues in examples or internal tools.\n      - linters: [gosec]\n        path: ^(example|tools)\\/\n        text: '(G304|G705|G706)'\n\n      # We don't run parallel integration tests\n      - linters: [paralleltest, tparallel]\n        path: ^test/integration\n\n      # Because fmt.Sprint(reset.Unix())) is more readable than strconv.FormatInt(reset.Unix(), 10).\n      - linters: [perfsprint]\n        text: fmt.Sprint.* can be replaced with faster strconv.FormatInt\nissues:\n  max-issues-per-linter: 0\n  max-same-issues: 0\nformatters:\n  enable:\n    - gci\n    - gofumpt\n  settings:\n    gofumpt:\n      extra-rules: true\n"
  },
  {
    "path": "AUTHORS",
    "content": "# This is the official list of go-github authors for copyright purposes.\n#\n# This does not necessarily list everyone who has contributed code, since in\n# some cases, their employer may be the copyright holder. To see the full list\n# of contributors, see the revision history in source control or\n# https://github.com/google/go-github/graphs/contributors.\n#\n# Authors who wish to be recognized in this file should add themselves (or\n# their employer, as appropriate).\n\n178inaba <masahiro.furudate@gmail.com>\n2BFL <imqksl@gmail.com>\n413x <dedifferentiator@gmail.com>\n6543 <6543@obermui.de>\nAaron LaBrie <bigdadbear@github.com>\nAbed Kibbe <abed.kibbe@gmail.com>\nAbhijit Hota <abhihota025@gmail.com>\nAbhinav Gupta <mail@abhinavg.net>\nabhishek <abhishek@exaforce.com>\nAbhishek Sharma <abhishekbiyala@gmail.com>\nAbhishek Veeramalla <abhishek.veeramalla@gmail.com>\nAbinand P <abinand0911@gmail.com>\naboy <b1011211@gmail.com>\nAdam Guthrie <ispiked@gmail.com>\nAdam Kohring <ajkohring@gmail.com>\nAditya Mahendrakar <a.mahendrakar@yahoo.com>\nadrienzieba <adrien.zieba@appdirect.com>\nafdesk <work@afdesk.com>\nAhmad Nurus S <ahmadnurus.sh@gmail.com>\nAhmed Hagy <a.akram93@gmail.com>\nAidan <aidan@artificial.com>\nAidan Steele <aidan.steele@glassechidna.com.au>\nAinsley Chong <ainsley.chong@gmail.com>\najz01 <azdenek@yahoo.com>\nAkeda Bagus <akeda@x-team.com>\nAkhil Mohan <akhilerm@gmail.com>\nAlec Thomas <alec@swapoff.org>\nAleks Clark <aleks.clark@gmail.com>\nAlex Bramley <a.bramley@gmail.com>\nAlex Ellis <alexellis2@gmail.com>\nAlex Orr <Alexorr.CSE@gmail.com>\nAlex Su <alexsu@17.media>\nAlex Unger <zyxancf@gmail.com>\nAlexander Harkness <me@bearbin.net>\nAlexey Alekhin <laughedelic@gmail.com>\nAlexis Couvreur <alexiscouvreur.pro@gmail.com>\nAlexis Gauthiez <alexis.gauthiez@gmail.com>\nAli Farooq <ali.farooq0@pm.me>\nAlin Balutoiu <alinbalutoiu@gmail.com>\nAllan Guwatudde <guwats10@gmail.com>\nAllen Sun <shlallen1990@gmail.com>\nAman Verma <verma1090aman@gmail.com>\nAmey Sakhadeo <me@ameyms.com>\nAnders Janmyr <anders@janmyr.com>\nAndreas Deininger <andreas@deininger.net>\nAndreas Garnæs <https://github.com/andreas>\nAndreas Jaggi <x-way@waterwave.ch>\nAndrew Gillis <gillis.andrew@gmail.com>\nAndrew Ryabchun <aryabchun@mail.ua>\nAndrew Svoboda <svoboda.andrew@gmail.com>\nAndriyun <andriy.yun@gmail.com>\nAndy Grunwald <andygrunwald@gmail.com>\nAndy Hume <andyhume@gmail.com>\nAndy Lindeman <andy@lindeman.io>\nangie pinilla <angelinepinilla@gmail.com>\nAnish Rajan <anishrajan2708@gmail.com>\nanjanashenoy <anjanashenoy1@gmail.com>\nAnshuman Bhartiya <anshuman.bhartiya@gmail.com>\nAntoine <antoine.tu@mail.mcgill.ca>\nAntoine Pelisse <apelisse@gmail.com>\nAnton Nguyen <afnguyen85@gmail.com>\nAnubha Kushwaha <anubha_bt2k14@dtu.ac.in>\nappilon <apilon@hashicorp.com>\naprp <doelaudi@gmail.com>\napurwaj2 <apurwaj2@gmail.com>\nAravind <aravindkp@outlook.in>\nArda Kuyumcu <kuyumcuarda@gmail.com>\nAry <arylmoraesn@hotmail.com>\nArıl Bozoluk <arilbozoluk@hotmail.com>\nAsier Marruedo <asiermarruedo@gmail.com>\nAusten Stone <austenstone@github.com>\nAustin Burdine <acburdine@gmail.com>\nAustin Dizzy <dizzy@wow.com>\nAzuka Okuleye <azuka@zatechcorp.com>\nBen Batha <bhbatha@gmail.com>\nBenjamen Keroack <benjamen@dollarshaveclub.com>\nBenjamin Nater <benjamin@nater.net>\nBerkay Tacyildiz <berkaytacyildiz@gmail.com>\nBeshr Kayali <beshrkayali@gmail.com>\nBeyang Liu <beyang.liu@gmail.com>\nbillnapier <napier@pobox.com>\nBilly Keyes <bluekeyes@gmail.com>\nBilly Lynch <wlynch92@gmail.com>\nBingtan Lu <lubingtan@126.com>\nBjorn Neergaard <bjorn@neersighted.com>\nBjörn Häuser <b.haeuser@rebuy.de>\nBo Huang <bo.huang@datadoghq.com>\nboljen <bol.christophe@gmail.com>\nBracken <abdawson@gmail.com>\nBrad Harris <bmharris@gmail.com>\nBrad Moylan <moylan.brad@gmail.com>\nBradley Falzon <brad@teambrad.net>\nBradley McAllister <brad.mcallister@hotmail.com>\nBrandon Butler <b.butler@chia.net>\nBrandon Cook <phylake@gmail.com>\nBrandon Everett <bme2010@gmail.com>\nBrandon Stubbs <brstubbs1@gmail.com>\nBrett Kuhlman <kuhlman-labs@github.com>\nBrett Logan <lindluni@github.com>\nBrian Egizi <brian@mojotech.com>\nBryan Boreham <bryan@weave.works>\nBryan Peterson <Lazyshot@gmail.com>\nCami Diez <diezcami@gmail.com>\nCarl Johnson <me@carlmjohnson.net>\nCarlos Alexandro Becker <caarlos0@gmail.com>\nCarlos Tadeu Panato Junior <ctadeu@gmail.com>\nCasey <casey.duquette@snapchat.com>\nChandanChainani <chainanichan@gmail.com>\nchandresh-pancholi <chandreshpancholi007@gmail.com>\nChangyong Um <e7217@naver.com>\nCharles Fenwick Elliott <Charles@FenwickElliott.io>\nCharlie Yan <charlieyan08@gmail.com>\nChmouel Boudjnah <chmouel@chmouel.com>\nChris Allen Lane <chris@chris-allen-lane.com>\nChris King <chriskingnet@gmail.com>\nChris Mc <prince.chrismc@gmail.com>\nChris Raborg <craborg57@gmail.com>\nChris Roche <chris@vsco.co>\nChris Schaefer <chris@dtzq.com>\nchrisforrette <chris@chrisforrette.com>\nChristian Bargmann <chris@cbrgm.net>\nChristian Muehlhaeuser <muesli@gmail.com>\nChristoph Jerolimov <jerolimov@gmail.com>\nChristoph Sassenberg <defsprite@gmail.com>\nCI Monk <ci-monk@protonmail.com>\nClaus Näveke <github@naeveke.de>\nClemens W <Clemens.wijnekus@nordnet.se>\ncointem <jsyin1@163.com>\nColby Williams <ColbyLWilliams@gmail.com>\nColin Misare <github.com/cmisare>\nCraig Gumbley <craiggumbley@gmail.com>\nCraig Peterson <cpeterson@stackoverflow.com>\nCristian Maglie <c.maglie@bug.st>\nCyb3r Jak3 <jake@jwhite.network>\nDaehyeok Mun <daehyeok@gmail.com>\nDalton Hubble <dghubble@gmail.com>\nDaniel Lanner <lanner.dan@gmail.com>\nDaniel Leavitt <daniel.leavitt@gmail.com>\nDaniel Nilsson <daniel.nilsson1989@gmail.com>\nDaoq <masseto2002@gmail.com>\nDave Du Cros <davidducros@gmail.com>\nDave Henderson <dhenderson@gmail.com>\nDave Perrett <hello@daveperrett.com>\nDave Protasowski <dprotaso@gmail.com>\nDavid Deng <daviddengcn@gmail.com>\nDavid Gamba <davidgamba@gmail.com>\nDavid J. M. Karlsen <david@davidkarlsen.com>\nDavid Jannotta <djannotta@gmail.com>\nDavid Ji <github.com/davidji99>\nDavid Lopez Reyes <davidlopezre@gmail.com>\nDavide Zipeto <dawez1@gmail.com>\nDennis Webb <dennis@bluesentryit.com>\nDerek Jobst <derekjobst@gmail.com>\nDeviousLab <deviouslab@gmail.com>\nDhananjay Mishra <technicaldmcontact@gmail.com>\nDhi Aurrahman <diorahman@rockybars.com>\nDiego Lapiduz <diego.lapiduz@cfpb.gov>\nDiogo Vilela <be0x74a@gmail.com>\nDion Gionet Mallet <dionmallet@hotmail.com>\nDmitri Shuralyov <shurcooL@gmail.com>\ndmnlk <seikima2demon@gmail.com>\nDon Petersen <don@donpetersen.net>\nDoug Turner <doug.turner@gmail.com>\nDrew Fradette <drew.fradette@gmail.com>\nDustin Deus <deusdustin@gmail.com>\nDustin Lish <dustin.lish@onepeloton.com>\nEivind <eivindkn@gmail.com>\nEli Uriegas <seemethere101@gmail.com>\nElliott Beach <elliott2.71828@gmail.com>\nEmerson Wood <emersonwood94@gmail.com>\nEmil V <emil.vaagland@schibsted.com>\nEmma Sax <esselbach_briley@simplelogin.com>\nEng Zer Jun <engzerjun@gmail.com>\nEnrico Candino <enrico.candino@gmail.com>\neperm <staffordworrell@gmail.com>\nErick Fejta <erick@fejta.com>\nErik Elkins <erik.elkins@outlook.com>\nErik Nobel <hendrik.nobel@transferwise.com>\nErwan Finot <finot.erwan@gmail.com>\nerwinvaneyk <erwinvaneyk@gmail.com>\nEvan Anderson <evan.k.anderson@gmail.com>\nEvan Elias <evanjelias@gmail.com>\nEyal Kapon <eyalk@jfrog.com>\nFabian Holler <fabian.holler@simplesurance.de>\nFabrice <fabrice.vaillant@student.ecp.fr>\nFatema-Moaiyadi <fatema.i.moaiyadi@gmail.com>\nFederico Di Pierro <nierro92@gmail.com>\nFelix Geisendörfer <felix@debuggable.com>\nFilippo Valsorda <hi@filippo.io>\nFlorian Forster <ff@octo.it>\nFlorian Maier <florianmaier101178@gmail.com>\nFlorian Wagner <h2floh@github.com>\nFrancesc Gil <xescugil@gmail.com>\nFrancis <hello@francismakes.com>\nFrancisco Guimarães <francisco.cpg@gmail.com>\nFrançois de Metz <francois@2metz.fr>\nFredrik Jönsson <fredrik.jonsson@izettle.com>\nGabriel <samfiragabriel@gmail.com>\nGal Ofri <galmenashofri@gmail.com>\nGarrett Squire <garrettsquire@gmail.com>\nGeorge Kontridze <george.kontridze@gmail.com>\nGeorgy Buranov <gburanov@gmail.com>\nGlen Mailer <glenjamin@gmail.com>\nGnahz <p@oath.pl>\nGoogle Inc.\nGrachev Mikhail <work@mgrachev.com>\nGregor Jasny <gjasny@googlemail.com>\nGregory Oschwald <oschwald@gmail.com>\ngriffin_stewie <panterathefamilyguy@gmail.com>\nguangwu <guoguangwu@magic-shield.com>\nGuillaume Jacquet <guillaume.jacquet@gmail.com>\nGuz Alexander <kalimatas@gmail.com>\nGuðmundur Bjarni Ólafsson <gudmundur@github.com>\nHanno Hecker <hanno.hecker@zalando.de>\nHari haran <hariharan.uno@gmail.com>\nHarikesh00 <prajapatiharikesh16@gmail.com>\nhaya14busa <haya14busa@gmail.com>\nhaya14busa <hayabusa1419@gmail.com>\nHenrik Lundström <henrik94lundstrom@gmail.com>\nHiroki Ito <hiroki.ito.dev@gmail.com>\nhnkƶ <kazuki.hanai@wan-nyan-wan.net>\nHubot Jr <rreichel3@github.com>\nHuy Tr <kingbazoka@gmail.com>\nhuydx <doxuanhuy@gmail.com>\ni2bskn <i2bskn@gmail.com>\nIain Steers <iainsteers@gmail.com>\nIehana Fu <wasuremono127@gmail.com>\nIkko Ashimine <eltociear@gmail.com>\nIlia Choly <ilia.choly@gmail.com>\nIoannis Georgoulas <igeorgoulas21@gmail.com>\nIsao Jonas <isao.jonas@gmail.com>\nishan upadhyay <ishanupadhyay412@gmail.com>\nisqua <isqua@isqua.ru>\nIvan Martos <martos.ivan@gmail.com>\nJacob Valdemar <jan@lunar.app>\nJake Krammer <jake.krammer1@gmail.com>\nJake Scaltreto <jake.scaltreto@circle.com>\nJake White <jake@jwhite.network>\nJameel Haffejee <RC1140@republiccommandos.co.za>\nJames Alseth <james@jalseth.me>\nJames Bowes <jbowes@repl.ca>\nJames Cockbain <james.cockbain@ibm.com>\nJames Loh <github@jloh.co>\nJames Maguire <jvm986@gmail.com>\nJames Turley <jamesturley1905@googlemail.com>\nJamie West <jamieianwest@hotmail.com>\nJan Guth <Jan.Guth@gmail.com>\nJan Kosecki <jan.kosecki91@gmail.com>\nJan Niklas Dittmar <jndzero2@gmail.com>\nJan Švábík <jansvabik@jansvabik.cz>\nJason Brill <jbrill95@gmail.com>\nJason Field <Jason@avon-lea.co.uk>\nJavier Campanini <jcampanini@palantir.com>\nJef LeCompte <jeffreylec@gmail.com>\nJeff Wenzbauer <jeff.wenzbauer@niceincontact.com>\nJens Rantil <jens.rantil@gmail.com>\nJeremy Morris <jeremylevanmorris@gmail.com>\nJesse Haka <haka.jesse@gmail.com>\nJesse Newland <jesse@jnewland.com>\nJihoon Chung <j.c@navercorp.com>\nJille Timmermans <jille@quis.cx>\nJimmi Dyson <jimmidyson@gmail.com>\nJiří Žižkovský <jirizizkovsky@post.cz>\nJoan Saum <joan.saum@epitech.eu>\nJoannaaKL <joannaakl@github.com>\nJoe Tsai <joetsai@digital-static.net>\nJohn Barton <jrbarton@gmail.com>\nJohn Engelman <john.r.engelman@gmail.com>\nJohn Jones <john@exthilion.org>\nJohn Liu <john.liu@mongodb.com>\nJordan Brockopp <jdbro94@gmail.com>\nJordan Burandt <jordanburandt@gmail.com>\nJordan Sussman <jordansail22@gmail.com>\nJorge Ferrero <jorgeferrerolinacero@gmail.com>\nJorge Gómez Reus <j-g1996@live.com>\nJoshua Bezaleel Abednego <joshua.bezaleel@gmail.com>\nJoshua French <jgg_63@yahoo.com>\nJoão Cerqueira <joao@cerqueira.io>\nJP Phillips <jonphill9@gmail.com>\njpbelanger-mtl <jp.belanger@gmail.com>\nJuan <juan.rios.28@gmail.com>\nJuan Basso <jrbasso@gmail.com>\nJulien Garcia Gonzalez <garciagonzalez.julien@gmail.com>\nJulien Midedji <Julien.Midedji@gmail.com>\nJulien Rostand <jrostand@users.noreply.github.com>\nJunya Kono <junya03dance@gmail.com>\nJustin Abrahms <justin@abrah.ms>\nJustin Toh <tohjustin@hotmail.com>\nJusung Lee <e.jusunglee@gmail.com>\njzhoucliqr <jzhou@cliqr.com>\nk0ral <mail@cmoreau.info>\nk1rnt <eru08tera15mora@gmail.com>\nkadern0 <kaderno@gmail.com>\nKarthik Sundari <karthiksundari2315@gmail.com>\nKatrina Owen <kytrinyx@github.com>\nKautilya Tripathi <tripathi.kautilya@gmail.com>\nKeita Urashima <ursm@ursm.jp>\nKevin Burke <kev@inburke.com>\nKevin Wang <kwangsan@gmail.com>\nKevin Zhao <kzhao@lyft.com>\nkgalli <mail@kgalli.de>\nKhanh Ngo <k@ndk.name>\nKirill <g4s8.public@gmail.com>\nKonrad Malawski <konrad.malawski@project13.pl>\nKookheon Kwon <kucuny@gmail.com>\nKrishna Indani <indanikrishna@gmail.com>\nKrzysztof Kowalczyk <kkowalczyk@gmail.com>\nKshitij Saraogi <KshitijSaraogi@gmail.com>\nKumar Saurabh <itsksaurabh@gmail.com>\nKyle Kurz <kyle@doublekaudio.com>\nkyokomi <kyoko1220adword@gmail.com>\nLachlan Cooper <lachlancooper@gmail.com>\nLars Lehtonen <lars.lehtonen@gmail.com>\nLaurent Verdoïa <verdoialaurent@gmail.com>\nLeonard Sheng Sheng Lee <leonard.sheng.sheng.lee@gmail.com>\nleopoldwang <leopold.wang@gmail.com>\nLiam Galvin <liam@liam-galvin.co.uk>\nLiam Stanley <liam@liam.sh>\nLluis Campos <lluis.campos@northern.tech>\nLovro Mažgon <lovro.mazgon@gmail.com>\nLoïs Postula <lois@postu.la>\nLuca Campese <me@campesel.net>\nLucas Alcantara <lucasalcantaraf@gmail.com>\nLucas Martin-King <lmartinking@gmail.com>\nLuis Davim <luis.davim@sendoso.com>\nLuke Evers <me@lukevers.com>\nLuke Hinds <luke@stacklok.com>\nLuke Kysow <lkysow@gmail.com>\nLuke Roberts <email@luke-roberts.co.uk>\nLuke Young <luke@hydrantlabs.org>\nlynn [they] <lynncyrin@gmail.com>\nLéo Salé <leo.sale@datadoghq.com>\nM. Ryan Rigdon <mr.rigdon@gmail.com>\nMagnus Kulke <mkulke@gmail.com>\nMaksim Zhylinski <uzzable@gmail.com>\nManas Sivakumar <manas23601@gmail.com>\nManav Sharma <manav.acno1@gmail.com>\nManuel Bergler <manue1@github.com>\nMarc Binder <marcandrebinder@gmail.com>\nMarcelo Carlos <marcelo@permutive.com>\nMark Tareshawty <tarebyte@github.com>\nMartin Holman <me@martinholman.co.nz>\nMartin-Louis Bright <mlbright@gmail.com>\nMartins Sipenko <martins.sipenko@gmail.com>\nMarwan Sulaiman <marwan.sameer@gmail.com>\nMasayuki Izumi <m@izum.in>\nMat Geist <matgeist@gmail.com>\nMatheus Santos Araújo <wenked.matheus@yahoo.com.br>\nMathewClegg <mathew.clegg@live.se>\nMathieu Sévégny <mathieu.sevegny@goto.com>\nMatija Horvat <horvat2112@gmail.com>\nMatin Rahmanian <itsmatinx@gmail.com>\nMatt <alpmatthew@gmail.com>\nMatt Brender <mjbrender@gmail.com>\nMatt Dainty <matt@bodgit-n-scarper.com>\nMatt Gaunt <matt@gauntface.co.uk>\nMatt Landis <landis.matt@gmail.com>\nMatt Mencel <matt@techminer.net>\nMatt Moore <mattmoor@vmware.com>\nMatt Simons <mattsimons@ntlworld.com>\nMatthew Reidy <matthewreidy5@gmail.com>\nMaxime Bury <maxime.bury@gmail.com>\nMichael Meng <mmeng@lyft.com>\nMichael Recachinas <mrecachinas@github.com>\nMichael Spiegel <michael.m.spiegel@gmail.com>\nMichael Tiller <michael.tiller@gmail.com>\nMichał Glapa <michal.glapa@gmail.com>\nMichelangelo Morrillo <michelangelo@morrillo.it>\nMiguel Elias dos Santos <migueleliasweb@gmail.com>\nMike Ball <mikedball@gmail.com>\nMike Chen <mchen300@gmail.com>\nMiles Crabill <miles@milescrabill.com>\nMishin Nikolai <sanduku.default@gmail.com>\nMohamad Al-Zawahreh <merchantmoh@gmail.com>\nmohammad ali <2018cs92@student.uet.edu.pk>\nMohammed AlDujaili <avainer11@gmail.com>\nMohammed Nafees <hello@mnafees.me>\nMudit <zeusdeux@gmail.com>\nMukundan Senthil <mukundan314@gmail.com>\nMunia Balayil <munia.247@gmail.com>\nMustafa Abban <mustafaabban@utexas.edu>\nNadav Kaner <nadavkaner1@gmail.com>\nNaoki Kanatani <k12naoki@gmail.com>\nNathan VanBenschoten <nvanbenschoten@gmail.com>\nNavaneeth Suresh <navaneeths1998@gmail.com>\nNayeem Hasan <nayeemhasan.nh01@gmail.com>\nNeal Caffery <neal1991@sina.com>\nNeil O'Toole <neilotoole@apache.org>\nNicholas Herring <oss@hakshak.com>\nNick Miyake <nmiyake@palantir.com>\nNick Platt <hello@nickplatt.co.uk>\nNick Spragg <nick.spragg@bbc.co.uk>\nNicolas Chapurlat <nc@coorganix.com>\nNikhita Raghunath <nikitaraghunath@gmail.com>\nNikita Pivkin <nikita.pivkin@smartforce.io>\nNilesh Singh <nilesh.singh24@outlook.com>\nNoah Hanjun Lee <noah.lee@buzzvil.com>\nNoah Zoschke <noah+sso2@convox.com>\nNoble Varghese <noblekvarghese96@gmail.com>\nns-cweber <cweber@narrativescience.com>\nnxya <nathacutlan@gmail.com>\nOle Orhagen <ole.orhagen@northern.tech>\nOleg Kovalov <iamolegkovalov@gmail.com>\nOleksandr Redko <oleksandr.red+github@gmail.com>\nOndřej Kupka <ondra.cap@gmail.com>\nOri Talmor <talmorori@gmail.com>\nOsama Faqhruldin <onfaqhru@gmail.com>\noslowalk <den.cs@pm.me>\nPablo Pérez Schröder <pablo.perezschroder@wetransfer.com>\nPalash Nigam <npalash25@gmail.com>\nPanagiotis Moustafellos <pmoust@gmail.com>\nParham Alvani <parham.alvani@gmail.com>\npari-27 <sonamajumdar2012@gmail.com>\nParker Moore <parkrmoore@gmail.com>\nparkhyukjun89 <park.hyukjun89@gmail.com>\nPat Alwell <pat.alwell@gmail.com>\nPatrick DeVivo <patrick.devivo@gmail.com>\nPatrick Marabeas <patrick@marabeas.io>\nPatrik Nordlén <patriki@gmail.com>\nPavel Dvoinos <pavel.dvoinos@transferwise.com>\nPavel Shtanko <pavel.shtanko@gmail.com>\nPavlos Tzianos <pavlos.tzianos@gmail.com>\nPedja Muatovic <pmuratov@raptive.com>\nPete Wagner <thepwagner@github.com>\nPetr Shevtsov <petr.shevtsov@gmail.com>\nPierce McEntagart <pierce@nightfall.ai>\nPierre Carrier <pierre@meteor.com>\nPiotr Zurek <p.zurek@gmail.com>\nPiyush Chugh <piyushchugh1993@gmail.com>\nPj Meyer <peej.meyer@gmail.com>\nPratik Mallya <pratik.mallya@gmail.com>\nQais Patankar <qaisjp@gmail.com>\nQuang Le Hong <iamquang95@gmail.com>\nQuentin Leffray <fiahil@gmail.com>\nQuinn Slack <qslack@qslack.com>\nRackspace US, Inc.\nRadek Simko <radek.simko@gmail.com>\nRadliński Ignacy <radlinsk@student.agh.edu.pl>\nRafael Aramizu Gomes <rafael.aramizu@mercadolivre.com>\nRaisa Kabir <raisa.kabir2010@gmail.com>\nRajat Jindal <rajatjindal83@gmail.com>\nRajendra arora <rajendraarora16@yahoo.com>\nRajkumar <princegosavi12@gmail.com>\nRamesh Gaikwad <rameshgkwd05@gmail.com>\nRanbir Singh <binkkatal.r@gmail.com>\nRavi Shekhar Jethani <rsjethani@gmail.com>\nRaviTeja Pothana <ravi-teja@live.com>\nrc1140 <jameel@republiccommandos.co.za>\nRed Hat, Inc.\nReetuparna Mukherjee <reetuparna.1988@gmail.com>\nreeves122 <reeves122@gmail.com>\nReinier Timmer <reinier.timmer@ah.nl>\nRenjith R <renjithr201097@gmail.com>\nRez Moss <hi@rezmoss.com>\nRiaje <francois@mbfr.fr>\nRicco Førgaard <ricco@fiskeben.dk>\nRichard de Vries <richard.de.vries@topicus.nl>\nRob Figueiredo <robfig@yext.com>\nRoger Peppe <rogpeppe@gmail.com>\nRohit Upadhyay <urohit011@gmail.com>\nRojan Dinc <rojand94@gmail.com>\nRoman Wu <me@romanwu.com>\nRoming22 <roming22@gmail.com>\nRonak Jain <ronakjain@outlook.in>\nRonan Pelliard <ronan.pelliard@datadoghq.com>\nRoss Gustafson <srgustafson8@icloud.com>\nRuben Vereecken <rubenvereecken@gmail.com>\nRufina Talalaeva <rufusnorbert14@gmail.com>\nRupok Ghosh <rupokghosh291@gmail.com>\nRussell Boley <raboley@gmail.com>\nRyan Leung <rleungx@gmail.com>\nRyan Lower <rpjlower@gmail.com>\nRyan Skidmore <github@ryanskidmore.co.uk>\nRyo Nakao <nakabonne@gmail.com>\nSaaarah <sarah.liusy@gmail.com>\nSafwan Olaimat <safwan.olaimat@gmail.com>\nSahil Dua <sahildua2305@gmail.com>\nSai Ravi Teja Chintakrindi <srt2712@gmail.com>\nsaisi <saisi@users.noreply.github.com>\nSam Minnée <sam@silverstripe.com>\nSandeep Sukhani <sandeep.d.sukhani@gmail.com>\nSander Knape <s.knape88@gmail.com>\nSander van Harmelen <svanharmelen@schubergphilis.com>\nsanjay s <sanjayygowdaa03@gmail.com>\nSanket Payghan <sanket.payghan8@gmail.com>\nSarah Funkhouser <sarah.k.funkhouser@gmail.com>\nSarasa Kisaragi <lingsamuelgrace@gmail.com>\nSasha Melentyev <sasha@melentyev.io>\nScott Dawson <scott@daw.sn>\nSean Wang <sean@decrypted.org>\nSebastian Mandrean <sebastian.mandrean@gmail.com>\nSebastian Mæland Pedersen <sem.pedersen@stud.uis.no>\nsellskin <mydesk@yeah.net>\nSergei Popinevskii <gurza000@gmail.com>\nSergey Romanov <xxsmotur@gmail.com>\nSergio Garcia <sergio.garcia@gmail.com>\nSeth Vargo <seth@sethvargo.com>\nSevki <s@sevki.org>\nShagun Khemka <shagun.khemka60@gmail.com>\nshakeelrao <shakeelrao79@gmail.com>\nShawn Catanzarite <me@shawncatz.com>\nShawn Smith <shawnpsmith@gmail.com>\nShibasis Patel <patelshibasis@gmail.com>\nSho Okada <shokada3@gmail.com>\nShrikrishna Singh <krishnasingh.ss30@gmail.com>\nSilas Alberti <alberti@cs.stanford.edu>\nSimon Davis <sdavis@hashicorp.com>\nsona-tar <sona.zip@gmail.com>\nsoniachikh <sonia.chikh@gmail.com>\nSoundCloud, Ltd.\nSridhar Mocherla <srmocher@microsoft.com>\nSriVignessh Pss <sriknowledge@gmail.com>\nStefan Sedich <stefan.sedich@gmail.com>\nSteve Hipwell <steve.hipwell@gmail.com>\nSteve Teuber <github@steveteuber.com>\nStian Eikeland <stian@eikeland.se>\nSuhaib Mujahid <suhaibmujahid@gmail.com>\nsushmita wable <sw09007@gmail.com>\nSven Palberg <oss@palberg.de>\nSzymon Kodrebski <simonkey007@gmail.com>\nSøren Hansen <soren@dinero.dk>\nT.J. Corrigan <tjcorr@github.com>\nTakashi Yoneuchi <takashi.yoneuchi@shift-js.info>\nTakayuki Watanabe <takanabe.w@gmail.com>\nTaketoshi Fujiwara <fujiwara@leapmind.io>\nTaketoshi Fujiwara <taketoshi.fujiwara@gmail.com>\nTakuma Kajikawa <kj1ktk@gmail.com>\nTasya Aditya Rukmana <tadityar@gmail.com>\nTheo Henson <theodorehenson@protonmail.com>\nTheofilos Petsios <theofilos.pe@gmail.com>\nThomas Aidan Curran <thomas@ory.sh>\nThomas Bruyelle <thomas.bruyelle@gmail.com>\nTim <sinnerpocht@gmail.com>\nTim Rogers <timrogers@github.com>\nTimothy O'Brien <obrien.timothy.a@gmail.com>\nTimothée Peignier <timothee.peignier@tryphon.org>\nTingluo Huang <tingluohuang@github.com>\ntkhandel <tarunkhandelwal.iitr@gmail.com>\nTobias Gesellchen <tobias@gesellix.de>\nTom Bamford <tom@bamford.io>\nTom Payne <twpayne@gmail.com>\nTomasz Adam Skrzypczak <tomasz.adam.skrzypczak@protonmail.com>\ntomfeigin <tom.feigin@gmail.com>\nTravis Tomsu <travis.tomsu@gmail.com>\nTrey Tacon <ttacon@gmail.com>\ntsbkw <tsbkw0@gmail.com>\nttacon <ttacon@gmail.com>\nVaibhav Singh <vaibhav.singh.14cse@bml.edu.in>\nVaradarajan Aravamudhan <varadaraajan@gmail.com>\nVictor Castell <victor@victorcastell.com>\nVictor Vrantchan <vrancean+github@gmail.com>\nVictory Osikwemhe <osikwemhev@gmail.com>\nvikkyomkar <vikky.omkar@samsung.com>\nVille Skyttä <ville.skytta@iki.fi>\nVivek <y.vivekanand@gmail.com>\nVivek Kumar Sahu <vivekkumarsahu650@gmail.com>\nVlad Ungureanu <vladu@palantir.com>\nWasim Thabraze <wasim@thabraze.me>\nWeslei Juan Moser Pereira <wesleimsr@gmail.com>\nWheeler Law <wheeler.law@outlook.com>\nWill Maier <wcmaier@gmail.com>\nWill Norris <will@tailscale.com>\nWillem D'Haeseleer <dhwillem@gmail.com>\nWilliam Bailey <mail@williambailey.org.uk>\nWilliam Cooke <pipeston@gmail.com>\nXabi <xmartinez1702@gmail.com>\nxibz <impactbchang@gmail.com>\nYann Malet <yann.malet@gmail.com>\nYannick Utard <yannickutard@gmail.com>\nYarden Shoham <git@yardenshoham.com>\nYicheng Qin <qycqycqycqycqyc@gmail.com>\nYosuke Akatsuka <yosuke.akatsuka@access-company.com>\nYumikiyo Osanai <yumios.art@gmail.com>\nYurii Soldak <ysoldak@gmail.com>\nYusef Mohamadi <yuseferi@gmail.com>\nYusuke Kuoka <ykuoka@gmail.com>\nYuto Kimura <biosugar0@gmail.com>\nZach Latta <zach@zachlatta.com>\nZe Peng <zehui.peng@circle.com>\nzhouhaibing089 <zhouhaibing089@gmail.com>\nzyfy29 <wasuremono127@gmail.com>\n六开箱 <lkxed@outlook.com>\n缘生 <i@ysicing.me>\n蒋航 <hang.jiang@daocloud.io>\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# How to contribute\n\nWe'd love to accept your patches and contributions to this project.\nThere are just a few small guidelines you need to follow.\n\n## Contributor License Agreement\n\nContributions to any Google project must be accompanied by a Contributor\nLicense Agreement. This is not a copyright **assignment**, it simply gives\nGoogle permission to use and redistribute your contributions as part of the\nproject. Head over to <https://cla.developers.google.com/> to see your current\nagreements on file or to sign a new one.\n\nYou generally only need to submit a CLA once, so if you've already submitted one\n(even if it was for a different project), you probably don't need to do it\nagain.\n\n## Reporting issues\n\nBugs, feature requests, and development-related questions should be directed to\nour [GitHub issue tracker](https://github.com/google/go-github/issues).  If\nreporting a bug, please try and provide as much context as possible such as\nyour operating system, Go version, and anything else that might be relevant to\nthe bug.  For feature requests, please explain what you're trying to do, and\nhow the requested feature would help you do that.\n\nSecurity related bugs can either be reported in the issue tracker, or if they\nare more sensitive, emailed to <opensource@google.com>.\n\n## Reviewing PRs\n\nIn addition to writing code, community projects also require community\ncontributions in other ways; one of these is reviewing code contributions. If\nyou are willing to review PRs please open a PR to add your GitHub username to\nthe [REVIEWERS](./REVIEWERS) file. By adding your GitHub username to the list\nof reviewers you are giving contributors permission to request a review for a\nPR that has already been approved by a maintainer. If you are asked to review a\nPR and either do not have the time or do not think you are able to you should\nfeel comfortable politely saying no.\n\nIf at any time you would like to remove your permission to be contacted for a\nreview you can open a PR to remove your name from the [REVIEWERS](./REVIEWERS)\nfile.\n\n## Submitting a patch\n\n1. It's generally best to start by opening a new issue describing the bug or\n   feature you're intending to fix. Even if you think it's relatively minor,\n   it's helpful to know what people are working on. Mention in the initial issue\n   that you are planning to work on that bug or feature so that it can be\n   assigned to you.\n\n2. Follow the normal process of [forking][] the project, and set up a new branch\n   to work in. It's important that each group of changes be done in separate\n   branches in order to ensure that a pull request only includes the commits\n   related to that bug or feature.\n\n3. Any significant changes should almost always be accompanied by tests. The\n   project already has good test coverage, so look at some of the existing tests\n   if you're unsure how to go about it. Coverage is [monitored by codecov.io][],\n   which flags pull requests that decrease test coverage. This doesn't\n   necessarily mean that PRs with decreased coverage won't be merged. Sometimes\n   a decrease in coverage makes sense, but if your PR is flagged, you should\n   either add tests to cover those lines or add a PR comment explaining the\n   untested lines.\n\n4. Run `script/fmt.sh`, `script/test.sh` and `script/lint.sh` to format your code and\n   check that it passes all tests and linters. `script/lint.sh` may also tell you\n   that generated files need to be updated. If so, run `script/generate.sh` to\n   update them.\n\n5. Do your best to have [well-formed commit messages][] for each change. This\n   provides consistency throughout the project, and ensures that commit messages\n   are able to be formatted properly by various git tools. See next section for\n   more details.\n\n6. Finally, push the commits to your fork and submit a [pull request][].\n   **NOTE:** Please do not use force-push on PRs in this repo, as it makes it\n   more difficult for reviewers to see what has changed since the last code\n   review. We always perform \"squash and merge\" actions on PRs in this repo, so it doesn't\n   matter how many commits your PR has, as they will end up being a single commit after merging.\n   This is done to make a much cleaner `git log` history and helps to find regressions in the code\n   using existing tools such as `git bisect`.\n\n   - If your PR needs additional reviews you can request one of the\n     [REVIEWERS][] takes a look by mentioning them in a PR comment.\n\n[forking]: https://help.github.com/articles/fork-a-repo\n[well-formed commit messages]: https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html\n[pull request]: https://help.github.com/articles/creating-a-pull-request\n[monitored by codecov.io]: https://codecov.io/gh/google/go-github\n[REVIEWERS]: ./REVIEWERS\n\n### Use proper commit messages and PR titles\n\nEffective Git commit messages and subject lines hold immense significance in comprehending alterations and enhancing the code's maintainability.\n\nAlways commit the changes to your fork and push them to the corresponding original repo by sending a Pull Request (PR). Follow the best practices for writing commit messages/PR titles.\n\n1. Limit the subject line to 50 characters\n2. Capitalize the subject line\n3. Do not end the subject line with a period\n4. Use the imperative mood in the subject line. A properly formed Git commit subject line should always be able to complete the following sentence:\n   If applied, this commit will `<your subject line here>`\n\n(This above advice can be found all over the internet, but was copied from [here](https://learn-ballerina.github.io/best_practices/use_proper_titles.html).)\n\n5. You may optionally prefix the PR title with the type of PR it is, in lower case,\n   followed by a colon. For example, `feat:`, `chore:`, `fix:`, `docs:`, etc.\n   For breaking API changes, add an exclamation point.\n   For example, `feat!:`, `chore!:`, `fix!:`, etc.\n\n### Windows users\n\nUse Git Bash as a terminal or WSL instead of PowerShell.\n\nTo avoid [issues][] with a few linters and formatters within golangci-lint,\nmake sure you check out files only with LF endings:\n\n```sh\ngit config core.autocrlf false\ngit config core.eol lf\n```\n\nTo convert an existing cloned repo from CRLF to LF, use the following commands:\n\n```sh\ngit config core.autocrlf false\ngit rm --cached -r .\ngit reset --hard HEAD\n```\n\n[issues]: https://github.com/golangci/golangci-lint/discussions/5840\n\n## Tips\n\nAlthough we have not (yet) banned AI-driven contributions to this repo (as many\nother open source projects have), we encourage you to read and honor the following\ntips (which are frequently ignored by AI-driven PRs):\n\n* Always review your own PRs using the same user interface that your actual\n  reviewers will be using with a critical eye, attempting to anticipate what your\n  reviewers will call out, _before_ asking anyone to review your PR.\n* Come up with a short and appropriate PR title.\n* Come up with a short, well-written, and appropriate PR description (we don't\n  need hundreds of lines of text here - keep it short and to-the-point so a\n  reviewer can _quickly_ determine what the PR is all about).\n* If a PR involves bug fixes, it should certainly include a unit test (or tests)\n  that demonstrates the bug - without the PR changes, the new unit test would\n  fail, but with the included PR changes, the new test(s) pass.\n* When possible, try to make smaller, focused PRs (which are easier to review\n  and easier for others to understand).\n\n## Code Comments\n\nEvery exported method and type needs to have code comments that follow\n[Go Doc Comments][]. A typical method's comments will look like this:\n\n```go\n// Get fetches a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#get-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}\nfunc (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Repository, *Response, error) {\n    u := fmt.Sprintf(\"repos/%v/%v\", owner, repo)\n    req, err := s.client.NewRequest(\"GET\", u, nil)\n    ...\n}\n```\nAnd the returned type `Repository` will have comments like this:\n\n```go\n// Repository represents a GitHub repository.\ntype Repository struct {\n    ID     *int64  `json:\"id,omitempty\"`\n    NodeID *string `json:\"node_id,omitempty\"`\n    Owner  *User   `json:\"owner,omitempty\"`\n    ...\n}\n```\n\nThe first line is the name of the method followed by a short description. This\ncould also be a longer description if needed, but there is no need to repeat any\ndetails that are documented in GitHub's documentation because users are expected\nto follow the documentation links to learn more.\n\nAfter the description comes a link to the GitHub API documentation. This is\nadded or fixed automatically when you run `script/generate.sh`, so you won't\nneed to set this yourself.\n\nFinally, the `//meta:operation` comment is a directive to the code generator\nthat maps the method to the corresponding OpenAPI operation. Once again, there\ncan be multiple directives for methods that call multiple\nendpoints. `script/generate.sh` will normalize these directives for you, so if\nyou are adding a new method you can use the pattern from the `u := fmt.Sprintf`\nline instead of looking up what the url parameters are called in the OpenAPI\ndescription.\n\n[Go Doc Comments]: https://go.dev/doc/comment\n\n## Metadata\n\nGitHub publishes [OpenAPI descriptions of their API][]. We use these\ndescriptions to keep documentation links up to date and to keep track of which\nmethods call which endpoints via the `//meta:operation` comments described\nabove. GitHub's descriptions are far too large to keep in this repository or to\npull down every time we generate code, so we keep only the metadata we need\nin `openapi_operations.yaml`.\n\n### openapi_operations.yaml\n\nMost contributors won't need to interact with `openapi_operations.yaml`, but it\nmay be useful to know what it is. Its sections are:\n\n- `openapi_operations` - is the metadata that comes from GitHub's OpenAPI\n  descriptions. It is generated by `script/metadata.sh update-openapi` and\n  should not be edited by hand. In the rare case where it needs to be\n  overridden, use the `operation_overrides` section instead.\n\n  An operation consists of `name`, `documentation_url`,\n  and `openapi_files`. `openapi_files` is the list of files where the operation\n  is described. In order or preference, values can be \"api.github.com.json\" for\n  operations available on the free plan, \"ghec.json\" for operations available on\n  GitHub Enterprise Cloud or \"ghes-<version>.json\" for operations available on\n  GitHub Enterprise Server. When an operation is described in multiple ghes\n  files, only the most recent version is included. `documentation_url` is the\n  URL that should be linked from godoc. It is the documentation link found in\n  the first file listed in `openapi_files`.\n\n- `openapi_commit` - is the git commit that `script/metadata.sh update-openapi`\n  saw when it last updated `openapi_operations`. It is not necessarily the most\n  recent commit seen because `update-openapi` doesn't update the file when\n  there are no changes to `openapi_operations`.\n\n- `operations` - contains manually added metadata that is not in GitHub's\n  OpenAPI descriptions. There are only a few of these. Some have\n  documentation_urls that point to relevant GitHub documentation that is not in\n  the OpenAPI descriptions. Others have no documentation_url and result in a\n  note in the generated code that the documentation is missing.\n\n- `operation_overrides` - is where we override the documentation_url for\n  operations where the link in the OpenAPI descriptions is wrong.\n\nPlease note that if your PR unit tests are failing due to an out-of-date\n`openapi_operations.yaml` file, simply ask the maintainer(s) of this repo\nto update it for you so that your PR doesn't need to include changes\nto this auto-generated file.\n\n### tools/metadata\n\nThe `tools/metadata` package is a command-line tool for working with metadata.\nIn a typical workflow, you won't use it directly, but you will use it indirectly\nthrough `script/generate.sh` and `script/lint.sh`.\n\nIts subcommands are:\n\n- `update-openapi` - updates `openapi_operations.yaml` with the latest\n  information from GitHub's OpenAPI descriptions. With `--validate` it will\n  validate that the descriptions are correct as of the commit\n  in `openapi_commit`. `update-openapi --validate` is called\n  by `script/lint.sh`.\n\n- `update-go` - updates Go files with documentation URLs and formats comments.\n  It is used by `script/generate.sh`.\n\n- `format` - formats white space in `openapi_operations.yaml` and sorts its\n  arrays. It is used by `script/fmt.sh`.\n\n- `unused` - lists operations from `openapi_operations.yaml` that are not mapped\n  from any methods.\n\n[OpenAPI descriptions of their API]: https://github.com/github/rest-api-description\n\n## Scripts\n\nThe `script` directory has shell scripts that help with common development\ntasks.\n\n**script/fmt.sh** formats all Go code in the repository.\n\n**script/generate.sh** runs code generators and `go mod tidy` on all modules. With\n`--check` it checks that the generated files are current.\n\n**script/lint.sh** runs linters on the project and checks generated files are\ncurrent.\n\n**script/metadata.sh** runs `tools/metadata`. See the [Metadata](#metadata)\nsection for more information.\n\n**script/test.sh** runs tests on all modules.\n\n## Other notes on code organization\n\nCurrently, everything is defined in the main `github` package, with API methods\nbroken into separate service objects. These services map directly to how\nthe [GitHub API documentation][] is organized, so use that as your guide for\nwhere to put new methods.\n\nCode is organized in files also based pretty closely on the GitHub API\ndocumentation, following the format `{service}_{api}.go`. For example, methods\ndefined at <https://docs.github.com/en/rest/webhooks/repos> live in\n[repos_hooks.go][].\n\n[GitHub API documentation]: https://docs.github.com/en/rest\n[repos_hooks.go]: https://github.com/google/go-github/blob/master/github/repos_hooks.go\n\n## Maintainer's Guide\n\n(These notes are mostly only for people merging in pull requests.)\n\n**Verify CLAs.** CLAs must be on file for the pull request submitter and commit\nauthor(s). Google's CLA verification system should handle this automatically\nand will set commit statuses as appropriate. If there's ever any question about\na pull request, ask [willnorris](https://github.com/willnorris).\n\n**Always try to maintain a clean, linear git history.** With very few\nexceptions, running `git log` should not show a bunch of branching and merging.\n\nNever use the GitHub \"merge\" button, since it always creates a merge commit.\nInstead, check out the pull request locally ([these git aliases\nhelp][git-aliases]), then cherry-pick or rebase them onto master. If there are\nsmall cleanup commits, especially as a result of addressing code review\ncomments, these should almost always be squashed down to a single commit. Don't\nbother squashing commits that really deserve to be separate though. If needed,\nfeel free to amend additional small changes to the code or commit message that\naren't worth going through code review for.\n\nIf you made any changes like squashing commits, rebasing onto master, etc, then\nGitHub won't recognize that this is the same commit in order to mark the pull\nrequest as \"merged\". So instead, amend the commit message to include a line\n\"Fixes #0\", referencing the pull request number. This would be in addition to\nany other \"Fixes\" lines for closing related issues. If you forget to do this,\nyou can also leave a comment on the pull request [like this][rebase-comment].\nIf you made any other changes, it's worth noting that as well, [like\nthis][modified-comment].\n\n[git-aliases]: https://github.com/willnorris/dotfiles/blob/d640d010c23b1116bdb3d4dc12088ed26120d87d/git/.gitconfig#L13-L15\n[rebase-comment]: https://github.com/google/go-github/pull/277#issuecomment-183035491\n[modified-comment]: https://github.com/google/go-github/pull/280#issuecomment-184859046\n\n**When creating a release, don't forget to update the `Version` constant in `github.go`.** This is used to\nsend the version in the `User-Agent` header to identify clients to the GitHub API.\n"
  },
  {
    "path": "LICENSE",
    "content": "Copyright (c) 2013 The go-github AUTHORS. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n   * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n   * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "README.md",
    "content": "# go-github #\n\n[![go-github release (latest SemVer)](https://img.shields.io/github/v/release/google/go-github?sort=semver)](https://github.com/google/go-github/releases)\n[![Go Reference](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/google/go-github/v84/github)\n[![Test Status](https://github.com/google/go-github/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/google/go-github/actions/workflows/tests.yml)\n[![Test Coverage](https://codecov.io/gh/google/go-github/branch/master/graph/badge.svg)](https://codecov.io/gh/google/go-github)\n[![Discuss at go-github@googlegroups.com](https://img.shields.io/badge/discuss-go--github%40googlegroups.com-blue.svg)](https://groups.google.com/group/go-github)\n[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/796/badge)](https://bestpractices.coreinfrastructure.org/projects/796)\n\ngo-github is a Go client library for accessing the [GitHub API v3][].\n\ngo-github tracks [Go's version support policy][support-policy] supporting any\nminor version of the latest two major releases of Go and the go directive in\ngo.mod reflects that.\nWe do our best not to break older versions of Go if we don't have to, but we\ndon't explicitly test older versions and as of Go 1.23 the go directive in\ngo.mod declares a hard required _minimum_ version of Go to use with this module\nand this _must_ be greater than or equal to the go line of all dependencies so\ngo-github will require the N-1 major release of Go by default.\n\n[support-policy]: https://golang.org/doc/devel/release.html#policy\n\n## Development\n\nIf you're interested in using the [GraphQL API v4][], the recommended library is\n[shurcooL/githubv4][].\n\n## Installation ##\n\ngo-github is compatible with modern Go releases in module mode, with Go installed:\n\n```bash\ngo get github.com/google/go-github/v84\n```\n\nwill resolve and add the package to the current development module, along with its dependencies.\n\nAlternatively the same can be achieved if you use import in a package:\n\n```go\nimport \"github.com/google/go-github/v84/github\"\n```\n\nand run `go get` without parameters.\n\nFinally, to use the top-of-trunk version of this repo, use the following command:\n\n```bash\ngo get github.com/google/go-github/v84@master\n```\n\nTo discover all the changes that have occurred since a prior release, you can\nfirst clone the repo, then run (for example):\n\n```bash\ngo run tools/gen-release-notes/main.go --tag v84.0.0\n```\n\n## Usage ##\n\n```go\nimport \"github.com/google/go-github/v84/github\"\n```\n\nConstruct a new GitHub client, then use the various services on the client to\naccess different parts of the GitHub API. For example:\n\n```go\nclient := github.NewClient(nil)\n\n// list all organizations for user \"willnorris\"\norgs, _, err := client.Organizations.List(context.Background(), \"willnorris\", nil)\n```\n\nSome API methods have optional parameters that can be passed. For example:\n\n```go\nclient := github.NewClient(nil)\n\n// list public repositories for org \"github\"\nopt := &github.RepositoryListByOrgOptions{Type: \"public\"}\nrepos, _, err := client.Repositories.ListByOrg(context.Background(), \"github\", opt)\n```\n\nThe services of a client divide the API into logical chunks and correspond to\nthe structure of the [GitHub API documentation](https://docs.github.com/en/rest).\n\nNOTE: Using the [context](https://pkg.go.dev/context) package, one can easily\npass cancellation signals and deadlines to various services of the client for\nhandling a request. In case there is no context available, then `context.Background()`\ncan be used as a starting point.\n\nFor more sample code snippets, head over to the\n[example](https://github.com/google/go-github/tree/master/example) directory.\n\n### Authentication ###\n\nUse the `WithAuthToken` method to configure your client to authenticate using an\nOAuth token (for example, a [personal access token][]). This is what is needed\nfor a majority of use cases aside from GitHub Apps.\n\n```go\nclient := github.NewClient(nil).WithAuthToken(\"... your access token ...\")\n```\n\nNote that when using an authenticated Client, all calls made by the client will\ninclude the specified OAuth token. Therefore, authenticated clients should\nalmost never be shared between different users.\n\nFor API methods that require HTTP Basic Authentication, use the\n[`BasicAuthTransport`](https://pkg.go.dev/github.com/google/go-github/v84/github#BasicAuthTransport).\n\n#### As a GitHub App ####\n\nGitHub Apps authentication can be provided by different pkgs like [bradleyfalzon/ghinstallation](https://github.com/bradleyfalzon/ghinstallation)\nor [jferrl/go-githubauth](https://github.com/jferrl/go-githubauth).\n\n> **Note**: Most endpoints (ex. [`GET /rate_limit`]) require access token authentication\n> while a few others (ex. [`GET /app/hook/deliveries`]) require [JWT] authentication.\n\n[`GET /rate_limit`]: https://docs.github.com/en/rest/rate-limit#get-rate-limit-status-for-the-authenticated-user\n[`GET /app/hook/deliveries`]: https://docs.github.com/en/rest/apps/webhooks#list-deliveries-for-an-app-webhook\n[JWT]: https://docs.github.com/en/developers/apps/building-github-apps/authenticating-with-github-apps#authenticating-as-a-github-app\n\n`ghinstallation` provides `Transport`, which implements `http.RoundTripper` to provide authentication as an installation for GitHub Apps.\n\nHere is an example of how to authenticate as a GitHub App using the `ghinstallation` package:\n\n```go\nimport (\n\t\"net/http\"\n\n\t\"github.com/bradleyfalzon/ghinstallation/v2\"\n\t\"github.com/google/go-github/v84/github\"\n)\n\nfunc main() {\n\t// Wrap the shared transport for use with the integration ID 1 authenticating with installation ID 99.\n\titr, err := ghinstallation.NewKeyFromFile(http.DefaultTransport, 1, 99, \"2016-10-19.private-key.pem\")\n\n\t// Or for endpoints that require JWT authentication\n\t// itr, err := ghinstallation.NewAppsTransportKeyFromFile(http.DefaultTransport, 1, \"2016-10-19.private-key.pem\")\n\n\tif err != nil {\n\t\t// Handle error.\n\t}\n\n\t// Use installation transport with client.\n\tclient := github.NewClient(&http.Client{Transport: itr})\n\n\t// Use client...\n}\n```\n\n`go-githubauth` implements a set of `oauth2.TokenSource` to be used with `oauth2.Client`. An `oauth2.Client` can be injected into the `github.Client` to authenticate requests.\n\nAnother example using `go-githubauth`:\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\n\t\"github.com/google/go-github/v84/github\"\n\t\"github.com/jferrl/go-githubauth\"\n\t\"golang.org/x/oauth2\"\n)\n\nfunc main() {\n\tprivateKey := []byte(os.Getenv(\"GITHUB_APP_PRIVATE_KEY\"))\n\n\tappTokenSource, err := githubauth.NewApplicationTokenSource(1112, privateKey)\n\tif err != nil {\n\t\tfmt.Println(\"Error creating application token source:\", err)\n\t\treturn\n\t }\n\n\tinstallationTokenSource := githubauth.NewInstallationTokenSource(1113, appTokenSource)\n\n\t// oauth2.NewClient uses oauth2.ReuseTokenSource to reuse the token until it expires.\n\t// The token will be automatically refreshed when it expires.\n\t// InstallationTokenSource has the mechanism to refresh the token when it expires.\n\thttpClient := oauth2.NewClient(context.Background(), installationTokenSource)\n\n\tclient := github.NewClient(httpClient)\n}\n```\n\n*Note*: In order to interact with certain APIs, for example writing a file to a repo, one must generate an installation token\nusing the installation ID of the GitHub app and authenticate with the OAuth method mentioned above. See the examples.\n\n### Rate Limiting ###\n\nGitHub imposes rate limits on all API clients. The [primary rate limit](https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-primary-rate-limits)\nis the limit to the number of REST API requests that a client can make within a\nspecific amount of time. This limit helps prevent abuse and denial-of-service\nattacks, and ensures that the API remains available for all users. Some\nendpoints, like the search endpoints, have more restrictive limits.\nUnauthenticated clients may request public data but have a low rate limit,\nwhile authenticated clients have rate limits based on the client\nidentity.\n\nIn addition to primary rate limits, GitHub enforces [secondary rate limits](https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)\nin order to prevent abuse and keep the API available for all users.\nSecondary rate limits generally limit the number of concurrent requests that a\nclient can make.\n\nThe client returned `Response.Rate` value contains the rate limit information\nfrom the most recent API call. If a recent enough response isn't\navailable, you can use the client `RateLimits` service to fetch the most\nup-to-date rate limit data for the client.\n\nTo detect a primary API rate limit error, you can check if the error is a\n`RateLimitError`.\n\n```go\nrepos, _, err := client.Repositories.List(ctx, \"\", nil)\nvar rateErr *github.RateLimitError\nif errors.As(err, &rateErr) {\n\tlog.Printf(\"hit primary rate limit, used %v of %v\\n\", rateErr.Rate.Used, rateErr.Rate.Limit)\n}\n```\n\nTo detect an API secondary rate limit error, you can check if the error is an\n`AbuseRateLimitError`.\n\n```go\nrepos, _, err := client.Repositories.List(ctx, \"\", nil)\nvar rateErr *github.AbuseRateLimitError\nif errors.As(err, &rateErr) {\n\tlog.Printf(\"hit secondary rate limit, retry after %v\\n\", rateErr.RetryAfter)\n}\n```\n\nIf you hit the primary rate limit, you can use the `SleepUntilPrimaryRateLimitResetWhenRateLimited`\nmethod to block until the rate limit is reset.\n\n```go\nrepos, _, err := client.Repositories.List(context.WithValue(ctx, github.SleepUntilPrimaryRateLimitResetWhenRateLimited, true), \"\", nil)\n```\n\nIf you need to make a request even if the rate limit has been hit you can use\nthe `BypassRateLimitCheck` method to bypass the rate limit check and make the\nrequest anyway.\n\n```go\nrepos, _, err := client.Repositories.List(context.WithValue(ctx, github.BypassRateLimitCheck, true), \"\", nil)\n```\n\nFor more advanced use cases, you can use [gofri/go-github-ratelimit](https://github.com/gofri/go-github-ratelimit)\nwhich provides a middleware (`http.RoundTripper`) that handles both the primary\nrate limit and secondary rate limit for the GitHub API. In this case you can\nset the client `DisableRateLimitCheck` to `true` so the client doesn't track the rate limit usage.\n\nIf the client is an [OAuth app](https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api#primary-rate-limit-for-oauth-apps)\nyou can use the apps higher rate limit to request public data by using the\n`UnauthenticatedRateLimitedTransport` to make calls as the app instead of as\nthe user.\n\n### Accepted Status ###\n\nSome endpoints may return a 202 Accepted status code, meaning that the\ninformation required is not yet ready and was scheduled to be gathered on\nthe GitHub side. Methods known to behave like this are documented specifying\nthis behavior.\n\nTo detect this condition of error, you can check if its type is\n`*github.AcceptedError`:\n\n```go\nstats, _, err := client.Repositories.ListContributorsStats(ctx, org, repo)\nif errors.As(err, new(*github.AcceptedError)) {\n\tlog.Println(\"scheduled on GitHub side\")\n}\n```\n\n### Conditional Requests ###\n\nThe GitHub REST API has good support for [conditional HTTP requests](https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2022-11-28#use-conditional-requests-if-appropriate)\nvia the `ETag` header which will help prevent you from burning through your\nrate limit, as well as help speed up your application. `go-github` does not\nhandle conditional requests directly, but is instead designed to work with a\ncaching `http.Transport`.\n\nTypically, an [RFC 9111](https://datatracker.ietf.org/doc/html/rfc9111)\ncompliant HTTP cache such as [bartventer/httpcache](https://github.com/bartventer/httpcache)\nis recommended, ex:\n\n```go\nimport (\n\t\"github.com/bartventer/httpcache\"\n\t_ \"github.com/bartventer/httpcache/store/memcache\" //  Register the in-memory backend\n)\n\nclient := github.NewClient(\n\thttpcache.NewClient(\"memcache://\"),\n).WithAuthToken(os.Getenv(\"GITHUB_TOKEN\"))\n```\n\nAlternatively, the [bored-engineer/github-conditional-http-transport](https://github.com/bored-engineer/github-conditional-http-transport)\npackage relies on (undocumented) GitHub specific cache logic and is\nrecommended when making requests using short-lived credentials such as a\n[GitHub App installation token](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app-installation).\n\n### Creating and Updating Resources ###\n\nAll structs for GitHub resources use pointer values for all non-repeated fields.\nThis allows distinguishing between unset fields and those set to a zero-value.\nHelper functions have been provided to easily create these pointers for string,\nbool, and int values. For example:\n\n```go\n// create a new private repository named \"foo\"\nrepo := &github.Repository{\n\tName:    github.Ptr(\"foo\"),\n\tPrivate: github.Ptr(true),\n}\nclient.Repositories.Create(ctx, \"\", repo)\n```\n\nUsers who have worked with protocol buffers should find this pattern familiar.\n\n### Pagination ###\n\nAll requests for resource collections (repos, pull requests, issues, etc.)\nsupport pagination. Pagination options using page numbers are described in the\n`github.ListOptions` struct and passed to the list methods directly or as an\nembedded type of a more specific list options struct (for example\n`github.PullRequestListOptions`). Pages information is available via the\n`github.Response` struct.\n\n```go\nclient := github.NewClient(nil)\n\nopt := &github.RepositoryListByOrgOptions{\n\tListOptions: github.ListOptions{PerPage: 10},\n}\n// get all pages of results\nvar allRepos []*github.Repository\nfor {\n\trepos, resp, err := client.Repositories.ListByOrg(ctx, \"github\", opt)\n\tif err != nil {\n\t\treturn err\n\t}\n\tallRepos = append(allRepos, repos...)\n\tif resp.NextPage == 0 {\n\t\tbreak\n\t}\n\topt.Page = resp.NextPage\n}\n```\n\nPagination options using string cursors are described in the `github.ListCursorOptions`\nstruct and passed to the list methods directly or as an\nembedded type of a more specific list cursor options struct (for example\n`github.ListGlobalSecurityAdvisoriesOptions`). Similarly, cursor and pages information\nis available via the `github.Response` struct.\n\n#### Iterators ####\n\nGo v1.23 introduces the new `iter` package.\n\nThe new `github/gen-iterators.go` file auto-generates \"*Iter\" methods in `github/github-iterators.go`\nfor all methods that support page number iteration (using the `NextPage` field in each response)\nor string cursor iteration (using the `After` field in each response).\nTo handle rate limiting issues, make sure to use a rate-limiting transport.\n(See [Rate Limiting](/#rate-limiting) above for more details.)\nTo use these methods, simply create an iterator and then range over it, for example:\n\n```go\nclient := github.NewClient(nil)\nvar allRepos []*github.Repository\n\n// create an iterator and start looping through all the results\niter := client.Repositories.ListIter(ctx, \"github\", nil)\nfor repo, err := range iter {\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tallRepos = append(allRepos, repo)\n}\n```\n\nAlternatively, if you wish to use an external package, there is `enrichman/gh-iter`.\nIts iterator will handle pagination for you, looping through all the available results.\n\n```go\nclient := github.NewClient(nil)\nvar allRepos []*github.Repository\n\n// create an iterator and start looping through all the results\nrepos := ghiter.NewFromFn1(client.Repositories.ListByOrg, \"github\")\nfor repo := range repos.All() {\n\tallRepos = append(allRepos, repo)\n}\n```\n\nFor complete usage of `enrichman/gh-iter`, see the full [package docs](https://github.com/enrichman/gh-iter).\n\n#### Middleware ####\n\nYou can use [gofri/go-github-pagination](https://github.com/gofri/go-github-pagination) to handle\npagination for you. It supports both sync and async modes, as well as customizations.\nBy default, the middleware automatically paginates through all pages, aggregates results, and returns them as an array.\nSee `example/ratelimit/main.go` for usage.\n\n### Webhooks ###\n\n`go-github` provides structs for almost all [GitHub webhook events][] as well as functions to validate them and unmarshal JSON payloads from `http.Request` structs.\n\n```go\nfunc (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\tpayload, err := github.ValidatePayload(r, s.webhookSecretKey)\n\tif err != nil { ... }\n\tevent, err := github.ParseWebHook(github.WebHookType(r), payload)\n\tif err != nil { ... }\n\tswitch event := event.(type) {\n\tcase *github.CommitCommentEvent:\n\t\tprocessCommitCommentEvent(event)\n\tcase *github.CreateEvent:\n\t\tprocessCreateEvent(event)\n\t...\n\t}\n}\n```\n\nFurthermore, there are libraries like [cbrgm/githubevents][] that build upon the example above and provide functions to subscribe callbacks to specific events.\n\nFor complete usage of go-github, see the full [package docs][].\n\n[GitHub API v3]: https://docs.github.com/en/rest\n[personal access token]: https://github.com/blog/1509-personal-api-tokens\n[package docs]: https://pkg.go.dev/github.com/google/go-github/v84/github\n[GraphQL API v4]: https://developer.github.com/v4/\n[shurcooL/githubv4]: https://github.com/shurcooL/githubv4\n[GitHub webhook events]: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads\n[cbrgm/githubevents]: https://github.com/cbrgm/githubevents\n\n### Testing code that uses `go-github` ###\n\nThe repo [migueleliasweb/go-github-mock](https://github.com/migueleliasweb/go-github-mock) provides a way to mock responses. Check the repo for more details.\n\n### Integration Tests ###\n\nYou can run integration tests from the `test` directory. See the integration tests [README](test/README.md).\n\n## Contributing ##\n\nI would like to cover the entire GitHub API and contributions are of course always welcome. The\ncalling pattern is pretty well established, so adding new methods is relatively\nstraightforward. See [`CONTRIBUTING.md`](CONTRIBUTING.md) for details.\n\n## Versioning ##\n\nIn general, go-github follows [semver](https://semver.org/) as closely as we\ncan for tagging releases of the package. For self-contained libraries, the\napplication of semantic versioning is relatively straightforward and generally\nunderstood. But because go-github is a client library for the GitHub API, which\nitself changes behavior, and because we are typically pretty aggressive about\nimplementing preview features of the GitHub API, we've adopted the following\nversioning policy:\n\n* We increment the **major version** with any incompatible change to\n\tnon-preview functionality, including changes to the exported Go API surface\n\tor behavior of the API.\n* We increment the **minor version** with any backwards-compatible changes to\n\tfunctionality, as well as any changes to preview functionality in the GitHub\n\tAPI. GitHub makes no guarantee about the stability of preview functionality,\n\tso neither do we consider it a stable part of the go-github API.\n* We increment the **patch version** with any backwards-compatible bug fixes.\n\nPreview functionality may take the form of entire methods or simply additional\ndata returned from an otherwise non-preview method. Refer to the GitHub API\ndocumentation for details on preview functionality.\n\n### Calendar Versioning ###\n\nAs of 2022-11-28, GitHub [has announced](https://github.blog/2022-11-28-to-infinity-and-beyond-enabling-the-future-of-githubs-rest-api-with-api-versioning/)\nthat they are starting to version their v3 API based on \"calendar-versioning\".\n\nIn practice, our goal is to make per-method version overrides (at\nleast in the core library) rare and temporary.\n\nOur understanding of the GitHub docs is that they will be revving the\nentire API to each new date-based version, even if only a few methods\nhave breaking changes. Other methods will accept the new version with\ntheir existing functionality. So when a new date-based version of the\nGitHub API is released, we (the repo maintainers) plan to:\n\n* update each method that had breaking changes, overriding their\n  per-method API version header. This may happen in one or multiple\n  commits and PRs, and is all done in the main branch.\n\n* once all of the methods with breaking changes have been updated,\n  have a final commit that bumps the default API version, and remove\n  all of the per-method overrides. That would now get a major version\n  bump when the next go-github release is made.\n\n### Version Compatibility Table ###\n\nThe following table identifies which version of the GitHub API is\nsupported by this (and past) versions of this repo (go-github).\nVersions prior to 48.2.0 are not listed.\n\n| go-github Version | GitHub v3 API Version |\n| ----------------- | --------------------- |\n| 84.0.0            | 2022-11-28            |\n| ...               | 2022-11-28            |\n| 48.2.0            | 2022-11-28            |\n\n## License ##\n\nThis library is distributed under the BSD-style license found in the [LICENSE](./LICENSE)\nfile.\n"
  },
  {
    "path": "REVIEWERS",
    "content": "stevehipwell\nalexandear\nzyfy29\nNot-Dhananjay-Mishra\nmunlicode\n"
  },
  {
    "path": "example/actionpermissions/main.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// The actionpermissions command utilizes go-github as a cli tool for\n// changing GitHub Actions related permission settings for a repository.\npackage main\n\nimport (\n\t\"context\"\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/google/go-github/v84/github\"\n)\n\nvar (\n\tname  = flag.String(\"name\", \"\", \"repo to change Actions permissions.\")\n\towner = flag.String(\"owner\", \"\", \"owner of targeted repo.\")\n)\n\nfunc main() {\n\tflag.Parse()\n\ttoken := os.Getenv(\"GITHUB_AUTH_TOKEN\")\n\tif token == \"\" {\n\t\tlog.Fatal(\"Unauthorized: No token present\")\n\t}\n\tif *name == \"\" {\n\t\tlog.Fatal(\"No name: repo name must be given\")\n\t}\n\tif *owner == \"\" {\n\t\tlog.Fatal(\"No owner: owner of repo must be given\")\n\t}\n\tctx := context.Background()\n\tclient := github.NewClient(nil).WithAuthToken(token)\n\n\tactionsPermissionsRepository, _, err := client.Repositories.GetActionsPermissions(ctx, *owner, *name)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfmt.Printf(\"Current ActionsPermissions %v\\n\", actionsPermissionsRepository)\n\n\tactionsPermissionsRepository = &github.ActionsPermissionsRepository{Enabled: github.Ptr(true), AllowedActions: github.Ptr(\"selected\")}\n\t_, _, err = client.Repositories.UpdateActionsPermissions(ctx, *owner, *name, *actionsPermissionsRepository)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfmt.Printf(\"Current ActionsPermissions %v\\n\", actionsPermissionsRepository)\n\n\tactionsAllowed, _, err := client.Repositories.GetActionsAllowed(ctx, *owner, *name)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfmt.Printf(\"Current ActionsAllowed %v\\n\", actionsAllowed)\n\n\tactionsAllowed = &github.ActionsAllowed{GithubOwnedAllowed: github.Ptr(true), VerifiedAllowed: github.Ptr(false), PatternsAllowed: []string{\"a/b\"}}\n\t_, _, err = client.Repositories.EditActionsAllowed(ctx, *owner, *name, *actionsAllowed)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfmt.Printf(\"Current ActionsAllowed %v\\n\", actionsAllowed)\n\n\tactionsPermissionsRepository = &github.ActionsPermissionsRepository{Enabled: github.Ptr(true), AllowedActions: github.Ptr(\"all\")}\n\t_, _, err = client.Repositories.UpdateActionsPermissions(ctx, *owner, *name, *actionsPermissionsRepository)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfmt.Printf(\"Current ActionsPermissions %v\\n\", actionsPermissionsRepository)\n}\n"
  },
  {
    "path": "example/appengine/app.go",
    "content": "// Copyright 2017 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package demo provides an app that shows how to use the github package on\n// Google App Engine.\npackage demo\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n\n\t\"github.com/google/go-github/v84/github\"\n\t\"google.golang.org/appengine\"\n\t\"google.golang.org/appengine/log\"\n)\n\nfunc init() {\n\thttp.HandleFunc(\"/\", handler)\n}\n\nfunc handler(w http.ResponseWriter, r *http.Request) {\n\tif r.URL.Path != \"/\" {\n\t\thttp.NotFound(w, r)\n\t\treturn\n\t}\n\n\tctx := appengine.NewContext(r)\n\tclient := github.NewClient(nil).WithAuthToken(os.Getenv(\"GITHUB_AUTH_TOKEN\"))\n\n\tcommits, _, err := client.Repositories.ListCommits(ctx, \"google\", \"go-github\", nil)\n\tif err != nil {\n\t\tlog.Errorf(ctx, \"ListCommits: %v\", err)\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"text/plain; charset=utf-8\")\n\tfor _, commit := range commits {\n\t\tfmt.Fprintln(w, commit.GetHTMLURL())\n\t}\n}\n"
  },
  {
    "path": "example/appengine/app.yaml",
    "content": "# Copyright 2017 The go-github AUTHORS. All rights reserved.\n#\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n\nruntime: go\napi_version: go1\n\nhandlers:\n- url: /.*\n  script: _go_app\n\nenv_variables:\n  GITHUB_AUTH_TOKEN: \"-your-auth-token-here-\"\n"
  },
  {
    "path": "example/auditlogstream/main.go",
    "content": "// Copyright 2026 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// The auditlogstream command demonstrates managing enterprise audit log\n// streams for Azure Blob Storage using the go-github library.\n//\n// The GitHub API base URL is read from the GITHUB_API_URL environment\n// variable. When running inside a GitHub Actions workflow this is set\n// automatically.\n//\n// Usage — create:\n//\n//\texport GITHUB_AUTH_TOKEN=<your token>\n//\texport GITHUB_API_URL=https://api.<domain>.ghe.com/ or https://domain/api/v3/\n//\tgo run main.go create \\\n//\t  -enterprise=my-enterprise \\\n//\t  -container=my-container \\\n//\t  -sas-url=<plain-text-sas-url>\n//\n// Usage — delete:\n//\n//\texport GITHUB_AUTH_TOKEN=<your token>\n//\texport GITHUB_API_URL=https://api.<domain>.ghe.com/ or https://domain/api/v3/\n//\tgo run main.go delete \\\n//\t  -enterprise=my-enterprise \\\n//\t  -stream-id=42\npackage main\n\nimport (\n\t\"context\"\n\t\"crypto/rand\"\n\t\"encoding/base64\"\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/google/go-github/v84/github\"\n\t\"golang.org/x/crypto/nacl/box\"\n)\n\n// encryptSecret encrypts a plain-text secret using libsodium's sealed box\n// (crypto_box_seal), which is what GitHub's API expects for encrypted credentials.\nfunc encryptSecret(publicKeyB64, secret string) (string, error) {\n\tpublicKeyBytes, err := base64.StdEncoding.DecodeString(publicKeyB64)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"decoding public key: %w\", err)\n\t}\n\tif len(publicKeyBytes) != 32 {\n\t\treturn \"\", fmt.Errorf(\"public key must be 32 bytes, got %v\", len(publicKeyBytes))\n\t}\n\tpublicKey := [32]byte(publicKeyBytes)\n\n\tencrypted, err := box.SealAnonymous(nil, []byte(secret), &publicKey, rand.Reader)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"encrypting secret: %w\", err)\n\t}\n\n\treturn base64.StdEncoding.EncodeToString(encrypted), nil\n}\n\nfunc main() {\n\tif len(os.Args) < 2 {\n\t\tfmt.Fprintf(os.Stderr, \"Usage: %v <create|delete> [flags]\\n\", os.Args[0])\n\t\tos.Exit(1)\n\t}\n\n\tswitch os.Args[1] {\n\tcase \"create\":\n\t\trunCreate(os.Args[2:])\n\tcase \"delete\":\n\t\trunDelete(os.Args[2:])\n\tdefault:\n\t\tfmt.Fprintf(os.Stderr, \"Unknown command %q. Must be one of: create, delete\\n\", os.Args[1])\n\t\tos.Exit(1)\n\t}\n}\n\n// newFlagSet creates a FlagSet with the common -enterprise flag pre-registered.\nfunc newFlagSet(name string) (*flag.FlagSet, *string) {\n\tfs := flag.NewFlagSet(name, flag.ExitOnError)\n\tenterprise := fs.String(\"enterprise\", \"\", \"Enterprise slug (required).\")\n\treturn fs, enterprise\n}\n\n// parseAndInit parses the FlagSet, validates the enterprise flag, reads\n// environment variables, and returns a ready-to-use context, client, and\n// enterprise slug.\nfunc parseAndInit(fs *flag.FlagSet, enterprise *string, args []string) (context.Context, *github.Client, string) {\n\tif err := fs.Parse(args); err != nil {\n\t\tlog.Fatalf(\"Error parsing flags: %v\", err)\n\t}\n\n\trequireFlag(\"enterprise\", *enterprise)\n\n\ttoken := requireEnv(\"GITHUB_AUTH_TOKEN\")\n\tapiURL := requireEnv(\"GITHUB_API_URL\")\n\n\treturn context.Background(), newClient(token, apiURL), *enterprise\n}\n\nfunc runCreate(args []string) {\n\tfs, enterprise := newFlagSet(\"create\")\n\tcontainer := fs.String(\"container\", \"\", \"Azure Blob Storage container name (required).\")\n\tsasURL := fs.String(\"sas-url\", \"\", \"Plain-text Azure SAS URL to encrypt and submit (required).\")\n\tenabled := fs.Bool(\"enabled\", true, \"Whether the stream should be enabled immediately.\")\n\n\tctx, client, ent := parseAndInit(fs, enterprise, args)\n\trequireFlag(\"container\", *container)\n\trequireFlag(\"sas-url\", *sasURL)\n\n\tstreamKey, _, err := client.Enterprise.GetAuditLogStreamKey(ctx, ent)\n\tif err != nil {\n\t\tlog.Fatalf(\"Error fetching audit log stream key: %v\", err)\n\t}\n\tfmt.Printf(\"Retrieved stream key ID: %v\\n\", streamKey.KeyID)\n\n\tencryptedSASURL, err := encryptSecret(streamKey.Key, *sasURL)\n\tif err != nil {\n\t\tlog.Fatalf(\"Error encrypting SAS URL: %v\", err)\n\t}\n\tfmt.Println(\"SAS URL encrypted successfully.\")\n\n\tconfig := github.NewAzureBlobStreamConfig(*enabled, &github.AzureBlobConfig{\n\t\tKeyID:           streamKey.KeyID,\n\t\tContainer:       *container,\n\t\tEncryptedSASURL: encryptedSASURL,\n\t})\n\n\tstream, _, err := client.Enterprise.CreateAuditLogStream(ctx, ent, *config)\n\tif err != nil {\n\t\tlog.Fatalf(\"Error creating audit log stream: %v\", err)\n\t}\n\n\tfmt.Println(\"Successfully created audit log stream:\")\n\tfmt.Printf(\"  ID:         %v\\n\", stream.ID)\n\tfmt.Printf(\"  Type:       %v\\n\", stream.StreamType)\n\tfmt.Printf(\"  Enabled:    %v\\n\", stream.Enabled)\n\tfmt.Printf(\"  Created at: %v\\n\", stream.CreatedAt)\n}\n\nfunc runDelete(args []string) {\n\tfs, enterprise := newFlagSet(\"delete\")\n\tstreamID := fs.Int64(\"stream-id\", 0, \"ID of the audit log stream to delete (required).\")\n\n\tctx, client, ent := parseAndInit(fs, enterprise, args)\n\trequireIntFlag(\"stream-id\", *streamID)\n\n\t_, err := client.Enterprise.DeleteAuditLogStream(ctx, ent, *streamID)\n\tif err != nil {\n\t\tlog.Fatalf(\"Error deleting audit log stream: %v\", err)\n\t}\n\n\tfmt.Printf(\"Successfully deleted audit log stream %v.\\n\", *streamID)\n}\n\nfunc newClient(token, apiURL string) *github.Client {\n\tclient, err := github.NewClient(nil).WithAuthToken(token).WithEnterpriseURLs(apiURL, apiURL)\n\tif err != nil {\n\t\tlog.Fatalf(\"Error creating GitHub client: %v\", err)\n\t}\n\treturn client\n}\n\nfunc requireEnv(name string) string {\n\tval := os.Getenv(name)\n\tif val == \"\" {\n\t\tlog.Fatalf(\"environment variable %v is not set\", name)\n\t}\n\treturn val\n}\n\nfunc requireFlag(name, val string) {\n\tif val == \"\" {\n\t\tlog.Fatalf(\"flag -%v is required\", name)\n\t}\n}\n\nfunc requireIntFlag(name string, val int64) {\n\tif val == 0 {\n\t\tlog.Fatalf(\"flag -%v is required\", name)\n\t}\n}\n"
  },
  {
    "path": "example/basicauth/main.go",
    "content": "// Copyright 2015 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// The basicauth command demonstrates using the github.BasicAuthTransport,\n// including handling two-factor authentication. This won't currently work for\n// accounts that use SMS to receive one-time passwords.\n//\n// Deprecation Notice: GitHub will discontinue password authentication to the API.\n// You must now authenticate to the GitHub API with an API token, such as an OAuth access token,\n// GitHub App installation access token, or personal access token, depending on what you need to do with the token.\n// Password authentication to the API will be removed on November 13, 2020.\n// See the tokenauth example for details.\npackage main\n\nimport (\n\t\"bufio\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\n\t\"github.com/google/go-github/v84/github\"\n\t\"golang.org/x/term\"\n)\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tfmt.Print(\"GitHub Username: \")\n\tusername, _ := r.ReadString('\\n')\n\n\tfmt.Print(\"GitHub Password: \")\n\tpassword, _ := term.ReadPassword(int(os.Stdin.Fd()))\n\n\ttp := github.BasicAuthTransport{\n\t\tUsername: strings.TrimSpace(username),\n\t\tPassword: strings.TrimSpace(string(password)),\n\t}\n\n\tclient := github.NewClient(tp.Client())\n\tctx := context.Background()\n\tuser, _, err := client.Users.Get(ctx, \"\")\n\n\t// Is this a two-factor auth error? If so, prompt for OTP and try again.\n\tif errors.As(err, new(*github.TwoFactorAuthError)) {\n\t\tfmt.Print(\"\\nGitHub OTP: \")\n\t\totp, _ := r.ReadString('\\n')\n\t\ttp.OTP = strings.TrimSpace(otp)\n\t\tuser, _, err = client.Users.Get(ctx, \"\")\n\t}\n\n\tif err != nil {\n\t\tfmt.Printf(\"\\nerror: %v\\n\", err)\n\t\treturn\n\t}\n\n\tfmt.Printf(\"\\n%v\\n\", github.Stringify(user))\n}\n"
  },
  {
    "path": "example/codespaces/newreposecretwithxcrypto/main.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// newreposecretwithxcrypto creates a new secret in GitHub for a given owner/repo.\n// newreposecretwithxcrypto uses x/crypto/nacl/box instead of sodium.\n// It does not depend on any native libraries and is easier to cross-compile for different platforms.\n// Quite possibly there is a performance penalty due to this.\n//\n// newreposecretwithxcrypto has two required flags for owner and repo, and takes in one argument for the name of the secret to add.\n// The secret value is pulled from an environment variable based on the secret name.\n// To authenticate with GitHub, provide your token via an environment variable GITHUB_AUTH_TOKEN.\n//\n// To verify the new secret, navigate to GitHub Repository > Settings > left side options bar > Secrets.\n//\n// Usage:\n//\n//\texport GITHUB_AUTH_TOKEN=<auth token from github that has secret create rights>\n//\texport SECRET_VARIABLE=<secret value of the secret variable>\n//\tgo run main.go -owner <owner name> -repo <repository name> SECRET_VARIABLE\n//\n// Example:\n//\n//\texport GITHUB_AUTH_TOKEN=0000000000000000\n//\texport SECRET_VARIABLE=\"my-secret\"\n//\tgo run main.go -owner google -repo go-github SECRET_VARIABLE\npackage main\n\nimport (\n\t\"context\"\n\tcrypto_rand \"crypto/rand\"\n\t\"encoding/base64\"\n\t\"errors\"\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/google/go-github/v84/github\"\n\t\"golang.org/x/crypto/nacl/box\"\n)\n\nvar (\n\trepo  = flag.String(\"repo\", \"\", \"The repo that the secret should be added to, ex. go-github\")\n\towner = flag.String(\"owner\", \"\", \"The owner of there repo this should be added to, ex. google\")\n)\n\nfunc main() {\n\tflag.Parse()\n\n\ttoken := os.Getenv(\"GITHUB_AUTH_TOKEN\")\n\tif token == \"\" {\n\t\tlog.Fatal(\"please provide a GitHub API token via env variable GITHUB_AUTH_TOKEN\")\n\t}\n\n\tif *repo == \"\" {\n\t\tlog.Fatal(\"please provide required flag --repo to specify GitHub repository \")\n\t}\n\n\tif *owner == \"\" {\n\t\tlog.Fatal(\"please provide required flag --owner to specify GitHub user/org owner\")\n\t}\n\n\tsecretName, err := getSecretName()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tsecretValue, err := getSecretValue(secretName)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tctx := context.Background()\n\tclient := github.NewClient(nil).WithAuthToken(token)\n\n\tif err := addRepoSecret(ctx, client, *owner, *repo, secretName, secretValue); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfmt.Printf(\"Added secret %q to the repo %v/%v\\n\", secretName, *owner, *repo)\n}\n\nfunc getSecretName() (string, error) {\n\tsecretName := flag.Arg(0)\n\tif secretName == \"\" {\n\t\treturn \"\", errors.New(\"missing argument secret name\")\n\t}\n\treturn secretName, nil\n}\n\nfunc getSecretValue(secretName string) (string, error) {\n\tsecretValue := os.Getenv(secretName)\n\tif secretValue == \"\" {\n\t\treturn \"\", fmt.Errorf(\"secret value not found under env variable %q\", secretName)\n\t}\n\treturn secretValue, nil\n}\n\n// addRepoSecret will add a secret to a GitHub repo for use in GitHub Codespaces.\n//\n// The secretName and secretValue will determine the name of the secret added and it's corresponding value.\n//\n// The actual transmission of the secret value to GitHub using the api requires that the secret value is encrypted\n// using the public key of the target repo. This encryption is done using x/crypto/nacl/box.\n//\n// First, the public key of the repo is retrieved. The public key comes base64\n// encoded, so it must be decoded prior to use.\n//\n// Second, the decode key is converted into a fixed size byte array.\n//\n// Third, the secret value is converted into a slice of bytes.\n//\n// Fourth, the secret is encrypted with box.SealAnonymous using the repo's decoded public key.\n//\n// Fifth, the encrypted secret is encoded as a base64 string to be used in a github.EncodedSecret type.\n//\n// Sixth, The other two properties of the github.EncodedSecret type are determined. The name of the secret to be added\n// (string not base64), and the KeyID of the public key used to encrypt the secret.\n// This can be retrieved via the public key's GetKeyID method.\n//\n// Finally, the github.EncodedSecret is passed into the GitHub client.Codespaces.CreateOrUpdateRepoSecret method to\n// populate the secret in the GitHub repo.\nfunc addRepoSecret(ctx context.Context, client *github.Client, owner, repo, secretName, secretValue string) error {\n\tpublicKey, _, err := client.Codespaces.GetRepoPublicKey(ctx, owner, repo)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tencryptedSecret, err := encryptSecretWithPublicKey(publicKey, secretName, secretValue)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif _, err := client.Codespaces.CreateOrUpdateRepoSecret(ctx, owner, repo, encryptedSecret); err != nil {\n\t\treturn fmt.Errorf(\"client.Codespaces.CreateOrUpdateRepoSecret returned error: %v\", err)\n\t}\n\n\treturn nil\n}\n\nfunc encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName, secretValue string) (*github.EncryptedSecret, error) {\n\tdecodedPublicKey, err := base64.StdEncoding.DecodeString(publicKey.GetKey())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to decode public key: %v\", err)\n\t}\n\n\tvar boxKey [32]byte\n\tcopy(boxKey[:], decodedPublicKey)\n\tencryptedBytes, err := box.SealAnonymous([]byte{}, []byte(secretValue), &boxKey, crypto_rand.Reader)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"box.SealAnonymous failed with error %w\", err)\n\t}\n\n\tencryptedString := base64.StdEncoding.EncodeToString(encryptedBytes)\n\tkeyID := publicKey.GetKeyID()\n\tencryptedSecret := &github.EncryptedSecret{\n\t\tName:           secretName,\n\t\tKeyID:          keyID,\n\t\tEncryptedValue: encryptedString,\n\t}\n\treturn encryptedSecret, nil\n}\n"
  },
  {
    "path": "example/codespaces/newusersecretwithxcrypto/main.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// newusersecretwithxcrypto creates a new secret in GitHub for a given user.\n// newusersecretwithxcrypto uses x/crypto/nacl/box instead of sodium.\n// It does not depend on any native libraries and is easier to cross-compile for different platforms.\n// Quite possibly there is a performance penalty due to this.\n//\n// newusersecretwithxcrypto takes in one argument for the name of the secret to add, and 2 flags owner, repo.\n// If owner/repo are defined then it adds the secret to that repository\n// The secret value is pulled from an environment variable based on the secret name.\n// To authenticate with GitHub, provide your token via an environment variable GITHUB_AUTH_TOKEN.\n//\n// To verify the new secret, navigate to GitHub User > Settings > left side options bar > Codespaces > Secrets.\n//\n// Usage:\n//\n//\texport GITHUB_AUTH_TOKEN=<auth token from github that has secret create rights>\n//\texport SECRET_VARIABLE=<secret value of the secret variable>\n//\tgo run main.go SECRET_VARIABLE\n//\n// Example:\n//\n//\texport GITHUB_AUTH_TOKEN=0000000000000000\n//\texport SECRET_VARIABLE=\"my-secret\"\n//\tgo run main.go SECRET_VARIABLE\npackage main\n\nimport (\n\t\"context\"\n\tcrypto_rand \"crypto/rand\"\n\t\"encoding/base64\"\n\t\"errors\"\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/google/go-github/v84/github\"\n\t\"golang.org/x/crypto/nacl/box\"\n)\n\nvar (\n\trepo  = flag.String(\"repo\", \"\", \"The repo that the secret should be added to, ex. go-github\")\n\towner = flag.String(\"owner\", \"\", \"The owner of there repo this should be added to, ex. google\")\n)\n\nfunc main() {\n\tflag.Parse()\n\n\ttoken := os.Getenv(\"GITHUB_AUTH_TOKEN\")\n\tif token == \"\" {\n\t\tlog.Fatal(\"please provide a GitHub API token via env variable GITHUB_AUTH_TOKEN\")\n\t}\n\n\tsecretName, err := getSecretName()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tsecretValue, err := getSecretValue(secretName)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tctx := context.Background()\n\tclient := github.NewClient(nil).WithAuthToken(token)\n\n\tif err := addUserSecret(ctx, client, secretName, secretValue, *owner, *repo); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfmt.Printf(\"Added secret %q to the authenticated user\\n\", secretName)\n}\n\nfunc getSecretName() (string, error) {\n\tsecretName := flag.Arg(0)\n\tif secretName == \"\" {\n\t\treturn \"\", errors.New(\"missing argument secret name\")\n\t}\n\treturn secretName, nil\n}\n\nfunc getSecretValue(secretName string) (string, error) {\n\tsecretValue := os.Getenv(secretName)\n\tif secretValue == \"\" {\n\t\treturn \"\", fmt.Errorf(\"secret value not found under env variable %q\", secretName)\n\t}\n\treturn secretValue, nil\n}\n\n// addUserSecret will add a secret to a GitHub user for use in GitHub Codespaces.\n//\n// The secretName and secretValue will determine the name of the secret added and it's corresponding value.\n//\n// The actual transmission of the secret value to GitHub using the api requires that the secret value is encrypted\n// using the public key of the target user. This encryption is done using x/crypto/nacl/box.\n//\n// First, the public key of the user is retrieved. The public key comes base64\n// encoded, so it must be decoded prior to use.\n//\n// Second, the decode key is converted into a fixed size byte array.\n//\n// Third, the secret value is converted into a slice of bytes.\n//\n// Fourth, the secret is encrypted with box.SealAnonymous using the user's decoded public key.\n//\n// Fifth, the encrypted secret is encoded as a base64 string to be used in a github.EncodedSecret type.\n//\n// Sixth, The other two properties of the github.EncodedSecret type are determined. The name of the secret to be added\n// (string not base64), and the KeyID of the public key used to encrypt the secret.\n// This can be retrieved via the public key's GetKeyID method.\n//\n// Seventh, the github.EncodedSecret is passed into the GitHub client.Codespaces.CreateOrUpdateUserSecret method to\n// populate the secret in the GitHub user.\n//\n// Finally, if a repo and owner are passed in, it adds the repo to the user secret.\nfunc addUserSecret(ctx context.Context, client *github.Client, secretName, secretValue, owner, repo string) error {\n\tpublicKey, _, err := client.Codespaces.GetUserPublicKey(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tencryptedSecret, err := encryptSecretWithPublicKey(publicKey, secretName, secretValue)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif _, err := client.Codespaces.CreateOrUpdateUserSecret(ctx, encryptedSecret); err != nil {\n\t\treturn fmt.Errorf(\"client.Codespaces.CreateOrUpdateUserSecret returned error: %v\", err)\n\t}\n\n\tif owner != \"\" && repo != \"\" {\n\t\tr, _, err := client.Repositories.Get(ctx, owner, repo)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"client.Repositories.Get returned error: %v\", err)\n\t\t}\n\t\t_, err = client.Codespaces.AddSelectedRepoToUserSecret(ctx, encryptedSecret.Name, r)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"client.Codespaces.AddSelectedRepoToUserSecret returned error: %v\", err)\n\t\t}\n\t\tfmt.Printf(\"Added secret %q to %v/%v\\n\", secretName, owner, repo)\n\t}\n\n\treturn nil\n}\n\nfunc encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName, secretValue string) (*github.EncryptedSecret, error) {\n\tdecodedPublicKey, err := base64.StdEncoding.DecodeString(publicKey.GetKey())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"base64.StdEncoding.DecodeString was unable to decode public key: %v\", err)\n\t}\n\n\tvar boxKey [32]byte\n\tcopy(boxKey[:], decodedPublicKey)\n\tencryptedBytes, err := box.SealAnonymous([]byte{}, []byte(secretValue), &boxKey, crypto_rand.Reader)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"box.SealAnonymous failed with error %w\", err)\n\t}\n\n\tencryptedString := base64.StdEncoding.EncodeToString(encryptedBytes)\n\tkeyID := publicKey.GetKeyID()\n\tencryptedSecret := &github.EncryptedSecret{\n\t\tName:           secretName,\n\t\tKeyID:          keyID,\n\t\tEncryptedValue: encryptedString,\n\t}\n\treturn encryptedSecret, nil\n}\n"
  },
  {
    "path": "example/commitpr/main.go",
    "content": "// Copyright 2018 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// The commitpr command utilizes go-github as a CLI tool for\n// pushing files to a branch and creating a pull request from it.\n// It takes an auth token as an environment variable and creates\n// the commit and the PR under the account affiliated with that token.\n//\n// The purpose of this example is to show how to use refs, trees and commits to\n// create commits and pull requests.\n//\n// Note, if you want to push a single file, you probably prefer to use the\n// content API. An example is available here:\n// https://pkg.go.dev/github.com/google/go-github/v84/github#example-RepositoriesService-CreateFile\n//\n// Note, for this to work at least 1 commit is needed, so you if you use this\n// after creating a repository you might want to make sure you set `AutoInit` to\n// `true`.\npackage main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"errors\"\n\t\"flag\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"os\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/ProtonMail/go-crypto/openpgp\"\n\t\"github.com/google/go-github/v84/github\"\n)\n\nvar (\n\tsourceOwner   = flag.String(\"source-owner\", \"\", \"Name of the owner (user or org) of the repo to create the commit in.\")\n\tsourceRepo    = flag.String(\"source-repo\", \"\", \"Name of repo to create the commit in.\")\n\tcommitMessage = flag.String(\"commit-message\", \"\", \"Content of the commit message.\")\n\tcommitBranch  = flag.String(\"commit-branch\", \"\", \"Name of branch to create the commit in. If it does not already exists, it will be created using the `base-branch` parameter\")\n\trepoBranch    = flag.String(\"repo-branch\", \"\", \"Name of the repository where the changes in the pull request were made. This field is required for cross-repository pull requests if both repositories are owned by the same organization\")\n\tbaseBranch    = flag.String(\"base-branch\", \"master\", \"Name of branch to create the `commit-branch` from.\")\n\tprRepoOwner   = flag.String(\"merge-repo-owner\", \"\", \"Name of the owner (user or org) of the repo to create the PR against. If not specified, the value of the `-source-owner` flag will be used.\")\n\tprRepo        = flag.String(\"merge-repo\", \"\", \"Name of repo to create the PR against. If not specified, the value of the `-source-repo` flag will be used.\")\n\tprBranch      = flag.String(\"merge-branch\", \"master\", \"Name of branch to create the PR against (the one you want to merge your branch in via the PR).\")\n\tprSubject     = flag.String(\"pr-title\", \"\", \"Title of the pull request. If not specified, no pull request will be created.\")\n\tprDescription = flag.String(\"pr-text\", \"\", \"Text to put in the description of the pull request.\")\n\tsourceFiles   = flag.String(\"files\", \"\", `Comma-separated list of files to commit and their location.\nThe local file is separated by its target location by a semi-colon.\nIf the file should be in the same location with the same name, you can just put the file name and omit the repetition.\nExample: README.md,main.go:github/examples/commitpr/main.go`)\n\tauthorName  = flag.String(\"author-name\", \"\", \"Name of the author of the commit.\")\n\tauthorEmail = flag.String(\"author-email\", \"\", \"Email of the author of the commit.\")\n\tprivateKey  = flag.String(\"private-key\", \"\", \"Path to the private key to use to sign the commit.\")\n)\n\nvar (\n\tclient *github.Client\n\tctx    = context.Background()\n)\n\n// getRef returns the commit branch reference object if it exists or creates it\n// from the base branch before returning it.\nfunc getRef() (ref *github.Reference, err error) {\n\tif ref, _, err = client.Git.GetRef(ctx, *sourceOwner, *sourceRepo, branchRef(*commitBranch)); err == nil {\n\t\treturn ref, nil\n\t}\n\n\t// We consider that an error means the branch has not been found and needs to\n\t// be created.\n\tif *commitBranch == *baseBranch {\n\t\treturn nil, errors.New(\"the commit branch does not exist but `-base-branch` is the same as `-commit-branch`\")\n\t}\n\n\tif *baseBranch == \"\" {\n\t\treturn nil, errors.New(\"the `-base-branch` should not be set to an empty string when the branch specified by `-commit-branch` does not exists\")\n\t}\n\n\tvar baseRef *github.Reference\n\tif baseRef, _, err = client.Git.GetRef(ctx, *sourceOwner, *sourceRepo, branchRef(*baseBranch)); err != nil {\n\t\treturn nil, err\n\t}\n\tnewRef := github.CreateRef{Ref: branchRef(*commitBranch), SHA: *baseRef.Object.SHA}\n\tref, _, err = client.Git.CreateRef(ctx, *sourceOwner, *sourceRepo, newRef)\n\treturn ref, err\n}\n\n// branchRef generates the fully qualified git reference for the given branch name.\nfunc branchRef(name string) string {\n\treturn \"refs/heads/\" + name\n}\n\n// getTree generates the tree to commit based on the given files and the commit\n// of the ref you got in getRef.\nfunc getTree(ref *github.Reference) (tree *github.Tree, err error) {\n\t// Create a tree with what to commit.\n\tentries := []*github.TreeEntry{}\n\n\t// Load each file into the tree.\n\tfor fileArg := range strings.SplitSeq(*sourceFiles, \",\") {\n\t\tfile, content, err := getFileContent(fileArg)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tentries = append(entries, &github.TreeEntry{Path: github.Ptr(file), Type: github.Ptr(\"blob\"), Content: github.Ptr(string(content)), Mode: github.Ptr(\"100644\")})\n\t}\n\n\ttree, _, err = client.Git.CreateTree(ctx, *sourceOwner, *sourceRepo, *ref.Object.SHA, entries)\n\treturn tree, err\n}\n\n// getFileContent loads the local content of a file and return the target name\n// of the file in the target repository and its contents.\nfunc getFileContent(fileArg string) (targetName string, b []byte, err error) {\n\tvar localFile string\n\tfiles := strings.Split(fileArg, \":\")\n\tswitch {\n\tcase len(files) < 1:\n\t\treturn \"\", nil, errors.New(\"empty `-files` parameter\")\n\tcase len(files) == 1:\n\t\tlocalFile = files[0]\n\t\ttargetName = files[0]\n\tdefault:\n\t\tlocalFile = files[0]\n\t\ttargetName = files[1]\n\t}\n\n\tb, err = os.ReadFile(localFile)\n\treturn targetName, b, err\n}\n\n// pushCommit creates the commit in the given reference using the given tree.\nfunc pushCommit(ref *github.Reference, tree *github.Tree) (err error) {\n\t// Get the parent commit to attach the commit to.\n\tparent, _, err := client.Repositories.GetCommit(ctx, *sourceOwner, *sourceRepo, *ref.Object.SHA, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// This is not always populated, but is needed.\n\tparent.Commit.SHA = parent.SHA\n\n\t// Create the commit using the tree.\n\tdate := time.Now()\n\tauthor := &github.CommitAuthor{Date: &github.Timestamp{Time: date}, Name: authorName, Email: authorEmail}\n\tcommit := github.Commit{Author: author, Message: commitMessage, Tree: tree, Parents: []*github.Commit{parent.Commit}}\n\topts := github.CreateCommitOptions{}\n\tif *privateKey != \"\" {\n\t\tarmoredBlock, e := os.ReadFile(*privateKey)\n\t\tif e != nil {\n\t\t\treturn e\n\t\t}\n\t\tkeyring, e := openpgp.ReadArmoredKeyRing(bytes.NewReader(armoredBlock))\n\t\tif e != nil {\n\t\t\treturn e\n\t\t}\n\t\tif len(keyring) != 1 {\n\t\t\treturn errors.New(\"expected exactly one key in the keyring\")\n\t\t}\n\t\tkey := keyring[0]\n\t\topts.Signer = github.MessageSignerFunc(func(w io.Writer, r io.Reader) error {\n\t\t\treturn openpgp.ArmoredDetachSign(w, key, r, nil)\n\t\t})\n\t}\n\tnewCommit, _, err := client.Git.CreateCommit(ctx, *sourceOwner, *sourceRepo, commit, &opts)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Attach the commit to the master branch.\n\tref.Object.SHA = newCommit.SHA\n\t_, _, err = client.Git.UpdateRef(ctx, *sourceOwner, *sourceRepo, *ref.Ref, github.UpdateRef{\n\t\tSHA:   *newCommit.SHA,\n\t\tForce: github.Ptr(false),\n\t})\n\treturn err\n}\n\n// createPR creates a pull request. Based on: https://pkg.go.dev/github.com/google/go-github/v84/github#example-PullRequestsService-Create\nfunc createPR() (err error) {\n\tif *prSubject == \"\" {\n\t\treturn errors.New(\"missing `-pr-title` flag; skipping PR creation\")\n\t}\n\n\tif *prRepoOwner != \"\" && *prRepoOwner != *sourceOwner {\n\t\t*commitBranch = fmt.Sprintf(\"%v:%v\", *sourceOwner, *commitBranch)\n\t} else {\n\t\tprRepoOwner = sourceOwner\n\t}\n\n\tif *prRepo == \"\" {\n\t\tprRepo = sourceRepo\n\t}\n\n\tnewPR := &github.NewPullRequest{\n\t\tTitle:               prSubject,\n\t\tHead:                commitBranch,\n\t\tHeadRepo:            repoBranch,\n\t\tBase:                prBranch,\n\t\tBody:                prDescription,\n\t\tMaintainerCanModify: github.Ptr(true),\n\t}\n\n\tpr, _, err := client.PullRequests.Create(ctx, *prRepoOwner, *prRepo, newPR)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfmt.Printf(\"PR created: %v\\n\", pr.GetHTMLURL())\n\treturn nil\n}\n\nfunc main() {\n\tflag.Parse()\n\ttoken := os.Getenv(\"GITHUB_AUTH_TOKEN\")\n\tif token == \"\" {\n\t\tlog.Fatal(\"Unauthorized: No token present\")\n\t}\n\tif *sourceOwner == \"\" || *sourceRepo == \"\" || *commitBranch == \"\" || *sourceFiles == \"\" || *authorName == \"\" || *authorEmail == \"\" {\n\t\tlog.Fatal(\"You need to specify a non-empty value for the flags `-source-owner`, `-source-repo`, `-commit-branch`, `-files`, `-author-name` and `-author-email`\")\n\t}\n\tclient = github.NewClient(nil).WithAuthToken(token)\n\n\tref, err := getRef()\n\tif err != nil {\n\t\tlog.Fatalf(\"Unable to get/create the commit reference: %v\\n\", err)\n\t}\n\tif ref == nil {\n\t\tlog.Fatal(\"No error where returned but the reference is nil\")\n\t}\n\n\ttree, err := getTree(ref)\n\tif err != nil {\n\t\tlog.Fatalf(\"Unable to create the tree based on the provided files: %v\\n\", err)\n\t}\n\n\tif err := pushCommit(ref, tree); err != nil {\n\t\tlog.Fatalf(\"Unable to create the commit: %v\\n\", err)\n\t}\n\n\tif err := createPR(); err != nil {\n\t\tlog.Fatalf(\"Error while creating the pull request: %v\", err)\n\t}\n}\n"
  },
  {
    "path": "example/go.mod",
    "content": "module github.com/google/go-github/v84/example\n\ngo 1.25.5\n\nrequire (\n\tgithub.com/ProtonMail/go-crypto v1.4.1\n\tgithub.com/bradleyfalzon/ghinstallation/v2 v2.18.0\n\tgithub.com/gofri/go-github-pagination v1.0.1\n\tgithub.com/gofri/go-github-ratelimit/v2 v2.0.2\n\tgithub.com/google/go-github/v84 v84.0.0\n\tgithub.com/google/go-github/v84/otel v0.0.0-00010101000000-000000000000\n\tgithub.com/sigstore/sigstore-go v1.1.4\n\tgo.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.42.0\n\tgo.opentelemetry.io/otel/sdk v1.42.0\n\tgolang.org/x/crypto v0.49.0\n\tgolang.org/x/term v0.41.0\n\tgoogle.golang.org/appengine v1.6.8\n)\n\nrequire (\n\tgithub.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect\n\tgithub.com/blang/semver v3.5.1+incompatible // indirect\n\tgithub.com/cenkalti/backoff/v5 v5.0.3 // indirect\n\tgithub.com/cespare/xxhash/v2 v2.3.0 // indirect\n\tgithub.com/cloudflare/circl v1.6.3 // indirect\n\tgithub.com/cyberphone/json-canonicalization v0.0.0-20241213102144-19d51d7fe467 // indirect\n\tgithub.com/digitorus/pkcs7 v0.0.0-20230818184609-3a137a874352 // indirect\n\tgithub.com/digitorus/timestamp v0.0.0-20231217203849-220c5c2851b7 // indirect\n\tgithub.com/go-logr/logr v1.4.3 // indirect\n\tgithub.com/go-logr/stdr v1.2.2 // indirect\n\tgithub.com/go-openapi/analysis v0.24.1 // indirect\n\tgithub.com/go-openapi/errors v0.22.6 // indirect\n\tgithub.com/go-openapi/jsonpointer v0.22.4 // indirect\n\tgithub.com/go-openapi/jsonreference v0.21.4 // indirect\n\tgithub.com/go-openapi/loads v0.23.2 // indirect\n\tgithub.com/go-openapi/runtime v0.29.2 // indirect\n\tgithub.com/go-openapi/spec v0.22.3 // indirect\n\tgithub.com/go-openapi/strfmt v0.25.0 // indirect\n\tgithub.com/go-openapi/swag v0.25.4 // indirect\n\tgithub.com/go-openapi/swag/cmdutils v0.25.4 // indirect\n\tgithub.com/go-openapi/swag/conv v0.25.4 // indirect\n\tgithub.com/go-openapi/swag/fileutils v0.25.4 // indirect\n\tgithub.com/go-openapi/swag/jsonname v0.25.4 // indirect\n\tgithub.com/go-openapi/swag/jsonutils v0.25.4 // indirect\n\tgithub.com/go-openapi/swag/loading v0.25.4 // indirect\n\tgithub.com/go-openapi/swag/mangling v0.25.4 // indirect\n\tgithub.com/go-openapi/swag/netutils v0.25.4 // indirect\n\tgithub.com/go-openapi/swag/stringutils v0.25.4 // indirect\n\tgithub.com/go-openapi/swag/typeutils v0.25.4 // indirect\n\tgithub.com/go-openapi/swag/yamlutils v0.25.4 // indirect\n\tgithub.com/go-openapi/validate v0.25.1 // indirect\n\tgithub.com/go-viper/mapstructure/v2 v2.4.0 // indirect\n\tgithub.com/golang-jwt/jwt/v4 v4.5.2 // indirect\n\tgithub.com/golang/protobuf v1.5.4 // indirect\n\tgithub.com/google/certificate-transparency-go v1.3.2 // indirect\n\tgithub.com/google/go-containerregistry v0.20.7 // indirect\n\tgithub.com/google/go-querystring v1.2.0 // indirect\n\tgithub.com/google/uuid v1.6.0 // indirect\n\tgithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect\n\tgithub.com/in-toto/attestation v1.1.2 // indirect\n\tgithub.com/in-toto/in-toto-golang v0.9.0 // indirect\n\tgithub.com/oklog/ulid v1.3.1 // indirect\n\tgithub.com/opencontainers/go-digest v1.0.0 // indirect\n\tgithub.com/pkg/errors v0.9.1 // indirect\n\tgithub.com/secure-systems-lab/go-securesystemslib v0.10.0 // indirect\n\tgithub.com/shibumi/go-pathspec v1.3.0 // indirect\n\tgithub.com/sigstore/protobuf-specs v0.5.0 // indirect\n\tgithub.com/sigstore/rekor v1.5.0 // indirect\n\tgithub.com/sigstore/rekor-tiles/v2 v2.0.1 // indirect\n\tgithub.com/sigstore/sigstore v1.10.4 // indirect\n\tgithub.com/sigstore/timestamp-authority/v2 v2.0.3 // indirect\n\tgithub.com/theupdateframework/go-tuf/v2 v2.4.1 // indirect\n\tgithub.com/transparency-dev/formats v0.0.0-20251017110053-404c0d5b696c // indirect\n\tgithub.com/transparency-dev/merkle v0.0.2 // indirect\n\tgo.mongodb.org/mongo-driver v1.17.6 // indirect\n\tgo.opentelemetry.io/auto/sdk v1.2.1 // indirect\n\tgo.opentelemetry.io/otel v1.42.0 // indirect\n\tgo.opentelemetry.io/otel/metric v1.42.0 // indirect\n\tgo.opentelemetry.io/otel/trace v1.42.0 // indirect\n\tgo.yaml.in/yaml/v3 v3.0.4 // indirect\n\tgolang.org/x/mod v0.33.0 // indirect\n\tgolang.org/x/net v0.51.0 // indirect\n\tgolang.org/x/sync v0.20.0 // indirect\n\tgolang.org/x/sys v0.42.0 // indirect\n\tgolang.org/x/text v0.35.0 // indirect\n\tgoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect\n\tgoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b // indirect\n\tgoogle.golang.org/grpc v1.79.3 // indirect\n\tgoogle.golang.org/protobuf v1.36.11 // indirect\n)\n\n// Use version at HEAD, not the latest published.\nreplace github.com/google/go-github/v84 => ../\n\nreplace github.com/google/go-github/v84/otel => ../otel\n"
  },
  {
    "path": "example/go.sum",
    "content": "cloud.google.com/go v0.121.6 h1:waZiuajrI28iAf40cWgycWNgaXPO06dupuS+sgibK6c=\ncloud.google.com/go v0.121.6/go.mod h1:coChdst4Ea5vUpiALcYKXEpR1S9ZgXbhEzzMcMR66vI=\ncloud.google.com/go/auth v0.18.0 h1:wnqy5hrv7p3k7cShwAU/Br3nzod7fxoqG+k0VZ+/Pk0=\ncloud.google.com/go/auth v0.18.0/go.mod h1:wwkPM1AgE1f2u6dG443MiWoD8C3BtOywNsUMcUTVDRo=\ncloud.google.com/go/auth/oauth2adapt v0.2.8 h1:keo8NaayQZ6wimpNSmW5OPc283g65QNIiLpZnkHRbnc=\ncloud.google.com/go/auth/oauth2adapt v0.2.8/go.mod h1:XQ9y31RkqZCcwJWNSx2Xvric3RrU88hAYYbjDWYDL+c=\ncloud.google.com/go/compute/metadata v0.9.0 h1:pDUj4QMoPejqq20dK0Pg2N4yG9zIkYGdBtwLoEkH9Zs=\ncloud.google.com/go/compute/metadata v0.9.0/go.mod h1:E0bWwX5wTnLPedCKqk3pJmVgCBSM6qQI1yTBdEb3C10=\ncloud.google.com/go/iam v1.5.3 h1:+vMINPiDF2ognBJ97ABAYYwRgsaqxPbQDlMnbHMjolc=\ncloud.google.com/go/iam v1.5.3/go.mod h1:MR3v9oLkZCTlaqljW6Eb2d3HGDGK5/bDv93jhfISFvU=\ncloud.google.com/go/kms v1.23.2 h1:4IYDQL5hG4L+HzJBhzejUySoUOheh3Lk5YT4PCyyW6k=\ncloud.google.com/go/kms v1.23.2/go.mod h1:rZ5kK0I7Kn9W4erhYVoIRPtpizjunlrfU4fUkumUp8g=\ncloud.google.com/go/longrunning v0.7.0 h1:FV0+SYF1RIj59gyoWDRi45GiYUMM3K1qO51qoboQT1E=\ncloud.google.com/go/longrunning v0.7.0/go.mod h1:ySn2yXmjbK9Ba0zsQqunhDkYi0+9rlXIwnoAf+h+TPY=\nfilippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=\nfilippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=\ngithub.com/AdamKorcz/go-fuzz-headers-1 v0.0.0-20230919221257-8b5d3ce2d11d h1:zjqpY4C7H15HjRPEenkS4SAn3Jy2eRRjkjZbGR30TOg=\ngithub.com/AdamKorcz/go-fuzz-headers-1 v0.0.0-20230919221257-8b5d3ce2d11d/go.mod h1:XNqJ7hv2kY++g8XEHREpi+JqZo3+0l+CH2egBVN4yqM=\ngithub.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0 h1:JXg2dwJUmPB9JmtVmdEB16APJ7jurfbY5jnfXpJoRMc=\ngithub.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0/go.mod h1:YD5h/ldMsG0XiIw7PdyNhLxaM317eFh5yNLccNfGdyw=\ngithub.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 h1:Hk5QBxZQC1jb2Fwj6mpzme37xbCDdNTxU7O9eb5+LB4=\ngithub.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1/go.mod h1:IYus9qsFobWIc2YVwe/WPjcnyCkPKtnHAqUYeebc8z0=\ngithub.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 h1:9iefClla7iYpfYWdzPCRDozdmndjTm8DXdpCzPajMgA=\ngithub.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2/go.mod h1:XtLgD3ZD34DAaVIIAyG3objl5DynM3CQ/vMcbBNJZGI=\ngithub.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.4.0 h1:E4MgwLBGeVB5f2MdcIVD3ELVAWpr+WD6MUe1i+tM/PA=\ngithub.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.4.0/go.mod h1:Y2b/1clN4zsAoUd/pgNAQHjLDnTis/6ROkUfyob6psM=\ngithub.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.2.0 h1:nCYfgcSyHZXJI8J0IWE5MsCGlb2xp9fJiXyxWgmOFg4=\ngithub.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.2.0/go.mod h1:ucUjca2JtSZboY8IoUqyQyuuXvwbMBVwFOm0vdQPNhA=\ngithub.com/AzureAD/microsoft-authentication-library-for-go v1.6.0 h1:XRzhVemXdgvJqCH0sFfrBUTnUJSBrBf7++ypk+twtRs=\ngithub.com/AzureAD/microsoft-authentication-library-for-go v1.6.0/go.mod h1:HKpQxkWaGLJ+D/5H8QRpyQXA1eKjxkFlOMwck5+33Jk=\ngithub.com/ProtonMail/go-crypto v1.4.1 h1:9RfcZHqEQUvP8RzecWEUafnZVtEvrBVL9BiF67IQOfM=\ngithub.com/ProtonMail/go-crypto v1.4.1/go.mod h1:e1OaTyu5SYVrO9gKOEhTc+5UcXtTUa+P3uLudwcgPqo=\ngithub.com/alessio/shellescape v1.4.1 h1:V7yhSDDn8LP4lc4jS8pFkt0zCnzVJlG5JXy9BVKJUX0=\ngithub.com/alessio/shellescape v1.4.1/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30=\ngithub.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=\ngithub.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=\ngithub.com/aws/aws-sdk-go v1.55.7 h1:UJrkFq7es5CShfBwlWAC8DA077vp8PyVbQd3lqLiztE=\ngithub.com/aws/aws-sdk-go v1.55.7/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=\ngithub.com/aws/aws-sdk-go-v2 v1.41.0 h1:tNvqh1s+v0vFYdA1xq0aOJH+Y5cRyZ5upu6roPgPKd4=\ngithub.com/aws/aws-sdk-go-v2 v1.41.0/go.mod h1:MayyLB8y+buD9hZqkCW3kX1AKq07Y5pXxtgB+rRFhz0=\ngithub.com/aws/aws-sdk-go-v2/config v1.32.5 h1:pz3duhAfUgnxbtVhIK39PGF/AHYyrzGEyRD9Og0QrE8=\ngithub.com/aws/aws-sdk-go-v2/config v1.32.5/go.mod h1:xmDjzSUs/d0BB7ClzYPAZMmgQdrodNjPPhd6bGASwoE=\ngithub.com/aws/aws-sdk-go-v2/credentials v1.19.5 h1:xMo63RlqP3ZZydpJDMBsH9uJ10hgHYfQFIk1cHDXrR4=\ngithub.com/aws/aws-sdk-go-v2/credentials v1.19.5/go.mod h1:hhbH6oRcou+LpXfA/0vPElh/e0M3aFeOblE1sssAAEk=\ngithub.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.16 h1:80+uETIWS1BqjnN9uJ0dBUaETh+P1XwFy5vwHwK5r9k=\ngithub.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.16/go.mod h1:wOOsYuxYuB/7FlnVtzeBYRcjSRtQpAW0hCP7tIULMwo=\ngithub.com/aws/aws-sdk-go-v2/internal/configsources v1.4.16 h1:rgGwPzb82iBYSvHMHXc8h9mRoOUBZIGFgKb9qniaZZc=\ngithub.com/aws/aws-sdk-go-v2/internal/configsources v1.4.16/go.mod h1:L/UxsGeKpGoIj6DxfhOWHWQ/kGKcd4I1VncE4++IyKA=\ngithub.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.16 h1:1jtGzuV7c82xnqOVfx2F0xmJcOw5374L7N6juGW6x6U=\ngithub.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.16/go.mod h1:M2E5OQf+XLe+SZGmmpaI2yy+J326aFf6/+54PoxSANc=\ngithub.com/aws/aws-sdk-go-v2/internal/ini v1.8.4 h1:WKuaxf++XKWlHWu9ECbMlha8WOEGm0OUEZqm4K/Gcfk=\ngithub.com/aws/aws-sdk-go-v2/internal/ini v1.8.4/go.mod h1:ZWy7j6v1vWGmPReu0iSGvRiise4YI5SkR3OHKTZ6Wuc=\ngithub.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.4 h1:0ryTNEdJbzUCEWkVXEXoqlXV72J5keC1GvILMOuD00E=\ngithub.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.4/go.mod h1:HQ4qwNZh32C3CBeO6iJLQlgtMzqeG17ziAA/3KDJFow=\ngithub.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.16 h1:oHjJHeUy0ImIV0bsrX0X91GkV5nJAyv1l1CC9lnO0TI=\ngithub.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.16/go.mod h1:iRSNGgOYmiYwSCXxXaKb9HfOEj40+oTKn8pTxMlYkRM=\ngithub.com/aws/aws-sdk-go-v2/service/kms v1.49.1 h1:U0asSZ3ifpuIehDPkRI2rxHbmFUMplDA2VeR9Uogrmw=\ngithub.com/aws/aws-sdk-go-v2/service/kms v1.49.1/go.mod h1:NZo9WJqQ0sxQ1Yqu1IwCHQFQunTms2MlVgejg16S1rY=\ngithub.com/aws/aws-sdk-go-v2/service/signin v1.0.4 h1:HpI7aMmJ+mm1wkSHIA2t5EaFFv5EFYXePW30p1EIrbQ=\ngithub.com/aws/aws-sdk-go-v2/service/signin v1.0.4/go.mod h1:C5RdGMYGlfM0gYq/tifqgn4EbyX99V15P2V3R+VHbQU=\ngithub.com/aws/aws-sdk-go-v2/service/sso v1.30.7 h1:eYnlt6QxnFINKzwxP5/Ucs1vkG7VT3Iezmvfgc2waUw=\ngithub.com/aws/aws-sdk-go-v2/service/sso v1.30.7/go.mod h1:+fWt2UHSb4kS7Pu8y+BMBvJF0EWx+4H0hzNwtDNRTrg=\ngithub.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.12 h1:AHDr0DaHIAo8c9t1emrzAlVDFp+iMMKnPdYy6XO4MCE=\ngithub.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.12/go.mod h1:GQ73XawFFiWxyWXMHWfhiomvP3tXtdNar/fi8z18sx0=\ngithub.com/aws/aws-sdk-go-v2/service/sts v1.41.5 h1:SciGFVNZ4mHdm7gpD1dgZYnCuVdX1s+lFTg4+4DOy70=\ngithub.com/aws/aws-sdk-go-v2/service/sts v1.41.5/go.mod h1:iW40X4QBmUxdP+fZNOpfmkdMZqsovezbAeO+Ubiv2pk=\ngithub.com/aws/smithy-go v1.24.0 h1:LpilSUItNPFr1eY85RYgTIg5eIEPtvFbskaFcmmIUnk=\ngithub.com/aws/smithy-go v1.24.0/go.mod h1:LEj2LM3rBRQJxPZTB4KuzZkaZYnZPnvgIhb4pu07mx0=\ngithub.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ=\ngithub.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=\ngithub.com/bradleyfalzon/ghinstallation/v2 v2.18.0 h1:WPqnN6NS9XvYlOgZQAIseN7Z1uAiE+UxgDKlW7FvFuU=\ngithub.com/bradleyfalzon/ghinstallation/v2 v2.18.0/go.mod h1:gpoSwwWc4biE49F7n+roCcpkEkZ1Qr9soZ2ESvMiouU=\ngithub.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=\ngithub.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=\ngithub.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM=\ngithub.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw=\ngithub.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=\ngithub.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=\ngithub.com/cloudflare/circl v1.6.3 h1:9GPOhQGF9MCYUeXyMYlqTR6a5gTrgR/fBLXvUgtVcg8=\ngithub.com/cloudflare/circl v1.6.3/go.mod h1:2eXP6Qfat4O/Yhh8BznvKnJ+uzEoTQ6jVKJRn81BiS4=\ngithub.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb h1:EDmT6Q9Zs+SbUoc7Ik9EfrFqcylYqgPZ9ANSbTAntnE=\ngithub.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb/go.mod h1:ZjrT6AXHbDs86ZSdt/osfBi5qfexBrKUdONk989Wnk4=\ngithub.com/coreos/go-oidc/v3 v3.17.0 h1:hWBGaQfbi0iVviX4ibC7bk8OKT5qNr4klBaCHVNvehc=\ngithub.com/coreos/go-oidc/v3 v3.17.0/go.mod h1:wqPbKFrVnE90vty060SB40FCJ8fTHTxSwyXJqZH+sI8=\ngithub.com/cyberphone/json-canonicalization v0.0.0-20241213102144-19d51d7fe467 h1:uX1JmpONuD549D73r6cgnxyUu18Zb7yHAy5AYU0Pm4Q=\ngithub.com/cyberphone/json-canonicalization v0.0.0-20241213102144-19d51d7fe467/go.mod h1:uzvlm1mxhHkdfqitSA92i7Se+S9ksOn3a3qmv/kyOCw=\ngithub.com/danieljoos/wincred v1.2.0 h1:ozqKHaLK0W/ii4KVbbvluM91W2H3Sh0BncbUNPS7jLE=\ngithub.com/danieljoos/wincred v1.2.0/go.mod h1:FzQLLMKBFdvu+osBrnFODiv32YGwCfx0SkRa/eYHgec=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=\ngithub.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/digitorus/pkcs7 v0.0.0-20230713084857-e76b763bdc49/go.mod h1:SKVExuS+vpu2l9IoOc0RwqE7NYnb0JlcFHFnEJkVDzc=\ngithub.com/digitorus/pkcs7 v0.0.0-20230818184609-3a137a874352 h1:ge14PCmCvPjpMQMIAH7uKg0lrtNSOdpYsRXlwk3QbaE=\ngithub.com/digitorus/pkcs7 v0.0.0-20230818184609-3a137a874352/go.mod h1:SKVExuS+vpu2l9IoOc0RwqE7NYnb0JlcFHFnEJkVDzc=\ngithub.com/digitorus/timestamp v0.0.0-20231217203849-220c5c2851b7 h1:lxmTCgmHE1GUYL7P0MlNa00M67axePTq+9nBSGddR8I=\ngithub.com/digitorus/timestamp v0.0.0-20231217203849-220c5c2851b7/go.mod h1:GvWntX9qiTlOud0WkQ6ewFm0LPy5JUR1Xo0Ngbd1w6Y=\ngithub.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=\ngithub.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=\ngithub.com/go-chi/chi v4.1.2+incompatible h1:fGFk2Gmi/YKXk0OmGfBh0WgmN3XB8lVnEyNz34tQRec=\ngithub.com/go-chi/chi/v5 v5.2.4 h1:WtFKPHwlywe8Srng8j2BhOD9312j9cGUxG1SP4V2cR4=\ngithub.com/go-chi/chi/v5 v5.2.4/go.mod h1:X7Gx4mteadT3eDOMTsXzmI4/rwUpOwBHLpAfupzFJP0=\ngithub.com/go-jose/go-jose/v4 v4.1.3 h1:CVLmWDhDVRa6Mi/IgCgaopNosCaHz7zrMeF9MlZRkrs=\ngithub.com/go-jose/go-jose/v4 v4.1.3/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08=\ngithub.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=\ngithub.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=\ngithub.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=\ngithub.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=\ngithub.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=\ngithub.com/go-openapi/analysis v0.24.1 h1:Xp+7Yn/KOnVWYG8d+hPksOYnCYImE3TieBa7rBOesYM=\ngithub.com/go-openapi/analysis v0.24.1/go.mod h1:dU+qxX7QGU1rl7IYhBC8bIfmWQdX4Buoea4TGtxXY84=\ngithub.com/go-openapi/errors v0.22.6 h1:eDxcf89O8odEnohIXwEjY1IB4ph5vmbUsBMsFNwXWPo=\ngithub.com/go-openapi/errors v0.22.6/go.mod h1:z9S8ASTUqx7+CP1Q8dD8ewGH/1JWFFLX/2PmAYNQLgk=\ngithub.com/go-openapi/jsonpointer v0.22.4 h1:dZtK82WlNpVLDW2jlA1YCiVJFVqkED1MegOUy9kR5T4=\ngithub.com/go-openapi/jsonpointer v0.22.4/go.mod h1:elX9+UgznpFhgBuaMQ7iu4lvvX1nvNsesQ3oxmYTw80=\ngithub.com/go-openapi/jsonreference v0.21.4 h1:24qaE2y9bx/q3uRK/qN+TDwbok1NhbSmGjjySRCHtC8=\ngithub.com/go-openapi/jsonreference v0.21.4/go.mod h1:rIENPTjDbLpzQmQWCj5kKj3ZlmEh+EFVbz3RTUh30/4=\ngithub.com/go-openapi/loads v0.23.2 h1:rJXAcP7g1+lWyBHC7iTY+WAF0rprtM+pm8Jxv1uQJp4=\ngithub.com/go-openapi/loads v0.23.2/go.mod h1:IEVw1GfRt/P2Pplkelxzj9BYFajiWOtY2nHZNj4UnWY=\ngithub.com/go-openapi/runtime v0.29.2 h1:UmwSGWNmWQqKm1c2MGgXVpC2FTGwPDQeUsBMufc5Yj0=\ngithub.com/go-openapi/runtime v0.29.2/go.mod h1:biq5kJXRJKBJxTDJXAa00DOTa/anflQPhT0/wmjuy+0=\ngithub.com/go-openapi/spec v0.22.3 h1:qRSmj6Smz2rEBxMnLRBMeBWxbbOvuOoElvSvObIgwQc=\ngithub.com/go-openapi/spec v0.22.3/go.mod h1:iIImLODL2loCh3Vnox8TY2YWYJZjMAKYyLH2Mu8lOZs=\ngithub.com/go-openapi/strfmt v0.25.0 h1:7R0RX7mbKLa9EYCTHRcCuIPcaqlyQiWNPTXwClK0saQ=\ngithub.com/go-openapi/strfmt v0.25.0/go.mod h1:nNXct7OzbwrMY9+5tLX4I21pzcmE6ccMGXl3jFdPfn8=\ngithub.com/go-openapi/swag v0.25.4 h1:OyUPUFYDPDBMkqyxOTkqDYFnrhuhi9NR6QVUvIochMU=\ngithub.com/go-openapi/swag v0.25.4/go.mod h1:zNfJ9WZABGHCFg2RnY0S4IOkAcVTzJ6z2Bi+Q4i6qFQ=\ngithub.com/go-openapi/swag/cmdutils v0.25.4 h1:8rYhB5n6WawR192/BfUu2iVlxqVR9aRgGJP6WaBoW+4=\ngithub.com/go-openapi/swag/cmdutils v0.25.4/go.mod h1:pdae/AFo6WxLl5L0rq87eRzVPm/XRHM3MoYgRMvG4A0=\ngithub.com/go-openapi/swag/conv v0.25.4 h1:/Dd7p0LZXczgUcC/Ikm1+YqVzkEeCc9LnOWjfkpkfe4=\ngithub.com/go-openapi/swag/conv v0.25.4/go.mod h1:3LXfie/lwoAv0NHoEuY1hjoFAYkvlqI/Bn5EQDD3PPU=\ngithub.com/go-openapi/swag/fileutils v0.25.4 h1:2oI0XNW5y6UWZTC7vAxC8hmsK/tOkWXHJQH4lKjqw+Y=\ngithub.com/go-openapi/swag/fileutils v0.25.4/go.mod h1:cdOT/PKbwcysVQ9Tpr0q20lQKH7MGhOEb6EwmHOirUk=\ngithub.com/go-openapi/swag/jsonname v0.25.4 h1:bZH0+MsS03MbnwBXYhuTttMOqk+5KcQ9869Vye1bNHI=\ngithub.com/go-openapi/swag/jsonname v0.25.4/go.mod h1:GPVEk9CWVhNvWhZgrnvRA6utbAltopbKwDu8mXNUMag=\ngithub.com/go-openapi/swag/jsonutils v0.25.4 h1:VSchfbGhD4UTf4vCdR2F4TLBdLwHyUDTd1/q4i+jGZA=\ngithub.com/go-openapi/swag/jsonutils v0.25.4/go.mod h1:7OYGXpvVFPn4PpaSdPHJBtF0iGnbEaTk8AvBkoWnaAY=\ngithub.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4 h1:IACsSvBhiNJwlDix7wq39SS2Fh7lUOCJRmx/4SN4sVo=\ngithub.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4/go.mod h1:Mt0Ost9l3cUzVv4OEZG+WSeoHwjWLnarzMePNDAOBiM=\ngithub.com/go-openapi/swag/loading v0.25.4 h1:jN4MvLj0X6yhCDduRsxDDw1aHe+ZWoLjW+9ZQWIKn2s=\ngithub.com/go-openapi/swag/loading v0.25.4/go.mod h1:rpUM1ZiyEP9+mNLIQUdMiD7dCETXvkkC30z53i+ftTE=\ngithub.com/go-openapi/swag/mangling v0.25.4 h1:2b9kBJk9JvPgxr36V23FxJLdwBrpijI26Bx5JH4Hp48=\ngithub.com/go-openapi/swag/mangling v0.25.4/go.mod h1:6dxwu6QyORHpIIApsdZgb6wBk/DPU15MdyYj/ikn0Hg=\ngithub.com/go-openapi/swag/netutils v0.25.4 h1:Gqe6K71bGRb3ZQLusdI8p/y1KLgV4M/k+/HzVSqT8H0=\ngithub.com/go-openapi/swag/netutils v0.25.4/go.mod h1:m2W8dtdaoX7oj9rEttLyTeEFFEBvnAx9qHd5nJEBzYg=\ngithub.com/go-openapi/swag/stringutils v0.25.4 h1:O6dU1Rd8bej4HPA3/CLPciNBBDwZj9HiEpdVsb8B5A8=\ngithub.com/go-openapi/swag/stringutils v0.25.4/go.mod h1:GTsRvhJW5xM5gkgiFe0fV3PUlFm0dr8vki6/VSRaZK0=\ngithub.com/go-openapi/swag/typeutils v0.25.4 h1:1/fbZOUN472NTc39zpa+YGHn3jzHWhv42wAJSN91wRw=\ngithub.com/go-openapi/swag/typeutils v0.25.4/go.mod h1:Ou7g//Wx8tTLS9vG0UmzfCsjZjKhpjxayRKTHXf2pTE=\ngithub.com/go-openapi/swag/yamlutils v0.25.4 h1:6jdaeSItEUb7ioS9lFoCZ65Cne1/RZtPBZ9A56h92Sw=\ngithub.com/go-openapi/swag/yamlutils v0.25.4/go.mod h1:MNzq1ulQu+yd8Kl7wPOut/YHAAU/H6hL91fF+E2RFwc=\ngithub.com/go-openapi/testify/enable/yaml/v2 v2.0.2 h1:0+Y41Pz1NkbTHz8NngxTuAXxEodtNSI1WG1c/m5Akw4=\ngithub.com/go-openapi/testify/enable/yaml/v2 v2.0.2/go.mod h1:kme83333GCtJQHXQ8UKX3IBZu6z8T5Dvy5+CW3NLUUg=\ngithub.com/go-openapi/testify/v2 v2.0.2 h1:X999g3jeLcoY8qctY/c/Z8iBHTbwLz7R2WXd6Ub6wls=\ngithub.com/go-openapi/testify/v2 v2.0.2/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54=\ngithub.com/go-openapi/validate v0.25.1 h1:sSACUI6Jcnbo5IWqbYHgjibrhhmt3vR6lCzKZnmAgBw=\ngithub.com/go-openapi/validate v0.25.1/go.mod h1:RMVyVFYte0gbSTaZ0N4KmTn6u/kClvAFp+mAVfS/DQc=\ngithub.com/go-sql-driver/mysql v1.9.3 h1:U/N249h2WzJ3Ukj8SowVFjdtZKfu9vlLZxjPXV1aweo=\ngithub.com/go-sql-driver/mysql v1.9.3/go.mod h1:qn46aNg1333BRMNU69Lq93t8du/dwxI64Gl8i5p1WMU=\ngithub.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=\ngithub.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=\ngithub.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk=\ngithub.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=\ngithub.com/gofri/go-github-pagination v1.0.1 h1:j5uJRx65i/Ta2M0QSgiPcyokY69JnCQglt4n9pspFhY=\ngithub.com/gofri/go-github-pagination v1.0.1/go.mod h1:Qij55Fb4fNPjam3SB+8cLnqp4pgR8RGMyIspYXcyHX0=\ngithub.com/gofri/go-github-ratelimit/v2 v2.0.2 h1:gS8wAS1jTmlWGdTjAM7KIpsLjwY1S0S/gKK5hthfSXM=\ngithub.com/gofri/go-github-ratelimit/v2 v2.0.2/go.mod h1:YBQt4gTbdcbMjJFT05YFEaECwH78P5b0IwrnbLiHGdE=\ngithub.com/golang-jwt/jwt/v4 v4.5.2 h1:YtQM7lnr8iZ+j5q71MGKkNw9Mn7AjHM68uc9g5fXeUI=\ngithub.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=\ngithub.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo=\ngithub.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE=\ngithub.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=\ngithub.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=\ngithub.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=\ngithub.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=\ngithub.com/google/certificate-transparency-go v1.3.2 h1:9ahSNZF2o7SYMaKaXhAumVEzXB2QaayzII9C8rv7v+A=\ngithub.com/google/certificate-transparency-go v1.3.2/go.mod h1:H5FpMUaGa5Ab2+KCYsxg6sELw3Flkl7pGZzWdBoYLXs=\ngithub.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=\ngithub.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/go-containerregistry v0.20.7 h1:24VGNpS0IwrOZ2ms2P1QE3Xa5X9p4phx0aUgzYzHW6I=\ngithub.com/google/go-containerregistry v0.20.7/go.mod h1:Lx5LCZQjLH1QBaMPeGwsME9biPeo1lPx6lbGj/UmzgM=\ngithub.com/google/go-querystring v1.2.0 h1:yhqkPbu2/OH+V9BfpCVPZkNmUXhb2gBxJArfhIxNtP0=\ngithub.com/google/go-querystring v1.2.0/go.mod h1:8IFJqpSRITyJ8QhQ13bmbeMBDfmeEJZD5A0egEOmkqU=\ngithub.com/google/s2a-go v0.1.9 h1:LGD7gtMgezd8a/Xak7mEWL0PjoTQFvpRudN895yqKW0=\ngithub.com/google/s2a-go v0.1.9/go.mod h1:YA0Ei2ZQL3acow2O62kdp9UlnvMmU7kA6Eutn0dXayM=\ngithub.com/google/trillian v1.7.2 h1:EPBxc4YWY4Ak8tcuhyFleY+zYlbCDCa4Sn24e1Ka8Js=\ngithub.com/google/trillian v1.7.2/go.mod h1:mfQJW4qRH6/ilABtPYNBerVJAJ/upxHLX81zxNQw05s=\ngithub.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=\ngithub.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=\ngithub.com/googleapis/enterprise-certificate-proxy v0.3.9 h1:TOpi/QG8iDcZlkQlGlFUti/ZtyLkliXvHDcyUIMuFrU=\ngithub.com/googleapis/enterprise-certificate-proxy v0.3.9/go.mod h1:MkHOF77EYAE7qfSuSS9PU6g4Nt4e11cnsDUowfwewLA=\ngithub.com/googleapis/gax-go/v2 v2.16.0 h1:iHbQmKLLZrexmb0OSsNGTeSTS0HO4YvFOG8g5E4Zd0Y=\ngithub.com/googleapis/gax-go/v2 v2.16.0/go.mod h1:o1vfQjjNZn4+dPnRdl/4ZD7S9414Y4xA+a/6Icj6l14=\ngithub.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI=\ngithub.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=\ngithub.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3/go.mod h1:zQrxl1YP88HQlA6i9c63DSVPFklWpGX4OWAc9bFuaH4=\ngithub.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=\ngithub.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=\ngithub.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=\ngithub.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=\ngithub.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=\ngithub.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=\ngithub.com/hashicorp/go-retryablehttp v0.7.8 h1:ylXZWnqa7Lhqpk0L1P1LzDtGcCR0rPVUrx/c8Unxc48=\ngithub.com/hashicorp/go-retryablehttp v0.7.8/go.mod h1:rjiScheydd+CxvumBsIrFKlx3iS0jrZ7LvzFGFmuKbw=\ngithub.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc=\ngithub.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8=\ngithub.com/hashicorp/go-secure-stdlib/parseutil v0.2.0 h1:U+kC2dOhMFQctRfhK0gRctKAPTloZdMU5ZJxaesJ/VM=\ngithub.com/hashicorp/go-secure-stdlib/parseutil v0.2.0/go.mod h1:Ll013mhdmsVDuoIXVfBtvgGJsXDYkTw1kooNcoCXuE0=\ngithub.com/hashicorp/go-secure-stdlib/strutil v0.1.2 h1:kes8mmyCpxJsI7FTwtzRqEy9CdjCtrXrXGuOpxEA7Ts=\ngithub.com/hashicorp/go-secure-stdlib/strutil v0.1.2/go.mod h1:Gou2R9+il93BqX25LAKCLuM+y9U2T4hlwvT1yprcna4=\ngithub.com/hashicorp/go-sockaddr v1.0.7 h1:G+pTkSO01HpR5qCxg7lxfsFEZaG+C0VssTy/9dbT+Fw=\ngithub.com/hashicorp/go-sockaddr v1.0.7/go.mod h1:FZQbEYa1pxkQ7WLpyXJ6cbjpT8q0YgQaK/JakXqGyWw=\ngithub.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=\ngithub.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=\ngithub.com/hashicorp/hcl v1.0.1-vault-7 h1:ag5OxFVy3QYTFTJODRzTKVZ6xvdfLLCA1cy/Y6xGI0I=\ngithub.com/hashicorp/hcl v1.0.1-vault-7/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM=\ngithub.com/hashicorp/vault/api v1.22.0 h1:+HYFquE35/B74fHoIeXlZIP2YADVboaPjaSicHEZiH0=\ngithub.com/hashicorp/vault/api v1.22.0/go.mod h1:IUZA2cDvr4Ok3+NtK2Oq/r+lJeXkeCrHRmqdyWfpmGM=\ngithub.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef h1:A9HsByNhogrvm9cWb28sjiS3i7tcKCkflWFEkHfuAgM=\ngithub.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef/go.mod h1:lADxMC39cJJqL93Duh1xhAs4I2Zs8mKS89XWXFGp9cs=\ngithub.com/in-toto/attestation v1.1.2 h1:MBFn6lsMq6dptQZJBhalXTcWMb/aJy3V+GX3VYj/V1E=\ngithub.com/in-toto/attestation v1.1.2/go.mod h1:gYFddHMZj3DiQ0b62ltNi1Vj5rC879bTmBbrv9CRHpM=\ngithub.com/in-toto/in-toto-golang v0.9.0 h1:tHny7ac4KgtsfrG6ybU8gVOZux2H8jN05AXJ9EBM1XU=\ngithub.com/in-toto/in-toto-golang v0.9.0/go.mod h1:xsBVrVsHNsB61++S6Dy2vWosKhuA3lUTQd+eF9HdeMo=\ngithub.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=\ngithub.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=\ngithub.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=\ngithub.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=\ngithub.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=\ngithub.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=\ngithub.com/jackc/pgx/v5 v5.7.5 h1:JHGfMnQY+IEtGM63d+NGMjoRpysB2JBwDr5fsngwmJs=\ngithub.com/jackc/pgx/v5 v5.7.5/go.mod h1:aruU7o91Tc2q2cFp5h4uP3f6ztExVpyVv88Xl/8Vl8M=\ngithub.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo=\ngithub.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=\ngithub.com/jedisct1/go-minisign v0.0.0-20211028175153-1c139d1cc84b h1:ZGiXF8sz7PDk6RgkP+A/SFfUD0ZR/AgG6SpRNEDKZy8=\ngithub.com/jedisct1/go-minisign v0.0.0-20211028175153-1c139d1cc84b/go.mod h1:hQmNrgofl+IY/8L+n20H6E6PWBBTokdsv+q49j0QhsU=\ngithub.com/jellydator/ttlcache/v3 v3.4.0 h1:YS4P125qQS0tNhtL6aeYkheEaB/m8HCqdMMP4mnWdTY=\ngithub.com/jellydator/ttlcache/v3 v3.4.0/go.mod h1:Hw9EgjymziQD3yGsQdf1FqFdpp7YjFMd4Srg5EJlgD4=\ngithub.com/jmespath/go-jmespath v0.4.1-0.20220621161143-b0104c826a24 h1:liMMTbpW34dhU4az1GN0pTPADwNmvoRSeoZ6PItiqnY=\ngithub.com/jmespath/go-jmespath v0.4.1-0.20220621161143-b0104c826a24/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=\ngithub.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=\ngithub.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=\ngithub.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=\ngithub.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=\ngithub.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=\ngithub.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=\ngithub.com/letsencrypt/boulder v0.20251110.0 h1:J8MnKICeilO91dyQ2n5eBbab24neHzUpYMUIOdOtbjc=\ngithub.com/letsencrypt/boulder v0.20251110.0/go.mod h1:ogKCJQwll82m7OVHWyTuf8eeFCjuzdRQlgnZcCl0V+8=\ngithub.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=\ngithub.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=\ngithub.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=\ngithub.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=\ngithub.com/natefinch/atomic v1.0.1 h1:ZPYKxkqQOx3KZ+RsbnP/YsgvxWQPGxjC0oBt2AhwV0A=\ngithub.com/natefinch/atomic v1.0.1/go.mod h1:N/D/ELrljoqDyT3rZrsUmtsuzvHkeB/wWjHV22AZRbM=\ngithub.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4=\ngithub.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=\ngithub.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=\ngithub.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=\ngithub.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=\ngithub.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=\ngithub.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=\ngithub.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=\ngithub.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=\ngithub.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=\ngithub.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk=\ngithub.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc=\ngithub.com/sassoftware/relic v7.2.1+incompatible h1:Pwyh1F3I0r4clFJXkSI8bOyJINGqpgjJU3DYAZeI05A=\ngithub.com/sassoftware/relic v7.2.1+incompatible/go.mod h1:CWfAxv73/iLZ17rbyhIEq3K9hs5w6FpNMdUT//qR+zk=\ngithub.com/sassoftware/relic/v7 v7.6.2 h1:rS44Lbv9G9eXsukknS4mSjIAuuX+lMq/FnStgmZlUv4=\ngithub.com/sassoftware/relic/v7 v7.6.2/go.mod h1:kjmP0IBVkJZ6gXeAu35/KCEfca//+PKM6vTAsyDPY+k=\ngithub.com/secure-systems-lab/go-securesystemslib v0.10.0 h1:l+H5ErcW0PAehBNrBxoGv1jjNpGYdZ9RcheFkB2WI14=\ngithub.com/secure-systems-lab/go-securesystemslib v0.10.0/go.mod h1:MRKONWmRoFzPNQ9USRF9i1mc7MvAVvF1LlW8X5VWDvk=\ngithub.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=\ngithub.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=\ngithub.com/shibumi/go-pathspec v1.3.0 h1:QUyMZhFo0Md5B8zV8x2tesohbb5kfbpTi9rBnKh5dkI=\ngithub.com/shibumi/go-pathspec v1.3.0/go.mod h1:Xutfslp817l2I1cZvgcfeMQJG5QnU2lh5tVaaMCl3jE=\ngithub.com/sigstore/protobuf-specs v0.5.0 h1:F8YTI65xOHw70NrvPwJ5PhAzsvTnuJMGLkA4FIkofAY=\ngithub.com/sigstore/protobuf-specs v0.5.0/go.mod h1:+gXR+38nIa2oEupqDdzg4qSBT0Os+sP7oYv6alWewWc=\ngithub.com/sigstore/rekor v1.5.0 h1:rL7SghHd5HLCtsCrxw0yQg+NczGvM75EjSPPWuGjaiQ=\ngithub.com/sigstore/rekor v1.5.0/go.mod h1:D7JoVCUkxwQOpPDNYeu+CE8zeBC18Y5uDo6tF8s2rcQ=\ngithub.com/sigstore/rekor-tiles/v2 v2.0.1 h1:1Wfz15oSRNGF5Dzb0lWn5W8+lfO50ork4PGIfEKjZeo=\ngithub.com/sigstore/rekor-tiles/v2 v2.0.1/go.mod h1:Pjsbhzj5hc3MKY8FfVTYHBUHQEnP0ozC4huatu4x7OU=\ngithub.com/sigstore/sigstore v1.10.4 h1:ytOmxMgLdcUed3w1SbbZOgcxqwMG61lh1TmZLN+WeZE=\ngithub.com/sigstore/sigstore v1.10.4/go.mod h1:tDiyrdOref3q6qJxm2G+JHghqfmvifB7hw+EReAfnbI=\ngithub.com/sigstore/sigstore-go v1.1.4 h1:wTTsgCHOfqiEzVyBYA6mDczGtBkN7cM8mPpjJj5QvMg=\ngithub.com/sigstore/sigstore-go v1.1.4/go.mod h1:2U/mQOT9cjjxrtIUeKDVhL+sHBKsnWddn8URlswdBsg=\ngithub.com/sigstore/sigstore/pkg/signature/kms/aws v1.10.3 h1:D/FRl5J9UYAJPGZRAJbP0dH78pfwWnKsyCSBwFBU8CI=\ngithub.com/sigstore/sigstore/pkg/signature/kms/aws v1.10.3/go.mod h1:2GIWuNvTRMvrzd0Nl8RNqxrt9H7X0OBStwOSzGYRjYw=\ngithub.com/sigstore/sigstore/pkg/signature/kms/azure v1.10.3 h1:k5VMLf/ms7hh6MLgVoorM0K+hSMwZLXoywlxh4CXqP8=\ngithub.com/sigstore/sigstore/pkg/signature/kms/azure v1.10.3/go.mod h1:S1Bp3dmP7jYlXcGLAxG81wRbE01NIZING8ZIy0dJlAI=\ngithub.com/sigstore/sigstore/pkg/signature/kms/gcp v1.10.0 h1:iUEf5MZYOuXGnXxdF/WrarJrk0DTVHqeIOjYdtpVXtc=\ngithub.com/sigstore/sigstore/pkg/signature/kms/gcp v1.10.0/go.mod h1:i6vg5JfEQix46R1rhQlrKmUtJoeH91drltyYOJEk1T4=\ngithub.com/sigstore/sigstore/pkg/signature/kms/hashivault v1.10.3 h1:lJSdaC/aOlFHlvqmmV696n1HdXLMLEKGwpNZMV0sKts=\ngithub.com/sigstore/sigstore/pkg/signature/kms/hashivault v1.10.3/go.mod h1:b2rV9qPbt/jv/Yy75AIOZThP8j+pe1ZdLEjOwmjPdoA=\ngithub.com/sigstore/timestamp-authority/v2 v2.0.3 h1:sRyYNtdED/ttLCMdaYnwpf0zre1A9chvjTnCmWWxN8Y=\ngithub.com/sigstore/timestamp-authority/v2 v2.0.3/go.mod h1:mDaHxkt3HmZYoIlwYj4QWo0RUr7VjYU52aVO5f5Qb3I=\ngithub.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU=\ngithub.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4=\ngithub.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=\ngithub.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=\ngithub.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=\ngithub.com/theupdateframework/go-tuf v0.7.0 h1:CqbQFrWo1ae3/I0UCblSbczevCCbS31Qvs5LdxRWqRI=\ngithub.com/theupdateframework/go-tuf v0.7.0/go.mod h1:uEB7WSY+7ZIugK6R1hiBMBjQftaFzn7ZCDJcp1tCUug=\ngithub.com/theupdateframework/go-tuf/v2 v2.4.1 h1:K6ewW064rKZCPkRo1W/CTbTtm/+IB4+coG1iNURAGCw=\ngithub.com/theupdateframework/go-tuf/v2 v2.4.1/go.mod h1:Nex2enPVYDFCklrnbTzl3OVwD7fgIAj0J5++z/rvCj8=\ngithub.com/tink-crypto/tink-go-awskms/v2 v2.1.0 h1:N9UxlsOzu5mttdjhxkDLbzwtEecuXmlxZVo/ds7JKJI=\ngithub.com/tink-crypto/tink-go-awskms/v2 v2.1.0/go.mod h1:PxSp9GlOkKL9rlybW804uspnHuO9nbD98V/fDX4uSis=\ngithub.com/tink-crypto/tink-go-gcpkms/v2 v2.2.0 h1:3B9i6XBXNTRspfkTC0asN5W0K6GhOSgcujNiECNRNb0=\ngithub.com/tink-crypto/tink-go-gcpkms/v2 v2.2.0/go.mod h1:jY5YN2BqD/KSCHM9SqZPIpJNG/u3zwfLXHgws4x2IRw=\ngithub.com/tink-crypto/tink-go-hcvault/v2 v2.3.0 h1:6nAX1aRGnkg2SEUMwO5toB2tQkP0Jd6cbmZ/K5Le1V0=\ngithub.com/tink-crypto/tink-go-hcvault/v2 v2.3.0/go.mod h1:HOC5NWW1wBI2Vke1FGcRBvDATkEYE7AUDiYbXqi2sBw=\ngithub.com/tink-crypto/tink-go/v2 v2.5.0 h1:B8KLF6AofxdBIE4UJIaFbmoj5/1ehEtt7/MmzfI4Zpw=\ngithub.com/tink-crypto/tink-go/v2 v2.5.0/go.mod h1:2WbBA6pfNsAfBwDCggboaHeB2X29wkU8XHtGwh2YIk8=\ngithub.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 h1:e/5i7d4oYZ+C1wj2THlRK+oAhjeS/TRQwMfkIuet3w0=\ngithub.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399/go.mod h1:LdwHTNJT99C5fTAzDz0ud328OgXz+gierycbcIx2fRs=\ngithub.com/transparency-dev/formats v0.0.0-20251017110053-404c0d5b696c h1:5a2XDQ2LiAUV+/RjckMyq9sXudfrPSuCY4FuPC1NyAw=\ngithub.com/transparency-dev/formats v0.0.0-20251017110053-404c0d5b696c/go.mod h1:g85IafeFJZLxlzZCDRu4JLpfS7HKzR+Hw9qRh3bVzDI=\ngithub.com/transparency-dev/merkle v0.0.2 h1:Q9nBoQcZcgPamMkGn7ghV8XiTZ/kRxn1yCG81+twTK4=\ngithub.com/transparency-dev/merkle v0.0.2/go.mod h1:pqSy+OXefQ1EDUVmAJ8MUhHB9TXGuzVAT58PqBoHz1A=\ngithub.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=\ngithub.com/zalando/go-keyring v0.2.3 h1:v9CUu9phlABObO4LPWycf+zwMG7nlbb3t/B5wa97yms=\ngithub.com/zalando/go-keyring v0.2.3/go.mod h1:HL4k+OXQfJUWaMnqyuSOc0drfGPX2b51Du6K+MRgZMk=\ngo.mongodb.org/mongo-driver v1.17.6 h1:87JUG1wZfWsr6rIz3ZmpH90rL5tea7O3IHuSwHUpsss=\ngo.mongodb.org/mongo-driver v1.17.6/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ=\ngo.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=\ngo.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=\ngo.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 h1:YH4g8lQroajqUwWbq/tr2QX1JFmEXaDLgG+ew9bLMWo=\ngo.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0/go.mod h1:fvPi2qXDqFs8M4B4fmJhE92TyQs9Ydjlg3RvfUp+NbQ=\ngo.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 h1:RbKq8BG0FI8OiXhBfcRtqqHcZcka+gU3cskNuf05R18=\ngo.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0/go.mod h1:h06DGIukJOevXaj/xrNjhi/2098RZzcLTbc0jDAUbsg=\ngo.opentelemetry.io/otel v1.42.0 h1:lSQGzTgVR3+sgJDAU/7/ZMjN9Z+vUip7leaqBKy4sho=\ngo.opentelemetry.io/otel v1.42.0/go.mod h1:lJNsdRMxCUIWuMlVJWzecSMuNjE7dOYyWlqOXWkdqCc=\ngo.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.42.0 h1:s/1iRkCKDfhlh1JF26knRneorus8aOwVIDhvYx9WoDw=\ngo.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.42.0/go.mod h1:UI3wi0FXg1Pofb8ZBiBLhtMzgoTm1TYkMvn71fAqDzs=\ngo.opentelemetry.io/otel/metric v1.42.0 h1:2jXG+3oZLNXEPfNmnpxKDeZsFI5o4J+nz6xUlaFdF/4=\ngo.opentelemetry.io/otel/metric v1.42.0/go.mod h1:RlUN/7vTU7Ao/diDkEpQpnz3/92J9ko05BIwxYa2SSI=\ngo.opentelemetry.io/otel/sdk v1.42.0 h1:LyC8+jqk6UJwdrI/8VydAq/hvkFKNHZVIWuslJXYsDo=\ngo.opentelemetry.io/otel/sdk v1.42.0/go.mod h1:rGHCAxd9DAph0joO4W6OPwxjNTYWghRWmkHuGbayMts=\ngo.opentelemetry.io/otel/sdk/metric v1.42.0 h1:D/1QR46Clz6ajyZ3G8SgNlTJKBdGp84q9RKCAZ3YGuA=\ngo.opentelemetry.io/otel/sdk/metric v1.42.0/go.mod h1:Ua6AAlDKdZ7tdvaQKfSmnFTdHx37+J4ba8MwVCYM5hc=\ngo.opentelemetry.io/otel/trace v1.42.0 h1:OUCgIPt+mzOnaUTpOQcBiM/PLQ/Op7oq6g4LenLmOYY=\ngo.opentelemetry.io/otel/trace v1.42.0/go.mod h1:f3K9S+IFqnumBkKhRJMeaZeNk9epyhnCmQh/EysQCdc=\ngo.step.sm/crypto v0.74.0 h1:/APBEv45yYR4qQFg47HA8w1nesIGcxh44pGyQNw6JRA=\ngo.step.sm/crypto v0.74.0/go.mod h1:UoXqCAJjjRgzPte0Llaqen7O9P7XjPmgjgTHQGkKCDk=\ngo.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=\ngo.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=\ngo.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=\ngo.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=\ngo.uber.org/zap v1.27.1 h1:08RqriUEv8+ArZRYSTXy1LeBScaMpVSTBhCeaZYfMYc=\ngo.uber.org/zap v1.27.1/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=\ngo.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI=\ngo.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU=\ngo.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=\ngo.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=\ngolang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=\ngolang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=\ngolang.org/x/crypto v0.49.0 h1:+Ng2ULVvLHnJ/ZFEq4KdcDd/cfjrrjjNSXNzxg0Y4U4=\ngolang.org/x/crypto v0.49.0/go.mod h1:ErX4dUh2UM+CFYiXZRTcMpEcN8b/1gxEuv3nODoYtCA=\ngolang.org/x/exp v0.0.0-20250620022241-b7579e27df2b h1:M2rDM6z3Fhozi9O7NWsxAkg/yqS/lQJ6PmkyIV3YP+o=\ngolang.org/x/exp v0.0.0-20250620022241-b7579e27df2b/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8=\ngolang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=\ngolang.org/x/mod v0.33.0 h1:tHFzIWbBifEmbwtGz65eaWyGiGZatSrT9prnU8DbVL8=\ngolang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w=\ngolang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=\ngolang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=\ngolang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=\ngolang.org/x/net v0.51.0 h1:94R/GTO7mt3/4wIKpcR5gkGmRLOuE/2hNGeWq/GBIFo=\ngolang.org/x/net v0.51.0/go.mod h1:aamm+2QF5ogm02fjy5Bb7CQ0WMt1/WVM7FtyaTLlA9Y=\ngolang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw=\ngolang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=\ngolang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=\ngolang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=\ngolang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\ngolang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo=\ngolang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=\ngolang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=\ngolang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=\ngolang.org/x/term v0.41.0 h1:QCgPso/Q3RTJx2Th4bDLqML4W6iJiaXFq2/ftQF13YU=\ngolang.org/x/term v0.41.0/go.mod h1:3pfBgksrReYfZ5lvYM0kSO0LIkAl4Yl2bXOkKP7Ec2A=\ngolang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=\ngolang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=\ngolang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=\ngolang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=\ngolang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8=\ngolang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA=\ngolang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=\ngolang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=\ngolang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=\ngolang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=\ngolang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=\ngolang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngolang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=\ngonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=\ngoogle.golang.org/api v0.260.0 h1:XbNi5E6bOVEj/uLXQRlt6TKuEzMD7zvW/6tNwltE4P4=\ngoogle.golang.org/api v0.260.0/go.mod h1:Shj1j0Phr/9sloYrKomICzdYgsSDImpTxME8rGLaZ/o=\ngoogle.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=\ngoogle.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds=\ngoogle.golang.org/genproto v0.0.0-20251202230838-ff82c1b0f217 h1:GvESR9BIyHUahIb0NcTum6itIWtdoglGX+rnGxm2934=\ngoogle.golang.org/genproto v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:yJ2HH4EHEDTd3JiLmhds6NkJ17ITVYOdV3m3VKOnws0=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:+rXWjjaukWZun3mLfjmVnQi18E1AsFbDN9QdJ5YXLto=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b h1:Mv8VFug0MP9e5vUxfBcE3vUkV6CImK3cMNMIDFjmzxU=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ=\ngoogle.golang.org/grpc v1.79.3 h1:sybAEdRIEtvcD68Gx7dmnwjZKlyfuc61Dyo9pGXXkKE=\ngoogle.golang.org/grpc v1.79.3/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ=\ngoogle.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=\ngoogle.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=\ngoogle.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=\ngoogle.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\nk8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=\nk8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=\nsigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs=\nsigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4=\nsoftware.sslmate.com/src/go-pkcs12 v0.4.0 h1:H2g08FrTvSFKUj+D309j1DPfk5APnIdAQAB8aEykJ5k=\nsoftware.sslmate.com/src/go-pkcs12 v0.4.0/go.mod h1:Qiz0EyvDRJjjxGyUQa2cCNZn/wMyzrRJ/qcDXOQazLI=\n"
  },
  {
    "path": "example/listenvironments/main.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// listenvironments is an example of how to use ListEnvironments method with EnvironmentListOptions.\n// It's runnable with the following command:\n//\n//\texport GITHUB_TOKEN=your_token\n//\texport GITHUB_REPOSITORY_OWNER=your_owner\n//\texport GITHUB_REPOSITORY_NAME=your_repo\n//\tgo run .\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/google/go-github/v84/github\"\n)\n\nfunc main() {\n\ttoken := os.Getenv(\"GITHUB_AUTH_TOKEN\")\n\trepo := os.Getenv(\"GITHUB_REPOSITORY_NAME\")\n\towner := os.Getenv(\"GITHUB_REPOSITORY_OWNER\")\n\n\tif token == \"\" {\n\t\tlog.Fatal(\"Unauthorized: No token present\")\n\t}\n\n\tctx := context.Background()\n\tclient := github.NewClient(nil).WithAuthToken(token)\n\n\texpectedPageSize := 2\n\n\topts := &github.EnvironmentListOptions{ListOptions: github.ListOptions{PerPage: expectedPageSize}}\n\tenvResponse, _, err := client.Repositories.ListEnvironments(ctx, owner, repo, opts)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tif len(envResponse.Environments) != expectedPageSize {\n\t\tlog.Fatal(\"Unexpected number of environments returned\")\n\t}\n\n\t// The number of environments here should be equal to expectedPageSize\n\tfmt.Printf(\"%v environments returned\\n\", len(envResponse.Environments))\n}\n"
  },
  {
    "path": "example/migrations/main.go",
    "content": "// Copyright 2018 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// migrations demonstrates the functionality of\n// the user data migration API for the authenticated GitHub\n// user and lists all the user migrations.\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/google/go-github/v84/github\"\n)\n\nfunc fetchAllUserMigrations() ([]*github.UserMigration, error) {\n\tctx := context.Background()\n\tclient := github.NewClient(nil).WithAuthToken(\"<GITHUB_AUTH_TOKEN>\")\n\n\tmigrations, _, err := client.Migrations.ListUserMigrations(ctx, &github.ListOptions{Page: 1})\n\treturn migrations, err\n}\n\nfunc main() {\n\tmigrations, err := fetchAllUserMigrations()\n\tif err != nil {\n\t\tfmt.Printf(\"Error %v\\n\", err)\n\t\treturn\n\t}\n\n\tfor i, m := range migrations {\n\t\tfmt.Printf(\"%v. %v\", i+1, m.GetID())\n\t}\n}\n"
  },
  {
    "path": "example/newfilewithappauth/main.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// newfilewithappauth demonstrates the functionality of GitHub's app authentication\n// methods by fetching an installation access token and reauthenticating to GitHub\n// with OAuth configurations.\npackage main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/bradleyfalzon/ghinstallation/v2\"\n\t\"github.com/google/go-github/v84/github\"\n)\n\nfunc main() {\n\tconst gitHost = \"https://git.api.com\"\n\n\tprivatePem, err := os.ReadFile(\"path/to/pem\")\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to read pem: %v\", err)\n\t}\n\n\titr, err := ghinstallation.NewAppsTransport(http.DefaultTransport, 10, privatePem)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to create app transport: %v\\n\", err)\n\t}\n\titr.BaseURL = gitHost\n\n\t// create git client with app transport\n\tclient, err := github.NewClient(\n\t\t&http.Client{\n\t\t\tTransport: itr,\n\t\t\tTimeout:   time.Second * 30,\n\t\t},\n\t).WithEnterpriseURLs(gitHost, gitHost)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to create git client for app: %v\\n\", err)\n\t}\n\n\tinstallations, _, err := client.Apps.ListInstallations(context.Background(), &github.ListOptions{})\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to list installations: %v\\n\", err)\n\t}\n\n\t// capture our installationId for our app\n\t// we need this for the access token\n\tvar installID int64\n\tfor _, val := range installations {\n\t\tinstallID = val.GetID()\n\t}\n\n\ttoken, _, err := client.Apps.CreateInstallationToken(\n\t\tcontext.Background(),\n\t\tinstallID,\n\t\t&github.InstallationTokenOptions{})\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to create installation token: %v\\n\", err)\n\t}\n\n\tapiClient, err := github.NewClient(nil).WithAuthToken(\n\t\ttoken.GetToken(),\n\t).WithEnterpriseURLs(gitHost, gitHost)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to create new git client with token: %v\\n\", err)\n\t}\n\n\t_, resp, err := apiClient.Repositories.CreateFile(\n\t\tcontext.Background(),\n\t\t\"repoOwner\",\n\t\t\"sample-repo\",\n\t\t\"example/foo.txt\",\n\t\t&github.RepositoryContentFileOptions{\n\t\t\tContent: []byte(\"foo\"),\n\t\t\tMessage: github.Ptr(\"sample commit\"),\n\t\t\tSHA:     nil,\n\t\t})\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to create new file: %v\\n\", err)\n\t}\n\n\tlog.Printf(\"file written status code: %v\", resp.StatusCode)\n}\n"
  },
  {
    "path": "example/newrepo/main.go",
    "content": "// Copyright 2018 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// The newrepo command utilizes go-github as a cli tool for\n// creating new repositories. It takes an auth token as\n// an environment variable and creates the new repo under\n// the account affiliated with that token.\npackage main\n\nimport (\n\t\"context\"\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/google/go-github/v84/github\"\n)\n\nvar (\n\tname        = flag.String(\"name\", \"\", \"Name of repo to create in authenticated user's GitHub account.\")\n\tdescription = flag.String(\"description\", \"\", \"Description of created repo.\")\n\tprivate     = flag.Bool(\"private\", false, \"Will created repo be private.\")\n\tautoInit    = flag.Bool(\"auto-init\", false, \"Pass true to create an initial commit with empty README.\")\n)\n\nfunc main() {\n\tflag.Parse()\n\ttoken := os.Getenv(\"GITHUB_AUTH_TOKEN\")\n\tif token == \"\" {\n\t\tlog.Fatal(\"Unauthorized: No token present\")\n\t}\n\tif *name == \"\" {\n\t\tlog.Fatal(\"No name: New repos must be given a name\")\n\t}\n\tctx := context.Background()\n\tclient := github.NewClient(nil).WithAuthToken(token)\n\n\tr := &github.Repository{Name: name, Private: private, Description: description, AutoInit: autoInit}\n\trepo, _, err := client.Repositories.Create(ctx, \"\", r)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"Successfully created new repo: %v\\n\", repo.GetName())\n}\n"
  },
  {
    "path": "example/newreposecretwithlibsodium/go.mod",
    "content": "module newreposecretwithlibsodium\n\ngo 1.25.0\n\nrequire (\n\tgithub.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb\n\tgithub.com/google/go-github/v84 v84.0.0\n)\n\nrequire github.com/google/go-querystring v1.2.0 // indirect\n\n// Use version at HEAD, not the latest published.\nreplace github.com/google/go-github/v84 => ../..\n"
  },
  {
    "path": "example/newreposecretwithlibsodium/go.sum",
    "content": "github.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb h1:ilqSFSbR1fq6x88heeHrvAqlg+ES+tZk2ZcaCmiH1gI=\ngithub.com/GoKillers/libsodium-go v0.0.0-20171022220152-dd733721c3cb/go.mod h1:72TQeEkiDH9QMXZa5nJJvZre0UjqqO67X2QEIoOwCRU=\ngithub.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/go-querystring v1.2.0 h1:yhqkPbu2/OH+V9BfpCVPZkNmUXhb2gBxJArfhIxNtP0=\ngithub.com/google/go-querystring v1.2.0/go.mod h1:8IFJqpSRITyJ8QhQ13bmbeMBDfmeEJZD5A0egEOmkqU=\n"
  },
  {
    "path": "example/newreposecretwithlibsodium/main.go",
    "content": "// Copyright 2020 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// newreposecretwithlibsodium creates a new secret in GitHub for a given owner/repo.\n// newreposecretwithlibsodium depends on sodium being installed. Installation instructions for Sodium can be found at this url:\n// https://github.com/jedisct1/libsodium\n//\n// nnewreposecretwithlibsodium has two required flags for owner and repo, and takes in one argument for the name of the secret to add.\n// The secret value is pulled from an environment variable based on the secret name.\n// To authenticate with GitHub, provide your token via an environment variable GITHUB_AUTH_TOKEN.\n//\n// To verify the new secret, navigate to GitHub Repository > Settings > left side options bar > Secrets.\n//\n// Usage:\n//\n//\texport GITHUB_AUTH_TOKEN=<auth token from github that has secret create rights>\n//\texport SECRET_VARIABLE=<secret value of the secret variable>\n//\tgo run main.go -owner <owner name> -repo <repository name> SECRET_VARIABLE\n//\n// Example:\n//\n//\texport GITHUB_AUTH_TOKEN=0000000000000000\n//\texport SECRET_VARIABLE=\"my-secret\"\n//\tgo run main.go -owner google -repo go-github SECRET_VARIABLE\npackage main\n\nimport (\n\t\"context\"\n\t\"encoding/base64\"\n\t\"errors\"\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\tsodium \"github.com/GoKillers/libsodium-go/cryptobox\"\n\t\"github.com/google/go-github/v84/github\"\n)\n\nvar (\n\trepo  = flag.String(\"repo\", \"\", \"The repo that the secret should be added to, ex. go-github\")\n\towner = flag.String(\"owner\", \"\", \"The owner of there repo this should be added to, ex. google\")\n)\n\nfunc main() {\n\tflag.Parse()\n\n\ttoken := os.Getenv(\"GITHUB_AUTH_TOKEN\")\n\tif token == \"\" {\n\t\tlog.Fatal(\"please provide a GitHub API token via env variable GITHUB_AUTH_TOKEN\")\n\t}\n\n\tif *repo == \"\" {\n\t\tlog.Fatal(\"please provide required flag --repo to specify GitHub repository \")\n\t}\n\n\tif *owner == \"\" {\n\t\tlog.Fatal(\"please provide required flag --owner to specify GitHub user/org owner\")\n\t}\n\n\tsecretName, err := getSecretName()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tsecretValue, err := getSecretValue(secretName)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tctx := context.Background()\n\tclient := github.NewClient(nil).WithAuthToken(token)\n\n\tif err := addRepoSecret(ctx, client, *owner, *repo, secretName, secretValue); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfmt.Printf(\"Added secret %q to the repo %v/%v\\n\", secretName, *owner, *repo)\n}\n\nfunc getSecretName() (string, error) {\n\tsecretName := flag.Arg(0)\n\tif secretName == \"\" {\n\t\treturn \"\", fmt.Errorf(\"missing argument secret name\")\n\t}\n\treturn secretName, nil\n}\n\nfunc getSecretValue(secretName string) (string, error) {\n\tsecretValue := os.Getenv(secretName)\n\tif secretValue == \"\" {\n\t\treturn \"\", fmt.Errorf(\"secret value not found under env variable %q\", secretName)\n\t}\n\treturn secretValue, nil\n}\n\n// addRepoSecret will add a secret to a GitHub repo for use in GitHub Actions.\n//\n// Finally, the secretName and secretValue will determine the name of the secret added and it's corresponding value.\n//\n// The actual transmission of the secret value to GitHub using the api requires that the secret value is encrypted\n// using the public key of the target repo. This encryption is done using sodium.\n//\n// First, the public key of the repo is retrieved. The public key comes base64\n// encoded, so it must be decoded prior to use in sodiumlib.\n//\n// Second, the secret value is converted into a slice of bytes.\n//\n// Third, the secret is encrypted with sodium.CryptoBoxSeal using the repo's decoded public key.\n//\n// Fourth, the encrypted secret is encoded as a base64 string to be used in a github.EncodedSecret type.\n//\n// Fifth, The other two properties of the github.EncodedSecret type are determined. The name of the secret to be added\n// (string not base64), and the KeyID of the public key used to encrypt the secret.\n// This can be retrieved via the public key's GetKeyID method.\n//\n// Finally, the github.EncodedSecret is passed into the GitHub client.Actions.CreateOrUpdateRepoSecret method to\n// populate the secret in the GitHub repo.\nfunc addRepoSecret(ctx context.Context, client *github.Client, owner, repo, secretName, secretValue string) error {\n\tpublicKey, _, err := client.Actions.GetRepoPublicKey(ctx, owner, repo)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tencryptedSecret, err := encryptSecretWithPublicKey(publicKey, secretName, secretValue)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif _, err := client.Actions.CreateOrUpdateRepoSecret(ctx, owner, repo, encryptedSecret); err != nil {\n\t\treturn fmt.Errorf(\"client.Actions.CreateOrUpdateRepoSecret returned error: %v\", err)\n\t}\n\n\treturn nil\n}\n\nfunc encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName, secretValue string) (*github.EncryptedSecret, error) {\n\tdecodedPublicKey, err := base64.StdEncoding.DecodeString(publicKey.GetKey())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"base64.StdEncoding.DecodeString was unable to decode public key: %v\", err)\n\t}\n\n\tencryptedBytes, exit := sodium.CryptoBoxSeal([]byte(secretValue), decodedPublicKey)\n\tif exit != 0 {\n\t\treturn nil, errors.New(\"sodium.CryptoBoxSeal exited with non zero exit code\")\n\t}\n\n\tencryptedString := base64.StdEncoding.EncodeToString(encryptedBytes)\n\tkeyID := publicKey.GetKeyID()\n\tencryptedSecret := &github.EncryptedSecret{\n\t\tName:           secretName,\n\t\tKeyID:          keyID,\n\t\tEncryptedValue: encryptedString,\n\t}\n\treturn encryptedSecret, nil\n}\n"
  },
  {
    "path": "example/newreposecretwithxcrypto/main.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// newreposecretwithxcrypto creates a new secret in GitHub for a given owner/repo.\n// newreposecretwithxcrypto uses x/crypto/nacl/box instead of sodium.\n// It does not depend on any native libraries and is easier to cross-compile for different platforms.\n// Quite possibly there is a performance penalty due to this.\n//\n// newreposecretwithxcrypto has two required flags for owner and repo, and takes in one argument for the name of the secret to add.\n// The secret value is pulled from an environment variable based on the secret name.\n// To authenticate with GitHub, provide your token via an environment variable GITHUB_AUTH_TOKEN.\n//\n// To verify the new secret, navigate to GitHub Repository > Settings > left side options bar > Secrets.\n//\n// Usage:\n//\n//\texport GITHUB_AUTH_TOKEN=<auth token from github that has secret create rights>\n//\texport SECRET_VARIABLE=<secret value of the secret variable>\n//\tgo run main.go -owner <owner name> -repo <repository name> SECRET_VARIABLE\n//\n// Example:\n//\n//\texport GITHUB_AUTH_TOKEN=0000000000000000\n//\texport SECRET_VARIABLE=\"my-secret\"\n//\tgo run main.go -owner google -repo go-github SECRET_VARIABLE\npackage main\n\nimport (\n\t\"context\"\n\tcrypto_rand \"crypto/rand\"\n\t\"encoding/base64\"\n\t\"errors\"\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/google/go-github/v84/github\"\n\t\"golang.org/x/crypto/nacl/box\"\n)\n\nvar (\n\trepo  = flag.String(\"repo\", \"\", \"The repo that the secret should be added to, ex. go-github\")\n\towner = flag.String(\"owner\", \"\", \"The owner of there repo this should be added to, ex. google\")\n)\n\nfunc main() {\n\tflag.Parse()\n\n\ttoken := os.Getenv(\"GITHUB_AUTH_TOKEN\")\n\tif token == \"\" {\n\t\tlog.Fatal(\"please provide a GitHub API token via env variable GITHUB_AUTH_TOKEN\")\n\t}\n\n\tif *repo == \"\" {\n\t\tlog.Fatal(\"please provide required flag --repo to specify GitHub repository \")\n\t}\n\n\tif *owner == \"\" {\n\t\tlog.Fatal(\"please provide required flag --owner to specify GitHub user/org owner\")\n\t}\n\n\tsecretName, err := getSecretName()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tsecretValue, err := getSecretValue(secretName)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tctx := context.Background()\n\tclient := github.NewClient(nil).WithAuthToken(token)\n\n\tif err := addRepoSecret(ctx, client, *owner, *repo, secretName, secretValue); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfmt.Printf(\"Added secret %q to the repo %v/%v\\n\", secretName, *owner, *repo)\n}\n\nfunc getSecretName() (string, error) {\n\tsecretName := flag.Arg(0)\n\tif secretName == \"\" {\n\t\treturn \"\", errors.New(\"missing argument secret name\")\n\t}\n\treturn secretName, nil\n}\n\nfunc getSecretValue(secretName string) (string, error) {\n\tsecretValue := os.Getenv(secretName)\n\tif secretValue == \"\" {\n\t\treturn \"\", fmt.Errorf(\"secret value not found under env variable %q\", secretName)\n\t}\n\treturn secretValue, nil\n}\n\n// addRepoSecret will add a secret to a GitHub repo for use in GitHub Actions.\n//\n// The secretName and secretValue will determine the name of the secret added and it's corresponding value.\n//\n// The actual transmission of the secret value to GitHub using the api requires that the secret value is encrypted\n// using the public key of the target repo. This encryption is done using x/crypto/nacl/box.\n//\n// First, the public key of the repo is retrieved. The public key comes base64\n// encoded, so it must be decoded prior to use.\n//\n// Second, the decode key is converted into a fixed size byte array.\n//\n// Third, the secret value is converted into a slice of bytes.\n//\n// Fourth, the secret is encrypted with box.SealAnonymous using the repo's decoded public key.\n//\n// Fifth, the encrypted secret is encoded as a base64 string to be used in a github.EncodedSecret type.\n//\n// Sixth, The other two properties of the github.EncodedSecret type are determined. The name of the secret to be added\n// (string not base64), and the KeyID of the public key used to encrypt the secret.\n// This can be retrieved via the public key's GetKeyID method.\n//\n// Finally, the github.EncodedSecret is passed into the GitHub client.Actions.CreateOrUpdateRepoSecret method to\n// populate the secret in the GitHub repo.\nfunc addRepoSecret(ctx context.Context, client *github.Client, owner, repo, secretName, secretValue string) error {\n\tpublicKey, _, err := client.Actions.GetRepoPublicKey(ctx, owner, repo)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tencryptedSecret, err := encryptSecretWithPublicKey(publicKey, secretName, secretValue)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif _, err := client.Actions.CreateOrUpdateRepoSecret(ctx, owner, repo, encryptedSecret); err != nil {\n\t\treturn fmt.Errorf(\"client.Actions.CreateOrUpdateRepoSecret returned error: %v\", err)\n\t}\n\n\treturn nil\n}\n\nfunc encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName, secretValue string) (*github.EncryptedSecret, error) {\n\tdecodedPublicKey, err := base64.StdEncoding.DecodeString(publicKey.GetKey())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"base64.StdEncoding.DecodeString was unable to decode public key: %v\", err)\n\t}\n\n\tvar boxKey [32]byte\n\tcopy(boxKey[:], decodedPublicKey)\n\tencryptedBytes, err := box.SealAnonymous([]byte{}, []byte(secretValue), &boxKey, crypto_rand.Reader)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"box.SealAnonymous failed with error %w\", err)\n\t}\n\n\tencryptedString := base64.StdEncoding.EncodeToString(encryptedBytes)\n\tkeyID := publicKey.GetKeyID()\n\tencryptedSecret := &github.EncryptedSecret{\n\t\tName:           secretName,\n\t\tKeyID:          keyID,\n\t\tEncryptedValue: encryptedString,\n\t}\n\treturn encryptedSecret, nil\n}\n"
  },
  {
    "path": "example/otel/main.go",
    "content": "// Copyright 2026 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// This example demonstrates how to use the otel transport to instrument\n// the go-github client with OpenTelemetry tracing.\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\n\t\"github.com/google/go-github/v84/github\"\n\t\"github.com/google/go-github/v84/otel\"\n\t\"go.opentelemetry.io/otel/exporters/stdout/stdouttrace\"\n\t\"go.opentelemetry.io/otel/sdk/trace\"\n)\n\nfunc main() {\n\t// Initialize stdout exporter to see traces in console\n\texporter, err := stdouttrace.New(stdouttrace.WithPrettyPrint())\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to initialize stdouttrace exporter: %v\", err)\n\t}\n\n\ttp := trace.NewTracerProvider(\n\t\ttrace.WithBatcher(exporter),\n\t)\n\tdefer func() {\n\t\tif err := tp.Shutdown(context.Background()); err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t}()\n\n\t// Configure HTTP client with OTel transport\n\thttpClient := &http.Client{\n\t\tTransport: otel.NewTransport(\n\t\t\thttp.DefaultTransport,\n\t\t\totel.WithTracerProvider(tp),\n\t\t),\n\t}\n\n\tclient := github.NewClient(httpClient)\n\n\t// Make a request (Get Rate Limits is public and cheap)\n\tlimits, resp, err := client.RateLimit.Get(context.Background())\n\tif err != nil {\n\t\tlog.Printf(\"Error fetching rate limits: %v\", err)\n\t} else {\n\t\tfmt.Printf(\"Core Rate Limit: %v/%v (Resets at %v)\\n\",\n\t\t\tlimits.GetCore().Remaining,\n\t\t\tlimits.GetCore().Limit,\n\t\t\tlimits.GetCore().Reset)\n\t}\n\n\t// Check if we captured attributes in response\n\tif resp != nil {\n\t\tfmt.Printf(\"Response Status: %v\\n\", resp.Status)\n\t}\n}\n"
  },
  {
    "path": "example/ratelimit/main.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// The ratelimit command demonstrates using the github_ratelimit as well as github_pagination.\n// By using the waiter, the client automatically sleeps and retry requests\n// when it hits secondary rate limits.\n// It also prevents the client from abusing the API in case of a primary rate limit.\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/gofri/go-github-pagination/githubpagination\"\n\t\"github.com/gofri/go-github-ratelimit/v2/github_ratelimit\"\n\t\"github.com/gofri/go-github-ratelimit/v2/github_ratelimit/github_primary_ratelimit\"\n\t\"github.com/gofri/go-github-ratelimit/v2/github_ratelimit/github_secondary_ratelimit\"\n\t\"github.com/google/go-github/v84/github\"\n)\n\nfunc main() {\n\tvar username string\n\tfmt.Print(\"Enter GitHub username: \")\n\tfmt.Scanf(\"%s\", &username)\n\n\trateLimiter := github_ratelimit.New(nil,\n\t\tgithub_primary_ratelimit.WithLimitDetectedCallback(func(ctx *github_primary_ratelimit.CallbackContext) {\n\t\t\tfmt.Printf(\"Primary rate limit detected: category %v, reset time: %v\\n\", ctx.Category, ctx.ResetTime)\n\t\t}),\n\t\tgithub_secondary_ratelimit.WithLimitDetectedCallback(func(ctx *github_secondary_ratelimit.CallbackContext) {\n\t\t\tfmt.Printf(\"Secondary rate limit detected: reset time: %v, total sleep time: %v\\n\", ctx.ResetTime, ctx.TotalSleepTime)\n\t\t}),\n\t)\n\n\tpaginator := githubpagination.NewClient(rateLimiter,\n\t\tgithubpagination.WithPerPage(100), // default to 100 results per page\n\t)\n\tclient := github.NewClient(paginator)\n\n\t// arbitrary usage of the client\n\trepos, _, err := client.Repositories.ListByUser(context.Background(), username, nil)\n\tif err != nil {\n\t\tfmt.Printf(\"Error: %v\\n\", err)\n\t\treturn\n\t}\n\n\tfor i, repo := range repos {\n\t\tfmt.Printf(\"%v. %v\\n\", i+1, repo.GetName())\n\t}\n}\n"
  },
  {
    "path": "example/simple/main.go",
    "content": "// Copyright 2017 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// The simple command demonstrates a simple functionality which\n// prompts the user for a GitHub username and lists all the public\n// organization memberships of the specified username.\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/google/go-github/v84/github\"\n)\n\n// Fetch all the public organizations' membership of a user.\nfunc fetchOrganizations(username string) ([]*github.Organization, error) {\n\tclient := github.NewClient(nil)\n\torgs, _, err := client.Organizations.List(context.Background(), username, nil)\n\treturn orgs, err\n}\n\nfunc main() {\n\tvar username string\n\tfmt.Print(\"Enter GitHub username: \")\n\tfmt.Scanf(\"%s\", &username)\n\n\torganizations, err := fetchOrganizations(username)\n\tif err != nil {\n\t\tfmt.Printf(\"Error: %v\\n\", err)\n\t\treturn\n\t}\n\n\tfor i, organization := range organizations {\n\t\tfmt.Printf(\"%v. %v\\n\", i+1, organization.GetLogin())\n\t}\n}\n"
  },
  {
    "path": "example/tokenauth/main.go",
    "content": "// Copyright 2020 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// The tokenauth command demonstrates using a Personal Access Token (PAT) to\n// authenticate with GitHub.\n// You can test out a GitHub Personal Access Token using this simple example.\n// You can generate them here: https://github.com/settings/tokens\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/google/go-github/v84/github\"\n\t\"golang.org/x/term\"\n)\n\nfunc main() {\n\tfmt.Print(\"GitHub Token: \")\n\ttoken, _ := term.ReadPassword(int(os.Stdin.Fd()))\n\tfmt.Println()\n\n\tctx := context.Background()\n\tclient := github.NewClient(nil).WithAuthToken(string(token))\n\n\tuser, resp, err := client.Users.Get(ctx, \"\")\n\tif err != nil {\n\t\tfmt.Printf(\"\\nerror: %v\\n\", err)\n\t\treturn\n\t}\n\n\t// Rate.Limit should most likely be 5000 when authorized.\n\tlog.Printf(\"Rate: %#v\\n\", resp.Rate)\n\n\t// If a Token Expiration has been set, it will be displayed.\n\tif !resp.TokenExpiration.IsZero() {\n\t\tlog.Printf(\"Token Expiration: %v\\n\", resp.TokenExpiration)\n\t}\n\n\tfmt.Printf(\"\\n%v\\n\", github.Stringify(user))\n}\n"
  },
  {
    "path": "example/topics/main.go",
    "content": "// Copyright 2019 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// The simple command demonstrates the functionality that\n// prompts the user for a GitHub topic and lists all the entities\n// that are related to the specified topic or subject.\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/google/go-github/v84/github\"\n)\n\n// Fetch and lists all the public topics associated with the specified GitHub topic.\nfunc fetchTopics(topic string) (*github.TopicsSearchResult, error) {\n\tclient := github.NewClient(nil)\n\ttopics, _, err := client.Search.Topics(context.Background(), topic, nil)\n\treturn topics, err\n}\n\nfunc main() {\n\tvar topic string\n\tfmt.Print(\"Enter GitHub topic: \")\n\tfmt.Scanf(\"%s\", &topic)\n\n\ttopics, err := fetchTopics(topic)\n\tif err != nil {\n\t\tfmt.Printf(\"Error: %v\\n\", err)\n\t\treturn\n\t}\n\n\tfor _, topic := range topics.Topics {\n\t\tfmt.Println(*topic.Name)\n\t}\n}\n"
  },
  {
    "path": "example/uploadreleaseassetfromrelease/main.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// The uploadreleaseassetfromrelease example demonstrates how to upload\n// a release asset using the UploadReleaseAssetFromRelease helper.\npackage main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/google/go-github/v84/github\"\n)\n\nfunc main() {\n\ttoken := os.Getenv(\"GITHUB_AUTH_TOKEN\")\n\tif token == \"\" {\n\t\tlog.Fatal(\"GITHUB_AUTH_TOKEN not set\")\n\t}\n\n\tctx := context.Background()\n\tclient := github.NewClient(nil).WithAuthToken(token)\n\n\towner := \"OWNER\"\n\trepo := \"REPO\"\n\treleaseID := int64(1)\n\n\t// Fetch the release (UploadURL is populated by the API)\n\trelease, _, err := client.Repositories.GetRelease(ctx, owner, repo, releaseID)\n\tif err != nil {\n\t\tlog.Fatalf(\"GetRelease failed: %v\", err)\n\t}\n\n\t// Asset content\n\tdata := []byte(\"Hello from go-github!\\n\")\n\treader := bytes.NewReader(data)\n\tsize := int64(len(data))\n\n\topts := &github.UploadOptions{\n\t\tName:  \"example.txt\",\n\t\tLabel: \"Example asset\",\n\t}\n\n\tasset, _, err := client.Repositories.UploadReleaseAssetFromRelease(\n\t\tctx,\n\t\trelease,\n\t\topts,\n\t\treader,\n\t\tsize,\n\t)\n\tif err != nil {\n\t\tlog.Fatalf(\"UploadReleaseAssetFromRelease failed: %v\", err)\n\t}\n\n\tfmt.Printf(\"Uploaded asset ID: %v\\n\", asset.GetID())\n}\n"
  },
  {
    "path": "example/verifyartifact/main.go",
    "content": "// Copyright 2024 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// This is a simple example of how to verify an artifact\n// attestations hosted on GitHub using the sigstore-go library.\n// This is a very barebones example drawn from the sigstore-go\n// library's examples and should not be used in production.\npackage main\n\nimport (\n\t\"context\"\n\t\"encoding/hex\"\n\t\"encoding/json\"\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/google/go-github/v84/github\"\n\t\"github.com/sigstore/sigstore-go/pkg/bundle\"\n\t\"github.com/sigstore/sigstore-go/pkg/root\"\n\t\"github.com/sigstore/sigstore-go/pkg/verify\"\n)\n\nvar (\n\towner = flag.String(\"owner\", \"cli\", \"GitHub organization or user to scope attestation lookup by\")\n\t// You can use a utility like openssl or sha256sum to\n\t// compute the digest.\n\tartifactDigest = flag.String(\"artifact-digest\", \"\", \"The digest of the artifact\")\n\t// The algorithm used to compute the digest of the artifact.\n\t// Note that the GitHub API only currently support querying\n\t// by sha256 digest.\n\tartifactDigestAlgorithm = flag.String(\"artifact-digest-algorithm\", \"sha256\", \"The algorithm used to compute the digest of the artifact\")\n\t// Attestations produced by GitHub Actions use ID token\n\t// issued by GitHub.\n\texpectedIssuer = flag.String(\"expected-issuer\", \"https://token.actions.githubusercontent.com\", \"Issuer of the OIDC token\")\n\t// Subject Alternative Name is set to the calling workflow file.\n\t// This value will vary from repository to repository.\n\texpectedSAN = flag.String(\"expected-san\", \"https://github.com/cli/cli/.github/workflows/deployment.yml@refs/heads/trunk\", \"The expected Subject Alternative Name (SAN) of the certificate used to sign the attestation\")\n\t// Attestations produced by GitHub Actions use the public\n\t// good trust root maintained by Sigstore.\n\t// A copy is included in this repo for convenience.\n\t//\n\t// https://github.com/sigstore/root-signing/raw/refs/heads/main/targets/trusted_root.json\n\ttrustedRootJSONPath = flag.String(\"trusted-root-json-path\", \"verifyartifact/trusted-root-public-good.json\", \"Path to the trusted root JSON file\")\n)\n\nfunc usage() {\n\tfmt.Fprintln(os.Stderr, \"This is an example of how to verify the provenance of an artifact using GitHub Attestations and the sigstore-go library.\")\n\tfmt.Fprintf(os.Stderr, \"\\nUsage: %v [flags]\\n\", os.Args[0])\n\tfmt.Fprint(os.Stderr, \"\\nThe flags are:\\n\")\n\tflag.PrintDefaults()\n\tfmt.Fprintf(os.Stderr, `\nExample:\nVerifying a GitHub CLI artifact\n\t%v -owner cli \\\n\t\t-artifact-digest 2ce2e480e3c3f7ca0af83418d3ebaeedacee135dbac94bd946d7d84edabcdb64 \\\n\t\t-expected-san https://github.com/cli/cli/.github/workflows/deployment.yml@refs/heads/trunk\n\n\tSee https://github.com/cli/cli/attestations/2543768 for a summary of the attestation.\n`, os.Args[0])\n}\n\nfunc main() {\n\tflag.Parse()\n\tif *artifactDigest == \"\" {\n\t\tfmt.Fprintln(os.Stderr, \"artifact-digest is required.\")\n\t\tusage()\n\t\tos.Exit(1)\n\t}\n\n\ttoken := os.Getenv(\"GITHUB_AUTH_TOKEN\")\n\n\tif token == \"\" {\n\t\tlog.Fatal(\"Unauthorized: No token present. Please set the GITHUB_AUTH_TOKEN environment variable to a valid token with `attestations:read` permission.\")\n\t}\n\n\tctx := context.Background()\n\tclient := github.NewClient(nil).WithAuthToken(token)\n\n\t// Fetch attestations from the GitHub API.\n\t// The attestations API doesn't differentiate between users and orgs,\n\t// so we can use the OrganizationsService to fetch attestations for both.\n\tattestations, _, err := client.Organizations.ListAttestations(ctx, *owner, fmt.Sprintf(\"%v:%v\", *artifactDigestAlgorithm, *artifactDigest), nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tif len(attestations.Attestations) == 0 {\n\t\tlog.Fatal(\"No attestations found.\")\n\t}\n\n\tsev, err := getSignedEntityVerifier()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tpb, err := getPolicyBuilder()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tvar b *bundle.Bundle\n\tfor _, attestation := range attestations.Attestations {\n\t\tif err := json.Unmarshal(attestation.Bundle, &b); err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\terr := runVerification(sev, pb, b)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t}\n}\n\nfunc getTrustedMaterial() (root.TrustedMaterialCollection, error) {\n\ttrustedRootJSON, err := os.ReadFile(*trustedRootJSONPath)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to read %v: %w\", *trustedRootJSONPath, err)\n\t}\n\n\ttrustedRoot, err := root.NewTrustedRootFromJSON(trustedRootJSON)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ttrustedMaterial := root.TrustedMaterialCollection{\n\t\ttrustedRoot,\n\t}\n\n\treturn trustedMaterial, nil\n}\n\nfunc getIdentityPolicies() ([]verify.PolicyOption, error) {\n\tcertID, err := verify.NewShortCertificateIdentity(*expectedIssuer, \"\", *expectedSAN, \"\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn []verify.PolicyOption{\n\t\tverify.WithCertificateIdentity(certID),\n\t}, nil\n}\n\nfunc getSignedEntityVerifier() (*verify.Verifier, error) {\n\t// Set up the verifier\n\tverifierConfig := []verify.VerifierOption{\n\t\tverify.WithSignedCertificateTimestamps(1),\n\t\tverify.WithObserverTimestamps(1),\n\t\tverify.WithTransparencyLog(1),\n\t}\n\n\t// Set up the trusted material\n\ttrustedMaterial, err := getTrustedMaterial()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn verify.NewVerifier(trustedMaterial, verifierConfig...)\n}\n\nfunc getPolicyBuilder() (*verify.PolicyBuilder, error) {\n\t// Set up the identity policy\n\tidentityPolicies, err := getIdentityPolicies()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Set up the artifact policy\n\tartifactDigestBytes, err := hex.DecodeString(*artifactDigest)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tartifactPolicy := verify.WithArtifactDigest(*artifactDigestAlgorithm, artifactDigestBytes)\n\n\tpb := verify.NewPolicy(artifactPolicy, identityPolicies...)\n\treturn &pb, nil\n}\n\nfunc runVerification(sev *verify.Verifier, pb *verify.PolicyBuilder, b *bundle.Bundle) error {\n\tres, err := sev.Verify(b, *pb)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfmt.Fprint(os.Stderr, \"Verification successful!\\n\")\n\n\tmarshaled, err := json.MarshalIndent(res, \"\", \"  \")\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfmt.Println(string(marshaled))\n\treturn nil\n}\n"
  },
  {
    "path": "example/verifyartifact/trusted-root-public-good.json",
    "content": "{\n  \"mediaType\": \"application/vnd.dev.sigstore.trustedroot+json;version=0.1\",\n  \"tlogs\": [\n    {\n      \"baseUrl\": \"https://rekor.sigstore.dev\",\n      \"hashAlgorithm\": \"SHA2_256\",\n      \"publicKey\": {\n        \"rawBytes\": \"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE2G2Y+2tabdTV5BcGiBIx0a9fAFwrkBbmLSGtks4L3qX6yYY0zufBnhC8Ur/iy55GhWP/9A/bY2LhC30M9+RYtw==\",\n        \"keyDetails\": \"PKIX_ECDSA_P256_SHA_256\",\n        \"validFor\": {\n          \"start\": \"2021-01-12T11:53:27.000Z\"\n        }\n      },\n      \"logId\": {\n        \"keyId\": \"wNI9atQGlz+VWfO6LRygH4QUfY/8W4RFwiT5i5WRgB0=\"\n      }\n    }\n  ],\n  \"certificateAuthorities\": [\n    {\n      \"subject\": {\n        \"organization\": \"sigstore.dev\",\n        \"commonName\": \"sigstore\"\n      },\n      \"uri\": \"https://fulcio.sigstore.dev\",\n      \"certChain\": {\n        \"certificates\": [\n          {\n            \"rawBytes\": \"MIIB+DCCAX6gAwIBAgITNVkDZoCiofPDsy7dfm6geLbuhzAKBggqhkjOPQQDAzAqMRUwEwYDVQQKEwxzaWdzdG9yZS5kZXYxETAPBgNVBAMTCHNpZ3N0b3JlMB4XDTIxMDMwNzAzMjAyOVoXDTMxMDIyMzAzMjAyOVowKjEVMBMGA1UEChMMc2lnc3RvcmUuZGV2MREwDwYDVQQDEwhzaWdzdG9yZTB2MBAGByqGSM49AgEGBSuBBAAiA2IABLSyA7Ii5k+pNO8ZEWY0ylemWDowOkNa3kL+GZE5Z5GWehL9/A9bRNA3RbrsZ5i0JcastaRL7Sp5fp/jD5dxqc/UdTVnlvS16an+2Yfswe/QuLolRUCrcOE2+2iA5+tzd6NmMGQwDgYDVR0PAQH/BAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQEwHQYDVR0OBBYEFMjFHQBBmiQpMlEk6w2uSu1KBtPsMB8GA1UdIwQYMBaAFMjFHQBBmiQpMlEk6w2uSu1KBtPsMAoGCCqGSM49BAMDA2gAMGUCMH8liWJfMui6vXXBhjDgY4MwslmN/TJxVe/83WrFomwmNf056y1X48F9c4m3a3ozXAIxAKjRay5/aj/jsKKGIkmQatjI8uupHr/+CxFvaJWmpYqNkLDGRU+9orzh5hI2RrcuaQ==\"\n          }\n        ]\n      },\n      \"validFor\": {\n        \"start\": \"2021-03-07T03:20:29.000Z\",\n        \"end\": \"2022-12-31T23:59:59.999Z\"\n      }\n    },\n    {\n      \"subject\": {\n        \"organization\": \"sigstore.dev\",\n        \"commonName\": \"sigstore\"\n      },\n      \"uri\": \"https://fulcio.sigstore.dev\",\n      \"certChain\": {\n        \"certificates\": [\n          {\n            \"rawBytes\": \"MIICGjCCAaGgAwIBAgIUALnViVfnU0brJasmRkHrn/UnfaQwCgYIKoZIzj0EAwMwKjEVMBMGA1UEChMMc2lnc3RvcmUuZGV2MREwDwYDVQQDEwhzaWdzdG9yZTAeFw0yMjA0MTMyMDA2MTVaFw0zMTEwMDUxMzU2NThaMDcxFTATBgNVBAoTDHNpZ3N0b3JlLmRldjEeMBwGA1UEAxMVc2lnc3RvcmUtaW50ZXJtZWRpYXRlMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE8RVS/ysH+NOvuDZyPIZtilgUF9NlarYpAd9HP1vBBH1U5CV77LSS7s0ZiH4nE7Hv7ptS6LvvR/STk798LVgMzLlJ4HeIfF3tHSaexLcYpSASr1kS0N/RgBJz/9jWCiXno3sweTAOBgNVHQ8BAf8EBAMCAQYwEwYDVR0lBAwwCgYIKwYBBQUHAwMwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQU39Ppz1YkEZb5qNjpKFWixi4YZD8wHwYDVR0jBBgwFoAUWMAeX5FFpWapesyQoZMi0CrFxfowCgYIKoZIzj0EAwMDZwAwZAIwPCsQK4DYiZYDPIaDi5HFKnfxXx6ASSVmERfsynYBiX2X6SJRnZU84/9DZdnFvvxmAjBOt6QpBlc4J/0DxvkTCqpclvziL6BCCPnjdlIB3Pu3BxsPmygUY7Ii2zbdCdliiow=\"\n          },\n          {\n            \"rawBytes\": \"MIIB9zCCAXygAwIBAgIUALZNAPFdxHPwjeDloDwyYChAO/4wCgYIKoZIzj0EAwMwKjEVMBMGA1UEChMMc2lnc3RvcmUuZGV2MREwDwYDVQQDEwhzaWdzdG9yZTAeFw0yMTEwMDcxMzU2NTlaFw0zMTEwMDUxMzU2NThaMCoxFTATBgNVBAoTDHNpZ3N0b3JlLmRldjERMA8GA1UEAxMIc2lnc3RvcmUwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAT7XeFT4rb3PQGwS4IajtLk3/OlnpgangaBclYpsYBr5i+4ynB07ceb3LP0OIOZdxexX69c5iVuyJRQ+Hz05yi+UF3uBWAlHpiS5sh0+H2GHE7SXrk1EC5m1Tr19L9gg92jYzBhMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRYwB5fkUWlZql6zJChkyLQKsXF+jAfBgNVHSMEGDAWgBRYwB5fkUWlZql6zJChkyLQKsXF+jAKBggqhkjOPQQDAwNpADBmAjEAj1nHeXZp+13NWBNa+EDsDP8G1WWg1tCMWP/WHPqpaVo0jhsweNFZgSs0eE7wYI4qAjEA2WB9ot98sIkoF3vZYdd3/VtWB5b9TNMea7Ix/stJ5TfcLLeABLE4BNJOsQ4vnBHJ\"\n          }\n        ]\n      },\n      \"validFor\": {\n        \"start\": \"2022-04-13T20:06:15.000Z\"\n      }\n    }\n  ],\n  \"ctlogs\": [\n    {\n      \"baseUrl\": \"https://ctfe.sigstore.dev/test\",\n      \"hashAlgorithm\": \"SHA2_256\",\n      \"publicKey\": {\n        \"rawBytes\": \"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEbfwR+RJudXscgRBRpKX1XFDy3PyudDxz/SfnRi1fT8ekpfBd2O1uoz7jr3Z8nKzxA69EUQ+eFCFI3zeubPWU7w==\",\n        \"keyDetails\": \"PKIX_ECDSA_P256_SHA_256\",\n        \"validFor\": {\n          \"start\": \"2021-03-14T00:00:00.000Z\",\n          \"end\": \"2022-10-31T23:59:59.999Z\"\n        }\n      },\n      \"logId\": {\n        \"keyId\": \"CGCS8ChS/2hF0dFrJ4ScRWcYrBY9wzjSbea8IgY2b3I=\"\n      }\n    },\n    {\n      \"baseUrl\": \"https://ctfe.sigstore.dev/2022\",\n      \"hashAlgorithm\": \"SHA2_256\",\n      \"publicKey\": {\n        \"rawBytes\": \"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEiPSlFi0CmFTfEjCUqF9HuCEcYXNKAaYalIJmBZ8yyezPjTqhxrKBpMnaocVtLJBI1eM3uXnQzQGAJdJ4gs9Fyw==\",\n        \"keyDetails\": \"PKIX_ECDSA_P256_SHA_256\",\n        \"validFor\": {\n          \"start\": \"2022-10-20T00:00:00.000Z\"\n        }\n      },\n      \"logId\": {\n        \"keyId\": \"3T0wasbHETJjGR4cmWc3AqJKXrjePK3/h4pygC8p7o4=\"\n      }\n    }\n  ],\n  \"timestampAuthorities\": [\n    {\n      \"subject\": {\n        \"organization\": \"GitHub, Inc.\",\n        \"commonName\": \"Internal Services Root\"\n      },\n      \"certChain\": {\n        \"certificates\": [\n          {\n            \"rawBytes\": \"MIIB3DCCAWKgAwIBAgIUchkNsH36Xa04b1LqIc+qr9DVecMwCgYIKoZIzj0EAwMwMjEVMBMGA1UEChMMR2l0SHViLCBJbmMuMRkwFwYDVQQDExBUU0EgaW50ZXJtZWRpYXRlMB4XDTIzMDQxNDAwMDAwMFoXDTI0MDQxMzAwMDAwMFowMjEVMBMGA1UEChMMR2l0SHViLCBJbmMuMRkwFwYDVQQDExBUU0EgVGltZXN0YW1waW5nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEUD5ZNbSqYMd6r8qpOOEX9ibGnZT9GsuXOhr/f8U9FJugBGExKYp40OULS0erjZW7xV9xV52NnJf5OeDq4e5ZKqNWMFQwDgYDVR0PAQH/BAQDAgeAMBMGA1UdJQQMMAoGCCsGAQUFBwMIMAwGA1UdEwEB/wQCMAAwHwYDVR0jBBgwFoAUaW1RudOgVt0leqY0WKYbuPr47wAwCgYIKoZIzj0EAwMDaAAwZQIwbUH9HvD4ejCZJOWQnqAlkqURllvu9M8+VqLbiRK+zSfZCZwsiljRn8MQQRSkXEE5AjEAg+VxqtojfVfu8DhzzhCx9GKETbJHb19iV72mMKUbDAFmzZ6bQ8b54Zb8tidy5aWe\"\n          },\n          {\n            \"rawBytes\": \"MIICEDCCAZWgAwIBAgIUX8ZO5QXP7vN4dMQ5e9sU3nub8OgwCgYIKoZIzj0EAwMwODEVMBMGA1UEChMMR2l0SHViLCBJbmMuMR8wHQYDVQQDExZJbnRlcm5hbCBTZXJ2aWNlcyBSb290MB4XDTIzMDQxNDAwMDAwMFoXDTI4MDQxMjAwMDAwMFowMjEVMBMGA1UEChMMR2l0SHViLCBJbmMuMRkwFwYDVQQDExBUU0EgaW50ZXJtZWRpYXRlMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEvMLY/dTVbvIJYANAuszEwJnQE1llftynyMKIMhh48HmqbVr5ygybzsLRLVKbBWOdZ21aeJz+gZiytZetqcyF9WlER5NEMf6JV7ZNojQpxHq4RHGoGSceQv/qvTiZxEDKo2YwZDAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQUaW1RudOgVt0leqY0WKYbuPr47wAwHwYDVR0jBBgwFoAU9NYYlobnAG4c0/qjxyH/lq/wz+QwCgYIKoZIzj0EAwMDaQAwZgIxAK1B185ygCrIYFlIs3GjswjnwSMG6LY8woLVdakKDZxVa8f8cqMs1DhcxJ0+09w95QIxAO+tBzZk7vjUJ9iJgD4R6ZWTxQWKqNm74jO99o+o9sv4FI/SZTZTFyMn0IJEHdNmyA==\"\n          },\n          {\n            \"rawBytes\": \"MIIB9DCCAXqgAwIBAgIUa/JAkdUjK4JUwsqtaiRJGWhqLSowCgYIKoZIzj0EAwMwODEVMBMGA1UEChMMR2l0SHViLCBJbmMuMR8wHQYDVQQDExZJbnRlcm5hbCBTZXJ2aWNlcyBSb290MB4XDTIzMDQxNDAwMDAwMFoXDTMzMDQxMTAwMDAwMFowODEVMBMGA1UEChMMR2l0SHViLCBJbmMuMR8wHQYDVQQDExZJbnRlcm5hbCBTZXJ2aWNlcyBSb290MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEf9jFAXxz4kx68AHRMOkFBhflDcMTvzaXz4x/FCcXjJ/1qEKon/qPIGnaURskDtyNbNDOpeJTDDFqt48iMPrnzpx6IZwqemfUJN4xBEZfza+pYt/iyod+9tZr20RRWSv/o0UwQzAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBAjAdBgNVHQ4EFgQU9NYYlobnAG4c0/qjxyH/lq/wz+QwCgYIKoZIzj0EAwMDaAAwZQIxALZLZ8BgRXzKxLMMN9VIlO+e4hrBnNBgF7tz7Hnrowv2NetZErIACKFymBlvWDvtMAIwZO+ki6ssQ1bsZo98O8mEAf2NZ7iiCgDDU0Vwjeco6zyeh0zBTs9/7gV6AHNQ53xD\"\n          }\n        ]\n      },\n      \"validFor\": {\n        \"start\": \"2023-04-14T00:00:00.000Z\"\n      }\n    }\n  ]\n}\n"
  },
  {
    "path": "github/actions.go",
    "content": "// Copyright 2020 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\n// ActionsService handles communication with the actions related\n// methods of the GitHub API.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/\ntype ActionsService service\n"
  },
  {
    "path": "github/actions_artifacts.go",
    "content": "// Copyright 2020 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n)\n\n// ArtifactWorkflowRun represents a GitHub artifact's workflow run.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/artifacts\ntype ArtifactWorkflowRun struct {\n\tID               *int64  `json:\"id,omitempty\"`\n\tRepositoryID     *int64  `json:\"repository_id,omitempty\"`\n\tHeadRepositoryID *int64  `json:\"head_repository_id,omitempty\"`\n\tHeadBranch       *string `json:\"head_branch,omitempty\"`\n\tHeadSHA          *string `json:\"head_sha,omitempty\"`\n}\n\n// Artifact represents a GitHub artifact.  Artifacts allow sharing\n// data between jobs in a workflow and provide storage for data\n// once a workflow is complete.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/artifacts\ntype Artifact struct {\n\tID                 *int64     `json:\"id,omitempty\"`\n\tNodeID             *string    `json:\"node_id,omitempty\"`\n\tName               *string    `json:\"name,omitempty\"`\n\tSizeInBytes        *int64     `json:\"size_in_bytes,omitempty\"`\n\tURL                *string    `json:\"url,omitempty\"`\n\tArchiveDownloadURL *string    `json:\"archive_download_url,omitempty\"`\n\tExpired            *bool      `json:\"expired,omitempty\"`\n\tCreatedAt          *Timestamp `json:\"created_at,omitempty\"`\n\tUpdatedAt          *Timestamp `json:\"updated_at,omitempty\"`\n\tExpiresAt          *Timestamp `json:\"expires_at,omitempty\"`\n\t// Digest is the SHA256 digest of the artifact.\n\t// This field will only be populated on artifacts uploaded with upload-artifact v4 or newer.\n\t// For older versions, this field will be null.\n\tDigest      *string              `json:\"digest,omitempty\"`\n\tWorkflowRun *ArtifactWorkflowRun `json:\"workflow_run,omitempty\"`\n}\n\n// ArtifactList represents a list of GitHub artifacts.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/artifacts#artifacts\ntype ArtifactList struct {\n\tTotalCount *int64      `json:\"total_count,omitempty\"`\n\tArtifacts  []*Artifact `json:\"artifacts,omitempty\"`\n}\n\n// ListArtifactsOptions specifies the optional parameters to the\n// ActionsService.ListArtifacts method.\ntype ListArtifactsOptions struct {\n\t// Name represents the name field of an artifact.\n\t// When specified, only artifacts with this name will be returned.\n\tName *string `url:\"name,omitempty\"`\n\n\tListOptions\n}\n\n// ArtifactPeriod represents the period for which the artifact and\n// log of a workflow run is retained.\ntype ArtifactPeriod struct {\n\tDays               *int `json:\"days,omitempty\"`\n\tMaximumAllowedDays *int `json:\"maximum_allowed_days,omitempty\"`\n}\n\nfunc (a ArtifactPeriod) String() string { return Stringify(a) }\n\n// ArtifactPeriodOpt is used to specify the retention period of\n// artifacts and logs in a workflow run.\ntype ArtifactPeriodOpt struct {\n\tDays *int `json:\"days,omitempty\"`\n}\n\n// ListArtifacts lists all artifacts that belong to a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/artifacts#list-artifacts-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/artifacts\nfunc (s *ActionsService) ListArtifacts(ctx context.Context, owner, repo string, opts *ListArtifactsOptions) (*ArtifactList, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/artifacts\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar artifactList *ArtifactList\n\tresp, err := s.client.Do(ctx, req, &artifactList)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn artifactList, resp, nil\n}\n\n// ListWorkflowRunArtifacts lists all artifacts that belong to a workflow run.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/artifacts#list-workflow-run-artifacts\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\nfunc (s *ActionsService) ListWorkflowRunArtifacts(ctx context.Context, owner, repo string, runID int64, opts *ListOptions) (*ArtifactList, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/runs/%v/artifacts\", owner, repo, runID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar artifactList *ArtifactList\n\tresp, err := s.client.Do(ctx, req, &artifactList)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn artifactList, resp, nil\n}\n\n// GetArtifact gets a specific artifact for a workflow run.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/artifacts#get-an-artifact\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\nfunc (s *ActionsService) GetArtifact(ctx context.Context, owner, repo string, artifactID int64) (*Artifact, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/artifacts/%v\", owner, repo, artifactID)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar artifact *Artifact\n\tresp, err := s.client.Do(ctx, req, &artifact)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn artifact, resp, nil\n}\n\n// DownloadArtifact gets a redirect URL to download an archive for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/artifacts#download-an-artifact\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}\nfunc (s *ActionsService) DownloadArtifact(ctx context.Context, owner, repo string, artifactID int64, maxRedirects int) (*url.URL, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/artifacts/%v/zip\", owner, repo, artifactID)\n\n\tif s.client.RateLimitRedirectionalEndpoints {\n\t\treturn s.downloadArtifactWithRateLimit(ctx, u, maxRedirects)\n\t}\n\n\treturn s.downloadArtifactWithoutRateLimit(ctx, u, maxRedirects)\n}\n\nfunc (s *ActionsService) downloadArtifactWithoutRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) {\n\tresp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, maxRedirects)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != http.StatusFound {\n\t\treturn nil, newResponse(resp), fmt.Errorf(\"unexpected status code: %v\", resp.Status)\n\t}\n\n\tparsedURL, err := url.Parse(resp.Header.Get(\"Location\"))\n\tif err != nil {\n\t\treturn nil, newResponse(resp), err\n\t}\n\n\treturn parsedURL, newResponse(resp), nil\n}\n\nfunc (s *ActionsService) downloadArtifactWithRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) {\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\turl, resp, err := s.client.bareDoUntilFound(ctx, req, maxRedirects)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\tdefer resp.Body.Close()\n\n\t// If we didn't receive a valid Location in a 302 response\n\tif url == nil {\n\t\treturn nil, resp, fmt.Errorf(\"unexpected status code: %v\", resp.Status)\n\t}\n\n\treturn url, resp, nil\n}\n\n// DeleteArtifact deletes a workflow run artifact.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/artifacts#delete-an-artifact\n//\n//meta:operation DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\nfunc (s *ActionsService) DeleteArtifact(ctx context.Context, owner, repo string, artifactID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/artifacts/%v\", owner, repo, artifactID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/actions_artifacts_test.go",
    "content": "// Copyright 2020 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestActionsService_ListArtifacts(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/artifacts\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\", \"name\": \"TheArtifact\"})\n\t\tfmt.Fprint(w,\n\t\t\t`{\n\t\t\t\t\"total_count\":1,\n\t\t\t\t\"artifacts\":[{\"id\":1}]\n\t\t\t}`,\n\t\t)\n\t})\n\n\topts := &ListArtifactsOptions{\n\t\tName:        Ptr(\"TheArtifact\"),\n\t\tListOptions: ListOptions{Page: 2},\n\t}\n\tctx := t.Context()\n\tartifacts, _, err := client.Actions.ListArtifacts(ctx, \"o\", \"r\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListArtifacts returned error: %v\", err)\n\t}\n\n\twant := &ArtifactList{TotalCount: Ptr(int64(1)), Artifacts: []*Artifact{{ID: Ptr(int64(1))}}}\n\tif !cmp.Equal(artifacts, want) {\n\t\tt.Errorf(\"Actions.ListArtifacts returned %+v, want %+v\", artifacts, want)\n\t}\n\n\tconst methodName = \"ListArtifacts\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListArtifacts(ctx, \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListArtifacts(ctx, \"o\", \"r\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_ListArtifacts_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Actions.ListArtifacts(ctx, \"%\", \"r\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestActionsService_ListArtifacts_invalidRepo(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Actions.ListArtifacts(ctx, \"o\", \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestActionsService_ListArtifacts_notFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/artifacts\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tartifacts, resp, err := client.Actions.ListArtifacts(ctx, \"o\", \"r\", nil)\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Actions.ListArtifacts return status %v, want %v\", got, want)\n\t}\n\tif artifacts != nil {\n\t\tt.Errorf(\"Actions.ListArtifacts return %+v, want nil\", artifacts)\n\t}\n}\n\nfunc TestActionsService_ListWorkflowRunArtifacts(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/runs/1/artifacts\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w,\n\t\t\t`{\n\t\t\t\t\"total_count\":1,\n\t\t\t\t\"artifacts\":[{\"id\":1}]\n\t\t\t}`,\n\t\t)\n\t})\n\n\topts := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tartifacts, _, err := client.Actions.ListWorkflowRunArtifacts(ctx, \"o\", \"r\", 1, opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListWorkflowRunArtifacts returned error: %v\", err)\n\t}\n\n\twant := &ArtifactList{TotalCount: Ptr(int64(1)), Artifacts: []*Artifact{{ID: Ptr(int64(1))}}}\n\tif !cmp.Equal(artifacts, want) {\n\t\tt.Errorf(\"Actions.ListWorkflowRunArtifacts returned %+v, want %+v\", artifacts, want)\n\t}\n\n\tconst methodName = \"ListWorkflowRunArtifacts\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListWorkflowRunArtifacts(ctx, \"\\n\", \"\\n\", -1, opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListWorkflowRunArtifacts(ctx, \"o\", \"r\", 1, opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_ListWorkflowRunArtifacts_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Actions.ListWorkflowRunArtifacts(ctx, \"%\", \"r\", 1, nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestActionsService_ListWorkflowRunArtifacts_invalidRepo(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Actions.ListWorkflowRunArtifacts(ctx, \"o\", \"%\", 1, nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestActionsService_ListWorkflowRunArtifacts_notFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/runs/1/artifacts\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tartifacts, resp, err := client.Actions.ListWorkflowRunArtifacts(ctx, \"o\", \"r\", 1, nil)\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Actions.ListWorkflowRunArtifacts return status %v, want %v\", got, want)\n\t}\n\tif artifacts != nil {\n\t\tt.Errorf(\"Actions.ListWorkflowRunArtifacts return %+v, want nil\", artifacts)\n\t}\n}\n\nfunc TestActionsService_GetArtifact(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/artifacts/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\":1,\n\t\t\t\"node_id\":\"xyz\",\n\t\t\t\"name\":\"a\",\n\t\t\t\"size_in_bytes\":5,\n\t\t\t\"archive_download_url\":\"u\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tartifact, _, err := client.Actions.GetArtifact(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetArtifact returned error: %v\", err)\n\t}\n\n\twant := &Artifact{\n\t\tID:                 Ptr(int64(1)),\n\t\tNodeID:             Ptr(\"xyz\"),\n\t\tName:               Ptr(\"a\"),\n\t\tSizeInBytes:        Ptr(int64(5)),\n\t\tArchiveDownloadURL: Ptr(\"u\"),\n\t}\n\tif !cmp.Equal(artifact, want) {\n\t\tt.Errorf(\"Actions.GetArtifact returned %+v, want %+v\", artifact, want)\n\t}\n\n\tconst methodName = \"GetArtifact\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetArtifact(ctx, \"\\n\", \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetArtifact(ctx, \"o\", \"r\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetArtifact_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Actions.GetArtifact(ctx, \"%\", \"r\", 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestActionsService_GetArtifact_invalidRepo(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Actions.GetArtifact(ctx, \"o\", \"%\", 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestActionsService_GetArtifact_notFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/artifacts/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tartifact, resp, err := client.Actions.GetArtifact(ctx, \"o\", \"r\", 1)\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Actions.GetArtifact return status %v, want %v\", got, want)\n\t}\n\tif artifact != nil {\n\t\tt.Errorf(\"Actions.GetArtifact return %+v, want nil\", artifact)\n\t}\n}\n\nfunc TestActionsService_DownloadArtifact(t *testing.T) {\n\tt.Parallel()\n\n\ttcs := []struct {\n\t\tname              string\n\t\trespectRateLimits bool\n\t}{\n\t\t{\n\t\t\tname:              \"withoutRateLimits\",\n\t\t\trespectRateLimits: false,\n\t\t},\n\t\t{\n\t\t\tname:              \"withRateLimits\",\n\t\t\trespectRateLimits: true,\n\t\t},\n\t}\n\n\tfor _, tc := range tcs {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\t\t\tclient.RateLimitRedirectionalEndpoints = tc.respectRateLimits\n\n\t\t\tmux.HandleFunc(\"/repos/o/r/actions/artifacts/1/zip\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\thttp.Redirect(w, r, \"https://github.com/artifact\", http.StatusFound)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\turl, resp, err := client.Actions.DownloadArtifact(ctx, \"o\", \"r\", 1, 1)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Actions.DownloadArtifact returned error: %v\", err)\n\t\t\t}\n\t\t\tif resp.StatusCode != http.StatusFound {\n\t\t\t\tt.Errorf(\"Actions.DownloadArtifact returned status: %v, want %v\", resp.StatusCode, http.StatusFound)\n\t\t\t}\n\n\t\t\twant := \"https://github.com/artifact\"\n\t\t\tif url.String() != want {\n\t\t\t\tt.Errorf(\"Actions.DownloadArtifact returned %+v, want %+v\", url, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"DownloadArtifact\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Actions.DownloadArtifact(ctx, \"\\n\", \"\\n\", -1, 1)\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\t// Add custom round tripper\n\t\t\tclient.client.Transport = roundTripperFunc(func(*http.Request) (*http.Response, error) {\n\t\t\t\treturn nil, errors.New(\"failed to download artifact\")\n\t\t\t})\n\t\t\t// propagate custom round tripper to client without CheckRedirect\n\t\t\tclient.initialize()\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Actions.DownloadArtifact(ctx, \"o\", \"r\", 1, 1)\n\t\t\t\treturn err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestActionsService_DownloadArtifact_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\ttcs := []struct {\n\t\tname              string\n\t\trespectRateLimits bool\n\t}{\n\t\t{\n\t\t\tname:              \"withoutRateLimits\",\n\t\t\trespectRateLimits: false,\n\t\t},\n\t\t{\n\t\t\tname:              \"withRateLimits\",\n\t\t\trespectRateLimits: true,\n\t\t},\n\t}\n\n\tfor _, tc := range tcs {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, _, _ := setup(t)\n\t\t\tclient.RateLimitRedirectionalEndpoints = tc.respectRateLimits\n\n\t\t\tctx := t.Context()\n\t\t\t_, _, err := client.Actions.DownloadArtifact(ctx, \"%\", \"r\", 1, 1)\n\t\t\ttestURLParseError(t, err)\n\t\t})\n\t}\n}\n\nfunc TestActionsService_DownloadArtifact_invalidRepo(t *testing.T) {\n\tt.Parallel()\n\ttcs := []struct {\n\t\tname              string\n\t\trespectRateLimits bool\n\t}{\n\t\t{\n\t\t\tname:              \"withoutRateLimits\",\n\t\t\trespectRateLimits: false,\n\t\t},\n\t\t{\n\t\t\tname:              \"withRateLimits\",\n\t\t\trespectRateLimits: true,\n\t\t},\n\t}\n\n\tfor _, tc := range tcs {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, _, _ := setup(t)\n\t\t\tclient.RateLimitRedirectionalEndpoints = tc.respectRateLimits\n\n\t\t\tctx := t.Context()\n\t\t\t_, _, err := client.Actions.DownloadArtifact(ctx, \"o\", \"%\", 1, 1)\n\t\t\ttestURLParseError(t, err)\n\t\t})\n\t}\n}\n\nfunc TestActionsService_DownloadArtifact_StatusMovedPermanently_dontFollowRedirects(t *testing.T) {\n\tt.Parallel()\n\ttcs := []struct {\n\t\tname              string\n\t\trespectRateLimits bool\n\t}{\n\t\t{\n\t\t\tname:              \"withoutRateLimits\",\n\t\t\trespectRateLimits: false,\n\t\t},\n\t\t{\n\t\t\tname:              \"withRateLimits\",\n\t\t\trespectRateLimits: true,\n\t\t},\n\t}\n\n\tfor _, tc := range tcs {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\t\t\tclient.RateLimitRedirectionalEndpoints = tc.respectRateLimits\n\n\t\t\tmux.HandleFunc(\"/repos/o/r/actions/artifacts/1/zip\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\thttp.Redirect(w, r, \"https://github.com/artifact\", http.StatusMovedPermanently)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\t_, resp, _ := client.Actions.DownloadArtifact(ctx, \"o\", \"r\", 1, 0)\n\t\t\tif resp.StatusCode != http.StatusMovedPermanently {\n\t\t\t\tt.Errorf(\"Actions.DownloadArtifact return status %v, want %v\", resp.StatusCode, http.StatusMovedPermanently)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestActionsService_DownloadArtifact_StatusMovedPermanently_followRedirects(t *testing.T) {\n\tt.Parallel()\n\ttcs := []struct {\n\t\tname              string\n\t\trespectRateLimits bool\n\t}{\n\t\t{\n\t\t\tname:              \"withoutRateLimits\",\n\t\t\trespectRateLimits: false,\n\t\t},\n\t\t{\n\t\t\tname:              \"withRateLimits\",\n\t\t\trespectRateLimits: true,\n\t\t},\n\t}\n\n\tfor _, tc := range tcs {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, serverURL := setup(t)\n\t\t\tclient.RateLimitRedirectionalEndpoints = tc.respectRateLimits\n\n\t\t\tmux.HandleFunc(\"/repos/o/r/actions/artifacts/1/zip\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\tredirectURL, _ := url.Parse(serverURL + baseURLPath + \"/redirect\")\n\t\t\t\thttp.Redirect(w, r, redirectURL.String(), http.StatusMovedPermanently)\n\t\t\t})\n\t\t\tmux.HandleFunc(\"/redirect\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\thttp.Redirect(w, r, \"https://github.com/artifact\", http.StatusFound)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\turl, resp, err := client.Actions.DownloadArtifact(ctx, \"o\", \"r\", 1, 1)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Actions.DownloadArtifact return error: %v\", err)\n\t\t\t}\n\t\t\tif resp.StatusCode != http.StatusFound {\n\t\t\t\tt.Errorf(\"Actions.DownloadArtifact return status %v, want %v\", resp.StatusCode, http.StatusFound)\n\t\t\t}\n\t\t\twant := \"https://github.com/artifact\"\n\t\t\tif url.String() != want {\n\t\t\t\tt.Errorf(\"Actions.DownloadArtifact returned %+v, want %+v\", url, want)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestActionsService_DownloadArtifact_unexpectedCode(t *testing.T) {\n\tt.Parallel()\n\ttcs := []struct {\n\t\tname              string\n\t\trespectRateLimits bool\n\t}{\n\t\t{\n\t\t\tname:              \"withoutRateLimits\",\n\t\t\trespectRateLimits: false,\n\t\t},\n\t\t{\n\t\t\tname:              \"withRateLimits\",\n\t\t\trespectRateLimits: true,\n\t\t},\n\t}\n\n\tfor _, tc := range tcs {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, serverURL := setup(t)\n\t\t\tclient.RateLimitRedirectionalEndpoints = tc.respectRateLimits\n\n\t\t\tmux.HandleFunc(\"/repos/o/r/actions/artifacts/1/zip\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\tredirectURL, _ := url.Parse(serverURL + baseURLPath + \"/redirect\")\n\t\t\t\thttp.Redirect(w, r, redirectURL.String(), http.StatusMovedPermanently)\n\t\t\t})\n\t\t\tmux.HandleFunc(\"/redirect\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\tw.WriteHeader(http.StatusNoContent)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\turl, resp, err := client.Actions.DownloadArtifact(ctx, \"o\", \"r\", 1, 1)\n\t\t\tif err == nil {\n\t\t\t\tt.Fatal(\"Actions.DownloadArtifact should return error on unexpected code\")\n\t\t\t}\n\t\t\tif !strings.Contains(err.Error(), \"unexpected status code\") {\n\t\t\t\tt.Error(\"Actions.DownloadArtifact should return unexpected status code\")\n\t\t\t}\n\t\t\tif got, want := resp.Response.StatusCode, http.StatusNoContent; got != want {\n\t\t\t\tt.Errorf(\"Actions.DownloadArtifact return status %v, want %v\", got, want)\n\t\t\t}\n\t\t\tif url != nil {\n\t\t\t\tt.Errorf(\"Actions.DownloadArtifact return %+v, want nil\", url)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestActionsService_DeleteArtifact(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/artifacts/1\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.DeleteArtifact(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.DeleteArtifact return error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteArtifact\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.DeleteArtifact(ctx, \"\\n\", \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.DeleteArtifact(ctx, \"o\", \"r\", 1)\n\t})\n}\n\nfunc TestActionsService_DeleteArtifact_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Actions.DeleteArtifact(ctx, \"%\", \"r\", 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestActionsService_DeleteArtifact_invalidRepo(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Actions.DeleteArtifact(ctx, \"o\", \"%\", 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestActionsService_DeleteArtifact_notFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/artifacts/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Actions.DeleteArtifact(ctx, \"o\", \"r\", 1)\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Actions.DeleteArtifact return status %v, want %v\", got, want)\n\t}\n}\n\nfunc TestArtifact_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Artifact{}, \"{}\")\n\n\tu := &Artifact{\n\t\tID:                 Ptr(int64(1)),\n\t\tNodeID:             Ptr(\"nid\"),\n\t\tName:               Ptr(\"n\"),\n\t\tSizeInBytes:        Ptr(int64(1)),\n\t\tURL:                Ptr(\"u\"),\n\t\tArchiveDownloadURL: Ptr(\"a\"),\n\t\tExpired:            Ptr(false),\n\t\tCreatedAt:          &Timestamp{referenceTime},\n\t\tUpdatedAt:          &Timestamp{referenceTime},\n\t\tExpiresAt:          &Timestamp{referenceTime},\n\t\tWorkflowRun: &ArtifactWorkflowRun{\n\t\t\tID:               Ptr(int64(1)),\n\t\t\tRepositoryID:     Ptr(int64(1)),\n\t\t\tHeadRepositoryID: Ptr(int64(1)),\n\t\t\tHeadBranch:       Ptr(\"b\"),\n\t\t\tHeadSHA:          Ptr(\"s\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"node_id\": \"nid\",\n\t\t\"name\": \"n\",\n\t\t\"size_in_bytes\": 1,\n\t\t\"url\": \"u\",\n\t\t\"archive_download_url\": \"a\",\n\t\t\"expired\": false,\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"expires_at\": ` + referenceTimeStr + `,\n\t\t\"workflow_run\": {\n\t\t\t\"id\": 1,\n\t\t\t\"repository_id\": 1,\n\t\t\t\"head_repository_id\": 1,\n\t\t\t\"head_branch\": \"b\",\n\t\t\t\"head_sha\": \"s\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestArtifactList_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ArtifactList{}, \"{}\")\n\n\tu := &ArtifactList{\n\t\tTotalCount: Ptr(int64(1)),\n\t\tArtifacts: []*Artifact{\n\t\t\t{\n\t\t\t\tID:                 Ptr(int64(1)),\n\t\t\t\tNodeID:             Ptr(\"nid\"),\n\t\t\t\tName:               Ptr(\"n\"),\n\t\t\t\tSizeInBytes:        Ptr(int64(1)),\n\t\t\t\tURL:                Ptr(\"u\"),\n\t\t\t\tArchiveDownloadURL: Ptr(\"a\"),\n\t\t\t\tExpired:            Ptr(false),\n\t\t\t\tCreatedAt:          &Timestamp{referenceTime},\n\t\t\t\tUpdatedAt:          &Timestamp{referenceTime},\n\t\t\t\tExpiresAt:          &Timestamp{referenceTime},\n\t\t\t\tWorkflowRun: &ArtifactWorkflowRun{\n\t\t\t\t\tID:               Ptr(int64(1)),\n\t\t\t\t\tRepositoryID:     Ptr(int64(1)),\n\t\t\t\t\tHeadRepositoryID: Ptr(int64(1)),\n\t\t\t\t\tHeadBranch:       Ptr(\"b\"),\n\t\t\t\t\tHeadSHA:          Ptr(\"s\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"total_count\": 1,\n\t\t\"artifacts\": [{\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"size_in_bytes\": 1,\n\t\t\t\"url\": \"u\",\n\t\t\t\"archive_download_url\": \"a\",\n\t\t\t\"expired\": false,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"expires_at\": ` + referenceTimeStr + `,\n\t\t\t\"workflow_run\": {\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"repository_id\": 1,\n\t\t\t\t\"head_repository_id\": 1,\n\t\t\t\t\"head_branch\": \"b\",\n\t\t\t\t\"head_sha\": \"s\"\n\t\t\t}\n\t\t}]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/actions_cache.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// ActionsCache represents a GitHub action cache.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/cache#about-the-cache-api\ntype ActionsCache struct {\n\tID             *int64     `json:\"id,omitempty\" url:\"-\"`\n\tRef            *string    `json:\"ref,omitempty\" url:\"ref\"`\n\tKey            *string    `json:\"key,omitempty\" url:\"key\"`\n\tVersion        *string    `json:\"version,omitempty\" url:\"-\"`\n\tLastAccessedAt *Timestamp `json:\"last_accessed_at,omitempty\" url:\"-\"`\n\tCreatedAt      *Timestamp `json:\"created_at,omitempty\" url:\"-\"`\n\tSizeInBytes    *int64     `json:\"size_in_bytes,omitempty\" url:\"-\"`\n}\n\n// ActionsCacheList represents a list of GitHub actions Cache.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository\ntype ActionsCacheList struct {\n\tTotalCount    int             `json:\"total_count\"`\n\tActionsCaches []*ActionsCache `json:\"actions_caches,omitempty\"`\n}\n\n// ActionsCacheUsage represents a GitHub Actions Cache Usage object.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository\ntype ActionsCacheUsage struct {\n\tFullName                string `json:\"full_name\"`\n\tActiveCachesSizeInBytes int64  `json:\"active_caches_size_in_bytes\"`\n\tActiveCachesCount       int    `json:\"active_caches_count\"`\n}\n\n// ActionsCacheUsageList represents a list of repositories with GitHub Actions cache usage for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository\ntype ActionsCacheUsageList struct {\n\tTotalCount     int                  `json:\"total_count\"`\n\tRepoCacheUsage []*ActionsCacheUsage `json:\"repository_cache_usages,omitempty\"`\n}\n\n// TotalCacheUsage represents total GitHub actions cache usage of an organization or enterprise.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-an-enterprise\ntype TotalCacheUsage struct {\n\tTotalActiveCachesUsageSizeInBytes int64 `json:\"total_active_caches_size_in_bytes\"`\n\tTotalActiveCachesCount            int   `json:\"total_active_caches_count\"`\n}\n\n// ActionsCacheListOptions represents a list of all possible optional Query parameters for ListCaches method.\n//\n// GitHub API docs:  https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository\ntype ActionsCacheListOptions struct {\n\tListOptions\n\t// The Git reference for the results you want to list.\n\t// The ref for a branch can be formatted either as refs/heads/<branch name>\n\t// or simply <branch name>. To reference a pull request use refs/pull/<number>/merge\n\tRef *string `url:\"ref,omitempty\"`\n\tKey *string `url:\"key,omitempty\"`\n\t// Can be one of: \"created_at\", \"last_accessed_at\", \"size_in_bytes\". Default: \"last_accessed_at\"\n\tSort *string `url:\"sort,omitempty\"`\n\t// Can be one of: \"asc\", \"desc\" Default: desc\n\tDirection *string `url:\"direction,omitempty\"`\n}\n\n// ListCaches lists the GitHub Actions caches for a repository.\n// You must authenticate using an access token with the repo scope to use this endpoint.\n//\n// Permissions: must have the actions:read permission to use this endpoint.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/caches\nfunc (s *ActionsService) ListCaches(ctx context.Context, owner, repo string, opts *ActionsCacheListOptions) (*ActionsCacheList, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/caches\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar actionCacheList *ActionsCacheList\n\tresp, err := s.client.Do(ctx, req, &actionCacheList)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn actionCacheList, resp, nil\n}\n\n// DeleteCachesByKey deletes one or more GitHub Actions caches for a repository, using a complete cache key.\n// By default, all caches that match the provided key are deleted, but you can optionally provide\n// a Git ref to restrict deletions to caches that match both the provided key and the Git ref.\n// The ref for a branch can be formatted either as \"refs/heads/<branch name>\" or simply \"<branch name>\".\n// To reference a pull request use \"refs/pull/<number>/merge\". If you don't want to use ref just pass nil in parameter.\n//\n// 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.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/cache#delete-github-actions-caches-for-a-repository-using-a-cache-key\n//\n//meta:operation DELETE /repos/{owner}/{repo}/actions/caches\nfunc (s *ActionsService) DeleteCachesByKey(ctx context.Context, owner, repo, key string, ref *string) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/caches\", owner, repo)\n\tu, err := addOptions(u, &ActionsCache{Key: &key, Ref: ref})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// DeleteCachesByID deletes a GitHub Actions cache for a repository, using a cache ID.\n//\n// 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.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/cache#delete-a-github-actions-cache-for-a-repository-using-a-cache-id\n//\n//meta:operation DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}\nfunc (s *ActionsService) DeleteCachesByID(ctx context.Context, owner, repo string, cacheID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/caches/%v\", owner, repo, cacheID)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// GetCacheUsageForRepo gets GitHub Actions cache usage for a repository. The data fetched using this API is refreshed approximately every 5 minutes,\n// so values returned from this endpoint may take at least 5 minutes to get updated.\n//\n// Permissions: Anyone with read access to the repository can use this endpoint. If the repository is private, you must use an\n// access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/cache/usage\nfunc (s *ActionsService) GetCacheUsageForRepo(ctx context.Context, owner, repo string) (*ActionsCacheUsage, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/cache/usage\", owner, repo)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar cacheUsage *ActionsCacheUsage\n\tres, err := s.client.Do(ctx, req, &cacheUsage)\n\tif err != nil {\n\t\treturn nil, res, err\n\t}\n\n\treturn cacheUsage, res, err\n}\n\n// ListCacheUsageByRepoForOrg lists repositories and their GitHub Actions cache usage for an organization. The data fetched using this API is\n// refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.\n//\n// Permissions: You must authenticate using an access token with the read:org scope to use this endpoint.\n// GitHub Apps must have the organization_administration:read permission to use this endpoint.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/cache#list-repositories-with-github-actions-cache-usage-for-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/cache/usage-by-repository\nfunc (s *ActionsService) ListCacheUsageByRepoForOrg(ctx context.Context, org string, opts *ListOptions) (*ActionsCacheUsageList, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/cache/usage-by-repository\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar cacheUsage *ActionsCacheUsageList\n\tres, err := s.client.Do(ctx, req, &cacheUsage)\n\tif err != nil {\n\t\treturn nil, res, err\n\t}\n\n\treturn cacheUsage, res, err\n}\n\n// GetTotalCacheUsageForOrg gets the total GitHub Actions cache usage for an organization. The data fetched using this API is refreshed approximately every\n// 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.\n//\n// Permissions: You must authenticate using an access token with the read:org scope to use this endpoint.\n// GitHub Apps must have the organization_administration:read permission to use this endpoint.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/cache/usage\nfunc (s *ActionsService) GetTotalCacheUsageForOrg(ctx context.Context, org string) (*TotalCacheUsage, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/cache/usage\", org)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar cacheUsage *TotalCacheUsage\n\tres, err := s.client.Do(ctx, req, &cacheUsage)\n\tif err != nil {\n\t\treturn nil, res, err\n\t}\n\n\treturn cacheUsage, res, err\n}\n\n// GetTotalCacheUsageForEnterprise gets the total GitHub Actions cache usage for an enterprise. The data fetched using this API is refreshed approximately every 5 minutes,\n// so values returned from this endpoint may take at least 5 minutes to get updated.\n//\n// Permissions: You must authenticate using an access token with the \"admin:enterprise\" scope to use this endpoint.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/cache#get-github-actions-cache-usage-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/actions/cache/usage\nfunc (s *ActionsService) GetTotalCacheUsageForEnterprise(ctx context.Context, enterprise string) (*TotalCacheUsage, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/cache/usage\", enterprise)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar cacheUsage *TotalCacheUsage\n\tres, err := s.client.Do(ctx, req, &cacheUsage)\n\tif err != nil {\n\t\treturn nil, res, err\n\t}\n\n\treturn cacheUsage, res, err\n}\n"
  },
  {
    "path": "github/actions_cache_test.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestActionsService_ListCaches(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/caches\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w,\n\t\t\t`{\n\t\t\t\t\"total_count\":1,\n\t\t\t\t\"actions_caches\":[{\"id\":1}]\n\t\t\t}`,\n\t\t)\n\t})\n\n\topts := &ActionsCacheListOptions{ListOptions: ListOptions{Page: 2}}\n\tctx := t.Context()\n\tcacheList, _, err := client.Actions.ListCaches(ctx, \"o\", \"r\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListCaches returned error: %v\", err)\n\t}\n\n\twant := &ActionsCacheList{TotalCount: 1, ActionsCaches: []*ActionsCache{{ID: Ptr(int64(1))}}}\n\tif !cmp.Equal(cacheList, want) {\n\t\tt.Errorf(\"Actions.ListCaches returned %+v, want %+v\", cacheList, want)\n\t}\n\n\tconst methodName = \"ListCaches\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListCaches(ctx, \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListCaches(ctx, \"o\", \"r\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_ListCaches_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Actions.ListCaches(ctx, \"%\", \"r\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestActionsService_ListCaches_invalidRepo(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Actions.ListCaches(ctx, \"o\", \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestActionsService_ListCaches_notFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/caches\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tcaches, resp, err := client.Actions.ListCaches(ctx, \"o\", \"r\", nil)\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Actions.ListCaches return status %v, want %v\", got, want)\n\t}\n\tif caches != nil {\n\t\tt.Errorf(\"Actions.ListCaches return %+v, want nil\", caches)\n\t}\n}\n\nfunc TestActionsService_DeleteCachesByKey(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/caches\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestFormValues(t, r, values{\"key\": \"1\", \"ref\": \"main\"})\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.DeleteCachesByKey(ctx, \"o\", \"r\", \"1\", Ptr(\"main\"))\n\tif err != nil {\n\t\tt.Errorf(\"Actions.DeleteCachesByKey return error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteCachesByKey\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.DeleteCachesByKey(ctx, \"\\n\", \"\\n\", \"\\n\", Ptr(\"\\n\"))\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.DeleteCachesByKey(ctx, \"o\", \"r\", \"1\", Ptr(\"main\"))\n\t})\n}\n\nfunc TestActionsService_DeleteCachesByKey_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Actions.DeleteCachesByKey(ctx, \"%\", \"r\", \"1\", Ptr(\"main\"))\n\ttestURLParseError(t, err)\n}\n\nfunc TestActionsService_DeleteCachesByKey_invalidRepo(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Actions.DeleteCachesByKey(ctx, \"o\", \"%\", \"1\", Ptr(\"main\"))\n\ttestURLParseError(t, err)\n}\n\nfunc TestActionsService_DeleteCachesByKey_notFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/artifacts/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Actions.DeleteCachesByKey(ctx, \"o\", \"r\", \"1\", Ptr(\"main\"))\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Actions.DeleteCachesByKey return status %v, want %v\", got, want)\n\t}\n}\n\nfunc TestActionsService_DeleteCachesByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/caches/1\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.DeleteCachesByID(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.DeleteCachesByID return error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteCachesByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.DeleteCachesByID(ctx, \"\\n\", \"\\n\", 0)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.DeleteCachesByID(ctx, \"o\", \"r\", 1)\n\t})\n}\n\nfunc TestActionsService_DeleteCachesByID_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Actions.DeleteCachesByID(ctx, \"%\", \"r\", 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestActionsService_DeleteCachesByID_invalidRepo(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Actions.DeleteCachesByID(ctx, \"o\", \"%\", 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestActionsService_DeleteCachesByID_notFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"repos/o/r/actions/caches/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Actions.DeleteCachesByID(ctx, \"o\", \"r\", 1)\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Actions.DeleteCachesByID return status %v, want %v\", got, want)\n\t}\n}\n\nfunc TestActionsService_GetCacheUsageForRepo(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/cache/usage\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w,\n\t\t\t`{\n\t\t\t\t\"full_name\":\"test-cache\",\n\t\t\t\t\"active_caches_size_in_bytes\":1000,\n\t\t\t\t\"active_caches_count\":1\n\t\t\t}`,\n\t\t)\n\t})\n\n\tctx := t.Context()\n\tcacheUse, _, err := client.Actions.GetCacheUsageForRepo(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetCacheUsageForRepo returned error: %v\", err)\n\t}\n\n\twant := &ActionsCacheUsage{FullName: \"test-cache\", ActiveCachesSizeInBytes: 1000, ActiveCachesCount: 1}\n\tif !cmp.Equal(cacheUse, want) {\n\t\tt.Errorf(\"Actions.GetCacheUsageForRepo returned %+v, want %+v\", cacheUse, want)\n\t}\n\n\tconst methodName = \"GetCacheUsageForRepo\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetCacheUsageForRepo(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetCacheUsageForRepo(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetCacheUsageForRepo_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Actions.GetCacheUsageForRepo(ctx, \"%\", \"r\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestActionsService_GetCacheUsageForRepo_invalidRepo(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Actions.GetCacheUsageForRepo(ctx, \"o\", \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestActionsService_GetCacheUsageForRepo_notFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/cache/usage\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tcaches, resp, err := client.Actions.GetCacheUsageForRepo(ctx, \"o\", \"r\")\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Actions.GetCacheUsageForRepo return status %v, want %v\", got, want)\n\t}\n\tif caches != nil {\n\t\tt.Errorf(\"Actions.GetCacheUsageForRepo return %+v, want nil\", caches)\n\t}\n}\n\nfunc TestActionsService_ListCacheUsageByRepoForOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/cache/usage-by-repository\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\", \"per_page\": \"1\"})\n\t\tfmt.Fprint(w,\n\t\t\t`{\n\t\t\t\t\"total_count\":1,\n\t\t\t\t\"repository_cache_usages\":[{\"full_name\":\"test-cache\",\"active_caches_size_in_bytes\":1000,\"active_caches_count\":1}]\n\t\t\t}`,\n\t\t)\n\t})\n\n\topts := &ListOptions{PerPage: 1, Page: 2}\n\tctx := t.Context()\n\tcacheList, _, err := client.Actions.ListCacheUsageByRepoForOrg(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListCacheUsageByRepoForOrg returned error: %v\", err)\n\t}\n\n\twant := &ActionsCacheUsageList{TotalCount: 1, RepoCacheUsage: []*ActionsCacheUsage{{FullName: \"test-cache\", ActiveCachesSizeInBytes: 1000, ActiveCachesCount: 1}}}\n\tif !cmp.Equal(cacheList, want) {\n\t\tt.Errorf(\"Actions.ListCacheUsageByRepoForOrg returned %+v, want %+v\", cacheList, want)\n\t}\n\n\tconst methodName = \"ListCacheUsageByRepoForOrg\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListCacheUsageByRepoForOrg(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListCacheUsageByRepoForOrg(ctx, \"o\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_ListCacheUsageByRepoForOrg_invalidOrganization(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Actions.ListCacheUsageByRepoForOrg(ctx, \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestActionsService_ListCacheUsageByRepoForOrg_notFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/cache/usage-by-repository\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tcaches, resp, err := client.Actions.ListCacheUsageByRepoForOrg(ctx, \"o\", nil)\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Actions.ListCacheUsageByRepoForOrg return status %v, want %v\", got, want)\n\t}\n\tif caches != nil {\n\t\tt.Errorf(\"Actions.ListCacheUsageByRepoForOrg return %+v, want nil\", caches)\n\t}\n}\n\nfunc TestActionsService_GetCacheUsageForOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/cache/usage\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w,\n\t\t\t`{\n\t\t\t\t\"total_active_caches_size_in_bytes\":1000,\n\t\t\t\t\"total_active_caches_count\":1\n\t\t\t}`,\n\t\t)\n\t})\n\n\tctx := t.Context()\n\tcache, _, err := client.Actions.GetTotalCacheUsageForOrg(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetTotalCacheUsageForOrg returned error: %v\", err)\n\t}\n\n\twant := &TotalCacheUsage{TotalActiveCachesUsageSizeInBytes: 1000, TotalActiveCachesCount: 1}\n\tif !cmp.Equal(cache, want) {\n\t\tt.Errorf(\"Actions.GetTotalCacheUsageForOrg returned %+v, want %+v\", cache, want)\n\t}\n\n\tconst methodName = \"GetTotalCacheUsageForOrg\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetTotalCacheUsageForOrg(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetTotalCacheUsageForOrg(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetCacheUsageForOrg_invalidOrganization(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Actions.GetTotalCacheUsageForOrg(ctx, \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestActionsService_GetCacheUsageForOrg_notFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/cache/usage\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tcaches, resp, err := client.Actions.GetTotalCacheUsageForOrg(ctx, \"o\")\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Actions.GetTotalCacheUsageForOrg return status %v, want %v\", got, want)\n\t}\n\tif caches != nil {\n\t\tt.Errorf(\"Actions.GetTotalCacheUsageForOrg return %+v, want nil\", caches)\n\t}\n}\n\nfunc TestActionsService_GetCacheUsageForEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/actions/cache/usage\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w,\n\t\t\t`{\n\t\t\t\t\"total_active_caches_size_in_bytes\":1000,\n\t\t\t\t\"total_active_caches_count\":1\n\t\t\t}`,\n\t\t)\n\t})\n\n\tctx := t.Context()\n\tcache, _, err := client.Actions.GetTotalCacheUsageForEnterprise(ctx, \"e\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetTotalCacheUsageForEnterprise returned error: %v\", err)\n\t}\n\n\twant := &TotalCacheUsage{TotalActiveCachesUsageSizeInBytes: 1000, TotalActiveCachesCount: 1}\n\tif !cmp.Equal(cache, want) {\n\t\tt.Errorf(\"Actions.GetTotalCacheUsageForEnterprise returned %+v, want %+v\", cache, want)\n\t}\n\n\tconst methodName = \"GetTotalCacheUsageForEnterprise\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetTotalCacheUsageForEnterprise(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetTotalCacheUsageForEnterprise(ctx, \"e\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetCacheUsageForEnterprise_invalidEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Actions.GetTotalCacheUsageForEnterprise(ctx, \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestActionsService_GetCacheUsageForEnterprise_notFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/actions/cache/usage\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tcaches, resp, err := client.Actions.GetTotalCacheUsageForEnterprise(ctx, \"o\")\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Actions.GetTotalCacheUsageForEnterprise return status %v, want %v\", got, want)\n\t}\n\tif caches != nil {\n\t\tt.Errorf(\"Actions.GetTotalCacheUsageForEnterprise return %+v, want nil\", caches)\n\t}\n}\n\nfunc TestActionsCache_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ActionsCache{}, \"{}\")\n\n\tu := &ActionsCache{\n\t\tID:             Ptr(int64(1)),\n\t\tRef:            Ptr(\"refAction\"),\n\t\tKey:            Ptr(\"key1\"),\n\t\tVersion:        Ptr(\"alpha\"),\n\t\tLastAccessedAt: &Timestamp{referenceTime},\n\t\tCreatedAt:      &Timestamp{referenceTime},\n\t\tSizeInBytes:    Ptr(int64(1)),\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"ref\": \"refAction\",\n\t\t\"key\": \"key1\",\n\t\t\"version\": \"alpha\",\n\t\t\"last_accessed_at\": ` + referenceTimeStr + `,\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"size_in_bytes\": 1\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestActionsCacheList_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ActionsCacheList{}, `{\"total_count\":0}`)\n\n\tu := &ActionsCacheList{\n\t\tTotalCount: 2,\n\t\tActionsCaches: []*ActionsCache{\n\t\t\t{\n\t\t\t\tID:             Ptr(int64(1)),\n\t\t\t\tKey:            Ptr(\"key1\"),\n\t\t\t\tVersion:        Ptr(\"alpha\"),\n\t\t\t\tLastAccessedAt: &Timestamp{referenceTime},\n\t\t\t\tCreatedAt:      &Timestamp{referenceTime},\n\t\t\t\tSizeInBytes:    Ptr(int64(1)),\n\t\t\t},\n\t\t\t{\n\t\t\t\tID:             Ptr(int64(2)),\n\t\t\t\tRef:            Ptr(\"refAction\"),\n\t\t\t\tLastAccessedAt: &Timestamp{referenceTime},\n\t\t\t\tCreatedAt:      &Timestamp{referenceTime},\n\t\t\t\tSizeInBytes:    Ptr(int64(1)),\n\t\t\t},\n\t\t},\n\t}\n\twant := `{\n\t\t\"total_count\": 2,\n\t\t\"actions_caches\": [{\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"key\": \"key1\",\n\t\t\t\t\"version\": \"alpha\",\n\t\t\t\t\"last_accessed_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"size_in_bytes\": 1\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"id\": 2,\n\t\t\t\t\"ref\": \"refAction\",\n\t\t\t\t\"last_accessed_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"size_in_bytes\": 1\n\t\t}]\n\t}`\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestActionsCacheUsage_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ActionsCacheUsage{}, `{\n\t\t\"active_caches_count\": 0,\n\t\t\"active_caches_size_in_bytes\": 0,\n\t\t\"full_name\": \"\"\n\t}`)\n\n\tu := &ActionsCacheUsage{\n\t\tFullName:                \"cache_usage1\",\n\t\tActiveCachesSizeInBytes: 2,\n\t\tActiveCachesCount:       2,\n\t}\n\n\twant := `{\n\t\t\"full_name\": \"cache_usage1\",\n\t\t\"active_caches_size_in_bytes\": 2,\n\t\t\"active_caches_count\": 2\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestActionsCacheUsageList_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ActionsCacheUsageList{}, `{\"total_count\": 0}`)\n\n\tu := &ActionsCacheUsageList{\n\t\tTotalCount: 1,\n\t\tRepoCacheUsage: []*ActionsCacheUsage{\n\t\t\t{\n\t\t\t\tFullName:                \"cache_usage1\",\n\t\t\t\tActiveCachesSizeInBytes: 2,\n\t\t\t\tActiveCachesCount:       2,\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"total_count\": 1,\n\t\t\"repository_cache_usages\": [{\n\t\t\t\"full_name\": \"cache_usage1\",\n\t\t\t\"active_caches_size_in_bytes\": 2,\n\t\t\t\"active_caches_count\": 2\n\t\t}]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestTotalCacheUsage_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &TotalCacheUsage{}, `{\n\t\t\"total_active_caches_count\": 0,\n\t\t\"total_active_caches_size_in_bytes\": 0\n\t}`)\n\n\tu := &TotalCacheUsage{\n\t\tTotalActiveCachesUsageSizeInBytes: 2,\n\t\tTotalActiveCachesCount:            2,\n\t}\n\n\twant := `{\n\t\t\"total_active_caches_size_in_bytes\": 2,\n\t\t\"total_active_caches_count\": 2\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/actions_hosted_runners.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n)\n\n// HostedRunnerPublicIP represents the details of a public IP for GitHub-hosted runner.\ntype HostedRunnerPublicIP struct {\n\tEnabled bool   `json:\"enabled\"` // Whether public IP is enabled.\n\tPrefix  string `json:\"prefix\"`  // The prefix for the public IP. Example: 20.80.208.150\n\tLength  int    `json:\"length\"`  // The length of the IP prefix. Example: 28\n}\n\n// HostedRunnerMachineSpec represents the details of a particular machine specification for GitHub-hosted runner.\ntype HostedRunnerMachineSpec struct {\n\tID        string `json:\"id\"`         // The ID used for the `size` parameter when creating a new runner. Example: 8-core\n\tCPUCores  int    `json:\"cpu_cores\"`  // The number of cores. Example: 8\n\tMemoryGB  int    `json:\"memory_gb\"`  // The available RAM for the machine spec. Example: 32\n\tStorageGB int    `json:\"storage_gb\"` // The available SSD storage for the machine spec. Example: 300\n}\n\n// HostedRunner represents a single GitHub-hosted runner with additional details.\ntype HostedRunner struct {\n\tID                 *int64                   `json:\"id,omitempty\"`\n\tName               *string                  `json:\"name,omitempty\"`\n\tRunnerGroupID      *int64                   `json:\"runner_group_id,omitempty\"`\n\tPlatform           *string                  `json:\"platform,omitempty\"`\n\tImageDetails       *HostedRunnerImageDetail `json:\"image_details,omitempty\"`\n\tMachineSizeDetails *HostedRunnerMachineSpec `json:\"machine_size_details,omitempty\"`\n\tStatus             *string                  `json:\"status,omitempty\"`\n\tMaximumRunners     *int64                   `json:\"maximum_runners,omitempty\"`\n\tPublicIPEnabled    *bool                    `json:\"public_ip_enabled,omitempty\"`\n\tPublicIPs          []*HostedRunnerPublicIP  `json:\"public_ips,omitempty\"`\n\tLastActiveOn       *Timestamp               `json:\"last_active_on,omitempty\"`\n}\n\n// HostedRunnerImageDetail represents the image details of a GitHub-hosted runners.\ntype HostedRunnerImageDetail struct {\n\tID          *string `json:\"id\"`           // The ID of the image. Use this ID for the `image` parameter when creating a new larger runner. Example: ubuntu-20.04\n\tSizeGB      *int64  `json:\"size_gb\"`      // Image size in GB. Example: 86\n\tDisplayName *string `json:\"display_name\"` // Display name for this image. Example: 20.04\n\tSource      *string `json:\"source\"`       // The image provider. Example: github, partner, custom\n\tVersion     *string `json:\"version\"`      // The image version of the hosted runner pool. Example: latest\n}\n\n// HostedRunners represents a collection of GitHub-hosted runners for an organization.\ntype HostedRunners struct {\n\tTotalCount int             `json:\"total_count\"`\n\tRunners    []*HostedRunner `json:\"runners\"`\n}\n\n// ListHostedRunners lists all the GitHub-hosted runners for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#list-github-hosted-runners-for-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/hosted-runners\nfunc (s *ActionsService) ListHostedRunners(ctx context.Context, org string, opts *ListOptions) (*HostedRunners, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/hosted-runners\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar runners *HostedRunners\n\tresp, err := s.client.Do(ctx, req, &runners)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn runners, resp, nil\n}\n\n// HostedRunnerImage represents the image of GitHub-hosted runners.\ntype HostedRunnerImage struct {\n\t// The unique identifier of the runner image.\n\tID string `json:\"id\"`\n\t// The source of the runner image. Can be one of: github, partner, custom.\n\tSource string `json:\"source\"`\n\t// The version of the runner image to deploy. This is relevant only for runners using custom images.\n\tVersion *string `json:\"version,omitempty\"`\n}\n\n// CreateHostedRunnerRequest specifies body parameters to create Hosted Runner configuration.\ntype CreateHostedRunnerRequest struct {\n\tName           string            `json:\"name\"`\n\tImage          HostedRunnerImage `json:\"image\"`\n\tSize           string            `json:\"size\"`\n\tRunnerGroupID  int64             `json:\"runner_group_id\"`\n\tMaximumRunners *int64            `json:\"maximum_runners,omitempty\"`\n\tEnableStaticIP *bool             `json:\"enable_static_ip,omitempty\"`\n\tImageGen       *bool             `json:\"image_gen,omitempty\"`\n}\n\n// UpdateHostedRunnerRequest specifies body parameters to update Hosted Runner configuration.\ntype UpdateHostedRunnerRequest struct {\n\tName           *string `json:\"name,omitempty\"`\n\tRunnerGroupID  *int64  `json:\"runner_group_id,omitempty\"`\n\tMaximumRunners *int64  `json:\"maximum_runners,omitempty\"`\n\tEnableStaticIP *bool   `json:\"enable_static_ip,omitempty\"`\n\tSize           *string `json:\"size,omitempty\"`\n\tImageID        *string `json:\"image_id,omitempty\"`\n\tImageVersion   *string `json:\"image_version,omitempty\"`\n}\n\n// validateCreateHostedRunnerRequest validates the provided CreateHostedRunnerRequest to ensure\n// that all required fields are properly set and that no invalid fields are present for hosted runner create request.\n//\n// If any of these conditions are violated, an appropriate error message is returned.\n// Otherwise, nil is returned, indicating the request is valid.\nfunc validateCreateHostedRunnerRequest(request *CreateHostedRunnerRequest) error {\n\tif request.Name == \"\" {\n\t\treturn errors.New(\"name is required for creating a hosted runner\")\n\t}\n\tif request.Image == (HostedRunnerImage{}) {\n\t\treturn errors.New(\"image is required for creating a hosted runner\")\n\t}\n\tif request.Size == \"\" {\n\t\treturn errors.New(\"size is required for creating a hosted runner\")\n\t}\n\tif request.RunnerGroupID == 0 {\n\t\treturn errors.New(\"runner group ID is required for creating a hosted runner\")\n\t}\n\treturn nil\n}\n\n// CreateHostedRunner creates a GitHub-hosted runner for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#create-a-github-hosted-runner-for-an-organization\n//\n//meta:operation POST /orgs/{org}/actions/hosted-runners\nfunc (s *ActionsService) CreateHostedRunner(ctx context.Context, org string, request CreateHostedRunnerRequest) (*HostedRunner, *Response, error) {\n\tif err := validateCreateHostedRunnerRequest(&request); err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"validation failed: %w\", err)\n\t}\n\n\tu := fmt.Sprintf(\"orgs/%v/actions/hosted-runners\", org)\n\treq, err := s.client.NewRequest(\"POST\", u, request)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar hostedRunner *HostedRunner\n\tresp, err := s.client.Do(ctx, req, &hostedRunner)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn hostedRunner, resp, nil\n}\n\n// HostedRunnerCustomImage represents a custom image definition for GitHub-hosted runners.\ntype HostedRunnerCustomImage struct {\n\tID                int64  `json:\"id\"`\n\tPlatform          string `json:\"platform\"`\n\tName              string `json:\"name\"`\n\tSource            string `json:\"source\"`\n\tVersionsCount     int    `json:\"versions_count\"`\n\tTotalVersionsSize int    `json:\"total_versions_size\"`\n\tLatestVersion     string `json:\"latest_version\"`\n\tState             string `json:\"state\"`\n}\n\n// HostedRunnerCustomImages represents a collection of custom images for GitHub-hosted runners.\ntype HostedRunnerCustomImages struct {\n\tTotalCount int                        `json:\"total_count\"`\n\tImages     []*HostedRunnerCustomImage `json:\"images\"`\n}\n\n// HostedRunnerCustomImageVersion represents a version of a custom image for GitHub-hosted runners.\ntype HostedRunnerCustomImageVersion struct {\n\tVersion      string    `json:\"version\"`\n\tSizeGB       int       `json:\"size_gb\"`\n\tState        string    `json:\"state\"`\n\tStateDetails string    `json:\"state_details\"`\n\tCreatedOn    Timestamp `json:\"created_on\"`\n}\n\n// HostedRunnerCustomImageVersions represents a collection of versions of a custom image.\ntype HostedRunnerCustomImageVersions struct {\n\tTotalCount    int                               `json:\"total_count\"`\n\tImageVersions []*HostedRunnerCustomImageVersion `json:\"image_versions\"`\n}\n\n// HostedRunnerImageSpecs represents the details of a GitHub-hosted runner image.\ntype HostedRunnerImageSpecs struct {\n\tID          string `json:\"id\"`\n\tPlatform    string `json:\"platform\"`\n\tSizeGB      int    `json:\"size_gb\"`\n\tDisplayName string `json:\"display_name\"`\n\tSource      string `json:\"source\"`\n}\n\n// HostedRunnerImages represents the response containing the total count and details of runner images.\ntype HostedRunnerImages struct {\n\tTotalCount int                       `json:\"total_count\"`\n\tImages     []*HostedRunnerImageSpecs `json:\"images\"`\n}\n\n// GetHostedRunnerGitHubOwnedImages gets the list of GitHub-owned images available for GitHub-hosted runners for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-github-owned-images-for-github-hosted-runners-in-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/hosted-runners/images/github-owned\nfunc (s *ActionsService) GetHostedRunnerGitHubOwnedImages(ctx context.Context, org string) (*HostedRunnerImages, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/hosted-runners/images/github-owned\", org)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar hostedRunnerImages *HostedRunnerImages\n\tresp, err := s.client.Do(ctx, req, &hostedRunnerImages)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn hostedRunnerImages, resp, nil\n}\n\n// GetHostedRunnerPartnerImages gets the list of partner images available for GitHub-hosted runners for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-partner-images-for-github-hosted-runners-in-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/hosted-runners/images/partner\nfunc (s *ActionsService) GetHostedRunnerPartnerImages(ctx context.Context, org string) (*HostedRunnerImages, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/hosted-runners/images/partner\", org)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar hostedRunnerImages *HostedRunnerImages\n\tresp, err := s.client.Do(ctx, req, &hostedRunnerImages)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn hostedRunnerImages, resp, nil\n}\n\n// HostedRunnerPublicIPLimits represents the static public IP limits for GitHub-hosted runners.\ntype HostedRunnerPublicIPLimits struct {\n\tPublicIPs *PublicIPUsage `json:\"public_ips\"`\n}\n\n// PublicIPUsage provides details of static public IP limits for GitHub-hosted runners.\ntype PublicIPUsage struct {\n\tMaximum      int64 `json:\"maximum\"`       // The maximum number of static public IP addresses that can be used for Hosted Runners. Example: 50\n\tCurrentUsage int64 `json:\"current_usage\"` // The current number of static public IP addresses in use by Hosted Runners. Example: 17\n}\n\n// GetHostedRunnerLimits gets the GitHub-hosted runners Static public IP Limits for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-limits-on-github-hosted-runners-for-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/hosted-runners/limits\nfunc (s *ActionsService) GetHostedRunnerLimits(ctx context.Context, org string) (*HostedRunnerPublicIPLimits, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/hosted-runners/limits\", org)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar publicIPLimits *HostedRunnerPublicIPLimits\n\tresp, err := s.client.Do(ctx, req, &publicIPLimits)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn publicIPLimits, resp, nil\n}\n\n// HostedRunnerMachineSpecs represents the response containing the total count and details of machine specs for GitHub-hosted runners.\ntype HostedRunnerMachineSpecs struct {\n\tTotalCount   int                        `json:\"total_count\"`\n\tMachineSpecs []*HostedRunnerMachineSpec `json:\"machine_specs\"`\n}\n\n// GetHostedRunnerMachineSpecs gets the list of machine specs available for GitHub-hosted runners for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-github-hosted-runners-machine-specs-for-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/hosted-runners/machine-sizes\nfunc (s *ActionsService) GetHostedRunnerMachineSpecs(ctx context.Context, org string) (*HostedRunnerMachineSpecs, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/hosted-runners/machine-sizes\", org)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar machineSpecs *HostedRunnerMachineSpecs\n\tresp, err := s.client.Do(ctx, req, &machineSpecs)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn machineSpecs, resp, nil\n}\n\n// HostedRunnerPlatforms represents the response containing the total count and platforms for GitHub-hosted runners.\ntype HostedRunnerPlatforms struct {\n\tTotalCount int      `json:\"total_count\"`\n\tPlatforms  []string `json:\"platforms\"`\n}\n\n// GetHostedRunnerPlatforms gets list of platforms available for GitHub-hosted runners for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-platforms-for-github-hosted-runners-in-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/hosted-runners/platforms\nfunc (s *ActionsService) GetHostedRunnerPlatforms(ctx context.Context, org string) (*HostedRunnerPlatforms, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/hosted-runners/platforms\", org)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar platforms *HostedRunnerPlatforms\n\tresp, err := s.client.Do(ctx, req, &platforms)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn platforms, resp, nil\n}\n\n// GetHostedRunner gets a GitHub-hosted runner in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-a-github-hosted-runner-for-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}\nfunc (s *ActionsService) GetHostedRunner(ctx context.Context, org string, runnerID int64) (*HostedRunner, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/hosted-runners/%v\", org, runnerID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar hostedRunner *HostedRunner\n\tresp, err := s.client.Do(ctx, req, &hostedRunner)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn hostedRunner, resp, nil\n}\n\n// UpdateHostedRunner updates a GitHub-hosted runner for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#update-a-github-hosted-runner-for-an-organization\n//\n//meta:operation PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}\nfunc (s *ActionsService) UpdateHostedRunner(ctx context.Context, org string, runnerID int64, request UpdateHostedRunnerRequest) (*HostedRunner, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/hosted-runners/%v\", org, runnerID)\n\treq, err := s.client.NewRequest(\"PATCH\", u, request)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar hostedRunner *HostedRunner\n\tresp, err := s.client.Do(ctx, req, &hostedRunner)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn hostedRunner, resp, nil\n}\n\n// DeleteHostedRunner deletes GitHub-hosted runner from an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#delete-a-github-hosted-runner-for-an-organization\n//\n//meta:operation DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}\nfunc (s *ActionsService) DeleteHostedRunner(ctx context.Context, org string, runnerID int64) (*HostedRunner, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/hosted-runners/%v\", org, runnerID)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar hostedRunner *HostedRunner\n\tresp, err := s.client.Do(ctx, req, &hostedRunner)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn hostedRunner, resp, nil\n}\n\n// ListHostedRunnerCustomImages lists custom images for GitHub-hosted runners in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#list-custom-images-for-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/hosted-runners/images/custom\nfunc (s *ActionsService) ListHostedRunnerCustomImages(ctx context.Context, org string) (*HostedRunnerCustomImages, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/hosted-runners/images/custom\", org)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar images *HostedRunnerCustomImages\n\tresp, err := s.client.Do(ctx, req, &images)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn images, resp, nil\n}\n\n// GetHostedRunnerCustomImage gets a custom image definition for GitHub-hosted runners in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-a-custom-image-definition-for-github-actions-hosted-runners\n//\n//meta:operation GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}\nfunc (s *ActionsService) GetHostedRunnerCustomImage(ctx context.Context, org string, imageDefinitionID int64) (*HostedRunnerCustomImage, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/hosted-runners/images/custom/%v\", org, imageDefinitionID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar image *HostedRunnerCustomImage\n\tresp, err := s.client.Do(ctx, req, &image)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn image, resp, nil\n}\n\n// DeleteHostedRunnerCustomImage deletes a custom image from the organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#delete-a-custom-image-from-the-organization\n//\n//meta:operation DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}\nfunc (s *ActionsService) DeleteHostedRunnerCustomImage(ctx context.Context, org string, imageDefinitionID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/hosted-runners/images/custom/%v\", org, imageDefinitionID)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// ListHostedRunnerCustomImageVersions lists image versions of a custom image for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#list-image-versions-of-a-custom-image-for-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions\nfunc (s *ActionsService) ListHostedRunnerCustomImageVersions(ctx context.Context, org string, imageDefinitionID int64) (*HostedRunnerCustomImageVersions, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/hosted-runners/images/custom/%v/versions\", org, imageDefinitionID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar versions *HostedRunnerCustomImageVersions\n\tresp, err := s.client.Do(ctx, req, &versions)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn versions, resp, nil\n}\n\n// GetHostedRunnerCustomImageVersion gets an image version of a custom image for GitHub-hosted runners in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#get-an-image-version-of-a-custom-image-for-github-actions-hosted-runners\n//\n//meta:operation GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}\nfunc (s *ActionsService) GetHostedRunnerCustomImageVersion(ctx context.Context, org string, imageDefinitionID int64, version string) (*HostedRunnerCustomImageVersion, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/hosted-runners/images/custom/%v/versions/%v\", org, imageDefinitionID, version)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar imageVersion *HostedRunnerCustomImageVersion\n\tresp, err := s.client.Do(ctx, req, &imageVersion)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn imageVersion, resp, nil\n}\n\n// DeleteHostedRunnerCustomImageVersion deletes an image version of a custom image from the organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/hosted-runners#delete-an-image-version-of-custom-image-from-the-organization\n//\n//meta:operation DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}\nfunc (s *ActionsService) DeleteHostedRunnerCustomImageVersion(ctx context.Context, org string, imageDefinitionID int64, version string) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/hosted-runners/images/custom/%v/versions/%v\", org, imageDefinitionID, version)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/actions_hosted_runners_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestActionsService_ListHostedRunners(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/hosted-runners\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"total_count\": 2,\n\t\t\t\"runners\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": 5,\n\t\t\t\t\t\"name\": \"My hosted ubuntu runner\",\n\t\t\t\t\t\"runner_group_id\": 2,\n\t\t\t\t\t\"platform\": \"linux-x64\",\n\t\t\t\t\t\"image_details\": {\n\t\t\t\t\t\t\"id\": \"ubuntu-20.04\",\n\t\t\t\t\t\t\"size_gb\": 86\n\t\t\t\t\t},\n\t\t\t\t\t\"machine_size_details\": {\n\t\t\t\t\t\t\"id\": \"4-core\",\n\t\t\t\t\t\t\"cpu_cores\": 4,\n\t\t\t\t\t\t\"memory_gb\": 16,\n\t\t\t\t\t\t\"storage_gb\": 150\n\t\t\t\t\t},\n\t\t\t\t\t\"status\": \"Ready\",\n\t\t\t\t\t\"maximum_runners\": 10,\n\t\t\t\t\t\"public_ip_enabled\": true,\n\t\t\t\t\t\"public_ips\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"enabled\": true,\n\t\t\t\t\t\t\t\"prefix\": \"20.80.208.150\",\n\t\t\t\t\t\t\t\"length\": 31\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"last_active_on\": \"2023-04-26T15:23:37Z\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"id\": 7,\n\t\t\t\t\t\"name\": \"My hosted Windows runner\",\n\t\t\t\t\t\"runner_group_id\": 2,\n\t\t\t\t\t\"platform\": \"win-x64\",\n\t\t\t\t\t\"image_details\": {\n\t\t\t\t\t\t\"id\": \"windows-latest\",\n\t\t\t\t\t\t\"size_gb\": 256\n\t\t\t\t\t},\n\t\t\t\t\t\"machine_size_details\": {\n\t\t\t\t\t\t\"id\": \"8-core\",\n\t\t\t\t\t\t\"cpu_cores\": 8,\n\t\t\t\t\t\t\"memory_gb\": 32,\n\t\t\t\t\t\t\"storage_gb\": 300\n\t\t\t\t\t},\n\t\t\t\t\t\"status\": \"Ready\",\n\t\t\t\t\t\"maximum_runners\": 20,\n\t\t\t\t\t\"public_ip_enabled\": false,\n\t\t\t\t\t\"public_ips\": [],\n\t\t\t\t\t\"last_active_on\": \"2023-04-26T15:23:37Z\"\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\topts := &ListOptions{Page: 1, PerPage: 1}\n\tctx := t.Context()\n\thostedRunners, _, err := client.Actions.ListHostedRunners(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListHostedRunners returned error: %v\", err)\n\t}\n\n\tlastActiveOn := Timestamp{time.Date(2023, 4, 26, 15, 23, 37, 0, time.UTC)}\n\n\twant := &HostedRunners{\n\t\tTotalCount: 2,\n\t\tRunners: []*HostedRunner{\n\t\t\t{\n\t\t\t\tID:            Ptr(int64(5)),\n\t\t\t\tName:          Ptr(\"My hosted ubuntu runner\"),\n\t\t\t\tRunnerGroupID: Ptr(int64(2)),\n\t\t\t\tPlatform:      Ptr(\"linux-x64\"),\n\t\t\t\tImageDetails: &HostedRunnerImageDetail{\n\t\t\t\t\tID:     Ptr(\"ubuntu-20.04\"),\n\t\t\t\t\tSizeGB: Ptr(int64(86)),\n\t\t\t\t},\n\t\t\t\tMachineSizeDetails: &HostedRunnerMachineSpec{\n\t\t\t\t\tID:        \"4-core\",\n\t\t\t\t\tCPUCores:  4,\n\t\t\t\t\tMemoryGB:  16,\n\t\t\t\t\tStorageGB: 150,\n\t\t\t\t},\n\t\t\t\tStatus:          Ptr(\"Ready\"),\n\t\t\t\tMaximumRunners:  Ptr(int64(10)),\n\t\t\t\tPublicIPEnabled: Ptr(true),\n\t\t\t\tPublicIPs: []*HostedRunnerPublicIP{\n\t\t\t\t\t{\n\t\t\t\t\t\tEnabled: true,\n\t\t\t\t\t\tPrefix:  \"20.80.208.150\",\n\t\t\t\t\t\tLength:  31,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tLastActiveOn: Ptr(lastActiveOn),\n\t\t\t},\n\t\t\t{\n\t\t\t\tID:            Ptr(int64(7)),\n\t\t\t\tName:          Ptr(\"My hosted Windows runner\"),\n\t\t\t\tRunnerGroupID: Ptr(int64(2)),\n\t\t\t\tPlatform:      Ptr(\"win-x64\"),\n\t\t\t\tImageDetails: &HostedRunnerImageDetail{\n\t\t\t\t\tID:     Ptr(\"windows-latest\"),\n\t\t\t\t\tSizeGB: Ptr(int64(256)),\n\t\t\t\t},\n\t\t\t\tMachineSizeDetails: &HostedRunnerMachineSpec{\n\t\t\t\t\tID:        \"8-core\",\n\t\t\t\t\tCPUCores:  8,\n\t\t\t\t\tMemoryGB:  32,\n\t\t\t\t\tStorageGB: 300,\n\t\t\t\t},\n\t\t\t\tStatus:          Ptr(\"Ready\"),\n\t\t\t\tMaximumRunners:  Ptr(int64(20)),\n\t\t\t\tPublicIPEnabled: Ptr(false),\n\t\t\t\tPublicIPs:       []*HostedRunnerPublicIP{},\n\t\t\t\tLastActiveOn:    Ptr(lastActiveOn),\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(hostedRunners, want) {\n\t\tt.Errorf(\"Actions.ListHostedRunners returned %+v, want %+v\", hostedRunners, want)\n\t}\n\n\tconst methodName = \"ListHostedRunners\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListHostedRunners(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListHostedRunners(ctx, \"o\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_CreateHostedRunner(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/hosted-runners\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 5,\n\t\t\t\"name\": \"My hosted ubuntu runner\",\n\t\t\t\"runner_group_id\": 2,\n\t\t\t\"platform\": \"linux-x64\",\n\t\t\t\"image_details\": {\n\t\t\t\t\"id\": \"ubuntu-20.04\",\n\t\t\t\t\"size_gb\": 86\n\t\t\t},\n\t\t\t\"machine_size_details\": {\n\t\t\t\t\"id\": \"4-core\",\n\t\t\t\t\"cpu_cores\": 4,\n\t\t\t\t\"memory_gb\": 16,\n\t\t\t\t\"storage_gb\": 150\n\t\t\t},\n\t\t\t\"status\": \"Ready\",\n\t\t\t\"maximum_runners\": 10,\n\t\t\t\"public_ip_enabled\": true,\n\t\t\t\"public_ips\": [\n\t\t\t\t{\n\t\t\t\t\t\"enabled\": true,\n\t\t\t\t\t\"prefix\": \"20.80.208.150\",\n\t\t\t\t\t\"length\": 31\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"last_active_on\": \"2023-04-26T15:23:37Z\"\n\t\t\t}`)\n\t})\n\n\tctx := t.Context()\n\n\tvalidReq := CreateHostedRunnerRequest{\n\t\tName: \"My Hosted runner\",\n\t\tImage: HostedRunnerImage{\n\t\t\tID:      \"ubuntu-latest\",\n\t\t\tSource:  \"github\",\n\t\t\tVersion: Ptr(\"latest\"),\n\t\t},\n\t\tRunnerGroupID:  1,\n\t\tSize:           \"4-core\",\n\t\tMaximumRunners: Ptr(int64(50)),\n\t\tEnableStaticIP: Ptr(false),\n\t\tImageGen:       Ptr(true),\n\t}\n\thostedRunner, _, err := client.Actions.CreateHostedRunner(ctx, \"o\", validReq)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.CreateHostedRunner returned error: %v\", err)\n\t}\n\n\tlastActiveOn := Timestamp{time.Date(2023, 4, 26, 15, 23, 37, 0, time.UTC)}\n\twant := &HostedRunner{\n\t\tID:            Ptr(int64(5)),\n\t\tName:          Ptr(\"My hosted ubuntu runner\"),\n\t\tRunnerGroupID: Ptr(int64(2)),\n\t\tPlatform:      Ptr(\"linux-x64\"),\n\t\tImageDetails: &HostedRunnerImageDetail{\n\t\t\tID:     Ptr(\"ubuntu-20.04\"),\n\t\t\tSizeGB: Ptr(int64(86)),\n\t\t},\n\t\tMachineSizeDetails: &HostedRunnerMachineSpec{\n\t\t\tID:        \"4-core\",\n\t\t\tCPUCores:  4,\n\t\t\tMemoryGB:  16,\n\t\t\tStorageGB: 150,\n\t\t},\n\t\tStatus:          Ptr(\"Ready\"),\n\t\tMaximumRunners:  Ptr(int64(10)),\n\t\tPublicIPEnabled: Ptr(true),\n\t\tPublicIPs: []*HostedRunnerPublicIP{\n\t\t\t{\n\t\t\t\tEnabled: true,\n\t\t\t\tPrefix:  \"20.80.208.150\",\n\t\t\t\tLength:  31,\n\t\t\t},\n\t\t},\n\t\tLastActiveOn: Ptr(lastActiveOn),\n\t}\n\n\tif !cmp.Equal(hostedRunner, want) {\n\t\tt.Errorf(\"Actions.CreateHostedRunner returned %+v, want %+v\", hostedRunner, want)\n\t}\n\n\t// Validation tests\n\ttestCases := []struct {\n\t\tname          string\n\t\trequest       CreateHostedRunnerRequest\n\t\texpectedError string\n\t}{\n\t\t{\n\t\t\tname: \"Missing Size\",\n\t\t\trequest: CreateHostedRunnerRequest{\n\t\t\t\tName: \"My Hosted runner\",\n\t\t\t\tImage: HostedRunnerImage{\n\t\t\t\t\tID:      \"ubuntu-latest\",\n\t\t\t\t\tSource:  \"github\",\n\t\t\t\t\tVersion: Ptr(\"latest\"),\n\t\t\t\t},\n\t\t\t\tRunnerGroupID: 1,\n\t\t\t},\n\t\t\texpectedError: \"validation failed: size is required for creating a hosted runner\",\n\t\t},\n\t\t{\n\t\t\tname: \"Missing Image\",\n\t\t\trequest: CreateHostedRunnerRequest{\n\t\t\t\tName:          \"My Hosted runner\",\n\t\t\t\tRunnerGroupID: 1,\n\t\t\t\tSize:          \"4-core\",\n\t\t\t},\n\t\t\texpectedError: \"validation failed: image is required for creating a hosted runner\",\n\t\t},\n\t\t{\n\t\t\tname: \"Missing Name\",\n\t\t\trequest: CreateHostedRunnerRequest{\n\t\t\t\tImage: HostedRunnerImage{\n\t\t\t\t\tID:      \"ubuntu-latest\",\n\t\t\t\t\tSource:  \"github\",\n\t\t\t\t\tVersion: Ptr(\"latest\"),\n\t\t\t\t},\n\t\t\t\tRunnerGroupID: 1,\n\t\t\t\tSize:          \"4-core\",\n\t\t\t},\n\t\t\texpectedError: \"validation failed: name is required for creating a hosted runner\",\n\t\t},\n\t\t{\n\t\t\tname: \"Missing RunnerGroupID\",\n\t\t\trequest: CreateHostedRunnerRequest{\n\t\t\t\tName: \"My Hosted runner\",\n\t\t\t\tImage: HostedRunnerImage{\n\t\t\t\t\tID:      \"ubuntu-latest\",\n\t\t\t\t\tSource:  \"github\",\n\t\t\t\t\tVersion: Ptr(\"latest\"),\n\t\t\t\t},\n\t\t\t\tSize: \"4-core\",\n\t\t\t},\n\t\t\texpectedError: \"validation failed: runner group ID is required for creating a hosted runner\",\n\t\t},\n\t}\n\n\tfor _, tt := range testCases {\n\t\t_, _, err := client.Actions.CreateHostedRunner(ctx, \"o\", tt.request)\n\t\tif err == nil || err.Error() != tt.expectedError {\n\t\t\tt.Errorf(\"expected error: %v, got: %v\", tt.expectedError, err)\n\t\t}\n\t}\n\n\tconst methodName = \"CreateHostedRunner\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.CreateHostedRunner(ctx, \"\\n\", validReq)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.CreateHostedRunner(ctx, \"o\", validReq)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetHostedRunnerGitHubOwnedImages(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/hosted-runners/images/github-owned\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"total_count\": 1,\n\t\t\t\"images\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"ubuntu-20.04\",\n\t\t\t\t\t\"platform\": \"linux-x64\",\n\t\t\t\t\t\"size_gb\": 86,\n\t\t\t\t\t\"display_name\": \"20.04\",\n\t\t\t\t\t\"source\": \"github\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t}`)\n\t})\n\n\tctx := t.Context()\n\thostedRunnerImages, _, err := client.Actions.GetHostedRunnerGitHubOwnedImages(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetHostedRunnerGitHubOwnedImages returned error: %v\", err)\n\t}\n\n\twant := &HostedRunnerImages{\n\t\tTotalCount: 1,\n\t\tImages: []*HostedRunnerImageSpecs{\n\t\t\t{\n\t\t\t\tID:          \"ubuntu-20.04\",\n\t\t\t\tPlatform:    \"linux-x64\",\n\t\t\t\tSizeGB:      86,\n\t\t\t\tDisplayName: \"20.04\",\n\t\t\t\tSource:      \"github\",\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(hostedRunnerImages, want) {\n\t\tt.Errorf(\"Actions.GetHostedRunnerGitHubOwnedImages returned %+v, want %+v\", hostedRunnerImages, want)\n\t}\n\n\tconst methodName = \"GetHostedRunnerGitHubOwnedImages\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetHostedRunnerGitHubOwnedImages(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetHostedRunnerGitHubOwnedImages(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetHostedRunnerPartnerImages(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/hosted-runners/images/partner\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"total_count\": 1,\n\t\t\t\"images\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"ubuntu-20.04\",\n\t\t\t\t\t\"platform\": \"linux-x64\",\n\t\t\t\t\t\"size_gb\": 86,\n\t\t\t\t\t\"display_name\": \"20.04\",\n\t\t\t\t\t\"source\": \"partner\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t}`)\n\t})\n\n\tctx := t.Context()\n\thostedRunnerImages, _, err := client.Actions.GetHostedRunnerPartnerImages(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetHostedRunnerPartnerImages returned error: %v\", err)\n\t}\n\n\twant := &HostedRunnerImages{\n\t\tTotalCount: 1,\n\t\tImages: []*HostedRunnerImageSpecs{\n\t\t\t{\n\t\t\t\tID:          \"ubuntu-20.04\",\n\t\t\t\tPlatform:    \"linux-x64\",\n\t\t\t\tSizeGB:      86,\n\t\t\t\tDisplayName: \"20.04\",\n\t\t\t\tSource:      \"partner\",\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(hostedRunnerImages, want) {\n\t\tt.Errorf(\"Actions.GetHostedRunnerPartnerImages returned %+v, want %+v\", hostedRunnerImages, want)\n\t}\n\n\tconst methodName = \"GetHostedRunnerPartnerImages\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetHostedRunnerPartnerImages(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetHostedRunnerPartnerImages(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetHostedRunnerLimits(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/hosted-runners/limits\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"public_ips\": {\n\t\t\t\t\"current_usage\": 17,\n\t\t\t\t\"maximum\": 50\n\t\t\t}\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tpublicIPLimits, _, err := client.Actions.GetHostedRunnerLimits(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetPartnerImages returned error: %v\", err)\n\t}\n\n\twant := &HostedRunnerPublicIPLimits{\n\t\tPublicIPs: &PublicIPUsage{\n\t\t\tCurrentUsage: 17,\n\t\t\tMaximum:      50,\n\t\t},\n\t}\n\n\tif !cmp.Equal(publicIPLimits, want) {\n\t\tt.Errorf(\"Actions.GetHostedRunnerLimits returned %+v, want %+v\", publicIPLimits, want)\n\t}\n\n\tconst methodName = \"GetHostedRunnerLimits\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetHostedRunnerLimits(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetHostedRunnerLimits(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetHostedRunnerMachineSpecs(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/hosted-runners/machine-sizes\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"total_count\": 1,\n\t\t\t\"machine_specs\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"4-core\",\n \t \t\t\t\t\"cpu_cores\": 4,\n  \t\t\t\t\t\"memory_gb\": 16,\n  \t\t\t\t\t\"storage_gb\": 150\n\t\t\t\t}\n\t\t\t]\n\t\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tmachineSpecs, _, err := client.Actions.GetHostedRunnerMachineSpecs(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetHostedRunnerMachineSpecs returned error: %v\", err)\n\t}\n\twant := &HostedRunnerMachineSpecs{\n\t\tTotalCount: 1,\n\t\tMachineSpecs: []*HostedRunnerMachineSpec{\n\t\t\t{\n\t\t\t\tID:        \"4-core\",\n\t\t\t\tCPUCores:  4,\n\t\t\t\tMemoryGB:  16,\n\t\t\t\tStorageGB: 150,\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(machineSpecs, want) {\n\t\tt.Errorf(\"Actions.GetHostedRunnerMachineSpecs returned %+v, want %+v\", machineSpecs, want)\n\t}\n\n\tconst methodName = \"GetHostedRunnerMachineSpecs\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetHostedRunnerMachineSpecs(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetHostedRunnerMachineSpecs(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetHostedRunnerPlatforms(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/hosted-runners/platforms\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"total_count\": 1,\n  \t\t\t\"platforms\": [\n    \t\t\t\"linux-x64\",\n    \t\t\t\"win-x64\"\n  \t\t\t]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tplatforms, _, err := client.Actions.GetHostedRunnerPlatforms(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetHostedRunnerPlatforms returned error: %v\", err)\n\t}\n\twant := &HostedRunnerPlatforms{\n\t\tTotalCount: 1,\n\t\tPlatforms: []string{\n\t\t\t\"linux-x64\",\n\t\t\t\"win-x64\",\n\t\t},\n\t}\n\n\tif !cmp.Equal(platforms, want) {\n\t\tt.Errorf(\"Actions.GetHostedRunnerPlatforms returned %+v, want %+v\", platforms, want)\n\t}\n\n\tconst methodName = \"GetHostedRunnerPlatforms\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetHostedRunnerPlatforms(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetHostedRunnerPlatforms(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetHostedRunner(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/hosted-runners/23\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 5,\n\t\t\t\"name\": \"My hosted ubuntu runner\",\n\t\t\t\"runner_group_id\": 2,\n\t\t\t\"platform\": \"linux-x64\",\n\t\t\t\"image_details\": {\n\t\t\t\t\"id\": \"ubuntu-20.04\",\n\t\t\t\t\"size_gb\": 86\n\t\t\t},\n\t\t\t\"machine_size_details\": {\n\t\t\t\t\"id\": \"4-core\",\n\t\t\t\t\"cpu_cores\": 4,\n\t\t\t\t\"memory_gb\": 16,\n\t\t\t\t\"storage_gb\": 150\n\t\t\t},\n\t\t\t\"status\": \"Ready\",\n\t\t\t\"maximum_runners\": 10,\n\t\t\t\"public_ip_enabled\": true,\n\t\t\t\"public_ips\": [\n\t\t\t\t{\n\t\t\t\t\"enabled\": true,\n\t\t\t\t\"prefix\": \"20.80.208.150\",\n\t\t\t\t\"length\": 31\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"last_active_on\": \"2023-04-26T15:23:37Z\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\thostedRunner, _, err := client.Actions.GetHostedRunner(ctx, \"o\", 23)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetHostedRunner returned error: %v\", err)\n\t}\n\n\tlastActiveOn := Timestamp{time.Date(2023, 4, 26, 15, 23, 37, 0, time.UTC)}\n\twant := &HostedRunner{\n\t\tID:            Ptr(int64(5)),\n\t\tName:          Ptr(\"My hosted ubuntu runner\"),\n\t\tRunnerGroupID: Ptr(int64(2)),\n\t\tPlatform:      Ptr(\"linux-x64\"),\n\t\tImageDetails: &HostedRunnerImageDetail{\n\t\t\tID:     Ptr(\"ubuntu-20.04\"),\n\t\t\tSizeGB: Ptr(int64(86)),\n\t\t},\n\t\tMachineSizeDetails: &HostedRunnerMachineSpec{\n\t\t\tID:        \"4-core\",\n\t\t\tCPUCores:  4,\n\t\t\tMemoryGB:  16,\n\t\t\tStorageGB: 150,\n\t\t},\n\t\tStatus:          Ptr(\"Ready\"),\n\t\tMaximumRunners:  Ptr(int64(10)),\n\t\tPublicIPEnabled: Ptr(true),\n\t\tPublicIPs: []*HostedRunnerPublicIP{\n\t\t\t{\n\t\t\t\tEnabled: true,\n\t\t\t\tPrefix:  \"20.80.208.150\",\n\t\t\t\tLength:  31,\n\t\t\t},\n\t\t},\n\t\tLastActiveOn: Ptr(lastActiveOn),\n\t}\n\n\tif !cmp.Equal(hostedRunner, want) {\n\t\tt.Errorf(\"Actions.GetHostedRunner returned %+v, want %+v\", hostedRunner, want)\n\t}\n\n\tconst methodName = \"GetHostedRunner\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetHostedRunner(ctx, \"\\n\", 23)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetHostedRunner(ctx, \"o\", 23)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_UpdateHostedRunner(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/hosted-runners/23\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 5,\n\t\t\t\"name\": \"My hosted ubuntu runner\",\n\t\t\t\"runner_group_id\": 2,\n\t\t\t\"platform\": \"linux-x64\",\n\t\t\t\"image_details\": {\n\t\t\t\t\"id\": \"ubuntu-20.04\",\n\t\t\t\t\"size_gb\": 86\n\t\t\t},\n\t\t\t\"machine_size_details\": {\n\t\t\t\t\"id\": \"4-core\",\n\t\t\t\t\"cpu_cores\": 4,\n\t\t\t\t\"memory_gb\": 16,\n\t\t\t\t\"storage_gb\": 150\n\t\t\t},\n\t\t\t\"status\": \"Ready\",\n\t\t\t\"maximum_runners\": 10,\n\t\t\t\"public_ip_enabled\": true,\n\t\t\t\"public_ips\": [\n\t\t\t\t{\n\t\t\t\t\t\"enabled\": true,\n\t\t\t\t\t\"prefix\": \"20.80.208.150\",\n\t\t\t\t\t\"length\": 31\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"last_active_on\": \"2023-04-26T15:23:37Z\"\n\t\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tvalidReq := UpdateHostedRunnerRequest{\n\t\tName:           Ptr(\"My larger runner\"),\n\t\tRunnerGroupID:  Ptr(int64(1)),\n\t\tMaximumRunners: Ptr(int64(50)),\n\t\tEnableStaticIP: Ptr(false),\n\t\tImageVersion:   Ptr(\"1.0.0\"),\n\t}\n\thostedRunner, _, err := client.Actions.UpdateHostedRunner(ctx, \"o\", 23, validReq)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.UpdateHostedRunner returned error: %v\", err)\n\t}\n\n\tlastActiveOn := Timestamp{time.Date(2023, 4, 26, 15, 23, 37, 0, time.UTC)}\n\twant := &HostedRunner{\n\t\tID:            Ptr(int64(5)),\n\t\tName:          Ptr(\"My hosted ubuntu runner\"),\n\t\tRunnerGroupID: Ptr(int64(2)),\n\t\tPlatform:      Ptr(\"linux-x64\"),\n\t\tImageDetails: &HostedRunnerImageDetail{\n\t\t\tID:     Ptr(\"ubuntu-20.04\"),\n\t\t\tSizeGB: Ptr(int64(86)),\n\t\t},\n\t\tMachineSizeDetails: &HostedRunnerMachineSpec{\n\t\t\tID:        \"4-core\",\n\t\t\tCPUCores:  4,\n\t\t\tMemoryGB:  16,\n\t\t\tStorageGB: 150,\n\t\t},\n\t\tStatus:          Ptr(\"Ready\"),\n\t\tMaximumRunners:  Ptr(int64(10)),\n\t\tPublicIPEnabled: Ptr(true),\n\t\tPublicIPs: []*HostedRunnerPublicIP{\n\t\t\t{\n\t\t\t\tEnabled: true,\n\t\t\t\tPrefix:  \"20.80.208.150\",\n\t\t\t\tLength:  31,\n\t\t\t},\n\t\t},\n\t\tLastActiveOn: Ptr(lastActiveOn),\n\t}\n\n\tif !cmp.Equal(hostedRunner, want) {\n\t\tt.Errorf(\"Actions.UpdateHostedRunner returned %+v, want %+v\", hostedRunner, want)\n\t}\n\n\tconst methodName = \"UpdateHostedRunner\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.UpdateHostedRunner(ctx, \"\\n\", 23, validReq)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.UpdateHostedRunner(ctx, \"o\", 23, validReq)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_DeleteHostedRunner(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/hosted-runners/23\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 5,\n\t\t\t\"name\": \"My hosted ubuntu runner\",\n\t\t\t\"runner_group_id\": 2,\n\t\t\t\"platform\": \"linux-x64\",\n\t\t\t\"image_details\": {\n\t\t\t\t\"id\": \"ubuntu-20.04\",\n\t\t\t\t\"size_gb\": 86\n\t\t\t},\n\t\t\t\"machine_size_details\": {\n\t\t\t\t\"id\": \"4-core\",\n\t\t\t\t\"cpu_cores\": 4,\n\t\t\t\t\"memory_gb\": 16,\n\t\t\t\t\"storage_gb\": 150\n\t\t\t},\n\t\t\t\"status\": \"Ready\",\n\t\t\t\"maximum_runners\": 10,\n\t\t\t\"public_ip_enabled\": true,\n\t\t\t\"public_ips\": [\n\t\t\t\t{\n\t\t\t\t\"enabled\": true,\n\t\t\t\t\"prefix\": \"20.80.208.150\",\n\t\t\t\t\"length\": 31\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"last_active_on\": \"2023-04-26T15:23:37Z\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\thostedRunner, _, err := client.Actions.DeleteHostedRunner(ctx, \"o\", 23)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetHostedRunner returned error: %v\", err)\n\t}\n\n\tlastActiveOn := Timestamp{time.Date(2023, 4, 26, 15, 23, 37, 0, time.UTC)}\n\twant := &HostedRunner{\n\t\tID:            Ptr(int64(5)),\n\t\tName:          Ptr(\"My hosted ubuntu runner\"),\n\t\tRunnerGroupID: Ptr(int64(2)),\n\t\tPlatform:      Ptr(\"linux-x64\"),\n\t\tImageDetails: &HostedRunnerImageDetail{\n\t\t\tID:     Ptr(\"ubuntu-20.04\"),\n\t\t\tSizeGB: Ptr(int64(86)),\n\t\t},\n\t\tMachineSizeDetails: &HostedRunnerMachineSpec{\n\t\t\tID:        \"4-core\",\n\t\t\tCPUCores:  4,\n\t\t\tMemoryGB:  16,\n\t\t\tStorageGB: 150,\n\t\t},\n\t\tStatus:          Ptr(\"Ready\"),\n\t\tMaximumRunners:  Ptr(int64(10)),\n\t\tPublicIPEnabled: Ptr(true),\n\t\tPublicIPs: []*HostedRunnerPublicIP{\n\t\t\t{\n\t\t\t\tEnabled: true,\n\t\t\t\tPrefix:  \"20.80.208.150\",\n\t\t\t\tLength:  31,\n\t\t\t},\n\t\t},\n\t\tLastActiveOn: Ptr(lastActiveOn),\n\t}\n\n\tif !cmp.Equal(hostedRunner, want) {\n\t\tt.Errorf(\"Actions.DeleteHostedRunner returned %+v, want %+v\", hostedRunner, want)\n\t}\n\n\tconst methodName = \"DeleteHostedRunner\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.DeleteHostedRunner(ctx, \"\\n\", 23)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.DeleteHostedRunner(ctx, \"o\", 23)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_ListHostedRunnerCustomImages(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/hosted-runners/images/custom\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"total_count\": 2,\n\t\t\t\"images\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"platform\": \"linux-x64\",\n\t\t\t\t\t\"name\": \"CustomImage1\",\n\t\t\t\t\t\"source\": \"custom\",\n\t\t\t\t\t\"versions_count\": 4,\n\t\t\t\t\t\"total_versions_size\": 200,\n\t\t\t\t\t\"latest_version\": \"1.3.0\",\n\t\t\t\t\t\"state\": \"Ready\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"id\": 2,\n\t\t\t\t\t\"platform\": \"linux-x64\",\n\t\t\t\t\t\"name\": \"CustomImage2\",\n\t\t\t\t\t\"source\": \"custom\",\n\t\t\t\t\t\"versions_count\": 2,\n\t\t\t\t\t\"total_versions_size\": 150,\n\t\t\t\t\t\"latest_version\": \"1.0.0\",\n\t\t\t\t\t\"state\": \"Ready\"\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\timages, _, err := client.Actions.ListHostedRunnerCustomImages(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListHostedRunnerCustomImages returned error: %v\", err)\n\t}\n\n\twant := &HostedRunnerCustomImages{\n\t\tTotalCount: 2,\n\t\tImages: []*HostedRunnerCustomImage{\n\t\t\t{\n\t\t\t\tID:                1,\n\t\t\t\tPlatform:          \"linux-x64\",\n\t\t\t\tName:              \"CustomImage1\",\n\t\t\t\tSource:            \"custom\",\n\t\t\t\tVersionsCount:     4,\n\t\t\t\tTotalVersionsSize: 200,\n\t\t\t\tLatestVersion:     \"1.3.0\",\n\t\t\t\tState:             \"Ready\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tID:                2,\n\t\t\t\tPlatform:          \"linux-x64\",\n\t\t\t\tName:              \"CustomImage2\",\n\t\t\t\tSource:            \"custom\",\n\t\t\t\tVersionsCount:     2,\n\t\t\t\tTotalVersionsSize: 150,\n\t\t\t\tLatestVersion:     \"1.0.0\",\n\t\t\t\tState:             \"Ready\",\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(images, want) {\n\t\tt.Errorf(\"Actions.ListHostedRunnerCustomImages returned %+v, want %+v\", images, want)\n\t}\n\n\tconst methodName = \"ListHostedRunnerCustomImages\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListHostedRunnerCustomImages(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListHostedRunnerCustomImages(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetHostedRunnerCustomImage(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/hosted-runners/images/custom/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 1,\n\t\t\t\"platform\": \"linux-x64\",\n\t\t\t\"name\": \"CustomImage\",\n\t\t\t\"source\": \"custom\",\n\t\t\t\"versions_count\": 4,\n\t\t\t\"total_versions_size\": 200,\n\t\t\t\"latest_version\": \"1.3.0\",\n\t\t\t\"state\": \"Ready\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\timage, _, err := client.Actions.GetHostedRunnerCustomImage(ctx, \"o\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetHostedRunnerCustomImage returned error: %v\", err)\n\t}\n\n\twant := &HostedRunnerCustomImage{\n\t\tID:                1,\n\t\tPlatform:          \"linux-x64\",\n\t\tName:              \"CustomImage\",\n\t\tSource:            \"custom\",\n\t\tVersionsCount:     4,\n\t\tTotalVersionsSize: 200,\n\t\tLatestVersion:     \"1.3.0\",\n\t\tState:             \"Ready\",\n\t}\n\n\tif !cmp.Equal(image, want) {\n\t\tt.Errorf(\"Actions.GetHostedRunnerCustomImage returned %+v, want %+v\", image, want)\n\t}\n\n\tconst methodName = \"GetHostedRunnerCustomImage\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetHostedRunnerCustomImage(ctx, \"\\n\", 1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetHostedRunnerCustomImage(ctx, \"o\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_DeleteHostedRunnerCustomImage(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/hosted-runners/images/custom/1\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.DeleteHostedRunnerCustomImage(ctx, \"o\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.DeleteHostedRunnerCustomImage returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteHostedRunnerCustomImage\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.DeleteHostedRunnerCustomImage(ctx, \"\\n\", 1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.DeleteHostedRunnerCustomImage(ctx, \"o\", 1)\n\t})\n}\n\nfunc TestActionsService_ListHostedRunnerCustomImageVersions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/hosted-runners/images/custom/1/versions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"total_count\": 2,\n\t\t\t\"image_versions\": [\n\t\t\t\t{\n\t\t\t\t\t\"version\": \"1.1.0\",\n\t\t\t\t\t\"size_gb\": 75,\n\t\t\t\t\t\"state\": \"Ready\",\n\t\t\t\t\t\"state_details\": \"None\",\n\t\t\t\t\t\"created_on\": \"2024-11-09T23:39:01Z\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"version\": \"1.0.0\",\n\t\t\t\t\t\"size_gb\": 75,\n\t\t\t\t\t\"state\": \"Ready\",\n\t\t\t\t\t\"state_details\": \"None\",\n\t\t\t\t\t\"created_on\": \"2024-11-08T20:39:01Z\"\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tversions, _, err := client.Actions.ListHostedRunnerCustomImageVersions(ctx, \"o\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListHostedRunnerCustomImageVersions returned error: %v\", err)\n\t}\n\n\twant := &HostedRunnerCustomImageVersions{\n\t\tTotalCount: 2,\n\t\tImageVersions: []*HostedRunnerCustomImageVersion{\n\t\t\t{\n\t\t\t\tVersion:      \"1.1.0\",\n\t\t\t\tSizeGB:       75,\n\t\t\t\tState:        \"Ready\",\n\t\t\t\tStateDetails: \"None\",\n\t\t\t\tCreatedOn:    Timestamp{time.Date(2024, 11, 9, 23, 39, 1, 0, time.UTC)},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVersion:      \"1.0.0\",\n\t\t\t\tSizeGB:       75,\n\t\t\t\tState:        \"Ready\",\n\t\t\t\tStateDetails: \"None\",\n\t\t\t\tCreatedOn:    Timestamp{time.Date(2024, 11, 8, 20, 39, 1, 0, time.UTC)},\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(versions, want) {\n\t\tt.Errorf(\"Actions.ListHostedRunnerCustomImageVersions returned %+v, want %+v\", versions, want)\n\t}\n\n\tconst methodName = \"ListHostedRunnerCustomImageVersions\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListHostedRunnerCustomImageVersions(ctx, \"\\n\", 1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListHostedRunnerCustomImageVersions(ctx, \"o\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetHostedRunnerCustomImageVersion(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/hosted-runners/images/custom/1/versions/1.0.0\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"version\": \"1.0.0\",\n\t\t\t\"size_gb\": 75,\n\t\t\t\"state\": \"Ready\",\n\t\t\t\"state_details\": \"None\",\n\t\t\t\"created_on\": \"2024-11-08T20:39:01Z\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tversion, _, err := client.Actions.GetHostedRunnerCustomImageVersion(ctx, \"o\", 1, \"1.0.0\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetHostedRunnerCustomImageVersion returned error: %v\", err)\n\t}\n\n\twant := &HostedRunnerCustomImageVersion{\n\t\tVersion:      \"1.0.0\",\n\t\tSizeGB:       75,\n\t\tState:        \"Ready\",\n\t\tStateDetails: \"None\",\n\t\tCreatedOn:    Timestamp{time.Date(2024, 11, 8, 20, 39, 1, 0, time.UTC)},\n\t}\n\n\tif !cmp.Equal(version, want) {\n\t\tt.Errorf(\"Actions.GetHostedRunnerCustomImageVersion returned %+v, want %+v\", version, want)\n\t}\n\n\tconst methodName = \"GetHostedRunnerCustomImageVersion\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetHostedRunnerCustomImageVersion(ctx, \"\\n\", 1, \"1.0.0\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetHostedRunnerCustomImageVersion(ctx, \"o\", 1, \"1.0.0\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_DeleteHostedRunnerCustomImageVersion(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/hosted-runners/images/custom/1/versions/1.0.0\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.DeleteHostedRunnerCustomImageVersion(ctx, \"o\", 1, \"1.0.0\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.DeleteHostedRunnerCustomImageVersion returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteHostedRunnerCustomImageVersion\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.DeleteHostedRunnerCustomImageVersion(ctx, \"\\n\", 1, \"1.0.0\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.DeleteHostedRunnerCustomImageVersion(ctx, \"o\", 1, \"1.0.0\")\n\t})\n}\n"
  },
  {
    "path": "github/actions_oidc.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// OIDCSubjectClaimCustomTemplate represents an OIDC subject claim customization template.\ntype OIDCSubjectClaimCustomTemplate struct {\n\tUseDefault       *bool    `json:\"use_default,omitempty\"`\n\tIncludeClaimKeys []string `json:\"include_claim_keys,omitempty\"`\n}\n\n// GetOrgOIDCSubjectClaimCustomTemplate gets the subject claim customization template for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/oidc/customization/sub\nfunc (s *ActionsService) GetOrgOIDCSubjectClaimCustomTemplate(ctx context.Context, org string) (*OIDCSubjectClaimCustomTemplate, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/oidc/customization/sub\", org)\n\treturn s.getOIDCSubjectClaimCustomTemplate(ctx, u)\n}\n\n// GetRepoOIDCSubjectClaimCustomTemplate gets the subject claim customization template for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/oidc/customization/sub\nfunc (s *ActionsService) GetRepoOIDCSubjectClaimCustomTemplate(ctx context.Context, owner, repo string) (*OIDCSubjectClaimCustomTemplate, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/oidc/customization/sub\", owner, repo)\n\treturn s.getOIDCSubjectClaimCustomTemplate(ctx, u)\n}\n\nfunc (s *ActionsService) getOIDCSubjectClaimCustomTemplate(ctx context.Context, url string) (*OIDCSubjectClaimCustomTemplate, *Response, error) {\n\treq, err := s.client.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar tmpl *OIDCSubjectClaimCustomTemplate\n\tresp, err := s.client.Do(ctx, req, &tmpl)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn tmpl, resp, nil\n}\n\n// SetOrgOIDCSubjectClaimCustomTemplate sets the subject claim customization for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization\n//\n//meta:operation PUT /orgs/{org}/actions/oidc/customization/sub\nfunc (s *ActionsService) SetOrgOIDCSubjectClaimCustomTemplate(ctx context.Context, org string, template *OIDCSubjectClaimCustomTemplate) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/oidc/customization/sub\", org)\n\treturn s.setOIDCSubjectClaimCustomTemplate(ctx, u, template)\n}\n\n// SetRepoOIDCSubjectClaimCustomTemplate sets the subject claim customization for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository\n//\n//meta:operation PUT /repos/{owner}/{repo}/actions/oidc/customization/sub\nfunc (s *ActionsService) SetRepoOIDCSubjectClaimCustomTemplate(ctx context.Context, owner, repo string, template *OIDCSubjectClaimCustomTemplate) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/oidc/customization/sub\", owner, repo)\n\treturn s.setOIDCSubjectClaimCustomTemplate(ctx, u, template)\n}\n\nfunc (s *ActionsService) setOIDCSubjectClaimCustomTemplate(ctx context.Context, url string, template *OIDCSubjectClaimCustomTemplate) (*Response, error) {\n\treq, err := s.client.NewRequest(\"PUT\", url, template)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/actions_oidc_test.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestActionsService_GetOrgOIDCSubjectClaimCustomTemplate(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/oidc/customization/sub\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"include_claim_keys\":[\"repo\",\"context\"]}`)\n\t})\n\n\tctx := t.Context()\n\ttemplate, _, err := client.Actions.GetOrgOIDCSubjectClaimCustomTemplate(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetOrgOIDCSubjectClaimCustomTemplate returned error: %v\", err)\n\t}\n\n\twant := &OIDCSubjectClaimCustomTemplate{IncludeClaimKeys: []string{\"repo\", \"context\"}}\n\tif !cmp.Equal(template, want) {\n\t\tt.Errorf(\"Actions.GetOrgOIDCSubjectClaimCustomTemplate returned %+v, want %+v\", template, want)\n\t}\n\n\tconst methodName = \"GetOrgOIDCSubjectClaimCustomTemplate\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetOrgOIDCSubjectClaimCustomTemplate(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetOrgOIDCSubjectClaimCustomTemplate(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetRepoOIDCSubjectClaimCustomTemplate(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/oidc/customization/sub\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"use_default\":false,\"include_claim_keys\":[\"repo\",\"context\"]}`)\n\t})\n\n\tctx := t.Context()\n\ttemplate, _, err := client.Actions.GetRepoOIDCSubjectClaimCustomTemplate(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetRepoOIDCSubjectClaimCustomTemplate returned error: %v\", err)\n\t}\n\n\twant := &OIDCSubjectClaimCustomTemplate{UseDefault: Ptr(false), IncludeClaimKeys: []string{\"repo\", \"context\"}}\n\tif !cmp.Equal(template, want) {\n\t\tt.Errorf(\"Actions.GetOrgOIDCSubjectClaimCustomTemplate returned %+v, want %+v\", template, want)\n\t}\n\n\tconst methodName = \"GetRepoOIDCSubjectClaimCustomTemplate\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetRepoOIDCSubjectClaimCustomTemplate(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetRepoOIDCSubjectClaimCustomTemplate(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_SetOrgOIDCSubjectClaimCustomTemplate(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/oidc/customization/sub\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\ttestBody(t, r, `{\"include_claim_keys\":[\"repo\",\"context\"]}`+\"\\n\")\n\t\tw.WriteHeader(http.StatusCreated)\n\t})\n\n\tinput := &OIDCSubjectClaimCustomTemplate{\n\t\tIncludeClaimKeys: []string{\"repo\", \"context\"},\n\t}\n\tctx := t.Context()\n\t_, err := client.Actions.SetOrgOIDCSubjectClaimCustomTemplate(ctx, \"o\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.SetOrgOIDCSubjectClaimCustomTemplate returned error: %v\", err)\n\t}\n\n\tconst methodName = \"SetOrgOIDCSubjectClaimCustomTemplate\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.SetOrgOIDCSubjectClaimCustomTemplate(ctx, \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.SetOrgOIDCSubjectClaimCustomTemplate(ctx, \"o\", input)\n\t})\n}\n\nfunc TestActionsService_SetRepoOIDCSubjectClaimCustomTemplate(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/oidc/customization/sub\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\ttestBody(t, r, `{\"use_default\":false,\"include_claim_keys\":[\"repo\",\"context\"]}`+\"\\n\")\n\t\tw.WriteHeader(http.StatusCreated)\n\t})\n\n\tinput := &OIDCSubjectClaimCustomTemplate{\n\t\tUseDefault:       Ptr(false),\n\t\tIncludeClaimKeys: []string{\"repo\", \"context\"},\n\t}\n\tctx := t.Context()\n\t_, err := client.Actions.SetRepoOIDCSubjectClaimCustomTemplate(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.SetRepoOIDCSubjectClaimCustomTemplate returned error: %v\", err)\n\t}\n\n\tconst methodName = \"SetRepoOIDCSubjectClaimCustomTemplate\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.SetRepoOIDCSubjectClaimCustomTemplate(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.SetRepoOIDCSubjectClaimCustomTemplate(ctx, \"o\", \"r\", input)\n\t})\n}\n\nfunc TestActionService_SetRepoOIDCSubjectClaimCustomTemplateToDefault(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/oidc/customization/sub\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\ttestBody(t, r, `{\"use_default\":true}`+\"\\n\")\n\t\tw.WriteHeader(http.StatusCreated)\n\t})\n\n\tinput := &OIDCSubjectClaimCustomTemplate{\n\t\tUseDefault: Ptr(true),\n\t}\n\tctx := t.Context()\n\t_, err := client.Actions.SetRepoOIDCSubjectClaimCustomTemplate(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.SetRepoOIDCSubjectClaimCustomTemplate returned error: %v\", err)\n\t}\n\n\tconst methodName = \"SetRepoOIDCSubjectClaimCustomTemplate\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.SetRepoOIDCSubjectClaimCustomTemplate(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.SetRepoOIDCSubjectClaimCustomTemplate(ctx, \"o\", \"r\", input)\n\t})\n}\n\nfunc TestOIDCSubjectClaimCustomTemplate_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &OIDCSubjectClaimCustomTemplate{}, \"{}\")\n\n\tu := &OIDCSubjectClaimCustomTemplate{\n\t\tUseDefault:       Ptr(false),\n\t\tIncludeClaimKeys: []string{\"s\"},\n\t}\n\n\twant := `{\n\t\t\"use_default\": false,\n\t\t\"include_claim_keys\": [\n\t\t\t\"s\"\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/actions_permissions_enterprise.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// ActionsEnabledOnEnterpriseRepos represents all the repositories in an enterprise for which Actions is enabled.\ntype ActionsEnabledOnEnterpriseRepos struct {\n\tTotalCount    int             `json:\"total_count\"`\n\tOrganizations []*Organization `json:\"organizations\"`\n}\n\n// ActionsPermissionsEnterprise represents a policy for allowed actions in an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions\ntype ActionsPermissionsEnterprise struct {\n\tEnabledOrganizations *string `json:\"enabled_organizations,omitempty\"`\n\tAllowedActions       *string `json:\"allowed_actions,omitempty\"`\n\tSelectedActionsURL   *string `json:\"selected_actions_url,omitempty\"`\n}\n\nfunc (a ActionsPermissionsEnterprise) String() string {\n\treturn Stringify(a)\n}\n\n// DefaultWorkflowPermissionEnterprise represents the default permissions for GitHub Actions workflows for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions\ntype DefaultWorkflowPermissionEnterprise struct {\n\tDefaultWorkflowPermissions   *string `json:\"default_workflow_permissions,omitempty\"`\n\tCanApprovePullRequestReviews *bool   `json:\"can_approve_pull_request_reviews,omitempty\"`\n}\n\n// SelfHostRunnerPermissionsEnterprise represents the settings for whether organizations in the enterprise are allowed to manage self-hosted runners at the repository level.\ntype SelfHostRunnerPermissionsEnterprise struct {\n\tDisableSelfHostedRunnersForAllOrgs *bool `json:\"disable_self_hosted_runners_for_all_orgs,omitempty\"`\n}\n\nfunc (a SelfHostRunnerPermissionsEnterprise) String() string {\n\treturn Stringify(a)\n}\n\n// GetActionsPermissionsInEnterprise gets the GitHub Actions permissions policy for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-github-actions-permissions-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/actions/permissions\nfunc (s *ActionsService) GetActionsPermissionsInEnterprise(ctx context.Context, enterprise string) (*ActionsPermissionsEnterprise, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/permissions\", enterprise)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar permissions *ActionsPermissionsEnterprise\n\tresp, err := s.client.Do(ctx, req, &permissions)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn permissions, resp, nil\n}\n\n// UpdateActionsPermissionsInEnterprise sets the permissions policy in an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-github-actions-permissions-for-an-enterprise\n//\n//meta:operation PUT /enterprises/{enterprise}/actions/permissions\nfunc (s *ActionsService) UpdateActionsPermissionsInEnterprise(ctx context.Context, enterprise string, actionsPermissionsEnterprise ActionsPermissionsEnterprise) (*ActionsPermissionsEnterprise, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/permissions\", enterprise)\n\treq, err := s.client.NewRequest(\"PUT\", u, actionsPermissionsEnterprise)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar p *ActionsPermissionsEnterprise\n\tresp, err := s.client.Do(ctx, req, &p)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn p, resp, nil\n}\n\n// ListEnabledOrgsInEnterprise lists the selected organizations that are enabled for GitHub Actions in an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#list-selected-organizations-enabled-for-github-actions-in-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/actions/permissions/organizations\nfunc (s *ActionsService) ListEnabledOrgsInEnterprise(ctx context.Context, owner string, opts *ListOptions) (*ActionsEnabledOnEnterpriseRepos, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/permissions/organizations\", owner)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar orgs *ActionsEnabledOnEnterpriseRepos\n\tresp, err := s.client.Do(ctx, req, &orgs)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn orgs, resp, nil\n}\n\n// SetEnabledOrgsInEnterprise replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-selected-organizations-enabled-for-github-actions-in-an-enterprise\n//\n//meta:operation PUT /enterprises/{enterprise}/actions/permissions/organizations\nfunc (s *ActionsService) SetEnabledOrgsInEnterprise(ctx context.Context, owner string, organizationIDs []int64) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/permissions/organizations\", owner)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, struct {\n\t\tIDs []int64 `json:\"selected_organization_ids\"`\n\t}{IDs: organizationIDs})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// AddEnabledOrgInEnterprise adds an organization to the list of selected organizations that are enabled for GitHub Actions in an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#enable-a-selected-organization-for-github-actions-in-an-enterprise\n//\n//meta:operation PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}\nfunc (s *ActionsService) AddEnabledOrgInEnterprise(ctx context.Context, owner string, organizationID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/permissions/organizations/%v\", owner, organizationID)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// RemoveEnabledOrgInEnterprise removes an organization from the list of selected organizations that are enabled for GitHub Actions in an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#disable-a-selected-organization-for-github-actions-in-an-enterprise\n//\n//meta:operation DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id}\nfunc (s *ActionsService) RemoveEnabledOrgInEnterprise(ctx context.Context, owner string, organizationID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/permissions/organizations/%v\", owner, organizationID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// GetActionsAllowedInEnterprise gets the actions that are allowed in an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/actions/permissions/selected-actions\nfunc (s *ActionsService) GetActionsAllowedInEnterprise(ctx context.Context, enterprise string) (*ActionsAllowed, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/permissions/selected-actions\", enterprise)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar actionsAllowed *ActionsAllowed\n\tresp, err := s.client.Do(ctx, req, &actionsAllowed)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn actionsAllowed, resp, nil\n}\n\n// UpdateActionsAllowedInEnterprise sets the actions that are allowed in an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-enterprise\n//\n//meta:operation PUT /enterprises/{enterprise}/actions/permissions/selected-actions\nfunc (s *ActionsService) UpdateActionsAllowedInEnterprise(ctx context.Context, enterprise string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/permissions/selected-actions\", enterprise)\n\treq, err := s.client.NewRequest(\"PUT\", u, actionsAllowed)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar p *ActionsAllowed\n\tresp, err := s.client.Do(ctx, req, &p)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn p, resp, nil\n}\n\n// GetDefaultWorkflowPermissionsInEnterprise gets the GitHub Actions default workflow permissions for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-default-workflow-permissions-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/actions/permissions/workflow\nfunc (s *ActionsService) GetDefaultWorkflowPermissionsInEnterprise(ctx context.Context, enterprise string) (*DefaultWorkflowPermissionEnterprise, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/permissions/workflow\", enterprise)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar permissions *DefaultWorkflowPermissionEnterprise\n\tresp, err := s.client.Do(ctx, req, &permissions)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn permissions, resp, nil\n}\n\n// UpdateDefaultWorkflowPermissionsInEnterprise sets the GitHub Actions default workflow permissions for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-default-workflow-permissions-for-an-enterprise\n//\n//meta:operation PUT /enterprises/{enterprise}/actions/permissions/workflow\nfunc (s *ActionsService) UpdateDefaultWorkflowPermissionsInEnterprise(ctx context.Context, enterprise string, permissions DefaultWorkflowPermissionEnterprise) (*DefaultWorkflowPermissionEnterprise, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/permissions/workflow\", enterprise)\n\treq, err := s.client.NewRequest(\"PUT\", u, permissions)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar p *DefaultWorkflowPermissionEnterprise\n\tresp, err := s.client.Do(ctx, req, &p)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn p, resp, nil\n}\n\n// GetArtifactAndLogRetentionPeriodInEnterprise gets the artifact and log retention period for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-artifact-and-log-retention-settings-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/actions/permissions/artifact-and-log-retention\nfunc (s *ActionsService) GetArtifactAndLogRetentionPeriodInEnterprise(ctx context.Context, enterprise string) (*ArtifactPeriod, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/permissions/artifact-and-log-retention\", enterprise)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar arp *ArtifactPeriod\n\tresp, err := s.client.Do(ctx, req, &arp)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn arp, resp, nil\n}\n\n// UpdateArtifactAndLogRetentionPeriodInEnterprise sets the artifact and log retention period for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-artifact-and-log-retention-settings-for-an-enterprise\n//\n//meta:operation PUT /enterprises/{enterprise}/actions/permissions/artifact-and-log-retention\nfunc (s *ActionsService) UpdateArtifactAndLogRetentionPeriodInEnterprise(ctx context.Context, enterprise string, period ArtifactPeriodOpt) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/permissions/artifact-and-log-retention\", enterprise)\n\treq, err := s.client.NewRequest(\"PUT\", u, period)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// GetSelfHostedRunnerPermissionsInEnterprise gets the self-hosted runner permissions for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-self-hosted-runners-permissions-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/actions/permissions/self-hosted-runners\nfunc (s *ActionsService) GetSelfHostedRunnerPermissionsInEnterprise(ctx context.Context, enterprise string) (*SelfHostRunnerPermissionsEnterprise, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/permissions/self-hosted-runners\", enterprise)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar permissions *SelfHostRunnerPermissionsEnterprise\n\tresp, err := s.client.Do(ctx, req, &permissions)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn permissions, resp, nil\n}\n\n// UpdateSelfHostedRunnerPermissionsInEnterprise sets the self-hosted runner permissions for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-self-hosted-runners-permissions-for-an-enterprise\n//\n//meta:operation PUT /enterprises/{enterprise}/actions/permissions/self-hosted-runners\nfunc (s *ActionsService) UpdateSelfHostedRunnerPermissionsInEnterprise(ctx context.Context, enterprise string, permissions SelfHostRunnerPermissionsEnterprise) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/permissions/self-hosted-runners\", enterprise)\n\treq, err := s.client.NewRequest(\"PUT\", u, permissions)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// GetPrivateRepoForkPRWorkflowSettingsInEnterprise gets the settings for whether workflows from fork pull requests can run on private repositories in an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-private-repo-fork-pr-workflow-settings-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/actions/permissions/fork-pr-workflows-private-repos\nfunc (s *ActionsService) GetPrivateRepoForkPRWorkflowSettingsInEnterprise(ctx context.Context, enterprise string) (*WorkflowsPermissions, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/permissions/fork-pr-workflows-private-repos\", enterprise)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar permissions *WorkflowsPermissions\n\tresp, err := s.client.Do(ctx, req, &permissions)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn permissions, resp, nil\n}\n\n// UpdatePrivateRepoForkPRWorkflowSettingsInEnterprise sets the settings for whether workflows from fork pull requests can run on private repositories in an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-private-repo-fork-pr-workflow-settings-for-an-enterprise\n//\n//meta:operation PUT /enterprises/{enterprise}/actions/permissions/fork-pr-workflows-private-repos\nfunc (s *ActionsService) UpdatePrivateRepoForkPRWorkflowSettingsInEnterprise(ctx context.Context, enterprise string, permissions *WorkflowsPermissionsOpt) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/permissions/fork-pr-workflows-private-repos\", enterprise)\n\treq, err := s.client.NewRequest(\"PUT\", u, permissions)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// GetEnterpriseForkPRContributorApprovalPermissions gets the fork PR contributor approval policy for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-fork-pr-contributor-approval-permissions-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/actions/permissions/fork-pr-contributor-approval\nfunc (s *ActionsService) GetEnterpriseForkPRContributorApprovalPermissions(ctx context.Context, enterprise string) (*ContributorApprovalPermissions, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/permissions/fork-pr-contributor-approval\", enterprise)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar policy *ContributorApprovalPermissions\n\tresp, err := s.client.Do(ctx, req, &policy)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn policy, resp, nil\n}\n\n// UpdateEnterpriseForkPRContributorApprovalPermissions sets the fork PR contributor approval policy for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-fork-pr-contributor-approval-permissions-for-an-enterprise\n//\n//meta:operation PUT /enterprises/{enterprise}/actions/permissions/fork-pr-contributor-approval\nfunc (s *ActionsService) UpdateEnterpriseForkPRContributorApprovalPermissions(ctx context.Context, enterprise string, policy ContributorApprovalPermissions) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/permissions/fork-pr-contributor-approval\", enterprise)\n\treq, err := s.client.NewRequest(\"PUT\", u, policy)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/actions_permissions_enterprise_test.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestActionsService_GetActionsPermissionsInEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/actions/permissions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"enabled_organizations\": \"all\", \"allowed_actions\": \"all\"}`)\n\t})\n\n\tctx := t.Context()\n\tent, _, err := client.Actions.GetActionsPermissionsInEnterprise(ctx, \"e\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetActionsPermissionsInEnterprise returned error: %v\", err)\n\t}\n\twant := &ActionsPermissionsEnterprise{EnabledOrganizations: Ptr(\"all\"), AllowedActions: Ptr(\"all\")}\n\tif !cmp.Equal(ent, want) {\n\t\tt.Errorf(\"Actions.GetActionsPermissionsInEnterprise returned %+v, want %+v\", ent, want)\n\t}\n\n\tconst methodName = \"GetActionsPermissionsInEnterprise\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetActionsPermissionsInEnterprise(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetActionsPermissionsInEnterprise(ctx, \"e\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_UpdateActionsPermissionsInEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &ActionsPermissionsEnterprise{EnabledOrganizations: Ptr(\"all\"), AllowedActions: Ptr(\"selected\")}\n\n\tmux.HandleFunc(\"/enterprises/e/actions/permissions\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *ActionsPermissionsEnterprise\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"enabled_organizations\": \"all\", \"allowed_actions\": \"selected\"}`)\n\t})\n\n\tctx := t.Context()\n\tent, _, err := client.Actions.UpdateActionsPermissionsInEnterprise(ctx, \"e\", *input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.UpdateActionsPermissionsInEnterprise returned error: %v\", err)\n\t}\n\n\twant := &ActionsPermissionsEnterprise{EnabledOrganizations: Ptr(\"all\"), AllowedActions: Ptr(\"selected\")}\n\tif !cmp.Equal(ent, want) {\n\t\tt.Errorf(\"Actions.UpdateActionsPermissionsInEnterprise returned %+v, want %+v\", ent, want)\n\t}\n\n\tconst methodName = \"UpdateActionsPermissionsInEnterprise\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.UpdateActionsPermissionsInEnterprise(ctx, \"\\n\", *input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.UpdateActionsPermissionsInEnterprise(ctx, \"e\", *input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_ListEnabledOrgsInEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/actions/permissions/organizations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\": \"1\",\n\t\t})\n\t\tfmt.Fprint(w, `{\"total_count\":2,\"organizations\":[{\"id\":2}, {\"id\":3}]}`)\n\t})\n\n\tctx := t.Context()\n\topt := &ListOptions{\n\t\tPage: 1,\n\t}\n\tgot, _, err := client.Actions.ListEnabledOrgsInEnterprise(ctx, \"e\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListEnabledOrgsInEnterprise returned error: %v\", err)\n\t}\n\n\twant := &ActionsEnabledOnEnterpriseRepos{TotalCount: int(2), Organizations: []*Organization{\n\t\t{ID: Ptr(int64(2))},\n\t\t{ID: Ptr(int64(3))},\n\t}}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Actions.ListEnabledOrgsInEnterprise returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ListEnabledOrgsInEnterprise\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListEnabledOrgsInEnterprise(ctx, \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListEnabledOrgsInEnterprise(ctx, \"e\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_SetEnabledOrgsInEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/actions/permissions/organizations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\ttestBody(t, r, `{\"selected_organization_ids\":[123,1234]}`+\"\\n\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.SetEnabledOrgsInEnterprise(ctx, \"e\", []int64{123, 1234})\n\tif err != nil {\n\t\tt.Errorf(\"Actions.SetEnabledOrgsInEnterprise returned error: %v\", err)\n\t}\n\n\tconst methodName = \"SetEnabledOrgsInEnterprise\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.SetEnabledOrgsInEnterprise(ctx, \"\\n\", []int64{123, 1234})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.SetEnabledOrgsInEnterprise(ctx, \"e\", []int64{123, 1234})\n\t})\n}\n\nfunc TestActionsService_AddEnabledOrgInEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/actions/permissions/organizations/123\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.AddEnabledOrgInEnterprise(ctx, \"e\", 123)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.AddEnabledOrgInEnterprise returned error: %v\", err)\n\t}\n\n\tconst methodName = \"AddEnabledOrgInEnterprise\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.AddEnabledOrgInEnterprise(ctx, \"\\n\", 123)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.AddEnabledOrgInEnterprise(ctx, \"e\", 123)\n\t})\n}\n\nfunc TestActionsService_RemoveEnabledOrgInEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/actions/permissions/organizations/123\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.RemoveEnabledOrgInEnterprise(ctx, \"e\", 123)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.RemoveEnabledOrgInEnterprise returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveEnabledOrgInEnterprise\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.RemoveEnabledOrgInEnterprise(ctx, \"\\n\", 123)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.RemoveEnabledOrgInEnterprise(ctx, \"e\", 123)\n\t})\n}\n\nfunc TestActionsService_GetActionsAllowedInEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/actions/permissions/selected-actions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"github_owned_allowed\":true, \"verified_allowed\":false, \"patterns_allowed\":[\"a/b\"]}`)\n\t})\n\n\tctx := t.Context()\n\tent, _, err := client.Actions.GetActionsAllowedInEnterprise(ctx, \"e\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetActionsAllowedInEnterprise returned error: %v\", err)\n\t}\n\twant := &ActionsAllowed{GithubOwnedAllowed: Ptr(true), VerifiedAllowed: Ptr(false), PatternsAllowed: []string{\"a/b\"}}\n\tif !cmp.Equal(ent, want) {\n\t\tt.Errorf(\"Actions.GetActionsAllowedInEnterprise returned %+v, want %+v\", ent, want)\n\t}\n\n\tconst methodName = \"GetActionsAllowedInEnterprise\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetActionsAllowedInEnterprise(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetActionsAllowedInEnterprise(ctx, \"e\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_UpdateActionsAllowedInEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &ActionsAllowed{GithubOwnedAllowed: Ptr(true), VerifiedAllowed: Ptr(false), PatternsAllowed: []string{\"a/b\"}}\n\n\tmux.HandleFunc(\"/enterprises/e/actions/permissions/selected-actions\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *ActionsAllowed\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"github_owned_allowed\":true, \"verified_allowed\":false, \"patterns_allowed\":[\"a/b\"]}`)\n\t})\n\n\tctx := t.Context()\n\tent, _, err := client.Actions.UpdateActionsAllowedInEnterprise(ctx, \"e\", *input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.UpdateActionsAllowedInEnterprise returned error: %v\", err)\n\t}\n\n\twant := &ActionsAllowed{GithubOwnedAllowed: Ptr(true), VerifiedAllowed: Ptr(false), PatternsAllowed: []string{\"a/b\"}}\n\tif !cmp.Equal(ent, want) {\n\t\tt.Errorf(\"Actions.UpdateActionsAllowedInEnterprise returned %+v, want %+v\", ent, want)\n\t}\n\n\tconst methodName = \"UpdateActionsAllowedInEnterprise\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.UpdateActionsAllowedInEnterprise(ctx, \"\\n\", *input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.UpdateActionsAllowedInEnterprise(ctx, \"e\", *input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetDefaultWorkflowPermissionsInEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/actions/permissions/workflow\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{ \"default_workflow_permissions\": \"read\", \"can_approve_pull_request_reviews\": true }`)\n\t})\n\n\tctx := t.Context()\n\tent, _, err := client.Actions.GetDefaultWorkflowPermissionsInEnterprise(ctx, \"e\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetDefaultWorkflowPermissionsInEnterprise returned error: %v\", err)\n\t}\n\twant := &DefaultWorkflowPermissionEnterprise{DefaultWorkflowPermissions: Ptr(\"read\"), CanApprovePullRequestReviews: Ptr(true)}\n\tif !cmp.Equal(ent, want) {\n\t\tt.Errorf(\"Actions.GetDefaultWorkflowPermissionsInEnterprise returned %+v, want %+v\", ent, want)\n\t}\n\n\tconst methodName = \"GetDefaultWorkflowPermissionsInEnterprise\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetDefaultWorkflowPermissionsInEnterprise(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetDefaultWorkflowPermissionsInEnterprise(ctx, \"e\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_UpdateDefaultWorkflowPermissionsInEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &DefaultWorkflowPermissionEnterprise{DefaultWorkflowPermissions: Ptr(\"read\"), CanApprovePullRequestReviews: Ptr(true)}\n\n\tmux.HandleFunc(\"/enterprises/e/actions/permissions/workflow\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *DefaultWorkflowPermissionEnterprise\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{ \"default_workflow_permissions\": \"read\", \"can_approve_pull_request_reviews\": true }`)\n\t})\n\n\tctx := t.Context()\n\tent, _, err := client.Actions.UpdateDefaultWorkflowPermissionsInEnterprise(ctx, \"e\", *input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.UpdateDefaultWorkflowPermissionsInEnterprise returned error: %v\", err)\n\t}\n\n\twant := &DefaultWorkflowPermissionEnterprise{DefaultWorkflowPermissions: Ptr(\"read\"), CanApprovePullRequestReviews: Ptr(true)}\n\tif !cmp.Equal(ent, want) {\n\t\tt.Errorf(\"Actions.UpdateDefaultWorkflowPermissionsInEnterprise returned %+v, want %+v\", ent, want)\n\t}\n\n\tconst methodName = \"UpdateDefaultWorkflowPermissionsInEnterprise\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.UpdateDefaultWorkflowPermissionsInEnterprise(ctx, \"\\n\", *input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.UpdateDefaultWorkflowPermissionsInEnterprise(ctx, \"e\", *input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetArtifactAndLogRetentionPeriodInEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/actions/permissions/artifact-and-log-retention\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"days\": 90, \"maximum_allowed_days\": 365}`)\n\t})\n\n\tctx := t.Context()\n\tperiod, _, err := client.Actions.GetArtifactAndLogRetentionPeriodInEnterprise(ctx, \"e\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetArtifactAndLogRetentionPeriodInEnterprise returned error: %v\", err)\n\t}\n\n\twant := &ArtifactPeriod{\n\t\tDays:               Ptr(90),\n\t\tMaximumAllowedDays: Ptr(365),\n\t}\n\tif !cmp.Equal(period, want) {\n\t\tt.Errorf(\"Actions.GetArtifactAndLogRetentionPeriodInEnterprise = %+v, want %+v\", period, want)\n\t}\n\n\tconst methodName = \"GetArtifactAndLogRetentionPeriodInEnterprise\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetArtifactAndLogRetentionPeriodInEnterprise(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetArtifactAndLogRetentionPeriodInEnterprise(ctx, \"e\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_UpdateArtifactAndLogRetentionPeriodInEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &ArtifactPeriodOpt{Days: Ptr(90)}\n\n\tmux.HandleFunc(\"/enterprises/e/actions/permissions/artifact-and-log-retention\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *ArtifactPeriodOpt\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Actions.UpdateArtifactAndLogRetentionPeriodInEnterprise(ctx, \"e\", *input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.UpdateArtifactAndLogRetentionPeriodInEnterprise returned error: %v\", err)\n\t}\n\n\tif resp.StatusCode != http.StatusNoContent {\n\t\tt.Errorf(\"Actions.UpdateArtifactAndLogRetentionPeriodInEnterprise = %v, want %v\", resp.StatusCode, http.StatusNoContent)\n\t}\n\n\tconst methodName = \"UpdateArtifactAndLogRetentionPeriodInEnterprise\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.UpdateArtifactAndLogRetentionPeriodInEnterprise(ctx, \"\\n\", *input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.UpdateArtifactAndLogRetentionPeriodInEnterprise(ctx, \"e\", *input)\n\t})\n}\n\nfunc TestActionsService_GetSelfHostedRunnerPermissionsInEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/actions/permissions/self-hosted-runners\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"disable_self_hosted_runners_for_all_orgs\": true}`)\n\t})\n\n\tctx := t.Context()\n\tpermissions, _, err := client.Actions.GetSelfHostedRunnerPermissionsInEnterprise(ctx, \"e\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetSelfHostedRunnerPermissionsInEnterprise returned error: %v\", err)\n\t}\n\twant := &SelfHostRunnerPermissionsEnterprise{DisableSelfHostedRunnersForAllOrgs: Ptr(true)}\n\tif !cmp.Equal(permissions, want) {\n\t\tt.Errorf(\"Actions.GetSelfHostedRunnerPermissionsInEnterprise returned %+v, want %+v\", permissions, want)\n\t}\n\n\tconst methodName = \"GetSelfHostedRunnerPermissionsInEnterprise\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetSelfHostedRunnerPermissionsInEnterprise(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetSelfHostedRunnerPermissionsInEnterprise(ctx, \"e\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_UpdateSelfHostedRunnerPermissionsInEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &SelfHostRunnerPermissionsEnterprise{DisableSelfHostedRunnersForAllOrgs: Ptr(false)}\n\n\tmux.HandleFunc(\"/enterprises/e/actions/permissions/self-hosted-runners\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *SelfHostRunnerPermissionsEnterprise\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Actions.UpdateSelfHostedRunnerPermissionsInEnterprise(ctx, \"e\", *input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.UpdateSelfHostedRunnerPermissionsInEnterprise returned error: %v\", err)\n\t}\n\n\tif resp.StatusCode != http.StatusNoContent {\n\t\tt.Errorf(\"Actions.UpdateSelfHostedRunnerPermissionsInEnterprise = %v, want %v\", resp.StatusCode, http.StatusNoContent)\n\t}\n\n\tconst methodName = \"UpdateSelfHostedRunnerPermissionsInEnterprise\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.UpdateSelfHostedRunnerPermissionsInEnterprise(ctx, \"\\n\", *input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.UpdateSelfHostedRunnerPermissionsInEnterprise(ctx, \"e\", *input)\n\t})\n}\n\nfunc TestActionsService_GetPrivateRepoForkPRWorkflowSettingsInEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/actions/permissions/fork-pr-workflows-private-repos\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"run_workflows_from_fork_pull_requests\": true, \"send_write_tokens_to_workflows\": false, \"send_secrets_and_variables\": true, \"require_approval_for_fork_pr_workflows\": false}`)\n\t})\n\n\tctx := t.Context()\n\tpermissions, _, err := client.Actions.GetPrivateRepoForkPRWorkflowSettingsInEnterprise(ctx, \"e\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetPrivateRepoForkPRWorkflowSettingsInEnterprise returned error: %v\", err)\n\t}\n\twant := &WorkflowsPermissions{\n\t\tRunWorkflowsFromForkPullRequests:  Ptr(true),\n\t\tSendWriteTokensToWorkflows:        Ptr(false),\n\t\tSendSecretsAndVariables:           Ptr(true),\n\t\tRequireApprovalForForkPRWorkflows: Ptr(false),\n\t}\n\tif !cmp.Equal(permissions, want) {\n\t\tt.Errorf(\"Actions.GetPrivateRepoForkPRWorkflowSettingsInEnterprise returned %+v, want %+v\", permissions, want)\n\t}\n\n\tconst methodName = \"GetPrivateRepoForkPRWorkflowSettingsInEnterprise\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetPrivateRepoForkPRWorkflowSettingsInEnterprise(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetPrivateRepoForkPRWorkflowSettingsInEnterprise(ctx, \"e\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_UpdatePrivateRepoForkPRWorkflowSettingsInEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &WorkflowsPermissionsOpt{\n\t\tRunWorkflowsFromForkPullRequests: true,\n\t\tSendWriteTokensToWorkflows:       Ptr(false),\n\t\tSendSecretsAndVariables:          Ptr(true),\n\t}\n\n\tmux.HandleFunc(\"/enterprises/e/actions/permissions/fork-pr-workflows-private-repos\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *WorkflowsPermissionsOpt\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Actions.UpdatePrivateRepoForkPRWorkflowSettingsInEnterprise(ctx, \"e\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.UpdatePrivateRepoForkPRWorkflowSettingsInEnterprise returned error: %v\", err)\n\t}\n\n\tif resp.StatusCode != http.StatusNoContent {\n\t\tt.Errorf(\"Actions.UpdatePrivateRepoForkPRWorkflowSettingsInEnterprise = %v, want %v\", resp.StatusCode, http.StatusNoContent)\n\t}\n\n\tconst methodName = \"UpdatePrivateRepoForkPRWorkflowSettingsInEnterprise\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.UpdatePrivateRepoForkPRWorkflowSettingsInEnterprise(ctx, \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.UpdatePrivateRepoForkPRWorkflowSettingsInEnterprise(ctx, \"e\", input)\n\t})\n}\n\nfunc TestActionsService_GetEnterpriseForkPRContributorApprovalPermissions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/actions/permissions/fork-pr-contributor-approval\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"approval_policy\": \"require_approval\"}`)\n\t})\n\n\tctx := t.Context()\n\tpolicy, _, err := client.Actions.GetEnterpriseForkPRContributorApprovalPermissions(ctx, \"e\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetEnterpriseForkPRContributorApprovalPermissions returned error: %v\", err)\n\t}\n\twant := &ContributorApprovalPermissions{ApprovalPolicy: \"require_approval\"}\n\tif !cmp.Equal(policy, want) {\n\t\tt.Errorf(\"Actions.GetEnterpriseForkPRContributorApprovalPermissions returned %+v, want %+v\", policy, want)\n\t}\n\n\tconst methodName = \"GetEnterpriseForkPRContributorApprovalPermissions\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetEnterpriseForkPRContributorApprovalPermissions(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetEnterpriseForkPRContributorApprovalPermissions(ctx, \"e\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_UpdateEnterpriseForkPRContributorApprovalPermissions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := ContributorApprovalPermissions{ApprovalPolicy: \"require_approval\"}\n\n\tmux.HandleFunc(\"/enterprises/e/actions/permissions/fork-pr-contributor-approval\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *ContributorApprovalPermissions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, &input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, &input)\n\t\t}\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Actions.UpdateEnterpriseForkPRContributorApprovalPermissions(ctx, \"e\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.UpdateEnterpriseForkPRContributorApprovalPermissions returned error: %v\", err)\n\t}\n\n\tif resp.StatusCode != http.StatusNoContent {\n\t\tt.Errorf(\"Actions.UpdateEnterpriseForkPRContributorApprovalPermissions = %v, want %v\", resp.StatusCode, http.StatusNoContent)\n\t}\n\n\tconst methodName = \"UpdateEnterpriseForkPRContributorApprovalPermissions\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.UpdateEnterpriseForkPRContributorApprovalPermissions(ctx, \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.UpdateEnterpriseForkPRContributorApprovalPermissions(ctx, \"e\", input)\n\t})\n}\n"
  },
  {
    "path": "github/actions_permissions_orgs.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// ActionsPermissions represents a policy for repositories and allowed actions in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions\ntype ActionsPermissions struct {\n\tEnabledRepositories *string `json:\"enabled_repositories,omitempty\"`\n\tAllowedActions      *string `json:\"allowed_actions,omitempty\"`\n\tSelectedActionsURL  *string `json:\"selected_actions_url,omitempty\"`\n\tSHAPinningRequired  *bool   `json:\"sha_pinning_required,omitempty\"`\n}\n\nfunc (a ActionsPermissions) String() string {\n\treturn Stringify(a)\n}\n\n// ActionsEnabledOnOrgRepos represents all the repositories in an organization for which Actions is enabled.\ntype ActionsEnabledOnOrgRepos struct {\n\tTotalCount   int           `json:\"total_count\"`\n\tRepositories []*Repository `json:\"repositories\"`\n}\n\n// ActionsAllowed represents selected actions that are allowed.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions\ntype ActionsAllowed struct {\n\tGithubOwnedAllowed *bool    `json:\"github_owned_allowed,omitempty\"`\n\tVerifiedAllowed    *bool    `json:\"verified_allowed,omitempty\"`\n\tPatternsAllowed    []string `json:\"patterns_allowed,omitempty\"`\n}\n\nfunc (a ActionsAllowed) String() string {\n\treturn Stringify(a)\n}\n\n// DefaultWorkflowPermissionOrganization represents the default permissions for GitHub Actions workflows for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions\ntype DefaultWorkflowPermissionOrganization struct {\n\tDefaultWorkflowPermissions   *string `json:\"default_workflow_permissions,omitempty\"`\n\tCanApprovePullRequestReviews *bool   `json:\"can_approve_pull_request_reviews,omitempty\"`\n}\n\n// SelfHostedRunnersSettingsOrganization represents the self-hosted runners permissions settings for repositories in an organization.\ntype SelfHostedRunnersSettingsOrganization struct {\n\tEnabledRepositories     *string `json:\"enabled_repositories,omitempty\"`\n\tSelectedRepositoriesURL *string `json:\"selected_repositories_url,omitempty\"`\n}\n\nfunc (s SelfHostedRunnersSettingsOrganization) String() string {\n\treturn Stringify(s)\n}\n\n// SelfHostedRunnersSettingsOrganizationOpt specifies the self-hosted runners permissions settings for repositories in an organization.\ntype SelfHostedRunnersSettingsOrganizationOpt struct {\n\tEnabledRepositories *string `json:\"enabled_repositories,omitempty\"`\n}\n\n// GetActionsPermissions gets the GitHub Actions permissions policy for repositories and allowed actions in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/permissions\nfunc (s *ActionsService) GetActionsPermissions(ctx context.Context, org string) (*ActionsPermissions, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/permissions\", org)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar permissions *ActionsPermissions\n\tresp, err := s.client.Do(ctx, req, &permissions)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn permissions, resp, nil\n}\n\n// UpdateActionsPermissions sets the permissions policy for repositories and allowed actions in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-an-organization\n//\n//meta:operation PUT /orgs/{org}/actions/permissions\nfunc (s *ActionsService) UpdateActionsPermissions(ctx context.Context, org string, actionsPermissions ActionsPermissions) (*ActionsPermissions, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/permissions\", org)\n\treq, err := s.client.NewRequest(\"PUT\", u, actionsPermissions)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar p *ActionsPermissions\n\tresp, err := s.client.Do(ctx, req, &p)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn p, resp, nil\n}\n\n// ListEnabledReposInOrg lists the selected repositories that are enabled for GitHub Actions in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#list-selected-repositories-enabled-for-github-actions-in-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/permissions/repositories\nfunc (s *ActionsService) ListEnabledReposInOrg(ctx context.Context, owner string, opts *ListOptions) (*ActionsEnabledOnOrgRepos, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/permissions/repositories\", owner)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar repos *ActionsEnabledOnOrgRepos\n\tresp, err := s.client.Do(ctx, req, &repos)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn repos, resp, nil\n}\n\n// SetEnabledReposInOrg replaces the list of selected repositories that are enabled for GitHub Actions in an organization..\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-selected-repositories-enabled-for-github-actions-in-an-organization\n//\n//meta:operation PUT /orgs/{org}/actions/permissions/repositories\nfunc (s *ActionsService) SetEnabledReposInOrg(ctx context.Context, owner string, repositoryIDs []int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/permissions/repositories\", owner)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, struct {\n\t\tIDs []int64 `json:\"selected_repository_ids\"`\n\t}{IDs: repositoryIDs})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// AddEnabledReposInOrg adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#enable-a-selected-repository-for-github-actions-in-an-organization\n//\n//meta:operation PUT /orgs/{org}/actions/permissions/repositories/{repository_id}\nfunc (s *ActionsService) AddEnabledReposInOrg(ctx context.Context, owner string, repositoryID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/permissions/repositories/%v\", owner, repositoryID)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// RemoveEnabledReposInOrg removes a single repository from the list of enabled repos for GitHub Actions in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#disable-a-selected-repository-for-github-actions-in-an-organization\n//\n//meta:operation DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}\nfunc (s *ActionsService) RemoveEnabledReposInOrg(ctx context.Context, owner string, repositoryID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/permissions/repositories/%v\", owner, repositoryID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// GetActionsAllowed gets the actions that are allowed in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/permissions/selected-actions\nfunc (s *ActionsService) GetActionsAllowed(ctx context.Context, org string) (*ActionsAllowed, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/permissions/selected-actions\", org)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar actionsAllowed *ActionsAllowed\n\tresp, err := s.client.Do(ctx, req, &actionsAllowed)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn actionsAllowed, resp, nil\n}\n\n// UpdateActionsAllowed sets the actions that are allowed in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization\n//\n//meta:operation PUT /orgs/{org}/actions/permissions/selected-actions\nfunc (s *ActionsService) UpdateActionsAllowed(ctx context.Context, org string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/permissions/selected-actions\", org)\n\treq, err := s.client.NewRequest(\"PUT\", u, actionsAllowed)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar p *ActionsAllowed\n\tresp, err := s.client.Do(ctx, req, &p)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn p, resp, nil\n}\n\n// GetDefaultWorkflowPermissionsInOrganization gets the GitHub Actions default workflow permissions for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/permissions/workflow\nfunc (s *ActionsService) GetDefaultWorkflowPermissionsInOrganization(ctx context.Context, org string) (*DefaultWorkflowPermissionOrganization, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/permissions/workflow\", org)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar permissions *DefaultWorkflowPermissionOrganization\n\tresp, err := s.client.Do(ctx, req, &permissions)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn permissions, resp, nil\n}\n\n// UpdateDefaultWorkflowPermissionsInOrganization sets the GitHub Actions default workflow permissions for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-an-organization\n//\n//meta:operation PUT /orgs/{org}/actions/permissions/workflow\nfunc (s *ActionsService) UpdateDefaultWorkflowPermissionsInOrganization(ctx context.Context, org string, permissions DefaultWorkflowPermissionOrganization) (*DefaultWorkflowPermissionOrganization, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/permissions/workflow\", org)\n\treq, err := s.client.NewRequest(\"PUT\", u, permissions)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar p *DefaultWorkflowPermissionOrganization\n\tresp, err := s.client.Do(ctx, req, &p)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn p, resp, nil\n}\n\n// GetArtifactAndLogRetentionPeriodInOrganization gets the artifact and log retention period for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-artifact-and-log-retention-settings-for-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/permissions/artifact-and-log-retention\nfunc (s *ActionsService) GetArtifactAndLogRetentionPeriodInOrganization(ctx context.Context, org string) (*ArtifactPeriod, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/permissions/artifact-and-log-retention\", org)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar arp *ArtifactPeriod\n\tresp, err := s.client.Do(ctx, req, &arp)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn arp, resp, nil\n}\n\n// UpdateArtifactAndLogRetentionPeriodInOrganization sets the artifact and log retention period for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-artifact-and-log-retention-settings-for-an-organization\n//\n//meta:operation PUT /orgs/{org}/actions/permissions/artifact-and-log-retention\nfunc (s *ActionsService) UpdateArtifactAndLogRetentionPeriodInOrganization(ctx context.Context, org string, period ArtifactPeriodOpt) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/permissions/artifact-and-log-retention\", org)\n\treq, err := s.client.NewRequest(\"PUT\", u, period)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// GetSelfHostedRunnersSettingsInOrganization gets the self-hosted runners permissions settings for repositories in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-self-hosted-runners-settings-for-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/permissions/self-hosted-runners\nfunc (s *ActionsService) GetSelfHostedRunnersSettingsInOrganization(ctx context.Context, org string) (*SelfHostedRunnersSettingsOrganization, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/permissions/self-hosted-runners\", org)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar settings *SelfHostedRunnersSettingsOrganization\n\tresp, err := s.client.Do(ctx, req, &settings)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn settings, resp, nil\n}\n\n// UpdateSelfHostedRunnersSettingsInOrganization sets the self-hosted runners permissions settings for repositories in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-self-hosted-runners-settings-for-an-organization\n//\n//meta:operation PUT /orgs/{org}/actions/permissions/self-hosted-runners\nfunc (s *ActionsService) UpdateSelfHostedRunnersSettingsInOrganization(ctx context.Context, org string, opt SelfHostedRunnersSettingsOrganizationOpt) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/permissions/self-hosted-runners\", org)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, opt)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// SelfHostedRunnersAllowedRepos represents the repositories that are allowed to use self-hosted runners in an organization.\ntype SelfHostedRunnersAllowedRepos struct {\n\tTotalCount   int           `json:\"total_count\"`\n\tRepositories []*Repository `json:\"repositories\"`\n}\n\n// ListRepositoriesSelfHostedRunnersAllowedInOrganization lists the repositories that are allowed to use self-hosted runners in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#list-repositories-allowed-to-use-self-hosted-runners-in-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/permissions/self-hosted-runners/repositories\nfunc (s *ActionsService) ListRepositoriesSelfHostedRunnersAllowedInOrganization(ctx context.Context, org string, opts *ListOptions) (*SelfHostedRunnersAllowedRepos, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/permissions/self-hosted-runners/repositories\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar settings *SelfHostedRunnersAllowedRepos\n\tresp, err := s.client.Do(ctx, req, &settings)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn settings, resp, nil\n}\n\n// SetRepositoriesSelfHostedRunnersAllowedInOrganization allows the list of repositories to use self-hosted runners in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-repositories-allowed-to-use-self-hosted-runners-in-an-organization\n//\n//meta:operation PUT /orgs/{org}/actions/permissions/self-hosted-runners/repositories\nfunc (s *ActionsService) SetRepositoriesSelfHostedRunnersAllowedInOrganization(ctx context.Context, org string, repositoryIDs []int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/permissions/self-hosted-runners/repositories\", org)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, struct {\n\t\tIDs []int64 `json:\"selected_repository_ids\"`\n\t}{IDs: repositoryIDs})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// AddRepositorySelfHostedRunnersAllowedInOrganization adds a repository to the list of repositories that are allowed to use self-hosted runners in an organization.\n//\n// 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\n//\n//meta:operation PUT /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}\nfunc (s *ActionsService) AddRepositorySelfHostedRunnersAllowedInOrganization(ctx context.Context, org string, repositoryID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/permissions/self-hosted-runners/repositories/%v\", org, repositoryID)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// RemoveRepositorySelfHostedRunnersAllowedInOrganization removes a repository from the list of repositories that are allowed to use self-hosted runners in an organization.\n//\n// 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\n//\n//meta:operation DELETE /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}\nfunc (s *ActionsService) RemoveRepositorySelfHostedRunnersAllowedInOrganization(ctx context.Context, org string, repositoryID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/permissions/self-hosted-runners/repositories/%v\", org, repositoryID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// GetPrivateRepoForkPRWorkflowSettingsInOrganization gets the settings for whether workflows from fork pull requests can run on private repositories in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-private-repo-fork-pr-workflow-settings-for-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos\nfunc (s *ActionsService) GetPrivateRepoForkPRWorkflowSettingsInOrganization(ctx context.Context, org string) (*WorkflowsPermissions, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/permissions/fork-pr-workflows-private-repos\", org)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar permissions *WorkflowsPermissions\n\tresp, err := s.client.Do(ctx, req, &permissions)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn permissions, resp, nil\n}\n\n// UpdatePrivateRepoForkPRWorkflowSettingsInOrganization sets the settings for whether workflows from fork pull requests can run on private repositories in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-private-repo-fork-pr-workflow-settings-for-an-organization\n//\n//meta:operation PUT /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos\nfunc (s *ActionsService) UpdatePrivateRepoForkPRWorkflowSettingsInOrganization(ctx context.Context, org string, permissions *WorkflowsPermissionsOpt) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/permissions/fork-pr-workflows-private-repos\", org)\n\treq, err := s.client.NewRequest(\"PUT\", u, permissions)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// GetOrganizationForkPRContributorApprovalPermissions gets the fork PR contributor approval policy for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-fork-pr-contributor-approval-permissions-for-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/permissions/fork-pr-contributor-approval\nfunc (s *ActionsService) GetOrganizationForkPRContributorApprovalPermissions(ctx context.Context, org string) (*ContributorApprovalPermissions, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/permissions/fork-pr-contributor-approval\", org)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar policy *ContributorApprovalPermissions\n\tresp, err := s.client.Do(ctx, req, &policy)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn policy, resp, nil\n}\n\n// UpdateOrganizationForkPRContributorApprovalPermissions sets the fork PR contributor approval policy for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-fork-pr-contributor-approval-permissions-for-an-organization\n//\n//meta:operation PUT /orgs/{org}/actions/permissions/fork-pr-contributor-approval\nfunc (s *ActionsService) UpdateOrganizationForkPRContributorApprovalPermissions(ctx context.Context, org string, policy ContributorApprovalPermissions) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/permissions/fork-pr-contributor-approval\", org)\n\treq, err := s.client.NewRequest(\"PUT\", u, policy)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/actions_permissions_orgs_test.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestActionsService_GetActionsPermissions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/permissions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"enabled_repositories\": \"all\", \"allowed_actions\": \"all\", \"sha_pinning_required\": true}`)\n\t})\n\n\tctx := t.Context()\n\torg, _, err := client.Actions.GetActionsPermissions(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetActionsPermissions returned error: %v\", err)\n\t}\n\twant := &ActionsPermissions{EnabledRepositories: Ptr(\"all\"), AllowedActions: Ptr(\"all\"), SHAPinningRequired: Ptr(true)}\n\tif !cmp.Equal(org, want) {\n\t\tt.Errorf(\"Actions.GetActionsPermissions returned %+v, want %+v\", org, want)\n\t}\n\n\tconst methodName = \"GetActionsPermissions\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetActionsPermissions(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetActionsPermissions(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_UpdateActionsPermissions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &ActionsPermissions{EnabledRepositories: Ptr(\"all\"), AllowedActions: Ptr(\"selected\"), SHAPinningRequired: Ptr(true)}\n\n\tmux.HandleFunc(\"/orgs/o/actions/permissions\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *ActionsPermissions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"enabled_repositories\": \"all\", \"allowed_actions\": \"selected\", \"sha_pinning_required\": true}`)\n\t})\n\n\tctx := t.Context()\n\torg, _, err := client.Actions.UpdateActionsPermissions(ctx, \"o\", *input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.UpdateActionsPermissions returned error: %v\", err)\n\t}\n\n\twant := &ActionsPermissions{EnabledRepositories: Ptr(\"all\"), AllowedActions: Ptr(\"selected\"), SHAPinningRequired: Ptr(true)}\n\tif !cmp.Equal(org, want) {\n\t\tt.Errorf(\"Actions.UpdateActionsPermissions returned %+v, want %+v\", org, want)\n\t}\n\n\tconst methodName = \"UpdateActionsPermissions\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.UpdateActionsPermissions(ctx, \"\\n\", *input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.UpdateActionsPermissions(ctx, \"o\", *input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_ListEnabledReposInOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/permissions/repositories\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\": \"1\",\n\t\t})\n\t\tfmt.Fprint(w, `{\"total_count\":2,\"repositories\":[{\"id\":2}, {\"id\": 3}]}`)\n\t})\n\n\tctx := t.Context()\n\topt := &ListOptions{\n\t\tPage: 1,\n\t}\n\tgot, _, err := client.Actions.ListEnabledReposInOrg(ctx, \"o\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListEnabledRepos returned error: %v\", err)\n\t}\n\n\twant := &ActionsEnabledOnOrgRepos{TotalCount: int(2), Repositories: []*Repository{\n\t\t{ID: Ptr(int64(2))},\n\t\t{ID: Ptr(int64(3))},\n\t}}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Actions.ListEnabledRepos returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ListEnabledRepos\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListEnabledReposInOrg(ctx, \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListEnabledReposInOrg(ctx, \"o\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_SetEnabledReposInOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/permissions/repositories\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\ttestBody(t, r, `{\"selected_repository_ids\":[123,1234]}`+\"\\n\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.SetEnabledReposInOrg(ctx, \"o\", []int64{123, 1234})\n\tif err != nil {\n\t\tt.Errorf(\"Actions.SetEnabledRepos returned error: %v\", err)\n\t}\n\n\tconst methodName = \"SetEnabledRepos\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.SetEnabledReposInOrg(ctx, \"\\n\", []int64{123, 1234})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.SetEnabledReposInOrg(ctx, \"o\", []int64{123, 1234})\n\t})\n}\n\nfunc TestActionsService_AddEnabledReposInOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/permissions/repositories/123\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.AddEnabledReposInOrg(ctx, \"o\", 123)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.AddEnabledReposInOrg returned error: %v\", err)\n\t}\n\n\tconst methodName = \"AddEnabledReposInOrg\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.AddEnabledReposInOrg(ctx, \"\\n\", 123)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.AddEnabledReposInOrg(ctx, \"o\", 123)\n\t})\n}\n\nfunc TestActionsService_RemoveEnabledReposInOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/permissions/repositories/123\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.RemoveEnabledReposInOrg(ctx, \"o\", 123)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.RemoveEnabledReposInOrg returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveEnabledReposInOrg\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.RemoveEnabledReposInOrg(ctx, \"\\n\", 123)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.RemoveEnabledReposInOrg(ctx, \"o\", 123)\n\t})\n}\n\nfunc TestActionsService_GetActionsAllowed(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/permissions/selected-actions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"github_owned_allowed\":true, \"verified_allowed\":false, \"patterns_allowed\":[\"a/b\"]}`)\n\t})\n\n\tctx := t.Context()\n\torg, _, err := client.Actions.GetActionsAllowed(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetActionsAllowed returned error: %v\", err)\n\t}\n\twant := &ActionsAllowed{GithubOwnedAllowed: Ptr(true), VerifiedAllowed: Ptr(false), PatternsAllowed: []string{\"a/b\"}}\n\tif !cmp.Equal(org, want) {\n\t\tt.Errorf(\"Actions.GetActionsAllowed returned %+v, want %+v\", org, want)\n\t}\n\n\tconst methodName = \"GetActionsAllowed\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetActionsAllowed(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetActionsAllowed(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_UpdateActionsAllowed(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &ActionsAllowed{GithubOwnedAllowed: Ptr(true), VerifiedAllowed: Ptr(false), PatternsAllowed: []string{\"a/b\"}}\n\n\tmux.HandleFunc(\"/orgs/o/actions/permissions/selected-actions\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *ActionsAllowed\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"github_owned_allowed\":true, \"verified_allowed\":false, \"patterns_allowed\":[\"a/b\"]}`)\n\t})\n\n\tctx := t.Context()\n\torg, _, err := client.Actions.UpdateActionsAllowed(ctx, \"o\", *input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.UpdateActionsAllowed returned error: %v\", err)\n\t}\n\n\twant := &ActionsAllowed{GithubOwnedAllowed: Ptr(true), VerifiedAllowed: Ptr(false), PatternsAllowed: []string{\"a/b\"}}\n\tif !cmp.Equal(org, want) {\n\t\tt.Errorf(\"Actions.UpdateActionsAllowed returned %+v, want %+v\", org, want)\n\t}\n\n\tconst methodName = \"UpdateActionsAllowed\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.UpdateActionsAllowed(ctx, \"\\n\", *input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.UpdateActionsAllowed(ctx, \"o\", *input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsAllowed_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ActionsAllowed{}, \"{}\")\n\n\tu := &ActionsAllowed{\n\t\tGithubOwnedAllowed: Ptr(false),\n\t\tVerifiedAllowed:    Ptr(false),\n\t\tPatternsAllowed:    []string{\"s\"},\n\t}\n\n\twant := `{\n\t\t\"github_owned_allowed\": false,\n\t\t\"verified_allowed\": false,\n\t\t\"patterns_allowed\": [\n\t\t\t\"s\"\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestActionsPermissions_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ActionsPermissions{}, \"{}\")\n\n\tu := &ActionsPermissions{\n\t\tEnabledRepositories: Ptr(\"e\"),\n\t\tAllowedActions:      Ptr(\"a\"),\n\t\tSelectedActionsURL:  Ptr(\"sau\"),\n\t\tSHAPinningRequired:  Ptr(true),\n\t}\n\n\twant := `{\n\t\t\"enabled_repositories\": \"e\",\n\t\t\"allowed_actions\": \"a\",\n\t\t\"selected_actions_url\": \"sau\",\n\t\t\"sha_pinning_required\": true\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestActionsService_GetDefaultWorkflowPermissionsInOrganization(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/permissions/workflow\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{ \"default_workflow_permissions\": \"read\", \"can_approve_pull_request_reviews\": true }`)\n\t})\n\n\tctx := t.Context()\n\torg, _, err := client.Actions.GetDefaultWorkflowPermissionsInOrganization(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetDefaultWorkflowPermissionsInOrganization returned error: %v\", err)\n\t}\n\twant := &DefaultWorkflowPermissionOrganization{DefaultWorkflowPermissions: Ptr(\"read\"), CanApprovePullRequestReviews: Ptr(true)}\n\tif !cmp.Equal(org, want) {\n\t\tt.Errorf(\"Actions.GetDefaultWorkflowPermissionsInOrganization returned %+v, want %+v\", org, want)\n\t}\n\n\tconst methodName = \"GetDefaultWorkflowPermissionsInOrganization\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetDefaultWorkflowPermissionsInOrganization(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetDefaultWorkflowPermissionsInOrganization(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_UpdateDefaultWorkflowPermissionsInOrganization(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &DefaultWorkflowPermissionOrganization{DefaultWorkflowPermissions: Ptr(\"read\"), CanApprovePullRequestReviews: Ptr(true)}\n\n\tmux.HandleFunc(\"/orgs/o/actions/permissions/workflow\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *DefaultWorkflowPermissionOrganization\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{ \"default_workflow_permissions\": \"read\", \"can_approve_pull_request_reviews\": true }`)\n\t})\n\n\tctx := t.Context()\n\torg, _, err := client.Actions.UpdateDefaultWorkflowPermissionsInOrganization(ctx, \"o\", *input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.UpdateDefaultWorkflowPermissionsInOrganization returned error: %v\", err)\n\t}\n\n\twant := &DefaultWorkflowPermissionOrganization{DefaultWorkflowPermissions: Ptr(\"read\"), CanApprovePullRequestReviews: Ptr(true)}\n\tif !cmp.Equal(org, want) {\n\t\tt.Errorf(\"Actions.UpdateDefaultWorkflowPermissionsInOrganization returned %+v, want %+v\", org, want)\n\t}\n\n\tconst methodName = \"UpdateDefaultWorkflowPermissionsInOrganization\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.UpdateDefaultWorkflowPermissionsInOrganization(ctx, \"\\n\", *input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.UpdateDefaultWorkflowPermissionsInOrganization(ctx, \"o\", *input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetArtifactAndLogRetentionPeriodInOrganization(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/permissions/artifact-and-log-retention\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"days\": 90, \"maximum_allowed_days\": 365}`)\n\t})\n\n\tctx := t.Context()\n\tperiod, _, err := client.Actions.GetArtifactAndLogRetentionPeriodInOrganization(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetArtifactAndLogRetentionPeriodInOrganization returned error: %v\", err)\n\t}\n\n\twant := &ArtifactPeriod{\n\t\tDays:               Ptr(90),\n\t\tMaximumAllowedDays: Ptr(365),\n\t}\n\tif !cmp.Equal(period, want) {\n\t\tt.Errorf(\"Actions.GetArtifactAndLogRetentionPeriodInOrganization = %+v, want %+v\", period, want)\n\t}\n\n\tconst methodName = \"GetArtifactAndLogRetentionPeriodInOrganization\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetArtifactAndLogRetentionPeriodInOrganization(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetArtifactAndLogRetentionPeriodInOrganization(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_UpdateArtifactAndLogRetentionPeriodInOrganization(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &ArtifactPeriodOpt{Days: Ptr(90)}\n\n\tmux.HandleFunc(\"/orgs/o/actions/permissions/artifact-and-log-retention\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *ArtifactPeriodOpt\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Actions.UpdateArtifactAndLogRetentionPeriodInOrganization(ctx, \"o\", *input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.UpdateArtifactAndLogRetentionPeriodInOrganization returned error: %v\", err)\n\t}\n\n\tif resp.StatusCode != http.StatusNoContent {\n\t\tt.Errorf(\"Actions.UpdateArtifactAndLogRetentionPeriodInOrganization = %v, want %v\", resp.StatusCode, http.StatusNoContent)\n\t}\n\n\tconst methodName = \"UpdateArtifactAndLogRetentionPeriodInOrganization\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.UpdateArtifactAndLogRetentionPeriodInOrganization(ctx, \"\\n\", *input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.UpdateArtifactAndLogRetentionPeriodInOrganization(ctx, \"o\", *input)\n\t})\n}\n\nfunc TestActionsService_GetSelfHostedRunnersSettingsInOrganization(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/permissions/self-hosted-runners\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"enabled_repositories\": \"all\", \"selected_repositories_url\": \"https://api.github.com/orgs/octo-org/actions/permissions/self-hosted-runners/repositories\"}`)\n\t})\n\n\tctx := t.Context()\n\tsettings, _, err := client.Actions.GetSelfHostedRunnersSettingsInOrganization(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetSelfHostedRunnersSettingsInOrganization returned error: %v\", err)\n\t}\n\twant := &SelfHostedRunnersSettingsOrganization{\n\t\tEnabledRepositories:     Ptr(\"all\"),\n\t\tSelectedRepositoriesURL: Ptr(\"https://api.github.com/orgs/octo-org/actions/permissions/self-hosted-runners/repositories\"),\n\t}\n\tif !cmp.Equal(settings, want) {\n\t\tt.Errorf(\"Actions.GetSelfHostedRunnersSettingsInOrganization returned %+v, want %+v\", settings, want)\n\t}\n\n\tconst methodName = \"GetSelfHostedRunnersSettingsInOrganization\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetSelfHostedRunnersSettingsInOrganization(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetSelfHostedRunnersSettingsInOrganization(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_UpdateSelfHostedRunnersSettingsInOrganization(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &SelfHostedRunnersSettingsOrganizationOpt{EnabledRepositories: Ptr(\"selected\")}\n\n\tmux.HandleFunc(\"/orgs/o/actions/permissions/self-hosted-runners\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *SelfHostedRunnersSettingsOrganizationOpt\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Actions.UpdateSelfHostedRunnersSettingsInOrganization(ctx, \"o\", *input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.UpdateSelfHostedRunnersSettingsInOrganization returned error: %v\", err)\n\t}\n\n\tif resp.StatusCode != http.StatusNoContent {\n\t\tt.Errorf(\"Actions.UpdateSelfHostedRunnersSettingsInOrganization = %v, want %v\", resp.StatusCode, http.StatusNoContent)\n\t}\n\n\tconst methodName = \"UpdateSelfHostedRunnersSettingsInOrganization\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.UpdateSelfHostedRunnersSettingsInOrganization(ctx, \"\\n\", *input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.UpdateSelfHostedRunnersSettingsInOrganization(ctx, \"o\", *input)\n\t})\n}\n\nfunc TestActionsService_ListRepositoriesSelfHostedRunnersAllowedInOrganization(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/permissions/self-hosted-runners/repositories\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\": \"1\",\n\t\t})\n\t\tfmt.Fprint(w, `{\"total_count\":2,\"repositories\":[{\"id\":2}, {\"id\": 3}]}`)\n\t})\n\n\tctx := t.Context()\n\topt := &ListOptions{\n\t\tPage: 1,\n\t}\n\tgot, _, err := client.Actions.ListRepositoriesSelfHostedRunnersAllowedInOrganization(ctx, \"o\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListRepositoriesSelfHostedRunnersAllowedInOrganization returned error: %v\", err)\n\t}\n\n\twant := &SelfHostedRunnersAllowedRepos{TotalCount: int(2), Repositories: []*Repository{\n\t\t{ID: Ptr(int64(2))},\n\t\t{ID: Ptr(int64(3))},\n\t}}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Actions.ListRepositoriesSelfHostedRunnersAllowedInOrganization returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ListRepositoriesSelfHostedRunnersAllowedInOrganization\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListRepositoriesSelfHostedRunnersAllowedInOrganization(ctx, \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListRepositoriesSelfHostedRunnersAllowedInOrganization(ctx, \"o\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_SetRepositoriesSelfHostedRunnersAllowedInOrganization(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/permissions/self-hosted-runners/repositories\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\ttestBody(t, r, `{\"selected_repository_ids\":[123,1234]}`+\"\\n\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.SetRepositoriesSelfHostedRunnersAllowedInOrganization(ctx, \"o\", []int64{123, 1234})\n\tif err != nil {\n\t\tt.Errorf(\"Actions.SetRepositoriesSelfHostedRunnersAllowedInOrganization returned error: %v\", err)\n\t}\n\n\tconst methodName = \"SetRepositoriesSelfHostedRunnersAllowedInOrganization\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.SetRepositoriesSelfHostedRunnersAllowedInOrganization(ctx, \"\\n\", []int64{123, 1234})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.SetRepositoriesSelfHostedRunnersAllowedInOrganization(ctx, \"o\", []int64{123, 1234})\n\t})\n}\n\nfunc TestActionsService_AddRepositorySelfHostedRunnersAllowedInOrganization(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/permissions/self-hosted-runners/repositories/123\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.AddRepositorySelfHostedRunnersAllowedInOrganization(ctx, \"o\", 123)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.AddRepositorySelfHostedRunnersAllowedInOrganization returned error: %v\", err)\n\t}\n\n\tconst methodName = \"AddRepositorySelfHostedRunnersAllowedInOrganization\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.AddRepositorySelfHostedRunnersAllowedInOrganization(ctx, \"\\n\", 123)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.AddRepositorySelfHostedRunnersAllowedInOrganization(ctx, \"o\", 123)\n\t})\n}\n\nfunc TestActionsService_RemoveRepositorySelfHostedRunnersAllowedInOrganization(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/permissions/self-hosted-runners/repositories/123\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.RemoveRepositorySelfHostedRunnersAllowedInOrganization(ctx, \"o\", 123)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.RemoveRepositorySelfHostedRunnersAllowedInOrganization returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveRepositorySelfHostedRunnersAllowedInOrganization\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.RemoveRepositorySelfHostedRunnersAllowedInOrganization(ctx, \"\\n\", 123)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.RemoveRepositorySelfHostedRunnersAllowedInOrganization(ctx, \"o\", 123)\n\t})\n}\n\nfunc TestActionsService_GetPrivateRepoForkPRWorkflowSettingsInOrganization(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/permissions/fork-pr-workflows-private-repos\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"run_workflows_from_fork_pull_requests\": true, \"send_write_tokens_to_workflows\": false, \"send_secrets_and_variables\": true, \"require_approval_for_fork_pr_workflows\": false}`)\n\t})\n\n\tctx := t.Context()\n\tpermissions, _, err := client.Actions.GetPrivateRepoForkPRWorkflowSettingsInOrganization(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetPrivateRepoForkPRWorkflowSettingsInOrganization returned error: %v\", err)\n\t}\n\twant := &WorkflowsPermissions{\n\t\tRunWorkflowsFromForkPullRequests:  Ptr(true),\n\t\tSendWriteTokensToWorkflows:        Ptr(false),\n\t\tSendSecretsAndVariables:           Ptr(true),\n\t\tRequireApprovalForForkPRWorkflows: Ptr(false),\n\t}\n\tif !cmp.Equal(permissions, want) {\n\t\tt.Errorf(\"Actions.GetPrivateRepoForkPRWorkflowSettingsInOrganization returned %+v, want %+v\", permissions, want)\n\t}\n\n\tconst methodName = \"GetPrivateRepoForkPRWorkflowSettingsInOrganization\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetPrivateRepoForkPRWorkflowSettingsInOrganization(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetPrivateRepoForkPRWorkflowSettingsInOrganization(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_UpdatePrivateRepoForkPRWorkflowSettingsInOrganization(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &WorkflowsPermissionsOpt{\n\t\tRunWorkflowsFromForkPullRequests: true,\n\t\tSendWriteTokensToWorkflows:       Ptr(false),\n\t\tSendSecretsAndVariables:          Ptr(true),\n\t}\n\n\tmux.HandleFunc(\"/orgs/o/actions/permissions/fork-pr-workflows-private-repos\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *WorkflowsPermissionsOpt\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Actions.UpdatePrivateRepoForkPRWorkflowSettingsInOrganization(ctx, \"o\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.UpdatePrivateRepoForkPRWorkflowSettingsInOrganization returned error: %v\", err)\n\t}\n\n\tif resp.StatusCode != http.StatusNoContent {\n\t\tt.Errorf(\"Actions.UpdatePrivateRepoForkPRWorkflowSettingsInOrganization = %v, want %v\", resp.StatusCode, http.StatusNoContent)\n\t}\n\n\tconst methodName = \"UpdatePrivateRepoForkPRWorkflowSettingsInOrganization\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.UpdatePrivateRepoForkPRWorkflowSettingsInOrganization(ctx, \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.UpdatePrivateRepoForkPRWorkflowSettingsInOrganization(ctx, \"o\", input)\n\t})\n}\n\nfunc TestActionsService_GetOrganizationForkPRContributorApprovalPermissions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/permissions/fork-pr-contributor-approval\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"approval_policy\": \"require_approval\"}`)\n\t})\n\n\tctx := t.Context()\n\tpolicy, _, err := client.Actions.GetOrganizationForkPRContributorApprovalPermissions(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetOrganizationForkPRContributorApprovalPermissions returned error: %v\", err)\n\t}\n\twant := &ContributorApprovalPermissions{ApprovalPolicy: \"require_approval\"}\n\tif !cmp.Equal(policy, want) {\n\t\tt.Errorf(\"Actions.GetOrganizationForkPRContributorApprovalPermissions returned %+v, want %+v\", policy, want)\n\t}\n\n\tconst methodName = \"GetOrganizationForkPRContributorApprovalPermissions\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetOrganizationForkPRContributorApprovalPermissions(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetOrganizationForkPRContributorApprovalPermissions(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_UpdateOrganizationForkPRContributorApprovalPermissions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := ContributorApprovalPermissions{ApprovalPolicy: \"require_approval\"}\n\n\tmux.HandleFunc(\"/orgs/o/actions/permissions/fork-pr-contributor-approval\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *ContributorApprovalPermissions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, &input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, &input)\n\t\t}\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Actions.UpdateOrganizationForkPRContributorApprovalPermissions(ctx, \"o\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.UpdateOrganizationForkPRContributorApprovalPermissions returned error: %v\", err)\n\t}\n\n\tif resp.StatusCode != http.StatusNoContent {\n\t\tt.Errorf(\"Actions.UpdateOrganizationForkPRContributorApprovalPermissions = %v, want %v\", resp.StatusCode, http.StatusNoContent)\n\t}\n\n\tconst methodName = \"UpdateOrganizationForkPRContributorApprovalPermissions\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.UpdateOrganizationForkPRContributorApprovalPermissions(ctx, \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.UpdateOrganizationForkPRContributorApprovalPermissions(ctx, \"o\", input)\n\t})\n}\n"
  },
  {
    "path": "github/actions_runner_groups.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// RunnerGroup represents a self-hosted runner group configured in an organization.\ntype RunnerGroup struct {\n\tID                           *int64   `json:\"id,omitempty\"`\n\tName                         *string  `json:\"name,omitempty\"`\n\tVisibility                   *string  `json:\"visibility,omitempty\"`\n\tDefault                      *bool    `json:\"default,omitempty\"`\n\tSelectedRepositoriesURL      *string  `json:\"selected_repositories_url,omitempty\"`\n\tRunnersURL                   *string  `json:\"runners_url,omitempty\"`\n\tHostedRunnersURL             *string  `json:\"hosted_runners_url,omitempty\"`\n\tNetworkConfigurationID       *string  `json:\"network_configuration_id,omitempty\"`\n\tInherited                    *bool    `json:\"inherited,omitempty\"`\n\tAllowsPublicRepositories     *bool    `json:\"allows_public_repositories,omitempty\"`\n\tRestrictedToWorkflows        *bool    `json:\"restricted_to_workflows,omitempty\"`\n\tSelectedWorkflows            []string `json:\"selected_workflows,omitempty\"`\n\tWorkflowRestrictionsReadOnly *bool    `json:\"workflow_restrictions_read_only,omitempty\"`\n}\n\n// RunnerGroups represents a collection of self-hosted runner groups configured for an organization.\ntype RunnerGroups struct {\n\tTotalCount   int            `json:\"total_count\"`\n\tRunnerGroups []*RunnerGroup `json:\"runner_groups\"`\n}\n\n// CreateRunnerGroupRequest represents a request to create a Runner group for an organization.\ntype CreateRunnerGroupRequest struct {\n\tName       *string `json:\"name,omitempty\"`\n\tVisibility *string `json:\"visibility,omitempty\"`\n\t// List of repository IDs that can access the runner group.\n\tSelectedRepositoryIDs []int64 `json:\"selected_repository_ids,omitempty\"`\n\t// Runners represent a list of runner IDs to add to the runner group.\n\tRunners []int64 `json:\"runners,omitempty\"`\n\t// If set to True, public repos can use this runner group\n\tAllowsPublicRepositories *bool `json:\"allows_public_repositories,omitempty\"`\n\t// If true, the runner group will be restricted to running only the workflows specified in the SelectedWorkflows slice.\n\tRestrictedToWorkflows *bool `json:\"restricted_to_workflows,omitempty\"`\n\t// List of workflows the runner group should be allowed to run. This setting will be ignored unless RestrictedToWorkflows is set to true.\n\tSelectedWorkflows []string `json:\"selected_workflows,omitempty\"`\n\t// The identifier of a hosted compute network configuration.\n\tNetworkConfigurationID *string `json:\"network_configuration_id,omitempty\"`\n}\n\n// UpdateRunnerGroupRequest represents a request to update a Runner group for an organization.\ntype UpdateRunnerGroupRequest struct {\n\tName                     *string  `json:\"name,omitempty\"`\n\tVisibility               *string  `json:\"visibility,omitempty\"`\n\tAllowsPublicRepositories *bool    `json:\"allows_public_repositories,omitempty\"`\n\tRestrictedToWorkflows    *bool    `json:\"restricted_to_workflows,omitempty\"`\n\tSelectedWorkflows        []string `json:\"selected_workflows,omitempty\"`\n\tNetworkConfigurationID   *string  `json:\"network_configuration_id,omitempty\"`\n}\n\n// SetRepoAccessRunnerGroupRequest represents a request to replace the list of repositories\n// that can access a self-hosted runner group configured in an organization.\ntype SetRepoAccessRunnerGroupRequest struct {\n\t// Updated list of repository IDs that should be given access to the runner group.\n\tSelectedRepositoryIDs []int64 `json:\"selected_repository_ids\"`\n}\n\n// SetRunnerGroupRunnersRequest represents a request to replace the list of\n// self-hosted runners that are part of an organization runner group.\ntype SetRunnerGroupRunnersRequest struct {\n\t// Updated list of runner IDs that should be given access to the runner group.\n\tRunners []int64 `json:\"runners\"`\n}\n\n// ListOrgRunnerGroupOptions extend ListOptions to have the optional parameters VisibleToRepository.\ntype ListOrgRunnerGroupOptions struct {\n\tListOptions\n\n\t// Only return runner groups that are allowed to be used by this repository.\n\tVisibleToRepository string `url:\"visible_to_repository,omitempty\"`\n}\n\n// ListOrganizationRunnerGroups lists all self-hosted runner groups configured in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/runner-groups\nfunc (s *ActionsService) ListOrganizationRunnerGroups(ctx context.Context, org string, opts *ListOrgRunnerGroupOptions) (*RunnerGroups, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/runner-groups\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar groups *RunnerGroups\n\tresp, err := s.client.Do(ctx, req, &groups)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn groups, resp, nil\n}\n\n// GetOrganizationRunnerGroup gets a specific self-hosted runner group for an organization using its RunnerGroup ID.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/runner-groups/{runner_group_id}\nfunc (s *ActionsService) GetOrganizationRunnerGroup(ctx context.Context, org string, groupID int64) (*RunnerGroup, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/runner-groups/%v\", org, groupID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar runnerGroup *RunnerGroup\n\tresp, err := s.client.Do(ctx, req, &runnerGroup)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn runnerGroup, resp, nil\n}\n\n// DeleteOrganizationRunnerGroup deletes a self-hosted runner group from an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization\n//\n//meta:operation DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}\nfunc (s *ActionsService) DeleteOrganizationRunnerGroup(ctx context.Context, org string, groupID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/runner-groups/%v\", org, groupID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// CreateOrganizationRunnerGroup creates a new self-hosted runner group for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization\n//\n//meta:operation POST /orgs/{org}/actions/runner-groups\nfunc (s *ActionsService) CreateOrganizationRunnerGroup(ctx context.Context, org string, createReq CreateRunnerGroupRequest) (*RunnerGroup, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/runner-groups\", org)\n\treq, err := s.client.NewRequest(\"POST\", u, createReq)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar runnerGroup *RunnerGroup\n\tresp, err := s.client.Do(ctx, req, &runnerGroup)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn runnerGroup, resp, nil\n}\n\n// UpdateOrganizationRunnerGroup updates a self-hosted runner group for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization\n//\n//meta:operation PATCH /orgs/{org}/actions/runner-groups/{runner_group_id}\nfunc (s *ActionsService) UpdateOrganizationRunnerGroup(ctx context.Context, org string, groupID int64, updateReq UpdateRunnerGroupRequest) (*RunnerGroup, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/runner-groups/%v\", org, groupID)\n\treq, err := s.client.NewRequest(\"PATCH\", u, updateReq)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar runnerGroup *RunnerGroup\n\tresp, err := s.client.Do(ctx, req, &runnerGroup)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn runnerGroup, resp, nil\n}\n\n// ListRepositoryAccessRunnerGroup lists the repositories with access to a self-hosted runner group configured in an organization.\n//\n// 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\n//\n//meta:operation GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories\nfunc (s *ActionsService) ListRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID int64, opts *ListOptions) (*ListRepositories, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/runner-groups/%v/repositories\", org, groupID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar repos *ListRepositories\n\tresp, err := s.client.Do(ctx, req, &repos)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn repos, resp, nil\n}\n\n// SetRepositoryAccessRunnerGroup replaces the list of repositories that have access to a self-hosted runner group configured in an organization\n// with a new List of repositories.\n//\n// 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\n//\n//meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories\nfunc (s *ActionsService) SetRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID int64, ids SetRepoAccessRunnerGroupRequest) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/runner-groups/%v/repositories\", org, groupID)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, ids)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// AddRepositoryAccessRunnerGroup adds a repository to the list of selected repositories that can access a self-hosted runner group.\n// The runner group must have visibility set to 'selected'.\n//\n// 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\n//\n//meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}\nfunc (s *ActionsService) AddRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID, repoID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/runner-groups/%v/repositories/%v\", org, groupID, repoID)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// RemoveRepositoryAccessRunnerGroup removes a repository from the list of selected repositories that can access a self-hosted runner group.\n// The runner group must have visibility set to 'selected'.\n//\n// 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\n//\n//meta:operation DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}\nfunc (s *ActionsService) RemoveRepositoryAccessRunnerGroup(ctx context.Context, org string, groupID, repoID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/runner-groups/%v/repositories/%v\", org, groupID, repoID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// ListRunnerGroupHostedRunners lists the GitHub-hosted runners in an organization runner group.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-github-hosted-runners-in-a-group-for-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners\nfunc (s *ActionsService) ListRunnerGroupHostedRunners(ctx context.Context, org string, groupID int64, opts *ListOptions) (*HostedRunners, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/runner-groups/%v/hosted-runners\", org, groupID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar runners *HostedRunners\n\tresp, err := s.client.Do(ctx, req, &runners)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn runners, resp, nil\n}\n\n// ListRunnerGroupRunners lists self-hosted runners that are in a specific organization group.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners\nfunc (s *ActionsService) ListRunnerGroupRunners(ctx context.Context, org string, groupID int64, opts *ListOptions) (*Runners, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/runner-groups/%v/runners\", org, groupID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar runners *Runners\n\tresp, err := s.client.Do(ctx, req, &runners)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn runners, resp, nil\n}\n\n// SetRunnerGroupRunners replaces the list of self-hosted runners that are part of an organization runner group\n// with a new list of runners.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization\n//\n//meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners\nfunc (s *ActionsService) SetRunnerGroupRunners(ctx context.Context, org string, groupID int64, ids SetRunnerGroupRunnersRequest) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/runner-groups/%v/runners\", org, groupID)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, ids)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// AddRunnerGroupRunners adds a self-hosted runner to a runner group configured in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization\n//\n//meta:operation PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}\nfunc (s *ActionsService) AddRunnerGroupRunners(ctx context.Context, org string, groupID, runnerID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/runner-groups/%v/runners/%v\", org, groupID, runnerID)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// RemoveRunnerGroupRunners removes a self-hosted runner from a group configured in an organization.\n// The runner is then returned to the default group.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization\n//\n//meta:operation DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}\nfunc (s *ActionsService) RemoveRunnerGroupRunners(ctx context.Context, org string, groupID, runnerID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/runner-groups/%v/runners/%v\", org, groupID, runnerID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/actions_runner_groups_test.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestActionsService_ListOrganizationRunnerGroups(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/runner-groups\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `{\"total_count\":3,\"runner_groups\":[{\"id\":1,\"name\":\"Default\",\"visibility\":\"all\",\"default\":true,\"runners_url\":\"https://api.github.com/orgs/octo-org/actions/runner_groups/1/runners\",\"inherited\":false,\"allows_public_repositories\":true,\"restricted_to_workflows\":true,\"selected_workflows\":[\"a\",\"b\"]},{\"id\":2,\"name\":\"octo-runner-group\",\"visibility\":\"selected\",\"default\":false,\"selected_repositories_url\":\"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories\",\"runners_url\":\"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners\",\"inherited\":true,\"allows_public_repositories\":true,\"restricted_to_workflows\":false,\"selected_workflows\":[]},{\"id\":3,\"name\":\"expensive-hardware\",\"visibility\":\"private\",\"default\":false,\"runners_url\":\"https://api.github.com/orgs/octo-org/actions/runner_groups/3/runners\",\"inherited\":false,\"allows_public_repositories\":true,\"restricted_to_workflows\":false,\"selected_workflows\":[]}]}`)\n\t})\n\n\topts := &ListOrgRunnerGroupOptions{ListOptions: ListOptions{Page: 2, PerPage: 2}}\n\tctx := t.Context()\n\tgroups, _, err := client.Actions.ListOrganizationRunnerGroups(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListOrganizationRunnerGroups returned error: %v\", err)\n\t}\n\n\twant := &RunnerGroups{\n\t\tTotalCount: 3,\n\t\tRunnerGroups: []*RunnerGroup{\n\t\t\t{ID: Ptr(int64(1)), Name: Ptr(\"Default\"), Visibility: Ptr(\"all\"), Default: Ptr(true), RunnersURL: Ptr(\"https://api.github.com/orgs/octo-org/actions/runner_groups/1/runners\"), Inherited: Ptr(false), AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(true), SelectedWorkflows: []string{\"a\", \"b\"}},\n\t\t\t{ID: Ptr(int64(2)), Name: Ptr(\"octo-runner-group\"), Visibility: Ptr(\"selected\"), Default: Ptr(false), SelectedRepositoriesURL: Ptr(\"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories\"), RunnersURL: Ptr(\"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners\"), Inherited: Ptr(true), AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}},\n\t\t\t{ID: Ptr(int64(3)), Name: Ptr(\"expensive-hardware\"), Visibility: Ptr(\"private\"), Default: Ptr(false), RunnersURL: Ptr(\"https://api.github.com/orgs/octo-org/actions/runner_groups/3/runners\"), Inherited: Ptr(false), AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}},\n\t\t},\n\t}\n\tif !cmp.Equal(groups, want) {\n\t\tt.Errorf(\"Actions.ListOrganizationRunnerGroups returned %+v, want %+v\", groups, want)\n\t}\n\n\tconst methodName = \"ListOrganizationRunnerGroups\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListOrganizationRunnerGroups(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListOrganizationRunnerGroups(ctx, \"o\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_ListOrganizationRunnerGroupsVisibleToRepo(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/runner-groups\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\", \"visible_to_repository\": \"github\"})\n\t\tfmt.Fprint(w, `{\"total_count\":3,\"runner_groups\":[{\"id\":1,\"name\":\"Default\",\"visibility\":\"all\",\"default\":true,\"runners_url\":\"https://api.github.com/orgs/octo-org/actions/runner_groups/1/runners\",\"inherited\":false,\"allows_public_repositories\":true,\"restricted_to_workflows\":false,\"selected_workflows\":[]},{\"id\":2,\"name\":\"octo-runner-group\",\"visibility\":\"selected\",\"default\":false,\"selected_repositories_url\":\"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories\",\"runners_url\":\"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners\",\"inherited\":true,\"allows_public_repositories\":true,\"restricted_to_workflows\":false,\"selected_workflows\":[]},{\"id\":3,\"name\":\"expensive-hardware\",\"visibility\":\"private\",\"default\":false,\"runners_url\":\"https://api.github.com/orgs/octo-org/actions/runner_groups/3/runners\",\"inherited\":false,\"allows_public_repositories\":true,\"restricted_to_workflows\":false,\"selected_workflows\":[]}]}`)\n\t})\n\n\topts := &ListOrgRunnerGroupOptions{ListOptions: ListOptions{Page: 2, PerPage: 2}, VisibleToRepository: \"github\"}\n\tctx := t.Context()\n\tgroups, _, err := client.Actions.ListOrganizationRunnerGroups(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListOrganizationRunnerGroups returned error: %v\", err)\n\t}\n\n\twant := &RunnerGroups{\n\t\tTotalCount: 3,\n\t\tRunnerGroups: []*RunnerGroup{\n\t\t\t{ID: Ptr(int64(1)), Name: Ptr(\"Default\"), Visibility: Ptr(\"all\"), Default: Ptr(true), RunnersURL: Ptr(\"https://api.github.com/orgs/octo-org/actions/runner_groups/1/runners\"), Inherited: Ptr(false), AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}},\n\t\t\t{ID: Ptr(int64(2)), Name: Ptr(\"octo-runner-group\"), Visibility: Ptr(\"selected\"), Default: Ptr(false), SelectedRepositoriesURL: Ptr(\"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories\"), RunnersURL: Ptr(\"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners\"), Inherited: Ptr(true), AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}},\n\t\t\t{ID: Ptr(int64(3)), Name: Ptr(\"expensive-hardware\"), Visibility: Ptr(\"private\"), Default: Ptr(false), RunnersURL: Ptr(\"https://api.github.com/orgs/octo-org/actions/runner_groups/3/runners\"), Inherited: Ptr(false), AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}},\n\t\t},\n\t}\n\tif !cmp.Equal(groups, want) {\n\t\tt.Errorf(\"Actions.ListOrganizationRunnerGroups returned %+v, want %+v\", groups, want)\n\t}\n\n\tconst methodName = \"ListOrganizationRunnerGroups\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListOrganizationRunnerGroups(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListOrganizationRunnerGroups(ctx, \"o\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetOrganizationRunnerGroup(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/runner-groups/2\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":2,\"name\":\"octo-runner-group\",\"visibility\":\"selected\",\"default\":false,\"selected_repositories_url\":\"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories\",\"runners_url\":\"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners\",\"hosted_runners_url\":\"https://api.github.com/orgs/octo-org/actions/runner_groups/2/hosted-runners\",\"network_configuration_id\":\"EC486D5D793175D7E3B29C27318D5C1AAE49A7833FC85F2E82C3D2C54AC7D3BA\",\"inherited\":false,\"allows_public_repositories\":true,\"restricted_to_workflows\":false,\"selected_workflows\":[]}`)\n\t})\n\n\tctx := t.Context()\n\tgroup, _, err := client.Actions.GetOrganizationRunnerGroup(ctx, \"o\", 2)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListOrganizationRunnerGroups returned error: %v\", err)\n\t}\n\n\twant := &RunnerGroup{\n\t\tID:                       Ptr(int64(2)),\n\t\tName:                     Ptr(\"octo-runner-group\"),\n\t\tVisibility:               Ptr(\"selected\"),\n\t\tDefault:                  Ptr(false),\n\t\tSelectedRepositoriesURL:  Ptr(\"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories\"),\n\t\tRunnersURL:               Ptr(\"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners\"),\n\t\tHostedRunnersURL:         Ptr(\"https://api.github.com/orgs/octo-org/actions/runner_groups/2/hosted-runners\"),\n\t\tNetworkConfigurationID:   Ptr(\"EC486D5D793175D7E3B29C27318D5C1AAE49A7833FC85F2E82C3D2C54AC7D3BA\"),\n\t\tInherited:                Ptr(false),\n\t\tAllowsPublicRepositories: Ptr(true),\n\t\tRestrictedToWorkflows:    Ptr(false),\n\t\tSelectedWorkflows:        []string{},\n\t}\n\n\tif !cmp.Equal(group, want) {\n\t\tt.Errorf(\"Actions.GetOrganizationRunnerGroup returned %+v, want %+v\", group, want)\n\t}\n\n\tconst methodName = \"GetOrganizationRunnerGroup\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetOrganizationRunnerGroup(ctx, \"\\n\", 2)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetOrganizationRunnerGroup(ctx, \"o\", 2)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_DeleteOrganizationRunnerGroup(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/runner-groups/2\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.DeleteOrganizationRunnerGroup(ctx, \"o\", 2)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.DeleteOrganizationRunnerGroup returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteOrganizationRunnerGroup\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.DeleteOrganizationRunnerGroup(ctx, \"\\n\", 2)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.DeleteOrganizationRunnerGroup(ctx, \"o\", 2)\n\t})\n}\n\nfunc TestActionsService_CreateOrganizationRunnerGroup(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/runner-groups\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\"id\":2,\"name\":\"octo-runner-group\",\"visibility\":\"selected\",\"default\":false,\"selected_repositories_url\":\"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories\",\"runners_url\":\"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners\",\"hosted_runners_url\":\"https://api.github.com/orgs/octo-org/actions/runner_groups/2/hosted-runners\",\"network_configuration_id\":\"EC486D5D793175D7E3B29C27318D5C1AAE49A7833FC85F2E82C3D2C54AC7D3BA\",\"inherited\":false,\"allows_public_repositories\":true,\"restricted_to_workflows\":false,\"selected_workflows\":[]}`)\n\t})\n\n\tctx := t.Context()\n\treq := CreateRunnerGroupRequest{\n\t\tName:                     Ptr(\"octo-runner-group\"),\n\t\tVisibility:               Ptr(\"selected\"),\n\t\tAllowsPublicRepositories: Ptr(true),\n\t\tRestrictedToWorkflows:    Ptr(false),\n\t\tSelectedWorkflows:        []string{},\n\t\tNetworkConfigurationID:   Ptr(\"EC486D5D793175D7E3B29C27318D5C1AAE49A7833FC85F2E82C3D2C54AC7D3BA\"),\n\t}\n\tgroup, _, err := client.Actions.CreateOrganizationRunnerGroup(ctx, \"o\", req)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.CreateOrganizationRunnerGroup returned error: %v\", err)\n\t}\n\n\twant := &RunnerGroup{\n\t\tID:                       Ptr(int64(2)),\n\t\tName:                     Ptr(\"octo-runner-group\"),\n\t\tVisibility:               Ptr(\"selected\"),\n\t\tDefault:                  Ptr(false),\n\t\tSelectedRepositoriesURL:  Ptr(\"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories\"),\n\t\tRunnersURL:               Ptr(\"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners\"),\n\t\tHostedRunnersURL:         Ptr(\"https://api.github.com/orgs/octo-org/actions/runner_groups/2/hosted-runners\"),\n\t\tNetworkConfigurationID:   Ptr(\"EC486D5D793175D7E3B29C27318D5C1AAE49A7833FC85F2E82C3D2C54AC7D3BA\"),\n\t\tInherited:                Ptr(false),\n\t\tAllowsPublicRepositories: Ptr(true),\n\t\tRestrictedToWorkflows:    Ptr(false),\n\t\tSelectedWorkflows:        []string{},\n\t}\n\n\tif !cmp.Equal(group, want) {\n\t\tt.Errorf(\"Actions.CreateOrganizationRunnerGroup returned %+v, want %+v\", group, want)\n\t}\n\n\tconst methodName = \"CreateOrganizationRunnerGroup\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.CreateOrganizationRunnerGroup(ctx, \"\\n\", req)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.CreateOrganizationRunnerGroup(ctx, \"o\", req)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_UpdateOrganizationRunnerGroup(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/runner-groups/2\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tfmt.Fprint(w, `{\"id\":2,\"name\":\"octo-runner-group\",\"visibility\":\"selected\",\"default\":false,\"selected_repositories_url\":\"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories\",\"runners_url\":\"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners\",\"hosted_runners_url\":\"https://api.github.com/orgs/octo-org/actions/runner_groups/2/hosted-runners\",\"network_configuration_id\":\"EC486D5D793175D7E3B29C27318D5C1AAE49A7833FC85F2E82C3D2C54AC7D3BA\",\"inherited\":false,\"allows_public_repositories\":true,\"restricted_to_workflows\":false,\"selected_workflows\":[]}`)\n\t})\n\n\tctx := t.Context()\n\treq := UpdateRunnerGroupRequest{\n\t\tName:                     Ptr(\"octo-runner-group\"),\n\t\tVisibility:               Ptr(\"selected\"),\n\t\tAllowsPublicRepositories: Ptr(true),\n\t\tRestrictedToWorkflows:    Ptr(false),\n\t\tSelectedWorkflows:        []string{},\n\t\tNetworkConfigurationID:   Ptr(\"EC486D5D793175D7E3B29C27318D5C1AAE49A7833FC85F2E82C3D2C54AC7D3BA\"),\n\t}\n\tgroup, _, err := client.Actions.UpdateOrganizationRunnerGroup(ctx, \"o\", 2, req)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.UpdateOrganizationRunnerGroup returned error: %v\", err)\n\t}\n\n\twant := &RunnerGroup{\n\t\tID:                       Ptr(int64(2)),\n\t\tName:                     Ptr(\"octo-runner-group\"),\n\t\tVisibility:               Ptr(\"selected\"),\n\t\tDefault:                  Ptr(false),\n\t\tSelectedRepositoriesURL:  Ptr(\"https://api.github.com/orgs/octo-org/actions/runner_groups/2/repositories\"),\n\t\tRunnersURL:               Ptr(\"https://api.github.com/orgs/octo-org/actions/runner_groups/2/runners\"),\n\t\tHostedRunnersURL:         Ptr(\"https://api.github.com/orgs/octo-org/actions/runner_groups/2/hosted-runners\"),\n\t\tNetworkConfigurationID:   Ptr(\"EC486D5D793175D7E3B29C27318D5C1AAE49A7833FC85F2E82C3D2C54AC7D3BA\"),\n\t\tInherited:                Ptr(false),\n\t\tAllowsPublicRepositories: Ptr(true),\n\t\tRestrictedToWorkflows:    Ptr(false),\n\t\tSelectedWorkflows:        []string{},\n\t}\n\n\tif !cmp.Equal(group, want) {\n\t\tt.Errorf(\"Actions.UpdateOrganizationRunnerGroup returned %+v, want %+v\", group, want)\n\t}\n\n\tconst methodName = \"UpdateOrganizationRunnerGroup\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.UpdateOrganizationRunnerGroup(ctx, \"\\n\", 2, req)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.UpdateOrganizationRunnerGroup(ctx, \"o\", 2, req)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_ListRepositoryAccessRunnerGroup(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/runner-groups/2/repositories\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"1\", \"page\": \"1\"})\n\t\tfmt.Fprint(w, `{\"total_count\": 1, \"repositories\": [{\"id\": 43, \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\", \"name\": \"Hello-World\", \"full_name\": \"octocat/Hello-World\"}]}`)\n\t})\n\n\tctx := t.Context()\n\topts := &ListOptions{Page: 1, PerPage: 1}\n\tgroups, _, err := client.Actions.ListRepositoryAccessRunnerGroup(ctx, \"o\", 2, opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListRepositoryAccessRunnerGroup returned error: %v\", err)\n\t}\n\n\twant := &ListRepositories{\n\t\tTotalCount: Ptr(1),\n\t\tRepositories: []*Repository{\n\t\t\t{ID: Ptr(int64(43)), NodeID: Ptr(\"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\"), Name: Ptr(\"Hello-World\"), FullName: Ptr(\"octocat/Hello-World\")},\n\t\t},\n\t}\n\tif !cmp.Equal(groups, want) {\n\t\tt.Errorf(\"Actions.ListRepositoryAccessRunnerGroup returned %+v, want %+v\", groups, want)\n\t}\n\n\tconst methodName = \"ListRepositoryAccessRunnerGroup\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListRepositoryAccessRunnerGroup(ctx, \"\\n\", 2, opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListRepositoryAccessRunnerGroup(ctx, \"o\", 2, opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_SetRepositoryAccessRunnerGroup(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/runner-groups/2/repositories\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t})\n\n\treq := SetRepoAccessRunnerGroupRequest{\n\t\tSelectedRepositoryIDs: []int64{\n\t\t\t1,\n\t\t\t2,\n\t\t},\n\t}\n\n\tctx := t.Context()\n\t_, err := client.Actions.SetRepositoryAccessRunnerGroup(ctx, \"o\", 2, req)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.SetRepositoryAccessRunnerGroup returned error: %v\", err)\n\t}\n\n\tconst methodName = \"SetRepositoryAccessRunnerGroup\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.SetRepositoryAccessRunnerGroup(ctx, \"\\n\", 2, req)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.SetRepositoryAccessRunnerGroup(ctx, \"o\", 2, req)\n\t})\n}\n\nfunc TestActionsService_AddRepositoryAccessRunnerGroup(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/runner-groups/2/repositories/42\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.AddRepositoryAccessRunnerGroup(ctx, \"o\", 2, 42)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.AddRepositoryAccessRunnerGroup returned error: %v\", err)\n\t}\n\n\tconst methodName = \"AddRepositoryAccessRunnerGroup\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.AddRepositoryAccessRunnerGroup(ctx, \"\\n\", 2, 42)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.AddRepositoryAccessRunnerGroup(ctx, \"o\", 2, 42)\n\t})\n}\n\nfunc TestActionsService_RemoveRepositoryAccessRunnerGroup(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/runner-groups/2/repositories/42\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.RemoveRepositoryAccessRunnerGroup(ctx, \"o\", 2, 42)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.RemoveRepositoryAccessRunnerGroup returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveRepositoryAccessRunnerGroup\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.RemoveRepositoryAccessRunnerGroup(ctx, \"\\n\", 2, 42)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.RemoveRepositoryAccessRunnerGroup(ctx, \"o\", 2, 42)\n\t})\n}\n\nfunc TestActionsService_ListRunnerGroupHostedRunners(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/runner-groups/2/hosted-runners\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `{\n\t\t\t\"total_count\": 2,\n\t\t\t\"runners\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": 5,\n\t\t\t\t\t\"name\": \"My hosted ubuntu runner\",\n\t\t\t\t\t\"runner_group_id\": 2,\n\t\t\t\t\t\"platform\": \"linux-x64\",\n\t\t\t\t\t\"image_details\": {\n\t\t\t\t\t\t\"id\": \"ubuntu-20.04\",\n\t\t\t\t\t\t\"size_gb\": 86\n\t\t\t\t\t},\n\t\t\t\t\t\"machine_size_details\": {\n\t\t\t\t\t\t\"id\": \"4-core\",\n\t\t\t\t\t\t\"cpu_cores\": 4,\n\t\t\t\t\t\t\"memory_gb\": 16,\n\t\t\t\t\t\t\"storage_gb\": 150\n\t\t\t\t\t},\n\t\t\t\t\t\"status\": \"Ready\",\n\t\t\t\t\t\"maximum_runners\": 10,\n\t\t\t\t\t\"public_ip_enabled\": true,\n\t\t\t\t\t\"public_ips\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"enabled\": true,\n\t\t\t\t\t\t\t\"prefix\": \"20.80.208.150\",\n\t\t\t\t\t\t\t\"length\": 31\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"last_active_on\": \"2023-04-26T15:23:37Z\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"id\": 7,\n\t\t\t\t\t\"name\": \"My hosted Windows runner\",\n\t\t\t\t\t\"runner_group_id\": 2,\n\t\t\t\t\t\"platform\": \"win-x64\",\n\t\t\t\t\t\"image_details\": {\n\t\t\t\t\t\t\"id\": \"windows-latest\",\n\t\t\t\t\t\t\"size_gb\": 256\n\t\t\t\t\t},\n\t\t\t\t\t\"machine_size_details\": {\n\t\t\t\t\t\t\"id\": \"8-core\",\n\t\t\t\t\t\t\"cpu_cores\": 8,\n\t\t\t\t\t\t\"memory_gb\": 32,\n\t\t\t\t\t\t\"storage_gb\": 300\n\t\t\t\t\t},\n\t\t\t\t\t\"status\": \"Ready\",\n\t\t\t\t\t\"maximum_runners\": 20,\n\t\t\t\t\t\"public_ip_enabled\": false,\n\t\t\t\t\t\"public_ips\": [],\n\t\t\t\t\t\"last_active_on\": \"2023-04-26T15:23:37Z\"\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\n\topts := &ListOptions{Page: 2, PerPage: 2}\n\tctx := t.Context()\n\trunners, _, err := client.Actions.ListRunnerGroupHostedRunners(ctx, \"o\", 2, opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListRunnerGroupHostedRunners returned error: %v\", err)\n\t}\n\n\tlastActiveOn := Timestamp{time.Date(2023, 4, 26, 15, 23, 37, 0, time.UTC)}\n\n\twant := &HostedRunners{\n\t\tTotalCount: 2,\n\t\tRunners: []*HostedRunner{\n\t\t\t{\n\t\t\t\tID:            Ptr(int64(5)),\n\t\t\t\tName:          Ptr(\"My hosted ubuntu runner\"),\n\t\t\t\tRunnerGroupID: Ptr(int64(2)),\n\t\t\t\tPlatform:      Ptr(\"linux-x64\"),\n\t\t\t\tImageDetails: &HostedRunnerImageDetail{\n\t\t\t\t\tID:     Ptr(\"ubuntu-20.04\"),\n\t\t\t\t\tSizeGB: Ptr(int64(86)),\n\t\t\t\t},\n\t\t\t\tMachineSizeDetails: &HostedRunnerMachineSpec{\n\t\t\t\t\tID:        \"4-core\",\n\t\t\t\t\tCPUCores:  4,\n\t\t\t\t\tMemoryGB:  16,\n\t\t\t\t\tStorageGB: 150,\n\t\t\t\t},\n\t\t\t\tStatus:          Ptr(\"Ready\"),\n\t\t\t\tMaximumRunners:  Ptr(int64(10)),\n\t\t\t\tPublicIPEnabled: Ptr(true),\n\t\t\t\tPublicIPs: []*HostedRunnerPublicIP{\n\t\t\t\t\t{\n\t\t\t\t\t\tEnabled: true,\n\t\t\t\t\t\tPrefix:  \"20.80.208.150\",\n\t\t\t\t\t\tLength:  31,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tLastActiveOn: Ptr(lastActiveOn),\n\t\t\t},\n\t\t\t{\n\t\t\t\tID:            Ptr(int64(7)),\n\t\t\t\tName:          Ptr(\"My hosted Windows runner\"),\n\t\t\t\tRunnerGroupID: Ptr(int64(2)),\n\t\t\t\tPlatform:      Ptr(\"win-x64\"),\n\t\t\t\tImageDetails: &HostedRunnerImageDetail{\n\t\t\t\t\tID:     Ptr(\"windows-latest\"),\n\t\t\t\t\tSizeGB: Ptr(int64(256)),\n\t\t\t\t},\n\t\t\t\tMachineSizeDetails: &HostedRunnerMachineSpec{\n\t\t\t\t\tID:        \"8-core\",\n\t\t\t\t\tCPUCores:  8,\n\t\t\t\t\tMemoryGB:  32,\n\t\t\t\t\tStorageGB: 300,\n\t\t\t\t},\n\t\t\t\tStatus:          Ptr(\"Ready\"),\n\t\t\t\tMaximumRunners:  Ptr(int64(20)),\n\t\t\t\tPublicIPEnabled: Ptr(false),\n\t\t\t\tPublicIPs:       []*HostedRunnerPublicIP{},\n\t\t\t\tLastActiveOn:    Ptr(lastActiveOn),\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(runners, want) {\n\t\tt.Errorf(\"Actions.ListRunnerGroupHostedRunners returned %+v, want %+v\", runners, want)\n\t}\n\n\tconst methodName = \"ListRunnerGroupHostedRunners\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListRunnerGroupHostedRunners(ctx, \"\\n\", 2, opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListRunnerGroupHostedRunners(ctx, \"o\", 2, opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_ListRunnerGroupRunners(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/runner-groups/2/runners\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `{\"total_count\":2,\"runners\":[{\"id\":23,\"name\":\"MBP\",\"os\":\"macos\",\"status\":\"online\"},{\"id\":24,\"name\":\"iMac\",\"os\":\"macos\",\"status\":\"offline\"}]}`)\n\t})\n\n\topts := &ListOptions{Page: 2, PerPage: 2}\n\tctx := t.Context()\n\trunners, _, err := client.Actions.ListRunnerGroupRunners(ctx, \"o\", 2, opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListRunnerGroupRunners returned error: %v\", err)\n\t}\n\n\twant := &Runners{\n\t\tTotalCount: 2,\n\t\tRunners: []*Runner{\n\t\t\t{ID: Ptr(int64(23)), Name: Ptr(\"MBP\"), OS: Ptr(\"macos\"), Status: Ptr(\"online\")},\n\t\t\t{ID: Ptr(int64(24)), Name: Ptr(\"iMac\"), OS: Ptr(\"macos\"), Status: Ptr(\"offline\")},\n\t\t},\n\t}\n\tif !cmp.Equal(runners, want) {\n\t\tt.Errorf(\"Actions.ListRunnerGroupRunners returned %+v, want %+v\", runners, want)\n\t}\n\n\tconst methodName = \"ListRunnerGroupRunners\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListRunnerGroupRunners(ctx, \"\\n\", 2, opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListRunnerGroupRunners(ctx, \"o\", 2, opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_SetRunnerGroupRunners(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/runner-groups/2/runners\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t})\n\n\treq := SetRunnerGroupRunnersRequest{\n\t\tRunners: []int64{\n\t\t\t1,\n\t\t\t2,\n\t\t},\n\t}\n\n\tctx := t.Context()\n\t_, err := client.Actions.SetRunnerGroupRunners(ctx, \"o\", 2, req)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.SetRunnerGroupRunners returned error: %v\", err)\n\t}\n\n\tconst methodName = \"SetRunnerGroupRunners\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.SetRunnerGroupRunners(ctx, \"\\n\", 2, req)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.SetRunnerGroupRunners(ctx, \"o\", 2, req)\n\t})\n}\n\nfunc TestActionsService_AddRunnerGroupRunners(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/runner-groups/2/runners/42\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.AddRunnerGroupRunners(ctx, \"o\", 2, 42)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.AddRunnerGroupRunners returned error: %v\", err)\n\t}\n\n\tconst methodName = \"AddRunnerGroupRunners\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.AddRunnerGroupRunners(ctx, \"\\n\", 2, 42)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.AddRunnerGroupRunners(ctx, \"o\", 2, 42)\n\t})\n}\n\nfunc TestActionsService_RemoveRunnerGroupRunners(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/runner-groups/2/runners/42\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.RemoveRunnerGroupRunners(ctx, \"o\", 2, 42)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.RemoveRunnerGroupRunners returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveRunnerGroupRunners\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.RemoveRunnerGroupRunners(ctx, \"\\n\", 2, 42)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.RemoveRunnerGroupRunners(ctx, \"o\", 2, 42)\n\t})\n}\n\nfunc TestRunnerGroup_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RunnerGroup{}, \"{}\")\n\n\tu := &RunnerGroup{\n\t\tID:                       Ptr(int64(1)),\n\t\tName:                     Ptr(\"n\"),\n\t\tVisibility:               Ptr(\"v\"),\n\t\tDefault:                  Ptr(true),\n\t\tSelectedRepositoriesURL:  Ptr(\"s\"),\n\t\tRunnersURL:               Ptr(\"r\"),\n\t\tHostedRunnersURL:         Ptr(\"h\"),\n\t\tNetworkConfigurationID:   Ptr(\"nc\"),\n\t\tInherited:                Ptr(true),\n\t\tAllowsPublicRepositories: Ptr(true),\n\t\tRestrictedToWorkflows:    Ptr(false),\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"name\": \"n\",\n\t\t\"visibility\": \"v\",\n\t\t\"default\": true,\n\t\t\"selected_repositories_url\": \"s\",\n\t\t\"runners_url\": \"r\",\n\t\t\"hosted_runners_url\": \"h\",\n\t\t\"network_configuration_id\": \"nc\",\n\t\t\"inherited\": true,\n\t\t\"allows_public_repositories\": true,\n\t\t\"restricted_to_workflows\": false\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestRunnerGroups_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RunnerGroups{}, `{\n\t\t\"total_count\": 0,\n\t\t\"runner_groups\": null\n\t}`)\n\n\tu := &RunnerGroups{\n\t\tTotalCount: int(1),\n\t\tRunnerGroups: []*RunnerGroup{\n\t\t\t{\n\t\t\t\tID:                       Ptr(int64(1)),\n\t\t\t\tName:                     Ptr(\"n\"),\n\t\t\t\tVisibility:               Ptr(\"v\"),\n\t\t\t\tDefault:                  Ptr(true),\n\t\t\t\tSelectedRepositoriesURL:  Ptr(\"s\"),\n\t\t\t\tRunnersURL:               Ptr(\"r\"),\n\t\t\t\tHostedRunnersURL:         Ptr(\"h\"),\n\t\t\t\tNetworkConfigurationID:   Ptr(\"nc\"),\n\t\t\t\tInherited:                Ptr(true),\n\t\t\t\tAllowsPublicRepositories: Ptr(true),\n\t\t\t\tRestrictedToWorkflows:    Ptr(false),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"total_count\": 1,\n\t\t\"runner_groups\": [{\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"visibility\": \"v\",\n\t\t\t\"default\": true,\n\t\t\t\"selected_repositories_url\": \"s\",\n\t\t\t\"runners_url\": \"r\",\n\t\t\t\"hosted_runners_url\": \"h\",\n\t\t\t\"network_configuration_id\": \"nc\",\n\t\t\t\"inherited\": true,\n\t\t\t\"allows_public_repositories\": true,\n\t\t\t\"restricted_to_workflows\": false\n\t\t}]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestCreateRunnerGroupRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CreateRunnerGroupRequest{}, \"{}\")\n\n\tu := &CreateRunnerGroupRequest{\n\t\tName:                     Ptr(\"n\"),\n\t\tVisibility:               Ptr(\"v\"),\n\t\tSelectedRepositoryIDs:    []int64{1},\n\t\tRunners:                  []int64{1},\n\t\tAllowsPublicRepositories: Ptr(true),\n\t\tRestrictedToWorkflows:    Ptr(true),\n\t\tSelectedWorkflows:        []string{\"a\", \"b\"},\n\t\tNetworkConfigurationID:   Ptr(\"nc\"),\n\t}\n\n\twant := `{\n\t\t\"name\": \"n\",\n\t\t\"visibility\": \"v\",\n\t\t\"selected_repository_ids\": [1],\n\t\t\"runners\": [1],\n\t\t\"allows_public_repositories\": true,\n\t\t\"restricted_to_workflows\": true,\n\t\t\"selected_workflows\": [\"a\",\"b\"],\n\t\t\"network_configuration_id\": \"nc\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestUpdateRunnerGroupRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &UpdateRunnerGroupRequest{}, \"{}\")\n\n\tu := &UpdateRunnerGroupRequest{\n\t\tName:                     Ptr(\"n\"),\n\t\tVisibility:               Ptr(\"v\"),\n\t\tAllowsPublicRepositories: Ptr(true),\n\t\tRestrictedToWorkflows:    Ptr(false),\n\t\tNetworkConfigurationID:   Ptr(\"nc\"),\n\t}\n\n\twant := `{\n\t\t\"name\": \"n\",\n\t\t\"visibility\": \"v\",\n\t\t\"allows_public_repositories\": true,\n\t\t\"restricted_to_workflows\": false,\n\t\t\"network_configuration_id\": \"nc\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestSetRepoAccessRunnerGroupRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SetRepoAccessRunnerGroupRequest{}, `{\"selected_repository_ids\": null}`)\n\n\tu := &SetRepoAccessRunnerGroupRequest{\n\t\tSelectedRepositoryIDs: []int64{1},\n\t}\n\n\twant := `{\n\t\t\"selected_repository_ids\": [1]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestSetRunnerGroupRunnersRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SetRunnerGroupRunnersRequest{}, `{\"runners\": null}`)\n\n\tu := &SetRunnerGroupRunnersRequest{\n\t\tRunners: []int64{1},\n\t}\n\n\twant := `{\n\t\t\"runners\": [1]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/actions_runners.go",
    "content": "// Copyright 2020 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// RunnerApplicationDownload represents a binary for the self-hosted runner application that can be downloaded.\ntype RunnerApplicationDownload struct {\n\tOS                *string `json:\"os,omitempty\"`\n\tArchitecture      *string `json:\"architecture,omitempty\"`\n\tDownloadURL       *string `json:\"download_url,omitempty\"`\n\tFilename          *string `json:\"filename,omitempty\"`\n\tTempDownloadToken *string `json:\"temp_download_token,omitempty\"`\n\tSHA256Checksum    *string `json:\"sha256_checksum,omitempty\"`\n}\n\n// ListRunnerApplicationDownloads lists self-hosted runner application binaries that can be downloaded and run.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/runners/downloads\nfunc (s *ActionsService) ListRunnerApplicationDownloads(ctx context.Context, owner, repo string) ([]*RunnerApplicationDownload, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/runners/downloads\", owner, repo)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar rads []*RunnerApplicationDownload\n\tresp, err := s.client.Do(ctx, req, &rads)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn rads, resp, nil\n}\n\n// GenerateJITConfigRequest specifies body parameters to GenerateRepoJITConfig.\ntype GenerateJITConfigRequest struct {\n\tName          string  `json:\"name\"`\n\tRunnerGroupID int64   `json:\"runner_group_id\"`\n\tWorkFolder    *string `json:\"work_folder,omitempty\"`\n\n\t// Labels represents the names of the custom labels to add to the runner.\n\t// Minimum items: 1. Maximum items: 100.\n\tLabels []string `json:\"labels\"`\n}\n\n// JITRunnerConfig represents encoded JIT configuration that can be used to bootstrap a self-hosted runner.\ntype JITRunnerConfig struct {\n\tRunner           *Runner `json:\"runner,omitempty\"`\n\tEncodedJITConfig *string `json:\"encoded_jit_config,omitempty\"`\n}\n\n// GenerateOrgJITConfig generate a just-in-time configuration for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-organization\n//\n//meta:operation POST /orgs/{org}/actions/runners/generate-jitconfig\nfunc (s *ActionsService) GenerateOrgJITConfig(ctx context.Context, org string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/runners/generate-jitconfig\", org)\n\treq, err := s.client.NewRequest(\"POST\", u, request)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar jitConfig *JITRunnerConfig\n\tresp, err := s.client.Do(ctx, req, &jitConfig)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn jitConfig, resp, nil\n}\n\n// GenerateRepoJITConfig generates a just-in-time configuration for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-a-repository\n//\n//meta:operation POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig\nfunc (s *ActionsService) GenerateRepoJITConfig(ctx context.Context, owner, repo string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/runners/generate-jitconfig\", owner, repo)\n\treq, err := s.client.NewRequest(\"POST\", u, request)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar jitConfig *JITRunnerConfig\n\tresp, err := s.client.Do(ctx, req, &jitConfig)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn jitConfig, resp, nil\n}\n\n// RegistrationToken represents a token that can be used to add a self-hosted runner to a repository.\ntype RegistrationToken struct {\n\tToken     *string    `json:\"token,omitempty\"`\n\tExpiresAt *Timestamp `json:\"expires_at,omitempty\"`\n}\n\n// CreateRegistrationToken creates a token that can be used to add a self-hosted runner.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-a-repository\n//\n//meta:operation POST /repos/{owner}/{repo}/actions/runners/registration-token\nfunc (s *ActionsService) CreateRegistrationToken(ctx context.Context, owner, repo string) (*RegistrationToken, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/runners/registration-token\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar registrationToken *RegistrationToken\n\tresp, err := s.client.Do(ctx, req, &registrationToken)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn registrationToken, resp, nil\n}\n\n// Runner represents a self-hosted runner registered with a repository.\ntype Runner struct {\n\tID     *int64          `json:\"id,omitempty\"`\n\tName   *string         `json:\"name,omitempty\"`\n\tOS     *string         `json:\"os,omitempty\"`\n\tStatus *string         `json:\"status,omitempty\"`\n\tBusy   *bool           `json:\"busy,omitempty\"`\n\tLabels []*RunnerLabels `json:\"labels,omitempty\"`\n}\n\n// RunnerLabels represents a collection of labels attached to each runner.\ntype RunnerLabels struct {\n\tID   *int64  `json:\"id,omitempty\"`\n\tName *string `json:\"name,omitempty\"`\n\tType *string `json:\"type,omitempty\"`\n}\n\n// Runners represents a collection of self-hosted runners for a repository.\ntype Runners struct {\n\tTotalCount int       `json:\"total_count\"`\n\tRunners    []*Runner `json:\"runners\"`\n}\n\n// ListRunnersOptions specifies the optional parameters to the ListRunners and ListOrganizationRunners methods.\ntype ListRunnersOptions struct {\n\tName *string `url:\"name,omitempty\"`\n\tListOptions\n}\n\n// ListRunners lists all the self-hosted runners for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/runners\nfunc (s *ActionsService) ListRunners(ctx context.Context, owner, repo string, opts *ListRunnersOptions) (*Runners, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/runners\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar runners *Runners\n\tresp, err := s.client.Do(ctx, req, &runners)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn runners, resp, nil\n}\n\n// GetRunner gets a specific self-hosted runner for a repository using its runner ID.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/runners/{runner_id}\nfunc (s *ActionsService) GetRunner(ctx context.Context, owner, repo string, runnerID int64) (*Runner, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/runners/%v\", owner, repo, runnerID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar runner *Runner\n\tresp, err := s.client.Do(ctx, req, &runner)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn runner, resp, nil\n}\n\n// RemoveToken represents a token that can be used to remove a self-hosted runner from a repository.\ntype RemoveToken struct {\n\tToken     *string    `json:\"token,omitempty\"`\n\tExpiresAt *Timestamp `json:\"expires_at,omitempty\"`\n}\n\n// CreateRemoveToken creates a token that can be used to remove a self-hosted runner from a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-a-repository\n//\n//meta:operation POST /repos/{owner}/{repo}/actions/runners/remove-token\nfunc (s *ActionsService) CreateRemoveToken(ctx context.Context, owner, repo string) (*RemoveToken, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/runners/remove-token\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar removeToken *RemoveToken\n\tresp, err := s.client.Do(ctx, req, &removeToken)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn removeToken, resp, nil\n}\n\n// RemoveRunner forces the removal of a self-hosted runner in a repository using the runner id.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-a-repository\n//\n//meta:operation DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}\nfunc (s *ActionsService) RemoveRunner(ctx context.Context, owner, repo string, runnerID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/runners/%v\", owner, repo, runnerID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// ListOrganizationRunnerApplicationDownloads lists self-hosted runner application binaries that can be downloaded and run.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/runners/downloads\nfunc (s *ActionsService) ListOrganizationRunnerApplicationDownloads(ctx context.Context, org string) ([]*RunnerApplicationDownload, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/runners/downloads\", org)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar rads []*RunnerApplicationDownload\n\tresp, err := s.client.Do(ctx, req, &rads)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn rads, resp, nil\n}\n\n// CreateOrganizationRegistrationToken creates a token that can be used to add a self-hosted runner to an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization\n//\n//meta:operation POST /orgs/{org}/actions/runners/registration-token\nfunc (s *ActionsService) CreateOrganizationRegistrationToken(ctx context.Context, org string) (*RegistrationToken, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/runners/registration-token\", org)\n\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar registrationToken *RegistrationToken\n\tresp, err := s.client.Do(ctx, req, &registrationToken)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn registrationToken, resp, nil\n}\n\n// ListOrganizationRunners lists all the self-hosted runners for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/runners\nfunc (s *ActionsService) ListOrganizationRunners(ctx context.Context, org string, opts *ListRunnersOptions) (*Runners, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/runners\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar runners *Runners\n\tresp, err := s.client.Do(ctx, req, &runners)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn runners, resp, nil\n}\n\n// GetOrganizationRunner gets a specific self-hosted runner for an organization using its runner ID.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/runners/{runner_id}\nfunc (s *ActionsService) GetOrganizationRunner(ctx context.Context, org string, runnerID int64) (*Runner, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/runners/%v\", org, runnerID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar runner *Runner\n\tresp, err := s.client.Do(ctx, req, &runner)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn runner, resp, nil\n}\n\n// CreateOrganizationRemoveToken creates a token that can be used to remove a self-hosted runner from an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-an-organization\n//\n//meta:operation POST /orgs/{org}/actions/runners/remove-token\nfunc (s *ActionsService) CreateOrganizationRemoveToken(ctx context.Context, org string) (*RemoveToken, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/runners/remove-token\", org)\n\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar removeToken *RemoveToken\n\tresp, err := s.client.Do(ctx, req, &removeToken)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn removeToken, resp, nil\n}\n\n// RemoveOrganizationRunner forces the removal of a self-hosted runner from an organization using the runner id.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-organization\n//\n//meta:operation DELETE /orgs/{org}/actions/runners/{runner_id}\nfunc (s *ActionsService) RemoveOrganizationRunner(ctx context.Context, org string, runnerID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/actions/runners/%v\", org, runnerID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/actions_runners_test.go",
    "content": "// Copyright 2020 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestActionsService_ListRunnerApplicationDownloads(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/runners/downloads\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"os\":\"osx\",\"architecture\":\"x64\",\"download_url\":\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-osx-x64-2.164.0.tar.gz\",\"filename\":\"actions-runner-osx-x64-2.164.0.tar.gz\"},{\"os\":\"linux\",\"architecture\":\"x64\",\"download_url\":\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-x64-2.164.0.tar.gz\",\"filename\":\"actions-runner-linux-x64-2.164.0.tar.gz\"},{\"os\": \"linux\",\"architecture\":\"arm\",\"download_url\":\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm-2.164.0.tar.gz\",\"filename\":\"actions-runner-linux-arm-2.164.0.tar.gz\"},{\"os\":\"win\",\"architecture\":\"x64\",\"download_url\":\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-win-x64-2.164.0.zip\",\"filename\":\"actions-runner-win-x64-2.164.0.zip\"},{\"os\":\"linux\",\"architecture\":\"arm64\",\"download_url\":\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm64-2.164.0.tar.gz\",\"filename\":\"actions-runner-linux-arm64-2.164.0.tar.gz\"}]`)\n\t})\n\n\tctx := t.Context()\n\tdownloads, _, err := client.Actions.ListRunnerApplicationDownloads(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListRunnerApplicationDownloads returned error: %v\", err)\n\t}\n\n\twant := []*RunnerApplicationDownload{\n\t\t{OS: Ptr(\"osx\"), Architecture: Ptr(\"x64\"), DownloadURL: Ptr(\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-osx-x64-2.164.0.tar.gz\"), Filename: Ptr(\"actions-runner-osx-x64-2.164.0.tar.gz\")},\n\t\t{OS: Ptr(\"linux\"), Architecture: Ptr(\"x64\"), DownloadURL: Ptr(\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-x64-2.164.0.tar.gz\"), Filename: Ptr(\"actions-runner-linux-x64-2.164.0.tar.gz\")},\n\t\t{OS: Ptr(\"linux\"), Architecture: Ptr(\"arm\"), DownloadURL: Ptr(\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm-2.164.0.tar.gz\"), Filename: Ptr(\"actions-runner-linux-arm-2.164.0.tar.gz\")},\n\t\t{OS: Ptr(\"win\"), Architecture: Ptr(\"x64\"), DownloadURL: Ptr(\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-win-x64-2.164.0.zip\"), Filename: Ptr(\"actions-runner-win-x64-2.164.0.zip\")},\n\t\t{OS: Ptr(\"linux\"), Architecture: Ptr(\"arm64\"), DownloadURL: Ptr(\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm64-2.164.0.tar.gz\"), Filename: Ptr(\"actions-runner-linux-arm64-2.164.0.tar.gz\")},\n\t}\n\tif !cmp.Equal(downloads, want) {\n\t\tt.Errorf(\"Actions.ListRunnerApplicationDownloads returned %+v, want %+v\", downloads, want)\n\t}\n\n\tconst methodName = \"ListRunnerApplicationDownloads\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListRunnerApplicationDownloads(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListRunnerApplicationDownloads(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GenerateOrgJITConfig(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &GenerateJITConfigRequest{Name: \"test\", RunnerGroupID: 1, Labels: []string{\"one\", \"two\"}}\n\n\tmux.HandleFunc(\"/orgs/o/actions/runners/generate-jitconfig\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *GenerateJITConfigRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"encoded_jit_config\":\"foo\"}`)\n\t})\n\n\tctx := t.Context()\n\tjitConfig, _, err := client.Actions.GenerateOrgJITConfig(ctx, \"o\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GenerateOrgJITConfig returned error: %v\", err)\n\t}\n\n\twant := &JITRunnerConfig{EncodedJITConfig: Ptr(\"foo\")}\n\tif !cmp.Equal(jitConfig, want) {\n\t\tt.Errorf(\"Actions.GenerateOrgJITConfig returned %+v, want %+v\", jitConfig, want)\n\t}\n\n\tconst methodName = \"GenerateOrgJITConfig\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GenerateOrgJITConfig(ctx, \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GenerateOrgJITConfig(ctx, \"o\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GenerateRepoJITConfig(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &GenerateJITConfigRequest{Name: \"test\", RunnerGroupID: 1, Labels: []string{\"one\", \"two\"}}\n\n\tmux.HandleFunc(\"/repos/o/r/actions/runners/generate-jitconfig\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *GenerateJITConfigRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"encoded_jit_config\":\"foo\"}`)\n\t})\n\n\tctx := t.Context()\n\tjitConfig, _, err := client.Actions.GenerateRepoJITConfig(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GenerateRepoJITConfig returned error: %v\", err)\n\t}\n\n\twant := &JITRunnerConfig{EncodedJITConfig: Ptr(\"foo\")}\n\tif !cmp.Equal(jitConfig, want) {\n\t\tt.Errorf(\"Actions.GenerateRepoJITConfig returned %+v, want %+v\", jitConfig, want)\n\t}\n\n\tconst methodName = \"GenerateRepoJITConfig\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GenerateRepoJITConfig(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GenerateRepoJITConfig(ctx, \"o\", \"r\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_CreateRegistrationToken(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/runners/registration-token\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\"token\":\"LLBF3JGZDX3P5PMEXLND6TS6FCWO6\",\"expires_at\":\"2020-01-22T12:13:35.123Z\"}`)\n\t})\n\n\tctx := t.Context()\n\ttoken, _, err := client.Actions.CreateRegistrationToken(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.CreateRegistrationToken returned error: %v\", err)\n\t}\n\n\twant := &RegistrationToken{\n\t\tToken: Ptr(\"LLBF3JGZDX3P5PMEXLND6TS6FCWO6\"),\n\t\tExpiresAt: &Timestamp{time.Date(2020, time.January, 22, 12, 13, 35,\n\t\t\t123000000, time.UTC)},\n\t}\n\tif !cmp.Equal(token, want) {\n\t\tt.Errorf(\"Actions.CreateRegistrationToken returned %+v, want %+v\", token, want)\n\t}\n\n\tconst methodName = \"CreateRegistrationToken\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.CreateRegistrationToken(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.CreateRegistrationToken(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_ListRunners(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/runners\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"name\": \"MBP\", \"per_page\": \"2\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `{\"total_count\":1,\"runners\":[{\"id\":23,\"name\":\"MBP\",\"os\":\"macos\",\"status\":\"online\"}]}`)\n\t})\n\n\topts := &ListRunnersOptions{\n\t\tName:        Ptr(\"MBP\"),\n\t\tListOptions: ListOptions{Page: 2, PerPage: 2},\n\t}\n\tctx := t.Context()\n\trunners, _, err := client.Actions.ListRunners(ctx, \"o\", \"r\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListRunners returned error: %v\", err)\n\t}\n\n\twant := &Runners{\n\t\tTotalCount: 1,\n\t\tRunners: []*Runner{\n\t\t\t{ID: Ptr(int64(23)), Name: Ptr(\"MBP\"), OS: Ptr(\"macos\"), Status: Ptr(\"online\")},\n\t\t},\n\t}\n\tif !cmp.Equal(runners, want) {\n\t\tt.Errorf(\"Actions.ListRunners returned %+v, want %+v\", runners, want)\n\t}\n\n\tconst methodName = \"ListRunners\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListRunners(ctx, \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListRunners(ctx, \"o\", \"r\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetRunner(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/runners/23\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":23,\"name\":\"MBP\",\"os\":\"macos\",\"status\":\"online\"}`)\n\t})\n\n\tctx := t.Context()\n\trunner, _, err := client.Actions.GetRunner(ctx, \"o\", \"r\", 23)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetRunner returned error: %v\", err)\n\t}\n\n\twant := &Runner{\n\t\tID:     Ptr(int64(23)),\n\t\tName:   Ptr(\"MBP\"),\n\t\tOS:     Ptr(\"macos\"),\n\t\tStatus: Ptr(\"online\"),\n\t}\n\tif !cmp.Equal(runner, want) {\n\t\tt.Errorf(\"Actions.GetRunner returned %+v, want %+v\", runner, want)\n\t}\n\n\tconst methodName = \"GetRunner\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetRunner(ctx, \"\\n\", \"\\n\", 23)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetRunner(ctx, \"o\", \"r\", 23)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_CreateRemoveToken(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/runners/remove-token\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\"token\":\"AABF3JGZDX3P5PMEXLND6TS6FCWO6\",\"expires_at\":\"2020-01-29T12:13:35.123Z\"}`)\n\t})\n\n\tctx := t.Context()\n\ttoken, _, err := client.Actions.CreateRemoveToken(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.CreateRemoveToken returned error: %v\", err)\n\t}\n\n\twant := &RemoveToken{Token: Ptr(\"AABF3JGZDX3P5PMEXLND6TS6FCWO6\"), ExpiresAt: &Timestamp{time.Date(2020, time.January, 29, 12, 13, 35, 123000000, time.UTC)}}\n\tif !cmp.Equal(token, want) {\n\t\tt.Errorf(\"Actions.CreateRemoveToken returned %+v, want %+v\", token, want)\n\t}\n\n\tconst methodName = \"CreateRemoveToken\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.CreateRemoveToken(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.CreateRemoveToken(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_RemoveRunner(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/runners/21\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.RemoveRunner(ctx, \"o\", \"r\", 21)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.RemoveRunner returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveRunner\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.RemoveRunner(ctx, \"\\n\", \"\\n\", 21)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.RemoveRunner(ctx, \"o\", \"r\", 21)\n\t})\n}\n\nfunc TestActionsService_ListOrganizationRunnerApplicationDownloads(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/runners/downloads\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"os\":\"osx\",\"architecture\":\"x64\",\"download_url\":\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-osx-x64-2.164.0.tar.gz\",\"filename\":\"actions-runner-osx-x64-2.164.0.tar.gz\"},{\"os\":\"linux\",\"architecture\":\"x64\",\"download_url\":\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-x64-2.164.0.tar.gz\",\"filename\":\"actions-runner-linux-x64-2.164.0.tar.gz\"},{\"os\": \"linux\",\"architecture\":\"arm\",\"download_url\":\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm-2.164.0.tar.gz\",\"filename\":\"actions-runner-linux-arm-2.164.0.tar.gz\"},{\"os\":\"win\",\"architecture\":\"x64\",\"download_url\":\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-win-x64-2.164.0.zip\",\"filename\":\"actions-runner-win-x64-2.164.0.zip\"},{\"os\":\"linux\",\"architecture\":\"arm64\",\"download_url\":\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm64-2.164.0.tar.gz\",\"filename\":\"actions-runner-linux-arm64-2.164.0.tar.gz\"}]`)\n\t})\n\n\tctx := t.Context()\n\tdownloads, _, err := client.Actions.ListOrganizationRunnerApplicationDownloads(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListRunnerApplicationDownloads returned error: %v\", err)\n\t}\n\n\twant := []*RunnerApplicationDownload{\n\t\t{OS: Ptr(\"osx\"), Architecture: Ptr(\"x64\"), DownloadURL: Ptr(\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-osx-x64-2.164.0.tar.gz\"), Filename: Ptr(\"actions-runner-osx-x64-2.164.0.tar.gz\")},\n\t\t{OS: Ptr(\"linux\"), Architecture: Ptr(\"x64\"), DownloadURL: Ptr(\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-x64-2.164.0.tar.gz\"), Filename: Ptr(\"actions-runner-linux-x64-2.164.0.tar.gz\")},\n\t\t{OS: Ptr(\"linux\"), Architecture: Ptr(\"arm\"), DownloadURL: Ptr(\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm-2.164.0.tar.gz\"), Filename: Ptr(\"actions-runner-linux-arm-2.164.0.tar.gz\")},\n\t\t{OS: Ptr(\"win\"), Architecture: Ptr(\"x64\"), DownloadURL: Ptr(\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-win-x64-2.164.0.zip\"), Filename: Ptr(\"actions-runner-win-x64-2.164.0.zip\")},\n\t\t{OS: Ptr(\"linux\"), Architecture: Ptr(\"arm64\"), DownloadURL: Ptr(\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm64-2.164.0.tar.gz\"), Filename: Ptr(\"actions-runner-linux-arm64-2.164.0.tar.gz\")},\n\t}\n\tif !cmp.Equal(downloads, want) {\n\t\tt.Errorf(\"Actions.ListOrganizationRunnerApplicationDownloads returned %+v, want %+v\", downloads, want)\n\t}\n\n\tconst methodName = \"ListOrganizationRunnerApplicationDownloads\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListOrganizationRunnerApplicationDownloads(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListOrganizationRunnerApplicationDownloads(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_CreateOrganizationRegistrationToken(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/runners/registration-token\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\"token\":\"LLBF3JGZDX3P5PMEXLND6TS6FCWO6\",\"expires_at\":\"2020-01-22T12:13:35.123Z\"}`)\n\t})\n\n\tctx := t.Context()\n\ttoken, _, err := client.Actions.CreateOrganizationRegistrationToken(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.CreateRegistrationToken returned error: %v\", err)\n\t}\n\n\twant := &RegistrationToken{\n\t\tToken: Ptr(\"LLBF3JGZDX3P5PMEXLND6TS6FCWO6\"),\n\t\tExpiresAt: &Timestamp{time.Date(2020, time.January, 22, 12, 13, 35,\n\t\t\t123000000, time.UTC)},\n\t}\n\tif !cmp.Equal(token, want) {\n\t\tt.Errorf(\"Actions.CreateRegistrationToken returned %+v, want %+v\", token, want)\n\t}\n\n\tconst methodName = \"CreateOrganizationRegistrationToken\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.CreateOrganizationRegistrationToken(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.CreateOrganizationRegistrationToken(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_ListOrganizationRunners(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/runners\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `{\"total_count\":2,\"runners\":[{\"id\":23,\"name\":\"MBP\",\"os\":\"macos\",\"status\":\"online\"},{\"id\":24,\"name\":\"iMac\",\"os\":\"macos\",\"status\":\"offline\"}]}`)\n\t})\n\n\topts := &ListRunnersOptions{\n\t\tListOptions: ListOptions{Page: 2, PerPage: 2},\n\t}\n\tctx := t.Context()\n\trunners, _, err := client.Actions.ListOrganizationRunners(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListRunners returned error: %v\", err)\n\t}\n\n\twant := &Runners{\n\t\tTotalCount: 2,\n\t\tRunners: []*Runner{\n\t\t\t{ID: Ptr(int64(23)), Name: Ptr(\"MBP\"), OS: Ptr(\"macos\"), Status: Ptr(\"online\")},\n\t\t\t{ID: Ptr(int64(24)), Name: Ptr(\"iMac\"), OS: Ptr(\"macos\"), Status: Ptr(\"offline\")},\n\t\t},\n\t}\n\tif !cmp.Equal(runners, want) {\n\t\tt.Errorf(\"Actions.ListRunners returned %+v, want %+v\", runners, want)\n\t}\n\n\tconst methodName = \"ListOrganizationRunners\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListOrganizationRunners(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListOrganizationRunners(ctx, \"o\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetOrganizationRunner(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/runners/23\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":23,\"name\":\"MBP\",\"os\":\"macos\",\"status\":\"online\"}`)\n\t})\n\n\tctx := t.Context()\n\trunner, _, err := client.Actions.GetOrganizationRunner(ctx, \"o\", 23)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetRunner returned error: %v\", err)\n\t}\n\n\twant := &Runner{\n\t\tID:     Ptr(int64(23)),\n\t\tName:   Ptr(\"MBP\"),\n\t\tOS:     Ptr(\"macos\"),\n\t\tStatus: Ptr(\"online\"),\n\t}\n\tif !cmp.Equal(runner, want) {\n\t\tt.Errorf(\"Actions.GetRunner returned %+v, want %+v\", runner, want)\n\t}\n\n\tconst methodName = \"GetOrganizationRunner\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetOrganizationRunner(ctx, \"\\n\", 23)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetOrganizationRunner(ctx, \"o\", 23)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_CreateOrganizationRemoveToken(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/runners/remove-token\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\"token\":\"AABF3JGZDX3P5PMEXLND6TS6FCWO6\",\"expires_at\":\"2020-01-29T12:13:35.123Z\"}`)\n\t})\n\n\tctx := t.Context()\n\ttoken, _, err := client.Actions.CreateOrganizationRemoveToken(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.CreateRemoveToken returned error: %v\", err)\n\t}\n\n\twant := &RemoveToken{Token: Ptr(\"AABF3JGZDX3P5PMEXLND6TS6FCWO6\"), ExpiresAt: &Timestamp{time.Date(2020, time.January, 29, 12, 13, 35, 123000000, time.UTC)}}\n\tif !cmp.Equal(token, want) {\n\t\tt.Errorf(\"Actions.CreateRemoveToken returned %+v, want %+v\", token, want)\n\t}\n\n\tconst methodName = \"CreateOrganizationRemoveToken\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.CreateOrganizationRemoveToken(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.CreateOrganizationRemoveToken(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_RemoveOrganizationRunner(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/runners/21\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.RemoveOrganizationRunner(ctx, \"o\", 21)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.RemoveOrganizationRunner returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveOrganizationRunner\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.RemoveOrganizationRunner(ctx, \"\\n\", 21)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.RemoveOrganizationRunner(ctx, \"o\", 21)\n\t})\n}\n\nfunc TestRunnerApplicationDownload_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RunnerApplicationDownload{}, \"{}\")\n\n\tu := &RunnerApplicationDownload{\n\t\tOS:                Ptr(\"o\"),\n\t\tArchitecture:      Ptr(\"a\"),\n\t\tDownloadURL:       Ptr(\"d\"),\n\t\tFilename:          Ptr(\"f\"),\n\t\tTempDownloadToken: Ptr(\"t\"),\n\t\tSHA256Checksum:    Ptr(\"s\"),\n\t}\n\n\twant := `{\n\t\t\"os\": \"o\",\n\t\t\"architecture\": \"a\",\n\t\t\"download_url\": \"d\",\n\t\t\"filename\": \"f\",\n\t\t\"temp_download_token\": \"t\",\n\t\t\"sha256_checksum\": \"s\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestActionsEnabledOnOrgRepos_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ActionsEnabledOnOrgRepos{}, `{\n\t\t\"repositories\": null,\n\t\t\"total_count\": 0\n\t}`)\n\n\tu := &ActionsEnabledOnOrgRepos{\n\t\tTotalCount: 1,\n\t\tRepositories: []*Repository{\n\t\t\t{\n\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\tURL:  Ptr(\"u\"),\n\t\t\t\tName: Ptr(\"n\"),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"total_count\": 1,\n\t\t\"repositories\": [\n\t\t\t{\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"name\": \"n\"\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestRegistrationToken_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RegistrationToken{}, \"{}\")\n\n\tu := &RegistrationToken{\n\t\tToken:     Ptr(\"t\"),\n\t\tExpiresAt: &Timestamp{referenceTime},\n\t}\n\n\twant := `{\n\t\t\"token\": \"t\",\n\t\t\"expires_at\": ` + referenceTimeStr + `\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestRunnerLabels_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RunnerLabels{}, \"{}\")\n\n\tu := &RunnerLabels{\n\t\tID:   Ptr(int64(1)),\n\t\tName: Ptr(\"n\"),\n\t\tType: Ptr(\"t\"),\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"name\": \"n\",\n\t\t\"type\": \"t\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestRunner_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Runner{}, \"{}\")\n\n\tu := &Runner{\n\t\tID:     Ptr(int64(1)),\n\t\tName:   Ptr(\"n\"),\n\t\tOS:     Ptr(\"o\"),\n\t\tStatus: Ptr(\"s\"),\n\t\tBusy:   Ptr(false),\n\t\tLabels: []*RunnerLabels{\n\t\t\t{\n\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\tType: Ptr(\"t\"),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"name\": \"n\",\n\t\t\"os\": \"o\",\n\t\t\"status\": \"s\",\n\t\t\"busy\": false,\n\t\t\"labels\": [\n\t\t\t{\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"type\": \"t\"\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestRunners_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Runners{}, `{\n\t\t\"runners\": null,\n\t\t\"total_count\": 0\n\t}`)\n\n\tu := &Runners{\n\t\tTotalCount: 1,\n\t\tRunners: []*Runner{\n\t\t\t{\n\t\t\t\tID:     Ptr(int64(1)),\n\t\t\t\tName:   Ptr(\"n\"),\n\t\t\t\tOS:     Ptr(\"o\"),\n\t\t\t\tStatus: Ptr(\"s\"),\n\t\t\t\tBusy:   Ptr(false),\n\t\t\t\tLabels: []*RunnerLabels{\n\t\t\t\t\t{\n\t\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t\t\tType: Ptr(\"t\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"total_count\": 1,\n\t\t\"runners\": [\n\t\t\t{\n\t\t\t\t\"id\": 1,\n\t\t\"name\": \"n\",\n\t\t\"os\": \"o\",\n\t\t\"status\": \"s\",\n\t\t\"busy\": false,\n\t\t\"labels\": [\n\t\t\t{\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"type\": \"t\"\n\t\t\t}\n\t\t]\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestRemoveToken_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RemoveToken{}, \"{}\")\n\n\tu := &RemoveToken{\n\t\tToken:     Ptr(\"t\"),\n\t\tExpiresAt: &Timestamp{referenceTime},\n\t}\n\n\twant := `{\n\t\t\"token\": \"t\",\n\t\t\"expires_at\": ` + referenceTimeStr + `\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/actions_secrets.go",
    "content": "// Copyright 2020 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"strconv\"\n)\n\n// PublicKey represents the public key that should be used to encrypt secrets.\ntype PublicKey struct {\n\tKeyID *string `json:\"key_id\"`\n\tKey   *string `json:\"key\"`\n}\n\n// UnmarshalJSON implements the json.Unmarshaler interface.\n// This ensures GitHub Enterprise versions which return a numeric key id\n// do not error out when unmarshaling.\nfunc (p *PublicKey) UnmarshalJSON(data []byte) error {\n\tvar pk struct {\n\t\tKeyID any     `json:\"key_id\"`\n\t\tKey   *string `json:\"key\"`\n\t}\n\n\tif err := json.Unmarshal(data, &pk); err != nil {\n\t\treturn err\n\t}\n\n\tp.Key = pk.Key\n\n\tswitch v := pk.KeyID.(type) {\n\tcase nil:\n\t\treturn nil\n\tcase string:\n\t\tp.KeyID = &v\n\tcase float64:\n\t\tp.KeyID = Ptr(strconv.FormatFloat(v, 'f', -1, 64))\n\tdefault:\n\t\treturn fmt.Errorf(\"unable to unmarshal %T as a string\", v)\n\t}\n\n\treturn nil\n}\n\nfunc (s *ActionsService) getPublicKey(ctx context.Context, url string) (*PublicKey, *Response, error) {\n\treq, err := s.client.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar pubKey *PublicKey\n\tresp, err := s.client.Do(ctx, req, &pubKey)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn pubKey, resp, nil\n}\n\n// GetRepoPublicKey gets a public key that should be used for secret encryption.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-a-repository-public-key\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/secrets/public-key\nfunc (s *ActionsService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error) {\n\turl := fmt.Sprintf(\"repos/%v/%v/actions/secrets/public-key\", owner, repo)\n\treturn s.getPublicKey(ctx, url)\n}\n\n// GetOrgPublicKey gets a public key that should be used for secret encryption.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-an-organization-public-key\n//\n//meta:operation GET /orgs/{org}/actions/secrets/public-key\nfunc (s *ActionsService) GetOrgPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error) {\n\turl := fmt.Sprintf(\"orgs/%v/actions/secrets/public-key\", org)\n\treturn s.getPublicKey(ctx, url)\n}\n\n// GetEnvPublicKey gets a public key that should be used for secret encryption.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#get-an-environment-public-key\n//\n//meta:operation GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key\nfunc (s *ActionsService) GetEnvPublicKey(ctx context.Context, repoID int, env string) (*PublicKey, *Response, error) {\n\turl := fmt.Sprintf(\"repositories/%v/environments/%v/secrets/public-key\", repoID, env)\n\treturn s.getPublicKey(ctx, url)\n}\n\n// Secret represents a repository action secret.\ntype Secret struct {\n\tName                    string    `json:\"name\"`\n\tCreatedAt               Timestamp `json:\"created_at\"`\n\tUpdatedAt               Timestamp `json:\"updated_at\"`\n\tVisibility              string    `json:\"visibility,omitempty\"`\n\tSelectedRepositoriesURL string    `json:\"selected_repositories_url,omitempty\"`\n}\n\n// Secrets represents one item from the ListSecrets response.\ntype Secrets struct {\n\tTotalCount int       `json:\"total_count\"`\n\tSecrets    []*Secret `json:\"secrets\"`\n}\n\nfunc (s *ActionsService) listSecrets(ctx context.Context, url string, opts *ListOptions) (*Secrets, *Response, error) {\n\tu, err := addOptions(url, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar secrets *Secrets\n\tresp, err := s.client.Do(ctx, req, &secrets)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn secrets, resp, nil\n}\n\n// ListRepoSecrets lists all secrets available in a repository\n// without revealing their encrypted values.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-repository-secrets\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/secrets\nfunc (s *ActionsService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) {\n\turl := fmt.Sprintf(\"repos/%v/%v/actions/secrets\", owner, repo)\n\treturn s.listSecrets(ctx, url, opts)\n}\n\n// ListRepoOrgSecrets lists all organization secrets available in a repository\n// without revealing their encrypted values.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-repository-organization-secrets\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/organization-secrets\nfunc (s *ActionsService) ListRepoOrgSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) {\n\turl := fmt.Sprintf(\"repos/%v/%v/actions/organization-secrets\", owner, repo)\n\treturn s.listSecrets(ctx, url, opts)\n}\n\n// ListOrgSecrets lists all secrets available in an organization\n// without revealing their encrypted values.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-organization-secrets\n//\n//meta:operation GET /orgs/{org}/actions/secrets\nfunc (s *ActionsService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error) {\n\turl := fmt.Sprintf(\"orgs/%v/actions/secrets\", org)\n\treturn s.listSecrets(ctx, url, opts)\n}\n\n// ListEnvSecrets lists all secrets available in an environment.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#list-environment-secrets\n//\n//meta:operation GET /repositories/{repository_id}/environments/{environment_name}/secrets\nfunc (s *ActionsService) ListEnvSecrets(ctx context.Context, repoID int, env string, opts *ListOptions) (*Secrets, *Response, error) {\n\turl := fmt.Sprintf(\"repositories/%v/environments/%v/secrets\", repoID, env)\n\treturn s.listSecrets(ctx, url, opts)\n}\n\nfunc (s *ActionsService) getSecret(ctx context.Context, url string) (*Secret, *Response, error) {\n\treq, err := s.client.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar secret *Secret\n\tresp, err := s.client.Do(ctx, req, &secret)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn secret, resp, nil\n}\n\n// GetRepoSecret gets a single repository secret without revealing its encrypted value.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-a-repository-secret\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/secrets/{secret_name}\nfunc (s *ActionsService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error) {\n\turl := fmt.Sprintf(\"repos/%v/%v/actions/secrets/%v\", owner, repo, name)\n\treturn s.getSecret(ctx, url)\n}\n\n// GetOrgSecret gets a single organization secret without revealing its encrypted value.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/secrets#get-an-organization-secret\n//\n//meta:operation GET /orgs/{org}/actions/secrets/{secret_name}\nfunc (s *ActionsService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error) {\n\turl := fmt.Sprintf(\"orgs/%v/actions/secrets/%v\", org, name)\n\treturn s.getSecret(ctx, url)\n}\n\n// GetEnvSecret gets a single environment secret without revealing its encrypted value.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#get-an-environment-secret\n//\n//meta:operation GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\nfunc (s *ActionsService) GetEnvSecret(ctx context.Context, repoID int, env, secretName string) (*Secret, *Response, error) {\n\turl := fmt.Sprintf(\"repositories/%v/environments/%v/secrets/%v\", repoID, env, secretName)\n\treturn s.getSecret(ctx, url)\n}\n\n// SelectedRepoIDs are the repository IDs that have access to the actions secrets.\ntype SelectedRepoIDs []int64\n\n// EncryptedSecret represents a secret that is encrypted using a public key.\n//\n// The value of EncryptedValue must be your secret, encrypted with\n// LibSodium (see documentation here: https://libsodium.gitbook.io/doc/bindings_for_other_languages)\n// using the public key retrieved using the GetPublicKey method.\ntype EncryptedSecret struct {\n\tName                  string          `json:\"-\"`\n\tKeyID                 string          `json:\"key_id\"`\n\tEncryptedValue        string          `json:\"encrypted_value\"`\n\tVisibility            string          `json:\"visibility,omitempty\"`\n\tSelectedRepositoryIDs SelectedRepoIDs `json:\"selected_repository_ids,omitempty\"`\n}\n\nfunc (s *ActionsService) putSecret(ctx context.Context, url string, eSecret *EncryptedSecret) (*Response, error) {\n\treq, err := s.client.NewRequest(\"PUT\", url, eSecret)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// CreateOrUpdateRepoSecret creates or updates a repository secret with an encrypted value.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/secrets#create-or-update-a-repository-secret\n//\n//meta:operation PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}\nfunc (s *ActionsService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error) {\n\tif eSecret == nil {\n\t\treturn nil, errors.New(\"encrypted secret must be provided\")\n\t}\n\n\turl := fmt.Sprintf(\"repos/%v/%v/actions/secrets/%v\", owner, repo, eSecret.Name)\n\treturn s.putSecret(ctx, url, eSecret)\n}\n\n// CreateOrUpdateOrgSecret creates or updates an organization secret with an encrypted value.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret\n//\n//meta:operation PUT /orgs/{org}/actions/secrets/{secret_name}\nfunc (s *ActionsService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error) {\n\tif eSecret == nil {\n\t\treturn nil, errors.New(\"encrypted secret must be provided\")\n\t}\n\n\turl := fmt.Sprintf(\"orgs/%v/actions/secrets/%v\", org, eSecret.Name)\n\treturn s.putSecret(ctx, url, eSecret)\n}\n\n// CreateOrUpdateEnvSecret creates or updates a single environment secret with an encrypted value.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#create-or-update-an-environment-secret\n//\n//meta:operation PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\nfunc (s *ActionsService) CreateOrUpdateEnvSecret(ctx context.Context, repoID int, env string, eSecret *EncryptedSecret) (*Response, error) {\n\tif eSecret == nil {\n\t\treturn nil, errors.New(\"encrypted secret must be provided\")\n\t}\n\n\turl := fmt.Sprintf(\"repositories/%v/environments/%v/secrets/%v\", repoID, env, eSecret.Name)\n\treturn s.putSecret(ctx, url, eSecret)\n}\n\nfunc (s *ActionsService) deleteSecret(ctx context.Context, url string) (*Response, error) {\n\treq, err := s.client.NewRequest(\"DELETE\", url, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// DeleteRepoSecret deletes a secret in a repository using the secret name.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/secrets#delete-a-repository-secret\n//\n//meta:operation DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}\nfunc (s *ActionsService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error) {\n\turl := fmt.Sprintf(\"repos/%v/%v/actions/secrets/%v\", owner, repo, name)\n\treturn s.deleteSecret(ctx, url)\n}\n\n// DeleteOrgSecret deletes a secret in an organization using the secret name.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/secrets#delete-an-organization-secret\n//\n//meta:operation DELETE /orgs/{org}/actions/secrets/{secret_name}\nfunc (s *ActionsService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error) {\n\turl := fmt.Sprintf(\"orgs/%v/actions/secrets/%v\", org, name)\n\treturn s.deleteSecret(ctx, url)\n}\n\n// DeleteEnvSecret deletes a secret in an environment using the secret name.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#delete-an-environment-secret\n//\n//meta:operation DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\nfunc (s *ActionsService) DeleteEnvSecret(ctx context.Context, repoID int, env, secretName string) (*Response, error) {\n\turl := fmt.Sprintf(\"repositories/%v/environments/%v/secrets/%v\", repoID, env, secretName)\n\treturn s.deleteSecret(ctx, url)\n}\n\n// SelectedReposList represents the list of repositories selected for an organization secret.\ntype SelectedReposList struct {\n\tTotalCount   *int          `json:\"total_count,omitempty\"`\n\tRepositories []*Repository `json:\"repositories,omitempty\"`\n}\n\nfunc (s *ActionsService) listSelectedReposForSecret(ctx context.Context, url string, opts *ListOptions) (*SelectedReposList, *Response, error) {\n\tu, err := addOptions(url, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar result *SelectedReposList\n\tresp, err := s.client.Do(ctx, req, &result)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn result, resp, nil\n}\n\n// ListSelectedReposForOrgSecret lists all repositories that have access to a secret.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/secrets#list-selected-repositories-for-an-organization-secret\n//\n//meta:operation GET /orgs/{org}/actions/secrets/{secret_name}/repositories\nfunc (s *ActionsService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) {\n\turl := fmt.Sprintf(\"orgs/%v/actions/secrets/%v/repositories\", org, name)\n\treturn s.listSelectedReposForSecret(ctx, url, opts)\n}\n\nfunc (s *ActionsService) setSelectedReposForSecret(ctx context.Context, url string, ids SelectedRepoIDs) (*Response, error) {\n\ttype repoIDs struct {\n\t\tSelectedIDs SelectedRepoIDs `json:\"selected_repository_ids\"`\n\t}\n\n\treq, err := s.client.NewRequest(\"PUT\", url, repoIDs{SelectedIDs: ids})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// SetSelectedReposForOrgSecret sets the repositories that have access to a secret.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret\n//\n//meta:operation PUT /orgs/{org}/actions/secrets/{secret_name}/repositories\nfunc (s *ActionsService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) {\n\turl := fmt.Sprintf(\"orgs/%v/actions/secrets/%v/repositories\", org, name)\n\treturn s.setSelectedReposForSecret(ctx, url, ids)\n}\n\nfunc (s *ActionsService) addSelectedRepoToSecret(ctx context.Context, url string) (*Response, error) {\n\treq, err := s.client.NewRequest(\"PUT\", url, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// AddSelectedRepoToOrgSecret adds a repository to an organization secret.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/secrets#add-selected-repository-to-an-organization-secret\n//\n//meta:operation PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\nfunc (s *ActionsService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) {\n\tif repo == nil {\n\t\treturn nil, errors.New(\"repository must be provided\")\n\t}\n\n\turl := fmt.Sprintf(\"orgs/%v/actions/secrets/%v/repositories/%v\", org, name, *repo.ID)\n\treturn s.addSelectedRepoToSecret(ctx, url)\n}\n\nfunc (s *ActionsService) removeSelectedRepoFromSecret(ctx context.Context, url string) (*Response, error) {\n\treq, err := s.client.NewRequest(\"DELETE\", url, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// RemoveSelectedRepoFromOrgSecret removes a repository from an organization secret.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret\n//\n//meta:operation DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\nfunc (s *ActionsService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) {\n\tif repo == nil {\n\t\treturn nil, errors.New(\"repository must be provided\")\n\t}\n\n\turl := fmt.Sprintf(\"orgs/%v/actions/secrets/%v/repositories/%v\", org, name, *repo.ID)\n\treturn s.removeSelectedRepoFromSecret(ctx, url)\n}\n"
  },
  {
    "path": "github/actions_secrets_test.go",
    "content": "// Copyright 2020 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestPublicKey_UnmarshalJSON(t *testing.T) {\n\tt.Parallel()\n\ttestCases := map[string]struct {\n\t\tdata          []byte\n\t\twantPublicKey PublicKey\n\t\twantErr       bool\n\t}{\n\t\t\"Empty\": {\n\t\t\tdata:          []byte(\"{}\"),\n\t\t\twantPublicKey: PublicKey{},\n\t\t\twantErr:       false,\n\t\t},\n\t\t\"Invalid JSON\": {\n\t\t\tdata:          []byte(\"{\"),\n\t\t\twantPublicKey: PublicKey{},\n\t\t\twantErr:       true,\n\t\t},\n\t\t\"Numeric KeyID\": {\n\t\t\tdata:          []byte(`{\"key_id\":1234,\"key\":\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\"}`),\n\t\t\twantPublicKey: PublicKey{KeyID: Ptr(\"1234\"), Key: Ptr(\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\")},\n\t\t\twantErr:       false,\n\t\t},\n\t\t\"String KeyID\": {\n\t\t\tdata:          []byte(`{\"key_id\":\"1234\",\"key\":\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\"}`),\n\t\t\twantPublicKey: PublicKey{KeyID: Ptr(\"1234\"), Key: Ptr(\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\")},\n\t\t\twantErr:       false,\n\t\t},\n\t\t\"Invalid KeyID\": {\n\t\t\tdata:          []byte(`{\"key_id\":[\"1234\"],\"key\":\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\"}`),\n\t\t\twantPublicKey: PublicKey{KeyID: nil, Key: Ptr(\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\")},\n\t\t\twantErr:       true,\n\t\t},\n\t\t\"Invalid Key\": {\n\t\t\tdata:          []byte(`{\"key\":123}`),\n\t\t\twantPublicKey: PublicKey{KeyID: nil, Key: nil},\n\t\t\twantErr:       true,\n\t\t},\n\t\t\"Nil\": {\n\t\t\tdata:          nil,\n\t\t\twantPublicKey: PublicKey{KeyID: nil, Key: nil},\n\t\t\twantErr:       true,\n\t\t},\n\t\t\"Empty String\": {\n\t\t\tdata:          []byte(\"\"),\n\t\t\twantPublicKey: PublicKey{KeyID: nil, Key: nil},\n\t\t\twantErr:       true,\n\t\t},\n\t\t\"Missing Key\": {\n\t\t\tdata:          []byte(`{\"key_id\":\"1234\"}`),\n\t\t\twantPublicKey: PublicKey{KeyID: Ptr(\"1234\")},\n\t\t\twantErr:       false,\n\t\t},\n\t\t\"Missing KeyID\": {\n\t\t\tdata:          []byte(`{\"key\":\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\"}`),\n\t\t\twantPublicKey: PublicKey{Key: Ptr(\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\")},\n\t\t\twantErr:       false,\n\t\t},\n\t}\n\n\tfor name, tt := range testCases {\n\t\tt.Run(name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tpk := PublicKey{}\n\t\t\terr := json.Unmarshal(tt.data, &pk)\n\t\t\tif err == nil && tt.wantErr {\n\t\t\t\tt.Error(\"PublicKey.UnmarshalJSON returned nil instead of an error\")\n\t\t\t}\n\t\t\tif err != nil && !tt.wantErr {\n\t\t\t\tt.Errorf(\"PublicKey.UnmarshalJSON returned an unexpected error: %+v\", err)\n\t\t\t}\n\t\t\tif !cmp.Equal(tt.wantPublicKey, pk) {\n\t\t\t\tt.Errorf(\"PublicKey.UnmarshalJSON expected public key %+v, got %+v\", tt.wantPublicKey, pk)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestActionsService_GetRepoPublicKey(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/secrets/public-key\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"key_id\":\"1234\",\"key\":\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\"}`)\n\t})\n\n\tctx := t.Context()\n\tkey, _, err := client.Actions.GetRepoPublicKey(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetRepoPublicKey returned error: %v\", err)\n\t}\n\n\twant := &PublicKey{KeyID: Ptr(\"1234\"), Key: Ptr(\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\")}\n\tif !cmp.Equal(key, want) {\n\t\tt.Errorf(\"Actions.GetRepoPublicKey returned %+v, want %+v\", key, want)\n\t}\n\n\tconst methodName = \"GetRepoPublicKey\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetRepoPublicKey(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetRepoPublicKey(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetRepoPublicKeyNumeric(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/secrets/public-key\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"key_id\":1234,\"key\":\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\"}`)\n\t})\n\n\tctx := t.Context()\n\tkey, _, err := client.Actions.GetRepoPublicKey(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetRepoPublicKey returned error: %v\", err)\n\t}\n\n\twant := &PublicKey{KeyID: Ptr(\"1234\"), Key: Ptr(\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\")}\n\tif !cmp.Equal(key, want) {\n\t\tt.Errorf(\"Actions.GetRepoPublicKey returned %+v, want %+v\", key, want)\n\t}\n\n\tconst methodName = \"GetRepoPublicKey\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetRepoPublicKey(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetRepoPublicKey(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_ListRepoSecrets(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/secrets\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `{\"total_count\":4,\"secrets\":[{\"name\":\"A\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"},{\"name\":\"B\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"}]}`)\n\t})\n\n\topts := &ListOptions{Page: 2, PerPage: 2}\n\tctx := t.Context()\n\tsecrets, _, err := client.Actions.ListRepoSecrets(ctx, \"o\", \"r\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListRepoSecrets returned error: %v\", err)\n\t}\n\n\twant := &Secrets{\n\t\tTotalCount: 4,\n\t\tSecrets: []*Secret{\n\t\t\t{Name: \"A\", CreatedAt: Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)}, UpdatedAt: Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)}},\n\t\t\t{Name: \"B\", CreatedAt: Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)}, UpdatedAt: Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)}},\n\t\t},\n\t}\n\tif !cmp.Equal(secrets, want) {\n\t\tt.Errorf(\"Actions.ListRepoSecrets returned %+v, want %+v\", secrets, want)\n\t}\n\n\tconst methodName = \"ListRepoSecrets\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListRepoSecrets(ctx, \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListRepoSecrets(ctx, \"o\", \"r\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_ListRepoOrgSecrets(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/organization-secrets\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `{\"total_count\":4,\"secrets\":[{\"name\":\"A\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"},{\"name\":\"B\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"}]}`)\n\t})\n\n\topts := &ListOptions{Page: 2, PerPage: 2}\n\tctx := t.Context()\n\tsecrets, _, err := client.Actions.ListRepoOrgSecrets(ctx, \"o\", \"r\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListRepoOrgSecrets returned error: %v\", err)\n\t}\n\n\twant := &Secrets{\n\t\tTotalCount: 4,\n\t\tSecrets: []*Secret{\n\t\t\t{Name: \"A\", CreatedAt: Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)}, UpdatedAt: Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)}},\n\t\t\t{Name: \"B\", CreatedAt: Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)}, UpdatedAt: Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)}},\n\t\t},\n\t}\n\tif !cmp.Equal(secrets, want) {\n\t\tt.Errorf(\"Actions.ListRepoOrgSecrets returned %+v, want %+v\", secrets, want)\n\t}\n\n\tconst methodName = \"ListRepoOrgSecrets\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListRepoOrgSecrets(ctx, \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListRepoOrgSecrets(ctx, \"o\", \"r\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetRepoSecret(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/secrets/NAME\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"name\":\"NAME\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"}`)\n\t})\n\n\tctx := t.Context()\n\tsecret, _, err := client.Actions.GetRepoSecret(ctx, \"o\", \"r\", \"NAME\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetRepoSecret returned error: %v\", err)\n\t}\n\n\twant := &Secret{\n\t\tName:      \"NAME\",\n\t\tCreatedAt: Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t\tUpdatedAt: Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t}\n\tif !cmp.Equal(secret, want) {\n\t\tt.Errorf(\"Actions.GetRepoSecret returned %+v, want %+v\", secret, want)\n\t}\n\n\tconst methodName = \"GetRepoSecret\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetRepoSecret(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetRepoSecret(ctx, \"o\", \"r\", \"NAME\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_CreateOrUpdateRepoSecret(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/secrets/NAME\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\ttestBody(t, r, `{\"key_id\":\"1234\",\"encrypted_value\":\"QIv=\"}`+\"\\n\")\n\t\tw.WriteHeader(http.StatusCreated)\n\t})\n\n\tinput := &EncryptedSecret{\n\t\tName:           \"NAME\",\n\t\tEncryptedValue: \"QIv=\",\n\t\tKeyID:          \"1234\",\n\t}\n\tctx := t.Context()\n\t_, err := client.Actions.CreateOrUpdateRepoSecret(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.CreateOrUpdateRepoSecret returned error: %v\", err)\n\t}\n\n\tconst methodName = \"CreateOrUpdateRepoSecret\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.CreateOrUpdateRepoSecret(ctx, \"o\", \"r\", nil)\n\t\treturn err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.CreateOrUpdateRepoSecret(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.CreateOrUpdateRepoSecret(ctx, \"o\", \"r\", input)\n\t})\n}\n\nfunc TestActionsService_DeleteRepoSecret(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/secrets/NAME\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.DeleteRepoSecret(ctx, \"o\", \"r\", \"NAME\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.DeleteRepoSecret returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteRepoSecret\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.DeleteRepoSecret(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.DeleteRepoSecret(ctx, \"o\", \"r\", \"NAME\")\n\t})\n}\n\nfunc TestActionsService_GetOrgPublicKey(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/secrets/public-key\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"key_id\":\"012345678\",\"key\":\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\"}`)\n\t})\n\n\tctx := t.Context()\n\tkey, _, err := client.Actions.GetOrgPublicKey(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetOrgPublicKey returned error: %v\", err)\n\t}\n\n\twant := &PublicKey{KeyID: Ptr(\"012345678\"), Key: Ptr(\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\")}\n\tif !cmp.Equal(key, want) {\n\t\tt.Errorf(\"Actions.GetOrgPublicKey returned %+v, want %+v\", key, want)\n\t}\n\n\tconst methodName = \"GetOrgPublicKey\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetOrgPublicKey(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetOrgPublicKey(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_ListOrgSecrets(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/secrets\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `{\"total_count\":3,\"secrets\":[{\"name\":\"GIST_ID\",\"created_at\":\"2019-08-10T14:59:22Z\",\"updated_at\":\"2020-01-10T14:59:22Z\",\"visibility\":\"private\"},{\"name\":\"DEPLOY_TOKEN\",\"created_at\":\"2019-08-10T14:59:22Z\",\"updated_at\":\"2020-01-10T14:59:22Z\",\"visibility\":\"all\"},{\"name\":\"GH_TOKEN\",\"created_at\":\"2019-08-10T14:59:22Z\",\"updated_at\":\"2020-01-10T14:59:22Z\",\"visibility\":\"selected\",\"selected_repositories_url\":\"https://api.github.com/orgs/octo-org/actions/secrets/SUPER_SECRET/repositories\"}]}`)\n\t})\n\n\topts := &ListOptions{Page: 2, PerPage: 2}\n\tctx := t.Context()\n\tsecrets, _, err := client.Actions.ListOrgSecrets(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListOrgSecrets returned error: %v\", err)\n\t}\n\n\twant := &Secrets{\n\t\tTotalCount: 3,\n\t\tSecrets: []*Secret{\n\t\t\t{Name: \"GIST_ID\", CreatedAt: Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)}, UpdatedAt: Timestamp{time.Date(2020, time.January, 10, 14, 59, 22, 0, time.UTC)}, Visibility: \"private\"},\n\t\t\t{Name: \"DEPLOY_TOKEN\", CreatedAt: Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)}, UpdatedAt: Timestamp{time.Date(2020, time.January, 10, 14, 59, 22, 0, time.UTC)}, Visibility: \"all\"},\n\t\t\t{Name: \"GH_TOKEN\", CreatedAt: Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)}, UpdatedAt: Timestamp{time.Date(2020, time.January, 10, 14, 59, 22, 0, time.UTC)}, Visibility: \"selected\", SelectedRepositoriesURL: \"https://api.github.com/orgs/octo-org/actions/secrets/SUPER_SECRET/repositories\"},\n\t\t},\n\t}\n\tif !cmp.Equal(secrets, want) {\n\t\tt.Errorf(\"Actions.ListOrgSecrets returned %+v, want %+v\", secrets, want)\n\t}\n\n\tconst methodName = \"ListOrgSecrets\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListOrgSecrets(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListOrgSecrets(ctx, \"o\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetOrgSecret(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/secrets/NAME\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"name\":\"NAME\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\",\"visibility\":\"selected\",\"selected_repositories_url\":\"https://api.github.com/orgs/octo-org/actions/secrets/SUPER_SECRET/repositories\"}`)\n\t})\n\n\tctx := t.Context()\n\tsecret, _, err := client.Actions.GetOrgSecret(ctx, \"o\", \"NAME\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetOrgSecret returned error: %v\", err)\n\t}\n\n\twant := &Secret{\n\t\tName:                    \"NAME\",\n\t\tCreatedAt:               Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t\tUpdatedAt:               Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t\tVisibility:              \"selected\",\n\t\tSelectedRepositoriesURL: \"https://api.github.com/orgs/octo-org/actions/secrets/SUPER_SECRET/repositories\",\n\t}\n\tif !cmp.Equal(secret, want) {\n\t\tt.Errorf(\"Actions.GetOrgSecret returned %+v, want %+v\", secret, want)\n\t}\n\n\tconst methodName = \"GetOrgSecret\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetOrgSecret(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetOrgSecret(ctx, \"o\", \"NAME\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_CreateOrUpdateOrgSecret(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/secrets/NAME\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\ttestBody(t, r, `{\"key_id\":\"1234\",\"encrypted_value\":\"QIv=\",\"visibility\":\"selected\",\"selected_repository_ids\":[1296269,1269280]}`+\"\\n\")\n\t\tw.WriteHeader(http.StatusCreated)\n\t})\n\n\tinput := &EncryptedSecret{\n\t\tName:                  \"NAME\",\n\t\tEncryptedValue:        \"QIv=\",\n\t\tKeyID:                 \"1234\",\n\t\tVisibility:            \"selected\",\n\t\tSelectedRepositoryIDs: SelectedRepoIDs{1296269, 1269280},\n\t}\n\tctx := t.Context()\n\t_, err := client.Actions.CreateOrUpdateOrgSecret(ctx, \"o\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.CreateOrUpdateOrgSecret returned error: %v\", err)\n\t}\n\n\tconst methodName = \"CreateOrUpdateOrgSecret\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.CreateOrUpdateOrgSecret(ctx, \"o\", nil)\n\t\treturn err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.CreateOrUpdateOrgSecret(ctx, \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.CreateOrUpdateOrgSecret(ctx, \"o\", input)\n\t})\n}\n\nfunc TestActionsService_ListSelectedReposForOrgSecret(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/secrets/NAME/repositories\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"total_count\":1,\"repositories\":[{\"id\":1}]}`)\n\t})\n\n\topts := &ListOptions{Page: 2, PerPage: 2}\n\tctx := t.Context()\n\trepos, _, err := client.Actions.ListSelectedReposForOrgSecret(ctx, \"o\", \"NAME\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListSelectedReposForOrgSecret returned error: %v\", err)\n\t}\n\n\twant := &SelectedReposList{\n\t\tTotalCount: Ptr(1),\n\t\tRepositories: []*Repository{\n\t\t\t{ID: Ptr(int64(1))},\n\t\t},\n\t}\n\tif !cmp.Equal(repos, want) {\n\t\tt.Errorf(\"Actions.ListSelectedReposForOrgSecret returned %+v, want %+v\", repos, want)\n\t}\n\n\tconst methodName = \"ListSelectedReposForOrgSecret\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListSelectedReposForOrgSecret(ctx, \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListSelectedReposForOrgSecret(ctx, \"o\", \"NAME\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_SetSelectedReposForOrgSecret(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/secrets/NAME/repositories\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\ttestBody(t, r, `{\"selected_repository_ids\":[64780797]}`+\"\\n\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.SetSelectedReposForOrgSecret(ctx, \"o\", \"NAME\", SelectedRepoIDs{64780797})\n\tif err != nil {\n\t\tt.Errorf(\"Actions.SetSelectedReposForOrgSecret returned error: %v\", err)\n\t}\n\n\tconst methodName = \"SetSelectedReposForOrgSecret\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.SetSelectedReposForOrgSecret(ctx, \"\\n\", \"\\n\", SelectedRepoIDs{64780797})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.SetSelectedReposForOrgSecret(ctx, \"o\", \"NAME\", SelectedRepoIDs{64780797})\n\t})\n}\n\nfunc TestActionsService_AddSelectedRepoToOrgSecret(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/secrets/NAME/repositories/1234\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t})\n\n\trepo := &Repository{ID: Ptr(int64(1234))}\n\tctx := t.Context()\n\t_, err := client.Actions.AddSelectedRepoToOrgSecret(ctx, \"o\", \"NAME\", repo)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.AddSelectedRepoToOrgSecret returned error: %v\", err)\n\t}\n\n\tconst methodName = \"AddSelectedRepoToOrgSecret\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.AddSelectedRepoToOrgSecret(ctx, \"o\", \"NAME\", nil)\n\t\treturn err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.AddSelectedRepoToOrgSecret(ctx, \"\\n\", \"\\n\", repo)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.AddSelectedRepoToOrgSecret(ctx, \"o\", \"NAME\", repo)\n\t})\n}\n\nfunc TestActionsService_RemoveSelectedRepoFromOrgSecret(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/secrets/NAME/repositories/1234\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\trepo := &Repository{ID: Ptr(int64(1234))}\n\tctx := t.Context()\n\t_, err := client.Actions.RemoveSelectedRepoFromOrgSecret(ctx, \"o\", \"NAME\", repo)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.RemoveSelectedRepoFromOrgSecret returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveSelectedRepoFromOrgSecret\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.RemoveSelectedRepoFromOrgSecret(ctx, \"o\", \"NAME\", nil)\n\t\treturn err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.RemoveSelectedRepoFromOrgSecret(ctx, \"\\n\", \"\\n\", repo)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.RemoveSelectedRepoFromOrgSecret(ctx, \"o\", \"NAME\", repo)\n\t})\n}\n\nfunc TestActionsService_DeleteOrgSecret(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/secrets/NAME\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.DeleteOrgSecret(ctx, \"o\", \"NAME\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.DeleteOrgSecret returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteOrgSecret\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.DeleteOrgSecret(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.DeleteOrgSecret(ctx, \"o\", \"NAME\")\n\t})\n}\n\nfunc TestActionsService_GetEnvPublicKey(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repositories/1/environments/e/secrets/public-key\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"key_id\":\"1234\",\"key\":\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\"}`)\n\t})\n\n\tctx := t.Context()\n\tkey, _, err := client.Actions.GetEnvPublicKey(ctx, 1, \"e\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetEnvPublicKey returned error: %v\", err)\n\t}\n\n\twant := &PublicKey{KeyID: Ptr(\"1234\"), Key: Ptr(\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\")}\n\tif !cmp.Equal(key, want) {\n\t\tt.Errorf(\"Actions.GetEnvPublicKey returned %+v, want %+v\", key, want)\n\t}\n\n\tconst methodName = \"GetEnvPublicKey\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetEnvPublicKey(ctx, 0.0, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetEnvPublicKey(ctx, 1, \"e\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetEnvPublicKeyNumeric(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repositories/1/environments/e/secrets/public-key\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"key_id\":1234,\"key\":\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\"}`)\n\t})\n\n\tctx := t.Context()\n\tkey, _, err := client.Actions.GetEnvPublicKey(ctx, 1, \"e\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetEnvPublicKey returned error: %v\", err)\n\t}\n\n\twant := &PublicKey{KeyID: Ptr(\"1234\"), Key: Ptr(\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\")}\n\tif !cmp.Equal(key, want) {\n\t\tt.Errorf(\"Actions.GetEnvPublicKey returned %+v, want %+v\", key, want)\n\t}\n\n\tconst methodName = \"GetEnvPublicKey\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetEnvPublicKey(ctx, 0.0, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetEnvPublicKey(ctx, 1, \"e\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_ListEnvSecrets(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repositories/1/environments/e/secrets\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `{\"total_count\":4,\"secrets\":[{\"name\":\"A\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"},{\"name\":\"B\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"}]}`)\n\t})\n\n\topts := &ListOptions{Page: 2, PerPage: 2}\n\tctx := t.Context()\n\tsecrets, _, err := client.Actions.ListEnvSecrets(ctx, 1, \"e\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListEnvSecrets returned error: %v\", err)\n\t}\n\n\twant := &Secrets{\n\t\tTotalCount: 4,\n\t\tSecrets: []*Secret{\n\t\t\t{Name: \"A\", CreatedAt: Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)}, UpdatedAt: Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)}},\n\t\t\t{Name: \"B\", CreatedAt: Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)}, UpdatedAt: Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)}},\n\t\t},\n\t}\n\tif !cmp.Equal(secrets, want) {\n\t\tt.Errorf(\"Actions.ListEnvSecrets returned %+v, want %+v\", secrets, want)\n\t}\n\n\tconst methodName = \"ListEnvSecrets\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListEnvSecrets(ctx, 0.0, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListEnvSecrets(ctx, 1, \"e\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetEnvSecret(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repositories/1/environments/e/secrets/secret\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"name\":\"secret\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"}`)\n\t})\n\n\tctx := t.Context()\n\tsecret, _, err := client.Actions.GetEnvSecret(ctx, 1, \"e\", \"secret\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetEnvSecret returned error: %v\", err)\n\t}\n\n\twant := &Secret{\n\t\tName:      \"secret\",\n\t\tCreatedAt: Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t\tUpdatedAt: Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t}\n\tif !cmp.Equal(secret, want) {\n\t\tt.Errorf(\"Actions.GetEnvSecret returned %+v, want %+v\", secret, want)\n\t}\n\n\tconst methodName = \"GetEnvSecret\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetEnvSecret(ctx, 0.0, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetEnvSecret(ctx, 1, \"e\", \"secret\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_CreateOrUpdateEnvSecret(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repositories/1/environments/e/secrets/secret\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\ttestBody(t, r, `{\"key_id\":\"1234\",\"encrypted_value\":\"QIv=\"}`+\"\\n\")\n\t\tw.WriteHeader(http.StatusCreated)\n\t})\n\n\tinput := &EncryptedSecret{\n\t\tName:           \"secret\",\n\t\tEncryptedValue: \"QIv=\",\n\t\tKeyID:          \"1234\",\n\t}\n\tctx := t.Context()\n\t_, err := client.Actions.CreateOrUpdateEnvSecret(ctx, 1, \"e\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.CreateOrUpdateEnvSecret returned error: %v\", err)\n\t}\n\n\tconst methodName = \"CreateOrUpdateEnvSecret\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.CreateOrUpdateEnvSecret(ctx, 1, \"e\", nil)\n\t\treturn err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.CreateOrUpdateEnvSecret(ctx, 0.0, \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.CreateOrUpdateEnvSecret(ctx, 1, \"e\", input)\n\t})\n}\n\nfunc TestActionsService_DeleteEnvSecret(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repositories/1/environments/e/secrets/secret\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.DeleteEnvSecret(ctx, 1, \"e\", \"secret\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.DeleteEnvSecret returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteEnvSecret\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.DeleteEnvSecret(ctx, 0.0, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.DeleteEnvSecret(ctx, 1, \"r\", \"secret\")\n\t})\n}\n\nfunc TestPublicKey_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PublicKey{}, `{\n\t\t\"key\": null,\n\t\t\"key_id\": null\n\t}`)\n\n\tu := &PublicKey{\n\t\tKeyID: Ptr(\"kid\"),\n\t\tKey:   Ptr(\"k\"),\n\t}\n\n\twant := `{\n\t\t\"key_id\": \"kid\",\n\t\t\"key\": \"k\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestSecret_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Secret{}, `{\n\t\t\"name\": \"\",\n\t\t\"created_at\": \"0001-01-01T00:00:00Z\",\n\t\t\"updated_at\": \"0001-01-01T00:00:00Z\"\n\t}`)\n\n\tu := &Secret{\n\t\tName:                    \"n\",\n\t\tCreatedAt:               Timestamp{referenceTime},\n\t\tUpdatedAt:               Timestamp{referenceTime},\n\t\tVisibility:              \"v\",\n\t\tSelectedRepositoriesURL: \"s\",\n\t}\n\n\twant := `{\n\t\t\"name\": \"n\",\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"visibility\": \"v\",\n\t\t\"selected_repositories_url\": \"s\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestSecrets_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Secrets{}, `{\n\t\t\"total_count\": 0,\n\t\t\"secrets\": null\n\t}`)\n\n\tu := &Secrets{\n\t\tTotalCount: 1,\n\t\tSecrets: []*Secret{\n\t\t\t{\n\t\t\t\tName:                    \"n\",\n\t\t\t\tCreatedAt:               Timestamp{referenceTime},\n\t\t\t\tUpdatedAt:               Timestamp{referenceTime},\n\t\t\t\tVisibility:              \"v\",\n\t\t\t\tSelectedRepositoriesURL: \"s\",\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"total_count\": 1,\n\t\t\"secrets\": [\n\t\t\t{\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"visibility\": \"v\",\n\t\t\t\t\"selected_repositories_url\": \"s\"\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestEncryptedSecret_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &EncryptedSecret{}, `{\n\t\t\"key_id\": \"\",\n\t\t\"encrypted_value\": \"\"\n\t}`)\n\n\tu := &EncryptedSecret{\n\t\tName:                  \"n\",\n\t\tKeyID:                 \"kid\",\n\t\tEncryptedValue:        \"e\",\n\t\tVisibility:            \"v\",\n\t\tSelectedRepositoryIDs: []int64{1},\n\t}\n\n\twant := `{\n\t\t\"key_id\": \"kid\",\n\t\t\"encrypted_value\": \"e\",\n\t\t\"visibility\": \"v\",\n\t\t\"selected_repository_ids\": [1]\n\t}`\n\n\ttestJSONMarshal(t, u, want, cmpIgnoreFieldOption(\"Name\"))\n}\n\nfunc TestSelectedReposList_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SelectedReposList{}, \"{}\")\n\n\tu := &SelectedReposList{\n\t\tTotalCount: Ptr(1),\n\t\tRepositories: []*Repository{\n\t\t\t{\n\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\tURL:  Ptr(\"u\"),\n\t\t\t\tName: Ptr(\"n\"),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"total_count\": 1,\n\t\t\"repositories\": [\n\t\t\t{\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"name\": \"n\"\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/actions_variables.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n)\n\n// ActionsVariable represents a repository action variable.\ntype ActionsVariable struct {\n\tName       string     `json:\"name\"`\n\tValue      string     `json:\"value\"`\n\tCreatedAt  *Timestamp `json:\"created_at,omitempty\"`\n\tUpdatedAt  *Timestamp `json:\"updated_at,omitempty\"`\n\tVisibility *string    `json:\"visibility,omitempty\"`\n\t// Used by ListOrgVariables and GetOrgVariables\n\tSelectedRepositoriesURL *string `json:\"selected_repositories_url,omitempty\"`\n\t// Used by UpdateOrgVariable and CreateOrgVariable\n\tSelectedRepositoryIDs *SelectedRepoIDs `json:\"selected_repository_ids,omitempty\"`\n}\n\n// ActionsVariables represents one item from the ListVariables response.\ntype ActionsVariables struct {\n\tTotalCount int                `json:\"total_count\"`\n\tVariables  []*ActionsVariable `json:\"variables\"`\n}\n\nfunc (s *ActionsService) listVariables(ctx context.Context, url string, opts *ListOptions) (*ActionsVariables, *Response, error) {\n\tu, err := addOptions(url, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar variables *ActionsVariables\n\tresp, err := s.client.Do(ctx, req, &variables)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn variables, resp, nil\n}\n\n// ListRepoVariables lists all variables available in a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/variables#list-repository-variables\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/variables\nfunc (s *ActionsService) ListRepoVariables(ctx context.Context, owner, repo string, opts *ListOptions) (*ActionsVariables, *Response, error) {\n\turl := fmt.Sprintf(\"repos/%v/%v/actions/variables\", owner, repo)\n\treturn s.listVariables(ctx, url, opts)\n}\n\n// ListRepoOrgVariables lists all organization variables available in a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/variables#list-repository-organization-variables\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/organization-variables\nfunc (s *ActionsService) ListRepoOrgVariables(ctx context.Context, owner, repo string, opts *ListOptions) (*ActionsVariables, *Response, error) {\n\turl := fmt.Sprintf(\"repos/%v/%v/actions/organization-variables\", owner, repo)\n\treturn s.listVariables(ctx, url, opts)\n}\n\n// ListOrgVariables lists all variables available in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/variables#list-organization-variables\n//\n//meta:operation GET /orgs/{org}/actions/variables\nfunc (s *ActionsService) ListOrgVariables(ctx context.Context, org string, opts *ListOptions) (*ActionsVariables, *Response, error) {\n\turl := fmt.Sprintf(\"orgs/%v/actions/variables\", org)\n\treturn s.listVariables(ctx, url, opts)\n}\n\n// ListEnvVariables lists all variables available in an environment.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/variables#list-environment-variables\n//\n//meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/variables\nfunc (s *ActionsService) ListEnvVariables(ctx context.Context, owner, repo, env string, opts *ListOptions) (*ActionsVariables, *Response, error) {\n\turl := fmt.Sprintf(\"repos/%v/%v/environments/%v/variables\", owner, repo, env)\n\treturn s.listVariables(ctx, url, opts)\n}\n\nfunc (s *ActionsService) getVariable(ctx context.Context, url string) (*ActionsVariable, *Response, error) {\n\treq, err := s.client.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar variable *ActionsVariable\n\tresp, err := s.client.Do(ctx, req, &variable)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn variable, resp, nil\n}\n\n// GetRepoVariable gets a single repository variable.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/variables#get-a-repository-variable\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/variables/{name}\nfunc (s *ActionsService) GetRepoVariable(ctx context.Context, owner, repo, name string) (*ActionsVariable, *Response, error) {\n\turl := fmt.Sprintf(\"repos/%v/%v/actions/variables/%v\", owner, repo, name)\n\treturn s.getVariable(ctx, url)\n}\n\n// GetOrgVariable gets a single organization variable.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/variables#get-an-organization-variable\n//\n//meta:operation GET /orgs/{org}/actions/variables/{name}\nfunc (s *ActionsService) GetOrgVariable(ctx context.Context, org, name string) (*ActionsVariable, *Response, error) {\n\turl := fmt.Sprintf(\"orgs/%v/actions/variables/%v\", org, name)\n\treturn s.getVariable(ctx, url)\n}\n\n// GetEnvVariable gets a single environment variable.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/variables#get-an-environment-variable\n//\n//meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}\nfunc (s *ActionsService) GetEnvVariable(ctx context.Context, owner, repo, env, variableName string) (*ActionsVariable, *Response, error) {\n\turl := fmt.Sprintf(\"repos/%v/%v/environments/%v/variables/%v\", owner, repo, env, variableName)\n\treturn s.getVariable(ctx, url)\n}\n\nfunc (s *ActionsService) postVariable(ctx context.Context, url string, variable *ActionsVariable) (*Response, error) {\n\treq, err := s.client.NewRequest(\"POST\", url, variable)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// CreateRepoVariable creates a repository variable.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/variables#create-a-repository-variable\n//\n//meta:operation POST /repos/{owner}/{repo}/actions/variables\nfunc (s *ActionsService) CreateRepoVariable(ctx context.Context, owner, repo string, variable *ActionsVariable) (*Response, error) {\n\turl := fmt.Sprintf(\"repos/%v/%v/actions/variables\", owner, repo)\n\treturn s.postVariable(ctx, url, variable)\n}\n\n// CreateOrgVariable creates an organization variable.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/variables#create-an-organization-variable\n//\n//meta:operation POST /orgs/{org}/actions/variables\nfunc (s *ActionsService) CreateOrgVariable(ctx context.Context, org string, variable *ActionsVariable) (*Response, error) {\n\turl := fmt.Sprintf(\"orgs/%v/actions/variables\", org)\n\treturn s.postVariable(ctx, url, variable)\n}\n\n// CreateEnvVariable creates an environment variable.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/variables#create-an-environment-variable\n//\n//meta:operation POST /repos/{owner}/{repo}/environments/{environment_name}/variables\nfunc (s *ActionsService) CreateEnvVariable(ctx context.Context, owner, repo, env string, variable *ActionsVariable) (*Response, error) {\n\turl := fmt.Sprintf(\"repos/%v/%v/environments/%v/variables\", owner, repo, env)\n\treturn s.postVariable(ctx, url, variable)\n}\n\nfunc (s *ActionsService) patchVariable(ctx context.Context, url string, variable *ActionsVariable) (*Response, error) {\n\treq, err := s.client.NewRequest(\"PATCH\", url, variable)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// UpdateRepoVariable updates a repository variable.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/variables#update-a-repository-variable\n//\n//meta:operation PATCH /repos/{owner}/{repo}/actions/variables/{name}\nfunc (s *ActionsService) UpdateRepoVariable(ctx context.Context, owner, repo string, variable *ActionsVariable) (*Response, error) {\n\tif variable == nil {\n\t\treturn nil, errors.New(\"variable must be provided\")\n\t}\n\n\turl := fmt.Sprintf(\"repos/%v/%v/actions/variables/%v\", owner, repo, variable.Name)\n\treturn s.patchVariable(ctx, url, variable)\n}\n\n// UpdateOrgVariable updates an organization variable.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/variables#update-an-organization-variable\n//\n//meta:operation PATCH /orgs/{org}/actions/variables/{name}\nfunc (s *ActionsService) UpdateOrgVariable(ctx context.Context, org string, variable *ActionsVariable) (*Response, error) {\n\tif variable == nil {\n\t\treturn nil, errors.New(\"variable must be provided\")\n\t}\n\n\turl := fmt.Sprintf(\"orgs/%v/actions/variables/%v\", org, variable.Name)\n\treturn s.patchVariable(ctx, url, variable)\n}\n\n// UpdateEnvVariable updates an environment variable.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/variables#update-an-environment-variable\n//\n//meta:operation PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}\nfunc (s *ActionsService) UpdateEnvVariable(ctx context.Context, owner, repo, env string, variable *ActionsVariable) (*Response, error) {\n\tif variable == nil {\n\t\treturn nil, errors.New(\"variable must be provided\")\n\t}\n\n\turl := fmt.Sprintf(\"repos/%v/%v/environments/%v/variables/%v\", owner, repo, env, variable.Name)\n\treturn s.patchVariable(ctx, url, variable)\n}\n\nfunc (s *ActionsService) deleteVariable(ctx context.Context, url string) (*Response, error) {\n\treq, err := s.client.NewRequest(\"DELETE\", url, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// DeleteRepoVariable deletes a variable in a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/variables#delete-a-repository-variable\n//\n//meta:operation DELETE /repos/{owner}/{repo}/actions/variables/{name}\nfunc (s *ActionsService) DeleteRepoVariable(ctx context.Context, owner, repo, name string) (*Response, error) {\n\turl := fmt.Sprintf(\"repos/%v/%v/actions/variables/%v\", owner, repo, name)\n\treturn s.deleteVariable(ctx, url)\n}\n\n// DeleteOrgVariable deletes a variable in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/variables#delete-an-organization-variable\n//\n//meta:operation DELETE /orgs/{org}/actions/variables/{name}\nfunc (s *ActionsService) DeleteOrgVariable(ctx context.Context, org, name string) (*Response, error) {\n\turl := fmt.Sprintf(\"orgs/%v/actions/variables/%v\", org, name)\n\treturn s.deleteVariable(ctx, url)\n}\n\n// DeleteEnvVariable deletes a variable in an environment.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/variables#delete-an-environment-variable\n//\n//meta:operation DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}\nfunc (s *ActionsService) DeleteEnvVariable(ctx context.Context, owner, repo, env, variableName string) (*Response, error) {\n\turl := fmt.Sprintf(\"repos/%v/%v/environments/%v/variables/%v\", owner, repo, env, variableName)\n\treturn s.deleteVariable(ctx, url)\n}\n\nfunc (s *ActionsService) listSelectedReposForVariable(ctx context.Context, url string, opts *ListOptions) (*SelectedReposList, *Response, error) {\n\tu, err := addOptions(url, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar result *SelectedReposList\n\tresp, err := s.client.Do(ctx, req, &result)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn result, resp, nil\n}\n\n// ListSelectedReposForOrgVariable lists all repositories that have access to a variable.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/variables#list-selected-repositories-for-an-organization-variable\n//\n//meta:operation GET /orgs/{org}/actions/variables/{name}/repositories\nfunc (s *ActionsService) ListSelectedReposForOrgVariable(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) {\n\turl := fmt.Sprintf(\"orgs/%v/actions/variables/%v/repositories\", org, name)\n\treturn s.listSelectedReposForVariable(ctx, url, opts)\n}\n\nfunc (s *ActionsService) setSelectedReposForVariable(ctx context.Context, url string, ids SelectedRepoIDs) (*Response, error) {\n\ttype repoIDs struct {\n\t\tSelectedIDs SelectedRepoIDs `json:\"selected_repository_ids\"`\n\t}\n\n\treq, err := s.client.NewRequest(\"PUT\", url, repoIDs{SelectedIDs: ids})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// SetSelectedReposForOrgVariable sets the repositories that have access to a variable.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/variables#set-selected-repositories-for-an-organization-variable\n//\n//meta:operation PUT /orgs/{org}/actions/variables/{name}/repositories\nfunc (s *ActionsService) SetSelectedReposForOrgVariable(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) {\n\turl := fmt.Sprintf(\"orgs/%v/actions/variables/%v/repositories\", org, name)\n\treturn s.setSelectedReposForVariable(ctx, url, ids)\n}\n\nfunc (s *ActionsService) addSelectedRepoToVariable(ctx context.Context, url string) (*Response, error) {\n\treq, err := s.client.NewRequest(\"PUT\", url, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// AddSelectedRepoToOrgVariable adds a repository to an organization variable.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/variables#add-selected-repository-to-an-organization-variable\n//\n//meta:operation PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}\nfunc (s *ActionsService) AddSelectedRepoToOrgVariable(ctx context.Context, org, name string, repo *Repository) (*Response, error) {\n\tif repo == nil {\n\t\treturn nil, errors.New(\"repository must be provided\")\n\t}\n\tif repo.ID == nil {\n\t\treturn nil, errors.New(\"id must be provided\")\n\t}\n\n\turl := fmt.Sprintf(\"orgs/%v/actions/variables/%v/repositories/%v\", org, name, *repo.ID)\n\treturn s.addSelectedRepoToVariable(ctx, url)\n}\n\nfunc (s *ActionsService) removeSelectedRepoFromVariable(ctx context.Context, url string) (*Response, error) {\n\treq, err := s.client.NewRequest(\"DELETE\", url, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// RemoveSelectedRepoFromOrgVariable removes a repository from an organization variable.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/variables#remove-selected-repository-from-an-organization-variable\n//\n//meta:operation DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}\nfunc (s *ActionsService) RemoveSelectedRepoFromOrgVariable(ctx context.Context, org, name string, repo *Repository) (*Response, error) {\n\tif repo == nil {\n\t\treturn nil, errors.New(\"repository must be provided\")\n\t}\n\tif repo.ID == nil {\n\t\treturn nil, errors.New(\"id must be provided\")\n\t}\n\n\turl := fmt.Sprintf(\"orgs/%v/actions/variables/%v/repositories/%v\", org, name, *repo.ID)\n\treturn s.removeSelectedRepoFromVariable(ctx, url)\n}\n"
  },
  {
    "path": "github/actions_variables_test.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestActionsService_ListRepoVariables(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/variables\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `{\"total_count\":4,\"variables\":[{\"name\":\"A\",\"value\":\"AA\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"},{\"name\":\"B\",\"value\":\"BB\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"}]}`)\n\t})\n\n\topts := &ListOptions{Page: 2, PerPage: 2}\n\tctx := t.Context()\n\tvariables, _, err := client.Actions.ListRepoVariables(ctx, \"o\", \"r\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListRepoVariables returned error: %v\", err)\n\t}\n\n\twant := &ActionsVariables{\n\t\tTotalCount: 4,\n\t\tVariables: []*ActionsVariable{\n\t\t\t{Name: \"A\", Value: \"AA\", CreatedAt: &Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)}},\n\t\t\t{Name: \"B\", Value: \"BB\", CreatedAt: &Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)}},\n\t\t},\n\t}\n\tif !cmp.Equal(variables, want) {\n\t\tt.Errorf(\"Actions.ListRepoVariables returned %+v, want %+v\", variables, want)\n\t}\n\n\tconst methodName = \"ListRepoVariables\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListRepoVariables(ctx, \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListRepoVariables(ctx, \"o\", \"r\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_ListRepoOrgVariables(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/organization-variables\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `{\"total_count\":4,\"variables\":[{\"name\":\"A\",\"value\":\"AA\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"},{\"name\":\"B\",\"value\":\"BB\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"}]}`)\n\t})\n\n\topts := &ListOptions{Page: 2, PerPage: 2}\n\tctx := t.Context()\n\tvariables, _, err := client.Actions.ListRepoOrgVariables(ctx, \"o\", \"r\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListRepoOrgVariables returned error: %v\", err)\n\t}\n\n\twant := &ActionsVariables{\n\t\tTotalCount: 4,\n\t\tVariables: []*ActionsVariable{\n\t\t\t{Name: \"A\", Value: \"AA\", CreatedAt: &Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)}},\n\t\t\t{Name: \"B\", Value: \"BB\", CreatedAt: &Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)}},\n\t\t},\n\t}\n\tif !cmp.Equal(variables, want) {\n\t\tt.Errorf(\"Actions.ListRepoOrgVariables returned %+v, want %+v\", variables, want)\n\t}\n\n\tconst methodName = \"ListRepoOrgVariables\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListRepoOrgVariables(ctx, \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListRepoOrgVariables(ctx, \"o\", \"r\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetRepoVariable(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/variables/NAME\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"name\":\"NAME\",\"value\":\"VALUE\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"}`)\n\t})\n\n\tctx := t.Context()\n\tvariable, _, err := client.Actions.GetRepoVariable(ctx, \"o\", \"r\", \"NAME\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetRepoVariable returned error: %v\", err)\n\t}\n\n\twant := &ActionsVariable{\n\t\tName:      \"NAME\",\n\t\tValue:     \"VALUE\",\n\t\tCreatedAt: &Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t\tUpdatedAt: &Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t}\n\tif !cmp.Equal(variable, want) {\n\t\tt.Errorf(\"Actions.GetRepoVariable returned %+v, want %+v\", variable, want)\n\t}\n\n\tconst methodName = \"GetRepoVariable\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetRepoVariable(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetRepoVariable(ctx, \"o\", \"r\", \"NAME\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_CreateRepoVariable(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/variables\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\ttestBody(t, r, `{\"name\":\"NAME\",\"value\":\"VALUE\"}`+\"\\n\")\n\t\tw.WriteHeader(http.StatusCreated)\n\t})\n\n\tinput := &ActionsVariable{\n\t\tName:  \"NAME\",\n\t\tValue: \"VALUE\",\n\t}\n\tctx := t.Context()\n\t_, err := client.Actions.CreateRepoVariable(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.CreateRepoVariable returned error: %v\", err)\n\t}\n\n\tconst methodName = \"CreateRepoVariable\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.CreateRepoVariable(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.CreateRepoVariable(ctx, \"o\", \"r\", input)\n\t})\n}\n\nfunc TestActionsService_UpdateRepoVariable(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/variables/NAME\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\ttestBody(t, r, `{\"name\":\"NAME\",\"value\":\"VALUE\"}`+\"\\n\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tinput := &ActionsVariable{\n\t\tName:  \"NAME\",\n\t\tValue: \"VALUE\",\n\t}\n\tctx := t.Context()\n\t_, err := client.Actions.UpdateRepoVariable(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.UpdateRepoVariable returned error: %v\", err)\n\t}\n\n\tconst methodName = \"UpdateRepoVariable\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.UpdateRepoVariable(ctx, \"o\", \"r\", nil)\n\t\treturn err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.UpdateRepoVariable(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.UpdateRepoVariable(ctx, \"o\", \"r\", input)\n\t})\n}\n\nfunc TestActionsService_DeleteRepoVariable(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/variables/NAME\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.DeleteRepoVariable(ctx, \"o\", \"r\", \"NAME\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.( returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteRepoVariable\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.DeleteRepoVariable(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.DeleteRepoVariable(ctx, \"o\", \"r\", \"NAME\")\n\t})\n}\n\nfunc TestActionsService_ListOrgVariables(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/variables\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `{\"total_count\":3,\"variables\":[{\"name\":\"A\",\"value\":\"AA\",\"created_at\":\"2019-08-10T14:59:22Z\",\"updated_at\":\"2020-01-10T14:59:22Z\",\"visibility\":\"private\"},{\"name\":\"B\",\"value\":\"BB\",\"created_at\":\"2019-08-10T14:59:22Z\",\"updated_at\":\"2020-01-10T14:59:22Z\",\"visibility\":\"all\"},{\"name\":\"C\",\"value\":\"CC\",\"created_at\":\"2019-08-10T14:59:22Z\",\"updated_at\":\"2020-01-10T14:59:22Z\",\"visibility\":\"selected\",\"selected_repositories_url\":\"https://api.github.com/orgs/octo-org/actions/variables/VAR/repositories\"}]}`)\n\t})\n\n\topts := &ListOptions{Page: 2, PerPage: 2}\n\tctx := t.Context()\n\tvariables, _, err := client.Actions.ListOrgVariables(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListOrgVariables returned error: %v\", err)\n\t}\n\n\twant := &ActionsVariables{\n\t\tTotalCount: 3,\n\t\tVariables: []*ActionsVariable{\n\t\t\t{Name: \"A\", Value: \"AA\", CreatedAt: &Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 10, 14, 59, 22, 0, time.UTC)}, Visibility: Ptr(\"private\")},\n\t\t\t{Name: \"B\", Value: \"BB\", CreatedAt: &Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 10, 14, 59, 22, 0, time.UTC)}, Visibility: Ptr(\"all\")},\n\t\t\t{Name: \"C\", Value: \"CC\", CreatedAt: &Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 10, 14, 59, 22, 0, time.UTC)}, Visibility: Ptr(\"selected\"), SelectedRepositoriesURL: Ptr(\"https://api.github.com/orgs/octo-org/actions/variables/VAR/repositories\")},\n\t\t},\n\t}\n\tif !cmp.Equal(variables, want) {\n\t\tt.Errorf(\"Actions.ListOrgVariables returned %+v, want %+v\", variables, want)\n\t}\n\n\tconst methodName = \"ListOrgVariables\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListOrgVariables(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListOrgVariables(ctx, \"o\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetOrgVariable(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/variables/NAME\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"name\":\"NAME\",\"value\":\"VALUE\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\",\"visibility\":\"selected\",\"selected_repositories_url\":\"https://api.github.com/orgs/octo-org/actions/variables/VAR/repositories\"}`)\n\t})\n\n\tctx := t.Context()\n\tvariable, _, err := client.Actions.GetOrgVariable(ctx, \"o\", \"NAME\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetOrgVariable returned error: %v\", err)\n\t}\n\n\twant := &ActionsVariable{\n\t\tName:                    \"NAME\",\n\t\tValue:                   \"VALUE\",\n\t\tCreatedAt:               &Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t\tUpdatedAt:               &Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t\tVisibility:              Ptr(\"selected\"),\n\t\tSelectedRepositoriesURL: Ptr(\"https://api.github.com/orgs/octo-org/actions/variables/VAR/repositories\"),\n\t}\n\tif !cmp.Equal(variable, want) {\n\t\tt.Errorf(\"Actions.GetOrgVariable returned %+v, want %+v\", variable, want)\n\t}\n\n\tconst methodName = \"GetOrgVariable\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetOrgVariable(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetOrgVariable(ctx, \"o\", \"NAME\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_CreateOrgVariable(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/variables\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\ttestBody(t, r, `{\"name\":\"NAME\",\"value\":\"VALUE\",\"visibility\":\"selected\",\"selected_repository_ids\":[1296269,1269280]}`+\"\\n\")\n\t\tw.WriteHeader(http.StatusCreated)\n\t})\n\n\tinput := &ActionsVariable{\n\t\tName:                  \"NAME\",\n\t\tValue:                 \"VALUE\",\n\t\tVisibility:            Ptr(\"selected\"),\n\t\tSelectedRepositoryIDs: &SelectedRepoIDs{1296269, 1269280},\n\t}\n\tctx := t.Context()\n\t_, err := client.Actions.CreateOrgVariable(ctx, \"o\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.CreateOrgVariable returned error: %v\", err)\n\t}\n\n\tconst methodName = \"CreateOrgVariable\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.CreateOrgVariable(ctx, \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.CreateOrgVariable(ctx, \"o\", input)\n\t})\n}\n\nfunc TestActionsService_UpdateOrgVariable(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/variables/NAME\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\ttestBody(t, r, `{\"name\":\"NAME\",\"value\":\"VALUE\",\"visibility\":\"selected\",\"selected_repository_ids\":[1296269,1269280]}`+\"\\n\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tinput := &ActionsVariable{\n\t\tName:                  \"NAME\",\n\t\tValue:                 \"VALUE\",\n\t\tVisibility:            Ptr(\"selected\"),\n\t\tSelectedRepositoryIDs: &SelectedRepoIDs{1296269, 1269280},\n\t}\n\tctx := t.Context()\n\t_, err := client.Actions.UpdateOrgVariable(ctx, \"o\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.UpdateOrgVariable returned error: %v\", err)\n\t}\n\n\tconst methodName = \"UpdateOrgVariable\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.UpdateOrgVariable(ctx, \"o\", nil)\n\t\treturn err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.UpdateOrgVariable(ctx, \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.UpdateOrgVariable(ctx, \"o\", input)\n\t})\n}\n\nfunc TestActionsService_ListSelectedReposForOrgVariable(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/variables/NAME/repositories\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"total_count\":1,\"repositories\":[{\"id\":1}]}`)\n\t})\n\n\topts := &ListOptions{Page: 2, PerPage: 2}\n\tctx := t.Context()\n\trepos, _, err := client.Actions.ListSelectedReposForOrgVariable(ctx, \"o\", \"NAME\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.( returned error: %v\", err)\n\t}\n\n\twant := &SelectedReposList{\n\t\tTotalCount: Ptr(1),\n\t\tRepositories: []*Repository{\n\t\t\t{ID: Ptr(int64(1))},\n\t\t},\n\t}\n\tif !cmp.Equal(repos, want) {\n\t\tt.Errorf(\"Actions.( returned %+v, want %+v\", repos, want)\n\t}\n\n\tconst methodName = \"ListSelectedReposForOrgVariable\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListSelectedReposForOrgVariable(ctx, \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListSelectedReposForOrgVariable(ctx, \"o\", \"NAME\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_SetSelectedReposForOrgSVariable(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/variables/NAME/repositories\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\ttestBody(t, r, `{\"selected_repository_ids\":[64780797]}`+\"\\n\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.SetSelectedReposForOrgVariable(ctx, \"o\", \"NAME\", SelectedRepoIDs{64780797})\n\tif err != nil {\n\t\tt.Errorf(\"Actions.( returned error: %v\", err)\n\t}\n\n\tconst methodName = \"SetSelectedReposForOrgVariable\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.SetSelectedReposForOrgVariable(ctx, \"\\n\", \"\\n\", SelectedRepoIDs{64780797})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.SetSelectedReposForOrgVariable(ctx, \"o\", \"NAME\", SelectedRepoIDs{64780797})\n\t})\n}\n\nfunc TestActionsService_AddSelectedRepoToOrgVariable(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/variables/NAME/repositories/1234\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t})\n\n\trepo := &Repository{ID: Ptr(int64(1234))}\n\tctx := t.Context()\n\t_, err := client.Actions.AddSelectedRepoToOrgVariable(ctx, \"o\", \"NAME\", repo)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.AddSelectedRepoToOrgVariable returned error: %v\", err)\n\t}\n\n\tconst methodName = \"AddSelectedRepoToOrgVariable\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.AddSelectedRepoToOrgVariable(ctx, \"o\", \"NAME\", nil)\n\t\treturn err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.AddSelectedRepoToOrgVariable(ctx, \"o\", \"NAME\", &Repository{ID: nil})\n\t\treturn err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.AddSelectedRepoToOrgVariable(ctx, \"\\n\", \"\\n\", repo)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.AddSelectedRepoToOrgVariable(ctx, \"o\", \"NAME\", repo)\n\t})\n}\n\nfunc TestActionsService_RemoveSelectedRepoFromOrgVariable(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/variables/NAME/repositories/1234\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\trepo := &Repository{ID: Ptr(int64(1234))}\n\tctx := t.Context()\n\t_, err := client.Actions.RemoveSelectedRepoFromOrgVariable(ctx, \"o\", \"NAME\", repo)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.RemoveSelectedRepoFromOrgVariable returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveSelectedRepoFromOrgVariable\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.RemoveSelectedRepoFromOrgVariable(ctx, \"o\", \"NAME\", nil)\n\t\treturn err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.RemoveSelectedRepoFromOrgVariable(ctx, \"o\", \"NAME\", &Repository{ID: nil})\n\t\treturn err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.RemoveSelectedRepoFromOrgVariable(ctx, \"\\n\", \"\\n\", repo)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.RemoveSelectedRepoFromOrgVariable(ctx, \"o\", \"NAME\", repo)\n\t})\n}\n\nfunc TestActionsService_DeleteOrgVariable(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/variables/NAME\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.DeleteOrgVariable(ctx, \"o\", \"NAME\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.DeleteOrgVariable returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteOrgVariable\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.DeleteOrgVariable(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.DeleteOrgVariable(ctx, \"o\", \"NAME\")\n\t})\n}\n\nfunc TestActionsService_ListEnvVariables(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/usr/1/environments/e/variables\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `{\"total_count\":4,\"variables\":[{\"name\":\"A\",\"value\":\"AA\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"},{\"name\":\"B\",\"value\":\"BB\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"}]}`)\n\t})\n\n\topts := &ListOptions{Page: 2, PerPage: 2}\n\tctx := t.Context()\n\tvariables, _, err := client.Actions.ListEnvVariables(ctx, \"usr\", \"1\", \"e\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListEnvVariables returned error: %v\", err)\n\t}\n\n\twant := &ActionsVariables{\n\t\tTotalCount: 4,\n\t\tVariables: []*ActionsVariable{\n\t\t\t{Name: \"A\", Value: \"AA\", CreatedAt: &Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)}},\n\t\t\t{Name: \"B\", Value: \"BB\", CreatedAt: &Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)}},\n\t\t},\n\t}\n\tif !cmp.Equal(variables, want) {\n\t\tt.Errorf(\"Actions.ListEnvVariables returned %+v, want %+v\", variables, want)\n\t}\n\n\tconst methodName = \"ListEnvVariables\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListEnvVariables(ctx, \"usr\", \"0\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListEnvVariables(ctx, \"usr\", \"1\", \"e\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetEnvVariable(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/usr/1/environments/e/variables/variable\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"name\":\"variable\",\"value\":\"VAR\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"}`)\n\t})\n\n\tctx := t.Context()\n\tvariable, _, err := client.Actions.GetEnvVariable(ctx, \"usr\", \"1\", \"e\", \"variable\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetEnvVariable returned error: %v\", err)\n\t}\n\n\twant := &ActionsVariable{\n\t\tName:      \"variable\",\n\t\tValue:     \"VAR\",\n\t\tCreatedAt: &Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t\tUpdatedAt: &Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t}\n\tif !cmp.Equal(variable, want) {\n\t\tt.Errorf(\"Actions.GetEnvVariable returned %+v, want %+v\", variable, want)\n\t}\n\n\tconst methodName = \"GetEnvVariable\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetEnvVariable(ctx, \"usr\", \"0\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetEnvVariable(ctx, \"usr\", \"1\", \"e\", \"variable\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_CreateEnvVariable(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/usr/1/environments/e/variables\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\ttestBody(t, r, `{\"name\":\"variable\",\"value\":\"VAR\"}`+\"\\n\")\n\t\tw.WriteHeader(http.StatusCreated)\n\t})\n\n\tinput := &ActionsVariable{\n\t\tName:  \"variable\",\n\t\tValue: \"VAR\",\n\t}\n\tctx := t.Context()\n\t_, err := client.Actions.CreateEnvVariable(ctx, \"usr\", \"1\", \"e\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.CreateEnvVariable returned error: %v\", err)\n\t}\n\n\tconst methodName = \"CreateEnvVariable\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.CreateEnvVariable(ctx, \"usr\", \"0\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.CreateEnvVariable(ctx, \"usr\", \"1\", \"e\", input)\n\t})\n}\n\nfunc TestActionsService_UpdateEnvVariable(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/usr/1/environments/e/variables/variable\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\ttestBody(t, r, `{\"name\":\"variable\",\"value\":\"VAR\"}`+\"\\n\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tinput := &ActionsVariable{\n\t\tName:  \"variable\",\n\t\tValue: \"VAR\",\n\t}\n\tctx := t.Context()\n\t_, err := client.Actions.UpdateEnvVariable(ctx, \"usr\", \"1\", \"e\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.UpdateEnvVariable returned error: %v\", err)\n\t}\n\n\tconst methodName = \"UpdateEnvVariable\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.UpdateEnvVariable(ctx, \"usr\", \"1\", \"e\", nil)\n\t\treturn err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.UpdateEnvVariable(ctx, \"usr\", \"1\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.UpdateEnvVariable(ctx, \"usr\", \"1\", \"e\", input)\n\t})\n}\n\nfunc TestActionsService_DeleteEnvVariable(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/usr/1/environments/e/variables/variable\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.DeleteEnvVariable(ctx, \"usr\", \"1\", \"e\", \"variable\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.DeleteEnvVariable returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteEnvVariable\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.DeleteEnvVariable(ctx, \"usr\", \"0\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.DeleteEnvVariable(ctx, \"usr\", \"1\", \"r\", \"variable\")\n\t})\n}\n\nfunc TestActionVariable_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ActionsVariable{}, `{\n\t\t\"name\": \"\",\n\t\t\"value\": \"\"\n\t}`)\n\n\tav := &ActionsVariable{\n\t\tName:                    \"n\",\n\t\tValue:                   \"v\",\n\t\tCreatedAt:               &Timestamp{referenceTime},\n\t\tUpdatedAt:               &Timestamp{referenceTime},\n\t\tVisibility:              Ptr(\"v\"),\n\t\tSelectedRepositoriesURL: Ptr(\"s\"),\n\t\tSelectedRepositoryIDs:   &SelectedRepoIDs{1, 2, 3},\n\t}\n\n\twant := fmt.Sprintf(`{\n\t\t\"name\": \"n\",\n\t\t\"value\": \"v\",\n\t\t\"created_at\": %v,\n\t\t\"updated_at\": %v,\n\t\t\"visibility\": \"v\",\n\t\t\"selected_repositories_url\": \"s\",\n\t\t\"selected_repository_ids\": [1,2,3]\n\t}`, referenceTimeStr, referenceTimeStr)\n\n\ttestJSONMarshal(t, av, want)\n}\n"
  },
  {
    "path": "github/actions_workflow_jobs.go",
    "content": "// Copyright 2020 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n)\n\n// TaskStep represents a single task step from a sequence of tasks of a job.\ntype TaskStep struct {\n\tName        *string    `json:\"name,omitempty\"`\n\tStatus      *string    `json:\"status,omitempty\"`\n\tConclusion  *string    `json:\"conclusion,omitempty\"`\n\tNumber      *int64     `json:\"number,omitempty\"`\n\tStartedAt   *Timestamp `json:\"started_at,omitempty\"`\n\tCompletedAt *Timestamp `json:\"completed_at,omitempty\"`\n}\n\n// WorkflowJob represents a repository action workflow job.\ntype WorkflowJob struct {\n\tID          *int64      `json:\"id,omitempty\"`\n\tRunID       *int64      `json:\"run_id,omitempty\"`\n\tRunURL      *string     `json:\"run_url,omitempty\"`\n\tNodeID      *string     `json:\"node_id,omitempty\"`\n\tHeadBranch  *string     `json:\"head_branch,omitempty\"`\n\tHeadSHA     *string     `json:\"head_sha,omitempty\"`\n\tURL         *string     `json:\"url,omitempty\"`\n\tHTMLURL     *string     `json:\"html_url,omitempty\"`\n\tStatus      *string     `json:\"status,omitempty\"`\n\tConclusion  *string     `json:\"conclusion,omitempty\"`\n\tCreatedAt   *Timestamp  `json:\"created_at,omitempty\"`\n\tStartedAt   *Timestamp  `json:\"started_at,omitempty\"`\n\tCompletedAt *Timestamp  `json:\"completed_at,omitempty\"`\n\tName        *string     `json:\"name,omitempty\"`\n\tSteps       []*TaskStep `json:\"steps,omitempty\"`\n\tCheckRunURL *string     `json:\"check_run_url,omitempty\"`\n\t// Labels represents runner labels from the `runs-on:` key from a GitHub Actions workflow.\n\tLabels          []string `json:\"labels,omitempty\"`\n\tRunnerID        *int64   `json:\"runner_id,omitempty\"`\n\tRunnerName      *string  `json:\"runner_name,omitempty\"`\n\tRunnerGroupID   *int64   `json:\"runner_group_id,omitempty\"`\n\tRunnerGroupName *string  `json:\"runner_group_name,omitempty\"`\n\tRunAttempt      *int64   `json:\"run_attempt,omitempty\"`\n\tWorkflowName    *string  `json:\"workflow_name,omitempty\"`\n}\n\n// Jobs represents a slice of repository action workflow job.\ntype Jobs struct {\n\tTotalCount *int           `json:\"total_count,omitempty\"`\n\tJobs       []*WorkflowJob `json:\"jobs,omitempty\"`\n}\n\n// ListWorkflowJobsOptions specifies optional parameters to ListWorkflowJobs.\ntype ListWorkflowJobsOptions struct {\n\t// Filter specifies how jobs should be filtered by their completed_at timestamp.\n\t// Possible values are:\n\t//     latest - Returns jobs from the most recent execution of the workflow run\n\t//     all - Returns all jobs for a workflow run, including from old executions of the workflow run\n\t//\n\t// Default value is \"latest\".\n\tFilter string `url:\"filter,omitempty\"`\n\tListOptions\n}\n\n// ListWorkflowJobs lists all jobs for a workflow run.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs\nfunc (s *ActionsService) ListWorkflowJobs(ctx context.Context, owner, repo string, runID int64, opts *ListWorkflowJobsOptions) (*Jobs, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/runs/%v/jobs\", owner, repo, runID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar jobs *Jobs\n\tresp, err := s.client.Do(ctx, req, &jobs)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn jobs, resp, nil\n}\n\n// ListWorkflowJobsAttempt lists jobs for a workflow run Attempt.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run-attempt\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs\nfunc (s *ActionsService) ListWorkflowJobsAttempt(ctx context.Context, owner, repo string, runID, attemptNumber int64, opts *ListOptions) (*Jobs, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/runs/%v/attempts/%v/jobs\", owner, repo, runID, attemptNumber)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar jobs *Jobs\n\tresp, err := s.client.Do(ctx, req, &jobs)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn jobs, resp, nil\n}\n\n// GetWorkflowJobByID gets a specific job in a workflow run by ID.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/jobs/{job_id}\nfunc (s *ActionsService) GetWorkflowJobByID(ctx context.Context, owner, repo string, jobID int64) (*WorkflowJob, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/jobs/%v\", owner, repo, jobID)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar job *WorkflowJob\n\tresp, err := s.client.Do(ctx, req, &job)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn job, resp, nil\n}\n\n// GetWorkflowJobLogs gets a redirect URL to download a plain text file of logs for a workflow job.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflow-jobs#download-job-logs-for-a-workflow-run\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs\nfunc (s *ActionsService) GetWorkflowJobLogs(ctx context.Context, owner, repo string, jobID int64, maxRedirects int) (*url.URL, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/jobs/%v/logs\", owner, repo, jobID)\n\n\tif s.client.RateLimitRedirectionalEndpoints {\n\t\treturn s.getWorkflowJobLogsWithRateLimit(ctx, u, maxRedirects)\n\t}\n\n\treturn s.getWorkflowJobLogsWithoutRateLimit(ctx, u, maxRedirects)\n}\n\nfunc (s *ActionsService) getWorkflowJobLogsWithoutRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) {\n\tresp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, maxRedirects)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != http.StatusFound {\n\t\treturn nil, newResponse(resp), fmt.Errorf(\"unexpected status code: %v\", resp.Status)\n\t}\n\n\tparsedURL, err := url.Parse(resp.Header.Get(\"Location\"))\n\treturn parsedURL, newResponse(resp), err\n}\n\nfunc (s *ActionsService) getWorkflowJobLogsWithRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) {\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\turl, resp, err := s.client.bareDoUntilFound(ctx, req, maxRedirects)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\tdefer resp.Body.Close()\n\n\t// If we didn't receive a valid Location in a 302 response\n\tif url == nil {\n\t\treturn nil, resp, fmt.Errorf(\"unexpected status code: %v\", resp.Status)\n\t}\n\n\treturn url, resp, nil\n}\n"
  },
  {
    "path": "github/actions_workflow_jobs_test.go",
    "content": "// Copyright 2020 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestActionsService_ListWorkflowJobs(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/runs/29679449/jobs\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `{\"total_count\":4,\"jobs\":[{\"id\":399444496,\"run_id\":29679449,\"started_at\":\"2019-01-02T15:04:05Z\",\"completed_at\":\"2020-01-02T15:04:05Z\"},{\"id\":399444497,\"run_id\":29679449,\"started_at\":\"2019-01-02T15:04:05Z\",\"completed_at\":\"2020-01-02T15:04:05Z\"}]}`)\n\t})\n\n\topts := &ListWorkflowJobsOptions{ListOptions: ListOptions{Page: 2, PerPage: 2}}\n\tctx := t.Context()\n\tjobs, _, err := client.Actions.ListWorkflowJobs(ctx, \"o\", \"r\", 29679449, opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListWorkflowJobs returned error: %v\", err)\n\t}\n\n\twant := &Jobs{\n\t\tTotalCount: Ptr(4),\n\t\tJobs: []*WorkflowJob{\n\t\t\t{ID: Ptr(int64(399444496)), RunID: Ptr(int64(29679449)), StartedAt: &Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)}, CompletedAt: &Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)}},\n\t\t\t{ID: Ptr(int64(399444497)), RunID: Ptr(int64(29679449)), StartedAt: &Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)}, CompletedAt: &Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)}},\n\t\t},\n\t}\n\tif !cmp.Equal(jobs, want) {\n\t\tt.Errorf(\"Actions.ListWorkflowJobs returned %+v, want %+v\", jobs, want)\n\t}\n\n\tconst methodName = \"ListWorkflowJobs\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListWorkflowJobs(ctx, \"\\n\", \"\\n\", 29679449, opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListWorkflowJobs(ctx, \"o\", \"r\", 29679449, opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_ListWorkflowJobs_Filter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/runs/29679449/jobs\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"filter\": \"all\", \"per_page\": \"2\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `{\"total_count\":4,\"jobs\":[{\"id\":399444496,\"run_id\":29679449,\"started_at\":\"2019-01-02T15:04:05Z\",\"completed_at\":\"2020-01-02T15:04:05Z\"},{\"id\":399444497,\"run_id\":29679449,\"started_at\":\"2019-01-02T15:04:05Z\",\"completed_at\":\"2020-01-02T15:04:05Z\"}]}`)\n\t})\n\n\topts := &ListWorkflowJobsOptions{Filter: \"all\", ListOptions: ListOptions{Page: 2, PerPage: 2}}\n\tctx := t.Context()\n\tjobs, _, err := client.Actions.ListWorkflowJobs(ctx, \"o\", \"r\", 29679449, opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListWorkflowJobs returned error: %v\", err)\n\t}\n\n\twant := &Jobs{\n\t\tTotalCount: Ptr(4),\n\t\tJobs: []*WorkflowJob{\n\t\t\t{ID: Ptr(int64(399444496)), RunID: Ptr(int64(29679449)), StartedAt: &Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)}, CompletedAt: &Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)}},\n\t\t\t{ID: Ptr(int64(399444497)), RunID: Ptr(int64(29679449)), StartedAt: &Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)}, CompletedAt: &Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)}},\n\t\t},\n\t}\n\tif !cmp.Equal(jobs, want) {\n\t\tt.Errorf(\"Actions.ListWorkflowJobs returned %+v, want %+v\", jobs, want)\n\t}\n}\n\nfunc TestActionsService_ListWorkflowJobsAttempt(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/runs/29679449/attempts/1/jobs\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `{\"total_count\":4,\"jobs\":[{\"id\":399444496,\"run_id\":29679449,\"started_at\":\"2019-01-02T15:04:05Z\",\"completed_at\":\"2020-01-02T15:04:05Z\",\"run_attempt\":2},{\"id\":399444497,\"run_id\":29679449,\"started_at\":\"2019-01-02T15:04:05Z\",\"completed_at\":\"2020-01-02T15:04:05Z\",\"run_attempt\":2}]}`)\n\t})\n\topts := &ListOptions{Page: 2, PerPage: 2}\n\tctx := t.Context()\n\tjobs, _, err := client.Actions.ListWorkflowJobsAttempt(ctx, \"o\", \"r\", 29679449, 1, opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListWorkflowJobsAttempt returned error: %v\", err)\n\t}\n\n\twant := &Jobs{\n\t\tTotalCount: Ptr(4),\n\t\tJobs: []*WorkflowJob{\n\t\t\t{\n\t\t\t\tID:          Ptr(int64(399444496)),\n\t\t\t\tRunID:       Ptr(int64(29679449)),\n\t\t\t\tStartedAt:   &Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t\t\t\tCompletedAt: &Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t\t\t\tRunAttempt:  Ptr(int64(2)),\n\t\t\t},\n\t\t\t{\n\t\t\t\tID:          Ptr(int64(399444497)),\n\t\t\t\tRunID:       Ptr(int64(29679449)),\n\t\t\t\tStartedAt:   &Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t\t\t\tCompletedAt: &Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t\t\t\tRunAttempt:  Ptr(int64(2)),\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(jobs, want) {\n\t\tt.Errorf(\"Actions.ListWorkflowJobsAttempt returned %+v, want %+v\", jobs, want)\n\t}\n\n\tconst methodName = \"ListWorkflowJobsAttempt\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListWorkflowJobsAttempt(ctx, \"\\n\", \"\\n\", 29679449, 1, opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListWorkflowJobsAttempt(ctx, \"o\", \"r\", 29679449, 1, opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetWorkflowJobByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/jobs/399444496\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":399444496,\"started_at\":\"2019-01-02T15:04:05Z\",\"completed_at\":\"2020-01-02T15:04:05Z\"}`)\n\t})\n\n\tctx := t.Context()\n\tjob, _, err := client.Actions.GetWorkflowJobByID(ctx, \"o\", \"r\", 399444496)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetWorkflowJobByID returned error: %v\", err)\n\t}\n\n\twant := &WorkflowJob{\n\t\tID:          Ptr(int64(399444496)),\n\t\tStartedAt:   &Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t\tCompletedAt: &Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t}\n\tif !cmp.Equal(job, want) {\n\t\tt.Errorf(\"Actions.GetWorkflowJobByID returned %+v, want %+v\", job, want)\n\t}\n\n\tconst methodName = \"GetWorkflowJobByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetWorkflowJobByID(ctx, \"\\n\", \"\\n\", 399444496)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetWorkflowJobByID(ctx, \"o\", \"r\", 399444496)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetWorkflowJobLogs(t *testing.T) {\n\tt.Parallel()\n\ttcs := []struct {\n\t\tname              string\n\t\trespectRateLimits bool\n\t}{\n\t\t{\n\t\t\tname:              \"withoutRateLimits\",\n\t\t\trespectRateLimits: false,\n\t\t},\n\t\t{\n\t\t\tname:              \"withRateLimits\",\n\t\t\trespectRateLimits: true,\n\t\t},\n\t}\n\n\tfor _, tc := range tcs {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\t\t\tclient.RateLimitRedirectionalEndpoints = tc.respectRateLimits\n\n\t\t\tmux.HandleFunc(\"/repos/o/r/actions/jobs/399444496/logs\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\thttp.Redirect(w, r, \"https://github.com/a\", http.StatusFound)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\turl, resp, err := client.Actions.GetWorkflowJobLogs(ctx, \"o\", \"r\", 399444496, 1)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Actions.GetWorkflowJobLogs returned error: %v\", err)\n\t\t\t}\n\t\t\tif resp.StatusCode != http.StatusFound {\n\t\t\t\tt.Errorf(\"Actions.GetWorkflowJobLogs returned status: %v, want %v\", resp.StatusCode, http.StatusFound)\n\t\t\t}\n\t\t\twant := \"https://github.com/a\"\n\t\t\tif url.String() != want {\n\t\t\t\tt.Errorf(\"Actions.GetWorkflowJobLogs returned %+v, want %+v\", url, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"GetWorkflowJobLogs\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Actions.GetWorkflowJobLogs(ctx, \"\\n\", \"\\n\", 399444496, 1)\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\t// Add custom round tripper\n\t\t\tclient.client.Transport = roundTripperFunc(func(*http.Request) (*http.Response, error) {\n\t\t\t\treturn nil, errors.New(\"failed to get workflow logs\")\n\t\t\t})\n\t\t\t// propagate custom round tripper to client without CheckRedirect\n\t\t\tclient.initialize()\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Actions.GetWorkflowJobLogs(ctx, \"o\", \"r\", 399444496, 1)\n\t\t\t\treturn err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestActionsService_GetWorkflowJobLogs_StatusMovedPermanently_dontFollowRedirects(t *testing.T) {\n\tt.Parallel()\n\ttcs := []struct {\n\t\tname              string\n\t\trespectRateLimits bool\n\t}{\n\t\t{\n\t\t\tname:              \"withoutRateLimits\",\n\t\t\trespectRateLimits: false,\n\t\t},\n\t\t{\n\t\t\tname:              \"withRateLimits\",\n\t\t\trespectRateLimits: true,\n\t\t},\n\t}\n\n\tfor _, tc := range tcs {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\t\t\tclient.RateLimitRedirectionalEndpoints = tc.respectRateLimits\n\n\t\t\tmux.HandleFunc(\"/repos/o/r/actions/jobs/399444496/logs\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\thttp.Redirect(w, r, \"https://github.com/a\", http.StatusMovedPermanently)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\t_, resp, _ := client.Actions.GetWorkflowJobLogs(ctx, \"o\", \"r\", 399444496, 0)\n\t\t\tif resp.StatusCode != http.StatusMovedPermanently {\n\t\t\t\tt.Errorf(\"Actions.GetWorkflowJobLogs returned status: %v, want %v\", resp.StatusCode, http.StatusMovedPermanently)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestActionsService_GetWorkflowJobLogs_StatusMovedPermanently_followRedirects(t *testing.T) {\n\tt.Parallel()\n\ttcs := []struct {\n\t\tname              string\n\t\trespectRateLimits bool\n\t}{\n\t\t{\n\t\t\tname:              \"withoutRateLimits\",\n\t\t\trespectRateLimits: false,\n\t\t},\n\t\t{\n\t\t\tname:              \"withRateLimits\",\n\t\t\trespectRateLimits: true,\n\t\t},\n\t}\n\n\tfor _, tc := range tcs {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, serverURL := setup(t)\n\t\t\tclient.RateLimitRedirectionalEndpoints = tc.respectRateLimits\n\n\t\t\t// Mock a redirect link, which leads to an archive link\n\t\t\tmux.HandleFunc(\"/repos/o/r/actions/jobs/399444496/logs\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\tredirectURL, _ := url.Parse(serverURL + baseURLPath + \"/redirect\")\n\t\t\t\thttp.Redirect(w, r, redirectURL.String(), http.StatusMovedPermanently)\n\t\t\t})\n\n\t\t\tmux.HandleFunc(\"/redirect\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\thttp.Redirect(w, r, \"https://github.com/a\", http.StatusFound)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\turl, resp, err := client.Actions.GetWorkflowJobLogs(ctx, \"o\", \"r\", 399444496, 1)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Actions.GetWorkflowJobLogs returned error: %v\", err)\n\t\t\t}\n\n\t\t\tif resp.StatusCode != http.StatusFound {\n\t\t\t\tt.Errorf(\"Actions.GetWorkflowJobLogs returned status: %v, want %v\", resp.StatusCode, http.StatusFound)\n\t\t\t}\n\n\t\t\twant := \"https://github.com/a\"\n\t\t\tif url.String() != want {\n\t\t\t\tt.Errorf(\"Actions.GetWorkflowJobLogs returned %+v, want %+v\", url, want)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestActionsService_GetWorkflowJobLogs_unexpectedCode(t *testing.T) {\n\tt.Parallel()\n\ttcs := []struct {\n\t\tname              string\n\t\trespectRateLimits bool\n\t}{\n\t\t{\n\t\t\tname:              \"withoutRateLimits\",\n\t\t\trespectRateLimits: false,\n\t\t},\n\t\t{\n\t\t\tname:              \"withRateLimits\",\n\t\t\trespectRateLimits: true,\n\t\t},\n\t}\n\n\tfor _, tc := range tcs {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, serverURL := setup(t)\n\t\t\tclient.RateLimitRedirectionalEndpoints = tc.respectRateLimits\n\n\t\t\t// Mock a redirect link, which leads to an archive link\n\t\t\tmux.HandleFunc(\"/repos/o/r/actions/jobs/399444496/logs\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\tredirectURL, _ := url.Parse(serverURL + baseURLPath + \"/redirect\")\n\t\t\t\thttp.Redirect(w, r, redirectURL.String(), http.StatusMovedPermanently)\n\t\t\t})\n\n\t\t\tmux.HandleFunc(\"/redirect\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\tw.WriteHeader(http.StatusNoContent)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\turl, resp, err := client.Actions.GetWorkflowJobLogs(ctx, \"o\", \"r\", 399444496, 1)\n\t\t\tif err == nil {\n\t\t\t\tt.Fatal(\"Actions.GetWorkflowJobLogs should return error on unexpected code\")\n\t\t\t}\n\t\t\tif !strings.Contains(err.Error(), \"unexpected status code\") {\n\t\t\t\tt.Error(\"Actions.GetWorkflowJobLogs should return unexpected status code\")\n\t\t\t}\n\t\t\tif got, want := resp.Response.StatusCode, http.StatusNoContent; got != want {\n\t\t\t\tt.Errorf(\"Actions.GetWorkflowJobLogs return status %v, want %v\", got, want)\n\t\t\t}\n\t\t\tif url != nil {\n\t\t\t\tt.Errorf(\"Actions.GetWorkflowJobLogs return %+v, want nil\", url)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestTaskStep_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &TaskStep{}, \"{}\")\n\n\tu := &TaskStep{\n\t\tName:        Ptr(\"n\"),\n\t\tStatus:      Ptr(\"s\"),\n\t\tConclusion:  Ptr(\"c\"),\n\t\tNumber:      Ptr(int64(1)),\n\t\tStartedAt:   &Timestamp{referenceTime},\n\t\tCompletedAt: &Timestamp{referenceTime},\n\t}\n\n\twant := `{\n\t\t\"name\": \"n\",\n\t\t\"status\": \"s\",\n\t\t\"conclusion\": \"c\",\n\t\t\"number\": 1,\n\t\t\"started_at\": ` + referenceTimeStr + `,\n\t\t\"completed_at\": ` + referenceTimeStr + `\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestWorkflowJob_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &WorkflowJob{}, \"{}\")\n\n\tu := &WorkflowJob{\n\t\tID:          Ptr(int64(1)),\n\t\tRunID:       Ptr(int64(1)),\n\t\tRunURL:      Ptr(\"r\"),\n\t\tNodeID:      Ptr(\"n\"),\n\t\tHeadBranch:  Ptr(\"b\"),\n\t\tHeadSHA:     Ptr(\"h\"),\n\t\tURL:         Ptr(\"u\"),\n\t\tHTMLURL:     Ptr(\"h\"),\n\t\tStatus:      Ptr(\"s\"),\n\t\tConclusion:  Ptr(\"c\"),\n\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\tStartedAt:   &Timestamp{referenceTime},\n\t\tCompletedAt: &Timestamp{referenceTime},\n\t\tName:        Ptr(\"n\"),\n\t\tSteps: []*TaskStep{\n\t\t\t{\n\t\t\t\tName:        Ptr(\"n\"),\n\t\t\t\tStatus:      Ptr(\"s\"),\n\t\t\t\tConclusion:  Ptr(\"c\"),\n\t\t\t\tNumber:      Ptr(int64(1)),\n\t\t\t\tStartedAt:   &Timestamp{referenceTime},\n\t\t\t\tCompletedAt: &Timestamp{referenceTime},\n\t\t\t},\n\t\t},\n\t\tCheckRunURL:  Ptr(\"c\"),\n\t\tWorkflowName: Ptr(\"w\"),\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"run_id\": 1,\n\t\t\"run_url\": \"r\",\n\t\t\"node_id\": \"n\",\n\t\t\"head_branch\": \"b\",\n\t\t\"head_sha\": \"h\",\n\t\t\"url\": \"u\",\n\t\t\"html_url\": \"h\",\n\t\t\"status\": \"s\",\n\t\t\"conclusion\": \"c\",\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"started_at\": ` + referenceTimeStr + `,\n\t\t\"completed_at\": ` + referenceTimeStr + `,\n\t\t\"name\": \"n\",\n\t\t\"steps\": [{\n\t\t\t\"name\": \"n\",\n\t\t\t\"status\": \"s\",\n\t\t\t\"conclusion\": \"c\",\n\t\t\t\"number\": 1,\n\t\t\t\"started_at\": ` + referenceTimeStr + `,\n\t\t\t\"completed_at\": ` + referenceTimeStr + `\n\t\t}],\n\t\t\"check_run_url\": \"c\",\n\t\t\"workflow_name\": \"w\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestJobs_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Jobs{}, \"{}\")\n\n\tu := &Jobs{\n\t\tTotalCount: Ptr(1),\n\t\tJobs: []*WorkflowJob{\n\t\t\t{\n\t\t\t\tID:          Ptr(int64(1)),\n\t\t\t\tRunID:       Ptr(int64(1)),\n\t\t\t\tRunURL:      Ptr(\"r\"),\n\t\t\t\tNodeID:      Ptr(\"n\"),\n\t\t\t\tHeadBranch:  Ptr(\"b\"),\n\t\t\t\tHeadSHA:     Ptr(\"h\"),\n\t\t\t\tURL:         Ptr(\"u\"),\n\t\t\t\tHTMLURL:     Ptr(\"h\"),\n\t\t\t\tStatus:      Ptr(\"s\"),\n\t\t\t\tConclusion:  Ptr(\"c\"),\n\t\t\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\t\t\tStartedAt:   &Timestamp{referenceTime},\n\t\t\t\tCompletedAt: &Timestamp{referenceTime},\n\t\t\t\tName:        Ptr(\"n\"),\n\t\t\t\tSteps: []*TaskStep{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:        Ptr(\"n\"),\n\t\t\t\t\t\tStatus:      Ptr(\"s\"),\n\t\t\t\t\t\tConclusion:  Ptr(\"c\"),\n\t\t\t\t\t\tNumber:      Ptr(int64(1)),\n\t\t\t\t\t\tStartedAt:   &Timestamp{referenceTime},\n\t\t\t\t\t\tCompletedAt: &Timestamp{referenceTime},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tCheckRunURL:  Ptr(\"c\"),\n\t\t\t\tRunAttempt:   Ptr(int64(2)),\n\t\t\t\tWorkflowName: Ptr(\"w\"),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"total_count\": 1,\n\t\t\"jobs\": [{\n\t\t\t\"id\": 1,\n\t\t\t\"run_id\": 1,\n\t\t\t\"run_url\": \"r\",\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"head_branch\": \"b\",\n\t\t\t\"head_sha\": \"h\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"html_url\": \"h\",\n\t\t\t\"status\": \"s\",\n\t\t\t\"conclusion\": \"c\",\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"started_at\": ` + referenceTimeStr + `,\n\t\t\t\"completed_at\": ` + referenceTimeStr + `,\n\t\t\t\"name\": \"n\",\n\t\t\t\"steps\": [{\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"status\": \"s\",\n\t\t\t\t\"conclusion\": \"c\",\n\t\t\t\t\"number\": 1,\n\t\t\t\t\"started_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"completed_at\": ` + referenceTimeStr + `\n\t\t\t}],\n\t\t\t\"check_run_url\": \"c\",\n\t\t\t\"run_attempt\": 2,\n\t\t\t\"workflow_name\": \"w\"\n\t\t}]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/actions_workflow_runs.go",
    "content": "// Copyright 2020 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n)\n\n// WorkflowRun represents a repository action workflow run.\ntype WorkflowRun struct {\n\tID                  *int64                `json:\"id,omitempty\"`\n\tName                *string               `json:\"name,omitempty\"`\n\tNodeID              *string               `json:\"node_id,omitempty\"`\n\tHeadBranch          *string               `json:\"head_branch,omitempty\"`\n\tHeadSHA             *string               `json:\"head_sha,omitempty\"`\n\tPath                *string               `json:\"path,omitempty\"`\n\tRunNumber           *int                  `json:\"run_number,omitempty\"`\n\tRunAttempt          *int                  `json:\"run_attempt,omitempty\"`\n\tEvent               *string               `json:\"event,omitempty\"`\n\tDisplayTitle        *string               `json:\"display_title,omitempty\"`\n\tStatus              *string               `json:\"status,omitempty\"`\n\tConclusion          *string               `json:\"conclusion,omitempty\"`\n\tWorkflowID          *int64                `json:\"workflow_id,omitempty\"`\n\tCheckSuiteID        *int64                `json:\"check_suite_id,omitempty\"`\n\tCheckSuiteNodeID    *string               `json:\"check_suite_node_id,omitempty\"`\n\tURL                 *string               `json:\"url,omitempty\"`\n\tHTMLURL             *string               `json:\"html_url,omitempty\"`\n\tPullRequests        []*PullRequest        `json:\"pull_requests,omitempty\"`\n\tCreatedAt           *Timestamp            `json:\"created_at,omitempty\"`\n\tUpdatedAt           *Timestamp            `json:\"updated_at,omitempty\"`\n\tRunStartedAt        *Timestamp            `json:\"run_started_at,omitempty\"`\n\tJobsURL             *string               `json:\"jobs_url,omitempty\"`\n\tLogsURL             *string               `json:\"logs_url,omitempty\"`\n\tCheckSuiteURL       *string               `json:\"check_suite_url,omitempty\"`\n\tArtifactsURL        *string               `json:\"artifacts_url,omitempty\"`\n\tCancelURL           *string               `json:\"cancel_url,omitempty\"`\n\tRerunURL            *string               `json:\"rerun_url,omitempty\"`\n\tPreviousAttemptURL  *string               `json:\"previous_attempt_url,omitempty\"`\n\tHeadCommit          *HeadCommit           `json:\"head_commit,omitempty\"`\n\tWorkflowURL         *string               `json:\"workflow_url,omitempty\"`\n\tRepository          *Repository           `json:\"repository,omitempty\"`\n\tHeadRepository      *Repository           `json:\"head_repository,omitempty\"`\n\tActor               *User                 `json:\"actor,omitempty\"`\n\tTriggeringActor     *User                 `json:\"triggering_actor,omitempty\"`\n\tReferencedWorkflows []*ReferencedWorkflow `json:\"referenced_workflows,omitempty\"`\n}\n\n// WorkflowRuns represents a slice of repository action workflow run.\ntype WorkflowRuns struct {\n\tTotalCount   *int           `json:\"total_count,omitempty\"`\n\tWorkflowRuns []*WorkflowRun `json:\"workflow_runs,omitempty\"`\n}\n\n// ListWorkflowRunsOptions specifies optional parameters to ListWorkflowRuns.\ntype ListWorkflowRunsOptions struct {\n\tActor               string `url:\"actor,omitempty\"`\n\tBranch              string `url:\"branch,omitempty\"`\n\tEvent               string `url:\"event,omitempty\"`\n\tStatus              string `url:\"status,omitempty\"`\n\tCreated             string `url:\"created,omitempty\"`\n\tHeadSHA             string `url:\"head_sha,omitempty\"`\n\tExcludePullRequests bool   `url:\"exclude_pull_requests,omitempty\"`\n\tCheckSuiteID        int64  `url:\"check_suite_id,omitempty\"`\n\tListOptions\n}\n\n// WorkflowRunUsage represents a usage of a specific workflow run.\ntype WorkflowRunUsage struct {\n\tBillable      *WorkflowRunBillMap `json:\"billable,omitempty\"`\n\tRunDurationMS *int64              `json:\"run_duration_ms,omitempty\"`\n}\n\n// WorkflowRunBillMap represents different runner environments available for a workflow run.\n// Its key is the name of its environment, e.g. \"UBUNTU\", \"MACOS\", \"WINDOWS\", etc.\ntype WorkflowRunBillMap map[string]*WorkflowRunBill\n\n// WorkflowRunBill specifies billable time for a specific environment in a workflow run.\ntype WorkflowRunBill struct {\n\tTotalMS *int64               `json:\"total_ms,omitempty\"`\n\tJobs    *int                 `json:\"jobs,omitempty\"`\n\tJobRuns []*WorkflowRunJobRun `json:\"job_runs,omitempty\"`\n}\n\n// WorkflowRunJobRun represents a usage of individual jobs of a specific workflow run.\ntype WorkflowRunJobRun struct {\n\tJobID      *int   `json:\"job_id,omitempty\"`\n\tDurationMS *int64 `json:\"duration_ms,omitempty\"`\n}\n\n// WorkflowRunAttemptOptions specifies optional parameters to GetWorkflowRunAttempt.\ntype WorkflowRunAttemptOptions struct {\n\tExcludePullRequests *bool `url:\"exclude_pull_requests,omitempty\"`\n}\n\n// PendingDeploymentsRequest specifies body parameters to PendingDeployments.\ntype PendingDeploymentsRequest struct {\n\tEnvironmentIDs []int64 `json:\"environment_ids\"`\n\t// State can be one of: \"approved\", \"rejected\".\n\tState   string `json:\"state\"`\n\tComment string `json:\"comment\"`\n}\n\n// ReferencedWorkflow represents a referenced workflow in a workflow run.\ntype ReferencedWorkflow struct {\n\tPath *string `json:\"path,omitempty\"`\n\tSHA  *string `json:\"sha,omitempty\"`\n\tRef  *string `json:\"ref,omitempty\"`\n}\n\n// PendingDeployment represents the pending_deployments response.\ntype PendingDeployment struct {\n\tEnvironment           *PendingDeploymentEnvironment `json:\"environment,omitempty\"`\n\tWaitTimer             *int64                        `json:\"wait_timer,omitempty\"`\n\tWaitTimerStartedAt    *Timestamp                    `json:\"wait_timer_started_at,omitempty\"`\n\tCurrentUserCanApprove *bool                         `json:\"current_user_can_approve,omitempty\"`\n\tReviewers             []*RequiredReviewer           `json:\"reviewers,omitempty\"`\n}\n\n// PendingDeploymentEnvironment represents pending deployment environment properties.\ntype PendingDeploymentEnvironment struct {\n\tID      *int64  `json:\"id,omitempty\"`\n\tNodeID  *string `json:\"node_id,omitempty\"`\n\tName    *string `json:\"name,omitempty\"`\n\tURL     *string `json:\"url,omitempty\"`\n\tHTMLURL *string `json:\"html_url,omitempty\"`\n}\n\n// ReviewCustomDeploymentProtectionRuleRequest specifies the parameters to ReviewCustomDeploymentProtectionRule.\ntype ReviewCustomDeploymentProtectionRuleRequest struct {\n\tEnvironmentName string `json:\"environment_name\"`\n\tState           string `json:\"state\"`\n\tComment         string `json:\"comment\"`\n}\n\nfunc (s *ActionsService) listWorkflowRuns(ctx context.Context, endpoint string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) {\n\tu, err := addOptions(endpoint, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar runs *WorkflowRuns\n\tresp, err := s.client.Do(ctx, req, &runs)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn runs, resp, nil\n}\n\n// ListWorkflowRunsByID lists all workflow runs by workflow ID.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\nfunc (s *ActionsService) ListWorkflowRunsByID(ctx context.Context, owner, repo string, workflowID int64, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/workflows/%v/runs\", owner, repo, workflowID)\n\treturn s.listWorkflowRuns(ctx, u, opts)\n}\n\n// ListWorkflowRunsByFileName lists all workflow runs by workflow file name.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\nfunc (s *ActionsService) ListWorkflowRunsByFileName(ctx context.Context, owner, repo, workflowFileName string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/workflows/%v/runs\", owner, repo, workflowFileName)\n\treturn s.listWorkflowRuns(ctx, u, opts)\n}\n\n// ListRepositoryWorkflowRuns lists all workflow runs for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/runs\nfunc (s *ActionsService) ListRepositoryWorkflowRuns(ctx context.Context, owner, repo string, opts *ListWorkflowRunsOptions) (*WorkflowRuns, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/runs\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar runs *WorkflowRuns\n\tresp, err := s.client.Do(ctx, req, &runs)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn runs, resp, nil\n}\n\n// GetWorkflowRunByID gets a specific workflow run by ID.\n// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}\nfunc (s *ActionsService) GetWorkflowRunByID(ctx context.Context, owner, repo string, runID int64) (*WorkflowRun, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/runs/%v\", owner, repo, runID)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar run *WorkflowRun\n\tresp, err := s.client.Do(ctx, req, &run)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn run, resp, nil\n}\n\n// GetWorkflowRunAttempt gets a specific workflow run attempt.\n// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run-attempt\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}\nfunc (s *ActionsService) GetWorkflowRunAttempt(ctx context.Context, owner, repo string, runID int64, attemptNumber int, opts *WorkflowRunAttemptOptions) (*WorkflowRun, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/runs/%v/attempts/%v\", owner, repo, runID, attemptNumber)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar run *WorkflowRun\n\tresp, err := s.client.Do(ctx, req, &run)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn run, resp, nil\n}\n\n// GetWorkflowRunAttemptLogs gets a redirect URL to download a plain text file of logs for a workflow run for attempt number.\n// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve a workflow run ID from the DeploymentProtectionRuleEvent.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-attempt-logs\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs\nfunc (s *ActionsService) GetWorkflowRunAttemptLogs(ctx context.Context, owner, repo string, runID int64, attemptNumber, maxRedirects int) (*url.URL, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/runs/%v/attempts/%v/logs\", owner, repo, runID, attemptNumber)\n\n\tif s.client.RateLimitRedirectionalEndpoints {\n\t\treturn s.getWorkflowRunAttemptLogsWithRateLimit(ctx, u, maxRedirects)\n\t}\n\n\treturn s.getWorkflowRunAttemptLogsWithoutRateLimit(ctx, u, maxRedirects)\n}\n\nfunc (s *ActionsService) getWorkflowRunAttemptLogsWithoutRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) {\n\tresp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, maxRedirects)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != http.StatusFound {\n\t\treturn nil, newResponse(resp), fmt.Errorf(\"unexpected status code: %v\", resp.Status)\n\t}\n\n\tparsedURL, err := url.Parse(resp.Header.Get(\"Location\"))\n\treturn parsedURL, newResponse(resp), err\n}\n\nfunc (s *ActionsService) getWorkflowRunAttemptLogsWithRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) {\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\turl, resp, err := s.client.bareDoUntilFound(ctx, req, maxRedirects)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\tdefer resp.Body.Close()\n\n\t// If we didn't receive a valid Location in a 302 response\n\tif url == nil {\n\t\treturn nil, resp, fmt.Errorf(\"unexpected status code: %v\", resp.Status)\n\t}\n\n\treturn url, resp, nil\n}\n\n// RerunWorkflowByID re-runs a workflow by ID.\n// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID of a DeploymentProtectionRuleEvent.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-a-workflow\n//\n//meta:operation POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun\nfunc (s *ActionsService) RerunWorkflowByID(ctx context.Context, owner, repo string, runID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/runs/%v/rerun\", owner, repo, runID)\n\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// RerunFailedJobsByID re-runs all of the failed jobs and their dependent jobs in a workflow run by ID.\n// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-failed-jobs-from-a-workflow-run\n//\n//meta:operation POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs\nfunc (s *ActionsService) RerunFailedJobsByID(ctx context.Context, owner, repo string, runID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/runs/%v/rerun-failed-jobs\", owner, repo, runID)\n\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// RerunJobByID re-runs a job and its dependent jobs in a workflow run by ID.\n//\n// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run\n//\n//meta:operation POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun\nfunc (s *ActionsService) RerunJobByID(ctx context.Context, owner, repo string, jobID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/jobs/%v/rerun\", owner, repo, jobID)\n\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// CancelWorkflowRunByID cancels a workflow run by ID.\n// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#cancel-a-workflow-run\n//\n//meta:operation POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel\nfunc (s *ActionsService) CancelWorkflowRunByID(ctx context.Context, owner, repo string, runID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/runs/%v/cancel\", owner, repo, runID)\n\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// GetWorkflowRunLogs gets a redirect URL to download a plain text file of logs for a workflow run.\n// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-logs\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs\nfunc (s *ActionsService) GetWorkflowRunLogs(ctx context.Context, owner, repo string, runID int64, maxRedirects int) (*url.URL, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/runs/%v/logs\", owner, repo, runID)\n\n\tif s.client.RateLimitRedirectionalEndpoints {\n\t\treturn s.getWorkflowRunLogsWithRateLimit(ctx, u, maxRedirects)\n\t}\n\n\treturn s.getWorkflowRunLogsWithoutRateLimit(ctx, u, maxRedirects)\n}\n\nfunc (s *ActionsService) getWorkflowRunLogsWithoutRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) {\n\tresp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, maxRedirects)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != http.StatusFound {\n\t\treturn nil, newResponse(resp), fmt.Errorf(\"unexpected status code: %v\", resp.Status)\n\t}\n\n\tparsedURL, err := url.Parse(resp.Header.Get(\"Location\"))\n\treturn parsedURL, newResponse(resp), err\n}\n\nfunc (s *ActionsService) getWorkflowRunLogsWithRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) {\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\turl, resp, err := s.client.bareDoUntilFound(ctx, req, maxRedirects)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\tdefer resp.Body.Close()\n\n\t// If we didn't receive a valid Location in a 302 response\n\tif url == nil {\n\t\treturn nil, resp, fmt.Errorf(\"unexpected status code: %v\", resp.Status)\n\t}\n\n\treturn url, resp, nil\n}\n\n// DeleteWorkflowRun deletes a workflow run by ID.\n// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#delete-a-workflow-run\n//\n//meta:operation DELETE /repos/{owner}/{repo}/actions/runs/{run_id}\nfunc (s *ActionsService) DeleteWorkflowRun(ctx context.Context, owner, repo string, runID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/runs/%v\", owner, repo, runID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// DeleteWorkflowRunLogs deletes all logs for a workflow run.\n// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#delete-workflow-run-logs\n//\n//meta:operation DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs\nfunc (s *ActionsService) DeleteWorkflowRunLogs(ctx context.Context, owner, repo string, runID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/runs/%v/logs\", owner, repo, runID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// GetWorkflowRunUsageByID gets a specific workflow usage run by run ID in the unit of billable milliseconds.\n// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-workflow-run-usage\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing\nfunc (s *ActionsService) GetWorkflowRunUsageByID(ctx context.Context, owner, repo string, runID int64) (*WorkflowRunUsage, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/runs/%v/timing\", owner, repo, runID)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar workflowRunUsage *WorkflowRunUsage\n\tresp, err := s.client.Do(ctx, req, &workflowRunUsage)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn workflowRunUsage, resp, nil\n}\n\n// GetPendingDeployments get all deployment environments for a workflow run that are waiting for protection rules to pass.\n// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#get-pending-deployments-for-a-workflow-run\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments\nfunc (s *ActionsService) GetPendingDeployments(ctx context.Context, owner, repo string, runID int64) ([]*PendingDeployment, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/runs/%v/pending_deployments\", owner, repo, runID)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar deployments []*PendingDeployment\n\tresp, err := s.client.Do(ctx, req, &deployments)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn deployments, resp, nil\n}\n\n// PendingDeployments approve or reject pending deployments that are waiting on approval by a required reviewer.\n// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run\n//\n//meta:operation POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments\nfunc (s *ActionsService) PendingDeployments(ctx context.Context, owner, repo string, runID int64, request *PendingDeploymentsRequest) ([]*Deployment, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/runs/%v/pending_deployments\", owner, repo, runID)\n\n\treq, err := s.client.NewRequest(\"POST\", u, request)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar deployments []*Deployment\n\tresp, err := s.client.Do(ctx, req, &deployments)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn deployments, resp, nil\n}\n\n// ReviewCustomDeploymentProtectionRule approves or rejects custom deployment protection rules provided by a GitHub App for a workflow run.\n// You can use the helper function *DeploymentProtectionRuleEvent.GetRunID() to easily retrieve the workflow run ID from a DeploymentProtectionRuleEvent.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#review-custom-deployment-protection-rules-for-a-workflow-run\n//\n//meta:operation POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule\nfunc (s *ActionsService) ReviewCustomDeploymentProtectionRule(ctx context.Context, owner, repo string, runID int64, request *ReviewCustomDeploymentProtectionRuleRequest) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/runs/%v/deployment_protection_rule\", owner, repo, runID)\n\n\treq, err := s.client.NewRequest(\"POST\", u, request)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\treturn resp, err\n}\n"
  },
  {
    "path": "github/actions_workflow_runs_test.go",
    "content": "// Copyright 2020 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestActionsService_ListWorkflowRunsByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/workflows/29679449/runs\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `{\"total_count\":4,\"workflow_runs\":[{\"id\":399444496,\"run_number\":296,\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"},{\"id\":399444497,\"run_number\":296,\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"}]}`)\n\t})\n\n\topts := &ListWorkflowRunsOptions{ListOptions: ListOptions{Page: 2, PerPage: 2}}\n\tctx := t.Context()\n\truns, _, err := client.Actions.ListWorkflowRunsByID(ctx, \"o\", \"r\", 29679449, opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListWorkFlowRunsByID returned error: %v\", err)\n\t}\n\n\twant := &WorkflowRuns{\n\t\tTotalCount: Ptr(4),\n\t\tWorkflowRuns: []*WorkflowRun{\n\t\t\t{ID: Ptr(int64(399444496)), RunNumber: Ptr(296), CreatedAt: &Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)}},\n\t\t\t{ID: Ptr(int64(399444497)), RunNumber: Ptr(296), CreatedAt: &Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)}},\n\t\t},\n\t}\n\tif !cmp.Equal(runs, want) {\n\t\tt.Errorf(\"Actions.ListWorkflowRunsByID returned %+v, want %+v\", runs, want)\n\t}\n\n\tconst methodName = \"ListWorkflowRunsByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListWorkflowRunsByID(ctx, \"\\n\", \"\\n\", 29679449, opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListWorkflowRunsByID(ctx, \"o\", \"r\", 29679449, opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_ListWorkflowRunsFileName(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/workflows/29679449/runs\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `{\"total_count\":4,\"workflow_runs\":[{\"id\":399444496,\"run_number\":296,\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"},{\"id\":399444497,\"run_number\":296,\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"}]}`)\n\t})\n\n\topts := &ListWorkflowRunsOptions{ListOptions: ListOptions{Page: 2, PerPage: 2}}\n\tctx := t.Context()\n\truns, _, err := client.Actions.ListWorkflowRunsByFileName(ctx, \"o\", \"r\", \"29679449\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListWorkFlowRunsByFileName returned error: %v\", err)\n\t}\n\n\twant := &WorkflowRuns{\n\t\tTotalCount: Ptr(4),\n\t\tWorkflowRuns: []*WorkflowRun{\n\t\t\t{ID: Ptr(int64(399444496)), RunNumber: Ptr(296), CreatedAt: &Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)}},\n\t\t\t{ID: Ptr(int64(399444497)), RunNumber: Ptr(296), CreatedAt: &Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)}},\n\t\t},\n\t}\n\tif !cmp.Equal(runs, want) {\n\t\tt.Errorf(\"Actions.ListWorkflowRunsByFileName returned %+v, want %+v\", runs, want)\n\t}\n\n\tconst methodName = \"ListWorkflowRunsByFileName\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListWorkflowRunsByFileName(ctx, \"\\n\", \"\\n\", \"29679449\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListWorkflowRunsByFileName(ctx, \"o\", \"r\", \"29679449\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetWorkflowRunByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/runs/29679449\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":399444496,\"run_number\":296,\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"}}`)\n\t})\n\n\tctx := t.Context()\n\truns, _, err := client.Actions.GetWorkflowRunByID(ctx, \"o\", \"r\", 29679449)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetWorkflowRunByID returned error: %v\", err)\n\t}\n\n\twant := &WorkflowRun{\n\t\tID:        Ptr(int64(399444496)),\n\t\tRunNumber: Ptr(296),\n\t\tCreatedAt: &Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t\tUpdatedAt: &Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t}\n\n\tif !cmp.Equal(runs, want) {\n\t\tt.Errorf(\"Actions.GetWorkflowRunByID returned %+v, want %+v\", runs, want)\n\t}\n\n\tconst methodName = \"GetWorkflowRunByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetWorkflowRunByID(ctx, \"\\n\", \"\\n\", 29679449)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetWorkflowRunByID(ctx, \"o\", \"r\", 29679449)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetWorkflowRunAttempt(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/runs/29679449/attempts/3\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"exclude_pull_requests\": \"true\"})\n\t\tfmt.Fprint(w, `{\"id\":399444496,\"run_number\":296,\"run_attempt\":3,\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"}}`)\n\t})\n\n\topts := &WorkflowRunAttemptOptions{ExcludePullRequests: Ptr(true)}\n\tctx := t.Context()\n\truns, _, err := client.Actions.GetWorkflowRunAttempt(ctx, \"o\", \"r\", 29679449, 3, opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetWorkflowRunAttempt returned error: %v\", err)\n\t}\n\n\twant := &WorkflowRun{\n\t\tID:         Ptr(int64(399444496)),\n\t\tRunNumber:  Ptr(296),\n\t\tRunAttempt: Ptr(3),\n\t\tCreatedAt:  &Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t\tUpdatedAt:  &Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t}\n\n\tif !cmp.Equal(runs, want) {\n\t\tt.Errorf(\"Actions.GetWorkflowRunAttempt returned %+v, want %+v\", runs, want)\n\t}\n\n\tconst methodName = \"GetWorkflowRunAttempt\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetWorkflowRunAttempt(ctx, \"\\n\", \"\\n\", 29679449, 3, opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetWorkflowRunAttempt(ctx, \"o\", \"r\", 29679449, 3, opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetWorkflowRunAttemptLogs(t *testing.T) {\n\tt.Parallel()\n\ttcs := []struct {\n\t\tname              string\n\t\trespectRateLimits bool\n\t}{\n\t\t{\n\t\t\tname:              \"withoutRateLimits\",\n\t\t\trespectRateLimits: false,\n\t\t},\n\t\t{\n\t\t\tname:              \"withRateLimits\",\n\t\t\trespectRateLimits: true,\n\t\t},\n\t}\n\n\tfor _, tc := range tcs {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\t\t\tclient.RateLimitRedirectionalEndpoints = tc.respectRateLimits\n\n\t\t\tmux.HandleFunc(\"/repos/o/r/actions/runs/399444496/attempts/2/logs\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\thttp.Redirect(w, r, \"https://github.com/a\", http.StatusFound)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\turl, resp, err := client.Actions.GetWorkflowRunAttemptLogs(ctx, \"o\", \"r\", 399444496, 2, 1)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Actions.GetWorkflowRunAttemptLogs returned error: %v\", err)\n\t\t\t}\n\t\t\tif resp.StatusCode != http.StatusFound {\n\t\t\t\tt.Errorf(\"Actions.GetWorkflowRunAttemptLogs returned status: %v, want %v\", resp.StatusCode, http.StatusFound)\n\t\t\t}\n\t\t\twant := \"https://github.com/a\"\n\t\t\tif url.String() != want {\n\t\t\t\tt.Errorf(\"Actions.GetWorkflowRunAttemptLogs returned %+v, want %+v\", url, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"GetWorkflowRunAttemptLogs\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Actions.GetWorkflowRunAttemptLogs(ctx, \"\\n\", \"\\n\", 399444496, 2, 1)\n\t\t\t\treturn err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestActionsService_GetWorkflowRunAttemptLogs_StatusMovedPermanently_dontFollowRedirects(t *testing.T) {\n\tt.Parallel()\n\ttcs := []struct {\n\t\tname              string\n\t\trespectRateLimits bool\n\t}{\n\t\t{\n\t\t\tname:              \"withoutRateLimits\",\n\t\t\trespectRateLimits: false,\n\t\t},\n\t\t{\n\t\t\tname:              \"withRateLimits\",\n\t\t\trespectRateLimits: true,\n\t\t},\n\t}\n\n\tfor _, tc := range tcs {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\t\t\tclient.RateLimitRedirectionalEndpoints = tc.respectRateLimits\n\n\t\t\tmux.HandleFunc(\"/repos/o/r/actions/runs/399444496/attempts/2/logs\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\thttp.Redirect(w, r, \"https://github.com/a\", http.StatusMovedPermanently)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\t_, resp, _ := client.Actions.GetWorkflowRunAttemptLogs(ctx, \"o\", \"r\", 399444496, 2, 0)\n\t\t\tif resp.StatusCode != http.StatusMovedPermanently {\n\t\t\t\tt.Errorf(\"Actions.GetWorkflowRunAttemptLogs returned status: %v, want %v\", resp.StatusCode, http.StatusMovedPermanently)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestActionsService_GetWorkflowRunAttemptLogs_StatusMovedPermanently_followRedirects(t *testing.T) {\n\tt.Parallel()\n\ttcs := []struct {\n\t\tname              string\n\t\trespectRateLimits bool\n\t}{\n\t\t{\n\t\t\tname:              \"withoutRateLimits\",\n\t\t\trespectRateLimits: false,\n\t\t},\n\t\t{\n\t\t\tname:              \"withRateLimits\",\n\t\t\trespectRateLimits: true,\n\t\t},\n\t}\n\n\tfor _, tc := range tcs {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, serverURL := setup(t)\n\t\t\tclient.RateLimitRedirectionalEndpoints = tc.respectRateLimits\n\n\t\t\t// Mock a redirect link, which leads to an archive link\n\t\t\tmux.HandleFunc(\"/repos/o/r/actions/runs/399444496/attempts/2/logs\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\tredirectURL, _ := url.Parse(serverURL + baseURLPath + \"/redirect\")\n\t\t\t\thttp.Redirect(w, r, redirectURL.String(), http.StatusMovedPermanently)\n\t\t\t})\n\n\t\t\tmux.HandleFunc(\"/redirect\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\thttp.Redirect(w, r, \"https://github.com/a\", http.StatusFound)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\turl, resp, err := client.Actions.GetWorkflowRunAttemptLogs(ctx, \"o\", \"r\", 399444496, 2, 1)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Actions.GetWorkflowRunAttemptLogs returned error: %v\", err)\n\t\t\t}\n\n\t\t\tif resp.StatusCode != http.StatusFound {\n\t\t\t\tt.Errorf(\"Actions.GetWorkflowRunAttemptLogs returned status: %v, want %v\", resp.StatusCode, http.StatusFound)\n\t\t\t}\n\n\t\t\twant := \"https://github.com/a\"\n\t\t\tif url.String() != want {\n\t\t\t\tt.Errorf(\"Actions.GetWorkflowRunAttemptLogs returned %+v, want %+v\", url, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"GetWorkflowRunAttemptLogs\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Actions.GetWorkflowRunAttemptLogs(ctx, \"\\n\", \"\\n\", 399444496, 2, 1)\n\t\t\t\treturn err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestActionsService_GetWorkflowRunAttemptLogs_unexpectedCode(t *testing.T) {\n\tt.Parallel()\n\ttcs := []struct {\n\t\tname              string\n\t\trespectRateLimits bool\n\t}{\n\t\t{\n\t\t\tname:              \"withoutRateLimits\",\n\t\t\trespectRateLimits: false,\n\t\t},\n\t\t{\n\t\t\tname:              \"withRateLimits\",\n\t\t\trespectRateLimits: true,\n\t\t},\n\t}\n\n\tfor _, tc := range tcs {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, serverURL := setup(t)\n\t\t\tclient.RateLimitRedirectionalEndpoints = tc.respectRateLimits\n\n\t\t\t// Mock a redirect link, which leads to an archive link\n\t\t\tmux.HandleFunc(\"/repos/o/r/actions/runs/399444496/attempts/2/logs\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\tredirectURL, _ := url.Parse(serverURL + baseURLPath + \"/redirect\")\n\t\t\t\thttp.Redirect(w, r, redirectURL.String(), http.StatusMovedPermanently)\n\t\t\t})\n\n\t\t\tmux.HandleFunc(\"/redirect\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\tw.WriteHeader(http.StatusNoContent)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\turl, resp, err := client.Actions.GetWorkflowRunAttemptLogs(ctx, \"o\", \"r\", 399444496, 2, 1)\n\t\t\tif err == nil {\n\t\t\t\tt.Fatal(\"Actions.GetWorkflowRunAttemptLogs should return error on unexpected code\")\n\t\t\t}\n\t\t\tif !strings.Contains(err.Error(), \"unexpected status code\") {\n\t\t\t\tt.Error(\"Actions.GetWorkflowRunAttemptLogs should return unexpected status code\")\n\t\t\t}\n\t\t\tif got, want := resp.Response.StatusCode, http.StatusNoContent; got != want {\n\t\t\t\tt.Errorf(\"Actions.GetWorkflowRunAttemptLogs return status %v, want %v\", got, want)\n\t\t\t}\n\t\t\tif url != nil {\n\t\t\t\tt.Errorf(\"Actions.GetWorkflowRunAttemptLogs return %+v, want nil\", url)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestActionsService_RerunWorkflowRunByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/runs/3434/rerun\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tw.WriteHeader(http.StatusCreated)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Actions.RerunWorkflowByID(ctx, \"o\", \"r\", 3434)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.RerunWorkflowByID returned error: %v\", err)\n\t}\n\tif resp.StatusCode != http.StatusCreated {\n\t\tt.Errorf(\"Actions.RerunWorkflowRunByID returned status: %v, want %v\", resp.StatusCode, http.StatusCreated)\n\t}\n\n\tconst methodName = \"RerunWorkflowByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.RerunWorkflowByID(ctx, \"\\n\", \"\\n\", 3434)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.RerunWorkflowByID(ctx, \"o\", \"r\", 3434)\n\t})\n}\n\nfunc TestActionsService_RerunFailedJobsByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/runs/3434/rerun-failed-jobs\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tw.WriteHeader(http.StatusCreated)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Actions.RerunFailedJobsByID(ctx, \"o\", \"r\", 3434)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.RerunFailedJobsByID returned error: %v\", err)\n\t}\n\tif resp.StatusCode != http.StatusCreated {\n\t\tt.Errorf(\"Actions.RerunFailedJobsByID returned status: %v, want %v\", resp.StatusCode, http.StatusCreated)\n\t}\n\n\tconst methodName = \"RerunFailedJobsByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.RerunFailedJobsByID(ctx, \"\\n\", \"\\n\", 3434)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.RerunFailedJobsByID(ctx, \"o\", \"r\", 3434)\n\t})\n}\n\nfunc TestActionsService_RerunJobByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/jobs/3434/rerun\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tw.WriteHeader(http.StatusCreated)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Actions.RerunJobByID(ctx, \"o\", \"r\", 3434)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.RerunJobByID returned error: %v\", err)\n\t}\n\tif resp.StatusCode != http.StatusCreated {\n\t\tt.Errorf(\"Actions.RerunJobByID returned status: %v, want %v\", resp.StatusCode, http.StatusCreated)\n\t}\n\n\tconst methodName = \"RerunJobByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.RerunJobByID(ctx, \"\\n\", \"\\n\", 3434)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.RerunJobByID(ctx, \"o\", \"r\", 3434)\n\t})\n}\n\nfunc TestActionsService_CancelWorkflowRunByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/runs/3434/cancel\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tw.WriteHeader(http.StatusAccepted)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Actions.CancelWorkflowRunByID(ctx, \"o\", \"r\", 3434)\n\tif !errors.As(err, new(*AcceptedError)) {\n\t\tt.Errorf(\"Actions.CancelWorkflowRunByID returned error: %v (want AcceptedError)\", err)\n\t}\n\tif resp.StatusCode != http.StatusAccepted {\n\t\tt.Errorf(\"Actions.CancelWorkflowRunByID returned status: %v, want %v\", resp.StatusCode, http.StatusAccepted)\n\t}\n\n\tconst methodName = \"CancelWorkflowRunByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.CancelWorkflowRunByID(ctx, \"\\n\", \"\\n\", 3434)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.CancelWorkflowRunByID(ctx, \"o\", \"r\", 3434)\n\t})\n}\n\nfunc TestActionsService_GetWorkflowRunLogs(t *testing.T) {\n\tt.Parallel()\n\ttcs := []struct {\n\t\tname              string\n\t\trespectRateLimits bool\n\t}{\n\t\t{\n\t\t\tname:              \"withoutRateLimits\",\n\t\t\trespectRateLimits: false,\n\t\t},\n\t\t{\n\t\t\tname:              \"withRateLimits\",\n\t\t\trespectRateLimits: true,\n\t\t},\n\t}\n\n\tfor _, tc := range tcs {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\t\t\tclient.RateLimitRedirectionalEndpoints = tc.respectRateLimits\n\n\t\t\tmux.HandleFunc(\"/repos/o/r/actions/runs/399444496/logs\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\thttp.Redirect(w, r, \"https://github.com/a\", http.StatusFound)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\turl, resp, err := client.Actions.GetWorkflowRunLogs(ctx, \"o\", \"r\", 399444496, 1)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Actions.GetWorkflowRunLogs returned error: %v\", err)\n\t\t\t}\n\t\t\tif resp.StatusCode != http.StatusFound {\n\t\t\t\tt.Errorf(\"Actions.GetWorkflowRunLogs returned status: %v, want %v\", resp.StatusCode, http.StatusFound)\n\t\t\t}\n\t\t\twant := \"https://github.com/a\"\n\t\t\tif url.String() != want {\n\t\t\t\tt.Errorf(\"Actions.GetWorkflowRunLogs returned %+v, want %+v\", url, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"GetWorkflowRunLogs\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Actions.GetWorkflowRunLogs(ctx, \"\\n\", \"\\n\", 399444496, 1)\n\t\t\t\treturn err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestActionsService_GetWorkflowRunLogs_StatusMovedPermanently_dontFollowRedirects(t *testing.T) {\n\tt.Parallel()\n\ttcs := []struct {\n\t\tname              string\n\t\trespectRateLimits bool\n\t}{\n\t\t{\n\t\t\tname:              \"withoutRateLimits\",\n\t\t\trespectRateLimits: false,\n\t\t},\n\t\t{\n\t\t\tname:              \"withRateLimits\",\n\t\t\trespectRateLimits: true,\n\t\t},\n\t}\n\n\tfor _, tc := range tcs {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\t\t\tclient.RateLimitRedirectionalEndpoints = tc.respectRateLimits\n\n\t\t\tmux.HandleFunc(\"/repos/o/r/actions/runs/399444496/logs\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\thttp.Redirect(w, r, \"https://github.com/a\", http.StatusMovedPermanently)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\t_, resp, _ := client.Actions.GetWorkflowRunLogs(ctx, \"o\", \"r\", 399444496, 0)\n\t\t\tif resp.StatusCode != http.StatusMovedPermanently {\n\t\t\t\tt.Errorf(\"Actions.GetWorkflowJobLogs returned status: %v, want %v\", resp.StatusCode, http.StatusMovedPermanently)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestActionsService_GetWorkflowRunLogs_StatusMovedPermanently_followRedirects(t *testing.T) {\n\tt.Parallel()\n\ttcs := []struct {\n\t\tname              string\n\t\trespectRateLimits bool\n\t}{\n\t\t{\n\t\t\tname:              \"withoutRateLimits\",\n\t\t\trespectRateLimits: false,\n\t\t},\n\t\t{\n\t\t\tname:              \"withRateLimits\",\n\t\t\trespectRateLimits: true,\n\t\t},\n\t}\n\n\tfor _, tc := range tcs {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, serverURL := setup(t)\n\t\t\tclient.RateLimitRedirectionalEndpoints = tc.respectRateLimits\n\n\t\t\t// Mock a redirect link, which leads to an archive link\n\t\t\tmux.HandleFunc(\"/repos/o/r/actions/runs/399444496/logs\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\tredirectURL, _ := url.Parse(serverURL + baseURLPath + \"/redirect\")\n\t\t\t\thttp.Redirect(w, r, redirectURL.String(), http.StatusMovedPermanently)\n\t\t\t})\n\n\t\t\tmux.HandleFunc(\"/redirect\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\thttp.Redirect(w, r, \"https://github.com/a\", http.StatusFound)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\turl, resp, err := client.Actions.GetWorkflowRunLogs(ctx, \"o\", \"r\", 399444496, 1)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Actions.GetWorkflowJobLogs returned error: %v\", err)\n\t\t\t}\n\n\t\t\tif resp.StatusCode != http.StatusFound {\n\t\t\t\tt.Errorf(\"Actions.GetWorkflowJobLogs returned status: %v, want %v\", resp.StatusCode, http.StatusFound)\n\t\t\t}\n\n\t\t\twant := \"https://github.com/a\"\n\t\t\tif url.String() != want {\n\t\t\t\tt.Errorf(\"Actions.GetWorkflowJobLogs returned %+v, want %+v\", url, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"GetWorkflowRunLogs\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Actions.GetWorkflowRunLogs(ctx, \"\\n\", \"\\n\", 399444496, 1)\n\t\t\t\treturn err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestActionsService_GetWorkflowRunLogs_unexpectedCode(t *testing.T) {\n\tt.Parallel()\n\ttcs := []struct {\n\t\tname              string\n\t\trespectRateLimits bool\n\t}{\n\t\t{\n\t\t\tname:              \"withoutRateLimits\",\n\t\t\trespectRateLimits: false,\n\t\t},\n\t\t{\n\t\t\tname:              \"withRateLimits\",\n\t\t\trespectRateLimits: true,\n\t\t},\n\t}\n\n\tfor _, tc := range tcs {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, serverURL := setup(t)\n\t\t\tclient.RateLimitRedirectionalEndpoints = tc.respectRateLimits\n\n\t\t\t// Mock a redirect link, which leads to an archive link\n\t\t\tmux.HandleFunc(\"/repos/o/r/actions/runs/399444496/logs\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\tredirectURL, _ := url.Parse(serverURL + baseURLPath + \"/redirect\")\n\t\t\t\thttp.Redirect(w, r, redirectURL.String(), http.StatusMovedPermanently)\n\t\t\t})\n\n\t\t\tmux.HandleFunc(\"/redirect\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\tw.WriteHeader(http.StatusNoContent)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\turl, resp, err := client.Actions.GetWorkflowRunLogs(ctx, \"o\", \"r\", 399444496, 1)\n\t\t\tif err == nil {\n\t\t\t\tt.Fatal(\"Actions.GetWorkflowRunLogs should return error on unexpected code\")\n\t\t\t}\n\t\t\tif !strings.Contains(err.Error(), \"unexpected status code\") {\n\t\t\t\tt.Error(\"Actions.GetWorkflowRunLogs should return unexpected status code\")\n\t\t\t}\n\t\t\tif got, want := resp.Response.StatusCode, http.StatusNoContent; got != want {\n\t\t\t\tt.Errorf(\"Actions.GetWorkflowRunLogs return status %v, want %v\", got, want)\n\t\t\t}\n\t\t\tif url != nil {\n\t\t\t\tt.Errorf(\"Actions.GetWorkflowRunLogs return %+v, want nil\", url)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestActionService_ListRepositoryWorkflowRuns(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/runs\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `{\"total_count\":2,\n\t\t\"workflow_runs\":[\n\t\t\t{\"id\":298499444,\"run_number\":301,\"created_at\":\"2020-04-11T11:14:54Z\",\"updated_at\":\"2020-04-11T11:14:54Z\"},\n\t\t\t{\"id\":298499445,\"run_number\":302,\"created_at\":\"2020-04-11T11:14:54Z\",\"updated_at\":\"2020-04-11T11:14:54Z\"}]}`)\n\t})\n\n\topts := &ListWorkflowRunsOptions{ListOptions: ListOptions{Page: 2, PerPage: 2}}\n\tctx := t.Context()\n\truns, _, err := client.Actions.ListRepositoryWorkflowRuns(ctx, \"o\", \"r\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListRepositoryWorkflowRuns returned error: %v\", err)\n\t}\n\n\texpected := &WorkflowRuns{\n\t\tTotalCount: Ptr(2),\n\t\tWorkflowRuns: []*WorkflowRun{\n\t\t\t{ID: Ptr(int64(298499444)), RunNumber: Ptr(301), CreatedAt: &Timestamp{time.Date(2020, time.April, 11, 11, 14, 54, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.April, 11, 11, 14, 54, 0, time.UTC)}},\n\t\t\t{ID: Ptr(int64(298499445)), RunNumber: Ptr(302), CreatedAt: &Timestamp{time.Date(2020, time.April, 11, 11, 14, 54, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.April, 11, 11, 14, 54, 0, time.UTC)}},\n\t\t},\n\t}\n\n\tif !cmp.Equal(runs, expected) {\n\t\tt.Errorf(\"Actions.ListRepositoryWorkflowRuns returned %+v, want %+v\", runs, expected)\n\t}\n\n\tconst methodName = \"ListRepositoryWorkflowRuns\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListRepositoryWorkflowRuns(ctx, \"\\n\", \"\\n\", opts)\n\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListRepositoryWorkflowRuns(ctx, \"o\", \"r\", opts)\n\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionService_DeleteWorkflowRun(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/runs/399444496\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Actions.DeleteWorkflowRun(ctx, \"o\", \"r\", 399444496); err != nil {\n\t\tt.Errorf(\"DeleteWorkflowRun returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteWorkflowRun\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.DeleteWorkflowRun(ctx, \"\\n\", \"\\n\", 399444496)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.DeleteWorkflowRun(ctx, \"o\", \"r\", 399444496)\n\t})\n}\n\nfunc TestActionService_DeleteWorkflowRunLogs(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/runs/399444496/logs\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Actions.DeleteWorkflowRunLogs(ctx, \"o\", \"r\", 399444496); err != nil {\n\t\tt.Errorf(\"DeleteWorkflowRunLogs returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteWorkflowRunLogs\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.DeleteWorkflowRunLogs(ctx, \"\\n\", \"\\n\", 399444496)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.DeleteWorkflowRunLogs(ctx, \"o\", \"r\", 399444496)\n\t})\n}\n\nfunc TestPendingDeployment_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PendingDeployment{}, \"{}\")\n\n\tu := &PendingDeployment{\n\t\tEnvironment: &PendingDeploymentEnvironment{\n\t\t\tID:      Ptr(int64(1)),\n\t\t\tNodeID:  Ptr(\"nid\"),\n\t\t\tName:    Ptr(\"n\"),\n\t\t\tURL:     Ptr(\"u\"),\n\t\t\tHTMLURL: Ptr(\"hu\"),\n\t\t},\n\t\tWaitTimer:             Ptr(int64(100)),\n\t\tWaitTimerStartedAt:    &Timestamp{referenceTime},\n\t\tCurrentUserCanApprove: Ptr(false),\n\t\tReviewers: []*RequiredReviewer{\n\t\t\t{\n\t\t\t\tType: Ptr(\"User\"),\n\t\t\t\tReviewer: &User{\n\t\t\t\t\tLogin: Ptr(\"l\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tType: Ptr(\"Team\"),\n\t\t\t\tReviewer: &Team{\n\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\twant := `{\n\t\t\"environment\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"html_url\": \"hu\"\n\t\t},\n\t\t\"wait_timer\": 100,\n\t\t\"wait_timer_started_at\": ` + referenceTimeStr + `,\n\t\t\"current_user_can_approve\": false,\n\t\t\"reviewers\": [\n\t\t\t{\n\t\t\t\t\"type\": \"User\",\n\t\t\t\t\"reviewer\": {\n\t\t\t\t\t\"login\": \"l\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": \"Team\",\n\t\t\t\t\"reviewer\": {\n\t\t\t\t\t\"name\": \"n\"\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t}`\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestActionsService_ReviewCustomDeploymentProtectionRule(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/runs/9444496/deployment_protection_rule\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\trequest := ReviewCustomDeploymentProtectionRuleRequest{\n\t\tEnvironmentName: \"production\",\n\t\tState:           \"approved\",\n\t\tComment:         \"Approve deployment\",\n\t}\n\n\tctx := t.Context()\n\tif _, err := client.Actions.ReviewCustomDeploymentProtectionRule(ctx, \"o\", \"r\", 9444496, &request); err != nil {\n\t\tt.Errorf(\"ReviewCustomDeploymentProtectionRule returned error: %v\", err)\n\t}\n\n\tconst methodName = \"ReviewCustomDeploymentProtectionRule\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.ReviewCustomDeploymentProtectionRule(ctx, \"\\n\", \"\\n\", 9444496, &request)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.ReviewCustomDeploymentProtectionRule(ctx, \"o\", \"r\", 9444496, &request)\n\t})\n}\n\nfunc TestReviewCustomDeploymentProtectionRuleRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ReviewCustomDeploymentProtectionRuleRequest{}, `{\n\t\t\"comment\": \"\",\n\t\t\"environment_name\": \"\",\n\t\t\"state\": \"\"\n\t}`)\n\n\tr := &ReviewCustomDeploymentProtectionRuleRequest{\n\t\tEnvironmentName: \"e\",\n\t\tState:           \"rejected\",\n\t\tComment:         \"c\",\n\t}\n\twant := `{\n\t\t\"environment_name\": \"e\",\n\t\t\"state\": \"rejected\",\n\t\t\"comment\": \"c\"\n\t}`\n\ttestJSONMarshal(t, r, want)\n}\n\nfunc TestActionsService_GetWorkflowRunUsageByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/runs/29679449/timing\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"billable\":{\"UBUNTU\":{\"total_ms\":180000,\"jobs\":1,\"job_runs\":[{\"job_id\":1,\"duration_ms\":60000}]},\"MACOS\":{\"total_ms\":240000,\"jobs\":2,\"job_runs\":[{\"job_id\":2,\"duration_ms\":30000},{\"job_id\":3,\"duration_ms\":10000}]},\"WINDOWS\":{\"total_ms\":300000,\"jobs\":2}},\"run_duration_ms\":500000}`)\n\t})\n\n\tctx := t.Context()\n\tworkflowRunUsage, _, err := client.Actions.GetWorkflowRunUsageByID(ctx, \"o\", \"r\", 29679449)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetWorkflowRunUsageByID returned error: %v\", err)\n\t}\n\n\twant := &WorkflowRunUsage{\n\t\tBillable: &WorkflowRunBillMap{\n\t\t\t\"UBUNTU\": &WorkflowRunBill{\n\t\t\t\tTotalMS: Ptr(int64(180000)),\n\t\t\t\tJobs:    Ptr(1),\n\t\t\t\tJobRuns: []*WorkflowRunJobRun{\n\t\t\t\t\t{\n\t\t\t\t\t\tJobID:      Ptr(1),\n\t\t\t\t\t\tDurationMS: Ptr(int64(60000)),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t\"MACOS\": &WorkflowRunBill{\n\t\t\t\tTotalMS: Ptr(int64(240000)),\n\t\t\t\tJobs:    Ptr(2),\n\t\t\t\tJobRuns: []*WorkflowRunJobRun{\n\t\t\t\t\t{\n\t\t\t\t\t\tJobID:      Ptr(2),\n\t\t\t\t\t\tDurationMS: Ptr(int64(30000)),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tJobID:      Ptr(3),\n\t\t\t\t\t\tDurationMS: Ptr(int64(10000)),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t\"WINDOWS\": &WorkflowRunBill{\n\t\t\t\tTotalMS: Ptr(int64(300000)),\n\t\t\t\tJobs:    Ptr(2),\n\t\t\t},\n\t\t},\n\t\tRunDurationMS: Ptr(int64(500000)),\n\t}\n\n\tif !cmp.Equal(workflowRunUsage, want) {\n\t\tt.Errorf(\"Actions.GetWorkflowRunUsageByID returned %+v, want %+v\", workflowRunUsage, want)\n\t}\n\n\tconst methodName = \"GetWorkflowRunUsageByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetWorkflowRunUsageByID(ctx, \"\\n\", \"\\n\", 29679449)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetWorkflowRunUsageByID(ctx, \"o\", \"r\", 29679449)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestWorkflowRun_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &WorkflowRun{}, \"{}\")\n\n\tu := &WorkflowRun{\n\t\tID:         Ptr(int64(1)),\n\t\tName:       Ptr(\"n\"),\n\t\tNodeID:     Ptr(\"nid\"),\n\t\tHeadBranch: Ptr(\"hb\"),\n\t\tHeadSHA:    Ptr(\"hs\"),\n\t\tPath:       Ptr(\"p\"),\n\t\tRunNumber:  Ptr(1),\n\t\tRunAttempt: Ptr(1),\n\t\tEvent:      Ptr(\"e\"),\n\t\tStatus:     Ptr(\"s\"),\n\t\tConclusion: Ptr(\"c\"),\n\t\tWorkflowID: Ptr(int64(1)),\n\t\tURL:        Ptr(\"u\"),\n\t\tHTMLURL:    Ptr(\"h\"),\n\t\tPullRequests: []*PullRequest{\n\t\t\t{\n\t\t\t\tURL:    Ptr(\"u\"),\n\t\t\t\tID:     Ptr(int64(1)),\n\t\t\t\tNumber: Ptr(1),\n\t\t\t\tHead: &PullRequestBranch{\n\t\t\t\t\tRef: Ptr(\"r\"),\n\t\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\t\tRepo: &Repository{\n\t\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\t\tURL:  Ptr(\"s\"),\n\t\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tBase: &PullRequestBranch{\n\t\t\t\t\tRef: Ptr(\"r\"),\n\t\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\t\tRepo: &Repository{\n\t\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\t\tURL:  Ptr(\"u\"),\n\t\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tCreatedAt:          &Timestamp{referenceTime},\n\t\tUpdatedAt:          &Timestamp{referenceTime},\n\t\tRunStartedAt:       &Timestamp{referenceTime},\n\t\tJobsURL:            Ptr(\"j\"),\n\t\tLogsURL:            Ptr(\"l\"),\n\t\tCheckSuiteURL:      Ptr(\"c\"),\n\t\tArtifactsURL:       Ptr(\"a\"),\n\t\tCancelURL:          Ptr(\"c\"),\n\t\tRerunURL:           Ptr(\"r\"),\n\t\tPreviousAttemptURL: Ptr(\"p\"),\n\t\tHeadCommit: &HeadCommit{\n\t\t\tMessage: Ptr(\"m\"),\n\t\t\tAuthor: &CommitAuthor{\n\t\t\t\tName:  Ptr(\"n\"),\n\t\t\t\tEmail: Ptr(\"e\"),\n\t\t\t\tLogin: Ptr(\"l\"),\n\t\t\t},\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tDistinct:  Ptr(false),\n\t\t\tSHA:       Ptr(\"s\"),\n\t\t\tID:        Ptr(\"i\"),\n\t\t\tTreeID:    Ptr(\"tid\"),\n\t\t\tTimestamp: &Timestamp{referenceTime},\n\t\t\tCommitter: &CommitAuthor{\n\t\t\t\tName:  Ptr(\"n\"),\n\t\t\t\tEmail: Ptr(\"e\"),\n\t\t\t\tLogin: Ptr(\"l\"),\n\t\t\t},\n\t\t},\n\t\tWorkflowURL: Ptr(\"w\"),\n\t\tRepository: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"u\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tHeadRepository: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"u\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tActor: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\tURL:             Ptr(\"u\"),\n\t\t},\n\t\tTriggeringActor: &User{\n\t\t\tLogin:           Ptr(\"l2\"),\n\t\t\tID:              Ptr(int64(2)),\n\t\t\tAvatarURL:       Ptr(\"a2\"),\n\t\t\tGravatarID:      Ptr(\"g2\"),\n\t\t\tName:            Ptr(\"n2\"),\n\t\t\tCompany:         Ptr(\"c2\"),\n\t\t\tBlog:            Ptr(\"b2\"),\n\t\t\tLocation:        Ptr(\"l2\"),\n\t\t\tEmail:           Ptr(\"e2\"),\n\t\t\tHireable:        Ptr(false),\n\t\t\tBio:             Ptr(\"b2\"),\n\t\t\tTwitterUsername: Ptr(\"t2\"),\n\t\t\tPublicRepos:     Ptr(2),\n\t\t\tFollowers:       Ptr(2),\n\t\t\tFollowing:       Ptr(2),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\tURL:             Ptr(\"u2\"),\n\t\t},\n\t\tReferencedWorkflows: []*ReferencedWorkflow{\n\t\t\t{\n\t\t\t\tPath: Ptr(\"rwfp\"),\n\t\t\t\tSHA:  Ptr(\"rwfsha\"),\n\t\t\t\tRef:  Ptr(\"rwfref\"),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"name\": \"n\",\n\t\t\"node_id\": \"nid\",\n\t\t\"head_branch\": \"hb\",\n\t\t\"head_sha\": \"hs\",\n\t\t\"path\": \"p\",\n\t\t\"run_number\": 1,\n\t\t\"run_attempt\": 1,\n\t\t\"event\": \"e\",\n\t\t\"status\": \"s\",\n\t\t\"conclusion\": \"c\",\n\t\t\"workflow_id\": 1,\n\t\t\"url\": \"u\",\n\t\t\"html_url\": \"h\",\n\t\t\"pull_requests\": [\n\t\t\t{\n\t\t\t\t\"id\":1,\n\t\t\t\t\"number\":1,\n\t\t\t\t\"url\":\"u\",\n\t\t\t\t\"head\":{\n\t\t\t\t\t\"ref\":\"r\",\n\t\t\t\t\t\"sha\":\"s\",\n\t\t\t\t\t\"repo\": {\n\t\t\t\t\t\t\"id\":1,\n\t\t\t\t\t\t\"name\":\"n\",\n\t\t\t\t\t\t\"url\":\"s\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"base\": {\n\t\t\t\t\t\t\"ref\":\"r\",\n\t\t\t\t\t\t\"sha\":\"s\",\n\t\t\t\t\t\t\"repo\": {\n\t\t\t\t\t\t\t\"id\":1,\n\t\t\t\t\t\t\t\"name\":\"n\",\n\t\t\t\t\t\t\t\"url\":\"u\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"run_started_at\": ` + referenceTimeStr + `,\n\t\t\"jobs_url\": \"j\",\n\t\t\"logs_url\": \"l\",\n\t\t\"check_suite_url\": \"c\",\n\t\t\"artifacts_url\": \"a\",\n\t\t\"cancel_url\": \"c\",\n\t\t\"rerun_url\": \"r\",\n\t\t\"previous_attempt_url\": \"p\",\n\t\t\"head_commit\": {\n\t\t\t\"message\": \"m\",\n\t\t\t\"author\": {\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"username\": \"l\"\n\t\t\t},\n\t\t\t\"url\": \"u\",\n\t\t\t\"distinct\": false,\n\t\t\t\"sha\": \"s\",\n\t\t\t\"id\": \"i\",\n\t\t\t\"tree_id\": \"tid\",\n\t\t\t\"timestamp\": ` + referenceTimeStr + `,\n\t\t\t\"committer\": {\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"username\": \"l\"\n\t\t\t}\n\t\t},\n\t\t\"workflow_url\": \"w\",\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"url\": \"u\",\n\t\t\t\"name\": \"n\"\n\t\t},\n\t\t\"head_repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"url\": \"u\",\n\t\t\t\"name\": \"n\"\n\t\t},\n\t\t\"actor\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"triggering_actor\": {\n\t\t\t\"login\": \"l2\",\n\t\t\t\"id\": 2,\n\t\t\t\"avatar_url\": \"a2\",\n\t\t\t\"gravatar_id\": \"g2\",\n\t\t\t\"name\": \"n2\",\n\t\t\t\"company\": \"c2\",\n\t\t\t\"blog\": \"b2\",\n\t\t\t\"location\": \"l2\",\n\t\t\t\"email\": \"e2\",\n\t\t\t\"hireable\": false,\n\t\t\t\"bio\": \"b2\",\n\t\t\t\"twitter_username\": \"t2\",\n\t\t\t\"public_repos\": 2,\n\t\t\t\"followers\": 2,\n\t\t\t\"following\": 2,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u2\"\n\t\t},\n\t\t\"referenced_workflows\": [\n\t\t\t{\n\t\t\t\t\"path\": \"rwfp\",\n\t\t\t\t\"sha\": \"rwfsha\",\n\t\t\t\t\"ref\": \"rwfref\"\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestWorkflowRuns_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &WorkflowRuns{}, \"{}\")\n\n\tu := &WorkflowRuns{\n\t\tTotalCount: Ptr(1),\n\t\tWorkflowRuns: []*WorkflowRun{\n\t\t\t{\n\t\t\t\tID:         Ptr(int64(1)),\n\t\t\t\tName:       Ptr(\"n\"),\n\t\t\t\tNodeID:     Ptr(\"nid\"),\n\t\t\t\tHeadBranch: Ptr(\"hb\"),\n\t\t\t\tHeadSHA:    Ptr(\"hs\"),\n\t\t\t\tRunNumber:  Ptr(1),\n\t\t\t\tRunAttempt: Ptr(1),\n\t\t\t\tEvent:      Ptr(\"e\"),\n\t\t\t\tStatus:     Ptr(\"s\"),\n\t\t\t\tConclusion: Ptr(\"c\"),\n\t\t\t\tWorkflowID: Ptr(int64(1)),\n\t\t\t\tURL:        Ptr(\"u\"),\n\t\t\t\tHTMLURL:    Ptr(\"h\"),\n\t\t\t\tPullRequests: []*PullRequest{\n\t\t\t\t\t{\n\t\t\t\t\t\tURL:    Ptr(\"u\"),\n\t\t\t\t\t\tID:     Ptr(int64(1)),\n\t\t\t\t\t\tNumber: Ptr(1),\n\t\t\t\t\t\tHead: &PullRequestBranch{\n\t\t\t\t\t\t\tRef: Ptr(\"r\"),\n\t\t\t\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\t\t\t\tRepo: &Repository{\n\t\t\t\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\t\t\t\tURL:  Ptr(\"s\"),\n\t\t\t\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tBase: &PullRequestBranch{\n\t\t\t\t\t\t\tRef: Ptr(\"r\"),\n\t\t\t\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\t\t\t\tRepo: &Repository{\n\t\t\t\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\t\t\t\tURL:  Ptr(\"u\"),\n\t\t\t\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tCreatedAt:          &Timestamp{referenceTime},\n\t\t\t\tUpdatedAt:          &Timestamp{referenceTime},\n\t\t\t\tRunStartedAt:       &Timestamp{referenceTime},\n\t\t\t\tJobsURL:            Ptr(\"j\"),\n\t\t\t\tLogsURL:            Ptr(\"l\"),\n\t\t\t\tCheckSuiteURL:      Ptr(\"c\"),\n\t\t\t\tArtifactsURL:       Ptr(\"a\"),\n\t\t\t\tCancelURL:          Ptr(\"c\"),\n\t\t\t\tRerunURL:           Ptr(\"r\"),\n\t\t\t\tPreviousAttemptURL: Ptr(\"p\"),\n\t\t\t\tHeadCommit: &HeadCommit{\n\t\t\t\t\tMessage: Ptr(\"m\"),\n\t\t\t\t\tAuthor: &CommitAuthor{\n\t\t\t\t\t\tName:  Ptr(\"n\"),\n\t\t\t\t\t\tEmail: Ptr(\"e\"),\n\t\t\t\t\t\tLogin: Ptr(\"l\"),\n\t\t\t\t\t},\n\t\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\t\tDistinct:  Ptr(false),\n\t\t\t\t\tSHA:       Ptr(\"s\"),\n\t\t\t\t\tID:        Ptr(\"i\"),\n\t\t\t\t\tTreeID:    Ptr(\"tid\"),\n\t\t\t\t\tTimestamp: &Timestamp{referenceTime},\n\t\t\t\t\tCommitter: &CommitAuthor{\n\t\t\t\t\t\tName:  Ptr(\"n\"),\n\t\t\t\t\t\tEmail: Ptr(\"e\"),\n\t\t\t\t\t\tLogin: Ptr(\"l\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tWorkflowURL: Ptr(\"w\"),\n\t\t\t\tRepository: &Repository{\n\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\tURL:  Ptr(\"u\"),\n\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t},\n\t\t\t\tHeadRepository: &Repository{\n\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\tURL:  Ptr(\"u\"),\n\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t},\n\t\t\t\tActor: &User{\n\t\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\t\tHireable:        Ptr(true),\n\t\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\t},\n\t\t\t\tTriggeringActor: &User{\n\t\t\t\t\tLogin:           Ptr(\"l2\"),\n\t\t\t\t\tID:              Ptr(int64(2)),\n\t\t\t\t\tAvatarURL:       Ptr(\"a2\"),\n\t\t\t\t\tGravatarID:      Ptr(\"g2\"),\n\t\t\t\t\tName:            Ptr(\"n2\"),\n\t\t\t\t\tCompany:         Ptr(\"c2\"),\n\t\t\t\t\tBlog:            Ptr(\"b2\"),\n\t\t\t\t\tLocation:        Ptr(\"l2\"),\n\t\t\t\t\tEmail:           Ptr(\"e2\"),\n\t\t\t\t\tHireable:        Ptr(false),\n\t\t\t\t\tBio:             Ptr(\"b2\"),\n\t\t\t\t\tTwitterUsername: Ptr(\"t2\"),\n\t\t\t\t\tPublicRepos:     Ptr(2),\n\t\t\t\t\tFollowers:       Ptr(2),\n\t\t\t\t\tFollowing:       Ptr(2),\n\t\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t\t\tURL:             Ptr(\"u2\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"total_count\": 1,\n\t\t\"workflow_runs\": [\n\t\t\t{\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"node_id\": \"nid\",\n\t\t\t\t\"head_branch\": \"hb\",\n\t\t\t\t\"head_sha\": \"hs\",\n\t\t\t\t\"run_number\": 1,\n\t\t\t\t\"run_attempt\": 1,\n\t\t\t\t\"event\": \"e\",\n\t\t\t\t\"status\": \"s\",\n\t\t\t\t\"conclusion\": \"c\",\n\t\t\t\t\"workflow_id\": 1,\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"html_url\": \"h\",\n\t\t\t\t\"pull_requests\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\":1,\n\t\t\t\t\t\t\"number\":1,\n\t\t\t\t\t\t\"url\":\"u\",\n\t\t\t\t\t\t\"head\":{\n\t\t\t\t\t\t\t\"ref\":\"r\",\n\t\t\t\t\t\t\t\"sha\":\"s\",\n\t\t\t\t\t\t\t\"repo\": {\n\t\t\t\t\t\t\t\t\"id\":1,\n\t\t\t\t\t\t\t\t\"name\":\"n\",\n\t\t\t\t\t\t\t\t\"url\":\"s\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"base\": {\n\t\t\t\t\t\t\t\t\"ref\":\"r\",\n\t\t\t\t\t\t\t\t\"sha\":\"s\",\n\t\t\t\t\t\t\t\t\"repo\": {\n\t\t\t\t\t\t\t\t\t\"id\":1,\n\t\t\t\t\t\t\t\t\t\"name\":\"n\",\n\t\t\t\t\t\t\t\t\t\"url\":\"u\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"run_started_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"jobs_url\": \"j\",\n\t\t\t\t\"logs_url\": \"l\",\n\t\t\t\t\"check_suite_url\": \"c\",\n\t\t\t\t\"artifacts_url\": \"a\",\n\t\t\t\t\"cancel_url\": \"c\",\n\t\t\t\t\"rerun_url\": \"r\",\n\t\t\t\t\"previous_attempt_url\": \"p\",\n\t\t\t\t\"head_commit\": {\n\t\t\t\t\t\"message\": \"m\",\n\t\t\t\t\t\"author\": {\n\t\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\t\"email\": \"e\",\n\t\t\t\t\t\t\"username\": \"l\"\n\t\t\t\t\t},\n\t\t\t\t\t\"url\": \"u\",\n\t\t\t\t\t\"distinct\": false,\n\t\t\t\t\t\"sha\": \"s\",\n\t\t\t\t\t\"id\": \"i\",\n\t\t\t\t\t\"tree_id\": \"tid\",\n\t\t\t\t\t\"timestamp\": ` + referenceTimeStr + `,\n\t\t\t\t\t\"committer\": {\n\t\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\t\"email\": \"e\",\n\t\t\t\t\t\t\"username\": \"l\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"workflow_url\": \"w\",\n\t\t\t\t\"repository\": {\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"url\": \"u\",\n\t\t\t\t\t\"name\": \"n\"\n\t\t\t\t},\n\t\t\t\t\"head_repository\": {\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"url\": \"u\",\n\t\t\t\t\t\"name\": \"n\"\n\t\t\t\t},\n\t\t\t\t\"actor\": {\n\t\t\t\t\t\"login\": \"l\",\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\"company\": \"c\",\n\t\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\t\"location\": \"l\",\n\t\t\t\t\t\"email\": \"e\",\n\t\t\t\t\t\"hireable\": true,\n\t\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\t\"followers\": 1,\n\t\t\t\t\t\"following\": 1,\n\t\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\t\"url\": \"u\"\n\t\t\t\t},\n\t\t\t\t\"triggering_actor\": {\n\t\t\t\t\t\"login\": \"l2\",\n\t\t\t\t\t\"id\": 2,\n\t\t\t\t\t\"avatar_url\": \"a2\",\n\t\t\t\t\t\"gravatar_id\": \"g2\",\n\t\t\t\t\t\"name\": \"n2\",\n\t\t\t\t\t\"company\": \"c2\",\n\t\t\t\t\t\"blog\": \"b2\",\n\t\t\t\t\t\"location\": \"l2\",\n\t\t\t\t\t\"email\": \"e2\",\n\t\t\t\t\t\"hireable\": false,\n\t\t\t\t\t\"bio\": \"b2\",\n\t\t\t\t\t\"twitter_username\": \"t2\",\n\t\t\t\t\t\"public_repos\": 2,\n\t\t\t\t\t\"followers\": 2,\n\t\t\t\t\t\"following\": 2,\n\t\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\t\"url\": \"u2\"\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestWorkflowRunBill_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &WorkflowRunBill{}, \"{}\")\n\n\tu := &WorkflowRunBill{\n\t\tTotalMS: Ptr(int64(1)),\n\t\tJobs:    Ptr(1),\n\t}\n\n\twant := `{\n\t\t\"total_ms\": 1,\n\t\t\"jobs\": 1\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestWorkflowRunBillMap_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &WorkflowRunBillMap{}, \"{}\")\n\n\tu := &WorkflowRunBillMap{\n\t\t\"UBUNTU\": &WorkflowRunBill{\n\t\t\tTotalMS: Ptr(int64(1)),\n\t\t\tJobs:    Ptr(1),\n\t\t},\n\t\t\"MACOS\": &WorkflowRunBill{\n\t\t\tTotalMS: Ptr(int64(1)),\n\t\t\tJobs:    Ptr(1),\n\t\t},\n\t\t\"WINDOWS\": &WorkflowRunBill{\n\t\t\tTotalMS: Ptr(int64(1)),\n\t\t\tJobs:    Ptr(1),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"UBUNTU\": {\n\t\t\t\"total_ms\": 1,\n\t\t\t\"jobs\": 1\n\t\t},\n\t\t\"MACOS\": {\n\t\t\t\"total_ms\": 1,\n\t\t\t\"jobs\": 1\n\t\t},\n\t\t\"WINDOWS\": {\n\t\t\t\"total_ms\": 1,\n\t\t\t\"jobs\": 1\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestWorkflowRunUsage_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &WorkflowRunUsage{}, \"{}\")\n\n\tu := &WorkflowRunUsage{\n\t\tBillable: &WorkflowRunBillMap{\n\t\t\t\"UBUNTU\": &WorkflowRunBill{\n\t\t\t\tTotalMS: Ptr(int64(1)),\n\t\t\t\tJobs:    Ptr(1),\n\t\t\t},\n\t\t\t\"MACOS\": &WorkflowRunBill{\n\t\t\t\tTotalMS: Ptr(int64(1)),\n\t\t\t\tJobs:    Ptr(1),\n\t\t\t},\n\t\t\t\"WINDOWS\": &WorkflowRunBill{\n\t\t\t\tTotalMS: Ptr(int64(1)),\n\t\t\t\tJobs:    Ptr(1),\n\t\t\t},\n\t\t},\n\t\tRunDurationMS: Ptr(int64(1)),\n\t}\n\n\twant := `{\n\t\t\"billable\": {\n\t\t\t\"UBUNTU\": {\n\t\t\t\t\"total_ms\": 1,\n\t\t\t\t\"jobs\": 1\n\t\t\t},\n\t\t\t\"MACOS\": {\n\t\t\t\t\"total_ms\": 1,\n\t\t\t\t\"jobs\": 1\n\t\t\t},\n\t\t\t\"WINDOWS\": {\n\t\t\t\t\"total_ms\": 1,\n\t\t\t\t\"jobs\": 1\n\t\t\t}\n\t\t},\n\t\t\"run_duration_ms\": 1\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestActionService_PendingDeployments(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &PendingDeploymentsRequest{EnvironmentIDs: []int64{3, 4}, State: \"approved\", Comment: \"\"}\n\n\tmux.HandleFunc(\"/repos/o/r/actions/runs/399444496/pending_deployments\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *PendingDeploymentsRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `[{\"id\":1}, {\"id\":2}]`)\n\t})\n\n\tctx := t.Context()\n\tdeployments, _, err := client.Actions.PendingDeployments(ctx, \"o\", \"r\", 399444496, input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.PendingDeployments returned error: %v\", err)\n\t}\n\n\twant := []*Deployment{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}}\n\tif !cmp.Equal(deployments, want) {\n\t\tt.Errorf(\"Actions.PendingDeployments returned %+v, want %+v\", deployments, want)\n\t}\n\n\tconst methodName = \"PendingDeployments\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.PendingDeployments(ctx, \"\\n\", \"\\n\", 399444496, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.PendingDeployments(ctx, \"o\", \"r\", 399444496, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionService_GetPendingDeployments(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/runs/399444496/pending_deployments\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[\n\t\t\t{\n\t\t\t\t\"environment\": {\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"node_id\": \"nid\",\n\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\"url\": \"u\",\n\t\t\t\t\t\"html_url\": \"hu\"\n\t\t\t\t},\n\t\t\t\t\"wait_timer\": 0,\n\t\t\t\t\"wait_timer_started_at\": `+referenceTimeStr+`,\n\t\t\t\t\"current_user_can_approve\": false,\n\t\t\t\t\"reviewers\": []\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"environment\": {\n\t\t\t\t\t\"id\": 2,\n\t\t\t\t\t\"node_id\": \"nid\",\n\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\"url\": \"u\",\n\t\t\t\t\t\"html_url\": \"hu\"\n\t\t\t\t},\n\t\t\t\t\"wait_timer\": 13,\n\t\t\t\t\"wait_timer_started_at\": `+referenceTimeStr+`,\n\t\t\t\t\"current_user_can_approve\": true,\n\t\t\t\t\"reviewers\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"User\",\n\t\t\t\t\t\t\"reviewer\": {\n\t\t\t\t\t\t\t\"login\": \"l\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"Team\",\n\t\t\t\t\t\t\"reviewer\": {\n\t\t\t\t\t\t\t\"name\": \"t\",\n\t\t\t\t\t\t\t\"slug\": \"s\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t]`)\n\t})\n\n\tctx := t.Context()\n\tdeployments, _, err := client.Actions.GetPendingDeployments(ctx, \"o\", \"r\", 399444496)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetPendingDeployments returned error: %v\", err)\n\t}\n\n\twant := []*PendingDeployment{\n\t\t{\n\t\t\tEnvironment: &PendingDeploymentEnvironment{\n\t\t\t\tID:      Ptr(int64(1)),\n\t\t\t\tNodeID:  Ptr(\"nid\"),\n\t\t\t\tName:    Ptr(\"n\"),\n\t\t\t\tURL:     Ptr(\"u\"),\n\t\t\t\tHTMLURL: Ptr(\"hu\"),\n\t\t\t},\n\t\t\tWaitTimer:             Ptr(int64(0)),\n\t\t\tWaitTimerStartedAt:    &Timestamp{referenceTime},\n\t\t\tCurrentUserCanApprove: Ptr(false),\n\t\t\tReviewers:             []*RequiredReviewer{},\n\t\t},\n\t\t{\n\t\t\tEnvironment: &PendingDeploymentEnvironment{\n\t\t\t\tID:      Ptr(int64(2)),\n\t\t\t\tNodeID:  Ptr(\"nid\"),\n\t\t\t\tName:    Ptr(\"n\"),\n\t\t\t\tURL:     Ptr(\"u\"),\n\t\t\t\tHTMLURL: Ptr(\"hu\"),\n\t\t\t},\n\t\t\tWaitTimer:             Ptr(int64(13)),\n\t\t\tWaitTimerStartedAt:    &Timestamp{referenceTime},\n\t\t\tCurrentUserCanApprove: Ptr(true),\n\t\t\tReviewers: []*RequiredReviewer{\n\t\t\t\t{\n\t\t\t\t\tType: Ptr(\"User\"),\n\t\t\t\t\tReviewer: &User{\n\t\t\t\t\t\tLogin: Ptr(\"l\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tType: Ptr(\"Team\"),\n\t\t\t\t\tReviewer: &Team{\n\t\t\t\t\t\tName: Ptr(\"t\"),\n\t\t\t\t\t\tSlug: Ptr(\"s\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(deployments, want) {\n\t\tt.Errorf(\"Actions.GetPendingDeployments returned %+v, want %+v\", deployments, want)\n\t}\n\n\tconst methodName = \"GetPendingDeployments\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetPendingDeployments(ctx, \"\\n\", \"\\n\", 399444496)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetPendingDeployments(ctx, \"o\", \"r\", 399444496)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/actions_workflows.go",
    "content": "// Copyright 2020 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// Workflow represents a repository action workflow.\ntype Workflow struct {\n\tID        *int64     `json:\"id,omitempty\"`\n\tNodeID    *string    `json:\"node_id,omitempty\"`\n\tName      *string    `json:\"name,omitempty\"`\n\tPath      *string    `json:\"path,omitempty\"`\n\tState     *string    `json:\"state,omitempty\"`\n\tCreatedAt *Timestamp `json:\"created_at,omitempty\"`\n\tUpdatedAt *Timestamp `json:\"updated_at,omitempty\"`\n\tURL       *string    `json:\"url,omitempty\"`\n\tHTMLURL   *string    `json:\"html_url,omitempty\"`\n\tBadgeURL  *string    `json:\"badge_url,omitempty\"`\n}\n\n// Workflows represents a slice of repository action workflows.\ntype Workflows struct {\n\tTotalCount *int        `json:\"total_count,omitempty\"`\n\tWorkflows  []*Workflow `json:\"workflows,omitempty\"`\n}\n\n// WorkflowUsage represents a usage of a specific workflow.\ntype WorkflowUsage struct {\n\tBillable *WorkflowBillMap `json:\"billable,omitempty\"`\n}\n\n// WorkflowBillMap represents different runner environments available for a workflow.\n// Its key is the name of its environment, e.g. \"UBUNTU\", \"MACOS\", \"WINDOWS\", etc.\ntype WorkflowBillMap map[string]*WorkflowBill\n\n// WorkflowBill specifies billable time for a specific environment in a workflow.\ntype WorkflowBill struct {\n\tTotalMS *int64 `json:\"total_ms,omitempty\"`\n}\n\n// CreateWorkflowDispatchEventRequest represents a request to create a workflow dispatch event.\ntype CreateWorkflowDispatchEventRequest struct {\n\t// Ref represents the reference of the workflow run.\n\t// The reference can be a branch or a tag.\n\t// Ref is required when creating a workflow dispatch event.\n\tRef string `json:\"ref\"`\n\t// Inputs represents input keys and values configured in the workflow file.\n\t// The maximum number of properties is 25.\n\t// Default: Any default properties configured in the workflow file will be used when `inputs` are omitted.\n\tInputs map[string]any `json:\"inputs,omitempty\"`\n\t// ReturnRunDetails specifies whether the response should include\n\t// the workflow run ID and URLs.\n\tReturnRunDetails *bool `json:\"return_run_details,omitempty\"`\n}\n\n// WorkflowDispatchRunDetails represents the response from creating\n// a workflow dispatch event when ReturnRunDetails is set to true.\ntype WorkflowDispatchRunDetails struct {\n\tWorkflowRunID *int64  `json:\"workflow_run_id,omitempty\"`\n\tRunURL        *string `json:\"run_url,omitempty\"`\n\tHTMLURL       *string `json:\"html_url,omitempty\"`\n}\n\n// WorkflowsPermissions represents the permissions for workflows in a repository.\ntype WorkflowsPermissions struct {\n\tRunWorkflowsFromForkPullRequests  *bool `json:\"run_workflows_from_fork_pull_requests,omitempty\"`\n\tSendWriteTokensToWorkflows        *bool `json:\"send_write_tokens_to_workflows,omitempty\"`\n\tSendSecretsAndVariables           *bool `json:\"send_secrets_and_variables,omitempty\"`\n\tRequireApprovalForForkPRWorkflows *bool `json:\"require_approval_for_fork_pr_workflows,omitempty\"`\n}\n\nfunc (w WorkflowsPermissions) String() string {\n\treturn Stringify(w)\n}\n\n// WorkflowsPermissionsOpt specifies options for editing workflows permissions in a repository.\ntype WorkflowsPermissionsOpt struct {\n\tRunWorkflowsFromForkPullRequests  bool  `json:\"run_workflows_from_fork_pull_requests\"`\n\tSendWriteTokensToWorkflows        *bool `json:\"send_write_tokens_to_workflows,omitempty\"`\n\tSendSecretsAndVariables           *bool `json:\"send_secrets_and_variables,omitempty\"`\n\tRequireApprovalForForkPRWorkflows *bool `json:\"require_approval_for_fork_pr_workflows,omitempty\"`\n}\n\n// ContributorApprovalPermissions represents the policy that controls\n// when fork PR workflows require approval from a maintainer.\ntype ContributorApprovalPermissions struct {\n\tApprovalPolicy string `json:\"approval_policy\"`\n}\n\nfunc (p ContributorApprovalPermissions) String() string {\n\treturn Stringify(p)\n}\n\n// ListWorkflows lists all workflows in a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflows#list-repository-workflows\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/workflows\nfunc (s *ActionsService) ListWorkflows(ctx context.Context, owner, repo string, opts *ListOptions) (*Workflows, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/workflows\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar workflows *Workflows\n\tresp, err := s.client.Do(ctx, req, &workflows)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn workflows, resp, nil\n}\n\n// GetWorkflowByID gets a specific workflow by ID.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflows#get-a-workflow\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}\nfunc (s *ActionsService) GetWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Workflow, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/workflows/%v\", owner, repo, workflowID)\n\n\treturn s.getWorkflow(ctx, u)\n}\n\n// GetWorkflowByFileName gets a specific workflow by file name.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflows#get-a-workflow\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}\nfunc (s *ActionsService) GetWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Workflow, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/workflows/%v\", owner, repo, workflowFileName)\n\n\treturn s.getWorkflow(ctx, u)\n}\n\nfunc (s *ActionsService) getWorkflow(ctx context.Context, url string) (*Workflow, *Response, error) {\n\treq, err := s.client.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar workflow *Workflow\n\tresp, err := s.client.Do(ctx, req, &workflow)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn workflow, resp, nil\n}\n\n// GetWorkflowUsageByID gets a specific workflow usage by ID in the unit of billable milliseconds.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflows#get-workflow-usage\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing\nfunc (s *ActionsService) GetWorkflowUsageByID(ctx context.Context, owner, repo string, workflowID int64) (*WorkflowUsage, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/workflows/%v/timing\", owner, repo, workflowID)\n\n\treturn s.getWorkflowUsage(ctx, u)\n}\n\n// GetWorkflowUsageByFileName gets a specific workflow usage by file name in the unit of billable milliseconds.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflows#get-workflow-usage\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing\nfunc (s *ActionsService) GetWorkflowUsageByFileName(ctx context.Context, owner, repo, workflowFileName string) (*WorkflowUsage, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/workflows/%v/timing\", owner, repo, workflowFileName)\n\n\treturn s.getWorkflowUsage(ctx, u)\n}\n\nfunc (s *ActionsService) getWorkflowUsage(ctx context.Context, url string) (*WorkflowUsage, *Response, error) {\n\treq, err := s.client.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar workflowUsage *WorkflowUsage\n\tresp, err := s.client.Do(ctx, req, &workflowUsage)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn workflowUsage, resp, nil\n}\n\n// CreateWorkflowDispatchEventByID manually triggers a GitHub Actions workflow run.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event\n//\n//meta:operation POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches\nfunc (s *ActionsService) CreateWorkflowDispatchEventByID(ctx context.Context, owner, repo string, workflowID int64, event CreateWorkflowDispatchEventRequest) (*WorkflowDispatchRunDetails, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/workflows/%v/dispatches\", owner, repo, workflowID)\n\n\treturn s.createWorkflowDispatchEvent(ctx, u, &event)\n}\n\n// CreateWorkflowDispatchEventByFileName manually triggers a GitHub Actions workflow run.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event\n//\n//meta:operation POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches\nfunc (s *ActionsService) CreateWorkflowDispatchEventByFileName(ctx context.Context, owner, repo, workflowFileName string, event CreateWorkflowDispatchEventRequest) (*WorkflowDispatchRunDetails, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/workflows/%v/dispatches\", owner, repo, workflowFileName)\n\n\treturn s.createWorkflowDispatchEvent(ctx, u, &event)\n}\n\nfunc (s *ActionsService) createWorkflowDispatchEvent(ctx context.Context, url string, event *CreateWorkflowDispatchEventRequest) (*WorkflowDispatchRunDetails, *Response, error) {\n\treq, err := s.client.NewRequest(\"POST\", url, event)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar dispatchRunDetails *WorkflowDispatchRunDetails\n\tresp, err := s.client.Do(ctx, req, &dispatchRunDetails)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn dispatchRunDetails, resp, nil\n}\n\n// EnableWorkflowByID enables a workflow and sets the state of the workflow to \"active\".\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflows#enable-a-workflow\n//\n//meta:operation PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable\nfunc (s *ActionsService) EnableWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/workflows/%v/enable\", owner, repo, workflowID)\n\treturn s.doNewPutRequest(ctx, u)\n}\n\n// EnableWorkflowByFileName enables a workflow and sets the state of the workflow to \"active\".\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflows#enable-a-workflow\n//\n//meta:operation PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable\nfunc (s *ActionsService) EnableWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/workflows/%v/enable\", owner, repo, workflowFileName)\n\treturn s.doNewPutRequest(ctx, u)\n}\n\n// DisableWorkflowByID disables a workflow and sets the state of the workflow to \"disabled_manually\".\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflows#disable-a-workflow\n//\n//meta:operation PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable\nfunc (s *ActionsService) DisableWorkflowByID(ctx context.Context, owner, repo string, workflowID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/workflows/%v/disable\", owner, repo, workflowID)\n\treturn s.doNewPutRequest(ctx, u)\n}\n\n// DisableWorkflowByFileName disables a workflow and sets the state of the workflow to \"disabled_manually\".\n//\n// GitHub API docs: https://docs.github.com/rest/actions/workflows#disable-a-workflow\n//\n//meta:operation PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable\nfunc (s *ActionsService) DisableWorkflowByFileName(ctx context.Context, owner, repo, workflowFileName string) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/workflows/%v/disable\", owner, repo, workflowFileName)\n\treturn s.doNewPutRequest(ctx, u)\n}\n\nfunc (s *ActionsService) doNewPutRequest(ctx context.Context, url string) (*Response, error) {\n\treq, err := s.client.NewRequest(\"PUT\", url, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/actions_workflows_test.go",
    "content": "// Copyright 2020 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestActionsService_ListWorkflows(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/workflows\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `{\"total_count\":4,\"workflows\":[{\"id\":72844,\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"},{\"id\":72845,\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"}]}`)\n\t})\n\n\topts := &ListOptions{Page: 2, PerPage: 2}\n\tctx := t.Context()\n\tworkflows, _, err := client.Actions.ListWorkflows(ctx, \"o\", \"r\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.ListWorkflows returned error: %v\", err)\n\t}\n\n\twant := &Workflows{\n\t\tTotalCount: Ptr(4),\n\t\tWorkflows: []*Workflow{\n\t\t\t{ID: Ptr(int64(72844)), CreatedAt: &Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)}},\n\t\t\t{ID: Ptr(int64(72845)), CreatedAt: &Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)}, UpdatedAt: &Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)}},\n\t\t},\n\t}\n\tif !cmp.Equal(workflows, want) {\n\t\tt.Errorf(\"Actions.ListWorkflows returned %+v, want %+v\", workflows, want)\n\t}\n\n\tconst methodName = \"ListWorkflows\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.ListWorkflows(ctx, \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.ListWorkflows(ctx, \"o\", \"r\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetWorkflowByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/workflows/72844\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":72844,\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"}`)\n\t})\n\n\tctx := t.Context()\n\tworkflow, _, err := client.Actions.GetWorkflowByID(ctx, \"o\", \"r\", 72844)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetWorkflowByID returned error: %v\", err)\n\t}\n\n\twant := &Workflow{\n\t\tID:        Ptr(int64(72844)),\n\t\tCreatedAt: &Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t\tUpdatedAt: &Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t}\n\tif !cmp.Equal(workflow, want) {\n\t\tt.Errorf(\"Actions.GetWorkflowByID returned %+v, want %+v\", workflow, want)\n\t}\n\n\tconst methodName = \"GetWorkflowByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetWorkflowByID(ctx, \"\\n\", \"\\n\", -72844)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetWorkflowByID(ctx, \"o\", \"r\", 72844)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetWorkflowByFileName(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/workflows/main.yml\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":72844,\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"}`)\n\t})\n\n\tctx := t.Context()\n\tworkflow, _, err := client.Actions.GetWorkflowByFileName(ctx, \"o\", \"r\", \"main.yml\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetWorkflowByFileName returned error: %v\", err)\n\t}\n\n\twant := &Workflow{\n\t\tID:        Ptr(int64(72844)),\n\t\tCreatedAt: &Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t\tUpdatedAt: &Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t}\n\tif !cmp.Equal(workflow, want) {\n\t\tt.Errorf(\"Actions.GetWorkflowByFileName returned %+v, want %+v\", workflow, want)\n\t}\n\n\tconst methodName = \"GetWorkflowByFileName\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetWorkflowByFileName(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetWorkflowByFileName(ctx, \"o\", \"r\", \"main.yml\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetWorkflowUsageByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/workflows/72844/timing\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"billable\":{\"UBUNTU\":{\"total_ms\":180000},\"MACOS\":{\"total_ms\":240000},\"WINDOWS\":{\"total_ms\":300000}}}`)\n\t})\n\n\tctx := t.Context()\n\tworkflowUsage, _, err := client.Actions.GetWorkflowUsageByID(ctx, \"o\", \"r\", 72844)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetWorkflowUsageByID returned error: %v\", err)\n\t}\n\n\twant := &WorkflowUsage{\n\t\tBillable: &WorkflowBillMap{\n\t\t\t\"UBUNTU\": &WorkflowBill{\n\t\t\t\tTotalMS: Ptr(int64(180000)),\n\t\t\t},\n\t\t\t\"MACOS\": &WorkflowBill{\n\t\t\t\tTotalMS: Ptr(int64(240000)),\n\t\t\t},\n\t\t\t\"WINDOWS\": &WorkflowBill{\n\t\t\t\tTotalMS: Ptr(int64(300000)),\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(workflowUsage, want) {\n\t\tt.Errorf(\"Actions.GetWorkflowUsageByID returned %+v, want %+v\", workflowUsage, want)\n\t}\n\n\tconst methodName = \"GetWorkflowUsageByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetWorkflowUsageByID(ctx, \"\\n\", \"\\n\", -72844)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetWorkflowUsageByID(ctx, \"o\", \"r\", 72844)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_GetWorkflowUsageByFileName(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/workflows/main.yml/timing\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"billable\":{\"UBUNTU\":{\"total_ms\":180000},\"MACOS\":{\"total_ms\":240000},\"WINDOWS\":{\"total_ms\":300000}}}`)\n\t})\n\n\tctx := t.Context()\n\tworkflowUsage, _, err := client.Actions.GetWorkflowUsageByFileName(ctx, \"o\", \"r\", \"main.yml\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetWorkflowUsageByFileName returned error: %v\", err)\n\t}\n\n\twant := &WorkflowUsage{\n\t\tBillable: &WorkflowBillMap{\n\t\t\t\"UBUNTU\": &WorkflowBill{\n\t\t\t\tTotalMS: Ptr(int64(180000)),\n\t\t\t},\n\t\t\t\"MACOS\": &WorkflowBill{\n\t\t\t\tTotalMS: Ptr(int64(240000)),\n\t\t\t},\n\t\t\t\"WINDOWS\": &WorkflowBill{\n\t\t\t\tTotalMS: Ptr(int64(300000)),\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(workflowUsage, want) {\n\t\tt.Errorf(\"Actions.GetWorkflowUsageByFileName returned %+v, want %+v\", workflowUsage, want)\n\t}\n\n\tconst methodName = \"GetWorkflowUsageByFileName\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetWorkflowUsageByFileName(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetWorkflowUsageByFileName(ctx, \"o\", \"r\", \"main.yml\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_CreateWorkflowDispatchEventByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tevent := CreateWorkflowDispatchEventRequest{\n\t\tRef:              \"d4cfb6e7\",\n\t\tReturnRunDetails: Ptr(true),\n\t\tInputs: map[string]any{\n\t\t\t\"key\": \"value\",\n\t\t},\n\t}\n\tmux.HandleFunc(\"/repos/o/r/actions/workflows/72844/dispatches\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v CreateWorkflowDispatchEventRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, event) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, event)\n\t\t}\n\n\t\tw.WriteHeader(http.StatusOK)\n\t\tfmt.Fprint(w, `{\"workflow_run_id\":1,\"run_url\":\"https://api.github.com/repos/o/r/actions/runs/1\",\"html_url\":\"https://github.com/o/r/actions/runs/1\"}`)\n\t})\n\n\tctx := t.Context()\n\tdispatchResponse, _, err := client.Actions.CreateWorkflowDispatchEventByID(ctx, \"o\", \"r\", 72844, event)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.CreateWorkflowDispatchEventByID returned error: %v\", err)\n\t}\n\n\twant := &WorkflowDispatchRunDetails{\n\t\tWorkflowRunID: Ptr(int64(1)),\n\t\tRunURL:        Ptr(\"https://api.github.com/repos/o/r/actions/runs/1\"),\n\t\tHTMLURL:       Ptr(\"https://github.com/o/r/actions/runs/1\"),\n\t}\n\tif !cmp.Equal(dispatchResponse, want) {\n\t\tt.Errorf(\"Actions.CreateWorkflowDispatchEventByID = %+v, want %+v\", dispatchResponse, want)\n\t}\n\n\t// Test s.client.NewRequest failure\n\tclient.BaseURL.Path = \"\"\n\t_, _, err = client.Actions.CreateWorkflowDispatchEventByID(ctx, \"o\", \"r\", 72844, event)\n\tif err == nil {\n\t\tt.Error(\"client.BaseURL.Path='' CreateWorkflowDispatchEventByID err = nil, want error\")\n\t}\n\n\tconst methodName = \"CreateWorkflowDispatchEventByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.CreateWorkflowDispatchEventByID(ctx, \"o\", \"r\", 72844, event)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.CreateWorkflowDispatchEventByID(ctx, \"o\", \"r\", 72844, event)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_CreateWorkflowDispatchEventByFileName(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tevent := CreateWorkflowDispatchEventRequest{\n\t\tRef:              \"d4cfb6e7\",\n\t\tReturnRunDetails: Ptr(true),\n\t\tInputs: map[string]any{\n\t\t\t\"key\": \"value\",\n\t\t},\n\t}\n\tmux.HandleFunc(\"/repos/o/r/actions/workflows/main.yml/dispatches\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v CreateWorkflowDispatchEventRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, event) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, event)\n\t\t}\n\n\t\tw.WriteHeader(http.StatusOK)\n\t\tfmt.Fprint(w, `{\"workflow_run_id\":1,\"run_url\":\"https://api.github.com/repos/o/r/actions/runs/1\",\"html_url\":\"https://github.com/o/r/actions/runs/1\"}`)\n\t})\n\n\tctx := t.Context()\n\tdispatchResponse, _, err := client.Actions.CreateWorkflowDispatchEventByFileName(ctx, \"o\", \"r\", \"main.yml\", event)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.CreateWorkflowDispatchEventByFileName returned error: %v\", err)\n\t}\n\n\twant := &WorkflowDispatchRunDetails{\n\t\tWorkflowRunID: Ptr(int64(1)),\n\t\tRunURL:        Ptr(\"https://api.github.com/repos/o/r/actions/runs/1\"),\n\t\tHTMLURL:       Ptr(\"https://github.com/o/r/actions/runs/1\"),\n\t}\n\tif !cmp.Equal(dispatchResponse, want) {\n\t\tt.Errorf(\"Actions.CreateWorkflowDispatchEventByFileName = %+v, want %+v\", dispatchResponse, want)\n\t}\n\n\t// Test s.client.NewRequest failure\n\tclient.BaseURL.Path = \"\"\n\t_, _, err = client.Actions.CreateWorkflowDispatchEventByFileName(ctx, \"o\", \"r\", \"main.yml\", event)\n\tif err == nil {\n\t\tt.Error(\"client.BaseURL.Path='' CreateWorkflowDispatchEventByFileName err = nil, want error\")\n\t}\n\n\tconst methodName = \"CreateWorkflowDispatchEventByFileName\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.CreateWorkflowDispatchEventByFileName(ctx, \"o\", \"r\", \"main.yml\", event)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.CreateWorkflowDispatchEventByFileName(ctx, \"o\", \"r\", \"main.yml\", event)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_CreateWorkflowDispatchEventByID_noRunDetails(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tevent := CreateWorkflowDispatchEventRequest{\n\t\tRef: \"d4cfb6e7\",\n\t\tInputs: map[string]any{\n\t\t\t\"key\": \"value\",\n\t\t},\n\t}\n\tmux.HandleFunc(\"/repos/o/r/actions/workflows/72844/dispatches\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v CreateWorkflowDispatchEventRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, event) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, event)\n\t\t}\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tdispatchResponse, _, err := client.Actions.CreateWorkflowDispatchEventByID(ctx, \"o\", \"r\", 72844, event)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.CreateWorkflowDispatchEventByID returned error: %v\", err)\n\t}\n\n\tif dispatchResponse != nil {\n\t\tt.Errorf(\"Actions.CreateWorkflowDispatchEventByID = %+v, want nil\", dispatchResponse)\n\t}\n}\n\nfunc TestActionsService_CreateWorkflowDispatchEventByFileName_noRunDetails(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tevent := CreateWorkflowDispatchEventRequest{\n\t\tRef: \"d4cfb6e7\",\n\t\tInputs: map[string]any{\n\t\t\t\"key\": \"value\",\n\t\t},\n\t}\n\tmux.HandleFunc(\"/repos/o/r/actions/workflows/main.yml/dispatches\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v CreateWorkflowDispatchEventRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, event) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, event)\n\t\t}\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tdispatchResponse, _, err := client.Actions.CreateWorkflowDispatchEventByFileName(ctx, \"o\", \"r\", \"main.yml\", event)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.CreateWorkflowDispatchEventByFileName returned error: %v\", err)\n\t}\n\n\tif dispatchResponse != nil {\n\t\tt.Errorf(\"Actions.CreateWorkflowDispatchEventByFileName = %+v, want nil\", dispatchResponse)\n\t}\n}\n\nfunc TestActionsService_EnableWorkflowByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/workflows/72844/enable\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif r.Body != http.NoBody {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", r.Body, http.NoBody)\n\t\t}\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.EnableWorkflowByID(ctx, \"o\", \"r\", 72844)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.EnableWorkflowByID returned error: %v\", err)\n\t}\n\n\t// Test s.client.NewRequest failure\n\tclient.BaseURL.Path = \"\"\n\t_, err = client.Actions.EnableWorkflowByID(ctx, \"o\", \"r\", 72844)\n\tif err == nil {\n\t\tt.Error(\"client.BaseURL.Path='' EnableWorkflowByID err = nil, want error\")\n\t}\n\n\tconst methodName = \"EnableWorkflowByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.EnableWorkflowByID(ctx, \"o\", \"r\", 72844)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.EnableWorkflowByID(ctx, \"o\", \"r\", 72844)\n\t})\n}\n\nfunc TestActionsService_EnableWorkflowByFilename(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/workflows/main.yml/enable\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif r.Body != http.NoBody {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", r.Body, http.NoBody)\n\t\t}\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.EnableWorkflowByFileName(ctx, \"o\", \"r\", \"main.yml\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.EnableWorkflowByFilename returned error: %v\", err)\n\t}\n\n\t// Test s.client.NewRequest failure\n\tclient.BaseURL.Path = \"\"\n\t_, err = client.Actions.EnableWorkflowByFileName(ctx, \"o\", \"r\", \"main.yml\")\n\tif err == nil {\n\t\tt.Error(\"client.BaseURL.Path='' EnableWorkflowByFilename err = nil, want error\")\n\t}\n\n\tconst methodName = \"EnableWorkflowByFileName\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.EnableWorkflowByFileName(ctx, \"o\", \"r\", \"main.yml\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.EnableWorkflowByFileName(ctx, \"o\", \"r\", \"main.yml\")\n\t})\n}\n\nfunc TestActionsService_DisableWorkflowByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/workflows/72844/disable\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif r.Body != http.NoBody {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", r.Body, http.NoBody)\n\t\t}\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.DisableWorkflowByID(ctx, \"o\", \"r\", 72844)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.DisableWorkflowByID returned error: %v\", err)\n\t}\n\n\t// Test s.client.NewRequest failure\n\tclient.BaseURL.Path = \"\"\n\t_, err = client.Actions.DisableWorkflowByID(ctx, \"o\", \"r\", 72844)\n\tif err == nil {\n\t\tt.Error(\"client.BaseURL.Path='' DisableWorkflowByID err = nil, want error\")\n\t}\n\n\tconst methodName = \"DisableWorkflowByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.DisableWorkflowByID(ctx, \"o\", \"r\", 72844)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.DisableWorkflowByID(ctx, \"o\", \"r\", 72844)\n\t})\n}\n\nfunc TestActionsService_DisableWorkflowByFileName(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/workflows/main.yml/disable\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif r.Body != http.NoBody {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", r.Body, http.NoBody)\n\t\t}\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Actions.DisableWorkflowByFileName(ctx, \"o\", \"r\", \"main.yml\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.DisableWorkflowByFileName returned error: %v\", err)\n\t}\n\n\t// Test s.client.NewRequest failure\n\tclient.BaseURL.Path = \"\"\n\t_, err = client.Actions.DisableWorkflowByFileName(ctx, \"o\", \"r\", \"main.yml\")\n\tif err == nil {\n\t\tt.Error(\"client.BaseURL.Path='' DisableWorkflowByFileName err = nil, want error\")\n\t}\n\n\tconst methodName = \"DisableWorkflowByFileName\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.DisableWorkflowByFileName(ctx, \"o\", \"r\", \"main.yml\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.DisableWorkflowByFileName(ctx, \"o\", \"r\", \"main.yml\")\n\t})\n}\n\nfunc TestWorkflow_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Workflow{}, \"{}\")\n\n\tu := &Workflow{\n\t\tID:        Ptr(int64(1)),\n\t\tNodeID:    Ptr(\"nid\"),\n\t\tName:      Ptr(\"n\"),\n\t\tPath:      Ptr(\"p\"),\n\t\tState:     Ptr(\"s\"),\n\t\tCreatedAt: &Timestamp{referenceTime},\n\t\tUpdatedAt: &Timestamp{referenceTime},\n\t\tURL:       Ptr(\"u\"),\n\t\tHTMLURL:   Ptr(\"h\"),\n\t\tBadgeURL:  Ptr(\"b\"),\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"node_id\": \"nid\",\n\t\t\"name\": \"n\",\n\t\t\"path\": \"p\",\n\t\t\"state\": \"s\",\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"url\": \"u\",\n\t\t\"html_url\": \"h\",\n\t\t\"badge_url\": \"b\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestWorkflows_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Workflows{}, \"{}\")\n\n\tu := &Workflows{\n\t\tTotalCount: Ptr(1),\n\t\tWorkflows: []*Workflow{\n\t\t\t{\n\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\tNodeID:    Ptr(\"nid\"),\n\t\t\t\tName:      Ptr(\"n\"),\n\t\t\t\tPath:      Ptr(\"p\"),\n\t\t\t\tState:     Ptr(\"s\"),\n\t\t\t\tCreatedAt: &Timestamp{referenceTime},\n\t\t\t\tUpdatedAt: &Timestamp{referenceTime},\n\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\tHTMLURL:   Ptr(\"h\"),\n\t\t\t\tBadgeURL:  Ptr(\"b\"),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"total_count\": 1,\n\t\t\"workflows\": [{\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"path\": \"p\",\n\t\t\t\"state\": \"s\",\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\",\n\t\t\t\"html_url\": \"h\",\n\t\t\t\"badge_url\": \"b\"\n\t\t}]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestWorkflowBill_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &WorkflowBill{}, \"{}\")\n\n\tu := &WorkflowBill{\n\t\tTotalMS: Ptr(int64(1)),\n\t}\n\n\twant := `{\n\t\t\"total_ms\": 1\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestWorkflowBillMap_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &WorkflowBillMap{}, \"{}\")\n\n\tu := &WorkflowBillMap{\n\t\t\"UBUNTU\": &WorkflowBill{\n\t\t\tTotalMS: Ptr(int64(1)),\n\t\t},\n\t\t\"MACOS\": &WorkflowBill{\n\t\t\tTotalMS: Ptr(int64(1)),\n\t\t},\n\t\t\"WINDOWS\": &WorkflowBill{\n\t\t\tTotalMS: Ptr(int64(1)),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"UBUNTU\": {\n\t\t\t\"total_ms\": 1\n\t\t},\n\t\t\"MACOS\": {\n\t\t\t\"total_ms\": 1\n\t\t},\n\t\t\"WINDOWS\": {\n\t\t\t\"total_ms\": 1\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestWorkflowUsage_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &WorkflowUsage{}, \"{}\")\n\n\tu := &WorkflowUsage{\n\t\tBillable: &WorkflowBillMap{\n\t\t\t\"UBUNTU\": &WorkflowBill{\n\t\t\t\tTotalMS: Ptr(int64(1)),\n\t\t\t},\n\t\t\t\"MACOS\": &WorkflowBill{\n\t\t\t\tTotalMS: Ptr(int64(1)),\n\t\t\t},\n\t\t\t\"WINDOWS\": &WorkflowBill{\n\t\t\t\tTotalMS: Ptr(int64(1)),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"billable\": {\n\t\t\t\"UBUNTU\": {\n\t\t\t\t\"total_ms\": 1\n\t\t\t},\n\t\t\t\"MACOS\": {\n\t\t\t\t\"total_ms\": 1\n\t\t\t},\n\t\t\t\"WINDOWS\": {\n\t\t\t\t\"total_ms\": 1\n\t\t\t}\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestCreateWorkflowDispatchEventRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CreateWorkflowDispatchEventRequest{}, `{\"ref\": \"\"}`)\n\n\tinputs := make(map[string]any, 0)\n\tinputs[\"key\"] = \"value\"\n\n\tu := &CreateWorkflowDispatchEventRequest{\n\t\tRef:    \"r\",\n\t\tInputs: inputs,\n\t}\n\n\twant := `{\n\t\t\"ref\": \"r\",\n\t\t\"inputs\": {\n\t\t\t\"key\": \"value\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/activity.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport \"context\"\n\n// ActivityService handles communication with the activity related\n// methods of the GitHub API.\n//\n// GitHub API docs: https://docs.github.com/rest/activity/\ntype ActivityService service\n\n// FeedLink represents a link to a related resource.\ntype FeedLink struct {\n\tHRef *string `json:\"href,omitempty\"`\n\tType *string `json:\"type,omitempty\"`\n}\n\n// Feeds represents timeline resources in Atom format.\ntype Feeds struct {\n\tTimelineURL                 *string    `json:\"timeline_url,omitempty\"`\n\tUserURL                     *string    `json:\"user_url,omitempty\"`\n\tCurrentUserPublicURL        *string    `json:\"current_user_public_url,omitempty\"`\n\tCurrentUserURL              *string    `json:\"current_user_url,omitempty\"`\n\tCurrentUserActorURL         *string    `json:\"current_user_actor_url,omitempty\"`\n\tCurrentUserOrganizationURL  *string    `json:\"current_user_organization_url,omitempty\"`\n\tCurrentUserOrganizationURLs []string   `json:\"current_user_organization_urls,omitempty\"`\n\tLinks                       *FeedLinks `json:\"_links,omitempty\"`\n}\n\n// FeedLinks represents the links in a Feed.\ntype FeedLinks struct {\n\tTimeline                 *FeedLink   `json:\"timeline,omitempty\"`\n\tUser                     *FeedLink   `json:\"user,omitempty\"`\n\tCurrentUserPublic        *FeedLink   `json:\"current_user_public,omitempty\"`\n\tCurrentUser              *FeedLink   `json:\"current_user,omitempty\"`\n\tCurrentUserActor         *FeedLink   `json:\"current_user_actor,omitempty\"`\n\tCurrentUserOrganization  *FeedLink   `json:\"current_user_organization,omitempty\"`\n\tCurrentUserOrganizations []*FeedLink `json:\"current_user_organizations,omitempty\"`\n}\n\n// ListFeeds lists all the feeds available to the authenticated user.\n//\n// GitHub provides several timeline resources in Atom format:\n//\n//\tTimeline: The GitHub global public timeline\n//\tUser: The public timeline for any user, using URI template\n//\tCurrent user public: The public timeline for the authenticated user\n//\tCurrent user: The private timeline for the authenticated user\n//\tCurrent user actor: The private timeline for activity created by the\n//\t    authenticated user\n//\tCurrent user organizations: The private timeline for the organizations\n//\t    the authenticated user is a member of.\n//\n// Note: Private feeds are only returned when authenticating via Basic Auth\n// since current feed URIs use the older, non revocable auth tokens.\n//\n// GitHub API docs: https://docs.github.com/rest/activity/feeds#get-feeds\n//\n//meta:operation GET /feeds\nfunc (s *ActivityService) ListFeeds(ctx context.Context) (*Feeds, *Response, error) {\n\treq, err := s.client.NewRequest(\"GET\", \"feeds\", nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar f *Feeds\n\tresp, err := s.client.Do(ctx, req, &f)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn f, resp, nil\n}\n"
  },
  {
    "path": "github/activity_events.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// ListEvents drinks from the firehose of all public events across GitHub.\n//\n// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-events\n//\n//meta:operation GET /events\nfunc (s *ActivityService) ListEvents(ctx context.Context, opts *ListOptions) ([]*Event, *Response, error) {\n\tu, err := addOptions(\"events\", opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar events []*Event\n\tresp, err := s.client.Do(ctx, req, &events)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn events, resp, nil\n}\n\n// ListRepositoryEvents lists events for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/activity/events#list-repository-events\n//\n//meta:operation GET /repos/{owner}/{repo}/events\nfunc (s *ActivityService) ListRepositoryEvents(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/events\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar events []*Event\n\tresp, err := s.client.Do(ctx, req, &events)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn events, resp, nil\n}\n\n// ListIssueEventsForRepository lists issue events for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/events#list-issue-events-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/issues/events\nfunc (s *ActivityService) ListIssueEventsForRepository(ctx context.Context, owner, repo string, opts *ListOptions) ([]*IssueEvent, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/issues/events\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar events []*IssueEvent\n\tresp, err := s.client.Do(ctx, req, &events)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn events, resp, nil\n}\n\n// ListEventsForRepoNetwork lists public events for a network of repositories.\n//\n// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-events-for-a-network-of-repositories\n//\n//meta:operation GET /networks/{owner}/{repo}/events\nfunc (s *ActivityService) ListEventsForRepoNetwork(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Event, *Response, error) {\n\tu := fmt.Sprintf(\"networks/%v/%v/events\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar events []*Event\n\tresp, err := s.client.Do(ctx, req, &events)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn events, resp, nil\n}\n\n// ListEventsForOrganization lists public events for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-organization-events\n//\n//meta:operation GET /orgs/{org}/events\nfunc (s *ActivityService) ListEventsForOrganization(ctx context.Context, org string, opts *ListOptions) ([]*Event, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/events\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar events []*Event\n\tresp, err := s.client.Do(ctx, req, &events)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn events, resp, nil\n}\n\n// ListEventsPerformedByUser lists the events performed by a user. If publicOnly is\n// true, only public events will be returned.\n//\n// GitHub API docs: https://docs.github.com/rest/activity/events#list-events-for-the-authenticated-user\n//\n// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-events-for-a-user\n//\n//meta:operation GET /users/{username}/events\n//meta:operation GET /users/{username}/events/public\nfunc (s *ActivityService) ListEventsPerformedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) {\n\tvar u string\n\tif publicOnly {\n\t\tu = fmt.Sprintf(\"users/%v/events/public\", user)\n\t} else {\n\t\tu = fmt.Sprintf(\"users/%v/events\", user)\n\t}\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar events []*Event\n\tresp, err := s.client.Do(ctx, req, &events)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn events, resp, nil\n}\n\n// ListEventsReceivedByUser lists the events received by a user. If publicOnly is\n// true, only public events will be returned.\n//\n// GitHub API docs: https://docs.github.com/rest/activity/events#list-events-received-by-the-authenticated-user\n//\n// GitHub API docs: https://docs.github.com/rest/activity/events#list-public-events-received-by-a-user\n//\n//meta:operation GET /users/{username}/received_events\n//meta:operation GET /users/{username}/received_events/public\nfunc (s *ActivityService) ListEventsReceivedByUser(ctx context.Context, user string, publicOnly bool, opts *ListOptions) ([]*Event, *Response, error) {\n\tvar u string\n\tif publicOnly {\n\t\tu = fmt.Sprintf(\"users/%v/received_events/public\", user)\n\t} else {\n\t\tu = fmt.Sprintf(\"users/%v/received_events\", user)\n\t}\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar events []*Event\n\tresp, err := s.client.Do(ctx, req, &events)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn events, resp, nil\n}\n\n// ListUserEventsForOrganization provides the user’s organization dashboard. You\n// must be authenticated as the user to view this.\n//\n// GitHub API docs: https://docs.github.com/rest/activity/events#list-organization-events-for-the-authenticated-user\n//\n//meta:operation GET /users/{username}/events/orgs/{org}\nfunc (s *ActivityService) ListUserEventsForOrganization(ctx context.Context, org, user string, opts *ListOptions) ([]*Event, *Response, error) {\n\tu := fmt.Sprintf(\"users/%v/events/orgs/%v\", user, org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar events []*Event\n\tresp, err := s.client.Do(ctx, req, &events)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn events, resp, nil\n}\n"
  },
  {
    "path": "github/activity_events_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestActivityService_ListEvents(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/events\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"id\":\"1\"},{\"id\":\"2\"}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tevents, _, err := client.Activity.ListEvents(ctx, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Activities.ListEvents returned error: %v\", err)\n\t}\n\n\twant := []*Event{{ID: Ptr(\"1\")}, {ID: Ptr(\"2\")}}\n\tif !cmp.Equal(events, want) {\n\t\tt.Errorf(\"Activities.ListEvents returned %+v, want %+v\", events, want)\n\t}\n\n\tconst methodName = \"ListEvents\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Activity.ListEvents(ctx, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActivityService_ListRepositoryEvents(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/events\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"id\":\"1\"},{\"id\":\"2\"}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tevents, _, err := client.Activity.ListRepositoryEvents(ctx, \"o\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Activities.ListRepositoryEvents returned error: %v\", err)\n\t}\n\n\twant := []*Event{{ID: Ptr(\"1\")}, {ID: Ptr(\"2\")}}\n\tif !cmp.Equal(events, want) {\n\t\tt.Errorf(\"Activities.ListRepositoryEvents returned %+v, want %+v\", events, want)\n\t}\n\n\tconst methodName = \"ListRepositoryEvents\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Activity.ListRepositoryEvents(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Activity.ListRepositoryEvents(ctx, \"o\", \"r\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActivityService_ListRepositoryEvents_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Activity.ListRepositoryEvents(ctx, \"%\", \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestActivityService_ListIssueEventsForRepository(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/issues/events\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"id\":1},{\"id\":2}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tevents, _, err := client.Activity.ListIssueEventsForRepository(ctx, \"o\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Activities.ListIssueEventsForRepository returned error: %v\", err)\n\t}\n\n\twant := []*IssueEvent{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}}\n\tif !cmp.Equal(events, want) {\n\t\tt.Errorf(\"Activities.ListIssueEventsForRepository returned %+v, want %+v\", events, want)\n\t}\n\n\tconst methodName = \"ListIssueEventsForRepository\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Activity.ListIssueEventsForRepository(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Activity.ListIssueEventsForRepository(ctx, \"o\", \"r\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActivityService_ListIssueEventsForRepository_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Activity.ListIssueEventsForRepository(ctx, \"%\", \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestActivityService_ListEventsForRepoNetwork(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/networks/o/r/events\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"id\":\"1\"},{\"id\":\"2\"}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tevents, _, err := client.Activity.ListEventsForRepoNetwork(ctx, \"o\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Activities.ListEventsForRepoNetwork returned error: %v\", err)\n\t}\n\n\twant := []*Event{{ID: Ptr(\"1\")}, {ID: Ptr(\"2\")}}\n\tif !cmp.Equal(events, want) {\n\t\tt.Errorf(\"Activities.ListEventsForRepoNetwork returned %+v, want %+v\", events, want)\n\t}\n\n\tconst methodName = \"ListEventsForRepoNetwork\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Activity.ListEventsForRepoNetwork(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Activity.ListEventsForRepoNetwork(ctx, \"o\", \"r\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActivityService_ListEventsForRepoNetwork_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Activity.ListEventsForRepoNetwork(ctx, \"%\", \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestActivityService_ListEventsForOrganization(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/events\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"id\":\"1\"},{\"id\":\"2\"}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tevents, _, err := client.Activity.ListEventsForOrganization(ctx, \"o\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Activities.ListEventsForOrganization returned error: %v\", err)\n\t}\n\n\twant := []*Event{{ID: Ptr(\"1\")}, {ID: Ptr(\"2\")}}\n\tif !cmp.Equal(events, want) {\n\t\tt.Errorf(\"Activities.ListEventsForOrganization returned %+v, want %+v\", events, want)\n\t}\n\n\tconst methodName = \"ListEventsForOrganization\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Activity.ListEventsForOrganization(ctx, \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Activity.ListEventsForOrganization(ctx, \"o\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActivityService_ListEventsForOrganization_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Activity.ListEventsForOrganization(ctx, \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestActivityService_ListEventsPerformedByUser_all(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/events\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"id\":\"1\"},{\"id\":\"2\"}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tevents, _, err := client.Activity.ListEventsPerformedByUser(ctx, \"u\", false, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Events.ListPerformedByUser returned error: %v\", err)\n\t}\n\n\twant := []*Event{{ID: Ptr(\"1\")}, {ID: Ptr(\"2\")}}\n\tif !cmp.Equal(events, want) {\n\t\tt.Errorf(\"Events.ListPerformedByUser returned %+v, want %+v\", events, want)\n\t}\n\n\tconst methodName = \"ListEventsPerformedByUser\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Activity.ListEventsPerformedByUser(ctx, \"\\n\", false, opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Activity.ListEventsPerformedByUser(ctx, \"u\", false, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActivityService_ListEventsPerformedByUser_publicOnly(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/events/public\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"id\":\"1\"},{\"id\":\"2\"}]`)\n\t})\n\n\tctx := t.Context()\n\tevents, _, err := client.Activity.ListEventsPerformedByUser(ctx, \"u\", true, nil)\n\tif err != nil {\n\t\tt.Errorf(\"Events.ListPerformedByUser returned error: %v\", err)\n\t}\n\n\twant := []*Event{{ID: Ptr(\"1\")}, {ID: Ptr(\"2\")}}\n\tif !cmp.Equal(events, want) {\n\t\tt.Errorf(\"Events.ListPerformedByUser returned %+v, want %+v\", events, want)\n\t}\n}\n\nfunc TestActivityService_ListEventsPerformedByUser_invalidUser(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Activity.ListEventsPerformedByUser(ctx, \"%\", false, nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestActivityService_ListEventsReceivedByUser_all(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/received_events\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"id\":\"1\"},{\"id\":\"2\"}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tevents, _, err := client.Activity.ListEventsReceivedByUser(ctx, \"u\", false, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Events.ListReceivedByUser returned error: %v\", err)\n\t}\n\n\twant := []*Event{{ID: Ptr(\"1\")}, {ID: Ptr(\"2\")}}\n\tif !cmp.Equal(events, want) {\n\t\tt.Errorf(\"Events.ListReceivedUser returned %+v, want %+v\", events, want)\n\t}\n\n\tconst methodName = \"ListEventsReceivedByUser\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Activity.ListEventsReceivedByUser(ctx, \"\\n\", false, opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Activity.ListEventsReceivedByUser(ctx, \"u\", false, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActivityService_ListEventsReceivedByUser_publicOnly(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/received_events/public\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"id\":\"1\"},{\"id\":\"2\"}]`)\n\t})\n\n\tctx := t.Context()\n\tevents, _, err := client.Activity.ListEventsReceivedByUser(ctx, \"u\", true, nil)\n\tif err != nil {\n\t\tt.Errorf(\"Events.ListReceivedByUser returned error: %v\", err)\n\t}\n\n\twant := []*Event{{ID: Ptr(\"1\")}, {ID: Ptr(\"2\")}}\n\tif !cmp.Equal(events, want) {\n\t\tt.Errorf(\"Events.ListReceivedByUser returned %+v, want %+v\", events, want)\n\t}\n}\n\nfunc TestActivityService_ListEventsReceivedByUser_invalidUser(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Activity.ListEventsReceivedByUser(ctx, \"%\", false, nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestActivityService_ListUserEventsForOrganization(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/events/orgs/o\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"id\":\"1\"},{\"id\":\"2\"}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tevents, _, err := client.Activity.ListUserEventsForOrganization(ctx, \"o\", \"u\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Activities.ListUserEventsForOrganization returned error: %v\", err)\n\t}\n\n\twant := []*Event{{ID: Ptr(\"1\")}, {ID: Ptr(\"2\")}}\n\tif !cmp.Equal(events, want) {\n\t\tt.Errorf(\"Activities.ListUserEventsForOrganization returned %+v, want %+v\", events, want)\n\t}\n\n\tconst methodName = \"ListUserEventsForOrganization\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Activity.ListUserEventsForOrganization(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Activity.ListUserEventsForOrganization(ctx, \"o\", \"u\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActivityService_EventParsePayload_typed(t *testing.T) {\n\tt.Parallel()\n\traw := []byte(`{\"type\": \"PushEvent\",\"payload\":{\"push_id\": 1}}`)\n\tvar event *Event\n\tif err := json.Unmarshal(raw, &event); err != nil {\n\t\tt.Fatalf(\"Unmarshal Event returned error: %v\", err)\n\t}\n\n\twant := &PushEvent{PushID: Ptr(int64(1))}\n\tgot, err := event.ParsePayload()\n\tif err != nil {\n\t\tt.Fatalf(\"ParsePayload returned unexpected error: %v\", err)\n\t}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Event.ParsePayload returned %+v, want %+v\", got, want)\n\t}\n}\n\n// TestEvent_Payload_untyped checks that unrecognized events are parsed to an\n// any value (instead of being discarded or throwing an error), for\n// forward compatibility with new event types.\nfunc TestActivityService_EventParsePayload_untyped(t *testing.T) {\n\tt.Parallel()\n\traw := []byte(`{\"type\": \"UnrecognizedEvent\",\"payload\":{\"field\": \"val\"}}`)\n\tvar event *Event\n\tif err := json.Unmarshal(raw, &event); err != nil {\n\t\tt.Fatalf(\"Unmarshal Event returned error: %v\", err)\n\t}\n\n\twant := map[string]any{\"field\": \"val\"}\n\tgot, err := event.ParsePayload()\n\tif err != nil {\n\t\tt.Fatalf(\"ParsePayload returned unexpected error: %v\", err)\n\t}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Event.ParsePayload returned %+v, want %+v\", got, want)\n\t}\n}\n\nfunc TestActivityService_EventParsePayload_installation(t *testing.T) {\n\tt.Parallel()\n\traw := []byte(`{\"type\": \"PullRequestEvent\",\"payload\":{\"installation\":{\"id\":1}}}`)\n\tvar event *Event\n\tif err := json.Unmarshal(raw, &event); err != nil {\n\t\tt.Fatalf(\"Unmarshal Event returned error: %v\", err)\n\t}\n\n\twant := &PullRequestEvent{Installation: &Installation{ID: Ptr(int64(1))}}\n\tgot, err := event.ParsePayload()\n\tif err != nil {\n\t\tt.Fatalf(\"ParsePayload returned unexpected error: %v\", err)\n\t}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Event.ParsePayload returned %+v, want %+v\", got, want)\n\t}\n}\n"
  },
  {
    "path": "github/activity_notifications.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n)\n\n// Notification identifies a GitHub notification for a user.\ntype Notification struct {\n\tID         *string              `json:\"id,omitempty\"`\n\tRepository *Repository          `json:\"repository,omitempty\"`\n\tSubject    *NotificationSubject `json:\"subject,omitempty\"`\n\n\t// Reason identifies the event that triggered the notification.\n\t//\n\t// GitHub API docs: https://docs.github.com/rest/activity#notification-reasons\n\tReason *string `json:\"reason,omitempty\"`\n\n\tUnread     *bool      `json:\"unread,omitempty\"`\n\tUpdatedAt  *Timestamp `json:\"updated_at,omitempty\"`\n\tLastReadAt *Timestamp `json:\"last_read_at,omitempty\"`\n\tURL        *string    `json:\"url,omitempty\"`\n}\n\n// NotificationSubject identifies the subject of a notification.\ntype NotificationSubject struct {\n\tTitle            *string `json:\"title,omitempty\"`\n\tURL              *string `json:\"url,omitempty\"`\n\tLatestCommentURL *string `json:\"latest_comment_url,omitempty\"`\n\tType             *string `json:\"type,omitempty\"`\n}\n\n// NotificationListOptions specifies the optional parameters to the\n// ActivityService.ListNotifications method.\ntype NotificationListOptions struct {\n\tAll           bool      `url:\"all,omitempty\"`\n\tParticipating bool      `url:\"participating,omitempty\"`\n\tSince         time.Time `url:\"since,omitempty\"`\n\tBefore        time.Time `url:\"before,omitempty\"`\n\n\tListOptions\n}\n\n// ListNotifications lists all notifications for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/activity/notifications#list-notifications-for-the-authenticated-user\n//\n//meta:operation GET /notifications\nfunc (s *ActivityService) ListNotifications(ctx context.Context, opts *NotificationListOptions) ([]*Notification, *Response, error) {\n\tu := \"notifications\"\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar notifications []*Notification\n\tresp, err := s.client.Do(ctx, req, &notifications)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn notifications, resp, nil\n}\n\n// ListRepositoryNotifications lists all notifications in a given repository\n// for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user\n//\n//meta:operation GET /repos/{owner}/{repo}/notifications\nfunc (s *ActivityService) ListRepositoryNotifications(ctx context.Context, owner, repo string, opts *NotificationListOptions) ([]*Notification, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/notifications\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar notifications []*Notification\n\tresp, err := s.client.Do(ctx, req, &notifications)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn notifications, resp, nil\n}\n\ntype markReadOptions struct {\n\tLastReadAt Timestamp `json:\"last_read_at,omitzero\"`\n}\n\n// MarkNotificationsRead marks all notifications up to lastRead as read.\n// If lastRead is the zero value, all notifications in the repository are marked as read.\n//\n// GitHub API docs: https://docs.github.com/rest/activity/notifications#mark-notifications-as-read\n//\n//meta:operation PUT /notifications\nfunc (s *ActivityService) MarkNotificationsRead(ctx context.Context, lastRead Timestamp) (*Response, error) {\n\topts := &markReadOptions{\n\t\tLastReadAt: lastRead,\n\t}\n\treq, err := s.client.NewRequest(\"PUT\", \"notifications\", opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// MarkRepositoryNotificationsRead marks all notifications up to lastRead in\n// the specified repository as read.\n// If lastRead is the zero value, all notifications in the repository are marked as read.\n//\n// GitHub API docs: https://docs.github.com/rest/activity/notifications#mark-repository-notifications-as-read\n//\n//meta:operation PUT /repos/{owner}/{repo}/notifications\nfunc (s *ActivityService) MarkRepositoryNotificationsRead(ctx context.Context, owner, repo string, lastRead Timestamp) (*Response, error) {\n\topts := &markReadOptions{\n\t\tLastReadAt: lastRead,\n\t}\n\tu := fmt.Sprintf(\"repos/%v/%v/notifications\", owner, repo)\n\treq, err := s.client.NewRequest(\"PUT\", u, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// GetThread gets the specified notification thread.\n//\n// GitHub API docs: https://docs.github.com/rest/activity/notifications#get-a-thread\n//\n//meta:operation GET /notifications/threads/{thread_id}\nfunc (s *ActivityService) GetThread(ctx context.Context, id string) (*Notification, *Response, error) {\n\tu := fmt.Sprintf(\"notifications/threads/%v\", id)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar notification *Notification\n\tresp, err := s.client.Do(ctx, req, &notification)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn notification, resp, nil\n}\n\n// MarkThreadRead marks the specified thread as read.\n//\n// GitHub API docs: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-read\n//\n//meta:operation PATCH /notifications/threads/{thread_id}\nfunc (s *ActivityService) MarkThreadRead(ctx context.Context, id string) (*Response, error) {\n\tu := fmt.Sprintf(\"notifications/threads/%v\", id)\n\n\treq, err := s.client.NewRequest(\"PATCH\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// MarkThreadDone marks the specified thread as done.\n// Marking a thread as \"done\" is equivalent to marking a notification in your notification inbox on GitHub as done.\n//\n// GitHub API docs: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-done\n//\n//meta:operation DELETE /notifications/threads/{thread_id}\nfunc (s *ActivityService) MarkThreadDone(ctx context.Context, id string) (*Response, error) {\n\tu := fmt.Sprintf(\"notifications/threads/%v\", id)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// GetThreadSubscription checks to see if the authenticated user is subscribed\n// to a thread.\n//\n// GitHub API docs: https://docs.github.com/rest/activity/notifications#get-a-thread-subscription-for-the-authenticated-user\n//\n//meta:operation GET /notifications/threads/{thread_id}/subscription\nfunc (s *ActivityService) GetThreadSubscription(ctx context.Context, id string) (*Subscription, *Response, error) {\n\tu := fmt.Sprintf(\"notifications/threads/%v/subscription\", id)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar sub *Subscription\n\tresp, err := s.client.Do(ctx, req, &sub)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn sub, resp, nil\n}\n\n// SetThreadSubscription sets the subscription for the specified thread for the\n// authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/activity/notifications#set-a-thread-subscription\n//\n//meta:operation PUT /notifications/threads/{thread_id}/subscription\nfunc (s *ActivityService) SetThreadSubscription(ctx context.Context, id string, subscription *Subscription) (*Subscription, *Response, error) {\n\tu := fmt.Sprintf(\"notifications/threads/%v/subscription\", id)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, subscription)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar sub *Subscription\n\tresp, err := s.client.Do(ctx, req, &sub)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn sub, resp, nil\n}\n\n// DeleteThreadSubscription deletes the subscription for the specified thread\n// for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/activity/notifications#delete-a-thread-subscription\n//\n//meta:operation DELETE /notifications/threads/{thread_id}/subscription\nfunc (s *ActivityService) DeleteThreadSubscription(ctx context.Context, id string) (*Response, error) {\n\tu := fmt.Sprintf(\"notifications/threads/%v/subscription\", id)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/activity_notifications_test.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestActivityService_ListNotification(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/notifications\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"all\":           \"true\",\n\t\t\t\"participating\": \"true\",\n\t\t\t\"since\":         \"2006-01-02T15:04:05Z\",\n\t\t\t\"before\":        \"2007-03-04T15:04:05Z\",\n\t\t})\n\n\t\tfmt.Fprint(w, `[{\"id\":\"1\", \"subject\":{\"title\":\"t\"}}]`)\n\t})\n\n\topt := &NotificationListOptions{\n\t\tAll:           true,\n\t\tParticipating: true,\n\t\tSince:         time.Date(2006, time.January, 2, 15, 4, 5, 0, time.UTC),\n\t\tBefore:        time.Date(2007, time.March, 4, 15, 4, 5, 0, time.UTC),\n\t}\n\tctx := t.Context()\n\tnotifications, _, err := client.Activity.ListNotifications(ctx, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Activity.ListNotifications returned error: %v\", err)\n\t}\n\n\twant := []*Notification{{ID: Ptr(\"1\"), Subject: &NotificationSubject{Title: Ptr(\"t\")}}}\n\tif !cmp.Equal(notifications, want) {\n\t\tt.Errorf(\"Activity.ListNotifications returned %+v, want %+v\", notifications, want)\n\t}\n\n\tconst methodName = \"ListNotifications\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Activity.ListNotifications(ctx, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActivityService_ListRepositoryNotifications(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/notifications\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"id\":\"1\"}]`)\n\t})\n\n\tctx := t.Context()\n\tnotifications, _, err := client.Activity.ListRepositoryNotifications(ctx, \"o\", \"r\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"Activity.ListRepositoryNotifications returned error: %v\", err)\n\t}\n\n\twant := []*Notification{{ID: Ptr(\"1\")}}\n\tif !cmp.Equal(notifications, want) {\n\t\tt.Errorf(\"Activity.ListRepositoryNotifications returned %+v, want %+v\", notifications, want)\n\t}\n\n\tconst methodName = \"ListRepositoryNotifications\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Activity.ListRepositoryNotifications(ctx, \"\\n\", \"\\n\", &NotificationListOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Activity.ListRepositoryNotifications(ctx, \"o\", \"r\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActivityService_MarkNotificationsRead(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/notifications\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\ttestBody(t, r, `{\"last_read_at\":\"2006-01-02T15:04:05Z\"}`+\"\\n\")\n\n\t\tw.WriteHeader(http.StatusResetContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Activity.MarkNotificationsRead(ctx, Timestamp{time.Date(2006, time.January, 2, 15, 4, 5, 0, time.UTC)})\n\tif err != nil {\n\t\tt.Errorf(\"Activity.MarkNotificationsRead returned error: %v\", err)\n\t}\n\n\tconst methodName = \"MarkNotificationsRead\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Activity.MarkNotificationsRead(ctx, Timestamp{time.Date(2006, time.January, 2, 15, 4, 5, 0, time.UTC)})\n\t})\n}\n\nfunc TestActivityService_MarkNotificationsRead_EmptyLastReadAt(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/notifications\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\ttestBody(t, r, `{}`+\"\\n\")\n\n\t\tw.WriteHeader(http.StatusResetContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Activity.MarkNotificationsRead(ctx, Timestamp{})\n\tif err != nil {\n\t\tt.Errorf(\"Activity.MarkNotificationsRead returned error: %v\", err)\n\t}\n}\n\nfunc TestActivityService_MarkRepositoryNotificationsRead(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/notifications\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\ttestBody(t, r, `{\"last_read_at\":\"2006-01-02T15:04:05Z\"}`+\"\\n\")\n\n\t\tw.WriteHeader(http.StatusResetContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Activity.MarkRepositoryNotificationsRead(ctx, \"o\", \"r\", Timestamp{time.Date(2006, time.January, 2, 15, 4, 5, 0, time.UTC)})\n\tif err != nil {\n\t\tt.Errorf(\"Activity.MarkRepositoryNotificationsRead returned error: %v\", err)\n\t}\n\n\tconst methodName = \"MarkRepositoryNotificationsRead\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Activity.MarkRepositoryNotificationsRead(ctx, \"\\n\", \"\\n\", Timestamp{time.Date(2006, time.January, 2, 15, 4, 5, 0, time.UTC)})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Activity.MarkRepositoryNotificationsRead(ctx, \"o\", \"r\", Timestamp{time.Date(2006, time.January, 2, 15, 4, 5, 0, time.UTC)})\n\t})\n}\n\nfunc TestActivityService_MarkRepositoryNotificationsRead_EmptyLastReadAt(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/notifications\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\ttestBody(t, r, `{}`+\"\\n\")\n\n\t\tw.WriteHeader(http.StatusResetContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Activity.MarkRepositoryNotificationsRead(ctx, \"o\", \"r\", Timestamp{})\n\tif err != nil {\n\t\tt.Errorf(\"Activity.MarkRepositoryNotificationsRead returned error: %v\", err)\n\t}\n}\n\nfunc TestActivityService_GetThread(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/notifications/threads/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":\"1\"}`)\n\t})\n\n\tctx := t.Context()\n\tnotification, _, err := client.Activity.GetThread(ctx, \"1\")\n\tif err != nil {\n\t\tt.Errorf(\"Activity.GetThread returned error: %v\", err)\n\t}\n\n\twant := &Notification{ID: Ptr(\"1\")}\n\tif !cmp.Equal(notification, want) {\n\t\tt.Errorf(\"Activity.GetThread returned %+v, want %+v\", notification, want)\n\t}\n\n\tconst methodName = \"GetThread\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Activity.GetThread(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Activity.GetThread(ctx, \"1\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActivityService_MarkThreadRead(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/notifications/threads/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tw.WriteHeader(http.StatusResetContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Activity.MarkThreadRead(ctx, \"1\")\n\tif err != nil {\n\t\tt.Errorf(\"Activity.MarkThreadRead returned error: %v\", err)\n\t}\n\n\tconst methodName = \"MarkThreadRead\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Activity.MarkThreadRead(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Activity.MarkThreadRead(ctx, \"1\")\n\t})\n}\n\nfunc TestActivityService_MarkThreadDone(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/notifications/threads/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusResetContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Activity.MarkThreadDone(ctx, \"1\")\n\tif err != nil {\n\t\tt.Errorf(\"Activity.MarkThreadDone returned error: %v\", err)\n\t}\n\n\tconst methodName = \"MarkThreadDone\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Activity.MarkThreadDone(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Activity.MarkThreadDone(ctx, \"1\")\n\t})\n}\n\nfunc TestActivityService_GetThreadSubscription(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/notifications/threads/1/subscription\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"subscribed\":true}`)\n\t})\n\n\tctx := t.Context()\n\tsub, _, err := client.Activity.GetThreadSubscription(ctx, \"1\")\n\tif err != nil {\n\t\tt.Errorf(\"Activity.GetThreadSubscription returned error: %v\", err)\n\t}\n\n\twant := &Subscription{Subscribed: Ptr(true)}\n\tif !cmp.Equal(sub, want) {\n\t\tt.Errorf(\"Activity.GetThreadSubscription returned %+v, want %+v\", sub, want)\n\t}\n\n\tconst methodName = \"GetThreadSubscription\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Activity.GetThreadSubscription(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Activity.GetThreadSubscription(ctx, \"1\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActivityService_SetThreadSubscription(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &Subscription{Subscribed: Ptr(true)}\n\n\tmux.HandleFunc(\"/notifications/threads/1/subscription\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *Subscription\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"ignored\":true}`)\n\t})\n\n\tctx := t.Context()\n\tsub, _, err := client.Activity.SetThreadSubscription(ctx, \"1\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Activity.SetThreadSubscription returned error: %v\", err)\n\t}\n\n\twant := &Subscription{Ignored: Ptr(true)}\n\tif !cmp.Equal(sub, want) {\n\t\tt.Errorf(\"Activity.SetThreadSubscription returned %+v, want %+v\", sub, want)\n\t}\n\n\tconst methodName = \"SetThreadSubscription\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Activity.SetThreadSubscription(ctx, \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Activity.SetThreadSubscription(ctx, \"1\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActivityService_DeleteThreadSubscription(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/notifications/threads/1/subscription\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Activity.DeleteThreadSubscription(ctx, \"1\")\n\tif err != nil {\n\t\tt.Errorf(\"Activity.DeleteThreadSubscription returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteThreadSubscription\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Activity.DeleteThreadSubscription(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Activity.DeleteThreadSubscription(ctx, \"1\")\n\t})\n}\n\nfunc TestNotification_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Notification{}, \"{}\")\n\n\tu := &Notification{\n\t\tID: Ptr(\"id\"),\n\t\tRepository: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"u\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tSubject: &NotificationSubject{\n\t\t\tTitle:            Ptr(\"t\"),\n\t\t\tURL:              Ptr(\"u\"),\n\t\t\tLatestCommentURL: Ptr(\"l\"),\n\t\t\tType:             Ptr(\"t\"),\n\t\t},\n\t\tReason:     Ptr(\"r\"),\n\t\tUnread:     Ptr(true),\n\t\tUpdatedAt:  &Timestamp{referenceTime},\n\t\tLastReadAt: &Timestamp{referenceTime},\n\t\tURL:        Ptr(\"u\"),\n\t}\n\n\twant := `{\n\t\t\"id\": \"id\",\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"url\": \"u\",\n\t\t\t\"name\": \"n\"\n\t\t},\n\t\t\"subject\": {\n\t\t\t\"title\": \"t\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"latest_comment_url\": \"l\",\n\t\t\t\"type\": \"t\"\n\t\t},\n\t\t\"reason\": \"r\",\n\t\t\"unread\": true,\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"last_read_at\": ` + referenceTimeStr + `,\n\t\t\"url\": \"u\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestNotificationSubject_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &NotificationSubject{}, \"{}\")\n\n\tu := &NotificationSubject{\n\t\tTitle:            Ptr(\"t\"),\n\t\tURL:              Ptr(\"u\"),\n\t\tLatestCommentURL: Ptr(\"l\"),\n\t\tType:             Ptr(\"t\"),\n\t}\n\n\twant := `{\n\t\t\"title\": \"t\",\n\t\t\"url\": \"u\",\n\t\t\"latest_comment_url\": \"l\",\n\t\t\"type\": \"t\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestMarkReadOptions_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &markReadOptions{}, `{}`)\n\n\tu := &markReadOptions{\n\t\tLastReadAt: Timestamp{referenceTime},\n\t}\n\n\twant := `{\n\t\t\"last_read_at\": ` + referenceTimeStr + `\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/activity_star.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strings\"\n)\n\n// StarredRepository is returned by ListStarred.\ntype StarredRepository struct {\n\tStarredAt  *Timestamp  `json:\"starred_at,omitempty\"`\n\tRepository *Repository `json:\"repo,omitempty\"`\n}\n\n// Stargazer represents a user that has starred a repository.\ntype Stargazer struct {\n\tStarredAt *Timestamp `json:\"starred_at,omitempty\"`\n\tUser      *User      `json:\"user,omitempty\"`\n}\n\n// ListStargazers lists people who have starred the specified repo.\n//\n// GitHub API docs: https://docs.github.com/rest/activity/starring#list-stargazers\n//\n//meta:operation GET /repos/{owner}/{repo}/stargazers\nfunc (s *ActivityService) ListStargazers(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Stargazer, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/stargazers\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeStarring)\n\n\tvar stargazers []*Stargazer\n\tresp, err := s.client.Do(ctx, req, &stargazers)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn stargazers, resp, nil\n}\n\n// ActivityListStarredOptions specifies the optional parameters to the\n// ActivityService.ListStarred method.\ntype ActivityListStarredOptions struct {\n\t// How to sort the repository list. Possible values are: created, updated,\n\t// pushed, full_name. Default is \"full_name\".\n\tSort string `url:\"sort,omitempty\"`\n\n\t// Direction in which to sort repositories. Possible values are: asc, desc.\n\t// Default is \"asc\" when sort is \"full_name\"; otherwise, default is \"desc\".\n\tDirection string `url:\"direction,omitempty\"`\n\n\tListOptions\n}\n\n// ListStarred lists all the repos starred by a user. Passing the empty string\n// will list the starred repositories for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-a-user\n//\n// GitHub API docs: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-the-authenticated-user\n//\n//meta:operation GET /user/starred\n//meta:operation GET /users/{username}/starred\nfunc (s *ActivityService) ListStarred(ctx context.Context, user string, opts *ActivityListStarredOptions) ([]*StarredRepository, *Response, error) {\n\tvar u string\n\tif user != \"\" {\n\t\tu = fmt.Sprintf(\"users/%v/starred\", user)\n\t} else {\n\t\tu = \"user/starred\"\n\t}\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tacceptHeaders := []string{mediaTypeStarring, mediaTypeTopicsPreview}\n\treq.Header.Set(\"Accept\", strings.Join(acceptHeaders, \", \"))\n\n\tvar repos []*StarredRepository\n\tresp, err := s.client.Do(ctx, req, &repos)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn repos, resp, nil\n}\n\n// IsStarred checks if a repository is starred by authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/activity/starring#check-if-a-repository-is-starred-by-the-authenticated-user\n//\n//meta:operation GET /user/starred/{owner}/{repo}\nfunc (s *ActivityService) IsStarred(ctx context.Context, owner, repo string) (bool, *Response, error) {\n\tu := fmt.Sprintf(\"user/starred/%v/%v\", owner, repo)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn false, nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tstarred, err := parseBoolResponse(err)\n\treturn starred, resp, err\n}\n\n// Star a repository as the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/activity/starring#star-a-repository-for-the-authenticated-user\n//\n//meta:operation PUT /user/starred/{owner}/{repo}\nfunc (s *ActivityService) Star(ctx context.Context, owner, repo string) (*Response, error) {\n\tu := fmt.Sprintf(\"user/starred/%v/%v\", owner, repo)\n\treq, err := s.client.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// Unstar a repository as the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/activity/starring#unstar-a-repository-for-the-authenticated-user\n//\n//meta:operation DELETE /user/starred/{owner}/{repo}\nfunc (s *ActivityService) Unstar(ctx context.Context, owner, repo string) (*Response, error) {\n\tu := fmt.Sprintf(\"user/starred/%v/%v\", owner, repo)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/activity_star_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestActivityService_ListStargazers(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/stargazers\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeStarring)\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\": \"2\",\n\t\t})\n\n\t\tfmt.Fprint(w, `[{\"starred_at\":\"2002-02-10T15:30:00Z\",\"user\":{\"id\":1}}]`)\n\t})\n\n\tctx := t.Context()\n\tstargazers, _, err := client.Activity.ListStargazers(ctx, \"o\", \"r\", &ListOptions{Page: 2})\n\tif err != nil {\n\t\tt.Errorf(\"Activity.ListStargazers returned error: %v\", err)\n\t}\n\n\twant := []*Stargazer{{StarredAt: &Timestamp{time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC)}, User: &User{ID: Ptr(int64(1))}}}\n\tif !cmp.Equal(stargazers, want) {\n\t\tt.Errorf(\"Activity.ListStargazers returned %+v, want %+v\", stargazers, want)\n\t}\n\n\tconst methodName = \"ListStargazers\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Activity.ListStargazers(ctx, \"\\n\", \"\\n\", &ListOptions{Page: 2})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Activity.ListStargazers(ctx, \"o\", \"r\", &ListOptions{Page: 2})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActivityService_ListStarred_authenticatedUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/starred\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", strings.Join([]string{mediaTypeStarring, mediaTypeTopicsPreview}, \", \"))\n\t\tfmt.Fprint(w, `[{\"starred_at\":\"2002-02-10T15:30:00Z\",\"repo\":{\"id\":1}}]`)\n\t})\n\n\tctx := t.Context()\n\trepos, _, err := client.Activity.ListStarred(ctx, \"\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"Activity.ListStarred returned error: %v\", err)\n\t}\n\n\twant := []*StarredRepository{{StarredAt: &Timestamp{time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC)}, Repository: &Repository{ID: Ptr(int64(1))}}}\n\tif !cmp.Equal(repos, want) {\n\t\tt.Errorf(\"Activity.ListStarred returned %+v, want %+v\", repos, want)\n\t}\n\n\tconst methodName = \"ListStarred\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Activity.ListStarred(ctx, \"\\n\", nil)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Activity.ListStarred(ctx, \"\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActivityService_ListStarred_specifiedUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/starred\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", strings.Join([]string{mediaTypeStarring, mediaTypeTopicsPreview}, \", \"))\n\t\ttestFormValues(t, r, values{\n\t\t\t\"sort\":      \"created\",\n\t\t\t\"direction\": \"asc\",\n\t\t\t\"page\":      \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"starred_at\":\"2002-02-10T15:30:00Z\",\"repo\":{\"id\":2}}]`)\n\t})\n\n\topt := &ActivityListStarredOptions{\"created\", \"asc\", ListOptions{Page: 2}}\n\tctx := t.Context()\n\trepos, _, err := client.Activity.ListStarred(ctx, \"u\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Activity.ListStarred returned error: %v\", err)\n\t}\n\n\twant := []*StarredRepository{{StarredAt: &Timestamp{time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC)}, Repository: &Repository{ID: Ptr(int64(2))}}}\n\tif !cmp.Equal(repos, want) {\n\t\tt.Errorf(\"Activity.ListStarred returned %+v, want %+v\", repos, want)\n\t}\n\n\tconst methodName = \"ListStarred\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Activity.ListStarred(ctx, \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Activity.ListStarred(ctx, \"u\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActivityService_ListStarred_invalidUser(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Activity.ListStarred(ctx, \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestActivityService_IsStarred_hasStar(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/starred/o/r\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tstar, _, err := client.Activity.IsStarred(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Activity.IsStarred returned error: %v\", err)\n\t}\n\tif want := true; star != want {\n\t\tt.Errorf(\"Activity.IsStarred returned %+v, want %+v\", star, want)\n\t}\n\n\tconst methodName = \"IsStarred\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Activity.IsStarred(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Activity.IsStarred(ctx, \"o\", \"r\")\n\t\tif got {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want false\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActivityService_IsStarred_noStar(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/starred/o/r\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tstar, _, err := client.Activity.IsStarred(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Activity.IsStarred returned error: %v\", err)\n\t}\n\tif want := false; star != want {\n\t\tt.Errorf(\"Activity.IsStarred returned %+v, want %+v\", star, want)\n\t}\n\n\tconst methodName = \"IsStarred\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Activity.IsStarred(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Activity.IsStarred(ctx, \"o\", \"r\")\n\t\tif got {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want false\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActivityService_IsStarred_invalidID(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Activity.IsStarred(ctx, \"%\", \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestActivityService_Star(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/starred/o/r\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Activity.Star(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Activity.Star returned error: %v\", err)\n\t}\n\n\tconst methodName = \"Star\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Activity.Star(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Activity.Star(ctx, \"o\", \"r\")\n\t})\n}\n\nfunc TestActivityService_Star_invalidID(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Activity.Star(ctx, \"%\", \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestActivityService_Unstar(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/starred/o/r\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Activity.Unstar(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Activity.Unstar returned error: %v\", err)\n\t}\n\n\tconst methodName = \"Unstar\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Activity.Unstar(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Activity.Unstar(ctx, \"o\", \"r\")\n\t})\n}\n\nfunc TestActivityService_Unstar_invalidID(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Activity.Unstar(ctx, \"%\", \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestStarredRepository_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &StarredRepository{}, \"{}\")\n\n\tu := &StarredRepository{\n\t\tStarredAt: &Timestamp{referenceTime},\n\t\tRepository: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"u\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"starred_at\": ` + referenceTimeStr + `,\n\t\t\"repo\": {\n\t\t\t\"id\": 1,\n\t\t\t\"url\": \"u\",\n\t\t\t\"name\": \"n\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestStargazer_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Stargazer{}, \"{}\")\n\n\tu := &Stargazer{\n\t\tStarredAt: &Timestamp{referenceTime},\n\t\tUser: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"starred_at\": ` + referenceTimeStr + `,\n\t\t\"user\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/activity_test.go",
    "content": "// Copyright 2016 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestActivityService_List(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/feeds\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\n\t\tw.WriteHeader(http.StatusOK)\n\t\tassertWrite(t, w, feedsJSON)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Activity.ListFeeds(ctx)\n\tif err != nil {\n\t\tt.Errorf(\"Activity.ListFeeds returned error: %v\", err)\n\t}\n\tif want := wantFeeds; !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Activity.ListFeeds = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ListFeeds\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Activity.ListFeeds(ctx)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nvar feedsJSON = []byte(`{\n  \"timeline_url\": \"https://github.com/timeline\",\n  \"user_url\": \"https://github.com/{user}\",\n  \"current_user_public_url\": \"https://github.com/defunkt\",\n  \"current_user_url\": \"https://github.com/defunkt.private?token=abc123\",\n  \"current_user_actor_url\": \"https://github.com/defunkt.private.actor?token=abc123\",\n  \"current_user_organization_url\": \"\",\n  \"current_user_organization_urls\": [\n    \"https://github.com/organizations/github/defunkt.private.atom?token=abc123\"\n  ],\n  \"_links\": {\n    \"timeline\": {\n      \"href\": \"https://github.com/timeline\",\n      \"type\": \"application/atom+xml\"\n    },\n    \"user\": {\n      \"href\": \"https://github.com/{user}\",\n      \"type\": \"application/atom+xml\"\n    },\n    \"current_user_public\": {\n      \"href\": \"https://github.com/defunkt\",\n      \"type\": \"application/atom+xml\"\n    },\n    \"current_user\": {\n      \"href\": \"https://github.com/defunkt.private?token=abc123\",\n      \"type\": \"application/atom+xml\"\n    },\n    \"current_user_actor\": {\n      \"href\": \"https://github.com/defunkt.private.actor?token=abc123\",\n      \"type\": \"application/atom+xml\"\n    },\n    \"current_user_organization\": {\n      \"href\": \"\",\n      \"type\": \"\"\n    },\n    \"current_user_organizations\": [\n      {\n        \"href\": \"https://github.com/organizations/github/defunkt.private.atom?token=abc123\",\n        \"type\": \"application/atom+xml\"\n      }\n    ]\n  }\n}`)\n\nvar wantFeeds = &Feeds{\n\tTimelineURL:                Ptr(\"https://github.com/timeline\"),\n\tUserURL:                    Ptr(\"https://github.com/{user}\"),\n\tCurrentUserPublicURL:       Ptr(\"https://github.com/defunkt\"),\n\tCurrentUserURL:             Ptr(\"https://github.com/defunkt.private?token=abc123\"),\n\tCurrentUserActorURL:        Ptr(\"https://github.com/defunkt.private.actor?token=abc123\"),\n\tCurrentUserOrganizationURL: Ptr(\"\"),\n\tCurrentUserOrganizationURLs: []string{\n\t\t\"https://github.com/organizations/github/defunkt.private.atom?token=abc123\",\n\t},\n\tLinks: &FeedLinks{\n\t\tTimeline: &FeedLink{\n\t\t\tHRef: Ptr(\"https://github.com/timeline\"),\n\t\t\tType: Ptr(\"application/atom+xml\"),\n\t\t},\n\t\tUser: &FeedLink{\n\t\t\tHRef: Ptr(\"https://github.com/{user}\"),\n\t\t\tType: Ptr(\"application/atom+xml\"),\n\t\t},\n\t\tCurrentUserPublic: &FeedLink{\n\t\t\tHRef: Ptr(\"https://github.com/defunkt\"),\n\t\t\tType: Ptr(\"application/atom+xml\"),\n\t\t},\n\t\tCurrentUser: &FeedLink{\n\t\t\tHRef: Ptr(\"https://github.com/defunkt.private?token=abc123\"),\n\t\t\tType: Ptr(\"application/atom+xml\"),\n\t\t},\n\t\tCurrentUserActor: &FeedLink{\n\t\t\tHRef: Ptr(\"https://github.com/defunkt.private.actor?token=abc123\"),\n\t\t\tType: Ptr(\"application/atom+xml\"),\n\t\t},\n\t\tCurrentUserOrganization: &FeedLink{\n\t\t\tHRef: Ptr(\"\"),\n\t\t\tType: Ptr(\"\"),\n\t\t},\n\t\tCurrentUserOrganizations: []*FeedLink{\n\t\t\t{\n\t\t\t\tHRef: Ptr(\"https://github.com/organizations/github/defunkt.private.atom?token=abc123\"),\n\t\t\t\tType: Ptr(\"application/atom+xml\"),\n\t\t\t},\n\t\t},\n\t},\n}\n\nfunc TestFeedLink_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &FeedLink{}, \"{}\")\n\n\tu := &FeedLink{\n\t\tHRef: Ptr(\"h\"),\n\t\tType: Ptr(\"t\"),\n\t}\n\n\twant := `{\n\t\t\"href\": \"h\",\n\t\t\"type\": \"t\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestFeeds_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Feeds{}, \"{}\")\n\n\tu := &Feeds{\n\t\tTimelineURL:                 Ptr(\"t\"),\n\t\tUserURL:                     Ptr(\"u\"),\n\t\tCurrentUserPublicURL:        Ptr(\"cupu\"),\n\t\tCurrentUserURL:              Ptr(\"cuu\"),\n\t\tCurrentUserActorURL:         Ptr(\"cuau\"),\n\t\tCurrentUserOrganizationURL:  Ptr(\"cuou\"),\n\t\tCurrentUserOrganizationURLs: []string{\"a\"},\n\t\tLinks: &FeedLinks{\n\t\t\tTimeline: &FeedLink{\n\t\t\t\tHRef: Ptr(\"h\"),\n\t\t\t\tType: Ptr(\"t\"),\n\t\t\t},\n\t\t\tUser: &FeedLink{\n\t\t\t\tHRef: Ptr(\"h\"),\n\t\t\t\tType: Ptr(\"t\"),\n\t\t\t},\n\t\t\tCurrentUserPublic: &FeedLink{\n\t\t\t\tHRef: Ptr(\"h\"),\n\t\t\t\tType: Ptr(\"t\"),\n\t\t\t},\n\t\t\tCurrentUser: &FeedLink{\n\t\t\t\tHRef: Ptr(\"h\"),\n\t\t\t\tType: Ptr(\"t\"),\n\t\t\t},\n\t\t\tCurrentUserActor: &FeedLink{\n\t\t\t\tHRef: Ptr(\"h\"),\n\t\t\t\tType: Ptr(\"t\"),\n\t\t\t},\n\t\t\tCurrentUserOrganization: &FeedLink{\n\t\t\t\tHRef: Ptr(\"h\"),\n\t\t\t\tType: Ptr(\"t\"),\n\t\t\t},\n\t\t\tCurrentUserOrganizations: []*FeedLink{\n\t\t\t\t{\n\t\t\t\t\tHRef: Ptr(\"h\"),\n\t\t\t\t\tType: Ptr(\"t\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"timeline_url\": \"t\",\n\t\t\"user_url\": \"u\",\n\t\t\"current_user_public_url\": \"cupu\",\n\t\t\"current_user_url\": \"cuu\",\n\t\t\"current_user_actor_url\": \"cuau\",\n\t\t\"current_user_organization_url\": \"cuou\",\n\t\t\"current_user_organization_urls\": [\"a\"],\n\t\t\"_links\": {\n\t\t\t\"timeline\": {\n\t\t\t\t\"href\": \"h\",\n\t\t\t\t\"type\": \"t\"\n\t\t\t\t},\n\t\t\t\"user\": {\n\t\t\t\t\"href\": \"h\",\n\t\t\t\t\"type\": \"t\"\n\t\t\t},\n\t\t\t\"current_user_public\": {\n\t\t\t\t\"href\": \"h\",\n\t\t\t\t\"type\": \"t\"\n\t\t\t},\n\t\t\t\"current_user\": {\n\t\t\t\t\"href\": \"h\",\n\t\t\t\t\"type\": \"t\"\n\t\t\t},\n\t\t\t\"current_user_actor\": {\n\t\t\t\t\"href\": \"h\",\n\t\t\t\t\"type\": \"t\"\n\t\t\t},\n\t\t\t\"current_user_organization\": {\n\t\t\t\t\"href\": \"h\",\n\t\t\t\t\"type\": \"t\"\n\t\t\t},\n\t\t\t\"current_user_organizations\": [\n\t\t\t\t{\n\t\t\t\t\t\"href\": \"h\",\n\t\t\t\t\t\"type\": \"t\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestFeedLinks_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &FeedLinks{}, \"{}\")\n\n\tu := &FeedLinks{\n\t\tTimeline: &FeedLink{\n\t\t\tHRef: Ptr(\"h\"),\n\t\t\tType: Ptr(\"t\"),\n\t\t},\n\t\tUser: &FeedLink{\n\t\t\tHRef: Ptr(\"h\"),\n\t\t\tType: Ptr(\"t\"),\n\t\t},\n\t\tCurrentUserPublic: &FeedLink{\n\t\t\tHRef: Ptr(\"h\"),\n\t\t\tType: Ptr(\"t\"),\n\t\t},\n\t\tCurrentUser: &FeedLink{\n\t\t\tHRef: Ptr(\"h\"),\n\t\t\tType: Ptr(\"t\"),\n\t\t},\n\t\tCurrentUserActor: &FeedLink{\n\t\t\tHRef: Ptr(\"h\"),\n\t\t\tType: Ptr(\"t\"),\n\t\t},\n\t\tCurrentUserOrganization: &FeedLink{\n\t\t\tHRef: Ptr(\"h\"),\n\t\t\tType: Ptr(\"t\"),\n\t\t},\n\t\tCurrentUserOrganizations: []*FeedLink{\n\t\t\t{\n\t\t\t\tHRef: Ptr(\"h\"),\n\t\t\t\tType: Ptr(\"t\"),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"timeline\": {\n\t\t\t\"href\": \"h\",\n\t\t\t\"type\": \"t\"\n\t\t},\n\t\t\"user\": {\n\t\t\t\"href\": \"h\",\n\t\t\t\"type\": \"t\"\n\t\t},\n\t\t\"current_user_public\": {\n\t\t\t\"href\": \"h\",\n\t\t\t\"type\": \"t\"\n\t\t},\n\t\t\"current_user\": {\n\t\t\t\"href\": \"h\",\n\t\t\t\"type\": \"t\"\n\t\t},\n\t\t\"current_user_actor\": {\n\t\t\t\"href\": \"h\",\n\t\t\t\"type\": \"t\"\n\t\t},\n\t\t\"current_user_organization\": {\n\t\t\t\"href\": \"h\",\n\t\t\t\"type\": \"t\"\n\t\t},\n\t\t\"current_user_organizations\": [\n\t\t\t{\n\t\t\t\t\"href\": \"h\",\n\t\t\t\t\"type\": \"t\"\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/activity_watching.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// Subscription identifies a repository or thread subscription.\ntype Subscription struct {\n\tSubscribed *bool      `json:\"subscribed,omitempty\"`\n\tIgnored    *bool      `json:\"ignored,omitempty\"`\n\tReason     *string    `json:\"reason,omitempty\"`\n\tCreatedAt  *Timestamp `json:\"created_at,omitempty\"`\n\tURL        *string    `json:\"url,omitempty\"`\n\n\t// only populated for repository subscriptions\n\tRepositoryURL *string `json:\"repository_url,omitempty\"`\n\n\t// only populated for thread subscriptions\n\tThreadURL *string `json:\"thread_url,omitempty\"`\n}\n\n// ListWatchers lists watchers of a particular repo.\n//\n// GitHub API docs: https://docs.github.com/rest/activity/watching#list-watchers\n//\n//meta:operation GET /repos/{owner}/{repo}/subscribers\nfunc (s *ActivityService) ListWatchers(ctx context.Context, owner, repo string, opts *ListOptions) ([]*User, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/subscribers\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar watchers []*User\n\tresp, err := s.client.Do(ctx, req, &watchers)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn watchers, resp, nil\n}\n\n// ListWatched lists the repositories the specified user is watching. Passing\n// the empty string will fetch watched repos for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-a-user\n//\n// GitHub API docs: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-the-authenticated-user\n//\n//meta:operation GET /user/subscriptions\n//meta:operation GET /users/{username}/subscriptions\nfunc (s *ActivityService) ListWatched(ctx context.Context, user string, opts *ListOptions) ([]*Repository, *Response, error) {\n\tvar u string\n\tif user != \"\" {\n\t\tu = fmt.Sprintf(\"users/%v/subscriptions\", user)\n\t} else {\n\t\tu = \"user/subscriptions\"\n\t}\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar watched []*Repository\n\tresp, err := s.client.Do(ctx, req, &watched)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn watched, resp, nil\n}\n\n// GetRepositorySubscription returns the subscription for the specified\n// repository for the authenticated user. If the authenticated user is not\n// watching the repository, a nil Subscription is returned.\n//\n// GitHub API docs: https://docs.github.com/rest/activity/watching#get-a-repository-subscription\n//\n//meta:operation GET /repos/{owner}/{repo}/subscription\nfunc (s *ActivityService) GetRepositorySubscription(ctx context.Context, owner, repo string) (*Subscription, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/subscription\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar sub *Subscription\n\tresp, err := s.client.Do(ctx, req, &sub)\n\tif err != nil {\n\t\t// if it's just a 404, don't return that as an error\n\t\t_, err = parseBoolResponse(err)\n\t\treturn nil, resp, err\n\t}\n\n\treturn sub, resp, nil\n}\n\n// SetRepositorySubscription sets the subscription for the specified repository\n// for the authenticated user.\n//\n// To watch a repository, set subscription.Subscribed to true.\n// To ignore notifications made within a repository, set subscription.Ignored to true.\n// To stop watching a repository, use DeleteRepositorySubscription.\n//\n// GitHub API docs: https://docs.github.com/rest/activity/watching#set-a-repository-subscription\n//\n//meta:operation PUT /repos/{owner}/{repo}/subscription\nfunc (s *ActivityService) SetRepositorySubscription(ctx context.Context, owner, repo string, subscription *Subscription) (*Subscription, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/subscription\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, subscription)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar sub *Subscription\n\tresp, err := s.client.Do(ctx, req, &sub)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn sub, resp, nil\n}\n\n// DeleteRepositorySubscription deletes the subscription for the specified\n// repository for the authenticated user.\n//\n// This is used to stop watching a repository. To control whether or not to\n// receive notifications from a repository, use SetRepositorySubscription.\n//\n// GitHub API docs: https://docs.github.com/rest/activity/watching#delete-a-repository-subscription\n//\n//meta:operation DELETE /repos/{owner}/{repo}/subscription\nfunc (s *ActivityService) DeleteRepositorySubscription(ctx context.Context, owner, repo string) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/subscription\", owner, repo)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/activity_watching_test.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestActivityService_ListWatchers(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/subscribers\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\": \"2\",\n\t\t})\n\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\tctx := t.Context()\n\twatchers, _, err := client.Activity.ListWatchers(ctx, \"o\", \"r\", &ListOptions{Page: 2})\n\tif err != nil {\n\t\tt.Errorf(\"Activity.ListWatchers returned error: %v\", err)\n\t}\n\n\twant := []*User{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(watchers, want) {\n\t\tt.Errorf(\"Activity.ListWatchers returned %+v, want %+v\", watchers, want)\n\t}\n\n\tconst methodName = \"ListWatchers\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Activity.ListWatchers(ctx, \"\\n\", \"\\n\", &ListOptions{Page: 2})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Activity.ListWatchers(ctx, \"o\", \"r\", &ListOptions{Page: 2})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActivityService_ListWatched_authenticatedUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/subscriptions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\tctx := t.Context()\n\twatched, _, err := client.Activity.ListWatched(ctx, \"\", &ListOptions{Page: 2})\n\tif err != nil {\n\t\tt.Errorf(\"Activity.ListWatched returned error: %v\", err)\n\t}\n\n\twant := []*Repository{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(watched, want) {\n\t\tt.Errorf(\"Activity.ListWatched returned %+v, want %+v\", watched, want)\n\t}\n\n\tconst methodName = \"ListWatched\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Activity.ListWatched(ctx, \"\\n\", &ListOptions{Page: 2})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Activity.ListWatched(ctx, \"\", &ListOptions{Page: 2})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActivityService_ListWatched_specifiedUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/subscriptions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\tctx := t.Context()\n\twatched, _, err := client.Activity.ListWatched(ctx, \"u\", &ListOptions{Page: 2})\n\tif err != nil {\n\t\tt.Errorf(\"Activity.ListWatched returned error: %v\", err)\n\t}\n\n\twant := []*Repository{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(watched, want) {\n\t\tt.Errorf(\"Activity.ListWatched returned %+v, want %+v\", watched, want)\n\t}\n}\n\nfunc TestActivityService_GetRepositorySubscription_true(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/subscription\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"subscribed\":true}`)\n\t})\n\n\tctx := t.Context()\n\tsub, _, err := client.Activity.GetRepositorySubscription(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Activity.GetRepositorySubscription returned error: %v\", err)\n\t}\n\n\twant := &Subscription{Subscribed: Ptr(true)}\n\tif !cmp.Equal(sub, want) {\n\t\tt.Errorf(\"Activity.GetRepositorySubscription returned %+v, want %+v\", sub, want)\n\t}\n\n\tconst methodName = \"GetRepositorySubscription\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Activity.GetRepositorySubscription(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Activity.GetRepositorySubscription(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActivityService_GetRepositorySubscription_false(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/subscription\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tsub, _, err := client.Activity.GetRepositorySubscription(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Activity.GetRepositorySubscription returned error: %v\", err)\n\t}\n\n\tvar want *Subscription\n\tif !cmp.Equal(sub, want) {\n\t\tt.Errorf(\"Activity.GetRepositorySubscription returned %+v, want %+v\", sub, want)\n\t}\n}\n\nfunc TestActivityService_GetRepositorySubscription_error(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/subscription\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t})\n\n\tctx := t.Context()\n\t_, _, err := client.Activity.GetRepositorySubscription(ctx, \"o\", \"r\")\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 400 response\")\n\t}\n}\n\nfunc TestActivityService_SetRepositorySubscription(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &Subscription{Subscribed: Ptr(true)}\n\n\tmux.HandleFunc(\"/repos/o/r/subscription\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *Subscription\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"ignored\":true}`)\n\t})\n\n\tctx := t.Context()\n\tsub, _, err := client.Activity.SetRepositorySubscription(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Activity.SetRepositorySubscription returned error: %v\", err)\n\t}\n\n\twant := &Subscription{Ignored: Ptr(true)}\n\tif !cmp.Equal(sub, want) {\n\t\tt.Errorf(\"Activity.SetRepositorySubscription returned %+v, want %+v\", sub, want)\n\t}\n\n\tconst methodName = \"SetRepositorySubscription\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Activity.SetRepositorySubscription(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Activity.SetRepositorySubscription(ctx, \"o\", \"r\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActivityService_DeleteRepositorySubscription(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/subscription\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Activity.DeleteRepositorySubscription(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Activity.DeleteRepositorySubscription returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteRepositorySubscription\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Activity.DeleteRepositorySubscription(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Activity.DeleteRepositorySubscription(ctx, \"o\", \"r\")\n\t})\n}\n\nfunc TestSubscription_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Subscription{}, \"{}\")\n\n\tu := &Subscription{\n\t\tSubscribed:    Ptr(true),\n\t\tIgnored:       Ptr(false),\n\t\tReason:        Ptr(\"r\"),\n\t\tCreatedAt:     &Timestamp{referenceTime},\n\t\tURL:           Ptr(\"u\"),\n\t\tRepositoryURL: Ptr(\"ru\"),\n\t\tThreadURL:     Ptr(\"tu\"),\n\t}\n\n\twant := `{\n\t\t\"subscribed\": true,\n\t\t\"ignored\": false,\n\t\t\"reason\": \"r\",\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"url\": \"u\",\n\t\t\"repository_url\": \"ru\",\n\t\t\"thread_url\": \"tu\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/admin.go",
    "content": "// Copyright 2016 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// AdminService handles communication with the admin related methods of the\n// GitHub API. These API routes are normally only accessible for GitHub\n// Enterprise installations.\n//\n// GitHub API docs: https://docs.github.com/rest/enterprise-admin\ntype AdminService service\n\n// TeamLDAPMapping represents the mapping between a GitHub team and an LDAP group.\ntype TeamLDAPMapping struct {\n\tID          *int64  `json:\"id,omitempty\"`\n\tLDAPDN      *string `json:\"ldap_dn,omitempty\"`\n\tURL         *string `json:\"url,omitempty\"`\n\tName        *string `json:\"name,omitempty\"`\n\tSlug        *string `json:\"slug,omitempty\"`\n\tDescription *string `json:\"description,omitempty\"`\n\tPrivacy     *string `json:\"privacy,omitempty\"`\n\tPermission  *string `json:\"permission,omitempty\"`\n\n\tMembersURL      *string `json:\"members_url,omitempty\"`\n\tRepositoriesURL *string `json:\"repositories_url,omitempty\"`\n}\n\nfunc (m TeamLDAPMapping) String() string {\n\treturn Stringify(m)\n}\n\n// UserLDAPMapping represents the mapping between a GitHub user and an LDAP user.\ntype UserLDAPMapping struct {\n\tID         *int64  `json:\"id,omitempty\"`\n\tLDAPDN     *string `json:\"ldap_dn,omitempty\"`\n\tLogin      *string `json:\"login,omitempty\"`\n\tAvatarURL  *string `json:\"avatar_url,omitempty\"`\n\tGravatarID *string `json:\"gravatar_id,omitempty\"`\n\tType       *string `json:\"type,omitempty\"`\n\tSiteAdmin  *bool   `json:\"site_admin,omitempty\"`\n\n\tURL               *string `json:\"url,omitempty\"`\n\tEventsURL         *string `json:\"events_url,omitempty\"`\n\tFollowingURL      *string `json:\"following_url,omitempty\"`\n\tFollowersURL      *string `json:\"followers_url,omitempty\"`\n\tGistsURL          *string `json:\"gists_url,omitempty\"`\n\tOrganizationsURL  *string `json:\"organizations_url,omitempty\"`\n\tReceivedEventsURL *string `json:\"received_events_url,omitempty\"`\n\tReposURL          *string `json:\"repos_url,omitempty\"`\n\tStarredURL        *string `json:\"starred_url,omitempty\"`\n\tSubscriptionsURL  *string `json:\"subscriptions_url,omitempty\"`\n}\n\nfunc (m UserLDAPMapping) String() string {\n\treturn Stringify(m)\n}\n\n// Enterprise represents the GitHub enterprise profile.\ntype Enterprise struct {\n\tID          *int       `json:\"id,omitempty\"`\n\tSlug        *string    `json:\"slug,omitempty\"`\n\tName        *string    `json:\"name,omitempty\"`\n\tNodeID      *string    `json:\"node_id,omitempty\"`\n\tAvatarURL   *string    `json:\"avatar_url,omitempty\"`\n\tDescription *string    `json:\"description,omitempty\"`\n\tWebsiteURL  *string    `json:\"website_url,omitempty\"`\n\tHTMLURL     *string    `json:\"html_url,omitempty\"`\n\tCreatedAt   *Timestamp `json:\"created_at,omitempty\"`\n\tUpdatedAt   *Timestamp `json:\"updated_at,omitempty\"`\n}\n\nfunc (m Enterprise) String() string {\n\treturn Stringify(m)\n}\n\n// UpdateUserLDAPMapping updates the mapping between a GitHub user and an LDAP user.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user\n//\n//meta:operation PATCH /admin/ldap/users/{username}/mapping\nfunc (s *AdminService) UpdateUserLDAPMapping(ctx context.Context, user string, mapping *UserLDAPMapping) (*UserLDAPMapping, *Response, error) {\n\tu := fmt.Sprintf(\"admin/ldap/users/%v/mapping\", user)\n\treq, err := s.client.NewRequest(\"PATCH\", u, mapping)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar m *UserLDAPMapping\n\tresp, err := s.client.Do(ctx, req, &m)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn m, resp, nil\n}\n\n// UpdateTeamLDAPMapping updates the mapping between a GitHub team and an LDAP group.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team\n//\n//meta:operation PATCH /admin/ldap/teams/{team_id}/mapping\nfunc (s *AdminService) UpdateTeamLDAPMapping(ctx context.Context, team int64, mapping *TeamLDAPMapping) (*TeamLDAPMapping, *Response, error) {\n\tu := fmt.Sprintf(\"admin/ldap/teams/%v/mapping\", team)\n\treq, err := s.client.NewRequest(\"PATCH\", u, mapping)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar m *TeamLDAPMapping\n\tresp, err := s.client.Do(ctx, req, &m)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn m, resp, nil\n}\n"
  },
  {
    "path": "github/admin_orgs.go",
    "content": "// Copyright 2019 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n)\n\n// createOrgRequest is a subset of Organization and is used internally\n// by CreateOrg to pass only the known fields for the endpoint.\ntype createOrgRequest struct {\n\tLogin *string `json:\"login,omitempty\"`\n\tAdmin *string `json:\"admin,omitempty\"`\n}\n\n// CreateOrg creates a new organization in GitHub Enterprise.\n//\n// Note that only a subset of the org fields are used and org must\n// not be nil.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/orgs#create-an-organization\n//\n//meta:operation POST /admin/organizations\nfunc (s *AdminService) CreateOrg(ctx context.Context, org *Organization, admin string) (*Organization, *Response, error) {\n\tu := \"admin/organizations\"\n\n\torgReq := &createOrgRequest{\n\t\tLogin: org.Login,\n\t\tAdmin: &admin,\n\t}\n\n\treq, err := s.client.NewRequest(\"POST\", u, orgReq)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar o *Organization\n\tresp, err := s.client.Do(ctx, req, &o)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn o, resp, nil\n}\n\n// renameOrgRequest is a subset of Organization and is used internally\n// by RenameOrg and RenameOrgByName to pass only the known fields for the endpoint.\ntype renameOrgRequest struct {\n\tLogin *string `json:\"login,omitempty\"`\n}\n\n// RenameOrgResponse is the response given when renaming an Organization.\ntype RenameOrgResponse struct {\n\tMessage *string `json:\"message,omitempty\"`\n\tURL     *string `json:\"url,omitempty\"`\n}\n\n// RenameOrg renames an organization in GitHub Enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/orgs#update-an-organization-name\n//\n//meta:operation PATCH /admin/organizations/{org}\nfunc (s *AdminService) RenameOrg(ctx context.Context, org *Organization, newName string) (*RenameOrgResponse, *Response, error) {\n\tif org == nil {\n\t\treturn nil, nil, errors.New(\"organization must be provided\")\n\t}\n\tif org.Login == nil {\n\t\treturn nil, nil, errors.New(\"login must be provided\")\n\t}\n\n\treturn s.RenameOrgByName(ctx, *org.Login, newName)\n}\n\n// RenameOrgByName renames an organization in GitHub Enterprise using its current name.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/orgs#update-an-organization-name\n//\n//meta:operation PATCH /admin/organizations/{org}\nfunc (s *AdminService) RenameOrgByName(ctx context.Context, org, newName string) (*RenameOrgResponse, *Response, error) {\n\tu := fmt.Sprintf(\"admin/organizations/%v\", org)\n\n\torgReq := &renameOrgRequest{\n\t\tLogin: &newName,\n\t}\n\n\treq, err := s.client.NewRequest(\"PATCH\", u, orgReq)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar o *RenameOrgResponse\n\tresp, err := s.client.Do(ctx, req, &o)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn o, resp, nil\n}\n"
  },
  {
    "path": "github/admin_orgs_test.go",
    "content": "// Copyright 2019 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestAdminOrgs_Create(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &Organization{\n\t\tLogin: Ptr(\"github\"),\n\t}\n\n\tmux.HandleFunc(\"/admin/organizations\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *createOrgRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\twant := &createOrgRequest{Login: Ptr(\"github\"), Admin: Ptr(\"ghAdmin\")}\n\t\tif !cmp.Equal(v, want) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, want)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"login\":\"github\",\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\torg, _, err := client.Admin.CreateOrg(ctx, input, \"ghAdmin\")\n\tif err != nil {\n\t\tt.Errorf(\"Admin.CreateOrg returned error: %v\", err)\n\t}\n\n\twant := &Organization{ID: Ptr(int64(1)), Login: Ptr(\"github\")}\n\tif !cmp.Equal(org, want) {\n\t\tt.Errorf(\"Admin.CreateOrg returned %+v, want %+v\", org, want)\n\t}\n\n\tconst methodName = \"CreateOrg\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Admin.CreateOrg(ctx, input, \"ghAdmin\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestAdminOrgs_Rename(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &Organization{\n\t\tLogin: Ptr(\"o\"),\n\t}\n\n\tmux.HandleFunc(\"/admin/organizations/o\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *renameOrgRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\twant := &renameOrgRequest{Login: Ptr(\"the-new-octocats\")}\n\t\tif !cmp.Equal(v, want) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, want)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"message\":\"Job queued to rename organization. It may take a few minutes to complete.\",\"url\":\"https://<hostname>/api/v3/organizations/1\"}`)\n\t})\n\n\tctx := t.Context()\n\tresp, _, err := client.Admin.RenameOrg(ctx, input, \"the-new-octocats\")\n\tif err != nil {\n\t\tt.Errorf(\"Admin.RenameOrg returned error: %v\", err)\n\t}\n\n\twant := &RenameOrgResponse{Message: Ptr(\"Job queued to rename organization. It may take a few minutes to complete.\"), URL: Ptr(\"https://<hostname>/api/v3/organizations/1\")}\n\tif !cmp.Equal(resp, want) {\n\t\tt.Errorf(\"Admin.RenameOrg returned %+v, want %+v\", resp, want)\n\t}\n\n\tconst methodName = \"RenameOrg\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Admin.RenameOrg(ctx, nil, \"the-new-octocats\")\n\t\treturn err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Admin.RenameOrg(ctx, &Organization{Login: nil}, \"the-new-octocats\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Admin.RenameOrg(ctx, input, \"the-new-octocats\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestAdminOrgs_RenameByName(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/admin/organizations/o\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *renameOrgRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\twant := &renameOrgRequest{Login: Ptr(\"the-new-octocats\")}\n\t\tif !cmp.Equal(v, want) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, want)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"message\":\"Job queued to rename organization. It may take a few minutes to complete.\",\"url\":\"https://<hostname>/api/v3/organizations/1\"}`)\n\t})\n\n\tctx := t.Context()\n\tresp, _, err := client.Admin.RenameOrgByName(ctx, \"o\", \"the-new-octocats\")\n\tif err != nil {\n\t\tt.Errorf(\"Admin.RenameOrg returned error: %v\", err)\n\t}\n\n\twant := &RenameOrgResponse{Message: Ptr(\"Job queued to rename organization. It may take a few minutes to complete.\"), URL: Ptr(\"https://<hostname>/api/v3/organizations/1\")}\n\tif !cmp.Equal(resp, want) {\n\t\tt.Errorf(\"Admin.RenameOrg returned %+v, want %+v\", resp, want)\n\t}\n\n\tconst methodName = \"RenameOrgByName\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Admin.RenameOrgByName(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Admin.RenameOrgByName(ctx, \"o\", \"the-new-octocats\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCreateOrgRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &createOrgRequest{}, \"{}\")\n\n\tu := &createOrgRequest{\n\t\tLogin: Ptr(\"l\"),\n\t\tAdmin: Ptr(\"a\"),\n\t}\n\n\twant := `{\n\t\t\"login\": \"l\",\n\t\t\"admin\": \"a\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestRenameOrgRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &renameOrgRequest{}, \"{}\")\n\n\tu := &renameOrgRequest{\n\t\tLogin: Ptr(\"l\"),\n\t}\n\n\twant := `{\n\t\t\"login\": \"l\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestRenameOrgResponse_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &renameOrgRequest{}, \"{}\")\n\n\tu := &RenameOrgResponse{\n\t\tMessage: Ptr(\"m\"),\n\t\tURL:     Ptr(\"u\"),\n\t}\n\n\twant := `{\n\t\t\"message\": \"m\",\n\t\t\"url\": \"u\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/admin_stats.go",
    "content": "// Copyright 2017 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n)\n\n// AdminStats represents a variety of stats of a GitHub Enterprise\n// installation.\ntype AdminStats struct {\n\tIssues     *IssueStats     `json:\"issues,omitempty\"`\n\tHooks      *HookStats      `json:\"hooks,omitempty\"`\n\tMilestones *MilestoneStats `json:\"milestones,omitempty\"`\n\tOrgs       *OrgStats       `json:\"orgs,omitempty\"`\n\tComments   *CommentStats   `json:\"comments,omitempty\"`\n\tPages      *PageStats      `json:\"pages,omitempty\"`\n\tUsers      *UserStats      `json:\"users,omitempty\"`\n\tGists      *GistStats      `json:\"gists,omitempty\"`\n\tPulls      *PullStats      `json:\"pulls,omitempty\"`\n\tRepos      *RepoStats      `json:\"repos,omitempty\"`\n}\n\nfunc (s AdminStats) String() string {\n\treturn Stringify(s)\n}\n\n// IssueStats represents the number of total, open and closed issues.\ntype IssueStats struct {\n\tTotalIssues  *int `json:\"total_issues,omitempty\"`\n\tOpenIssues   *int `json:\"open_issues,omitempty\"`\n\tClosedIssues *int `json:\"closed_issues,omitempty\"`\n}\n\nfunc (s IssueStats) String() string {\n\treturn Stringify(s)\n}\n\n// HookStats represents the number of total, active and inactive hooks.\ntype HookStats struct {\n\tTotalHooks    *int `json:\"total_hooks,omitempty\"`\n\tActiveHooks   *int `json:\"active_hooks,omitempty\"`\n\tInactiveHooks *int `json:\"inactive_hooks,omitempty\"`\n}\n\nfunc (s HookStats) String() string {\n\treturn Stringify(s)\n}\n\n// MilestoneStats represents the number of total, open and close milestones.\ntype MilestoneStats struct {\n\tTotalMilestones  *int `json:\"total_milestones,omitempty\"`\n\tOpenMilestones   *int `json:\"open_milestones,omitempty\"`\n\tClosedMilestones *int `json:\"closed_milestones,omitempty\"`\n}\n\nfunc (s MilestoneStats) String() string {\n\treturn Stringify(s)\n}\n\n// OrgStats represents the number of total, disabled organizations and the team\n// and team member count.\ntype OrgStats struct {\n\tTotalOrgs        *int `json:\"total_orgs,omitempty\"`\n\tDisabledOrgs     *int `json:\"disabled_orgs,omitempty\"`\n\tTotalTeams       *int `json:\"total_teams,omitempty\"`\n\tTotalTeamMembers *int `json:\"total_team_members,omitempty\"`\n}\n\nfunc (s OrgStats) String() string {\n\treturn Stringify(s)\n}\n\n// CommentStats represents the number of total comments on commits, gists, issues\n// and pull requests.\ntype CommentStats struct {\n\tTotalCommitComments      *int `json:\"total_commit_comments,omitempty\"`\n\tTotalGistComments        *int `json:\"total_gist_comments,omitempty\"`\n\tTotalIssueComments       *int `json:\"total_issue_comments,omitempty\"`\n\tTotalPullRequestComments *int `json:\"total_pull_request_comments,omitempty\"`\n}\n\nfunc (s CommentStats) String() string {\n\treturn Stringify(s)\n}\n\n// PageStats represents the total number of github pages.\ntype PageStats struct {\n\tTotalPages *int `json:\"total_pages,omitempty\"`\n}\n\nfunc (s PageStats) String() string {\n\treturn Stringify(s)\n}\n\n// UserStats represents the number of total, admin and suspended users.\ntype UserStats struct {\n\tTotalUsers     *int `json:\"total_users,omitempty\"`\n\tAdminUsers     *int `json:\"admin_users,omitempty\"`\n\tSuspendedUsers *int `json:\"suspended_users,omitempty\"`\n}\n\nfunc (s UserStats) String() string {\n\treturn Stringify(s)\n}\n\n// GistStats represents the number of total, private and public gists.\ntype GistStats struct {\n\tTotalGists   *int `json:\"total_gists,omitempty\"`\n\tPrivateGists *int `json:\"private_gists,omitempty\"`\n\tPublicGists  *int `json:\"public_gists,omitempty\"`\n}\n\nfunc (s GistStats) String() string {\n\treturn Stringify(s)\n}\n\n// PullStats represents the number of total, merged, mergeable and unmergeable\n// pull-requests.\ntype PullStats struct {\n\tTotalPulls       *int `json:\"total_pulls,omitempty\"`\n\tMergedPulls      *int `json:\"merged_pulls,omitempty\"`\n\tMergeablePulls   *int `json:\"mergeable_pulls,omitempty\"`\n\tUnmergeablePulls *int `json:\"unmergeable_pulls,omitempty\"`\n}\n\nfunc (s PullStats) String() string {\n\treturn Stringify(s)\n}\n\n// RepoStats represents the number of total, root, fork, organization repositories\n// together with the total number of pushes and wikis.\ntype RepoStats struct {\n\tTotalRepos  *int `json:\"total_repos,omitempty\"`\n\tRootRepos   *int `json:\"root_repos,omitempty\"`\n\tForkRepos   *int `json:\"fork_repos,omitempty\"`\n\tOrgRepos    *int `json:\"org_repos,omitempty\"`\n\tTotalPushes *int `json:\"total_pushes,omitempty\"`\n\tTotalWikis  *int `json:\"total_wikis,omitempty\"`\n}\n\nfunc (s RepoStats) String() string {\n\treturn Stringify(s)\n}\n\n// GetAdminStats returns a variety of metrics about a GitHub Enterprise\n// installation.\n//\n// Please note that this is only available to site administrators,\n// otherwise it will error with a 404 not found (instead of 401 or 403).\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/admin-stats#get-all-statistics\n//\n//meta:operation GET /enterprise/stats/all\nfunc (s *AdminService) GetAdminStats(ctx context.Context) (*AdminStats, *Response, error) {\n\tu := \"enterprise/stats/all\"\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar m *AdminStats\n\tresp, err := s.client.Do(ctx, req, &m)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn m, resp, nil\n}\n"
  },
  {
    "path": "github/admin_stats_test.go",
    "content": "// Copyright 2017 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestAdminService_GetAdminStats(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprise/stats/all\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\n\t\tfmt.Fprint(w, `\n{\n  \"repos\": {\n    \"total_repos\": 212,\n    \"root_repos\": 194,\n    \"fork_repos\": 18,\n    \"org_repos\": 51,\n    \"total_pushes\": 3082,\n    \"total_wikis\": 15\n  },\n  \"hooks\": {\n    \"total_hooks\": 27,\n    \"active_hooks\": 23,\n    \"inactive_hooks\": 4\n  },\n  \"pages\": {\n    \"total_pages\": 36\n  },\n  \"orgs\": {\n    \"total_orgs\": 33,\n    \"disabled_orgs\": 0,\n    \"total_teams\": 60,\n    \"total_team_members\": 314\n  },\n  \"users\": {\n    \"total_users\": 254,\n    \"admin_users\": 45,\n    \"suspended_users\": 21\n  },\n  \"pulls\": {\n    \"total_pulls\": 86,\n    \"merged_pulls\": 60,\n    \"mergeable_pulls\": 21,\n    \"unmergeable_pulls\": 3\n  },\n  \"issues\": {\n    \"total_issues\": 179,\n    \"open_issues\": 83,\n    \"closed_issues\": 96\n  },\n  \"milestones\": {\n    \"total_milestones\": 7,\n    \"open_milestones\": 6,\n    \"closed_milestones\": 1\n  },\n  \"gists\": {\n    \"total_gists\": 178,\n    \"private_gists\": 151,\n    \"public_gists\": 25\n  },\n  \"comments\": {\n    \"total_commit_comments\": 6,\n    \"total_gist_comments\": 28,\n    \"total_issue_comments\": 366,\n    \"total_pull_request_comments\": 30\n  }\n}\n`)\n\t})\n\n\tctx := t.Context()\n\tstats, _, err := client.Admin.GetAdminStats(ctx)\n\tif err != nil {\n\t\tt.Errorf(\"AdminService.GetAdminStats returned error: %v\", err)\n\t}\n\n\tif want := testAdminStats; !cmp.Equal(stats, want) {\n\t\tt.Errorf(\"AdminService.GetAdminStats returned %+v, want %+v\", stats, want)\n\t}\n\n\tconst methodName = \"GetAdminStats\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Admin.GetAdminStats(ctx)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestAdminService_Stringify(t *testing.T) {\n\tt.Parallel()\n\twant := \"github.AdminStats{Issues:github.IssueStats{TotalIssues:179, OpenIssues:83, ClosedIssues:96}, Hooks:github.HookStats{TotalHooks:27, ActiveHooks:23, InactiveHooks:4}, Milestones:github.MilestoneStats{TotalMilestones:7, OpenMilestones:6, ClosedMilestones:1}, Orgs:github.OrgStats{TotalOrgs:33, DisabledOrgs:0, TotalTeams:60, TotalTeamMembers:314}, Comments:github.CommentStats{TotalCommitComments:6, TotalGistComments:28, TotalIssueComments:366, TotalPullRequestComments:30}, Pages:github.PageStats{TotalPages:36}, Users:github.UserStats{TotalUsers:254, AdminUsers:45, SuspendedUsers:21}, Gists:github.GistStats{TotalGists:178, PrivateGists:151, PublicGists:25}, Pulls:github.PullStats{TotalPulls:86, MergedPulls:60, MergeablePulls:21, UnmergeablePulls:3}, Repos:github.RepoStats{TotalRepos:212, RootRepos:194, ForkRepos:18, OrgRepos:51, TotalPushes:3082, TotalWikis:15}}\"\n\tif got := testAdminStats.String(); got != want {\n\t\tt.Errorf(\"testAdminStats.String = %q, want %q\", got, want)\n\t}\n\n\twant = \"github.IssueStats{TotalIssues:179, OpenIssues:83, ClosedIssues:96}\"\n\tif got := testAdminStats.Issues.String(); got != want {\n\t\tt.Errorf(\"testAdminStats.Issues.String = %q, want %q\", got, want)\n\t}\n\n\twant = \"github.HookStats{TotalHooks:27, ActiveHooks:23, InactiveHooks:4}\"\n\tif got := testAdminStats.Hooks.String(); got != want {\n\t\tt.Errorf(\"testAdminStats.Hooks.String = %q, want %q\", got, want)\n\t}\n\n\twant = \"github.MilestoneStats{TotalMilestones:7, OpenMilestones:6, ClosedMilestones:1}\"\n\tif got := testAdminStats.Milestones.String(); got != want {\n\t\tt.Errorf(\"testAdminStats.Milestones.String = %q, want %q\", got, want)\n\t}\n\n\twant = \"github.OrgStats{TotalOrgs:33, DisabledOrgs:0, TotalTeams:60, TotalTeamMembers:314}\"\n\tif got := testAdminStats.Orgs.String(); got != want {\n\t\tt.Errorf(\"testAdminStats.Orgs.String = %q, want %q\", got, want)\n\t}\n\n\twant = \"github.CommentStats{TotalCommitComments:6, TotalGistComments:28, TotalIssueComments:366, TotalPullRequestComments:30}\"\n\tif got := testAdminStats.Comments.String(); got != want {\n\t\tt.Errorf(\"testAdminStats.Comments.String = %q, want %q\", got, want)\n\t}\n\n\twant = \"github.PageStats{TotalPages:36}\"\n\tif got := testAdminStats.Pages.String(); got != want {\n\t\tt.Errorf(\"testAdminStats.Pages.String = %q, want %q\", got, want)\n\t}\n\n\twant = \"github.UserStats{TotalUsers:254, AdminUsers:45, SuspendedUsers:21}\"\n\tif got := testAdminStats.Users.String(); got != want {\n\t\tt.Errorf(\"testAdminStats.Users.String = %q, want %q\", got, want)\n\t}\n\n\twant = \"github.GistStats{TotalGists:178, PrivateGists:151, PublicGists:25}\"\n\tif got := testAdminStats.Gists.String(); got != want {\n\t\tt.Errorf(\"testAdminStats.Gists.String = %q, want %q\", got, want)\n\t}\n\n\twant = \"github.PullStats{TotalPulls:86, MergedPulls:60, MergeablePulls:21, UnmergeablePulls:3}\"\n\tif got := testAdminStats.Pulls.String(); got != want {\n\t\tt.Errorf(\"testAdminStats.Pulls.String = %q, want %q\", got, want)\n\t}\n\n\twant = \"github.RepoStats{TotalRepos:212, RootRepos:194, ForkRepos:18, OrgRepos:51, TotalPushes:3082, TotalWikis:15}\"\n\tif got := testAdminStats.Repos.String(); got != want {\n\t\tt.Errorf(\"testAdminStats.Repos.String = %q, want %q\", got, want)\n\t}\n}\n\nvar testAdminStats = &AdminStats{\n\tRepos: &RepoStats{\n\t\tTotalRepos:  Ptr(212),\n\t\tRootRepos:   Ptr(194),\n\t\tForkRepos:   Ptr(18),\n\t\tOrgRepos:    Ptr(51),\n\t\tTotalPushes: Ptr(3082),\n\t\tTotalWikis:  Ptr(15),\n\t},\n\tHooks: &HookStats{\n\t\tTotalHooks:    Ptr(27),\n\t\tActiveHooks:   Ptr(23),\n\t\tInactiveHooks: Ptr(4),\n\t},\n\tPages: &PageStats{\n\t\tTotalPages: Ptr(36),\n\t},\n\tOrgs: &OrgStats{\n\t\tTotalOrgs:        Ptr(33),\n\t\tDisabledOrgs:     Ptr(0),\n\t\tTotalTeams:       Ptr(60),\n\t\tTotalTeamMembers: Ptr(314),\n\t},\n\tUsers: &UserStats{\n\t\tTotalUsers:     Ptr(254),\n\t\tAdminUsers:     Ptr(45),\n\t\tSuspendedUsers: Ptr(21),\n\t},\n\tPulls: &PullStats{\n\t\tTotalPulls:       Ptr(86),\n\t\tMergedPulls:      Ptr(60),\n\t\tMergeablePulls:   Ptr(21),\n\t\tUnmergeablePulls: Ptr(3),\n\t},\n\tIssues: &IssueStats{\n\t\tTotalIssues:  Ptr(179),\n\t\tOpenIssues:   Ptr(83),\n\t\tClosedIssues: Ptr(96),\n\t},\n\tMilestones: &MilestoneStats{\n\t\tTotalMilestones:  Ptr(7),\n\t\tOpenMilestones:   Ptr(6),\n\t\tClosedMilestones: Ptr(1),\n\t},\n\tGists: &GistStats{\n\t\tTotalGists:   Ptr(178),\n\t\tPrivateGists: Ptr(151),\n\t\tPublicGists:  Ptr(25),\n\t},\n\tComments: &CommentStats{\n\t\tTotalCommitComments:      Ptr(6),\n\t\tTotalGistComments:        Ptr(28),\n\t\tTotalIssueComments:       Ptr(366),\n\t\tTotalPullRequestComments: Ptr(30),\n\t},\n}\n\nfunc TestIssueStats_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &IssueStats{}, \"{}\")\n\n\tu := &IssueStats{\n\t\tTotalIssues:  Ptr(1),\n\t\tOpenIssues:   Ptr(1),\n\t\tClosedIssues: Ptr(1),\n\t}\n\n\twant := `{\n\t\t\"total_issues\": 1,\n\t\t\"open_issues\": 1,\n\t\t\"closed_issues\": 1\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestHookStats_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &HookStats{}, \"{}\")\n\n\tu := &HookStats{\n\t\tTotalHooks:    Ptr(1),\n\t\tActiveHooks:   Ptr(1),\n\t\tInactiveHooks: Ptr(1),\n\t}\n\n\twant := `{\n\t\t\"total_hooks\": 1,\n\t\t\"active_hooks\": 1,\n\t\t\"inactive_hooks\": 1\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestMilestoneStats_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &MilestoneStats{}, \"{}\")\n\n\tu := &MilestoneStats{\n\t\tTotalMilestones:  Ptr(1),\n\t\tOpenMilestones:   Ptr(1),\n\t\tClosedMilestones: Ptr(1),\n\t}\n\n\twant := `{\n\t\t\"total_milestones\": 1,\n\t\t\"open_milestones\": 1,\n\t\t\"closed_milestones\": 1\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestOrgStats_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &OrgStats{}, \"{}\")\n\n\tu := &OrgStats{\n\t\tTotalOrgs:        Ptr(1),\n\t\tDisabledOrgs:     Ptr(1),\n\t\tTotalTeams:       Ptr(1),\n\t\tTotalTeamMembers: Ptr(1),\n\t}\n\n\twant := `{\n\t\t\"total_orgs\": 1,\n\t\t\"disabled_orgs\": 1,\n\t\t\"total_teams\": 1,\n\t\t\"total_team_members\": 1\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestCommentStats_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CommentStats{}, \"{}\")\n\n\tu := &CommentStats{\n\t\tTotalCommitComments:      Ptr(1),\n\t\tTotalGistComments:        Ptr(1),\n\t\tTotalIssueComments:       Ptr(1),\n\t\tTotalPullRequestComments: Ptr(1),\n\t}\n\n\twant := `{\n\t\t\"total_commit_comments\": 1,\n\t\t\"total_gist_comments\": 1,\n\t\t\"total_issue_comments\": 1,\n\t\t\"total_pull_request_comments\": 1\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPageStats_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PageStats{}, \"{}\")\n\n\tu := &PageStats{\n\t\tTotalPages: Ptr(1),\n\t}\n\n\twant := `{\n\t\t\"total_pages\": 1\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestUserStats_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &UserStats{}, \"{}\")\n\n\tu := &UserStats{\n\t\tTotalUsers:     Ptr(1),\n\t\tAdminUsers:     Ptr(1),\n\t\tSuspendedUsers: Ptr(1),\n\t}\n\n\twant := `{\n\t\t\"total_users\": 1,\n\t\t\"admin_users\": 1,\n\t\t\"suspended_users\": 1\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestGistStats_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &GistStats{}, \"{}\")\n\n\tu := &GistStats{\n\t\tTotalGists:   Ptr(1),\n\t\tPrivateGists: Ptr(1),\n\t\tPublicGists:  Ptr(1),\n\t}\n\n\twant := `{\n\t\t\"total_gists\": 1,\n\t\t\"private_gists\": 1,\n\t\t\"public_gists\": 1\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPullStats_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PullStats{}, \"{}\")\n\n\tu := &PullStats{\n\t\tTotalPulls:       Ptr(1),\n\t\tMergedPulls:      Ptr(1),\n\t\tMergeablePulls:   Ptr(1),\n\t\tUnmergeablePulls: Ptr(1),\n\t}\n\n\twant := `{\n\t\t\"total_pulls\": 1,\n\t\t\"merged_pulls\": 1,\n\t\t\"mergeable_pulls\": 1,\n\t\t\"unmergeable_pulls\": 1\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestRepoStats_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RepoStats{}, \"{}\")\n\n\tu := &RepoStats{\n\t\tTotalRepos:  Ptr(1),\n\t\tRootRepos:   Ptr(1),\n\t\tForkRepos:   Ptr(1),\n\t\tOrgRepos:    Ptr(1),\n\t\tTotalPushes: Ptr(1),\n\t\tTotalWikis:  Ptr(1),\n\t}\n\n\twant := `{\n\t\t\"total_repos\": 1,\n\t\t\"root_repos\": 1,\n\t\t\"fork_repos\": 1,\n\t\t\"org_repos\": 1,\n\t\t\"total_pushes\": 1,\n\t\t\"total_wikis\": 1\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestAdminStats_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &AdminStats{}, \"{}\")\n\n\tu := &AdminStats{\n\t\tRepos: &RepoStats{\n\t\t\tTotalRepos:  Ptr(212),\n\t\t\tRootRepos:   Ptr(194),\n\t\t\tForkRepos:   Ptr(18),\n\t\t\tOrgRepos:    Ptr(51),\n\t\t\tTotalPushes: Ptr(3082),\n\t\t\tTotalWikis:  Ptr(15),\n\t\t},\n\t\tHooks: &HookStats{\n\t\t\tTotalHooks:    Ptr(27),\n\t\t\tActiveHooks:   Ptr(23),\n\t\t\tInactiveHooks: Ptr(4),\n\t\t},\n\t\tPages: &PageStats{\n\t\t\tTotalPages: Ptr(36),\n\t\t},\n\t\tOrgs: &OrgStats{\n\t\t\tTotalOrgs:        Ptr(33),\n\t\t\tDisabledOrgs:     Ptr(0),\n\t\t\tTotalTeams:       Ptr(60),\n\t\t\tTotalTeamMembers: Ptr(314),\n\t\t},\n\t\tUsers: &UserStats{\n\t\t\tTotalUsers:     Ptr(254),\n\t\t\tAdminUsers:     Ptr(45),\n\t\t\tSuspendedUsers: Ptr(21),\n\t\t},\n\t\tPulls: &PullStats{\n\t\t\tTotalPulls:       Ptr(86),\n\t\t\tMergedPulls:      Ptr(60),\n\t\t\tMergeablePulls:   Ptr(21),\n\t\t\tUnmergeablePulls: Ptr(3),\n\t\t},\n\t\tIssues: &IssueStats{\n\t\t\tTotalIssues:  Ptr(179),\n\t\t\tOpenIssues:   Ptr(83),\n\t\t\tClosedIssues: Ptr(96),\n\t\t},\n\t\tMilestones: &MilestoneStats{\n\t\t\tTotalMilestones:  Ptr(7),\n\t\t\tOpenMilestones:   Ptr(6),\n\t\t\tClosedMilestones: Ptr(1),\n\t\t},\n\t\tGists: &GistStats{\n\t\t\tTotalGists:   Ptr(178),\n\t\t\tPrivateGists: Ptr(151),\n\t\t\tPublicGists:  Ptr(25),\n\t\t},\n\t\tComments: &CommentStats{\n\t\t\tTotalCommitComments:      Ptr(6),\n\t\t\tTotalGistComments:        Ptr(28),\n\t\t\tTotalIssueComments:       Ptr(366),\n\t\t\tTotalPullRequestComments: Ptr(30),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"repos\": {\n\t\t\t\"total_repos\": 212,\n\t\t\t\"root_repos\": 194,\n\t\t\t\"fork_repos\": 18,\n\t\t\t\"org_repos\": 51,\n\t\t\t\"total_pushes\": 3082,\n\t\t\t\"total_wikis\": 15\n\t\t},\n\t\t\"hooks\": {\n\t\t\t\"total_hooks\": 27,\n\t\t\t\"active_hooks\": 23,\n\t\t\t\"inactive_hooks\": 4\n\t\t},\n\t\t\"pages\": {\n\t\t\t\"total_pages\": 36\n\t\t},\n\t\t\"orgs\": {\n\t\t\t\"total_orgs\": 33,\n\t\t\t\"disabled_orgs\": 0,\n\t\t\t\"total_teams\": 60,\n\t\t\t\"total_team_members\": 314\n\t\t},\n\t\t\"users\": {\n\t\t\t\"total_users\": 254,\n\t\t\t\"admin_users\": 45,\n\t\t\t\"suspended_users\": 21\n\t\t},\n\t\t\"pulls\": {\n\t\t\t\"total_pulls\": 86,\n\t\t\t\"merged_pulls\": 60,\n\t\t\t\"mergeable_pulls\": 21,\n\t\t\t\"unmergeable_pulls\": 3\n\t\t},\n\t\t\"issues\": {\n\t\t\t\"total_issues\": 179,\n\t\t\t\"open_issues\": 83,\n\t\t\t\"closed_issues\": 96\n\t\t},\n\t\t\"milestones\": {\n\t\t\t\"total_milestones\": 7,\n\t\t\t\"open_milestones\": 6,\n\t\t\t\"closed_milestones\": 1\n\t\t},\n\t\t\"gists\": {\n\t\t\t\"total_gists\": 178,\n\t\t\t\"private_gists\": 151,\n\t\t\t\"public_gists\": 25\n\t\t},\n\t\t\"comments\": {\n\t\t\t\"total_commit_comments\": 6,\n\t\t\t\"total_gist_comments\": 28,\n\t\t\t\"total_issue_comments\": 366,\n\t\t\t\"total_pull_request_comments\": 30\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/admin_test.go",
    "content": "// Copyright 2016 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestAdminService_UpdateUserLDAPMapping(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &UserLDAPMapping{\n\t\tLDAPDN: Ptr(\"uid=asdf,ou=users,dc=github,dc=com\"),\n\t}\n\n\tmux.HandleFunc(\"/admin/ldap/users/u/mapping\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *UserLDAPMapping\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\t\tfmt.Fprint(w, `{\"id\":1,\"ldap_dn\":\"uid=asdf,ou=users,dc=github,dc=com\"}`)\n\t})\n\n\tctx := t.Context()\n\tmapping, _, err := client.Admin.UpdateUserLDAPMapping(ctx, \"u\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Admin.UpdateUserLDAPMapping returned error: %v\", err)\n\t}\n\n\twant := &UserLDAPMapping{\n\t\tID:     Ptr(int64(1)),\n\t\tLDAPDN: Ptr(\"uid=asdf,ou=users,dc=github,dc=com\"),\n\t}\n\tif !cmp.Equal(mapping, want) {\n\t\tt.Errorf(\"Admin.UpdateUserLDAPMapping returned %+v, want %+v\", mapping, want)\n\t}\n\n\tconst methodName = \"UpdateUserLDAPMapping\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Admin.UpdateUserLDAPMapping(ctx, \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Admin.UpdateUserLDAPMapping(ctx, \"u\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestAdminService_UpdateTeamLDAPMapping(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &TeamLDAPMapping{\n\t\tLDAPDN: Ptr(\"cn=Enterprise Ops,ou=teams,dc=github,dc=com\"),\n\t}\n\n\tmux.HandleFunc(\"/admin/ldap/teams/1/mapping\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *TeamLDAPMapping\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\t\tfmt.Fprint(w, `{\"id\":1,\"ldap_dn\":\"cn=Enterprise Ops,ou=teams,dc=github,dc=com\"}`)\n\t})\n\n\tctx := t.Context()\n\tmapping, _, err := client.Admin.UpdateTeamLDAPMapping(ctx, 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"Admin.UpdateTeamLDAPMapping returned error: %v\", err)\n\t}\n\n\twant := &TeamLDAPMapping{\n\t\tID:     Ptr(int64(1)),\n\t\tLDAPDN: Ptr(\"cn=Enterprise Ops,ou=teams,dc=github,dc=com\"),\n\t}\n\tif !cmp.Equal(mapping, want) {\n\t\tt.Errorf(\"Admin.UpdateTeamLDAPMapping returned %+v, want %+v\", mapping, want)\n\t}\n\n\tconst methodName = \"UpdateTeamLDAPMapping\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Admin.UpdateTeamLDAPMapping(ctx, -1, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Admin.UpdateTeamLDAPMapping(ctx, 1, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestAdminService_TeamLDAPMapping_String(t *testing.T) {\n\tt.Parallel()\n\tv := &TeamLDAPMapping{\n\t\tID:              Ptr(int64(1)),\n\t\tLDAPDN:          Ptr(\"a\"),\n\t\tURL:             Ptr(\"b\"),\n\t\tName:            Ptr(\"c\"),\n\t\tSlug:            Ptr(\"d\"),\n\t\tDescription:     Ptr(\"e\"),\n\t\tPrivacy:         Ptr(\"f\"),\n\t\tPermission:      Ptr(\"g\"),\n\t\tMembersURL:      Ptr(\"h\"),\n\t\tRepositoriesURL: Ptr(\"i\"),\n\t}\n\n\twant := `github.TeamLDAPMapping{ID:1, LDAPDN:\"a\", URL:\"b\", Name:\"c\", Slug:\"d\", Description:\"e\", Privacy:\"f\", Permission:\"g\", MembersURL:\"h\", RepositoriesURL:\"i\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"TeamLDAPMapping.String = `%v`, want `%v`\", got, want)\n\t}\n}\n\nfunc TestAdminService_UserLDAPMapping_String(t *testing.T) {\n\tt.Parallel()\n\tv := &UserLDAPMapping{\n\t\tID:                Ptr(int64(1)),\n\t\tLDAPDN:            Ptr(\"a\"),\n\t\tLogin:             Ptr(\"b\"),\n\t\tAvatarURL:         Ptr(\"c\"),\n\t\tGravatarID:        Ptr(\"d\"),\n\t\tType:              Ptr(\"e\"),\n\t\tSiteAdmin:         Ptr(true),\n\t\tURL:               Ptr(\"f\"),\n\t\tEventsURL:         Ptr(\"g\"),\n\t\tFollowingURL:      Ptr(\"h\"),\n\t\tFollowersURL:      Ptr(\"i\"),\n\t\tGistsURL:          Ptr(\"j\"),\n\t\tOrganizationsURL:  Ptr(\"k\"),\n\t\tReceivedEventsURL: Ptr(\"l\"),\n\t\tReposURL:          Ptr(\"m\"),\n\t\tStarredURL:        Ptr(\"n\"),\n\t\tSubscriptionsURL:  Ptr(\"o\"),\n\t}\n\n\twant := `github.UserLDAPMapping{ID:1, LDAPDN:\"a\", Login:\"b\", AvatarURL:\"c\", GravatarID:\"d\", Type:\"e\", SiteAdmin:true, URL:\"f\", EventsURL:\"g\", FollowingURL:\"h\", FollowersURL:\"i\", GistsURL:\"j\", OrganizationsURL:\"k\", ReceivedEventsURL:\"l\", ReposURL:\"m\", StarredURL:\"n\", SubscriptionsURL:\"o\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"UserLDAPMapping.String = `%v`, want `%v`\", got, want)\n\t}\n}\n\nfunc TestTeamLDAPMapping_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &TeamLDAPMapping{}, \"{}\")\n\n\tu := &TeamLDAPMapping{\n\t\tID:              Ptr(int64(1)),\n\t\tLDAPDN:          Ptr(\"ldapdn\"),\n\t\tURL:             Ptr(\"u\"),\n\t\tName:            Ptr(\"n\"),\n\t\tSlug:            Ptr(\"s\"),\n\t\tDescription:     Ptr(\"d\"),\n\t\tPrivacy:         Ptr(\"p\"),\n\t\tPermission:      Ptr(\"per\"),\n\t\tMembersURL:      Ptr(\"mu\"),\n\t\tRepositoriesURL: Ptr(\"ru\"),\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"ldap_dn\": \"ldapdn\",\n\t\t\"url\": \"u\",\n\t\t\"name\": \"n\",\n\t\t\"slug\": \"s\",\n\t\t\"description\": \"d\",\n\t\t\"privacy\": \"p\",\n\t\t\"permission\": \"per\",\n\t\t\"members_url\": \"mu\",\n\t\t\"repositories_url\": \"ru\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestUserLDAPMapping_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &UserLDAPMapping{}, \"{}\")\n\n\tu := &UserLDAPMapping{\n\t\tID:                Ptr(int64(1)),\n\t\tLDAPDN:            Ptr(\"ldapdn\"),\n\t\tLogin:             Ptr(\"l\"),\n\t\tAvatarURL:         Ptr(\"au\"),\n\t\tGravatarID:        Ptr(\"gi\"),\n\t\tType:              Ptr(\"t\"),\n\t\tSiteAdmin:         Ptr(true),\n\t\tURL:               Ptr(\"u\"),\n\t\tEventsURL:         Ptr(\"eu\"),\n\t\tFollowingURL:      Ptr(\"fu\"),\n\t\tFollowersURL:      Ptr(\"fu\"),\n\t\tGistsURL:          Ptr(\"gu\"),\n\t\tOrganizationsURL:  Ptr(\"ou\"),\n\t\tReceivedEventsURL: Ptr(\"reu\"),\n\t\tReposURL:          Ptr(\"ru\"),\n\t\tStarredURL:        Ptr(\"su\"),\n\t\tSubscriptionsURL:  Ptr(\"subu\"),\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"ldap_dn\": \"ldapdn\",\n\t\t\"login\": \"l\",\n\t\t\"avatar_url\": \"au\",\n\t\t\"gravatar_id\": \"gi\",\n\t\t\"type\": \"t\",\n\t\t\"site_admin\": true,\n\t\t\"url\": \"u\",\n\t\t\"events_url\": \"eu\",\n\t\t\"following_url\": \"fu\",\n\t\t\"followers_url\": \"fu\",\n\t\t\"gists_url\": \"gu\",\n\t\t\"organizations_url\": \"ou\",\n\t\t\"received_events_url\": \"reu\",\n\t\t\"repos_url\": \"ru\",\n\t\t\"starred_url\": \"su\",\n\t\t\"subscriptions_url\": \"subu\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestEnterprise_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Enterprise{}, \"{}\")\n\n\tu := &Enterprise{\n\t\tID:          Ptr(1),\n\t\tSlug:        Ptr(\"s\"),\n\t\tName:        Ptr(\"n\"),\n\t\tNodeID:      Ptr(\"nid\"),\n\t\tAvatarURL:   Ptr(\"au\"),\n\t\tDescription: Ptr(\"d\"),\n\t\tWebsiteURL:  Ptr(\"wu\"),\n\t\tHTMLURL:     Ptr(\"hu\"),\n\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\tUpdatedAt:   &Timestamp{referenceTime},\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"slug\": \"s\",\n\t\t\"name\": \"n\",\n\t\t\"node_id\": \"nid\",\n\t\t\"avatar_url\": \"au\",\n\t\t\"description\": \"d\",\n\t\t\"website_url\": \"wu\",\n\t\t\"html_url\": \"hu\",\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/admin_users.go",
    "content": "// Copyright 2019 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// CreateUserRequest represents the fields sent to the `CreateUser` endpoint.\n// Note that `Login` is a required field.\ntype CreateUserRequest struct {\n\tLogin     string  `json:\"login\"`\n\tEmail     *string `json:\"email,omitempty\"`\n\tSuspended *bool   `json:\"suspended,omitempty\"`\n}\n\n// CreateUser creates a new user in GitHub Enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#create-a-user\n//\n//meta:operation POST /admin/users\nfunc (s *AdminService) CreateUser(ctx context.Context, userReq CreateUserRequest) (*User, *Response, error) {\n\tu := \"admin/users\"\n\n\treq, err := s.client.NewRequest(\"POST\", u, userReq)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar user User\n\tresp, err := s.client.Do(ctx, req, &user)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn &user, resp, nil\n}\n\n// DeleteUser deletes a user in GitHub Enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#delete-a-user\n//\n//meta:operation DELETE /admin/users/{username}\nfunc (s *AdminService) DeleteUser(ctx context.Context, username string) (*Response, error) {\n\tu := \"admin/users/\" + username\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// ImpersonateUserOptions represents the scoping for the OAuth token.\ntype ImpersonateUserOptions struct {\n\tScopes []string `json:\"scopes,omitempty\"`\n}\n\n// OAuthAPP represents the GitHub Site Administrator OAuth app.\ntype OAuthAPP struct {\n\tURL      *string `json:\"url,omitempty\"`\n\tName     *string `json:\"name,omitempty\"`\n\tClientID *string `json:\"client_id,omitempty\"`\n}\n\nfunc (s OAuthAPP) String() string {\n\treturn Stringify(s)\n}\n\n// UserAuthorization represents the impersonation response.\ntype UserAuthorization struct {\n\tID             *int64     `json:\"id,omitempty\"`\n\tURL            *string    `json:\"url,omitempty\"`\n\tScopes         []string   `json:\"scopes,omitempty\"`\n\tToken          *string    `json:\"token,omitempty\"`\n\tTokenLastEight *string    `json:\"token_last_eight,omitempty\"`\n\tHashedToken    *string    `json:\"hashed_token,omitempty\"`\n\tApp            *OAuthAPP  `json:\"app,omitempty\"`\n\tNote           *string    `json:\"note,omitempty\"`\n\tNoteURL        *string    `json:\"note_url,omitempty\"`\n\tUpdatedAt      *Timestamp `json:\"updated_at,omitempty\"`\n\tCreatedAt      *Timestamp `json:\"created_at,omitempty\"`\n\tFingerprint    *string    `json:\"fingerprint,omitempty\"`\n}\n\n// CreateUserImpersonation creates an impersonation OAuth token.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#create-an-impersonation-oauth-token\n//\n//meta:operation POST /admin/users/{username}/authorizations\nfunc (s *AdminService) CreateUserImpersonation(ctx context.Context, username string, opts *ImpersonateUserOptions) (*UserAuthorization, *Response, error) {\n\tu := fmt.Sprintf(\"admin/users/%v/authorizations\", username)\n\n\treq, err := s.client.NewRequest(\"POST\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar a *UserAuthorization\n\tresp, err := s.client.Do(ctx, req, &a)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn a, resp, nil\n}\n\n// DeleteUserImpersonation deletes an impersonation OAuth token.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#delete-an-impersonation-oauth-token\n//\n//meta:operation DELETE /admin/users/{username}/authorizations\nfunc (s *AdminService) DeleteUserImpersonation(ctx context.Context, username string) (*Response, error) {\n\tu := fmt.Sprintf(\"admin/users/%v/authorizations\", username)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n"
  },
  {
    "path": "github/admin_users_test.go",
    "content": "// Copyright 2019 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestAdminUsers_Create(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/admin/users\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *CreateUserRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\twant := &CreateUserRequest{Login: \"github\", Email: Ptr(\"email@example.com\"), Suspended: Ptr(false)}\n\t\tif !cmp.Equal(v, want) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, want)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"login\":\"github\",\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\torg, _, err := client.Admin.CreateUser(ctx, CreateUserRequest{\n\t\tLogin:     \"github\",\n\t\tEmail:     Ptr(\"email@example.com\"),\n\t\tSuspended: Ptr(false),\n\t})\n\tif err != nil {\n\t\tt.Errorf(\"Admin.CreateUser returned error: %v\", err)\n\t}\n\n\twant := &User{ID: Ptr(int64(1)), Login: Ptr(\"github\")}\n\tif !cmp.Equal(org, want) {\n\t\tt.Errorf(\"Admin.CreateUser returned %+v, want %+v\", org, want)\n\t}\n\n\tconst methodName = \"CreateUser\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Admin.CreateUser(ctx, CreateUserRequest{\n\t\t\tLogin:     \"github\",\n\t\t\tEmail:     Ptr(\"email@example.com\"),\n\t\t\tSuspended: Ptr(false),\n\t\t})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestAdminUsers_Delete(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/admin/users/github\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Admin.DeleteUser(ctx, \"github\")\n\tif err != nil {\n\t\tt.Errorf(\"Admin.DeleteUser returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteUser\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Admin.DeleteUser(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Admin.DeleteUser(ctx, \"github\")\n\t})\n}\n\nfunc TestUserImpersonation_Create(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/admin/users/github/authorizations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestBody(t, r, `{\"scopes\":[\"repo\"]}`+\"\\n\")\n\t\tfmt.Fprint(w, `{\"id\": 1234,\n\t\t\"url\": \"https://example.com/authorizations\",\n\t\t\"app\": {\n\t\t  \"name\": \"GitHub Site Administrator\",\n\t\t  \"url\": \"https://docs.github.com/en/rest/enterprise/users/\",\n\t\t  \"client_id\": \"1234\"\n\t\t},\n\t\t\"token\": \"1234\",\n\t\t\"hashed_token\": \"1234\",\n\t\t\"token_last_eight\": \"1234\",\n\t\t\"note\": null,\n\t\t\"note_url\": null,\n\t\t\"created_at\": \"2018-01-01T00:00:00Z\",\n\t\t\"updated_at\": \"2018-01-01T00:00:00Z\",\n\t\t\"scopes\": [\n\t\t  \"repo\"\n\t\t],\n\t\t\"fingerprint\": null}`)\n\t})\n\n\topt := &ImpersonateUserOptions{Scopes: []string{\"repo\"}}\n\tctx := t.Context()\n\tauth, _, err := client.Admin.CreateUserImpersonation(ctx, \"github\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Admin.CreateUserImpersonation returned error: %v\", err)\n\t}\n\n\tdate := Timestamp{Time: time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)}\n\twant := &UserAuthorization{\n\t\tID:  Ptr(int64(1234)),\n\t\tURL: Ptr(\"https://example.com/authorizations\"),\n\t\tApp: &OAuthAPP{\n\t\t\tName:     Ptr(\"GitHub Site Administrator\"),\n\t\t\tURL:      Ptr(\"https://docs.github.com/en/rest/enterprise/users/\"),\n\t\t\tClientID: Ptr(\"1234\"),\n\t\t},\n\t\tToken:          Ptr(\"1234\"),\n\t\tHashedToken:    Ptr(\"1234\"),\n\t\tTokenLastEight: Ptr(\"1234\"),\n\t\tNote:           nil,\n\t\tNoteURL:        nil,\n\t\tCreatedAt:      &date,\n\t\tUpdatedAt:      &date,\n\t\tScopes:         []string{\"repo\"},\n\t\tFingerprint:    nil,\n\t}\n\tif !cmp.Equal(auth, want) {\n\t\tt.Errorf(\"Admin.CreateUserImpersonation returned %+v, want %+v\", auth, want)\n\t}\n\n\tconst methodName = \"CreateUserImpersonation\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Admin.CreateUserImpersonation(ctx, \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Admin.CreateUserImpersonation(ctx, \"github\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUserImpersonation_Delete(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/admin/users/github/authorizations\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Admin.DeleteUserImpersonation(ctx, \"github\")\n\tif err != nil {\n\t\tt.Errorf(\"Admin.DeleteUserImpersonation returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteUserImpersonation\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Admin.DeleteUserImpersonation(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Admin.DeleteUserImpersonation(ctx, \"github\")\n\t})\n}\n\nfunc TestCreateUserRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CreateUserRequest{}, `{\"login\": \"\"}`)\n\n\tu := &CreateUserRequest{\n\t\tLogin: \"l\",\n\t\tEmail: Ptr(\"e\"),\n\t}\n\n\twant := `{\n\t\t\"login\": \"l\",\n\t\t\"email\": \"e\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestImpersonateUserOptions_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ImpersonateUserOptions{}, \"{}\")\n\n\tu := &ImpersonateUserOptions{\n\t\tScopes: []string{\n\t\t\t\"s\",\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"scopes\": [\"s\"]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestOAuthAPP_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &OAuthAPP{}, \"{}\")\n\n\tu := &OAuthAPP{\n\t\tURL:      Ptr(\"u\"),\n\t\tName:     Ptr(\"n\"),\n\t\tClientID: Ptr(\"cid\"),\n\t}\n\n\twant := `{\n\t\t\"url\": \"u\",\n\t\t\"name\": \"n\",\n\t\t\"client_id\": \"cid\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestUserAuthorization_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &UserAuthorization{}, \"{}\")\n\n\tu := &UserAuthorization{\n\t\tID:  Ptr(int64(1)),\n\t\tURL: Ptr(\"u\"),\n\t\tScopes: []string{\n\t\t\t\"s\",\n\t\t},\n\t\tToken:          Ptr(\"t\"),\n\t\tTokenLastEight: Ptr(\"tle\"),\n\t\tHashedToken:    Ptr(\"ht\"),\n\t\tApp: &OAuthAPP{\n\t\t\tURL:      Ptr(\"u\"),\n\t\t\tName:     Ptr(\"n\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t},\n\t\tNote:        Ptr(\"n\"),\n\t\tNoteURL:     Ptr(\"nu\"),\n\t\tUpdatedAt:   &Timestamp{referenceTime},\n\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\tFingerprint: Ptr(\"f\"),\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"url\": \"u\",\n\t\t\"scopes\": [\"s\"],\n\t\t\"token\": \"t\",\n\t\t\"token_last_eight\": \"tle\",\n\t\t\"hashed_token\": \"ht\",\n\t\t\"app\": {\n\t\t\t\"url\": \"u\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"client_id\": \"cid\"\n\t\t},\n\t\t\"note\": \"n\",\n\t\t\"note_url\": \"nu\",\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"fingerprint\": \"f\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/apps.go",
    "content": "// Copyright 2016 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// AppsService provides access to the installation related functions\n// in the GitHub API.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/\ntype AppsService service\n\n// App represents a GitHub App.\ntype App struct {\n\tID                 *int64                   `json:\"id,omitempty\"`\n\tSlug               *string                  `json:\"slug,omitempty\"`\n\tClientID           *string                  `json:\"client_id,omitempty\"`\n\tNodeID             *string                  `json:\"node_id,omitempty\"`\n\tOwner              *User                    `json:\"owner,omitempty\"`\n\tName               *string                  `json:\"name,omitempty\"`\n\tDescription        *string                  `json:\"description,omitempty\"`\n\tExternalURL        *string                  `json:\"external_url,omitempty\"`\n\tHTMLURL            *string                  `json:\"html_url,omitempty\"`\n\tCreatedAt          *Timestamp               `json:\"created_at,omitempty\"`\n\tUpdatedAt          *Timestamp               `json:\"updated_at,omitempty\"`\n\tPermissions        *InstallationPermissions `json:\"permissions,omitempty\"`\n\tEvents             []string                 `json:\"events,omitempty\"`\n\tInstallationsCount *int                     `json:\"installations_count,omitempty\"`\n}\n\n// InstallationToken represents an installation token.\ntype InstallationToken struct {\n\tToken        *string                  `json:\"token,omitempty\"`\n\tExpiresAt    *Timestamp               `json:\"expires_at,omitempty\"`\n\tPermissions  *InstallationPermissions `json:\"permissions,omitempty\"`\n\tRepositories []*Repository            `json:\"repositories,omitempty\"`\n}\n\n// InstallationTokenOptions allow restricting a token's access to specific repositories.\ntype InstallationTokenOptions struct {\n\t// The IDs of the repositories that the installation token can access.\n\t// Providing repository IDs restricts the access of an installation token to specific repositories.\n\tRepositoryIDs []int64 `json:\"repository_ids,omitempty\"`\n\n\t// The names of the repositories that the installation token can access.\n\t// Providing repository names restricts the access of an installation token to specific repositories.\n\tRepositories []string `json:\"repositories,omitempty\"`\n\n\t// The permissions granted to the access token.\n\t// The permissions object includes the permission names and their access type.\n\tPermissions *InstallationPermissions `json:\"permissions,omitempty\"`\n}\n\n// InstallationTokenListRepoOptions allow restricting a token's access to a list of all repositories in an installation.\n// It differs from InstallationTokenOptions as a parameter which does not omit RepositoryIDs if that field is nil or an empty array.\ntype InstallationTokenListRepoOptions struct {\n\t// The IDs of the repositories that the installation token can access.\n\t// Providing repository IDs restricts the access of an installation token to specific repositories.\n\tRepositoryIDs []int64 `json:\"repository_ids\"`\n\n\t// The names of the repositories that the installation token can access.\n\t// Providing repository names restricts the access of an installation token to specific repositories.\n\tRepositories []string `json:\"repositories,omitempty\"`\n\n\t// The permissions granted to the access token.\n\t// The permissions object includes the permission names and their access type.\n\tPermissions *InstallationPermissions `json:\"permissions,omitempty\"`\n}\n\n// InstallationPermissions lists the repository and organization permissions for an installation.\n//\n// Permission names taken from:\n//\n//\thttps://docs.github.com/enterprise-server@3.0/rest/apps#create-an-installation-access-token-for-an-app\n//\thttps://docs.github.com/rest/apps#create-an-installation-access-token-for-an-app\ntype InstallationPermissions struct {\n\tActions                                 *string `json:\"actions,omitempty\"`\n\tActionsVariables                        *string `json:\"actions_variables,omitempty\"`\n\tAdministration                          *string `json:\"administration,omitempty\"`\n\tAttestations                            *string `json:\"attestations,omitempty\"`\n\tBlocking                                *string `json:\"blocking,omitempty\"`\n\tChecks                                  *string `json:\"checks,omitempty\"`\n\tCodespaces                              *string `json:\"codespaces,omitempty\"`\n\tCodespacesLifecycleAdmin                *string `json:\"codespaces_lifecycle_admin,omitempty\"`\n\tCodespacesMetadata                      *string `json:\"codespaces_metadata,omitempty\"`\n\tCodespacesSecrets                       *string `json:\"codespaces_secrets,omitempty\"`\n\tCodespacesUserSecrets                   *string `json:\"codespaces_user_secrets,omitempty\"`\n\tContents                                *string `json:\"contents,omitempty\"`\n\tContentReferences                       *string `json:\"content_references,omitempty\"`\n\tCopilotMessages                         *string `json:\"copilot_messages,omitempty\"`\n\tDependabotSecrets                       *string `json:\"dependabot_secrets,omitempty\"`\n\tDeployments                             *string `json:\"deployments,omitempty\"`\n\tDiscussions                             *string `json:\"discussions,omitempty\"`\n\tEmails                                  *string `json:\"emails,omitempty\"`\n\tEnvironments                            *string `json:\"environments,omitempty\"`\n\tFollowers                               *string `json:\"followers,omitempty\"`\n\tGists                                   *string `json:\"gists,omitempty\"`\n\tGitSigningSSHPublicKeys                 *string `json:\"git_signing_ssh_public_keys,omitempty\"`\n\tGPGKeys                                 *string `json:\"gpg_keys,omitempty\"`\n\tInteractionLimits                       *string `json:\"interaction_limits,omitempty\"`\n\tIssues                                  *string `json:\"issues,omitempty\"`\n\tKeys                                    *string `json:\"keys,omitempty\"`\n\tMetadata                                *string `json:\"metadata,omitempty\"`\n\tMembers                                 *string `json:\"members,omitempty\"`\n\tMergeQueues                             *string `json:\"merge_queues,omitempty\"`\n\tOrganizationActionsVariables            *string `json:\"organization_actions_variables,omitempty\"`\n\tOrganizationAdministration              *string `json:\"organization_administration,omitempty\"`\n\tOrganizationAnnouncementBanners         *string `json:\"organization_announcement_banners,omitempty\"`\n\tOrganizationAPIInsights                 *string `json:\"organization_api_insights,omitempty\"`\n\tOrganizationCodespaces                  *string `json:\"organization_codespaces,omitempty\"`\n\tOrganizationCodespacesSecrets           *string `json:\"organization_codespaces_secrets,omitempty\"`\n\tOrganizationCodespacesSettings          *string `json:\"organization_codespaces_settings,omitempty\"`\n\tOrganizationCopilotMetrics              *string `json:\"organization_copilot_metrics,omitempty\"`\n\tOrganizationCopilotSeatManagement       *string `json:\"organization_copilot_seat_management,omitempty\"`\n\tOrganizationCustomProperties            *string `json:\"organization_custom_properties,omitempty\"`\n\tOrganizationCustomRoles                 *string `json:\"organization_custom_roles,omitempty\"`\n\tOrganizationCustomOrgRoles              *string `json:\"organization_custom_org_roles,omitempty\"`\n\tOrganizationDependabotSecrets           *string `json:\"organization_dependabot_secrets,omitempty\"`\n\tOrganizationEvents                      *string `json:\"organization_events,omitempty\"`\n\tOrganizationHooks                       *string `json:\"organization_hooks,omitempty\"`\n\tOrganizationKnowledgeBases              *string `json:\"organization_knowledge_bases,omitempty\"`\n\tOrganizationPackages                    *string `json:\"organization_packages,omitempty\"`\n\tOrganizationPersonalAccessTokens        *string `json:\"organization_personal_access_tokens,omitempty\"`\n\tOrganizationPersonalAccessTokenRequests *string `json:\"organization_personal_access_token_requests,omitempty\"`\n\tOrganizationPlan                        *string `json:\"organization_plan,omitempty\"`\n\tOrganizationPreReceiveHooks             *string `json:\"organization_pre_receive_hooks,omitempty\"`\n\tOrganizationProjects                    *string `json:\"organization_projects,omitempty\"`\n\tOrganizationSecrets                     *string `json:\"organization_secrets,omitempty\"`\n\tOrganizationSelfHostedRunners           *string `json:\"organization_self_hosted_runners,omitempty\"`\n\tOrganizationUserBlocking                *string `json:\"organization_user_blocking,omitempty\"`\n\tPackages                                *string `json:\"packages,omitempty\"`\n\tPages                                   *string `json:\"pages,omitempty\"`\n\tPlan                                    *string `json:\"plan,omitempty\"`\n\tProfile                                 *string `json:\"profile,omitempty\"`\n\tPullRequests                            *string `json:\"pull_requests,omitempty\"`\n\tRepositoryAdvisories                    *string `json:\"repository_advisories,omitempty\"`\n\tRepositoryCustomProperties              *string `json:\"repository_custom_properties,omitempty\"`\n\tRepositoryHooks                         *string `json:\"repository_hooks,omitempty\"`\n\tRepositoryProjects                      *string `json:\"repository_projects,omitempty\"`\n\tRepositoryPreReceiveHooks               *string `json:\"repository_pre_receive_hooks,omitempty\"`\n\tSecrets                                 *string `json:\"secrets,omitempty\"`\n\tSecretScanningAlerts                    *string `json:\"secret_scanning_alerts,omitempty\"`\n\tSecurityEvents                          *string `json:\"security_events,omitempty\"`\n\tSingleFile                              *string `json:\"single_file,omitempty\"`\n\tStarring                                *string `json:\"starring,omitempty\"`\n\tStatuses                                *string `json:\"statuses,omitempty\"`\n\tTeamDiscussions                         *string `json:\"team_discussions,omitempty\"`\n\tUserEvents                              *string `json:\"user_events,omitempty\"`\n\tVulnerabilityAlerts                     *string `json:\"vulnerability_alerts,omitempty\"`\n\tWatching                                *string `json:\"watching,omitempty\"`\n\tWorkflows                               *string `json:\"workflows,omitempty\"`\n}\n\n// InstallationRequest represents a pending GitHub App installation request.\ntype InstallationRequest struct {\n\tID        *int64     `json:\"id,omitempty\"`\n\tNodeID    *string    `json:\"node_id,omitempty\"`\n\tAccount   *User      `json:\"account,omitempty\"`\n\tRequester *User      `json:\"requester,omitempty\"`\n\tCreatedAt *Timestamp `json:\"created_at,omitempty\"`\n}\n\n// Installation represents a GitHub Apps installation.\ntype Installation struct {\n\tID                     *int64                   `json:\"id,omitempty\"`\n\tNodeID                 *string                  `json:\"node_id,omitempty\"`\n\tClientID               *string                  `json:\"client_id,omitempty\"`\n\tAppID                  *int64                   `json:\"app_id,omitempty\"`\n\tAppSlug                *string                  `json:\"app_slug,omitempty\"`\n\tTargetID               *int64                   `json:\"target_id,omitempty\"`\n\tAccount                *User                    `json:\"account,omitempty\"`\n\tAccessTokensURL        *string                  `json:\"access_tokens_url,omitempty\"`\n\tRepositoriesURL        *string                  `json:\"repositories_url,omitempty\"`\n\tHTMLURL                *string                  `json:\"html_url,omitempty\"`\n\tTargetType             *string                  `json:\"target_type,omitempty\"`\n\tSingleFileName         *string                  `json:\"single_file_name,omitempty\"`\n\tRepositorySelection    *string                  `json:\"repository_selection,omitempty\"`\n\tEvents                 []string                 `json:\"events,omitempty\"`\n\tSingleFilePaths        []string                 `json:\"single_file_paths,omitempty\"`\n\tPermissions            *InstallationPermissions `json:\"permissions,omitempty\"`\n\tCreatedAt              *Timestamp               `json:\"created_at,omitempty\"`\n\tUpdatedAt              *Timestamp               `json:\"updated_at,omitempty\"`\n\tHasMultipleSingleFiles *bool                    `json:\"has_multiple_single_files,omitempty\"`\n\tSuspendedBy            *User                    `json:\"suspended_by,omitempty\"`\n\tSuspendedAt            *Timestamp               `json:\"suspended_at,omitempty\"`\n}\n\n// Attachment represents a GitHub Apps attachment.\ntype Attachment struct {\n\tID    *int64  `json:\"id,omitempty\"`\n\tTitle *string `json:\"title,omitempty\"`\n\tBody  *string `json:\"body,omitempty\"`\n}\n\n// ContentReference represents a reference to a URL in an issue or pull request.\ntype ContentReference struct {\n\tID        *int64  `json:\"id,omitempty\"`\n\tNodeID    *string `json:\"node_id,omitempty\"`\n\tReference *string `json:\"reference,omitempty\"`\n}\n\nfunc (i Installation) String() string {\n\treturn Stringify(i)\n}\n\n// Get a single GitHub App. Passing the empty string will get\n// the authenticated GitHub App.\n//\n// Note: appSlug is just the URL-friendly name of your GitHub App.\n// You can find this on the settings page for your GitHub App\n// (e.g., https://github.com/settings/apps/:app_slug).\n//\n// GitHub API docs: https://docs.github.com/rest/apps/apps#get-an-app\n//\n// GitHub API docs: https://docs.github.com/rest/apps/apps#get-the-authenticated-app\n//\n//meta:operation GET /app\n//meta:operation GET /apps/{app_slug}\nfunc (s *AppsService) Get(ctx context.Context, appSlug string) (*App, *Response, error) {\n\tvar u string\n\tif appSlug != \"\" {\n\t\tu = fmt.Sprintf(\"apps/%v\", appSlug)\n\t} else {\n\t\tu = \"app\"\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar app *App\n\tresp, err := s.client.Do(ctx, req, &app)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn app, resp, nil\n}\n\n// ListInstallationRequests lists the pending installation requests that the current GitHub App has.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/apps#list-installation-requests-for-the-authenticated-app\n//\n//meta:operation GET /app/installation-requests\nfunc (s *AppsService) ListInstallationRequests(ctx context.Context, opts *ListOptions) ([]*InstallationRequest, *Response, error) {\n\tu, err := addOptions(\"app/installation-requests\", opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar i []*InstallationRequest\n\tresp, err := s.client.Do(ctx, req, &i)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn i, resp, nil\n}\n\n// ListInstallations lists the installations that the current GitHub App has.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/apps#list-installations-for-the-authenticated-app\n//\n//meta:operation GET /app/installations\nfunc (s *AppsService) ListInstallations(ctx context.Context, opts *ListOptions) ([]*Installation, *Response, error) {\n\tu, err := addOptions(\"app/installations\", opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar i []*Installation\n\tresp, err := s.client.Do(ctx, req, &i)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn i, resp, nil\n}\n\n// GetInstallation returns the specified installation.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/apps#get-an-installation-for-the-authenticated-app\n//\n//meta:operation GET /app/installations/{installation_id}\nfunc (s *AppsService) GetInstallation(ctx context.Context, id int64) (*Installation, *Response, error) {\n\treturn s.getInstallation(ctx, fmt.Sprintf(\"app/installations/%v\", id))\n}\n\n// ListUserInstallations lists installations that are accessible to the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token\n//\n//meta:operation GET /user/installations\nfunc (s *AppsService) ListUserInstallations(ctx context.Context, opts *ListOptions) ([]*Installation, *Response, error) {\n\tu, err := addOptions(\"user/installations\", opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar i struct {\n\t\tInstallations []*Installation `json:\"installations\"`\n\t}\n\tresp, err := s.client.Do(ctx, req, &i)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn i.Installations, resp, nil\n}\n\n// SuspendInstallation suspends the specified installation.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/apps#suspend-an-app-installation\n//\n//meta:operation PUT /app/installations/{installation_id}/suspended\nfunc (s *AppsService) SuspendInstallation(ctx context.Context, id int64) (*Response, error) {\n\tu := fmt.Sprintf(\"app/installations/%v/suspended\", id)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// UnsuspendInstallation unsuspends the specified installation.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/apps#unsuspend-an-app-installation\n//\n//meta:operation DELETE /app/installations/{installation_id}/suspended\nfunc (s *AppsService) UnsuspendInstallation(ctx context.Context, id int64) (*Response, error) {\n\tu := fmt.Sprintf(\"app/installations/%v/suspended\", id)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// DeleteInstallation deletes the specified installation.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/apps#delete-an-installation-for-the-authenticated-app\n//\n//meta:operation DELETE /app/installations/{installation_id}\nfunc (s *AppsService) DeleteInstallation(ctx context.Context, id int64) (*Response, error) {\n\tu := fmt.Sprintf(\"app/installations/%v\", id)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// CreateInstallationToken creates a new installation token.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app\n//\n//meta:operation POST /app/installations/{installation_id}/access_tokens\nfunc (s *AppsService) CreateInstallationToken(ctx context.Context, id int64, opts *InstallationTokenOptions) (*InstallationToken, *Response, error) {\n\tu := fmt.Sprintf(\"app/installations/%v/access_tokens\", id)\n\n\treq, err := s.client.NewRequest(\"POST\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar t *InstallationToken\n\tresp, err := s.client.Do(ctx, req, &t)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn t, resp, nil\n}\n\n// CreateInstallationTokenListRepos creates a new installation token with a list of all repositories in an installation which is not possible with CreateInstallationToken.\n//\n// It differs from CreateInstallationToken by taking InstallationTokenListRepoOptions as a parameter which does not omit RepositoryIDs if that field is nil or an empty array.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app\n//\n//meta:operation POST /app/installations/{installation_id}/access_tokens\nfunc (s *AppsService) CreateInstallationTokenListRepos(ctx context.Context, id int64, opts *InstallationTokenListRepoOptions) (*InstallationToken, *Response, error) {\n\tu := fmt.Sprintf(\"app/installations/%v/access_tokens\", id)\n\n\treq, err := s.client.NewRequest(\"POST\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar t *InstallationToken\n\tresp, err := s.client.Do(ctx, req, &t)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn t, resp, nil\n}\n\n// CreateAttachment creates a new attachment on user comment containing a url.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#create-a-content-attachment\n//\n//meta:operation POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments\nfunc (s *AppsService) CreateAttachment(ctx context.Context, contentReferenceID int64, title, body string) (*Attachment, *Response, error) {\n\tu := fmt.Sprintf(\"content_references/%v/attachments\", contentReferenceID)\n\tpayload := &Attachment{Title: Ptr(title), Body: Ptr(body)}\n\treq, err := s.client.NewRequest(\"POST\", u, payload)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeContentAttachmentsPreview)\n\n\tvar m *Attachment\n\tresp, err := s.client.Do(ctx, req, &m)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn m, resp, nil\n}\n\n// FindOrganizationInstallation finds the organization's installation information.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app\n//\n//meta:operation GET /orgs/{org}/installation\nfunc (s *AppsService) FindOrganizationInstallation(ctx context.Context, org string) (*Installation, *Response, error) {\n\treturn s.getInstallation(ctx, fmt.Sprintf(\"orgs/%v/installation\", org))\n}\n\n// FindRepositoryInstallation finds the repository's installation information.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/apps#get-a-repository-installation-for-the-authenticated-app\n//\n//meta:operation GET /repos/{owner}/{repo}/installation\nfunc (s *AppsService) FindRepositoryInstallation(ctx context.Context, owner, repo string) (*Installation, *Response, error) {\n\treturn s.getInstallation(ctx, fmt.Sprintf(\"repos/%v/%v/installation\", owner, repo))\n}\n\n// FindRepositoryInstallationByID finds the repository's installation information.\n//\n// Note: FindRepositoryInstallationByID uses the undocumented GitHub API endpoint \"GET /repositories/{repository_id}/installation\".\n//\n//meta:operation GET /repositories/{repository_id}/installation\nfunc (s *AppsService) FindRepositoryInstallationByID(ctx context.Context, id int64) (*Installation, *Response, error) {\n\treturn s.getInstallation(ctx, fmt.Sprintf(\"repositories/%v/installation\", id))\n}\n\n// FindUserInstallation finds the user's installation information.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/apps#get-a-user-installation-for-the-authenticated-app\n//\n//meta:operation GET /users/{username}/installation\nfunc (s *AppsService) FindUserInstallation(ctx context.Context, user string) (*Installation, *Response, error) {\n\treturn s.getInstallation(ctx, fmt.Sprintf(\"users/%v/installation\", user))\n}\n\nfunc (s *AppsService) getInstallation(ctx context.Context, url string) (*Installation, *Response, error) {\n\treq, err := s.client.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar i *Installation\n\tresp, err := s.client.Do(ctx, req, &i)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn i, resp, nil\n}\n"
  },
  {
    "path": "github/apps_hooks.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n)\n\n// GetHookConfig returns the webhook configuration for a GitHub App.\n// The underlying transport must be authenticated as an app.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/webhooks#get-a-webhook-configuration-for-an-app\n//\n//meta:operation GET /app/hook/config\nfunc (s *AppsService) GetHookConfig(ctx context.Context) (*HookConfig, *Response, error) {\n\treq, err := s.client.NewRequest(\"GET\", \"app/hook/config\", nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar config *HookConfig\n\tresp, err := s.client.Do(ctx, req, &config)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn config, resp, nil\n}\n\n// UpdateHookConfig updates the webhook configuration for a GitHub App.\n// The underlying transport must be authenticated as an app.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/webhooks#update-a-webhook-configuration-for-an-app\n//\n//meta:operation PATCH /app/hook/config\nfunc (s *AppsService) UpdateHookConfig(ctx context.Context, config *HookConfig) (*HookConfig, *Response, error) {\n\treq, err := s.client.NewRequest(\"PATCH\", \"app/hook/config\", config)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar c *HookConfig\n\tresp, err := s.client.Do(ctx, req, &c)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn c, resp, nil\n}\n"
  },
  {
    "path": "github/apps_hooks_deliveries.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// ListHookDeliveries lists deliveries of an App webhook.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/webhooks#list-deliveries-for-an-app-webhook\n//\n//meta:operation GET /app/hook/deliveries\nfunc (s *AppsService) ListHookDeliveries(ctx context.Context, opts *ListCursorOptions) ([]*HookDelivery, *Response, error) {\n\tu, err := addOptions(\"app/hook/deliveries\", opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tdeliveries := []*HookDelivery{}\n\tresp, err := s.client.Do(ctx, req, &deliveries)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn deliveries, resp, nil\n}\n\n// GetHookDelivery returns the App webhook delivery with the specified ID.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/webhooks#get-a-delivery-for-an-app-webhook\n//\n//meta:operation GET /app/hook/deliveries/{delivery_id}\nfunc (s *AppsService) GetHookDelivery(ctx context.Context, deliveryID int64) (*HookDelivery, *Response, error) {\n\tu := fmt.Sprintf(\"app/hook/deliveries/%v\", deliveryID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar h *HookDelivery\n\tresp, err := s.client.Do(ctx, req, &h)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn h, resp, nil\n}\n\n// RedeliverHookDelivery redelivers a delivery for an App webhook.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook\n//\n//meta:operation POST /app/hook/deliveries/{delivery_id}/attempts\nfunc (s *AppsService) RedeliverHookDelivery(ctx context.Context, deliveryID int64) (*HookDelivery, *Response, error) {\n\tu := fmt.Sprintf(\"app/hook/deliveries/%v/attempts\", deliveryID)\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar h *HookDelivery\n\tresp, err := s.client.Do(ctx, req, &h)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn h, resp, nil\n}\n"
  },
  {
    "path": "github/apps_hooks_deliveries_test.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestAppsService_ListHookDeliveries(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/app/hook/deliveries\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"cursor\": \"v1_12077215967\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}, {\"id\":2}]`)\n\t})\n\n\topts := &ListCursorOptions{Cursor: \"v1_12077215967\"}\n\n\tctx := t.Context()\n\n\tdeliveries, _, err := client.Apps.ListHookDeliveries(ctx, opts)\n\tif err != nil {\n\t\tt.Errorf(\"Apps.ListHookDeliveries returned error: %v\", err)\n\t}\n\n\twant := []*HookDelivery{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}}\n\tif d := cmp.Diff(deliveries, want); d != \"\" {\n\t\tt.Errorf(\"Apps.ListHooks want (-), got (+):\\n%v\", d)\n\t}\n\n\tconst methodName = \"ListHookDeliveries\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Apps.ListHookDeliveries(ctx, opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestAppsService_GetHookDelivery(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/app/hook/deliveries/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\thook, _, err := client.Apps.GetHookDelivery(ctx, 1)\n\tif err != nil {\n\t\tt.Errorf(\"Apps.GetHookDelivery returned error: %v\", err)\n\t}\n\n\twant := &HookDelivery{ID: Ptr(int64(1))}\n\tif !cmp.Equal(hook, want) {\n\t\tt.Errorf(\"Apps.GetHookDelivery returned %+v, want %+v\", hook, want)\n\t}\n\n\tconst methodName = \"GetHookDelivery\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Apps.GetHookDelivery(ctx, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Apps.GetHookDelivery(ctx, 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestAppsService_RedeliverHookDelivery(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/app/hook/deliveries/1/attempts\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\thook, _, err := client.Apps.RedeliverHookDelivery(ctx, 1)\n\tif err != nil {\n\t\tt.Errorf(\"Apps.RedeliverHookDelivery returned error: %v\", err)\n\t}\n\n\twant := &HookDelivery{ID: Ptr(int64(1))}\n\tif !cmp.Equal(hook, want) {\n\t\tt.Errorf(\"Apps.RedeliverHookDelivery returned %+v, want %+v\", hook, want)\n\t}\n\n\tconst methodName = \"RedeliverHookDelivery\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Apps.RedeliverHookDelivery(ctx, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Apps.RedeliverHookDelivery(ctx, 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/apps_hooks_test.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestAppsService_GetHookConfig(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/app/hook/config\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"content_type\": \"json\",\n\t\t\t\"insecure_ssl\": \"0\",\n\t\t\t\"secret\": \"********\",\n\t\t\t\"url\": \"https://example.com/webhook\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tconfig, _, err := client.Apps.GetHookConfig(ctx)\n\tif err != nil {\n\t\tt.Errorf(\"Apps.GetHookConfig returned error: %v\", err)\n\t}\n\n\twant := &HookConfig{\n\t\tContentType: Ptr(\"json\"),\n\t\tInsecureSSL: Ptr(\"0\"),\n\t\tSecret:      Ptr(\"********\"),\n\t\tURL:         Ptr(\"https://example.com/webhook\"),\n\t}\n\tif !cmp.Equal(config, want) {\n\t\tt.Errorf(\"Apps.GetHookConfig returned %+v, want %+v\", config, want)\n\t}\n\n\tconst methodName = \"GetHookConfig\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Apps.GetHookConfig(ctx)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestAppsService_UpdateHookConfig(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &HookConfig{\n\t\tContentType: Ptr(\"json\"),\n\t\tInsecureSSL: Ptr(\"1\"),\n\t\tSecret:      Ptr(\"s\"),\n\t\tURL:         Ptr(\"u\"),\n\t}\n\n\tmux.HandleFunc(\"/app/hook/config\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\ttestBody(t, r, `{\"content_type\":\"json\",\"insecure_ssl\":\"1\",\"url\":\"u\",\"secret\":\"s\"}`+\"\\n\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"content_type\": \"json\",\n\t\t\t\"insecure_ssl\": \"1\",\n\t\t\t\"secret\": \"********\",\n\t\t\t\"url\": \"u\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tconfig, _, err := client.Apps.UpdateHookConfig(ctx, input)\n\tif err != nil {\n\t\tt.Errorf(\"Apps.UpdateHookConfig returned error: %v\", err)\n\t}\n\n\twant := &HookConfig{\n\t\tContentType: Ptr(\"json\"),\n\t\tInsecureSSL: Ptr(\"1\"),\n\t\tSecret:      Ptr(\"********\"),\n\t\tURL:         Ptr(\"u\"),\n\t}\n\tif !cmp.Equal(config, want) {\n\t\tt.Errorf(\"Apps.UpdateHookConfig returned %+v, want %+v\", config, want)\n\t}\n\n\tconst methodName = \"UpdateHookConfig\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Apps.UpdateHookConfig(ctx, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/apps_installation.go",
    "content": "// Copyright 2016 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// ListRepositories represents the response from the list repos endpoints.\ntype ListRepositories struct {\n\tTotalCount   *int          `json:\"total_count,omitempty\"`\n\tRepositories []*Repository `json:\"repositories\"`\n}\n\n// ListRepos lists the repositories that are accessible to the authenticated installation.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-app-installation\n//\n//meta:operation GET /installation/repositories\nfunc (s *AppsService) ListRepos(ctx context.Context, opts *ListOptions) (*ListRepositories, *Response, error) {\n\tu, err := addOptions(\"installation/repositories\", opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar r *ListRepositories\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}\n\n// ListUserRepos lists repositories that are accessible\n// to the authenticated user for an installation.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-user-access-token\n//\n//meta:operation GET /user/installations/{installation_id}/repositories\nfunc (s *AppsService) ListUserRepos(ctx context.Context, id int64, opts *ListOptions) (*ListRepositories, *Response, error) {\n\tu := fmt.Sprintf(\"user/installations/%v/repositories\", id)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar r *ListRepositories\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}\n\n// AddRepository adds a single repository to an installation.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/installations#add-a-repository-to-an-app-installation\n//\n//meta:operation PUT /user/installations/{installation_id}/repositories/{repository_id}\nfunc (s *AppsService) AddRepository(ctx context.Context, instID, repoID int64) (*Repository, *Response, error) {\n\tu := fmt.Sprintf(\"user/installations/%v/repositories/%v\", instID, repoID)\n\treq, err := s.client.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar r *Repository\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}\n\n// RemoveRepository removes a single repository from an installation.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/installations#remove-a-repository-from-an-app-installation\n//\n//meta:operation DELETE /user/installations/{installation_id}/repositories/{repository_id}\nfunc (s *AppsService) RemoveRepository(ctx context.Context, instID, repoID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"user/installations/%v/repositories/%v\", instID, repoID)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// RevokeInstallationToken revokes an installation token.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/installations#revoke-an-installation-access-token\n//\n//meta:operation DELETE /installation/token\nfunc (s *AppsService) RevokeInstallationToken(ctx context.Context) (*Response, error) {\n\tu := \"installation/token\"\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/apps_installation_test.go",
    "content": "// Copyright 2016 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestAppsService_ListRepos(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/installation/repositories\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\":     \"1\",\n\t\t\t\"per_page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `{\"total_count\": 1,\"repositories\": [{\"id\": 1}]}`)\n\t})\n\n\topt := &ListOptions{Page: 1, PerPage: 2}\n\tctx := t.Context()\n\trepositories, _, err := client.Apps.ListRepos(ctx, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Apps.ListRepos returned error: %v\", err)\n\t}\n\n\twant := &ListRepositories{TotalCount: Ptr(1), Repositories: []*Repository{{ID: Ptr(int64(1))}}}\n\tif !cmp.Equal(repositories, want) {\n\t\tt.Errorf(\"Apps.ListRepos returned %+v, want %+v\", repositories, want)\n\t}\n\n\tconst methodName = \"ListRepos\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Apps.ListRepos(ctx, nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestAppsService_ListUserRepos(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/installations/1/repositories\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\":     \"1\",\n\t\t\t\"per_page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `{\"total_count\":1,\"repositories\": [{\"id\":1}]}`)\n\t})\n\n\topt := &ListOptions{Page: 1, PerPage: 2}\n\tctx := t.Context()\n\trepositories, _, err := client.Apps.ListUserRepos(ctx, 1, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Apps.ListUserRepos returned error: %v\", err)\n\t}\n\n\twant := &ListRepositories{TotalCount: Ptr(1), Repositories: []*Repository{{ID: Ptr(int64(1))}}}\n\tif !cmp.Equal(repositories, want) {\n\t\tt.Errorf(\"Apps.ListUserRepos returned %+v, want %+v\", repositories, want)\n\t}\n\n\tconst methodName = \"ListUserRepos\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Apps.ListUserRepos(ctx, -1, &ListOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Apps.ListUserRepos(ctx, 1, nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestAppsService_AddRepository(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/installations/1/repositories/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tfmt.Fprint(w, `{\"id\":1,\"name\":\"n\",\"description\":\"d\",\"owner\":{\"login\":\"l\"},\"license\":{\"key\":\"mit\"}}`)\n\t})\n\n\tctx := t.Context()\n\trepo, _, err := client.Apps.AddRepository(ctx, 1, 1)\n\tif err != nil {\n\t\tt.Errorf(\"Apps.AddRepository returned error: %v\", err)\n\t}\n\n\twant := &Repository{ID: Ptr(int64(1)), Name: Ptr(\"n\"), Description: Ptr(\"d\"), Owner: &User{Login: Ptr(\"l\")}, License: &License{Key: Ptr(\"mit\")}}\n\tif !cmp.Equal(repo, want) {\n\t\tt.Errorf(\"AddRepository returned %+v, want %+v\", repo, want)\n\t}\n\n\tconst methodName = \"AddRepository\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Apps.AddRepository(ctx, 1, 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestAppsService_RemoveRepository(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/installations/1/repositories/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Apps.RemoveRepository(ctx, 1, 1)\n\tif err != nil {\n\t\tt.Errorf(\"Apps.RemoveRepository returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveRepository\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Apps.RemoveRepository(ctx, 1, 1)\n\t})\n}\n\nfunc TestAppsService_RevokeInstallationToken(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/installation/token\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Apps.RevokeInstallationToken(ctx)\n\tif err != nil {\n\t\tt.Errorf(\"Apps.RevokeInstallationToken returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RevokeInstallationToken\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Apps.RevokeInstallationToken(ctx)\n\t})\n}\n\nfunc TestListRepositories_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ListRepositories{}, `{\"repositories\": null}`)\n\n\tu := &ListRepositories{\n\t\tTotalCount: Ptr(1),\n\t\tRepositories: []*Repository{\n\t\t\t{\n\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\tURL:  Ptr(\"u\"),\n\t\t\t\tName: Ptr(\"n\"),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"total_count\": 1,\n\t\t\"repositories\": [{\n\t\t\t\"id\":1,\n\t\t\t\"name\":\"n\",\n\t\t\t\"url\":\"u\"\n\t\t\t}]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/apps_manifest.go",
    "content": "// Copyright 2019 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// AppConfig describes the configuration of a GitHub App.\ntype AppConfig struct {\n\tID            *int64     `json:\"id,omitempty\"`\n\tSlug          *string    `json:\"slug,omitempty\"`\n\tNodeID        *string    `json:\"node_id,omitempty\"`\n\tOwner         *User      `json:\"owner,omitempty\"`\n\tName          *string    `json:\"name,omitempty\"`\n\tDescription   *string    `json:\"description,omitempty\"`\n\tExternalURL   *string    `json:\"external_url,omitempty\"`\n\tHTMLURL       *string    `json:\"html_url,omitempty\"`\n\tCreatedAt     *Timestamp `json:\"created_at,omitempty\"`\n\tUpdatedAt     *Timestamp `json:\"updated_at,omitempty\"`\n\tClientID      *string    `json:\"client_id,omitempty\"`\n\tClientSecret  *string    `json:\"client_secret,omitempty\"`\n\tWebhookSecret *string    `json:\"webhook_secret,omitempty\"`\n\tPEM           *string    `json:\"pem,omitempty\"`\n}\n\n// CompleteAppManifest completes the App manifest handshake flow for the given\n// code.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/apps#create-a-github-app-from-a-manifest\n//\n//meta:operation POST /app-manifests/{code}/conversions\nfunc (s *AppsService) CompleteAppManifest(ctx context.Context, code string) (*AppConfig, *Response, error) {\n\tu := fmt.Sprintf(\"app-manifests/%v/conversions\", code)\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar cfg *AppConfig\n\tresp, err := s.client.Do(ctx, req, &cfg)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn cfg, resp, nil\n}\n"
  },
  {
    "path": "github/apps_manifest_test.go",
    "content": "// Copyright 2019 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nconst (\n\tmanifestJSON = `{\n\t\"id\": 1,\n  \"client_id\": \"a\" ,\n  \"client_secret\": \"b\",\n  \"webhook_secret\": \"c\",\n  \"pem\": \"key\"\n}\n`\n)\n\nfunc TestGetConfig(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/app-manifests/code/conversions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, manifestJSON)\n\t})\n\n\tctx := t.Context()\n\tcfg, _, err := client.Apps.CompleteAppManifest(ctx, \"code\")\n\tif err != nil {\n\t\tt.Errorf(\"AppManifest.GetConfig returned error: %v\", err)\n\t}\n\n\twant := &AppConfig{\n\t\tID:            Ptr(int64(1)),\n\t\tClientID:      Ptr(\"a\"),\n\t\tClientSecret:  Ptr(\"b\"),\n\t\tWebhookSecret: Ptr(\"c\"),\n\t\tPEM:           Ptr(\"key\"),\n\t}\n\n\tif !cmp.Equal(cfg, want) {\n\t\tt.Errorf(\"GetConfig returned %+v, want %+v\", cfg, want)\n\t}\n\n\tconst methodName = \"CompleteAppManifest\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Apps.CompleteAppManifest(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Apps.CompleteAppManifest(ctx, \"code\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestAppConfig_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &AppConfig{}, \"{}\")\n\n\tu := &AppConfig{\n\t\tID:     Ptr(int64(1)),\n\t\tSlug:   Ptr(\"s\"),\n\t\tNodeID: Ptr(\"nid\"),\n\t\tOwner: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t\tName:          Ptr(\"n\"),\n\t\tDescription:   Ptr(\"d\"),\n\t\tExternalURL:   Ptr(\"eu\"),\n\t\tHTMLURL:       Ptr(\"hu\"),\n\t\tCreatedAt:     &Timestamp{referenceTime},\n\t\tUpdatedAt:     &Timestamp{referenceTime},\n\t\tClientID:      Ptr(\"ci\"),\n\t\tClientSecret:  Ptr(\"cs\"),\n\t\tWebhookSecret: Ptr(\"ws\"),\n\t\tPEM:           Ptr(\"pem\"),\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"slug\": \"s\",\n\t\t\"node_id\": \"nid\",\n\t\t\"owner\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"name\": \"n\",\n\t\t\"description\": \"d\",\n\t\t\"external_url\": \"eu\",\n\t\t\"html_url\": \"hu\",\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"client_id\": \"ci\",\n\t\t\"client_secret\": \"cs\",\n\t\t\"webhook_secret\": \"ws\",\n\t\t\"pem\": \"pem\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/apps_marketplace.go",
    "content": "// Copyright 2017 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// MarketplaceService handles communication with the marketplace related\n// methods of the GitHub API.\n//\n// GitHub API docs: https://docs.github.com/rest/apps#marketplace\ntype MarketplaceService struct {\n\tclient *Client\n\t// Stubbed controls whether endpoints that return stubbed data are used\n\t// instead of production endpoints. Stubbed data is fake data that's useful\n\t// for testing your GitHub Apps. Stubbed data is hard-coded and will not\n\t// change based on actual subscriptions.\n\t//\n\t// GitHub API docs: https://docs.github.com/rest/apps#testing-with-stubbed-endpoints\n\tStubbed bool\n}\n\n// MarketplacePlan represents a GitHub Apps Marketplace Listing Plan.\ntype MarketplacePlan struct {\n\tURL                 *string `json:\"url,omitempty\"`\n\tAccountsURL         *string `json:\"accounts_url,omitempty\"`\n\tID                  *int64  `json:\"id,omitempty\"`\n\tNumber              *int    `json:\"number,omitempty\"`\n\tName                *string `json:\"name,omitempty\"`\n\tDescription         *string `json:\"description,omitempty\"`\n\tMonthlyPriceInCents *int    `json:\"monthly_price_in_cents,omitempty\"`\n\tYearlyPriceInCents  *int    `json:\"yearly_price_in_cents,omitempty\"`\n\t// The pricing model for this listing.  Can be one of \"flat-rate\", \"per-unit\", or \"free\".\n\tPriceModel *string   `json:\"price_model,omitempty\"`\n\tUnitName   *string   `json:\"unit_name,omitempty\"`\n\tBullets    *[]string `json:\"bullets,omitempty\"`\n\t// State can be one of the values \"draft\" or \"published\".\n\tState        *string `json:\"state,omitempty\"`\n\tHasFreeTrial *bool   `json:\"has_free_trial,omitempty\"`\n}\n\n// MarketplacePurchase represents a GitHub Apps Marketplace Purchase.\ntype MarketplacePurchase struct {\n\tAccount *MarketplacePurchaseAccount `json:\"account,omitempty\"`\n\t// BillingCycle can be one of the values \"yearly\", \"monthly\" or nil.\n\tBillingCycle    *string          `json:\"billing_cycle,omitempty\"`\n\tNextBillingDate *Timestamp       `json:\"next_billing_date,omitempty\"`\n\tUnitCount       *int             `json:\"unit_count,omitempty\"`\n\tPlan            *MarketplacePlan `json:\"plan,omitempty\"`\n\tOnFreeTrial     *bool            `json:\"on_free_trial,omitempty\"`\n\tFreeTrialEndsOn *Timestamp       `json:\"free_trial_ends_on,omitempty\"`\n\tUpdatedAt       *Timestamp       `json:\"updated_at,omitempty\"`\n}\n\n// MarketplacePendingChange represents a pending change to a GitHub Apps Marketplace Plan.\ntype MarketplacePendingChange struct {\n\tEffectiveDate *Timestamp       `json:\"effective_date,omitempty\"`\n\tUnitCount     *int             `json:\"unit_count,omitempty\"`\n\tID            *int64           `json:\"id,omitempty\"`\n\tPlan          *MarketplacePlan `json:\"plan,omitempty\"`\n}\n\n// MarketplacePlanAccount represents a GitHub Account (user or organization) on a specific plan.\ntype MarketplacePlanAccount struct {\n\tURL                      *string                   `json:\"url,omitempty\"`\n\tType                     *string                   `json:\"type,omitempty\"`\n\tID                       *int64                    `json:\"id,omitempty\"`\n\tLogin                    *string                   `json:\"login,omitempty\"`\n\tOrganizationBillingEmail *string                   `json:\"organization_billing_email,omitempty\"`\n\tMarketplacePurchase      *MarketplacePurchase      `json:\"marketplace_purchase,omitempty\"`\n\tMarketplacePendingChange *MarketplacePendingChange `json:\"marketplace_pending_change,omitempty\"`\n}\n\n// MarketplacePurchaseAccount represents a GitHub Account (user or organization) for a Purchase.\ntype MarketplacePurchaseAccount struct {\n\tURL                      *string `json:\"url,omitempty\"`\n\tType                     *string `json:\"type,omitempty\"`\n\tID                       *int64  `json:\"id,omitempty\"`\n\tLogin                    *string `json:\"login,omitempty\"`\n\tOrganizationBillingEmail *string `json:\"organization_billing_email,omitempty\"`\n\tEmail                    *string `json:\"email,omitempty\"`\n\tNodeID                   *string `json:\"node_id,omitempty\"`\n}\n\n// ListPlans lists all plans for your Marketplace listing.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-plans\n//\n// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-plans-stubbed\n//\n//meta:operation GET /marketplace_listing/plans\n//meta:operation GET /marketplace_listing/stubbed/plans\nfunc (s *MarketplaceService) ListPlans(ctx context.Context, opts *ListOptions) ([]*MarketplacePlan, *Response, error) {\n\turi := s.marketplaceURI(\"plans\")\n\tu, err := addOptions(uri, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar plans []*MarketplacePlan\n\tresp, err := s.client.Do(ctx, req, &plans)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn plans, resp, nil\n}\n\n// ListPlanAccountsForPlan lists all GitHub accounts (user or organization) on a specific plan.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan\n//\n// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan-stubbed\n//\n//meta:operation GET /marketplace_listing/plans/{plan_id}/accounts\n//meta:operation GET /marketplace_listing/stubbed/plans/{plan_id}/accounts\nfunc (s *MarketplaceService) ListPlanAccountsForPlan(ctx context.Context, planID int64, opts *ListOptions) ([]*MarketplacePlanAccount, *Response, error) {\n\turi := s.marketplaceURI(fmt.Sprintf(\"plans/%v/accounts\", planID))\n\tu, err := addOptions(uri, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar accounts []*MarketplacePlanAccount\n\tresp, err := s.client.Do(ctx, req, &accounts)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn accounts, resp, nil\n}\n\n// GetPlanAccountForAccount get GitHub account (user or organization) associated with an account.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account\n//\n// GitHub API docs: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account-stubbed\n//\n//meta:operation GET /marketplace_listing/accounts/{account_id}\n//meta:operation GET /marketplace_listing/stubbed/accounts/{account_id}\nfunc (s *MarketplaceService) GetPlanAccountForAccount(ctx context.Context, accountID int64) (*MarketplacePlanAccount, *Response, error) {\n\turi := s.marketplaceURI(fmt.Sprintf(\"accounts/%v\", accountID))\n\n\treq, err := s.client.NewRequest(\"GET\", uri, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar account *MarketplacePlanAccount\n\tresp, err := s.client.Do(ctx, req, &account)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn account, resp, nil\n}\n\n// ListMarketplacePurchasesForUser lists all GitHub marketplace purchases made by a user.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user\n//\n// GitHub API docs: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user-stubbed\n//\n//meta:operation GET /user/marketplace_purchases\n//meta:operation GET /user/marketplace_purchases/stubbed\nfunc (s *MarketplaceService) ListMarketplacePurchasesForUser(ctx context.Context, opts *ListOptions) ([]*MarketplacePurchase, *Response, error) {\n\turi := \"user/marketplace_purchases\"\n\tif s.Stubbed {\n\t\turi = \"user/marketplace_purchases/stubbed\"\n\t}\n\n\tu, err := addOptions(uri, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar purchases []*MarketplacePurchase\n\tresp, err := s.client.Do(ctx, req, &purchases)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn purchases, resp, nil\n}\n\nfunc (s *MarketplaceService) marketplaceURI(endpoint string) string {\n\turl := \"marketplace_listing\"\n\tif s.Stubbed {\n\t\turl = \"marketplace_listing/stubbed\"\n\t}\n\treturn url + \"/\" + endpoint\n}\n"
  },
  {
    "path": "github/apps_marketplace_test.go",
    "content": "// Copyright 2017 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestMarketplaceService_ListPlans(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/marketplace_listing/plans\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\":     \"1\",\n\t\t\t\"per_page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &ListOptions{Page: 1, PerPage: 2}\n\tclient.Marketplace.Stubbed = false\n\tctx := t.Context()\n\tplans, _, err := client.Marketplace.ListPlans(ctx, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Marketplace.ListPlans returned error: %v\", err)\n\t}\n\n\twant := []*MarketplacePlan{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(plans, want) {\n\t\tt.Errorf(\"Marketplace.ListPlans returned %+v, want %+v\", plans, want)\n\t}\n\n\tconst methodName = \"ListPlans\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Marketplace.ListPlans(ctx, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestMarketplaceService_Stubbed_ListPlans(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/marketplace_listing/stubbed/plans\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &ListOptions{Page: 1, PerPage: 2}\n\tclient.Marketplace.Stubbed = true\n\tctx := t.Context()\n\tplans, _, err := client.Marketplace.ListPlans(ctx, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Marketplace.ListPlans (Stubbed) returned error: %v\", err)\n\t}\n\n\twant := []*MarketplacePlan{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(plans, want) {\n\t\tt.Errorf(\"Marketplace.ListPlans (Stubbed) returned %+v, want %+v\", plans, want)\n\t}\n}\n\nfunc TestMarketplaceService_ListPlanAccountsForPlan(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/marketplace_listing/plans/1/accounts\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &ListOptions{Page: 1, PerPage: 2}\n\tclient.Marketplace.Stubbed = false\n\tctx := t.Context()\n\taccounts, _, err := client.Marketplace.ListPlanAccountsForPlan(ctx, 1, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Marketplace.ListPlanAccountsForPlan returned error: %v\", err)\n\t}\n\n\twant := []*MarketplacePlanAccount{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(accounts, want) {\n\t\tt.Errorf(\"Marketplace.ListPlanAccountsForPlan returned %+v, want %+v\", accounts, want)\n\t}\n\n\tconst methodName = \"ListPlanAccountsForPlan\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Marketplace.ListPlanAccountsForPlan(ctx, 1, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestMarketplaceService_Stubbed_ListPlanAccountsForPlan(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/marketplace_listing/stubbed/plans/1/accounts\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &ListOptions{Page: 1, PerPage: 2}\n\tclient.Marketplace.Stubbed = true\n\tctx := t.Context()\n\taccounts, _, err := client.Marketplace.ListPlanAccountsForPlan(ctx, 1, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Marketplace.ListPlanAccountsForPlan (Stubbed) returned error: %v\", err)\n\t}\n\n\twant := []*MarketplacePlanAccount{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(accounts, want) {\n\t\tt.Errorf(\"Marketplace.ListPlanAccountsForPlan (Stubbed) returned %+v, want %+v\", accounts, want)\n\t}\n}\n\nfunc TestMarketplaceService_GetPlanAccountForAccount(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/marketplace_listing/accounts/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1, \"marketplace_pending_change\": {\"id\": 77}}`)\n\t})\n\n\tclient.Marketplace.Stubbed = false\n\tctx := t.Context()\n\taccount, _, err := client.Marketplace.GetPlanAccountForAccount(ctx, 1)\n\tif err != nil {\n\t\tt.Errorf(\"Marketplace.GetPlanAccountForAccount returned error: %v\", err)\n\t}\n\n\twant := &MarketplacePlanAccount{ID: Ptr(int64(1)), MarketplacePendingChange: &MarketplacePendingChange{ID: Ptr(int64(77))}}\n\tif !cmp.Equal(account, want) {\n\t\tt.Errorf(\"Marketplace.GetPlanAccountForAccount returned %+v, want %+v\", account, want)\n\t}\n\n\tconst methodName = \"GetPlanAccountForAccount\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Marketplace.GetPlanAccountForAccount(ctx, 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestMarketplaceService_Stubbed_GetPlanAccountForAccount(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/marketplace_listing/stubbed/accounts/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tclient.Marketplace.Stubbed = true\n\tctx := t.Context()\n\taccount, _, err := client.Marketplace.GetPlanAccountForAccount(ctx, 1)\n\tif err != nil {\n\t\tt.Errorf(\"Marketplace.GetPlanAccountForAccount (Stubbed) returned error: %v\", err)\n\t}\n\n\twant := &MarketplacePlanAccount{ID: Ptr(int64(1))}\n\tif !cmp.Equal(account, want) {\n\t\tt.Errorf(\"Marketplace.GetPlanAccountForAccount (Stubbed) returned %+v, want %+v\", account, want)\n\t}\n}\n\nfunc TestMarketplaceService_ListMarketplacePurchasesForUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/marketplace_purchases\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"billing_cycle\":\"monthly\"}]`)\n\t})\n\n\topt := &ListOptions{Page: 1, PerPage: 2}\n\tclient.Marketplace.Stubbed = false\n\tctx := t.Context()\n\tpurchases, _, err := client.Marketplace.ListMarketplacePurchasesForUser(ctx, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Marketplace.ListMarketplacePurchasesForUser returned error: %v\", err)\n\t}\n\n\twant := []*MarketplacePurchase{{BillingCycle: Ptr(\"monthly\")}}\n\tif !cmp.Equal(purchases, want) {\n\t\tt.Errorf(\"Marketplace.ListMarketplacePurchasesForUser returned %+v, want %+v\", purchases, want)\n\t}\n\n\tconst methodName = \"ListMarketplacePurchasesForUser\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Marketplace.ListMarketplacePurchasesForUser(ctx, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestMarketplaceService_Stubbed_ListMarketplacePurchasesForUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/marketplace_purchases/stubbed\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"billing_cycle\":\"monthly\"}]`)\n\t})\n\n\topt := &ListOptions{Page: 1, PerPage: 2}\n\tclient.Marketplace.Stubbed = true\n\tctx := t.Context()\n\tpurchases, _, err := client.Marketplace.ListMarketplacePurchasesForUser(ctx, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Marketplace.ListMarketplacePurchasesForUser returned error: %v\", err)\n\t}\n\n\twant := []*MarketplacePurchase{{BillingCycle: Ptr(\"monthly\")}}\n\tif !cmp.Equal(purchases, want) {\n\t\tt.Errorf(\"Marketplace.ListMarketplacePurchasesForUser returned %+v, want %+v\", purchases, want)\n\t}\n}\n\nfunc TestMarketplacePlan_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &MarketplacePlan{}, \"{}\")\n\n\tu := &MarketplacePlan{\n\t\tURL:                 Ptr(\"u\"),\n\t\tAccountsURL:         Ptr(\"au\"),\n\t\tID:                  Ptr(int64(1)),\n\t\tNumber:              Ptr(1),\n\t\tName:                Ptr(\"n\"),\n\t\tDescription:         Ptr(\"d\"),\n\t\tMonthlyPriceInCents: Ptr(1),\n\t\tYearlyPriceInCents:  Ptr(1),\n\t\tPriceModel:          Ptr(\"pm\"),\n\t\tUnitName:            Ptr(\"un\"),\n\t\tBullets:             &[]string{\"b\"},\n\t\tState:               Ptr(\"s\"),\n\t\tHasFreeTrial:        Ptr(false),\n\t}\n\n\twant := `{\n\t\t\"url\": \"u\",\n\t\t\"accounts_url\": \"au\",\n\t\t\"id\": 1,\n\t\t\"number\": 1,\n\t\t\"name\": \"n\",\n\t\t\"description\": \"d\",\n\t\t\"monthly_price_in_cents\": 1,\n\t\t\"yearly_price_in_cents\": 1,\n\t\t\"price_model\": \"pm\",\n\t\t\"unit_name\": \"un\",\n\t\t\"bullets\": [\"b\"],\n\t\t\"state\": \"s\",\n\t\t\"has_free_trial\": false\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestMarketplacePurchase_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &MarketplacePurchase{}, \"{}\")\n\n\tu := &MarketplacePurchase{\n\t\tBillingCycle:    Ptr(\"bc\"),\n\t\tNextBillingDate: &Timestamp{referenceTime},\n\t\tUnitCount:       Ptr(1),\n\t\tPlan: &MarketplacePlan{\n\t\t\tURL:                 Ptr(\"u\"),\n\t\t\tAccountsURL:         Ptr(\"au\"),\n\t\t\tID:                  Ptr(int64(1)),\n\t\t\tNumber:              Ptr(1),\n\t\t\tName:                Ptr(\"n\"),\n\t\t\tDescription:         Ptr(\"d\"),\n\t\t\tMonthlyPriceInCents: Ptr(1),\n\t\t\tYearlyPriceInCents:  Ptr(1),\n\t\t\tPriceModel:          Ptr(\"pm\"),\n\t\t\tUnitName:            Ptr(\"un\"),\n\t\t\tBullets:             &[]string{\"b\"},\n\t\t\tState:               Ptr(\"s\"),\n\t\t\tHasFreeTrial:        Ptr(false),\n\t\t},\n\t\tOnFreeTrial:     Ptr(false),\n\t\tFreeTrialEndsOn: &Timestamp{referenceTime},\n\t\tUpdatedAt:       &Timestamp{referenceTime},\n\t}\n\n\twant := `{\n\t\t\"billing_cycle\": \"bc\",\n\t\t\"next_billing_date\": ` + referenceTimeStr + `,\n\t\t\"unit_count\": 1,\n\t\t\"plan\": {\n\t\t\t\"url\": \"u\",\n\t\t\t\"accounts_url\": \"au\",\n\t\t\t\"id\": 1,\n\t\t\t\"number\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"monthly_price_in_cents\": 1,\n\t\t\t\"yearly_price_in_cents\": 1,\n\t\t\t\"price_model\": \"pm\",\n\t\t\t\"unit_name\": \"un\",\n\t\t\t\"bullets\": [\"b\"],\n\t\t\t\"state\": \"s\",\n\t\t\t\"has_free_trial\": false\n\t\t\t},\n\t\t\"on_free_trial\": false,\n\t\t\"free_trial_ends_on\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestMarketplacePendingChange_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &MarketplacePendingChange{}, \"{}\")\n\n\tu := &MarketplacePendingChange{\n\t\tEffectiveDate: &Timestamp{referenceTime},\n\t\tUnitCount:     Ptr(1),\n\t\tID:            Ptr(int64(1)),\n\t\tPlan: &MarketplacePlan{\n\t\t\tURL:                 Ptr(\"u\"),\n\t\t\tAccountsURL:         Ptr(\"au\"),\n\t\t\tID:                  Ptr(int64(1)),\n\t\t\tNumber:              Ptr(1),\n\t\t\tName:                Ptr(\"n\"),\n\t\t\tDescription:         Ptr(\"d\"),\n\t\t\tMonthlyPriceInCents: Ptr(1),\n\t\t\tYearlyPriceInCents:  Ptr(1),\n\t\t\tPriceModel:          Ptr(\"pm\"),\n\t\t\tUnitName:            Ptr(\"un\"),\n\t\t\tBullets:             &[]string{\"b\"},\n\t\t\tState:               Ptr(\"s\"),\n\t\t\tHasFreeTrial:        Ptr(false),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"effective_date\": ` + referenceTimeStr + `,\n\t\t\"unit_count\": 1,\n\t\t\"id\": 1,\n\t\t\"plan\": {\n\t\t\t\"url\": \"u\",\n\t\t\t\"accounts_url\": \"au\",\n\t\t\t\"id\": 1,\n\t\t\t\"number\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"monthly_price_in_cents\": 1,\n\t\t\t\"yearly_price_in_cents\": 1,\n\t\t\t\"price_model\": \"pm\",\n\t\t\t\"unit_name\": \"un\",\n\t\t\t\"bullets\": [\"b\"],\n\t\t\t\"state\": \"s\",\n\t\t\t\"has_free_trial\": false\n\t\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestMarketplacePlanAccount_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &MarketplacePlanAccount{}, \"{}\")\n\n\tu := &MarketplacePlanAccount{\n\t\tURL:                      Ptr(\"u\"),\n\t\tType:                     Ptr(\"t\"),\n\t\tID:                       Ptr(int64(1)),\n\t\tLogin:                    Ptr(\"l\"),\n\t\tOrganizationBillingEmail: Ptr(\"obe\"),\n\t\tMarketplacePurchase: &MarketplacePurchase{\n\t\t\tBillingCycle:    Ptr(\"bc\"),\n\t\t\tNextBillingDate: &Timestamp{referenceTime},\n\t\t\tUnitCount:       Ptr(1),\n\t\t\tPlan: &MarketplacePlan{\n\t\t\t\tURL:                 Ptr(\"u\"),\n\t\t\t\tAccountsURL:         Ptr(\"au\"),\n\t\t\t\tID:                  Ptr(int64(1)),\n\t\t\t\tNumber:              Ptr(1),\n\t\t\t\tName:                Ptr(\"n\"),\n\t\t\t\tDescription:         Ptr(\"d\"),\n\t\t\t\tMonthlyPriceInCents: Ptr(1),\n\t\t\t\tYearlyPriceInCents:  Ptr(1),\n\t\t\t\tPriceModel:          Ptr(\"pm\"),\n\t\t\t\tUnitName:            Ptr(\"un\"),\n\t\t\t\tBullets:             &[]string{\"b\"},\n\t\t\t\tState:               Ptr(\"s\"),\n\t\t\t\tHasFreeTrial:        Ptr(false),\n\t\t\t},\n\t\t\tOnFreeTrial:     Ptr(false),\n\t\t\tFreeTrialEndsOn: &Timestamp{referenceTime},\n\t\t\tUpdatedAt:       &Timestamp{referenceTime},\n\t\t},\n\t\tMarketplacePendingChange: &MarketplacePendingChange{\n\t\t\tEffectiveDate: &Timestamp{referenceTime},\n\t\t\tUnitCount:     Ptr(1),\n\t\t\tID:            Ptr(int64(1)),\n\t\t\tPlan: &MarketplacePlan{\n\t\t\t\tURL:                 Ptr(\"u\"),\n\t\t\t\tAccountsURL:         Ptr(\"au\"),\n\t\t\t\tID:                  Ptr(int64(1)),\n\t\t\t\tNumber:              Ptr(1),\n\t\t\t\tName:                Ptr(\"n\"),\n\t\t\t\tDescription:         Ptr(\"d\"),\n\t\t\t\tMonthlyPriceInCents: Ptr(1),\n\t\t\t\tYearlyPriceInCents:  Ptr(1),\n\t\t\t\tPriceModel:          Ptr(\"pm\"),\n\t\t\t\tUnitName:            Ptr(\"un\"),\n\t\t\t\tBullets:             &[]string{\"b\"},\n\t\t\t\tState:               Ptr(\"s\"),\n\t\t\t\tHasFreeTrial:        Ptr(false),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"url\": \"u\",\n\t\t\"type\": \"t\",\n\t\t\"id\": 1,\n\t\t\"login\": \"l\",\n\t\t\"organization_billing_email\": \"obe\",\n\t\t\"marketplace_purchase\": {\n\t\t\t\"billing_cycle\": \"bc\",\n\t\t\t\"next_billing_date\": ` + referenceTimeStr + `,\n\t\t\t\"unit_count\": 1,\n\t\t\t\"plan\": {\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"accounts_url\": \"au\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"number\": 1,\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"description\": \"d\",\n\t\t\t\t\"monthly_price_in_cents\": 1,\n\t\t\t\t\"yearly_price_in_cents\": 1,\n\t\t\t\t\"price_model\": \"pm\",\n\t\t\t\t\"unit_name\": \"un\",\n\t\t\t\t\"bullets\": [\"b\"],\n\t\t\t\t\"state\": \"s\",\n\t\t\t\t\"has_free_trial\": false\n\t\t\t\t},\n\t\t\t\"on_free_trial\": false,\n\t\t\t\"free_trial_ends_on\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"marketplace_pending_change\": {\n\t\t\t\"effective_date\": ` + referenceTimeStr + `,\n\t\t\t\"unit_count\": 1,\n\t\t\t\"id\": 1,\n\t\t\t\"plan\": {\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"accounts_url\": \"au\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"number\": 1,\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"description\": \"d\",\n\t\t\t\t\"monthly_price_in_cents\": 1,\n\t\t\t\t\"yearly_price_in_cents\": 1,\n\t\t\t\t\"price_model\": \"pm\",\n\t\t\t\t\"unit_name\": \"un\",\n\t\t\t\t\"bullets\": [\"b\"],\n\t\t\t\t\"state\": \"s\",\n\t\t\t\t\"has_free_trial\": false\n\t\t\t}\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/apps_test.go",
    "content": "// Copyright 2016 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestAppsService_Get_authenticatedApp(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/app\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tapp, _, err := client.Apps.Get(ctx, \"\")\n\tif err != nil {\n\t\tt.Errorf(\"Apps.Get returned error: %v\", err)\n\t}\n\n\twant := &App{ID: Ptr(int64(1))}\n\tif !cmp.Equal(app, want) {\n\t\tt.Errorf(\"Apps.Get returned %+v, want %+v\", app, want)\n\t}\n\n\tconst methodName = \"Get\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Apps.Get(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Apps.Get(ctx, \"\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestAppsService_Get_specifiedApp(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/apps/a\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"html_url\":\"https://github.com/apps/a\"}`)\n\t})\n\n\tctx := t.Context()\n\tapp, _, err := client.Apps.Get(ctx, \"a\")\n\tif err != nil {\n\t\tt.Errorf(\"Apps.Get returned error: %v\", err)\n\t}\n\n\twant := &App{HTMLURL: Ptr(\"https://github.com/apps/a\")}\n\tif !cmp.Equal(app, want) {\n\t\tt.Errorf(\"Apps.Get returned %+v, want %+v\", *app.HTMLURL, *want.HTMLURL)\n\t}\n}\n\nfunc TestAppsService_ListInstallationRequests(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/app/installation-requests\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\":     \"1\",\n\t\t\t\"per_page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"id\": 1,\n\t\t\t\"account\": { \"id\": 2 },\n\t\t\t\"requester\": { \"id\": 3 },\n\t\t\t\"created_at\": \"2018-01-01T00:00:00Z\"\n\t\t}]`,\n\t\t)\n\t})\n\n\topt := &ListOptions{Page: 1, PerPage: 2}\n\tctx := t.Context()\n\tinstallationRequests, _, err := client.Apps.ListInstallationRequests(ctx, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Apps.ListInstallations returned error: %v\", err)\n\t}\n\n\tdate := Timestamp{Time: time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)}\n\twant := []*InstallationRequest{{\n\t\tID:        Ptr(int64(1)),\n\t\tAccount:   &User{ID: Ptr(int64(2))},\n\t\tRequester: &User{ID: Ptr(int64(3))},\n\t\tCreatedAt: &date,\n\t}}\n\tif !cmp.Equal(installationRequests, want) {\n\t\tt.Errorf(\"Apps.ListInstallationRequests returned %+v, want %+v\", installationRequests, want)\n\t}\n\n\tconst methodName = \"ListInstallationRequests\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Apps.ListInstallationRequests(ctx, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestAppsService_ListInstallations(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/app/installations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\":     \"1\",\n\t\t\t\"per_page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\n                                   \"id\":1,\n                                   \"app_id\":1,\n                                   \"target_id\":1,\n                                   \"target_type\": \"Organization\",\n                                   \"permissions\": {\n                                       \"actions\": \"read\",\n                                       \"administration\": \"read\",\n                                       \"checks\": \"read\",\n                                       \"contents\": \"read\",\n                                       \"content_references\": \"read\",\n                                       \"deployments\": \"read\",\n                                       \"environments\": \"read\",\n                                       \"issues\": \"write\",\n                                       \"metadata\": \"read\",\n                                       \"members\": \"read\",\n                                       \"organization_administration\": \"write\",\n                                       \"organization_custom_roles\": \"write\",\n                                       \"organization_hooks\": \"write\",\n                                       \"organization_packages\": \"write\",\n                                       \"organization_personal_access_tokens\": \"read\",\n                                       \"organization_personal_access_token_requests\": \"read\",\n                                       \"organization_plan\": \"read\",\n                                       \"organization_pre_receive_hooks\": \"write\",\n                                       \"organization_projects\": \"read\",\n                                       \"organization_secrets\": \"read\",\n                                       \"organization_self_hosted_runners\": \"read\",\n                                       \"organization_user_blocking\": \"write\",\n                                       \"packages\": \"read\",\n                                       \"pages\": \"read\",\n                                       \"pull_requests\": \"write\",\n                                       \"repository_hooks\": \"write\",\n                                       \"repository_projects\": \"read\",\n                                       \"repository_pre_receive_hooks\": \"read\",\n                                       \"secrets\": \"read\",\n                                       \"secret_scanning_alerts\": \"read\",\n                                       \"security_events\": \"read\",\n                                       \"single_file\": \"write\",\n                                       \"statuses\": \"write\",\n                                       \"team_discussions\": \"read\",\n                                       \"vulnerability_alerts\": \"read\",\n                                       \"workflows\": \"write\"\n                                   },\n                                  \"events\": [\n                                      \"push\",\n                                      \"pull_request\"\n                                  ],\n                                 \"single_file_name\": \"config.yml\",\n                                 \"repository_selection\": \"selected\",\n                                 \"created_at\": \"2018-01-01T00:00:00Z\",\n                                 \"updated_at\": \"2018-01-01T00:00:00Z\"}]`,\n\t\t)\n\t})\n\n\topt := &ListOptions{Page: 1, PerPage: 2}\n\tctx := t.Context()\n\tinstallations, _, err := client.Apps.ListInstallations(ctx, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Apps.ListInstallations returned error: %v\", err)\n\t}\n\n\tdate := Timestamp{Time: time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)}\n\twant := []*Installation{{\n\t\tID:                  Ptr(int64(1)),\n\t\tAppID:               Ptr(int64(1)),\n\t\tTargetID:            Ptr(int64(1)),\n\t\tTargetType:          Ptr(\"Organization\"),\n\t\tSingleFileName:      Ptr(\"config.yml\"),\n\t\tRepositorySelection: Ptr(\"selected\"),\n\t\tPermissions: &InstallationPermissions{\n\t\t\tActions:                                 Ptr(\"read\"),\n\t\t\tAdministration:                          Ptr(\"read\"),\n\t\t\tChecks:                                  Ptr(\"read\"),\n\t\t\tContents:                                Ptr(\"read\"),\n\t\t\tContentReferences:                       Ptr(\"read\"),\n\t\t\tDeployments:                             Ptr(\"read\"),\n\t\t\tEnvironments:                            Ptr(\"read\"),\n\t\t\tIssues:                                  Ptr(\"write\"),\n\t\t\tMetadata:                                Ptr(\"read\"),\n\t\t\tMembers:                                 Ptr(\"read\"),\n\t\t\tOrganizationAdministration:              Ptr(\"write\"),\n\t\t\tOrganizationCustomRoles:                 Ptr(\"write\"),\n\t\t\tOrganizationHooks:                       Ptr(\"write\"),\n\t\t\tOrganizationPackages:                    Ptr(\"write\"),\n\t\t\tOrganizationPersonalAccessTokens:        Ptr(\"read\"),\n\t\t\tOrganizationPersonalAccessTokenRequests: Ptr(\"read\"),\n\t\t\tOrganizationPlan:                        Ptr(\"read\"),\n\t\t\tOrganizationPreReceiveHooks:             Ptr(\"write\"),\n\t\t\tOrganizationProjects:                    Ptr(\"read\"),\n\t\t\tOrganizationSecrets:                     Ptr(\"read\"),\n\t\t\tOrganizationSelfHostedRunners:           Ptr(\"read\"),\n\t\t\tOrganizationUserBlocking:                Ptr(\"write\"),\n\t\t\tPackages:                                Ptr(\"read\"),\n\t\t\tPages:                                   Ptr(\"read\"),\n\t\t\tPullRequests:                            Ptr(\"write\"),\n\t\t\tRepositoryHooks:                         Ptr(\"write\"),\n\t\t\tRepositoryProjects:                      Ptr(\"read\"),\n\t\t\tRepositoryPreReceiveHooks:               Ptr(\"read\"),\n\t\t\tSecrets:                                 Ptr(\"read\"),\n\t\t\tSecretScanningAlerts:                    Ptr(\"read\"),\n\t\t\tSecurityEvents:                          Ptr(\"read\"),\n\t\t\tSingleFile:                              Ptr(\"write\"),\n\t\t\tStatuses:                                Ptr(\"write\"),\n\t\t\tTeamDiscussions:                         Ptr(\"read\"),\n\t\t\tVulnerabilityAlerts:                     Ptr(\"read\"),\n\t\t\tWorkflows:                               Ptr(\"write\"),\n\t\t},\n\t\tEvents:    []string{\"push\", \"pull_request\"},\n\t\tCreatedAt: &date,\n\t\tUpdatedAt: &date,\n\t}}\n\tif !cmp.Equal(installations, want) {\n\t\tt.Errorf(\"Apps.ListInstallations returned %+v, want %+v\", installations, want)\n\t}\n\n\tconst methodName = \"ListInstallations\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Apps.ListInstallations(ctx, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestAppsService_GetInstallation(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/app/installations/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1, \"app_id\":1, \"target_id\":1, \"target_type\": \"Organization\"}`)\n\t})\n\n\tctx := t.Context()\n\tinstallation, _, err := client.Apps.GetInstallation(ctx, 1)\n\tif err != nil {\n\t\tt.Errorf(\"Apps.GetInstallation returned error: %v\", err)\n\t}\n\n\twant := &Installation{ID: Ptr(int64(1)), AppID: Ptr(int64(1)), TargetID: Ptr(int64(1)), TargetType: Ptr(\"Organization\")}\n\tif !cmp.Equal(installation, want) {\n\t\tt.Errorf(\"Apps.GetInstallation returned %+v, want %+v\", installation, want)\n\t}\n\n\tconst methodName = \"GetInstallation\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Apps.GetInstallation(ctx, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Apps.GetInstallation(ctx, 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestAppsService_ListUserInstallations(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/installations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\":     \"1\",\n\t\t\t\"per_page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `{\"installations\":[{\"id\":1, \"app_id\":1, \"target_id\":1, \"target_type\": \"Organization\"}]}`)\n\t})\n\n\topt := &ListOptions{Page: 1, PerPage: 2}\n\tctx := t.Context()\n\tinstallations, _, err := client.Apps.ListUserInstallations(ctx, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Apps.ListUserInstallations returned error: %v\", err)\n\t}\n\n\twant := []*Installation{{ID: Ptr(int64(1)), AppID: Ptr(int64(1)), TargetID: Ptr(int64(1)), TargetType: Ptr(\"Organization\")}}\n\tif !cmp.Equal(installations, want) {\n\t\tt.Errorf(\"Apps.ListUserInstallations returned %+v, want %+v\", installations, want)\n\t}\n\n\tconst methodName = \"ListUserInstallations\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Apps.ListUserInstallations(ctx, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestAppsService_SuspendInstallation(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/app/installations/1/suspended\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Apps.SuspendInstallation(ctx, 1); err != nil {\n\t\tt.Errorf(\"Apps.SuspendInstallation returned error: %v\", err)\n\t}\n\n\tconst methodName = \"SuspendInstallation\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Apps.SuspendInstallation(ctx, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Apps.SuspendInstallation(ctx, 1)\n\t})\n}\n\nfunc TestAppsService_UnsuspendInstallation(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/app/installations/1/suspended\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Apps.UnsuspendInstallation(ctx, 1); err != nil {\n\t\tt.Errorf(\"Apps.UnsuspendInstallation returned error: %v\", err)\n\t}\n\n\tconst methodName = \"UnsuspendInstallation\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Apps.UnsuspendInstallation(ctx, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Apps.UnsuspendInstallation(ctx, 1)\n\t})\n}\n\nfunc TestAppsService_DeleteInstallation(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/app/installations/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Apps.DeleteInstallation(ctx, 1)\n\tif err != nil {\n\t\tt.Errorf(\"Apps.DeleteInstallation returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteInstallation\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Apps.DeleteInstallation(ctx, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Apps.DeleteInstallation(ctx, 1)\n\t})\n}\n\nfunc TestAppsService_CreateInstallationToken(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/app/installations/1/access_tokens\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\"token\":\"t\"}`)\n\t})\n\n\tctx := t.Context()\n\ttoken, _, err := client.Apps.CreateInstallationToken(ctx, 1, nil)\n\tif err != nil {\n\t\tt.Errorf(\"Apps.CreateInstallationToken returned error: %v\", err)\n\t}\n\n\twant := &InstallationToken{Token: Ptr(\"t\")}\n\tif !cmp.Equal(token, want) {\n\t\tt.Errorf(\"Apps.CreateInstallationToken returned %+v, want %+v\", token, want)\n\t}\n\n\tconst methodName = \"CreateInstallationToken\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Apps.CreateInstallationToken(ctx, -1, nil)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Apps.CreateInstallationToken(ctx, 1, nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestAppsService_CreateInstallationTokenWithOptions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinstallationTokenOptions := &InstallationTokenOptions{\n\t\tRepositoryIDs: []int64{1234},\n\t\tRepositories:  []string{\"foo\"},\n\t\tPermissions: &InstallationPermissions{\n\t\t\tContents: Ptr(\"write\"),\n\t\t\tIssues:   Ptr(\"read\"),\n\t\t},\n\t}\n\n\tmux.HandleFunc(\"/app/installations/1/access_tokens\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *InstallationTokenOptions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\tif !cmp.Equal(v, installationTokenOptions) {\n\t\t\tt.Errorf(\"request sent %+v, want %+v\", v, installationTokenOptions)\n\t\t}\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\"token\":\"t\"}`)\n\t})\n\n\tctx := t.Context()\n\ttoken, _, err := client.Apps.CreateInstallationToken(ctx, 1, installationTokenOptions)\n\tif err != nil {\n\t\tt.Errorf(\"Apps.CreateInstallationToken returned error: %v\", err)\n\t}\n\n\twant := &InstallationToken{Token: Ptr(\"t\")}\n\tif !cmp.Equal(token, want) {\n\t\tt.Errorf(\"Apps.CreateInstallationToken returned %+v, want %+v\", token, want)\n\t}\n}\n\nfunc TestAppsService_CreateInstallationTokenListReposWithOptions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinstallationTokenListRepoOptions := &InstallationTokenListRepoOptions{\n\t\tRepositories: []string{\"foo\"},\n\t\tPermissions: &InstallationPermissions{\n\t\t\tContents: Ptr(\"write\"),\n\t\t\tIssues:   Ptr(\"read\"),\n\t\t},\n\t}\n\n\tmux.HandleFunc(\"/app/installations/1/access_tokens\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *InstallationTokenListRepoOptions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\tif !cmp.Equal(v, installationTokenListRepoOptions) {\n\t\t\tt.Errorf(\"request sent %+v, want %+v\", v, installationTokenListRepoOptions)\n\t\t}\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\"token\":\"t\"}`)\n\t})\n\n\tctx := t.Context()\n\ttoken, _, err := client.Apps.CreateInstallationTokenListRepos(ctx, 1, installationTokenListRepoOptions)\n\tif err != nil {\n\t\tt.Errorf(\"Apps.CreateInstallationTokenListRepos returned error: %v\", err)\n\t}\n\n\twant := &InstallationToken{Token: Ptr(\"t\")}\n\tif !cmp.Equal(token, want) {\n\t\tt.Errorf(\"Apps.CreateInstallationTokenListRepos returned %+v, want %+v\", token, want)\n\t}\n}\n\nfunc TestAppsService_CreateInstallationTokenListReposWithNoOptions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/app/installations/1/access_tokens\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\"token\":\"t\"}`)\n\t})\n\n\tctx := t.Context()\n\ttoken, _, err := client.Apps.CreateInstallationTokenListRepos(ctx, 1, nil)\n\tif err != nil {\n\t\tt.Errorf(\"Apps.CreateInstallationTokenListRepos returned error: %v\", err)\n\t}\n\n\twant := &InstallationToken{Token: Ptr(\"t\")}\n\tif !cmp.Equal(token, want) {\n\t\tt.Errorf(\"Apps.CreateInstallationTokenListRepos returned %+v, want %+v\", token, want)\n\t}\n\n\tconst methodName = \"CreateInstallationTokenListRepos\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Apps.CreateInstallationTokenListRepos(ctx, -1, nil)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Apps.CreateInstallationTokenListRepos(ctx, 1, nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestAppsService_CreateAttachment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/content_references/11/attachments\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeContentAttachmentsPreview)\n\n\t\tw.WriteHeader(http.StatusOK)\n\t\tassertWrite(t, w, []byte(`{\"id\":1,\"title\":\"title1\",\"body\":\"body1\"}`))\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Apps.CreateAttachment(ctx, 11, \"title1\", \"body1\")\n\tif err != nil {\n\t\tt.Errorf(\"CreateAttachment returned error: %v\", err)\n\t}\n\n\twant := &Attachment{ID: Ptr(int64(1)), Title: Ptr(\"title1\"), Body: Ptr(\"body1\")}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"CreateAttachment = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"CreateAttachment\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Apps.CreateAttachment(ctx, -11, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Apps.CreateAttachment(ctx, 11, \"title1\", \"body1\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestAppsService_FindOrganizationInstallation(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/installation\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1, \"app_id\":1, \"target_id\":1, \"target_type\": \"Organization\"}`)\n\t})\n\n\tctx := t.Context()\n\tinstallation, _, err := client.Apps.FindOrganizationInstallation(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Apps.FindOrganizationInstallation returned error: %v\", err)\n\t}\n\n\twant := &Installation{ID: Ptr(int64(1)), AppID: Ptr(int64(1)), TargetID: Ptr(int64(1)), TargetType: Ptr(\"Organization\")}\n\tif !cmp.Equal(installation, want) {\n\t\tt.Errorf(\"Apps.FindOrganizationInstallation returned %+v, want %+v\", installation, want)\n\t}\n\n\tconst methodName = \"FindOrganizationInstallation\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Apps.FindOrganizationInstallation(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Apps.FindOrganizationInstallation(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestAppsService_FindRepositoryInstallation(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/installation\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1, \"app_id\":1, \"target_id\":1, \"target_type\": \"Organization\"}`)\n\t})\n\n\tctx := t.Context()\n\tinstallation, _, err := client.Apps.FindRepositoryInstallation(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Apps.FindRepositoryInstallation returned error: %v\", err)\n\t}\n\n\twant := &Installation{ID: Ptr(int64(1)), AppID: Ptr(int64(1)), TargetID: Ptr(int64(1)), TargetType: Ptr(\"Organization\")}\n\tif !cmp.Equal(installation, want) {\n\t\tt.Errorf(\"Apps.FindRepositoryInstallation returned %+v, want %+v\", installation, want)\n\t}\n\n\tconst methodName = \"FindRepositoryInstallation\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Apps.FindRepositoryInstallation(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Apps.FindRepositoryInstallation(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestAppsService_FindRepositoryInstallationByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repositories/1/installation\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1, \"app_id\":1, \"target_id\":1, \"target_type\": \"Organization\"}`)\n\t})\n\n\tctx := t.Context()\n\tinstallation, _, err := client.Apps.FindRepositoryInstallationByID(ctx, 1)\n\tif err != nil {\n\t\tt.Errorf(\"Apps.FindRepositoryInstallationByID returned error: %v\", err)\n\t}\n\n\twant := &Installation{ID: Ptr(int64(1)), AppID: Ptr(int64(1)), TargetID: Ptr(int64(1)), TargetType: Ptr(\"Organization\")}\n\tif !cmp.Equal(installation, want) {\n\t\tt.Errorf(\"Apps.FindRepositoryInstallationByID returned %+v, want %+v\", installation, want)\n\t}\n\n\tconst methodName = \"FindRepositoryInstallationByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Apps.FindRepositoryInstallationByID(ctx, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Apps.FindRepositoryInstallationByID(ctx, 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestAppsService_FindUserInstallation(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/installation\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1, \"app_id\":1, \"target_id\":1, \"target_type\": \"User\"}`)\n\t})\n\n\tctx := t.Context()\n\tinstallation, _, err := client.Apps.FindUserInstallation(ctx, \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Apps.FindUserInstallation returned error: %v\", err)\n\t}\n\n\twant := &Installation{ID: Ptr(int64(1)), AppID: Ptr(int64(1)), TargetID: Ptr(int64(1)), TargetType: Ptr(\"User\")}\n\tif !cmp.Equal(installation, want) {\n\t\tt.Errorf(\"Apps.FindUserInstallation returned %+v, want %+v\", installation, want)\n\t}\n\n\tconst methodName = \"FindUserInstallation\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Apps.FindUserInstallation(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Apps.FindUserInstallation(ctx, \"u\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestContentReference_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ContentReference{}, \"{}\")\n\n\tu := &ContentReference{\n\t\tID:        Ptr(int64(1)),\n\t\tNodeID:    Ptr(\"nid\"),\n\t\tReference: Ptr(\"r\"),\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"node_id\": \"nid\",\n\t\t\"reference\": \"r\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestAttachment_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Attachment{}, \"{}\")\n\n\tu := &Attachment{\n\t\tID:    Ptr(int64(1)),\n\t\tTitle: Ptr(\"t\"),\n\t\tBody:  Ptr(\"b\"),\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"title\": \"t\",\n\t\t\"body\": \"b\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestInstallationPermissions_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &InstallationPermissions{}, \"{}\")\n\n\tu := &InstallationPermissions{\n\t\tActions:                       Ptr(\"a\"),\n\t\tAdministration:                Ptr(\"ad\"),\n\t\tChecks:                        Ptr(\"c\"),\n\t\tContents:                      Ptr(\"co\"),\n\t\tContentReferences:             Ptr(\"cr\"),\n\t\tDeployments:                   Ptr(\"d\"),\n\t\tEnvironments:                  Ptr(\"e\"),\n\t\tIssues:                        Ptr(\"i\"),\n\t\tMetadata:                      Ptr(\"md\"),\n\t\tMembers:                       Ptr(\"m\"),\n\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\tOrganizationCustomOrgRoles:    Ptr(\"ocr\"),\n\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\tPackages:                      Ptr(\"pkg\"),\n\t\tPages:                         Ptr(\"pg\"),\n\t\tPullRequests:                  Ptr(\"pr\"),\n\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\tSecrets:                       Ptr(\"s\"),\n\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\tSecurityEvents:                Ptr(\"se\"),\n\t\tSingleFile:                    Ptr(\"sf\"),\n\t\tStatuses:                      Ptr(\"s\"),\n\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\tWorkflows:                     Ptr(\"w\"),\n\t}\n\n\twant := `{\n\t\t\"actions\": \"a\",\n\t\t\"administration\": \"ad\",\n\t\t\"checks\": \"c\",\n\t\t\"contents\": \"co\",\n\t\t\"content_references\": \"cr\",\n\t\t\"deployments\": \"d\",\n\t\t\"environments\": \"e\",\n\t\t\"issues\": \"i\",\n\t\t\"metadata\": \"md\",\n\t\t\"members\": \"m\",\n\t\t\"organization_administration\": \"oa\",\n\t\t\"organization_custom_org_roles\": \"ocr\",\n\t\t\"organization_hooks\": \"oh\",\n\t\t\"organization_plan\": \"op\",\n\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\"organization_projects\": \"op\",\n\t\t\"organization_secrets\": \"os\",\n\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\"organization_user_blocking\": \"oub\",\n\t\t\"packages\": \"pkg\",\n\t\t\"pages\": \"pg\",\n\t\t\"pull_requests\": \"pr\",\n\t\t\"repository_hooks\": \"rh\",\n\t\t\"repository_projects\": \"rp\",\n\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\"secrets\": \"s\",\n\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\"security_events\": \"se\",\n\t\t\"single_file\": \"sf\",\n\t\t\"statuses\": \"s\",\n\t\t\"team_discussions\": \"td\",\n\t\t\"vulnerability_alerts\":\"va\",\n\t\t\"workflows\": \"w\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestInstallation_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Installation{}, \"{}\")\n\n\tu := &Installation{\n\t\tID:       Ptr(int64(1)),\n\t\tNodeID:   Ptr(\"nid\"),\n\t\tAppID:    Ptr(int64(1)),\n\t\tAppSlug:  Ptr(\"as\"),\n\t\tTargetID: Ptr(int64(1)),\n\t\tAccount: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\tHTMLURL:             Ptr(\"hu\"),\n\t\tTargetType:          Ptr(\"tt\"),\n\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\tRepositorySelection: Ptr(\"rs\"),\n\t\tEvents:              []string{\"e\"},\n\t\tSingleFilePaths:     []string{\"s\"},\n\t\tPermissions: &InstallationPermissions{\n\t\t\tActions:                       Ptr(\"a\"),\n\t\t\tActionsVariables:              Ptr(\"ac\"),\n\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\tContents:                      Ptr(\"co\"),\n\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\tOrganizationCustomOrgRoles:    Ptr(\"ocr\"),\n\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t},\n\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\tHasMultipleSingleFiles: Ptr(false),\n\t\tSuspendedBy: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t\tSuspendedAt: &Timestamp{referenceTime},\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"node_id\": \"nid\",\n\t\t\"app_id\": 1,\n\t\t\"app_slug\": \"as\",\n\t\t\"target_id\": 1,\n\t\t\"account\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"access_tokens_url\": \"atu\",\n\t\t\"repositories_url\": \"ru\",\n\t\t\"html_url\": \"hu\",\n\t\t\"target_type\": \"tt\",\n\t\t\"single_file_name\": \"sfn\",\n\t\t\"repository_selection\": \"rs\",\n\t\t\"events\": [\n\t\t\t\"e\"\n\t\t],\n\t\t\"single_file_paths\": [\n\t\t\t\"s\"\n\t\t],\n\t\t\"permissions\": {\n\t\t\t\"actions\": \"a\",\n\t\t\t\"actions_variables\": \"ac\",\n\t\t\t\"administration\": \"ad\",\n\t\t\t\"checks\": \"c\",\n\t\t\t\"contents\": \"co\",\n\t\t\t\"content_references\": \"cr\",\n\t\t\t\"deployments\": \"d\",\n\t\t\t\"environments\": \"e\",\n\t\t\t\"issues\": \"i\",\n\t\t\t\"metadata\": \"md\",\n\t\t\t\"members\": \"m\",\n\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\"organization_custom_org_roles\": \"ocr\",\n\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\"organization_plan\": \"op\",\n\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\"organization_projects\": \"op\",\n\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\"packages\": \"pkg\",\n\t\t\t\"pages\": \"pg\",\n\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\"secrets\": \"s\",\n\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\"security_events\": \"se\",\n\t\t\t\"single_file\": \"sf\",\n\t\t\t\"statuses\": \"s\",\n\t\t\t\"team_discussions\": \"td\",\n\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\"workflows\": \"w\"\n\t\t},\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"has_multiple_single_files\": false,\n\t\t\"suspended_by\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestInstallationTokenOptions_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &InstallationTokenOptions{}, \"{}\")\n\n\tu := &InstallationTokenOptions{\n\t\tRepositoryIDs: []int64{1},\n\t\tPermissions: &InstallationPermissions{\n\t\t\tActions:                       Ptr(\"a\"),\n\t\t\tActionsVariables:              Ptr(\"ac\"),\n\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\tContents:                      Ptr(\"co\"),\n\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\tOrganizationCustomOrgRoles:    Ptr(\"ocr\"),\n\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"repository_ids\": [1],\n\t\t\"permissions\": {\n\t\t\t\"actions\": \"a\",\n\t\t\t\"actions_variables\": \"ac\",\n\t\t\t\"administration\": \"ad\",\n\t\t\t\"checks\": \"c\",\n\t\t\t\"contents\": \"co\",\n\t\t\t\"content_references\": \"cr\",\n\t\t\t\"deployments\": \"d\",\n\t\t\t\"environments\": \"e\",\n\t\t\t\"issues\": \"i\",\n\t\t\t\"metadata\": \"md\",\n\t\t\t\"members\": \"m\",\n\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\"organization_custom_org_roles\": \"ocr\",\n\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\"organization_plan\": \"op\",\n\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\"organization_projects\": \"op\",\n\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\"packages\": \"pkg\",\n\t\t\t\"pages\": \"pg\",\n\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\"secrets\": \"s\",\n\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\"security_events\": \"se\",\n\t\t\t\"single_file\": \"sf\",\n\t\t\t\"statuses\": \"s\",\n\t\t\t\"team_discussions\": \"td\",\n\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\"workflows\": \"w\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestInstallationToken_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &InstallationToken{}, \"{}\")\n\n\tu := &InstallationToken{\n\t\tToken:     Ptr(\"t\"),\n\t\tExpiresAt: &Timestamp{referenceTime},\n\t\tPermissions: &InstallationPermissions{\n\t\t\tActions:                       Ptr(\"a\"),\n\t\t\tActionsVariables:              Ptr(\"ac\"),\n\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\tContents:                      Ptr(\"co\"),\n\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\tOrganizationCustomOrgRoles:    Ptr(\"ocr\"),\n\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t},\n\t\tRepositories: []*Repository{\n\t\t\t{\n\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\tURL:  Ptr(\"u\"),\n\t\t\t\tName: Ptr(\"n\"),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"token\": \"t\",\n\t\t\"expires_at\": ` + referenceTimeStr + `,\n\t\t\"permissions\": {\n\t\t\t\"actions\": \"a\",\n\t\t\t\"actions_variables\": \"ac\",\n\t\t\t\"administration\": \"ad\",\n\t\t\t\"checks\": \"c\",\n\t\t\t\"contents\": \"co\",\n\t\t\t\"content_references\": \"cr\",\n\t\t\t\"deployments\": \"d\",\n\t\t\t\"environments\": \"e\",\n\t\t\t\"issues\": \"i\",\n\t\t\t\"metadata\": \"md\",\n\t\t\t\"members\": \"m\",\n\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\"organization_custom_org_roles\": \"ocr\",\n\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\"organization_plan\": \"op\",\n\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\"organization_projects\": \"op\",\n\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\"packages\": \"pkg\",\n\t\t\t\"pages\": \"pg\",\n\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\"secrets\": \"s\",\n\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\"security_events\": \"se\",\n\t\t\t\"single_file\": \"sf\",\n\t\t\t\"statuses\": \"s\",\n\t\t\t\"team_discussions\": \"td\",\n\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\"workflows\": \"w\"\n\t\t},\n\t\t\"repositories\": [\n\t\t\t{\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"name\": \"n\"\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestApp_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &App{}, \"{}\")\n\n\tu := &App{\n\t\tID:     Ptr(int64(1)),\n\t\tSlug:   Ptr(\"s\"),\n\t\tNodeID: Ptr(\"nid\"),\n\t\tOwner: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t\tName:        Ptr(\"n\"),\n\t\tDescription: Ptr(\"d\"),\n\t\tExternalURL: Ptr(\"eu\"),\n\t\tHTMLURL:     Ptr(\"hu\"),\n\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\tUpdatedAt:   &Timestamp{referenceTime},\n\t\tPermissions: &InstallationPermissions{\n\t\t\tActions:                       Ptr(\"a\"),\n\t\t\tActionsVariables:              Ptr(\"ac\"),\n\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\tContents:                      Ptr(\"co\"),\n\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\tOrganizationCustomOrgRoles:    Ptr(\"ocr\"),\n\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t},\n\t\tEvents: []string{\"s\"},\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"slug\": \"s\",\n\t\t\"node_id\": \"nid\",\n\t\t\"owner\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"name\": \"n\",\n\t\t\"description\": \"d\",\n\t\t\"external_url\": \"eu\",\n\t\t\"html_url\": \"hu\",\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"permissions\": {\n\t\t\t\"actions\": \"a\",\n\t\t\t\"actions_variables\": \"ac\",\n\t\t\t\"administration\": \"ad\",\n\t\t\t\"checks\": \"c\",\n\t\t\t\"contents\": \"co\",\n\t\t\t\"content_references\": \"cr\",\n\t\t\t\"deployments\": \"d\",\n\t\t\t\"environments\": \"e\",\n\t\t\t\"issues\": \"i\",\n\t\t\t\"metadata\": \"md\",\n\t\t\t\"members\": \"m\",\n\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\"organization_custom_org_roles\": \"ocr\",\n\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\"organization_plan\": \"op\",\n\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\"organization_projects\": \"op\",\n\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\"packages\": \"pkg\",\n\t\t\t\"pages\": \"pg\",\n\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\"secrets\": \"s\",\n\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\"security_events\": \"se\",\n\t\t\t\"single_file\": \"sf\",\n\t\t\t\"statuses\": \"s\",\n\t\t\t\"team_discussions\": \"td\",\n\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\"workflows\": \"w\"\n\t\t},\n\t\t\"events\": [\"s\"]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/attestations.go",
    "content": "// Copyright 2024 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n)\n\n// Attestation represents an artifact attestation associated with a repository.\n// The provided bundle can be used to verify the provenance of artifacts.\n//\n// https://docs.github.com/en/actions/security-for-github-actions/using-artifact-attestations/using-artifact-attestations-to-establish-provenance-for-builds\ntype Attestation struct {\n\t// The attestation's Sigstore Bundle.\n\t// Refer to the sigstore bundle specification for more info:\n\t// https://github.com/sigstore/protobuf-specs/blob/main/protos/sigstore_bundle.proto\n\tBundle       json.RawMessage `json:\"bundle\"`\n\tRepositoryID int64           `json:\"repository_id\"`\n}\n\n// AttestationsResponse represents a collection of artifact attestations.\ntype AttestationsResponse struct {\n\tAttestations []*Attestation `json:\"attestations\"`\n}\n"
  },
  {
    "path": "github/authorizations.go",
    "content": "// Copyright 2015 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// Scope models a GitHub authorization scope.\n//\n// GitHub API docs: https://docs.github.com/rest/oauth/#scopes\ntype Scope string\n\n// This is the set of scopes for GitHub API V3.\nconst (\n\tScopeNone           Scope = \"(no scope)\" // REVISIT: is this actually returned, or just a documentation artifact?\n\tScopeUser           Scope = \"user\"\n\tScopeUserEmail      Scope = \"user:email\"\n\tScopeUserFollow     Scope = \"user:follow\"\n\tScopePublicRepo     Scope = \"public_repo\"\n\tScopeRepo           Scope = \"repo\"\n\tScopeRepoDeployment Scope = \"repo_deployment\"\n\tScopeRepoStatus     Scope = \"repo:status\"\n\tScopeDeleteRepo     Scope = \"delete_repo\"\n\tScopeNotifications  Scope = \"notifications\"\n\tScopeGist           Scope = \"gist\"\n\tScopeReadRepoHook   Scope = \"read:repo_hook\"\n\tScopeWriteRepoHook  Scope = \"write:repo_hook\"\n\tScopeAdminRepoHook  Scope = \"admin:repo_hook\"\n\tScopeAdminOrgHook   Scope = \"admin:org_hook\"\n\tScopeReadOrg        Scope = \"read:org\"\n\tScopeWriteOrg       Scope = \"write:org\"\n\tScopeAdminOrg       Scope = \"admin:org\"\n\tScopeReadPublicKey  Scope = \"read:public_key\"\n\tScopeWritePublicKey Scope = \"write:public_key\"\n\tScopeAdminPublicKey Scope = \"admin:public_key\"\n\tScopeReadGPGKey     Scope = \"read:gpg_key\"\n\tScopeWriteGPGKey    Scope = \"write:gpg_key\"\n\tScopeAdminGPGKey    Scope = \"admin:gpg_key\"\n\tScopeSecurityEvents Scope = \"security_events\"\n)\n\n// AuthorizationsService handles communication with the authorization related\n// methods of the GitHub API.\n//\n// This service requires HTTP Basic Authentication; it cannot be accessed using\n// an OAuth token.\n//\n// GitHub API docs: https://docs.github.com/rest/oauth-authorizations\ntype AuthorizationsService service\n\n// Authorization represents an individual GitHub authorization.\ntype Authorization struct {\n\tID             *int64            `json:\"id,omitempty\"`\n\tURL            *string           `json:\"url,omitempty\"`\n\tScopes         []Scope           `json:\"scopes,omitempty\"`\n\tToken          *string           `json:\"token,omitempty\"`\n\tTokenLastEight *string           `json:\"token_last_eight,omitempty\"`\n\tHashedToken    *string           `json:\"hashed_token,omitempty\"`\n\tApp            *AuthorizationApp `json:\"app,omitempty\"`\n\tNote           *string           `json:\"note,omitempty\"`\n\tNoteURL        *string           `json:\"note_url,omitempty\"`\n\tUpdatedAt      *Timestamp        `json:\"updated_at,omitempty\"`\n\tCreatedAt      *Timestamp        `json:\"created_at,omitempty\"`\n\tFingerprint    *string           `json:\"fingerprint,omitempty\"`\n\n\t// User is only populated by the Check and Reset methods.\n\tUser *User `json:\"user,omitempty\"`\n}\n\nfunc (a Authorization) String() string {\n\treturn Stringify(a)\n}\n\n// AuthorizationApp represents an individual GitHub app (in the context of authorization).\ntype AuthorizationApp struct {\n\tURL      *string `json:\"url,omitempty\"`\n\tName     *string `json:\"name,omitempty\"`\n\tClientID *string `json:\"client_id,omitempty\"`\n}\n\nfunc (a AuthorizationApp) String() string {\n\treturn Stringify(a)\n}\n\n// Grant represents an OAuth application that has been granted access to an account.\ntype Grant struct {\n\tID        *int64            `json:\"id,omitempty\"`\n\tURL       *string           `json:\"url,omitempty\"`\n\tApp       *AuthorizationApp `json:\"app,omitempty\"`\n\tCreatedAt *Timestamp        `json:\"created_at,omitempty\"`\n\tUpdatedAt *Timestamp        `json:\"updated_at,omitempty\"`\n\tScopes    []string          `json:\"scopes,omitempty\"`\n}\n\nfunc (g Grant) String() string {\n\treturn Stringify(g)\n}\n\n// AuthorizationRequest represents a request to create an authorization.\ntype AuthorizationRequest struct {\n\tScopes       []Scope `json:\"scopes,omitempty\"`\n\tNote         *string `json:\"note,omitempty\"`\n\tNoteURL      *string `json:\"note_url,omitempty\"`\n\tClientID     *string `json:\"client_id,omitempty\"`\n\tClientSecret *string `json:\"client_secret,omitempty\"`\n\tFingerprint  *string `json:\"fingerprint,omitempty\"`\n}\n\nfunc (a AuthorizationRequest) String() string {\n\treturn Stringify(a)\n}\n\n// AuthorizationUpdateRequest represents a request to update an authorization.\n//\n// Note that for any one update, you must only provide one of the \"scopes\"\n// fields. That is, you may provide only one of \"Scopes\", or \"AddScopes\", or\n// \"RemoveScopes\".\n//\n// GitHub API docs: https://docs.github.com/rest/oauth-authorizations#update-an-existing-authorization\ntype AuthorizationUpdateRequest struct {\n\tScopes       []string `json:\"scopes,omitempty\"`\n\tAddScopes    []string `json:\"add_scopes,omitempty\"`\n\tRemoveScopes []string `json:\"remove_scopes,omitempty\"`\n\tNote         *string  `json:\"note,omitempty\"`\n\tNoteURL      *string  `json:\"note_url,omitempty\"`\n\tFingerprint  *string  `json:\"fingerprint,omitempty\"`\n}\n\nfunc (a AuthorizationUpdateRequest) String() string {\n\treturn Stringify(a)\n}\n\n// Check if an OAuth token is valid for a specific app.\n//\n// Note that this operation requires the use of BasicAuth, but where the\n// username is the OAuth application clientID, and the password is its\n// clientSecret. Invalid tokens will return a 404 Not Found.\n//\n// The returned Authorization.User field will be populated.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications#check-a-token\n//\n//meta:operation POST /applications/{client_id}/token\nfunc (s *AuthorizationsService) Check(ctx context.Context, clientID, accessToken string) (*Authorization, *Response, error) {\n\tu := fmt.Sprintf(\"applications/%v/token\", clientID)\n\n\treqBody := &struct {\n\t\tAccessToken string `json:\"access_token\"`\n\t}{AccessToken: accessToken}\n\n\treq, err := s.client.NewRequest(\"POST\", u, reqBody)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treq.Header.Set(\"Accept\", mediaTypeOAuthAppPreview)\n\n\tvar a *Authorization\n\tresp, err := s.client.Do(ctx, req, &a)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn a, resp, nil\n}\n\n// Reset is used to reset a valid OAuth token without end user involvement.\n// Applications must save the \"token\" property in the response, because changes\n// take effect immediately.\n//\n// Note that this operation requires the use of BasicAuth, but where the\n// username is the OAuth application clientID, and the password is its\n// clientSecret. Invalid tokens will return a 404 Not Found.\n//\n// The returned Authorization.User field will be populated.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications#reset-a-token\n//\n//meta:operation PATCH /applications/{client_id}/token\nfunc (s *AuthorizationsService) Reset(ctx context.Context, clientID, accessToken string) (*Authorization, *Response, error) {\n\tu := fmt.Sprintf(\"applications/%v/token\", clientID)\n\n\treqBody := &struct {\n\t\tAccessToken string `json:\"access_token\"`\n\t}{AccessToken: accessToken}\n\n\treq, err := s.client.NewRequest(\"PATCH\", u, reqBody)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treq.Header.Set(\"Accept\", mediaTypeOAuthAppPreview)\n\n\tvar a *Authorization\n\tresp, err := s.client.Do(ctx, req, &a)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn a, resp, nil\n}\n\n// Revoke an authorization for an application.\n//\n// Note that this operation requires the use of BasicAuth, but where the\n// username is the OAuth application clientID, and the password is its\n// clientSecret. Invalid tokens will return a 404 Not Found.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-token\n//\n//meta:operation DELETE /applications/{client_id}/token\nfunc (s *AuthorizationsService) Revoke(ctx context.Context, clientID, accessToken string) (*Response, error) {\n\tu := fmt.Sprintf(\"applications/%v/token\", clientID)\n\n\treqBody := &struct {\n\t\tAccessToken string `json:\"access_token\"`\n\t}{AccessToken: accessToken}\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, reqBody)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq.Header.Set(\"Accept\", mediaTypeOAuthAppPreview)\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// DeleteGrant deletes an OAuth application grant. Deleting an application's\n// grant will also delete all OAuth tokens associated with the application for\n// the user.\n//\n// GitHub API docs: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-authorization\n//\n//meta:operation DELETE /applications/{client_id}/grant\nfunc (s *AuthorizationsService) DeleteGrant(ctx context.Context, clientID, accessToken string) (*Response, error) {\n\tu := fmt.Sprintf(\"applications/%v/grant\", clientID)\n\n\treqBody := &struct {\n\t\tAccessToken string `json:\"access_token\"`\n\t}{AccessToken: accessToken}\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, reqBody)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq.Header.Set(\"Accept\", mediaTypeOAuthAppPreview)\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// CreateImpersonation creates an impersonation OAuth token.\n//\n// This requires admin permissions. With the returned Authorization.Token\n// you can e.g. create or delete a user's public SSH key. NOTE: creating a\n// new token automatically revokes an existing one.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#create-an-impersonation-oauth-token\n//\n//meta:operation POST /admin/users/{username}/authorizations\nfunc (s *AuthorizationsService) CreateImpersonation(ctx context.Context, username string, authReq *AuthorizationRequest) (*Authorization, *Response, error) {\n\tu := fmt.Sprintf(\"admin/users/%v/authorizations\", username)\n\treq, err := s.client.NewRequest(\"POST\", u, authReq)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar a *Authorization\n\tresp, err := s.client.Do(ctx, req, &a)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn a, resp, nil\n}\n\n// DeleteImpersonation deletes an impersonation OAuth token.\n//\n// NOTE: there can be only one at a time.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#delete-an-impersonation-oauth-token\n//\n//meta:operation DELETE /admin/users/{username}/authorizations\nfunc (s *AuthorizationsService) DeleteImpersonation(ctx context.Context, username string) (*Response, error) {\n\tu := fmt.Sprintf(\"admin/users/%v/authorizations\", username)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/authorizations_test.go",
    "content": "// Copyright 2015 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestAuthorizationsService_Check(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/applications/id/token\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestBody(t, r, `{\"access_token\":\"a\"}`+\"\\n\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeOAuthAppPreview)\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Authorizations.Check(ctx, \"id\", \"a\")\n\tif err != nil {\n\t\tt.Errorf(\"Authorizations.Check returned error: %v\", err)\n\t}\n\n\twant := &Authorization{ID: Ptr(int64(1))}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Authorizations.Check returned auth %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"Check\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Authorizations.Check(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Authorizations.Check(ctx, \"id\", \"a\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestAuthorizationsService_Reset(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/applications/id/token\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\ttestBody(t, r, `{\"access_token\":\"a\"}`+\"\\n\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeOAuthAppPreview)\n\t\tfmt.Fprint(w, `{\"ID\":1}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Authorizations.Reset(ctx, \"id\", \"a\")\n\tif err != nil {\n\t\tt.Errorf(\"Authorizations.Reset returned error: %v\", err)\n\t}\n\n\twant := &Authorization{ID: Ptr(int64(1))}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Authorizations.Reset returned auth %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"Reset\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Authorizations.Reset(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Authorizations.Reset(ctx, \"id\", \"a\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestAuthorizationsService_Revoke(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/applications/id/token\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestBody(t, r, `{\"access_token\":\"a\"}`+\"\\n\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeOAuthAppPreview)\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Authorizations.Revoke(ctx, \"id\", \"a\")\n\tif err != nil {\n\t\tt.Errorf(\"Authorizations.Revoke returned error: %v\", err)\n\t}\n\n\tconst methodName = \"Revoke\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Authorizations.Revoke(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Authorizations.Revoke(ctx, \"id\", \"a\")\n\t})\n}\n\nfunc TestDeleteGrant(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/applications/id/grant\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestBody(t, r, `{\"access_token\":\"a\"}`+\"\\n\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeOAuthAppPreview)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Authorizations.DeleteGrant(ctx, \"id\", \"a\")\n\tif err != nil {\n\t\tt.Errorf(\"OAuthAuthorizations.DeleteGrant returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteGrant\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Authorizations.DeleteGrant(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Authorizations.DeleteGrant(ctx, \"id\", \"a\")\n\t})\n}\n\nfunc TestAuthorizationsService_CreateImpersonation(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/admin/users/u/authorizations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\treq := &AuthorizationRequest{Scopes: []Scope{ScopePublicRepo}}\n\tctx := t.Context()\n\tgot, _, err := client.Authorizations.CreateImpersonation(ctx, \"u\", req)\n\tif err != nil {\n\t\tt.Errorf(\"Authorizations.CreateImpersonation returned error: %+v\", err)\n\t}\n\n\twant := &Authorization{ID: Ptr(int64(1))}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Authorizations.CreateImpersonation returned %+v, want %+v\", *got.ID, *want.ID)\n\t}\n\n\tconst methodName = \"CreateImpersonation\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Authorizations.CreateImpersonation(ctx, \"\\n\", req)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Authorizations.CreateImpersonation(ctx, \"u\", req)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestAuthorizationsService_DeleteImpersonation(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/admin/users/u/authorizations\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Authorizations.DeleteImpersonation(ctx, \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Authorizations.DeleteImpersonation returned error: %+v\", err)\n\t}\n\n\tconst methodName = \"DeleteImpersonation\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Authorizations.DeleteImpersonation(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Authorizations.DeleteImpersonation(ctx, \"u\")\n\t})\n}\n\nfunc TestAuthorizationUpdateRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &AuthorizationUpdateRequest{}, \"{}\")\n\n\tu := &AuthorizationUpdateRequest{\n\t\tScopes:       []string{\"s\"},\n\t\tAddScopes:    []string{\"a\"},\n\t\tRemoveScopes: []string{\"r\"},\n\t\tNote:         Ptr(\"n\"),\n\t\tNoteURL:      Ptr(\"nu\"),\n\t\tFingerprint:  Ptr(\"f\"),\n\t}\n\n\twant := `{\n\t\t\"scopes\": [\"s\"],\n\t\t\"add_scopes\": [\"a\"],\n\t\t\"remove_scopes\": [\"r\"],\n\t\t\"note\": \"n\",\n\t\t\"note_url\": \"nu\",\n\t\t\"fingerprint\": \"f\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestAuthorizationRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &AuthorizationRequest{}, \"{}\")\n\n\tu := &AuthorizationRequest{\n\t\tScopes:       []Scope{\"s\"},\n\t\tClientID:     Ptr(\"cid\"),\n\t\tClientSecret: Ptr(\"cs\"),\n\t\tNote:         Ptr(\"n\"),\n\t\tNoteURL:      Ptr(\"nu\"),\n\t\tFingerprint:  Ptr(\"f\"),\n\t}\n\n\twant := `{\n\t\t\"scopes\": [\"s\"],\n\t\t\"client_id\": \"cid\",\n\t\t\"client_secret\": \"cs\",\n\t\t\"note\": \"n\",\n\t\t\"note_url\": \"nu\",\n\t\t\"fingerprint\": \"f\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestAuthorizationApp_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &AuthorizationApp{}, \"{}\")\n\n\tu := &AuthorizationApp{\n\t\tURL:      Ptr(\"u\"),\n\t\tName:     Ptr(\"n\"),\n\t\tClientID: Ptr(\"cid\"),\n\t}\n\n\twant := `{\n\t\t\"url\": \"u\",\n\t\t\"name\": \"n\",\n\t\t\"client_id\": \"cid\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestGrant_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Grant{}, \"{}\")\n\n\tu := &Grant{\n\t\tID:  Ptr(int64(1)),\n\t\tURL: Ptr(\"u\"),\n\t\tApp: &AuthorizationApp{\n\t\t\tURL:      Ptr(\"u\"),\n\t\t\tName:     Ptr(\"n\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t},\n\t\tCreatedAt: &Timestamp{referenceTime},\n\t\tUpdatedAt: &Timestamp{referenceTime},\n\t\tScopes:    []string{\"s\"},\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"url\": \"u\",\n\t\t\"app\": {\n\t\t\t\"url\": \"u\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"client_id\": \"cid\"\n\t\t},\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"scopes\": [\"s\"]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestAuthorization_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Authorization{}, \"{}\")\n\n\tu := &Authorization{\n\t\tID:             Ptr(int64(1)),\n\t\tURL:            Ptr(\"u\"),\n\t\tScopes:         []Scope{\"s\"},\n\t\tToken:          Ptr(\"t\"),\n\t\tTokenLastEight: Ptr(\"tle\"),\n\t\tHashedToken:    Ptr(\"ht\"),\n\t\tApp: &AuthorizationApp{\n\t\t\tURL:      Ptr(\"u\"),\n\t\t\tName:     Ptr(\"n\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t},\n\t\tNote:        Ptr(\"n\"),\n\t\tNoteURL:     Ptr(\"nu\"),\n\t\tUpdatedAt:   &Timestamp{referenceTime},\n\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\tFingerprint: Ptr(\"f\"),\n\t\tUser: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"url\": \"u\",\n\t\t\"scopes\": [\"s\"],\n\t\t\"token\": \"t\",\n\t\t\"token_last_eight\": \"tle\",\n\t\t\"hashed_token\": \"ht\",\n\t\t\"app\": {\n\t\t\t\"url\": \"u\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"client_id\": \"cid\"\n\t\t},\n\t\t\"note\": \"n\",\n\t\t\"note_url\": \"nu\",\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"fingerprint\": \"f\",\n\t\t\"user\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/billing.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// BillingService provides access to the billing related functions\n// in the GitHub API.\n//\n// GitHub API docs: https://docs.github.com/rest/billing\ntype BillingService service\n\n// MinutesUsedBreakdown counts the actions minutes used by machine type (e.g. UBUNTU, WINDOWS, MACOS).\ntype MinutesUsedBreakdown = map[string]int\n\n// PackagesBilling represents billing of GitHub Packages .\ntype PackagesBilling struct {\n\tTotalGigabytesBandwidthUsed     int `json:\"total_gigabytes_bandwidth_used\"`\n\tTotalPaidGigabytesBandwidthUsed int `json:\"total_paid_gigabytes_bandwidth_used\"`\n\tIncludedGigabytesBandwidth      int `json:\"included_gigabytes_bandwidth\"`\n}\n\n// StorageBilling represents a GitHub Storage billing.\ntype StorageBilling struct {\n\tDaysLeftInBillingCycle       int `json:\"days_left_in_billing_cycle\"`\n\tEstimatedPaidStorageForMonth int `json:\"estimated_paid_storage_for_month\"`\n\tEstimatedStorageForMonth     int `json:\"estimated_storage_for_month\"`\n}\n\n// ActiveCommittersListOptions specifies optional parameters to the\n// BillingService.GetAdvancedSecurityActiveCommittersOrg method.\ntype ActiveCommittersListOptions struct {\n\t// The security product to get GitHub Advanced Security active committers for. For standalone\n\t// Code Scanning or Secret Protection products, this parameter is required to specify which\n\t// product you want committer information for. For other plans this parameter cannot be used.\n\t//\n\t// Can be one of: \"code_security\", \"secret_protection\".\n\tAdvancedSecurityProduct *string `url:\"advanced_security_product,omitempty\"`\n\n\tListOptions\n}\n\n// ActiveCommitters represents the total active committers across all repositories in an Organization.\ntype ActiveCommitters struct {\n\tTotalAdvancedSecurityCommitters     *int                          `json:\"total_advanced_security_committers,omitempty\"`\n\tTotalCount                          *int                          `json:\"total_count,omitempty\"`\n\tMaximumAdvancedSecurityCommitters   *int                          `json:\"maximum_advanced_security_committers,omitempty\"`\n\tPurchasedAdvancedSecurityCommitters *int                          `json:\"purchased_advanced_security_committers,omitempty\"`\n\tRepositories                        []*RepositoryActiveCommitters `json:\"repositories\"`\n}\n\n// RepositoryActiveCommitters represents active committers on each repository.\ntype RepositoryActiveCommitters struct {\n\tName                                string                                 `json:\"name\"`\n\tAdvancedSecurityCommitters          int                                    `json:\"advanced_security_committers\"`\n\tAdvancedSecurityCommittersBreakdown []*AdvancedSecurityCommittersBreakdown `json:\"advanced_security_committers_breakdown\"`\n}\n\n// AdvancedSecurityCommittersBreakdown represents the user activity breakdown for ActiveCommitters.\ntype AdvancedSecurityCommittersBreakdown struct {\n\tUserLogin       string `json:\"user_login\"`\n\tLastPushedDate  string `json:\"last_pushed_date\"`\n\tLastPushedEmail string `json:\"last_pushed_email\"`\n}\n\n// UsageReportOptions specifies optional parameters for the enhanced billing platform usage report.\ntype UsageReportOptions struct {\n\t// If specified, only return results for a single year. The value of year is an integer with four digits representing a year. For example, 2025.\n\t// Default value is the current year.\n\tYear *int `url:\"year,omitempty\"`\n\n\t// If specified, only return results for a single month. The value of month is an integer between 1 and 12.\n\t// If no year is specified the default year is used.\n\tMonth *int `url:\"month,omitempty\"`\n\n\t// If specified, only return results for a single day. The value of day is an integer between 1 and 31.\n\t// If no year or month is specified, the default year and month are used.\n\tDay *int `url:\"day,omitempty\"`\n\n\t// If specified, only return results for a single hour. The value of hour is an integer between 0 and 23.\n\t// If no year, month, or day is specified, the default year, month, and day are used.\n\tHour *int `url:\"hour,omitempty\"`\n}\n\n// PremiumRequestUsageReportOptions specifies optional parameters\n// for the enhanced billing platform premium request usage report.\ntype PremiumRequestUsageReportOptions struct {\n\t// If specified, only return results for a single year.\n\t// The value of year is an integer with four digits representing a year. For example, 2025.\n\t// Default value is the current year.\n\tYear *int `url:\"year,omitempty\"`\n\n\t// If specified, only return results for a single month.\n\t// The value of month is an integer between 1 and 12. Default value is the current month.\n\t// If no year is specified the default year is used.\n\tMonth *int `url:\"month,omitempty\"`\n\n\t// If specified, only return results for a single day.\n\t// The value of day is an integer between 1 and 31.\n\t// If no year or month is specified, the default year and month are used.\n\tDay *int `url:\"day,omitempty\"`\n\n\t// The user name to query usage for. The name is not case-sensitive.\n\tUser *string `url:\"user,omitempty\"`\n\n\t// The model name to query usage for. The name is not case-sensitive.\n\tModel *string `url:\"model,omitempty\"`\n\n\t// The product name to query usage for. The name is not case-sensitive.\n\tProduct *string `url:\"product,omitempty\"`\n}\n\n// UsageItem represents a single usage item in the enhanced billing platform report.\ntype UsageItem struct {\n\tDate           string  `json:\"date\"`\n\tProduct        string  `json:\"product\"`\n\tSKU            string  `json:\"sku\"`\n\tQuantity       float64 `json:\"quantity\"`\n\tUnitType       string  `json:\"unitType\"`\n\tPricePerUnit   float64 `json:\"pricePerUnit\"`\n\tGrossAmount    float64 `json:\"grossAmount\"`\n\tDiscountAmount float64 `json:\"discountAmount\"`\n\tNetAmount      float64 `json:\"netAmount\"`\n\tRepositoryName *string `json:\"repositoryName,omitempty\"`\n\t// Organization name is only used for organization-level reports.\n\tOrganizationName *string `json:\"organizationName,omitempty\"`\n}\n\n// UsageReport represents the enhanced billing platform usage report response.\ntype UsageReport struct {\n\tUsageItems []*UsageItem `json:\"usageItems,omitempty\"`\n}\n\n// PremiumRequestUsageItem represents a single usage line item in premium request usage reports.\ntype PremiumRequestUsageItem struct {\n\tProduct          string  `json:\"product\"`\n\tSKU              string  `json:\"sku\"`\n\tModel            string  `json:\"model\"`\n\tUnitType         string  `json:\"unitType\"`\n\tPricePerUnit     float64 `json:\"pricePerUnit\"`\n\tGrossQuantity    float64 `json:\"grossQuantity\"`\n\tGrossAmount      float64 `json:\"grossAmount\"`\n\tDiscountQuantity float64 `json:\"discountQuantity\"`\n\tDiscountAmount   float64 `json:\"discountAmount\"`\n\tNetQuantity      float64 `json:\"netQuantity\"`\n\tNetAmount        float64 `json:\"netAmount\"`\n}\n\n// PremiumRequestUsageTimePeriod represents a time period for premium request usage reports.\ntype PremiumRequestUsageTimePeriod struct {\n\tYear  int  `json:\"year\"`\n\tMonth *int `json:\"month,omitempty\"`\n\tDay   *int `json:\"day,omitempty\"`\n}\n\n// PremiumRequestUsageReport represents the premium request usage report response.\ntype PremiumRequestUsageReport struct {\n\tTimePeriod PremiumRequestUsageTimePeriod `json:\"timePeriod\"`\n\t// Organization is only set for organization-level reports.\n\tOrganization *string `json:\"organization,omitempty\"`\n\t// User is only set for user-level reports.\n\tUser       *string                    `json:\"user,omitempty\"`\n\tProduct    *string                    `json:\"product,omitempty\"`\n\tModel      *string                    `json:\"model,omitempty\"`\n\tUsageItems []*PremiumRequestUsageItem `json:\"usageItems\"`\n}\n\n// GetOrganizationPackagesBilling returns the free and paid storage used for GitHub Packages in gigabytes for an Org.\n//\n// This endpoint appears to have disappeared from the official GitHub v3 API documentation website.\n// See https://github.com/google/go-github/issues/3894 for details.\nfunc (s *BillingService) GetOrganizationPackagesBilling(ctx context.Context, org string) (*PackagesBilling, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/settings/billing/packages\", org)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar result *PackagesBilling\n\tresp, err := s.client.Do(ctx, req, &result)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn result, resp, nil\n}\n\n// GetOrganizationStorageBilling returns the estimated paid and estimated total storage used for GitHub Actions\n// and GitHub Packages in gigabytes for an Org.\n//\n// This endpoint appears to have disappeared from the official GitHub v3 API documentation website.\n// See https://github.com/google/go-github/issues/3894 for details.\nfunc (s *BillingService) GetOrganizationStorageBilling(ctx context.Context, org string) (*StorageBilling, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/settings/billing/shared-storage\", org)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar result *StorageBilling\n\tresp, err := s.client.Do(ctx, req, &result)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn result, resp, nil\n}\n\n// GetOrganizationAdvancedSecurityActiveCommitters returns the GitHub Advanced Security active committers for an organization per repository.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/billing#get-github-advanced-security-active-committers-for-an-organization\n//\n//meta:operation GET /orgs/{org}/settings/billing/advanced-security\nfunc (s *BillingService) GetOrganizationAdvancedSecurityActiveCommitters(ctx context.Context, org string, opts *ActiveCommittersListOptions) (*ActiveCommitters, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/settings/billing/advanced-security\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar result *ActiveCommitters\n\tresp, err := s.client.Do(ctx, req, &result)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn result, resp, nil\n}\n\n// GetPackagesBilling returns the free and paid storage used for GitHub Packages in gigabytes for a user.\n//\n// This endpoint appears to have disappeared from the official GitHub v3 API documentation website.\n// See https://github.com/google/go-github/issues/3894 for details.\nfunc (s *BillingService) GetPackagesBilling(ctx context.Context, user string) (*PackagesBilling, *Response, error) {\n\tu := fmt.Sprintf(\"users/%v/settings/billing/packages\", user)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar packagesUserBilling *PackagesBilling\n\tresp, err := s.client.Do(ctx, req, &packagesUserBilling)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn packagesUserBilling, resp, nil\n}\n\n// GetStorageBilling returns the estimated paid and estimated total storage used for GitHub Actions\n// and GitHub Packages in gigabytes for a user.\n//\n// This endpoint appears to have disappeared from the official GitHub v3 API documentation website.\n// See https://github.com/google/go-github/issues/3894 for details.\nfunc (s *BillingService) GetStorageBilling(ctx context.Context, user string) (*StorageBilling, *Response, error) {\n\tu := fmt.Sprintf(\"users/%v/settings/billing/shared-storage\", user)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar storageUserBilling *StorageBilling\n\tresp, err := s.client.Do(ctx, req, &storageUserBilling)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn storageUserBilling, resp, nil\n}\n\n// GetOrganizationUsageReport returns a report of the total usage for an organization using the enhanced billing platform.\n//\n// Note: This endpoint is only available to organizations with access to the enhanced billing platform.\n//\n// GitHub API docs: https://docs.github.com/rest/billing/usage#get-billing-usage-report-for-an-organization\n//\n//meta:operation GET /organizations/{org}/settings/billing/usage\nfunc (s *BillingService) GetOrganizationUsageReport(ctx context.Context, org string, opts *UsageReportOptions) (*UsageReport, *Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/settings/billing/usage\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar usageReport *UsageReport\n\tresp, err := s.client.Do(ctx, req, &usageReport)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn usageReport, resp, nil\n}\n\n// GetUsageReport returns a report of the total usage for a user using the enhanced billing platform.\n//\n// Note: This endpoint is only available to users with access to the enhanced billing platform.\n//\n// GitHub API docs: https://docs.github.com/rest/billing/usage#get-billing-usage-report-for-a-user\n//\n//meta:operation GET /users/{username}/settings/billing/usage\nfunc (s *BillingService) GetUsageReport(ctx context.Context, user string, opts *UsageReportOptions) (*UsageReport, *Response, error) {\n\tu := fmt.Sprintf(\"users/%v/settings/billing/usage\", user)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar usageReport *UsageReport\n\tresp, err := s.client.Do(ctx, req, &usageReport)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn usageReport, resp, nil\n}\n\n// GetOrganizationPremiumRequestUsageReport returns a report of the premium request\n// usage for an organization using the enhanced billing platform.\n//\n// Note: This endpoint is only available to organizations with access to the enhanced billing platform.\n//\n// GitHub API docs: https://docs.github.com/rest/billing/usage#get-billing-premium-request-usage-report-for-an-organization\n//\n//meta:operation GET /organizations/{org}/settings/billing/premium_request/usage\nfunc (s *BillingService) GetOrganizationPremiumRequestUsageReport(ctx context.Context, org string, opts *PremiumRequestUsageReportOptions) (*PremiumRequestUsageReport, *Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/settings/billing/premium_request/usage\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar premiumRequestUsageReport *PremiumRequestUsageReport\n\tresp, err := s.client.Do(ctx, req, &premiumRequestUsageReport)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn premiumRequestUsageReport, resp, nil\n}\n\n// GetPremiumRequestUsageReport returns a report of the premium request\n// usage for a user using the enhanced billing platform.\n//\n// Note: This endpoint is only available to users with access to the enhanced billing platform.\n//\n// GitHub API docs: https://docs.github.com/rest/billing/usage#get-billing-premium-request-usage-report-for-a-user\n//\n//meta:operation GET /users/{username}/settings/billing/premium_request/usage\nfunc (s *BillingService) GetPremiumRequestUsageReport(ctx context.Context, user string, opts *PremiumRequestUsageReportOptions) (*PremiumRequestUsageReport, *Response, error) {\n\tu := fmt.Sprintf(\"users/%v/settings/billing/premium_request/usage\", user)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar premiumRequestUsageReport *PremiumRequestUsageReport\n\tresp, err := s.client.Do(ctx, req, &premiumRequestUsageReport)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn premiumRequestUsageReport, resp, nil\n}\n"
  },
  {
    "path": "github/billing_test.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestBillingService_GetOrganizationPackagesBilling(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/settings/billing/packages\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\t\"total_gigabytes_bandwidth_used\": 50,\n\t\t\t\t\"total_paid_gigabytes_bandwidth_used\": 40,\n\t\t\t\t\"included_gigabytes_bandwidth\": 10\n\t\t\t}`)\n\t})\n\n\tctx := t.Context()\n\thook, _, err := client.Billing.GetOrganizationPackagesBilling(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Billing.GetOrganizationPackagesBilling returned error: %v\", err)\n\t}\n\n\twant := &PackagesBilling{\n\t\tTotalGigabytesBandwidthUsed:     50,\n\t\tTotalPaidGigabytesBandwidthUsed: 40,\n\t\tIncludedGigabytesBandwidth:      10,\n\t}\n\tif !cmp.Equal(hook, want) {\n\t\tt.Errorf(\"Billing.GetOrganizationPackagesBilling returned %+v, want %+v\", hook, want)\n\t}\n\n\tconst methodName = \"GetOrganizationPackagesBilling\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Billing.GetOrganizationPackagesBilling(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Billing.GetOrganizationPackagesBilling(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestBillingService_GetOrganizationPackagesBilling_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Billing.GetOrganizationPackagesBilling(ctx, \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestBillingService_GetOrganizationStorageBilling(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/settings/billing/shared-storage\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\t\"days_left_in_billing_cycle\": 20,\n\t\t\t\t\"estimated_paid_storage_for_month\": 15,\n\t\t\t\t\"estimated_storage_for_month\": 40\n\t\t\t}`)\n\t})\n\n\tctx := t.Context()\n\thook, _, err := client.Billing.GetOrganizationStorageBilling(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Billing.GetOrganizationStorageBilling returned error: %v\", err)\n\t}\n\n\twant := &StorageBilling{\n\t\tDaysLeftInBillingCycle:       20,\n\t\tEstimatedPaidStorageForMonth: 15,\n\t\tEstimatedStorageForMonth:     40,\n\t}\n\tif !cmp.Equal(hook, want) {\n\t\tt.Errorf(\"Billing.GetOrganizationStorageBilling returned %+v, want %+v\", hook, want)\n\t}\n\n\tconst methodName = \"GetOrganizationStorageBilling\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Billing.GetOrganizationStorageBilling(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Billing.GetOrganizationStorageBilling(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestBillingService_GetOrganizationStorageBilling_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Billing.GetOrganizationStorageBilling(ctx, \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestBillingService_GetPackagesBilling(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/settings/billing/packages\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\t\"total_gigabytes_bandwidth_used\": 50,\n\t\t\t\t\"total_paid_gigabytes_bandwidth_used\": 40,\n\t\t\t\t\"included_gigabytes_bandwidth\": 10\n\t\t\t}`)\n\t})\n\n\tctx := t.Context()\n\thook, _, err := client.Billing.GetPackagesBilling(ctx, \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Billing.GetPackagesBilling returned error: %v\", err)\n\t}\n\n\twant := &PackagesBilling{\n\t\tTotalGigabytesBandwidthUsed:     50,\n\t\tTotalPaidGigabytesBandwidthUsed: 40,\n\t\tIncludedGigabytesBandwidth:      10,\n\t}\n\tif !cmp.Equal(hook, want) {\n\t\tt.Errorf(\"Billing.GetPackagesBilling returned %+v, want %+v\", hook, want)\n\t}\n\n\tconst methodName = \"GetPackagesBilling\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Billing.GetPackagesBilling(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Billing.GetPackagesBilling(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestBillingService_GetPackagesBilling_invalidUser(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Billing.GetPackagesBilling(ctx, \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestBillingService_GetStorageBilling(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/settings/billing/shared-storage\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\t\"days_left_in_billing_cycle\": 20,\n\t\t\t\t\"estimated_paid_storage_for_month\": 15,\n\t\t\t\t\"estimated_storage_for_month\": 40\n\t\t\t}`)\n\t})\n\n\tctx := t.Context()\n\thook, _, err := client.Billing.GetStorageBilling(ctx, \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Billing.GetStorageBilling returned error: %v\", err)\n\t}\n\n\twant := &StorageBilling{\n\t\tDaysLeftInBillingCycle:       20,\n\t\tEstimatedPaidStorageForMonth: 15,\n\t\tEstimatedStorageForMonth:     40,\n\t}\n\tif !cmp.Equal(hook, want) {\n\t\tt.Errorf(\"Billing.GetStorageBilling returned %+v, want %+v\", hook, want)\n\t}\n\n\tconst methodName = \"GetStorageBilling\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Billing.GetStorageBilling(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Billing.GetStorageBilling(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestBillingService_GetStorageBilling_invalidUser(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Billing.GetStorageBilling(ctx, \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestMinutesUsedBreakdown_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &MinutesUsedBreakdown{}, \"{}\")\n\n\tu := &MinutesUsedBreakdown{\n\t\t\"UBUNTU\":  1,\n\t\t\"MACOS\":   1,\n\t\t\"WINDOWS\": 1,\n\t}\n\n\twant := `{\n\t\t\"UBUNTU\": 1,\n\t\t\"MACOS\": 1,\n\t\t\"WINDOWS\": 1\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPackagesBilling_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PackagesBilling{}, `{\n\t\t\"total_gigabytes_bandwidth_used\": 0,\n\t\t\"total_paid_gigabytes_bandwidth_used\": 0,\n\t\t\"included_gigabytes_bandwidth\": 0\n\t}`)\n\n\tu := &PackagesBilling{\n\t\tTotalGigabytesBandwidthUsed:     1,\n\t\tTotalPaidGigabytesBandwidthUsed: 1,\n\t\tIncludedGigabytesBandwidth:      1,\n\t}\n\n\twant := `{\n\t\t\"total_gigabytes_bandwidth_used\": 1,\n\t\t\"total_paid_gigabytes_bandwidth_used\": 1,\n\t\t\"included_gigabytes_bandwidth\": 1\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestStorageBilling_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &StorageBilling{}, `{\n\t\t\"days_left_in_billing_cycle\": 0,\n\t\t\"estimated_paid_storage_for_month\": 0,\n\t\t\"estimated_storage_for_month\": 0\n\t}`)\n\n\tu := &StorageBilling{\n\t\tDaysLeftInBillingCycle:       1,\n\t\tEstimatedPaidStorageForMonth: 1,\n\t\tEstimatedStorageForMonth:     1,\n\t}\n\n\twant := `{\n\t\t\"days_left_in_billing_cycle\": 1,\n\t\t\"estimated_paid_storage_for_month\": 1,\n\t\t\"estimated_storage_for_month\": 1\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestBillingService_GetOrganizationAdvancedSecurityActiveCommitters(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/settings/billing/advanced-security\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n  \"total_advanced_security_committers\": 2,\n  \"total_count\": 2,\n  \"maximum_advanced_security_committers\": 3,\n  \"purchased_advanced_security_committers\": 4,\n  \"repositories\": [\n    {\n      \"name\": \"octocat-org/Hello-World\",\n      \"advanced_security_committers\": 2,\n      \"advanced_security_committers_breakdown\": [\n        {\n          \"user_login\": \"octokitten\",\n          \"last_pushed_date\": \"2021-10-25\",\n          \"last_pushed_email\": \"octokitten@example.com\"\n        }\n      ]\n    }\n  ]\n}`)\n\t})\n\n\tctx := t.Context()\n\topts := &ActiveCommittersListOptions{\n\t\tnil,\n\t\tListOptions{Page: 2, PerPage: 50},\n\t}\n\thook, _, err := client.Billing.GetOrganizationAdvancedSecurityActiveCommitters(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Billing.GetOrganizationAdvancedSecurityActiveCommitters returned error: %v\", err)\n\t}\n\n\twant := &ActiveCommitters{\n\t\tTotalAdvancedSecurityCommitters:     Ptr(2),\n\t\tTotalCount:                          Ptr(2),\n\t\tMaximumAdvancedSecurityCommitters:   Ptr(3),\n\t\tPurchasedAdvancedSecurityCommitters: Ptr(4),\n\t\tRepositories: []*RepositoryActiveCommitters{\n\t\t\t{\n\t\t\t\tName:                       \"octocat-org/Hello-World\",\n\t\t\t\tAdvancedSecurityCommitters: 2,\n\t\t\t\tAdvancedSecurityCommittersBreakdown: []*AdvancedSecurityCommittersBreakdown{\n\t\t\t\t\t{\n\t\t\t\t\t\tUserLogin:       \"octokitten\",\n\t\t\t\t\t\tLastPushedDate:  \"2021-10-25\",\n\t\t\t\t\t\tLastPushedEmail: \"octokitten@example.com\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(hook, want) {\n\t\tt.Errorf(\"Billing.GetOrganizationAdvancedSecurityActiveCommitters returned %+v, want %+v\", hook, want)\n\t}\n\n\tconst methodName = \"GetOrganizationAdvancedSecurityActiveCommitters\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Billing.GetOrganizationAdvancedSecurityActiveCommitters(ctx, \"\\n\", nil)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Billing.GetOrganizationAdvancedSecurityActiveCommitters(ctx, \"o\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestBillingService_GetOrganizationAdvancedSecurityActiveCommitters_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Billing.GetOrganizationAdvancedSecurityActiveCommitters(ctx, \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestBillingService_GetOrganizationUsageReport(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/o/settings/billing/usage\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"year\":  \"2023\",\n\t\t\t\"month\": \"8\",\n\t\t})\n\t\tfmt.Fprint(w, `{\n\t\t\t\"usageItems\": [\n\t\t\t\t{\n\t\t\t\t\t\"date\": \"2023-08-01\",\n\t\t\t\t\t\"product\": \"Actions\",\n\t\t\t\t\t\"sku\": \"Actions Linux\",\n\t\t\t\t\t\"quantity\": 100,\n\t\t\t\t\t\"unitType\": \"minutes\",\n\t\t\t\t\t\"pricePerUnit\": 0.008,\n\t\t\t\t\t\"grossAmount\": 0.8,\n\t\t\t\t\t\"discountAmount\": 0,\n\t\t\t\t\t\"netAmount\": 0.8,\n\t\t\t\t\t\"organizationName\": \"GitHub\",\n\t\t\t\t\t\"repositoryName\": \"github/example\"\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\topts := &UsageReportOptions{\n\t\tYear:  Ptr(2023),\n\t\tMonth: Ptr(8),\n\t}\n\treport, _, err := client.Billing.GetOrganizationUsageReport(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Billing.GetOrganizationUsageReport returned error: %v\", err)\n\t}\n\n\twant := &UsageReport{\n\t\tUsageItems: []*UsageItem{\n\t\t\t{\n\t\t\t\tDate:             \"2023-08-01\",\n\t\t\t\tProduct:          \"Actions\",\n\t\t\t\tSKU:              \"Actions Linux\",\n\t\t\t\tQuantity:         100.0,\n\t\t\t\tUnitType:         \"minutes\",\n\t\t\t\tPricePerUnit:     0.008,\n\t\t\t\tGrossAmount:      0.8,\n\t\t\t\tDiscountAmount:   0.0,\n\t\t\t\tNetAmount:        0.8,\n\t\t\t\tOrganizationName: Ptr(\"GitHub\"),\n\t\t\t\tRepositoryName:   Ptr(\"github/example\"),\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(report, want) {\n\t\tt.Errorf(\"Billing.GetOrganizationUsageReport returned %+v, want %+v\", report, want)\n\t}\n\n\tconst methodName = \"GetOrganizationUsageReport\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Billing.GetOrganizationUsageReport(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Billing.GetOrganizationUsageReport(ctx, \"o\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestBillingService_GetOrganizationUsageReport_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Billing.GetOrganizationUsageReport(ctx, \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestBillingService_GetUsageReport(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/settings/billing/usage\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"day\": \"15\",\n\t\t})\n\t\tfmt.Fprint(w, `{\n\t\t\t\"usageItems\": [\n\t\t\t\t{\n\t\t\t\t\t\"date\": \"2023-08-15\",\n\t\t\t\t\t\"product\": \"Codespaces\",\n\t\t\t\t\t\"sku\": \"Codespaces Linux\",\n\t\t\t\t\t\"quantity\": 50,\n\t\t\t\t\t\"unitType\": \"hours\",\n\t\t\t\t\t\"pricePerUnit\": 0.18,\n\t\t\t\t\t\"grossAmount\": 9.0,\n\t\t\t\t\t\"discountAmount\": 1.0,\n\t\t\t\t\t\"netAmount\": 8.0,\n\t\t\t\t\t\"repositoryName\": \"user/example\"\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\topts := &UsageReportOptions{\n\t\tDay: Ptr(15),\n\t}\n\treport, _, err := client.Billing.GetUsageReport(ctx, \"u\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Billing.GetUsageReport returned error: %v\", err)\n\t}\n\n\twant := &UsageReport{\n\t\tUsageItems: []*UsageItem{\n\t\t\t{\n\t\t\t\tDate:           \"2023-08-15\",\n\t\t\t\tProduct:        \"Codespaces\",\n\t\t\t\tSKU:            \"Codespaces Linux\",\n\t\t\t\tQuantity:       50.0,\n\t\t\t\tUnitType:       \"hours\",\n\t\t\t\tPricePerUnit:   0.18,\n\t\t\t\tGrossAmount:    9.0,\n\t\t\t\tDiscountAmount: 1.0,\n\t\t\t\tNetAmount:      8.0,\n\t\t\t\tRepositoryName: Ptr(\"user/example\"),\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(report, want) {\n\t\tt.Errorf(\"Billing.GetUsageReport returned %+v, want %+v\", report, want)\n\t}\n\n\tconst methodName = \"GetUsageReport\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Billing.GetUsageReport(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Billing.GetUsageReport(ctx, \"u\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestBillingService_GetUsageReport_invalidUser(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Billing.GetUsageReport(ctx, \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestBillingService_GetOrganizationPremiumRequestUsageReport(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tmux.HandleFunc(\"/organizations/o/settings/billing/premium_request/usage\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"year\":  \"2025\",\n\t\t\t\"month\": \"10\",\n\t\t\t\"user\":  \"testuser\",\n\t\t})\n\t\tfmt.Fprint(w, `{\n\t\t\t\"timePeriod\": {\n\t\t\t\t\"year\": 2025,\n\t\t\t\t\"month\": 10\n\t\t\t},\n\t\t\t\"organization\": \"GitHub\",\n\t\t\t\"user\": \"testuser\",\n\t\t\t\"product\": \"Copilot\",\n\t\t\t\"model\": \"GPT-5\",\n\t\t\t\"usageItems\": [\n\t\t\t\t{\n\t\t\t\t\t\"product\": \"Copilot\",\n\t\t\t\t\t\"sku\": \"Copilot Premium Request\",\n\t\t\t\t\t\"model\": \"GPT-5\",\n\t\t\t\t\t\"unitType\": \"requests\",\n\t\t\t\t\t\"pricePerUnit\": 0.04,\n\t\t\t\t\t\"grossQuantity\": 100,\n\t\t\t\t\t\"grossAmount\": 4.0,\n\t\t\t\t\t\"discountQuantity\": 0,\n\t\t\t\t\t\"discountAmount\": 0.0,\n\t\t\t\t\t\"netQuantity\": 100,\n\t\t\t\t\t\"netAmount\": 4.0\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\tctx := t.Context()\n\topts := &PremiumRequestUsageReportOptions{\n\t\tYear:  Ptr(2025),\n\t\tMonth: Ptr(10),\n\t\tUser:  Ptr(\"testuser\"),\n\t}\n\treport, _, err := client.Billing.GetOrganizationPremiumRequestUsageReport(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Billing.GetOrganizationPremiumRequestUsageReport returned error: %v\", err)\n\t}\n\twant := &PremiumRequestUsageReport{\n\t\tTimePeriod: PremiumRequestUsageTimePeriod{\n\t\t\tYear:  2025,\n\t\t\tMonth: Ptr(10),\n\t\t},\n\t\tOrganization: Ptr(\"GitHub\"),\n\t\tUser:         Ptr(\"testuser\"),\n\t\tProduct:      Ptr(\"Copilot\"),\n\t\tModel:        Ptr(\"GPT-5\"),\n\t\tUsageItems: []*PremiumRequestUsageItem{\n\t\t\t{\n\t\t\t\tProduct:          \"Copilot\",\n\t\t\t\tSKU:              \"Copilot Premium Request\",\n\t\t\t\tModel:            \"GPT-5\",\n\t\t\t\tUnitType:         \"requests\",\n\t\t\t\tPricePerUnit:     0.04,\n\t\t\t\tGrossQuantity:    100.0,\n\t\t\t\tGrossAmount:      4.0,\n\t\t\t\tDiscountQuantity: 0.0,\n\t\t\t\tDiscountAmount:   0.0,\n\t\t\t\tNetQuantity:      100.0,\n\t\t\t\tNetAmount:        4.0,\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(report, want) {\n\t\tt.Errorf(\"Billing.GetOrganizationPremiumRequestUsageReport returned %+v, want %+v\", report, want)\n\t}\n\n\tconst methodName = \"GetOrganizationPremiumRequestUsageReport\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Billing.GetOrganizationPremiumRequestUsageReport(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Billing.GetOrganizationPremiumRequestUsageReport(ctx, \"o\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestBillingService_GetOrganizationPremiumRequestUsageReport_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Billing.GetOrganizationPremiumRequestUsageReport(ctx, \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestBillingService_GetPremiumRequestUsageReport(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tmux.HandleFunc(\"/users/u/settings/billing/premium_request/usage\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"year\": \"2025\",\n\t\t\t\"day\":  \"15\",\n\t\t})\n\t\tfmt.Fprint(w, `{\n\t\t\t\"timePeriod\": {\n\t\t\t\t\"year\": 2025,\n\t\t\t\t\"day\": 15\n\t\t\t},\n\t\t\t\"user\": \"User\",\n\t\t\t\"product\": \"Copilot\",\n\t\t\t\"usageItems\": [\n\t\t\t\t{\n\t\t\t\t\t\"product\": \"Copilot\",\n\t\t\t\t\t\"sku\": \"Copilot Premium Request\",\n\t\t\t\t\t\"model\": \"GPT-4\",\n\t\t\t\t\t\"unitType\": \"requests\",\n\t\t\t\t\t\"pricePerUnit\": 0.02,\n\t\t\t\t\t\"grossQuantity\": 50,\n\t\t\t\t\t\"grossAmount\": 1.0,\n\t\t\t\t\t\"discountQuantity\": 5,\n\t\t\t\t\t\"discountAmount\": 0.1,\n\t\t\t\t\t\"netQuantity\": 45,\n\t\t\t\t\t\"netAmount\": 0.9\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\tctx := t.Context()\n\topts := &PremiumRequestUsageReportOptions{\n\t\tYear: Ptr(2025),\n\t\tDay:  Ptr(15),\n\t}\n\treport, _, err := client.Billing.GetPremiumRequestUsageReport(ctx, \"u\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Billing.GetPremiumRequestUsageReport returned error: %v\", err)\n\t}\n\twant := &PremiumRequestUsageReport{\n\t\tTimePeriod: PremiumRequestUsageTimePeriod{\n\t\t\tYear: 2025,\n\t\t\tDay:  Ptr(15),\n\t\t},\n\t\tUser:    Ptr(\"User\"),\n\t\tProduct: Ptr(\"Copilot\"),\n\t\tUsageItems: []*PremiumRequestUsageItem{\n\t\t\t{\n\t\t\t\tProduct:          \"Copilot\",\n\t\t\t\tSKU:              \"Copilot Premium Request\",\n\t\t\t\tModel:            \"GPT-4\",\n\t\t\t\tUnitType:         \"requests\",\n\t\t\t\tPricePerUnit:     0.02,\n\t\t\t\tGrossQuantity:    50.0,\n\t\t\t\tGrossAmount:      1.0,\n\t\t\t\tDiscountQuantity: 5.0,\n\t\t\t\tDiscountAmount:   0.1,\n\t\t\t\tNetQuantity:      45.0,\n\t\t\t\tNetAmount:        0.9,\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(report, want) {\n\t\tt.Errorf(\"Billing.GetPremiumRequestUsageReport returned %+v, want %+v\", report, want)\n\t}\n\n\tconst methodName = \"GetPremiumRequestUsageReport\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Billing.GetPremiumRequestUsageReport(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Billing.GetPremiumRequestUsageReport(ctx, \"u\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestBillingService_GetPremiumRequestUsageReport_invalidUser(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Billing.GetPremiumRequestUsageReport(ctx, \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestBillingService_PremiumRequestUsageItem_FloatQuantities(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tmux.HandleFunc(\"/organizations/o/settings/billing/premium_request/usage\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"timePeriod\": {\n\t\t\t\t\"year\": 2026,\n\t\t\t\t\"month\": 2\n\t\t\t},\n\t\t\t\"organization\": \"testorg\",\n\t\t\t\"usageItems\": [\n\t\t\t\t{\n\t\t\t\t\t\"product\": \"Copilot\",\n\t\t\t\t\t\"sku\": \"Copilot Premium Request\",\n\t\t\t\t\t\"model\": \"GPT-5.2\",\n\t\t\t\t\t\"unitType\": \"requests\",\n\t\t\t\t\t\"pricePerUnit\": 0.04,\n\t\t\t\t\t\"grossQuantity\": 5054.0,\n\t\t\t\t\t\"grossAmount\": 202.16,\n\t\t\t\t\t\"discountQuantity\": 4974.0,\n\t\t\t\t\t\"discountAmount\": 198.96,\n\t\t\t\t\t\"netQuantity\": 80.0,\n\t\t\t\t\t\"netAmount\": 3.2\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\tctx := t.Context()\n\treport, _, err := client.Billing.GetOrganizationPremiumRequestUsageReport(ctx, \"o\", nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Billing.GetOrganizationPremiumRequestUsageReport returned error: %v\", err)\n\t}\n\twant := &PremiumRequestUsageReport{\n\t\tTimePeriod: PremiumRequestUsageTimePeriod{\n\t\t\tYear:  2026,\n\t\t\tMonth: Ptr(2),\n\t\t},\n\t\tOrganization: Ptr(\"testorg\"),\n\t\tUsageItems: []*PremiumRequestUsageItem{\n\t\t\t{\n\t\t\t\tProduct:          \"Copilot\",\n\t\t\t\tSKU:              \"Copilot Premium Request\",\n\t\t\t\tModel:            \"GPT-5.2\",\n\t\t\t\tUnitType:         \"requests\",\n\t\t\t\tPricePerUnit:     0.04,\n\t\t\t\tGrossQuantity:    5054.0,\n\t\t\t\tGrossAmount:      202.16,\n\t\t\t\tDiscountQuantity: 4974.0,\n\t\t\t\tDiscountAmount:   198.96,\n\t\t\t\tNetQuantity:      80.0,\n\t\t\t\tNetAmount:        3.2,\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(report, want) {\n\t\tt.Errorf(\"Billing.GetOrganizationPremiumRequestUsageReport returned %+v, want %+v\", report, want)\n\t}\n}\n"
  },
  {
    "path": "github/checks.go",
    "content": "// Copyright 2018 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// ChecksService provides access to the Checks API in the\n// GitHub API.\n//\n// GitHub API docs: https://docs.github.com/rest/checks/\ntype ChecksService service\n\n// CheckRun represents a GitHub check run on a repository associated with a GitHub app.\ntype CheckRun struct {\n\tID           *int64          `json:\"id,omitempty\"`\n\tNodeID       *string         `json:\"node_id,omitempty\"`\n\tHeadSHA      *string         `json:\"head_sha,omitempty\"`\n\tExternalID   *string         `json:\"external_id,omitempty\"`\n\tURL          *string         `json:\"url,omitempty\"`\n\tHTMLURL      *string         `json:\"html_url,omitempty\"`\n\tDetailsURL   *string         `json:\"details_url,omitempty\"`\n\tStatus       *string         `json:\"status,omitempty\"`\n\tConclusion   *string         `json:\"conclusion,omitempty\"`\n\tStartedAt    *Timestamp      `json:\"started_at,omitempty\"`\n\tCompletedAt  *Timestamp      `json:\"completed_at,omitempty\"`\n\tOutput       *CheckRunOutput `json:\"output,omitempty\"`\n\tName         *string         `json:\"name,omitempty\"`\n\tCheckSuite   *CheckSuite     `json:\"check_suite,omitempty\"`\n\tApp          *App            `json:\"app,omitempty\"`\n\tPullRequests []*PullRequest  `json:\"pull_requests,omitempty\"`\n}\n\n// CheckRunOutput represents the output of a CheckRun.\ntype CheckRunOutput struct {\n\tTitle            *string               `json:\"title,omitempty\"`\n\tSummary          *string               `json:\"summary,omitempty\"`\n\tText             *string               `json:\"text,omitempty\"`\n\tAnnotationsCount *int                  `json:\"annotations_count,omitempty\"`\n\tAnnotationsURL   *string               `json:\"annotations_url,omitempty\"`\n\tAnnotations      []*CheckRunAnnotation `json:\"annotations,omitempty\"`\n\tImages           []*CheckRunImage      `json:\"images,omitempty\"`\n}\n\n// CheckRunAnnotation represents an annotation object for a CheckRun output.\ntype CheckRunAnnotation struct {\n\tPath            *string `json:\"path,omitempty\"`\n\tStartLine       *int    `json:\"start_line,omitempty\"`\n\tEndLine         *int    `json:\"end_line,omitempty\"`\n\tStartColumn     *int    `json:\"start_column,omitempty\"`\n\tEndColumn       *int    `json:\"end_column,omitempty\"`\n\tAnnotationLevel *string `json:\"annotation_level,omitempty\"`\n\tMessage         *string `json:\"message,omitempty\"`\n\tTitle           *string `json:\"title,omitempty\"`\n\tRawDetails      *string `json:\"raw_details,omitempty\"`\n}\n\n// CheckRunImage represents an image object for a CheckRun output.\ntype CheckRunImage struct {\n\tAlt      *string `json:\"alt,omitempty\"`\n\tImageURL *string `json:\"image_url,omitempty\"`\n\tCaption  *string `json:\"caption,omitempty\"`\n}\n\n// CheckSuite represents a suite of check runs.\ntype CheckSuite struct {\n\tID           *int64         `json:\"id,omitempty\"`\n\tNodeID       *string        `json:\"node_id,omitempty\"`\n\tHeadBranch   *string        `json:\"head_branch,omitempty\"`\n\tHeadSHA      *string        `json:\"head_sha,omitempty\"`\n\tURL          *string        `json:\"url,omitempty\"`\n\tBeforeSHA    *string        `json:\"before,omitempty\"`\n\tAfterSHA     *string        `json:\"after,omitempty\"`\n\tStatus       *string        `json:\"status,omitempty\"`\n\tConclusion   *string        `json:\"conclusion,omitempty\"`\n\tCreatedAt    *Timestamp     `json:\"created_at,omitempty\"`\n\tUpdatedAt    *Timestamp     `json:\"updated_at,omitempty\"`\n\tApp          *App           `json:\"app,omitempty\"`\n\tRepository   *Repository    `json:\"repository,omitempty\"`\n\tPullRequests []*PullRequest `json:\"pull_requests,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tHeadCommit           *Commit `json:\"head_commit,omitempty\"`\n\tLatestCheckRunsCount *int64  `json:\"latest_check_runs_count,omitempty\"`\n\tRerequestable        *bool   `json:\"rerequestable,omitempty\"`\n\tRunsRerequestable    *bool   `json:\"runs_rerequestable,omitempty\"`\n}\n\nfunc (c CheckRun) String() string {\n\treturn Stringify(c)\n}\n\nfunc (c CheckSuite) String() string {\n\treturn Stringify(c)\n}\n\n// GetCheckRun gets a check-run for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/checks/runs#get-a-check-run\n//\n//meta:operation GET /repos/{owner}/{repo}/check-runs/{check_run_id}\nfunc (s *ChecksService) GetCheckRun(ctx context.Context, owner, repo string, checkRunID int64) (*CheckRun, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/check-runs/%v\", owner, repo, checkRunID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeCheckRunsPreview)\n\n\tvar checkRun *CheckRun\n\tresp, err := s.client.Do(ctx, req, &checkRun)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn checkRun, resp, nil\n}\n\n// GetCheckSuite gets a single check suite.\n//\n// GitHub API docs: https://docs.github.com/rest/checks/suites#get-a-check-suite\n//\n//meta:operation GET /repos/{owner}/{repo}/check-suites/{check_suite_id}\nfunc (s *ChecksService) GetCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64) (*CheckSuite, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/check-suites/%v\", owner, repo, checkSuiteID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeCheckRunsPreview)\n\n\tvar checkSuite *CheckSuite\n\tresp, err := s.client.Do(ctx, req, &checkSuite)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn checkSuite, resp, nil\n}\n\n// CreateCheckRunOptions sets up parameters needed to create a CheckRun.\ntype CreateCheckRunOptions struct {\n\tName        string            `json:\"name\"`                   // The name of the check (e.g., \"code-coverage\"). (Required.)\n\tHeadSHA     string            `json:\"head_sha\"`               // The SHA of the commit. (Required.)\n\tDetailsURL  *string           `json:\"details_url,omitempty\"`  // The URL of the integrator's site that has the full details of the check. (Optional.)\n\tExternalID  *string           `json:\"external_id,omitempty\"`  // A reference for the run on the integrator's system. (Optional.)\n\tStatus      *string           `json:\"status,omitempty\"`       // The current status. Can be one of \"queued\", \"in_progress\", or \"completed\". Default: \"queued\". (Optional.)\n\tConclusion  *string           `json:\"conclusion,omitempty\"`   // Can be one of \"success\", \"failure\", \"neutral\", \"cancelled\", \"skipped\", \"timed_out\", or \"action_required\". (Optional. Required if you provide a status of \"completed\".)\n\tStartedAt   *Timestamp        `json:\"started_at,omitempty\"`   // The time that the check run began. (Optional.)\n\tCompletedAt *Timestamp        `json:\"completed_at,omitempty\"` // The time the check completed. (Optional. Required if you provide conclusion.)\n\tOutput      *CheckRunOutput   `json:\"output,omitempty\"`       // Provide descriptive details about the run. (Optional)\n\tActions     []*CheckRunAction `json:\"actions,omitempty\"`      // Possible further actions the integrator can perform, which a user may trigger. (Optional.)\n}\n\n// CheckRunAction exposes further actions the integrator can perform, which a user may trigger.\ntype CheckRunAction struct {\n\tLabel       string `json:\"label\"`       // The text to be displayed on a button in the web UI. The maximum size is 20 characters. (Required.)\n\tDescription string `json:\"description\"` // A short explanation of what this action would do. The maximum size is 40 characters. (Required.)\n\tIdentifier  string `json:\"identifier\"`  // A reference for the action on the integrator's system. The maximum size is 20 characters. (Required.)\n}\n\n// CreateCheckRun creates a check run for repository.\n//\n// GitHub API docs: https://docs.github.com/rest/checks/runs#create-a-check-run\n//\n//meta:operation POST /repos/{owner}/{repo}/check-runs\nfunc (s *ChecksService) CreateCheckRun(ctx context.Context, owner, repo string, opts CreateCheckRunOptions) (*CheckRun, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/check-runs\", owner, repo)\n\treq, err := s.client.NewRequest(\"POST\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeCheckRunsPreview)\n\n\tvar checkRun *CheckRun\n\tresp, err := s.client.Do(ctx, req, &checkRun)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn checkRun, resp, nil\n}\n\n// UpdateCheckRunOptions sets up parameters needed to update a CheckRun.\ntype UpdateCheckRunOptions struct {\n\tName        string            `json:\"name\"`                   // The name of the check (e.g., \"code-coverage\"). (Required.)\n\tDetailsURL  *string           `json:\"details_url,omitempty\"`  // The URL of the integrator's site that has the full details of the check. (Optional.)\n\tExternalID  *string           `json:\"external_id,omitempty\"`  // A reference for the run on the integrator's system. (Optional.)\n\tStatus      *string           `json:\"status,omitempty\"`       // The current status. Can be one of \"queued\", \"in_progress\", or \"completed\". Default: \"queued\". (Optional.)\n\tConclusion  *string           `json:\"conclusion,omitempty\"`   // Can be one of \"success\", \"failure\", \"neutral\", \"cancelled\", \"skipped\", \"timed_out\", or \"action_required\". (Optional. Required if you provide a status of \"completed\".)\n\tCompletedAt *Timestamp        `json:\"completed_at,omitempty\"` // The time the check completed. (Optional. Required if you provide conclusion.)\n\tOutput      *CheckRunOutput   `json:\"output,omitempty\"`       // Provide descriptive details about the run. (Optional)\n\tActions     []*CheckRunAction `json:\"actions,omitempty\"`      // Possible further actions the integrator can perform, which a user may trigger. (Optional.)\n}\n\n// UpdateCheckRun updates a check run for a specific commit in a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/checks/runs#update-a-check-run\n//\n//meta:operation PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}\nfunc (s *ChecksService) UpdateCheckRun(ctx context.Context, owner, repo string, checkRunID int64, opts UpdateCheckRunOptions) (*CheckRun, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/check-runs/%v\", owner, repo, checkRunID)\n\treq, err := s.client.NewRequest(\"PATCH\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeCheckRunsPreview)\n\n\tvar checkRun *CheckRun\n\tresp, err := s.client.Do(ctx, req, &checkRun)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn checkRun, resp, nil\n}\n\n// ListCheckRunAnnotations lists the annotations for a check run.\n//\n// GitHub API docs: https://docs.github.com/rest/checks/runs#list-check-run-annotations\n//\n//meta:operation GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\nfunc (s *ChecksService) ListCheckRunAnnotations(ctx context.Context, owner, repo string, checkRunID int64, opts *ListOptions) ([]*CheckRunAnnotation, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/check-runs/%v/annotations\", owner, repo, checkRunID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeCheckRunsPreview)\n\n\tvar checkRunAnnotations []*CheckRunAnnotation\n\tresp, err := s.client.Do(ctx, req, &checkRunAnnotations)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn checkRunAnnotations, resp, nil\n}\n\n// ListCheckRunsOptions represents parameters to list check runs.\ntype ListCheckRunsOptions struct {\n\tCheckName *string `url:\"check_name,omitempty\"` // Returns check runs with the specified name.\n\tStatus    *string `url:\"status,omitempty\"`     // Returns check runs with the specified status. Can be one of \"queued\", \"in_progress\", or \"completed\".\n\tFilter    *string `url:\"filter,omitempty\"`     // Filters check runs by their completed_at timestamp. Can be one of \"latest\" (returning the most recent check runs) or \"all\". Default: \"latest\"\n\tAppID     *int64  `url:\"app_id,omitempty\"`     // Filters check runs by GitHub App ID.\n\n\tListOptions\n}\n\n// ListCheckRunsResults represents the result of a check run list.\ntype ListCheckRunsResults struct {\n\tTotal     *int        `json:\"total_count,omitempty\"`\n\tCheckRuns []*CheckRun `json:\"check_runs,omitempty\"`\n}\n\n// ListCheckRunsForRef lists check runs for a specific ref.\n// The ref can be a commit SHA, branch name `heads/<branch name>`, or tag name `tags/<tag name>`.\n// For more information, see \"Git References\" in the Git documentation https://git-scm.com/book/en/v2/Git-Internals-Git-References.\n//\n// GitHub API docs: https://docs.github.com/rest/checks/runs#list-check-runs-for-a-git-reference\n//\n//meta:operation GET /repos/{owner}/{repo}/commits/{ref}/check-runs\nfunc (s *ChecksService) ListCheckRunsForRef(ctx context.Context, owner, repo, ref string, opts *ListCheckRunsOptions) (*ListCheckRunsResults, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/commits/%v/check-runs\", owner, repo, refURLEscape(ref))\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeCheckRunsPreview)\n\n\tvar checkRunResults *ListCheckRunsResults\n\tresp, err := s.client.Do(ctx, req, &checkRunResults)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn checkRunResults, resp, nil\n}\n\n// ListCheckRunsCheckSuite lists check runs for a check suite.\n//\n// GitHub API docs: https://docs.github.com/rest/checks/runs#list-check-runs-in-a-check-suite\n//\n//meta:operation GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\nfunc (s *ChecksService) ListCheckRunsCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64, opts *ListCheckRunsOptions) (*ListCheckRunsResults, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/check-suites/%v/check-runs\", owner, repo, checkSuiteID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeCheckRunsPreview)\n\n\tvar checkRunResults *ListCheckRunsResults\n\tresp, err := s.client.Do(ctx, req, &checkRunResults)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn checkRunResults, resp, nil\n}\n\n// ReRequestCheckRun triggers GitHub to rerequest an existing check run.\n//\n// GitHub API docs: https://docs.github.com/rest/checks/runs#rerequest-a-check-run\n//\n//meta:operation POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest\nfunc (s *ChecksService) ReRequestCheckRun(ctx context.Context, owner, repo string, checkRunID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/check-runs/%v/rerequest\", owner, repo, checkRunID)\n\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeCheckRunsPreview)\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// ListCheckSuiteOptions represents parameters to list check suites.\ntype ListCheckSuiteOptions struct {\n\tCheckName *string `url:\"check_name,omitempty\"` // Filters checks suites by the name of the check run.\n\tAppID     *int64  `url:\"app_id,omitempty\"`     // Filters check suites by GitHub App id.\n\n\tListOptions\n}\n\n// ListCheckSuiteResults represents the result of a check run list.\ntype ListCheckSuiteResults struct {\n\tTotal       *int          `json:\"total_count,omitempty\"`\n\tCheckSuites []*CheckSuite `json:\"check_suites,omitempty\"`\n}\n\n// ListCheckSuitesForRef lists check suite for a specific ref.\n// The ref can be a commit SHA, branch name `heads/<branch name>`, or tag name `tags/<tag name>`.\n// For more information, see \"Git References\" in the Git documentation https://git-scm.com/book/en/v2/Git-Internals-Git-References.\n//\n// GitHub API docs: https://docs.github.com/rest/checks/suites#list-check-suites-for-a-git-reference\n//\n//meta:operation GET /repos/{owner}/{repo}/commits/{ref}/check-suites\nfunc (s *ChecksService) ListCheckSuitesForRef(ctx context.Context, owner, repo, ref string, opts *ListCheckSuiteOptions) (*ListCheckSuiteResults, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/commits/%v/check-suites\", owner, repo, refURLEscape(ref))\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeCheckRunsPreview)\n\n\tvar checkSuiteResults *ListCheckSuiteResults\n\tresp, err := s.client.Do(ctx, req, &checkSuiteResults)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn checkSuiteResults, resp, nil\n}\n\n// AutoTriggerCheck enables or disables automatic creation of CheckSuite events upon pushes to the repository.\ntype AutoTriggerCheck struct {\n\tAppID   *int64 `json:\"app_id,omitempty\"`  // The id of the GitHub App. (Required.)\n\tSetting *bool  `json:\"setting,omitempty\"` // Set to \"true\" to enable automatic creation of CheckSuite events upon pushes to the repository, or \"false\" to disable them. Default: \"true\" (Required.)\n}\n\n// CheckSuitePreferenceOptions set options for check suite preferences for a repository.\ntype CheckSuitePreferenceOptions struct {\n\tAutoTriggerChecks []*AutoTriggerCheck `json:\"auto_trigger_checks,omitempty\"` // A slice of auto trigger checks that can be set for a check suite in a repository.\n}\n\n// CheckSuitePreferenceResults represents the results of the preference set operation.\ntype CheckSuitePreferenceResults struct {\n\tPreferences *PreferenceList `json:\"preferences,omitempty\"`\n\tRepository  *Repository     `json:\"repository,omitempty\"`\n}\n\n// PreferenceList represents a list of auto trigger checks for repository.\ntype PreferenceList struct {\n\tAutoTriggerChecks []*AutoTriggerCheck `json:\"auto_trigger_checks,omitempty\"` // A slice of auto trigger checks that can be set for a check suite in a repository.\n}\n\n// SetCheckSuitePreferences changes the default automatic flow when creating check suites.\n//\n// GitHub API docs: https://docs.github.com/rest/checks/suites#update-repository-preferences-for-check-suites\n//\n//meta:operation PATCH /repos/{owner}/{repo}/check-suites/preferences\nfunc (s *ChecksService) SetCheckSuitePreferences(ctx context.Context, owner, repo string, opts CheckSuitePreferenceOptions) (*CheckSuitePreferenceResults, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/check-suites/preferences\", owner, repo)\n\treq, err := s.client.NewRequest(\"PATCH\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeCheckRunsPreview)\n\n\tvar checkSuitePrefResults *CheckSuitePreferenceResults\n\tresp, err := s.client.Do(ctx, req, &checkSuitePrefResults)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn checkSuitePrefResults, resp, nil\n}\n\n// CreateCheckSuiteOptions sets up parameters to manually create a check suite.\ntype CreateCheckSuiteOptions struct {\n\tHeadSHA    string  `json:\"head_sha\"`              // The sha of the head commit. (Required.)\n\tHeadBranch *string `json:\"head_branch,omitempty\"` // The name of the head branch where the code changes are implemented.\n}\n\n// CreateCheckSuite manually creates a check suite for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/checks/suites#create-a-check-suite\n//\n//meta:operation POST /repos/{owner}/{repo}/check-suites\nfunc (s *ChecksService) CreateCheckSuite(ctx context.Context, owner, repo string, opts CreateCheckSuiteOptions) (*CheckSuite, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/check-suites\", owner, repo)\n\treq, err := s.client.NewRequest(\"POST\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeCheckRunsPreview)\n\n\tvar checkSuite *CheckSuite\n\tresp, err := s.client.Do(ctx, req, &checkSuite)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn checkSuite, resp, nil\n}\n\n// ReRequestCheckSuite triggers GitHub to rerequest an existing check suite, without pushing new code to a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/checks/suites#rerequest-a-check-suite\n//\n//meta:operation POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest\nfunc (s *ChecksService) ReRequestCheckSuite(ctx context.Context, owner, repo string, checkSuiteID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/check-suites/%v/rerequest\", owner, repo, checkSuiteID)\n\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeCheckRunsPreview)\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\treturn resp, err\n}\n"
  },
  {
    "path": "github/checks_test.go",
    "content": "// Copyright 2018 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestChecksService_GetCheckRun(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/check-runs/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeCheckRunsPreview)\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 1,\n                        \"name\":\"testCheckRun\",\n\t\t\t\"status\": \"completed\",\n\t\t\t\"conclusion\": \"neutral\",\n\t\t\t\"started_at\": \"2018-05-04T01:14:52Z\",\n\t\t\t\"completed_at\": \"2018-05-04T01:14:52Z\"}`)\n\t})\n\tctx := t.Context()\n\tcheckRun, _, err := client.Checks.GetCheckRun(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Checks.GetCheckRun return error: %v\", err)\n\t}\n\tstartedAt, _ := time.Parse(time.RFC3339, \"2018-05-04T01:14:52Z\")\n\tcompleteAt, _ := time.Parse(time.RFC3339, \"2018-05-04T01:14:52Z\")\n\n\twant := &CheckRun{\n\t\tID:          Ptr(int64(1)),\n\t\tStatus:      Ptr(\"completed\"),\n\t\tConclusion:  Ptr(\"neutral\"),\n\t\tStartedAt:   &Timestamp{startedAt},\n\t\tCompletedAt: &Timestamp{completeAt},\n\t\tName:        Ptr(\"testCheckRun\"),\n\t}\n\tif !cmp.Equal(checkRun, want) {\n\t\tt.Errorf(\"Checks.GetCheckRun return %+v, want %+v\", checkRun, want)\n\t}\n\n\tconst methodName = \"GetCheckRun\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Checks.GetCheckRun(ctx, \"\\n\", \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Checks.GetCheckRun(ctx, \"o\", \"r\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestChecksService_GetCheckSuite(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/check-suites/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeCheckRunsPreview)\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 1,\n                        \"head_branch\":\"master\",\n\t\t\t\"head_sha\": \"deadbeef\",\n\t\t\t\"conclusion\": \"neutral\",\n                        \"before\": \"deadbeefb\",\n                        \"after\": \"deadbeefa\",\n\t\t\t\"status\": \"completed\"}`)\n\t})\n\tctx := t.Context()\n\tcheckSuite, _, err := client.Checks.GetCheckSuite(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Checks.GetCheckSuite return error: %v\", err)\n\t}\n\twant := &CheckSuite{\n\t\tID:         Ptr(int64(1)),\n\t\tHeadBranch: Ptr(\"master\"),\n\t\tHeadSHA:    Ptr(\"deadbeef\"),\n\t\tAfterSHA:   Ptr(\"deadbeefa\"),\n\t\tBeforeSHA:  Ptr(\"deadbeefb\"),\n\t\tStatus:     Ptr(\"completed\"),\n\t\tConclusion: Ptr(\"neutral\"),\n\t}\n\tif !cmp.Equal(checkSuite, want) {\n\t\tt.Errorf(\"Checks.GetCheckSuite return %+v, want %+v\", checkSuite, want)\n\t}\n\n\tconst methodName = \"GetCheckSuite\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Checks.GetCheckSuite(ctx, \"\\n\", \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Checks.GetCheckSuite(ctx, \"o\", \"r\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestChecksService_CreateCheckRun(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/check-runs\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeCheckRunsPreview)\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 1,\n                        \"name\":\"testCreateCheckRun\",\n                        \"head_sha\":\"deadbeef\",\n\t\t\t\"status\": \"in_progress\",\n\t\t\t\"conclusion\": null,\n\t\t\t\"started_at\": \"2018-05-04T01:14:52Z\",\n\t\t\t\"completed_at\": null,\n                        \"output\":{\"title\": \"Mighty test report\", \"summary\":\"\", \"text\":\"\"}}`)\n\t})\n\tstartedAt, _ := time.Parse(time.RFC3339, \"2018-05-04T01:14:52Z\")\n\tcheckRunOpt := CreateCheckRunOptions{\n\t\tName:      \"testCreateCheckRun\",\n\t\tHeadSHA:   \"deadbeef\",\n\t\tStatus:    Ptr(\"in_progress\"),\n\t\tStartedAt: &Timestamp{startedAt},\n\t\tOutput: &CheckRunOutput{\n\t\t\tTitle:   Ptr(\"Mighty test report\"),\n\t\t\tSummary: Ptr(\"\"),\n\t\t\tText:    Ptr(\"\"),\n\t\t},\n\t}\n\n\tctx := t.Context()\n\tcheckRun, _, err := client.Checks.CreateCheckRun(ctx, \"o\", \"r\", checkRunOpt)\n\tif err != nil {\n\t\tt.Errorf(\"Checks.CreateCheckRun return error: %v\", err)\n\t}\n\n\twant := &CheckRun{\n\t\tID:        Ptr(int64(1)),\n\t\tStatus:    Ptr(\"in_progress\"),\n\t\tStartedAt: &Timestamp{startedAt},\n\t\tHeadSHA:   Ptr(\"deadbeef\"),\n\t\tName:      Ptr(\"testCreateCheckRun\"),\n\t\tOutput: &CheckRunOutput{\n\t\t\tTitle:   Ptr(\"Mighty test report\"),\n\t\t\tSummary: Ptr(\"\"),\n\t\t\tText:    Ptr(\"\"),\n\t\t},\n\t}\n\tif !cmp.Equal(checkRun, want) {\n\t\tt.Errorf(\"Checks.CreateCheckRun return %+v, want %+v\", checkRun, want)\n\t}\n\n\tconst methodName = \"CreateCheckRun\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Checks.CreateCheckRun(ctx, \"\\n\", \"\\n\", CreateCheckRunOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Checks.CreateCheckRun(ctx, \"o\", \"r\", checkRunOpt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestChecksService_ListCheckRunAnnotations(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/check-runs/1/annotations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeCheckRunsPreview)\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\": \"1\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\n\t\t                           \"path\": \"README.md\",\n\t\t                           \"start_line\": 2,\n\t\t                           \"end_line\": 2,\n\t\t                           \"start_column\": 1,\n\t\t                           \"end_column\": 5,\n\t\t                           \"annotation_level\": \"warning\",\n\t\t                           \"message\": \"Check your spelling for 'banaas'.\",\n                                           \"title\": \"Spell check\",\n\t\t                           \"raw_details\": \"Do you mean 'bananas' or 'banana'?\"}]`,\n\t\t)\n\t})\n\n\tctx := t.Context()\n\tcheckRunAnnotations, _, err := client.Checks.ListCheckRunAnnotations(ctx, \"o\", \"r\", 1, &ListOptions{Page: 1})\n\tif err != nil {\n\t\tt.Errorf(\"Checks.ListCheckRunAnnotations return error: %v\", err)\n\t}\n\n\twant := []*CheckRunAnnotation{{\n\t\tPath:            Ptr(\"README.md\"),\n\t\tStartLine:       Ptr(2),\n\t\tEndLine:         Ptr(2),\n\t\tStartColumn:     Ptr(1),\n\t\tEndColumn:       Ptr(5),\n\t\tAnnotationLevel: Ptr(\"warning\"),\n\t\tMessage:         Ptr(\"Check your spelling for 'banaas'.\"),\n\t\tTitle:           Ptr(\"Spell check\"),\n\t\tRawDetails:      Ptr(\"Do you mean 'bananas' or 'banana'?\"),\n\t}}\n\n\tif !cmp.Equal(checkRunAnnotations, want) {\n\t\tt.Errorf(\"Checks.ListCheckRunAnnotations returned %+v, want %+v\", checkRunAnnotations, want)\n\t}\n\n\tconst methodName = \"ListCheckRunAnnotations\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Checks.ListCheckRunAnnotations(ctx, \"\\n\", \"\\n\", -1, &ListOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Checks.ListCheckRunAnnotations(ctx, \"o\", \"r\", 1, nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestChecksService_UpdateCheckRun(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/check-runs/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeCheckRunsPreview)\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 1,\n                        \"name\":\"testUpdateCheckRun\",\n\t\t\t\"status\": \"completed\",\n\t\t\t\"conclusion\": \"neutral\",\n\t\t\t\"started_at\": \"2018-05-04T01:14:52Z\",\n\t\t\t\"completed_at\": \"2018-05-04T01:14:52Z\",\n                        \"output\":{\"title\": \"Mighty test report\", \"summary\":\"There are 0 failures, 2 warnings and 1 notice\", \"text\":\"You may have misspelled some words.\"}}`)\n\t})\n\tstartedAt, _ := time.Parse(time.RFC3339, \"2018-05-04T01:14:52Z\")\n\tupdateCheckRunOpt := UpdateCheckRunOptions{\n\t\tName:        \"testUpdateCheckRun\",\n\t\tStatus:      Ptr(\"completed\"),\n\t\tCompletedAt: &Timestamp{startedAt},\n\t\tOutput: &CheckRunOutput{\n\t\t\tTitle:   Ptr(\"Mighty test report\"),\n\t\t\tSummary: Ptr(\"There are 0 failures, 2 warnings and 1 notice\"),\n\t\t\tText:    Ptr(\"You may have misspelled some words.\"),\n\t\t},\n\t}\n\n\tctx := t.Context()\n\tcheckRun, _, err := client.Checks.UpdateCheckRun(ctx, \"o\", \"r\", 1, updateCheckRunOpt)\n\tif err != nil {\n\t\tt.Errorf(\"Checks.UpdateCheckRun return error: %v\", err)\n\t}\n\n\twant := &CheckRun{\n\t\tID:          Ptr(int64(1)),\n\t\tStatus:      Ptr(\"completed\"),\n\t\tStartedAt:   &Timestamp{startedAt},\n\t\tCompletedAt: &Timestamp{startedAt},\n\t\tConclusion:  Ptr(\"neutral\"),\n\t\tName:        Ptr(\"testUpdateCheckRun\"),\n\t\tOutput: &CheckRunOutput{\n\t\t\tTitle:   Ptr(\"Mighty test report\"),\n\t\t\tSummary: Ptr(\"There are 0 failures, 2 warnings and 1 notice\"),\n\t\t\tText:    Ptr(\"You may have misspelled some words.\"),\n\t\t},\n\t}\n\tif !cmp.Equal(checkRun, want) {\n\t\tt.Errorf(\"Checks.UpdateCheckRun return %+v, want %+v\", checkRun, want)\n\t}\n\n\tconst methodName = \"UpdateCheckRun\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Checks.UpdateCheckRun(ctx, \"\\n\", \"\\n\", -1, UpdateCheckRunOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Checks.UpdateCheckRun(ctx, \"o\", \"r\", 1, updateCheckRunOpt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestChecksService_ListCheckRunsForRef(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/commits/master/check-runs\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeCheckRunsPreview)\n\t\ttestFormValues(t, r, values{\n\t\t\t\"check_name\": \"testing\",\n\t\t\t\"page\":       \"1\",\n\t\t\t\"status\":     \"completed\",\n\t\t\t\"filter\":     \"all\",\n\t\t\t\"app_id\":     \"1\",\n\t\t})\n\t\tfmt.Fprint(w, `{\"total_count\":1,\n                                \"check_runs\": [{\n                                    \"id\": 1,\n                                    \"head_sha\": \"deadbeef\",\n                                    \"status\": \"completed\",\n                                    \"conclusion\": \"neutral\",\n                                    \"started_at\": \"2018-05-04T01:14:52Z\",\n                                    \"completed_at\": \"2018-05-04T01:14:52Z\",\n                                    \"app\": {\n                                      \"id\": 1}}]}`,\n\t\t)\n\t})\n\n\topt := &ListCheckRunsOptions{\n\t\tCheckName:   Ptr(\"testing\"),\n\t\tStatus:      Ptr(\"completed\"),\n\t\tFilter:      Ptr(\"all\"),\n\t\tAppID:       Ptr(int64(1)),\n\t\tListOptions: ListOptions{Page: 1},\n\t}\n\tctx := t.Context()\n\tcheckRuns, _, err := client.Checks.ListCheckRunsForRef(ctx, \"o\", \"r\", \"master\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Checks.ListCheckRunsForRef return error: %v\", err)\n\t}\n\tstartedAt, _ := time.Parse(time.RFC3339, \"2018-05-04T01:14:52Z\")\n\twant := &ListCheckRunsResults{\n\t\tTotal: Ptr(1),\n\t\tCheckRuns: []*CheckRun{{\n\t\t\tID:          Ptr(int64(1)),\n\t\t\tStatus:      Ptr(\"completed\"),\n\t\t\tStartedAt:   &Timestamp{startedAt},\n\t\t\tCompletedAt: &Timestamp{startedAt},\n\t\t\tConclusion:  Ptr(\"neutral\"),\n\t\t\tHeadSHA:     Ptr(\"deadbeef\"),\n\t\t\tApp:         &App{ID: Ptr(int64(1))},\n\t\t}},\n\t}\n\n\tif !cmp.Equal(checkRuns, want) {\n\t\tt.Errorf(\"Checks.ListCheckRunsForRef returned %+v, want %+v\", checkRuns, want)\n\t}\n\n\tconst methodName = \"ListCheckRunsForRef\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Checks.ListCheckRunsForRef(ctx, \"\\n\", \"\\n\", \"\\n\", &ListCheckRunsOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Checks.ListCheckRunsForRef(ctx, \"o\", \"r\", \"master\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestChecksService_ListCheckRunsCheckSuite(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/check-suites/1/check-runs\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeCheckRunsPreview)\n\t\ttestFormValues(t, r, values{\n\t\t\t\"check_name\": \"testing\",\n\t\t\t\"page\":       \"1\",\n\t\t\t\"status\":     \"completed\",\n\t\t\t\"filter\":     \"all\",\n\t\t})\n\t\tfmt.Fprint(w, `{\"total_count\":1,\n                                \"check_runs\": [{\n                                    \"id\": 1,\n                                    \"head_sha\": \"deadbeef\",\n                                    \"status\": \"completed\",\n                                    \"conclusion\": \"neutral\",\n                                    \"started_at\": \"2018-05-04T01:14:52Z\",\n                                    \"completed_at\": \"2018-05-04T01:14:52Z\"}]}`,\n\t\t)\n\t})\n\n\topt := &ListCheckRunsOptions{\n\t\tCheckName:   Ptr(\"testing\"),\n\t\tStatus:      Ptr(\"completed\"),\n\t\tFilter:      Ptr(\"all\"),\n\t\tListOptions: ListOptions{Page: 1},\n\t}\n\tctx := t.Context()\n\tcheckRuns, _, err := client.Checks.ListCheckRunsCheckSuite(ctx, \"o\", \"r\", 1, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Checks.ListCheckRunsCheckSuite return error: %v\", err)\n\t}\n\tstartedAt, _ := time.Parse(time.RFC3339, \"2018-05-04T01:14:52Z\")\n\twant := &ListCheckRunsResults{\n\t\tTotal: Ptr(1),\n\t\tCheckRuns: []*CheckRun{{\n\t\t\tID:          Ptr(int64(1)),\n\t\t\tStatus:      Ptr(\"completed\"),\n\t\t\tStartedAt:   &Timestamp{startedAt},\n\t\t\tCompletedAt: &Timestamp{startedAt},\n\t\t\tConclusion:  Ptr(\"neutral\"),\n\t\t\tHeadSHA:     Ptr(\"deadbeef\"),\n\t\t}},\n\t}\n\n\tif !cmp.Equal(checkRuns, want) {\n\t\tt.Errorf(\"Checks.ListCheckRunsCheckSuite returned %+v, want %+v\", checkRuns, want)\n\t}\n\n\tconst methodName = \"ListCheckRunsCheckSuite\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Checks.ListCheckRunsCheckSuite(ctx, \"\\n\", \"\\n\", -1, &ListCheckRunsOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Checks.ListCheckRunsCheckSuite(ctx, \"o\", \"r\", 1, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestChecksService_ListCheckSuiteForRef(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/commits/master/check-suites\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeCheckRunsPreview)\n\t\ttestFormValues(t, r, values{\n\t\t\t\"check_name\": \"testing\",\n\t\t\t\"page\":       \"1\",\n\t\t\t\"app_id\":     \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `{\"total_count\":1,\n                                \"check_suites\": [{\n                                    \"id\": 1,\n                                    \"head_sha\": \"deadbeef\",\n                                    \"head_branch\": \"master\",\n                                    \"status\": \"completed\",\n                                    \"conclusion\": \"neutral\",\n                                    \"before\": \"deadbeefb\",\n                                    \"after\": \"deadbeefa\"}]}`,\n\t\t)\n\t})\n\n\topt := &ListCheckSuiteOptions{\n\t\tCheckName:   Ptr(\"testing\"),\n\t\tAppID:       Ptr(int64(2)),\n\t\tListOptions: ListOptions{Page: 1},\n\t}\n\tctx := t.Context()\n\tcheckSuites, _, err := client.Checks.ListCheckSuitesForRef(ctx, \"o\", \"r\", \"master\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Checks.ListCheckSuitesForRef return error: %v\", err)\n\t}\n\twant := &ListCheckSuiteResults{\n\t\tTotal: Ptr(1),\n\t\tCheckSuites: []*CheckSuite{{\n\t\t\tID:         Ptr(int64(1)),\n\t\t\tStatus:     Ptr(\"completed\"),\n\t\t\tConclusion: Ptr(\"neutral\"),\n\t\t\tHeadSHA:    Ptr(\"deadbeef\"),\n\t\t\tHeadBranch: Ptr(\"master\"),\n\t\t\tBeforeSHA:  Ptr(\"deadbeefb\"),\n\t\t\tAfterSHA:   Ptr(\"deadbeefa\"),\n\t\t}},\n\t}\n\n\tif !cmp.Equal(checkSuites, want) {\n\t\tt.Errorf(\"Checks.ListCheckSuitesForRef returned %+v, want %+v\", checkSuites, want)\n\t}\n\n\tconst methodName = \"ListCheckSuitesForRef\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Checks.ListCheckSuitesForRef(ctx, \"\\n\", \"\\n\", \"\\n\", &ListCheckSuiteOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Checks.ListCheckSuitesForRef(ctx, \"o\", \"r\", \"master\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestChecksService_SetCheckSuitePreferences(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/check-suites/preferences\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeCheckRunsPreview)\n\t\ttestBody(t, r, `{\"auto_trigger_checks\":[{\"app_id\":2,\"setting\":false}]}`+\"\\n\")\n\t\tfmt.Fprint(w, `{\"preferences\":{\"auto_trigger_checks\":[{\"app_id\": 2,\"setting\": false}]}}`)\n\t})\n\ta := []*AutoTriggerCheck{{\n\t\tAppID:   Ptr(int64(2)),\n\t\tSetting: Ptr(false),\n\t}}\n\topt := CheckSuitePreferenceOptions{AutoTriggerChecks: a}\n\tctx := t.Context()\n\tprefResults, _, err := client.Checks.SetCheckSuitePreferences(ctx, \"o\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Checks.SetCheckSuitePreferences return error: %v\", err)\n\t}\n\n\tp := &PreferenceList{\n\t\tAutoTriggerChecks: a,\n\t}\n\twant := &CheckSuitePreferenceResults{\n\t\tPreferences: p,\n\t}\n\n\tif !cmp.Equal(prefResults, want) {\n\t\tt.Errorf(\"Checks.SetCheckSuitePreferences return %+v, want %+v\", prefResults, want)\n\t}\n\n\tconst methodName = \"SetCheckSuitePreferences\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Checks.SetCheckSuitePreferences(ctx, \"\\n\", \"\\n\", CheckSuitePreferenceOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Checks.SetCheckSuitePreferences(ctx, \"o\", \"r\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestChecksService_CreateCheckSuite(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/check-suites\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeCheckRunsPreview)\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 2,\n                        \"head_branch\":\"master\",\n                        \"head_sha\":\"deadbeef\",\n\t\t\t\"status\": \"completed\",\n\t\t\t\"conclusion\": \"neutral\",\n                        \"before\": \"deadbeefb\",\n                        \"after\": \"deadbeefa\"}`)\n\t})\n\n\tcheckSuiteOpt := CreateCheckSuiteOptions{\n\t\tHeadSHA:    \"deadbeef\",\n\t\tHeadBranch: Ptr(\"master\"),\n\t}\n\n\tctx := t.Context()\n\tcheckSuite, _, err := client.Checks.CreateCheckSuite(ctx, \"o\", \"r\", checkSuiteOpt)\n\tif err != nil {\n\t\tt.Errorf(\"Checks.CreateCheckSuite return error: %v\", err)\n\t}\n\n\twant := &CheckSuite{\n\t\tID:         Ptr(int64(2)),\n\t\tStatus:     Ptr(\"completed\"),\n\t\tHeadSHA:    Ptr(\"deadbeef\"),\n\t\tHeadBranch: Ptr(\"master\"),\n\t\tConclusion: Ptr(\"neutral\"),\n\t\tBeforeSHA:  Ptr(\"deadbeefb\"),\n\t\tAfterSHA:   Ptr(\"deadbeefa\"),\n\t}\n\tif !cmp.Equal(checkSuite, want) {\n\t\tt.Errorf(\"Checks.CreateCheckSuite return %+v, want %+v\", checkSuite, want)\n\t}\n\n\tconst methodName = \"CreateCheckSuite\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Checks.CreateCheckSuite(ctx, \"\\n\", \"\\n\", CreateCheckSuiteOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Checks.CreateCheckSuite(ctx, \"o\", \"r\", checkSuiteOpt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestChecksService_ReRequestCheckSuite(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/check-suites/1/rerequest\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeCheckRunsPreview)\n\t\tw.WriteHeader(http.StatusCreated)\n\t})\n\tctx := t.Context()\n\tresp, err := client.Checks.ReRequestCheckSuite(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Checks.ReRequestCheckSuite return error: %v\", err)\n\t}\n\tif got, want := resp.StatusCode, http.StatusCreated; got != want {\n\t\tt.Errorf(\"Checks.ReRequestCheckSuite = %v, want %v\", got, want)\n\t}\n\n\tconst methodName = \"ReRequestCheckSuite\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Checks.ReRequestCheckSuite(ctx, \"\\n\", \"\\n\", 1)\n\t\treturn err\n\t})\n}\n\nfunc Test_CheckRunMarshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CheckRun{}, \"{}\")\n\n\tnow := time.Now()\n\tts := now.Format(time.RFC3339Nano)\n\n\tc := CheckRun{\n\t\tID:          Ptr(int64(1)),\n\t\tNodeID:      Ptr(\"n\"),\n\t\tHeadSHA:     Ptr(\"h\"),\n\t\tExternalID:  Ptr(\"1\"),\n\t\tURL:         Ptr(\"u\"),\n\t\tHTMLURL:     Ptr(\"u\"),\n\t\tDetailsURL:  Ptr(\"u\"),\n\t\tStatus:      Ptr(\"s\"),\n\t\tConclusion:  Ptr(\"c\"),\n\t\tStartedAt:   &Timestamp{Time: now},\n\t\tCompletedAt: &Timestamp{Time: now},\n\t\tOutput: &CheckRunOutput{\n\t\t\tAnnotations: []*CheckRunAnnotation{\n\t\t\t\t{\n\t\t\t\t\tAnnotationLevel: Ptr(\"a\"),\n\t\t\t\t\tEndLine:         Ptr(1),\n\t\t\t\t\tMessage:         Ptr(\"m\"),\n\t\t\t\t\tPath:            Ptr(\"p\"),\n\t\t\t\t\tRawDetails:      Ptr(\"r\"),\n\t\t\t\t\tStartLine:       Ptr(1),\n\t\t\t\t\tTitle:           Ptr(\"t\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tAnnotationsCount: Ptr(1),\n\t\t\tAnnotationsURL:   Ptr(\"a\"),\n\t\t\tImages: []*CheckRunImage{\n\t\t\t\t{\n\t\t\t\t\tAlt:      Ptr(\"a\"),\n\t\t\t\t\tImageURL: Ptr(\"i\"),\n\t\t\t\t\tCaption:  Ptr(\"c\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tTitle:   Ptr(\"t\"),\n\t\t\tSummary: Ptr(\"s\"),\n\t\t\tText:    Ptr(\"t\"),\n\t\t},\n\t\tName: Ptr(\"n\"),\n\t\tCheckSuite: &CheckSuite{\n\t\t\tID: Ptr(int64(1)),\n\t\t},\n\t\tApp: &App{\n\t\t\tID:     Ptr(int64(1)),\n\t\t\tNodeID: Ptr(\"n\"),\n\t\t\tOwner: &User{\n\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t},\n\t\t\tName:        Ptr(\"n\"),\n\t\t\tDescription: Ptr(\"d\"),\n\t\t\tHTMLURL:     Ptr(\"h\"),\n\t\t\tExternalURL: Ptr(\"u\"),\n\t\t\tCreatedAt:   &Timestamp{now},\n\t\t\tUpdatedAt:   &Timestamp{now},\n\t\t},\n\t\tPullRequests: []*PullRequest{\n\t\t\t{\n\t\t\t\tURL:    Ptr(\"u\"),\n\t\t\t\tID:     Ptr(int64(1)),\n\t\t\t\tNumber: Ptr(1),\n\t\t\t\tHead: &PullRequestBranch{\n\t\t\t\t\tRef: Ptr(\"r\"),\n\t\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\t\tRepo: &Repository{\n\t\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\t\tURL:  Ptr(\"s\"),\n\t\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tBase: &PullRequestBranch{\n\t\t\t\t\tRef: Ptr(\"r\"),\n\t\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\t\tRepo: &Repository{\n\t\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\t\tURL:  Ptr(\"u\"),\n\t\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\tw := fmt.Sprintf(`{\n\t\t\"id\": 1,\n\t\t\"node_id\": \"n\",\n\t\t\"head_sha\": \"h\",\n\t\t\"external_id\": \"1\",\n\t\t\"url\": \"u\",\n\t\t\"html_url\": \"u\",\n\t\t\"details_url\": \"u\",\n\t\t\"status\": \"s\",\n\t\t\"conclusion\": \"c\",\n\t\t\"started_at\": \"%v\",\n\t\t\"completed_at\": \"%v\",\n\t\t\"output\": {\n\t\t\t\"title\": \"t\",\n\t\t\t\"summary\": \"s\",\n\t\t\t\"text\": \"t\",\n\t\t\t\"annotations_count\": 1,\n\t\t\t\"annotations_url\": \"a\",\n\t\t\t\"annotations\": [\n\t\t\t\t{\n\t\t\t\t\t\"path\": \"p\",\n\t\t\t\t\t\"start_line\": 1,\n\t\t\t\t\t\"end_line\": 1,\n\t\t\t\t\t\"annotation_level\": \"a\",\n\t\t\t\t\t\"message\": \"m\",\n\t\t\t\t\t\"title\": \"t\",\n\t\t\t\t\t\"raw_details\": \"r\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"images\": [\n\t\t\t\t{\n\t\t\t\t\t\"alt\": \"a\",\n\t\t\t\t\t\"image_url\": \"i\",\n\t\t\t\t\t\"caption\": \"c\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t\"name\": \"n\",\n\t\t\"check_suite\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"app\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"owner\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"events_url\": \"e\",\n\t\t\t\t\"repos_url\": \"r\"\n\t\t\t},\n\t\t\t\"name\": \"n\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"external_url\": \"u\",\n\t\t\t\"html_url\": \"h\",\n\t\t\t\"created_at\": \"%v\",\n\t\t\t\"updated_at\": \"%v\"\n\t\t},\n\t\t\"pull_requests\": [\n\t\t\t{\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"number\": 1,\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"head\": {\n\t\t\t\t\t\"ref\": \"r\",\n\t\t\t\t\t\"sha\": \"s\",\n\t\t\t\t\t\"repo\": {\n\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\t\"url\": \"s\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"base\": {\n\t\t\t\t\t\"ref\": \"r\",\n\t\t\t\t\t\"sha\": \"s\",\n\t\t\t\t\t\"repo\": {\n\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\t\"url\": \"u\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t  }`, ts, ts, ts, ts)\n\n\ttestJSONMarshal(t, &c, w)\n}\n\nfunc Test_CheckSuiteMarshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CheckSuite{}, \"{}\")\n\n\tnow := time.Now()\n\tts := now.Format(time.RFC3339Nano)\n\n\tc := CheckSuite{\n\t\tID:         Ptr(int64(1)),\n\t\tNodeID:     Ptr(\"n\"),\n\t\tHeadBranch: Ptr(\"h\"),\n\t\tHeadSHA:    Ptr(\"h\"),\n\t\tURL:        Ptr(\"u\"),\n\t\tBeforeSHA:  Ptr(\"b\"),\n\t\tAfterSHA:   Ptr(\"a\"),\n\t\tStatus:     Ptr(\"s\"),\n\t\tConclusion: Ptr(\"c\"),\n\t\tApp: &App{\n\t\t\tID:     Ptr(int64(1)),\n\t\t\tNodeID: Ptr(\"n\"),\n\t\t\tOwner: &User{\n\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t},\n\t\t\tName:        Ptr(\"n\"),\n\t\t\tDescription: Ptr(\"d\"),\n\t\t\tHTMLURL:     Ptr(\"h\"),\n\t\t\tExternalURL: Ptr(\"u\"),\n\t\t\tCreatedAt:   &Timestamp{now},\n\t\t\tUpdatedAt:   &Timestamp{now},\n\t\t},\n\t\tRepository: &Repository{\n\t\t\tID: Ptr(int64(1)),\n\t\t},\n\t\tPullRequests: []*PullRequest{\n\t\t\t{\n\t\t\t\tURL:    Ptr(\"u\"),\n\t\t\t\tID:     Ptr(int64(1)),\n\t\t\t\tNumber: Ptr(1),\n\t\t\t\tHead: &PullRequestBranch{\n\t\t\t\t\tRef: Ptr(\"r\"),\n\t\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\t\tRepo: &Repository{\n\t\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\t\tURL:  Ptr(\"s\"),\n\t\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tBase: &PullRequestBranch{\n\t\t\t\t\tRef: Ptr(\"r\"),\n\t\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\t\tRepo: &Repository{\n\t\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\t\tURL:  Ptr(\"u\"),\n\t\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tHeadCommit: &Commit{\n\t\t\tSHA: Ptr(\"s\"),\n\t\t},\n\t\tLatestCheckRunsCount: Ptr(int64(1)),\n\t\tRerequestable:        Ptr(true),\n\t\tRunsRerequestable:    Ptr(true),\n\t}\n\n\tw := fmt.Sprintf(`{\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"head_branch\": \"h\",\n\t\t\t\"head_sha\": \"h\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"before\": \"b\",\n\t\t\t\"after\": \"a\",\n\t\t\t\"status\": \"s\",\n\t\t\t\"conclusion\": \"c\",\n\t\t\t\"app\": {\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"owner\": {\n\t\t\t\t\t\"login\": \"l\",\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\t\"url\": \"u\",\n\t\t\t\t\t\"events_url\": \"e\",\n\t\t\t\t\t\"repos_url\": \"r\"\n\t\t\t\t},\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"description\": \"d\",\n\t\t\t\t\"external_url\": \"u\",\n\t\t\t\t\"html_url\": \"h\",\n\t\t\t\t\"created_at\": \"%v\",\n\t\t\t\t\"updated_at\": \"%v\"\n\t\t\t},\n\t\t\t\"repository\": {\n\t\t\t\t\"id\": 1\n\t\t\t},\n\t\t\t\"pull_requests\": [\n\t\t\t{\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"number\": 1,\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"head\": {\n\t\t\t\t\t\"ref\": \"r\",\n\t\t\t\t\t\"sha\": \"s\",\n\t\t\t\t\t\"repo\": {\n\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\t\"url\": \"s\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"base\": {\n\t\t\t\t\t\"ref\": \"r\",\n\t\t\t\t\t\"sha\": \"s\",\n\t\t\t\t\t\"repo\": {\n\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\t\"url\": \"u\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\t\"head_commit\": {\n\t\t\t\"sha\": \"s\"\n\t\t},\n\t\t\"latest_check_runs_count\": 1,\n\t\t\"rerequestable\": true,\n\t\t\"runs_rerequestable\": true\n\t\t}`, ts, ts)\n\n\ttestJSONMarshal(t, &c, w)\n}\n\nfunc TestCheckRunAnnotation_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CheckRunAnnotation{}, \"{}\")\n\n\tu := &CheckRunAnnotation{\n\t\tPath:            Ptr(\"p\"),\n\t\tStartLine:       Ptr(1),\n\t\tEndLine:         Ptr(1),\n\t\tStartColumn:     Ptr(1),\n\t\tEndColumn:       Ptr(1),\n\t\tAnnotationLevel: Ptr(\"al\"),\n\t\tMessage:         Ptr(\"m\"),\n\t\tTitle:           Ptr(\"t\"),\n\t\tRawDetails:      Ptr(\"rd\"),\n\t}\n\n\twant := `{\n\t\t\"path\": \"p\",\n\t\t\"start_line\": 1,\n\t\t\"end_line\": 1,\n\t\t\"start_column\": 1,\n\t\t\"end_column\": 1,\n\t\t\"annotation_level\": \"al\",\n\t\t\"message\": \"m\",\n\t\t\"title\": \"t\",\n\t\t\"raw_details\": \"rd\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestCheckRunImage_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CheckRunImage{}, \"{}\")\n\n\tu := &CheckRunImage{\n\t\tAlt:      Ptr(\"a\"),\n\t\tImageURL: Ptr(\"i\"),\n\t\tCaption:  Ptr(\"c\"),\n\t}\n\n\twant := `{\n\t\t\"alt\": \"a\",\n\t\t\"image_url\": \"i\",\n\t\t\"caption\": \"c\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestCheckRunAction_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CheckRunAction{}, `{\n\t\t\"label\": \"\",\n\t\t\"description\": \"\",\n\t\t\"identifier\": \"\"\n\t}`)\n\n\tu := &CheckRunAction{\n\t\tLabel:       \"l\",\n\t\tDescription: \"d\",\n\t\tIdentifier:  \"i\",\n\t}\n\n\twant := `{\n\t\t\"label\": \"l\",\n\t\t\"description\": \"d\",\n\t\t\"identifier\": \"i\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestAutoTriggerCheck_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &AutoTriggerCheck{}, \"{}\")\n\n\tu := &AutoTriggerCheck{\n\t\tAppID:   Ptr(int64(1)),\n\t\tSetting: Ptr(false),\n\t}\n\n\twant := `{\n\t\t\"app_id\": 1,\n\t\t\"setting\": false\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestCreateCheckSuiteOptions_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CreateCheckSuiteOptions{}, `{\"head_sha\": \"\"}`)\n\n\tu := &CreateCheckSuiteOptions{\n\t\tHeadSHA:    \"hsha\",\n\t\tHeadBranch: Ptr(\"hb\"),\n\t}\n\n\twant := `{\n\t\t\"head_sha\": \"hsha\",\n\t\t\"head_branch\": \"hb\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestCheckRunOutput_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CheckRunOutput{}, \"{}\")\n\n\tu := &CheckRunOutput{\n\t\tTitle:            Ptr(\"ti\"),\n\t\tSummary:          Ptr(\"s\"),\n\t\tText:             Ptr(\"t\"),\n\t\tAnnotationsCount: Ptr(1),\n\t\tAnnotationsURL:   Ptr(\"au\"),\n\t\tAnnotations: []*CheckRunAnnotation{\n\t\t\t{\n\t\t\t\tPath:            Ptr(\"p\"),\n\t\t\t\tStartLine:       Ptr(1),\n\t\t\t\tEndLine:         Ptr(1),\n\t\t\t\tStartColumn:     Ptr(1),\n\t\t\t\tEndColumn:       Ptr(1),\n\t\t\t\tAnnotationLevel: Ptr(\"al\"),\n\t\t\t\tMessage:         Ptr(\"m\"),\n\t\t\t\tTitle:           Ptr(\"t\"),\n\t\t\t\tRawDetails:      Ptr(\"rd\"),\n\t\t\t},\n\t\t},\n\t\tImages: []*CheckRunImage{\n\t\t\t{\n\t\t\t\tAlt:      Ptr(\"a\"),\n\t\t\t\tImageURL: Ptr(\"i\"),\n\t\t\t\tCaption:  Ptr(\"c\"),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"title\": \"ti\",\n\t\t\"summary\": \"s\",\n\t\t\"text\": \"t\",\n\t\t\"annotations_count\": 1,\n\t\t\"annotations_url\": \"au\",\n\t\t\"annotations\": [\n\t\t\t{\n\t\t\t\t\"path\": \"p\",\n\t\t\t\t\"start_line\": 1,\n\t\t\t\t\"end_line\": 1,\n\t\t\t\t\"start_column\": 1,\n\t\t\t\t\"end_column\": 1,\n\t\t\t\t\"annotation_level\": \"al\",\n\t\t\t\t\"message\": \"m\",\n\t\t\t\t\"title\": \"t\",\n\t\t\t\t\"raw_details\": \"rd\"\n\t\t\t}\n\t\t],\n\t\t\"images\": [\n\t\t\t{\n\t\t\t\t\"alt\": \"a\",\n\t\t\t\t\"image_url\": \"i\",\n\t\t\t\t\"caption\": \"c\"\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestCreateCheckRunOptions_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CreateCheckRunOptions{}, `{\n\t\t\"name\": \"\",\n\t\t\"head_sha\": \"\"\n\t}`)\n\n\tu := &CreateCheckRunOptions{\n\t\tName:        \"n\",\n\t\tHeadSHA:     \"hsha\",\n\t\tDetailsURL:  Ptr(\"durl\"),\n\t\tExternalID:  Ptr(\"eid\"),\n\t\tStatus:      Ptr(\"s\"),\n\t\tConclusion:  Ptr(\"c\"),\n\t\tStartedAt:   &Timestamp{referenceTime},\n\t\tCompletedAt: &Timestamp{referenceTime},\n\t\tOutput: &CheckRunOutput{\n\t\t\tTitle:            Ptr(\"ti\"),\n\t\t\tSummary:          Ptr(\"s\"),\n\t\t\tText:             Ptr(\"t\"),\n\t\t\tAnnotationsCount: Ptr(1),\n\t\t\tAnnotationsURL:   Ptr(\"au\"),\n\t\t\tAnnotations: []*CheckRunAnnotation{\n\t\t\t\t{\n\t\t\t\t\tPath:            Ptr(\"p\"),\n\t\t\t\t\tStartLine:       Ptr(1),\n\t\t\t\t\tEndLine:         Ptr(1),\n\t\t\t\t\tStartColumn:     Ptr(1),\n\t\t\t\t\tEndColumn:       Ptr(1),\n\t\t\t\t\tAnnotationLevel: Ptr(\"al\"),\n\t\t\t\t\tMessage:         Ptr(\"m\"),\n\t\t\t\t\tTitle:           Ptr(\"t\"),\n\t\t\t\t\tRawDetails:      Ptr(\"rd\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tImages: []*CheckRunImage{\n\t\t\t\t{\n\t\t\t\t\tAlt:      Ptr(\"a\"),\n\t\t\t\t\tImageURL: Ptr(\"i\"),\n\t\t\t\t\tCaption:  Ptr(\"c\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tActions: []*CheckRunAction{\n\t\t\t{\n\t\t\t\tLabel:       \"l\",\n\t\t\t\tDescription: \"d\",\n\t\t\t\tIdentifier:  \"i\",\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"name\": \"n\",\n\t\t\"head_sha\": \"hsha\",\n\t\t\"details_url\": \"durl\",\n\t\t\"external_id\": \"eid\",\n\t\t\"status\": \"s\",\n\t\t\"conclusion\": \"c\",\n\t\t\"started_at\": ` + referenceTimeStr + `,\n\t\t\"completed_at\": ` + referenceTimeStr + `,\n\t\t\"output\": {\n\t\t\t\"title\": \"ti\",\n\t\t\t\"summary\": \"s\",\n\t\t\t\"text\": \"t\",\n\t\t\t\"annotations_count\": 1,\n\t\t\t\"annotations_url\": \"au\",\n\t\t\t\"annotations\": [\n\t\t\t\t{\n\t\t\t\t\t\"path\": \"p\",\n\t\t\t\t\t\"start_line\": 1,\n\t\t\t\t\t\"end_line\": 1,\n\t\t\t\t\t\"start_column\": 1,\n\t\t\t\t\t\"end_column\": 1,\n\t\t\t\t\t\"annotation_level\": \"al\",\n\t\t\t\t\t\"message\": \"m\",\n\t\t\t\t\t\"title\": \"t\",\n\t\t\t\t\t\"raw_details\": \"rd\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"images\": [\n\t\t\t\t{\n\t\t\t\t\t\"alt\": \"a\",\n\t\t\t\t\t\"image_url\": \"i\",\n\t\t\t\t\t\"caption\": \"c\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t\"actions\": [\n\t\t\t{\n\t\t\t\t\"label\": \"l\",\n\t\t\t\t\"description\": \"d\",\n\t\t\t\t\"identifier\": \"i\"\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestUpdateCheckRunOptions_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &UpdateCheckRunOptions{}, `{\"name\": \"\"}`)\n\n\tu := &UpdateCheckRunOptions{\n\t\tName:        \"n\",\n\t\tDetailsURL:  Ptr(\"durl\"),\n\t\tExternalID:  Ptr(\"eid\"),\n\t\tStatus:      Ptr(\"s\"),\n\t\tConclusion:  Ptr(\"c\"),\n\t\tCompletedAt: &Timestamp{referenceTime},\n\t\tOutput: &CheckRunOutput{\n\t\t\tTitle:            Ptr(\"ti\"),\n\t\t\tSummary:          Ptr(\"s\"),\n\t\t\tText:             Ptr(\"t\"),\n\t\t\tAnnotationsCount: Ptr(1),\n\t\t\tAnnotationsURL:   Ptr(\"au\"),\n\t\t\tAnnotations: []*CheckRunAnnotation{\n\t\t\t\t{\n\t\t\t\t\tPath:            Ptr(\"p\"),\n\t\t\t\t\tStartLine:       Ptr(1),\n\t\t\t\t\tEndLine:         Ptr(1),\n\t\t\t\t\tStartColumn:     Ptr(1),\n\t\t\t\t\tEndColumn:       Ptr(1),\n\t\t\t\t\tAnnotationLevel: Ptr(\"al\"),\n\t\t\t\t\tMessage:         Ptr(\"m\"),\n\t\t\t\t\tTitle:           Ptr(\"t\"),\n\t\t\t\t\tRawDetails:      Ptr(\"rd\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tImages: []*CheckRunImage{\n\t\t\t\t{\n\t\t\t\t\tAlt:      Ptr(\"a\"),\n\t\t\t\t\tImageURL: Ptr(\"i\"),\n\t\t\t\t\tCaption:  Ptr(\"c\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tActions: []*CheckRunAction{\n\t\t\t{\n\t\t\t\tLabel:       \"l\",\n\t\t\t\tDescription: \"d\",\n\t\t\t\tIdentifier:  \"i\",\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"name\": \"n\",\n\t\t\"details_url\": \"durl\",\n\t\t\"external_id\": \"eid\",\n\t\t\"status\": \"s\",\n\t\t\"conclusion\": \"c\",\n\t\t\"completed_at\": ` + referenceTimeStr + `,\n\t\t\"output\": {\n\t\t\t\"title\": \"ti\",\n\t\t\t\"summary\": \"s\",\n\t\t\t\"text\": \"t\",\n\t\t\t\"annotations_count\": 1,\n\t\t\t\"annotations_url\": \"au\",\n\t\t\t\"annotations\": [\n\t\t\t\t{\n\t\t\t\t\t\"path\": \"p\",\n\t\t\t\t\t\"start_line\": 1,\n\t\t\t\t\t\"end_line\": 1,\n\t\t\t\t\t\"start_column\": 1,\n\t\t\t\t\t\"end_column\": 1,\n\t\t\t\t\t\"annotation_level\": \"al\",\n\t\t\t\t\t\"message\": \"m\",\n\t\t\t\t\t\"title\": \"t\",\n\t\t\t\t\t\"raw_details\": \"rd\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"images\": [\n\t\t\t\t{\n\t\t\t\t\t\"alt\": \"a\",\n\t\t\t\t\t\"image_url\": \"i\",\n\t\t\t\t\t\"caption\": \"c\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t\"actions\": [\n\t\t\t{\n\t\t\t\t\"label\": \"l\",\n\t\t\t\t\"description\": \"d\",\n\t\t\t\t\"identifier\": \"i\"\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestListCheckRunsResults_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ListCheckRunsResults{}, \"{}\")\n\n\tl := &ListCheckRunsResults{\n\t\tTotal: Ptr(1),\n\t\tCheckRuns: []*CheckRun{\n\t\t\t{\n\t\t\t\tID:          Ptr(int64(1)),\n\t\t\t\tNodeID:      Ptr(\"n\"),\n\t\t\t\tHeadSHA:     Ptr(\"h\"),\n\t\t\t\tExternalID:  Ptr(\"1\"),\n\t\t\t\tURL:         Ptr(\"u\"),\n\t\t\t\tHTMLURL:     Ptr(\"u\"),\n\t\t\t\tDetailsURL:  Ptr(\"u\"),\n\t\t\t\tStatus:      Ptr(\"s\"),\n\t\t\t\tConclusion:  Ptr(\"c\"),\n\t\t\t\tStartedAt:   &Timestamp{referenceTime},\n\t\t\t\tCompletedAt: &Timestamp{referenceTime},\n\t\t\t\tOutput: &CheckRunOutput{\n\t\t\t\t\tAnnotations: []*CheckRunAnnotation{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tAnnotationLevel: Ptr(\"a\"),\n\t\t\t\t\t\t\tEndLine:         Ptr(1),\n\t\t\t\t\t\t\tMessage:         Ptr(\"m\"),\n\t\t\t\t\t\t\tPath:            Ptr(\"p\"),\n\t\t\t\t\t\t\tRawDetails:      Ptr(\"r\"),\n\t\t\t\t\t\t\tStartLine:       Ptr(1),\n\t\t\t\t\t\t\tTitle:           Ptr(\"t\"),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tAnnotationsCount: Ptr(1),\n\t\t\t\t\tAnnotationsURL:   Ptr(\"a\"),\n\t\t\t\t\tImages: []*CheckRunImage{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tAlt:      Ptr(\"a\"),\n\t\t\t\t\t\t\tImageURL: Ptr(\"i\"),\n\t\t\t\t\t\t\tCaption:  Ptr(\"c\"),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tTitle:   Ptr(\"t\"),\n\t\t\t\t\tSummary: Ptr(\"s\"),\n\t\t\t\t\tText:    Ptr(\"t\"),\n\t\t\t\t},\n\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\tCheckSuite: &CheckSuite{\n\t\t\t\t\tID: Ptr(int64(1)),\n\t\t\t\t},\n\t\t\t\tApp: &App{\n\t\t\t\t\tID:     Ptr(int64(1)),\n\t\t\t\t\tNodeID: Ptr(\"n\"),\n\t\t\t\t\tOwner: &User{\n\t\t\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\t\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t\t\t},\n\t\t\t\t\tName:        Ptr(\"n\"),\n\t\t\t\t\tDescription: Ptr(\"d\"),\n\t\t\t\t\tHTMLURL:     Ptr(\"h\"),\n\t\t\t\t\tExternalURL: Ptr(\"u\"),\n\t\t\t\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\t\t\t\tUpdatedAt:   &Timestamp{referenceTime},\n\t\t\t\t},\n\t\t\t\tPullRequests: []*PullRequest{\n\t\t\t\t\t{\n\t\t\t\t\t\tURL:    Ptr(\"u\"),\n\t\t\t\t\t\tID:     Ptr(int64(1)),\n\t\t\t\t\t\tNumber: Ptr(1),\n\t\t\t\t\t\tHead: &PullRequestBranch{\n\t\t\t\t\t\t\tRef: Ptr(\"r\"),\n\t\t\t\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\t\t\t\tRepo: &Repository{\n\t\t\t\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\t\t\t\tURL:  Ptr(\"s\"),\n\t\t\t\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tBase: &PullRequestBranch{\n\t\t\t\t\t\t\tRef: Ptr(\"r\"),\n\t\t\t\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\t\t\t\tRepo: &Repository{\n\t\t\t\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\t\t\t\tURL:  Ptr(\"u\"),\n\t\t\t\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tw := `{\n\t\t\"total_count\": 1,\n\t\t\"check_runs\": [\n\t\t\t{\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"head_sha\": \"h\",\n\t\t\t\t\"external_id\": \"1\",\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"html_url\": \"u\",\n\t\t\t\t\"details_url\": \"u\",\n\t\t\t\t\"status\": \"s\",\n\t\t\t\t\"conclusion\": \"c\",\n\t\t\t\t\"started_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"completed_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"output\": {\n\t\t\t\t\t\"title\": \"t\",\n\t\t\t\t\t\"summary\": \"s\",\n\t\t\t\t\t\"text\": \"t\",\n\t\t\t\t\t\"annotations_count\": 1,\n\t\t\t\t\t\"annotations_url\": \"a\",\n\t\t\t\t\t\"annotations\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"path\": \"p\",\n\t\t\t\t\t\t\t\"start_line\": 1,\n\t\t\t\t\t\t\t\"end_line\": 1,\n\t\t\t\t\t\t\t\"annotation_level\": \"a\",\n\t\t\t\t\t\t\t\"message\": \"m\",\n\t\t\t\t\t\t\t\"title\": \"t\",\n\t\t\t\t\t\t\t\"raw_details\": \"r\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"images\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"alt\": \"a\",\n\t\t\t\t\t\t\t\"image_url\": \"i\",\n\t\t\t\t\t\t\t\"caption\": \"c\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"check_suite\": {\n\t\t\t\t\t\"id\": 1\n\t\t\t\t},\n\t\t\t\t\"app\": {\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\t\"owner\": {\n\t\t\t\t\t\t\"login\": \"l\",\n\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\t\t\"url\": \"u\",\n\t\t\t\t\t\t\"events_url\": \"e\",\n\t\t\t\t\t\t\"repos_url\": \"r\"\n\t\t\t\t\t},\n\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\"description\": \"d\",\n\t\t\t\t\t\"external_url\": \"u\",\n\t\t\t\t\t\"html_url\": \"h\",\n\t\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\t\"updated_at\": ` + referenceTimeStr + `\n\t\t\t\t},\n\t\t\t\t\"pull_requests\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\"number\": 1,\n\t\t\t\t\t\t\"url\": \"u\",\n\t\t\t\t\t\t\"head\": {\n\t\t\t\t\t\t\t\"ref\": \"r\",\n\t\t\t\t\t\t\t\"sha\": \"s\",\n\t\t\t\t\t\t\t\"repo\": {\n\t\t\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\t\t\t\"url\": \"s\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"base\": {\n\t\t\t\t\t\t\t\"ref\": \"r\",\n\t\t\t\t\t\t\t\"sha\": \"s\",\n\t\t\t\t\t\t\t\"repo\": {\n\t\t\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\t\t\t\"url\": \"u\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, &l, w)\n}\n\nfunc TestListCheckSuiteResults_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ListCheckSuiteResults{}, \"{}\")\n\n\tl := &ListCheckSuiteResults{\n\t\tTotal: Ptr(1),\n\t\tCheckSuites: []*CheckSuite{\n\t\t\t{\n\t\t\t\tID:         Ptr(int64(1)),\n\t\t\t\tNodeID:     Ptr(\"n\"),\n\t\t\t\tHeadBranch: Ptr(\"h\"),\n\t\t\t\tHeadSHA:    Ptr(\"h\"),\n\t\t\t\tURL:        Ptr(\"u\"),\n\t\t\t\tBeforeSHA:  Ptr(\"b\"),\n\t\t\t\tAfterSHA:   Ptr(\"a\"),\n\t\t\t\tStatus:     Ptr(\"s\"),\n\t\t\t\tConclusion: Ptr(\"c\"),\n\t\t\t\tApp: &App{\n\t\t\t\t\tID:     Ptr(int64(1)),\n\t\t\t\t\tNodeID: Ptr(\"n\"),\n\t\t\t\t\tOwner: &User{\n\t\t\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\t\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t\t\t},\n\t\t\t\t\tName:        Ptr(\"n\"),\n\t\t\t\t\tDescription: Ptr(\"d\"),\n\t\t\t\t\tHTMLURL:     Ptr(\"h\"),\n\t\t\t\t\tExternalURL: Ptr(\"u\"),\n\t\t\t\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\t\t\t\tUpdatedAt:   &Timestamp{referenceTime},\n\t\t\t\t},\n\t\t\t\tRepository: &Repository{\n\t\t\t\t\tID: Ptr(int64(1)),\n\t\t\t\t},\n\t\t\t\tPullRequests: []*PullRequest{\n\t\t\t\t\t{\n\t\t\t\t\t\tURL:    Ptr(\"u\"),\n\t\t\t\t\t\tID:     Ptr(int64(1)),\n\t\t\t\t\t\tNumber: Ptr(1),\n\t\t\t\t\t\tHead: &PullRequestBranch{\n\t\t\t\t\t\t\tRef: Ptr(\"r\"),\n\t\t\t\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\t\t\t\tRepo: &Repository{\n\t\t\t\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\t\t\t\tURL:  Ptr(\"s\"),\n\t\t\t\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tBase: &PullRequestBranch{\n\t\t\t\t\t\t\tRef: Ptr(\"r\"),\n\t\t\t\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\t\t\t\tRepo: &Repository{\n\t\t\t\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\t\t\t\tURL:  Ptr(\"u\"),\n\t\t\t\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tHeadCommit: &Commit{\n\t\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tw := `{\n\t\t\"total_count\": 1,\n\t\t\"check_suites\": [\n\t\t\t{\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"head_branch\": \"h\",\n\t\t\t\t\"head_sha\": \"h\",\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"before\": \"b\",\n\t\t\t\t\"after\": \"a\",\n\t\t\t\t\"status\": \"s\",\n\t\t\t\t\"conclusion\": \"c\",\n\t\t\t\t\"app\": {\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\t\"owner\": {\n\t\t\t\t\t\t\"login\": \"l\",\n\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\t\t\"url\": \"u\",\n\t\t\t\t\t\t\"events_url\": \"e\",\n\t\t\t\t\t\t\"repos_url\": \"r\"\n\t\t\t\t\t},\n\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\"description\": \"d\",\n\t\t\t\t\t\"external_url\": \"u\",\n\t\t\t\t\t\"html_url\": \"h\",\n\t\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\t\"updated_at\": ` + referenceTimeStr + `\n\t\t\t\t},\n\t\t\t\t\"repository\": {\n\t\t\t\t\t\"id\": 1\n\t\t\t\t},\n\t\t\t\t\"pull_requests\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"number\": 1,\n\t\t\t\t\t\"url\": \"u\",\n\t\t\t\t\t\"head\": {\n\t\t\t\t\t\t\"ref\": \"r\",\n\t\t\t\t\t\t\"sha\": \"s\",\n\t\t\t\t\t\t\"repo\": {\n\t\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\t\t\"url\": \"s\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"base\": {\n\t\t\t\t\t\t\"ref\": \"r\",\n\t\t\t\t\t\t\"sha\": \"s\",\n\t\t\t\t\t\t\"repo\": {\n\t\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\t\t\"url\": \"u\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"head_commit\": {\n\t\t\t\t\"sha\": \"s\"\n\t\t\t}\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, &l, w)\n}\n\nfunc TestCheckSuitePreferenceOptions_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CheckSuitePreferenceOptions{}, \"{}\")\n\n\tu := &CheckSuitePreferenceOptions{\n\t\tAutoTriggerChecks: []*AutoTriggerCheck{\n\t\t\t{\n\t\t\t\tAppID:   Ptr(int64(1)),\n\t\t\t\tSetting: Ptr(false),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"auto_trigger_checks\": [\n\t\t\t{\n\t\t\t\t\"app_id\": 1,\n\t\t\t\t\"setting\": false\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPreferenceList_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PreferenceList{}, \"{}\")\n\n\tu := &PreferenceList{\n\t\tAutoTriggerChecks: []*AutoTriggerCheck{\n\t\t\t{\n\t\t\t\tAppID:   Ptr(int64(1)),\n\t\t\t\tSetting: Ptr(false),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"auto_trigger_checks\": [\n\t\t\t{\n\t\t\t\t\"app_id\": 1,\n\t\t\t\t\"setting\": false\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestCheckSuitePreferenceResults_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CheckSuitePreferenceResults{}, \"{}\")\n\n\tu := &CheckSuitePreferenceResults{\n\t\tPreferences: &PreferenceList{\n\t\t\tAutoTriggerChecks: []*AutoTriggerCheck{\n\t\t\t\t{\n\t\t\t\t\tAppID:   Ptr(int64(1)),\n\t\t\t\t\tSetting: Ptr(false),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tRepository: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"u\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"preferences\": {\n\t\t\t\"auto_trigger_checks\": [\n\t\t\t\t{\n\t\t\t\t\t\"app_id\": 1,\n\t\t\t\t\t\"setting\": false\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\":1,\n\t\t\t\"name\":\"n\",\n\t\t\t\"url\":\"u\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestChecksService_ReRequestCheckRun(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/check-runs/1/rerequest\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeCheckRunsPreview)\n\t\tw.WriteHeader(http.StatusCreated)\n\t})\n\tctx := t.Context()\n\tresp, err := client.Checks.ReRequestCheckRun(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Checks.ReRequestCheckRun return error: %v\", err)\n\t}\n\tif got, want := resp.StatusCode, http.StatusCreated; got != want {\n\t\tt.Errorf(\"Checks.ReRequestCheckRun = %v, want %v\", got, want)\n\t}\n\n\tconst methodName = \"ReRequestCheckRun\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Checks.ReRequestCheckRun(ctx, \"\\n\", \"\\n\", 1)\n\t\treturn err\n\t})\n}\n"
  },
  {
    "path": "github/classroom.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// ClassroomService handles communication with the GitHub Classroom related\n// methods of the GitHub API.\n//\n// GitHub API docs: https://docs.github.com/rest/classroom/classroom\ntype ClassroomService service\n\n// ClassroomUser represents a GitHub user simplified for Classroom.\ntype ClassroomUser struct {\n\tID        *int64  `json:\"id,omitempty\"`\n\tLogin     *string `json:\"login,omitempty\"`\n\tAvatarURL *string `json:\"avatar_url,omitempty\"`\n\tHTMLURL   *string `json:\"html_url,omitempty\"`\n}\n\nfunc (u ClassroomUser) String() string {\n\treturn Stringify(u)\n}\n\n// Classroom represents a GitHub Classroom.\ntype Classroom struct {\n\tID           *int64        `json:\"id,omitempty\"`\n\tName         *string       `json:\"name,omitempty\"`\n\tArchived     *bool         `json:\"archived,omitempty\"`\n\tOrganization *Organization `json:\"organization,omitempty\"`\n\tURL          *string       `json:\"url,omitempty\"`\n}\n\nfunc (c Classroom) String() string {\n\treturn Stringify(c)\n}\n\n// ClassroomAssignment represents a GitHub Classroom assignment.\ntype ClassroomAssignment struct {\n\tID                          *int64      `json:\"id,omitempty\"`\n\tPublicRepo                  *bool       `json:\"public_repo,omitempty\"`\n\tTitle                       *string     `json:\"title,omitempty\"`\n\tType                        *string     `json:\"type,omitempty\"`\n\tInviteLink                  *string     `json:\"invite_link,omitempty\"`\n\tInvitationsEnabled          *bool       `json:\"invitations_enabled,omitempty\"`\n\tSlug                        *string     `json:\"slug,omitempty\"`\n\tStudentsAreRepoAdmins       *bool       `json:\"students_are_repo_admins,omitempty\"`\n\tFeedbackPullRequestsEnabled *bool       `json:\"feedback_pull_requests_enabled,omitempty\"`\n\tMaxTeams                    *int        `json:\"max_teams,omitempty\"`\n\tMaxMembers                  *int        `json:\"max_members,omitempty\"`\n\tEditor                      *string     `json:\"editor,omitempty\"`\n\tAccepted                    *int        `json:\"accepted,omitempty\"`\n\tSubmitted                   *int        `json:\"submitted,omitempty\"`\n\tPassing                     *int        `json:\"passing,omitempty\"`\n\tLanguage                    *string     `json:\"language,omitempty\"`\n\tDeadline                    *Timestamp  `json:\"deadline,omitempty\"`\n\tStarterCodeRepository       *Repository `json:\"starter_code_repository,omitempty\"`\n\tClassroom                   *Classroom  `json:\"classroom,omitempty\"`\n}\n\nfunc (a ClassroomAssignment) String() string {\n\treturn Stringify(a)\n}\n\n// AcceptedAssignment represents a GitHub Classroom accepted assignment.\ntype AcceptedAssignment struct {\n\tID          *int64               `json:\"id,omitempty\"`\n\tSubmitted   *bool                `json:\"submitted,omitempty\"`\n\tPassing     *bool                `json:\"passing,omitempty\"`\n\tCommitCount *int                 `json:\"commit_count,omitempty\"`\n\tGrade       *string              `json:\"grade,omitempty\"`\n\tStudents    []*ClassroomUser     `json:\"students,omitempty\"`\n\tRepository  *Repository          `json:\"repository,omitempty\"`\n\tAssignment  *ClassroomAssignment `json:\"assignment,omitempty\"`\n}\n\nfunc (a AcceptedAssignment) String() string {\n\treturn Stringify(a)\n}\n\n// AssignmentGrade represents a GitHub Classroom assignment grade.\ntype AssignmentGrade struct {\n\tAssignmentName        *string    `json:\"assignment_name,omitempty\"`\n\tAssignmentURL         *string    `json:\"assignment_url,omitempty\"`\n\tStarterCodeURL        *string    `json:\"starter_code_url,omitempty\"`\n\tGithubUsername        *string    `json:\"github_username,omitempty\"`\n\tRosterIdentifier      *string    `json:\"roster_identifier,omitempty\"`\n\tStudentRepositoryName *string    `json:\"student_repository_name,omitempty\"`\n\tStudentRepositoryURL  *string    `json:\"student_repository_url,omitempty\"`\n\tSubmissionTimestamp   *Timestamp `json:\"submission_timestamp,omitempty\"`\n\tPointsAwarded         *int       `json:\"points_awarded,omitempty\"`\n\tPointsAvailable       *int       `json:\"points_available,omitempty\"`\n\tGroupName             *string    `json:\"group_name,omitempty\"`\n}\n\nfunc (g AssignmentGrade) String() string {\n\treturn Stringify(g)\n}\n\n// GetAssignment gets a GitHub Classroom assignment. Assignment will only be\n// returned if the current user is an administrator of the GitHub Classroom\n// for the assignment.\n//\n// GitHub API docs: https://docs.github.com/rest/classroom/classroom#get-an-assignment\n//\n//meta:operation GET /assignments/{assignment_id}\nfunc (s *ClassroomService) GetAssignment(ctx context.Context, assignmentID int64) (*ClassroomAssignment, *Response, error) {\n\tu := fmt.Sprintf(\"assignments/%v\", assignmentID)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar assignment *ClassroomAssignment\n\tresp, err := s.client.Do(ctx, req, &assignment)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn assignment, resp, nil\n}\n\n// GetClassroom gets a GitHub Classroom for the current user. Classroom will only be\n// returned if the current user is an administrator of the GitHub Classroom.\n//\n// GitHub API docs: https://docs.github.com/rest/classroom/classroom#get-a-classroom\n//\n//meta:operation GET /classrooms/{classroom_id}\nfunc (s *ClassroomService) GetClassroom(ctx context.Context, classroomID int64) (*Classroom, *Response, error) {\n\tu := fmt.Sprintf(\"classrooms/%v\", classroomID)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar classroom *Classroom\n\tresp, err := s.client.Do(ctx, req, &classroom)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn classroom, resp, nil\n}\n\n// ListClassrooms lists GitHub Classrooms for the current user. Classrooms will only be\n// returned if the current user is an administrator of one or more GitHub Classrooms.\n//\n// GitHub API docs: https://docs.github.com/rest/classroom/classroom#list-classrooms\n//\n//meta:operation GET /classrooms\nfunc (s *ClassroomService) ListClassrooms(ctx context.Context, opts *ListOptions) ([]*Classroom, *Response, error) {\n\tu, err := addOptions(\"classrooms\", opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar classrooms []*Classroom\n\tresp, err := s.client.Do(ctx, req, &classrooms)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn classrooms, resp, nil\n}\n\n// ListClassroomAssignments lists GitHub Classroom assignments for a classroom. Assignments will only be\n// returned if the current user is an administrator of the GitHub Classroom.\n//\n// GitHub API docs: https://docs.github.com/rest/classroom/classroom#list-assignments-for-a-classroom\n//\n//meta:operation GET /classrooms/{classroom_id}/assignments\nfunc (s *ClassroomService) ListClassroomAssignments(ctx context.Context, classroomID int64, opts *ListOptions) ([]*ClassroomAssignment, *Response, error) {\n\tu := fmt.Sprintf(\"classrooms/%v/assignments\", classroomID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar assignments []*ClassroomAssignment\n\tresp, err := s.client.Do(ctx, req, &assignments)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn assignments, resp, nil\n}\n\n// ListAcceptedAssignments lists accepted assignments for a GitHub Classroom assignment.\n// Accepted assignments will only be returned if the current user is an administrator\n// of the GitHub Classroom for the assignment.\n//\n// GitHub API docs: https://docs.github.com/rest/classroom/classroom#list-accepted-assignments-for-an-assignment\n//\n//meta:operation GET /assignments/{assignment_id}/accepted_assignments\nfunc (s *ClassroomService) ListAcceptedAssignments(ctx context.Context, assignmentID int64, opts *ListOptions) ([]*AcceptedAssignment, *Response, error) {\n\tu := fmt.Sprintf(\"assignments/%v/accepted_assignments\", assignmentID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar acceptedAssignments []*AcceptedAssignment\n\tresp, err := s.client.Do(ctx, req, &acceptedAssignments)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn acceptedAssignments, resp, nil\n}\n\n// GetAssignmentGrades gets assignment grades for a GitHub Classroom assignment.\n// Grades will only be returned if the current user is an administrator\n// of the GitHub Classroom for the assignment.\n//\n// GitHub API docs: https://docs.github.com/rest/classroom/classroom#get-assignment-grades\n//\n//meta:operation GET /assignments/{assignment_id}/grades\nfunc (s *ClassroomService) GetAssignmentGrades(ctx context.Context, assignmentID int64) ([]*AssignmentGrade, *Response, error) {\n\tu := fmt.Sprintf(\"assignments/%v/grades\", assignmentID)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar grades []*AssignmentGrade\n\tresp, err := s.client.Do(ctx, req, &grades)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn grades, resp, nil\n}\n"
  },
  {
    "path": "github/classroom_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestClassroom_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Classroom{}, \"{}\")\n\n\tc := &Classroom{\n\t\tID:       Ptr(int64(1296269)),\n\t\tName:     Ptr(\"Programming Elixir\"),\n\t\tArchived: Ptr(false),\n\t\tOrganization: &Organization{\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tLogin:     Ptr(\"programming-elixir\"),\n\t\t\tNodeID:    Ptr(\"MDEyOk9yZ2FuaXphdGlvbjE=\"),\n\t\t\tHTMLURL:   Ptr(\"https://example.com/programming-elixir\"),\n\t\t\tName:      Ptr(\"Learn how to build fault tolerant applications\"),\n\t\t\tAvatarURL: Ptr(\"https://example.com/avatars/u/9919?v=4\"),\n\t\t},\n\t\tURL: Ptr(\"https://example.com/classrooms/programming\"),\n\t}\n\n\twant := `{\n\t\t\"id\": 1296269,\n\t\t\"name\": \"Programming Elixir\",\n\t\t\"archived\": false,\n\t\t\"organization\": {\n\t\t\t\"id\": 1,\n\t\t\t\"login\": \"programming-elixir\",\n\t\t\t\"node_id\": \"MDEyOk9yZ2FuaXphdGlvbjE=\",\n\t\t\t\"html_url\": \"https://example.com/programming-elixir\",\n\t\t\t\"name\": \"Learn how to build fault tolerant applications\",\n\t\t\t\"avatar_url\": \"https://example.com/avatars/u/9919?v=4\"\n\t\t},\n\t\t\"url\": \"https://example.com/classrooms/programming\"\n\t}`\n\n\ttestJSONMarshal(t, c, want)\n}\n\nfunc TestClassroomAssignment_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ClassroomAssignment{}, \"{}\")\n\n\ta := &ClassroomAssignment{\n\t\tID:                          Ptr(int64(12)),\n\t\tPublicRepo:                  Ptr(false),\n\t\tTitle:                       Ptr(\"Intro to Binaries\"),\n\t\tType:                        Ptr(\"individual\"),\n\t\tInviteLink:                  Ptr(\"https://example.com/a/Lx7jiUgx\"),\n\t\tInvitationsEnabled:          Ptr(true),\n\t\tSlug:                        Ptr(\"intro-to-binaries\"),\n\t\tStudentsAreRepoAdmins:       Ptr(false),\n\t\tFeedbackPullRequestsEnabled: Ptr(true),\n\t\tMaxTeams:                    Ptr(0),\n\t\tMaxMembers:                  Ptr(0),\n\t\tEditor:                      Ptr(\"codespaces\"),\n\t\tAccepted:                    Ptr(100),\n\t\tSubmitted:                   Ptr(40),\n\t\tPassing:                     Ptr(10),\n\t\tLanguage:                    Ptr(\"ruby\"),\n\t\tDeadline:                    &Timestamp{referenceTime},\n\t\tStarterCodeRepository: &Repository{\n\t\t\tID:       Ptr(int64(1296269)),\n\t\t\tFullName: Ptr(\"octocat/Hello-World\"),\n\t\t},\n\t\tClassroom: &Classroom{\n\t\t\tID:   Ptr(int64(1296269)),\n\t\t\tName: Ptr(\"Programming Elixir\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"id\": 12,\n\t\t\"public_repo\": false,\n\t\t\"title\": \"Intro to Binaries\",\n\t\t\"type\": \"individual\",\n\t\t\"invite_link\": \"https://example.com/a/Lx7jiUgx\",\n\t\t\"invitations_enabled\": true,\n\t\t\"slug\": \"intro-to-binaries\",\n\t\t\"students_are_repo_admins\": false,\n\t\t\"feedback_pull_requests_enabled\": true,\n\t\t\"max_teams\": 0,\n\t\t\"max_members\": 0,\n\t\t\"editor\": \"codespaces\",\n\t\t\"accepted\": 100,\n\t\t\"submitted\": 40,\n\t\t\"passing\": 10,\n\t\t\"language\": \"ruby\",\n\t\t\"deadline\": ` + referenceTimeStr + `,\n\t\t\"starter_code_repository\": {\n\t\t\t\"id\": 1296269,\n\t\t\t\"full_name\": \"octocat/Hello-World\"\n\t\t},\n\t\t\"classroom\": {\n\t\t\t\"id\": 1296269,\n\t\t\t\"name\": \"Programming Elixir\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, a, want)\n}\n\nfunc TestAcceptedAssignment_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &AcceptedAssignment{}, \"{}\")\n\n\ta := &AcceptedAssignment{\n\t\tID:          Ptr(int64(42)),\n\t\tSubmitted:   Ptr(true),\n\t\tPassing:     Ptr(true),\n\t\tCommitCount: Ptr(5),\n\t\tGrade:       Ptr(\"10/10\"),\n\t\tStudents: []*ClassroomUser{\n\t\t\t{\n\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\tLogin:     Ptr(\"octocat\"),\n\t\t\t\tAvatarURL: Ptr(\"https://github.com/images/error/octocat_happy.gif\"),\n\t\t\t\tHTMLURL:   Ptr(\"https://github.com/octocat\"),\n\t\t\t},\n\t\t},\n\t\tRepository: &Repository{\n\t\t\tID:            Ptr(int64(1296269)),\n\t\t\tFullName:      Ptr(\"octocat/Hello-World\"),\n\t\t\tHTMLURL:       Ptr(\"https://github.com/octocat/Hello-World\"),\n\t\t\tNodeID:        Ptr(\"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\"),\n\t\t\tPrivate:       Ptr(false),\n\t\t\tDefaultBranch: Ptr(\"main\"),\n\t\t},\n\t\tAssignment: &ClassroomAssignment{\n\t\t\tID:                          Ptr(int64(12)),\n\t\t\tPublicRepo:                  Ptr(false),\n\t\t\tTitle:                       Ptr(\"Intro to Binaries\"),\n\t\t\tType:                        Ptr(\"individual\"),\n\t\t\tInviteLink:                  Ptr(\"https://example.com/a/Lx7jiUgx\"),\n\t\t\tInvitationsEnabled:          Ptr(true),\n\t\t\tSlug:                        Ptr(\"intro-to-binaries\"),\n\t\t\tStudentsAreRepoAdmins:       Ptr(false),\n\t\t\tFeedbackPullRequestsEnabled: Ptr(true),\n\t\t\tMaxTeams:                    Ptr(0),\n\t\t\tMaxMembers:                  Ptr(0),\n\t\t\tEditor:                      Ptr(\"codespaces\"),\n\t\t\tAccepted:                    Ptr(100),\n\t\t\tSubmitted:                   Ptr(40),\n\t\t\tPassing:                     Ptr(10),\n\t\t\tLanguage:                    Ptr(\"ruby\"),\n\t\t\tDeadline:                    &Timestamp{referenceTime},\n\t\t\tClassroom: &Classroom{\n\t\t\t\tID:       Ptr(int64(1296269)),\n\t\t\t\tName:     Ptr(\"Programming Elixir\"),\n\t\t\t\tArchived: Ptr(false),\n\t\t\t\tURL:      Ptr(\"https://example.com/classrooms/programming\"),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"id\": 42,\n\t\t\"submitted\": true,\n\t\t\"passing\": true,\n\t\t\"commit_count\": 5,\n\t\t\"grade\": \"10/10\",\n\t\t\"students\": [\n\t\t\t{\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"login\": \"octocat\",\n\t\t\t\t\"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n\t\t\t\t\"html_url\": \"https://github.com/octocat\"\n\t\t\t}\n\t\t],\n\t\t\"repository\": {\n\t\t\t\"id\": 1296269,\n\t\t\t\"full_name\": \"octocat/Hello-World\",\n\t\t\t\"html_url\": \"https://github.com/octocat/Hello-World\",\n\t\t\t\"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n\t\t\t\"private\": false,\n\t\t\t\"default_branch\": \"main\"\n\t\t},\n\t\t\"assignment\": {\n\t\t\t\"id\": 12,\n\t\t\t\"public_repo\": false,\n\t\t\t\"title\": \"Intro to Binaries\",\n\t\t\t\"type\": \"individual\",\n\t\t\t\"invite_link\": \"https://example.com/a/Lx7jiUgx\",\n\t\t\t\"invitations_enabled\": true,\n\t\t\t\"slug\": \"intro-to-binaries\",\n\t\t\t\"students_are_repo_admins\": false,\n\t\t\t\"feedback_pull_requests_enabled\": true,\n\t\t\t\"max_teams\": 0,\n\t\t\t\"max_members\": 0,\n\t\t\t\"editor\": \"codespaces\",\n\t\t\t\"accepted\": 100,\n\t\t\t\"submitted\": 40,\n\t\t\t\"passing\": 10,\n\t\t\t\"language\": \"ruby\",\n\t\t\t\"deadline\": \"2006-01-02T15:04:05Z\",\n\t\t\t\"classroom\": {\n\t\t\t\t\"id\": 1296269,\n\t\t\t\t\"name\": \"Programming Elixir\",\n\t\t\t\t\"archived\": false,\n\t\t\t\t\"url\": \"https://example.com/classrooms/programming\"\n\t\t\t}\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, a, want)\n}\n\nfunc TestAssignmentGrade_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &AssignmentGrade{}, \"{}\")\n\n\tg := &AssignmentGrade{\n\t\tAssignmentName:        Ptr(\"Intro to Binaries\"),\n\t\tAssignmentURL:         Ptr(\"https://classroom.github.com/assignments/12\"),\n\t\tStarterCodeURL:        Ptr(\"https://github.com/octocat/Hello-World\"),\n\t\tGithubUsername:        Ptr(\"octocat\"),\n\t\tRosterIdentifier:      Ptr(\"student123\"),\n\t\tStudentRepositoryName: Ptr(\"octocat/intro-to-binaries\"),\n\t\tStudentRepositoryURL:  Ptr(\"https://github.com/octocat/intro-to-binaries\"),\n\t\tSubmissionTimestamp:   &Timestamp{referenceTime},\n\t\tPointsAwarded:         Ptr(10),\n\t\tPointsAvailable:       Ptr(10),\n\t\tGroupName:             Ptr(\"Team Alpha\"),\n\t}\n\n\twant := `{\n\t\t\"assignment_name\": \"Intro to Binaries\",\n\t\t\"assignment_url\": \"https://classroom.github.com/assignments/12\",\n\t\t\"starter_code_url\": \"https://github.com/octocat/Hello-World\",\n\t\t\"github_username\": \"octocat\",\n\t\t\"roster_identifier\": \"student123\",\n\t\t\"student_repository_name\": \"octocat/intro-to-binaries\",\n\t\t\"student_repository_url\": \"https://github.com/octocat/intro-to-binaries\",\n\t\t\"submission_timestamp\": \"2006-01-02T15:04:05Z\",\n\t\t\"points_awarded\": 10,\n\t\t\"points_available\": 10,\n\t\t\"group_name\": \"Team Alpha\"\n\t}`\n\n\ttestJSONMarshal(t, g, want)\n}\n\nfunc TestClassroomService_GetAssignment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/assignments/12\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 12,\n\t\t\t\"public_repo\": false,\n\t\t\t\"title\": \"Intro to Binaries\",\n\t\t\t\"type\": \"individual\",\n\t\t\t\"invite_link\": \"https://example.com/a/Lx7jiUgx\",\n\t\t\t\"invitations_enabled\": true,\n\t\t\t\"slug\": \"intro-to-binaries\",\n\t\t\t\"students_are_repo_admins\": false,\n\t\t\t\"feedback_pull_requests_enabled\": true,\n\t\t\t\"max_teams\": 0,\n\t\t\t\"max_members\": 0,\n\t\t\t\"editor\": \"codespaces\",\n\t\t\t\"accepted\": 100,\n\t\t\t\"submitted\": 40,\n\t\t\t\"passing\": 10,\n\t\t\t\"language\": \"ruby\",\n\t\t\t\"deadline\": \"2011-01-26T19:06:43Z\",\n\t\t\t\"starter_code_repository\": {\n\t\t\t\t\"id\": 1296269,\n\t\t\t\t\"full_name\": \"octocat/Hello-World\",\n\t\t\t\t\"html_url\": \"https://example.com/octocat/Hello-World\",\n\t\t\t\t\"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n\t\t\t\t\"private\": false,\n\t\t\t\t\"default_branch\": \"main\"\n\t\t\t},\n\t\t\t\"classroom\": {\n\t\t\t\t\"id\": 1296269,\n\t\t\t\t\"name\": \"Programming Elixir\",\n\t\t\t\t\"archived\": false,\n\t\t\t\t\"url\": \"https://example.com/classrooms/programming\"\n\t\t\t}\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tassignment, _, err := client.Classroom.GetAssignment(ctx, 12)\n\tif err != nil {\n\t\tt.Errorf(\"Classroom.GetAssignment returned error: %v\", err)\n\t}\n\n\twant := &ClassroomAssignment{\n\t\tID:                          Ptr(int64(12)),\n\t\tPublicRepo:                  Ptr(false),\n\t\tTitle:                       Ptr(\"Intro to Binaries\"),\n\t\tType:                        Ptr(\"individual\"),\n\t\tInviteLink:                  Ptr(\"https://example.com/a/Lx7jiUgx\"),\n\t\tInvitationsEnabled:          Ptr(true),\n\t\tSlug:                        Ptr(\"intro-to-binaries\"),\n\t\tStudentsAreRepoAdmins:       Ptr(false),\n\t\tFeedbackPullRequestsEnabled: Ptr(true),\n\t\tMaxTeams:                    Ptr(0),\n\t\tMaxMembers:                  Ptr(0),\n\t\tEditor:                      Ptr(\"codespaces\"),\n\t\tAccepted:                    Ptr(100),\n\t\tSubmitted:                   Ptr(40),\n\t\tPassing:                     Ptr(10),\n\t\tLanguage:                    Ptr(\"ruby\"),\n\t\tDeadline:                    func() *Timestamp { t, _ := time.Parse(time.RFC3339, \"2011-01-26T19:06:43Z\"); return &Timestamp{t} }(),\n\t\tStarterCodeRepository: &Repository{\n\t\t\tID:            Ptr(int64(1296269)),\n\t\t\tFullName:      Ptr(\"octocat/Hello-World\"),\n\t\t\tHTMLURL:       Ptr(\"https://example.com/octocat/Hello-World\"),\n\t\t\tNodeID:        Ptr(\"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\"),\n\t\t\tPrivate:       Ptr(false),\n\t\t\tDefaultBranch: Ptr(\"main\"),\n\t\t},\n\t\tClassroom: &Classroom{\n\t\t\tID:       Ptr(int64(1296269)),\n\t\t\tName:     Ptr(\"Programming Elixir\"),\n\t\t\tArchived: Ptr(false),\n\t\t\tURL:      Ptr(\"https://example.com/classrooms/programming\"),\n\t\t},\n\t}\n\n\tif !cmp.Equal(assignment, want) {\n\t\tt.Errorf(\"Classroom.GetAssignment returned %+v, want %+v\", assignment, want)\n\t}\n\n\tconst methodName = \"GetAssignment\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Classroom.GetAssignment(ctx, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Classroom.GetAssignment(ctx, 12)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestClassroomService_GetClassroom(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/classrooms/1296269\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 1296269,\n\t\t\t\"name\": \"Programming Elixir\",\n\t\t\t\"archived\": false,\n\t\t\t\"organization\": {\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"login\": \"programming-elixir\",\n\t\t\t\t\"node_id\": \"MDEyOk9yZ2FuaXphdGlvbjE=\",\n\t\t\t\t\"html_url\": \"https://example.com/programming-elixir\",\n\t\t\t\t\"name\": \"Learn how to build fault tolerant applications\",\n\t\t\t\t\"avatar_url\": \"https://example.com/avatars/u/9919?v=4\"\n\t\t\t},\n\t\t\t\"url\": \"https://example.com/classrooms/programming\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tclassroom, _, err := client.Classroom.GetClassroom(ctx, 1296269)\n\tif err != nil {\n\t\tt.Errorf(\"Classroom.GetClassroom returned error: %v\", err)\n\t}\n\n\twant := &Classroom{\n\t\tID:       Ptr(int64(1296269)),\n\t\tName:     Ptr(\"Programming Elixir\"),\n\t\tArchived: Ptr(false),\n\t\tOrganization: &Organization{\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tLogin:     Ptr(\"programming-elixir\"),\n\t\t\tNodeID:    Ptr(\"MDEyOk9yZ2FuaXphdGlvbjE=\"),\n\t\t\tHTMLURL:   Ptr(\"https://example.com/programming-elixir\"),\n\t\t\tName:      Ptr(\"Learn how to build fault tolerant applications\"),\n\t\t\tAvatarURL: Ptr(\"https://example.com/avatars/u/9919?v=4\"),\n\t\t},\n\t\tURL: Ptr(\"https://example.com/classrooms/programming\"),\n\t}\n\n\tif !cmp.Equal(classroom, want) {\n\t\tt.Errorf(\"Classroom.GetClassroom returned %+v, want %+v\", classroom, want)\n\t}\n\n\tconst methodName = \"GetClassroom\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Classroom.GetClassroom(ctx, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Classroom.GetClassroom(ctx, 1296269)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestClassroomService_ListClassrooms(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/classrooms\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\", \"per_page\": \"2\"})\n\t\tfmt.Fprint(w, `[\n\t\t\t{\n\t\t\t\t\"id\": 1296269,\n\t\t\t\t\"name\": \"Programming Elixir\",\n\t\t\t\t\"archived\": false,\n\t\t\t\t\"url\": \"https://example.com/classrooms/programming\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"id\": 1296270,\n\t\t\t\t\"name\": \"Advanced Programming\",\n\t\t\t\t\"archived\": true,\n\t\t\t\t\"url\": \"https://example.com/classrooms/2-advanced-programming\"\n\t\t\t}\n\t\t]`)\n\t})\n\n\topt := &ListOptions{Page: 2, PerPage: 2}\n\tctx := t.Context()\n\tclassrooms, _, err := client.Classroom.ListClassrooms(ctx, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Classroom.ListClassrooms returned error: %v\", err)\n\t}\n\n\twant := []*Classroom{\n\t\t{\n\t\t\tID:       Ptr(int64(1296269)),\n\t\t\tName:     Ptr(\"Programming Elixir\"),\n\t\t\tArchived: Ptr(false),\n\t\t\tURL:      Ptr(\"https://example.com/classrooms/programming\"),\n\t\t},\n\t\t{\n\t\t\tID:       Ptr(int64(1296270)),\n\t\t\tName:     Ptr(\"Advanced Programming\"),\n\t\t\tArchived: Ptr(true),\n\t\t\tURL:      Ptr(\"https://example.com/classrooms/2-advanced-programming\"),\n\t\t},\n\t}\n\n\tif !cmp.Equal(classrooms, want) {\n\t\tt.Errorf(\"Classroom.ListClassrooms returned %+v, want %+v\", classrooms, want)\n\t}\n\n\tconst methodName = \"ListClassrooms\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Classroom.ListClassrooms(ctx, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestClassroomService_ListClassroomAssignments(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/classrooms/1296269/assignments\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\", \"per_page\": \"2\"})\n\t\tfmt.Fprint(w, `[\n\t\t\t{\n\t\t\t\t\"id\": 12,\n\t\t\t\t\"public_repo\": false,\n\t\t\t\t\"title\": \"Intro to Binaries\",\n\t\t\t\t\"type\": \"individual\",\n\t\t\t\t\"invite_link\": \"https://example.com/a/Lx7jiUgx\",\n\t\t\t\t\"invitations_enabled\": true,\n\t\t\t\t\"slug\": \"intro-to-binaries\",\n\t\t\t\t\"students_are_repo_admins\": false,\n\t\t\t\t\"feedback_pull_requests_enabled\": true,\n\t\t\t\t\"max_teams\": 0,\n\t\t\t\t\"max_members\": 0,\n\t\t\t\t\"editor\": \"codespaces\",\n\t\t\t\t\"accepted\": 100,\n\t\t\t\t\"submitted\": 40,\n\t\t\t\t\"passing\": 10,\n\t\t\t\t\"language\": \"ruby\",\n\t\t\t\t\"deadline\": \"2011-01-26T19:06:43Z\",\n\t\t\t\t\"classroom\": {\n\t\t\t\t\t\"id\": 1296269,\n\t\t\t\t\t\"name\": \"Programming Elixir\",\n\t\t\t\t\t\"archived\": false,\n\t\t\t\t\t\"url\": \"https://example.com/classrooms/programming\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"id\": 13,\n\t\t\t\t\"public_repo\": true,\n\t\t\t\t\"title\": \"Advanced Programming\",\n\t\t\t\t\"type\": \"group\",\n\t\t\t\t\"invite_link\": \"https://example.com/a/AdvancedProg\",\n\t\t\t\t\"invitations_enabled\": true,\n\t\t\t\t\"slug\": \"advanced-programming\",\n\t\t\t\t\"students_are_repo_admins\": true,\n\t\t\t\t\"feedback_pull_requests_enabled\": false,\n\t\t\t\t\"max_teams\": 5,\n\t\t\t\t\"max_members\": 3,\n\t\t\t\t\"editor\": \"vscode\",\n\t\t\t\t\"accepted\": 50,\n\t\t\t\t\"submitted\": 25,\n\t\t\t\t\"passing\": 20,\n\t\t\t\t\"language\": \"python\",\n\t\t\t\t\"deadline\": \"2020-01-11T11:59:22Z\",\n\t\t\t\t\"classroom\": {\n\t\t\t\t\t\"id\": 1296269,\n\t\t\t\t\t\"name\": \"Programming Elixir\",\n\t\t\t\t\t\"archived\": false,\n\t\t\t\t\t\"url\": \"https://example.com/classrooms/programming\"\n\t\t\t\t}\n\t\t\t}\n\t\t]`)\n\t})\n\n\topt := &ListOptions{Page: 2, PerPage: 2}\n\tctx := t.Context()\n\tassignments, _, err := client.Classroom.ListClassroomAssignments(ctx, 1296269, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Classroom.ListClassroomAssignments returned error: %v\", err)\n\t}\n\n\twant := []*ClassroomAssignment{\n\t\t{\n\t\t\tID:                          Ptr(int64(12)),\n\t\t\tPublicRepo:                  Ptr(false),\n\t\t\tTitle:                       Ptr(\"Intro to Binaries\"),\n\t\t\tType:                        Ptr(\"individual\"),\n\t\t\tInviteLink:                  Ptr(\"https://example.com/a/Lx7jiUgx\"),\n\t\t\tInvitationsEnabled:          Ptr(true),\n\t\t\tSlug:                        Ptr(\"intro-to-binaries\"),\n\t\t\tStudentsAreRepoAdmins:       Ptr(false),\n\t\t\tFeedbackPullRequestsEnabled: Ptr(true),\n\t\t\tMaxTeams:                    Ptr(0),\n\t\t\tMaxMembers:                  Ptr(0),\n\t\t\tEditor:                      Ptr(\"codespaces\"),\n\t\t\tAccepted:                    Ptr(100),\n\t\t\tSubmitted:                   Ptr(40),\n\t\t\tPassing:                     Ptr(10),\n\t\t\tLanguage:                    Ptr(\"ruby\"),\n\t\t\tDeadline:                    func() *Timestamp { t, _ := time.Parse(time.RFC3339, \"2011-01-26T19:06:43Z\"); return &Timestamp{t} }(),\n\t\t\tClassroom: &Classroom{\n\t\t\t\tID:       Ptr(int64(1296269)),\n\t\t\t\tName:     Ptr(\"Programming Elixir\"),\n\t\t\t\tArchived: Ptr(false),\n\t\t\t\tURL:      Ptr(\"https://example.com/classrooms/programming\"),\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tID:                          Ptr(int64(13)),\n\t\t\tPublicRepo:                  Ptr(true),\n\t\t\tTitle:                       Ptr(\"Advanced Programming\"),\n\t\t\tType:                        Ptr(\"group\"),\n\t\t\tInviteLink:                  Ptr(\"https://example.com/a/AdvancedProg\"),\n\t\t\tInvitationsEnabled:          Ptr(true),\n\t\t\tSlug:                        Ptr(\"advanced-programming\"),\n\t\t\tStudentsAreRepoAdmins:       Ptr(true),\n\t\t\tFeedbackPullRequestsEnabled: Ptr(false),\n\t\t\tMaxTeams:                    Ptr(5),\n\t\t\tMaxMembers:                  Ptr(3),\n\t\t\tEditor:                      Ptr(\"vscode\"),\n\t\t\tAccepted:                    Ptr(50),\n\t\t\tSubmitted:                   Ptr(25),\n\t\t\tPassing:                     Ptr(20),\n\t\t\tLanguage:                    Ptr(\"python\"),\n\t\t\tDeadline:                    func() *Timestamp { t, _ := time.Parse(time.RFC3339, \"2020-01-11T11:59:22Z\"); return &Timestamp{t} }(),\n\t\t\tClassroom: &Classroom{\n\t\t\t\tID:       Ptr(int64(1296269)),\n\t\t\t\tName:     Ptr(\"Programming Elixir\"),\n\t\t\t\tArchived: Ptr(false),\n\t\t\t\tURL:      Ptr(\"https://example.com/classrooms/programming\"),\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(assignments, want) {\n\t\tt.Errorf(\"Classroom.ListClassroomAssignments returned %+v, want %+v\", assignments, want)\n\t}\n\n\tconst methodName = \"ListClassroomAssignments\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Classroom.ListClassroomAssignments(ctx, -1, opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Classroom.ListClassroomAssignments(ctx, 1296269, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestClassroomService_ListAcceptedAssignments(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/assignments/12/accepted_assignments\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\", \"per_page\": \"2\"})\n\t\tfmt.Fprint(w, `[\n\t\t\t{\n\t\t\t\t\"id\": 42,\n\t\t\t\t\"submitted\": true,\n\t\t\t\t\"passing\": true,\n\t\t\t\t\"commit_count\": 5,\n\t\t\t\t\"grade\": \"10/10\",\n\t\t\t\t\"students\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\"login\": \"octocat\",\n\t\t\t\t\t\t\"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n\t\t\t\t\t\t\"html_url\": \"https://github.com/octocat\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"repository\": {\n\t\t\t\t\t\"id\": 1296269,\n\t\t\t\t\t\"full_name\": \"octocat/Hello-World\",\n\t\t\t\t\t\"html_url\": \"https://github.com/octocat/Hello-World\",\n\t\t\t\t\t\"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\",\n\t\t\t\t\t\"private\": false,\n\t\t\t\t\t\"default_branch\": \"main\"\n\t\t\t\t},\n\t\t\t\t\"assignment\": {\n\t\t\t\t\t\"id\": 12,\n\t\t\t\t\t\"public_repo\": false,\n\t\t\t\t\t\"title\": \"Intro to Binaries\",\n\t\t\t\t\t\"type\": \"individual\",\n\t\t\t\t\t\"invite_link\": \"https://example.com/a/Lx7jiUgx\",\n\t\t\t\t\t\"invitations_enabled\": true,\n\t\t\t\t\t\"slug\": \"intro-to-binaries\",\n\t\t\t\t\t\"students_are_repo_admins\": false,\n\t\t\t\t\t\"feedback_pull_requests_enabled\": true,\n\t\t\t\t\t\"max_teams\": 0,\n\t\t\t\t\t\"max_members\": 0,\n\t\t\t\t\t\"editor\": \"codespaces\",\n\t\t\t\t\t\"accepted\": 100,\n\t\t\t\t\t\"submitted\": 40,\n\t\t\t\t\t\"passing\": 10,\n\t\t\t\t\t\"language\": \"ruby\",\n\t\t\t\t\t\"deadline\": \"2011-01-26T19:06:43Z\",\n\t\t\t\t\t\"classroom\": {\n\t\t\t\t\t\t\"id\": 1296269,\n\t\t\t\t\t\t\"name\": \"Programming Elixir\",\n\t\t\t\t\t\t\"archived\": false,\n\t\t\t\t\t\t\"url\": \"https://example.com/classrooms/programming\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"id\": 43,\n\t\t\t\t\"submitted\": false,\n\t\t\t\t\"passing\": false,\n\t\t\t\t\"commit_count\": 2,\n\t\t\t\t\"grade\": \"5/10\",\n\t\t\t\t\"students\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": 2,\n\t\t\t\t\t\t\"login\": \"monalisa\",\n\t\t\t\t\t\t\"avatar_url\": \"https://github.com/images/error/monalisa_happy.gif\",\n\t\t\t\t\t\t\"html_url\": \"https://github.com/monalisa\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"repository\": {\n\t\t\t\t\t\"id\": 1296270,\n\t\t\t\t\t\"full_name\": \"monalisa/Hello-World\",\n\t\t\t\t\t\"html_url\": \"https://github.com/monalisa/Hello-World\",\n\t\t\t\t\t\"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2Mjcw\",\n\t\t\t\t\t\"private\": true,\n\t\t\t\t\t\"default_branch\": \"main\"\n\t\t\t\t},\n\t\t\t\t\"assignment\": {\n\t\t\t\t\t\"id\": 12,\n\t\t\t\t\t\"public_repo\": false,\n\t\t\t\t\t\"title\": \"Intro to Binaries\",\n\t\t\t\t\t\"type\": \"individual\",\n\t\t\t\t\t\"invite_link\": \"https://example.com/a/Lx7jiUgx\",\n\t\t\t\t\t\"invitations_enabled\": true,\n\t\t\t\t\t\"slug\": \"intro-to-binaries\",\n\t\t\t\t\t\"students_are_repo_admins\": false,\n\t\t\t\t\t\"feedback_pull_requests_enabled\": true,\n\t\t\t\t\t\"max_teams\": 0,\n\t\t\t\t\t\"max_members\": 0,\n\t\t\t\t\t\"editor\": \"codespaces\",\n\t\t\t\t\t\"accepted\": 100,\n\t\t\t\t\t\"submitted\": 40,\n\t\t\t\t\t\"passing\": 10,\n\t\t\t\t\t\"language\": \"ruby\",\n\t\t\t\t\t\"deadline\": \"2011-01-26T19:06:43Z\",\n\t\t\t\t\t\"classroom\": {\n\t\t\t\t\t\t\"id\": 1296269,\n\t\t\t\t\t\t\"name\": \"Programming Elixir\",\n\t\t\t\t\t\t\"archived\": false,\n\t\t\t\t\t\t\"url\": \"https://example.com/classrooms/programming\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t]`)\n\t})\n\n\tctx := t.Context()\n\topt := &ListOptions{Page: 2, PerPage: 2}\n\tacceptedAssignments, _, err := client.Classroom.ListAcceptedAssignments(ctx, 12, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Classroom.ListAcceptedAssignments returned error: %v\", err)\n\t}\n\n\twant := []*AcceptedAssignment{\n\t\t{\n\t\t\tID:          Ptr(int64(42)),\n\t\t\tSubmitted:   Ptr(true),\n\t\t\tPassing:     Ptr(true),\n\t\t\tCommitCount: Ptr(5),\n\t\t\tGrade:       Ptr(\"10/10\"),\n\t\t\tStudents: []*ClassroomUser{\n\t\t\t\t{\n\t\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\t\tLogin:     Ptr(\"octocat\"),\n\t\t\t\t\tAvatarURL: Ptr(\"https://github.com/images/error/octocat_happy.gif\"),\n\t\t\t\t\tHTMLURL:   Ptr(\"https://github.com/octocat\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tRepository: &Repository{\n\t\t\t\tID:            Ptr(int64(1296269)),\n\t\t\t\tFullName:      Ptr(\"octocat/Hello-World\"),\n\t\t\t\tHTMLURL:       Ptr(\"https://github.com/octocat/Hello-World\"),\n\t\t\t\tNodeID:        Ptr(\"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\"),\n\t\t\t\tPrivate:       Ptr(false),\n\t\t\t\tDefaultBranch: Ptr(\"main\"),\n\t\t\t},\n\t\t\tAssignment: &ClassroomAssignment{\n\t\t\t\tID:                          Ptr(int64(12)),\n\t\t\t\tPublicRepo:                  Ptr(false),\n\t\t\t\tTitle:                       Ptr(\"Intro to Binaries\"),\n\t\t\t\tType:                        Ptr(\"individual\"),\n\t\t\t\tInviteLink:                  Ptr(\"https://example.com/a/Lx7jiUgx\"),\n\t\t\t\tInvitationsEnabled:          Ptr(true),\n\t\t\t\tSlug:                        Ptr(\"intro-to-binaries\"),\n\t\t\t\tStudentsAreRepoAdmins:       Ptr(false),\n\t\t\t\tFeedbackPullRequestsEnabled: Ptr(true),\n\t\t\t\tMaxTeams:                    Ptr(0),\n\t\t\t\tMaxMembers:                  Ptr(0),\n\t\t\t\tEditor:                      Ptr(\"codespaces\"),\n\t\t\t\tAccepted:                    Ptr(100),\n\t\t\t\tSubmitted:                   Ptr(40),\n\t\t\t\tPassing:                     Ptr(10),\n\t\t\t\tLanguage:                    Ptr(\"ruby\"),\n\t\t\t\tDeadline:                    &Timestamp{time.Date(2011, 1, 26, 19, 6, 43, 0, time.UTC)},\n\t\t\t\tClassroom: &Classroom{\n\t\t\t\t\tID:       Ptr(int64(1296269)),\n\t\t\t\t\tName:     Ptr(\"Programming Elixir\"),\n\t\t\t\t\tArchived: Ptr(false),\n\t\t\t\t\tURL:      Ptr(\"https://example.com/classrooms/programming\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tID:          Ptr(int64(43)),\n\t\t\tSubmitted:   Ptr(false),\n\t\t\tPassing:     Ptr(false),\n\t\t\tCommitCount: Ptr(2),\n\t\t\tGrade:       Ptr(\"5/10\"),\n\t\t\tStudents: []*ClassroomUser{\n\t\t\t\t{\n\t\t\t\t\tID:        Ptr(int64(2)),\n\t\t\t\t\tLogin:     Ptr(\"monalisa\"),\n\t\t\t\t\tAvatarURL: Ptr(\"https://github.com/images/error/monalisa_happy.gif\"),\n\t\t\t\t\tHTMLURL:   Ptr(\"https://github.com/monalisa\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tRepository: &Repository{\n\t\t\t\tID:            Ptr(int64(1296270)),\n\t\t\t\tFullName:      Ptr(\"monalisa/Hello-World\"),\n\t\t\t\tHTMLURL:       Ptr(\"https://github.com/monalisa/Hello-World\"),\n\t\t\t\tNodeID:        Ptr(\"MDEwOlJlcG9zaXRvcnkxMjk2Mjcw\"),\n\t\t\t\tPrivate:       Ptr(true),\n\t\t\t\tDefaultBranch: Ptr(\"main\"),\n\t\t\t},\n\t\t\tAssignment: &ClassroomAssignment{\n\t\t\t\tID:                          Ptr(int64(12)),\n\t\t\t\tPublicRepo:                  Ptr(false),\n\t\t\t\tTitle:                       Ptr(\"Intro to Binaries\"),\n\t\t\t\tType:                        Ptr(\"individual\"),\n\t\t\t\tInviteLink:                  Ptr(\"https://example.com/a/Lx7jiUgx\"),\n\t\t\t\tInvitationsEnabled:          Ptr(true),\n\t\t\t\tSlug:                        Ptr(\"intro-to-binaries\"),\n\t\t\t\tStudentsAreRepoAdmins:       Ptr(false),\n\t\t\t\tFeedbackPullRequestsEnabled: Ptr(true),\n\t\t\t\tMaxTeams:                    Ptr(0),\n\t\t\t\tMaxMembers:                  Ptr(0),\n\t\t\t\tEditor:                      Ptr(\"codespaces\"),\n\t\t\t\tAccepted:                    Ptr(100),\n\t\t\t\tSubmitted:                   Ptr(40),\n\t\t\t\tPassing:                     Ptr(10),\n\t\t\t\tLanguage:                    Ptr(\"ruby\"),\n\t\t\t\tDeadline:                    &Timestamp{time.Date(2011, 1, 26, 19, 6, 43, 0, time.UTC)},\n\t\t\t\tClassroom: &Classroom{\n\t\t\t\t\tID:       Ptr(int64(1296269)),\n\t\t\t\t\tName:     Ptr(\"Programming Elixir\"),\n\t\t\t\t\tArchived: Ptr(false),\n\t\t\t\t\tURL:      Ptr(\"https://example.com/classrooms/programming\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(acceptedAssignments, want) {\n\t\tt.Errorf(\"Classroom.ListAcceptedAssignments returned %+v, want %+v\", acceptedAssignments, want)\n\t}\n\n\tconst methodName = \"ListAcceptedAssignments\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Classroom.ListAcceptedAssignments(ctx, -1, opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Classroom.ListAcceptedAssignments(ctx, 12, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestClassroomService_GetAssignmentGrades(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/assignments/12/grades\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[\n\t\t\t{\n\t\t\t\t\"assignment_name\": \"Intro to Binaries\",\n\t\t\t\t\"assignment_url\": \"https://classroom.github.com/assignments/12\",\n\t\t\t\t\"starter_code_url\": \"https://github.com/octocat/Hello-World\",\n\t\t\t\t\"github_username\": \"octocat\",\n\t\t\t\t\"roster_identifier\": \"student123\",\n\t\t\t\t\"student_repository_name\": \"octocat/intro-to-binaries\",\n\t\t\t\t\"student_repository_url\": \"https://github.com/octocat/intro-to-binaries\",\n\t\t\t\t\"submission_timestamp\": \"2011-01-26T19:06:43Z\",\n\t\t\t\t\"points_awarded\": 10,\n\t\t\t\t\"points_available\": 10,\n\t\t\t\t\"group_name\": \"Team Alpha\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"assignment_name\": \"Intro to Binaries\",\n\t\t\t\t\"assignment_url\": \"https://classroom.github.com/assignments/12\",\n\t\t\t\t\"starter_code_url\": \"https://github.com/octocat/Hello-World\",\n\t\t\t\t\"github_username\": \"monalisa\",\n\t\t\t\t\"roster_identifier\": \"student456\",\n\t\t\t\t\"student_repository_name\": \"monalisa/intro-to-binaries\",\n\t\t\t\t\"student_repository_url\": \"https://github.com/monalisa/intro-to-binaries\",\n\t\t\t\t\"submission_timestamp\": \"2011-01-27T10:30:15Z\",\n\t\t\t\t\"points_awarded\": 8,\n\t\t\t\t\"points_available\": 10,\n\t\t\t\t\"group_name\": \"Team Beta\"\n\t\t\t}\n\t\t]`)\n\t})\n\n\tctx := t.Context()\n\tgrades, _, err := client.Classroom.GetAssignmentGrades(ctx, 12)\n\tif err != nil {\n\t\tt.Errorf(\"Classroom.GetAssignmentGrades returned error: %v\", err)\n\t}\n\n\twant := []*AssignmentGrade{\n\t\t{\n\t\t\tAssignmentName:        Ptr(\"Intro to Binaries\"),\n\t\t\tAssignmentURL:         Ptr(\"https://classroom.github.com/assignments/12\"),\n\t\t\tStarterCodeURL:        Ptr(\"https://github.com/octocat/Hello-World\"),\n\t\t\tGithubUsername:        Ptr(\"octocat\"),\n\t\t\tRosterIdentifier:      Ptr(\"student123\"),\n\t\t\tStudentRepositoryName: Ptr(\"octocat/intro-to-binaries\"),\n\t\t\tStudentRepositoryURL:  Ptr(\"https://github.com/octocat/intro-to-binaries\"),\n\t\t\tSubmissionTimestamp:   &Timestamp{time.Date(2011, 1, 26, 19, 6, 43, 0, time.UTC)},\n\t\t\tPointsAwarded:         Ptr(10),\n\t\t\tPointsAvailable:       Ptr(10),\n\t\t\tGroupName:             Ptr(\"Team Alpha\"),\n\t\t},\n\t\t{\n\t\t\tAssignmentName:        Ptr(\"Intro to Binaries\"),\n\t\t\tAssignmentURL:         Ptr(\"https://classroom.github.com/assignments/12\"),\n\t\t\tStarterCodeURL:        Ptr(\"https://github.com/octocat/Hello-World\"),\n\t\t\tGithubUsername:        Ptr(\"monalisa\"),\n\t\t\tRosterIdentifier:      Ptr(\"student456\"),\n\t\t\tStudentRepositoryName: Ptr(\"monalisa/intro-to-binaries\"),\n\t\t\tStudentRepositoryURL:  Ptr(\"https://github.com/monalisa/intro-to-binaries\"),\n\t\t\tSubmissionTimestamp:   &Timestamp{time.Date(2011, 1, 27, 10, 30, 15, 0, time.UTC)},\n\t\t\tPointsAwarded:         Ptr(8),\n\t\t\tPointsAvailable:       Ptr(10),\n\t\t\tGroupName:             Ptr(\"Team Beta\"),\n\t\t},\n\t}\n\n\tif !cmp.Equal(grades, want) {\n\t\tt.Errorf(\"Classroom.GetAssignmentGrades returned %+v, want %+v\", grades, want)\n\t}\n\n\tconst methodName = \"GetAssignmentGrades\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Classroom.GetAssignmentGrades(ctx, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Classroom.GetAssignmentGrades(ctx, 12)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/code_scanning.go",
    "content": "// Copyright 2020 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// CodeScanningService handles communication with the code scanning related\n// methods of the GitHub API.\n//\n// GitHub API docs: https://docs.github.com/rest/code-scanning\ntype CodeScanningService service\n\n// Rule represents the complete details of GitHub Code Scanning alert type.\ntype Rule struct {\n\tID                    *string  `json:\"id,omitempty\"`\n\tSeverity              *string  `json:\"severity,omitempty\"`\n\tDescription           *string  `json:\"description,omitempty\"`\n\tName                  *string  `json:\"name,omitempty\"`\n\tSecuritySeverityLevel *string  `json:\"security_severity_level,omitempty\"`\n\tFullDescription       *string  `json:\"full_description,omitempty\"`\n\tTags                  []string `json:\"tags,omitempty\"`\n\tHelp                  *string  `json:\"help,omitempty\"`\n}\n\n// Location represents the exact location of the GitHub Code Scanning Alert in the scanned project.\ntype Location struct {\n\tPath        *string `json:\"path,omitempty\"`\n\tStartLine   *int    `json:\"start_line,omitempty\"`\n\tEndLine     *int    `json:\"end_line,omitempty\"`\n\tStartColumn *int    `json:\"start_column,omitempty\"`\n\tEndColumn   *int    `json:\"end_column,omitempty\"`\n}\n\n// Message is a part of MostRecentInstance struct which provides the appropriate message when any action is performed on the analysis object.\ntype Message struct {\n\tText *string `json:\"text,omitempty\"`\n}\n\n// MostRecentInstance provides details of the most recent instance of this alert for the default branch or for the specified Git reference.\ntype MostRecentInstance struct {\n\tRef             *string   `json:\"ref,omitempty\"`\n\tAnalysisKey     *string   `json:\"analysis_key,omitempty\"`\n\tCategory        *string   `json:\"category,omitempty\"`\n\tEnvironment     *string   `json:\"environment,omitempty\"`\n\tState           *string   `json:\"state,omitempty\"`\n\tCommitSHA       *string   `json:\"commit_sha,omitempty\"`\n\tMessage         *Message  `json:\"message,omitempty\"`\n\tLocation        *Location `json:\"location,omitempty\"`\n\tHTMLURL         *string   `json:\"html_url,omitempty\"`\n\tClassifications []string  `json:\"classifications,omitempty\"`\n}\n\n// Tool represents the tool used to generate a GitHub Code Scanning Alert.\ntype Tool struct {\n\tName    *string `json:\"name,omitempty\"`\n\tGUID    *string `json:\"guid,omitempty\"`\n\tVersion *string `json:\"version,omitempty\"`\n}\n\n// Alert represents an individual GitHub Code Scanning Alert on a single repository.\n//\n// GitHub API docs: https://docs.github.com/rest/code-scanning\ntype Alert struct {\n\tNumber             *int                  `json:\"number,omitempty\"`\n\tRepository         *Repository           `json:\"repository,omitempty\"`\n\tRuleID             *string               `json:\"rule_id,omitempty\"`\n\tRuleSeverity       *string               `json:\"rule_severity,omitempty\"`\n\tRuleDescription    *string               `json:\"rule_description,omitempty\"`\n\tRule               *Rule                 `json:\"rule,omitempty\"`\n\tTool               *Tool                 `json:\"tool,omitempty\"`\n\tCreatedAt          *Timestamp            `json:\"created_at,omitempty\"`\n\tUpdatedAt          *Timestamp            `json:\"updated_at,omitempty\"`\n\tFixedAt            *Timestamp            `json:\"fixed_at,omitempty\"`\n\tState              *string               `json:\"state,omitempty\"`\n\tClosedBy           *User                 `json:\"closed_by,omitempty\"`\n\tClosedAt           *Timestamp            `json:\"closed_at,omitempty\"`\n\tURL                *string               `json:\"url,omitempty\"`\n\tHTMLURL            *string               `json:\"html_url,omitempty\"`\n\tMostRecentInstance *MostRecentInstance   `json:\"most_recent_instance,omitempty\"`\n\tInstances          []*MostRecentInstance `json:\"instances,omitempty\"`\n\tDismissedBy        *User                 `json:\"dismissed_by,omitempty\"`\n\tDismissedAt        *Timestamp            `json:\"dismissed_at,omitempty\"`\n\tDismissedReason    *string               `json:\"dismissed_reason,omitempty\"`\n\tDismissedComment   *string               `json:\"dismissed_comment,omitempty\"`\n\tInstancesURL       *string               `json:\"instances_url,omitempty\"`\n}\n\n// ID returns the ID associated with an alert. It is the number at the end of the security alert's URL.\nfunc (a *Alert) ID() int64 {\n\tif a == nil {\n\t\treturn 0\n\t}\n\n\ts := a.GetHTMLURL()\n\n\t// Check for an ID to parse at the end of the url\n\tif i := strings.LastIndex(s, \"/\"); i >= 0 {\n\t\ts = s[i+1:]\n\t}\n\n\t// Return the alert ID as a 64-bit integer. Unable to convert or out of range returns 0.\n\tid, err := strconv.ParseInt(s, 10, 64)\n\tif err != nil {\n\t\treturn 0\n\t}\n\n\treturn id\n}\n\n// AlertInstancesListOptions specifies optional parameters to the CodeScanningService.ListAlertInstances method.\ntype AlertInstancesListOptions struct {\n\t// Return code scanning alert instances for a specific branch reference.\n\t// The ref can be formatted as refs/heads/<branch name> or simply <branch name>. To reference a pull request use refs/pull/<number>/merge\n\tRef string `url:\"ref,omitempty\"`\n\n\tListOptions\n}\n\n// AlertListOptions specifies optional parameters to the CodeScanningService.ListAlerts method.\ntype AlertListOptions struct {\n\t// State of the code scanning alerts to list. Set to closed to list only closed code scanning alerts. Default: open\n\tState string `url:\"state,omitempty\"`\n\n\t// Return code scanning alerts for a specific branch reference.\n\t// The ref can be formatted as refs/heads/<branch name> or simply <branch name>. To reference a pull request use refs/pull/<number>/merge\n\tRef string `url:\"ref,omitempty\"`\n\n\t// If specified, only code scanning alerts with this severity will be returned. Possible values are: critical, high, medium, low, warning, note, error.\n\tSeverity string `url:\"severity,omitempty\"`\n\n\t// The name of a code scanning tool. Only results by this tool will be listed.\n\tToolName string `url:\"tool_name,omitempty\"`\n\n\t// The GUID of a code scanning tool. Only results by this tool will be listed.\n\tToolGUID string `url:\"tool_guid,omitempty\"`\n\n\t// The direction to sort the results by. Possible values are: asc, desc. Default: desc.\n\tDirection string `url:\"direction,omitempty\"`\n\n\t// The property by which to sort the results. Possible values are: created, updated. Default: created.\n\tSort string `url:\"sort,omitempty\"`\n\n\tListCursorOptions\n\n\t// Add ListOptions so offset pagination with integer type \"page\" query parameter is accepted\n\t// since ListCursorOptions accepts \"page\" as string only.\n\tListOptions\n}\n\n// AnalysesListOptions specifies optional parameters to the CodeScanningService.ListAnalysesForRepo method.\ntype AnalysesListOptions struct {\n\t// Return code scanning analyses belonging to the same SARIF upload.\n\tSarifID *string `url:\"sarif_id,omitempty\"`\n\n\t// Return code scanning analyses for a specific branch reference.\n\t// The ref can be formatted as refs/heads/<branch name> or simply <branch name>. To reference a pull request use refs/pull/<number>/merge\n\tRef *string `url:\"ref,omitempty\"`\n\n\tListOptions\n}\n\n// CodeQLDatabase represents a metadata about the CodeQL database.\n//\n// GitHub API docs: https://docs.github.com/rest/code-scanning\ntype CodeQLDatabase struct {\n\tID          *int64     `json:\"id,omitempty\"`\n\tName        *string    `json:\"name,omitempty\"`\n\tLanguage    *string    `json:\"language,omitempty\"`\n\tUploader    *User      `json:\"uploader,omitempty\"`\n\tContentType *string    `json:\"content_type,omitempty\"`\n\tSize        *int64     `json:\"size,omitempty\"`\n\tCreatedAt   *Timestamp `json:\"created_at,omitempty\"`\n\tUpdatedAt   *Timestamp `json:\"updated_at,omitempty\"`\n\tURL         *string    `json:\"url,omitempty\"`\n}\n\n// ScanningAnalysis represents an individual GitHub Code Scanning ScanningAnalysis on a single repository.\n//\n// GitHub API docs: https://docs.github.com/rest/code-scanning\ntype ScanningAnalysis struct {\n\tID           *int64     `json:\"id,omitempty\"`\n\tRef          *string    `json:\"ref,omitempty\"`\n\tCommitSHA    *string    `json:\"commit_sha,omitempty\"`\n\tAnalysisKey  *string    `json:\"analysis_key,omitempty\"`\n\tEnvironment  *string    `json:\"environment,omitempty\"`\n\tError        *string    `json:\"error,omitempty\"`\n\tCategory     *string    `json:\"category,omitempty\"`\n\tCreatedAt    *Timestamp `json:\"created_at,omitempty\"`\n\tResultsCount *int       `json:\"results_count,omitempty\"`\n\tRulesCount   *int       `json:\"rules_count,omitempty\"`\n\tURL          *string    `json:\"url,omitempty\"`\n\tSarifID      *string    `json:\"sarif_id,omitempty\"`\n\tTool         *Tool      `json:\"tool,omitempty\"`\n\tDeletable    *bool      `json:\"deletable,omitempty\"`\n\tWarning      *string    `json:\"warning,omitempty\"`\n}\n\n// SarifAnalysis specifies the results of a code scanning job.\n//\n// GitHub API docs: https://docs.github.com/rest/code-scanning\ntype SarifAnalysis struct {\n\tCommitSHA   *string    `json:\"commit_sha,omitempty\"`\n\tRef         *string    `json:\"ref,omitempty\"`\n\tSarif       *string    `json:\"sarif,omitempty\"`\n\tCheckoutURI *string    `json:\"checkout_uri,omitempty\"`\n\tStartedAt   *Timestamp `json:\"started_at,omitempty\"`\n\tToolName    *string    `json:\"tool_name,omitempty\"`\n}\n\n// CodeScanningAlertState specifies the state of a code scanning alert.\n//\n// GitHub API docs: https://docs.github.com/rest/code-scanning\ntype CodeScanningAlertState struct {\n\t// State sets the state of the code scanning alert and is a required field.\n\t// You must also provide DismissedReason when you set the state to \"dismissed\".\n\t// State can be one of: \"open\", \"dismissed\".\n\tState string `json:\"state\"`\n\t// DismissedReason represents the reason for dismissing or closing the alert.\n\t// It is required when the state is \"dismissed\".\n\t// It can be one of: \"false positive\", \"won't fix\", \"used in tests\".\n\tDismissedReason *string `json:\"dismissed_reason,omitempty\"`\n\t// DismissedComment is associated with the dismissal of the alert.\n\tDismissedComment *string `json:\"dismissed_comment,omitempty\"`\n}\n\n// SarifID identifies a sarif analysis upload.\n//\n// GitHub API docs: https://docs.github.com/rest/code-scanning\ntype SarifID struct {\n\tID  *string `json:\"id,omitempty\"`\n\tURL *string `json:\"url,omitempty\"`\n}\n\n// ListAlertsForOrg lists code scanning alerts for an org.\n//\n// You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events\n// read permission to use this endpoint.\n//\n// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-organization\n//\n//meta:operation GET /orgs/{org}/code-scanning/alerts\nfunc (s *CodeScanningService) ListAlertsForOrg(ctx context.Context, org string, opts *AlertListOptions) ([]*Alert, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/code-scanning/alerts\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar alerts []*Alert\n\tresp, err := s.client.Do(ctx, req, &alerts)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn alerts, resp, nil\n}\n\n// ListAlertsForRepo lists code scanning alerts for a repository.\n//\n// Lists all open code scanning alerts for the default branch (usually master) and protected branches in a repository.\n// You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events\n// read permission to use this endpoint.\n//\n// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/code-scanning/alerts\nfunc (s *CodeScanningService) ListAlertsForRepo(ctx context.Context, owner, repo string, opts *AlertListOptions) ([]*Alert, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/code-scanning/alerts\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar alerts []*Alert\n\tresp, err := s.client.Do(ctx, req, &alerts)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn alerts, resp, nil\n}\n\n// GetAlert gets a single code scanning alert for a repository.\n//\n// You must use an access token with the security_events scope to use this endpoint.\n// GitHub Apps must have the security_events read permission to use this endpoint.\n//\n// The security alert_id is the number at the end of the security alert's URL.\n//\n// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-alert\n//\n//meta:operation GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\nfunc (s *CodeScanningService) GetAlert(ctx context.Context, owner, repo string, id int64) (*Alert, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/code-scanning/alerts/%v\", owner, repo, id)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar a *Alert\n\tresp, err := s.client.Do(ctx, req, &a)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn a, resp, nil\n}\n\n// UpdateAlert updates the state of a single code scanning alert for a repository.\n//\n// You must use an access token with the security_events scope to use this endpoint.\n// GitHub Apps must have the security_events read permission to use this endpoint.\n//\n// The security alert_id is the number at the end of the security alert's URL.\n//\n// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-alert\n//\n//meta:operation PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\nfunc (s *CodeScanningService) UpdateAlert(ctx context.Context, owner, repo string, id int64, stateInfo *CodeScanningAlertState) (*Alert, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/code-scanning/alerts/%v\", owner, repo, id)\n\n\treq, err := s.client.NewRequest(\"PATCH\", u, stateInfo)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar a *Alert\n\tresp, err := s.client.Do(ctx, req, &a)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn a, resp, nil\n}\n\n// ListAlertInstances lists instances of a code scanning alert.\n//\n// You must use an access token with the security_events scope to use this endpoint.\n// GitHub Apps must have the security_events read permission to use this endpoint.\n//\n// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-instances-of-a-code-scanning-alert\n//\n//meta:operation GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\nfunc (s *CodeScanningService) ListAlertInstances(ctx context.Context, owner, repo string, id int64, opts *AlertInstancesListOptions) ([]*MostRecentInstance, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/code-scanning/alerts/%v/instances\", owner, repo, id)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar alertInstances []*MostRecentInstance\n\tresp, err := s.client.Do(ctx, req, &alertInstances)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn alertInstances, resp, nil\n}\n\n// UploadSarif uploads the result of code scanning job to GitHub.\n//\n// For the parameter sarif, you must first compress your SARIF file using gzip and then translate the contents of the file into a Base64 encoding string.\n// You must use an access token with the security_events scope to use this endpoint. GitHub Apps must have the security_events\n// write permission to use this endpoint.\n//\n// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#upload-an-analysis-as-sarif-data\n//\n//meta:operation POST /repos/{owner}/{repo}/code-scanning/sarifs\nfunc (s *CodeScanningService) UploadSarif(ctx context.Context, owner, repo string, sarif *SarifAnalysis) (*SarifID, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/code-scanning/sarifs\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"POST\", u, sarif)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\t// This will always return an error without unmarshaling the data\n\tresp, err := s.client.Do(ctx, req, nil)\n\t// Even though there was an error, we still return the response\n\t// in case the caller wants to inspect it further.\n\t// However, if the error is AcceptedError, decode it below before\n\t// returning from this function and closing the response body.\n\tvar acceptedError *AcceptedError\n\tif !errors.As(err, &acceptedError) {\n\t\treturn nil, resp, err\n\t}\n\tvar sarifID *SarifID\n\tdecErr := json.Unmarshal(acceptedError.Raw, &sarifID)\n\tif decErr != nil {\n\t\treturn nil, resp, decErr\n\t}\n\n\treturn sarifID, resp, nil\n}\n\n// SARIFUpload represents information about a SARIF upload.\ntype SARIFUpload struct {\n\t// `pending` files have not yet been processed, while `complete` means results from the SARIF have been stored.\n\t// `failed` files have either not been processed at all, or could only be partially processed.\n\tProcessingStatus *string `json:\"processing_status,omitempty\"`\n\t// The REST API URL for getting the analyses associated with the upload.\n\tAnalysesURL *string `json:\"analyses_url,omitempty\"`\n}\n\n// GetSARIF gets information about a SARIF upload.\n//\n// You must use an access token with the security_events scope to use this endpoint.\n// GitHub Apps must have the security_events read permission to use this endpoint.\n//\n// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload\n//\n//meta:operation GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}\nfunc (s *CodeScanningService) GetSARIF(ctx context.Context, owner, repo, sarifID string) (*SARIFUpload, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/code-scanning/sarifs/%v\", owner, repo, sarifID)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar sarifUpload *SARIFUpload\n\tresp, err := s.client.Do(ctx, req, &sarifUpload)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn sarifUpload, resp, nil\n}\n\n// ListAnalysesForRepo lists code scanning analyses for a repository.\n//\n// Lists the details of all code scanning analyses for a repository, starting with the most recent.\n// You must use an access token with the security_events scope to use this endpoint.\n// GitHub Apps must have the security_events read permission to use this endpoint.\n//\n// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-analyses-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/code-scanning/analyses\nfunc (s *CodeScanningService) ListAnalysesForRepo(ctx context.Context, owner, repo string, opts *AnalysesListOptions) ([]*ScanningAnalysis, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/code-scanning/analyses\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar analyses []*ScanningAnalysis\n\tresp, err := s.client.Do(ctx, req, &analyses)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn analyses, resp, nil\n}\n\n// GetAnalysis gets a single code scanning analysis for a repository.\n//\n// You must use an access token with the security_events scope to use this endpoint.\n// GitHub Apps must have the security_events read permission to use this endpoint.\n//\n// The security analysis_id is the ID of the analysis, as returned from the ListAnalysesForRepo operation.\n//\n// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}\nfunc (s *CodeScanningService) GetAnalysis(ctx context.Context, owner, repo string, id int64) (*ScanningAnalysis, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/code-scanning/analyses/%v\", owner, repo, id)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar analysis *ScanningAnalysis\n\tresp, err := s.client.Do(ctx, req, &analysis)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn analysis, resp, nil\n}\n\n// DeleteAnalysis represents a successful deletion of a code scanning analysis.\ntype DeleteAnalysis struct {\n\t// Next deletable analysis in chain, without last analysis deletion confirmation\n\tNextAnalysisURL *string `json:\"next_analysis_url,omitempty\"`\n\t// Next deletable analysis in chain, with last analysis deletion confirmation\n\tConfirmDeleteURL *string `json:\"confirm_delete_url,omitempty\"`\n}\n\n// DeleteAnalysis deletes a single code scanning analysis from a repository.\n//\n// You must use an access token with the repo scope to use this endpoint.\n// GitHub Apps must have the security_events read permission to use this endpoint.\n//\n// The security analysis_id is the ID of the analysis, as returned from the ListAnalysesForRepo operation.\n//\n// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#delete-a-code-scanning-analysis-from-a-repository\n//\n//meta:operation DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}\nfunc (s *CodeScanningService) DeleteAnalysis(ctx context.Context, owner, repo string, id int64) (*DeleteAnalysis, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/code-scanning/analyses/%v\", owner, repo, id)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar deleteAnalysis *DeleteAnalysis\n\tresp, err := s.client.Do(ctx, req, &deleteAnalysis)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn deleteAnalysis, resp, nil\n}\n\n// ListCodeQLDatabases lists the CodeQL databases that are available in a repository.\n//\n// You must use an access token with the security_events scope to use this endpoint.\n// GitHub Apps must have the contents read permission to use this endpoint.\n//\n// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#list-codeql-databases-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/code-scanning/codeql/databases\nfunc (s *CodeScanningService) ListCodeQLDatabases(ctx context.Context, owner, repo string) ([]*CodeQLDatabase, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/code-scanning/codeql/databases\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar codeqlDatabases []*CodeQLDatabase\n\tresp, err := s.client.Do(ctx, req, &codeqlDatabases)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn codeqlDatabases, resp, nil\n}\n\n// GetCodeQLDatabase gets a CodeQL database for a language in a repository.\n//\n// You must use an access token with the security_events scope to use this endpoint.\n// GitHub Apps must have the contents read permission to use this endpoint.\n//\n// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-a-codeql-database-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}\nfunc (s *CodeScanningService) GetCodeQLDatabase(ctx context.Context, owner, repo, language string) (*CodeQLDatabase, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/code-scanning/codeql/databases/%v\", owner, repo, language)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar codeqlDatabase *CodeQLDatabase\n\tresp, err := s.client.Do(ctx, req, &codeqlDatabase)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn codeqlDatabase, resp, nil\n}\n\n// DefaultSetupConfiguration represents a code scanning default setup configuration.\ntype DefaultSetupConfiguration struct {\n\tState      *string    `json:\"state,omitempty\"`\n\tLanguages  []string   `json:\"languages,omitempty\"`\n\tQuerySuite *string    `json:\"query_suite,omitempty\"`\n\tUpdatedAt  *Timestamp `json:\"updated_at,omitempty\"`\n}\n\n// GetDefaultSetupConfiguration gets a code scanning default setup configuration.\n//\n// You must use an access token with the repo scope to use this\n// endpoint with private repos or the public_repo scope for public repos. GitHub Apps must have the repo write\n// permission to use this endpoint.\n//\n// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-default-setup-configuration\n//\n//meta:operation GET /repos/{owner}/{repo}/code-scanning/default-setup\nfunc (s *CodeScanningService) GetDefaultSetupConfiguration(ctx context.Context, owner, repo string) (*DefaultSetupConfiguration, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/code-scanning/default-setup\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar cfg *DefaultSetupConfiguration\n\tresp, err := s.client.Do(ctx, req, &cfg)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn cfg, resp, nil\n}\n\n// UpdateDefaultSetupConfigurationOptions specifies parameters to the CodeScanningService.UpdateDefaultSetupConfiguration\n// method.\ntype UpdateDefaultSetupConfigurationOptions struct {\n\tState      string   `json:\"state\"`\n\tQuerySuite *string  `json:\"query_suite,omitempty\"`\n\tLanguages  []string `json:\"languages,omitempty\"`\n}\n\n// UpdateDefaultSetupConfigurationResponse represents a response from updating a code scanning default setup configuration.\ntype UpdateDefaultSetupConfigurationResponse struct {\n\tRunID  *int64  `json:\"run_id,omitempty\"`\n\tRunURL *string `json:\"run_url,omitempty\"`\n}\n\n// UpdateDefaultSetupConfiguration updates a code scanning default setup configuration.\n//\n// You must use an access token with the repo scope to use this\n// endpoint with private repos or the public_repo scope for public repos. GitHub Apps must have the repo write\n// permission to use this endpoint.\n//\n// This method might return an AcceptedError and a status code of 202. This is because this is the status that GitHub\n// returns to signify that it has now scheduled the update of the pull request branch in a background task.\n//\n// GitHub API docs: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-default-setup-configuration\n//\n//meta:operation PATCH /repos/{owner}/{repo}/code-scanning/default-setup\nfunc (s *CodeScanningService) UpdateDefaultSetupConfiguration(ctx context.Context, owner, repo string, options *UpdateDefaultSetupConfigurationOptions) (*UpdateDefaultSetupConfigurationResponse, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/code-scanning/default-setup\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"PATCH\", u, options)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar a *UpdateDefaultSetupConfigurationResponse\n\tresp, err := s.client.Do(ctx, req, &a)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn a, resp, nil\n}\n"
  },
  {
    "path": "github/code_scanning_test.go",
    "content": "// Copyright 2020 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestCodeScanningService_Alert_ID(t *testing.T) {\n\tt.Parallel()\n\t// Test: nil Alert ID == 0\n\tvar a *Alert\n\tid := a.ID()\n\tvar want int64\n\tif id != want {\n\t\tt.Errorf(\"Alert.ID error returned %+v, want %+v\", id, want)\n\t}\n\n\t// Test: Valid HTMLURL\n\ta = &Alert{\n\t\tHTMLURL: Ptr(\"https://github.com/o/r/security/code-scanning/88\"),\n\t}\n\tid = a.ID()\n\twant = 88\n\tif !cmp.Equal(id, want) {\n\t\tt.Errorf(\"Alert.ID error returned %+v, want %+v\", id, want)\n\t}\n\n\t// Test: HTMLURL is nil\n\ta = &Alert{}\n\tid = a.ID()\n\twant = 0\n\tif !cmp.Equal(id, want) {\n\t\tt.Errorf(\"Alert.ID error returned %+v, want %+v\", id, want)\n\t}\n\n\t// Test: ID can't be parsed as an int\n\ta = &Alert{\n\t\tHTMLURL: Ptr(\"https://github.com/o/r/security/code-scanning/bad88\"),\n\t}\n\tid = a.ID()\n\twant = 0\n\tif !cmp.Equal(id, want) {\n\t\tt.Errorf(\"Alert.ID error returned %+v, want %+v\", id, want)\n\t}\n}\n\nfunc TestCodeScanningService_UploadSarif(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\texpectedSarifID := &SarifID{\n\t\tID:  Ptr(\"testid\"),\n\t\tURL: Ptr(\"https://example.com/testurl\"),\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/code-scanning/sarifs\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *SarifAnalysis\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\t\ttestMethod(t, r, \"POST\")\n\t\twant := &SarifAnalysis{CommitSHA: Ptr(\"abc\"), Ref: Ptr(\"ref/head/main\"), Sarif: Ptr(\"abc\"), CheckoutURI: Ptr(\"uri\"), StartedAt: &Timestamp{time.Date(2006, time.January, 2, 15, 4, 5, 0, time.UTC)}, ToolName: Ptr(\"codeql-cli\")}\n\t\tif !cmp.Equal(v, want) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, want)\n\t\t}\n\n\t\tw.WriteHeader(http.StatusAccepted)\n\t\trespBody, _ := json.Marshal(expectedSarifID)\n\t\t_, _ = w.Write(respBody)\n\t})\n\n\tctx := t.Context()\n\tsarifAnalysis := &SarifAnalysis{CommitSHA: Ptr(\"abc\"), Ref: Ptr(\"ref/head/main\"), Sarif: Ptr(\"abc\"), CheckoutURI: Ptr(\"uri\"), StartedAt: &Timestamp{time.Date(2006, time.January, 2, 15, 4, 5, 0, time.UTC)}, ToolName: Ptr(\"codeql-cli\")}\n\trespSarifID, _, err := client.CodeScanning.UploadSarif(ctx, \"o\", \"r\", sarifAnalysis)\n\tif err != nil {\n\t\tt.Errorf(\"CodeScanning.UploadSarif returned error: %v\", err)\n\t}\n\tif !cmp.Equal(expectedSarifID, respSarifID) {\n\t\tt.Errorf(\"Sarif response = %+v, want %+v\", respSarifID, expectedSarifID)\n\t}\n\n\tconst methodName = \"UploadSarif\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.CodeScanning.UploadSarif(ctx, \"\\n\", \"\\n\", sarifAnalysis)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailureCategory(t, methodName, client, CodeScanningUploadCategory, func() (*Response, error) {\n\t\t_, resp, err := client.CodeScanning.UploadSarif(ctx, \"o\", \"r\", sarifAnalysis)\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodeScanningService_GetSARIF(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/code-scanning/sarifs/abc\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"processing_status\": \"s\",\n\t\t\t\"analyses_url\": \"u\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tsarifUpload, _, err := client.CodeScanning.GetSARIF(ctx, \"o\", \"r\", \"abc\")\n\tif err != nil {\n\t\tt.Errorf(\"CodeScanning.GetSARIF returned error: %v\", err)\n\t}\n\n\twant := &SARIFUpload{\n\t\tProcessingStatus: Ptr(\"s\"),\n\t\tAnalysesURL:      Ptr(\"u\"),\n\t}\n\tif !cmp.Equal(sarifUpload, want) {\n\t\tt.Errorf(\"CodeScanning.GetSARIF returned %+v, want %+v\", sarifUpload, want)\n\t}\n\n\tconst methodName = \"GetSARIF\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.CodeScanning.GetSARIF(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.CodeScanning.GetSARIF(ctx, \"o\", \"r\", \"abc\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodeScanningService_ListAlertsForOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/code-scanning/alerts\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"state\": \"open\", \"ref\": \"heads/master\", \"severity\": \"warning\", \"tool_name\": \"CodeQL\", \"tool_guid\": \"guid\", \"direction\": \"asc\", \"sort\": \"updated\"})\n\t\tfmt.Fprint(w, `[{\n\t\t\t\t\"repository\": {\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\"url\": \"url\"\n\t\t\t\t},\n\t\t\t\t\"rule_id\":\"js/trivial-conditional\",\n\t\t\t\t\"rule_severity\":\"warning\",\n\t\t\t\t\"rule_description\":\"Useless conditional\",\n\t\t\t\t\"tool\": {\n\t\t\t\t\t\"name\": \"CodeQL\",\n\t\t\t\t\t\"guid\": \"guid\",\n\t\t\t\t\t\"version\": \"1.4.0\"\n\t\t\t\t},\n\t\t\t\t\"rule\": {\n\t\t\t\t\t\"id\": \"js/trivial-conditional\",\n\t\t\t\t\t\"severity\": \"warning\",\n\t\t\t\t\t\"description\": \"Useless conditional\",\n\t\t\t\t\t\"name\": \"js/trivial-conditional\",\n\t\t\t\t\t\"full_description\": \"Expression has no effect\",\n\t\t\t\t\t\"help\": \"Expression has no effect\"\n\t\t\t\t},\n\t\t\t\t\"most_recent_instance\": {\n\t\t\t\t\t\"ref\": \"refs/heads/main\",\n\t\t\t\t\t\"state\": \"open\",\n\t\t\t\t\t\"commit_sha\": \"abcdefg12345\",\n\t\t\t\t\t\"message\": {\n\t\t\t\t\t\t\"text\": \"This path depends on a user-provided value.\"\n\t\t\t\t\t},\n\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\"path\": \"spec-main/api-session-spec.ts\",\n\t\t\t\t\t\t\"start_line\": 917,\n\t\t\t\t\t\t\"end_line\": 917,\n\t\t\t\t\t\t\"start_column\": 7,\n\t\t\t\t\t\t\"end_column\": 18\n\t\t\t\t\t},\n\t\t\t\t\t\"classifications\": [\n\t\t\t\t\t\t\"test\"\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"created_at\":\"2020-05-06T12:00:00Z\",\n\t\t\t\t\"state\":\"open\",\n\t\t\t\t\"closed_by\":null,\n\t\t\t\t\"closed_at\":null,\n\t\t\t\t\"url\":\"https://api.github.com/repos/o/r/code-scanning/alerts/25\",\n\t\t\t\t\"html_url\":\"https://github.com/o/r/security/code-scanning/25\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\"rule_id\":\"js/useless-expression\",\n\t\t\t\t\"rule_severity\":\"warning\",\n\t\t\t\t\"rule_description\":\"Expression has no effect\",\n\t\t\t\t\"tool\": {\n\t\t\t\t\t\"name\": \"CodeQL\",\n\t\t\t\t\t\"guid\": null,\n\t\t\t\t\t\"version\": \"1.4.0\"\n\t\t\t\t},\n\t\t\t\t\"rule\": {\n\t\t\t\t\t\"id\": \"js/useless-expression\",\n\t\t\t\t\t\"severity\": \"warning\",\n\t\t\t\t\t\"description\": \"Expression has no effect\",\n\t\t\t\t\t\"name\": \"js/useless-expression\",\n\t\t\t\t\t\"full_description\": \"Expression has no effect\",\n\t\t\t\t\t\"help\": \"Expression has no effect\"\n\t\t\t\t},\n\t\t\t\t\"most_recent_instance\": {\n\t\t\t\t\t\"ref\": \"refs/heads/main\",\n\t\t\t\t\t\"state\": \"open\",\n\t\t\t\t\t\"commit_sha\": \"abcdefg12345\",\n\t\t\t\t\t\"message\": {\n\t\t\t\t\t\t\"text\": \"This path depends on a user-provided value.\"\n\t\t\t\t\t},\n\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\"path\": \"spec-main/api-session-spec.ts\",\n\t\t\t\t\t\t\"start_line\": 917,\n\t\t\t\t\t\t\"end_line\": 917,\n\t\t\t\t\t\t\"start_column\": 7,\n\t\t\t\t\t\t\"end_column\": 18\n\t\t\t\t\t},\n\t\t\t\t\t\"classifications\": [\n\t\t\t\t\t\t\"test\"\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"created_at\":\"2020-05-06T12:00:00Z\",\n\t\t\t\t\"state\":\"open\",\n\t\t\t\t\"closed_by\":null,\n\t\t\t\t\"closed_at\":null,\n\t\t\t\t\"url\":\"https://api.github.com/repos/o/r/code-scanning/alerts/88\",\n\t\t\t\t\"html_url\":\"https://github.com/o/r/security/code-scanning/88\"\n\t\t\t\t}]`)\n\t})\n\n\topts := &AlertListOptions{State: \"open\", Ref: \"heads/master\", Severity: \"warning\", ToolName: \"CodeQL\", ToolGUID: \"guid\", Direction: \"asc\", Sort: \"updated\"}\n\tctx := t.Context()\n\talerts, _, err := client.CodeScanning.ListAlertsForOrg(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"CodeScanning.ListAlertsForOrg returned error: %v\", err)\n\t}\n\n\tdate := Timestamp{time.Date(2020, time.May, 6, 12, 0, 0, 0, time.UTC)}\n\twant := []*Alert{\n\t\t{\n\t\t\tRepository: &Repository{\n\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\tURL:  Ptr(\"url\"),\n\t\t\t\tName: Ptr(\"n\"),\n\t\t\t},\n\t\t\tRuleID:          Ptr(\"js/trivial-conditional\"),\n\t\t\tRuleSeverity:    Ptr(\"warning\"),\n\t\t\tRuleDescription: Ptr(\"Useless conditional\"),\n\t\t\tTool:            &Tool{Name: Ptr(\"CodeQL\"), GUID: Ptr(\"guid\"), Version: Ptr(\"1.4.0\")},\n\t\t\tRule: &Rule{\n\t\t\t\tID:              Ptr(\"js/trivial-conditional\"),\n\t\t\t\tSeverity:        Ptr(\"warning\"),\n\t\t\t\tDescription:     Ptr(\"Useless conditional\"),\n\t\t\t\tName:            Ptr(\"js/trivial-conditional\"),\n\t\t\t\tFullDescription: Ptr(\"Expression has no effect\"),\n\t\t\t\tHelp:            Ptr(\"Expression has no effect\"),\n\t\t\t},\n\t\t\tCreatedAt: &date,\n\t\t\tState:     Ptr(\"open\"),\n\t\t\tClosedBy:  nil,\n\t\t\tClosedAt:  nil,\n\t\t\tURL:       Ptr(\"https://api.github.com/repos/o/r/code-scanning/alerts/25\"),\n\t\t\tHTMLURL:   Ptr(\"https://github.com/o/r/security/code-scanning/25\"),\n\t\t\tMostRecentInstance: &MostRecentInstance{\n\t\t\t\tRef:       Ptr(\"refs/heads/main\"),\n\t\t\t\tState:     Ptr(\"open\"),\n\t\t\t\tCommitSHA: Ptr(\"abcdefg12345\"),\n\t\t\t\tMessage: &Message{\n\t\t\t\t\tText: Ptr(\"This path depends on a user-provided value.\"),\n\t\t\t\t},\n\t\t\t\tLocation: &Location{\n\t\t\t\t\tPath:        Ptr(\"spec-main/api-session-spec.ts\"),\n\t\t\t\t\tStartLine:   Ptr(917),\n\t\t\t\t\tEndLine:     Ptr(917),\n\t\t\t\t\tStartColumn: Ptr(7),\n\t\t\t\t\tEndColumn:   Ptr(18),\n\t\t\t\t},\n\t\t\t\tClassifications: []string{\"test\"},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tRuleID:          Ptr(\"js/useless-expression\"),\n\t\t\tRuleSeverity:    Ptr(\"warning\"),\n\t\t\tRuleDescription: Ptr(\"Expression has no effect\"),\n\t\t\tTool:            &Tool{Name: Ptr(\"CodeQL\"), GUID: nil, Version: Ptr(\"1.4.0\")},\n\t\t\tRule: &Rule{\n\t\t\t\tID:              Ptr(\"js/useless-expression\"),\n\t\t\t\tSeverity:        Ptr(\"warning\"),\n\t\t\t\tDescription:     Ptr(\"Expression has no effect\"),\n\t\t\t\tName:            Ptr(\"js/useless-expression\"),\n\t\t\t\tFullDescription: Ptr(\"Expression has no effect\"),\n\t\t\t\tHelp:            Ptr(\"Expression has no effect\"),\n\t\t\t},\n\t\t\tCreatedAt: &date,\n\t\t\tState:     Ptr(\"open\"),\n\t\t\tClosedBy:  nil,\n\t\t\tClosedAt:  nil,\n\t\t\tURL:       Ptr(\"https://api.github.com/repos/o/r/code-scanning/alerts/88\"),\n\t\t\tHTMLURL:   Ptr(\"https://github.com/o/r/security/code-scanning/88\"),\n\t\t\tMostRecentInstance: &MostRecentInstance{\n\t\t\t\tRef:       Ptr(\"refs/heads/main\"),\n\t\t\t\tState:     Ptr(\"open\"),\n\t\t\t\tCommitSHA: Ptr(\"abcdefg12345\"),\n\t\t\t\tMessage: &Message{\n\t\t\t\t\tText: Ptr(\"This path depends on a user-provided value.\"),\n\t\t\t\t},\n\t\t\t\tLocation: &Location{\n\t\t\t\t\tPath:        Ptr(\"spec-main/api-session-spec.ts\"),\n\t\t\t\t\tStartLine:   Ptr(917),\n\t\t\t\t\tEndLine:     Ptr(917),\n\t\t\t\t\tStartColumn: Ptr(7),\n\t\t\t\t\tEndColumn:   Ptr(18),\n\t\t\t\t},\n\t\t\t\tClassifications: []string{\"test\"},\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(alerts, want) {\n\t\tt.Errorf(\"CodeScanning.ListAlertsForOrg returned %+v, want %+v\", alerts, want)\n\t}\n\n\tconst methodName = \"ListAlertsForOrg\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.CodeScanning.ListAlertsForOrg(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.CodeScanning.ListAlertsForOrg(ctx, \"o\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodeScanningService_ListAlertsForOrgLisCursorOptions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/code-scanning/alerts\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"state\": \"open\", \"ref\": \"heads/master\", \"severity\": \"warning\", \"tool_name\": \"CodeQL\", \"per_page\": \"1\", \"before\": \"deadbeefb\", \"after\": \"deadbeefa\"})\n\t\tfmt.Fprint(w, `[{\n\t\t\t\t\"repository\": {\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\"url\": \"url\"\n\t\t\t\t},\n\t\t\t\t\"rule_id\":\"js/trivial-conditional\",\n\t\t\t\t\"rule_severity\":\"warning\",\n\t\t\t\t\"rule_description\":\"Useless conditional\",\n\t\t\t\t\"tool\": {\n\t\t\t\t\t\"name\": \"CodeQL\",\n\t\t\t\t\t\"guid\": null,\n\t\t\t\t\t\"version\": \"1.4.0\"\n\t\t\t\t},\n\t\t\t\t\"rule\": {\n\t\t\t\t\t\"id\": \"js/trivial-conditional\",\n\t\t\t\t\t\"severity\": \"warning\",\n\t\t\t\t\t\"description\": \"Useless conditional\",\n\t\t\t\t\t\"name\": \"js/trivial-conditional\",\n\t\t\t\t\t\"full_description\": \"Expression has no effect\",\n\t\t\t\t\t\"help\": \"Expression has no effect\"\n\t\t\t\t},\n\t\t\t\t\"most_recent_instance\": {\n\t\t\t\t\t\"ref\": \"refs/heads/main\",\n\t\t\t\t\t\"state\": \"open\",\n\t\t\t\t\t\"commit_sha\": \"abcdefg12345\",\n\t\t\t\t\t\"message\": {\n\t\t\t\t\t\t\"text\": \"This path depends on a user-provided value.\"\n\t\t\t\t\t},\n\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\"path\": \"spec-main/api-session-spec.ts\",\n\t\t\t\t\t\t\"start_line\": 917,\n\t\t\t\t\t\t\"end_line\": 917,\n\t\t\t\t\t\t\"start_column\": 7,\n\t\t\t\t\t\t\"end_column\": 18\n\t\t\t\t\t},\n\t\t\t\t\t\"classifications\": [\n\t\t\t\t\t\t\"test\"\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"created_at\":\"2020-05-06T12:00:00Z\",\n\t\t\t\t\"state\":\"open\",\n\t\t\t\t\"closed_by\":null,\n\t\t\t\t\"closed_at\":null,\n\t\t\t\t\"url\":\"https://api.github.com/repos/o/r/code-scanning/alerts/25\",\n\t\t\t\t\"html_url\":\"https://github.com/o/r/security/code-scanning/25\"\n\t\t\t\t}]`)\n\t})\n\n\topts := &AlertListOptions{State: \"open\", Ref: \"heads/master\", Severity: \"warning\", ToolName: \"CodeQL\", ListCursorOptions: ListCursorOptions{PerPage: 1, Before: \"deadbeefb\", After: \"deadbeefa\"}}\n\tctx := t.Context()\n\talerts, _, err := client.CodeScanning.ListAlertsForOrg(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"CodeScanning.ListAlertsForOrg returned error: %v\", err)\n\t}\n\n\tdate := Timestamp{time.Date(2020, time.May, 6, 12, 0, 0, 0, time.UTC)}\n\twant := []*Alert{\n\t\t{\n\t\t\tRepository: &Repository{\n\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\tURL:  Ptr(\"url\"),\n\t\t\t\tName: Ptr(\"n\"),\n\t\t\t},\n\t\t\tRuleID:          Ptr(\"js/trivial-conditional\"),\n\t\t\tRuleSeverity:    Ptr(\"warning\"),\n\t\t\tRuleDescription: Ptr(\"Useless conditional\"),\n\t\t\tTool:            &Tool{Name: Ptr(\"CodeQL\"), GUID: nil, Version: Ptr(\"1.4.0\")},\n\t\t\tRule: &Rule{\n\t\t\t\tID:              Ptr(\"js/trivial-conditional\"),\n\t\t\t\tSeverity:        Ptr(\"warning\"),\n\t\t\t\tDescription:     Ptr(\"Useless conditional\"),\n\t\t\t\tName:            Ptr(\"js/trivial-conditional\"),\n\t\t\t\tFullDescription: Ptr(\"Expression has no effect\"),\n\t\t\t\tHelp:            Ptr(\"Expression has no effect\"),\n\t\t\t},\n\t\t\tCreatedAt: &date,\n\t\t\tState:     Ptr(\"open\"),\n\t\t\tClosedBy:  nil,\n\t\t\tClosedAt:  nil,\n\t\t\tURL:       Ptr(\"https://api.github.com/repos/o/r/code-scanning/alerts/25\"),\n\t\t\tHTMLURL:   Ptr(\"https://github.com/o/r/security/code-scanning/25\"),\n\t\t\tMostRecentInstance: &MostRecentInstance{\n\t\t\t\tRef:       Ptr(\"refs/heads/main\"),\n\t\t\t\tState:     Ptr(\"open\"),\n\t\t\t\tCommitSHA: Ptr(\"abcdefg12345\"),\n\t\t\t\tMessage: &Message{\n\t\t\t\t\tText: Ptr(\"This path depends on a user-provided value.\"),\n\t\t\t\t},\n\t\t\t\tLocation: &Location{\n\t\t\t\t\tPath:        Ptr(\"spec-main/api-session-spec.ts\"),\n\t\t\t\t\tStartLine:   Ptr(917),\n\t\t\t\t\tEndLine:     Ptr(917),\n\t\t\t\t\tStartColumn: Ptr(7),\n\t\t\t\t\tEndColumn:   Ptr(18),\n\t\t\t\t},\n\t\t\t\tClassifications: []string{\"test\"},\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(alerts, want) {\n\t\tt.Errorf(\"CodeScanning.ListAlertsForOrg returned %+v, want %+v\", alerts, want)\n\t}\n\n\tconst methodName = \"ListAlertsForOrg\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.CodeScanning.ListAlertsForOrg(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.CodeScanning.ListAlertsForOrg(ctx, \"o\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodeScanningService_ListAlertsForRepo(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/code-scanning/alerts\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"state\": \"open\", \"ref\": \"heads/master\", \"severity\": \"warning\", \"tool_name\": \"CodeQL\", \"tool_guid\": \"guid\", \"direction\": \"asc\", \"sort\": \"updated\"})\n\t\tfmt.Fprint(w, `[{\n\t\t\t\t\"rule_id\":\"js/trivial-conditional\",\n\t\t\t\t\"rule_severity\":\"warning\",\n\t\t\t\t\"rule_description\":\"Useless conditional\",\n\t\t\t\t\"tool\": {\n\t\t\t\t\t\"name\": \"CodeQL\",\n\t\t\t\t\t\"guid\": \"guid\",\n\t\t\t\t\t\"version\": \"1.4.0\"\n\t\t\t\t},\n\t\t\t\t\"rule\": {\n\t\t\t\t\t\"id\": \"js/trivial-conditional\",\n\t\t\t\t\t\"severity\": \"warning\",\n\t\t\t\t\t\"description\": \"Useless conditional\",\n\t\t\t\t\t\"name\": \"js/trivial-conditional\",\n\t\t\t\t\t\"full_description\": \"Expression has no effect\",\n\t\t\t\t\t\"help\": \"Expression has no effect\"\n\t\t\t\t},\n\t\t\t\t\"most_recent_instance\": {\n\t\t\t\t\t\"ref\": \"refs/heads/main\",\n\t\t\t\t\t\"state\": \"open\",\n\t\t\t\t\t\"commit_sha\": \"abcdefg12345\",\n\t\t\t\t\t\"message\": {\n\t\t\t\t\t\t\"text\": \"This path depends on a user-provided value.\"\n\t\t\t\t\t},\n\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\"path\": \"spec-main/api-session-spec.ts\",\n\t\t\t\t\t\t\"start_line\": 917,\n\t\t\t\t\t\t\"end_line\": 917,\n\t\t\t\t\t\t\"start_column\": 7,\n\t\t\t\t\t\t\"end_column\": 18\n\t\t\t\t\t},\n\t\t\t\t\t\"classifications\": [\n\t\t\t\t\t\t\"test\"\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"created_at\":\"2020-05-06T12:00:00Z\",\n\t\t\t\t\"state\":\"open\",\n\t\t\t\t\"closed_by\":null,\n\t\t\t\t\"closed_at\":null,\n\t\t\t\t\"url\":\"https://api.github.com/repos/o/r/code-scanning/alerts/25\",\n\t\t\t\t\"html_url\":\"https://github.com/o/r/security/code-scanning/25\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\"rule_id\":\"js/useless-expression\",\n\t\t\t\t\"rule_severity\":\"warning\",\n\t\t\t\t\"rule_description\":\"Expression has no effect\",\n\t\t\t\t\"tool\": {\n\t\t\t\t\t\"name\": \"CodeQL\",\n\t\t\t\t\t\"guid\": \"guid\",\n\t\t\t\t\t\"version\": \"1.4.0\"\n\t\t\t\t},\n\t\t\t\t\"rule\": {\n\t\t\t\t\t\"id\": \"js/useless-expression\",\n\t\t\t\t\t\"severity\": \"warning\",\n\t\t\t\t\t\"description\": \"Expression has no effect\",\n\t\t\t\t\t\"name\": \"js/useless-expression\",\n\t\t\t\t\t\"full_description\": \"Expression has no effect\",\n\t\t\t\t\t\"help\": \"Expression has no effect\"\n\t\t\t\t},\n\t\t\t\t\"most_recent_instance\": {\n\t\t\t\t\t\"ref\": \"refs/heads/main\",\n\t\t\t\t\t\"state\": \"open\",\n\t\t\t\t\t\"commit_sha\": \"abcdefg12345\",\n\t\t\t\t\t\"message\": {\n\t\t\t\t\t\t\"text\": \"This path depends on a user-provided value.\"\n\t\t\t\t\t},\n\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\"path\": \"spec-main/api-session-spec.ts\",\n\t\t\t\t\t\t\"start_line\": 917,\n\t\t\t\t\t\t\"end_line\": 917,\n\t\t\t\t\t\t\"start_column\": 7,\n\t\t\t\t\t\t\"end_column\": 18\n\t\t\t\t\t},\n\t\t\t\t\t\"classifications\": [\n\t\t\t\t\t\t\"test\"\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"created_at\":\"2020-05-06T12:00:00Z\",\n\t\t\t\t\"state\":\"open\",\n\t\t\t\t\"closed_by\":null,\n\t\t\t\t\"closed_at\":null,\n\t\t\t\t\"url\":\"https://api.github.com/repos/o/r/code-scanning/alerts/88\",\n\t\t\t\t\"html_url\":\"https://github.com/o/r/security/code-scanning/88\"\n\t\t\t\t}]`)\n\t})\n\n\topts := &AlertListOptions{State: \"open\", Ref: \"heads/master\", Severity: \"warning\", ToolName: \"CodeQL\", ToolGUID: \"guid\", Direction: \"asc\", Sort: \"updated\"}\n\tctx := t.Context()\n\talerts, _, err := client.CodeScanning.ListAlertsForRepo(ctx, \"o\", \"r\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"CodeScanning.ListAlertsForRepo returned error: %v\", err)\n\t}\n\n\tdate := Timestamp{time.Date(2020, time.May, 6, 12, 0, 0, 0, time.UTC)}\n\twant := []*Alert{\n\t\t{\n\t\t\tRuleID:          Ptr(\"js/trivial-conditional\"),\n\t\t\tRuleSeverity:    Ptr(\"warning\"),\n\t\t\tRuleDescription: Ptr(\"Useless conditional\"),\n\t\t\tTool:            &Tool{Name: Ptr(\"CodeQL\"), GUID: Ptr(\"guid\"), Version: Ptr(\"1.4.0\")},\n\t\t\tRule: &Rule{\n\t\t\t\tID:              Ptr(\"js/trivial-conditional\"),\n\t\t\t\tSeverity:        Ptr(\"warning\"),\n\t\t\t\tDescription:     Ptr(\"Useless conditional\"),\n\t\t\t\tName:            Ptr(\"js/trivial-conditional\"),\n\t\t\t\tFullDescription: Ptr(\"Expression has no effect\"),\n\t\t\t\tHelp:            Ptr(\"Expression has no effect\"),\n\t\t\t},\n\t\t\tCreatedAt: &date,\n\t\t\tState:     Ptr(\"open\"),\n\t\t\tClosedBy:  nil,\n\t\t\tClosedAt:  nil,\n\t\t\tURL:       Ptr(\"https://api.github.com/repos/o/r/code-scanning/alerts/25\"),\n\t\t\tHTMLURL:   Ptr(\"https://github.com/o/r/security/code-scanning/25\"),\n\t\t\tMostRecentInstance: &MostRecentInstance{\n\t\t\t\tRef:       Ptr(\"refs/heads/main\"),\n\t\t\t\tState:     Ptr(\"open\"),\n\t\t\t\tCommitSHA: Ptr(\"abcdefg12345\"),\n\t\t\t\tMessage: &Message{\n\t\t\t\t\tText: Ptr(\"This path depends on a user-provided value.\"),\n\t\t\t\t},\n\t\t\t\tLocation: &Location{\n\t\t\t\t\tPath:        Ptr(\"spec-main/api-session-spec.ts\"),\n\t\t\t\t\tStartLine:   Ptr(917),\n\t\t\t\t\tEndLine:     Ptr(917),\n\t\t\t\t\tStartColumn: Ptr(7),\n\t\t\t\t\tEndColumn:   Ptr(18),\n\t\t\t\t},\n\t\t\t\tClassifications: []string{\"test\"},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tRuleID:          Ptr(\"js/useless-expression\"),\n\t\t\tRuleSeverity:    Ptr(\"warning\"),\n\t\t\tRuleDescription: Ptr(\"Expression has no effect\"),\n\t\t\tTool:            &Tool{Name: Ptr(\"CodeQL\"), GUID: Ptr(\"guid\"), Version: Ptr(\"1.4.0\")},\n\t\t\tRule: &Rule{\n\t\t\t\tID:              Ptr(\"js/useless-expression\"),\n\t\t\t\tSeverity:        Ptr(\"warning\"),\n\t\t\t\tDescription:     Ptr(\"Expression has no effect\"),\n\t\t\t\tName:            Ptr(\"js/useless-expression\"),\n\t\t\t\tFullDescription: Ptr(\"Expression has no effect\"),\n\t\t\t\tHelp:            Ptr(\"Expression has no effect\"),\n\t\t\t},\n\t\t\tCreatedAt: &date,\n\t\t\tState:     Ptr(\"open\"),\n\t\t\tClosedBy:  nil,\n\t\t\tClosedAt:  nil,\n\t\t\tURL:       Ptr(\"https://api.github.com/repos/o/r/code-scanning/alerts/88\"),\n\t\t\tHTMLURL:   Ptr(\"https://github.com/o/r/security/code-scanning/88\"),\n\t\t\tMostRecentInstance: &MostRecentInstance{\n\t\t\t\tRef:       Ptr(\"refs/heads/main\"),\n\t\t\t\tState:     Ptr(\"open\"),\n\t\t\t\tCommitSHA: Ptr(\"abcdefg12345\"),\n\t\t\t\tMessage: &Message{\n\t\t\t\t\tText: Ptr(\"This path depends on a user-provided value.\"),\n\t\t\t\t},\n\t\t\t\tLocation: &Location{\n\t\t\t\t\tPath:        Ptr(\"spec-main/api-session-spec.ts\"),\n\t\t\t\t\tStartLine:   Ptr(917),\n\t\t\t\t\tEndLine:     Ptr(917),\n\t\t\t\t\tStartColumn: Ptr(7),\n\t\t\t\t\tEndColumn:   Ptr(18),\n\t\t\t\t},\n\t\t\t\tClassifications: []string{\"test\"},\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(alerts, want) {\n\t\tt.Errorf(\"CodeScanning.ListAlertsForRepo returned %+v, want %+v\", alerts, want)\n\t}\n\n\tconst methodName = \"ListAlertsForRepo\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.CodeScanning.ListAlertsForRepo(ctx, \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.CodeScanning.ListAlertsForRepo(ctx, \"o\", \"r\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodeScanningService_UpdateAlert(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/code-scanning/alerts/88\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tfmt.Fprint(w, `{\"rule_id\":\"js/useless-expression\",\n\t\t\t\t\"rule_severity\":\"warning\",\n\t\t\t\t\"rule_description\":\"Expression has no effect\",\n\t\t\t\t\"tool\": {\n\t\t\t\t\t\"name\": \"CodeQL\",\n\t\t\t\t\t\"guid\": null,\n\t\t\t\t\t\"version\": \"1.4.0\"\n\t\t\t\t},\n\t\t\t\t\"rule\": {\n\t\t\t\t\t\"id\": \"useless expression\",\n\t\t\t\t\t\"severity\": \"warning\",\n\t\t\t\t\t\"description\": \"Expression has no effect\",\n\t\t\t\t\t\"name\": \"useless expression\",\n\t\t\t\t\t\"full_description\": \"Expression has no effect\",\n\t\t\t\t\t\"help\": \"Expression has no effect\"\n\t\t\t\t},\n\t\t\t\t\"most_recent_instance\": {\n\t\t\t\t\t\"ref\": \"refs/heads/main\",\n\t\t\t\t\t\"state\": \"dismissed\",\n\t\t\t\t\t\"commit_sha\": \"abcdefg12345\",\n\t\t\t\t\t\"message\": {\n\t\t\t\t\t\t\"text\": \"This path depends on a user-provided value.\"\n\t\t\t\t\t},\n\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\"path\": \"spec-main/api-session-spec.ts\",\n\t\t\t\t\t\t\"start_line\": 917,\n\t\t\t\t\t\t\"end_line\": 917,\n\t\t\t\t\t\t\"start_column\": 7,\n\t\t\t\t\t\t\"end_column\": 18\n\t\t\t\t\t},\n\t\t\t\t\t\"classifications\": [\n\t\t\t\t\t\t\"test\"\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"created_at\":\"2019-01-02T15:04:05Z\",\n\t\t\t\t\"state\":\"dismissed\",\n\t\t\t\t\"dismissed_reason\": \"false positive\",\n\t\t\t\t\"dismissed_comment\": \"This alert is not actually correct as sanitizer is used\",\n\t\t\t\t\"closed_by\":null,\n\t\t\t\t\"closed_at\":null,\n\t\t\t\t\"url\":\"https://api.github.com/repos/o/r/code-scanning/alerts/88\",\n\t\t\t\t\"html_url\":\"https://github.com/o/r/security/code-scanning/88\"}`)\n\t})\n\n\tctx := t.Context()\n\tdismissedComment := Ptr(\"This alert is not actually correct as sanitizer is used\")\n\tdismissedReason := Ptr(\"false positive\")\n\tstate := Ptr(\"dismissed\")\n\tstateInfo := &CodeScanningAlertState{State: *state, DismissedReason: dismissedReason, DismissedComment: dismissedComment}\n\talert, _, err := client.CodeScanning.UpdateAlert(ctx, \"o\", \"r\", 88, stateInfo)\n\tif err != nil {\n\t\tt.Errorf(\"CodeScanning.UpdateAlert returned error: %v\", err)\n\t}\n\n\tdate := Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)}\n\twant := &Alert{\n\t\tRuleID:          Ptr(\"js/useless-expression\"),\n\t\tRuleSeverity:    Ptr(\"warning\"),\n\t\tRuleDescription: Ptr(\"Expression has no effect\"),\n\t\tTool:            &Tool{Name: Ptr(\"CodeQL\"), GUID: nil, Version: Ptr(\"1.4.0\")},\n\t\tRule: &Rule{\n\t\t\tID:              Ptr(\"useless expression\"),\n\t\t\tSeverity:        Ptr(\"warning\"),\n\t\t\tDescription:     Ptr(\"Expression has no effect\"),\n\t\t\tName:            Ptr(\"useless expression\"),\n\t\t\tFullDescription: Ptr(\"Expression has no effect\"),\n\t\t\tHelp:            Ptr(\"Expression has no effect\"),\n\t\t},\n\t\tCreatedAt:        &date,\n\t\tState:            state,\n\t\tDismissedReason:  dismissedReason,\n\t\tDismissedComment: dismissedComment,\n\t\tClosedBy:         nil,\n\t\tClosedAt:         nil,\n\t\tURL:              Ptr(\"https://api.github.com/repos/o/r/code-scanning/alerts/88\"),\n\t\tHTMLURL:          Ptr(\"https://github.com/o/r/security/code-scanning/88\"),\n\t\tMostRecentInstance: &MostRecentInstance{\n\t\t\tRef:       Ptr(\"refs/heads/main\"),\n\t\t\tState:     Ptr(\"dismissed\"),\n\t\t\tCommitSHA: Ptr(\"abcdefg12345\"),\n\t\t\tMessage: &Message{\n\t\t\t\tText: Ptr(\"This path depends on a user-provided value.\"),\n\t\t\t},\n\t\t\tLocation: &Location{\n\t\t\t\tPath:        Ptr(\"spec-main/api-session-spec.ts\"),\n\t\t\t\tStartLine:   Ptr(917),\n\t\t\t\tEndLine:     Ptr(917),\n\t\t\t\tStartColumn: Ptr(7),\n\t\t\t\tEndColumn:   Ptr(18),\n\t\t\t},\n\t\t\tClassifications: []string{\"test\"},\n\t\t},\n\t}\n\tif !cmp.Equal(alert, want) {\n\t\tt.Errorf(\"CodeScanning.UpdateAlert returned %+v, want %+v\", alert, want)\n\t}\n\n\tconst methodName = \"UpdateAlert\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.CodeScanning.UpdateAlert(ctx, \"\\n\", \"\\n\", -88, stateInfo)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.CodeScanning.UpdateAlert(ctx, \"o\", \"r\", 88, stateInfo)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodeScanningService_ListAlertInstances(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/code-scanning/alerts/88/instances\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[\n\t\t\t{\n\t\t\t  \"ref\": \"refs/heads/main\",\n\t\t\t  \"analysis_key\": \".github/workflows/codeql-analysis.yml:analyze\",\n\t\t\t  \"environment\": \"\",\n\t\t\t  \"category\": \".github/workflows/codeql-analysis.yml:analyze\",\n\t\t\t  \"state\": \"open\",\n\t\t\t  \"fixed_at\": null,\n\t\t\t  \"commit_sha\": \"abcdefg12345\",\n\t\t\t  \"message\": {\n\t\t\t\t\"text\": \"This path depends on a user-provided value.\"\n\t\t\t  },\n\t\t\t  \"location\": {\n\t\t\t\t\"path\": \"spec-main/api-session-spec.ts\",\n\t\t\t\t\"start_line\": 917,\n\t\t\t\t\"end_line\": 917,\n\t\t\t\t\"start_column\": 7,\n\t\t\t\t\"end_column\": 18\n\t\t\t  },\n\t\t\t  \"classifications\": [\n\t\t\t\t\"test\"\n\t\t\t  ]\n\t\t\t}\n\t\t  ]`)\n\t})\n\n\topts := &AlertInstancesListOptions{Ref: \"heads/main\", ListOptions: ListOptions{Page: 1}}\n\tctx := t.Context()\n\tinstances, _, err := client.CodeScanning.ListAlertInstances(ctx, \"o\", \"r\", 88, opts)\n\tif err != nil {\n\t\tt.Errorf(\"CodeScanning.ListAlertInstances returned error: %v\", err)\n\t}\n\n\twant := []*MostRecentInstance{\n\t\t{\n\t\t\tRef:         Ptr(\"refs/heads/main\"),\n\t\t\tAnalysisKey: Ptr(\".github/workflows/codeql-analysis.yml:analyze\"),\n\t\t\tCategory:    Ptr(\".github/workflows/codeql-analysis.yml:analyze\"),\n\t\t\tEnvironment: Ptr(\"\"),\n\t\t\tState:       Ptr(\"open\"),\n\t\t\tCommitSHA:   Ptr(\"abcdefg12345\"),\n\t\t\tMessage: &Message{\n\t\t\t\tText: Ptr(\"This path depends on a user-provided value.\"),\n\t\t\t},\n\t\t\tLocation: &Location{\n\t\t\t\tPath:        Ptr(\"spec-main/api-session-spec.ts\"),\n\t\t\t\tStartLine:   Ptr(917),\n\t\t\t\tEndLine:     Ptr(917),\n\t\t\t\tStartColumn: Ptr(7),\n\t\t\t\tEndColumn:   Ptr(18),\n\t\t\t},\n\t\t\tClassifications: []string{\"test\"},\n\t\t},\n\t}\n\tif !cmp.Equal(instances, want) {\n\t\tt.Errorf(\"CodeScanning.ListAlertInstances returned %+v, want %+v\", instances, want)\n\t}\n\n\tconst methodName = \"ListAlertInstances\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.CodeScanning.ListAlertInstances(ctx, \"\\n\", \"\\n\", -1, opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.CodeScanning.ListAlertInstances(ctx, \"o\", \"r\", 88, opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodeScanningService_GetAlert(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/code-scanning/alerts/88\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"rule_id\":\"js/useless-expression\",\n\t\t\t\"rule_severity\":\"warning\",\n\t\t\t\"rule_description\":\"Expression has no effect\",\n\t\t\t\"tool\": {\n\t\t\t\t\"name\": \"CodeQL\",\n\t\t\t\t\"guid\": null,\n\t\t\t\t\"version\": \"1.4.0\"\n\t\t\t},\n\t\t\t\"rule\": {\n\t\t\t\t\"id\": \"useless expression\",\n\t\t\t\t\"severity\": \"warning\",\n\t\t\t\t\"description\": \"Expression has no effect\",\n\t\t\t\t\"name\": \"useless expression\",\n\t\t\t\t\"full_description\": \"Expression has no effect\",\n\t\t\t\t\"help\": \"Expression has no effect\"\n\t\t\t},\n\t\t\t\"most_recent_instance\": {\n\t\t\t\t\"ref\": \"refs/heads/main\",\n\t\t\t\t\"state\": \"open\",\n\t\t\t\t\"commit_sha\": \"abcdefg12345\",\n\t\t\t\t\"message\": {\n\t\t\t\t\t\"text\": \"This path depends on a user-provided value.\"\n\t\t\t\t},\n\t\t\t\t\"location\": {\n\t\t\t\t\t\"path\": \"spec-main/api-session-spec.ts\",\n\t\t\t\t\t\"start_line\": 917,\n\t\t\t\t\t\"end_line\": 917,\n\t\t\t\t\t\"start_column\": 7,\n\t\t\t\t\t\"end_column\": 18\n\t\t\t\t},\n\t\t\t\t\"classifications\": [\n\t\t\t\t\t\"test\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"created_at\":\"2019-01-02T15:04:05Z\",\n\t\t\t\"state\":\"open\",\n\t\t\t\"closed_by\":null,\n\t\t\t\"closed_at\":null,\n\t\t\t\"url\":\"https://api.github.com/repos/o/r/code-scanning/alerts/88\",\n\t\t\t\"html_url\":\"https://github.com/o/r/security/code-scanning/88\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\talert, _, err := client.CodeScanning.GetAlert(ctx, \"o\", \"r\", 88)\n\tif err != nil {\n\t\tt.Errorf(\"CodeScanning.GetAlert returned error: %v\", err)\n\t}\n\n\tdate := Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)}\n\twant := &Alert{\n\t\tRuleID:          Ptr(\"js/useless-expression\"),\n\t\tRuleSeverity:    Ptr(\"warning\"),\n\t\tRuleDescription: Ptr(\"Expression has no effect\"),\n\t\tTool:            &Tool{Name: Ptr(\"CodeQL\"), GUID: nil, Version: Ptr(\"1.4.0\")},\n\t\tRule: &Rule{\n\t\t\tID:              Ptr(\"useless expression\"),\n\t\t\tSeverity:        Ptr(\"warning\"),\n\t\t\tDescription:     Ptr(\"Expression has no effect\"),\n\t\t\tName:            Ptr(\"useless expression\"),\n\t\t\tFullDescription: Ptr(\"Expression has no effect\"),\n\t\t\tHelp:            Ptr(\"Expression has no effect\"),\n\t\t},\n\t\tCreatedAt: &date,\n\t\tState:     Ptr(\"open\"),\n\t\tClosedBy:  nil,\n\t\tClosedAt:  nil,\n\t\tURL:       Ptr(\"https://api.github.com/repos/o/r/code-scanning/alerts/88\"),\n\t\tHTMLURL:   Ptr(\"https://github.com/o/r/security/code-scanning/88\"),\n\t\tMostRecentInstance: &MostRecentInstance{\n\t\t\tRef:       Ptr(\"refs/heads/main\"),\n\t\t\tState:     Ptr(\"open\"),\n\t\t\tCommitSHA: Ptr(\"abcdefg12345\"),\n\t\t\tMessage: &Message{\n\t\t\t\tText: Ptr(\"This path depends on a user-provided value.\"),\n\t\t\t},\n\t\t\tLocation: &Location{\n\t\t\t\tPath:        Ptr(\"spec-main/api-session-spec.ts\"),\n\t\t\t\tStartLine:   Ptr(917),\n\t\t\t\tEndLine:     Ptr(917),\n\t\t\t\tStartColumn: Ptr(7),\n\t\t\t\tEndColumn:   Ptr(18),\n\t\t\t},\n\t\t\tClassifications: []string{\"test\"},\n\t\t},\n\t}\n\tif !cmp.Equal(alert, want) {\n\t\tt.Errorf(\"CodeScanning.GetAlert returned %+v, want %+v\", alert, want)\n\t}\n\n\tconst methodName = \"GetAlert\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.CodeScanning.GetAlert(ctx, \"\\n\", \"\\n\", -88)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.CodeScanning.GetAlert(ctx, \"o\", \"r\", 88)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestAlert_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Alert{}, \"{}\")\n\n\tu := &Alert{\n\t\tRuleID:          Ptr(\"rid\"),\n\t\tRuleSeverity:    Ptr(\"rs\"),\n\t\tRuleDescription: Ptr(\"rd\"),\n\t\tTool: &Tool{\n\t\t\tName:    Ptr(\"n\"),\n\t\t\tGUID:    Ptr(\"g\"),\n\t\t\tVersion: Ptr(\"v\"),\n\t\t},\n\t\tCreatedAt: &Timestamp{referenceTime},\n\t\tState:     Ptr(\"fixed\"),\n\t\tClosedBy: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tClosedAt: &Timestamp{referenceTime},\n\t\tURL:      Ptr(\"url\"),\n\t\tHTMLURL:  Ptr(\"hurl\"),\n\t}\n\n\twant := `{\n\t\t\"rule_id\": \"rid\",\n\t\t\"rule_severity\": \"rs\",\n\t\t\"rule_description\": \"rd\",\n\t\t\"tool\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"guid\": \"g\",\n\t\t\t\"version\": \"v\"\n\t\t},\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"state\": \"fixed\",\n\t\t\"closed_by\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"closed_at\": ` + referenceTimeStr + `,\n\t\t\"url\": \"url\",\n\t\t\"html_url\": \"hurl\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestLocation_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Location{}, \"{}\")\n\n\tu := &Location{\n\t\tPath:        Ptr(\"path\"),\n\t\tStartLine:   Ptr(1),\n\t\tEndLine:     Ptr(2),\n\t\tStartColumn: Ptr(3),\n\t\tEndColumn:   Ptr(4),\n\t}\n\n\twant := `{\n\t\t\"path\": \"path\",\n\t\t\"start_line\": 1,\n\t\t\"end_line\": 2,\n\t\t\"start_column\": 3,\n\t\t\"end_column\": 4\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestRule_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Rule{}, \"{}\")\n\n\tu := &Rule{\n\t\tID:                    Ptr(\"1\"),\n\t\tSeverity:              Ptr(\"3\"),\n\t\tDescription:           Ptr(\"description\"),\n\t\tName:                  Ptr(\"first\"),\n\t\tSecuritySeverityLevel: Ptr(\"2\"),\n\t\tFullDescription:       Ptr(\"summary\"),\n\t\tTags:                  []string{\"tag1\", \"tag2\"},\n\t\tHelp:                  Ptr(\"Help Text\"),\n\t}\n\n\twant := `{\n\t\t\"id\":                      \"1\",\n\t\t\"severity\":                \"3\",\n\t\t\"description\":             \"description\",\n\t\t\"name\":                    \"first\",\n\t\t\"security_severity_level\": \"2\",\n\t\t\"full_description\":        \"summary\",\n\t\t\"tags\":                    [\"tag1\", \"tag2\"],\n\t\t\"help\":                    \"Help Text\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestTool_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Tool{}, \"{}\")\n\n\tu := &Tool{\n\t\tName:    Ptr(\"name\"),\n\t\tGUID:    Ptr(\"guid\"),\n\t\tVersion: Ptr(\"ver\"),\n\t}\n\n\twant := `{\n\t\t\"name\": \"name\",\n\t\t\"guid\": \"guid\",\n\t\t\"version\": \"ver\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestMessage_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Message{}, \"{}\")\n\n\tu := &Message{\n\t\tText: Ptr(\"text\"),\n\t}\n\n\twant := `{\n\t\t\"text\": \"text\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestCodeScanningService_ListAnalysesForRepo(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/code-scanning/analyses\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"sarif_id\": \"8981cd8e-b078-4ac3-a3be-1dad7dbd0b582\", \"ref\": \"heads/master\"})\n\t\tfmt.Fprint(w, `[\n\t\t\t  {\n\t\t\t\t\"ref\": \"refs/heads/main\",\n\t\t\t\t\"commit_sha\": \"d99612c3e1f2970085cfbaeadf8f010ef69bad83\",\n\t\t\t\t\"analysis_key\": \".github/workflows/codeql-analysis.yml:analyze\",\n\t\t\t\t\"environment\": \"{\\\"language\\\":\\\"python\\\"}\",\n\t\t\t\t\"error\": \"\",\n\t\t\t\t\"category\": \".github/workflows/codeql-analysis.yml:analyze/language:python\",\n\t\t\t\t\"created_at\": \"2020-08-27T15:05:21Z\",\n\t\t\t\t\"results_count\": 17,\n\t\t\t\t\"rules_count\": 49,\n\t\t\t\t\"id\": 201,\n\t\t\t\t\"url\": \"https://api.github.com/repos/o/r/code-scanning/analyses/201\",\n\t\t\t\t\"sarif_id\": \"8981cd8e-b078-4ac3-a3be-1dad7dbd0b582\",\n\t\t\t\t\"tool\": {\n\t\t\t\t  \"name\": \"CodeQL\",\n\t\t\t\t  \"guid\": null,\n\t\t\t\t  \"version\": \"2.4.0\"\n\t\t\t\t},\n\t\t\t\t\"deletable\": true,\n\t\t\t\t\"warning\": \"\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"ref\": \"refs/heads/my-branch\",\n\t\t\t\t\"commit_sha\": \"c8cff6510d4d084fb1b4aa13b64b97ca12b07321\",\n\t\t\t\t\"analysis_key\": \".github/workflows/shiftleft.yml:build\",\n\t\t\t\t\"environment\": \"{}\",\n\t\t\t\t\"error\": \"\",\n\t\t\t\t\"category\": \".github/workflows/shiftleft.yml:build/\",\n\t\t\t\t\"created_at\": \"2020-08-27T15:05:21Z\",\n\t\t\t\t\"results_count\": 17,\n\t\t\t\t\"rules_count\": 32,\n\t\t\t\t\"id\": 200,\n\t\t\t\t\"url\": \"https://api.github.com/repos/o/r/code-scanning/analyses/200\",\n\t\t\t\t\"sarif_id\": \"8981cd8e-b078-4ac3-a3be-1dad7dbd0b582\",\n\t\t\t\t\"tool\": {\n\t\t\t\t  \"name\": \"Python Security ScanningAnalysis\",\n\t\t\t\t  \"guid\": null,\n\t\t\t\t  \"version\": \"1.2.0\"\n\t\t\t\t},\n\t\t\t\t\"deletable\": true,\n\t\t\t\t\"warning\": \"\"\n\t\t\t  }\n\t\t\t]`)\n\t})\n\n\topts := &AnalysesListOptions{SarifID: Ptr(\"8981cd8e-b078-4ac3-a3be-1dad7dbd0b582\"), Ref: Ptr(\"heads/master\")}\n\tctx := t.Context()\n\tanalyses, _, err := client.CodeScanning.ListAnalysesForRepo(ctx, \"o\", \"r\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"CodeScanning.ListAnalysesForRepo returned error: %v\", err)\n\t}\n\n\tdate := &Timestamp{time.Date(2020, time.August, 27, 15, 5, 21, 0, time.UTC)}\n\twant := []*ScanningAnalysis{\n\t\t{\n\t\t\tID:           Ptr(int64(201)),\n\t\t\tRef:          Ptr(\"refs/heads/main\"),\n\t\t\tCommitSHA:    Ptr(\"d99612c3e1f2970085cfbaeadf8f010ef69bad83\"),\n\t\t\tAnalysisKey:  Ptr(\".github/workflows/codeql-analysis.yml:analyze\"),\n\t\t\tEnvironment:  Ptr(\"{\\\"language\\\":\\\"python\\\"}\"),\n\t\t\tError:        Ptr(\"\"),\n\t\t\tCategory:     Ptr(\".github/workflows/codeql-analysis.yml:analyze/language:python\"),\n\t\t\tCreatedAt:    date,\n\t\t\tResultsCount: Ptr(17),\n\t\t\tRulesCount:   Ptr(49),\n\t\t\tURL:          Ptr(\"https://api.github.com/repos/o/r/code-scanning/analyses/201\"),\n\t\t\tSarifID:      Ptr(\"8981cd8e-b078-4ac3-a3be-1dad7dbd0b582\"),\n\t\t\tTool: &Tool{\n\t\t\t\tName:    Ptr(\"CodeQL\"),\n\t\t\t\tGUID:    nil,\n\t\t\t\tVersion: Ptr(\"2.4.0\"),\n\t\t\t},\n\t\t\tDeletable: Ptr(true),\n\t\t\tWarning:   Ptr(\"\"),\n\t\t},\n\t\t{\n\t\t\tID:           Ptr(int64(200)),\n\t\t\tRef:          Ptr(\"refs/heads/my-branch\"),\n\t\t\tCommitSHA:    Ptr(\"c8cff6510d4d084fb1b4aa13b64b97ca12b07321\"),\n\t\t\tAnalysisKey:  Ptr(\".github/workflows/shiftleft.yml:build\"),\n\t\t\tEnvironment:  Ptr(\"{}\"),\n\t\t\tError:        Ptr(\"\"),\n\t\t\tCategory:     Ptr(\".github/workflows/shiftleft.yml:build/\"),\n\t\t\tCreatedAt:    date,\n\t\t\tResultsCount: Ptr(17),\n\t\t\tRulesCount:   Ptr(32),\n\t\t\tURL:          Ptr(\"https://api.github.com/repos/o/r/code-scanning/analyses/200\"),\n\t\t\tSarifID:      Ptr(\"8981cd8e-b078-4ac3-a3be-1dad7dbd0b582\"),\n\t\t\tTool: &Tool{\n\t\t\t\tName:    Ptr(\"Python Security ScanningAnalysis\"),\n\t\t\t\tGUID:    nil,\n\t\t\t\tVersion: Ptr(\"1.2.0\"),\n\t\t\t},\n\t\t\tDeletable: Ptr(true),\n\t\t\tWarning:   Ptr(\"\"),\n\t\t},\n\t}\n\tif !cmp.Equal(analyses, want) {\n\t\tt.Errorf(\"CodeScanning.ListAnalysesForRepo returned %+v, want %+v\", analyses, want)\n\t}\n\n\tconst methodName = \"ListAnalysesForRepo\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.CodeScanning.ListAnalysesForRepo(ctx, \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.CodeScanning.ListAnalysesForRepo(ctx, \"o\", \"r\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodeScanningService_GetAnalysis(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/code-scanning/analyses/3602840\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t  \"ref\": \"refs/heads/main\",\n\t\t\t  \"commit_sha\": \"c18c69115654ff0166991962832dc2bd7756e655\",\n\t\t\t  \"analysis_key\": \".github/workflows/codeql-analysis.yml:analyze\",\n\t\t\t  \"environment\": \"{\\\"language\\\":\\\"javascript\\\"}\",\n\t\t\t  \"error\": \"\",\n\t\t\t  \"category\": \".github/workflows/codeql-analysis.yml:analyze/language:javascript\",\n\t\t\t  \"created_at\": \"2021-01-13T11:55:49Z\",\n\t\t\t  \"results_count\": 3,\n\t\t\t  \"rules_count\": 67,\n\t\t\t  \"id\": 3602840,\n\t\t\t  \"url\": \"https://api.github.com/repos/o/r/code-scanning/analyses/201\",\n\t\t\t  \"sarif_id\": \"47177e22-5596-11eb-80a1-c1e54ef945c6\",\n\t\t\t  \"tool\": {\n\t\t\t\t\"name\": \"CodeQL\",\n\t\t\t\t\"guid\": null,\n\t\t\t\t\"version\": \"2.4.0\"\n\t\t\t  },\n\t\t\t  \"deletable\": true,\n\t\t\t  \"warning\": \"\"\n\t\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tanalysis, _, err := client.CodeScanning.GetAnalysis(ctx, \"o\", \"r\", 3602840)\n\tif err != nil {\n\t\tt.Errorf(\"CodeScanning.GetAnalysis returned error: %v\", err)\n\t}\n\n\tdate := &Timestamp{time.Date(2021, time.January, 13, 11, 55, 49, 0, time.UTC)}\n\twant := &ScanningAnalysis{\n\t\tID:           Ptr(int64(3602840)),\n\t\tRef:          Ptr(\"refs/heads/main\"),\n\t\tCommitSHA:    Ptr(\"c18c69115654ff0166991962832dc2bd7756e655\"),\n\t\tAnalysisKey:  Ptr(\".github/workflows/codeql-analysis.yml:analyze\"),\n\t\tEnvironment:  Ptr(\"{\\\"language\\\":\\\"javascript\\\"}\"),\n\t\tError:        Ptr(\"\"),\n\t\tCategory:     Ptr(\".github/workflows/codeql-analysis.yml:analyze/language:javascript\"),\n\t\tCreatedAt:    date,\n\t\tResultsCount: Ptr(3),\n\t\tRulesCount:   Ptr(67),\n\t\tURL:          Ptr(\"https://api.github.com/repos/o/r/code-scanning/analyses/201\"),\n\t\tSarifID:      Ptr(\"47177e22-5596-11eb-80a1-c1e54ef945c6\"),\n\t\tTool: &Tool{\n\t\t\tName:    Ptr(\"CodeQL\"),\n\t\t\tGUID:    nil,\n\t\t\tVersion: Ptr(\"2.4.0\"),\n\t\t},\n\t\tDeletable: Ptr(true),\n\t\tWarning:   Ptr(\"\"),\n\t}\n\tif !cmp.Equal(analysis, want) {\n\t\tt.Errorf(\"CodeScanning.GetAnalysis returned %+v, want %+v\", analysis, want)\n\t}\n\n\tconst methodName = \"GetAnalysis\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.CodeScanning.GetAnalysis(ctx, \"\\n\", \"\\n\", -123)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.CodeScanning.GetAnalysis(ctx, \"o\", \"r\", 3602840)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodeScanningService_DeleteAnalysis(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/code-scanning/analyses/40\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"next_analysis_url\": \"a\",\n\t\t\t\"confirm_delete_url\": \"b\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tanalysis, _, err := client.CodeScanning.DeleteAnalysis(ctx, \"o\", \"r\", 40)\n\tif err != nil {\n\t\tt.Errorf(\"CodeScanning.DeleteAnalysis returned error: %v\", err)\n\t}\n\n\twant := &DeleteAnalysis{\n\t\tNextAnalysisURL:  Ptr(\"a\"),\n\t\tConfirmDeleteURL: Ptr(\"b\"),\n\t}\n\tif !cmp.Equal(analysis, want) {\n\t\tt.Errorf(\"CodeScanning.DeleteAnalysis returned %+v, want %+v\", analysis, want)\n\t}\n\n\tconst methodName = \"DeleteAnalysis\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.CodeScanning.DeleteAnalysis(ctx, \"\\n\", \"\\n\", -123)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.CodeScanning.DeleteAnalysis(ctx, \"o\", \"r\", 40)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodeScanningService_ListCodeQLDatabases(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/code-scanning/codeql/databases\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[\n\t\t\t{\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"name\": \"name\",\n\t\t\t\t\"language\": \"language\",\n\t\t\t\t\"uploader\": {\n\t\t\t\t\t\"login\": \"a\",\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"node_id\": \"b\",\n\t\t\t\t\t\"avatar_url\": \"c\",\n\t\t\t\t\t\"gravatar_id\": \"d\",\n\t\t\t\t\t\"url\": \"e\",\n\t\t\t\t\t\"html_url\": \"f\",\n\t\t\t\t\t\"followers_url\": \"g\",\n\t\t\t\t\t\"following_url\": \"h\",\n\t\t\t\t\t\"gists_url\": \"i\",\n\t\t\t\t\t\"starred_url\": \"j\",\n\t\t\t\t\t\"subscriptions_url\": \"k\",\n\t\t\t\t\t\"organizations_url\": \"l\",\n\t\t\t\t\t\"repos_url\": \"m\",\n\t\t\t\t\t\"events_url\": \"n\",\n\t\t\t\t\t\"received_events_url\": \"o\",\n\t\t\t\t\t\"type\": \"p\",\n\t\t\t\t\t\"site_admin\": false\n\t\t\t\t},\n\t\t\t\t\"content_type\": \"r\",\n\t\t\t\t\"size\": 1024,\n\t\t\t\t\"created_at\": \"2021-01-13T11:55:49Z\",\n\t\t\t\t\"updated_at\": \"2021-01-13T11:55:49Z\",\n\t\t\t\t\"url\": \"s\"\n\t\t\t}\n\t\t]`)\n\t})\n\n\tctx := t.Context()\n\tdatabases, _, err := client.CodeScanning.ListCodeQLDatabases(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"CodeScanning.ListCodeQLDatabases returned error: %v\", err)\n\t}\n\n\tdate := &Timestamp{time.Date(2021, time.January, 13, 11, 55, 49, 0, time.UTC)}\n\twant := []*CodeQLDatabase{\n\t\t{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tName:     Ptr(\"name\"),\n\t\t\tLanguage: Ptr(\"language\"),\n\t\t\tUploader: &User{\n\t\t\t\tLogin:             Ptr(\"a\"),\n\t\t\t\tID:                Ptr(int64(1)),\n\t\t\t\tNodeID:            Ptr(\"b\"),\n\t\t\t\tAvatarURL:         Ptr(\"c\"),\n\t\t\t\tGravatarID:        Ptr(\"d\"),\n\t\t\t\tURL:               Ptr(\"e\"),\n\t\t\t\tHTMLURL:           Ptr(\"f\"),\n\t\t\t\tFollowersURL:      Ptr(\"g\"),\n\t\t\t\tFollowingURL:      Ptr(\"h\"),\n\t\t\t\tGistsURL:          Ptr(\"i\"),\n\t\t\t\tStarredURL:        Ptr(\"j\"),\n\t\t\t\tSubscriptionsURL:  Ptr(\"k\"),\n\t\t\t\tOrganizationsURL:  Ptr(\"l\"),\n\t\t\t\tReposURL:          Ptr(\"m\"),\n\t\t\t\tEventsURL:         Ptr(\"n\"),\n\t\t\t\tReceivedEventsURL: Ptr(\"o\"),\n\t\t\t\tType:              Ptr(\"p\"),\n\t\t\t\tSiteAdmin:         Ptr(false),\n\t\t\t},\n\t\t\tContentType: Ptr(\"r\"),\n\t\t\tSize:        Ptr(int64(1024)),\n\t\t\tCreatedAt:   date,\n\t\t\tUpdatedAt:   date,\n\t\t\tURL:         Ptr(\"s\"),\n\t\t},\n\t}\n\n\tif !cmp.Equal(databases, want) {\n\t\tt.Errorf(\"CodeScanning.ListCodeQLDatabases returned %+v, want %+v\", databases, want)\n\t}\n\n\tconst methodName = \"ListCodeQLDatabases\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.CodeScanning.ListCodeQLDatabases(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.CodeScanning.ListCodeQLDatabases(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodeScanningService_GetCodeQLDatabase(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/code-scanning/codeql/databases/lang\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"name\",\n\t\t\t\"language\": \"language\",\n\t\t\t\"uploader\": {\n\t\t\t\t\"login\": \"a\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"b\",\n\t\t\t\t\"avatar_url\": \"c\",\n\t\t\t\t\"gravatar_id\": \"d\",\n\t\t\t\t\"url\": \"e\",\n\t\t\t\t\"html_url\": \"f\",\n\t\t\t\t\"followers_url\": \"g\",\n\t\t\t\t\"following_url\": \"h\",\n\t\t\t\t\"gists_url\": \"i\",\n\t\t\t\t\"starred_url\": \"j\",\n\t\t\t\t\"subscriptions_url\": \"k\",\n\t\t\t\t\"organizations_url\": \"l\",\n\t\t\t\t\"repos_url\": \"m\",\n\t\t\t\t\"events_url\": \"n\",\n\t\t\t\t\"received_events_url\": \"o\",\n\t\t\t\t\"type\": \"p\",\n\t\t\t\t\"site_admin\": false\n\t\t\t},\n\t\t\t\"content_type\": \"r\",\n\t\t\t\"size\": 1024,\n\t\t\t\"created_at\": \"2021-01-13T11:55:49Z\",\n\t\t\t\"updated_at\": \"2021-01-13T11:55:49Z\",\n\t\t\t\"url\": \"s\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tdatabase, _, err := client.CodeScanning.GetCodeQLDatabase(ctx, \"o\", \"r\", \"lang\")\n\tif err != nil {\n\t\tt.Errorf(\"CodeScanning.GetCodeQLDatabase returned error: %v\", err)\n\t}\n\n\tdate := &Timestamp{time.Date(2021, time.January, 13, 11, 55, 49, 0, time.UTC)}\n\twant := &CodeQLDatabase{\n\t\tID:       Ptr(int64(1)),\n\t\tName:     Ptr(\"name\"),\n\t\tLanguage: Ptr(\"language\"),\n\t\tUploader: &User{\n\t\t\tLogin:             Ptr(\"a\"),\n\t\t\tID:                Ptr(int64(1)),\n\t\t\tNodeID:            Ptr(\"b\"),\n\t\t\tAvatarURL:         Ptr(\"c\"),\n\t\t\tGravatarID:        Ptr(\"d\"),\n\t\t\tURL:               Ptr(\"e\"),\n\t\t\tHTMLURL:           Ptr(\"f\"),\n\t\t\tFollowersURL:      Ptr(\"g\"),\n\t\t\tFollowingURL:      Ptr(\"h\"),\n\t\t\tGistsURL:          Ptr(\"i\"),\n\t\t\tStarredURL:        Ptr(\"j\"),\n\t\t\tSubscriptionsURL:  Ptr(\"k\"),\n\t\t\tOrganizationsURL:  Ptr(\"l\"),\n\t\t\tReposURL:          Ptr(\"m\"),\n\t\t\tEventsURL:         Ptr(\"n\"),\n\t\t\tReceivedEventsURL: Ptr(\"o\"),\n\t\t\tType:              Ptr(\"p\"),\n\t\t\tSiteAdmin:         Ptr(false),\n\t\t},\n\t\tContentType: Ptr(\"r\"),\n\t\tSize:        Ptr(int64(1024)),\n\t\tCreatedAt:   date,\n\t\tUpdatedAt:   date,\n\t\tURL:         Ptr(\"s\"),\n\t}\n\n\tif !cmp.Equal(database, want) {\n\t\tt.Errorf(\"CodeScanning.GetCodeQLDatabase returned %+v, want %+v\", database, want)\n\t}\n\n\tconst methodName = \"GetCodeQLDatabase\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.CodeScanning.GetCodeQLDatabase(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.CodeScanning.GetCodeQLDatabase(ctx, \"o\", \"r\", \"lang\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodeScanningService_GetDefaultSetupConfiguration(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/code-scanning/default-setup\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\t_, err := fmt.Fprint(w, `{\n\t\t\"state\": \"configured\",\n\t\t\"languages\": [\n\t\t\t\"javascript\",\n\t\t\t\"javascript-typescript\",\n\t\t\t\"typescript\"\n\t\t],\n\t\t\"query_suite\": \"default\",\n\t\t\"updated_at\": \"2006-01-02T15:04:05Z\"\n\t\t}`)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t})\n\n\tctx := t.Context()\n\tcfg, _, err := client.CodeScanning.GetDefaultSetupConfiguration(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"CodeScanning.GetDefaultSetupConfiguration returned error: %v\", err)\n\t}\n\n\tdate := &Timestamp{time.Date(2006, time.January, 2, 15, 4, 5, 0, time.UTC)}\n\twant := &DefaultSetupConfiguration{\n\t\tState:      Ptr(\"configured\"),\n\t\tLanguages:  []string{\"javascript\", \"javascript-typescript\", \"typescript\"},\n\t\tQuerySuite: Ptr(\"default\"),\n\t\tUpdatedAt:  date,\n\t}\n\tif !cmp.Equal(cfg, want) {\n\t\tt.Errorf(\"CodeScanning.GetDefaultSetupConfiguration returned %+v, want %+v\", cfg, want)\n\t}\n\n\tconst methodName = \"GetDefaultSetupConfiguration\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.CodeScanning.GetDefaultSetupConfiguration(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.CodeScanning.GetDefaultSetupConfiguration(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodeScanningService_UpdateDefaultSetupConfiguration(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/code-scanning/default-setup\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\t_, err := fmt.Fprint(w, `{\n\t\t\"run_id\": 5301214200,\n\t\t\"run_url\": \"https://api.github.com/repos/o/r/actions/runs/5301214200\"\n\t\t}`)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t})\n\n\tctx := t.Context()\n\toptions := &UpdateDefaultSetupConfigurationOptions{\n\t\tState:      \"configured\",\n\t\tLanguages:  []string{\"go\"},\n\t\tQuerySuite: Ptr(\"default\"),\n\t}\n\tgot, _, err := client.CodeScanning.UpdateDefaultSetupConfiguration(ctx, \"o\", \"r\", options)\n\tif err != nil {\n\t\tt.Errorf(\"CodeScanning.UpdateDefaultSetupConfiguration returned error: %v\", err)\n\t}\n\n\twant := &UpdateDefaultSetupConfigurationResponse{\n\t\tRunID:  Ptr(int64(5301214200)),\n\t\tRunURL: Ptr(\"https://api.github.com/repos/o/r/actions/runs/5301214200\"),\n\t}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"CodeScanning.UpdateDefaultSetupConfiguration returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"UpdateDefaultSetupConfiguration\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.CodeScanning.UpdateDefaultSetupConfiguration(ctx, \"\\n\", \"\\n\", nil)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.CodeScanning.UpdateDefaultSetupConfiguration(ctx, \"o\", \"r\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/codesofconduct.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// CodesOfConductService provides access to code-of-conduct-related functions in the GitHub API.\ntype CodesOfConductService service\n\n// CodeOfConduct represents a code of conduct.\ntype CodeOfConduct struct {\n\tName *string `json:\"name,omitempty\"`\n\tKey  *string `json:\"key,omitempty\"`\n\tURL  *string `json:\"url,omitempty\"`\n\tBody *string `json:\"body,omitempty\"`\n}\n\nfunc (c *CodeOfConduct) String() string {\n\treturn Stringify(c)\n}\n\n// List returns all codes of conduct.\n//\n// GitHub API docs: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-all-codes-of-conduct\n//\n//meta:operation GET /codes_of_conduct\nfunc (s *CodesOfConductService) List(ctx context.Context) ([]*CodeOfConduct, *Response, error) {\n\treq, err := s.client.NewRequest(\"GET\", \"codes_of_conduct\", nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeCodesOfConductPreview)\n\n\tvar cs []*CodeOfConduct\n\tresp, err := s.client.Do(ctx, req, &cs)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn cs, resp, nil\n}\n\n// ListCodesOfConduct returns all codes of conduct.\n//\n// Deprecated: Use CodesOfConductService.List instead.\nfunc (c *Client) ListCodesOfConduct(ctx context.Context) ([]*CodeOfConduct, *Response, error) {\n\treturn c.CodesOfConduct.List(ctx)\n}\n\n// Get returns an individual code of conduct.\n//\n// GitHub API docs: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-a-code-of-conduct\n//\n//meta:operation GET /codes_of_conduct/{key}\nfunc (s *CodesOfConductService) Get(ctx context.Context, key string) (*CodeOfConduct, *Response, error) {\n\tu := fmt.Sprintf(\"codes_of_conduct/%v\", key)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeCodesOfConductPreview)\n\n\tvar coc *CodeOfConduct\n\tresp, err := s.client.Do(ctx, req, &coc)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn coc, resp, nil\n}\n\n// GetCodeOfConduct returns an individual code of conduct.\n//\n// Deprecated: Use CodesOfConductService.Get instead.\nfunc (c *Client) GetCodeOfConduct(ctx context.Context, key string) (*CodeOfConduct, *Response, error) {\n\treturn c.CodesOfConduct.Get(ctx, key)\n}\n"
  },
  {
    "path": "github/codesofconduct_test.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestCodesOfConductService_List(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/codes_of_conduct\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeCodesOfConductPreview)\n\t\tfmt.Fprint(w, `[{\n\t\t\t\t\t\t\"key\": \"key\",\n\t\t\t\t\t\t\"name\": \"name\",\n\t\t\t\t\t\t\"url\": \"url\"}\n\t\t\t\t\t\t]`)\n\t})\n\n\tctx := t.Context()\n\tcs, _, err := client.ListCodesOfConduct(ctx)\n\tassertNilError(t, err)\n\n\twant := []*CodeOfConduct{\n\t\t{\n\t\t\tKey:  Ptr(\"key\"),\n\t\t\tName: Ptr(\"name\"),\n\t\t\tURL:  Ptr(\"url\"),\n\t\t},\n\t}\n\tif !cmp.Equal(want, cs) {\n\t\tt.Errorf(\"returned %+v, want %+v\", cs, want)\n\t}\n\n\tconst methodName = \"List\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.CodesOfConduct.List(ctx)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodesOfConductService_Get(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/codes_of_conduct/k\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeCodesOfConductPreview)\n\t\tfmt.Fprint(w, `{\n\t\t\t\t\t\t\"key\": \"key\",\n\t\t\t\t\t\t\"name\": \"name\",\n\t\t\t\t\t\t\"url\": \"url\",\n\t\t\t\t\t\t\"body\": \"body\"}`,\n\t\t)\n\t})\n\n\tctx := t.Context()\n\tcoc, _, err := client.GetCodeOfConduct(ctx, \"k\")\n\tassertNilError(t, err)\n\n\twant := &CodeOfConduct{\n\t\tKey:  Ptr(\"key\"),\n\t\tName: Ptr(\"name\"),\n\t\tURL:  Ptr(\"url\"),\n\t\tBody: Ptr(\"body\"),\n\t}\n\tif !cmp.Equal(want, coc) {\n\t\tt.Errorf(\"returned %+v, want %+v\", coc, want)\n\t}\n\n\tconst methodName = \"Get\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.CodesOfConduct.Get(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.CodesOfConduct.Get(ctx, \"k\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodeOfConduct_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CodeOfConduct{}, \"{}\")\n\n\ta := &CodeOfConduct{\n\t\tName: Ptr(\"name\"),\n\t\tKey:  Ptr(\"key\"),\n\t\tURL:  Ptr(\"url\"),\n\t\tBody: Ptr(\"body\"),\n\t}\n\n\twant := `{\n\t\t\"name\": \"name\",\n\t\t\"key\": \"key\",\n\t\t\"url\": \"url\",\n\t\t\"body\": \"body\"\n\t}`\n\n\ttestJSONMarshal(t, a, want)\n}\n"
  },
  {
    "path": "github/codespaces.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// CodespacesService handles communication with the Codespaces related\n// methods of the GitHub API.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/\ntype CodespacesService service\n\n// Codespace represents a codespace.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces\ntype Codespace struct {\n\tID                             *int64                        `json:\"id,omitempty\"`\n\tName                           *string                       `json:\"name,omitempty\"`\n\tDisplayName                    *string                       `json:\"display_name,omitempty\"`\n\tEnvironmentID                  *string                       `json:\"environment_id,omitempty\"`\n\tOwner                          *User                         `json:\"owner,omitempty\"`\n\tBillableOwner                  *User                         `json:\"billable_owner,omitempty\"`\n\tRepository                     *Repository                   `json:\"repository,omitempty\"`\n\tMachine                        *CodespacesMachine            `json:\"machine,omitempty\"`\n\tDevcontainerPath               *string                       `json:\"devcontainer_path,omitempty\"`\n\tPrebuild                       *bool                         `json:\"prebuild,omitempty\"`\n\tCreatedAt                      *Timestamp                    `json:\"created_at,omitempty\"`\n\tUpdatedAt                      *Timestamp                    `json:\"updated_at,omitempty\"`\n\tLastUsedAt                     *Timestamp                    `json:\"last_used_at,omitempty\"`\n\tState                          *string                       `json:\"state,omitempty\"`\n\tURL                            *string                       `json:\"url,omitempty\"`\n\tGitStatus                      *CodespacesGitStatus          `json:\"git_status,omitempty\"`\n\tLocation                       *string                       `json:\"location,omitempty\"`\n\tIdleTimeoutMinutes             *int                          `json:\"idle_timeout_minutes,omitempty\"`\n\tWebURL                         *string                       `json:\"web_url,omitempty\"`\n\tMachinesURL                    *string                       `json:\"machines_url,omitempty\"`\n\tStartURL                       *string                       `json:\"start_url,omitempty\"`\n\tStopURL                        *string                       `json:\"stop_url,omitempty\"`\n\tPullsURL                       *string                       `json:\"pulls_url,omitempty\"`\n\tRecentFolders                  []string                      `json:\"recent_folders,omitempty\"`\n\tRuntimeConstraints             *CodespacesRuntimeConstraints `json:\"runtime_constraints,omitempty\"`\n\tPendingOperation               *bool                         `json:\"pending_operation,omitempty\"`\n\tPendingOperationDisabledReason *string                       `json:\"pending_operation_disabled_reason,omitempty\"`\n\tIdleTimeoutNotice              *string                       `json:\"idle_timeout_notice,omitempty\"`\n\tRetentionPeriodMinutes         *int                          `json:\"retention_period_minutes,omitempty\"`\n\tRetentionExpiresAt             *Timestamp                    `json:\"retention_expires_at,omitempty\"`\n\tLastKnownStopNotice            *string                       `json:\"last_known_stop_notice,omitempty\"`\n}\n\n// CodespacesGitStatus represents the git status of a codespace.\ntype CodespacesGitStatus struct {\n\tAhead                 *int    `json:\"ahead,omitempty\"`\n\tBehind                *int    `json:\"behind,omitempty\"`\n\tHasUnpushedChanges    *bool   `json:\"has_unpushed_changes,omitempty\"`\n\tHasUncommittedChanges *bool   `json:\"has_uncommitted_changes,omitempty\"`\n\tRef                   *string `json:\"ref,omitempty\"`\n}\n\n// CodespacesMachine represents the machine type of a codespace.\ntype CodespacesMachine struct {\n\tName                 *string `json:\"name,omitempty\"`\n\tDisplayName          *string `json:\"display_name,omitempty\"`\n\tOperatingSystem      *string `json:\"operating_system,omitempty\"`\n\tStorageInBytes       *int64  `json:\"storage_in_bytes,omitempty\"`\n\tMemoryInBytes        *int64  `json:\"memory_in_bytes,omitempty\"`\n\tCPUs                 *int    `json:\"cpus,omitempty\"`\n\tPrebuildAvailability *string `json:\"prebuild_availability,omitempty\"`\n}\n\n// CodespacesRuntimeConstraints represents the runtime constraints of a codespace.\ntype CodespacesRuntimeConstraints struct {\n\tAllowedPortPrivacySettings []string `json:\"allowed_port_privacy_settings,omitempty\"`\n}\n\n// ListCodespaces represents the response from the list codespaces endpoints.\ntype ListCodespaces struct {\n\tTotalCount *int         `json:\"total_count,omitempty\"`\n\tCodespaces []*Codespace `json:\"codespaces\"`\n}\n\n// ListInRepo lists codespaces for a user in a repository.\n//\n// Lists the codespaces associated with a specified repository and the authenticated user.\n// You must authenticate using an access token with the codespace scope to use this endpoint.\n// GitHub Apps must have read access to the codespaces repository permission to use this endpoint.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-in-a-repository-for-the-authenticated-user\n//\n//meta:operation GET /repos/{owner}/{repo}/codespaces\nfunc (s *CodespacesService) ListInRepo(ctx context.Context, owner, repo string, opts *ListOptions) (*ListCodespaces, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/codespaces\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar codespaces *ListCodespaces\n\tresp, err := s.client.Do(ctx, req, &codespaces)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn codespaces, resp, nil\n}\n\n// ListCodespacesOptions represents the options for listing codespaces for a user.\ntype ListCodespacesOptions struct {\n\tListOptions\n\tRepositoryID int64 `url:\"repository_id,omitempty\"`\n}\n\n// List lists codespaces for an authenticated user.\n//\n// Lists the authenticated user's codespaces.\n// You must authenticate using an access token with the codespace scope to use this endpoint.\n// GitHub Apps must have read access to the codespaces repository permission to use this endpoint.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-for-the-authenticated-user\n//\n//meta:operation GET /user/codespaces\nfunc (s *CodespacesService) List(ctx context.Context, opts *ListCodespacesOptions) (*ListCodespaces, *Response, error) {\n\tu := \"user/codespaces\"\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar codespaces *ListCodespaces\n\tresp, err := s.client.Do(ctx, req, &codespaces)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn codespaces, resp, nil\n}\n\n// CreateCodespaceOptions represents options for the creation of a codespace in a repository.\ntype CreateCodespaceOptions struct {\n\tRef *string `json:\"ref,omitempty\"`\n\t// Geo represents the geographic area for this codespace.\n\t// If not specified, the value is assigned by IP.\n\t// This property replaces location, which is being deprecated.\n\t// Geo can be one of: `EuropeWest`, `SoutheastAsia`, `UsEast`, `UsWest`.\n\tGeo                        *string `json:\"geo,omitempty\"`\n\tClientIP                   *string `json:\"client_ip,omitempty\"`\n\tMachine                    *string `json:\"machine,omitempty\"`\n\tDevcontainerPath           *string `json:\"devcontainer_path,omitempty\"`\n\tMultiRepoPermissionsOptOut *bool   `json:\"multi_repo_permissions_opt_out,omitempty\"`\n\tWorkingDirectory           *string `json:\"working_directory,omitempty\"`\n\tIdleTimeoutMinutes         *int    `json:\"idle_timeout_minutes,omitempty\"`\n\tDisplayName                *string `json:\"display_name,omitempty\"`\n\t// RetentionPeriodMinutes represents the duration in minutes after codespace has gone idle in which it will be deleted.\n\t// Must be integer minutes between 0 and 43200 (30 days).\n\tRetentionPeriodMinutes *int    `json:\"retention_period_minutes,omitempty\"`\n\tLocation               *string `json:\"location,omitempty\"`\n}\n\n// DevContainer represents a devcontainer configuration in a repository.\ntype DevContainer struct {\n\tPath        string  `json:\"path\"`\n\tName        *string `json:\"name,omitempty\"`\n\tDisplayName *string `json:\"display_name,omitempty\"`\n}\n\n// DevContainerConfigurations represents a list of devcontainer configurations in a repository.\ntype DevContainerConfigurations struct {\n\tDevcontainers []*DevContainer `json:\"devcontainers\"`\n\tTotalCount    int64           `json:\"total_count\"`\n}\n\n// CodespaceDefaults represents default settings for a Codespace.\ntype CodespaceDefaults struct {\n\tLocation         string  `json:\"location\"`\n\tDevcontainerPath *string `json:\"devcontainer_path,omitempty\"`\n}\n\n// CodespaceDefaultAttributes represents the default attributes for codespaces created by the user with the repository.\ntype CodespaceDefaultAttributes struct {\n\tBillableOwner *User              `json:\"billable_owner\"`\n\tDefaults      *CodespaceDefaults `json:\"defaults\"`\n}\n\n// CodespaceGetDefaultAttributesOptions represents options for getting default attributes for a codespace.\ntype CodespaceGetDefaultAttributesOptions struct {\n\t// Ref represents the branch or commit to check for a default devcontainer path. If not specified, the default branch will be checked.\n\tRef *string `url:\"ref,omitempty\"`\n\t// ClientIP represents an alternative IP for default location auto-detection, such as when proxying a request.\n\tClientIP *string `url:\"client_ip,omitempty\"`\n}\n\n// CodespacePullRequestOptions represents options for a CodespacePullRequest.\ntype CodespacePullRequestOptions struct {\n\t// PullRequestNumber represents the pull request number.\n\tPullRequestNumber int64 `json:\"pull_request_number\"`\n\t// RepositoryID represents the repository ID for this codespace.\n\tRepositoryID int64 `json:\"repository_id\"`\n}\n\n// CodespaceCreateForUserOptions represents options for creating a codespace for the authenticated user.\ntype CodespaceCreateForUserOptions struct {\n\tPullRequest *CodespacePullRequestOptions `json:\"pull_request\"`\n\t// RepositoryID represents the repository ID for this codespace.\n\tRepositoryID               int64   `json:\"repository_id\"`\n\tRef                        *string `json:\"ref,omitempty\"`\n\tGeo                        *string `json:\"geo,omitempty\"`\n\tClientIP                   *string `json:\"client_ip,omitempty\"`\n\tRetentionPeriodMinutes     *int    `json:\"retention_period_minutes,omitempty\"`\n\tLocation                   *string `json:\"location,omitempty\"`\n\tMachine                    *string `json:\"machine,omitempty\"`\n\tDevcontainerPath           *string `json:\"devcontainer_path,omitempty\"`\n\tMultiRepoPermissionsOptOut *bool   `json:\"multi_repo_permissions_opt_out,omitempty\"`\n\tWorkingDirectory           *string `json:\"working_directory,omitempty\"`\n\tIdleTimeoutMinutes         *int    `json:\"idle_timeout_minutes,omitempty\"`\n\tDisplayName                *string `json:\"display_name,omitempty\"`\n}\n\n// UpdateCodespaceOptions represents options for updating a codespace.\ntype UpdateCodespaceOptions struct {\n\t// Machine represents a valid machine to transition this codespace to.\n\tMachine *string `json:\"machine,omitempty\"`\n\t// RecentFolders represents the recently opened folders inside the codespace.\n\t// It is currently used by the clients to determine the folder path to load the codespace in.\n\tRecentFolders []string `json:\"recent_folders,omitempty\"`\n}\n\n// CodespaceExport represents an export of a codespace.\ntype CodespaceExport struct {\n\t// Can be one of: `succeeded`, `failed`, `in_progress`.\n\tState       *string    `json:\"state,omitempty\"`\n\tCompletedAt *Timestamp `json:\"completed_at,omitempty\"`\n\tBranch      *string    `json:\"branch,omitempty\"`\n\tSHA         *string    `json:\"sha,omitempty\"`\n\tID          *string    `json:\"id,omitempty\"`\n\tExportURL   *string    `json:\"export_url,omitempty\"`\n\tHTMLURL     *string    `json:\"html_url,omitempty\"`\n}\n\n// PublishCodespaceOptions represents options for creating a repository from an unpublished codespace.\ntype PublishCodespaceOptions struct {\n\t// Name represents the name of the new repository.\n\tName *string `json:\"name,omitempty\"`\n\t// Private represents whether the new repository is private. Defaults to false.\n\tPrivate *bool `json:\"private,omitempty\"`\n}\n\n// CodespacePermissions represents a response indicating whether the permissions defined by a devcontainer have been accepted.\ntype CodespacePermissions struct {\n\tAccepted bool `json:\"accepted\"`\n}\n\n// CreateInRepo creates a codespace in a repository.\n//\n// Creates a codespace owned by the authenticated user in the specified repository.\n// You must authenticate using an access token with the codespace scope to use this endpoint.\n// GitHub Apps must have write access to the codespaces repository permission to use this endpoint.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-in-a-repository\n//\n//meta:operation POST /repos/{owner}/{repo}/codespaces\nfunc (s *CodespacesService) CreateInRepo(ctx context.Context, owner, repo string, request *CreateCodespaceOptions) (*Codespace, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/codespaces\", owner, repo)\n\treq, err := s.client.NewRequest(\"POST\", u, request)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar codespace *Codespace\n\tresp, err := s.client.Do(ctx, req, &codespace)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn codespace, resp, nil\n}\n\n// Start starts a codespace.\n//\n// You must authenticate using an access token with the codespace scope to use this endpoint.\n// GitHub Apps must have write access to the codespaces_lifecycle_admin repository permission to use this endpoint.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#start-a-codespace-for-the-authenticated-user\n//\n//meta:operation POST /user/codespaces/{codespace_name}/start\nfunc (s *CodespacesService) Start(ctx context.Context, codespaceName string) (*Codespace, *Response, error) {\n\tu := fmt.Sprintf(\"user/codespaces/%v/start\", codespaceName)\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar codespace *Codespace\n\tresp, err := s.client.Do(ctx, req, &codespace)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn codespace, resp, nil\n}\n\n// Stop stops a codespace.\n//\n// You must authenticate using an access token with the codespace scope to use this endpoint.\n// GitHub Apps must have write access to the codespaces_lifecycle_admin repository permission to use this endpoint.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#stop-a-codespace-for-the-authenticated-user\n//\n//meta:operation POST /user/codespaces/{codespace_name}/stop\nfunc (s *CodespacesService) Stop(ctx context.Context, codespaceName string) (*Codespace, *Response, error) {\n\tu := fmt.Sprintf(\"user/codespaces/%v/stop\", codespaceName)\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar codespace *Codespace\n\tresp, err := s.client.Do(ctx, req, &codespace)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn codespace, resp, nil\n}\n\n// Delete deletes a codespace.\n//\n// You must authenticate using an access token with the codespace scope to use this endpoint.\n// GitHub Apps must have write access to the codespaces repository permission to use this endpoint.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#delete-a-codespace-for-the-authenticated-user\n//\n//meta:operation DELETE /user/codespaces/{codespace_name}\nfunc (s *CodespacesService) Delete(ctx context.Context, codespaceName string) (*Response, error) {\n\tu := fmt.Sprintf(\"user/codespaces/%v\", codespaceName)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// ListDevContainerConfigurations lists devcontainer configurations in a repository for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#list-devcontainer-configurations-in-a-repository-for-the-authenticated-user\n//\n//meta:operation GET /repos/{owner}/{repo}/codespaces/devcontainers\nfunc (s *CodespacesService) ListDevContainerConfigurations(ctx context.Context, owner, repo string, opts *ListOptions) (*DevContainerConfigurations, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/codespaces/devcontainers\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar devcontainers *DevContainerConfigurations\n\tresp, err := s.client.Do(ctx, req, &devcontainers)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn devcontainers, resp, nil\n}\n\n// GetDefaultAttributes gets the default attributes for codespaces created by the user with the repository.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#get-default-attributes-for-a-codespace\n//\n//meta:operation GET /repos/{owner}/{repo}/codespaces/new\nfunc (s *CodespacesService) GetDefaultAttributes(ctx context.Context, owner, repo string, opts *CodespaceGetDefaultAttributesOptions) (*CodespaceDefaultAttributes, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/codespaces/new\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar attributes *CodespaceDefaultAttributes\n\tresp, err := s.client.Do(ctx, req, &attributes)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn attributes, resp, nil\n}\n\n// CheckPermissions checks whether the permissions defined by a given devcontainer configuration have been accepted by the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#check-if-permissions-defined-by-a-devcontainer-have-been-accepted-by-the-authenticated-user\n//\n//meta:operation GET /repos/{owner}/{repo}/codespaces/permissions_check\nfunc (s *CodespacesService) CheckPermissions(ctx context.Context, owner, repo, ref, devcontainerPath string) (*CodespacePermissions, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/codespaces/permissions_check\", owner, repo)\n\tu, err := addOptions(u, &struct {\n\t\tRef              string `url:\"ref\"`\n\t\tDevcontainerPath string `url:\"devcontainer_path\"`\n\t}{\n\t\tRef:              ref,\n\t\tDevcontainerPath: devcontainerPath,\n\t})\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar permissions *CodespacePermissions\n\tresp, err := s.client.Do(ctx, req, &permissions)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn permissions, resp, nil\n}\n\n// CreateFromPullRequest creates a codespace owned by the authenticated user for the specified pull request.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-from-a-pull-request\n//\n//meta:operation POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces\nfunc (s *CodespacesService) CreateFromPullRequest(ctx context.Context, owner, repo string, pullNumber int, request *CreateCodespaceOptions) (*Codespace, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pulls/%v/codespaces\", owner, repo, pullNumber)\n\treq, err := s.client.NewRequest(\"POST\", u, request)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar codespace *Codespace\n\tresp, err := s.client.Do(ctx, req, &codespace)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn codespace, resp, nil\n}\n\n// Create creates a new codespace, owned by the authenticated user.\n//\n// This method requires either RepositoryId OR a PullRequest but not both.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-for-the-authenticated-user\n//\n//meta:operation POST /user/codespaces\nfunc (s *CodespacesService) Create(ctx context.Context, opts *CodespaceCreateForUserOptions) (*Codespace, *Response, error) {\n\tu := \"user/codespaces\"\n\treq, err := s.client.NewRequest(\"POST\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar codespace *Codespace\n\tresp, err := s.client.Do(ctx, req, &codespace)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn codespace, resp, nil\n}\n\n// Get gets information about a user's codespace.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#get-a-codespace-for-the-authenticated-user\n//\n//meta:operation GET /user/codespaces/{codespace_name}\nfunc (s *CodespacesService) Get(ctx context.Context, codespaceName string) (*Codespace, *Response, error) {\n\tu := fmt.Sprintf(\"user/codespaces/%v\", codespaceName)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar codespace *Codespace\n\tresp, err := s.client.Do(ctx, req, &codespace)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn codespace, resp, nil\n}\n\n// Update updates a codespace owned by the authenticated user.\n//\n// Only the codespace's machine type and recent folders can be modified using this endpoint.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#update-a-codespace-for-the-authenticated-user\n//\n//meta:operation PATCH /user/codespaces/{codespace_name}\nfunc (s *CodespacesService) Update(ctx context.Context, codespaceName string, opts *UpdateCodespaceOptions) (*Codespace, *Response, error) {\n\tu := fmt.Sprintf(\"user/codespaces/%v\", codespaceName)\n\treq, err := s.client.NewRequest(\"PATCH\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar codespace *Codespace\n\tresp, err := s.client.Do(ctx, req, &codespace)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn codespace, resp, nil\n}\n\n// ExportCodespace triggers an export of the specified codespace and returns a URL and ID where the status of the export can be monitored.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#export-a-codespace-for-the-authenticated-user\n//\n//meta:operation POST /user/codespaces/{codespace_name}/exports\nfunc (s *CodespacesService) ExportCodespace(ctx context.Context, codespaceName string) (*CodespaceExport, *Response, error) {\n\tu := fmt.Sprintf(\"user/codespaces/%v/exports\", codespaceName)\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar codespace *CodespaceExport\n\tresp, err := s.client.Do(ctx, req, &codespace)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn codespace, resp, nil\n}\n\n// GetLatestCodespaceExport gets information about an export of a codespace.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#get-details-about-a-codespace-export\n//\n//meta:operation GET /user/codespaces/{codespace_name}/exports/{export_id}\nfunc (s *CodespacesService) GetLatestCodespaceExport(ctx context.Context, codespaceName string) (*CodespaceExport, *Response, error) {\n\tu := fmt.Sprintf(\"user/codespaces/%v/exports/latest\", codespaceName)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar codespace *CodespaceExport\n\tresp, err := s.client.Do(ctx, req, &codespace)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn codespace, resp, nil\n}\n\n// Publish publishes an unpublished codespace, creating a new repository and assigning it to the codespace.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/codespaces#create-a-repository-from-an-unpublished-codespace\n//\n//meta:operation POST /user/codespaces/{codespace_name}/publish\nfunc (s *CodespacesService) Publish(ctx context.Context, codespaceName string, opts *PublishCodespaceOptions) (*Codespace, *Response, error) {\n\tu := fmt.Sprintf(\"user/codespaces/%v/publish\", codespaceName)\n\treq, err := s.client.NewRequest(\"POST\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar codespace *Codespace\n\tresp, err := s.client.Do(ctx, req, &codespace)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn codespace, resp, nil\n}\n"
  },
  {
    "path": "github/codespaces_machines.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// CodespacesMachines represent a list of machines.\ntype CodespacesMachines struct {\n\tTotalCount int64                `json:\"total_count\"`\n\tMachines   []*CodespacesMachine `json:\"machines\"`\n}\n\n// ListRepoMachineTypesOptions represent options for ListMachineTypesForRepository.\ntype ListRepoMachineTypesOptions struct {\n\t// Ref represent the branch or commit to check for prebuild availability and devcontainer restrictions.\n\tRef *string `url:\"ref,omitempty\"`\n\t// Location represent the location to check for available machines. Assigned by IP if not provided.\n\tLocation *string `url:\"location,omitempty\"`\n\t// ClientIP represent the IP for location auto-detection when proxying a request\n\tClientIP *string `url:\"client_ip,omitempty\"`\n}\n\n// ListRepositoryMachineTypes lists the machine types available for a given repository based on its configuration.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/machines#list-available-machine-types-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/codespaces/machines\nfunc (s *CodespacesService) ListRepositoryMachineTypes(ctx context.Context, owner, repo string, opts *ListRepoMachineTypesOptions) (*CodespacesMachines, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/codespaces/machines\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar machines *CodespacesMachines\n\tresp, err := s.client.Do(ctx, req, &machines)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn machines, resp, nil\n}\n\n// ListCodespaceMachineTypes lists the machine types a codespace can transition to use.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/machines#list-machine-types-for-a-codespace\n//\n//meta:operation GET /user/codespaces/{codespace_name}/machines\nfunc (s *CodespacesService) ListCodespaceMachineTypes(ctx context.Context, codespaceName string) (*CodespacesMachines, *Response, error) {\n\tu := fmt.Sprintf(\"user/codespaces/%v/machines\", codespaceName)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar machines *CodespacesMachines\n\tresp, err := s.client.Do(ctx, req, &machines)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn machines, resp, nil\n}\n"
  },
  {
    "path": "github/codespaces_machines_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestCodespacesService_ListRepositoryMachineTypes(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/owner/repo/codespaces/machines\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"ref\":       \"main\",\n\t\t\t\"location\":  \"WestUs2\",\n\t\t\t\"client_ip\": \"1.2.3.4\",\n\t\t})\n\t\tfmt.Fprint(w, `{\n\t\t\t\"total_count\": 1,\n\t\t\t\"machines\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"standardLinux\",\n\t\t\t\t\t\"display_name\": \"4 cores, 8 GB RAM, 64 GB storage\",\n\t\t\t\t\t\"operating_system\": \"linux\",\n\t\t\t\t\t\"storage_in_bytes\": 68719476736,\n\t\t\t\t\t\"memory_in_bytes\": 17179869184,\n\t\t\t\t\t\"cpus\": 4,\n\t\t\t\t\t\"prebuild_availability\": \"ready\"\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\topts := &ListRepoMachineTypesOptions{\n\t\tRef:      Ptr(\"main\"),\n\t\tLocation: Ptr(\"WestUs2\"),\n\t\tClientIP: Ptr(\"1.2.3.4\"),\n\t}\n\n\tgot, _, err := client.Codespaces.ListRepositoryMachineTypes(\n\t\tctx,\n\t\t\"owner\",\n\t\t\"repo\",\n\t\topts,\n\t)\n\tif err != nil {\n\t\tt.Fatalf(\"Codespaces.ListRepositoryMachineTypes returned error: %v\", err)\n\t}\n\n\twant := &CodespacesMachines{\n\t\tTotalCount: 1,\n\t\tMachines: []*CodespacesMachine{\n\t\t\t{\n\t\t\t\tName:                 Ptr(\"standardLinux\"),\n\t\t\t\tDisplayName:          Ptr(\"4 cores, 8 GB RAM, 64 GB storage\"),\n\t\t\t\tOperatingSystem:      Ptr(\"linux\"),\n\t\t\t\tStorageInBytes:       Ptr(int64(68719476736)),\n\t\t\t\tMemoryInBytes:        Ptr(int64(17179869184)),\n\t\t\t\tCPUs:                 Ptr(4),\n\t\t\t\tPrebuildAvailability: Ptr(\"ready\"),\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Codespaces.ListRepositoryMachineTypes returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ListRepositoryMachineTypes\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err := client.Codespaces.ListRepositoryMachineTypes(ctx, \"\\n\", \"/n\", opts)\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Codespaces.ListRepositoryMachineTypes(ctx, \"/n\", \"/n\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodespacesService_ListCodespaceMachineTypes(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/codespaces/codespace_1/machines\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\n\t\tfmt.Fprint(w, `{\n\t\t\t\"total_count\": 1,\n\t\t\t\"machines\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"standardLinux\",\n\t\t\t\t\t\"display_name\": \"4 cores, 8 GB RAM, 64 GB storage\",\n\t\t\t\t\t\"operating_system\": \"linux\",\n\t\t\t\t\t\"storage_in_bytes\": 68719476736,\n\t\t\t\t\t\"memory_in_bytes\": 17179869184,\n\t\t\t\t\t\"cpus\": 4,\n\t\t\t\t\t\"prebuild_availability\": \"ready\"\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Codespaces.ListCodespaceMachineTypes(ctx, \"codespace_1\")\n\tif err != nil {\n\t\tt.Fatalf(\"Codespaces.ListCodespaceMachineTypes returned error: %v\", err)\n\t}\n\n\twant := &CodespacesMachines{\n\t\tTotalCount: 1,\n\t\tMachines: []*CodespacesMachine{\n\t\t\t{\n\t\t\t\tName:                 Ptr(\"standardLinux\"),\n\t\t\t\tDisplayName:          Ptr(\"4 cores, 8 GB RAM, 64 GB storage\"),\n\t\t\t\tOperatingSystem:      Ptr(\"linux\"),\n\t\t\t\tStorageInBytes:       Ptr(int64(68719476736)),\n\t\t\t\tMemoryInBytes:        Ptr(int64(17179869184)),\n\t\t\t\tCPUs:                 Ptr(4),\n\t\t\t\tPrebuildAvailability: Ptr(\"ready\"),\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Codespaces.ListCodespaceMachineTypes returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ListCodespaceMachineTypes\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Codespaces.ListCodespaceMachineTypes(ctx, \"/n\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/codespaces_orgs.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// CodespacesOrgAccessControlRequest represent request for SetOrgAccessControl.\ntype CodespacesOrgAccessControlRequest struct {\n\t// Visibility represent which users can access codespaces in the organization.\n\t// Can be one of: disabled, selected_members, all_members, all_members_and_outside_collaborators.\n\tVisibility string `json:\"visibility\"`\n\t// SelectedUsernames represent the usernames of the organization members who should have access to codespaces in the organization.\n\t// Required when visibility is selected_members.\n\tSelectedUsernames []string `json:\"selected_usernames,omitzero\"`\n}\n\n// ListInOrg lists the codespaces associated to a specified organization.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-the-organization\n//\n//meta:operation GET /orgs/{org}/codespaces\nfunc (s *CodespacesService) ListInOrg(ctx context.Context, org string, opts *ListOptions) (*ListCodespaces, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/codespaces\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar codespaces *ListCodespaces\n\tresp, err := s.client.Do(ctx, req, &codespaces)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn codespaces, resp, nil\n}\n\n// SetOrgAccessControl sets which users can access codespaces in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/organizations#manage-access-control-for-organization-codespaces\n//\n//meta:operation PUT /orgs/{org}/codespaces/access\nfunc (s *CodespacesService) SetOrgAccessControl(ctx context.Context, org string, request CodespacesOrgAccessControlRequest) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/codespaces/access\", org)\n\treq, err := s.client.NewRequest(\"PUT\", u, request)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// AddUsersToOrgAccess adds users to Codespaces access for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/organizations#add-users-to-codespaces-access-for-an-organization\n//\n//meta:operation POST /orgs/{org}/codespaces/access/selected_users\nfunc (s *CodespacesService) AddUsersToOrgAccess(ctx context.Context, org string, usernames []string) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/codespaces/access/selected_users\", org)\n\treq, err := s.client.NewRequest(\"POST\", u, map[string][]string{\"selected_usernames\": usernames})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// RemoveUsersFromOrgAccess removes users from Codespaces access for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/organizations#remove-users-from-codespaces-access-for-an-organization\n//\n//meta:operation DELETE /orgs/{org}/codespaces/access/selected_users\nfunc (s *CodespacesService) RemoveUsersFromOrgAccess(ctx context.Context, org string, usernames []string) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/codespaces/access/selected_users\", org)\n\treq, err := s.client.NewRequest(\"DELETE\", u, map[string][]string{\"selected_usernames\": usernames})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// ListUserCodespacesInOrg lists the codespaces that a member of an organization has for repositories in that organization.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-a-user-in-organization\n//\n//meta:operation GET /orgs/{org}/members/{username}/codespaces\nfunc (s *CodespacesService) ListUserCodespacesInOrg(ctx context.Context, org, username string, opts *ListOptions) (*ListCodespaces, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/members/%v/codespaces\", org, username)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar codespaces *ListCodespaces\n\tresp, err := s.client.Do(ctx, req, &codespaces)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn codespaces, resp, nil\n}\n\n// DeleteUserCodespaceInOrg deletes a user's codespace from the organization.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/organizations#delete-a-codespace-from-the-organization\n//\n//meta:operation DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}\nfunc (s *CodespacesService) DeleteUserCodespaceInOrg(ctx context.Context, org, username, codespaceName string) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/members/%v/codespaces/%v\", org, username, codespaceName)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// StopUserCodespaceInOrg stops a codespace for an organization user.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/organizations#stop-a-codespace-for-an-organization-user\n//\n//meta:operation POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop\nfunc (s *CodespacesService) StopUserCodespaceInOrg(ctx context.Context, org, username, codespaceName string) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/members/%v/codespaces/%v/stop\", org, username, codespaceName)\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n"
  },
  {
    "path": "github/codespaces_orgs_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestCodespacesService_ListInOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o1/codespaces\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"total_count\":1,\"codespaces\":[{\"id\":1}]}`)\n\t})\n\n\topts := &ListOptions{Page: 1, PerPage: 10}\n\tctx := t.Context()\n\tgot, _, err := client.Codespaces.ListInOrg(ctx, \"o1\", opts)\n\tif err != nil {\n\t\tt.Fatalf(\"Codespaces.ListInOrg returned error: %v\", err)\n\t}\n\n\twant := &ListCodespaces{\n\t\tTotalCount: Ptr(1),\n\t\tCodespaces: []*Codespace{\n\t\t\t{ID: Ptr(int64(1))},\n\t\t},\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Codespaces.ListInOrg = %+v, want %+v\", got, want)\n\t}\n\tconst methodName = \"ListInOrg\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err := client.Codespaces.ListInOrg(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Codespaces.ListInOrg(ctx, \"o1\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodespacesService_SetOrgAccessControl(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o1/codespaces/access\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestBody(t, r, `{\"visibility\":\"selected_members\",\"selected_usernames\":[\"u1\",\"u2\"]}`+\"\\n\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\treq := CodespacesOrgAccessControlRequest{\n\t\tVisibility:        \"selected_members\",\n\t\tSelectedUsernames: []string{\"u1\", \"u2\"},\n\t}\n\n\t_, err := client.Codespaces.SetOrgAccessControl(ctx, \"o1\", req)\n\tif err != nil {\n\t\tt.Fatalf(\"Codespaces.SetOrgAccessControl returned error: %v\", err)\n\t}\n\n\tconst methodName = \"SetOrgAccessControl\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, err := client.Codespaces.SetOrgAccessControl(ctx, \"\\n\", req)\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Codespaces.SetOrgAccessControl(ctx, \"o1\", req)\n\t})\n}\n\nfunc TestEnterpriseService_AddUsersToOrgAccess(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o1/codespaces/access/selected_users\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestBody(t, r, `{\"selected_usernames\":[\"u1\"]}`+\"\\n\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\treq := []string{\"u1\"}\n\tresp, err := client.Codespaces.AddUsersToOrgAccess(ctx, \"o1\", req)\n\tif err != nil {\n\t\tt.Fatalf(\"AddUsersToOrgAccess returned error: %v\", err)\n\t}\n\tif resp == nil {\n\t\tt.Fatal(\"AddUsersToOrgAccess returned nil Response\")\n\t}\n\n\tconst methodName = \"AddUsersToOrgAccess\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, err := client.Codespaces.AddUsersToOrgAccess(ctx, \"\\n\", req)\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Codespaces.AddUsersToOrgAccess(ctx, \"o1\", req)\n\t})\n}\n\nfunc TestEnterpriseService_RemoveUsersFromOrgAccess(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o1/codespaces/access/selected_users\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestBody(t, r, `{\"selected_usernames\":[\"u1\"]}`+\"\\n\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\treq := []string{\"u1\"}\n\tresp, err := client.Codespaces.RemoveUsersFromOrgAccess(ctx, \"o1\", req)\n\tif err != nil {\n\t\tt.Fatalf(\"RemoveUsersFromOrgAccess returned error: %v\", err)\n\t}\n\tif resp == nil {\n\t\tt.Fatal(\"RemoveUsersFromOrgAccess returned nil Response\")\n\t}\n\n\tconst methodName = \"RemoveUsersFromOrgAccess\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, err := client.Codespaces.RemoveUsersFromOrgAccess(ctx, \"\\n\", req)\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Codespaces.RemoveUsersFromOrgAccess(ctx, \"o1\", req)\n\t})\n}\n\nfunc TestCodespacesService_ListUserCodespacesInOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o1/members/u1/codespaces\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"total_count\":1,\"codespaces\":[{\"id\":1}]}`)\n\t})\n\n\topts := &ListOptions{Page: 1, PerPage: 10}\n\tctx := t.Context()\n\tgot, _, err := client.Codespaces.ListUserCodespacesInOrg(ctx, \"o1\", \"u1\", opts)\n\tif err != nil {\n\t\tt.Fatalf(\"Codespaces.ListUserCodespacesInOrg returned error: %v\", err)\n\t}\n\n\twant := &ListCodespaces{\n\t\tTotalCount: Ptr(1),\n\t\tCodespaces: []*Codespace{\n\t\t\t{ID: Ptr(int64(1))},\n\t\t},\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Codespaces.ListUserCodespacesInOrg = %+v, want %+v\", got, want)\n\t}\n\tconst methodName = \"ListUserCodespacesInOrg\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err := client.Codespaces.ListUserCodespacesInOrg(ctx, \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Codespaces.ListUserCodespacesInOrg(ctx, \"o1\", \"u1\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_DeleteUserCodespaceInOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o1/members/u1/codespaces/c1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Codespaces.DeleteUserCodespaceInOrg(ctx, \"o1\", \"u1\", \"c1\")\n\tif err != nil {\n\t\tt.Fatalf(\"DeleteUserCodespaceInOrg returned error: %v\", err)\n\t}\n\tif resp == nil {\n\t\tt.Fatal(\"DeleteUserCodespaceInOrg returned nil Response\")\n\t}\n\n\tconst methodName = \"DeleteUserCodespaceInOrg\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, err := client.Codespaces.DeleteUserCodespaceInOrg(ctx, \"\\n\", \"u1\", \"c1\")\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Codespaces.DeleteUserCodespaceInOrg(ctx, \"o1\", \"u1\", \"c1\")\n\t})\n}\n\nfunc TestEnterpriseService_StopUserCodespaceInOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o1/members/u1/codespaces/c1/stop\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Codespaces.StopUserCodespaceInOrg(ctx, \"o1\", \"u1\", \"c1\")\n\tif err != nil {\n\t\tt.Fatalf(\"StopUserCodespaceInOrg returned error: %v\", err)\n\t}\n\tif resp == nil {\n\t\tt.Fatal(\"StopUserCodespaceInOrg returned nil Response\")\n\t}\n\n\tconst methodName = \"StopUserCodespaceInOrg\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, err := client.Codespaces.StopUserCodespaceInOrg(ctx, \"\\n\", \"u1\", \"c1\")\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Codespaces.StopUserCodespaceInOrg(ctx, \"o1\", \"u1\", \"c1\")\n\t})\n}\n"
  },
  {
    "path": "github/codespaces_secrets.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n)\n\n// ListUserSecrets list all secrets available for a users codespace\n//\n// Lists all secrets available for a user's Codespaces without revealing their encrypted values\n// 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\n// GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#list-secrets-for-the-authenticated-user\n//\n//meta:operation GET /user/codespaces/secrets\nfunc (s *CodespacesService) ListUserSecrets(ctx context.Context, opts *ListOptions) (*Secrets, *Response, error) {\n\tu, err := addOptions(\"user/codespaces/secrets\", opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treturn s.listSecrets(ctx, u)\n}\n\n// ListOrgSecrets list all secrets available to an org\n//\n// 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.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#list-organization-secrets\n//\n//meta:operation GET /orgs/{org}/codespaces/secrets\nfunc (s *CodespacesService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/codespaces/secrets\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treturn s.listSecrets(ctx, u)\n}\n\n// ListRepoSecrets list all secrets available to a repo\n//\n// 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.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#list-repository-secrets\n//\n//meta:operation GET /repos/{owner}/{repo}/codespaces/secrets\nfunc (s *CodespacesService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/codespaces/secrets\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treturn s.listSecrets(ctx, u)\n}\n\nfunc (s *CodespacesService) listSecrets(ctx context.Context, url string) (*Secrets, *Response, error) {\n\treq, err := s.client.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar secrets *Secrets\n\tresp, err := s.client.Do(ctx, req, &secrets)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn secrets, resp, nil\n}\n\n// GetUserPublicKey gets the users public key for encrypting codespace secrets\n//\n// Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets.\n// 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.\n// GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#get-public-key-for-the-authenticated-user\n//\n//meta:operation GET /user/codespaces/secrets/public-key\nfunc (s *CodespacesService) GetUserPublicKey(ctx context.Context) (*PublicKey, *Response, error) {\n\treturn s.getPublicKey(ctx, \"user/codespaces/secrets/public-key\")\n}\n\n// GetOrgPublicKey gets the org public key for encrypting codespace secrets\n//\n// 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.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-public-key\n//\n//meta:operation GET /orgs/{org}/codespaces/secrets/public-key\nfunc (s *CodespacesService) GetOrgPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error) {\n\treturn s.getPublicKey(ctx, fmt.Sprintf(\"orgs/%v/codespaces/secrets/public-key\", org))\n}\n\n// GetRepoPublicKey gets the repo public key for encrypting codespace secrets\n//\n// 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.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#get-a-repository-public-key\n//\n//meta:operation GET /repos/{owner}/{repo}/codespaces/secrets/public-key\nfunc (s *CodespacesService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error) {\n\treturn s.getPublicKey(ctx, fmt.Sprintf(\"repos/%v/%v/codespaces/secrets/public-key\", owner, repo))\n}\n\nfunc (s *CodespacesService) getPublicKey(ctx context.Context, url string) (*PublicKey, *Response, error) {\n\treq, err := s.client.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar publicKey *PublicKey\n\tresp, err := s.client.Do(ctx, req, &publicKey)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn publicKey, resp, nil\n}\n\n// GetUserSecret gets a users codespace secret\n//\n// Gets a secret available to a user's codespaces without revealing its encrypted value.\n// 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.\n// GitHub Apps must have read access to the codespaces_user_secrets user permission to use this endpoint.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#get-a-secret-for-the-authenticated-user\n//\n//meta:operation GET /user/codespaces/secrets/{secret_name}\nfunc (s *CodespacesService) GetUserSecret(ctx context.Context, name string) (*Secret, *Response, error) {\n\tu := fmt.Sprintf(\"user/codespaces/secrets/%v\", name)\n\treturn s.getSecret(ctx, u)\n}\n\n// GetOrgSecret gets an org codespace secret\n//\n// 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.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-secret\n//\n//meta:operation GET /orgs/{org}/codespaces/secrets/{secret_name}\nfunc (s *CodespacesService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/codespaces/secrets/%v\", org, name)\n\treturn s.getSecret(ctx, u)\n}\n\n// GetRepoSecret gets a repo codespace secret\n//\n// 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.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#get-a-repository-secret\n//\n//meta:operation GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}\nfunc (s *CodespacesService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/codespaces/secrets/%v\", owner, repo, name)\n\treturn s.getSecret(ctx, u)\n}\n\nfunc (s *CodespacesService) getSecret(ctx context.Context, url string) (*Secret, *Response, error) {\n\treq, err := s.client.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar secret *Secret\n\tresp, err := s.client.Do(ctx, req, &secret)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn secret, resp, nil\n}\n\n// CreateOrUpdateUserSecret creates or updates a users codespace secret\n//\n// Creates or updates a secret for a user's codespace with an encrypted value. Encrypt your secret using LibSodium.\n// 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.\n// 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.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#create-or-update-a-secret-for-the-authenticated-user\n//\n//meta:operation PUT /user/codespaces/secrets/{secret_name}\nfunc (s *CodespacesService) CreateOrUpdateUserSecret(ctx context.Context, eSecret *EncryptedSecret) (*Response, error) {\n\tif eSecret == nil {\n\t\treturn nil, errors.New(\"encrypted secret must be provided\")\n\t}\n\n\tu := fmt.Sprintf(\"user/codespaces/secrets/%v\", eSecret.Name)\n\treturn s.createOrUpdateSecret(ctx, u, eSecret)\n}\n\n// CreateOrUpdateOrgSecret creates or updates an orgs codespace secret\n//\n// 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.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#create-or-update-an-organization-secret\n//\n//meta:operation PUT /orgs/{org}/codespaces/secrets/{secret_name}\nfunc (s *CodespacesService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *EncryptedSecret) (*Response, error) {\n\tif eSecret == nil {\n\t\treturn nil, errors.New(\"encrypted secret must be provided\")\n\t}\n\n\tu := fmt.Sprintf(\"orgs/%v/codespaces/secrets/%v\", org, eSecret.Name)\n\treturn s.createOrUpdateSecret(ctx, u, eSecret)\n}\n\n// CreateOrUpdateRepoSecret creates or updates a repos codespace secret\n//\n// 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.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#create-or-update-a-repository-secret\n//\n//meta:operation PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}\nfunc (s *CodespacesService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *EncryptedSecret) (*Response, error) {\n\tif eSecret == nil {\n\t\treturn nil, errors.New(\"encrypted secret must be provided\")\n\t}\n\n\tu := fmt.Sprintf(\"repos/%v/%v/codespaces/secrets/%v\", owner, repo, eSecret.Name)\n\treturn s.createOrUpdateSecret(ctx, u, eSecret)\n}\n\nfunc (s *CodespacesService) createOrUpdateSecret(ctx context.Context, url string, eSecret *EncryptedSecret) (*Response, error) {\n\treq, err := s.client.NewRequest(\"PUT\", url, eSecret)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// DeleteUserSecret deletes a users codespace secret\n//\n// Deletes a secret from a user's codespaces using the secret name. Deleting the secret will remove access from all codespaces that were allowed to access the secret.\n// 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.\n// GitHub Apps must have write access to the codespaces_user_secrets user permission to use this endpoint.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#delete-a-secret-for-the-authenticated-user\n//\n//meta:operation DELETE /user/codespaces/secrets/{secret_name}\nfunc (s *CodespacesService) DeleteUserSecret(ctx context.Context, name string) (*Response, error) {\n\tu := fmt.Sprintf(\"user/codespaces/secrets/%v\", name)\n\treturn s.deleteSecret(ctx, u)\n}\n\n// DeleteOrgSecret deletes an orgs codespace secret\n//\n// Deletes an organization secret using the secret name. You must authenticate using an access token with the admin:org scope to use this endpoint.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#delete-an-organization-secret\n//\n//meta:operation DELETE /orgs/{org}/codespaces/secrets/{secret_name}\nfunc (s *CodespacesService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/codespaces/secrets/%v\", org, name)\n\treturn s.deleteSecret(ctx, u)\n}\n\n// DeleteRepoSecret deletes a repos codespace secret\n//\n// 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.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/repository-secrets#delete-a-repository-secret\n//\n//meta:operation DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}\nfunc (s *CodespacesService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/codespaces/secrets/%v\", owner, repo, name)\n\treturn s.deleteSecret(ctx, u)\n}\n\nfunc (s *CodespacesService) deleteSecret(ctx context.Context, url string) (*Response, error) {\n\treq, err := s.client.NewRequest(\"DELETE\", url, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// ListSelectedReposForUserSecret lists the repositories that have been granted the ability to use a user's codespace secret.\n//\n// 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.\n// 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.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#list-selected-repositories-for-a-user-secret\n//\n//meta:operation GET /user/codespaces/secrets/{secret_name}/repositories\nfunc (s *CodespacesService) ListSelectedReposForUserSecret(ctx context.Context, name string, opts *ListOptions) (*SelectedReposList, *Response, error) {\n\tu := fmt.Sprintf(\"user/codespaces/secrets/%v/repositories\", name)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treturn s.listSelectedReposForSecret(ctx, u)\n}\n\n// ListSelectedReposForOrgSecret lists the repositories that have been granted the ability to use an organization's codespace secret.\n//\n// 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.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#list-selected-repositories-for-an-organization-secret\n//\n//meta:operation GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories\nfunc (s *CodespacesService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/codespaces/secrets/%v/repositories\", org, name)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treturn s.listSelectedReposForSecret(ctx, u)\n}\n\nfunc (s *CodespacesService) listSelectedReposForSecret(ctx context.Context, url string) (*SelectedReposList, *Response, error) {\n\treq, err := s.client.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar repositories *SelectedReposList\n\tresp, err := s.client.Do(ctx, req, &repositories)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn repositories, resp, nil\n}\n\n// SetSelectedReposForUserSecret sets the repositories that have been granted the ability to use a user's codespace secret.\n//\n// 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.\n// 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.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#set-selected-repositories-for-a-user-secret\n//\n//meta:operation PUT /user/codespaces/secrets/{secret_name}/repositories\nfunc (s *CodespacesService) SetSelectedReposForUserSecret(ctx context.Context, name string, ids SelectedRepoIDs) (*Response, error) {\n\tu := fmt.Sprintf(\"user/codespaces/secrets/%v/repositories\", name)\n\treturn s.setSelectedRepoForSecret(ctx, u, ids)\n}\n\n// SetSelectedReposForOrgSecret sets the repositories that have been granted the ability to use a user's codespace secret.\n//\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.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#set-selected-repositories-for-an-organization-secret\n//\n//meta:operation PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories\nfunc (s *CodespacesService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids SelectedRepoIDs) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/codespaces/secrets/%v/repositories\", org, name)\n\treturn s.setSelectedRepoForSecret(ctx, u, ids)\n}\n\nfunc (s *CodespacesService) setSelectedRepoForSecret(ctx context.Context, url string, ids SelectedRepoIDs) (*Response, error) {\n\ttype repoIDs struct {\n\t\tSelectedIDs SelectedRepoIDs `json:\"selected_repository_ids\"`\n\t}\n\n\treq, err := s.client.NewRequest(\"PUT\", url, repoIDs{SelectedIDs: ids})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// AddSelectedRepoToUserSecret adds a repository to the list of repositories that have been granted the ability to use a user's codespace secret.\n//\n// 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.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#add-a-selected-repository-to-a-user-secret\n//\n//meta:operation PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}\nfunc (s *CodespacesService) AddSelectedRepoToUserSecret(ctx context.Context, name string, repo *Repository) (*Response, error) {\n\tif repo == nil {\n\t\treturn nil, errors.New(\"repository must be provided\")\n\t}\n\tif repo.ID == nil {\n\t\treturn nil, errors.New(\"id must be provided\")\n\t}\n\n\tu := fmt.Sprintf(\"user/codespaces/secrets/%v/repositories/%v\", name, *repo.ID)\n\treturn s.addSelectedRepoToSecret(ctx, u)\n}\n\n// AddSelectedRepoToOrgSecret adds a repository to the list of repositories that have been granted the ability to use an organization's codespace secret.\n//\n// 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.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#add-selected-repository-to-an-organization-secret\n//\n//meta:operation PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}\nfunc (s *CodespacesService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) {\n\tif repo == nil {\n\t\treturn nil, errors.New(\"repository must be provided\")\n\t}\n\tif repo.ID == nil {\n\t\treturn nil, errors.New(\"id must be provided\")\n\t}\n\n\tu := fmt.Sprintf(\"orgs/%v/codespaces/secrets/%v/repositories/%v\", org, name, *repo.ID)\n\treturn s.addSelectedRepoToSecret(ctx, u)\n}\n\nfunc (s *CodespacesService) addSelectedRepoToSecret(ctx context.Context, url string) (*Response, error) {\n\treq, err := s.client.NewRequest(\"PUT\", url, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// RemoveSelectedRepoFromUserSecret removes a repository from the list of repositories that have been granted the ability to use a user's codespace secret.\n//\n// 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.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/secrets#remove-a-selected-repository-from-a-user-secret\n//\n//meta:operation DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}\nfunc (s *CodespacesService) RemoveSelectedRepoFromUserSecret(ctx context.Context, name string, repo *Repository) (*Response, error) {\n\tif repo == nil {\n\t\treturn nil, errors.New(\"repository must be provided\")\n\t}\n\tif repo.ID == nil {\n\t\treturn nil, errors.New(\"id must be provided\")\n\t}\n\n\tu := fmt.Sprintf(\"user/codespaces/secrets/%v/repositories/%v\", name, *repo.ID)\n\treturn s.removeSelectedRepoFromSecret(ctx, u)\n}\n\n// RemoveSelectedRepoFromOrgSecret removes a repository from the list of repositories that have been granted the ability to use an organization's codespace secret.\n//\n// 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.\n//\n// GitHub API docs: https://docs.github.com/rest/codespaces/organization-secrets#remove-selected-repository-from-an-organization-secret\n//\n//meta:operation DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}\nfunc (s *CodespacesService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) {\n\tif repo == nil {\n\t\treturn nil, errors.New(\"repository must be provided\")\n\t}\n\tif repo.ID == nil {\n\t\treturn nil, errors.New(\"id must be provided\")\n\t}\n\n\tu := fmt.Sprintf(\"orgs/%v/codespaces/secrets/%v/repositories/%v\", org, name, *repo.ID)\n\treturn s.removeSelectedRepoFromSecret(ctx, u)\n}\n\nfunc (s *CodespacesService) removeSelectedRepoFromSecret(ctx context.Context, url string) (*Response, error) {\n\treq, err := s.client.NewRequest(\"DELETE\", url, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n"
  },
  {
    "path": "github/codespaces_secrets_test.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestCodespacesService_ListSecrets(t *testing.T) {\n\tt.Parallel()\n\ttype test struct {\n\t\tname       string\n\t\thandleFunc func(*http.ServeMux)\n\t\tcall       func(context.Context, *Client) (*Secrets, *Response, error)\n\t\tbadCall    func(context.Context, *Client) (*Secrets, *Response, error)\n\t\tmethodName string\n\t}\n\topts := &ListOptions{Page: 2, PerPage: 2}\n\ttests := []*test{\n\t\t{\n\t\t\tname: \"User\",\n\t\t\thandleFunc: func(mux *http.ServeMux) {\n\t\t\t\tmux.HandleFunc(\"/user/codespaces/secrets\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\"})\n\t\t\t\t\tfmt.Fprint(w, `{\"total_count\":4,\"secrets\":[{\"name\":\"A\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"},{\"name\":\"B\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"}]}`)\n\t\t\t\t})\n\t\t\t},\n\t\t\tcall: func(ctx context.Context, client *Client) (*Secrets, *Response, error) {\n\t\t\t\treturn client.Codespaces.ListUserSecrets(ctx, opts)\n\t\t\t},\n\t\t\tmethodName: \"ListUserSecrets\",\n\t\t},\n\t\t{\n\t\t\tname: \"Org\",\n\t\t\thandleFunc: func(mux *http.ServeMux) {\n\t\t\t\tmux.HandleFunc(\"/orgs/o/codespaces/secrets\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\"})\n\t\t\t\t\tfmt.Fprint(w, `{\"total_count\":4,\"secrets\":[{\"name\":\"A\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"},{\"name\":\"B\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"}]}`)\n\t\t\t\t})\n\t\t\t},\n\t\t\tcall: func(ctx context.Context, client *Client) (*Secrets, *Response, error) {\n\t\t\t\treturn client.Codespaces.ListOrgSecrets(ctx, \"o\", opts)\n\t\t\t},\n\t\t\tbadCall: func(ctx context.Context, client *Client) (*Secrets, *Response, error) {\n\t\t\t\treturn client.Codespaces.ListOrgSecrets(ctx, \"\\n\", opts)\n\t\t\t},\n\t\t\tmethodName: \"ListOrgSecrets\",\n\t\t},\n\t\t{\n\t\t\tname: \"Repo\",\n\t\t\thandleFunc: func(mux *http.ServeMux) {\n\t\t\t\tmux.HandleFunc(\"/repos/o/r/codespaces/secrets\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\"})\n\t\t\t\t\tfmt.Fprint(w, `{\"total_count\":4,\"secrets\":[{\"name\":\"A\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"},{\"name\":\"B\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"}]}`)\n\t\t\t\t})\n\t\t\t},\n\t\t\tcall: func(ctx context.Context, client *Client) (*Secrets, *Response, error) {\n\t\t\t\treturn client.Codespaces.ListRepoSecrets(ctx, \"o\", \"r\", opts)\n\t\t\t},\n\t\t\tbadCall: func(ctx context.Context, client *Client) (*Secrets, *Response, error) {\n\t\t\t\treturn client.Codespaces.ListRepoSecrets(ctx, \"\\n\", \"\\n\", opts)\n\t\t\t},\n\t\t\tmethodName: \"ListRepoSecrets\",\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\ttt.handleFunc(mux)\n\n\t\t\tctx := t.Context()\n\t\t\tsecrets, _, err := tt.call(ctx, client)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Codespaces.%v returned error: %v\", tt.methodName, err)\n\t\t\t}\n\n\t\t\twant := &Secrets{\n\t\t\t\tTotalCount: 4,\n\t\t\t\tSecrets: []*Secret{\n\t\t\t\t\t{Name: \"A\", CreatedAt: Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)}, UpdatedAt: Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)}},\n\t\t\t\t\t{Name: \"B\", CreatedAt: Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)}, UpdatedAt: Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)}},\n\t\t\t\t},\n\t\t\t}\n\t\t\tif !cmp.Equal(secrets, want) {\n\t\t\t\tt.Errorf(\"Codespaces.%v returned %+v, want %+v\", tt.methodName, secrets, want)\n\t\t\t}\n\n\t\t\tif tt.badCall != nil {\n\t\t\t\ttestBadOptions(t, tt.methodName, func() (err error) {\n\t\t\t\t\t_, _, err = tt.badCall(ctx, client)\n\t\t\t\t\treturn err\n\t\t\t\t})\n\t\t\t}\n\n\t\t\ttestNewRequestAndDoFailure(t, tt.methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := tt.call(ctx, client)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", tt.methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestCodespacesService_GetSecret(t *testing.T) {\n\tt.Parallel()\n\ttype test struct {\n\t\tname       string\n\t\thandleFunc func(*http.ServeMux)\n\t\tcall       func(context.Context, *Client) (*Secret, *Response, error)\n\t\tbadCall    func(context.Context, *Client) (*Secret, *Response, error)\n\t\tmethodName string\n\t}\n\ttests := []*test{\n\t\t{\n\t\t\tname: \"User\",\n\t\t\thandleFunc: func(mux *http.ServeMux) {\n\t\t\t\tmux.HandleFunc(\"/user/codespaces/secrets/NAME\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\t\tfmt.Fprint(w, `{\"name\":\"A\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"}`)\n\t\t\t\t})\n\t\t\t},\n\t\t\tcall: func(ctx context.Context, client *Client) (*Secret, *Response, error) {\n\t\t\t\treturn client.Codespaces.GetUserSecret(ctx, \"NAME\")\n\t\t\t},\n\t\t\tmethodName: \"GetUserSecret\",\n\t\t},\n\t\t{\n\t\t\tname: \"Org\",\n\t\t\thandleFunc: func(mux *http.ServeMux) {\n\t\t\t\tmux.HandleFunc(\"/orgs/o/codespaces/secrets/NAME\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\t\tfmt.Fprint(w, `{\"name\":\"A\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"}`)\n\t\t\t\t})\n\t\t\t},\n\t\t\tcall: func(ctx context.Context, client *Client) (*Secret, *Response, error) {\n\t\t\t\treturn client.Codespaces.GetOrgSecret(ctx, \"o\", \"NAME\")\n\t\t\t},\n\t\t\tbadCall: func(ctx context.Context, client *Client) (*Secret, *Response, error) {\n\t\t\t\treturn client.Codespaces.GetOrgSecret(ctx, \"\\n\", \"\\n\")\n\t\t\t},\n\t\t\tmethodName: \"GetOrgSecret\",\n\t\t},\n\t\t{\n\t\t\tname: \"Repo\",\n\t\t\thandleFunc: func(mux *http.ServeMux) {\n\t\t\t\tmux.HandleFunc(\"/repos/o/r/codespaces/secrets/NAME\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\t\tfmt.Fprint(w, `{\"name\":\"A\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"}`)\n\t\t\t\t})\n\t\t\t},\n\t\t\tcall: func(ctx context.Context, client *Client) (*Secret, *Response, error) {\n\t\t\t\treturn client.Codespaces.GetRepoSecret(ctx, \"o\", \"r\", \"NAME\")\n\t\t\t},\n\t\t\tbadCall: func(ctx context.Context, client *Client) (*Secret, *Response, error) {\n\t\t\t\treturn client.Codespaces.GetRepoSecret(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\t\t},\n\t\t\tmethodName: \"GetRepoSecret\",\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\ttt.handleFunc(mux)\n\n\t\t\tctx := t.Context()\n\t\t\tsecret, _, err := tt.call(ctx, client)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Codespaces.%v returned error: %v\", tt.methodName, err)\n\t\t\t}\n\n\t\t\twant := &Secret{Name: \"A\", CreatedAt: Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)}, UpdatedAt: Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)}}\n\t\t\tif !cmp.Equal(secret, want) {\n\t\t\t\tt.Errorf(\"Codespaces.%v returned %+v, want %+v\", tt.methodName, secret, want)\n\t\t\t}\n\n\t\t\tif tt.badCall != nil {\n\t\t\t\ttestBadOptions(t, tt.methodName, func() (err error) {\n\t\t\t\t\t_, _, err = tt.badCall(ctx, client)\n\t\t\t\t\treturn err\n\t\t\t\t})\n\t\t\t}\n\n\t\t\ttestNewRequestAndDoFailure(t, tt.methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := tt.call(ctx, client)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", tt.methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestCodespacesService_CreateOrUpdateSecret(t *testing.T) {\n\tt.Parallel()\n\ttype test struct {\n\t\tname       string\n\t\thandleFunc func(*http.ServeMux)\n\t\tcall       func(context.Context, *Client, *EncryptedSecret) (*Response, error)\n\t\tbadCall    func(context.Context, *Client, *EncryptedSecret) (*Response, error)\n\t\tmethodName string\n\t}\n\ttests := []*test{\n\t\t{\n\t\t\tname: \"User\",\n\t\t\thandleFunc: func(mux *http.ServeMux) {\n\t\t\t\tmux.HandleFunc(\"/user/codespaces/secrets/NAME\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\t\ttestMethod(t, r, \"PUT\")\n\t\t\t\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\t\t\t\ttestBody(t, r, `{\"key_id\":\"1234\",\"encrypted_value\":\"QIv=\"}`+\"\\n\")\n\t\t\t\t\tw.WriteHeader(http.StatusCreated)\n\t\t\t\t})\n\t\t\t},\n\t\t\tcall: func(ctx context.Context, client *Client, e *EncryptedSecret) (*Response, error) {\n\t\t\t\treturn client.Codespaces.CreateOrUpdateUserSecret(ctx, e)\n\t\t\t},\n\t\t\tbadCall: func(ctx context.Context, client *Client, _ *EncryptedSecret) (*Response, error) {\n\t\t\t\treturn client.Codespaces.CreateOrUpdateUserSecret(ctx, nil)\n\t\t\t},\n\t\t\tmethodName: \"CreateOrUpdateUserSecret\",\n\t\t},\n\t\t{\n\t\t\tname: \"Org\",\n\t\t\thandleFunc: func(mux *http.ServeMux) {\n\t\t\t\tmux.HandleFunc(\"/orgs/o/codespaces/secrets/NAME\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\t\ttestMethod(t, r, \"PUT\")\n\t\t\t\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\t\t\t\ttestBody(t, r, `{\"key_id\":\"1234\",\"encrypted_value\":\"QIv=\"}`+\"\\n\")\n\t\t\t\t\tw.WriteHeader(http.StatusCreated)\n\t\t\t\t})\n\t\t\t},\n\t\t\tcall: func(ctx context.Context, client *Client, e *EncryptedSecret) (*Response, error) {\n\t\t\t\treturn client.Codespaces.CreateOrUpdateOrgSecret(ctx, \"o\", e)\n\t\t\t},\n\t\t\tbadCall: func(ctx context.Context, client *Client, e *EncryptedSecret) (*Response, error) {\n\t\t\t\treturn client.Codespaces.CreateOrUpdateOrgSecret(ctx, \"\\n\", e)\n\t\t\t},\n\t\t\tmethodName: \"CreateOrUpdateOrgSecret\",\n\t\t},\n\t\t{\n\t\t\tname: \"Repo\",\n\t\t\thandleFunc: func(mux *http.ServeMux) {\n\t\t\t\tmux.HandleFunc(\"/repos/o/r/codespaces/secrets/NAME\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\t\ttestMethod(t, r, \"PUT\")\n\t\t\t\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\t\t\t\ttestBody(t, r, `{\"key_id\":\"1234\",\"encrypted_value\":\"QIv=\"}`+\"\\n\")\n\t\t\t\t\tw.WriteHeader(http.StatusCreated)\n\t\t\t\t})\n\t\t\t},\n\t\t\tcall: func(ctx context.Context, client *Client, e *EncryptedSecret) (*Response, error) {\n\t\t\t\treturn client.Codespaces.CreateOrUpdateRepoSecret(ctx, \"o\", \"r\", e)\n\t\t\t},\n\t\t\tbadCall: func(ctx context.Context, client *Client, e *EncryptedSecret) (*Response, error) {\n\t\t\t\treturn client.Codespaces.CreateOrUpdateRepoSecret(ctx, \"\\n\", \"\\n\", e)\n\t\t\t},\n\t\t\tmethodName: \"CreateOrUpdateRepoSecret\",\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\ttt.handleFunc(mux)\n\n\t\t\tinput := &EncryptedSecret{\n\t\t\t\tName:           \"NAME\",\n\t\t\t\tEncryptedValue: \"QIv=\",\n\t\t\t\tKeyID:          \"1234\",\n\t\t\t}\n\t\t\tctx := t.Context()\n\t\t\t_, err := tt.call(ctx, client, input)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Codespaces.%v returned error: %v\", tt.methodName, err)\n\t\t\t}\n\n\t\t\tif tt.badCall != nil {\n\t\t\t\ttestBadOptions(t, tt.methodName, func() (err error) {\n\t\t\t\t\t_, err = tt.badCall(ctx, client, input)\n\t\t\t\t\treturn err\n\t\t\t\t})\n\t\t\t}\n\n\t\t\ttestNewRequestAndDoFailure(t, tt.methodName, client, func() (*Response, error) {\n\t\t\t\treturn tt.call(ctx, client, input)\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestCodespacesService_DeleteSecret(t *testing.T) {\n\tt.Parallel()\n\ttype test struct {\n\t\tname       string\n\t\thandleFunc func(*http.ServeMux)\n\t\tcall       func(context.Context, *Client) (*Response, error)\n\t\tbadCall    func(context.Context, *Client) (*Response, error)\n\t\tmethodName string\n\t}\n\ttests := []*test{\n\t\t{\n\t\t\tname: \"User\",\n\t\t\thandleFunc: func(mux *http.ServeMux) {\n\t\t\t\tmux.HandleFunc(\"/user/codespaces/secrets/NAME\", func(_ http.ResponseWriter, r *http.Request) {\n\t\t\t\t\ttestMethod(t, r, \"DELETE\")\n\t\t\t\t})\n\t\t\t},\n\t\t\tcall: func(ctx context.Context, client *Client) (*Response, error) {\n\t\t\t\treturn client.Codespaces.DeleteUserSecret(ctx, \"NAME\")\n\t\t\t},\n\t\t\tmethodName: \"DeleteUserSecret\",\n\t\t},\n\t\t{\n\t\t\tname: \"Org\",\n\t\t\thandleFunc: func(mux *http.ServeMux) {\n\t\t\t\tmux.HandleFunc(\"/orgs/o/codespaces/secrets/NAME\", func(_ http.ResponseWriter, r *http.Request) {\n\t\t\t\t\ttestMethod(t, r, \"DELETE\")\n\t\t\t\t})\n\t\t\t},\n\t\t\tcall: func(ctx context.Context, client *Client) (*Response, error) {\n\t\t\t\treturn client.Codespaces.DeleteOrgSecret(ctx, \"o\", \"NAME\")\n\t\t\t},\n\t\t\tbadCall: func(ctx context.Context, client *Client) (*Response, error) {\n\t\t\t\treturn client.Codespaces.DeleteOrgSecret(ctx, \"\\n\", \"\\n\")\n\t\t\t},\n\t\t\tmethodName: \"DeleteOrgSecret\",\n\t\t},\n\t\t{\n\t\t\tname: \"Repo\",\n\t\t\thandleFunc: func(mux *http.ServeMux) {\n\t\t\t\tmux.HandleFunc(\"/repos/o/r/codespaces/secrets/NAME\", func(_ http.ResponseWriter, r *http.Request) {\n\t\t\t\t\ttestMethod(t, r, \"DELETE\")\n\t\t\t\t})\n\t\t\t},\n\t\t\tcall: func(ctx context.Context, client *Client) (*Response, error) {\n\t\t\t\treturn client.Codespaces.DeleteRepoSecret(ctx, \"o\", \"r\", \"NAME\")\n\t\t\t},\n\t\t\tbadCall: func(ctx context.Context, client *Client) (*Response, error) {\n\t\t\t\treturn client.Codespaces.DeleteRepoSecret(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\t\t},\n\t\t\tmethodName: \"DeleteRepoSecret\",\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\ttt.handleFunc(mux)\n\n\t\t\tctx := t.Context()\n\t\t\t_, err := tt.call(ctx, client)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Codespaces.%v returned error: %v\", tt.methodName, err)\n\t\t\t}\n\n\t\t\tif tt.badCall != nil {\n\t\t\t\ttestBadOptions(t, tt.methodName, func() (err error) {\n\t\t\t\t\t_, err = tt.badCall(ctx, client)\n\t\t\t\t\treturn err\n\t\t\t\t})\n\t\t\t}\n\n\t\t\ttestNewRequestAndDoFailure(t, tt.methodName, client, func() (*Response, error) {\n\t\t\t\treturn tt.call(ctx, client)\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestCodespacesService_GetPublicKey(t *testing.T) {\n\tt.Parallel()\n\ttype test struct {\n\t\tname       string\n\t\thandleFunc func(*http.ServeMux)\n\t\tcall       func(context.Context, *Client) (*PublicKey, *Response, error)\n\t\tbadCall    func(context.Context, *Client) (*PublicKey, *Response, error)\n\t\tmethodName string\n\t}\n\n\ttests := []*test{\n\t\t{\n\t\t\tname: \"User\",\n\t\t\thandleFunc: func(mux *http.ServeMux) {\n\t\t\t\tmux.HandleFunc(\"/user/codespaces/secrets/public-key\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\t\tfmt.Fprint(w, `{\"key_id\":\"1234\",\"key\":\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\"}`)\n\t\t\t\t})\n\t\t\t},\n\t\t\tcall: func(ctx context.Context, client *Client) (*PublicKey, *Response, error) {\n\t\t\t\treturn client.Codespaces.GetUserPublicKey(ctx)\n\t\t\t},\n\t\t\tmethodName: \"GetUserPublicKey\",\n\t\t},\n\t\t{\n\t\t\tname: \"Org\",\n\t\t\thandleFunc: func(mux *http.ServeMux) {\n\t\t\t\tmux.HandleFunc(\"/orgs/o/codespaces/secrets/public-key\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\t\tfmt.Fprint(w, `{\"key_id\":\"1234\",\"key\":\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\"}`)\n\t\t\t\t})\n\t\t\t},\n\t\t\tcall: func(ctx context.Context, client *Client) (*PublicKey, *Response, error) {\n\t\t\t\treturn client.Codespaces.GetOrgPublicKey(ctx, \"o\")\n\t\t\t},\n\t\t\tbadCall: func(ctx context.Context, client *Client) (*PublicKey, *Response, error) {\n\t\t\t\treturn client.Codespaces.GetOrgPublicKey(ctx, \"\\n\")\n\t\t\t},\n\t\t\tmethodName: \"GetOrgPublicKey\",\n\t\t},\n\t\t{\n\t\t\tname: \"Repo\",\n\t\t\thandleFunc: func(mux *http.ServeMux) {\n\t\t\t\tmux.HandleFunc(\"/repos/o/r/codespaces/secrets/public-key\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\t\tfmt.Fprint(w, `{\"key_id\":\"1234\",\"key\":\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\"}`)\n\t\t\t\t})\n\t\t\t},\n\t\t\tcall: func(ctx context.Context, client *Client) (*PublicKey, *Response, error) {\n\t\t\t\treturn client.Codespaces.GetRepoPublicKey(ctx, \"o\", \"r\")\n\t\t\t},\n\t\t\tbadCall: func(ctx context.Context, client *Client) (*PublicKey, *Response, error) {\n\t\t\t\treturn client.Codespaces.GetRepoPublicKey(ctx, \"\\n\", \"\\n\")\n\t\t\t},\n\t\t\tmethodName: \"GetRepoPublicKey\",\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\ttt.handleFunc(mux)\n\n\t\t\tctx := t.Context()\n\t\t\tkey, _, err := tt.call(ctx, client)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Codespaces.%v returned error: %v\", tt.methodName, err)\n\t\t\t}\n\n\t\t\twant := &PublicKey{KeyID: Ptr(\"1234\"), Key: Ptr(\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\")}\n\t\t\tif !cmp.Equal(key, want) {\n\t\t\t\tt.Errorf(\"Codespaces.%v returned %+v, want %+v\", tt.methodName, key, want)\n\t\t\t}\n\n\t\t\tif tt.badCall != nil {\n\t\t\t\ttestBadOptions(t, tt.methodName, func() (err error) {\n\t\t\t\t\t_, _, err = tt.badCall(ctx, client)\n\t\t\t\t\treturn err\n\t\t\t\t})\n\t\t\t}\n\n\t\t\ttestNewRequestAndDoFailure(t, tt.methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := tt.call(ctx, client)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", tt.methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestCodespacesService_ListSelectedReposForSecret(t *testing.T) {\n\tt.Parallel()\n\ttype test struct {\n\t\tname       string\n\t\thandleFunc func(*http.ServeMux)\n\t\tcall       func(context.Context, *Client) (*SelectedReposList, *Response, error)\n\t\tbadCall    func(context.Context, *Client) (*SelectedReposList, *Response, error)\n\t\tmethodName string\n\t}\n\topts := &ListOptions{Page: 2, PerPage: 2}\n\ttests := []*test{\n\t\t{\n\t\t\tname: \"User\",\n\t\t\thandleFunc: func(mux *http.ServeMux) {\n\t\t\t\tmux.HandleFunc(\"/user/codespaces/secrets/NAME/repositories\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\t\tfmt.Fprint(w, `{\"total_count\":1,\"repositories\":[{\"id\":1}]}`)\n\t\t\t\t})\n\t\t\t},\n\t\t\tcall: func(ctx context.Context, client *Client) (*SelectedReposList, *Response, error) {\n\t\t\t\treturn client.Codespaces.ListSelectedReposForUserSecret(ctx, \"NAME\", opts)\n\t\t\t},\n\t\t\tmethodName: \"ListSelectedReposForUserSecret\",\n\t\t},\n\t\t{\n\t\t\tname: \"Org\",\n\t\t\thandleFunc: func(mux *http.ServeMux) {\n\t\t\t\tmux.HandleFunc(\"/orgs/o/codespaces/secrets/NAME/repositories\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\t\tfmt.Fprint(w, `{\"total_count\":1,\"repositories\":[{\"id\":1}]}`)\n\t\t\t\t})\n\t\t\t},\n\t\t\tcall: func(ctx context.Context, client *Client) (*SelectedReposList, *Response, error) {\n\t\t\t\treturn client.Codespaces.ListSelectedReposForOrgSecret(ctx, \"o\", \"NAME\", opts)\n\t\t\t},\n\t\t\tbadCall: func(ctx context.Context, client *Client) (*SelectedReposList, *Response, error) {\n\t\t\t\treturn client.Codespaces.ListSelectedReposForOrgSecret(ctx, \"\\n\", \"\\n\", opts)\n\t\t\t},\n\t\t\tmethodName: \"ListSelectedReposForOrgSecret\",\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\ttt.handleFunc(mux)\n\n\t\t\tctx := t.Context()\n\t\t\trepos, _, err := tt.call(ctx, client)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Codespaces.%v returned error: %v\", tt.methodName, err)\n\t\t\t}\n\n\t\t\twant := &SelectedReposList{\n\t\t\t\tTotalCount: Ptr(1),\n\t\t\t\tRepositories: []*Repository{\n\t\t\t\t\t{ID: Ptr(int64(1))},\n\t\t\t\t},\n\t\t\t}\n\n\t\t\tif !cmp.Equal(repos, want) {\n\t\t\t\tt.Errorf(\"Codespaces.%v returned %+v, want %+v\", tt.methodName, repos, want)\n\t\t\t}\n\n\t\t\tif tt.badCall != nil {\n\t\t\t\ttestBadOptions(t, tt.methodName, func() (err error) {\n\t\t\t\t\t_, _, err = tt.badCall(ctx, client)\n\t\t\t\t\treturn err\n\t\t\t\t})\n\t\t\t}\n\n\t\t\ttestNewRequestAndDoFailure(t, tt.methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := tt.call(ctx, client)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", tt.methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestCodespacesService_SetSelectedReposForSecret(t *testing.T) {\n\tt.Parallel()\n\ttype test struct {\n\t\tname       string\n\t\thandleFunc func(*http.ServeMux)\n\t\tcall       func(context.Context, *Client) (*Response, error)\n\t\tbadCall    func(context.Context, *Client) (*Response, error)\n\t\tmethodName string\n\t}\n\tids := SelectedRepoIDs{64780797}\n\ttests := []*test{\n\t\t{\n\t\t\tname: \"User\",\n\t\t\thandleFunc: func(mux *http.ServeMux) {\n\t\t\t\tmux.HandleFunc(\"/user/codespaces/secrets/NAME/repositories\", func(_ http.ResponseWriter, r *http.Request) {\n\t\t\t\t\ttestMethod(t, r, \"PUT\")\n\t\t\t\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\t\t\t\ttestBody(t, r, `{\"selected_repository_ids\":[64780797]}`+\"\\n\")\n\t\t\t\t})\n\t\t\t},\n\t\t\tcall: func(ctx context.Context, client *Client) (*Response, error) {\n\t\t\t\treturn client.Codespaces.SetSelectedReposForUserSecret(ctx, \"NAME\", ids)\n\t\t\t},\n\t\t\tmethodName: \"SetSelectedReposForUserSecret\",\n\t\t},\n\t\t{\n\t\t\tname: \"Org\",\n\t\t\thandleFunc: func(mux *http.ServeMux) {\n\t\t\t\tmux.HandleFunc(\"/orgs/o/codespaces/secrets/NAME/repositories\", func(_ http.ResponseWriter, r *http.Request) {\n\t\t\t\t\ttestMethod(t, r, \"PUT\")\n\t\t\t\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\t\t\t\ttestBody(t, r, `{\"selected_repository_ids\":[64780797]}`+\"\\n\")\n\t\t\t\t})\n\t\t\t},\n\t\t\tcall: func(ctx context.Context, client *Client) (*Response, error) {\n\t\t\t\treturn client.Codespaces.SetSelectedReposForOrgSecret(ctx, \"o\", \"NAME\", ids)\n\t\t\t},\n\t\t\tbadCall: func(ctx context.Context, client *Client) (*Response, error) {\n\t\t\t\treturn client.Codespaces.SetSelectedReposForOrgSecret(ctx, \"\\n\", \"\\n\", ids)\n\t\t\t},\n\t\t\tmethodName: \"SetSelectedReposForOrgSecret\",\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\ttt.handleFunc(mux)\n\n\t\t\tctx := t.Context()\n\t\t\t_, err := tt.call(ctx, client)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Codespaces.%v returned error: %v\", tt.methodName, err)\n\t\t\t}\n\n\t\t\tif tt.badCall != nil {\n\t\t\t\ttestBadOptions(t, tt.methodName, func() (err error) {\n\t\t\t\t\t_, err = tt.badCall(ctx, client)\n\t\t\t\t\treturn err\n\t\t\t\t})\n\t\t\t}\n\n\t\t\ttestNewRequestAndDoFailure(t, tt.methodName, client, func() (*Response, error) {\n\t\t\t\treturn tt.call(ctx, client)\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestCodespacesService_AddSelectedReposForSecret(t *testing.T) {\n\tt.Parallel()\n\ttype test struct {\n\t\tname       string\n\t\thandleFunc func(*http.ServeMux)\n\t\tcall       func(context.Context, *Client) (*Response, error)\n\t\tbadCall    func(context.Context, *Client) (*Response, error)\n\t\tmethodName string\n\t}\n\trepo := &Repository{ID: Ptr(int64(1234))}\n\ttests := []*test{\n\t\t{\n\t\t\tname: \"User\",\n\t\t\thandleFunc: func(mux *http.ServeMux) {\n\t\t\t\tmux.HandleFunc(\"/user/codespaces/secrets/NAME/repositories/1234\", func(_ http.ResponseWriter, r *http.Request) {\n\t\t\t\t\ttestMethod(t, r, \"PUT\")\n\t\t\t\t})\n\t\t\t},\n\t\t\tcall: func(ctx context.Context, client *Client) (*Response, error) {\n\t\t\t\treturn client.Codespaces.AddSelectedRepoToUserSecret(ctx, \"NAME\", repo)\n\t\t\t},\n\t\t\tbadCall: func(ctx context.Context, client *Client) (*Response, error) {\n\t\t\t\treturn client.Codespaces.AddSelectedRepoToUserSecret(ctx, \"NAME\", &Repository{ID: nil})\n\t\t\t},\n\t\t\tmethodName: \"AddSelectedRepoToUserSecret\",\n\t\t},\n\t\t{\n\t\t\tname: \"Org\",\n\t\t\thandleFunc: func(mux *http.ServeMux) {\n\t\t\t\tmux.HandleFunc(\"/orgs/o/codespaces/secrets/NAME/repositories/1234\", func(_ http.ResponseWriter, r *http.Request) {\n\t\t\t\t\ttestMethod(t, r, \"PUT\")\n\t\t\t\t})\n\t\t\t},\n\t\t\tcall: func(ctx context.Context, client *Client) (*Response, error) {\n\t\t\t\treturn client.Codespaces.AddSelectedRepoToOrgSecret(ctx, \"o\", \"NAME\", repo)\n\t\t\t},\n\t\t\tbadCall: func(ctx context.Context, client *Client) (*Response, error) {\n\t\t\t\treturn client.Codespaces.AddSelectedRepoToOrgSecret(ctx, \"\\n\", \"\\n\", repo)\n\t\t\t},\n\t\t\tmethodName: \"AddSelectedRepoToOrgSecret\",\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\ttt.handleFunc(mux)\n\n\t\t\tctx := t.Context()\n\t\t\t_, err := tt.call(ctx, client)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Codespaces.%v returned error: %v\", tt.methodName, err)\n\t\t\t}\n\n\t\t\tif tt.badCall != nil {\n\t\t\t\ttestBadOptions(t, tt.methodName, func() (err error) {\n\t\t\t\t\t_, err = tt.badCall(ctx, client)\n\t\t\t\t\treturn err\n\t\t\t\t})\n\t\t\t}\n\n\t\t\ttestNewRequestAndDoFailure(t, tt.methodName, client, func() (*Response, error) {\n\t\t\t\treturn tt.call(ctx, client)\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestCodespacesService_RemoveSelectedReposFromSecret(t *testing.T) {\n\tt.Parallel()\n\ttype test struct {\n\t\tname       string\n\t\thandleFunc func(*http.ServeMux)\n\t\tcall       func(context.Context, *Client) (*Response, error)\n\t\tbadCall    func(context.Context, *Client) (*Response, error)\n\t\tmethodName string\n\t}\n\trepo := &Repository{ID: Ptr(int64(1234))}\n\ttests := []*test{\n\t\t{\n\t\t\tname: \"User\",\n\t\t\thandleFunc: func(mux *http.ServeMux) {\n\t\t\t\tmux.HandleFunc(\"/user/codespaces/secrets/NAME/repositories/1234\", func(_ http.ResponseWriter, r *http.Request) {\n\t\t\t\t\ttestMethod(t, r, \"DELETE\")\n\t\t\t\t})\n\t\t\t},\n\t\t\tcall: func(ctx context.Context, client *Client) (*Response, error) {\n\t\t\t\treturn client.Codespaces.RemoveSelectedRepoFromUserSecret(ctx, \"NAME\", repo)\n\t\t\t},\n\t\t\tbadCall: func(ctx context.Context, client *Client) (*Response, error) {\n\t\t\t\treturn client.Codespaces.RemoveSelectedRepoFromUserSecret(ctx, \"NAME\", nil)\n\t\t\t},\n\t\t\tmethodName: \"RemoveSelectedRepoFromUserSecret\",\n\t\t},\n\t\t{\n\t\t\tname: \"Org\",\n\t\t\thandleFunc: func(mux *http.ServeMux) {\n\t\t\t\tmux.HandleFunc(\"/orgs/o/codespaces/secrets/NAME/repositories/1234\", func(_ http.ResponseWriter, r *http.Request) {\n\t\t\t\t\ttestMethod(t, r, \"DELETE\")\n\t\t\t\t})\n\t\t\t},\n\t\t\tcall: func(ctx context.Context, client *Client) (*Response, error) {\n\t\t\t\treturn client.Codespaces.RemoveSelectedRepoFromOrgSecret(ctx, \"o\", \"NAME\", repo)\n\t\t\t},\n\t\t\tbadCall: func(ctx context.Context, client *Client) (*Response, error) {\n\t\t\t\treturn client.Codespaces.RemoveSelectedRepoFromOrgSecret(ctx, \"\\n\", \"\\n\", repo)\n\t\t\t},\n\t\t\tmethodName: \"RemoveSelectedRepoFromOrgSecret\",\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\ttt.handleFunc(mux)\n\n\t\t\tctx := t.Context()\n\t\t\t_, err := tt.call(ctx, client)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Codespaces.%v returned error: %v\", tt.methodName, err)\n\t\t\t}\n\n\t\t\tif tt.badCall != nil {\n\t\t\t\ttestBadOptions(t, tt.methodName, func() (err error) {\n\t\t\t\t\t_, err = tt.badCall(ctx, client)\n\t\t\t\t\treturn err\n\t\t\t\t})\n\t\t\t}\n\n\t\t\ttestNewRequestAndDoFailure(t, tt.methodName, client, func() (*Response, error) {\n\t\t\t\treturn tt.call(ctx, client)\n\t\t\t})\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "github/codespaces_test.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestCodespacesService_ListInRepo(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/owner/repo/codespaces\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\":     \"1\",\n\t\t\t\"per_page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `{\"total_count\":2,\"codespaces\":[{\"id\":1,\"name\":\"monalisa-octocat-hello-world-g4wpq6h95q\",\"environment_id\":\"26a7c758-7299-4a73-b978-5a92a7ae98a0\",\"owner\":{\"login\":\"octocat\"},\"billable_owner\":{\"login\":\"octocat\"},\"repository\":{\"id\":1296269},\"machine\":{\"name\":\"standardLinux\",\"display_name\":\"4 cores, 8 GB RAM, 64 GB storage\",\"operating_system\":\"linux\",\"storage_in_bytes\":68719476736,\"memory_in_bytes\":8589934592,\"cpus\":4},\"prebuild\":false,\"devcontainer_path\":\".devcontainer/devcontainer.json\",\"created_at\":\"2021-10-14T00:53:30-06:00\",\"updated_at\":\"2021-10-14T00:53:32-06:00\",\"last_used_at\":\"2021-10-14T00:53:30-06:00\",\"state\":\"Available\",\"url\":\"https://api.github.com/user/codespaces/monalisa-octocat-hello-world-g4wpq6h95q\",\"git_status\":{\"ahead\":0,\"behind\":0,\"has_unpushed_changes\":false,\"has_uncommitted_changes\":false,\"ref\":\"main\"},\"location\":\"WestUs2\",\"idle_timeout_minutes\":60,\"web_url\":\"https://monalisa-octocat-hello-world-g4wpq6h95q.github.dev\",\"machines_url\":\"https://api.github.com/user/codespaces/monalisa-octocat-hello-world-g4wpq6h95q/machines\",\"start_url\":\"https://api.github.com/user/codespaces/monalisa-octocat-hello-world-g4wpq6h95q/start\",\"stop_url\":\"https://api.github.com/user/codespaces/monalisa-octocat-hello-world-g4wpq6h95q/stop\",\"recent_folders\":[\"testfolder1\",\"testfolder2\"]},{\"id\":2}]}`)\n\t})\n\n\topt := &ListOptions{Page: 1, PerPage: 2}\n\tctx := t.Context()\n\tcodespaces, _, err := client.Codespaces.ListInRepo(ctx, \"owner\", \"repo\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Codespaces.ListInRepo returned error: %v\", err)\n\t}\n\n\twant := &ListCodespaces{TotalCount: Ptr(2), Codespaces: []*Codespace{\n\t\t{\n\t\t\tID:            Ptr(int64(1)),\n\t\t\tName:          Ptr(\"monalisa-octocat-hello-world-g4wpq6h95q\"),\n\t\t\tEnvironmentID: Ptr(\"26a7c758-7299-4a73-b978-5a92a7ae98a0\"),\n\t\t\tOwner: &User{\n\t\t\t\tLogin: Ptr(\"octocat\"),\n\t\t\t},\n\t\t\tBillableOwner: &User{\n\t\t\t\tLogin: Ptr(\"octocat\"),\n\t\t\t},\n\t\t\tRepository: &Repository{\n\t\t\t\tID: Ptr(int64(1296269)),\n\t\t\t},\n\t\t\tMachine: &CodespacesMachine{\n\t\t\t\tName:            Ptr(\"standardLinux\"),\n\t\t\t\tDisplayName:     Ptr(\"4 cores, 8 GB RAM, 64 GB storage\"),\n\t\t\t\tOperatingSystem: Ptr(\"linux\"),\n\t\t\t\tStorageInBytes:  Ptr(int64(68719476736)),\n\t\t\t\tMemoryInBytes:   Ptr(int64(8589934592)),\n\t\t\t\tCPUs:            Ptr(4),\n\t\t\t},\n\t\t\tPrebuild:         Ptr(false),\n\t\t\tDevcontainerPath: Ptr(\".devcontainer/devcontainer.json\"),\n\t\t\tCreatedAt:        &Timestamp{time.Date(2021, 10, 14, 0, 53, 30, 0, time.FixedZone(\"\", -6*60*60))},\n\t\t\tUpdatedAt:        &Timestamp{time.Date(2021, 10, 14, 0, 53, 32, 0, time.FixedZone(\"\", -6*60*60))},\n\t\t\tLastUsedAt:       &Timestamp{time.Date(2021, 10, 14, 0, 53, 30, 0, time.FixedZone(\"\", -6*60*60))},\n\t\t\tState:            Ptr(\"Available\"),\n\t\t\tURL:              Ptr(\"https://api.github.com/user/codespaces/monalisa-octocat-hello-world-g4wpq6h95q\"),\n\t\t\tGitStatus: &CodespacesGitStatus{\n\t\t\t\tAhead:                 Ptr(0),\n\t\t\t\tBehind:                Ptr(0),\n\t\t\t\tHasUnpushedChanges:    Ptr(false),\n\t\t\t\tHasUncommittedChanges: Ptr(false),\n\t\t\t\tRef:                   Ptr(\"main\"),\n\t\t\t},\n\t\t\tLocation:           Ptr(\"WestUs2\"),\n\t\t\tIdleTimeoutMinutes: Ptr(60),\n\t\t\tWebURL:             Ptr(\"https://monalisa-octocat-hello-world-g4wpq6h95q.github.dev\"),\n\t\t\tMachinesURL:        Ptr(\"https://api.github.com/user/codespaces/monalisa-octocat-hello-world-g4wpq6h95q/machines\"),\n\t\t\tStartURL:           Ptr(\"https://api.github.com/user/codespaces/monalisa-octocat-hello-world-g4wpq6h95q/start\"),\n\t\t\tStopURL:            Ptr(\"https://api.github.com/user/codespaces/monalisa-octocat-hello-world-g4wpq6h95q/stop\"),\n\t\t\tRecentFolders: []string{\n\t\t\t\t\"testfolder1\",\n\t\t\t\t\"testfolder2\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tID: Ptr(int64(2)),\n\t\t},\n\t}}\n\tif !cmp.Equal(codespaces, want) {\n\t\tt.Errorf(\"Codespaces.ListInRepo returned %+v, want %+v\", codespaces, want)\n\t}\n\n\tconst methodName = \"ListInRepo\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Codespaces.ListInRepo(ctx, \"\", \"\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodespacesService_List(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/codespaces\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\":          \"1\",\n\t\t\t\"per_page\":      \"2\",\n\t\t\t\"repository_id\": \"1296269\",\n\t\t})\n\t\tfmt.Fprint(w, `{\"total_count\":1,\"codespaces\":[{\"id\":1, \"repository\": {\"id\": 1296269}}]}`)\n\t})\n\n\topt := &ListCodespacesOptions{ListOptions: ListOptions{Page: 1, PerPage: 2}, RepositoryID: 1296269}\n\tctx := t.Context()\n\tcodespaces, _, err := client.Codespaces.List(ctx, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Codespaces.List returned error: %v\", err)\n\t}\n\n\twant := &ListCodespaces{TotalCount: Ptr(1), Codespaces: []*Codespace{\n\t\t{\n\t\t\tID: Ptr(int64(1)),\n\t\t\tRepository: &Repository{\n\t\t\t\tID: Ptr(int64(1296269)),\n\t\t\t},\n\t\t},\n\t}}\n\tif !cmp.Equal(codespaces, want) {\n\t\tt.Errorf(\"Codespaces.ListInRepo returned %+v, want %+v\", codespaces, want)\n\t}\n\n\tconst methodName = \"List\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Codespaces.List(ctx, nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodespacesService_CreateInRepo(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/owner/repo/codespaces\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\ttestBody(t, r, `{\"ref\":\"main\",\"geo\":\"WestUs2\",\"machine\":\"standardLinux\",\"idle_timeout_minutes\":60}`+\"\\n\")\n\t\tfmt.Fprint(w, `{\"id\":1, \"repository\": {\"id\": 1296269}}`)\n\t})\n\tinput := &CreateCodespaceOptions{\n\t\tRef:                Ptr(\"main\"),\n\t\tGeo:                Ptr(\"WestUs2\"),\n\t\tMachine:            Ptr(\"standardLinux\"),\n\t\tIdleTimeoutMinutes: Ptr(60),\n\t}\n\tctx := t.Context()\n\tcodespace, _, err := client.Codespaces.CreateInRepo(ctx, \"owner\", \"repo\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Codespaces.CreateInRepo returned error: %v\", err)\n\t}\n\twant := &Codespace{\n\t\tID: Ptr(int64(1)),\n\t\tRepository: &Repository{\n\t\t\tID: Ptr(int64(1296269)),\n\t\t},\n\t}\n\n\tif !cmp.Equal(codespace, want) {\n\t\tt.Errorf(\"Codespaces.CreateInRepo returned %+v, want %+v\", codespace, want)\n\t}\n\n\tconst methodName = \"CreateInRepo\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Codespaces.CreateInRepo(ctx, \"\\n\", \"\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Codespaces.CreateInRepo(ctx, \"o\", \"r\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodespacesService_Start(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/codespaces/codespace_1/start\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\"id\":1, \"repository\": {\"id\": 1296269}}`)\n\t})\n\tctx := t.Context()\n\tcodespace, _, err := client.Codespaces.Start(ctx, \"codespace_1\")\n\tif err != nil {\n\t\tt.Errorf(\"Codespaces.Start returned error: %v\", err)\n\t}\n\twant := &Codespace{\n\t\tID: Ptr(int64(1)),\n\t\tRepository: &Repository{\n\t\t\tID: Ptr(int64(1296269)),\n\t\t},\n\t}\n\n\tif !cmp.Equal(codespace, want) {\n\t\tt.Errorf(\"Codespaces.Start returned %+v, want %+v\", codespace, want)\n\t}\n\n\tconst methodName = \"Start\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Codespaces.Start(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Codespaces.Start(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodespacesService_Stop(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/codespaces/codespace_1/stop\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\"id\":1, \"repository\": {\"id\": 1296269}}`)\n\t})\n\tctx := t.Context()\n\tcodespace, _, err := client.Codespaces.Stop(ctx, \"codespace_1\")\n\tif err != nil {\n\t\tt.Errorf(\"Codespaces.Stop returned error: %v\", err)\n\t}\n\twant := &Codespace{\n\t\tID: Ptr(int64(1)),\n\t\tRepository: &Repository{\n\t\t\tID: Ptr(int64(1296269)),\n\t\t},\n\t}\n\n\tif !cmp.Equal(codespace, want) {\n\t\tt.Errorf(\"Codespaces.Stop returned %+v, want %+v\", codespace, want)\n\t}\n\n\tconst methodName = \"Stop\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Codespaces.Stop(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Codespaces.Stop(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodespacesService_Delete(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/codespaces/codespace_1\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Codespaces.Delete(ctx, \"codespace_1\")\n\tif err != nil {\n\t\tt.Errorf(\"Codespaces.Delete return error: %v\", err)\n\t}\n\n\tconst methodName = \"Delete\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Codespaces.Delete(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Codespaces.Delete(ctx, \"codespace_1\")\n\t})\n}\n\nfunc TestCodespacesService_ListDevContainerConfigurations(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/codespaces/devcontainers\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"total_count\": 1,\n\t\t\t\"devcontainers\": [{\n\t\t\t\t\"path\": \".devcontainer/foobar/devcontainer.json\",\n\t\t\t\t\"name\": \"foobar\",\n\t\t\t\t\"display_name\": \"foobar\"\n\t\t\t}]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\topts := &ListOptions{Page: 1, PerPage: 10}\n\n\tgot, _, err := client.Codespaces.ListDevContainerConfigurations(ctx, \"o\", \"r\", opts)\n\tif err != nil {\n\t\tt.Fatalf(\"Codespaces.ListDevContainerConfigurations returned error: %v\", err)\n\t}\n\n\twant := &DevContainerConfigurations{\n\t\tTotalCount: 1,\n\t\tDevcontainers: []*DevContainer{\n\t\t\t{\n\t\t\t\tPath:        \".devcontainer/foobar/devcontainer.json\",\n\t\t\t\tName:        Ptr(\"foobar\"),\n\t\t\t\tDisplayName: Ptr(\"foobar\"),\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Codespaces.ListDevContainerConfigurations = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ListDevContainerConfigurations\"\n\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err := client.Codespaces.ListDevContainerConfigurations(ctx, \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Codespaces.ListDevContainerConfigurations(ctx, \"e\", \"r\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodespacesService_GetDefaultAttributes(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/codespaces/new\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"billable_owner\": {\n\t\t\t\t\"login\": \"user1\",\n\t\t\t\t\"id\": 1001,\n\t\t\t\t\"url\": \"https://example.com/user1\"\n\t\t\t},\n\t\t\t\"defaults\": {\n\t\t\t\t\"devcontainer_path\": \".devcontainer/devcontainer.json\",\n\t\t\t\t\"location\": \"WestUs2\"\n\t\t\t}\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\n\topt := &CodespaceGetDefaultAttributesOptions{\n\t\tRef:      Ptr(\"main\"),\n\t\tClientIP: Ptr(\"1.2.3.4\"),\n\t}\n\n\tgot, _, err := client.Codespaces.GetDefaultAttributes(ctx, \"o\", \"r\", opt)\n\tif err != nil {\n\t\tt.Fatalf(\"Codespaces.GetDefaultAttributes returned error: %v\", err)\n\t}\n\n\twant := &CodespaceDefaultAttributes{\n\t\tBillableOwner: &User{\n\t\t\tLogin: Ptr(\"user1\"),\n\t\t\tID:    Ptr(int64(1001)),\n\t\t\tURL:   Ptr(\"https://example.com/user1\"),\n\t\t},\n\t\tDefaults: &CodespaceDefaults{\n\t\t\tDevcontainerPath: Ptr(\".devcontainer/devcontainer.json\"),\n\t\t\tLocation:         \"WestUs2\",\n\t\t},\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Codespaces.GetDefaultAttributes = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"GetDefaultAttributes\"\n\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err := client.Codespaces.GetDefaultAttributes(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Codespaces.GetDefaultAttributes(ctx, \"e\", \"r\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodespacesService_CheckPermissions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/codespaces/permissions_check\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"accepted\": true}`)\n\t})\n\n\tctx := t.Context()\n\thasPermission, _, err := client.Codespaces.CheckPermissions(ctx, \"o\", \"r\", \"main\", \"path\")\n\tif err != nil {\n\t\tt.Errorf(\"Codespaces.CheckPermissions returned error: %v\", err)\n\t}\n\n\twant := CodespacePermissions{Accepted: true}\n\tif !cmp.Equal(hasPermission, &want) {\n\t\tt.Errorf(\"Codespaces.CheckPermissions = %+v, want %+v\", hasPermission, want)\n\t}\n\n\tconst methodName = \"CheckPermissions\"\n\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err := client.Codespaces.CheckPermissions(ctx, \"\\n\", \"\\n\", \"main\", \"path\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Codespaces.CheckPermissions(ctx, \"o\", \"r\", \"main\", \"path\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodespacesService_CreateFromPullRequest(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/owner/repo/pulls/42/codespaces\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestBody(t, r, `{\"machine\":\"standardLinux\",\"idle_timeout_minutes\":60}`+\"\\n\")\n\t\tfmt.Fprint(w, `{\"id\":1, \"repository\": {\"id\": 1}}`)\n\t})\n\tinput := &CreateCodespaceOptions{\n\t\tMachine:            Ptr(\"standardLinux\"),\n\t\tIdleTimeoutMinutes: Ptr(60),\n\t}\n\tctx := t.Context()\n\tcodespace, _, err := client.Codespaces.CreateFromPullRequest(ctx, \"owner\", \"repo\", 42, input)\n\tif err != nil {\n\t\tt.Errorf(\"Codespaces.CreateFromPullRequest returned error: %v\", err)\n\t}\n\twant := &Codespace{\n\t\tID: Ptr(int64(1)),\n\t\tRepository: &Repository{\n\t\t\tID: Ptr(int64(1)),\n\t\t},\n\t}\n\n\tif !cmp.Equal(codespace, want) {\n\t\tt.Errorf(\"Codespaces.CreateFromPullRequest returned %+v, want %+v\", codespace, want)\n\t}\n\n\tconst methodName = \"CreateFromPullRequest\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Codespaces.CreateFromPullRequest(ctx, \"\\n\", \"\", 0, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Codespaces.CreateFromPullRequest(ctx, \"o\", \"r\", 42, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodespacesService_Create(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/codespaces\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestBody(\n\t\t\tt,\n\t\t\tr,\n\t\t\t`{\"pull_request\":null,\"repository_id\":111,\"ref\":\"main\",\"geo\":\"WestUs2\",\"machine\":\"standardLinux\",\"idle_timeout_minutes\":60}`+\"\\n\",\n\t\t)\n\t\tfmt.Fprint(w, `{\"id\":1,\"repository\":{\"id\":111}}`)\n\t})\n\n\topt := &CodespaceCreateForUserOptions{\n\t\tRef:                Ptr(\"main\"),\n\t\tGeo:                Ptr(\"WestUs2\"),\n\t\tMachine:            Ptr(\"standardLinux\"),\n\t\tIdleTimeoutMinutes: Ptr(60),\n\t\tRepositoryID:       int64(111),\n\t\tPullRequest:        nil,\n\t}\n\n\tctx := t.Context()\n\tcodespace, _, err := client.Codespaces.Create(\n\t\tctx,\n\t\topt,\n\t)\n\tif err != nil {\n\t\tt.Fatalf(\"Codespaces.Create returned error: %v\", err)\n\t}\n\n\twant := &Codespace{\n\t\tID: Ptr(int64(1)),\n\t\tRepository: &Repository{\n\t\t\tID: Ptr(int64(111)),\n\t\t},\n\t}\n\n\tif !cmp.Equal(codespace, want) {\n\t\tt.Errorf(\"Codespaces.Create returned %+v, want %+v\", codespace, want)\n\t}\n\n\tconst methodName = \"Create\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Codespaces.Create(\n\t\t\tctx,\n\t\t\topt,\n\t\t)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodespacesService_Get(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/codespaces/codespace_1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1,\"repository\":{\"id\":111}}`)\n\t})\n\n\tctx := t.Context()\n\tcodespace, _, err := client.Codespaces.Get(ctx, \"codespace_1\")\n\tif err != nil {\n\t\tt.Fatalf(\"Codespaces.Get returned error: %v\", err)\n\t}\n\n\twant := &Codespace{\n\t\tID: Ptr(int64(1)),\n\t\tRepository: &Repository{\n\t\t\tID: Ptr(int64(111)),\n\t\t},\n\t}\n\n\tif !cmp.Equal(codespace, want) {\n\t\tt.Errorf(\"Codespaces.Get returned %+v, want %+v\", codespace, want)\n\t}\n\n\tconst methodName = \"Get\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Codespaces.Get(ctx, \"codespace_1\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodespacesService_Update(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/codespaces/codespace_1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\ttestBody(\n\t\t\tt,\n\t\t\tr,\n\t\t\t`{\"machine\":\"standardLinux\",\"recent_folders\":[\"folder1\",\"folder2\"]}`+\"\\n\",\n\t\t)\n\t\tfmt.Fprint(w, `{\"id\":1,\"repository\":{\"id\":111}}`)\n\t})\n\n\topt := &UpdateCodespaceOptions{\n\t\tMachine: Ptr(\"standardLinux\"),\n\t\tRecentFolders: []string{\n\t\t\t\"folder1\",\n\t\t\t\"folder2\",\n\t\t},\n\t}\n\n\tctx := t.Context()\n\tcodespace, _, err := client.Codespaces.Update(\n\t\tctx,\n\t\t\"codespace_1\",\n\t\topt,\n\t)\n\tif err != nil {\n\t\tt.Fatalf(\"Codespaces.Update returned error: %v\", err)\n\t}\n\n\twant := &Codespace{\n\t\tID: Ptr(int64(1)),\n\t\tRepository: &Repository{\n\t\t\tID: Ptr(int64(111)),\n\t\t},\n\t}\n\n\tif !cmp.Equal(codespace, want) {\n\t\tt.Errorf(\"Codespaces.Update returned %+v, want %+v\", codespace, want)\n\t}\n\n\tconst methodName = \"Update\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Codespaces.Update(\n\t\t\tctx,\n\t\t\t\"codespace_1\",\n\t\t\topt,\n\t\t)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodespacesService_ExportCodespace(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/codespaces/codespace_1/exports\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"state\": \"succeeded\",\n\t\t\t\"completed_at\": \"2025-12-11T00:00:00Z\",\n\t\t\t\"branch\": \"main\",\n\t\t\t\"export_url\": \"https://api.github.com/user/codespaces/:name/exports/latest\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\texport, _, err := client.Codespaces.ExportCodespace(ctx, \"codespace_1\")\n\tif err != nil {\n\t\tt.Fatalf(\"Codespaces.ExportCodespace returned error: %v\", err)\n\t}\n\n\twant := &CodespaceExport{\n\t\tState:       Ptr(\"succeeded\"),\n\t\tCompletedAt: Ptr(Timestamp{Time: time.Date(2025, time.December, 11, 0, 0, 0, 0, time.UTC)}),\n\t\tBranch:      Ptr(\"main\"),\n\t\tExportURL:   Ptr(\"https://api.github.com/user/codespaces/:name/exports/latest\"),\n\t}\n\n\tif !cmp.Equal(export, want) {\n\t\tt.Errorf(\"Codespaces.ExportCodespace returned %+v, want %+v\", export, want)\n\t}\n\n\tconst methodName = \"ExportCodespace\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Codespaces.ExportCodespace(ctx, \"codespace_1\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodespacesService_GetLatestCodespaceExport(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/codespaces/codespace_1/exports/latest\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"state\": \"succeeded\",\n\t\t\t\"completed_at\": \"2025-12-11T00:00:00Z\",\n\t\t\t\"branch\": \"main\",\n\t\t\t\"export_url\": \"https://api.github.com/user/codespaces/:name/exports/latest\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\texport, _, err := client.Codespaces.GetLatestCodespaceExport(ctx, \"codespace_1\")\n\tif err != nil {\n\t\tt.Fatalf(\"Codespaces.GetLatestCodespaceExport returned error: %v\", err)\n\t}\n\n\twant := &CodespaceExport{\n\t\tState:       Ptr(\"succeeded\"),\n\t\tCompletedAt: Ptr(Timestamp{Time: time.Date(2025, time.December, 11, 0, 0, 0, 0, time.UTC)}),\n\t\tBranch:      Ptr(\"main\"),\n\t\tExportURL:   Ptr(\"https://api.github.com/user/codespaces/:name/exports/latest\"),\n\t}\n\n\tif !cmp.Equal(export, want) {\n\t\tt.Errorf(\"Codespaces.GetLatestCodespaceExport returned %+v, want %+v\", export, want)\n\t}\n\n\tconst methodName = \"GetLatestCodespaceExport\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Codespaces.GetLatestCodespaceExport(ctx, \"codespace_1\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodespacesService_Publish(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/codespaces/codespace_1/publish\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestBody(\n\t\t\tt,\n\t\t\tr,\n\t\t\t`{\"name\":\"repo\",\"private\":true}`+\"\\n\",\n\t\t)\n\t\tfmt.Fprint(w, `{\"id\":1,\"repository\":{\"id\":111}}`)\n\t})\n\n\topt := &PublishCodespaceOptions{\n\t\tName:    Ptr(\"repo\"),\n\t\tPrivate: Ptr(true),\n\t}\n\n\tctx := t.Context()\n\trepo, _, err := client.Codespaces.Publish(\n\t\tctx,\n\t\t\"codespace_1\",\n\t\topt,\n\t)\n\tif err != nil {\n\t\tt.Fatalf(\"Codespaces.Publish returned error: %v\", err)\n\t}\n\n\twant := &Codespace{\n\t\tID: Ptr(int64(1)),\n\t\tRepository: &Repository{\n\t\t\tID: Ptr(int64(111)),\n\t\t},\n\t}\n\tif !cmp.Equal(repo, want) {\n\t\tt.Errorf(\"Codespaces.Publish returned %+v, want %+v\", repo, want)\n\t}\n\n\tconst methodName = \"Publish\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Codespaces.Publish(\n\t\t\tctx,\n\t\t\t\"codespace_1\",\n\t\t\topt,\n\t\t)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/copilot.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"time\"\n)\n\n// CopilotService provides access to the Copilot-related functions\n// in the GitHub API.\n//\n// GitHub API docs: https://docs.github.com/en/rest/copilot/\ntype CopilotService service\n\n// CopilotOrganizationDetails represents the details of an organization's Copilot for Business subscription.\ntype CopilotOrganizationDetails struct {\n\tSeatBreakdown         *CopilotSeatBreakdown `json:\"seat_breakdown\"`\n\tPublicCodeSuggestions string                `json:\"public_code_suggestions\"`\n\tCopilotChat           string                `json:\"copilot_chat\"`\n\tSeatManagementSetting string                `json:\"seat_management_setting\"`\n}\n\n// CopilotSeatBreakdown represents the breakdown of Copilot for Business seats for the organization.\ntype CopilotSeatBreakdown struct {\n\tTotal               int `json:\"total\"`\n\tAddedThisCycle      int `json:\"added_this_cycle\"`\n\tPendingCancellation int `json:\"pending_cancellation\"`\n\tPendingInvitation   int `json:\"pending_invitation\"`\n\tActiveThisCycle     int `json:\"active_this_cycle\"`\n\tInactiveThisCycle   int `json:\"inactive_this_cycle\"`\n}\n\n// ListCopilotSeatsResponse represents the Copilot for Business seat assignments for an organization.\ntype ListCopilotSeatsResponse struct {\n\tTotalSeats int64                 `json:\"total_seats\"`\n\tSeats      []*CopilotSeatDetails `json:\"seats\"`\n}\n\n// CopilotSeatDetails represents the details of a Copilot for Business seat.\ntype CopilotSeatDetails struct {\n\t// Assignee can either be a User, Team, or Organization.\n\tAssignee                any        `json:\"assignee\"`\n\tAssigningTeam           *Team      `json:\"assigning_team,omitempty\"`\n\tPendingCancellationDate *string    `json:\"pending_cancellation_date,omitempty\"`\n\tLastActivityAt          *Timestamp `json:\"last_activity_at,omitempty\"`\n\tLastActivityEditor      *string    `json:\"last_activity_editor,omitempty\"`\n\tCreatedAt               *Timestamp `json:\"created_at\"`\n\tUpdatedAt               *Timestamp `json:\"updated_at,omitempty\"`\n\tPlanType                *string    `json:\"plan_type,omitempty\"`\n}\n\n// SeatAssignments represents the number of seats assigned.\ntype SeatAssignments struct {\n\tSeatsCreated int `json:\"seats_created\"`\n}\n\n// SeatCancellations represents the number of seats cancelled.\ntype SeatCancellations struct {\n\tSeatsCancelled int `json:\"seats_cancelled\"`\n}\n\n// CopilotMetricsListOptions represents the optional parameters to the CopilotService get metrics methods.\ntype CopilotMetricsListOptions struct {\n\tSince *time.Time `url:\"since,omitempty\"`\n\tUntil *time.Time `url:\"until,omitempty\"`\n\n\tListOptions\n}\n\n// CopilotIDECodeCompletionsLanguage represents Copilot usage metrics for completions in the IDE for a language.\ntype CopilotIDECodeCompletionsLanguage struct {\n\tName              string `json:\"name\"`\n\tTotalEngagedUsers int    `json:\"total_engaged_users\"`\n}\n\n// CopilotIDECodeCompletionsModelLanguage represents Copilot usage metrics for completions in the IDE for a model and language.\ntype CopilotIDECodeCompletionsModelLanguage struct {\n\tName                    string `json:\"name\"`\n\tTotalEngagedUsers       int    `json:\"total_engaged_users\"`\n\tTotalCodeSuggestions    int    `json:\"total_code_suggestions\"`\n\tTotalCodeAcceptances    int    `json:\"total_code_acceptances\"`\n\tTotalCodeLinesSuggested int    `json:\"total_code_lines_suggested\"`\n\tTotalCodeLinesAccepted  int    `json:\"total_code_lines_accepted\"`\n}\n\n// CopilotIDECodeCompletionsModel represents Copilot usage metrics for completions in the IDE for a model.\ntype CopilotIDECodeCompletionsModel struct {\n\tName                    string                                    `json:\"name\"`\n\tIsCustomModel           bool                                      `json:\"is_custom_model\"`\n\tCustomModelTrainingDate *string                                   `json:\"custom_model_training_date,omitempty\"`\n\tTotalEngagedUsers       int                                       `json:\"total_engaged_users\"`\n\tLanguages               []*CopilotIDECodeCompletionsModelLanguage `json:\"languages\"`\n}\n\n// CopilotIDECodeCompletionsEditor represents Copilot usage metrics for completions in the IDE for an editor.\ntype CopilotIDECodeCompletionsEditor struct {\n\tName              string                            `json:\"name\"`\n\tTotalEngagedUsers int                               `json:\"total_engaged_users\"`\n\tModels            []*CopilotIDECodeCompletionsModel `json:\"models\"`\n}\n\n// CopilotIDECodeCompletions represents Copilot usage metrics for Copilot code completions in the IDE, categorized by editor, model and language.\ntype CopilotIDECodeCompletions struct {\n\tTotalEngagedUsers int                                  `json:\"total_engaged_users\"`\n\tLanguages         []*CopilotIDECodeCompletionsLanguage `json:\"languages\"`\n\tEditors           []*CopilotIDECodeCompletionsEditor   `json:\"editors\"`\n}\n\n// CopilotIDEChatModel represents Copilot usage metrics for chatting with a model in the IDE.\ntype CopilotIDEChatModel struct {\n\tName                     string  `json:\"name\"`\n\tIsCustomModel            bool    `json:\"is_custom_model\"`\n\tCustomModelTrainingDate  *string `json:\"custom_model_training_date,omitempty\"`\n\tTotalEngagedUsers        int     `json:\"total_engaged_users\"`\n\tTotalChats               int     `json:\"total_chats\"`\n\tTotalChatInsertionEvents int     `json:\"total_chat_insertion_events\"`\n\tTotalChatCopyEvents      int     `json:\"total_chat_copy_events\"`\n}\n\n// CopilotIDEChatEditor represents Copilot usage metrics for chatting with a model in the IDE, categorized by editor and model.\ntype CopilotIDEChatEditor struct {\n\tName              string                 `json:\"name\"`\n\tTotalEngagedUsers int                    `json:\"total_engaged_users\"`\n\tModels            []*CopilotIDEChatModel `json:\"models\"`\n}\n\n// CopilotIDEChat represents Copilot usage metrics for Copilot Chat in the IDE, categorized by editor and model.\ntype CopilotIDEChat struct {\n\tTotalEngagedUsers int                     `json:\"total_engaged_users\"`\n\tEditors           []*CopilotIDEChatEditor `json:\"editors\"`\n}\n\n// CopilotDotcomChatModel represents Copilot usage metrics for chatting with a model in the webbrowser.\ntype CopilotDotcomChatModel struct {\n\tName                    string  `json:\"name\"`\n\tIsCustomModel           bool    `json:\"is_custom_model\"`\n\tCustomModelTrainingDate *string `json:\"custom_model_training_date,omitempty\"`\n\tTotalEngagedUsers       int     `json:\"total_engaged_users\"`\n\tTotalChats              int     `json:\"total_chats\"`\n}\n\n// CopilotDotcomChat represents Copilot usage metrics for Copilot Chat in the webbrowser, categorized by model.\ntype CopilotDotcomChat struct {\n\tTotalEngagedUsers int                       `json:\"total_engaged_users\"`\n\tModels            []*CopilotDotcomChatModel `json:\"models\"`\n}\n\n// CopilotDotcomPullRequestsModel represents Copilot usage metrics for pull requests in the webbrowser, categorized by model.\ntype CopilotDotcomPullRequestsModel struct {\n\tName                    string  `json:\"name\"`\n\tIsCustomModel           bool    `json:\"is_custom_model\"`\n\tCustomModelTrainingDate *string `json:\"custom_model_training_date,omitempty\"`\n\tTotalPRSummariesCreated int     `json:\"total_pr_summaries_created\"`\n\tTotalEngagedUsers       int     `json:\"total_engaged_users\"`\n}\n\n// CopilotDotcomPullRequestsRepository represents Copilot usage metrics for pull requests in the webbrowser, categorized by repository.\ntype CopilotDotcomPullRequestsRepository struct {\n\tName              string                            `json:\"name\"`\n\tTotalEngagedUsers int                               `json:\"total_engaged_users\"`\n\tModels            []*CopilotDotcomPullRequestsModel `json:\"models\"`\n}\n\n// CopilotDotcomPullRequests represents Copilot usage metrics for pull requests in the webbrowser, categorized by repository and model.\ntype CopilotDotcomPullRequests struct {\n\tTotalEngagedUsers int                                    `json:\"total_engaged_users\"`\n\tRepositories      []*CopilotDotcomPullRequestsRepository `json:\"repositories\"`\n}\n\n// CopilotMetrics represents Copilot usage metrics for a given day.\ntype CopilotMetrics struct {\n\tDate                      string                     `json:\"date\"`\n\tTotalActiveUsers          *int                       `json:\"total_active_users,omitempty\"`\n\tTotalEngagedUsers         *int                       `json:\"total_engaged_users,omitempty\"`\n\tCopilotIDECodeCompletions *CopilotIDECodeCompletions `json:\"copilot_ide_code_completions,omitempty\"`\n\tCopilotIDEChat            *CopilotIDEChat            `json:\"copilot_ide_chat,omitempty\"`\n\tCopilotDotcomChat         *CopilotDotcomChat         `json:\"copilot_dotcom_chat,omitempty\"`\n\tCopilotDotcomPullRequests *CopilotDotcomPullRequests `json:\"copilot_dotcom_pull_requests,omitempty\"`\n}\n\n// CopilotMetricsReportOptions specifies the optional parameters for single-day metrics report endpoints.\ntype CopilotMetricsReportOptions struct {\n\tDay string `url:\"day\"` // Required, format: YYYY-MM-DD\n}\n\n// CopilotDailyMetricsReport represents the response from 1-day Copilot metrics report endpoints.\ntype CopilotDailyMetricsReport struct {\n\tDownloadLinks []string `json:\"download_links\"`\n\tReportDay     string   `json:\"report_day\"`\n}\n\n// CopilotMetricsReport represents the response from 28-day Copilot metrics report endpoints.\ntype CopilotMetricsReport struct {\n\tDownloadLinks  []string `json:\"download_links\"`\n\tReportStartDay string   `json:\"report_start_day\"`\n\tReportEndDay   string   `json:\"report_end_day\"`\n}\n\n// UnmarshalJSON implements the json.Unmarshaler interface.\nfunc (cp *CopilotSeatDetails) UnmarshalJSON(data []byte) error {\n\t// Using an alias to avoid infinite recursion when calling json.Unmarshal\n\ttype alias CopilotSeatDetails\n\tvar seatDetail alias\n\n\tif err := json.Unmarshal(data, &seatDetail); err != nil {\n\t\treturn err\n\t}\n\n\tcp.AssigningTeam = seatDetail.AssigningTeam\n\tcp.PendingCancellationDate = seatDetail.PendingCancellationDate\n\tcp.LastActivityAt = seatDetail.LastActivityAt\n\tcp.LastActivityEditor = seatDetail.LastActivityEditor\n\tcp.CreatedAt = seatDetail.CreatedAt\n\tcp.UpdatedAt = seatDetail.UpdatedAt\n\tcp.PlanType = seatDetail.PlanType\n\n\tswitch v := seatDetail.Assignee.(type) {\n\tcase nil:\n\t\t// Assignee can be null according to GitHub API specification.\n\t\t// See: https://docs.github.com/en/rest/copilot/copilot-user-management?apiVersion=2022-11-28#list-all-copilot-seat-assignments-for-an-organization\n\t\t// Note: Copilot API is in public preview and subject to change.\n\t\tcp.Assignee = nil\n\tcase map[string]any:\n\t\tjsonData, err := json.Marshal(seatDetail.Assignee)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif v[\"type\"] == nil {\n\t\t\treturn errors.New(\"assignee type field is not set\")\n\t\t}\n\n\t\tif t, ok := v[\"type\"].(string); ok && t == \"User\" {\n\t\t\tvar user *User\n\t\t\tif err := json.Unmarshal(jsonData, &user); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tcp.Assignee = user\n\t\t} else if t, ok := v[\"type\"].(string); ok && t == \"Team\" {\n\t\t\tvar team *Team\n\t\t\tif err := json.Unmarshal(jsonData, &team); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tcp.Assignee = team\n\t\t} else if t, ok := v[\"type\"].(string); ok && t == \"Organization\" {\n\t\t\tvar organization *Organization\n\t\t\tif err := json.Unmarshal(jsonData, &organization); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tcp.Assignee = organization\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"unsupported assignee type %v\", v[\"type\"])\n\t\t}\n\tdefault:\n\t\treturn fmt.Errorf(\"unsupported assignee type %T\", v)\n\t}\n\n\treturn nil\n}\n\n// GetUser gets the User from the CopilotSeatDetails if the assignee is a user.\nfunc (cp *CopilotSeatDetails) GetUser() (*User, bool) { u, ok := cp.Assignee.(*User); return u, ok }\n\n// GetTeam gets the Team from the CopilotSeatDetails if the assignee is a team.\nfunc (cp *CopilotSeatDetails) GetTeam() (*Team, bool) { t, ok := cp.Assignee.(*Team); return t, ok }\n\n// GetOrganization gets the Organization from the CopilotSeatDetails if the assignee is an organization.\nfunc (cp *CopilotSeatDetails) GetOrganization() (*Organization, bool) {\n\to, ok := cp.Assignee.(*Organization)\n\treturn o, ok\n}\n\n// GetCopilotBilling gets Copilot for Business billing information and settings for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#get-copilot-seat-information-and-settings-for-an-organization\n//\n//meta:operation GET /orgs/{org}/copilot/billing\nfunc (s *CopilotService) GetCopilotBilling(ctx context.Context, org string) (*CopilotOrganizationDetails, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/copilot/billing\", org)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar copilotDetails *CopilotOrganizationDetails\n\tresp, err := s.client.Do(ctx, req, &copilotDetails)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn copilotDetails, resp, nil\n}\n\n// ListCopilotSeats lists Copilot for Business seat assignments for an organization.\n//\n// To paginate through all seats, populate 'Page' with the number of the last page.\n//\n// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#list-all-copilot-seat-assignments-for-an-organization\n//\n//meta:operation GET /orgs/{org}/copilot/billing/seats\nfunc (s *CopilotService) ListCopilotSeats(ctx context.Context, org string, opts *ListOptions) (*ListCopilotSeatsResponse, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/copilot/billing/seats\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar copilotSeats *ListCopilotSeatsResponse\n\tresp, err := s.client.Do(ctx, req, &copilotSeats)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn copilotSeats, resp, nil\n}\n\n// ListCopilotEnterpriseSeats lists Copilot for Business seat assignments for an enterprise.\n//\n// To paginate through all seats, populate 'Page' with the number of the last page.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-user-management#list-all-copilot-seat-assignments-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/copilot/billing/seats\nfunc (s *CopilotService) ListCopilotEnterpriseSeats(ctx context.Context, enterprise string, opts *ListOptions) (*ListCopilotSeatsResponse, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/copilot/billing/seats\", enterprise)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar copilotSeats *ListCopilotSeatsResponse\n\tresp, err := s.client.Do(ctx, req, &copilotSeats)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn copilotSeats, resp, nil\n}\n\n// AddCopilotTeams adds teams to the Copilot for Business subscription for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#add-teams-to-the-copilot-subscription-for-an-organization\n//\n//meta:operation POST /orgs/{org}/copilot/billing/selected_teams\nfunc (s *CopilotService) AddCopilotTeams(ctx context.Context, org string, teamNames []string) (*SeatAssignments, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/copilot/billing/selected_teams\", org)\n\n\tbody := struct {\n\t\tSelectedTeams []string `json:\"selected_teams\"`\n\t}{\n\t\tSelectedTeams: teamNames,\n\t}\n\n\treq, err := s.client.NewRequest(\"POST\", u, body)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar seatAssignments *SeatAssignments\n\tresp, err := s.client.Do(ctx, req, &seatAssignments)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn seatAssignments, resp, nil\n}\n\n// RemoveCopilotTeams removes teams from the Copilot for Business subscription for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#remove-teams-from-the-copilot-subscription-for-an-organization\n//\n//meta:operation DELETE /orgs/{org}/copilot/billing/selected_teams\nfunc (s *CopilotService) RemoveCopilotTeams(ctx context.Context, org string, teamNames []string) (*SeatCancellations, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/copilot/billing/selected_teams\", org)\n\n\tbody := struct {\n\t\tSelectedTeams []string `json:\"selected_teams\"`\n\t}{\n\t\tSelectedTeams: teamNames,\n\t}\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, body)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar seatCancellations *SeatCancellations\n\tresp, err := s.client.Do(ctx, req, &seatCancellations)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn seatCancellations, resp, nil\n}\n\n// AddCopilotUsers adds users to the Copilot for Business subscription for an organization\n//\n// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#add-users-to-the-copilot-subscription-for-an-organization\n//\n//meta:operation POST /orgs/{org}/copilot/billing/selected_users\nfunc (s *CopilotService) AddCopilotUsers(ctx context.Context, org string, users []string) (*SeatAssignments, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/copilot/billing/selected_users\", org)\n\n\tbody := struct {\n\t\tSelectedUsernames []string `json:\"selected_usernames\"`\n\t}{\n\t\tSelectedUsernames: users,\n\t}\n\n\treq, err := s.client.NewRequest(\"POST\", u, body)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar seatAssignments *SeatAssignments\n\tresp, err := s.client.Do(ctx, req, &seatAssignments)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn seatAssignments, resp, nil\n}\n\n// RemoveCopilotUsers removes users from the Copilot for Business subscription for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#remove-users-from-the-copilot-subscription-for-an-organization\n//\n//meta:operation DELETE /orgs/{org}/copilot/billing/selected_users\nfunc (s *CopilotService) RemoveCopilotUsers(ctx context.Context, org string, users []string) (*SeatCancellations, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/copilot/billing/selected_users\", org)\n\n\tbody := struct {\n\t\tSelectedUsernames []string `json:\"selected_usernames\"`\n\t}{\n\t\tSelectedUsernames: users,\n\t}\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, body)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar seatCancellations *SeatCancellations\n\tresp, err := s.client.Do(ctx, req, &seatCancellations)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn seatCancellations, resp, nil\n}\n\n// GetSeatDetails gets Copilot for Business seat assignment details for a user.\n//\n// GitHub API docs: https://docs.github.com/rest/copilot/copilot-user-management#get-copilot-seat-assignment-details-for-a-user\n//\n//meta:operation GET /orgs/{org}/members/{username}/copilot\nfunc (s *CopilotService) GetSeatDetails(ctx context.Context, org, user string) (*CopilotSeatDetails, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/members/%v/copilot\", org, user)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar seatDetails *CopilotSeatDetails\n\tresp, err := s.client.Do(ctx, req, &seatDetails)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn seatDetails, resp, nil\n}\n\n// GetEnterpriseMetrics gets Copilot usage metrics for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/copilot/metrics\nfunc (s *CopilotService) GetEnterpriseMetrics(ctx context.Context, enterprise string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/copilot/metrics\", enterprise)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar metrics []*CopilotMetrics\n\tresp, err := s.client.Do(ctx, req, &metrics)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn metrics, resp, nil\n}\n\n// GetEnterpriseTeamMetrics gets Copilot usage metrics for an enterprise team.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise-team\n//\n//meta:operation GET /enterprises/{enterprise}/team/{team_slug}/copilot/metrics\nfunc (s *CopilotService) GetEnterpriseTeamMetrics(ctx context.Context, enterprise, team string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/team/%v/copilot/metrics\", enterprise, team)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar metrics []*CopilotMetrics\n\tresp, err := s.client.Do(ctx, req, &metrics)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn metrics, resp, nil\n}\n\n// GetOrganizationMetrics gets Copilot usage metrics for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-organization\n//\n//meta:operation GET /orgs/{org}/copilot/metrics\nfunc (s *CopilotService) GetOrganizationMetrics(ctx context.Context, org string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/copilot/metrics\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar metrics []*CopilotMetrics\n\tresp, err := s.client.Do(ctx, req, &metrics)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn metrics, resp, nil\n}\n\n// GetOrganizationTeamMetrics gets Copilot usage metrics for an organization team.\n//\n// GitHub API docs: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-a-team\n//\n//meta:operation GET /orgs/{org}/team/{team_slug}/copilot/metrics\nfunc (s *CopilotService) GetOrganizationTeamMetrics(ctx context.Context, org, team string, opts *CopilotMetricsListOptions) ([]*CopilotMetrics, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/team/%v/copilot/metrics\", org, team)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar metrics []*CopilotMetrics\n\tresp, err := s.client.Do(ctx, req, &metrics)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn metrics, resp, nil\n}\n\n// GetEnterpriseDailyMetricsReport gets a report containing Copilot metrics for a single day for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-enterprise-usage-metrics-for-a-specific-day\n//\n//meta:operation GET /enterprises/{enterprise}/copilot/metrics/reports/enterprise-1-day\nfunc (s *CopilotService) GetEnterpriseDailyMetricsReport(ctx context.Context, enterprise string, opts *CopilotMetricsReportOptions) (*CopilotDailyMetricsReport, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/copilot/metrics/reports/enterprise-1-day\", enterprise)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar report *CopilotDailyMetricsReport\n\tresp, err := s.client.Do(ctx, req, &report)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn report, resp, nil\n}\n\n// GetEnterpriseMetricsReport gets a report containing Copilot metrics for a 28-day rolling window for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-enterprise-usage-metrics\n//\n//meta:operation GET /enterprises/{enterprise}/copilot/metrics/reports/enterprise-28-day/latest\nfunc (s *CopilotService) GetEnterpriseMetricsReport(ctx context.Context, enterprise string) (*CopilotMetricsReport, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/copilot/metrics/reports/enterprise-28-day/latest\", enterprise)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar report *CopilotMetricsReport\n\tresp, err := s.client.Do(ctx, req, &report)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn report, resp, nil\n}\n\n// GetEnterpriseUsersDailyMetricsReport gets a report containing Copilot user metrics for a single day for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-users-usage-metrics-for-a-specific-day\n//\n//meta:operation GET /enterprises/{enterprise}/copilot/metrics/reports/users-1-day\nfunc (s *CopilotService) GetEnterpriseUsersDailyMetricsReport(ctx context.Context, enterprise string, opts *CopilotMetricsReportOptions) (*CopilotDailyMetricsReport, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/copilot/metrics/reports/users-1-day\", enterprise)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar report *CopilotDailyMetricsReport\n\tresp, err := s.client.Do(ctx, req, &report)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn report, resp, nil\n}\n\n// GetEnterpriseUsersMetricsReport gets a report containing Copilot user metrics for a 28-day rolling window for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-users-usage-metrics\n//\n//meta:operation GET /enterprises/{enterprise}/copilot/metrics/reports/users-28-day/latest\nfunc (s *CopilotService) GetEnterpriseUsersMetricsReport(ctx context.Context, enterprise string) (*CopilotMetricsReport, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/copilot/metrics/reports/users-28-day/latest\", enterprise)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar report *CopilotMetricsReport\n\tresp, err := s.client.Do(ctx, req, &report)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn report, resp, nil\n}\n\n// GetOrganizationDailyMetricsReport gets a report containing Copilot metrics for a single day for an organization.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-organization-usage-metrics-for-a-specific-day\n//\n//meta:operation GET /orgs/{org}/copilot/metrics/reports/organization-1-day\nfunc (s *CopilotService) GetOrganizationDailyMetricsReport(ctx context.Context, org string, opts *CopilotMetricsReportOptions) (*CopilotDailyMetricsReport, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/copilot/metrics/reports/organization-1-day\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar report *CopilotDailyMetricsReport\n\tresp, err := s.client.Do(ctx, req, &report)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn report, resp, nil\n}\n\n// GetOrganizationMetricsReport gets a report containing Copilot metrics for a 28-day rolling window for an organization.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-organization-usage-metrics\n//\n//meta:operation GET /orgs/{org}/copilot/metrics/reports/organization-28-day/latest\nfunc (s *CopilotService) GetOrganizationMetricsReport(ctx context.Context, org string) (*CopilotMetricsReport, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/copilot/metrics/reports/organization-28-day/latest\", org)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar report *CopilotMetricsReport\n\tresp, err := s.client.Do(ctx, req, &report)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn report, resp, nil\n}\n\n// GetOrganizationUsersDailyMetricsReport gets a report containing Copilot user metrics for a single day for an organization.\n//\n// 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\n//\n//meta:operation GET /orgs/{org}/copilot/metrics/reports/users-1-day\nfunc (s *CopilotService) GetOrganizationUsersDailyMetricsReport(ctx context.Context, org string, opts *CopilotMetricsReportOptions) (*CopilotDailyMetricsReport, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/copilot/metrics/reports/users-1-day\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar report *CopilotDailyMetricsReport\n\tresp, err := s.client.Do(ctx, req, &report)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn report, resp, nil\n}\n\n// GetOrganizationUsersMetricsReport gets a report containing Copilot user metrics for a 28-day rolling window for an organization.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/copilot/copilot-usage-metrics#get-copilot-organization-users-usage-metrics\n//\n//meta:operation GET /orgs/{org}/copilot/metrics/reports/users-28-day/latest\nfunc (s *CopilotService) GetOrganizationUsersMetricsReport(ctx context.Context, org string) (*CopilotMetricsReport, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/copilot/metrics/reports/users-28-day/latest\", org)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar report *CopilotMetricsReport\n\tresp, err := s.client.Do(ctx, req, &report)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn report, resp, nil\n}\n"
  },
  {
    "path": "github/copilot_test.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\n// Test invalid JSON responses, valid responses are covered in the other tests.\nfunc TestCopilotSeatDetails_UnmarshalJSON(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tname    string\n\t\tdata    string\n\t\twant    *CopilotSeatDetails\n\t\twantErr bool\n\t}{\n\t\t{\n\t\t\tname:    \"Invalid JSON\",\n\t\t\tdata:    `{`,\n\t\t\twant:    nil,\n\t\t\twantErr: true,\n\t\t},\n\t\t{\n\t\t\tname: \"Invalid top level type\",\n\t\t\tdata: `{\n\t\t\t\t\t\"assignee\": {\n\t\t\t\t\t\t\"type\": \"User\",\n\t\t\t\t\t\t\"name\": \"octokittens\",\n\t\t\t\t\t\t\"id\": 1\n\t\t\t\t\t},\n\t\t\t\t\t\"assigning_team\": \"this should be an object\"\n\t\t\t\t}`,\n\t\t\twant:    &CopilotSeatDetails{},\n\t\t\twantErr: true,\n\t\t},\n\t\t{\n\t\t\tname: \"No Type Field\",\n\t\t\tdata: `{\n\t\t\t\t\t\"assignee\": {\n\t\t\t\t\t\t\"name\": \"octokittens\",\n\t\t\t\t\t\t\"id\": 1\n\t\t\t\t\t}\n\t\t\t\t}`,\n\t\t\twant:    &CopilotSeatDetails{},\n\t\t\twantErr: true,\n\t\t},\n\t\t{\n\t\t\tname: \"Null Assignee\",\n\t\t\tdata: `{\n\t\t\t\t\t\"assignee\": null\n\t\t\t\t}`,\n\t\t\twant: &CopilotSeatDetails{\n\t\t\t\tAssignee: nil,\n\t\t\t},\n\t\t\twantErr: false,\n\t\t},\n\t\t{\n\t\t\tname: \"Invalid Assignee Field Type\",\n\t\t\tdata: `{\n\t\t\t\t\t\"assignee\": \"test\"\n\t\t\t\t}`,\n\t\t\twant:    &CopilotSeatDetails{},\n\t\t\twantErr: true,\n\t\t},\n\t\t{\n\t\t\tname: \"Invalid Assignee Type\",\n\t\t\tdata: `{\n\t\t\t\t\t\"assignee\": {\n\t\t\t\t\t\t\"name\": \"octokittens\",\n\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\"type\": []\n\t\t\t\t\t}\n\t\t\t\t}`,\n\t\t\twant:    &CopilotSeatDetails{},\n\t\t\twantErr: true,\n\t\t},\n\t\t{\n\t\t\tname: \"Invalid User\",\n\t\t\tdata: `{\n\t\t\t\t\t\"assignee\": {\n\t\t\t\t\t\t\"type\": \"User\",\n\t\t\t\t\t\t\"id\": \"bad\"\n\t\t\t\t\t}\n\t\t\t\t}`,\n\t\t\twant:    &CopilotSeatDetails{},\n\t\t\twantErr: true,\n\t\t},\n\t\t{\n\t\t\tname: \"Invalid Team\",\n\t\t\tdata: `{\n\t\t\t\t\t\"assignee\": {\n\t\t\t\t\t\t\"type\": \"Team\",\n\t\t\t\t\t\t\"id\": \"bad\"\n\t\t\t\t\t}\n\t\t\t\t}`,\n\t\t\twant:    &CopilotSeatDetails{},\n\t\t\twantErr: true,\n\t\t},\n\t\t{\n\t\t\tname: \"Invalid Organization\",\n\t\t\tdata: `{\n\t\t\t\t\t\"assignee\": {\n\t\t\t\t\t\t\"type\": \"Organization\",\n\t\t\t\t\t\t\"id\": \"bad\"\n\t\t\t\t\t}\n\t\t\t\t}`,\n\t\t\twant:    &CopilotSeatDetails{},\n\t\t\twantErr: true,\n\t\t},\n\t}\n\n\tfor _, tc := range tests {\n\t\tvar seatDetails *CopilotSeatDetails\n\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\terr := json.Unmarshal([]byte(tc.data), &seatDetails)\n\t\t\tif err == nil && tc.wantErr {\n\t\t\t\tt.Error(\"CopilotSeatDetails.UnmarshalJSON returned nil instead of an error\")\n\t\t\t}\n\t\t\tif err != nil && !tc.wantErr {\n\t\t\t\tt.Errorf(\"CopilotSeatDetails.UnmarshalJSON returned an unexpected error: %v\", err)\n\t\t\t}\n\t\t\tif !cmp.Equal(tc.want, seatDetails) {\n\t\t\t\tt.Errorf(\"CopilotSeatDetails.UnmarshalJSON expected %+v, got %+v\", tc.want, seatDetails)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestCopilotService_GetSeatDetailsUser(t *testing.T) {\n\tt.Parallel()\n\tdata := `{\n\t\t\t\t\"assignee\": {\n\t\t\t\t\t\"type\": \"User\",\n\t\t\t\t\t\"id\": 1\n\t\t\t\t}\n\t\t\t}`\n\n\tvar seatDetails *CopilotSeatDetails\n\n\terr := json.Unmarshal([]byte(data), &seatDetails)\n\tif err != nil {\n\t\tt.Errorf(\"CopilotSeatDetails.UnmarshalJSON returned an unexpected error: %v\", err)\n\t}\n\n\twant := &User{\n\t\tID:   Ptr(int64(1)),\n\t\tType: Ptr(\"User\"),\n\t}\n\n\tif got, ok := seatDetails.GetUser(); ok && !cmp.Equal(got, want) {\n\t\tt.Errorf(\"CopilotSeatDetails.GetTeam returned %+v, want %+v\", got, want)\n\t} else if !ok {\n\t\tt.Error(\"CopilotSeatDetails.GetUser returned false, expected true\")\n\t}\n\n\tdata = `{\n\t\t\t\t\"assignee\": {\n\t\t\t\t\t\"type\": \"Organization\",\n\t\t\t\t\t\"id\": 1\n\t\t\t\t}\n\t\t\t}`\n\n\tbad := &Organization{\n\t\tID:   Ptr(int64(1)),\n\t\tType: Ptr(\"Organization\"),\n\t}\n\n\terr = json.Unmarshal([]byte(data), seatDetails)\n\tif err != nil {\n\t\tt.Errorf(\"CopilotSeatDetails.UnmarshalJSON returned an unexpected error: %v\", err)\n\t}\n\n\tif got, ok := seatDetails.GetUser(); ok {\n\t\tt.Errorf(\"CopilotSeatDetails.GetUser returned true, expected false. Returned %v, expected %v\", got, bad)\n\t}\n}\n\nfunc TestCopilotService_GetSeatDetailsTeam(t *testing.T) {\n\tt.Parallel()\n\tdata := `{\n\t\t\t\t\"assignee\": {\n\t\t\t\t\t\"type\": \"Team\",\n\t\t\t\t\t\"id\": 1\n\t\t\t\t}\n\t\t\t}`\n\n\tvar seatDetails *CopilotSeatDetails\n\n\terr := json.Unmarshal([]byte(data), &seatDetails)\n\tif err != nil {\n\t\tt.Errorf(\"CopilotSeatDetails.UnmarshalJSON returned an unexpected error: %v\", err)\n\t}\n\n\twant := &Team{\n\t\tID:   Ptr(int64(1)),\n\t\tType: Ptr(\"Team\"),\n\t}\n\n\tif got, ok := seatDetails.GetTeam(); ok && !cmp.Equal(got, want) {\n\t\tt.Errorf(\"CopilotSeatDetails.GetTeam returned %+v, want %+v\", got, want)\n\t} else if !ok {\n\t\tt.Error(\"CopilotSeatDetails.GetTeam returned false, expected true\")\n\t}\n\n\tdata = `{\n\t\t\t\t\"assignee\": {\n\t\t\t\t\t\"type\": \"User\",\n\t\t\t\t\t\"id\": 1\n\t\t\t\t}\n\t\t\t}`\n\n\tbad := &User{\n\t\tID:   Ptr(int64(1)),\n\t\tType: Ptr(\"User\"),\n\t}\n\n\terr = json.Unmarshal([]byte(data), seatDetails)\n\tif err != nil {\n\t\tt.Errorf(\"CopilotSeatDetails.UnmarshalJSON returned an unexpected error: %v\", err)\n\t}\n\n\tif got, ok := seatDetails.GetTeam(); ok {\n\t\tt.Errorf(\"CopilotSeatDetails.GetTeam returned true, expected false. Returned %v, expected %v\", got, bad)\n\t}\n}\n\nfunc TestCopilotService_GetSeatDetailsOrganization(t *testing.T) {\n\tt.Parallel()\n\tdata := `{\n\t\t\t\t\"assignee\": {\n\t\t\t\t\t\"type\": \"Organization\",\n\t\t\t\t\t\"id\": 1\n\t\t\t\t}\n\t\t\t}`\n\n\tvar seatDetails *CopilotSeatDetails\n\n\terr := json.Unmarshal([]byte(data), &seatDetails)\n\tif err != nil {\n\t\tt.Errorf(\"CopilotSeatDetails.UnmarshalJSON returned an unexpected error: %v\", err)\n\t}\n\n\twant := &Organization{\n\t\tID:   Ptr(int64(1)),\n\t\tType: Ptr(\"Organization\"),\n\t}\n\n\tif got, ok := seatDetails.GetOrganization(); ok && !cmp.Equal(got, want) {\n\t\tt.Errorf(\"CopilotSeatDetails.GetOrganization returned %+v, want %+v\", got, want)\n\t} else if !ok {\n\t\tt.Error(\"CopilotSeatDetails.GetOrganization returned false, expected true\")\n\t}\n\n\tdata = `{\n\t\t\t\t\"assignee\": {\n\t\t\t\t\t\"type\": \"Team\",\n\t\t\t\t\t\"id\": 1\n\t\t\t\t}\n\t\t\t}`\n\n\tbad := &Team{\n\t\tID: Ptr(int64(1)),\n\t}\n\n\terr = json.Unmarshal([]byte(data), seatDetails)\n\tif err != nil {\n\t\tt.Errorf(\"CopilotSeatDetails.UnmarshalJSON returned an unexpected error: %v\", err)\n\t}\n\n\tif got, ok := seatDetails.GetOrganization(); ok {\n\t\tt.Errorf(\"CopilotSeatDetails.GetOrganization returned true, expected false. Returned %v, expected %v\", got, bad)\n\t}\n}\n\nfunc TestCopilotService_GetCopilotBilling(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/copilot/billing\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"seat_breakdown\": {\n\t\t\t\t\"total\": 12,\n\t\t\t\t\"added_this_cycle\": 9,\n\t\t\t\t\"pending_invitation\": 0,\n\t\t\t\t\"pending_cancellation\": 0,\n\t\t\t\t\"active_this_cycle\": 12,\n\t\t\t\t\"inactive_this_cycle\": 11\n\t\t\t},\n\t\t\t\"seat_management_setting\": \"assign_selected\",\n\t\t\t\"public_code_suggestions\": \"block\"\n\t\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Copilot.GetCopilotBilling(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Copilot.GetCopilotBilling returned error: %v\", err)\n\t}\n\n\twant := &CopilotOrganizationDetails{\n\t\tSeatBreakdown: &CopilotSeatBreakdown{\n\t\t\tTotal:               12,\n\t\t\tAddedThisCycle:      9,\n\t\t\tPendingInvitation:   0,\n\t\t\tPendingCancellation: 0,\n\t\t\tActiveThisCycle:     12,\n\t\t\tInactiveThisCycle:   11,\n\t\t},\n\t\tPublicCodeSuggestions: \"block\",\n\t\tCopilotChat:           \"\",\n\t\tSeatManagementSetting: \"assign_selected\",\n\t}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Copilot.GetCopilotBilling returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"GetCopilotBilling\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Copilot.GetCopilotBilling(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Copilot.GetCopilotBilling(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"Copilot.GetCopilotBilling returned %+v, want nil\", got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCopilotService_ListCopilotSeats(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/copilot/billing/seats\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"per_page\": \"100\",\n\t\t\t\"page\":     \"1\",\n\t\t})\n\t\tfmt.Fprint(w, `{\n\t\t\t\t\"total_seats\": 4,\n\t\t\t\t\"seats\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"created_at\": \"2021-08-03T18:00:00-06:00\",\n\t\t\t\t\t\t\"updated_at\": \"2021-09-23T15:00:00-06:00\",\n\t\t\t\t\t\t\"pending_cancellation_date\": null,\n\t\t\t\t\t\t\"last_activity_at\": \"2021-10-14T00:53:32-06:00\",\n\t\t\t\t\t\t\"last_activity_editor\": \"vscode/1.77.3/copilot/1.86.82\",\n\t\t\t\t\t\t\"assignee\": {\n\t\t\t\t\t\t\t\"login\": \"octocat\",\n\t\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\t\"node_id\": \"MDQ6VXNlcjE=\",\n\t\t\t\t\t\t\t\"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n\t\t\t\t\t\t\t\"gravatar_id\": \"\",\n\t\t\t\t\t\t\t\"url\": \"https://api.github.com/users/octocat\",\n\t\t\t\t\t\t\t\"html_url\": \"https://github.com/octocat\",\n\t\t\t\t\t\t\t\"followers_url\": \"https://api.github.com/users/octocat/followers\",\n\t\t\t\t\t\t\t\"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n\t\t\t\t\t\t\t\"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n\t\t\t\t\t\t\t\"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n\t\t\t\t\t\t\t\"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n\t\t\t\t\t\t\t\"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n\t\t\t\t\t\t\t\"repos_url\": \"https://api.github.com/users/octocat/repos\",\n\t\t\t\t\t\t\t\"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n\t\t\t\t\t\t\t\"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n\t\t\t\t\t\t\t\"type\": \"User\",\n\t\t\t\t\t\t\t\"site_admin\": false\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"assigning_team\": {\n\t\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\t\"node_id\": \"MDQ6VGVhbTE=\",\n\t\t\t\t\t\t\t\"url\": \"https://api.github.com/teams/1\",\n\t\t\t\t\t\t\t\"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n\t\t\t\t\t\t\t\"name\": \"Justice League\",\n\t\t\t\t\t\t\t\"slug\": \"justice-league\",\n\t\t\t\t\t\t\t\"description\": \"A great team.\",\n\t\t\t\t\t\t\t\"privacy\": \"closed\",\n\t\t\t\t\t\t\t\"notification_setting\": \"notifications_enabled\",\n\t\t\t\t\t\t\t\"permission\": \"admin\",\n\t\t\t\t\t\t\t\"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n\t\t\t\t\t\t\t\"repositories_url\": \"https://api.github.com/teams/1/repos\",\n\t\t\t\t\t\t\t\"parent\": null\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"created_at\": \"2021-09-23T18:00:00-06:00\",\n\t\t\t\t\t\t\"updated_at\": \"2021-09-23T15:00:00-06:00\",\n\t\t\t\t\t\t\"pending_cancellation_date\": \"2021-11-01\",\n\t\t\t\t\t\t\"last_activity_at\": \"2021-10-13T00:53:32-06:00\",\n\t\t\t\t\t\t\"last_activity_editor\": \"vscode/1.77.3/copilot/1.86.82\",\n\t\t\t\t\t\t\"assignee\": {\n\t\t\t\t\t\t\t\"login\": \"octokitten\",\n\t\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\t\"node_id\": \"MDQ76VNlcjE=\",\n\t\t\t\t\t\t\t\"avatar_url\": \"https://github.com/images/error/octokitten_happy.gif\",\n\t\t\t\t\t\t\t\"gravatar_id\": \"\",\n\t\t\t\t\t\t\t\"url\": \"https://api.github.com/users/octokitten\",\n\t\t\t\t\t\t\t\"html_url\": \"https://github.com/octokitten\",\n\t\t\t\t\t\t\t\"followers_url\": \"https://api.github.com/users/octokitten/followers\",\n\t\t\t\t\t\t\t\"following_url\": \"https://api.github.com/users/octokitten/following{/other_user}\",\n\t\t\t\t\t\t\t\"gists_url\": \"https://api.github.com/users/octokitten/gists{/gist_id}\",\n\t\t\t\t\t\t\t\"starred_url\": \"https://api.github.com/users/octokitten/starred{/owner}{/repo}\",\n\t\t\t\t\t\t\t\"subscriptions_url\": \"https://api.github.com/users/octokitten/subscriptions\",\n\t\t\t\t\t\t\t\"organizations_url\": \"https://api.github.com/users/octokitten/orgs\",\n\t\t\t\t\t\t\t\"repos_url\": \"https://api.github.com/users/octokitten/repos\",\n\t\t\t\t\t\t\t\"events_url\": \"https://api.github.com/users/octokitten/events{/privacy}\",\n\t\t\t\t\t\t\t\"received_events_url\": \"https://api.github.com/users/octokitten/received_events\",\n\t\t\t\t\t\t\t\"type\": \"User\",\n\t\t\t\t\t\t\t\"site_admin\": false\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"created_at\": \"2021-09-23T18:00:00-06:00\",\n\t\t\t\t\t\t\"updated_at\": \"2021-09-23T15:00:00-06:00\",\n\t\t\t\t\t\t\"pending_cancellation_date\": \"2021-11-01\",\n\t\t\t\t\t\t\"last_activity_at\": \"2021-10-13T00:53:32-06:00\",\n\t\t\t\t\t\t\"last_activity_editor\": \"vscode/1.77.3/copilot/1.86.82\",\n\t\t\t\t\t\t\"assignee\": {\n\t\t\t\t\t\t\t\"name\": \"octokittens\",\n\t\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\t\"type\": \"Team\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"created_at\": \"2021-09-23T18:00:00-06:00\",\n\t\t\t\t\t\t\"updated_at\": \"2021-09-23T15:00:00-06:00\",\n\t\t\t\t\t\t\"pending_cancellation_date\": \"2021-11-01\",\n\t\t\t\t\t\t\"last_activity_at\": \"2021-10-13T00:53:32-06:00\",\n\t\t\t\t\t\t\"last_activity_editor\": \"vscode/1.77.3/copilot/1.86.82\",\n\t\t\t\t\t\t\"assignee\": {\n\t\t\t\t\t\t\t\"name\": \"octocats\",\n\t\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\t\"type\": \"Organization\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}`)\n\t})\n\n\tctx := t.Context()\n\topts := &ListOptions{Page: 1, PerPage: 100}\n\tgot, _, err := client.Copilot.ListCopilotSeats(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Copilot.ListCopilotSeats returned error: %v\", err)\n\t}\n\n\twant := &ListCopilotSeatsResponse{\n\t\tTotalSeats: 4,\n\t\tSeats: []*CopilotSeatDetails{\n\t\t\t{\n\t\t\t\tAssignee: &User{\n\t\t\t\t\tLogin:             Ptr(\"octocat\"),\n\t\t\t\t\tID:                Ptr(int64(1)),\n\t\t\t\t\tNodeID:            Ptr(\"MDQ6VXNlcjE=\"),\n\t\t\t\t\tAvatarURL:         Ptr(\"https://github.com/images/error/octocat_happy.gif\"),\n\t\t\t\t\tGravatarID:        Ptr(\"\"),\n\t\t\t\t\tURL:               Ptr(\"https://api.github.com/users/octocat\"),\n\t\t\t\t\tHTMLURL:           Ptr(\"https://github.com/octocat\"),\n\t\t\t\t\tFollowersURL:      Ptr(\"https://api.github.com/users/octocat/followers\"),\n\t\t\t\t\tFollowingURL:      Ptr(\"https://api.github.com/users/octocat/following{/other_user}\"),\n\t\t\t\t\tGistsURL:          Ptr(\"https://api.github.com/users/octocat/gists{/gist_id}\"),\n\t\t\t\t\tStarredURL:        Ptr(\"https://api.github.com/users/octocat/starred{/owner}{/repo}\"),\n\t\t\t\t\tSubscriptionsURL:  Ptr(\"https://api.github.com/users/octocat/subscriptions\"),\n\t\t\t\t\tOrganizationsURL:  Ptr(\"https://api.github.com/users/octocat/orgs\"),\n\t\t\t\t\tReposURL:          Ptr(\"https://api.github.com/users/octocat/repos\"),\n\t\t\t\t\tEventsURL:         Ptr(\"https://api.github.com/users/octocat/events{/privacy}\"),\n\t\t\t\t\tReceivedEventsURL: Ptr(\"https://api.github.com/users/octocat/received_events\"),\n\t\t\t\t\tType:              Ptr(\"User\"),\n\t\t\t\t\tSiteAdmin:         Ptr(false),\n\t\t\t\t},\n\t\t\t\tAssigningTeam: &Team{\n\t\t\t\t\tID:                  Ptr(int64(1)),\n\t\t\t\t\tNodeID:              Ptr(\"MDQ6VGVhbTE=\"),\n\t\t\t\t\tURL:                 Ptr(\"https://api.github.com/teams/1\"),\n\t\t\t\t\tHTMLURL:             Ptr(\"https://github.com/orgs/github/teams/justice-league\"),\n\t\t\t\t\tName:                Ptr(\"Justice League\"),\n\t\t\t\t\tSlug:                Ptr(\"justice-league\"),\n\t\t\t\t\tDescription:         Ptr(\"A great team.\"),\n\t\t\t\t\tPrivacy:             Ptr(\"closed\"),\n\t\t\t\t\tPermission:          Ptr(\"admin\"),\n\t\t\t\t\tNotificationSetting: Ptr(\"notifications_enabled\"),\n\t\t\t\t\tMembersURL:          Ptr(\"https://api.github.com/teams/1/members{/member}\"),\n\t\t\t\t\tRepositoriesURL:     Ptr(\"https://api.github.com/teams/1/repos\"),\n\t\t\t\t\tParent:              nil,\n\t\t\t\t},\n\n\t\t\t\tCreatedAt:               Ptr(Timestamp{time.Date(2021, time.August, 3, 18, 0, 0, 0, time.FixedZone(\"CST\", -6*3600))}),\n\t\t\t\tUpdatedAt:               Ptr(Timestamp{time.Date(2021, time.September, 23, 15, 0, 0, 0, time.FixedZone(\"CST\", -6*3600))}),\n\t\t\t\tPendingCancellationDate: nil,\n\t\t\t\tLastActivityAt:          Ptr(Timestamp{time.Date(2021, time.October, 14, 0, 53, 32, 0, time.FixedZone(\"CST\", -6*3600))}),\n\t\t\t\tLastActivityEditor:      Ptr(\"vscode/1.77.3/copilot/1.86.82\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\tAssignee: &User{\n\t\t\t\t\tLogin:             Ptr(\"octokitten\"),\n\t\t\t\t\tID:                Ptr(int64(1)),\n\t\t\t\t\tNodeID:            Ptr(\"MDQ76VNlcjE=\"),\n\t\t\t\t\tAvatarURL:         Ptr(\"https://github.com/images/error/octokitten_happy.gif\"),\n\t\t\t\t\tGravatarID:        Ptr(\"\"),\n\t\t\t\t\tURL:               Ptr(\"https://api.github.com/users/octokitten\"),\n\t\t\t\t\tHTMLURL:           Ptr(\"https://github.com/octokitten\"),\n\t\t\t\t\tFollowersURL:      Ptr(\"https://api.github.com/users/octokitten/followers\"),\n\t\t\t\t\tFollowingURL:      Ptr(\"https://api.github.com/users/octokitten/following{/other_user}\"),\n\t\t\t\t\tGistsURL:          Ptr(\"https://api.github.com/users/octokitten/gists{/gist_id}\"),\n\t\t\t\t\tStarredURL:        Ptr(\"https://api.github.com/users/octokitten/starred{/owner}{/repo}\"),\n\t\t\t\t\tSubscriptionsURL:  Ptr(\"https://api.github.com/users/octokitten/subscriptions\"),\n\t\t\t\t\tOrganizationsURL:  Ptr(\"https://api.github.com/users/octokitten/orgs\"),\n\t\t\t\t\tReposURL:          Ptr(\"https://api.github.com/users/octokitten/repos\"),\n\t\t\t\t\tEventsURL:         Ptr(\"https://api.github.com/users/octokitten/events{/privacy}\"),\n\t\t\t\t\tReceivedEventsURL: Ptr(\"https://api.github.com/users/octokitten/received_events\"),\n\t\t\t\t\tType:              Ptr(\"User\"),\n\t\t\t\t\tSiteAdmin:         Ptr(false),\n\t\t\t\t},\n\t\t\t\tAssigningTeam:           nil,\n\t\t\t\tCreatedAt:               Ptr(Timestamp{time.Date(2021, time.September, 23, 18, 0, 0, 0, time.FixedZone(\"CST\", -6*3600))}),\n\t\t\t\tUpdatedAt:               Ptr(Timestamp{time.Date(2021, time.September, 23, 15, 0, 0, 0, time.FixedZone(\"CST\", -6*3600))}),\n\t\t\t\tPendingCancellationDate: Ptr(\"2021-11-01\"),\n\t\t\t\tLastActivityAt:          Ptr(Timestamp{time.Date(2021, time.October, 13, 0, 53, 32, 0, time.FixedZone(\"CST\", -6*3600))}),\n\t\t\t\tLastActivityEditor:      Ptr(\"vscode/1.77.3/copilot/1.86.82\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\tAssignee: &Team{\n\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\tName: Ptr(\"octokittens\"),\n\t\t\t\t\tType: Ptr(\"Team\"),\n\t\t\t\t},\n\t\t\t\tAssigningTeam:           nil,\n\t\t\t\tCreatedAt:               Ptr(Timestamp{time.Date(2021, time.September, 23, 18, 0, 0, 0, time.FixedZone(\"CST\", -6*3600))}),\n\t\t\t\tUpdatedAt:               Ptr(Timestamp{time.Date(2021, time.September, 23, 15, 0, 0, 0, time.FixedZone(\"CST\", -6*3600))}),\n\t\t\t\tPendingCancellationDate: Ptr(\"2021-11-01\"),\n\t\t\t\tLastActivityAt:          Ptr(Timestamp{time.Date(2021, time.October, 13, 0, 53, 32, 0, time.FixedZone(\"CST\", -6*3600))}),\n\t\t\t\tLastActivityEditor:      Ptr(\"vscode/1.77.3/copilot/1.86.82\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\tAssignee: &Organization{\n\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\tName: Ptr(\"octocats\"),\n\t\t\t\t\tType: Ptr(\"Organization\"),\n\t\t\t\t},\n\t\t\t\tAssigningTeam:           nil,\n\t\t\t\tCreatedAt:               Ptr(Timestamp{time.Date(2021, time.September, 23, 18, 0, 0, 0, time.FixedZone(\"CST\", -6*3600))}),\n\t\t\t\tUpdatedAt:               Ptr(Timestamp{time.Date(2021, time.September, 23, 15, 0, 0, 0, time.FixedZone(\"CST\", -6*3600))}),\n\t\t\t\tPendingCancellationDate: Ptr(\"2021-11-01\"),\n\t\t\t\tLastActivityAt:          Ptr(Timestamp{time.Date(2021, time.October, 13, 0, 53, 32, 0, time.FixedZone(\"CST\", -6*3600))}),\n\t\t\t\tLastActivityEditor:      Ptr(\"vscode/1.77.3/copilot/1.86.82\"),\n\t\t\t},\n\t\t},\n\t}\n\n\tassertNoDiff(t, want, got)\n\n\tconst methodName = \"ListCopilotSeats\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Copilot.ListCopilotSeats(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Copilot.ListCopilotSeats(ctx, \"o\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"Copilot.ListCopilotSeats returned %+v, want nil\", got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCopilotService_ListCopilotEnterpriseSeats(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/copilot/billing/seats\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"per_page\": \"100\",\n\t\t\t\"page\":     \"1\",\n\t\t})\n\t\tfmt.Fprint(w, `{\n\t\t\t\"total_seats\": 2,\n\t\t\t\"seats\": [\n\t\t\t\t{\n\t\t\t\t\t\"created_at\": \"2021-08-03T18:00:00-06:00\",\n\t\t\t\t\t\"updated_at\": \"2021-09-23T15:00:00-06:00\",\n\t\t\t\t\t\"pending_cancellation_date\": null,\n\t\t\t\t\t\"last_activity_at\": \"2021-10-14T00:53:32-06:00\",\n\t\t\t\t\t\"last_activity_editor\": \"vscode/1.77.3/copilot/1.86.82\",\n\t\t\t\t\t\"plan_type\": \"business\",\n\t\t\t\t\t\"assignee\": {\n\t\t\t\t\t\t\"login\": \"octocat\",\n\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\"node_id\": \"MDQ6VXNlcjE=\",\n\t\t\t\t\t\t\"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n\t\t\t\t\t\t\"gravatar_id\": \"\",\n\t\t\t\t\t\t\"url\": \"https://api.github.com/users/octocat\",\n\t\t\t\t\t\t\"html_url\": \"https://github.com/octocat\",\n\t\t\t\t\t\t\"followers_url\": \"https://api.github.com/users/octocat/followers\",\n\t\t\t\t\t\t\"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n\t\t\t\t\t\t\"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n\t\t\t\t\t\t\"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n\t\t\t\t\t\t\"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n\t\t\t\t\t\t\"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n\t\t\t\t\t\t\"repos_url\": \"https://api.github.com/users/octocat/repos\",\n\t\t\t\t\t\t\"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n\t\t\t\t\t\t\"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n\t\t\t\t\t\t\"type\": \"User\",\n\t\t\t\t\t\t\"site_admin\": false\n\t\t\t\t\t},\n\t\t\t\t\t\"assigning_team\": {\n\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\"node_id\": \"MDQ6VGVhbTE=\",\n\t\t\t\t\t\t\"url\": \"https://api.github.com/teams/1\",\n\t\t\t\t\t\t\"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n\t\t\t\t\t\t\"name\": \"Justice League\",\n\t\t\t\t\t\t\"slug\": \"justice-league\",\n\t\t\t\t\t\t\"description\": \"A great team.\",\n\t\t\t\t\t\t\"privacy\": \"closed\",\n\t\t\t\t\t\t\"notification_setting\": \"notifications_enabled\",\n\t\t\t\t\t\t\"permission\": \"admin\",\n\t\t\t\t\t\t\"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n\t\t\t\t\t\t\"repositories_url\": \"https://api.github.com/teams/1/repos\",\n\t\t\t\t\t\t\"parent\": null\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"created_at\": \"2021-09-23T18:00:00-06:00\",\n\t\t\t\t\t\"updated_at\": \"2021-09-23T15:00:00-06:00\",\n\t\t\t\t\t\"pending_cancellation_date\": \"2021-11-01\",\n\t\t\t\t\t\"last_activity_at\": \"2021-10-13T00:53:32-06:00\",\n\t\t\t\t\t\"last_activity_editor\": \"vscode/1.77.3/copilot/1.86.82\",\n\t\t\t\t\t\"assignee\": {\n\t\t\t\t\t\t\"login\": \"octokitten\",\n\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\"node_id\": \"MDQ76VNlcjE=\",\n\t\t\t\t\t\t\"avatar_url\": \"https://github.com/images/error/octokitten_happy.gif\",\n\t\t\t\t\t\t\"gravatar_id\": \"\",\n\t\t\t\t\t\t\"url\": \"https://api.github.com/users/octokitten\",\n\t\t\t\t\t\t\"html_url\": \"https://github.com/octokitten\",\n\t\t\t\t\t\t\"followers_url\": \"https://api.github.com/users/octokitten/followers\",\n\t\t\t\t\t\t\"following_url\": \"https://api.github.com/users/octokitten/following{/other_user}\",\n\t\t\t\t\t\t\"gists_url\": \"https://api.github.com/users/octokitten/gists{/gist_id}\",\n\t\t\t\t\t\t\"starred_url\": \"https://api.github.com/users/octokitten/starred{/owner}{/repo}\",\n\t\t\t\t\t\t\"subscriptions_url\": \"https://api.github.com/users/octokitten/subscriptions\",\n\t\t\t\t\t\t\"organizations_url\": \"https://api.github.com/users/octokitten/orgs\",\n\t\t\t\t\t\t\"repos_url\": \"https://api.github.com/users/octokitten/repos\",\n\t\t\t\t\t\t\"events_url\": \"https://api.github.com/users/octokitten/events{/privacy}\",\n\t\t\t\t\t\t\"received_events_url\": \"https://api.github.com/users/octokitten/received_events\",\n\t\t\t\t\t\t\"type\": \"User\",\n\t\t\t\t\t\t\"site_admin\": false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\topts := &ListOptions{Page: 1, PerPage: 100}\n\tgot, _, err := client.Copilot.ListCopilotEnterpriseSeats(ctx, \"e\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Copilot.ListCopilotEnterpriseSeats returned error: %v\", err)\n\t}\n\n\twant := &ListCopilotSeatsResponse{\n\t\tTotalSeats: 2,\n\t\tSeats: []*CopilotSeatDetails{\n\t\t\t{\n\t\t\t\tAssignee: &User{\n\t\t\t\t\tLogin:             Ptr(\"octocat\"),\n\t\t\t\t\tID:                Ptr(int64(1)),\n\t\t\t\t\tNodeID:            Ptr(\"MDQ6VXNlcjE=\"),\n\t\t\t\t\tAvatarURL:         Ptr(\"https://github.com/images/error/octocat_happy.gif\"),\n\t\t\t\t\tGravatarID:        Ptr(\"\"),\n\t\t\t\t\tURL:               Ptr(\"https://api.github.com/users/octocat\"),\n\t\t\t\t\tHTMLURL:           Ptr(\"https://github.com/octocat\"),\n\t\t\t\t\tFollowersURL:      Ptr(\"https://api.github.com/users/octocat/followers\"),\n\t\t\t\t\tFollowingURL:      Ptr(\"https://api.github.com/users/octocat/following{/other_user}\"),\n\t\t\t\t\tGistsURL:          Ptr(\"https://api.github.com/users/octocat/gists{/gist_id}\"),\n\t\t\t\t\tStarredURL:        Ptr(\"https://api.github.com/users/octocat/starred{/owner}{/repo}\"),\n\t\t\t\t\tSubscriptionsURL:  Ptr(\"https://api.github.com/users/octocat/subscriptions\"),\n\t\t\t\t\tOrganizationsURL:  Ptr(\"https://api.github.com/users/octocat/orgs\"),\n\t\t\t\t\tReposURL:          Ptr(\"https://api.github.com/users/octocat/repos\"),\n\t\t\t\t\tEventsURL:         Ptr(\"https://api.github.com/users/octocat/events{/privacy}\"),\n\t\t\t\t\tReceivedEventsURL: Ptr(\"https://api.github.com/users/octocat/received_events\"),\n\t\t\t\t\tType:              Ptr(\"User\"),\n\t\t\t\t\tSiteAdmin:         Ptr(false),\n\t\t\t\t},\n\t\t\t\tAssigningTeam: &Team{\n\t\t\t\t\tID:                  Ptr(int64(1)),\n\t\t\t\t\tNodeID:              Ptr(\"MDQ6VGVhbTE=\"),\n\t\t\t\t\tURL:                 Ptr(\"https://api.github.com/teams/1\"),\n\t\t\t\t\tHTMLURL:             Ptr(\"https://github.com/orgs/github/teams/justice-league\"),\n\t\t\t\t\tName:                Ptr(\"Justice League\"),\n\t\t\t\t\tSlug:                Ptr(\"justice-league\"),\n\t\t\t\t\tDescription:         Ptr(\"A great team.\"),\n\t\t\t\t\tPrivacy:             Ptr(\"closed\"),\n\t\t\t\t\tNotificationSetting: Ptr(\"notifications_enabled\"),\n\t\t\t\t\tPermission:          Ptr(\"admin\"),\n\t\t\t\t\tMembersURL:          Ptr(\"https://api.github.com/teams/1/members{/member}\"),\n\t\t\t\t\tRepositoriesURL:     Ptr(\"https://api.github.com/teams/1/repos\"),\n\t\t\t\t\tParent:              nil,\n\t\t\t\t},\n\t\t\t\tCreatedAt:               Ptr(Timestamp{time.Date(2021, time.August, 3, 18, 0, 0, 0, time.FixedZone(\"CST\", -6*3600))}),\n\t\t\t\tUpdatedAt:               Ptr(Timestamp{time.Date(2021, time.September, 23, 15, 0, 0, 0, time.FixedZone(\"CST\", -6*3600))}),\n\t\t\t\tPendingCancellationDate: nil,\n\t\t\t\tLastActivityAt:          Ptr(Timestamp{time.Date(2021, time.October, 14, 0, 53, 32, 0, time.FixedZone(\"CST\", -6*3600))}),\n\t\t\t\tLastActivityEditor:      Ptr(\"vscode/1.77.3/copilot/1.86.82\"),\n\t\t\t\tPlanType:                Ptr(\"business\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\tAssignee: &User{\n\t\t\t\t\tLogin:             Ptr(\"octokitten\"),\n\t\t\t\t\tID:                Ptr(int64(1)),\n\t\t\t\t\tNodeID:            Ptr(\"MDQ76VNlcjE=\"),\n\t\t\t\t\tAvatarURL:         Ptr(\"https://github.com/images/error/octokitten_happy.gif\"),\n\t\t\t\t\tGravatarID:        Ptr(\"\"),\n\t\t\t\t\tURL:               Ptr(\"https://api.github.com/users/octokitten\"),\n\t\t\t\t\tHTMLURL:           Ptr(\"https://github.com/octokitten\"),\n\t\t\t\t\tFollowersURL:      Ptr(\"https://api.github.com/users/octokitten/followers\"),\n\t\t\t\t\tFollowingURL:      Ptr(\"https://api.github.com/users/octokitten/following{/other_user}\"),\n\t\t\t\t\tGistsURL:          Ptr(\"https://api.github.com/users/octokitten/gists{/gist_id}\"),\n\t\t\t\t\tStarredURL:        Ptr(\"https://api.github.com/users/octokitten/starred{/owner}{/repo}\"),\n\t\t\t\t\tSubscriptionsURL:  Ptr(\"https://api.github.com/users/octokitten/subscriptions\"),\n\t\t\t\t\tOrganizationsURL:  Ptr(\"https://api.github.com/users/octokitten/orgs\"),\n\t\t\t\t\tReposURL:          Ptr(\"https://api.github.com/users/octokitten/repos\"),\n\t\t\t\t\tEventsURL:         Ptr(\"https://api.github.com/users/octokitten/events{/privacy}\"),\n\t\t\t\t\tReceivedEventsURL: Ptr(\"https://api.github.com/users/octokitten/received_events\"),\n\t\t\t\t\tType:              Ptr(\"User\"),\n\t\t\t\t\tSiteAdmin:         Ptr(false),\n\t\t\t\t},\n\t\t\t\tAssigningTeam:           nil,\n\t\t\t\tCreatedAt:               Ptr(Timestamp{time.Date(2021, time.September, 23, 18, 0, 0, 0, time.FixedZone(\"CST\", -6*3600))}),\n\t\t\t\tUpdatedAt:               Ptr(Timestamp{time.Date(2021, time.September, 23, 15, 0, 0, 0, time.FixedZone(\"CST\", -6*3600))}),\n\t\t\t\tPendingCancellationDate: Ptr(\"2021-11-01\"),\n\t\t\t\tLastActivityAt:          Ptr(Timestamp{time.Date(2021, time.October, 13, 0, 53, 32, 0, time.FixedZone(\"CST\", -6*3600))}),\n\t\t\t\tLastActivityEditor:      Ptr(\"vscode/1.77.3/copilot/1.86.82\"),\n\t\t\t\tPlanType:                nil,\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tlog.Printf(\"got: %+v\", got.Seats[1])\n\t\tlog.Printf(\"want: %+v\", want.Seats[1])\n\t\tt.Errorf(\"Copilot.ListCopilotEnterpriseSeats returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ListCopilotEnterpriseSeats\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Copilot.ListCopilotEnterpriseSeats(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Copilot.ListCopilotEnterpriseSeats(ctx, \"e\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"Copilot.ListCopilotEnterpriseSeats returned %+v, want nil\", got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCopilotService_AddCopilotTeams(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/copilot/billing/selected_teams\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestBody(t, r, `{\"selected_teams\":[\"team1\",\"team2\"]}`+\"\\n\")\n\t\tfmt.Fprint(w, `{\"seats_created\": 2}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Copilot.AddCopilotTeams(ctx, \"o\", []string{\"team1\", \"team2\"})\n\tif err != nil {\n\t\tt.Errorf(\"Copilot.AddCopilotTeams returned error: %v\", err)\n\t}\n\n\twant := &SeatAssignments{SeatsCreated: 2}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Copilot.AddCopilotTeams returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"AddCopilotTeams\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Copilot.AddCopilotTeams(ctx, \"\\n\", []string{\"team1\", \"team2\"})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Copilot.AddCopilotTeams(ctx, \"o\", []string{\"team1\", \"team2\"})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"Copilot.AddCopilotTeams returned %+v, want nil\", got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCopilotService_RemoveCopilotTeams(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/copilot/billing/selected_teams\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestBody(t, r, `{\"selected_teams\":[\"team1\",\"team2\"]}`+\"\\n\")\n\t\tfmt.Fprint(w, `{\"seats_cancelled\": 2}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Copilot.RemoveCopilotTeams(ctx, \"o\", []string{\"team1\", \"team2\"})\n\tif err != nil {\n\t\tt.Errorf(\"Copilot.RemoveCopilotTeams returned error: %v\", err)\n\t}\n\n\twant := &SeatCancellations{SeatsCancelled: 2}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Copilot.RemoveCopilotTeams returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"RemoveCopilotTeams\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Copilot.RemoveCopilotTeams(ctx, \"\\n\", []string{\"team1\", \"team2\"})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Copilot.RemoveCopilotTeams(ctx, \"o\", []string{\"team1\", \"team2\"})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"Copilot.RemoveCopilotTeams returned %+v, want nil\", got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCopilotService_AddCopilotUsers(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/copilot/billing/selected_users\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestBody(t, r, `{\"selected_usernames\":[\"user1\",\"user2\"]}`+\"\\n\")\n\t\tfmt.Fprint(w, `{\"seats_created\": 2}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Copilot.AddCopilotUsers(ctx, \"o\", []string{\"user1\", \"user2\"})\n\tif err != nil {\n\t\tt.Errorf(\"Copilot.AddCopilotUsers returned error: %v\", err)\n\t}\n\n\twant := &SeatAssignments{SeatsCreated: 2}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Copilot.AddCopilotUsers returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"AddCopilotUsers\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Copilot.AddCopilotUsers(ctx, \"\\n\", []string{\"user1\", \"user2\"})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Copilot.AddCopilotUsers(ctx, \"o\", []string{\"user1\", \"user2\"})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"Copilot.AddCopilotUsers returned %+v, want nil\", got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCopilotService_RemoveCopilotUsers(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/copilot/billing/selected_users\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestBody(t, r, `{\"selected_usernames\":[\"user1\",\"user2\"]}`+\"\\n\")\n\t\tfmt.Fprint(w, `{\"seats_cancelled\": 2}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Copilot.RemoveCopilotUsers(ctx, \"o\", []string{\"user1\", \"user2\"})\n\tif err != nil {\n\t\tt.Errorf(\"Copilot.RemoveCopilotUsers returned error: %v\", err)\n\t}\n\n\twant := &SeatCancellations{SeatsCancelled: 2}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Copilot.RemoveCopilotUsers returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"RemoveCopilotUsers\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Copilot.RemoveCopilotUsers(ctx, \"\\n\", []string{\"user1\", \"user2\"})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Copilot.RemoveCopilotUsers(ctx, \"o\", []string{\"user1\", \"user2\"})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"Copilot.RemoveCopilotUsers returned %+v, want nil\", got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCopilotService_GetSeatDetails(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/members/u/copilot\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\t\"created_at\": \"2021-08-03T18:00:00-06:00\",\n\t\t\t\t\"updated_at\": \"2021-09-23T15:00:00-06:00\",\n\t\t\t\t\"pending_cancellation_date\": null,\n\t\t\t\t\"last_activity_at\": \"2021-10-14T00:53:32-06:00\",\n\t\t\t\t\"last_activity_editor\": \"vscode/1.77.3/copilot/1.86.82\",\n\t\t\t\t\"assignee\": {\n\t\t\t\t\t\"login\": \"octocat\",\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"node_id\": \"MDQ6VXNlcjE=\",\n\t\t\t\t\t\"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n\t\t\t\t\t\"gravatar_id\": \"\",\n\t\t\t\t\t\"url\": \"https://api.github.com/users/octocat\",\n\t\t\t\t\t\"html_url\": \"https://github.com/octocat\",\n\t\t\t\t\t\"followers_url\": \"https://api.github.com/users/octocat/followers\",\n\t\t\t\t\t\"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n\t\t\t\t\t\"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n\t\t\t\t\t\"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n\t\t\t\t\t\"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n\t\t\t\t\t\"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n\t\t\t\t\t\"repos_url\": \"https://api.github.com/users/octocat/repos\",\n\t\t\t\t\t\"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n\t\t\t\t\t\"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n\t\t\t\t\t\"type\": \"User\",\n\t\t\t\t\t\"site_admin\": false\n\t\t\t\t},\n\t\t\t\t\"assigning_team\": {\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"node_id\": \"MDQ6VGVhbTE=\",\n\t\t\t\t\t\"url\": \"https://api.github.com/teams/1\",\n\t\t\t\t\t\"html_url\": \"https://github.com/orgs/github/teams/justice-league\",\n\t\t\t\t\t\"name\": \"Justice League\",\n\t\t\t\t\t\"slug\": \"justice-league\",\n\t\t\t\t\t\"description\": \"A great team.\",\n\t\t\t\t\t\"privacy\": \"closed\",\n\t\t\t\t\t\"notification_setting\": \"notifications_enabled\",\n\t\t\t\t\t\"permission\": \"admin\",\n\t\t\t\t\t\"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n\t\t\t\t\t\"repositories_url\": \"https://api.github.com/teams/1/repos\",\n\t\t\t\t\t\"parent\": null\n\t\t\t\t}\n\t\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Copilot.GetSeatDetails(ctx, \"o\", \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Copilot.GetSeatDetails returned error: %v\", err)\n\t}\n\n\twant := &CopilotSeatDetails{\n\t\tAssignee: &User{\n\t\t\tLogin:             Ptr(\"octocat\"),\n\t\t\tID:                Ptr(int64(1)),\n\t\t\tNodeID:            Ptr(\"MDQ6VXNlcjE=\"),\n\t\t\tAvatarURL:         Ptr(\"https://github.com/images/error/octocat_happy.gif\"),\n\t\t\tGravatarID:        Ptr(\"\"),\n\t\t\tURL:               Ptr(\"https://api.github.com/users/octocat\"),\n\t\t\tHTMLURL:           Ptr(\"https://github.com/octocat\"),\n\t\t\tFollowersURL:      Ptr(\"https://api.github.com/users/octocat/followers\"),\n\t\t\tFollowingURL:      Ptr(\"https://api.github.com/users/octocat/following{/other_user}\"),\n\t\t\tGistsURL:          Ptr(\"https://api.github.com/users/octocat/gists{/gist_id}\"),\n\t\t\tStarredURL:        Ptr(\"https://api.github.com/users/octocat/starred{/owner}{/repo}\"),\n\t\t\tSubscriptionsURL:  Ptr(\"https://api.github.com/users/octocat/subscriptions\"),\n\t\t\tOrganizationsURL:  Ptr(\"https://api.github.com/users/octocat/orgs\"),\n\t\t\tReposURL:          Ptr(\"https://api.github.com/users/octocat/repos\"),\n\t\t\tEventsURL:         Ptr(\"https://api.github.com/users/octocat/events{/privacy}\"),\n\t\t\tReceivedEventsURL: Ptr(\"https://api.github.com/users/octocat/received_events\"),\n\t\t\tType:              Ptr(\"User\"),\n\t\t\tSiteAdmin:         Ptr(false),\n\t\t},\n\t\tAssigningTeam: &Team{\n\t\t\tID:                  Ptr(int64(1)),\n\t\t\tNodeID:              Ptr(\"MDQ6VGVhbTE=\"),\n\t\t\tURL:                 Ptr(\"https://api.github.com/teams/1\"),\n\t\t\tHTMLURL:             Ptr(\"https://github.com/orgs/github/teams/justice-league\"),\n\t\t\tName:                Ptr(\"Justice League\"),\n\t\t\tSlug:                Ptr(\"justice-league\"),\n\t\t\tDescription:         Ptr(\"A great team.\"),\n\t\t\tPrivacy:             Ptr(\"closed\"),\n\t\t\tNotificationSetting: Ptr(\"notifications_enabled\"),\n\t\t\tPermission:          Ptr(\"admin\"),\n\t\t\tMembersURL:          Ptr(\"https://api.github.com/teams/1/members{/member}\"),\n\t\t\tRepositoriesURL:     Ptr(\"https://api.github.com/teams/1/repos\"),\n\t\t\tParent:              nil,\n\t\t},\n\t\tCreatedAt:               Ptr(Timestamp{time.Date(2021, time.August, 3, 18, 0, 0, 0, time.FixedZone(\"CST\", -6*3600))}),\n\t\tUpdatedAt:               Ptr(Timestamp{time.Date(2021, time.September, 23, 15, 0, 0, 0, time.FixedZone(\"CST\", -6*3600))}),\n\t\tPendingCancellationDate: nil,\n\t\tLastActivityAt:          Ptr(Timestamp{time.Date(2021, time.October, 14, 0, 53, 32, 0, time.FixedZone(\"CST\", -6*3600))}),\n\t\tLastActivityEditor:      Ptr(\"vscode/1.77.3/copilot/1.86.82\"),\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Copilot.GetSeatDetails returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"GetSeatDetails\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Copilot.GetSeatDetails(ctx, \"\\n\", \"u\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Copilot.GetSeatDetails(ctx, \"o\", \"u\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"Copilot.GetSeatDetails returned %+v, want nil\", got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCopilotService_GetEnterpriseMetrics(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/copilot/metrics\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[\n\t\t\t{\n\t\t\t\t\"date\": \"2024-06-24\",\n\t\t\t\t\"total_active_users\": 24,\n\t\t\t\t\"total_engaged_users\": 20,\n\t\t\t\t\"copilot_ide_code_completions\": {\n\t\t\t\t\"total_engaged_users\": 20,\n\t\t\t\t\"languages\": [\n\t\t\t\t\t{\n\t\t\t\t\t\"name\": \"python\",\n\t\t\t\t\t\"total_engaged_users\": 10\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\"name\": \"ruby\",\n\t\t\t\t\t\"total_engaged_users\": 10\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"editors\": [\n\t\t\t\t\t{\n\t\t\t\t\t\"name\": \"vscode\",\n\t\t\t\t\t\"total_engaged_users\": 13,\n\t\t\t\t\t\"models\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\"name\": \"default\",\n\t\t\t\t\t\t\"is_custom_model\": false,\n\t\t\t\t\t\t\"custom_model_training_date\": null,\n\t\t\t\t\t\t\"total_engaged_users\": 13,\n\t\t\t\t\t\t\"languages\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"python\",\n\t\t\t\t\t\t\t\"total_engaged_users\": 6,\n\t\t\t\t\t\t\t\"total_code_suggestions\": 249,\n\t\t\t\t\t\t\t\"total_code_acceptances\": 123,\n\t\t\t\t\t\t\t\"total_code_lines_suggested\": 225,\n\t\t\t\t\t\t\t\"total_code_lines_accepted\": 135\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ruby\",\n\t\t\t\t\t\t\t\"total_engaged_users\": 7,\n\t\t\t\t\t\t\t\"total_code_suggestions\": 496,\n\t\t\t\t\t\t\t\"total_code_acceptances\": 253,\n\t\t\t\t\t\t\t\"total_code_lines_suggested\": 520,\n\t\t\t\t\t\t\t\"total_code_lines_accepted\": 270\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\"name\": \"neovim\",\n\t\t\t\t\t\"total_engaged_users\": 7,\n\t\t\t\t\t\"models\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\"name\": \"a-custom-model\",\n\t\t\t\t\t\t\"is_custom_model\": true,\n\t\t\t\t\t\t\"custom_model_training_date\": \"2024-02-01\",\n\t\t\t\t\t\t\"languages\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"typescript\",\n\t\t\t\t\t\t\t\"total_engaged_users\": 3,\n\t\t\t\t\t\t\t\"total_code_suggestions\": 112,\n\t\t\t\t\t\t\t\"total_code_acceptances\": 56,\n\t\t\t\t\t\t\t\"total_code_lines_suggested\": 143,\n\t\t\t\t\t\t\t\"total_code_lines_accepted\": 61\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"go\",\n\t\t\t\t\t\t\t\"total_engaged_users\": 4,\n\t\t\t\t\t\t\t\"total_code_suggestions\": 132,\n\t\t\t\t\t\t\t\"total_code_acceptances\": 67,\n\t\t\t\t\t\t\t\"total_code_lines_suggested\": 154,\n\t\t\t\t\t\t\t\"total_code_lines_accepted\": 72\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"copilot_ide_chat\": {\n\t\t\t\t\"total_engaged_users\": 13,\n\t\t\t\t\"editors\": [\n\t\t\t\t\t{\n\t\t\t\t\t\"name\": \"vscode\",\n\t\t\t\t\t\"total_engaged_users\": 13,\n\t\t\t\t\t\"models\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\"name\": \"default\",\n\t\t\t\t\t\t\"is_custom_model\": false,\n\t\t\t\t\t\t\"custom_model_training_date\": null,\n\t\t\t\t\t\t\"total_engaged_users\": 12,\n\t\t\t\t\t\t\"total_chats\": 45,\n\t\t\t\t\t\t\"total_chat_insertion_events\": 12,\n\t\t\t\t\t\t\"total_chat_copy_events\": 16\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\"name\": \"a-custom-model\",\n\t\t\t\t\t\t\"is_custom_model\": true,\n\t\t\t\t\t\t\"custom_model_training_date\": \"2024-02-01\",\n\t\t\t\t\t\t\"total_engaged_users\": 1,\n\t\t\t\t\t\t\"total_chats\": 10,\n\t\t\t\t\t\t\"total_chat_insertion_events\": 11,\n\t\t\t\t\t\t\"total_chat_copy_events\": 3\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"copilot_dotcom_chat\": {\n\t\t\t\t\"total_engaged_users\": 14,\n\t\t\t\t\"models\": [\n\t\t\t\t\t{\n\t\t\t\t\t\"name\": \"default\",\n\t\t\t\t\t\"is_custom_model\": false,\n\t\t\t\t\t\"custom_model_training_date\": null,\n\t\t\t\t\t\"total_engaged_users\": 14,\n\t\t\t\t\t\"total_chats\": 38\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"copilot_dotcom_pull_requests\": {\n\t\t\t\t\"total_engaged_users\": 12,\n\t\t\t\t\"repositories\": [\n\t\t\t\t\t{\n\t\t\t\t\t\"name\": \"demo/repo1\",\n\t\t\t\t\t\"total_engaged_users\": 8,\n\t\t\t\t\t\"models\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\"name\": \"default\",\n\t\t\t\t\t\t\"is_custom_model\": false,\n\t\t\t\t\t\t\"custom_model_training_date\": null,\n\t\t\t\t\t\t\"total_pr_summaries_created\": 6,\n\t\t\t\t\t\t\"total_engaged_users\": 8\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\"name\": \"demo/repo2\",\n\t\t\t\t\t\"total_engaged_users\": 4,\n\t\t\t\t\t\"models\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\"name\": \"a-custom-model\",\n\t\t\t\t\t\t\"is_custom_model\": true,\n\t\t\t\t\t\t\"custom_model_training_date\": \"2024-02-01\",\n\t\t\t\t\t\t\"total_pr_summaries_created\": 10,\n\t\t\t\t\t\t\"total_engaged_users\": 4\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t]`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Copilot.GetEnterpriseMetrics(ctx, \"e\", &CopilotMetricsListOptions{})\n\tif err != nil {\n\t\tt.Errorf(\"Copilot.GetEnterpriseMetrics returned error: %v\", err)\n\t}\n\n\ttotalActiveUsers := 24\n\ttotalEngagedUsers := 20\n\twant := []*CopilotMetrics{\n\t\t{\n\t\t\tDate:              \"2024-06-24\",\n\t\t\tTotalActiveUsers:  &totalActiveUsers,\n\t\t\tTotalEngagedUsers: &totalEngagedUsers,\n\t\t\tCopilotIDECodeCompletions: &CopilotIDECodeCompletions{\n\t\t\t\tTotalEngagedUsers: 20,\n\t\t\t\tLanguages: []*CopilotIDECodeCompletionsLanguage{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:              \"python\",\n\t\t\t\t\t\tTotalEngagedUsers: 10,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tName:              \"ruby\",\n\t\t\t\t\t\tTotalEngagedUsers: 10,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tEditors: []*CopilotIDECodeCompletionsEditor{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:              \"vscode\",\n\t\t\t\t\t\tTotalEngagedUsers: 13,\n\t\t\t\t\t\tModels: []*CopilotIDECodeCompletionsModel{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:                    \"default\",\n\t\t\t\t\t\t\t\tIsCustomModel:           false,\n\t\t\t\t\t\t\t\tCustomModelTrainingDate: nil,\n\t\t\t\t\t\t\t\tTotalEngagedUsers:       13,\n\t\t\t\t\t\t\t\tLanguages: []*CopilotIDECodeCompletionsModelLanguage{\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tName:                    \"python\",\n\t\t\t\t\t\t\t\t\t\tTotalEngagedUsers:       6,\n\t\t\t\t\t\t\t\t\t\tTotalCodeSuggestions:    249,\n\t\t\t\t\t\t\t\t\t\tTotalCodeAcceptances:    123,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesSuggested: 225,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesAccepted:  135,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tName:                    \"ruby\",\n\t\t\t\t\t\t\t\t\t\tTotalEngagedUsers:       7,\n\t\t\t\t\t\t\t\t\t\tTotalCodeSuggestions:    496,\n\t\t\t\t\t\t\t\t\t\tTotalCodeAcceptances:    253,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesSuggested: 520,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesAccepted:  270,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tName:              \"neovim\",\n\t\t\t\t\t\tTotalEngagedUsers: 7,\n\t\t\t\t\t\tModels: []*CopilotIDECodeCompletionsModel{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:                    \"a-custom-model\",\n\t\t\t\t\t\t\t\tIsCustomModel:           true,\n\t\t\t\t\t\t\t\tCustomModelTrainingDate: Ptr(\"2024-02-01\"),\n\t\t\t\t\t\t\t\tLanguages: []*CopilotIDECodeCompletionsModelLanguage{\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tName:                    \"typescript\",\n\t\t\t\t\t\t\t\t\t\tTotalEngagedUsers:       3,\n\t\t\t\t\t\t\t\t\t\tTotalCodeSuggestions:    112,\n\t\t\t\t\t\t\t\t\t\tTotalCodeAcceptances:    56,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesSuggested: 143,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesAccepted:  61,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tName:                    \"go\",\n\t\t\t\t\t\t\t\t\t\tTotalEngagedUsers:       4,\n\t\t\t\t\t\t\t\t\t\tTotalCodeSuggestions:    132,\n\t\t\t\t\t\t\t\t\t\tTotalCodeAcceptances:    67,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesSuggested: 154,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesAccepted:  72,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tCopilotIDEChat: &CopilotIDEChat{\n\t\t\t\tTotalEngagedUsers: 13,\n\t\t\t\tEditors: []*CopilotIDEChatEditor{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:              \"vscode\",\n\t\t\t\t\t\tTotalEngagedUsers: 13,\n\t\t\t\t\t\tModels: []*CopilotIDEChatModel{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:                     \"default\",\n\t\t\t\t\t\t\t\tIsCustomModel:            false,\n\t\t\t\t\t\t\t\tCustomModelTrainingDate:  nil,\n\t\t\t\t\t\t\t\tTotalEngagedUsers:        12,\n\t\t\t\t\t\t\t\tTotalChats:               45,\n\t\t\t\t\t\t\t\tTotalChatInsertionEvents: 12,\n\t\t\t\t\t\t\t\tTotalChatCopyEvents:      16,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:                     \"a-custom-model\",\n\t\t\t\t\t\t\t\tIsCustomModel:            true,\n\t\t\t\t\t\t\t\tCustomModelTrainingDate:  Ptr(\"2024-02-01\"),\n\t\t\t\t\t\t\t\tTotalEngagedUsers:        1,\n\t\t\t\t\t\t\t\tTotalChats:               10,\n\t\t\t\t\t\t\t\tTotalChatInsertionEvents: 11,\n\t\t\t\t\t\t\t\tTotalChatCopyEvents:      3,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tCopilotDotcomChat: &CopilotDotcomChat{\n\t\t\t\tTotalEngagedUsers: 14,\n\t\t\t\tModels: []*CopilotDotcomChatModel{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:                    \"default\",\n\t\t\t\t\t\tIsCustomModel:           false,\n\t\t\t\t\t\tCustomModelTrainingDate: nil,\n\t\t\t\t\t\tTotalEngagedUsers:       14,\n\t\t\t\t\t\tTotalChats:              38,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tCopilotDotcomPullRequests: &CopilotDotcomPullRequests{\n\t\t\t\tTotalEngagedUsers: 12,\n\t\t\t\tRepositories: []*CopilotDotcomPullRequestsRepository{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:              \"demo/repo1\",\n\t\t\t\t\t\tTotalEngagedUsers: 8,\n\t\t\t\t\t\tModels: []*CopilotDotcomPullRequestsModel{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:                    \"default\",\n\t\t\t\t\t\t\t\tIsCustomModel:           false,\n\t\t\t\t\t\t\t\tCustomModelTrainingDate: nil,\n\t\t\t\t\t\t\t\tTotalPRSummariesCreated: 6,\n\t\t\t\t\t\t\t\tTotalEngagedUsers:       8,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tName:              \"demo/repo2\",\n\t\t\t\t\t\tTotalEngagedUsers: 4,\n\t\t\t\t\t\tModels: []*CopilotDotcomPullRequestsModel{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:                    \"a-custom-model\",\n\t\t\t\t\t\t\t\tIsCustomModel:           true,\n\t\t\t\t\t\t\t\tCustomModelTrainingDate: Ptr(\"2024-02-01\"),\n\t\t\t\t\t\t\t\tTotalPRSummariesCreated: 10,\n\t\t\t\t\t\t\t\tTotalEngagedUsers:       4,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Copilot.GetEnterpriseMetrics returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"GetEnterpriseMetrics\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Copilot.GetEnterpriseMetrics(ctx, \"\\n\", &CopilotMetricsListOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Copilot.GetEnterpriseMetrics(ctx, \"e\", &CopilotMetricsListOptions{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"Copilot.GetEnterpriseMetrics returned %+v, want nil\", got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCopilotService_GetEnterpriseTeamMetrics(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/team/t/copilot/metrics\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[\n\t\t\t{\n\t\t\t\t\"date\": \"2024-06-24\",\n\t\t\t\t\"total_active_users\": 24,\n\t\t\t\t\"total_engaged_users\": 20,\n\t\t\t\t\"copilot_ide_code_completions\": {\n\t\t\t\t\"total_engaged_users\": 20,\n\t\t\t\t\"languages\": [\n\t\t\t\t\t{\n\t\t\t\t\t\"name\": \"python\",\n\t\t\t\t\t\"total_engaged_users\": 10\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\"name\": \"ruby\",\n\t\t\t\t\t\"total_engaged_users\": 10\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"editors\": [\n\t\t\t\t\t{\n\t\t\t\t\t\"name\": \"vscode\",\n\t\t\t\t\t\"total_engaged_users\": 13,\n\t\t\t\t\t\"models\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\"name\": \"default\",\n\t\t\t\t\t\t\"is_custom_model\": false,\n\t\t\t\t\t\t\"custom_model_training_date\": null,\n\t\t\t\t\t\t\"total_engaged_users\": 13,\n\t\t\t\t\t\t\"languages\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"python\",\n\t\t\t\t\t\t\t\"total_engaged_users\": 6,\n\t\t\t\t\t\t\t\"total_code_suggestions\": 249,\n\t\t\t\t\t\t\t\"total_code_acceptances\": 123,\n\t\t\t\t\t\t\t\"total_code_lines_suggested\": 225,\n\t\t\t\t\t\t\t\"total_code_lines_accepted\": 135\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ruby\",\n\t\t\t\t\t\t\t\"total_engaged_users\": 7,\n\t\t\t\t\t\t\t\"total_code_suggestions\": 496,\n\t\t\t\t\t\t\t\"total_code_acceptances\": 253,\n\t\t\t\t\t\t\t\"total_code_lines_suggested\": 520,\n\t\t\t\t\t\t\t\"total_code_lines_accepted\": 270\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\"name\": \"neovim\",\n\t\t\t\t\t\"total_engaged_users\": 7,\n\t\t\t\t\t\"models\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\"name\": \"a-custom-model\",\n\t\t\t\t\t\t\"is_custom_model\": true,\n\t\t\t\t\t\t\"custom_model_training_date\": \"2024-02-01\",\n\t\t\t\t\t\t\"languages\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"typescript\",\n\t\t\t\t\t\t\t\"total_engaged_users\": 3,\n\t\t\t\t\t\t\t\"total_code_suggestions\": 112,\n\t\t\t\t\t\t\t\"total_code_acceptances\": 56,\n\t\t\t\t\t\t\t\"total_code_lines_suggested\": 143,\n\t\t\t\t\t\t\t\"total_code_lines_accepted\": 61\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"go\",\n\t\t\t\t\t\t\t\"total_engaged_users\": 4,\n\t\t\t\t\t\t\t\"total_code_suggestions\": 132,\n\t\t\t\t\t\t\t\"total_code_acceptances\": 67,\n\t\t\t\t\t\t\t\"total_code_lines_suggested\": 154,\n\t\t\t\t\t\t\t\"total_code_lines_accepted\": 72\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"copilot_ide_chat\": {\n\t\t\t\t\"total_engaged_users\": 13,\n\t\t\t\t\"editors\": [\n\t\t\t\t\t{\n\t\t\t\t\t\"name\": \"vscode\",\n\t\t\t\t\t\"total_engaged_users\": 13,\n\t\t\t\t\t\"models\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\"name\": \"default\",\n\t\t\t\t\t\t\"is_custom_model\": false,\n\t\t\t\t\t\t\"custom_model_training_date\": null,\n\t\t\t\t\t\t\"total_engaged_users\": 12,\n\t\t\t\t\t\t\"total_chats\": 45,\n\t\t\t\t\t\t\"total_chat_insertion_events\": 12,\n\t\t\t\t\t\t\"total_chat_copy_events\": 16\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\"name\": \"a-custom-model\",\n\t\t\t\t\t\t\"is_custom_model\": true,\n\t\t\t\t\t\t\"custom_model_training_date\": \"2024-02-01\",\n\t\t\t\t\t\t\"total_engaged_users\": 1,\n\t\t\t\t\t\t\"total_chats\": 10,\n\t\t\t\t\t\t\"total_chat_insertion_events\": 11,\n\t\t\t\t\t\t\"total_chat_copy_events\": 3\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"copilot_dotcom_chat\": {\n\t\t\t\t\"total_engaged_users\": 14,\n\t\t\t\t\"models\": [\n\t\t\t\t\t{\n\t\t\t\t\t\"name\": \"default\",\n\t\t\t\t\t\"is_custom_model\": false,\n\t\t\t\t\t\"custom_model_training_date\": null,\n\t\t\t\t\t\"total_engaged_users\": 14,\n\t\t\t\t\t\"total_chats\": 38\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"copilot_dotcom_pull_requests\": {\n\t\t\t\t\"total_engaged_users\": 12,\n\t\t\t\t\"repositories\": [\n\t\t\t\t\t{\n\t\t\t\t\t\"name\": \"demo/repo1\",\n\t\t\t\t\t\"total_engaged_users\": 8,\n\t\t\t\t\t\"models\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\"name\": \"default\",\n\t\t\t\t\t\t\"is_custom_model\": false,\n\t\t\t\t\t\t\"custom_model_training_date\": null,\n\t\t\t\t\t\t\"total_pr_summaries_created\": 6,\n\t\t\t\t\t\t\"total_engaged_users\": 8\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\"name\": \"demo/repo2\",\n\t\t\t\t\t\"total_engaged_users\": 4,\n\t\t\t\t\t\"models\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\"name\": \"a-custom-model\",\n\t\t\t\t\t\t\"is_custom_model\": true,\n\t\t\t\t\t\t\"custom_model_training_date\": \"2024-02-01\",\n\t\t\t\t\t\t\"total_pr_summaries_created\": 10,\n\t\t\t\t\t\t\"total_engaged_users\": 4\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t]`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Copilot.GetEnterpriseTeamMetrics(ctx, \"e\", \"t\", &CopilotMetricsListOptions{})\n\tif err != nil {\n\t\tt.Errorf(\"Copilot.GetEnterpriseTeamMetrics returned error: %v\", err)\n\t}\n\n\ttotalActiveUsers := 24\n\ttotalEngagedUsers := 20\n\twant := []*CopilotMetrics{\n\t\t{\n\t\t\tDate:              \"2024-06-24\",\n\t\t\tTotalActiveUsers:  &totalActiveUsers,\n\t\t\tTotalEngagedUsers: &totalEngagedUsers,\n\t\t\tCopilotIDECodeCompletions: &CopilotIDECodeCompletions{\n\t\t\t\tTotalEngagedUsers: 20,\n\t\t\t\tLanguages: []*CopilotIDECodeCompletionsLanguage{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:              \"python\",\n\t\t\t\t\t\tTotalEngagedUsers: 10,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tName:              \"ruby\",\n\t\t\t\t\t\tTotalEngagedUsers: 10,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tEditors: []*CopilotIDECodeCompletionsEditor{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:              \"vscode\",\n\t\t\t\t\t\tTotalEngagedUsers: 13,\n\t\t\t\t\t\tModels: []*CopilotIDECodeCompletionsModel{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:                    \"default\",\n\t\t\t\t\t\t\t\tIsCustomModel:           false,\n\t\t\t\t\t\t\t\tCustomModelTrainingDate: nil,\n\t\t\t\t\t\t\t\tTotalEngagedUsers:       13,\n\t\t\t\t\t\t\t\tLanguages: []*CopilotIDECodeCompletionsModelLanguage{\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tName:                    \"python\",\n\t\t\t\t\t\t\t\t\t\tTotalEngagedUsers:       6,\n\t\t\t\t\t\t\t\t\t\tTotalCodeSuggestions:    249,\n\t\t\t\t\t\t\t\t\t\tTotalCodeAcceptances:    123,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesSuggested: 225,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesAccepted:  135,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tName:                    \"ruby\",\n\t\t\t\t\t\t\t\t\t\tTotalEngagedUsers:       7,\n\t\t\t\t\t\t\t\t\t\tTotalCodeSuggestions:    496,\n\t\t\t\t\t\t\t\t\t\tTotalCodeAcceptances:    253,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesSuggested: 520,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesAccepted:  270,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tName:              \"neovim\",\n\t\t\t\t\t\tTotalEngagedUsers: 7,\n\t\t\t\t\t\tModels: []*CopilotIDECodeCompletionsModel{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:                    \"a-custom-model\",\n\t\t\t\t\t\t\t\tIsCustomModel:           true,\n\t\t\t\t\t\t\t\tCustomModelTrainingDate: Ptr(\"2024-02-01\"),\n\t\t\t\t\t\t\t\tLanguages: []*CopilotIDECodeCompletionsModelLanguage{\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tName:                    \"typescript\",\n\t\t\t\t\t\t\t\t\t\tTotalEngagedUsers:       3,\n\t\t\t\t\t\t\t\t\t\tTotalCodeSuggestions:    112,\n\t\t\t\t\t\t\t\t\t\tTotalCodeAcceptances:    56,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesSuggested: 143,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesAccepted:  61,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tName:                    \"go\",\n\t\t\t\t\t\t\t\t\t\tTotalEngagedUsers:       4,\n\t\t\t\t\t\t\t\t\t\tTotalCodeSuggestions:    132,\n\t\t\t\t\t\t\t\t\t\tTotalCodeAcceptances:    67,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesSuggested: 154,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesAccepted:  72,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tCopilotIDEChat: &CopilotIDEChat{\n\t\t\t\tTotalEngagedUsers: 13,\n\t\t\t\tEditors: []*CopilotIDEChatEditor{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:              \"vscode\",\n\t\t\t\t\t\tTotalEngagedUsers: 13,\n\t\t\t\t\t\tModels: []*CopilotIDEChatModel{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:                     \"default\",\n\t\t\t\t\t\t\t\tIsCustomModel:            false,\n\t\t\t\t\t\t\t\tCustomModelTrainingDate:  nil,\n\t\t\t\t\t\t\t\tTotalEngagedUsers:        12,\n\t\t\t\t\t\t\t\tTotalChats:               45,\n\t\t\t\t\t\t\t\tTotalChatInsertionEvents: 12,\n\t\t\t\t\t\t\t\tTotalChatCopyEvents:      16,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:                     \"a-custom-model\",\n\t\t\t\t\t\t\t\tIsCustomModel:            true,\n\t\t\t\t\t\t\t\tCustomModelTrainingDate:  Ptr(\"2024-02-01\"),\n\t\t\t\t\t\t\t\tTotalEngagedUsers:        1,\n\t\t\t\t\t\t\t\tTotalChats:               10,\n\t\t\t\t\t\t\t\tTotalChatInsertionEvents: 11,\n\t\t\t\t\t\t\t\tTotalChatCopyEvents:      3,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tCopilotDotcomChat: &CopilotDotcomChat{\n\t\t\t\tTotalEngagedUsers: 14,\n\t\t\t\tModels: []*CopilotDotcomChatModel{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:                    \"default\",\n\t\t\t\t\t\tIsCustomModel:           false,\n\t\t\t\t\t\tCustomModelTrainingDate: nil,\n\t\t\t\t\t\tTotalEngagedUsers:       14,\n\t\t\t\t\t\tTotalChats:              38,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tCopilotDotcomPullRequests: &CopilotDotcomPullRequests{\n\t\t\t\tTotalEngagedUsers: 12,\n\t\t\t\tRepositories: []*CopilotDotcomPullRequestsRepository{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:              \"demo/repo1\",\n\t\t\t\t\t\tTotalEngagedUsers: 8,\n\t\t\t\t\t\tModels: []*CopilotDotcomPullRequestsModel{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:                    \"default\",\n\t\t\t\t\t\t\t\tIsCustomModel:           false,\n\t\t\t\t\t\t\t\tCustomModelTrainingDate: nil,\n\t\t\t\t\t\t\t\tTotalPRSummariesCreated: 6,\n\t\t\t\t\t\t\t\tTotalEngagedUsers:       8,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tName:              \"demo/repo2\",\n\t\t\t\t\t\tTotalEngagedUsers: 4,\n\t\t\t\t\t\tModels: []*CopilotDotcomPullRequestsModel{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:                    \"a-custom-model\",\n\t\t\t\t\t\t\t\tIsCustomModel:           true,\n\t\t\t\t\t\t\t\tCustomModelTrainingDate: Ptr(\"2024-02-01\"),\n\t\t\t\t\t\t\t\tTotalPRSummariesCreated: 10,\n\t\t\t\t\t\t\t\tTotalEngagedUsers:       4,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Copilot.GetEnterpriseTeamMetrics returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"GetEnterpriseTeamMetrics\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Copilot.GetEnterpriseTeamMetrics(ctx, \"\\n\", \"t\", &CopilotMetricsListOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Copilot.GetEnterpriseTeamMetrics(ctx, \"e\", \"t\", &CopilotMetricsListOptions{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"Copilot.GetEnterpriseTeamMetrics returned %+v, want nil\", got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCopilotService_GetOrganizationMetrics(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/copilot/metrics\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[\n\t\t\t{\n\t\t\t\t\"date\": \"2024-06-24\",\n\t\t\t\t\"total_active_users\": 24,\n\t\t\t\t\"total_engaged_users\": 20,\n\t\t\t\t\"copilot_ide_code_completions\": {\n\t\t\t\t\"total_engaged_users\": 20,\n\t\t\t\t\"languages\": [\n\t\t\t\t\t{\n\t\t\t\t\t\"name\": \"python\",\n\t\t\t\t\t\"total_engaged_users\": 10\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\"name\": \"ruby\",\n\t\t\t\t\t\"total_engaged_users\": 10\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"editors\": [\n\t\t\t\t\t{\n\t\t\t\t\t\"name\": \"vscode\",\n\t\t\t\t\t\"total_engaged_users\": 13,\n\t\t\t\t\t\"models\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\"name\": \"default\",\n\t\t\t\t\t\t\"is_custom_model\": false,\n\t\t\t\t\t\t\"custom_model_training_date\": null,\n\t\t\t\t\t\t\"total_engaged_users\": 13,\n\t\t\t\t\t\t\"languages\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"python\",\n\t\t\t\t\t\t\t\"total_engaged_users\": 6,\n\t\t\t\t\t\t\t\"total_code_suggestions\": 249,\n\t\t\t\t\t\t\t\"total_code_acceptances\": 123,\n\t\t\t\t\t\t\t\"total_code_lines_suggested\": 225,\n\t\t\t\t\t\t\t\"total_code_lines_accepted\": 135\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ruby\",\n\t\t\t\t\t\t\t\"total_engaged_users\": 7,\n\t\t\t\t\t\t\t\"total_code_suggestions\": 496,\n\t\t\t\t\t\t\t\"total_code_acceptances\": 253,\n\t\t\t\t\t\t\t\"total_code_lines_suggested\": 520,\n\t\t\t\t\t\t\t\"total_code_lines_accepted\": 270\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\"name\": \"neovim\",\n\t\t\t\t\t\"total_engaged_users\": 7,\n\t\t\t\t\t\"models\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\"name\": \"a-custom-model\",\n\t\t\t\t\t\t\"is_custom_model\": true,\n\t\t\t\t\t\t\"custom_model_training_date\": \"2024-02-01\",\n\t\t\t\t\t\t\"languages\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"typescript\",\n\t\t\t\t\t\t\t\"total_engaged_users\": 3,\n\t\t\t\t\t\t\t\"total_code_suggestions\": 112,\n\t\t\t\t\t\t\t\"total_code_acceptances\": 56,\n\t\t\t\t\t\t\t\"total_code_lines_suggested\": 143,\n\t\t\t\t\t\t\t\"total_code_lines_accepted\": 61\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"go\",\n\t\t\t\t\t\t\t\"total_engaged_users\": 4,\n\t\t\t\t\t\t\t\"total_code_suggestions\": 132,\n\t\t\t\t\t\t\t\"total_code_acceptances\": 67,\n\t\t\t\t\t\t\t\"total_code_lines_suggested\": 154,\n\t\t\t\t\t\t\t\"total_code_lines_accepted\": 72\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"copilot_ide_chat\": {\n\t\t\t\t\"total_engaged_users\": 13,\n\t\t\t\t\"editors\": [\n\t\t\t\t\t{\n\t\t\t\t\t\"name\": \"vscode\",\n\t\t\t\t\t\"total_engaged_users\": 13,\n\t\t\t\t\t\"models\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\"name\": \"default\",\n\t\t\t\t\t\t\"is_custom_model\": false,\n\t\t\t\t\t\t\"custom_model_training_date\": null,\n\t\t\t\t\t\t\"total_engaged_users\": 12,\n\t\t\t\t\t\t\"total_chats\": 45,\n\t\t\t\t\t\t\"total_chat_insertion_events\": 12,\n\t\t\t\t\t\t\"total_chat_copy_events\": 16\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\"name\": \"a-custom-model\",\n\t\t\t\t\t\t\"is_custom_model\": true,\n\t\t\t\t\t\t\"custom_model_training_date\": \"2024-02-01\",\n\t\t\t\t\t\t\"total_engaged_users\": 1,\n\t\t\t\t\t\t\"total_chats\": 10,\n\t\t\t\t\t\t\"total_chat_insertion_events\": 11,\n\t\t\t\t\t\t\"total_chat_copy_events\": 3\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"copilot_dotcom_chat\": {\n\t\t\t\t\"total_engaged_users\": 14,\n\t\t\t\t\"models\": [\n\t\t\t\t\t{\n\t\t\t\t\t\"name\": \"default\",\n\t\t\t\t\t\"is_custom_model\": false,\n\t\t\t\t\t\"custom_model_training_date\": null,\n\t\t\t\t\t\"total_engaged_users\": 14,\n\t\t\t\t\t\"total_chats\": 38\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"copilot_dotcom_pull_requests\": {\n\t\t\t\t\"total_engaged_users\": 12,\n\t\t\t\t\"repositories\": [\n\t\t\t\t\t{\n\t\t\t\t\t\"name\": \"demo/repo1\",\n\t\t\t\t\t\"total_engaged_users\": 8,\n\t\t\t\t\t\"models\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\"name\": \"default\",\n\t\t\t\t\t\t\"is_custom_model\": false,\n\t\t\t\t\t\t\"custom_model_training_date\": null,\n\t\t\t\t\t\t\"total_pr_summaries_created\": 6,\n\t\t\t\t\t\t\"total_engaged_users\": 8\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\"name\": \"demo/repo2\",\n\t\t\t\t\t\"total_engaged_users\": 4,\n\t\t\t\t\t\"models\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\"name\": \"a-custom-model\",\n\t\t\t\t\t\t\"is_custom_model\": true,\n\t\t\t\t\t\t\"custom_model_training_date\": \"2024-02-01\",\n\t\t\t\t\t\t\"total_pr_summaries_created\": 10,\n\t\t\t\t\t\t\"total_engaged_users\": 4\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t]`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Copilot.GetOrganizationMetrics(ctx, \"o\", &CopilotMetricsListOptions{})\n\tif err != nil {\n\t\tt.Errorf(\"Copilot.GetOrganizationMetrics returned error: %v\", err)\n\t}\n\n\ttotalActiveUsers := 24\n\ttotalEngagedUsers := 20\n\twant := []*CopilotMetrics{\n\t\t{\n\t\t\tDate:              \"2024-06-24\",\n\t\t\tTotalActiveUsers:  &totalActiveUsers,\n\t\t\tTotalEngagedUsers: &totalEngagedUsers,\n\t\t\tCopilotIDECodeCompletions: &CopilotIDECodeCompletions{\n\t\t\t\tTotalEngagedUsers: 20,\n\t\t\t\tLanguages: []*CopilotIDECodeCompletionsLanguage{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:              \"python\",\n\t\t\t\t\t\tTotalEngagedUsers: 10,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tName:              \"ruby\",\n\t\t\t\t\t\tTotalEngagedUsers: 10,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tEditors: []*CopilotIDECodeCompletionsEditor{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:              \"vscode\",\n\t\t\t\t\t\tTotalEngagedUsers: 13,\n\t\t\t\t\t\tModels: []*CopilotIDECodeCompletionsModel{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:                    \"default\",\n\t\t\t\t\t\t\t\tIsCustomModel:           false,\n\t\t\t\t\t\t\t\tCustomModelTrainingDate: nil,\n\t\t\t\t\t\t\t\tTotalEngagedUsers:       13,\n\t\t\t\t\t\t\t\tLanguages: []*CopilotIDECodeCompletionsModelLanguage{\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tName:                    \"python\",\n\t\t\t\t\t\t\t\t\t\tTotalEngagedUsers:       6,\n\t\t\t\t\t\t\t\t\t\tTotalCodeSuggestions:    249,\n\t\t\t\t\t\t\t\t\t\tTotalCodeAcceptances:    123,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesSuggested: 225,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesAccepted:  135,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tName:                    \"ruby\",\n\t\t\t\t\t\t\t\t\t\tTotalEngagedUsers:       7,\n\t\t\t\t\t\t\t\t\t\tTotalCodeSuggestions:    496,\n\t\t\t\t\t\t\t\t\t\tTotalCodeAcceptances:    253,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesSuggested: 520,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesAccepted:  270,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tName:              \"neovim\",\n\t\t\t\t\t\tTotalEngagedUsers: 7,\n\t\t\t\t\t\tModels: []*CopilotIDECodeCompletionsModel{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:                    \"a-custom-model\",\n\t\t\t\t\t\t\t\tIsCustomModel:           true,\n\t\t\t\t\t\t\t\tCustomModelTrainingDate: Ptr(\"2024-02-01\"),\n\t\t\t\t\t\t\t\tLanguages: []*CopilotIDECodeCompletionsModelLanguage{\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tName:                    \"typescript\",\n\t\t\t\t\t\t\t\t\t\tTotalEngagedUsers:       3,\n\t\t\t\t\t\t\t\t\t\tTotalCodeSuggestions:    112,\n\t\t\t\t\t\t\t\t\t\tTotalCodeAcceptances:    56,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesSuggested: 143,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesAccepted:  61,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tName:                    \"go\",\n\t\t\t\t\t\t\t\t\t\tTotalEngagedUsers:       4,\n\t\t\t\t\t\t\t\t\t\tTotalCodeSuggestions:    132,\n\t\t\t\t\t\t\t\t\t\tTotalCodeAcceptances:    67,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesSuggested: 154,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesAccepted:  72,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tCopilotIDEChat: &CopilotIDEChat{\n\t\t\t\tTotalEngagedUsers: 13,\n\t\t\t\tEditors: []*CopilotIDEChatEditor{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:              \"vscode\",\n\t\t\t\t\t\tTotalEngagedUsers: 13,\n\t\t\t\t\t\tModels: []*CopilotIDEChatModel{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:                     \"default\",\n\t\t\t\t\t\t\t\tIsCustomModel:            false,\n\t\t\t\t\t\t\t\tCustomModelTrainingDate:  nil,\n\t\t\t\t\t\t\t\tTotalEngagedUsers:        12,\n\t\t\t\t\t\t\t\tTotalChats:               45,\n\t\t\t\t\t\t\t\tTotalChatInsertionEvents: 12,\n\t\t\t\t\t\t\t\tTotalChatCopyEvents:      16,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:                     \"a-custom-model\",\n\t\t\t\t\t\t\t\tIsCustomModel:            true,\n\t\t\t\t\t\t\t\tCustomModelTrainingDate:  Ptr(\"2024-02-01\"),\n\t\t\t\t\t\t\t\tTotalEngagedUsers:        1,\n\t\t\t\t\t\t\t\tTotalChats:               10,\n\t\t\t\t\t\t\t\tTotalChatInsertionEvents: 11,\n\t\t\t\t\t\t\t\tTotalChatCopyEvents:      3,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tCopilotDotcomChat: &CopilotDotcomChat{\n\t\t\t\tTotalEngagedUsers: 14,\n\t\t\t\tModels: []*CopilotDotcomChatModel{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:                    \"default\",\n\t\t\t\t\t\tIsCustomModel:           false,\n\t\t\t\t\t\tCustomModelTrainingDate: nil,\n\t\t\t\t\t\tTotalEngagedUsers:       14,\n\t\t\t\t\t\tTotalChats:              38,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tCopilotDotcomPullRequests: &CopilotDotcomPullRequests{\n\t\t\t\tTotalEngagedUsers: 12,\n\t\t\t\tRepositories: []*CopilotDotcomPullRequestsRepository{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:              \"demo/repo1\",\n\t\t\t\t\t\tTotalEngagedUsers: 8,\n\t\t\t\t\t\tModels: []*CopilotDotcomPullRequestsModel{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:                    \"default\",\n\t\t\t\t\t\t\t\tIsCustomModel:           false,\n\t\t\t\t\t\t\t\tCustomModelTrainingDate: nil,\n\t\t\t\t\t\t\t\tTotalPRSummariesCreated: 6,\n\t\t\t\t\t\t\t\tTotalEngagedUsers:       8,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tName:              \"demo/repo2\",\n\t\t\t\t\t\tTotalEngagedUsers: 4,\n\t\t\t\t\t\tModels: []*CopilotDotcomPullRequestsModel{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:                    \"a-custom-model\",\n\t\t\t\t\t\t\t\tIsCustomModel:           true,\n\t\t\t\t\t\t\t\tCustomModelTrainingDate: Ptr(\"2024-02-01\"),\n\t\t\t\t\t\t\t\tTotalPRSummariesCreated: 10,\n\t\t\t\t\t\t\t\tTotalEngagedUsers:       4,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Copilot.GetOrganizationMetrics returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"GetOrganizationMetrics\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Copilot.GetOrganizationMetrics(ctx, \"\\n\", &CopilotMetricsListOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Copilot.GetOrganizationMetrics(ctx, \"o\", &CopilotMetricsListOptions{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"Copilot.GetOrganizationMetrics returned %+v, want nil\", got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCopilotService_GetOrganizationTeamMetrics(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/team/t/copilot/metrics\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[\n\t\t\t{\n\t\t\t\t\"date\": \"2024-06-24\",\n\t\t\t\t\"total_active_users\": 24,\n\t\t\t\t\"total_engaged_users\": 20,\n\t\t\t\t\"copilot_ide_code_completions\": {\n\t\t\t\t\t\"total_engaged_users\": 20,\n\t\t\t\t\t\"languages\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"python\",\n\t\t\t\t\t\t\t\"total_engaged_users\": 10\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"ruby\",\n\t\t\t\t\t\t\t\"total_engaged_users\": 10\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"editors\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"vscode\",\n\t\t\t\t\t\t\t\"total_engaged_users\": 13,\n\t\t\t\t\t\t\t\"models\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"name\": \"default\",\n\t\t\t\t\t\t\t\t\t\"is_custom_model\": false,\n\t\t\t\t\t\t\t\t\t\"custom_model_training_date\": null,\n\t\t\t\t\t\t\t\t\t\"total_engaged_users\": 13,\n\t\t\t\t\t\t\t\t\t\"languages\": [\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\"name\": \"python\",\n\t\t\t\t\t\t\t\t\t\t\t\"total_engaged_users\": 6,\n\t\t\t\t\t\t\t\t\t\t\t\"total_code_suggestions\": 249,\n\t\t\t\t\t\t\t\t\t\t\t\"total_code_acceptances\": 123,\n\t\t\t\t\t\t\t\t\t\t\t\"total_code_lines_suggested\": 225,\n\t\t\t\t\t\t\t\t\t\t\t\"total_code_lines_accepted\": 135\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\"name\": \"ruby\",\n\t\t\t\t\t\t\t\t\t\t\t\"total_engaged_users\": 7,\n\t\t\t\t\t\t\t\t\t\t\t\"total_code_suggestions\": 496,\n\t\t\t\t\t\t\t\t\t\t\t\"total_code_acceptances\": 253,\n\t\t\t\t\t\t\t\t\t\t\t\"total_code_lines_suggested\": 520,\n\t\t\t\t\t\t\t\t\t\t\t\"total_code_lines_accepted\": 270\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"neovim\",\n\t\t\t\t\t\t\t\"total_engaged_users\": 7,\n\t\t\t\t\t\t\t\"models\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"name\": \"a-custom-model\",\n\t\t\t\t\t\t\t\t\t\"is_custom_model\": true,\n\t\t\t\t\t\t\t\t\t\"custom_model_training_date\": \"2024-02-01\",\n\t\t\t\t\t\t\t\t\t\"languages\": [\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\"name\": \"typescript\",\n\t\t\t\t\t\t\t\t\t\t\t\"total_engaged_users\": 3,\n\t\t\t\t\t\t\t\t\t\t\t\"total_code_suggestions\": 112,\n\t\t\t\t\t\t\t\t\t\t\t\"total_code_acceptances\": 56,\n\t\t\t\t\t\t\t\t\t\t\t\"total_code_lines_suggested\": 143,\n\t\t\t\t\t\t\t\t\t\t\t\"total_code_lines_accepted\": 61\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\"name\": \"go\",\n\t\t\t\t\t\t\t\t\t\t\t\"total_engaged_users\": 4,\n\t\t\t\t\t\t\t\t\t\t\t\"total_code_suggestions\": 132,\n\t\t\t\t\t\t\t\t\t\t\t\"total_code_acceptances\": 67,\n\t\t\t\t\t\t\t\t\t\t\t\"total_code_lines_suggested\": 154,\n\t\t\t\t\t\t\t\t\t\t\t\"total_code_lines_accepted\": 72\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"copilot_ide_chat\": {\n\t\t\t\t\t\"total_engaged_users\": 13,\n\t\t\t\t\t\"editors\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"vscode\",\n\t\t\t\t\t\t\t\"total_engaged_users\": 13,\n\t\t\t\t\t\t\t\"models\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"name\": \"default\",\n\t\t\t\t\t\t\t\t\t\"is_custom_model\": false,\n\t\t\t\t\t\t\t\t\t\"custom_model_training_date\": null,\n\t\t\t\t\t\t\t\t\t\"total_engaged_users\": 12,\n\t\t\t\t\t\t\t\t\t\"total_chats\": 45,\n\t\t\t\t\t\t\t\t\t\"total_chat_insertion_events\": 12,\n\t\t\t\t\t\t\t\t\t\"total_chat_copy_events\": 16\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"name\": \"a-custom-model\",\n\t\t\t\t\t\t\t\t\t\"is_custom_model\": true,\n\t\t\t\t\t\t\t\t\t\"custom_model_training_date\": \"2024-02-01\",\n\t\t\t\t\t\t\t\t\t\"total_engaged_users\": 1,\n\t\t\t\t\t\t\t\t\t\"total_chats\": 10,\n\t\t\t\t\t\t\t\t\t\"total_chat_insertion_events\": 11,\n\t\t\t\t\t\t\t\t\t\"total_chat_copy_events\": 3\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"copilot_dotcom_chat\": {\n\t\t\t\t\t\"total_engaged_users\": 14,\n\t\t\t\t\t\"models\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"default\",\n\t\t\t\t\t\t\t\"is_custom_model\": false,\n\t\t\t\t\t\t\t\"custom_model_training_date\": null,\n\t\t\t\t\t\t\t\"total_engaged_users\": 14,\n\t\t\t\t\t\t\t\"total_chats\": 38\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"copilot_dotcom_pull_requests\": {\n\t\t\t\t\t\"total_engaged_users\": 12,\n\t\t\t\t\t\"repositories\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"demo/repo1\",\n\t\t\t\t\t\t\t\"total_engaged_users\": 8,\n\t\t\t\t\t\t\t\"models\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"name\": \"default\",\n\t\t\t\t\t\t\t\t\t\"is_custom_model\": false,\n\t\t\t\t\t\t\t\t\t\"custom_model_training_date\": null,\n\t\t\t\t\t\t\t\t\t\"total_pr_summaries_created\": 6,\n\t\t\t\t\t\t\t\t\t\"total_engaged_users\": 8\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"demo/repo2\",\n\t\t\t\t\t\t\t\"total_engaged_users\": 4,\n\t\t\t\t\t\t\t\"models\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"name\": \"a-custom-model\",\n\t\t\t\t\t\t\t\t\t\"is_custom_model\": true,\n\t\t\t\t\t\t\t\t\t\"custom_model_training_date\": \"2024-02-01\",\n\t\t\t\t\t\t\t\t\t\"total_pr_summaries_created\": 10,\n\t\t\t\t\t\t\t\t\t\"total_engaged_users\": 4\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}\n\t\t]`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Copilot.GetOrganizationTeamMetrics(ctx, \"o\", \"t\", &CopilotMetricsListOptions{})\n\tif err != nil {\n\t\tt.Errorf(\"Copilot.GetOrganizationTeamMetrics returned error: %v\", err)\n\t}\n\n\ttotalActiveUsers := 24\n\ttotalEngagedUsers := 20\n\twant := []*CopilotMetrics{\n\t\t{\n\t\t\tDate:              \"2024-06-24\",\n\t\t\tTotalActiveUsers:  &totalActiveUsers,\n\t\t\tTotalEngagedUsers: &totalEngagedUsers,\n\t\t\tCopilotIDECodeCompletions: &CopilotIDECodeCompletions{\n\t\t\t\tTotalEngagedUsers: 20,\n\t\t\t\tLanguages: []*CopilotIDECodeCompletionsLanguage{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:              \"python\",\n\t\t\t\t\t\tTotalEngagedUsers: 10,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tName:              \"ruby\",\n\t\t\t\t\t\tTotalEngagedUsers: 10,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tEditors: []*CopilotIDECodeCompletionsEditor{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:              \"vscode\",\n\t\t\t\t\t\tTotalEngagedUsers: 13,\n\t\t\t\t\t\tModels: []*CopilotIDECodeCompletionsModel{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:                    \"default\",\n\t\t\t\t\t\t\t\tIsCustomModel:           false,\n\t\t\t\t\t\t\t\tCustomModelTrainingDate: nil,\n\t\t\t\t\t\t\t\tTotalEngagedUsers:       13,\n\t\t\t\t\t\t\t\tLanguages: []*CopilotIDECodeCompletionsModelLanguage{\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tName:                    \"python\",\n\t\t\t\t\t\t\t\t\t\tTotalEngagedUsers:       6,\n\t\t\t\t\t\t\t\t\t\tTotalCodeSuggestions:    249,\n\t\t\t\t\t\t\t\t\t\tTotalCodeAcceptances:    123,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesSuggested: 225,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesAccepted:  135,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tName:                    \"ruby\",\n\t\t\t\t\t\t\t\t\t\tTotalEngagedUsers:       7,\n\t\t\t\t\t\t\t\t\t\tTotalCodeSuggestions:    496,\n\t\t\t\t\t\t\t\t\t\tTotalCodeAcceptances:    253,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesSuggested: 520,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesAccepted:  270,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tName:              \"neovim\",\n\t\t\t\t\t\tTotalEngagedUsers: 7,\n\t\t\t\t\t\tModels: []*CopilotIDECodeCompletionsModel{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:                    \"a-custom-model\",\n\t\t\t\t\t\t\t\tIsCustomModel:           true,\n\t\t\t\t\t\t\t\tCustomModelTrainingDate: Ptr(\"2024-02-01\"),\n\t\t\t\t\t\t\t\tLanguages: []*CopilotIDECodeCompletionsModelLanguage{\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tName:                    \"typescript\",\n\t\t\t\t\t\t\t\t\t\tTotalEngagedUsers:       3,\n\t\t\t\t\t\t\t\t\t\tTotalCodeSuggestions:    112,\n\t\t\t\t\t\t\t\t\t\tTotalCodeAcceptances:    56,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesSuggested: 143,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesAccepted:  61,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tName:                    \"go\",\n\t\t\t\t\t\t\t\t\t\tTotalEngagedUsers:       4,\n\t\t\t\t\t\t\t\t\t\tTotalCodeSuggestions:    132,\n\t\t\t\t\t\t\t\t\t\tTotalCodeAcceptances:    67,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesSuggested: 154,\n\t\t\t\t\t\t\t\t\t\tTotalCodeLinesAccepted:  72,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tCopilotIDEChat: &CopilotIDEChat{\n\t\t\t\tTotalEngagedUsers: 13,\n\t\t\t\tEditors: []*CopilotIDEChatEditor{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:              \"vscode\",\n\t\t\t\t\t\tTotalEngagedUsers: 13,\n\t\t\t\t\t\tModels: []*CopilotIDEChatModel{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:                     \"default\",\n\t\t\t\t\t\t\t\tIsCustomModel:            false,\n\t\t\t\t\t\t\t\tCustomModelTrainingDate:  nil,\n\t\t\t\t\t\t\t\tTotalEngagedUsers:        12,\n\t\t\t\t\t\t\t\tTotalChats:               45,\n\t\t\t\t\t\t\t\tTotalChatInsertionEvents: 12,\n\t\t\t\t\t\t\t\tTotalChatCopyEvents:      16,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:                     \"a-custom-model\",\n\t\t\t\t\t\t\t\tIsCustomModel:            true,\n\t\t\t\t\t\t\t\tCustomModelTrainingDate:  Ptr(\"2024-02-01\"),\n\t\t\t\t\t\t\t\tTotalEngagedUsers:        1,\n\t\t\t\t\t\t\t\tTotalChats:               10,\n\t\t\t\t\t\t\t\tTotalChatInsertionEvents: 11,\n\t\t\t\t\t\t\t\tTotalChatCopyEvents:      3,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tCopilotDotcomChat: &CopilotDotcomChat{\n\t\t\t\tTotalEngagedUsers: 14,\n\t\t\t\tModels: []*CopilotDotcomChatModel{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:                    \"default\",\n\t\t\t\t\t\tIsCustomModel:           false,\n\t\t\t\t\t\tCustomModelTrainingDate: nil,\n\t\t\t\t\t\tTotalEngagedUsers:       14,\n\t\t\t\t\t\tTotalChats:              38,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tCopilotDotcomPullRequests: &CopilotDotcomPullRequests{\n\t\t\t\tTotalEngagedUsers: 12,\n\t\t\t\tRepositories: []*CopilotDotcomPullRequestsRepository{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:              \"demo/repo1\",\n\t\t\t\t\t\tTotalEngagedUsers: 8,\n\t\t\t\t\t\tModels: []*CopilotDotcomPullRequestsModel{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:                    \"default\",\n\t\t\t\t\t\t\t\tIsCustomModel:           false,\n\t\t\t\t\t\t\t\tCustomModelTrainingDate: nil,\n\t\t\t\t\t\t\t\tTotalPRSummariesCreated: 6,\n\t\t\t\t\t\t\t\tTotalEngagedUsers:       8,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tName:              \"demo/repo2\",\n\t\t\t\t\t\tTotalEngagedUsers: 4,\n\t\t\t\t\t\tModels: []*CopilotDotcomPullRequestsModel{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:                    \"a-custom-model\",\n\t\t\t\t\t\t\t\tIsCustomModel:           true,\n\t\t\t\t\t\t\t\tCustomModelTrainingDate: Ptr(\"2024-02-01\"),\n\t\t\t\t\t\t\t\tTotalPRSummariesCreated: 10,\n\t\t\t\t\t\t\t\tTotalEngagedUsers:       4,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Copilot.GetOrganizationTeamMetrics returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"GetOrganizationTeamMetrics\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Copilot.GetOrganizationTeamMetrics(ctx, \"\\n\", \"\\n\", &CopilotMetricsListOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Copilot.GetOrganizationTeamMetrics(ctx, \"o\", \"t\", &CopilotMetricsListOptions{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"Copilot.GetOrganizationTeamMetrics returned %+v, want nil\", got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCopilotService_GetEnterpriseDailyMetricsReport(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/copilot/metrics/reports/enterprise-1-day\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"day\": \"2025-07-01\"})\n\t\tfmt.Fprint(w, `{\n\t\t\t\"download_links\": [\"https://example.com/copilot-usage-report-1.json\", \"https://example.com/copilot-usage-report-2.json\"],\n\t\t\t\"report_day\": \"2025-07-01\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\topts := &CopilotMetricsReportOptions{Day: \"2025-07-01\"}\n\tgot, _, err := client.Copilot.GetEnterpriseDailyMetricsReport(ctx, \"e\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Copilot.GetEnterpriseDailyMetricsReport returned error: %v\", err)\n\t}\n\n\twant := &CopilotDailyMetricsReport{\n\t\tDownloadLinks: []string{\"https://example.com/copilot-usage-report-1.json\", \"https://example.com/copilot-usage-report-2.json\"},\n\t\tReportDay:     \"2025-07-01\",\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Copilot.GetEnterpriseDailyMetricsReport returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"GetEnterpriseDailyMetricsReport\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Copilot.GetEnterpriseDailyMetricsReport(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Copilot.GetEnterpriseDailyMetricsReport(ctx, \"e\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"Copilot.GetEnterpriseDailyMetricsReport returned %+v, want nil\", got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCopilotService_GetEnterpriseMetricsReport(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/copilot/metrics/reports/enterprise-28-day/latest\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"download_links\": [\"https://example.com/copilot-usage-report-1.json\", \"https://example.com/copilot-usage-report-2.json\"],\n\t\t\t\"report_start_day\": \"2025-07-01\",\n\t\t\t\"report_end_day\": \"2025-07-28\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Copilot.GetEnterpriseMetricsReport(ctx, \"e\")\n\tif err != nil {\n\t\tt.Errorf(\"Copilot.GetEnterpriseMetricsReport returned error: %v\", err)\n\t}\n\n\twant := &CopilotMetricsReport{\n\t\tDownloadLinks:  []string{\"https://example.com/copilot-usage-report-1.json\", \"https://example.com/copilot-usage-report-2.json\"},\n\t\tReportStartDay: \"2025-07-01\",\n\t\tReportEndDay:   \"2025-07-28\",\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Copilot.GetEnterpriseMetricsReport returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"GetEnterpriseMetricsReport\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Copilot.GetEnterpriseMetricsReport(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Copilot.GetEnterpriseMetricsReport(ctx, \"e\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"Copilot.GetEnterpriseMetricsReport returned %+v, want nil\", got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCopilotService_GetEnterpriseUsersDailyMetricsReport(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/copilot/metrics/reports/users-1-day\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"day\": \"2025-07-01\"})\n\t\tfmt.Fprint(w, `{\n\t\t\t\"download_links\": [\"https://example.com/copilot-usage-report-1.json\", \"https://example.com/copilot-usage-report-2.json\"],\n\t\t\t\"report_day\": \"2025-07-01\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\topts := &CopilotMetricsReportOptions{Day: \"2025-07-01\"}\n\tgot, _, err := client.Copilot.GetEnterpriseUsersDailyMetricsReport(ctx, \"e\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Copilot.GetEnterpriseUsersDailyMetricsReport returned error: %v\", err)\n\t}\n\n\twant := &CopilotDailyMetricsReport{\n\t\tDownloadLinks: []string{\"https://example.com/copilot-usage-report-1.json\", \"https://example.com/copilot-usage-report-2.json\"},\n\t\tReportDay:     \"2025-07-01\",\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Copilot.GetEnterpriseUsersDailyMetricsReport returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"GetEnterpriseUsersDailyMetricsReport\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Copilot.GetEnterpriseUsersDailyMetricsReport(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Copilot.GetEnterpriseUsersDailyMetricsReport(ctx, \"e\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"Copilot.GetEnterpriseUsersDailyMetricsReport returned %+v, want nil\", got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCopilotService_GetEnterpriseUsersMetricsReport(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/copilot/metrics/reports/users-28-day/latest\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"download_links\": [\"https://example.com/copilot-usage-report-1.json\", \"https://example.com/copilot-usage-report-2.json\"],\n\t\t\t\"report_start_day\": \"2025-07-01\",\n\t\t\t\"report_end_day\": \"2025-07-28\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Copilot.GetEnterpriseUsersMetricsReport(ctx, \"e\")\n\tif err != nil {\n\t\tt.Errorf(\"Copilot.GetEnterpriseUsersMetricsReport returned error: %v\", err)\n\t}\n\n\twant := &CopilotMetricsReport{\n\t\tDownloadLinks:  []string{\"https://example.com/copilot-usage-report-1.json\", \"https://example.com/copilot-usage-report-2.json\"},\n\t\tReportStartDay: \"2025-07-01\",\n\t\tReportEndDay:   \"2025-07-28\",\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Copilot.GetEnterpriseUsersMetricsReport returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"GetEnterpriseUsersMetricsReport\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Copilot.GetEnterpriseUsersMetricsReport(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Copilot.GetEnterpriseUsersMetricsReport(ctx, \"e\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"Copilot.GetEnterpriseUsersMetricsReport returned %+v, want nil\", got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCopilotService_GetOrganizationDailyMetricsReport(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/copilot/metrics/reports/organization-1-day\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"day\": \"2025-07-01\"})\n\t\tfmt.Fprint(w, `{\n\t\t\t\"download_links\": [\"https://example.com/copilot-usage-report-1.json\", \"https://example.com/copilot-usage-report-2.json\"],\n\t\t\t\"report_day\": \"2025-07-01\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\topts := &CopilotMetricsReportOptions{Day: \"2025-07-01\"}\n\tgot, _, err := client.Copilot.GetOrganizationDailyMetricsReport(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Copilot.GetOrganizationDailyMetricsReport returned error: %v\", err)\n\t}\n\n\twant := &CopilotDailyMetricsReport{\n\t\tDownloadLinks: []string{\"https://example.com/copilot-usage-report-1.json\", \"https://example.com/copilot-usage-report-2.json\"},\n\t\tReportDay:     \"2025-07-01\",\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Copilot.GetOrganizationDailyMetricsReport returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"GetOrganizationDailyMetricsReport\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Copilot.GetOrganizationDailyMetricsReport(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Copilot.GetOrganizationDailyMetricsReport(ctx, \"o\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"Copilot.GetOrganizationDailyMetricsReport returned %+v, want nil\", got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCopilotService_GetOrganizationMetricsReport(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/copilot/metrics/reports/organization-28-day/latest\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"download_links\": [\"https://example.com/copilot-usage-report-1.json\", \"https://example.com/copilot-usage-report-2.json\"],\n\t\t\t\"report_start_day\": \"2025-07-01\",\n\t\t\t\"report_end_day\": \"2025-07-28\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Copilot.GetOrganizationMetricsReport(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Copilot.GetOrganizationMetricsReport returned error: %v\", err)\n\t}\n\n\twant := &CopilotMetricsReport{\n\t\tDownloadLinks:  []string{\"https://example.com/copilot-usage-report-1.json\", \"https://example.com/copilot-usage-report-2.json\"},\n\t\tReportStartDay: \"2025-07-01\",\n\t\tReportEndDay:   \"2025-07-28\",\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Copilot.GetOrganizationMetricsReport returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"GetOrganizationMetricsReport\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Copilot.GetOrganizationMetricsReport(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Copilot.GetOrganizationMetricsReport(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"Copilot.GetOrganizationMetricsReport returned %+v, want nil\", got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCopilotService_GetOrganizationUsersDailyMetricsReport(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/copilot/metrics/reports/users-1-day\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"day\": \"2025-07-01\"})\n\t\tfmt.Fprint(w, `{\n\t\t\t\"download_links\": [\"https://example.com/copilot-usage-report-1.json\", \"https://example.com/copilot-usage-report-2.json\"],\n\t\t\t\"report_day\": \"2025-07-01\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\topts := &CopilotMetricsReportOptions{Day: \"2025-07-01\"}\n\tgot, _, err := client.Copilot.GetOrganizationUsersDailyMetricsReport(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Copilot.GetOrganizationUsersDailyMetricsReport returned error: %v\", err)\n\t}\n\n\twant := &CopilotDailyMetricsReport{\n\t\tDownloadLinks: []string{\"https://example.com/copilot-usage-report-1.json\", \"https://example.com/copilot-usage-report-2.json\"},\n\t\tReportDay:     \"2025-07-01\",\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Copilot.GetOrganizationUsersDailyMetricsReport returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"GetOrganizationUsersDailyMetricsReport\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Copilot.GetOrganizationUsersDailyMetricsReport(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Copilot.GetOrganizationUsersDailyMetricsReport(ctx, \"o\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"Copilot.GetOrganizationUsersDailyMetricsReport returned %+v, want nil\", got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCopilotService_GetOrganizationUsersMetricsReport(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/copilot/metrics/reports/users-28-day/latest\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"download_links\": [\"https://example.com/copilot-usage-report-1.json\", \"https://example.com/copilot-usage-report-2.json\"],\n\t\t\t\"report_start_day\": \"2025-07-01\",\n\t\t\t\"report_end_day\": \"2025-07-28\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Copilot.GetOrganizationUsersMetricsReport(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Copilot.GetOrganizationUsersMetricsReport returned error: %v\", err)\n\t}\n\n\twant := &CopilotMetricsReport{\n\t\tDownloadLinks:  []string{\"https://example.com/copilot-usage-report-1.json\", \"https://example.com/copilot-usage-report-2.json\"},\n\t\tReportStartDay: \"2025-07-01\",\n\t\tReportEndDay:   \"2025-07-28\",\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Copilot.GetOrganizationUsersMetricsReport returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"GetOrganizationUsersMetricsReport\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Copilot.GetOrganizationUsersMetricsReport(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Copilot.GetOrganizationUsersMetricsReport(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"Copilot.GetOrganizationUsersMetricsReport returned %+v, want nil\", got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/credentials.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n)\n\n// CredentialsService handles credentials related methods of the GitHub API.\ntype CredentialsService service\n\n// revokeCredentialsRequest represents the request body for revoking credentials.\ntype revokeCredentialsRequest struct {\n\t// The list of credential strings (tokens) to revoke.\n\tCredentials []string `json:\"credentials\"`\n}\n\n// Revoke revokes a list of credentials.\n//\n// GitHub API docs: https://docs.github.com/rest/credentials/revoke#revoke-a-list-of-credentials\n//\n//meta:operation POST /credentials/revoke\nfunc (s *CredentialsService) Revoke(ctx context.Context, credentials []string) (*Response, error) {\n\tu := \"credentials/revoke\"\n\n\treqBody := &revokeCredentialsRequest{Credentials: credentials}\n\n\treq, err := s.client.NewRequest(\"POST\", u, reqBody)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/credentials_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"net/http\"\n\t\"testing\"\n)\n\nfunc TestCredentialsService_Revoke(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tcreds := []string{\n\t\t\"ghp_1234567890abcdef1234567890abcdef12345678\",\n\t\t\"ghp_abcdef1234567890abcdef1234567890abcdef12\",\n\t}\n\texpectedBodyBytes, _ := json.Marshal(map[string][]string{\"credentials\": creds})\n\texpectedBody := string(expectedBodyBytes) + \"\\n\"\n\n\tmux.HandleFunc(\"/credentials/revoke\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestBody(t, r, expectedBody)\n\t\tw.WriteHeader(http.StatusAccepted)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Credentials.Revoke(ctx, creds)\n\tif !errors.As(err, new(*AcceptedError)) {\n\t\tt.Errorf(\"Credentials.Revoke returned error: %v (want AcceptedError)\", err)\n\t}\n\tif resp == nil {\n\t\tt.Fatal(\"Credentials.Revoke returned nil response\")\n\t}\n\tif resp.StatusCode != http.StatusAccepted {\n\t\tt.Errorf(\"Credentials.Revoke returned status %v, want %v\", resp.StatusCode, http.StatusAccepted)\n\t}\n\n\tconst methodName = \"Revoke\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Credentials.Revoke(ctx, []string{\"a\"})\n\t})\n}\n"
  },
  {
    "path": "github/dependabot.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\n// DependabotService handles communication with the Dependabot related\n// methods of the GitHub API.\n//\n// GitHub API docs: https://docs.github.com/rest/dependabot/\ntype DependabotService service\n"
  },
  {
    "path": "github/dependabot_alerts.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// Dependency represents the vulnerable dependency.\ntype Dependency struct {\n\tPackage      *VulnerabilityPackage `json:\"package,omitempty\"`\n\tManifestPath *string               `json:\"manifest_path,omitempty\"`\n\tScope        *string               `json:\"scope,omitempty\"`\n}\n\n// AdvisoryCVSS represents the advisory pertaining to the Common Vulnerability Scoring System.\ntype AdvisoryCVSS struct {\n\tScore        *float64 `json:\"score,omitempty\"`\n\tVectorString *string  `json:\"vector_string,omitempty\"`\n}\n\n// AdvisoryCWEs represent the advisory pertaining to Common Weakness Enumeration.\ntype AdvisoryCWEs struct {\n\tCWEID *string `json:\"cwe_id,omitempty\"`\n\tName  *string `json:\"name,omitempty\"`\n}\n\n// AdvisoryEPSS represents the advisory pertaining to the Exploit Prediction Scoring System.\n//\n// For more information, see:\n// https://github.blog/changelog/2024-10-10-epss-scores-in-the-github-advisory-database/\ntype AdvisoryEPSS struct {\n\tPercentage float64 `json:\"percentage\"`\n\tPercentile float64 `json:\"percentile\"`\n}\n\n// DependabotSecurityAdvisory represents the GitHub Security Advisory.\ntype DependabotSecurityAdvisory struct {\n\tGHSAID          *string                  `json:\"ghsa_id,omitempty\"`\n\tCVEID           *string                  `json:\"cve_id,omitempty\"`\n\tSummary         *string                  `json:\"summary,omitempty\"`\n\tDescription     *string                  `json:\"description,omitempty\"`\n\tVulnerabilities []*AdvisoryVulnerability `json:\"vulnerabilities,omitempty\"`\n\tSeverity        *string                  `json:\"severity,omitempty\"`\n\tCVSS            *AdvisoryCVSS            `json:\"cvss,omitempty\"`\n\tCWEs            []*AdvisoryCWEs          `json:\"cwes,omitempty\"`\n\tEPSS            *AdvisoryEPSS            `json:\"epss,omitempty\"`\n\tIdentifiers     []*AdvisoryIdentifier    `json:\"identifiers,omitempty\"`\n\tReferences      []*AdvisoryReference     `json:\"references,omitempty\"`\n\tPublishedAt     *Timestamp               `json:\"published_at,omitempty\"`\n\tUpdatedAt       *Timestamp               `json:\"updated_at,omitempty\"`\n\tWithdrawnAt     *Timestamp               `json:\"withdrawn_at,omitempty\"`\n}\n\n// DependabotAlert represents a Dependabot alert.\ntype DependabotAlert struct {\n\tNumber                *int                        `json:\"number,omitempty\"`\n\tState                 *string                     `json:\"state,omitempty\"`\n\tDependency            *Dependency                 `json:\"dependency,omitempty\"`\n\tSecurityAdvisory      *DependabotSecurityAdvisory `json:\"security_advisory,omitempty\"`\n\tSecurityVulnerability *AdvisoryVulnerability      `json:\"security_vulnerability,omitempty\"`\n\tURL                   *string                     `json:\"url,omitempty\"`\n\tHTMLURL               *string                     `json:\"html_url,omitempty\"`\n\tCreatedAt             *Timestamp                  `json:\"created_at,omitempty\"`\n\tUpdatedAt             *Timestamp                  `json:\"updated_at,omitempty\"`\n\tDismissedAt           *Timestamp                  `json:\"dismissed_at,omitempty\"`\n\tDismissedBy           *User                       `json:\"dismissed_by,omitempty\"`\n\tDismissedReason       *string                     `json:\"dismissed_reason,omitempty\"`\n\tDismissedComment      *string                     `json:\"dismissed_comment,omitempty\"`\n\tFixedAt               *Timestamp                  `json:\"fixed_at,omitempty\"`\n\tAutoDismissedAt       *Timestamp                  `json:\"auto_dismissed_at,omitempty\"`\n\t// The repository is always empty for events\n\tRepository *Repository `json:\"repository,omitempty\"`\n}\n\n// DependabotAlertState represents the state of a Dependabot alert to update.\ntype DependabotAlertState struct {\n\t// The state of the Dependabot alert. A dismissed_reason must be provided when setting the state to dismissed.\n\tState string `json:\"state\"`\n\t// Required when state is dismissed. A reason for dismissing the alert.\n\t// Can be one of: fix_started, inaccurate, no_bandwidth, not_used, tolerable_risk\n\tDismissedReason *string `json:\"dismissed_reason,omitempty\"`\n\t// An optional comment associated with dismissing the alert.\n\tDismissedComment *string `json:\"dismissed_comment,omitempty\"`\n}\n\n// ListAlertsOptions specifies the optional parameters to the DependabotService.ListRepoAlerts\n// and DependabotService.ListOrgAlerts methods.\ntype ListAlertsOptions struct {\n\tState     *string `url:\"state,omitempty\"`\n\tSeverity  *string `url:\"severity,omitempty\"`\n\tEcosystem *string `url:\"ecosystem,omitempty\"`\n\tPackage   *string `url:\"package,omitempty\"`\n\tScope     *string `url:\"scope,omitempty\"`\n\tSort      *string `url:\"sort,omitempty\"`\n\tDirection *string `url:\"direction,omitempty\"`\n\n\tListOptions\n\tListCursorOptions\n}\n\nfunc (s *DependabotService) listAlerts(ctx context.Context, url string, opts *ListAlertsOptions) ([]*DependabotAlert, *Response, error) {\n\tu, err := addOptions(url, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar alerts []*DependabotAlert\n\tresp, err := s.client.Do(ctx, req, &alerts)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn alerts, resp, nil\n}\n\n// ListRepoAlerts lists all Dependabot alerts of a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/dependabot/alerts\nfunc (s *DependabotService) ListRepoAlerts(ctx context.Context, owner, repo string, opts *ListAlertsOptions) ([]*DependabotAlert, *Response, error) {\n\turl := fmt.Sprintf(\"repos/%v/%v/dependabot/alerts\", owner, repo)\n\treturn s.listAlerts(ctx, url, opts)\n}\n\n// ListOrgAlerts lists all Dependabot alerts of an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-organization\n//\n//meta:operation GET /orgs/{org}/dependabot/alerts\nfunc (s *DependabotService) ListOrgAlerts(ctx context.Context, org string, opts *ListAlertsOptions) ([]*DependabotAlert, *Response, error) {\n\turl := fmt.Sprintf(\"orgs/%v/dependabot/alerts\", org)\n\treturn s.listAlerts(ctx, url, opts)\n}\n\n// GetRepoAlert gets a single repository Dependabot alert.\n//\n// GitHub API docs: https://docs.github.com/rest/dependabot/alerts#get-a-dependabot-alert\n//\n//meta:operation GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}\nfunc (s *DependabotService) GetRepoAlert(ctx context.Context, owner, repo string, number int) (*DependabotAlert, *Response, error) {\n\turl := fmt.Sprintf(\"repos/%v/%v/dependabot/alerts/%v\", owner, repo, number)\n\treq, err := s.client.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar alert *DependabotAlert\n\tresp, err := s.client.Do(ctx, req, &alert)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn alert, resp, nil\n}\n\n// UpdateAlert updates a Dependabot alert.\n//\n// GitHub API docs: https://docs.github.com/rest/dependabot/alerts#update-a-dependabot-alert\n//\n//meta:operation PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}\nfunc (s *DependabotService) UpdateAlert(ctx context.Context, owner, repo string, number int, stateInfo *DependabotAlertState) (*DependabotAlert, *Response, error) {\n\turl := fmt.Sprintf(\"repos/%v/%v/dependabot/alerts/%v\", owner, repo, number)\n\treq, err := s.client.NewRequest(\"PATCH\", url, stateInfo)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar alert *DependabotAlert\n\tresp, err := s.client.Do(ctx, req, &alert)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn alert, resp, nil\n}\n"
  },
  {
    "path": "github/dependabot_alerts_test.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestDependabotService_ListRepoAlerts(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/dependabot/alerts\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"state\": \"open\"})\n\t\tfmt.Fprint(w, `[{\"number\":1,\"state\":\"open\"},{\"number\":42,\"state\":\"fixed\"}]`)\n\t})\n\n\topts := &ListAlertsOptions{State: Ptr(\"open\")}\n\tctx := t.Context()\n\talerts, _, err := client.Dependabot.ListRepoAlerts(ctx, \"o\", \"r\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Dependabot.ListRepoAlerts returned error: %v\", err)\n\t}\n\n\twant := []*DependabotAlert{\n\t\t{Number: Ptr(1), State: Ptr(\"open\")},\n\t\t{Number: Ptr(42), State: Ptr(\"fixed\")},\n\t}\n\tif !cmp.Equal(alerts, want) {\n\t\tt.Errorf(\"Dependabot.ListRepoAlerts returned %+v, want %+v\", alerts, want)\n\t}\n\n\tconst methodName = \"ListRepoAlerts\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Dependabot.ListRepoAlerts(ctx, \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Dependabot.ListRepoAlerts(ctx, \"o\", \"r\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestDependabotService_GetRepoAlert(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/dependabot/alerts/42\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"number\":42,\"state\":\"fixed\"}`)\n\t})\n\n\tctx := t.Context()\n\talert, _, err := client.Dependabot.GetRepoAlert(ctx, \"o\", \"r\", 42)\n\tif err != nil {\n\t\tt.Errorf(\"Dependabot.GetRepoAlert returned error: %v\", err)\n\t}\n\n\twant := &DependabotAlert{\n\t\tNumber: Ptr(42),\n\t\tState:  Ptr(\"fixed\"),\n\t}\n\tif !cmp.Equal(alert, want) {\n\t\tt.Errorf(\"Dependabot.GetRepoAlert returned %+v, want %+v\", alert, want)\n\t}\n\n\tconst methodName = \"GetRepoAlert\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Dependabot.GetRepoAlert(ctx, \"\\n\", \"\\n\", 0)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Dependabot.GetRepoAlert(ctx, \"o\", \"r\", 42)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestDependabotService_ListOrgAlerts(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/dependabot/alerts\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"state\": \"open\"})\n\t\tfmt.Fprint(w, `[{\"number\":1,\"state\":\"open\"},{\"number\":42,\"state\":\"fixed\"}]`)\n\t})\n\n\topts := &ListAlertsOptions{State: Ptr(\"open\")}\n\tctx := t.Context()\n\talerts, _, err := client.Dependabot.ListOrgAlerts(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Dependabot.ListOrgAlerts returned error: %v\", err)\n\t}\n\n\twant := []*DependabotAlert{\n\t\t{Number: Ptr(1), State: Ptr(\"open\")},\n\t\t{Number: Ptr(42), State: Ptr(\"fixed\")},\n\t}\n\tif !cmp.Equal(alerts, want) {\n\t\tt.Errorf(\"Dependabot.ListOrgAlerts returned %+v, want %+v\", alerts, want)\n\t}\n\n\tconst methodName = \"ListOrgAlerts\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Dependabot.ListOrgAlerts(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Dependabot.ListOrgAlerts(ctx, \"o\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestDependabotService_UpdateAlert(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tstate := Ptr(\"dismissed\")\n\tdismissedReason := Ptr(\"no_bandwidth\")\n\tdismissedComment := Ptr(\"no time to fix this\")\n\n\talertState := &DependabotAlertState{State: *state, DismissedReason: dismissedReason, DismissedComment: dismissedComment}\n\n\tmux.HandleFunc(\"/repos/o/r/dependabot/alerts/42\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tfmt.Fprint(w, `{\"number\":42,\"state\":\"dismissed\",\"dismissed_reason\":\"no_bandwidth\",\"dismissed_comment\":\"no time to fix this\"}`)\n\t})\n\n\tctx := t.Context()\n\talert, _, err := client.Dependabot.UpdateAlert(ctx, \"o\", \"r\", 42, alertState)\n\tif err != nil {\n\t\tt.Errorf(\"Dependabot.UpdateAlert returned error: %v\", err)\n\t}\n\n\twant := &DependabotAlert{\n\t\tNumber:           Ptr(42),\n\t\tState:            Ptr(\"dismissed\"),\n\t\tDismissedReason:  Ptr(\"no_bandwidth\"),\n\t\tDismissedComment: Ptr(\"no time to fix this\"),\n\t}\n\tif !cmp.Equal(alert, want) {\n\t\tt.Errorf(\"Dependabot.UpdateAlert returned %+v, want %+v\", alert, want)\n\t}\n\n\tconst methodName = \"UpdateAlert\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Dependabot.UpdateAlert(ctx, \"\\n\", \"\\n\", 0, alertState)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Dependabot.UpdateAlert(ctx, \"o\", \"r\", 42, alertState)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestDependency_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Dependency{}, \"{}\")\n\n\th := &Dependency{\n\t\tPackage: &VulnerabilityPackage{\n\t\t\tEcosystem: Ptr(\"pip\"),\n\t\t\tName:      Ptr(\"django\"),\n\t\t},\n\t\tManifestPath: Ptr(\"path/to/requirements.txt\"),\n\t\tScope:        Ptr(\"runtime\"),\n\t}\n\n\twant := `{\n\t\t\"package\": {\n        \"ecosystem\": \"pip\",\n        \"name\": \"django\"\n      },\n      \"manifest_path\": \"path/to/requirements.txt\",\n      \"scope\": \"runtime\"\n\t}`\n\n\ttestJSONMarshal(t, h, want)\n}\n\nfunc TestAdvisoryCVSS_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &AdvisoryCVSS{}, \"{}\")\n\n\th := &AdvisoryCVSS{\n\t\tScore:        Ptr(7.5),\n\t\tVectorString: Ptr(\"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N\"),\n\t}\n\n\twant := `{\n\t\t\"vector_string\": \"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N\",\n        \"score\": 7.5\n\t}`\n\n\ttestJSONMarshal(t, h, want)\n}\n\nfunc TestAdvisoryCWEs_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &AdvisoryCWEs{}, \"{}\")\n\n\th := &AdvisoryCWEs{\n\t\tCWEID: Ptr(\"CWE-200\"),\n\t\tName:  Ptr(\"Exposure of Sensitive Information to an Unauthorized Actor\"),\n\t}\n\n\twant := `{\n\t\t\"cwe_id\": \"CWE-200\",\n\t\t\"name\": \"Exposure of Sensitive Information to an Unauthorized Actor\"\n\t}`\n\n\ttestJSONMarshal(t, h, want)\n}\n\nfunc TestDependabotSecurityAdvisory_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &DependabotSecurityAdvisory{}, \"{}\")\n\n\tpublishedAt, _ := time.Parse(time.RFC3339, \"2018-10-03T21:13:54Z\")\n\tupdatedAt, _ := time.Parse(time.RFC3339, \"2022-04-26T18:35:37Z\")\n\n\th := &DependabotSecurityAdvisory{\n\t\tGHSAID:      Ptr(\"GHSA-rf4j-j272-fj86\"),\n\t\tCVEID:       Ptr(\"CVE-2018-6188\"),\n\t\tSummary:     Ptr(\"Django allows remote attackers to obtain potentially sensitive information by leveraging data exposure from the confirm_login_allowed() method, as demonstrated by discovering whether a user account is inactive\"),\n\t\tDescription: Ptr(\"django.contrib.auth.forms.AuthenticationForm in Django 2.0 before 2.0.2, and 1.11.8 and 1.11.9, allows remote attackers to obtain potentially sensitive information by leveraging data exposure from the confirm_login_allowed() method, as demonstrated by discovering whether a user account is inactive.\"),\n\t\tVulnerabilities: []*AdvisoryVulnerability{\n\t\t\t{\n\t\t\t\tPackage: &VulnerabilityPackage{\n\t\t\t\t\tEcosystem: Ptr(\"pip\"),\n\t\t\t\t\tName:      Ptr(\"django\"),\n\t\t\t\t},\n\t\t\t\tSeverity:               Ptr(\"high\"),\n\t\t\t\tVulnerableVersionRange: Ptr(\">= 2.0.0, < 2.0.2\"),\n\t\t\t\tFirstPatchedVersion:    &FirstPatchedVersion{Identifier: Ptr(\"2.0.2\")},\n\t\t\t},\n\t\t\t{\n\t\t\t\tPackage: &VulnerabilityPackage{\n\t\t\t\t\tEcosystem: Ptr(\"pip\"),\n\t\t\t\t\tName:      Ptr(\"django\"),\n\t\t\t\t},\n\t\t\t\tSeverity:               Ptr(\"high\"),\n\t\t\t\tVulnerableVersionRange: Ptr(\">= 1.11.8, < 1.11.10\"),\n\t\t\t\tFirstPatchedVersion:    &FirstPatchedVersion{Identifier: Ptr(\"1.11.10\")},\n\t\t\t},\n\t\t},\n\t\tSeverity: Ptr(\"high\"),\n\t\tCVSS: &AdvisoryCVSS{\n\t\t\tScore:        Ptr(7.5),\n\t\t\tVectorString: Ptr(\"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N\"),\n\t\t},\n\t\tCWEs: []*AdvisoryCWEs{\n\t\t\t{\n\t\t\t\tCWEID: Ptr(\"CWE-200\"),\n\t\t\t\tName:  Ptr(\"Exposure of Sensitive Information to an Unauthorized Actor\"),\n\t\t\t},\n\t\t},\n\t\tEPSS: &AdvisoryEPSS{\n\t\t\tPercentage: 0.05,\n\t\t\tPercentile: 0.5,\n\t\t},\n\t\tIdentifiers: []*AdvisoryIdentifier{\n\t\t\t{\n\t\t\t\tType:  Ptr(\"GHSA\"),\n\t\t\t\tValue: Ptr(\"GHSA-rf4j-j272-fj86\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\tType:  Ptr(\"CVE\"),\n\t\t\t\tValue: Ptr(\"CVE-2018-6188\"),\n\t\t\t},\n\t\t},\n\t\tReferences: []*AdvisoryReference{\n\t\t\t{\n\t\t\t\tURL: Ptr(\"https://example.com/vuln/detail/CVE-2018-6188\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\tURL: Ptr(\"https://github.com/advisories/GHSA-rf4j-j272-fj86\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\tURL: Ptr(\"https://example.com/3559-1/\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\tURL: Ptr(\"https://example.com/weblog/2018/feb/01/security-releases/\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\tURL: Ptr(\"https://example.com/id/1040422\"),\n\t\t\t},\n\t\t},\n\t\tPublishedAt: &Timestamp{publishedAt},\n\t\tUpdatedAt:   &Timestamp{updatedAt},\n\t\tWithdrawnAt: nil,\n\t}\n\n\twant := `{\n\t  \"ghsa_id\": \"GHSA-rf4j-j272-fj86\",\n      \"cve_id\": \"CVE-2018-6188\",\n      \"summary\": \"Django allows remote attackers to obtain potentially sensitive information by leveraging data exposure from the confirm_login_allowed() method, as demonstrated by discovering whether a user account is inactive\",\n      \"description\": \"django.contrib.auth.forms.AuthenticationForm in Django 2.0 before 2.0.2, and 1.11.8 and 1.11.9, allows remote attackers to obtain potentially sensitive information by leveraging data exposure from the confirm_login_allowed() method, as demonstrated by discovering whether a user account is inactive.\",\n      \"vulnerabilities\": [\n        {\n          \"package\": {\n            \"ecosystem\": \"pip\",\n            \"name\": \"django\"\n          },\n          \"severity\": \"high\",\n          \"vulnerable_version_range\": \">= 2.0.0, < 2.0.2\",\n          \"first_patched_version\": {\n            \"identifier\": \"2.0.2\"\n          }\n        },\n        {\n          \"package\": {\n            \"ecosystem\": \"pip\",\n            \"name\": \"django\"\n          },\n          \"severity\": \"high\",\n          \"vulnerable_version_range\": \">= 1.11.8, < 1.11.10\",\n          \"first_patched_version\": {\n            \"identifier\": \"1.11.10\"\n          }\n        }\n      ],\n      \"severity\": \"high\",\n      \"cvss\": {\n        \"vector_string\": \"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N\",\n        \"score\": 7.5\n      },\n      \"cwes\": [\n        {\n          \"cwe_id\": \"CWE-200\",\n          \"name\": \"Exposure of Sensitive Information to an Unauthorized Actor\"\n        }\n      ],\n      \"epss\": {\n        \"percentage\": 0.05,\n        \"percentile\": 0.5\n      },\n      \"identifiers\": [\n        {\n          \"type\": \"GHSA\",\n          \"value\": \"GHSA-rf4j-j272-fj86\"\n        },\n        {\n          \"type\": \"CVE\",\n          \"value\": \"CVE-2018-6188\"\n        }\n      ],\n      \"references\": [\n        {\n          \"url\": \"https://example.com/vuln/detail/CVE-2018-6188\"\n        },\n        {\n          \"url\": \"https://github.com/advisories/GHSA-rf4j-j272-fj86\"\n        },\n        {\n          \"url\": \"https://example.com/3559-1/\"\n        },\n        {\n          \"url\": \"https://example.com/weblog/2018/feb/01/security-releases/\"\n        },\n        {\n          \"url\": \"https://example.com/id/1040422\"\n        }\n      ],\n      \"published_at\": \"2018-10-03T21:13:54Z\",\n      \"updated_at\": \"2022-04-26T18:35:37Z\"\n\t}`\n\n\ttestJSONMarshal(t, h, want)\n}\n"
  },
  {
    "path": "github/dependabot_secrets.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n)\n\nfunc (s *DependabotService) getPublicKey(ctx context.Context, url string) (*PublicKey, *Response, error) {\n\treq, err := s.client.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar pubKey *PublicKey\n\tresp, err := s.client.Do(ctx, req, &pubKey)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn pubKey, resp, nil\n}\n\n// GetRepoPublicKey gets a public key that should be used for Dependabot secret encryption.\n//\n// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#get-a-repository-public-key\n//\n//meta:operation GET /repos/{owner}/{repo}/dependabot/secrets/public-key\nfunc (s *DependabotService) GetRepoPublicKey(ctx context.Context, owner, repo string) (*PublicKey, *Response, error) {\n\turl := fmt.Sprintf(\"repos/%v/%v/dependabot/secrets/public-key\", owner, repo)\n\treturn s.getPublicKey(ctx, url)\n}\n\n// GetOrgPublicKey gets a public key that should be used for Dependabot secret encryption.\n//\n// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#get-an-organization-public-key\n//\n//meta:operation GET /orgs/{org}/dependabot/secrets/public-key\nfunc (s *DependabotService) GetOrgPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error) {\n\turl := fmt.Sprintf(\"orgs/%v/dependabot/secrets/public-key\", org)\n\treturn s.getPublicKey(ctx, url)\n}\n\nfunc (s *DependabotService) listSecrets(ctx context.Context, url string, opts *ListOptions) (*Secrets, *Response, error) {\n\tu, err := addOptions(url, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar secrets *Secrets\n\tresp, err := s.client.Do(ctx, req, &secrets)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn secrets, resp, nil\n}\n\n// ListRepoSecrets lists all Dependabot secrets available in a repository\n// without revealing their encrypted values.\n//\n// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#list-repository-secrets\n//\n//meta:operation GET /repos/{owner}/{repo}/dependabot/secrets\nfunc (s *DependabotService) ListRepoSecrets(ctx context.Context, owner, repo string, opts *ListOptions) (*Secrets, *Response, error) {\n\turl := fmt.Sprintf(\"repos/%v/%v/dependabot/secrets\", owner, repo)\n\treturn s.listSecrets(ctx, url, opts)\n}\n\n// ListOrgSecrets lists all Dependabot secrets available in an organization\n// without revealing their encrypted values.\n//\n// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#list-organization-secrets\n//\n//meta:operation GET /orgs/{org}/dependabot/secrets\nfunc (s *DependabotService) ListOrgSecrets(ctx context.Context, org string, opts *ListOptions) (*Secrets, *Response, error) {\n\turl := fmt.Sprintf(\"orgs/%v/dependabot/secrets\", org)\n\treturn s.listSecrets(ctx, url, opts)\n}\n\nfunc (s *DependabotService) getSecret(ctx context.Context, url string) (*Secret, *Response, error) {\n\treq, err := s.client.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar secret *Secret\n\tresp, err := s.client.Do(ctx, req, &secret)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn secret, resp, nil\n}\n\n// GetRepoSecret gets a single repository Dependabot secret without revealing its encrypted value.\n//\n// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#get-a-repository-secret\n//\n//meta:operation GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}\nfunc (s *DependabotService) GetRepoSecret(ctx context.Context, owner, repo, name string) (*Secret, *Response, error) {\n\turl := fmt.Sprintf(\"repos/%v/%v/dependabot/secrets/%v\", owner, repo, name)\n\treturn s.getSecret(ctx, url)\n}\n\n// GetOrgSecret gets a single organization Dependabot secret without revealing its encrypted value.\n//\n// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#get-an-organization-secret\n//\n//meta:operation GET /orgs/{org}/dependabot/secrets/{secret_name}\nfunc (s *DependabotService) GetOrgSecret(ctx context.Context, org, name string) (*Secret, *Response, error) {\n\turl := fmt.Sprintf(\"orgs/%v/dependabot/secrets/%v\", org, name)\n\treturn s.getSecret(ctx, url)\n}\n\n// DependabotEncryptedSecret represents a secret that is encrypted using a public key for Dependabot.\n//\n// The value of EncryptedValue must be your secret, encrypted with\n// LibSodium (see documentation here: https://libsodium.gitbook.io/doc/bindings_for_other_languages)\n// using the public key retrieved using the GetPublicKey method.\ntype DependabotEncryptedSecret struct {\n\tName                  string                           `json:\"-\"`\n\tKeyID                 string                           `json:\"key_id\"`\n\tEncryptedValue        string                           `json:\"encrypted_value\"`\n\tVisibility            string                           `json:\"visibility,omitempty\"`\n\tSelectedRepositoryIDs DependabotSecretsSelectedRepoIDs `json:\"selected_repository_ids,omitempty\"`\n}\n\nfunc (s *DependabotService) putSecret(ctx context.Context, url string, eSecret *DependabotEncryptedSecret) (*Response, error) {\n\treq, err := s.client.NewRequest(\"PUT\", url, eSecret)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// CreateOrUpdateRepoSecret creates or updates a repository Dependabot secret with an encrypted value.\n//\n// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#create-or-update-a-repository-secret\n//\n//meta:operation PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}\nfunc (s *DependabotService) CreateOrUpdateRepoSecret(ctx context.Context, owner, repo string, eSecret *DependabotEncryptedSecret) (*Response, error) {\n\tif eSecret == nil {\n\t\treturn nil, errors.New(\"dependabot encrypted secret must be provided\")\n\t}\n\n\turl := fmt.Sprintf(\"repos/%v/%v/dependabot/secrets/%v\", owner, repo, eSecret.Name)\n\treturn s.putSecret(ctx, url, eSecret)\n}\n\n// CreateOrUpdateOrgSecret creates or updates an organization Dependabot secret with an encrypted value.\n//\n// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret\n//\n//meta:operation PUT /orgs/{org}/dependabot/secrets/{secret_name}\nfunc (s *DependabotService) CreateOrUpdateOrgSecret(ctx context.Context, org string, eSecret *DependabotEncryptedSecret) (*Response, error) {\n\tif eSecret == nil {\n\t\treturn nil, errors.New(\"dependabot encrypted secret must be provided\")\n\t}\n\n\trepoIDs := make([]string, len(eSecret.SelectedRepositoryIDs))\n\tfor i, secret := range eSecret.SelectedRepositoryIDs {\n\t\trepoIDs[i] = fmt.Sprintf(\"%v\", secret)\n\t}\n\tparams := struct {\n\t\t*DependabotEncryptedSecret\n\t\tSelectedRepositoryIDs []string `json:\"selected_repository_ids,omitempty\"`\n\t}{\n\t\tDependabotEncryptedSecret: eSecret,\n\t\tSelectedRepositoryIDs:     repoIDs,\n\t}\n\n\turl := fmt.Sprintf(\"orgs/%v/dependabot/secrets/%v\", org, eSecret.Name)\n\treq, err := s.client.NewRequest(\"PUT\", url, params)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\nfunc (s *DependabotService) deleteSecret(ctx context.Context, url string) (*Response, error) {\n\treq, err := s.client.NewRequest(\"DELETE\", url, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// DeleteRepoSecret deletes a Dependabot secret in a repository using the secret name.\n//\n// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#delete-a-repository-secret\n//\n//meta:operation DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}\nfunc (s *DependabotService) DeleteRepoSecret(ctx context.Context, owner, repo, name string) (*Response, error) {\n\turl := fmt.Sprintf(\"repos/%v/%v/dependabot/secrets/%v\", owner, repo, name)\n\treturn s.deleteSecret(ctx, url)\n}\n\n// DeleteOrgSecret deletes a Dependabot secret in an organization using the secret name.\n//\n// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#delete-an-organization-secret\n//\n//meta:operation DELETE /orgs/{org}/dependabot/secrets/{secret_name}\nfunc (s *DependabotService) DeleteOrgSecret(ctx context.Context, org, name string) (*Response, error) {\n\turl := fmt.Sprintf(\"orgs/%v/dependabot/secrets/%v\", org, name)\n\treturn s.deleteSecret(ctx, url)\n}\n\n// ListSelectedReposForOrgSecret lists all repositories that have access to a Dependabot secret.\n//\n// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret\n//\n//meta:operation GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories\nfunc (s *DependabotService) ListSelectedReposForOrgSecret(ctx context.Context, org, name string, opts *ListOptions) (*SelectedReposList, *Response, error) {\n\turl := fmt.Sprintf(\"orgs/%v/dependabot/secrets/%v/repositories\", org, name)\n\tu, err := addOptions(url, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar result *SelectedReposList\n\tresp, err := s.client.Do(ctx, req, &result)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn result, resp, nil\n}\n\n// DependabotSecretsSelectedRepoIDs are the repository IDs that have access to the dependabot secrets.\ntype DependabotSecretsSelectedRepoIDs []int64\n\n// SetSelectedReposForOrgSecret sets the repositories that have access to a Dependabot secret.\n//\n// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret\n//\n//meta:operation PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories\nfunc (s *DependabotService) SetSelectedReposForOrgSecret(ctx context.Context, org, name string, ids DependabotSecretsSelectedRepoIDs) (*Response, error) {\n\turl := fmt.Sprintf(\"orgs/%v/dependabot/secrets/%v/repositories\", org, name)\n\ttype repoIDs struct {\n\t\tSelectedIDs DependabotSecretsSelectedRepoIDs `json:\"selected_repository_ids\"`\n\t}\n\n\treq, err := s.client.NewRequest(\"PUT\", url, repoIDs{SelectedIDs: ids})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// AddSelectedRepoToOrgSecret adds a repository to an organization Dependabot secret.\n//\n// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#add-selected-repository-to-an-organization-secret\n//\n//meta:operation PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}\nfunc (s *DependabotService) AddSelectedRepoToOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) {\n\tif repo == nil {\n\t\treturn nil, errors.New(\"repository must be provided\")\n\t}\n\tif repo.ID == nil {\n\t\treturn nil, errors.New(\"id must be provided\")\n\t}\n\n\turl := fmt.Sprintf(\"orgs/%v/dependabot/secrets/%v/repositories/%v\", org, name, *repo.ID)\n\treq, err := s.client.NewRequest(\"PUT\", url, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// RemoveSelectedRepoFromOrgSecret removes a repository from an organization Dependabot secret.\n//\n// GitHub API docs: https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret\n//\n//meta:operation DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}\nfunc (s *DependabotService) RemoveSelectedRepoFromOrgSecret(ctx context.Context, org, name string, repo *Repository) (*Response, error) {\n\tif repo == nil {\n\t\treturn nil, errors.New(\"repository must be provided\")\n\t}\n\tif repo.ID == nil {\n\t\treturn nil, errors.New(\"id must be provided\")\n\t}\n\n\turl := fmt.Sprintf(\"orgs/%v/dependabot/secrets/%v/repositories/%v\", org, name, *repo.ID)\n\treq, err := s.client.NewRequest(\"DELETE\", url, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/dependabot_secrets_test.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestDependabotService_GetRepoPublicKey(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/dependabot/secrets/public-key\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"key_id\":\"1234\",\"key\":\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\"}`)\n\t})\n\n\tctx := t.Context()\n\tkey, _, err := client.Dependabot.GetRepoPublicKey(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Dependabot.GetRepoPublicKey returned error: %v\", err)\n\t}\n\n\twant := &PublicKey{KeyID: Ptr(\"1234\"), Key: Ptr(\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\")}\n\tif !cmp.Equal(key, want) {\n\t\tt.Errorf(\"Dependabot.GetRepoPublicKey returned %+v, want %+v\", key, want)\n\t}\n\n\tconst methodName = \"GetRepoPublicKey\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Dependabot.GetRepoPublicKey(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Dependabot.GetRepoPublicKey(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestDependabotService_GetRepoPublicKeyNumeric(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/dependabot/secrets/public-key\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"key_id\":1234,\"key\":\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\"}`)\n\t})\n\n\tctx := t.Context()\n\tkey, _, err := client.Dependabot.GetRepoPublicKey(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Dependabot.GetRepoPublicKey returned error: %v\", err)\n\t}\n\n\twant := &PublicKey{KeyID: Ptr(\"1234\"), Key: Ptr(\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\")}\n\tif !cmp.Equal(key, want) {\n\t\tt.Errorf(\"Dependabot.GetRepoPublicKey returned %+v, want %+v\", key, want)\n\t}\n\n\tconst methodName = \"GetRepoPublicKey\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Dependabot.GetRepoPublicKey(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Dependabot.GetRepoPublicKey(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestDependabotService_ListRepoSecrets(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/dependabot/secrets\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `{\"total_count\":4,\"secrets\":[{\"name\":\"A\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"},{\"name\":\"B\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"}]}`)\n\t})\n\n\topts := &ListOptions{Page: 2, PerPage: 2}\n\tctx := t.Context()\n\tsecrets, _, err := client.Dependabot.ListRepoSecrets(ctx, \"o\", \"r\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Dependabot.ListRepoSecrets returned error: %v\", err)\n\t}\n\n\twant := &Secrets{\n\t\tTotalCount: 4,\n\t\tSecrets: []*Secret{\n\t\t\t{Name: \"A\", CreatedAt: Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)}, UpdatedAt: Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)}},\n\t\t\t{Name: \"B\", CreatedAt: Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)}, UpdatedAt: Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)}},\n\t\t},\n\t}\n\tif !cmp.Equal(secrets, want) {\n\t\tt.Errorf(\"Dependabot.ListRepoSecrets returned %+v, want %+v\", secrets, want)\n\t}\n\n\tconst methodName = \"ListRepoSecrets\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Dependabot.ListRepoSecrets(ctx, \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Dependabot.ListRepoSecrets(ctx, \"o\", \"r\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestDependabotService_GetRepoSecret(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/dependabot/secrets/NAME\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"name\":\"NAME\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\"}`)\n\t})\n\n\tctx := t.Context()\n\tsecret, _, err := client.Dependabot.GetRepoSecret(ctx, \"o\", \"r\", \"NAME\")\n\tif err != nil {\n\t\tt.Errorf(\"Dependabot.GetRepoSecret returned error: %v\", err)\n\t}\n\n\twant := &Secret{\n\t\tName:      \"NAME\",\n\t\tCreatedAt: Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t\tUpdatedAt: Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t}\n\tif !cmp.Equal(secret, want) {\n\t\tt.Errorf(\"Dependabot.GetRepoSecret returned %+v, want %+v\", secret, want)\n\t}\n\n\tconst methodName = \"GetRepoSecret\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Dependabot.GetRepoSecret(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Dependabot.GetRepoSecret(ctx, \"o\", \"r\", \"NAME\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestDependabotService_CreateOrUpdateRepoSecret(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/dependabot/secrets/NAME\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\ttestBody(t, r, `{\"key_id\":\"1234\",\"encrypted_value\":\"QIv=\"}`+\"\\n\")\n\t\tw.WriteHeader(http.StatusCreated)\n\t})\n\n\tinput := &DependabotEncryptedSecret{\n\t\tName:           \"NAME\",\n\t\tEncryptedValue: \"QIv=\",\n\t\tKeyID:          \"1234\",\n\t}\n\tctx := t.Context()\n\t_, err := client.Dependabot.CreateOrUpdateRepoSecret(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Dependabot.CreateOrUpdateRepoSecret returned error: %v\", err)\n\t}\n\n\tconst methodName = \"CreateOrUpdateRepoSecret\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Dependabot.CreateOrUpdateRepoSecret(ctx, \"o\", \"r\", nil)\n\t\treturn err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Dependabot.CreateOrUpdateRepoSecret(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Dependabot.CreateOrUpdateRepoSecret(ctx, \"o\", \"r\", input)\n\t})\n}\n\nfunc TestDependabotService_DeleteRepoSecret(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/dependabot/secrets/NAME\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Dependabot.DeleteRepoSecret(ctx, \"o\", \"r\", \"NAME\")\n\tif err != nil {\n\t\tt.Errorf(\"Dependabot.DeleteRepoSecret returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteRepoSecret\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Dependabot.DeleteRepoSecret(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Dependabot.DeleteRepoSecret(ctx, \"o\", \"r\", \"NAME\")\n\t})\n}\n\nfunc TestDependabotService_GetOrgPublicKey(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/dependabot/secrets/public-key\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"key_id\":\"012345678\",\"key\":\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\"}`)\n\t})\n\n\tctx := t.Context()\n\tkey, _, err := client.Dependabot.GetOrgPublicKey(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Dependabot.GetOrgPublicKey returned error: %v\", err)\n\t}\n\n\twant := &PublicKey{KeyID: Ptr(\"012345678\"), Key: Ptr(\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\")}\n\tif !cmp.Equal(key, want) {\n\t\tt.Errorf(\"Dependabot.GetOrgPublicKey returned %+v, want %+v\", key, want)\n\t}\n\n\tconst methodName = \"GetOrgPublicKey\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Dependabot.GetOrgPublicKey(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Dependabot.GetOrgPublicKey(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestDependabotService_ListOrgSecrets(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/dependabot/secrets\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `{\"total_count\":3,\"secrets\":[{\"name\":\"GIST_ID\",\"created_at\":\"2019-08-10T14:59:22Z\",\"updated_at\":\"2020-01-10T14:59:22Z\",\"visibility\":\"private\"},{\"name\":\"DEPLOY_TOKEN\",\"created_at\":\"2019-08-10T14:59:22Z\",\"updated_at\":\"2020-01-10T14:59:22Z\",\"visibility\":\"all\"},{\"name\":\"GH_TOKEN\",\"created_at\":\"2019-08-10T14:59:22Z\",\"updated_at\":\"2020-01-10T14:59:22Z\",\"visibility\":\"selected\",\"selected_repositories_url\":\"https://api.github.com/orgs/octo-org/dependabot/secrets/SUPER_SECRET/repositories\"}]}`)\n\t})\n\n\topts := &ListOptions{Page: 2, PerPage: 2}\n\tctx := t.Context()\n\tsecrets, _, err := client.Dependabot.ListOrgSecrets(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Dependabot.ListOrgSecrets returned error: %v\", err)\n\t}\n\n\twant := &Secrets{\n\t\tTotalCount: 3,\n\t\tSecrets: []*Secret{\n\t\t\t{Name: \"GIST_ID\", CreatedAt: Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)}, UpdatedAt: Timestamp{time.Date(2020, time.January, 10, 14, 59, 22, 0, time.UTC)}, Visibility: \"private\"},\n\t\t\t{Name: \"DEPLOY_TOKEN\", CreatedAt: Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)}, UpdatedAt: Timestamp{time.Date(2020, time.January, 10, 14, 59, 22, 0, time.UTC)}, Visibility: \"all\"},\n\t\t\t{Name: \"GH_TOKEN\", CreatedAt: Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)}, UpdatedAt: Timestamp{time.Date(2020, time.January, 10, 14, 59, 22, 0, time.UTC)}, Visibility: \"selected\", SelectedRepositoriesURL: \"https://api.github.com/orgs/octo-org/dependabot/secrets/SUPER_SECRET/repositories\"},\n\t\t},\n\t}\n\tif !cmp.Equal(secrets, want) {\n\t\tt.Errorf(\"Dependabot.ListOrgSecrets returned %+v, want %+v\", secrets, want)\n\t}\n\n\tconst methodName = \"ListOrgSecrets\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Dependabot.ListOrgSecrets(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Dependabot.ListOrgSecrets(ctx, \"o\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestDependabotService_GetOrgSecret(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/dependabot/secrets/NAME\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"name\":\"NAME\",\"created_at\":\"2019-01-02T15:04:05Z\",\"updated_at\":\"2020-01-02T15:04:05Z\",\"visibility\":\"selected\",\"selected_repositories_url\":\"https://api.github.com/orgs/octo-org/dependabot/secrets/SUPER_SECRET/repositories\"}`)\n\t})\n\n\tctx := t.Context()\n\tsecret, _, err := client.Dependabot.GetOrgSecret(ctx, \"o\", \"NAME\")\n\tif err != nil {\n\t\tt.Errorf(\"Dependabot.GetOrgSecret returned error: %v\", err)\n\t}\n\n\twant := &Secret{\n\t\tName:                    \"NAME\",\n\t\tCreatedAt:               Timestamp{time.Date(2019, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t\tUpdatedAt:               Timestamp{time.Date(2020, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t\tVisibility:              \"selected\",\n\t\tSelectedRepositoriesURL: \"https://api.github.com/orgs/octo-org/dependabot/secrets/SUPER_SECRET/repositories\",\n\t}\n\tif !cmp.Equal(secret, want) {\n\t\tt.Errorf(\"Dependabot.GetOrgSecret returned %+v, want %+v\", secret, want)\n\t}\n\n\tconst methodName = \"GetOrgSecret\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Dependabot.GetOrgSecret(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Dependabot.GetOrgSecret(ctx, \"o\", \"NAME\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestDependabotService_CreateOrUpdateOrgSecret(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/dependabot/secrets/NAME\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\ttestBody(t, r, `{\"key_id\":\"1234\",\"encrypted_value\":\"QIv=\",\"visibility\":\"selected\",\"selected_repository_ids\":[\"1296269\",\"1269280\"]}`+\"\\n\")\n\t\tw.WriteHeader(http.StatusCreated)\n\t})\n\n\tinput := &DependabotEncryptedSecret{\n\t\tName:                  \"NAME\",\n\t\tEncryptedValue:        \"QIv=\",\n\t\tKeyID:                 \"1234\",\n\t\tVisibility:            \"selected\",\n\t\tSelectedRepositoryIDs: DependabotSecretsSelectedRepoIDs{1296269, 1269280},\n\t}\n\tctx := t.Context()\n\t_, err := client.Dependabot.CreateOrUpdateOrgSecret(ctx, \"o\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Dependabot.CreateOrUpdateOrgSecret returned error: %v\", err)\n\t}\n\n\tconst methodName = \"CreateOrUpdateOrgSecret\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Dependabot.CreateOrUpdateOrgSecret(ctx, \"o\", nil)\n\t\treturn err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Dependabot.CreateOrUpdateOrgSecret(ctx, \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Dependabot.CreateOrUpdateOrgSecret(ctx, \"o\", input)\n\t})\n}\n\nfunc TestDependabotService_ListSelectedReposForOrgSecret(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/dependabot/secrets/NAME/repositories\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"total_count\":1,\"repositories\":[{\"id\":1}]}`)\n\t})\n\n\topts := &ListOptions{Page: 2, PerPage: 2}\n\tctx := t.Context()\n\trepos, _, err := client.Dependabot.ListSelectedReposForOrgSecret(ctx, \"o\", \"NAME\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Dependabot.ListSelectedReposForOrgSecret returned error: %v\", err)\n\t}\n\n\twant := &SelectedReposList{\n\t\tTotalCount: Ptr(1),\n\t\tRepositories: []*Repository{\n\t\t\t{ID: Ptr(int64(1))},\n\t\t},\n\t}\n\tif !cmp.Equal(repos, want) {\n\t\tt.Errorf(\"Dependabot.ListSelectedReposForOrgSecret returned %+v, want %+v\", repos, want)\n\t}\n\n\tconst methodName = \"ListSelectedReposForOrgSecret\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Dependabot.ListSelectedReposForOrgSecret(ctx, \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Dependabot.ListSelectedReposForOrgSecret(ctx, \"o\", \"NAME\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestDependabotService_SetSelectedReposForOrgSecret(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/dependabot/secrets/NAME/repositories\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Content-Type\", \"application/json\")\n\t\ttestBody(t, r, `{\"selected_repository_ids\":[64780797]}`+\"\\n\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Dependabot.SetSelectedReposForOrgSecret(ctx, \"o\", \"NAME\", DependabotSecretsSelectedRepoIDs{64780797})\n\tif err != nil {\n\t\tt.Errorf(\"Dependabot.SetSelectedReposForOrgSecret returned error: %v\", err)\n\t}\n\n\tconst methodName = \"SetSelectedReposForOrgSecret\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Dependabot.SetSelectedReposForOrgSecret(ctx, \"\\n\", \"\\n\", DependabotSecretsSelectedRepoIDs{64780797})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Dependabot.SetSelectedReposForOrgSecret(ctx, \"o\", \"NAME\", DependabotSecretsSelectedRepoIDs{64780797})\n\t})\n}\n\nfunc TestDependabotService_AddSelectedRepoToOrgSecret(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/dependabot/secrets/NAME/repositories/1234\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t})\n\n\trepo := &Repository{ID: Ptr(int64(1234))}\n\tctx := t.Context()\n\t_, err := client.Dependabot.AddSelectedRepoToOrgSecret(ctx, \"o\", \"NAME\", repo)\n\tif err != nil {\n\t\tt.Errorf(\"Dependabot.AddSelectedRepoToOrgSecret returned error: %v\", err)\n\t}\n\n\tconst methodName = \"AddSelectedRepoToOrgSecret\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Dependabot.AddSelectedRepoToOrgSecret(ctx, \"o\", \"NAME\", nil)\n\t\treturn err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Dependabot.AddSelectedRepoToOrgSecret(ctx, \"o\", \"NAME\", &Repository{ID: nil})\n\t\treturn err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Dependabot.AddSelectedRepoToOrgSecret(ctx, \"\\n\", \"\\n\", repo)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Dependabot.AddSelectedRepoToOrgSecret(ctx, \"o\", \"NAME\", repo)\n\t})\n}\n\nfunc TestDependabotService_RemoveSelectedRepoFromOrgSecret(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/dependabot/secrets/NAME/repositories/1234\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\trepo := &Repository{ID: Ptr(int64(1234))}\n\tctx := t.Context()\n\t_, err := client.Dependabot.RemoveSelectedRepoFromOrgSecret(ctx, \"o\", \"NAME\", repo)\n\tif err != nil {\n\t\tt.Errorf(\"Dependabot.RemoveSelectedRepoFromOrgSecret returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveSelectedRepoFromOrgSecret\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Dependabot.RemoveSelectedRepoFromOrgSecret(ctx, \"o\", \"NAME\", nil)\n\t\treturn err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Dependabot.RemoveSelectedRepoFromOrgSecret(ctx, \"o\", \"NAME\", &Repository{ID: nil})\n\t\treturn err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Dependabot.RemoveSelectedRepoFromOrgSecret(ctx, \"\\n\", \"\\n\", repo)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Dependabot.RemoveSelectedRepoFromOrgSecret(ctx, \"o\", \"NAME\", repo)\n\t})\n}\n\nfunc TestDependabotService_DeleteOrgSecret(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/dependabot/secrets/NAME\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Dependabot.DeleteOrgSecret(ctx, \"o\", \"NAME\")\n\tif err != nil {\n\t\tt.Errorf(\"Dependabot.DeleteOrgSecret returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteOrgSecret\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Dependabot.DeleteOrgSecret(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Dependabot.DeleteOrgSecret(ctx, \"o\", \"NAME\")\n\t})\n}\n"
  },
  {
    "path": "github/dependency_graph.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// DependencyGraphService handles communication with the dependency graph\n// related methods of the GitHub API.\n//\n// GitHub API docs: https://docs.github.com/rest/dependency-graph\ntype DependencyGraphService service\n\n// SBOM represents a software bill of materials, which describes the\n// packages/libraries that a repository depends on.\ntype SBOM struct {\n\tSBOM *SBOMInfo `json:\"sbom,omitempty\"`\n}\n\n// CreationInfo represents when the SBOM was created and who created it.\ntype CreationInfo struct {\n\tCreated  *Timestamp `json:\"created,omitempty\"`\n\tCreators []string   `json:\"creators,omitempty\"`\n}\n\n// RepoDependencies represents the dependencies of a repo.\ntype RepoDependencies struct {\n\tSPDXID *string `json:\"SPDXID,omitempty\"`\n\t// Package name\n\tName             *string               `json:\"name,omitempty\"`\n\tVersionInfo      *string               `json:\"versionInfo,omitempty\"`\n\tDownloadLocation *string               `json:\"downloadLocation,omitempty\"`\n\tFilesAnalyzed    *bool                 `json:\"filesAnalyzed,omitempty\"`\n\tLicenseConcluded *string               `json:\"licenseConcluded,omitempty\"`\n\tLicenseDeclared  *string               `json:\"licenseDeclared,omitempty\"`\n\tExternalRefs     []*PackageExternalRef `json:\"externalRefs,omitempty\"`\n}\n\n// PackageExternalRef allows an Package to reference an external sources of additional information,\n// like asset identifiers, or downloadable content that are relevant to the package,\n// Example for identifiers (e.g., PURL/SWID/CPE) for a package in the SBOM.\n// https://spdx.github.io/spdx-spec/v2.3/package-information/#721-external-reference-field\ntype PackageExternalRef struct {\n\t// ReferenceCategory specifies the external reference categories such\n\t// SECURITY\", \"PACKAGE-MANAGER\", \"PERSISTENT-ID\", or \"OTHER\"\n\t// Example: \"PACKAGE-MANAGER\"\n\tReferenceCategory string `json:\"referenceCategory\"`\n\n\t// ReferenceType specifies the type of external reference.\n\t// For PACKAGE-MANAGER, it could be \"purl\"; other types include \"cpe22Type\", \"swid\", etc.\n\tReferenceType string `json:\"referenceType\"`\n\n\t// ReferenceLocator is the actual unique identifier or URI for the external reference.\n\t// Example: \"pkg:golang/github.com/spf13/cobra@1.8.1\"\n\tReferenceLocator string `json:\"referenceLocator\"`\n}\n\n// SBOMRelationship provides information about the relationship between two SPDX elements.\n// Element could be packages or files in the SBOM.\n// For example, to represent a relationship between two different Files, between a Package and a File,\n// between two Packages, or between one SPDXDocument and another SPDXDocument.\n// https://spdx.github.io/spdx-spec/v2.3/relationships-between-SPDX-elements/\ntype SBOMRelationship struct {\n\t// SPDXElementID is the identifier of the SPDX element that has a relationship.\n\t// Example: \"SPDXRef-github-interlynk-io-sbomqs-main-f43c98\"\n\tSPDXElementID string `json:\"spdxElementId\"`\n\n\t// RelatedSPDXElement is the identifier of the related SPDX element.\n\t// Example: \"SPDXRef-golang-github.comspf13-cobra-1.8.1-75c946\"\n\tRelatedSPDXElement string `json:\"relatedSpdxElement\"`\n\n\t// RelationshipType describes the type of relationship between the two elements.\n\t// Such as \"DEPENDS_ON\", \"DESCRIBES\", \"CONTAINS\", etc., as defined by SPDX 2.3.\n\t// Example: \"DEPENDS_ON\", \"CONTAINS\", \"DESCRIBES\", etc.\n\tRelationshipType string `json:\"relationshipType\"`\n}\n\n// SBOMInfo represents a software bill of materials (SBOM) using SPDX.\n// SPDX is an open standard for SBOMs that\n// identifies and catalogs components, licenses, copyrights, security\n// references, and other metadata relating to software.\ntype SBOMInfo struct {\n\tSPDXID       *string       `json:\"SPDXID,omitempty\"`\n\tSPDXVersion  *string       `json:\"spdxVersion,omitempty\"`\n\tCreationInfo *CreationInfo `json:\"creationInfo,omitempty\"`\n\n\t// Repo name\n\tName              *string  `json:\"name,omitempty\"`\n\tDataLicense       *string  `json:\"dataLicense,omitempty\"`\n\tDocumentDescribes []string `json:\"documentDescribes,omitempty\"`\n\tDocumentNamespace *string  `json:\"documentNamespace,omitempty\"`\n\n\t// List of packages dependencies\n\tPackages []*RepoDependencies `json:\"packages,omitempty\"`\n\n\t// List of relationships between packages\n\tRelationships []*SBOMRelationship `json:\"relationships,omitempty\"`\n}\n\nfunc (s SBOM) String() string {\n\treturn Stringify(s)\n}\n\n// GetSBOM fetches the software bill of materials for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/dependency-graph/sboms#export-a-software-bill-of-materials-sbom-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/dependency-graph/sbom\nfunc (s *DependencyGraphService) GetSBOM(ctx context.Context, owner, repo string) (*SBOM, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/dependency-graph/sbom\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar sbom *SBOM\n\tresp, err := s.client.Do(ctx, req, &sbom)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn sbom, resp, nil\n}\n"
  },
  {
    "path": "github/dependency_graph_snapshots.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// DependencyGraphSnapshotResolvedDependency represents a resolved dependency in a dependency graph snapshot.\n//\n// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository\ntype DependencyGraphSnapshotResolvedDependency struct {\n\tPackageURL *string `json:\"package_url,omitempty\"`\n\t// User-defined metadata to store domain-specific information limited to 8 keys with scalar values.\n\t// This metadata overrides auto-detected values from the package URL and GitHub's database.\n\t// Common fields include:\n\t//   - \"licenses\": license information (e.g., \"MIT\", \"Apache-2.0\")\n\t//   - \"name\": package name\n\t//   - \"version\": package version\n\t//   - \"manager\": package manager (e.g., \"npm\", \"pip\", \"maven\")\n\t//   - \"description\": package description\n\tMetadata map[string]any `json:\"metadata,omitempty\"`\n\t// Represents whether the dependency is requested directly by the manifest or is a dependency of another dependency.\n\t// Can have the following values:\n\t//   - \"direct\": indicates that the dependency is requested directly by the manifest.\n\t//   - \"indirect\": indicates that the dependency is a dependency of another dependency.\n\tRelationship *string `json:\"relationship,omitempty\"`\n\t// Represents whether the dependency is required for the primary build artifact or is only used for development.\n\t// Can have the following values:\n\t//   - \"runtime\": indicates that the dependency is required for the primary build artifact.\n\t//   - \"development\": indicates that the dependency is only used for development.\n\tScope        *string  `json:\"scope,omitempty\"`\n\tDependencies []string `json:\"dependencies,omitempty\"`\n}\n\n// DependencyGraphSnapshotJob represents the job that created the snapshot.\n//\n// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository\ntype DependencyGraphSnapshotJob struct {\n\tCorrelator *string `json:\"correlator,omitempty\"`\n\tID         *string `json:\"id,omitempty\"`\n\tHTMLURL    *string `json:\"html_url,omitempty\"`\n}\n\n// DependencyGraphSnapshotDetector represents a description of the detector used.\n//\n// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository\ntype DependencyGraphSnapshotDetector struct {\n\tName    *string `json:\"name,omitempty\"`\n\tVersion *string `json:\"version,omitempty\"`\n\tURL     *string `json:\"url,omitempty\"`\n}\n\n// DependencyGraphSnapshotManifestFile represents the file declaring the repository's dependencies.\n//\n// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository\ntype DependencyGraphSnapshotManifestFile struct {\n\tSourceLocation *string `json:\"source_location,omitempty\"`\n}\n\n// DependencyGraphSnapshotManifest represents a collection of related dependencies declared in a file or representing a logical group of dependencies.\n//\n// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository\ntype DependencyGraphSnapshotManifest struct {\n\tName     *string                                               `json:\"name,omitempty\"`\n\tFile     *DependencyGraphSnapshotManifestFile                  `json:\"file,omitempty\"`\n\tMetadata map[string]any                                        `json:\"metadata,omitempty\"`\n\tResolved map[string]*DependencyGraphSnapshotResolvedDependency `json:\"resolved,omitempty\"`\n}\n\n// DependencyGraphSnapshot represent a snapshot of a repository's dependencies.\n//\n// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository\ntype DependencyGraphSnapshot struct {\n\tVersion   int                                         `json:\"version\"`\n\tSha       *string                                     `json:\"sha,omitempty\"`\n\tRef       *string                                     `json:\"ref,omitempty\"`\n\tJob       *DependencyGraphSnapshotJob                 `json:\"job,omitempty\"`\n\tDetector  *DependencyGraphSnapshotDetector            `json:\"detector,omitempty\"`\n\tScanned   *Timestamp                                  `json:\"scanned,omitempty\"`\n\tMetadata  map[string]any                              `json:\"metadata,omitempty\"`\n\tManifests map[string]*DependencyGraphSnapshotManifest `json:\"manifests,omitempty\"`\n}\n\n// DependencyGraphSnapshotCreationData represents the dependency snapshot's creation result.\n//\n// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository\ntype DependencyGraphSnapshotCreationData struct {\n\tID        int64      `json:\"id\"`\n\tCreatedAt *Timestamp `json:\"created_at,omitempty\"`\n\tMessage   *string    `json:\"message,omitempty\"`\n\t// Represents the snapshot creation result.\n\t// Can have the following values:\n\t//   - \"SUCCESS\": indicates that the snapshot was successfully created and the repository's dependencies were updated.\n\t//   - \"ACCEPTED\": indicates that the snapshot was successfully created, but the repository's dependencies were not updated.\n\t//   - \"INVALID\": indicates that the snapshot was malformed.\n\tResult *string `json:\"result,omitempty\"`\n}\n\n// CreateSnapshot creates a new snapshot of a repository's dependencies.\n//\n// GitHub API docs: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository\n//\n//meta:operation POST /repos/{owner}/{repo}/dependency-graph/snapshots\nfunc (s *DependencyGraphService) CreateSnapshot(ctx context.Context, owner, repo string, dependencyGraphSnapshot *DependencyGraphSnapshot) (*DependencyGraphSnapshotCreationData, *Response, error) {\n\turl := fmt.Sprintf(\"repos/%v/%v/dependency-graph/snapshots\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"POST\", url, dependencyGraphSnapshot)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar snapshotCreationData *DependencyGraphSnapshotCreationData\n\tresp, err := s.client.Do(ctx, req, &snapshotCreationData)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn snapshotCreationData, resp, nil\n}\n"
  },
  {
    "path": "github/dependency_graph_snapshots_test.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestDependencyGraphService_CreateSnapshot(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/dependency-graph/snapshots\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestBody(t, r, `{\"version\":0,\"sha\":\"ce587453ced02b1526dfb4cb910479d431683101\",\"ref\":\"refs/heads/main\",\"job\":{\"correlator\":\"yourworkflowname_youractionname\",\"id\":\"yourrunid\",\"html_url\":\"https://example.com\"},\"detector\":{\"name\":\"octo-detector\",\"version\":\"0.0.1\",\"url\":\"https://github.com/octo-org/octo-repo\"},\"scanned\":\"2022-06-14T20:25:00Z\",\"metadata\":{\"key1\":\"value1\",\"key2\":\"value2\"},\"manifests\":{\"package-lock.json\":{\"name\":\"package-lock.json\",\"file\":{\"source_location\":\"src/package-lock.json\"},\"metadata\":{\"key1\":\"value1\",\"key2\":\"value2\"},\"resolved\":{\"@actions/core\":{\"package_url\":\"pkg:/npm/%40actions/core@1.1.9\",\"metadata\":{\"licenses\":\"MIT\"},\"relationship\":\"direct\",\"scope\":\"runtime\",\"dependencies\":[\"@actions/http-client\"]},\"@actions/http-client\":{\"package_url\":\"pkg:/npm/%40actions/http-client@1.0.7\",\"relationship\":\"indirect\",\"scope\":\"runtime\",\"dependencies\":[\"tunnel\"]},\"tunnel\":{\"package_url\":\"pkg:/npm/tunnel@0.0.6\",\"relationship\":\"indirect\",\"scope\":\"runtime\"}}}}}`+\"\\n\")\n\t\tfmt.Fprint(w, `{\"id\":12345,\"created_at\":\"2022-06-14T20:25:01Z\",\"message\":\"Dependency results for the repo have been successfully updated.\",\"result\":\"SUCCESS\"}`)\n\t})\n\n\tctx := t.Context()\n\tsnapshot := &DependencyGraphSnapshot{\n\t\tVersion: 0,\n\t\tSha:     Ptr(\"ce587453ced02b1526dfb4cb910479d431683101\"),\n\t\tRef:     Ptr(\"refs/heads/main\"),\n\t\tJob: &DependencyGraphSnapshotJob{\n\t\t\tCorrelator: Ptr(\"yourworkflowname_youractionname\"),\n\t\t\tID:         Ptr(\"yourrunid\"),\n\t\t\tHTMLURL:    Ptr(\"https://example.com\"),\n\t\t},\n\t\tDetector: &DependencyGraphSnapshotDetector{\n\t\t\tName:    Ptr(\"octo-detector\"),\n\t\t\tVersion: Ptr(\"0.0.1\"),\n\t\t\tURL:     Ptr(\"https://github.com/octo-org/octo-repo\"),\n\t\t},\n\t\tScanned: &Timestamp{time.Date(2022, time.June, 14, 20, 25, 0, 0, time.UTC)},\n\t\tMetadata: map[string]any{\n\t\t\t\"key1\": \"value1\",\n\t\t\t\"key2\": \"value2\",\n\t\t},\n\t\tManifests: map[string]*DependencyGraphSnapshotManifest{\n\t\t\t\"package-lock.json\": {\n\t\t\t\tName: Ptr(\"package-lock.json\"),\n\t\t\t\tFile: &DependencyGraphSnapshotManifestFile{SourceLocation: Ptr(\"src/package-lock.json\")},\n\t\t\t\tMetadata: map[string]any{\n\t\t\t\t\t\"key1\": \"value1\",\n\t\t\t\t\t\"key2\": \"value2\",\n\t\t\t\t},\n\t\t\t\tResolved: map[string]*DependencyGraphSnapshotResolvedDependency{\n\t\t\t\t\t\"@actions/core\": {\n\t\t\t\t\t\tPackageURL:   Ptr(\"pkg:/npm/%40actions/core@1.1.9\"),\n\t\t\t\t\t\tRelationship: Ptr(\"direct\"),\n\t\t\t\t\t\tScope:        Ptr(\"runtime\"),\n\t\t\t\t\t\tMetadata: map[string]any{\n\t\t\t\t\t\t\t\"licenses\": \"MIT\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\tDependencies: []string{\"@actions/http-client\"},\n\t\t\t\t\t},\n\t\t\t\t\t\"@actions/http-client\": {\n\t\t\t\t\t\tPackageURL:   Ptr(\"pkg:/npm/%40actions/http-client@1.0.7\"),\n\t\t\t\t\t\tRelationship: Ptr(\"indirect\"),\n\t\t\t\t\t\tScope:        Ptr(\"runtime\"),\n\t\t\t\t\t\tDependencies: []string{\"tunnel\"},\n\t\t\t\t\t},\n\t\t\t\t\t\"tunnel\": {\n\t\t\t\t\t\tPackageURL:   Ptr(\"pkg:/npm/tunnel@0.0.6\"),\n\t\t\t\t\t\tRelationship: Ptr(\"indirect\"),\n\t\t\t\t\t\tScope:        Ptr(\"runtime\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tsnapshotCreationData, _, err := client.DependencyGraph.CreateSnapshot(ctx, \"o\", \"r\", snapshot)\n\tif err != nil {\n\t\tt.Errorf(\"DependencyGraph.CreateSnapshot returned error: %v\", err)\n\t}\n\n\twant := &DependencyGraphSnapshotCreationData{\n\t\tID:        12345,\n\t\tCreatedAt: &Timestamp{time.Date(2022, time.June, 14, 20, 25, 1, 0, time.UTC)},\n\t\tMessage:   Ptr(\"Dependency results for the repo have been successfully updated.\"),\n\t\tResult:    Ptr(\"SUCCESS\"),\n\t}\n\tif !cmp.Equal(snapshotCreationData, want) {\n\t\tt.Errorf(\"DependencyGraph.CreateSnapshot returned %+v, want %+v\", snapshotCreationData, want)\n\t}\n\n\tconst methodName = \"CreateSnapshot\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.DependencyGraph.CreateSnapshot(ctx, \"o\", \"r\", snapshot)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/dependency_graph_test.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestDependencyGraphService_GetSBOM(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/owner/repo/dependency-graph/sbom\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n   \"sbom\":{\n      \"creationInfo\":{\n         \"created\":\"2021-09-01T00:00:00Z\"\n      },\n      \"name\":\"owner/repo\",\n      \"packages\":[\n                {\n                \"name\":\"rubygems:rails\",\n                \"versionInfo\":\"1.0.0\"\n                }\n            ]\n        }\n    }`)\n\t})\n\n\tctx := t.Context()\n\tsbom, _, err := client.DependencyGraph.GetSBOM(ctx, \"owner\", \"repo\")\n\tif err != nil {\n\t\tt.Errorf(\"DependencyGraph.GetSBOM returned error: %v\", err)\n\t}\n\n\ttestTime := time.Date(2021, 9, 1, 0, 0, 0, 0, time.UTC)\n\twant := &SBOM{\n\t\t&SBOMInfo{\n\t\t\tCreationInfo: &CreationInfo{\n\t\t\t\tCreated: &Timestamp{testTime},\n\t\t\t},\n\t\t\tName: Ptr(\"owner/repo\"),\n\t\t\tPackages: []*RepoDependencies{\n\t\t\t\t{\n\t\t\t\t\tName:        Ptr(\"rubygems:rails\"),\n\t\t\t\t\tVersionInfo: Ptr(\"1.0.0\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(sbom, want) {\n\t\tt.Errorf(\"DependencyGraph.GetSBOM returned %+v, want %+v\", sbom, want)\n\t}\n\n\tconst methodName = \"GetSBOM\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.DependencyGraph.GetSBOM(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.DependencyGraph.GetSBOM(ctx, \"owner\", \"repo\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/doc.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n/*\nPackage github provides a client for using the GitHub API.\n\nUsage:\n\n\timport \"github.com/google/go-github/v84/github\"\n\nConstruct a new GitHub client, then use the various services on the client to\naccess different parts of the GitHub API. For example:\n\n\tclient := github.NewClient(nil)\n\n\t// list all organizations for user \"willnorris\"\n\torgs, _, err := client.Organizations.List(ctx, \"willnorris\", nil)\n\nSome API methods have optional parameters that can be passed. For example:\n\n\tclient := github.NewClient(nil)\n\n\t// list public repositories for org \"github\"\n\topt := &github.RepositoryListByOrgOptions{Type: \"public\"}\n\trepos, _, err := client.Repositories.ListByOrg(ctx, \"github\", opt)\n\nThe services of a client divide the API into logical chunks and correspond to\nthe structure of the GitHub API documentation at\nhttps://docs.github.com/rest .\n\nNOTE: Using the [context] package, one can easily\npass cancellation signals and deadlines to various services of the client for\nhandling a request. In case there is no context available, then [context.Background]\ncan be used as a starting point.\n\nFor more sample code snippets, head over to the https://github.com/google/go-github/tree/master/example directory.\n\n# Authentication\n\nUse [Client.WithAuthToken] to configure your client to authenticate using an OAuth token\n(for example, a personal access token). This is what is needed for a majority of use cases\naside from GitHub Apps.\n\n\tclient := github.NewClient(nil).WithAuthToken(\"... your access token ...\")\n\nNote that when using an authenticated [Client], all calls made by the client will\ninclude the specified OAuth token. Therefore, authenticated clients should\nalmost never be shared between different users.\n\nFor API methods that require HTTP Basic Authentication, use the\n[BasicAuthTransport].\n\nGitHub Apps authentication can be provided by the\nhttps://github.com/bradleyfalzon/ghinstallation package.\nIt supports both authentication as an installation, using an installation access token,\nand as an app, using a JWT.\n\nTo authenticate as an installation:\n\n\timport \"github.com/bradleyfalzon/ghinstallation\"\n\n\tfunc main() {\n\t\t// Wrap the shared transport for use with the integration ID 1 authenticating with installation ID 99.\n\t\titr, err := ghinstallation.NewKeyFromFile(http.DefaultTransport, 1, 99, \"2016-10-19.private-key.pem\")\n\t\tif err != nil {\n\t\t\t// Handle error.\n\t\t}\n\n\t\t// Use installation transport with client\n\t\tclient := github.NewClient(&http.Client{Transport: itr})\n\n\t\t// Use client...\n\t}\n\nTo authenticate as an app, using a JWT:\n\n\timport \"github.com/bradleyfalzon/ghinstallation\"\n\n\tfunc main() {\n\t\t// Wrap the shared transport for use with the application ID 1.\n\t\tatr, err := ghinstallation.NewAppsTransportKeyFromFile(http.DefaultTransport, 1, \"2016-10-19.private-key.pem\")\n\t\tif err != nil {\n\t\t\t// Handle error.\n\t\t}\n\n\t\t// Use app transport with client\n\t\tclient := github.NewClient(&http.Client{Transport: atr})\n\n\t\t// Use client...\n\t}\n\n# Rate Limiting\n\nGitHub imposes a rate limit on all API clients. Unauthenticated clients are\nlimited to 60 requests per hour, while authenticated clients can make up to\n5,000 requests per hour. The Search API has a custom rate limit. Unauthenticated\nclients are limited to 10 requests per minute, while authenticated clients\ncan make up to 30 requests per minute. To receive the higher rate limit when\nmaking calls that are not issued on behalf of a user,\nuse [UnauthenticatedRateLimitedTransport].\n\nThe returned [Response].[Rate] value contains the rate limit information\nfrom the most recent API call. If a recent enough response isn't\navailable, you can use RateLimits to fetch the most up-to-date rate\nlimit data for the client.\n\nTo detect an API rate limit error, you can check if its type is *[RateLimitError].\nFor secondary rate limits, you can check if its type is *[AbuseRateLimitError]:\n\n\trepos, _, err := client.Repositories.List(ctx, \"\", nil)\n\tif errors.As(err, new(*github.RateLimitError)) {\n\t\tlog.Println(\"hit rate limit\")\n\t}\n\tif errors.As(err, new(*github.AbuseRateLimitError)) {\n\t\tlog.Println(\"hit secondary rate limit\")\n\t}\n\nLearn more about GitHub rate limiting at\nhttps://docs.github.com/rest/rate-limit .\n\n# Accepted Status\n\nSome endpoints may return a 202 Accepted status code, meaning that the\ninformation required is not yet ready and was scheduled to be gathered on\nthe GitHub side. Methods known to behave like this are documented specifying\nthis behavior.\n\nTo detect this condition of error, you can check if its type is\n*[AcceptedError]:\n\n\tstats, _, err := client.Repositories.ListContributorsStats(ctx, org, repo)\n\tif errors.As(err, new(*github.AcceptedError)) {\n\t\tlog.Println(\"scheduled on GitHub side\")\n\t}\n\n# Conditional Requests\n\nThe GitHub REST API has good support for conditional HTTP requests\nvia the ETag header which will help prevent you from burning through your\nrate limit, as well as help speed up your application. go-github does not\nhandle conditional requests directly, but is instead designed to work with a\ncaching [http.Transport].\n\nTypically, an RFC 9111 compliant HTTP cache such as https://github.com/bartventer/httpcache\nis recommended. Alternatively, the https://github.com/bored-engineer/github-conditional-http-transport\npackage relies on (undocumented) GitHub specific cache logic and is\nrecommended when making requests using short-lived credentials such as a\nGitHub App installation token.\n\nLearn more about GitHub conditional requests at\nhttps://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2022-11-28#use-conditional-requests-if-appropriate.\n\n# Creating and Updating Resources\n\nAll structs for GitHub resources use pointer values for all non-repeated fields.\nThis allows distinguishing between unset fields and those set to a zero-value.\nA helper function, [Ptr], has been provided to easily create these pointers for string,\nbool, and int values. For example:\n\n\t// create a new private repository named \"foo\"\n\trepo := &github.Repository{\n\t\tName:    github.Ptr(\"foo\"),\n\t\tPrivate: github.Ptr(true),\n\t}\n\tclient.Repositories.Create(ctx, \"\", repo)\n\nUsers who have worked with protocol buffers should find this pattern familiar.\n\n# Pagination\n\nAll requests for resource collections (repos, pull requests, issues, etc.)\nsupport pagination. Pagination options are described in the\n[ListOptions] struct and passed to the list methods directly or as an\nembedded type of a more specific list options struct (for example\n[PullRequestListOptions]). Pages information is available via the\n[Response] struct.\n\n\tclient := github.NewClient(nil)\n\n\topt := &github.RepositoryListByOrgOptions{\n\t\tListOptions: github.ListOptions{PerPage: 10},\n\t}\n\t// get all pages of results\n\tvar allRepos []*github.Repository\n\tfor {\n\t\trepos, resp, err := client.Repositories.ListByOrg(ctx, \"github\", opt)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tallRepos = append(allRepos, repos...)\n\t\tif resp.NextPage == 0 {\n\t\t\tbreak\n\t\t}\n\t\topt.Page = resp.NextPage\n\t}\n*/\npackage github\n"
  },
  {
    "path": "github/emojis.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n)\n\n// EmojisService provides access to emoji-related functions in the GitHub API.\ntype EmojisService service\n\n// List returns the emojis available to use on GitHub.\n//\n// GitHub API docs: https://docs.github.com/rest/emojis/emojis#get-emojis\n//\n//meta:operation GET /emojis\nfunc (s *EmojisService) List(ctx context.Context) (map[string]string, *Response, error) {\n\treq, err := s.client.NewRequest(\"GET\", \"emojis\", nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar emoji map[string]string\n\tresp, err := s.client.Do(ctx, req, &emoji)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn emoji, resp, nil\n}\n\n// ListEmojis returns the emojis available to use on GitHub.\n//\n// Deprecated: Use EmojisService.List instead.\nfunc (c *Client) ListEmojis(ctx context.Context) (map[string]string, *Response, error) {\n\treturn c.Emojis.List(ctx)\n}\n"
  },
  {
    "path": "github/emojis_test.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestEmojisService_List(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/emojis\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"+1\": \"+1.png\"}`)\n\t})\n\n\tctx := t.Context()\n\temoji, _, err := client.ListEmojis(ctx)\n\tif err != nil {\n\t\tt.Errorf(\"List returned error: %v\", err)\n\t}\n\n\twant := map[string]string{\"+1\": \"+1.png\"}\n\tif !cmp.Equal(want, emoji) {\n\t\tt.Errorf(\"List returned %+v, want %+v\", emoji, want)\n\t}\n\n\tconst methodName = \"List\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Emojis.List(ctx)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/enterprise.go",
    "content": "// Copyright 2020 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\n// EnterpriseService provides access to the enterprise related functions\n// in the GitHub API.\n//\n// GitHub API docs: https://docs.github.com/rest/enterprise-admin/\ntype EnterpriseService service\n"
  },
  {
    "path": "github/enterprise_actions_hosted_runners.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// ListHostedRunners lists all the GitHub-hosted runners for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#list-github-hosted-runners-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners\nfunc (s *EnterpriseService) ListHostedRunners(ctx context.Context, enterprise string, opts *ListOptions) (*HostedRunners, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/hosted-runners\", enterprise)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar runners *HostedRunners\n\tresp, err := s.client.Do(ctx, req, &runners)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn runners, resp, nil\n}\n\n// CreateHostedRunner creates a GitHub-hosted runner for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#create-a-github-hosted-runner-for-an-enterprise\n//\n//meta:operation POST /enterprises/{enterprise}/actions/hosted-runners\nfunc (s *EnterpriseService) CreateHostedRunner(ctx context.Context, enterprise string, request CreateHostedRunnerRequest) (*HostedRunner, *Response, error) {\n\tif err := validateCreateHostedRunnerRequest(&request); err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"validation failed: %w\", err)\n\t}\n\n\tu := fmt.Sprintf(\"enterprises/%v/actions/hosted-runners\", enterprise)\n\treq, err := s.client.NewRequest(\"POST\", u, request)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar hostedRunner *HostedRunner\n\tresp, err := s.client.Do(ctx, req, &hostedRunner)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn hostedRunner, resp, nil\n}\n\n// GetHostedRunnerGitHubOwnedImages gets the list of GitHub-owned images available for GitHub-hosted runners for an enterprise.\n//\n// 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\n//\n//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/github-owned\nfunc (s *EnterpriseService) GetHostedRunnerGitHubOwnedImages(ctx context.Context, enterprise string) (*HostedRunnerImages, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/hosted-runners/images/github-owned\", enterprise)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar hostedRunnerImages *HostedRunnerImages\n\tresp, err := s.client.Do(ctx, req, &hostedRunnerImages)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn hostedRunnerImages, resp, nil\n}\n\n// GetHostedRunnerPartnerImages gets the list of partner images available for GitHub-hosted runners for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-partner-images-for-github-hosted-runners-in-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/partner\nfunc (s *EnterpriseService) GetHostedRunnerPartnerImages(ctx context.Context, enterprise string) (*HostedRunnerImages, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/hosted-runners/images/partner\", enterprise)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar hostedRunnerImages *HostedRunnerImages\n\tresp, err := s.client.Do(ctx, req, &hostedRunnerImages)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn hostedRunnerImages, resp, nil\n}\n\n// GetHostedRunnerLimits gets the GitHub-hosted runners Static public IP Limits for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-limits-on-github-hosted-runners-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/limits\nfunc (s *EnterpriseService) GetHostedRunnerLimits(ctx context.Context, enterprise string) (*HostedRunnerPublicIPLimits, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/hosted-runners/limits\", enterprise)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar publicIPLimits *HostedRunnerPublicIPLimits\n\tresp, err := s.client.Do(ctx, req, &publicIPLimits)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn publicIPLimits, resp, nil\n}\n\n// GetHostedRunnerMachineSpecs gets the list of machine specs available for GitHub-hosted runners for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-github-hosted-runners-machine-specs-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/machine-sizes\nfunc (s *EnterpriseService) GetHostedRunnerMachineSpecs(ctx context.Context, enterprise string) (*HostedRunnerMachineSpecs, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/hosted-runners/machine-sizes\", enterprise)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar machineSpecs *HostedRunnerMachineSpecs\n\tresp, err := s.client.Do(ctx, req, &machineSpecs)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn machineSpecs, resp, nil\n}\n\n// GetHostedRunnerPlatforms gets list of platforms available for GitHub-hosted runners for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-platforms-for-github-hosted-runners-in-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/platforms\nfunc (s *EnterpriseService) GetHostedRunnerPlatforms(ctx context.Context, enterprise string) (*HostedRunnerPlatforms, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/hosted-runners/platforms\", enterprise)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar platforms *HostedRunnerPlatforms\n\tresp, err := s.client.Do(ctx, req, &platforms)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn platforms, resp, nil\n}\n\n// GetHostedRunner gets a GitHub-hosted runner in an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-a-github-hosted-runner-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id}\nfunc (s *EnterpriseService) GetHostedRunner(ctx context.Context, enterprise string, runnerID int64) (*HostedRunner, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/hosted-runners/%v\", enterprise, runnerID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar hostedRunner *HostedRunner\n\tresp, err := s.client.Do(ctx, req, &hostedRunner)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn hostedRunner, resp, nil\n}\n\n// UpdateHostedRunner updates a GitHub-hosted runner for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#update-a-github-hosted-runner-for-an-enterprise\n//\n//meta:operation PATCH /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id}\nfunc (s *EnterpriseService) UpdateHostedRunner(ctx context.Context, enterprise string, runnerID int64, request UpdateHostedRunnerRequest) (*HostedRunner, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/hosted-runners/%v\", enterprise, runnerID)\n\treq, err := s.client.NewRequest(\"PATCH\", u, request)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar hostedRunner *HostedRunner\n\tresp, err := s.client.Do(ctx, req, &hostedRunner)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn hostedRunner, resp, nil\n}\n\n// DeleteHostedRunner deletes GitHub-hosted runner from an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#delete-a-github-hosted-runner-for-an-enterprise\n//\n//meta:operation DELETE /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id}\nfunc (s *EnterpriseService) DeleteHostedRunner(ctx context.Context, enterprise string, runnerID int64) (*HostedRunner, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/hosted-runners/%v\", enterprise, runnerID)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar hostedRunner *HostedRunner\n\tresp, err := s.client.Do(ctx, req, &hostedRunner)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn hostedRunner, resp, nil\n}\n\n// ListHostedRunnerCustomImages lists custom images for GitHub-hosted runners in an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#list-custom-images-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/custom\nfunc (s *EnterpriseService) ListHostedRunnerCustomImages(ctx context.Context, enterprise string) (*HostedRunnerCustomImages, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/hosted-runners/images/custom\", enterprise)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar images *HostedRunnerCustomImages\n\tresp, err := s.client.Do(ctx, req, &images)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn images, resp, nil\n}\n\n// GetHostedRunnerCustomImage gets a custom image definition for GitHub-hosted runners in an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-an-enterprise-custom-image-definition-for-github-actions-hosted-runners\n//\n//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/custom/{image_definition_id}\nfunc (s *EnterpriseService) GetHostedRunnerCustomImage(ctx context.Context, enterprise string, imageDefinitionID int64) (*HostedRunnerCustomImage, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/hosted-runners/images/custom/%v\", enterprise, imageDefinitionID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar image *HostedRunnerCustomImage\n\tresp, err := s.client.Do(ctx, req, &image)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn image, resp, nil\n}\n\n// DeleteHostedRunnerCustomImage deletes a custom image from the enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#delete-a-custom-image-from-the-enterprise\n//\n//meta:operation DELETE /enterprises/{enterprise}/actions/hosted-runners/images/custom/{image_definition_id}\nfunc (s *EnterpriseService) DeleteHostedRunnerCustomImage(ctx context.Context, enterprise string, imageDefinitionID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/hosted-runners/images/custom/%v\", enterprise, imageDefinitionID)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// ListHostedRunnerCustomImageVersions lists image versions of a custom image for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#list-image-versions-of-a-custom-image-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/custom/{image_definition_id}/versions\nfunc (s *EnterpriseService) ListHostedRunnerCustomImageVersions(ctx context.Context, enterprise string, imageDefinitionID int64) (*HostedRunnerCustomImageVersions, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/hosted-runners/images/custom/%v/versions\", enterprise, imageDefinitionID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar versions *HostedRunnerCustomImageVersions\n\tresp, err := s.client.Do(ctx, req, &versions)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn versions, resp, nil\n}\n\n// GetHostedRunnerCustomImageVersion gets an image version of a custom image for GitHub-hosted runners in an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#get-an-image-version-of-an-enterprise-custom-image-for-github-actions-hosted-runners\n//\n//meta:operation GET /enterprises/{enterprise}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}\nfunc (s *EnterpriseService) GetHostedRunnerCustomImageVersion(ctx context.Context, enterprise string, imageDefinitionID int64, version string) (*HostedRunnerCustomImageVersion, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/hosted-runners/images/custom/%v/versions/%v\", enterprise, imageDefinitionID, version)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar imageVersion *HostedRunnerCustomImageVersion\n\tresp, err := s.client.Do(ctx, req, &imageVersion)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn imageVersion, resp, nil\n}\n\n// DeleteHostedRunnerCustomImageVersion deletes an image version of a custom image from the enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/hosted-runners#delete-an-image-version-of-custom-image-from-the-enterprise\n//\n//meta:operation DELETE /enterprises/{enterprise}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}\nfunc (s *EnterpriseService) DeleteHostedRunnerCustomImageVersion(ctx context.Context, enterprise string, imageDefinitionID int64, version string) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/hosted-runners/images/custom/%v/versions/%v\", enterprise, imageDefinitionID, version)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/enterprise_actions_hosted_runners_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestEnterpriseService_ListHostedRunners(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/o/actions/hosted-runners\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"total_count\": 2,\n\t\t\t\"runners\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": 5,\n\t\t\t\t\t\"name\": \"My hosted ubuntu runner\",\n\t\t\t\t\t\"runner_group_id\": 2,\n\t\t\t\t\t\"platform\": \"linux-x64\",\n\t\t\t\t\t\"image_details\": {\n\t\t\t\t\t\t\"id\": \"ubuntu-20.04\",\n\t\t\t\t\t\t\"size_gb\": 86\n\t\t\t\t\t},\n\t\t\t\t\t\"machine_size_details\": {\n\t\t\t\t\t\t\"id\": \"4-core\",\n\t\t\t\t\t\t\"cpu_cores\": 4,\n\t\t\t\t\t\t\"memory_gb\": 16,\n\t\t\t\t\t\t\"storage_gb\": 150\n\t\t\t\t\t},\n\t\t\t\t\t\"status\": \"Ready\",\n\t\t\t\t\t\"maximum_runners\": 10,\n\t\t\t\t\t\"public_ip_enabled\": true,\n\t\t\t\t\t\"public_ips\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"enabled\": true,\n\t\t\t\t\t\t\t\"prefix\": \"20.80.208.150\",\n\t\t\t\t\t\t\t\"length\": 31\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"last_active_on\": \"2023-04-26T15:23:37Z\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"id\": 7,\n\t\t\t\t\t\"name\": \"My hosted Windows runner\",\n\t\t\t\t\t\"runner_group_id\": 2,\n\t\t\t\t\t\"platform\": \"win-x64\",\n\t\t\t\t\t\"image_details\": {\n\t\t\t\t\t\t\"id\": \"windows-latest\",\n\t\t\t\t\t\t\"size_gb\": 256\n\t\t\t\t\t},\n\t\t\t\t\t\"machine_size_details\": {\n\t\t\t\t\t\t\"id\": \"8-core\",\n\t\t\t\t\t\t\"cpu_cores\": 8,\n\t\t\t\t\t\t\"memory_gb\": 32,\n\t\t\t\t\t\t\"storage_gb\": 300\n\t\t\t\t\t},\n\t\t\t\t\t\"status\": \"Ready\",\n\t\t\t\t\t\"maximum_runners\": 20,\n\t\t\t\t\t\"public_ip_enabled\": false,\n\t\t\t\t\t\"public_ips\": [],\n\t\t\t\t\t\"last_active_on\": \"2023-04-26T15:23:37Z\"\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\topts := &ListOptions{Page: 1, PerPage: 1}\n\tctx := t.Context()\n\thostedRunners, _, err := client.Enterprise.ListHostedRunners(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.ListHostedRunners returned error: %v\", err)\n\t}\n\n\tlastActiveOn := Timestamp{time.Date(2023, 4, 26, 15, 23, 37, 0, time.UTC)}\n\n\twant := &HostedRunners{\n\t\tTotalCount: 2,\n\t\tRunners: []*HostedRunner{\n\t\t\t{\n\t\t\t\tID:            Ptr(int64(5)),\n\t\t\t\tName:          Ptr(\"My hosted ubuntu runner\"),\n\t\t\t\tRunnerGroupID: Ptr(int64(2)),\n\t\t\t\tPlatform:      Ptr(\"linux-x64\"),\n\t\t\t\tImageDetails: &HostedRunnerImageDetail{\n\t\t\t\t\tID:     Ptr(\"ubuntu-20.04\"),\n\t\t\t\t\tSizeGB: Ptr(int64(86)),\n\t\t\t\t},\n\t\t\t\tMachineSizeDetails: &HostedRunnerMachineSpec{\n\t\t\t\t\tID:        \"4-core\",\n\t\t\t\t\tCPUCores:  4,\n\t\t\t\t\tMemoryGB:  16,\n\t\t\t\t\tStorageGB: 150,\n\t\t\t\t},\n\t\t\t\tStatus:          Ptr(\"Ready\"),\n\t\t\t\tMaximumRunners:  Ptr(int64(10)),\n\t\t\t\tPublicIPEnabled: Ptr(true),\n\t\t\t\tPublicIPs: []*HostedRunnerPublicIP{\n\t\t\t\t\t{\n\t\t\t\t\t\tEnabled: true,\n\t\t\t\t\t\tPrefix:  \"20.80.208.150\",\n\t\t\t\t\t\tLength:  31,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tLastActiveOn: Ptr(lastActiveOn),\n\t\t\t},\n\t\t\t{\n\t\t\t\tID:            Ptr(int64(7)),\n\t\t\t\tName:          Ptr(\"My hosted Windows runner\"),\n\t\t\t\tRunnerGroupID: Ptr(int64(2)),\n\t\t\t\tPlatform:      Ptr(\"win-x64\"),\n\t\t\t\tImageDetails: &HostedRunnerImageDetail{\n\t\t\t\t\tID:     Ptr(\"windows-latest\"),\n\t\t\t\t\tSizeGB: Ptr(int64(256)),\n\t\t\t\t},\n\t\t\t\tMachineSizeDetails: &HostedRunnerMachineSpec{\n\t\t\t\t\tID:        \"8-core\",\n\t\t\t\t\tCPUCores:  8,\n\t\t\t\t\tMemoryGB:  32,\n\t\t\t\t\tStorageGB: 300,\n\t\t\t\t},\n\t\t\t\tStatus:          Ptr(\"Ready\"),\n\t\t\t\tMaximumRunners:  Ptr(int64(20)),\n\t\t\t\tPublicIPEnabled: Ptr(false),\n\t\t\t\tPublicIPs:       []*HostedRunnerPublicIP{},\n\t\t\t\tLastActiveOn:    Ptr(lastActiveOn),\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(hostedRunners, want) {\n\t\tt.Errorf(\"Enterprise.ListHostedRunners returned %+v, want %+v\", hostedRunners, want)\n\t}\n\n\tconst methodName = \"ListHostedRunners\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.ListHostedRunners(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ListHostedRunners(ctx, \"o\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_CreateHostedRunner(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/o/actions/hosted-runners\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 5,\n\t\t\t\"name\": \"My hosted ubuntu runner\",\n\t\t\t\"runner_group_id\": 2,\n\t\t\t\"platform\": \"linux-x64\",\n\t\t\t\"image_details\": {\n\t\t\t\t\"id\": \"ubuntu-20.04\",\n\t\t\t\t\"size_gb\": 86\n\t\t\t},\n\t\t\t\"machine_size_details\": {\n\t\t\t\t\"id\": \"4-core\",\n\t\t\t\t\"cpu_cores\": 4,\n\t\t\t\t\"memory_gb\": 16,\n\t\t\t\t\"storage_gb\": 150\n\t\t\t},\n\t\t\t\"status\": \"Ready\",\n\t\t\t\"maximum_runners\": 10,\n\t\t\t\"public_ip_enabled\": true,\n\t\t\t\"public_ips\": [\n\t\t\t\t{\n\t\t\t\t\t\"enabled\": true,\n\t\t\t\t\t\"prefix\": \"20.80.208.150\",\n\t\t\t\t\t\"length\": 31\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"last_active_on\": \"2023-04-26T15:23:37Z\"\n\t\t\t}`)\n\t})\n\n\tctx := t.Context()\n\treq := CreateHostedRunnerRequest{\n\t\tName: \"My Hosted runner\",\n\t\tImage: HostedRunnerImage{\n\t\t\tID:      \"ubuntu-latest\",\n\t\t\tSource:  \"github\",\n\t\t\tVersion: Ptr(\"latest\"),\n\t\t},\n\t\tRunnerGroupID:  1,\n\t\tSize:           \"4-core\",\n\t\tMaximumRunners: Ptr(int64(50)),\n\t\tEnableStaticIP: Ptr(false),\n\t\tImageGen:       Ptr(true),\n\t}\n\thostedRunner, _, err := client.Enterprise.CreateHostedRunner(ctx, \"o\", req)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.CreateHostedRunner returned error: %v\", err)\n\t}\n\n\tlastActiveOn := Timestamp{time.Date(2023, 4, 26, 15, 23, 37, 0, time.UTC)}\n\twant := &HostedRunner{\n\t\tID:            Ptr(int64(5)),\n\t\tName:          Ptr(\"My hosted ubuntu runner\"),\n\t\tRunnerGroupID: Ptr(int64(2)),\n\t\tPlatform:      Ptr(\"linux-x64\"),\n\t\tImageDetails: &HostedRunnerImageDetail{\n\t\t\tID:     Ptr(\"ubuntu-20.04\"),\n\t\t\tSizeGB: Ptr(int64(86)),\n\t\t},\n\t\tMachineSizeDetails: &HostedRunnerMachineSpec{\n\t\t\tID:        \"4-core\",\n\t\t\tCPUCores:  4,\n\t\t\tMemoryGB:  16,\n\t\t\tStorageGB: 150,\n\t\t},\n\t\tStatus:          Ptr(\"Ready\"),\n\t\tMaximumRunners:  Ptr(int64(10)),\n\t\tPublicIPEnabled: Ptr(true),\n\t\tPublicIPs: []*HostedRunnerPublicIP{\n\t\t\t{\n\t\t\t\tEnabled: true,\n\t\t\t\tPrefix:  \"20.80.208.150\",\n\t\t\t\tLength:  31,\n\t\t\t},\n\t\t},\n\t\tLastActiveOn: Ptr(lastActiveOn),\n\t}\n\n\tif !cmp.Equal(hostedRunner, want) {\n\t\tt.Errorf(\"Enterprise.CreateHostedRunner returned %+v, want %+v\", hostedRunner, want)\n\t}\n\n\t// Validation tests\n\ttestCases := []struct {\n\t\tname          string\n\t\trequest       CreateHostedRunnerRequest\n\t\texpectedError string\n\t}{\n\t\t{\n\t\t\tname: \"Missing Size\",\n\t\t\trequest: CreateHostedRunnerRequest{\n\t\t\t\tName: \"My Hosted runner\",\n\t\t\t\tImage: HostedRunnerImage{\n\t\t\t\t\tID:      \"ubuntu-latest\",\n\t\t\t\t\tSource:  \"github\",\n\t\t\t\t\tVersion: Ptr(\"latest\"),\n\t\t\t\t},\n\t\t\t\tRunnerGroupID: 1,\n\t\t\t},\n\t\t\texpectedError: \"validation failed: size is required for creating a hosted runner\",\n\t\t},\n\t\t{\n\t\t\tname: \"Missing Image\",\n\t\t\trequest: CreateHostedRunnerRequest{\n\t\t\t\tName:          \"My Hosted runner\",\n\t\t\t\tRunnerGroupID: 1,\n\t\t\t\tSize:          \"4-core\",\n\t\t\t},\n\t\t\texpectedError: \"validation failed: image is required for creating a hosted runner\",\n\t\t},\n\t\t{\n\t\t\tname: \"Missing Name\",\n\t\t\trequest: CreateHostedRunnerRequest{\n\t\t\t\tImage: HostedRunnerImage{\n\t\t\t\t\tID:      \"ubuntu-latest\",\n\t\t\t\t\tSource:  \"github\",\n\t\t\t\t\tVersion: Ptr(\"latest\"),\n\t\t\t\t},\n\t\t\t\tRunnerGroupID: 1,\n\t\t\t\tSize:          \"4-core\",\n\t\t\t},\n\t\t\texpectedError: \"validation failed: name is required for creating a hosted runner\",\n\t\t},\n\t\t{\n\t\t\tname: \"Missing RunnerGroupID\",\n\t\t\trequest: CreateHostedRunnerRequest{\n\t\t\t\tName: \"My Hosted runner\",\n\t\t\t\tImage: HostedRunnerImage{\n\t\t\t\t\tID:      \"ubuntu-latest\",\n\t\t\t\t\tSource:  \"github\",\n\t\t\t\t\tVersion: Ptr(\"latest\"),\n\t\t\t\t},\n\t\t\t\tSize: \"4-core\",\n\t\t\t},\n\t\t\texpectedError: \"validation failed: runner group ID is required for creating a hosted runner\",\n\t\t},\n\t}\n\n\tfor _, tt := range testCases {\n\t\t_, _, err := client.Enterprise.CreateHostedRunner(ctx, \"o\", tt.request)\n\t\tif err == nil || err.Error() != tt.expectedError {\n\t\t\tt.Errorf(\"expected error: %v, got: %v\", tt.expectedError, err)\n\t\t}\n\t}\n\n\tconst methodName = \"CreateHostedRunner\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.CreateHostedRunner(ctx, \"\\n\", req)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.CreateHostedRunner(ctx, \"o\", req)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_GetHostedRunnerGitHubOwnedImages(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/o/actions/hosted-runners/images/github-owned\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"total_count\": 1,\n\t\t\t\"images\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"ubuntu-20.04\",\n\t\t\t\t\t\"platform\": \"linux-x64\",\n\t\t\t\t\t\"size_gb\": 86,\n\t\t\t\t\t\"display_name\": \"20.04\",\n\t\t\t\t\t\"source\": \"github\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t}`)\n\t})\n\n\tctx := t.Context()\n\thostedRunnerImages, _, err := client.Enterprise.GetHostedRunnerGitHubOwnedImages(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.GetHostedRunnerGitHubOwnedImages returned error: %v\", err)\n\t}\n\n\twant := &HostedRunnerImages{\n\t\tTotalCount: 1,\n\t\tImages: []*HostedRunnerImageSpecs{\n\t\t\t{\n\t\t\t\tID:          \"ubuntu-20.04\",\n\t\t\t\tPlatform:    \"linux-x64\",\n\t\t\t\tSizeGB:      86,\n\t\t\t\tDisplayName: \"20.04\",\n\t\t\t\tSource:      \"github\",\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(hostedRunnerImages, want) {\n\t\tt.Errorf(\"Enterprise.GetHostedRunnerGitHubOwnedImages returned %+v, want %+v\", hostedRunnerImages, want)\n\t}\n\n\tconst methodName = \"GetHostedRunnerGitHubOwnedImages\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.GetHostedRunnerGitHubOwnedImages(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetHostedRunnerGitHubOwnedImages(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_GetHostedRunnerPartnerImages(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/o/actions/hosted-runners/images/partner\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"total_count\": 1,\n\t\t\t\"images\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"ubuntu-20.04\",\n\t\t\t\t\t\"platform\": \"linux-x64\",\n\t\t\t\t\t\"size_gb\": 86,\n\t\t\t\t\t\"display_name\": \"20.04\",\n\t\t\t\t\t\"source\": \"partner\"\n\t\t\t\t}\n\t\t\t]\n\t\t\t}`)\n\t})\n\n\tctx := t.Context()\n\thostedRunnerImages, _, err := client.Enterprise.GetHostedRunnerPartnerImages(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.GetHostedRunnerPartnerImages returned error: %v\", err)\n\t}\n\n\twant := &HostedRunnerImages{\n\t\tTotalCount: 1,\n\t\tImages: []*HostedRunnerImageSpecs{\n\t\t\t{\n\t\t\t\tID:          \"ubuntu-20.04\",\n\t\t\t\tPlatform:    \"linux-x64\",\n\t\t\t\tSizeGB:      86,\n\t\t\t\tDisplayName: \"20.04\",\n\t\t\t\tSource:      \"partner\",\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(hostedRunnerImages, want) {\n\t\tt.Errorf(\"Enterprise.GetHostedRunnerPartnerImages returned %+v, want %+v\", hostedRunnerImages, want)\n\t}\n\n\tconst methodName = \"GetHostedRunnerPartnerImages\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.GetHostedRunnerPartnerImages(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetHostedRunnerPartnerImages(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_GetHostedRunnerLimits(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tmux.HandleFunc(\"/enterprises/o/actions/hosted-runners/limits\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"public_ips\": {\n\t\t\t\t\"current_usage\": 17,\n\t\t\t\t\"maximum\": 50\n\t\t\t}\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tpublicIPLimits, _, err := client.Enterprise.GetHostedRunnerLimits(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.GetPartnerImages returned error: %v\", err)\n\t}\n\n\twant := &HostedRunnerPublicIPLimits{\n\t\tPublicIPs: &PublicIPUsage{\n\t\t\tCurrentUsage: 17,\n\t\t\tMaximum:      50,\n\t\t},\n\t}\n\n\tif !cmp.Equal(publicIPLimits, want) {\n\t\tt.Errorf(\"Enterprise.GetHostedRunnerLimits returned %+v, want %+v\", publicIPLimits, want)\n\t}\n\n\tconst methodName = \"GetHostedRunnerLimits\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.GetHostedRunnerLimits(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetHostedRunnerLimits(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_GetHostedRunnerMachineSpecs(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/o/actions/hosted-runners/machine-sizes\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"total_count\": 1,\n\t\t\t\"machine_specs\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"4-core\",\n \t \t\t\t\t\"cpu_cores\": 4,\n  \t\t\t\t\t\"memory_gb\": 16,\n  \t\t\t\t\t\"storage_gb\": 150\n\t\t\t\t}\n\t\t\t]\n\t\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tmachineSpecs, _, err := client.Enterprise.GetHostedRunnerMachineSpecs(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.GetHostedRunnerMachineSpecs returned error: %v\", err)\n\t}\n\twant := &HostedRunnerMachineSpecs{\n\t\tTotalCount: 1,\n\t\tMachineSpecs: []*HostedRunnerMachineSpec{\n\t\t\t{\n\t\t\t\tID:        \"4-core\",\n\t\t\t\tCPUCores:  4,\n\t\t\t\tMemoryGB:  16,\n\t\t\t\tStorageGB: 150,\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(machineSpecs, want) {\n\t\tt.Errorf(\"Enterprise.GetHostedRunnerMachineSpecs returned %+v, want %+v\", machineSpecs, want)\n\t}\n\n\tconst methodName = \"GetHostedRunnerMachineSpecs\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.GetHostedRunnerMachineSpecs(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetHostedRunnerMachineSpecs(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_GetHostedRunnerPlatforms(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/o/actions/hosted-runners/platforms\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"total_count\": 1,\n  \t\t\t\"platforms\": [\n    \t\t\t\"linux-x64\",\n    \t\t\t\"win-x64\"\n  \t\t\t]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tplatforms, _, err := client.Enterprise.GetHostedRunnerPlatforms(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.GetHostedRunnerPlatforms returned error: %v\", err)\n\t}\n\twant := &HostedRunnerPlatforms{\n\t\tTotalCount: 1,\n\t\tPlatforms: []string{\n\t\t\t\"linux-x64\",\n\t\t\t\"win-x64\",\n\t\t},\n\t}\n\n\tif !cmp.Equal(platforms, want) {\n\t\tt.Errorf(\"Enterprise.GetHostedRunnerPlatforms returned %+v, want %+v\", platforms, want)\n\t}\n\n\tconst methodName = \"GetHostedRunnerPlatforms\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.GetHostedRunnerPlatforms(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetHostedRunnerPlatforms(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_GetHostedRunner(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/o/actions/hosted-runners/23\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 5,\n\t\t\t\"name\": \"My hosted ubuntu runner\",\n\t\t\t\"runner_group_id\": 2,\n\t\t\t\"platform\": \"linux-x64\",\n\t\t\t\"image_details\": {\n\t\t\t\t\"id\": \"ubuntu-20.04\",\n\t\t\t\t\"size_gb\": 86\n\t\t\t},\n\t\t\t\"machine_size_details\": {\n\t\t\t\t\"id\": \"4-core\",\n\t\t\t\t\"cpu_cores\": 4,\n\t\t\t\t\"memory_gb\": 16,\n\t\t\t\t\"storage_gb\": 150\n\t\t\t},\n\t\t\t\"status\": \"Ready\",\n\t\t\t\"maximum_runners\": 10,\n\t\t\t\"public_ip_enabled\": true,\n\t\t\t\"public_ips\": [\n\t\t\t\t{\n\t\t\t\t\"enabled\": true,\n\t\t\t\t\"prefix\": \"20.80.208.150\",\n\t\t\t\t\"length\": 31\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"last_active_on\": \"2023-04-26T15:23:37Z\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\thostedRunner, _, err := client.Enterprise.GetHostedRunner(ctx, \"o\", 23)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.GetHostedRunner returned error: %v\", err)\n\t}\n\n\tlastActiveOn := Timestamp{time.Date(2023, 4, 26, 15, 23, 37, 0, time.UTC)}\n\twant := &HostedRunner{\n\t\tID:            Ptr(int64(5)),\n\t\tName:          Ptr(\"My hosted ubuntu runner\"),\n\t\tRunnerGroupID: Ptr(int64(2)),\n\t\tPlatform:      Ptr(\"linux-x64\"),\n\t\tImageDetails: &HostedRunnerImageDetail{\n\t\t\tID:     Ptr(\"ubuntu-20.04\"),\n\t\t\tSizeGB: Ptr(int64(86)),\n\t\t},\n\t\tMachineSizeDetails: &HostedRunnerMachineSpec{\n\t\t\tID:        \"4-core\",\n\t\t\tCPUCores:  4,\n\t\t\tMemoryGB:  16,\n\t\t\tStorageGB: 150,\n\t\t},\n\t\tStatus:          Ptr(\"Ready\"),\n\t\tMaximumRunners:  Ptr(int64(10)),\n\t\tPublicIPEnabled: Ptr(true),\n\t\tPublicIPs: []*HostedRunnerPublicIP{\n\t\t\t{\n\t\t\t\tEnabled: true,\n\t\t\t\tPrefix:  \"20.80.208.150\",\n\t\t\t\tLength:  31,\n\t\t\t},\n\t\t},\n\t\tLastActiveOn: Ptr(lastActiveOn),\n\t}\n\n\tif !cmp.Equal(hostedRunner, want) {\n\t\tt.Errorf(\"Enterprise.GetHostedRunner returned %+v, want %+v\", hostedRunner, want)\n\t}\n\n\tconst methodName = \"GetHostedRunner\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.GetHostedRunner(ctx, \"\\n\", 23)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetHostedRunner(ctx, \"o\", 23)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_UpdateHostedRunner(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/o/actions/hosted-runners/23\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 5,\n\t\t\t\"name\": \"My hosted ubuntu runner\",\n\t\t\t\"runner_group_id\": 2,\n\t\t\t\"platform\": \"linux-x64\",\n\t\t\t\"image_details\": {\n\t\t\t\t\"id\": \"ubuntu-20.04\",\n\t\t\t\t\"size_gb\": 86\n\t\t\t},\n\t\t\t\"machine_size_details\": {\n\t\t\t\t\"id\": \"4-core\",\n\t\t\t\t\"cpu_cores\": 4,\n\t\t\t\t\"memory_gb\": 16,\n\t\t\t\t\"storage_gb\": 150\n\t\t\t},\n\t\t\t\"status\": \"Ready\",\n\t\t\t\"maximum_runners\": 10,\n\t\t\t\"public_ip_enabled\": true,\n\t\t\t\"public_ips\": [\n\t\t\t\t{\n\t\t\t\t\t\"enabled\": true,\n\t\t\t\t\t\"prefix\": \"20.80.208.150\",\n\t\t\t\t\t\"length\": 31\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"last_active_on\": \"2023-04-26T15:23:37Z\"\n\t\t}`)\n\t})\n\n\t// Test for a valid update without `Size`\n\tctx := t.Context()\n\tvalidReq := UpdateHostedRunnerRequest{\n\t\tName:           Ptr(\"My larger runner\"),\n\t\tRunnerGroupID:  Ptr(int64(1)),\n\t\tMaximumRunners: Ptr(int64(50)),\n\t\tEnableStaticIP: Ptr(false),\n\t\tImageVersion:   Ptr(\"1.0.0\"),\n\t}\n\thostedRunner, _, err := client.Enterprise.UpdateHostedRunner(ctx, \"o\", 23, validReq)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.UpdateHostedRunner returned error: %v\", err)\n\t}\n\n\tlastActiveOn := Timestamp{time.Date(2023, 4, 26, 15, 23, 37, 0, time.UTC)}\n\twant := &HostedRunner{\n\t\tID:            Ptr(int64(5)),\n\t\tName:          Ptr(\"My hosted ubuntu runner\"),\n\t\tRunnerGroupID: Ptr(int64(2)),\n\t\tPlatform:      Ptr(\"linux-x64\"),\n\t\tImageDetails: &HostedRunnerImageDetail{\n\t\t\tID:     Ptr(\"ubuntu-20.04\"),\n\t\t\tSizeGB: Ptr(int64(86)),\n\t\t},\n\t\tMachineSizeDetails: &HostedRunnerMachineSpec{\n\t\t\tID:        \"4-core\",\n\t\t\tCPUCores:  4,\n\t\t\tMemoryGB:  16,\n\t\t\tStorageGB: 150,\n\t\t},\n\t\tStatus:          Ptr(\"Ready\"),\n\t\tMaximumRunners:  Ptr(int64(10)),\n\t\tPublicIPEnabled: Ptr(true),\n\t\tPublicIPs: []*HostedRunnerPublicIP{\n\t\t\t{\n\t\t\t\tEnabled: true,\n\t\t\t\tPrefix:  \"20.80.208.150\",\n\t\t\t\tLength:  31,\n\t\t\t},\n\t\t},\n\t\tLastActiveOn: Ptr(lastActiveOn),\n\t}\n\n\tif !cmp.Equal(hostedRunner, want) {\n\t\tt.Errorf(\"Enterprise.UpdateHostedRunner returned %+v, want %+v\", hostedRunner, want)\n\t}\n\n\tconst methodName = \"UpdateHostedRunner\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.UpdateHostedRunner(ctx, \"\\n\", 23, validReq)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.UpdateHostedRunner(ctx, \"o\", 23, validReq)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_DeleteHostedRunner(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/o/actions/hosted-runners/23\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 5,\n\t\t\t\"name\": \"My hosted ubuntu runner\",\n\t\t\t\"runner_group_id\": 2,\n\t\t\t\"platform\": \"linux-x64\",\n\t\t\t\"image_details\": {\n\t\t\t\t\"id\": \"ubuntu-20.04\",\n\t\t\t\t\"size_gb\": 86\n\t\t\t},\n\t\t\t\"machine_size_details\": {\n\t\t\t\t\"id\": \"4-core\",\n\t\t\t\t\"cpu_cores\": 4,\n\t\t\t\t\"memory_gb\": 16,\n\t\t\t\t\"storage_gb\": 150\n\t\t\t},\n\t\t\t\"status\": \"Ready\",\n\t\t\t\"maximum_runners\": 10,\n\t\t\t\"public_ip_enabled\": true,\n\t\t\t\"public_ips\": [\n\t\t\t\t{\n\t\t\t\t\"enabled\": true,\n\t\t\t\t\"prefix\": \"20.80.208.150\",\n\t\t\t\t\"length\": 31\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"last_active_on\": \"2023-04-26T15:23:37Z\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\thostedRunner, _, err := client.Enterprise.DeleteHostedRunner(ctx, \"o\", 23)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.GetHostedRunner returned error: %v\", err)\n\t}\n\n\tlastActiveOn := Timestamp{time.Date(2023, 4, 26, 15, 23, 37, 0, time.UTC)}\n\twant := &HostedRunner{\n\t\tID:            Ptr(int64(5)),\n\t\tName:          Ptr(\"My hosted ubuntu runner\"),\n\t\tRunnerGroupID: Ptr(int64(2)),\n\t\tPlatform:      Ptr(\"linux-x64\"),\n\t\tImageDetails: &HostedRunnerImageDetail{\n\t\t\tID:     Ptr(\"ubuntu-20.04\"),\n\t\t\tSizeGB: Ptr(int64(86)),\n\t\t},\n\t\tMachineSizeDetails: &HostedRunnerMachineSpec{\n\t\t\tID:        \"4-core\",\n\t\t\tCPUCores:  4,\n\t\t\tMemoryGB:  16,\n\t\t\tStorageGB: 150,\n\t\t},\n\t\tStatus:          Ptr(\"Ready\"),\n\t\tMaximumRunners:  Ptr(int64(10)),\n\t\tPublicIPEnabled: Ptr(true),\n\t\tPublicIPs: []*HostedRunnerPublicIP{\n\t\t\t{\n\t\t\t\tEnabled: true,\n\t\t\t\tPrefix:  \"20.80.208.150\",\n\t\t\t\tLength:  31,\n\t\t\t},\n\t\t},\n\t\tLastActiveOn: Ptr(lastActiveOn),\n\t}\n\n\tif !cmp.Equal(hostedRunner, want) {\n\t\tt.Errorf(\"Enterprise.DeleteHostedRunner returned %+v, want %+v\", hostedRunner, want)\n\t}\n\n\tconst methodName = \"DeleteHostedRunner\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.DeleteHostedRunner(ctx, \"\\n\", 23)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.DeleteHostedRunner(ctx, \"o\", 23)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_ListHostedRunnerCustomImages(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/actions/hosted-runners/images/custom\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"total_count\": 2,\n\t\t\t\"images\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"platform\": \"linux-x64\",\n\t\t\t\t\t\"name\": \"CustomImage1\",\n\t\t\t\t\t\"source\": \"custom\",\n\t\t\t\t\t\"versions_count\": 4,\n\t\t\t\t\t\"total_versions_size\": 200,\n\t\t\t\t\t\"latest_version\": \"1.3.0\",\n\t\t\t\t\t\"state\": \"Ready\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"id\": 2,\n\t\t\t\t\t\"platform\": \"linux-x64\",\n\t\t\t\t\t\"name\": \"CustomImage2\",\n\t\t\t\t\t\"source\": \"custom\",\n\t\t\t\t\t\"versions_count\": 2,\n\t\t\t\t\t\"total_versions_size\": 150,\n\t\t\t\t\t\"latest_version\": \"1.0.0\",\n\t\t\t\t\t\"state\": \"Ready\"\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\timages, _, err := client.Enterprise.ListHostedRunnerCustomImages(ctx, \"e\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.ListHostedRunnerCustomImages returned error: %v\", err)\n\t}\n\n\twant := &HostedRunnerCustomImages{\n\t\tTotalCount: 2,\n\t\tImages: []*HostedRunnerCustomImage{\n\t\t\t{\n\t\t\t\tID:                1,\n\t\t\t\tPlatform:          \"linux-x64\",\n\t\t\t\tName:              \"CustomImage1\",\n\t\t\t\tSource:            \"custom\",\n\t\t\t\tVersionsCount:     4,\n\t\t\t\tTotalVersionsSize: 200,\n\t\t\t\tLatestVersion:     \"1.3.0\",\n\t\t\t\tState:             \"Ready\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tID:                2,\n\t\t\t\tPlatform:          \"linux-x64\",\n\t\t\t\tName:              \"CustomImage2\",\n\t\t\t\tSource:            \"custom\",\n\t\t\t\tVersionsCount:     2,\n\t\t\t\tTotalVersionsSize: 150,\n\t\t\t\tLatestVersion:     \"1.0.0\",\n\t\t\t\tState:             \"Ready\",\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(images, want) {\n\t\tt.Errorf(\"Enterprise.ListHostedRunnerCustomImages returned %+v, want %+v\", images, want)\n\t}\n\n\tconst methodName = \"ListHostedRunnerCustomImages\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.ListHostedRunnerCustomImages(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ListHostedRunnerCustomImages(ctx, \"e\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_GetHostedRunnerCustomImage(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/actions/hosted-runners/images/custom/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 1,\n\t\t\t\"platform\": \"linux-x64\",\n\t\t\t\"name\": \"CustomImage\",\n\t\t\t\"source\": \"custom\",\n\t\t\t\"versions_count\": 4,\n\t\t\t\"total_versions_size\": 200,\n\t\t\t\"latest_version\": \"1.3.0\",\n\t\t\t\"state\": \"Ready\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\timage, _, err := client.Enterprise.GetHostedRunnerCustomImage(ctx, \"e\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.GetHostedRunnerCustomImage returned error: %v\", err)\n\t}\n\n\twant := &HostedRunnerCustomImage{\n\t\tID:                1,\n\t\tPlatform:          \"linux-x64\",\n\t\tName:              \"CustomImage\",\n\t\tSource:            \"custom\",\n\t\tVersionsCount:     4,\n\t\tTotalVersionsSize: 200,\n\t\tLatestVersion:     \"1.3.0\",\n\t\tState:             \"Ready\",\n\t}\n\n\tif !cmp.Equal(image, want) {\n\t\tt.Errorf(\"Enterprise.GetHostedRunnerCustomImage returned %+v, want %+v\", image, want)\n\t}\n\n\tconst methodName = \"GetHostedRunnerCustomImage\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.GetHostedRunnerCustomImage(ctx, \"\\n\", 1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetHostedRunnerCustomImage(ctx, \"e\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_DeleteHostedRunnerCustomImage(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/actions/hosted-runners/images/custom/1\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Enterprise.DeleteHostedRunnerCustomImage(ctx, \"e\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.DeleteHostedRunnerCustomImage returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteHostedRunnerCustomImage\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Enterprise.DeleteHostedRunnerCustomImage(ctx, \"\\n\", 1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Enterprise.DeleteHostedRunnerCustomImage(ctx, \"e\", 1)\n\t})\n}\n\nfunc TestEnterpriseService_ListHostedRunnerCustomImageVersions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/actions/hosted-runners/images/custom/1/versions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"total_count\": 2,\n\t\t\t\"image_versions\": [\n\t\t\t\t{\n\t\t\t\t\t\"version\": \"1.1.0\",\n\t\t\t\t\t\"size_gb\": 75,\n\t\t\t\t\t\"state\": \"Ready\",\n\t\t\t\t\t\"state_details\": \"None\",\n\t\t\t\t\t\"created_on\": \"2024-11-09T23:39:01Z\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"version\": \"1.0.0\",\n\t\t\t\t\t\"size_gb\": 75,\n\t\t\t\t\t\"state\": \"Ready\",\n\t\t\t\t\t\"state_details\": \"None\",\n\t\t\t\t\t\"created_on\": \"2024-11-08T20:39:01Z\"\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tversions, _, err := client.Enterprise.ListHostedRunnerCustomImageVersions(ctx, \"e\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.ListHostedRunnerCustomImageVersions returned error: %v\", err)\n\t}\n\n\twant := &HostedRunnerCustomImageVersions{\n\t\tTotalCount: 2,\n\t\tImageVersions: []*HostedRunnerCustomImageVersion{\n\t\t\t{\n\t\t\t\tVersion:      \"1.1.0\",\n\t\t\t\tSizeGB:       75,\n\t\t\t\tState:        \"Ready\",\n\t\t\t\tStateDetails: \"None\",\n\t\t\t\tCreatedOn:    Timestamp{time.Date(2024, 11, 9, 23, 39, 1, 0, time.UTC)},\n\t\t\t},\n\t\t\t{\n\t\t\t\tVersion:      \"1.0.0\",\n\t\t\t\tSizeGB:       75,\n\t\t\t\tState:        \"Ready\",\n\t\t\t\tStateDetails: \"None\",\n\t\t\t\tCreatedOn:    Timestamp{time.Date(2024, 11, 8, 20, 39, 1, 0, time.UTC)},\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(versions, want) {\n\t\tt.Errorf(\"Enterprise.ListHostedRunnerCustomImageVersions returned %+v, want %+v\", versions, want)\n\t}\n\n\tconst methodName = \"ListHostedRunnerCustomImageVersions\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.ListHostedRunnerCustomImageVersions(ctx, \"\\n\", 1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ListHostedRunnerCustomImageVersions(ctx, \"e\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_GetHostedRunnerCustomImageVersion(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/actions/hosted-runners/images/custom/1/versions/1.0.0\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"version\": \"1.0.0\",\n\t\t\t\"size_gb\": 75,\n\t\t\t\"state\": \"Ready\",\n\t\t\t\"state_details\": \"None\",\n\t\t\t\"created_on\": \"2024-11-08T20:39:01Z\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tversion, _, err := client.Enterprise.GetHostedRunnerCustomImageVersion(ctx, \"e\", 1, \"1.0.0\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.GetHostedRunnerCustomImageVersion returned error: %v\", err)\n\t}\n\n\twant := &HostedRunnerCustomImageVersion{\n\t\tVersion:      \"1.0.0\",\n\t\tSizeGB:       75,\n\t\tState:        \"Ready\",\n\t\tStateDetails: \"None\",\n\t\tCreatedOn:    Timestamp{time.Date(2024, 11, 8, 20, 39, 1, 0, time.UTC)},\n\t}\n\n\tif !cmp.Equal(version, want) {\n\t\tt.Errorf(\"Enterprise.GetHostedRunnerCustomImageVersion returned %+v, want %+v\", version, want)\n\t}\n\n\tconst methodName = \"GetHostedRunnerCustomImageVersion\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.GetHostedRunnerCustomImageVersion(ctx, \"\\n\", 1, \"1.0.0\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetHostedRunnerCustomImageVersion(ctx, \"e\", 1, \"1.0.0\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_DeleteHostedRunnerCustomImageVersion(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/actions/hosted-runners/images/custom/1/versions/1.0.0\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Enterprise.DeleteHostedRunnerCustomImageVersion(ctx, \"e\", 1, \"1.0.0\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.DeleteHostedRunnerCustomImageVersion returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteHostedRunnerCustomImageVersion\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Enterprise.DeleteHostedRunnerCustomImageVersion(ctx, \"\\n\", 1, \"1.0.0\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Enterprise.DeleteHostedRunnerCustomImageVersion(ctx, \"e\", 1, \"1.0.0\")\n\t})\n}\n"
  },
  {
    "path": "github/enterprise_actions_runner_groups.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// ListOrganizations represents the response from the list orgs endpoints.\ntype ListOrganizations struct {\n\tTotalCount    *int            `json:\"total_count,omitempty\"`\n\tOrganizations []*Organization `json:\"organizations\"`\n}\n\n// EnterpriseRunnerGroup represents a self-hosted runner group configured in an enterprise.\ntype EnterpriseRunnerGroup struct {\n\tID                           *int64   `json:\"id,omitempty\"`\n\tName                         *string  `json:\"name,omitempty\"`\n\tVisibility                   *string  `json:\"visibility,omitempty\"`\n\tDefault                      *bool    `json:\"default,omitempty\"`\n\tSelectedOrganizationsURL     *string  `json:\"selected_organizations_url,omitempty\"`\n\tRunnersURL                   *string  `json:\"runners_url,omitempty\"`\n\tHostedRunnersURL             *string  `json:\"hosted_runners_url,omitempty\"`\n\tNetworkConfigurationID       *string  `json:\"network_configuration_id,omitempty\"`\n\tInherited                    *bool    `json:\"inherited,omitempty\"`\n\tAllowsPublicRepositories     *bool    `json:\"allows_public_repositories,omitempty\"`\n\tRestrictedToWorkflows        *bool    `json:\"restricted_to_workflows,omitempty\"`\n\tSelectedWorkflows            []string `json:\"selected_workflows,omitempty\"`\n\tWorkflowRestrictionsReadOnly *bool    `json:\"workflow_restrictions_read_only,omitempty\"`\n}\n\n// EnterpriseRunnerGroups represents a collection of self-hosted runner groups configured for an enterprise.\ntype EnterpriseRunnerGroups struct {\n\tTotalCount   *int                     `json:\"total_count,omitempty\"`\n\tRunnerGroups []*EnterpriseRunnerGroup `json:\"runner_groups\"`\n}\n\n// CreateEnterpriseRunnerGroupRequest represents a request to create a Runner group for an enterprise.\ntype CreateEnterpriseRunnerGroupRequest struct {\n\tName       *string `json:\"name,omitempty\"`\n\tVisibility *string `json:\"visibility,omitempty\"`\n\t// List of organization IDs that can access the runner group.\n\tSelectedOrganizationIDs []int64 `json:\"selected_organization_ids,omitempty\"`\n\t// Runners represent a list of runner IDs to add to the runner group.\n\tRunners []int64 `json:\"runners,omitempty\"`\n\t// If set to True, public repos can use this runner group\n\tAllowsPublicRepositories *bool `json:\"allows_public_repositories,omitempty\"`\n\t// If true, the runner group will be restricted to running only the workflows specified in the SelectedWorkflows slice.\n\tRestrictedToWorkflows *bool `json:\"restricted_to_workflows,omitempty\"`\n\t// List of workflows the runner group should be allowed to run. This setting will be ignored unless RestrictedToWorkflows is set to true.\n\tSelectedWorkflows []string `json:\"selected_workflows,omitempty\"`\n\t// The identifier of a hosted compute network configuration.\n\tNetworkConfigurationID *string `json:\"network_configuration_id,omitempty\"`\n}\n\n// UpdateEnterpriseRunnerGroupRequest represents a request to update a Runner group for an enterprise.\ntype UpdateEnterpriseRunnerGroupRequest struct {\n\tName                     *string  `json:\"name,omitempty\"`\n\tVisibility               *string  `json:\"visibility,omitempty\"`\n\tAllowsPublicRepositories *bool    `json:\"allows_public_repositories,omitempty\"`\n\tRestrictedToWorkflows    *bool    `json:\"restricted_to_workflows,omitempty\"`\n\tSelectedWorkflows        []string `json:\"selected_workflows,omitempty\"`\n\tNetworkConfigurationID   *string  `json:\"network_configuration_id,omitempty\"`\n}\n\n// SetOrgAccessRunnerGroupRequest represents a request to replace the list of organizations\n// that can access a self-hosted runner group configured in an enterprise.\ntype SetOrgAccessRunnerGroupRequest struct {\n\t// Updated list of organization IDs that should be given access to the runner group.\n\tSelectedOrganizationIDs []int64 `json:\"selected_organization_ids\"`\n}\n\n// ListEnterpriseRunnerGroupOptions extend ListOptions to have the optional parameters VisibleToOrganization.\ntype ListEnterpriseRunnerGroupOptions struct {\n\tListOptions\n\n\t// Only return runner groups that are allowed to be used by this organization.\n\tVisibleToOrganization string `url:\"visible_to_organization,omitempty\"`\n}\n\n// ListRunnerGroups lists all self-hosted runner groups configured in an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/actions/runner-groups\nfunc (s *EnterpriseService) ListRunnerGroups(ctx context.Context, enterprise string, opts *ListEnterpriseRunnerGroupOptions) (*EnterpriseRunnerGroups, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/runner-groups\", enterprise)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar groups *EnterpriseRunnerGroups\n\tresp, err := s.client.Do(ctx, req, &groups)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn groups, resp, nil\n}\n\n// GetEnterpriseRunnerGroup gets a specific self-hosted runner group for an enterprise using its RunnerGroup ID.\n//\n// 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\n//\n//meta:operation GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}\nfunc (s *EnterpriseService) GetEnterpriseRunnerGroup(ctx context.Context, enterprise string, groupID int64) (*EnterpriseRunnerGroup, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/runner-groups/%v\", enterprise, groupID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar runnerGroup *EnterpriseRunnerGroup\n\tresp, err := s.client.Do(ctx, req, &runnerGroup)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn runnerGroup, resp, nil\n}\n\n// DeleteEnterpriseRunnerGroup deletes a self-hosted runner group from an enterprise.\n//\n// 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\n//\n//meta:operation DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}\nfunc (s *EnterpriseService) DeleteEnterpriseRunnerGroup(ctx context.Context, enterprise string, groupID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/runner-groups/%v\", enterprise, groupID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// CreateEnterpriseRunnerGroup creates a new self-hosted runner group for an enterprise.\n//\n// 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\n//\n//meta:operation POST /enterprises/{enterprise}/actions/runner-groups\nfunc (s *EnterpriseService) CreateEnterpriseRunnerGroup(ctx context.Context, enterprise string, createReq CreateEnterpriseRunnerGroupRequest) (*EnterpriseRunnerGroup, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/runner-groups\", enterprise)\n\treq, err := s.client.NewRequest(\"POST\", u, createReq)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar runnerGroup *EnterpriseRunnerGroup\n\tresp, err := s.client.Do(ctx, req, &runnerGroup)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn runnerGroup, resp, nil\n}\n\n// UpdateEnterpriseRunnerGroup updates a self-hosted runner group for an enterprise.\n//\n// 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\n//\n//meta:operation PATCH /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}\nfunc (s *EnterpriseService) UpdateEnterpriseRunnerGroup(ctx context.Context, enterprise string, groupID int64, updateReq UpdateEnterpriseRunnerGroupRequest) (*EnterpriseRunnerGroup, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/runner-groups/%v\", enterprise, groupID)\n\treq, err := s.client.NewRequest(\"PATCH\", u, updateReq)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar runnerGroup *EnterpriseRunnerGroup\n\tresp, err := s.client.Do(ctx, req, &runnerGroup)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn runnerGroup, resp, nil\n}\n\n// ListOrganizationAccessRunnerGroup lists the organizations with access to a self-hosted runner group configured in an enterprise.\n//\n// 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\n//\n//meta:operation GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations\nfunc (s *EnterpriseService) ListOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID int64, opts *ListOptions) (*ListOrganizations, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/runner-groups/%v/organizations\", enterprise, groupID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar orgs *ListOrganizations\n\tresp, err := s.client.Do(ctx, req, &orgs)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn orgs, resp, nil\n}\n\n// SetOrganizationAccessRunnerGroup replaces the list of organizations that have access to a self-hosted runner group configured in an enterprise\n// with a new List of organizations.\n//\n// 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\n//\n//meta:operation PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations\nfunc (s *EnterpriseService) SetOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID int64, ids SetOrgAccessRunnerGroupRequest) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/runner-groups/%v/organizations\", enterprise, groupID)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, ids)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// AddOrganizationAccessRunnerGroup adds an organization to the list of selected organizations that can access a self-hosted runner group.\n// The runner group must have visibility set to 'selected'.\n//\n// 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\n//\n//meta:operation PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id}\nfunc (s *EnterpriseService) AddOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID, orgID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/runner-groups/%v/organizations/%v\", enterprise, groupID, orgID)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// RemoveOrganizationAccessRunnerGroup removes an organization from the list of selected organizations that can access a self-hosted runner group.\n// The runner group must have visibility set to 'selected'.\n//\n// 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\n//\n//meta:operation DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id}\nfunc (s *EnterpriseService) RemoveOrganizationAccessRunnerGroup(ctx context.Context, enterprise string, groupID, orgID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/runner-groups/%v/organizations/%v\", enterprise, groupID, orgID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// ListRunnerGroupRunners lists self-hosted runners that are in a specific enterprise group.\n//\n// 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\n//\n//meta:operation GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners\nfunc (s *EnterpriseService) ListRunnerGroupRunners(ctx context.Context, enterprise string, groupID int64, opts *ListOptions) (*Runners, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/runner-groups/%v/runners\", enterprise, groupID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar runners *Runners\n\tresp, err := s.client.Do(ctx, req, &runners)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn runners, resp, nil\n}\n\n// SetRunnerGroupRunners replaces the list of self-hosted runners that are part of an enterprise runner group\n// with a new list of runners.\n//\n// 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\n//\n//meta:operation PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners\nfunc (s *EnterpriseService) SetRunnerGroupRunners(ctx context.Context, enterprise string, groupID int64, ids SetRunnerGroupRunnersRequest) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/runner-groups/%v/runners\", enterprise, groupID)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, ids)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// AddRunnerGroupRunners adds a self-hosted runner to a runner group configured in an enterprise.\n//\n// 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\n//\n//meta:operation PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id}\nfunc (s *EnterpriseService) AddRunnerGroupRunners(ctx context.Context, enterprise string, groupID, runnerID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/runner-groups/%v/runners/%v\", enterprise, groupID, runnerID)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// RemoveRunnerGroupRunners removes a self-hosted runner from a group configured in an enterprise.\n// The runner is then returned to the default group.\n//\n// 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\n//\n//meta:operation DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id}\nfunc (s *EnterpriseService) RemoveRunnerGroupRunners(ctx context.Context, enterprise string, groupID, runnerID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/runner-groups/%v/runners/%v\", enterprise, groupID, runnerID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/enterprise_actions_runner_groups_test.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestEnterpriseService_ListRunnerGroups(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/o/actions/runner-groups\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `{\"total_count\":3,\"runner_groups\":[{\"id\":1,\"name\":\"Default\",\"visibility\":\"all\",\"default\":true,\"runners_url\":\"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/1/runners\",\"inherited\":false,\"allows_public_repositories\":true,\"restricted_to_workflows\":true,\"selected_workflows\":[\"a\",\"b\"]},{\"id\":2,\"name\":\"octo-runner-group\",\"visibility\":\"selected\",\"default\":false,\"selected_organizations_url\":\"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations\",\"runners_url\":\"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners\",\"inherited\":true,\"allows_public_repositories\":true,\"restricted_to_workflows\":false,\"selected_workflows\":[]},{\"id\":3,\"name\":\"expensive-hardware\",\"visibility\":\"private\",\"default\":false,\"runners_url\":\"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/3/runners\",\"inherited\":false,\"allows_public_repositories\":true,\"restricted_to_workflows\":false,\"selected_workflows\":[]}]}`)\n\t})\n\n\topts := &ListEnterpriseRunnerGroupOptions{ListOptions: ListOptions{Page: 2, PerPage: 2}}\n\tctx := t.Context()\n\tgroups, _, err := client.Enterprise.ListRunnerGroups(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.ListRunnerGroups returned error: %v\", err)\n\t}\n\n\twant := &EnterpriseRunnerGroups{\n\t\tTotalCount: Ptr(3),\n\t\tRunnerGroups: []*EnterpriseRunnerGroup{\n\t\t\t{ID: Ptr(int64(1)), Name: Ptr(\"Default\"), Visibility: Ptr(\"all\"), Default: Ptr(true), RunnersURL: Ptr(\"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/1/runners\"), Inherited: Ptr(false), AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(true), SelectedWorkflows: []string{\"a\", \"b\"}},\n\t\t\t{ID: Ptr(int64(2)), Name: Ptr(\"octo-runner-group\"), Visibility: Ptr(\"selected\"), Default: Ptr(false), SelectedOrganizationsURL: Ptr(\"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations\"), RunnersURL: Ptr(\"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners\"), Inherited: Ptr(true), AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}},\n\t\t\t{ID: Ptr(int64(3)), Name: Ptr(\"expensive-hardware\"), Visibility: Ptr(\"private\"), Default: Ptr(false), RunnersURL: Ptr(\"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/3/runners\"), Inherited: Ptr(false), AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}},\n\t\t},\n\t}\n\tif !cmp.Equal(groups, want) {\n\t\tt.Errorf(\"Enterprise.ListRunnerGroups returned %+v, want %+v\", groups, want)\n\t}\n\n\tconst methodName = \"ListRunnerGroups\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.ListRunnerGroups(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ListRunnerGroups(ctx, \"o\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_ListRunnerGroupsVisibleToOrganization(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/o/actions/runner-groups\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\", \"visible_to_organization\": \"github\"})\n\t\tfmt.Fprint(w, `{\"total_count\":3,\"runner_groups\":[{\"id\":1,\"name\":\"Default\",\"visibility\":\"all\",\"default\":true,\"runners_url\":\"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/1/runners\",\"inherited\":false,\"allows_public_repositories\":true,\"restricted_to_workflows\":false,\"selected_workflows\":[]},{\"id\":2,\"name\":\"octo-runner-group\",\"visibility\":\"selected\",\"default\":false,\"selected_organizations_url\":\"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations\",\"runners_url\":\"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners\",\"inherited\":true,\"allows_public_repositories\":true,\"restricted_to_workflows\":false,\"selected_workflows\":[]},{\"id\":3,\"name\":\"expensive-hardware\",\"visibility\":\"private\",\"default\":false,\"runners_url\":\"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/3/runners\",\"inherited\":false,\"allows_public_repositories\":true,\"restricted_to_workflows\":false,\"selected_workflows\":[]}]}`)\n\t})\n\n\topts := &ListEnterpriseRunnerGroupOptions{ListOptions: ListOptions{Page: 2, PerPage: 2}, VisibleToOrganization: \"github\"}\n\tctx := t.Context()\n\tgroups, _, err := client.Enterprise.ListRunnerGroups(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.ListRunnerGroups returned error: %v\", err)\n\t}\n\n\twant := &EnterpriseRunnerGroups{\n\t\tTotalCount: Ptr(3),\n\t\tRunnerGroups: []*EnterpriseRunnerGroup{\n\t\t\t{ID: Ptr(int64(1)), Name: Ptr(\"Default\"), Visibility: Ptr(\"all\"), Default: Ptr(true), RunnersURL: Ptr(\"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/1/runners\"), Inherited: Ptr(false), AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}},\n\t\t\t{ID: Ptr(int64(2)), Name: Ptr(\"octo-runner-group\"), Visibility: Ptr(\"selected\"), Default: Ptr(false), SelectedOrganizationsURL: Ptr(\"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations\"), RunnersURL: Ptr(\"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners\"), Inherited: Ptr(true), AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}},\n\t\t\t{ID: Ptr(int64(3)), Name: Ptr(\"expensive-hardware\"), Visibility: Ptr(\"private\"), Default: Ptr(false), RunnersURL: Ptr(\"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/3/runners\"), Inherited: Ptr(false), AllowsPublicRepositories: Ptr(true), RestrictedToWorkflows: Ptr(false), SelectedWorkflows: []string{}},\n\t\t},\n\t}\n\tif !cmp.Equal(groups, want) {\n\t\tt.Errorf(\"Enterprise.ListRunnerGroups returned %+v, want %+v\", groups, want)\n\t}\n\n\tconst methodName = \"ListRunnerGroups\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.ListRunnerGroups(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ListRunnerGroups(ctx, \"o\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_GetRunnerGroup(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/o/actions/runner-groups/2\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":2,\"name\":\"octo-runner-group\",\"visibility\":\"selected\",\"default\":false,\"selected_organizations_url\":\"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations\",\"runners_url\":\"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners\",\"inherited\":false,\"allows_public_repositories\":true,\"restricted_to_workflows\":false,\"selected_workflows\":[]}`)\n\t})\n\n\tctx := t.Context()\n\tgroup, _, err := client.Enterprise.GetEnterpriseRunnerGroup(ctx, \"o\", 2)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.GetRunnerGroup returned error: %v\", err)\n\t}\n\n\twant := &EnterpriseRunnerGroup{\n\t\tID:                       Ptr(int64(2)),\n\t\tName:                     Ptr(\"octo-runner-group\"),\n\t\tVisibility:               Ptr(\"selected\"),\n\t\tDefault:                  Ptr(false),\n\t\tSelectedOrganizationsURL: Ptr(\"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations\"),\n\t\tRunnersURL:               Ptr(\"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners\"),\n\t\tInherited:                Ptr(false),\n\t\tAllowsPublicRepositories: Ptr(true),\n\t\tRestrictedToWorkflows:    Ptr(false),\n\t\tSelectedWorkflows:        []string{},\n\t}\n\n\tif !cmp.Equal(group, want) {\n\t\tt.Errorf(\"Enterprise.GetRunnerGroup returned %+v, want %+v\", group, want)\n\t}\n\n\tconst methodName = \"GetRunnerGroup\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.GetEnterpriseRunnerGroup(ctx, \"\\n\", 2)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetEnterpriseRunnerGroup(ctx, \"o\", 2)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_DeleteRunnerGroup(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/o/actions/runner-groups/2\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Enterprise.DeleteEnterpriseRunnerGroup(ctx, \"o\", 2)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.DeleteRunnerGroup returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteRunnerGroup\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Enterprise.DeleteEnterpriseRunnerGroup(ctx, \"\\n\", 2)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Enterprise.DeleteEnterpriseRunnerGroup(ctx, \"o\", 2)\n\t})\n}\n\nfunc TestEnterpriseService_CreateRunnerGroup(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/o/actions/runner-groups\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\"id\":2,\"name\":\"octo-runner-group\",\"visibility\":\"selected\",\"default\":false,\"selected_organizations_url\":\"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations\",\"runners_url\":\"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners\",\"inherited\":false,\"allows_public_repositories\":true,\"restricted_to_workflows\":false,\"selected_workflows\":[]}`)\n\t})\n\n\tctx := t.Context()\n\treq := CreateEnterpriseRunnerGroupRequest{\n\t\tName:                     Ptr(\"octo-runner-group\"),\n\t\tVisibility:               Ptr(\"selected\"),\n\t\tAllowsPublicRepositories: Ptr(true),\n\t\tRestrictedToWorkflows:    Ptr(false),\n\t\tSelectedWorkflows:        []string{},\n\t}\n\tgroup, _, err := client.Enterprise.CreateEnterpriseRunnerGroup(ctx, \"o\", req)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.CreateRunnerGroup returned error: %v\", err)\n\t}\n\n\twant := &EnterpriseRunnerGroup{\n\t\tID:                       Ptr(int64(2)),\n\t\tName:                     Ptr(\"octo-runner-group\"),\n\t\tVisibility:               Ptr(\"selected\"),\n\t\tDefault:                  Ptr(false),\n\t\tSelectedOrganizationsURL: Ptr(\"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations\"),\n\t\tRunnersURL:               Ptr(\"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners\"),\n\t\tInherited:                Ptr(false),\n\t\tAllowsPublicRepositories: Ptr(true),\n\t\tRestrictedToWorkflows:    Ptr(false),\n\t\tSelectedWorkflows:        []string{},\n\t}\n\n\tif !cmp.Equal(group, want) {\n\t\tt.Errorf(\"Enterprise.CreateRunnerGroup returned %+v, want %+v\", group, want)\n\t}\n\n\tconst methodName = \"CreateRunnerGroup\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.CreateEnterpriseRunnerGroup(ctx, \"\\n\", req)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.CreateEnterpriseRunnerGroup(ctx, \"o\", req)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_UpdateRunnerGroup(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/o/actions/runner-groups/2\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tfmt.Fprint(w, `{\"id\":2,\"name\":\"octo-runner-group\",\"visibility\":\"selected\",\"default\":false,\"selected_organizations_url\":\"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations\",\"runners_url\":\"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners\",\"inherited\":false,\"allows_public_repositories\":true,\"restricted_to_workflows\":false,\"selected_workflows\":[]}`)\n\t})\n\n\tctx := t.Context()\n\treq := UpdateEnterpriseRunnerGroupRequest{\n\t\tName:                     Ptr(\"octo-runner-group\"),\n\t\tVisibility:               Ptr(\"selected\"),\n\t\tAllowsPublicRepositories: Ptr(true),\n\t\tRestrictedToWorkflows:    Ptr(false),\n\t\tSelectedWorkflows:        []string{},\n\t}\n\tgroup, _, err := client.Enterprise.UpdateEnterpriseRunnerGroup(ctx, \"o\", 2, req)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.UpdateRunnerGroup returned error: %v\", err)\n\t}\n\n\twant := &EnterpriseRunnerGroup{\n\t\tID:                       Ptr(int64(2)),\n\t\tName:                     Ptr(\"octo-runner-group\"),\n\t\tVisibility:               Ptr(\"selected\"),\n\t\tDefault:                  Ptr(false),\n\t\tSelectedOrganizationsURL: Ptr(\"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/organizations\"),\n\t\tRunnersURL:               Ptr(\"https://api.github.com/enterprises/octo-enterprise/actions/runner_groups/2/runners\"),\n\t\tInherited:                Ptr(false),\n\t\tAllowsPublicRepositories: Ptr(true),\n\t\tRestrictedToWorkflows:    Ptr(false),\n\t\tSelectedWorkflows:        []string{},\n\t}\n\n\tif !cmp.Equal(group, want) {\n\t\tt.Errorf(\"Enterprise.UpdateRunnerGroup returned %+v, want %+v\", group, want)\n\t}\n\n\tconst methodName = \"UpdateRunnerGroup\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.UpdateEnterpriseRunnerGroup(ctx, \"\\n\", 2, req)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.UpdateEnterpriseRunnerGroup(ctx, \"o\", 2, req)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_ListOrganizationAccessRunnerGroup(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/o/actions/runner-groups/2/organizations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"1\", \"page\": \"1\"})\n\t\tfmt.Fprint(w, `{\"total_count\": 1, \"organizations\": [{\"id\": 43, \"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\", \"name\": \"Hello-World\", \"login\": \"octocat\"}]}`)\n\t})\n\n\tctx := t.Context()\n\topts := &ListOptions{Page: 1, PerPage: 1}\n\tgroups, _, err := client.Enterprise.ListOrganizationAccessRunnerGroup(ctx, \"o\", 2, opts)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.ListOrganizationAccessRunnerGroup returned error: %v\", err)\n\t}\n\n\twant := &ListOrganizations{\n\t\tTotalCount: Ptr(1),\n\t\tOrganizations: []*Organization{\n\t\t\t{ID: Ptr(int64(43)), NodeID: Ptr(\"MDEwOlJlcG9zaXRvcnkxMjk2MjY5\"), Name: Ptr(\"Hello-World\"), Login: Ptr(\"octocat\")},\n\t\t},\n\t}\n\tif !cmp.Equal(groups, want) {\n\t\tt.Errorf(\"Enterprise.ListOrganizationAccessRunnerGroup returned %+v, want %+v\", groups, want)\n\t}\n\n\tconst methodName = \"ListOrganizationAccessRunnerGroup\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.ListOrganizationAccessRunnerGroup(ctx, \"\\n\", 2, opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ListOrganizationAccessRunnerGroup(ctx, \"o\", 2, opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_SetOrganizationAccessRunnerGroup(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/o/actions/runner-groups/2/organizations\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t})\n\n\treq := SetOrgAccessRunnerGroupRequest{\n\t\tSelectedOrganizationIDs: []int64{\n\t\t\t1,\n\t\t\t2,\n\t\t},\n\t}\n\n\tctx := t.Context()\n\t_, err := client.Enterprise.SetOrganizationAccessRunnerGroup(ctx, \"o\", 2, req)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.SetOrganizationAccessRunnerGroup returned error: %v\", err)\n\t}\n\n\tconst methodName = \"SetRepositoryAccessRunnerGroup\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Enterprise.SetOrganizationAccessRunnerGroup(ctx, \"\\n\", 2, req)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Enterprise.SetOrganizationAccessRunnerGroup(ctx, \"o\", 2, req)\n\t})\n}\n\nfunc TestEnterpriseService_AddOrganizationAccessRunnerGroup(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/o/actions/runner-groups/2/organizations/42\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Enterprise.AddOrganizationAccessRunnerGroup(ctx, \"o\", 2, 42)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.AddOrganizationAccessRunnerGroup returned error: %v\", err)\n\t}\n\n\tconst methodName = \"AddOrganizationAccessRunnerGroup\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Enterprise.AddOrganizationAccessRunnerGroup(ctx, \"\\n\", 2, 42)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Enterprise.AddOrganizationAccessRunnerGroup(ctx, \"o\", 2, 42)\n\t})\n}\n\nfunc TestEnterpriseService_RemoveOrganizationAccessRunnerGroup(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/o/actions/runner-groups/2/organizations/42\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Enterprise.RemoveOrganizationAccessRunnerGroup(ctx, \"o\", 2, 42)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.RemoveOrganizationAccessRunnerGroup returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveOrganizationAccessRunnerGroup\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Enterprise.RemoveOrganizationAccessRunnerGroup(ctx, \"\\n\", 2, 42)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Enterprise.RemoveOrganizationAccessRunnerGroup(ctx, \"o\", 2, 42)\n\t})\n}\n\nfunc TestEnterpriseService_ListEnterpriseRunnerGroupRunners(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/o/actions/runner-groups/2/runners\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `{\"total_count\":2,\"runners\":[{\"id\":23,\"name\":\"MBP\",\"os\":\"macos\",\"status\":\"online\"},{\"id\":24,\"name\":\"iMac\",\"os\":\"macos\",\"status\":\"offline\"}]}`)\n\t})\n\n\topts := &ListOptions{Page: 2, PerPage: 2}\n\tctx := t.Context()\n\trunners, _, err := client.Enterprise.ListRunnerGroupRunners(ctx, \"o\", 2, opts)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.ListEnterpriseRunnerGroupRunners returned error: %v\", err)\n\t}\n\n\twant := &Runners{\n\t\tTotalCount: 2,\n\t\tRunners: []*Runner{\n\t\t\t{ID: Ptr(int64(23)), Name: Ptr(\"MBP\"), OS: Ptr(\"macos\"), Status: Ptr(\"online\")},\n\t\t\t{ID: Ptr(int64(24)), Name: Ptr(\"iMac\"), OS: Ptr(\"macos\"), Status: Ptr(\"offline\")},\n\t\t},\n\t}\n\tif !cmp.Equal(runners, want) {\n\t\tt.Errorf(\"Enterprise.ListEnterpriseRunnerGroupRunners returned %+v, want %+v\", runners, want)\n\t}\n\n\tconst methodName = \"ListEnterpriseRunnerGroupRunners\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.ListRunnerGroupRunners(ctx, \"\\n\", 2, opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ListRunnerGroupRunners(ctx, \"o\", 2, opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_SetEnterpriseRunnerGroupRunners(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/o/actions/runner-groups/2/runners\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t})\n\n\treq := SetRunnerGroupRunnersRequest{\n\t\tRunners: []int64{\n\t\t\t1,\n\t\t\t2,\n\t\t},\n\t}\n\n\tctx := t.Context()\n\t_, err := client.Enterprise.SetRunnerGroupRunners(ctx, \"o\", 2, req)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.SetEnterpriseRunnerGroupRunners returned error: %v\", err)\n\t}\n\n\tconst methodName = \"SetEnterpriseRunnerGroupRunners\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Enterprise.SetRunnerGroupRunners(ctx, \"\\n\", 2, req)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Enterprise.SetRunnerGroupRunners(ctx, \"o\", 2, req)\n\t})\n}\n\nfunc TestEnterpriseService_AddEnterpriseRunnerGroupRunners(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/o/actions/runner-groups/2/runners/42\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Enterprise.AddRunnerGroupRunners(ctx, \"o\", 2, 42)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.AddEnterpriseRunnerGroupRunners returned error: %v\", err)\n\t}\n\n\tconst methodName = \"AddEnterpriseRunnerGroupRunners\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Enterprise.AddRunnerGroupRunners(ctx, \"\\n\", 2, 42)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Enterprise.AddRunnerGroupRunners(ctx, \"o\", 2, 42)\n\t})\n}\n\nfunc TestEnterpriseService_RemoveEnterpriseRunnerGroupRunners(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/o/actions/runner-groups/2/runners/42\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Enterprise.RemoveRunnerGroupRunners(ctx, \"o\", 2, 42)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.RemoveEnterpriseRunnerGroupRunners returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveEnterpriseRunnerGroupRunners\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Enterprise.RemoveRunnerGroupRunners(ctx, \"\\n\", 2, 42)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Enterprise.RemoveRunnerGroupRunners(ctx, \"o\", 2, 42)\n\t})\n}\n\nfunc TestEnterpriseRunnerGroup_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &EnterpriseRunnerGroup{}, \"{}\")\n\n\tu := &EnterpriseRunnerGroup{\n\t\tID:                       Ptr(int64(1)),\n\t\tName:                     Ptr(\"n\"),\n\t\tVisibility:               Ptr(\"v\"),\n\t\tDefault:                  Ptr(true),\n\t\tSelectedOrganizationsURL: Ptr(\"s\"),\n\t\tRunnersURL:               Ptr(\"r\"),\n\t\tHostedRunnersURL:         Ptr(\"h\"),\n\t\tNetworkConfigurationID:   Ptr(\"nc\"),\n\t\tInherited:                Ptr(true),\n\t\tAllowsPublicRepositories: Ptr(true),\n\t\tRestrictedToWorkflows:    Ptr(false),\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"name\": \"n\",\n\t\t\"visibility\": \"v\",\n\t\t\"default\": true,\n\t\t\"selected_organizations_url\": \"s\",\n\t\t\"runners_url\": \"r\",\n\t\t\"hosted_runners_url\": \"h\",\n\t\t\"network_configuration_id\": \"nc\",\n\t\t\"inherited\": true,\n\t\t\"allows_public_repositories\": true,\n\t\t\"restricted_to_workflows\": false\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestEnterpriseRunnerGroups_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &EnterpriseRunnerGroups{}, `{\"runner_groups\": null}`)\n\n\tu := &EnterpriseRunnerGroups{\n\t\tTotalCount: Ptr(1),\n\t\tRunnerGroups: []*EnterpriseRunnerGroup{\n\t\t\t{\n\t\t\t\tID:                       Ptr(int64(1)),\n\t\t\t\tName:                     Ptr(\"n\"),\n\t\t\t\tVisibility:               Ptr(\"v\"),\n\t\t\t\tDefault:                  Ptr(true),\n\t\t\t\tSelectedOrganizationsURL: Ptr(\"s\"),\n\t\t\t\tRunnersURL:               Ptr(\"r\"),\n\t\t\t\tHostedRunnersURL:         Ptr(\"h\"),\n\t\t\t\tNetworkConfigurationID:   Ptr(\"nc\"),\n\t\t\t\tInherited:                Ptr(true),\n\t\t\t\tAllowsPublicRepositories: Ptr(true),\n\t\t\t\tRestrictedToWorkflows:    Ptr(false),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"total_count\": 1,\n\t\t\"runner_groups\": [{\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"visibility\": \"v\",\n\t\t\t\"default\": true,\n\t\t\t\"selected_organizations_url\": \"s\",\n\t\t\t\"runners_url\": \"r\",\n\t\t\t\"hosted_runners_url\": \"h\",\n\t\t\t\"network_configuration_id\": \"nc\",\n\t\t\t\"inherited\": true,\n\t\t\t\"allows_public_repositories\": true,\n\t\t\t\"restricted_to_workflows\": false\n\t\t}]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestCreateEnterpriseRunnerGroupRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CreateEnterpriseRunnerGroupRequest{}, \"{}\")\n\n\tu := &CreateEnterpriseRunnerGroupRequest{\n\t\tName:                     Ptr(\"n\"),\n\t\tVisibility:               Ptr(\"v\"),\n\t\tSelectedOrganizationIDs:  []int64{1},\n\t\tRunners:                  []int64{1},\n\t\tAllowsPublicRepositories: Ptr(true),\n\t\tRestrictedToWorkflows:    Ptr(true),\n\t\tSelectedWorkflows:        []string{\"a\", \"b\"},\n\t\tNetworkConfigurationID:   Ptr(\"nc-123\"),\n\t}\n\n\twant := `{\n\t\t\"name\": \"n\",\n\t\t\"visibility\": \"v\",\n\t\t\"selected_organization_ids\": [1],\n\t\t\"runners\": [1],\n\t\t\"allows_public_repositories\": true,\n\t\t\"restricted_to_workflows\": true,\n\t\t\"selected_workflows\": [\"a\",\"b\"],\n\t\t\"network_configuration_id\": \"nc-123\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestUpdateEnterpriseRunnerGroupRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &UpdateEnterpriseRunnerGroupRequest{}, \"{}\")\n\n\tu := &UpdateEnterpriseRunnerGroupRequest{\n\t\tName:                     Ptr(\"n\"),\n\t\tVisibility:               Ptr(\"v\"),\n\t\tAllowsPublicRepositories: Ptr(true),\n\t\tRestrictedToWorkflows:    Ptr(false),\n\t\tNetworkConfigurationID:   Ptr(\"nc-456\"),\n\t}\n\n\twant := `{\n\t\t\"name\": \"n\",\n\t\t\"visibility\": \"v\",\n\t\t\"allows_public_repositories\": true,\n\t\t\"restricted_to_workflows\": false,\n\t\t\"network_configuration_id\": \"nc-456\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestSetOrgAccessRunnerGroupRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SetOrgAccessRunnerGroupRequest{}, `{\"selected_organization_ids\": null}`)\n\n\tu := &SetOrgAccessRunnerGroupRequest{\n\t\tSelectedOrganizationIDs: []int64{1},\n\t}\n\n\twant := `{\n\t\t\"selected_organization_ids\": [1]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/enterprise_actions_runners.go",
    "content": "// Copyright 2020 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// ListRunnerApplicationDownloads lists self-hosted runner application binaries that can be downloaded and run.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#list-runner-applications-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/actions/runners/downloads\nfunc (s *EnterpriseService) ListRunnerApplicationDownloads(ctx context.Context, enterprise string) ([]*RunnerApplicationDownload, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/runners/downloads\", enterprise)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar rads []*RunnerApplicationDownload\n\tresp, err := s.client.Do(ctx, req, &rads)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn rads, resp, nil\n}\n\n// GenerateEnterpriseJITConfig generates a just-in-time configuration for an enterprise.\n//\n// 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\n//\n//meta:operation POST /enterprises/{enterprise}/actions/runners/generate-jitconfig\nfunc (s *EnterpriseService) GenerateEnterpriseJITConfig(ctx context.Context, enterprise string, request *GenerateJITConfigRequest) (*JITRunnerConfig, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/runners/generate-jitconfig\", enterprise)\n\n\treq, err := s.client.NewRequest(\"POST\", u, request)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar jitConfig *JITRunnerConfig\n\tresp, err := s.client.Do(ctx, req, &jitConfig)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn jitConfig, resp, nil\n}\n\n// CreateRegistrationToken creates a token that can be used to add a self-hosted runner.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#create-a-registration-token-for-an-enterprise\n//\n//meta:operation POST /enterprises/{enterprise}/actions/runners/registration-token\nfunc (s *EnterpriseService) CreateRegistrationToken(ctx context.Context, enterprise string) (*RegistrationToken, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/runners/registration-token\", enterprise)\n\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar registrationToken *RegistrationToken\n\tresp, err := s.client.Do(ctx, req, &registrationToken)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn registrationToken, resp, nil\n}\n\n// ListRunners lists all the self-hosted runners for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/actions/runners\nfunc (s *EnterpriseService) ListRunners(ctx context.Context, enterprise string, opts *ListRunnersOptions) (*Runners, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/runners\", enterprise)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar runners *Runners\n\tresp, err := s.client.Do(ctx, req, &runners)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn runners, resp, nil\n}\n\n// GetRunner gets a specific self-hosted runner configured in an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/actions/runners/{runner_id}\nfunc (s *EnterpriseService) GetRunner(ctx context.Context, enterprise string, runnerID int64) (*Runner, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/runners/%v\", enterprise, runnerID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar runner *Runner\n\tresp, err := s.client.Do(ctx, req, &runner)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn runner, resp, nil\n}\n\n// RemoveRunner forces the removal of a self-hosted runner from an enterprise using the runner id.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-enterprise\n//\n//meta:operation DELETE /enterprises/{enterprise}/actions/runners/{runner_id}\nfunc (s *EnterpriseService) RemoveRunner(ctx context.Context, enterprise string, runnerID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/actions/runners/%v\", enterprise, runnerID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/enterprise_actions_runners_test.go",
    "content": "// Copyright 2020 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestEnterpriseService_GenerateEnterpriseJITConfig(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &GenerateJITConfigRequest{Name: \"test\", RunnerGroupID: 1, Labels: []string{\"one\", \"two\"}}\n\n\tmux.HandleFunc(\"/enterprises/o/actions/runners/generate-jitconfig\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *GenerateJITConfigRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"encoded_jit_config\":\"foo\"}`)\n\t})\n\n\tctx := t.Context()\n\tjitConfig, _, err := client.Enterprise.GenerateEnterpriseJITConfig(ctx, \"o\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.GenerateEnterpriseJITConfig returned error: %v\", err)\n\t}\n\n\twant := &JITRunnerConfig{EncodedJITConfig: Ptr(\"foo\")}\n\tif !cmp.Equal(jitConfig, want) {\n\t\tt.Errorf(\"Enterprise.GenerateEnterpriseJITConfig returned %+v, want %+v\", jitConfig, want)\n\t}\n\n\tconst methodName = \"GenerateEnterpriseJITConfig\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.GenerateEnterpriseJITConfig(ctx, \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GenerateEnterpriseJITConfig(ctx, \"o\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_CreateRegistrationToken(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/actions/runners/registration-token\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\"token\":\"LLBF3JGZDX3P5PMEXLND6TS6FCWO6\",\"expires_at\":\"2020-01-22T12:13:35.123Z\"}`)\n\t})\n\n\tctx := t.Context()\n\ttoken, _, err := client.Enterprise.CreateRegistrationToken(ctx, \"e\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.CreateRegistrationToken returned error: %v\", err)\n\t}\n\n\twant := &RegistrationToken{\n\t\tToken: Ptr(\"LLBF3JGZDX3P5PMEXLND6TS6FCWO6\"),\n\t\tExpiresAt: &Timestamp{time.Date(2020, time.January, 22, 12, 13, 35,\n\t\t\t123000000, time.UTC)},\n\t}\n\tif !cmp.Equal(token, want) {\n\t\tt.Errorf(\"Enterprise.CreateRegistrationToken returned %+v, want %+v\", token, want)\n\t}\n\n\tconst methodName = \"CreateRegistrationToken\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.CreateRegistrationToken(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.CreateRegistrationToken(ctx, \"e\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_ListRunners(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/actions/runners\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"name\": \"MBP\", \"per_page\": \"2\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `{\"total_count\":1,\"runners\":[{\"id\":23,\"name\":\"MBP\",\"os\":\"macos\",\"status\":\"online\"}]}`)\n\t})\n\n\topts := &ListRunnersOptions{\n\t\tName:        Ptr(\"MBP\"),\n\t\tListOptions: ListOptions{Page: 2, PerPage: 2},\n\t}\n\tctx := t.Context()\n\trunners, _, err := client.Enterprise.ListRunners(ctx, \"e\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.ListRunners returned error: %v\", err)\n\t}\n\n\twant := &Runners{\n\t\tTotalCount: 1,\n\t\tRunners: []*Runner{\n\t\t\t{ID: Ptr(int64(23)), Name: Ptr(\"MBP\"), OS: Ptr(\"macos\"), Status: Ptr(\"online\")},\n\t\t},\n\t}\n\tif !cmp.Equal(runners, want) {\n\t\tt.Errorf(\"Actions.ListRunners returned %+v, want %+v\", runners, want)\n\t}\n\n\tconst methodName = \"ListRunners\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.ListRunners(ctx, \"\\n\", &ListRunnersOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ListRunners(ctx, \"e\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_GetRunner(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/actions/runners/23\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":23,\"name\":\"MBP\",\"os\":\"macos\",\"status\":\"online\"}`)\n\t})\n\n\tctx := t.Context()\n\trunner, _, err := client.Enterprise.GetRunner(ctx, \"e\", 23)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.GetRunner returned error: %v\", err)\n\t}\n\n\twant := &Runner{\n\t\tID:     Ptr(int64(23)),\n\t\tName:   Ptr(\"MBP\"),\n\t\tOS:     Ptr(\"macos\"),\n\t\tStatus: Ptr(\"online\"),\n\t}\n\tif !cmp.Equal(runner, want) {\n\t\tt.Errorf(\"Enterprise.GetRunner returned %+v, want %+v\", runner, want)\n\t}\n\n\tconst methodName = \"GetRunner\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.GetRunner(ctx, \"\\n\", 23)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetRunner(ctx, \"e\", 23)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_RemoveRunner(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/o/actions/runners/21\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Enterprise.RemoveRunner(ctx, \"o\", 21)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.RemoveRunner returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveRunner\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Enterprise.RemoveRunner(ctx, \"\\n\", 21)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Enterprise.RemoveRunner(ctx, \"o\", 21)\n\t})\n}\n\nfunc TestEnterpriseService_ListRunnerApplicationDownloads(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/o/actions/runners/downloads\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"os\":\"osx\",\"architecture\":\"x64\",\"download_url\":\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-osx-x64-2.164.0.tar.gz\",\"filename\":\"actions-runner-osx-x64-2.164.0.tar.gz\"},{\"os\":\"linux\",\"architecture\":\"x64\",\"download_url\":\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-x64-2.164.0.tar.gz\",\"filename\":\"actions-runner-linux-x64-2.164.0.tar.gz\"},{\"os\": \"linux\",\"architecture\":\"arm\",\"download_url\":\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm-2.164.0.tar.gz\",\"filename\":\"actions-runner-linux-arm-2.164.0.tar.gz\"},{\"os\":\"win\",\"architecture\":\"x64\",\"download_url\":\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-win-x64-2.164.0.zip\",\"filename\":\"actions-runner-win-x64-2.164.0.zip\"},{\"os\":\"linux\",\"architecture\":\"arm64\",\"download_url\":\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm64-2.164.0.tar.gz\",\"filename\":\"actions-runner-linux-arm64-2.164.0.tar.gz\"}]`)\n\t})\n\n\tctx := t.Context()\n\tdownloads, _, err := client.Enterprise.ListRunnerApplicationDownloads(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.ListRunnerApplicationDownloads returned error: %v\", err)\n\t}\n\n\twant := []*RunnerApplicationDownload{\n\t\t{OS: Ptr(\"osx\"), Architecture: Ptr(\"x64\"), DownloadURL: Ptr(\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-osx-x64-2.164.0.tar.gz\"), Filename: Ptr(\"actions-runner-osx-x64-2.164.0.tar.gz\")},\n\t\t{OS: Ptr(\"linux\"), Architecture: Ptr(\"x64\"), DownloadURL: Ptr(\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-x64-2.164.0.tar.gz\"), Filename: Ptr(\"actions-runner-linux-x64-2.164.0.tar.gz\")},\n\t\t{OS: Ptr(\"linux\"), Architecture: Ptr(\"arm\"), DownloadURL: Ptr(\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm-2.164.0.tar.gz\"), Filename: Ptr(\"actions-runner-linux-arm-2.164.0.tar.gz\")},\n\t\t{OS: Ptr(\"win\"), Architecture: Ptr(\"x64\"), DownloadURL: Ptr(\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-win-x64-2.164.0.zip\"), Filename: Ptr(\"actions-runner-win-x64-2.164.0.zip\")},\n\t\t{OS: Ptr(\"linux\"), Architecture: Ptr(\"arm64\"), DownloadURL: Ptr(\"https://github.com/actions/runner/releases/download/v2.164.0/actions-runner-linux-arm64-2.164.0.tar.gz\"), Filename: Ptr(\"actions-runner-linux-arm64-2.164.0.tar.gz\")},\n\t}\n\tif !cmp.Equal(downloads, want) {\n\t\tt.Errorf(\"Enterprise.ListRunnerApplicationDownloads returned %+v, want %+v\", downloads, want)\n\t}\n\n\tconst methodName = \"ListRunnerApplicationDownloads\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.ListRunnerApplicationDownloads(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ListRunnerApplicationDownloads(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/enterprise_app_installation.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// InstallableOrganization represents an organization in an enterprise in which a GitHub app can be installed.\ntype InstallableOrganization struct {\n\tID                        int64   `json:\"id\"`\n\tLogin                     string  `json:\"login\"`\n\tAccessibleRepositoriesURL *string `json:\"accessible_repositories_url,omitempty\"`\n}\n\n// AccessibleRepository represents a repository that can be made accessible to a GitHub app.\ntype AccessibleRepository struct {\n\tID       int64  `json:\"id\"`\n\tName     string `json:\"name\"`\n\tFullName string `json:\"full_name\"`\n}\n\n// InstallAppRequest represents the request to install a GitHub app on an enterprise-owned organization.\ntype InstallAppRequest struct {\n\t// The Client ID of the GitHub App to install.\n\tClientID string `json:\"client_id\"`\n\t// The selection of repositories that the GitHub app can access.\n\t// Can be one of: all, selected, none\n\tRepositorySelection string `json:\"repository_selection\"`\n\t// A list of repository names that the GitHub App can access, if the repository_selection is set to selected.\n\tRepositories []string `json:\"repositories,omitempty\"`\n}\n\n// ListAppInstallableOrganizations lists the organizations in an enterprise that are installable for an app.\n//\n// 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\n//\n//meta:operation GET /enterprises/{enterprise}/apps/installable_organizations\nfunc (s *EnterpriseService) ListAppInstallableOrganizations(ctx context.Context, enterprise string, opts *ListOptions) ([]*InstallableOrganization, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/apps/installable_organizations\", enterprise)\n\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar orgs []*InstallableOrganization\n\tresp, err := s.client.Do(ctx, req, &orgs)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn orgs, resp, nil\n}\n\n// ListAppAccessibleOrganizationRepositories lists the repositories accessible to an app in an enterprise-owned organization.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations#get-repositories-belonging-to-an-enterprise-owned-organization\n//\n//meta:operation GET /enterprises/{enterprise}/apps/installable_organizations/{org}/accessible_repositories\nfunc (s *EnterpriseService) ListAppAccessibleOrganizationRepositories(ctx context.Context, enterprise, org string, opts *ListOptions) ([]*AccessibleRepository, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/apps/installable_organizations/%v/accessible_repositories\", enterprise, org)\n\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar repos []*AccessibleRepository\n\tresp, err := s.client.Do(ctx, req, &repos)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn repos, resp, nil\n}\n\n// ListAppInstallations lists the GitHub app installations associated with the given enterprise-owned organization.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations#list-github-apps-installed-on-an-enterprise-owned-organization\n//\n//meta:operation GET /enterprises/{enterprise}/apps/organizations/{org}/installations\nfunc (s *EnterpriseService) ListAppInstallations(ctx context.Context, enterprise, org string, opts *ListOptions) ([]*Installation, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/apps/organizations/%v/installations\", enterprise, org)\n\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar installation []*Installation\n\tresp, err := s.client.Do(ctx, req, &installation)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn installation, resp, nil\n}\n\n// InstallApp installs any valid GitHub app on the specified organization owned by the enterprise.\n// 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.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations#install-a-github-app-on-an-enterprise-owned-organization\n//\n//meta:operation POST /enterprises/{enterprise}/apps/organizations/{org}/installations\nfunc (s *EnterpriseService) InstallApp(ctx context.Context, enterprise, org string, request InstallAppRequest) (*Installation, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/apps/organizations/%v/installations\", enterprise, org)\n\treq, err := s.client.NewRequest(\"POST\", u, request)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar installation *Installation\n\tresp, err := s.client.Do(ctx, req, &installation)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn installation, resp, nil\n}\n\n// UninstallApp uninstalls a GitHub app from an organization. Any app installed on the organization can be removed.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations#uninstall-a-github-app-from-an-enterprise-owned-organization\n//\n//meta:operation DELETE /enterprises/{enterprise}/apps/organizations/{org}/installations/{installation_id}\nfunc (s *EnterpriseService) UninstallApp(ctx context.Context, enterprise, org string, installationID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/apps/organizations/%v/installations/%v\", enterprise, org, installationID)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n"
  },
  {
    "path": "github/enterprise_app_installation_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestEnterpriseService_ListAppInstallableOrganizations(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/apps/installable_organizations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"id\":1, \"login\":\"org1\"}]`)\n\t})\n\n\tctx := t.Context()\n\topts := &ListOptions{Page: 1, PerPage: 10}\n\tgot, _, err := client.Enterprise.ListAppInstallableOrganizations(ctx, \"e\", opts)\n\tif err != nil {\n\t\tt.Fatalf(\"Enterprise.ListAppInstallableOrganizations returned error: %v\", err)\n\t}\n\n\twant := []*InstallableOrganization{\n\t\t{ID: int64(1), Login: \"org1\"},\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Enterprise.ListAppInstallableOrganizations = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ListAppInstallableOrganizations\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err := client.Enterprise.ListAppInstallableOrganizations(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ListAppInstallableOrganizations(ctx, \"e\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_ListAppAccessibleOrganizationRepositories(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/apps/installable_organizations/org1/accessible_repositories\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"id\":10, \"name\":\"repo1\", \"full_name\":\"org1/repo1\"}]`)\n\t})\n\n\topts := &ListOptions{Page: 2, PerPage: 2}\n\tctx := t.Context()\n\trepos, _, err := client.Enterprise.ListAppAccessibleOrganizationRepositories(ctx, \"e\", \"org1\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.ListAppAccessibleOrganizationRepositories returned error: %v\", err)\n\t}\n\n\twant := []*AccessibleRepository{\n\t\t{ID: int64(10), Name: \"repo1\", FullName: \"org1/repo1\"},\n\t}\n\n\tif !cmp.Equal(repos, want) {\n\t\tt.Errorf(\"Enterprise.ListAppAccessibleOrganizationRepositories returned %+v, want %+v\", repos, want)\n\t}\n\n\tconst methodName = \"ListAppAccessibleOrganizationRepositories\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.ListAppAccessibleOrganizationRepositories(ctx, \"\\n\", \"org1\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ListAppAccessibleOrganizationRepositories(ctx, \"e\", \"org1\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_ListAppInstallations(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/apps/organizations/org1/installations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":99}]`)\n\t})\n\n\topts := &ListOptions{Page: 2, PerPage: 2}\n\tctx := t.Context()\n\tinstallations, _, err := client.Enterprise.ListAppInstallations(ctx, \"e\", \"org1\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"ListAppInstallations returned error: %v\", err)\n\t}\n\twant := []*Installation{\n\t\t{ID: Ptr(int64(99))},\n\t}\n\n\tif !cmp.Equal(installations, want) {\n\t\tt.Errorf(\"ListAppInstallations returned %+v, want %+v\", installations, want)\n\t}\n\n\tconst methodName = \"ListAppInstallations\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.ListAppInstallations(ctx, \"\\n\", \"org1\", &ListOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ListAppInstallations(ctx, \"e\", \"org1\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_InstallApp(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/apps/organizations/org1/installations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestBody(t, r, `{\"client_id\":\"cid\",\"repository_selection\":\"selected\",\"repositories\":[\"r1\",\"r2\"]}`+\"\\n\")\n\t\tfmt.Fprint(w, `{\"id\":555}`)\n\t})\n\n\treq := InstallAppRequest{\n\t\tClientID:            \"cid\",\n\t\tRepositorySelection: \"selected\",\n\t\tRepositories:        []string{\"r1\", \"r2\"},\n\t}\n\n\tctx := t.Context()\n\tinstallation, _, err := client.Enterprise.InstallApp(ctx, \"e\", \"org1\", req)\n\tif err != nil {\n\t\tt.Errorf(\"InstallApp returned error: %v\", err)\n\t}\n\n\twant := &Installation{ID: Ptr(int64(555))}\n\n\tif !cmp.Equal(installation, want) {\n\t\tt.Errorf(\"InstallApp returned %+v, want %+v\", installation, want)\n\t}\n\n\tconst methodName = \"InstallApp\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.InstallApp(ctx, \"e\", \"org1\", req)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_UninstallApp(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/apps/organizations/org1/installations/123\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Enterprise.UninstallApp(ctx, \"e\", \"org1\", 123)\n\tif err != nil {\n\t\tt.Errorf(\"UninstallApp returned error: %v\", err)\n\t}\n\n\tif resp.StatusCode != http.StatusNoContent {\n\t\tt.Errorf(\"UninstallApp returned status %v, want %v\", resp.StatusCode, http.StatusNoContent)\n\t}\n\n\tconst methodName = \"UninstallApp\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Enterprise.UninstallApp(ctx, \"e\", \"org1\", 123)\n\t})\n}\n"
  },
  {
    "path": "github/enterprise_apps.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// AppInstallationRepositoriesOptions specifies the parameters for\n// EnterpriseService.AddRepositoriesToAppInstallation and\n// EnterpriseService.RemoveRepositoriesFromAppInstallation.\ntype AppInstallationRepositoriesOptions struct {\n\tSelectedRepositoryIDs []int64 `json:\"selected_repository_ids\"`\n}\n\n// UpdateAppInstallationRepositoriesOptions specifies the parameters for\n// EnterpriseService.UpdateAppInstallationRepositories.\ntype UpdateAppInstallationRepositoriesOptions struct {\n\tRepositorySelection   *string `json:\"repository_selection,omitempty\"` // Can be \"all\" or \"selected\"\n\tSelectedRepositoryIDs []int64 `json:\"selected_repository_ids,omitempty\"`\n}\n\n// ListRepositoriesForOrgAppInstallation lists the repositories that an enterprise app installation\n// has access to on an organization.\n//\n// 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\n//\n//meta:operation GET /enterprises/{enterprise}/apps/organizations/{org}/installations/{installation_id}/repositories\nfunc (s *EnterpriseService) ListRepositoriesForOrgAppInstallation(ctx context.Context, enterprise, org string, installationID int64, opts *ListOptions) ([]*AccessibleRepository, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/apps/organizations/%v/installations/%v/repositories\", enterprise, org, installationID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar r []*AccessibleRepository\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}\n\n// UpdateAppInstallationRepositories changes a GitHub App installation's repository access\n// between all repositories and a selected set.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations#toggle-installation-repository-access-between-selected-and-all-repositories\n//\n//meta:operation PATCH /enterprises/{enterprise}/apps/organizations/{org}/installations/{installation_id}/repositories\nfunc (s *EnterpriseService) UpdateAppInstallationRepositories(ctx context.Context, enterprise, org string, installationID int64, opts UpdateAppInstallationRepositoriesOptions) (*Installation, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/apps/organizations/%v/installations/%v/repositories\", enterprise, org, installationID)\n\treq, err := s.client.NewRequest(\"PATCH\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar r *Installation\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}\n\n// AddRepositoriesToAppInstallation grants repository access for a GitHub App installation.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations#grant-repository-access-to-an-organization-installation\n//\n//meta:operation PATCH /enterprises/{enterprise}/apps/organizations/{org}/installations/{installation_id}/repositories/add\nfunc (s *EnterpriseService) AddRepositoriesToAppInstallation(ctx context.Context, enterprise, org string, installationID int64, opts AppInstallationRepositoriesOptions) ([]*AccessibleRepository, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/apps/organizations/%v/installations/%v/repositories/add\", enterprise, org, installationID)\n\treq, err := s.client.NewRequest(\"PATCH\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar r []*AccessibleRepository\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}\n\n// RemoveRepositoriesFromAppInstallation revokes repository access from a GitHub App installation.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/organization-installations#remove-repository-access-from-an-organization-installation\n//\n//meta:operation PATCH /enterprises/{enterprise}/apps/organizations/{org}/installations/{installation_id}/repositories/remove\nfunc (s *EnterpriseService) RemoveRepositoriesFromAppInstallation(ctx context.Context, enterprise, org string, installationID int64, opts AppInstallationRepositoriesOptions) ([]*AccessibleRepository, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/apps/organizations/%v/installations/%v/repositories/remove\", enterprise, org, installationID)\n\treq, err := s.client.NewRequest(\"PATCH\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar r []*AccessibleRepository\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}\n"
  },
  {
    "path": "github/enterprise_apps_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestEnterpriseService_ListRepositoriesForOrgAppInstallation(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/apps/organizations/o/installations/1/repositories\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"1\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\tctx := t.Context()\n\trepos, _, err := client.Enterprise.ListRepositoriesForOrgAppInstallation(ctx, \"e\", \"o\", 1, &ListOptions{Page: 1})\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.ListRepositoriesForOrgAppInstallation returned error: %v\", err)\n\t}\n\n\twant := []*AccessibleRepository{{ID: 1}}\n\tif diff := cmp.Diff(repos, want); diff != \"\" {\n\t\tt.Errorf(\"Enterprise.ListRepositoriesForOrgAppInstallation returned diff (-want +got):\\n%v\", diff)\n\t}\n\n\tconst methodName = \"ListRepositoriesForOrgAppInstallation\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.ListRepositoriesForOrgAppInstallation(ctx, \"\\n\", \"\\n\", -1, &ListOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t_, resp, err := client.Enterprise.ListRepositoriesForOrgAppInstallation(ctx, \"e\", \"o\", 1, &ListOptions{})\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_UpdateAppInstallationRepositories(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := UpdateAppInstallationRepositoriesOptions{\n\t\tRepositorySelection:   Ptr(\"selected\"),\n\t\tSelectedRepositoryIDs: []int64{1, 2},\n\t}\n\n\tmux.HandleFunc(\"/enterprises/e/apps/organizations/o/installations/1/repositories\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\ttestBody(t, r, `{\"repository_selection\":\"selected\",\"selected_repository_ids\":[1,2]}`+\"\\n\")\n\t\tfmt.Fprint(w, `{\"id\":1, \"repository_selection\":\"selected\"}`)\n\t})\n\n\tctx := t.Context()\n\tinst, _, err := client.Enterprise.UpdateAppInstallationRepositories(ctx, \"e\", \"o\", 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.UpdateAppInstallationRepositories returned error: %v\", err)\n\t}\n\n\twant := &Installation{ID: Ptr(int64(1)), RepositorySelection: Ptr(\"selected\")}\n\tif diff := cmp.Diff(inst, want); diff != \"\" {\n\t\tt.Errorf(\"Enterprise.UpdateAppInstallationRepositories returned diff (-want +got):\\n%v\", diff)\n\t}\n\n\tconst methodName = \"UpdateAppInstallationRepositories\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.UpdateAppInstallationRepositories(ctx, \"\\n\", \"\\n\", -1, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t_, resp, err := client.Enterprise.UpdateAppInstallationRepositories(ctx, \"e\", \"o\", 1, input)\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_AddRepositoriesToAppInstallation(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := AppInstallationRepositoriesOptions{SelectedRepositoryIDs: []int64{1, 2}}\n\n\tmux.HandleFunc(\"/enterprises/e/apps/organizations/o/installations/1/repositories/add\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\ttestBody(t, r, `{\"selected_repository_ids\":[1,2]}`+\"\\n\")\n\t\tfmt.Fprint(w, `[{\"id\":1},{\"id\":2}]`)\n\t})\n\n\tctx := t.Context()\n\trepos, _, err := client.Enterprise.AddRepositoriesToAppInstallation(ctx, \"e\", \"o\", 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.AddRepositoriesToAppInstallation returned error: %v\", err)\n\t}\n\n\twant := []*AccessibleRepository{{ID: 1}, {ID: 2}}\n\tif diff := cmp.Diff(repos, want); diff != \"\" {\n\t\tt.Errorf(\"Enterprise.AddRepositoriesToAppInstallation returned diff (-want +got):\\n%v\", diff)\n\t}\n\n\tconst methodName = \"AddRepositoriesToAppInstallation\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.AddRepositoriesToAppInstallation(ctx, \"\\n\", \"\\n\", -1, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t_, resp, err := client.Enterprise.AddRepositoriesToAppInstallation(ctx, \"e\", \"o\", 1, input)\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_RemoveRepositoriesFromAppInstallation(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := AppInstallationRepositoriesOptions{SelectedRepositoryIDs: []int64{1, 2}}\n\n\tmux.HandleFunc(\"/enterprises/e/apps/organizations/o/installations/1/repositories/remove\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\ttestBody(t, r, `{\"selected_repository_ids\":[1,2]}`+\"\\n\")\n\t\tfmt.Fprint(w, `[{\"id\":1},{\"id\":2}]`)\n\t})\n\n\tctx := t.Context()\n\trepos, _, err := client.Enterprise.RemoveRepositoriesFromAppInstallation(ctx, \"e\", \"o\", 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.RemoveRepositoriesFromAppInstallation returned error: %v\", err)\n\t}\n\n\twant := []*AccessibleRepository{{ID: 1}, {ID: 2}}\n\tif diff := cmp.Diff(repos, want); diff != \"\" {\n\t\tt.Errorf(\"Enterprise.RemoveRepositoriesFromAppInstallation returned diff (-want +got):\\n%v\", diff)\n\t}\n\n\tconst methodName = \"RemoveRepositoriesFromAppInstallation\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.RemoveRepositoriesFromAppInstallation(ctx, \"\\n\", \"\\n\", -1, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t_, resp, err := client.Enterprise.RemoveRepositoriesFromAppInstallation(ctx, \"e\", \"o\", 1, input)\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/enterprise_audit_log.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// GetAuditLog gets the audit-log entries for an organization.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/audit-log#get-the-audit-log-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/audit-log\nfunc (s *EnterpriseService) GetAuditLog(ctx context.Context, enterprise string, opts *GetAuditLogOptions) ([]*AuditEntry, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/audit-log\", enterprise)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar auditEntries []*AuditEntry\n\tresp, err := s.client.Do(ctx, req, &auditEntries)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn auditEntries, resp, nil\n}\n"
  },
  {
    "path": "github/enterprise_audit_log_stream.go",
    "content": "// Copyright 2026 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// AuditLogStream represents an audit log stream configuration for an enterprise.\ntype AuditLogStream struct {\n\tID            int64      `json:\"id\"`\n\tStreamType    string     `json:\"stream_type\"`\n\tStreamDetails string     `json:\"stream_details\"`\n\tEnabled       bool       `json:\"enabled\"`\n\tCreatedAt     Timestamp  `json:\"created_at\"`\n\tUpdatedAt     Timestamp  `json:\"updated_at\"`\n\tPausedAt      *Timestamp `json:\"paused_at,omitempty\"`\n}\n\n// AuditLogStreamConfig represents a configuration for creating or updating an audit log stream.\ntype AuditLogStreamConfig struct {\n\tEnabled        bool                       `json:\"enabled\"`\n\tStreamType     string                     `json:\"stream_type\"`\n\tVendorSpecific AuditLogStreamVendorConfig `json:\"vendor_specific\"`\n}\n\n// AuditLogStreamVendorConfig is a sealed marker interface for vendor-specific audit log\n// stream configurations. Only this package can define implementations.\ntype AuditLogStreamVendorConfig interface {\n\tisAuditLogStreamVendorConfig()\n}\n\n// AuditLogStreamKey represents the public key used to encrypt secrets for audit log streaming.\ntype AuditLogStreamKey struct {\n\tKeyID string `json:\"key_id\"`\n\tKey   string `json:\"key\"`\n}\n\n// AzureBlobConfig represents vendor-specific config for Azure Blob Storage.\ntype AzureBlobConfig struct {\n\tKeyID           string `json:\"key_id\"`\n\tEncryptedSASURL string `json:\"encrypted_sas_url\"`\n\tContainer       string `json:\"container\"`\n}\n\n// AzureHubConfig represents vendor-specific config for Azure Event Hubs.\ntype AzureHubConfig struct {\n\tName                string `json:\"name\"`\n\tEncryptedConnstring string `json:\"encrypted_connstring\"`\n\tKeyID               string `json:\"key_id\"`\n}\n\n// AmazonS3OIDCConfig represents vendor-specific config for Amazon S3 with OIDC authentication.\ntype AmazonS3OIDCConfig struct {\n\tBucket             string `json:\"bucket\"`\n\tRegion             string `json:\"region\"`\n\tKeyID              string `json:\"key_id\"`\n\tAuthenticationType string `json:\"authentication_type\"` // Value: \"oidc\"\n\tArnRole            string `json:\"arn_role\"`\n}\n\n// AmazonS3AccessKeysConfig represents vendor-specific config for Amazon S3 with access key authentication.\ntype AmazonS3AccessKeysConfig struct {\n\tBucket               string `json:\"bucket\"`\n\tRegion               string `json:\"region\"`\n\tKeyID                string `json:\"key_id\"`\n\tAuthenticationType   string `json:\"authentication_type\"` // Value: \"access_keys\"\n\tEncryptedSecretKey   string `json:\"encrypted_secret_key\"`\n\tEncryptedAccessKeyID string `json:\"encrypted_access_key_id\"`\n}\n\n// SplunkConfig represents vendor-specific config for Splunk.\ntype SplunkConfig struct {\n\tDomain         string `json:\"domain\"`\n\tPort           uint16 `json:\"port\"`\n\tKeyID          string `json:\"key_id\"`\n\tEncryptedToken string `json:\"encrypted_token\"`\n\tSSLVerify      bool   `json:\"ssl_verify\"`\n}\n\n// HecConfig represents vendor-specific config for an HTTPS Event Collector (HEC) endpoint.\ntype HecConfig struct {\n\tDomain         string `json:\"domain\"`\n\tPort           uint16 `json:\"port\"`\n\tKeyID          string `json:\"key_id\"`\n\tEncryptedToken string `json:\"encrypted_token\"`\n\tPath           string `json:\"path\"`\n\tSSLVerify      bool   `json:\"ssl_verify\"`\n}\n\n// GoogleCloudConfig represents vendor-specific config for Google Cloud Storage.\ntype GoogleCloudConfig struct {\n\tBucket                   string `json:\"bucket\"`\n\tKeyID                    string `json:\"key_id\"`\n\tEncryptedJSONCredentials string `json:\"encrypted_json_credentials\"`\n}\n\n// DatadogConfig represents vendor-specific config for Datadog.\ntype DatadogConfig struct {\n\tEncryptedToken string `json:\"encrypted_token\"`\n\tSite           string `json:\"site\"` // One of: US, US3, US5, EU1, US1-FED, AP1\n\tKeyID          string `json:\"key_id\"`\n}\n\n// Implement the sealed marker interface for all vendor config types.\nfunc (*AzureBlobConfig) isAuditLogStreamVendorConfig()          {}\nfunc (*AzureHubConfig) isAuditLogStreamVendorConfig()           {}\nfunc (*AmazonS3OIDCConfig) isAuditLogStreamVendorConfig()       {}\nfunc (*AmazonS3AccessKeysConfig) isAuditLogStreamVendorConfig() {}\nfunc (*SplunkConfig) isAuditLogStreamVendorConfig()             {}\nfunc (*HecConfig) isAuditLogStreamVendorConfig()                {}\nfunc (*GoogleCloudConfig) isAuditLogStreamVendorConfig()        {}\nfunc (*DatadogConfig) isAuditLogStreamVendorConfig()            {}\n\n// NewAzureBlobStreamConfig returns an AuditLogStreamConfig for Azure Blob Storage.\nfunc NewAzureBlobStreamConfig(enabled bool, cfg *AzureBlobConfig) *AuditLogStreamConfig {\n\treturn &AuditLogStreamConfig{Enabled: enabled, StreamType: \"Azure Blob Storage\", VendorSpecific: cfg}\n}\n\n// NewAzureHubStreamConfig returns an AuditLogStreamConfig for Azure Event Hubs.\nfunc NewAzureHubStreamConfig(enabled bool, cfg *AzureHubConfig) *AuditLogStreamConfig {\n\treturn &AuditLogStreamConfig{Enabled: enabled, StreamType: \"Azure Event Hubs\", VendorSpecific: cfg}\n}\n\n// NewAmazonS3OIDCStreamConfig returns an AuditLogStreamConfig for Amazon S3 with OIDC auth.\nfunc NewAmazonS3OIDCStreamConfig(enabled bool, cfg *AmazonS3OIDCConfig) *AuditLogStreamConfig {\n\treturn &AuditLogStreamConfig{Enabled: enabled, StreamType: \"Amazon S3\", VendorSpecific: cfg}\n}\n\n// NewAmazonS3AccessKeysStreamConfig returns an AuditLogStreamConfig for Amazon S3 with access key auth.\nfunc NewAmazonS3AccessKeysStreamConfig(enabled bool, cfg *AmazonS3AccessKeysConfig) *AuditLogStreamConfig {\n\treturn &AuditLogStreamConfig{Enabled: enabled, StreamType: \"Amazon S3\", VendorSpecific: cfg}\n}\n\n// NewSplunkStreamConfig returns an AuditLogStreamConfig for Splunk.\nfunc NewSplunkStreamConfig(enabled bool, cfg *SplunkConfig) *AuditLogStreamConfig {\n\treturn &AuditLogStreamConfig{Enabled: enabled, StreamType: \"Splunk\", VendorSpecific: cfg}\n}\n\n// NewHecStreamConfig returns an AuditLogStreamConfig for an HTTPS Event Collector endpoint.\nfunc NewHecStreamConfig(enabled bool, cfg *HecConfig) *AuditLogStreamConfig {\n\treturn &AuditLogStreamConfig{Enabled: enabled, StreamType: \"HTTPS Event Collector\", VendorSpecific: cfg}\n}\n\n// NewGoogleCloudStreamConfig returns an AuditLogStreamConfig for Google Cloud Storage.\nfunc NewGoogleCloudStreamConfig(enabled bool, cfg *GoogleCloudConfig) *AuditLogStreamConfig {\n\treturn &AuditLogStreamConfig{Enabled: enabled, StreamType: \"Google Cloud Storage\", VendorSpecific: cfg}\n}\n\n// NewDatadogStreamConfig returns an AuditLogStreamConfig for Datadog.\nfunc NewDatadogStreamConfig(enabled bool, cfg *DatadogConfig) *AuditLogStreamConfig {\n\treturn &AuditLogStreamConfig{Enabled: enabled, StreamType: \"Datadog\", VendorSpecific: cfg}\n}\n\n// GetAuditLogStreamKey retrieves the public key used to encrypt secrets for audit log streaming.\n// Credentials must be encrypted with this key before being submitted via CreateAuditLogStream\n// or UpdateAuditLogStream.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/audit-log#get-the-audit-log-stream-key-for-encrypting-secrets\n//\n//meta:operation GET /enterprises/{enterprise}/audit-log/stream-key\nfunc (s *EnterpriseService) GetAuditLogStreamKey(ctx context.Context, enterprise string) (*AuditLogStreamKey, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/audit-log/stream-key\", enterprise)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar key *AuditLogStreamKey\n\tresp, err := s.client.Do(ctx, req, &key)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn key, resp, nil\n}\n\n// ListAuditLogStreams lists the audit log stream configurations for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/audit-log#list-audit-log-stream-configurations-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/audit-log/streams\nfunc (s *EnterpriseService) ListAuditLogStreams(ctx context.Context, enterprise string) ([]*AuditLogStream, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/audit-log/streams\", enterprise)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar streams []*AuditLogStream\n\tresp, err := s.client.Do(ctx, req, &streams)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn streams, resp, nil\n}\n\n// GetAuditLogStream gets a single audit log stream configuration for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/audit-log#list-one-audit-log-streaming-configuration-via-a-stream-id\n//\n//meta:operation GET /enterprises/{enterprise}/audit-log/streams/{stream_id}\nfunc (s *EnterpriseService) GetAuditLogStream(ctx context.Context, enterprise string, streamID int64) (*AuditLogStream, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/audit-log/streams/%v\", enterprise, streamID)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar stream *AuditLogStream\n\tresp, err := s.client.Do(ctx, req, &stream)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn stream, resp, nil\n}\n\n// CreateAuditLogStream creates an audit log streaming configuration for an enterprise.\n// Credentials in the config must be encrypted using the key returned by GetAuditLogStreamKey.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/audit-log#create-an-audit-log-streaming-configuration-for-an-enterprise\n//\n//meta:operation POST /enterprises/{enterprise}/audit-log/streams\nfunc (s *EnterpriseService) CreateAuditLogStream(ctx context.Context, enterprise string, config AuditLogStreamConfig) (*AuditLogStream, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/audit-log/streams\", enterprise)\n\n\treq, err := s.client.NewRequest(\"POST\", u, config)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar stream *AuditLogStream\n\tresp, err := s.client.Do(ctx, req, &stream)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn stream, resp, nil\n}\n\n// UpdateAuditLogStream updates an existing audit log stream configuration for an enterprise.\n// Credentials in the config must be encrypted using the key returned by GetAuditLogStreamKey.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/audit-log#update-an-existing-audit-log-stream-configuration\n//\n//meta:operation PUT /enterprises/{enterprise}/audit-log/streams/{stream_id}\nfunc (s *EnterpriseService) UpdateAuditLogStream(ctx context.Context, enterprise string, streamID int64, config AuditLogStreamConfig) (*AuditLogStream, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/audit-log/streams/%v\", enterprise, streamID)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, config)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar stream *AuditLogStream\n\tresp, err := s.client.Do(ctx, req, &stream)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn stream, resp, nil\n}\n\n// DeleteAuditLogStream deletes an audit log stream configuration for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/audit-log#delete-an-audit-log-streaming-configuration-for-an-enterprise\n//\n//meta:operation DELETE /enterprises/{enterprise}/audit-log/streams/{stream_id}\nfunc (s *EnterpriseService) DeleteAuditLogStream(ctx context.Context, enterprise string, streamID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/audit-log/streams/%v\", enterprise, streamID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/enterprise_audit_log_stream_test.go",
    "content": "// Copyright 2026 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestEnterpriseService_GetAuditLogStreamKey(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/audit-log/stream-key\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"key_id\":\"1234\",\"key\":\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\"}`)\n\t})\n\n\tctx := t.Context()\n\tkey, _, err := client.Enterprise.GetAuditLogStreamKey(ctx, \"e\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.GetAuditLogStreamKey returned error: %v\", err)\n\t}\n\n\twant := &AuditLogStreamKey{\n\t\tKeyID: \"1234\",\n\t\tKey:   \"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234\",\n\t}\n\tif !cmp.Equal(key, want) {\n\t\tt.Errorf(\"Enterprise.GetAuditLogStreamKey returned %+v, want %+v\", key, want)\n\t}\n\n\tconst methodName = \"GetAuditLogStreamKey\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.GetAuditLogStreamKey(ctx, \"\\n\")\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetAuditLogStreamKey(ctx, \"e\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_ListAuditLogStreams(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/audit-log/streams\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"id\":1,\"stream_type\":\"Splunk\",\"stream_details\":\"US\",\"enabled\":true}]`)\n\t})\n\n\tctx := t.Context()\n\tstreams, _, err := client.Enterprise.ListAuditLogStreams(ctx, \"e\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.ListAuditLogStreams returned error: %v\", err)\n\t}\n\n\twant := []*AuditLogStream{\n\t\t{\n\t\t\tID:            1,\n\t\t\tStreamType:    \"Splunk\",\n\t\t\tStreamDetails: \"US\",\n\t\t\tEnabled:       true,\n\t\t},\n\t}\n\tif !cmp.Equal(streams, want) {\n\t\tt.Errorf(\"Enterprise.ListAuditLogStreams returned %+v, want %+v\", streams, want)\n\t}\n\n\tconst methodName = \"ListAuditLogStreams\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.ListAuditLogStreams(ctx, \"\\n\")\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ListAuditLogStreams(ctx, \"e\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_GetAuditLogStream(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/audit-log/streams/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1,\"stream_type\":\"Datadog\",\"stream_details\":\"US\",\"enabled\":true}`)\n\t})\n\n\tctx := t.Context()\n\tstream, _, err := client.Enterprise.GetAuditLogStream(ctx, \"e\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.GetAuditLogStream returned error: %v\", err)\n\t}\n\n\twant := &AuditLogStream{\n\t\tID:            1,\n\t\tStreamType:    \"Datadog\",\n\t\tStreamDetails: \"US\",\n\t\tEnabled:       true,\n\t}\n\tif !cmp.Equal(stream, want) {\n\t\tt.Errorf(\"Enterprise.GetAuditLogStream returned %+v, want %+v\", stream, want)\n\t}\n\n\tconst methodName = \"GetAuditLogStream\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.GetAuditLogStream(ctx, \"\\n\", 1)\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetAuditLogStream(ctx, \"e\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_CreateAuditLogStream(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/audit-log/streams\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\"id\":2,\"stream_type\":\"Datadog\",\"stream_details\":\"US3\",\"enabled\":false}`)\n\t})\n\n\tinput := NewDatadogStreamConfig(false, &DatadogConfig{\n\t\tEncryptedToken: \"ENCRYPTED\",\n\t\tSite:           \"US3\",\n\t\tKeyID:          \"v1\",\n\t})\n\n\tctx := t.Context()\n\tstream, _, err := client.Enterprise.CreateAuditLogStream(ctx, \"e\", *input)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.CreateAuditLogStream returned error: %v\", err)\n\t}\n\n\twant := &AuditLogStream{\n\t\tID:            2,\n\t\tStreamType:    \"Datadog\",\n\t\tStreamDetails: \"US3\",\n\t\tEnabled:       false,\n\t}\n\tif !cmp.Equal(stream, want) {\n\t\tt.Errorf(\"Enterprise.CreateAuditLogStream returned %+v, want %+v\", stream, want)\n\t}\n\n\tconst methodName = \"CreateAuditLogStream\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.CreateAuditLogStream(ctx, \"\\n\", *input)\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.CreateAuditLogStream(ctx, \"e\", *input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_UpdateAuditLogStream(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/audit-log/streams/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tfmt.Fprint(w, `{\"id\":1,\"stream_type\":\"Splunk\",\"stream_details\":\"splunk.example.com\",\"enabled\":true}`)\n\t})\n\n\tinput := NewSplunkStreamConfig(true, &SplunkConfig{\n\t\tDomain:         \"splunk.example.com\",\n\t\tPort:           8089,\n\t\tKeyID:          \"v1\",\n\t\tEncryptedToken: \"ENCRYPTED\",\n\t\tSSLVerify:      true,\n\t})\n\n\tctx := t.Context()\n\tstream, _, err := client.Enterprise.UpdateAuditLogStream(ctx, \"e\", 1, *input)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.UpdateAuditLogStream returned error: %v\", err)\n\t}\n\n\twant := &AuditLogStream{\n\t\tID:            1,\n\t\tStreamType:    \"Splunk\",\n\t\tStreamDetails: \"splunk.example.com\",\n\t\tEnabled:       true,\n\t}\n\tif !cmp.Equal(stream, want) {\n\t\tt.Errorf(\"Enterprise.UpdateAuditLogStream returned %+v, want %+v\", stream, want)\n\t}\n\n\tconst methodName = \"UpdateAuditLogStream\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.UpdateAuditLogStream(ctx, \"\\n\", 1, *input)\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.UpdateAuditLogStream(ctx, \"e\", 1, *input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_DeleteAuditLogStream(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/audit-log/streams/1\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Enterprise.DeleteAuditLogStream(ctx, \"e\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.DeleteAuditLogStream returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteAuditLogStream\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Enterprise.DeleteAuditLogStream(ctx, \"\\n\", 1)\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Enterprise.DeleteAuditLogStream(ctx, \"e\", 1)\n\t})\n}\n\nfunc TestNewAzureBlobStreamConfig(t *testing.T) {\n\tt.Parallel()\n\tcfg := &AzureBlobConfig{\n\t\tKeyID:           \"v1\",\n\t\tEncryptedSASURL: \"ENCRYPTED\",\n\t\tContainer:       \"my-container\",\n\t}\n\n\tgot := NewAzureBlobStreamConfig(true, cfg)\n\n\twant := &AuditLogStreamConfig{\n\t\tEnabled:        true,\n\t\tStreamType:     \"Azure Blob Storage\",\n\t\tVendorSpecific: cfg,\n\t}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"NewAzureBlobStreamConfig = %+v, want %+v\", got, want)\n\t}\n}\n\nfunc TestNewAzureHubStreamConfig(t *testing.T) {\n\tt.Parallel()\n\tcfg := &AzureHubConfig{\n\t\tName:                \"my-hub\",\n\t\tEncryptedConnstring: \"ENCRYPTED\",\n\t\tKeyID:               \"v1\",\n\t}\n\n\tgot := NewAzureHubStreamConfig(true, cfg)\n\n\twant := &AuditLogStreamConfig{\n\t\tEnabled:        true,\n\t\tStreamType:     \"Azure Event Hubs\",\n\t\tVendorSpecific: cfg,\n\t}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"NewAzureHubStreamConfig = %+v, want %+v\", got, want)\n\t}\n}\n\nfunc TestNewAmazonS3OIDCStreamConfig(t *testing.T) {\n\tt.Parallel()\n\tcfg := &AmazonS3OIDCConfig{\n\t\tBucket:             \"my-bucket\",\n\t\tRegion:             \"us-east-1\",\n\t\tKeyID:              \"v1\",\n\t\tAuthenticationType: \"oidc\",\n\t\tArnRole:            \"arn:aws:iam::role/my-role\",\n\t}\n\n\tgot := NewAmazonS3OIDCStreamConfig(true, cfg)\n\n\twant := &AuditLogStreamConfig{\n\t\tEnabled:        true,\n\t\tStreamType:     \"Amazon S3\",\n\t\tVendorSpecific: cfg,\n\t}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"NewAmazonS3OIDCStreamConfig = %+v, want %+v\", got, want)\n\t}\n}\n\nfunc TestNewAmazonS3AccessKeysStreamConfig(t *testing.T) {\n\tt.Parallel()\n\tcfg := &AmazonS3AccessKeysConfig{\n\t\tBucket:               \"my-bucket\",\n\t\tRegion:               \"us-west-2\",\n\t\tKeyID:                \"v1\",\n\t\tAuthenticationType:   \"access_keys\",\n\t\tEncryptedSecretKey:   \"ENCRYPTED_SECRET\",\n\t\tEncryptedAccessKeyID: \"ENCRYPTED_KEY_ID\",\n\t}\n\n\tgot := NewAmazonS3AccessKeysStreamConfig(false, cfg)\n\n\twant := &AuditLogStreamConfig{\n\t\tEnabled:        false,\n\t\tStreamType:     \"Amazon S3\",\n\t\tVendorSpecific: cfg,\n\t}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"NewAmazonS3AccessKeysStreamConfig = %+v, want %+v\", got, want)\n\t}\n}\n\nfunc TestNewSplunkStreamConfig(t *testing.T) {\n\tt.Parallel()\n\tcfg := &SplunkConfig{\n\t\tDomain:         \"splunk.example.com\",\n\t\tPort:           8089,\n\t\tKeyID:          \"v1\",\n\t\tEncryptedToken: \"ENCRYPTED\",\n\t\tSSLVerify:      true,\n\t}\n\n\tgot := NewSplunkStreamConfig(true, cfg)\n\n\twant := &AuditLogStreamConfig{\n\t\tEnabled:        true,\n\t\tStreamType:     \"Splunk\",\n\t\tVendorSpecific: cfg,\n\t}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"NewSplunkStreamConfig = %+v, want %+v\", got, want)\n\t}\n}\n\nfunc TestNewHecStreamConfig(t *testing.T) {\n\tt.Parallel()\n\tcfg := &HecConfig{\n\t\tDomain:         \"hec.example.com\",\n\t\tPort:           443,\n\t\tKeyID:          \"v1\",\n\t\tEncryptedToken: \"ENCRYPTED\",\n\t\tPath:           \"/services/collector\",\n\t\tSSLVerify:      true,\n\t}\n\n\tgot := NewHecStreamConfig(false, cfg)\n\n\twant := &AuditLogStreamConfig{\n\t\tEnabled:        false,\n\t\tStreamType:     \"HTTPS Event Collector\",\n\t\tVendorSpecific: cfg,\n\t}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"NewHecStreamConfig = %+v, want %+v\", got, want)\n\t}\n}\n\nfunc TestNewGoogleCloudStreamConfig(t *testing.T) {\n\tt.Parallel()\n\tcfg := &GoogleCloudConfig{\n\t\tBucket:                   \"my-gcs-bucket\",\n\t\tKeyID:                    \"v1\",\n\t\tEncryptedJSONCredentials: \"ENCRYPTED\",\n\t}\n\n\tgot := NewGoogleCloudStreamConfig(true, cfg)\n\n\twant := &AuditLogStreamConfig{\n\t\tEnabled:        true,\n\t\tStreamType:     \"Google Cloud Storage\",\n\t\tVendorSpecific: cfg,\n\t}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"NewGoogleCloudStreamConfig = %+v, want %+v\", got, want)\n\t}\n}\n\nfunc TestNewDatadogStreamConfig(t *testing.T) {\n\tt.Parallel()\n\tcfg := &DatadogConfig{\n\t\tEncryptedToken: \"ENCRYPTED\",\n\t\tSite:           \"US\",\n\t\tKeyID:          \"v1\",\n\t}\n\n\tgot := NewDatadogStreamConfig(false, cfg)\n\n\twant := &AuditLogStreamConfig{\n\t\tEnabled:        false,\n\t\tStreamType:     \"Datadog\",\n\t\tVendorSpecific: cfg,\n\t}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"NewDatadogStreamConfig = %+v, want %+v\", got, want)\n\t}\n}\n"
  },
  {
    "path": "github/enterprise_audit_log_test.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestEnterpriseService_GetAuditLog(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/audit-log\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\n\t\tfmt.Fprint(w, `[\n\t\t{\n        \"workflow_id\": 123456,\n        \"head_branch\": \"master\",\n        \"org\": \"o\",\n        \"trigger_id\": null,\n        \"repo\": \"o/blue-crayon-1\",\n        \"created_at\": 1615077308538,\n        \"head_sha\": \"5acdeadbeef64d1a62388e901e5cdc9358644b37\",\n        \"conclusion\": \"success\",\n        \"actor\": \"testactor\",\n        \"completed_at\": \"2021-03-07T00:35:08.000Z\",\n        \"@timestamp\": 1615077308538,\n        \"name\": \"Code scanning - action\",\n        \"action\": \"workflows.completed_workflow_run\",\n        \"started_at\": \"2021-03-07T00:33:04.000Z\",\n        \"event\": \"schedule\",\n        \"workflow_run_id\": 628312345,\n        \"_document_id\": \"beeZYapIUe-wKg5-beadb33\"\n\t\t}\n\t\t]`)\n\t})\n\tgetOpts := GetAuditLogOptions{\n\t\tInclude: Ptr(\"all\"),\n\t\tPhrase:  Ptr(\"action:workflows\"),\n\t\tOrder:   Ptr(\"asc\"),\n\t}\n\tctx := t.Context()\n\tauditEntries, _, err := client.Enterprise.GetAuditLog(ctx, \"e\", &getOpts)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.GetAuditLog returned error: %v\", err)\n\t}\n\ttimestamp := time.Unix(0, 1615077308538*1e6)\n\twant := []*AuditEntry{\n\t\t{\n\t\t\tTimestamp:  &Timestamp{timestamp},\n\t\t\tDocumentID: Ptr(\"beeZYapIUe-wKg5-beadb33\"),\n\t\t\tAction:     Ptr(\"workflows.completed_workflow_run\"),\n\t\t\tActor:      Ptr(\"testactor\"),\n\t\t\tCreatedAt:  &Timestamp{timestamp},\n\t\t\tOrg:        Ptr(\"o\"),\n\t\t\tAdditionalFields: map[string]any{\n\t\t\t\t\"completed_at\":    \"2021-03-07T00:35:08.000Z\",\n\t\t\t\t\"conclusion\":      \"success\",\n\t\t\t\t\"event\":           \"schedule\",\n\t\t\t\t\"head_branch\":     \"master\",\n\t\t\t\t\"head_sha\":        \"5acdeadbeef64d1a62388e901e5cdc9358644b37\",\n\t\t\t\t\"name\":            \"Code scanning - action\",\n\t\t\t\t\"repo\":            \"o/blue-crayon-1\",\n\t\t\t\t\"started_at\":      \"2021-03-07T00:33:04.000Z\",\n\t\t\t\t\"workflow_id\":     float64(123456),\n\t\t\t\t\"workflow_run_id\": float64(628312345),\n\t\t\t},\n\t\t},\n\t}\n\n\tassertNoDiff(t, want, auditEntries)\n\n\tconst methodName = \"GetAuditLog\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.GetAuditLog(ctx, \"\\n\", &getOpts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailureCategory(t, methodName, client, AuditLogCategory, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetAuditLog(ctx, \"o\", &GetAuditLogOptions{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/enterprise_billing_cost_centers.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// CostCenter represents an enterprise cost center.\ntype CostCenter struct {\n\tID                string                `json:\"id\"`\n\tName              string                `json:\"name\"`\n\tResources         []*CostCenterResource `json:\"resources\"`\n\tState             *string               `json:\"state,omitempty\"`\n\tAzureSubscription *string               `json:\"azure_subscription,omitempty\"`\n}\n\n// CostCenterResource represents a resource assigned to a cost center.\ntype CostCenterResource struct {\n\tType string `json:\"type\"`\n\tName string `json:\"name\"`\n}\n\n// CostCenters represents a list of cost centers.\ntype CostCenters struct {\n\tCostCenters []*CostCenter `json:\"costCenters,omitempty\"`\n}\n\n// ListCostCenterOptions specifies optional parameters to the EnterpriseService.ListCostCenters method.\ntype ListCostCenterOptions struct {\n\t// Set to `active` or `deleted` to only list cost centers in a specific state.\n\tState *string `url:\"state,omitempty\"`\n}\n\n// CostCenterRequest represents a request to create or update a cost center.\ntype CostCenterRequest struct {\n\tName string `json:\"name\"`\n}\n\n// CostCenterResourceRequest represents a request to add or remove resources from a cost center.\ntype CostCenterResourceRequest struct {\n\tUsers         []string `json:\"users,omitempty\"`\n\tOrganizations []string `json:\"organizations,omitempty\"`\n\tRepositories  []string `json:\"repositories,omitempty\"`\n}\n\n// AddResourcesToCostCenterResponse represents a response from adding resources to a cost center.\ntype AddResourcesToCostCenterResponse struct {\n\tMessage             *string               `json:\"message,omitempty\"`\n\tReassignedResources []*ReassignedResource `json:\"reassigned_resources,omitempty\"`\n}\n\n// ReassignedResource represents a resource that was reassigned from another cost center.\ntype ReassignedResource struct {\n\tResourceType       *string `json:\"resource_type,omitempty\"`\n\tName               *string `json:\"name,omitempty\"`\n\tPreviousCostCenter *string `json:\"previous_cost_center,omitempty\"`\n}\n\n// RemoveResourcesFromCostCenterResponse represents a response from removing resources from a cost center.\ntype RemoveResourcesFromCostCenterResponse struct {\n\tMessage *string `json:\"message,omitempty\"`\n}\n\n// DeleteCostCenterResponse represents a response from deleting a cost center.\ntype DeleteCostCenterResponse struct {\n\tMessage         string `json:\"message\"`\n\tID              string `json:\"id\"`\n\tName            string `json:\"name\"`\n\tCostCenterState string `json:\"costCenterState\"`\n}\n\n// ListCostCenters lists all cost centers for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#get-all-cost-centers-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/settings/billing/cost-centers\nfunc (s *EnterpriseService) ListCostCenters(ctx context.Context, enterprise string, opts *ListCostCenterOptions) (*CostCenters, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/settings/billing/cost-centers\", enterprise)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar costCenters *CostCenters\n\tresp, err := s.client.Do(ctx, req, &costCenters)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn costCenters, resp, nil\n}\n\n// CreateCostCenter creates a new cost center for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#create-a-new-cost-center\n//\n//meta:operation POST /enterprises/{enterprise}/settings/billing/cost-centers\nfunc (s *EnterpriseService) CreateCostCenter(ctx context.Context, enterprise string, costCenter CostCenterRequest) (*CostCenter, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/settings/billing/cost-centers\", enterprise)\n\n\treq, err := s.client.NewRequest(\"POST\", u, costCenter)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar result *CostCenter\n\tresp, err := s.client.Do(ctx, req, &result)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn result, resp, nil\n}\n\n// GetCostCenter gets a cost center by ID for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#get-a-cost-center-by-id\n//\n//meta:operation GET /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}\nfunc (s *EnterpriseService) GetCostCenter(ctx context.Context, enterprise, costCenterID string) (*CostCenter, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/settings/billing/cost-centers/%v\", enterprise, costCenterID)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar costCenter *CostCenter\n\tresp, err := s.client.Do(ctx, req, &costCenter)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn costCenter, resp, nil\n}\n\n// UpdateCostCenter updates the name of a cost center.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#update-a-cost-center-name\n//\n//meta:operation PATCH /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}\nfunc (s *EnterpriseService) UpdateCostCenter(ctx context.Context, enterprise, costCenterID string, costCenter CostCenterRequest) (*CostCenter, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/settings/billing/cost-centers/%v\", enterprise, costCenterID)\n\n\treq, err := s.client.NewRequest(\"PATCH\", u, costCenter)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar result *CostCenter\n\tresp, err := s.client.Do(ctx, req, &result)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn result, resp, nil\n}\n\n// DeleteCostCenter deletes a cost center.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#delete-a-cost-center\n//\n//meta:operation DELETE /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}\nfunc (s *EnterpriseService) DeleteCostCenter(ctx context.Context, enterprise, costCenterID string) (*DeleteCostCenterResponse, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/settings/billing/cost-centers/%v\", enterprise, costCenterID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar result *DeleteCostCenterResponse\n\tresp, err := s.client.Do(ctx, req, &result)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn result, resp, nil\n}\n\n// AddResourcesToCostCenter adds resources to a cost center.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#add-resources-to-a-cost-center\n//\n//meta:operation POST /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}/resource\nfunc (s *EnterpriseService) AddResourcesToCostCenter(ctx context.Context, enterprise, costCenterID string, resources CostCenterResourceRequest) (*AddResourcesToCostCenterResponse, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/settings/billing/cost-centers/%v/resource\", enterprise, costCenterID)\n\n\treq, err := s.client.NewRequest(\"POST\", u, resources)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar result *AddResourcesToCostCenterResponse\n\tresp, err := s.client.Do(ctx, req, &result)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn result, resp, nil\n}\n\n// RemoveResourcesFromCostCenter removes resources from a cost center.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/cost-centers#remove-resources-from-a-cost-center\n//\n//meta:operation DELETE /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}/resource\nfunc (s *EnterpriseService) RemoveResourcesFromCostCenter(ctx context.Context, enterprise, costCenterID string, resources CostCenterResourceRequest) (*RemoveResourcesFromCostCenterResponse, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/settings/billing/cost-centers/%v/resource\", enterprise, costCenterID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, resources)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar result *RemoveResourcesFromCostCenterResponse\n\tresp, err := s.client.Do(ctx, req, &result)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn result, resp, nil\n}\n"
  },
  {
    "path": "github/enterprise_billing_cost_centers_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestEnterpriseService_ListCostCenters(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/settings/billing/cost-centers\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"state\": \"active\",\n\t\t})\n\t\tfmt.Fprint(w, `{\n\t\t\t\"costCenters\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"2eeb8ffe-6903-11ee-8c99-0242ac120002\",\n\t\t\t\t\t\"name\": \"Cost Center Name\",\n\t\t\t\t\t\"state\": \"active\",\n\t\t\t\t\t\"azure_subscription\": \"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\",\n\t\t\t\t\t\"resources\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"type\": \"User\",\n\t\t\t\t\t\t\t\"name\": \"Monalisa\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"type\": \"Repo\",\n\t\t\t\t\t\t\t\"name\": \"octocat/hello-world\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"3ffb9ffe-6903-11ee-8c99-0242ac120003\",\n\t\t\t\t\t\"name\": \"Another Cost Center\",\n\t\t\t\t\t\"state\": \"active\",\n\t\t\t\t\t\"resources\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"type\": \"User\",\n\t\t\t\t\t\t\t\"name\": \"Octocat\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\topts := &ListCostCenterOptions{\n\t\tState: Ptr(\"active\"),\n\t}\n\tcostCenters, _, err := client.Enterprise.ListCostCenters(ctx, \"e\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.ListCostCenters returned error: %v\", err)\n\t}\n\n\twant := &CostCenters{\n\t\tCostCenters: []*CostCenter{\n\t\t\t{\n\t\t\t\tID:                \"2eeb8ffe-6903-11ee-8c99-0242ac120002\",\n\t\t\t\tName:              \"Cost Center Name\",\n\t\t\t\tState:             Ptr(\"active\"),\n\t\t\t\tAzureSubscription: Ptr(\"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\"),\n\t\t\t\tResources: []*CostCenterResource{\n\t\t\t\t\t{\n\t\t\t\t\t\tType: \"User\",\n\t\t\t\t\t\tName: \"Monalisa\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tType: \"Repo\",\n\t\t\t\t\t\tName: \"octocat/hello-world\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tID:    \"3ffb9ffe-6903-11ee-8c99-0242ac120003\",\n\t\t\t\tName:  \"Another Cost Center\",\n\t\t\t\tState: Ptr(\"active\"),\n\t\t\t\tResources: []*CostCenterResource{\n\t\t\t\t\t{\n\t\t\t\t\t\tType: \"User\",\n\t\t\t\t\t\tName: \"Octocat\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(costCenters, want) {\n\t\tt.Errorf(\"Enterprise.ListCostCenters returned %+v, want %+v\", costCenters, want)\n\t}\n\n\tconst methodName = \"ListCostCenters\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.ListCostCenters(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ListCostCenters(ctx, \"e\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_ListCostCenters_invalidEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Enterprise.ListCostCenters(ctx, \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestEnterpriseService_CreateCostCenter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/settings/billing/cost-centers\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestBody(t, r, `{\"name\":\"Engineering Team\"}`+\"\\n\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": \"abc123\",\n\t\t\t\"name\": \"Engineering Team\",\n\t\t\t\"resources\": []\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\treq := CostCenterRequest{\n\t\tName: \"Engineering Team\",\n\t}\n\tcostCenter, _, err := client.Enterprise.CreateCostCenter(ctx, \"e\", req)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.CreateCostCenter returned error: %v\", err)\n\t}\n\n\twant := &CostCenter{\n\t\tID:        \"abc123\",\n\t\tName:      \"Engineering Team\",\n\t\tResources: []*CostCenterResource{},\n\t}\n\tif !cmp.Equal(costCenter, want) {\n\t\tt.Errorf(\"Enterprise.CreateCostCenter returned %+v, want %+v\", costCenter, want)\n\t}\n\n\tconst methodName = \"CreateCostCenter\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.CreateCostCenter(ctx, \"\\n\", req)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.CreateCostCenter(ctx, \"e\", req)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_CreateCostCenter_invalidEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Enterprise.CreateCostCenter(ctx, \"%\", CostCenterRequest{})\n\ttestURLParseError(t, err)\n}\n\nfunc TestEnterpriseService_GetCostCenter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/settings/billing/cost-centers/2eeb8ffe-6903-11ee-8c99-0242ac120002\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": \"2eeb8ffe-6903-11ee-8c99-0242ac120002\",\n\t\t\t\"name\": \"Cost Center Name\",\n\t\t\t\"state\": \"active\",\n\t\t\t\"azure_subscription\": \"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\",\n\t\t\t\"resources\": [\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"User\",\n\t\t\t\t\t\"name\": \"Monalisa\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"Repo\",\n\t\t\t\t\t\"name\": \"octocat/hello-world\"\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tcostCenter, _, err := client.Enterprise.GetCostCenter(ctx, \"e\", \"2eeb8ffe-6903-11ee-8c99-0242ac120002\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.GetCostCenter returned error: %v\", err)\n\t}\n\n\twant := &CostCenter{\n\t\tID:                \"2eeb8ffe-6903-11ee-8c99-0242ac120002\",\n\t\tName:              \"Cost Center Name\",\n\t\tState:             Ptr(\"active\"),\n\t\tAzureSubscription: Ptr(\"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\"),\n\t\tResources: []*CostCenterResource{\n\t\t\t{\n\t\t\t\tType: \"User\",\n\t\t\t\tName: \"Monalisa\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tType: \"Repo\",\n\t\t\t\tName: \"octocat/hello-world\",\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(costCenter, want) {\n\t\tt.Errorf(\"Enterprise.GetCostCenter returned %+v, want %+v\", costCenter, want)\n\t}\n\n\tconst methodName = \"GetCostCenter\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.GetCostCenter(ctx, \"\\n\", \"2eeb8ffe-6903-11ee-8c99-0242ac120002\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetCostCenter(ctx, \"e\", \"2eeb8ffe-6903-11ee-8c99-0242ac120002\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_GetCostCenter_invalidEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Enterprise.GetCostCenter(ctx, \"%\", \"2eeb8ffe-6903-11ee-8c99-0242ac120002\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestEnterpriseService_UpdateCostCenter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/settings/billing/cost-centers/2eeb8ffe-6903-11ee-8c99-0242ac120002\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\ttestBody(t, r, `{\"name\":\"Updated Cost Center Name\"}`+\"\\n\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": \"2eeb8ffe-6903-11ee-8c99-0242ac120002\",\n\t\t\t\"name\": \"Updated Cost Center Name\",\n\t\t\t\"state\": \"active\",\n\t\t\t\"azure_subscription\": \"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\",\n\t\t\t\"resources\": [\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"User\",\n\t\t\t\t\t\"name\": \"Monalisa\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"Repo\",\n\t\t\t\t\t\"name\": \"octocat/hello-world\"\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\treq := CostCenterRequest{\n\t\tName: \"Updated Cost Center Name\",\n\t}\n\tcostCenter, _, err := client.Enterprise.UpdateCostCenter(ctx, \"e\", \"2eeb8ffe-6903-11ee-8c99-0242ac120002\", req)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.UpdateCostCenter returned error: %v\", err)\n\t}\n\n\twant := &CostCenter{\n\t\tID:                \"2eeb8ffe-6903-11ee-8c99-0242ac120002\",\n\t\tName:              \"Updated Cost Center Name\",\n\t\tState:             Ptr(\"active\"),\n\t\tAzureSubscription: Ptr(\"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\"),\n\t\tResources: []*CostCenterResource{\n\t\t\t{\n\t\t\t\tType: \"User\",\n\t\t\t\tName: \"Monalisa\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tType: \"Repo\",\n\t\t\t\tName: \"octocat/hello-world\",\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(costCenter, want) {\n\t\tt.Errorf(\"Enterprise.UpdateCostCenter returned %+v, want %+v\", costCenter, want)\n\t}\n\n\tconst methodName = \"UpdateCostCenter\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.UpdateCostCenter(ctx, \"\\n\", \"2eeb8ffe-6903-11ee-8c99-0242ac120002\", req)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.UpdateCostCenter(ctx, \"e\", \"2eeb8ffe-6903-11ee-8c99-0242ac120002\", req)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_UpdateCostCenter_invalidEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Enterprise.UpdateCostCenter(ctx, \"%\", \"2eeb8ffe-6903-11ee-8c99-0242ac120002\", CostCenterRequest{})\n\ttestURLParseError(t, err)\n}\n\nfunc TestEnterpriseService_DeleteCostCenter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/settings/billing/cost-centers/2eeb8ffe-6903-11ee-8c99-0242ac120002\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"message\": \"Cost center successfully deleted.\",\n\t\t\t\"id\": \"2eeb8ffe-6903-11ee-8c99-0242ac120002\",\n\t\t\t\"name\": \"Engineering Team\",\n\t\t\t\"costCenterState\": \"CostCenterArchived\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tresult, _, err := client.Enterprise.DeleteCostCenter(ctx, \"e\", \"2eeb8ffe-6903-11ee-8c99-0242ac120002\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.DeleteCostCenter returned error: %v\", err)\n\t}\n\n\twant := &DeleteCostCenterResponse{\n\t\tMessage:         \"Cost center successfully deleted.\",\n\t\tID:              \"2eeb8ffe-6903-11ee-8c99-0242ac120002\",\n\t\tName:            \"Engineering Team\",\n\t\tCostCenterState: \"CostCenterArchived\",\n\t}\n\tif !cmp.Equal(result, want) {\n\t\tt.Errorf(\"Enterprise.DeleteCostCenter returned %+v, want %+v\", result, want)\n\t}\n\n\tconst methodName = \"DeleteCostCenter\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.DeleteCostCenter(ctx, \"\\n\", \"2eeb8ffe-6903-11ee-8c99-0242ac120002\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.DeleteCostCenter(ctx, \"e\", \"2eeb8ffe-6903-11ee-8c99-0242ac120002\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_DeleteCostCenter_invalidEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Enterprise.DeleteCostCenter(ctx, \"%\", \"2eeb8ffe-6903-11ee-8c99-0242ac120002\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestEnterpriseService_AddResourcesToCostCenter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/settings/billing/cost-centers/2eeb8ffe-6903-11ee-8c99-0242ac120002/resource\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestBody(t, r, `{\"users\":[\"monalisa\"]}`+\"\\n\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"message\": \"Resources successfully added to the cost center.\",\n\t\t\t\"reassigned_resources\": [\n\t\t\t\t{\n\t\t\t\t\t\"resource_type\": \"user\",\n\t\t\t\t\t\"name\": \"monalisa\",\n\t\t\t\t\t\"previous_cost_center\": \"old-cost-center\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"resource_type\": \"organization\",\n\t\t\t\t\t\"name\": \"octo-org\",\n\t\t\t\t\t\"previous_cost_center\": \"another-cost-center\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"resource_type\": \"repository\",\n\t\t\t\t\t\"name\": \"octo-repo\",\n\t\t\t\t\t\"previous_cost_center\": \"yet-another-cost-center\"\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\treq := CostCenterResourceRequest{\n\t\tUsers: []string{\"monalisa\"},\n\t}\n\tresult, _, err := client.Enterprise.AddResourcesToCostCenter(ctx, \"e\", \"2eeb8ffe-6903-11ee-8c99-0242ac120002\", req)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.AddResourcesToCostCenter returned error: %v\", err)\n\t}\n\n\twant := &AddResourcesToCostCenterResponse{\n\t\tMessage: Ptr(\"Resources successfully added to the cost center.\"),\n\t\tReassignedResources: []*ReassignedResource{\n\t\t\t{\n\t\t\t\tResourceType:       Ptr(\"user\"),\n\t\t\t\tName:               Ptr(\"monalisa\"),\n\t\t\t\tPreviousCostCenter: Ptr(\"old-cost-center\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\tResourceType:       Ptr(\"organization\"),\n\t\t\t\tName:               Ptr(\"octo-org\"),\n\t\t\t\tPreviousCostCenter: Ptr(\"another-cost-center\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\tResourceType:       Ptr(\"repository\"),\n\t\t\t\tName:               Ptr(\"octo-repo\"),\n\t\t\t\tPreviousCostCenter: Ptr(\"yet-another-cost-center\"),\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(result, want) {\n\t\tt.Errorf(\"Enterprise.AddResourcesToCostCenter returned %+v, want %+v\", result, want)\n\t}\n\n\tconst methodName = \"AddResourcesToCostCenter\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.AddResourcesToCostCenter(ctx, \"\\n\", \"2eeb8ffe-6903-11ee-8c99-0242ac120002\", req)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.AddResourcesToCostCenter(ctx, \"e\", \"2eeb8ffe-6903-11ee-8c99-0242ac120002\", req)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_AddResourcesToCostCenter_invalidEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Enterprise.AddResourcesToCostCenter(ctx, \"%\", \"2eeb8ffe-6903-11ee-8c99-0242ac120002\", CostCenterResourceRequest{})\n\ttestURLParseError(t, err)\n}\n\nfunc TestEnterpriseService_RemoveResourcesFromCostCenter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/settings/billing/cost-centers/2eeb8ffe-6903-11ee-8c99-0242ac120002/resource\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestBody(t, r, `{\"users\":[\"monalisa\"]}`+\"\\n\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"message\": \"Resources successfully removed from the cost center.\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\treq := CostCenterResourceRequest{\n\t\tUsers: []string{\"monalisa\"},\n\t}\n\tresult, _, err := client.Enterprise.RemoveResourcesFromCostCenter(ctx, \"e\", \"2eeb8ffe-6903-11ee-8c99-0242ac120002\", req)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.RemoveResourcesFromCostCenter returned error: %v\", err)\n\t}\n\n\twant := &RemoveResourcesFromCostCenterResponse{\n\t\tMessage: Ptr(\"Resources successfully removed from the cost center.\"),\n\t}\n\tif !cmp.Equal(result, want) {\n\t\tt.Errorf(\"Enterprise.RemoveResourcesFromCostCenter returned %+v, want %+v\", result, want)\n\t}\n\n\tconst methodName = \"RemoveResourcesFromCostCenter\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.RemoveResourcesFromCostCenter(ctx, \"\\n\", \"2eeb8ffe-6903-11ee-8c99-0242ac120002\", req)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.RemoveResourcesFromCostCenter(ctx, \"e\", \"2eeb8ffe-6903-11ee-8c99-0242ac120002\", req)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_RemoveResourcesFromCostCenter_invalidEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Enterprise.RemoveResourcesFromCostCenter(ctx, \"%\", \"2eeb8ffe-6903-11ee-8c99-0242ac120002\", CostCenterResourceRequest{})\n\ttestURLParseError(t, err)\n}\n\nfunc TestCostCenter_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CostCenter{}, `{\"id\":\"\",\"name\":\"\",\"resources\":null}`)\n\n\tu := &CostCenter{\n\t\tID:                \"1\",\n\t\tName:              \"Engineering\",\n\t\tState:             Ptr(\"active\"),\n\t\tAzureSubscription: Ptr(\"sub-123\"),\n\t\tResources: []*CostCenterResource{\n\t\t\t{\n\t\t\t\tType: \"user\",\n\t\t\t\tName: \"octocat\",\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"id\": \"1\",\n\t\t\"name\": \"Engineering\",\n\t\t\"state\": \"active\",\n\t\t\"azure_subscription\": \"sub-123\",\n\t\t\"resources\": [\n\t\t\t{\n\t\t\t\t\"type\": \"user\",\n\t\t\t\t\"name\": \"octocat\"\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestCostCenterResource_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CostCenterResource{}, `{\"type\":\"\",\"name\":\"\"}`)\n\n\tu := &CostCenterResource{\n\t\tType: \"user\",\n\t\tName: \"octocat\",\n\t}\n\n\twant := `{\n\t\t\"type\": \"user\",\n\t\t\"name\": \"octocat\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestCostCenters_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CostCenters{}, \"{}\")\n\n\tu := &CostCenters{\n\t\tCostCenters: []*CostCenter{\n\t\t\t{\n\t\t\t\tID:        \"1\",\n\t\t\t\tName:      \"Engineering\",\n\t\t\t\tResources: []*CostCenterResource{},\n\t\t\t\tState:     Ptr(\"active\"),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"costCenters\": [\n\t\t\t{\n\t\t\t\t\"id\": \"1\",\n\t\t\t\t\"name\": \"Engineering\",\n\t\t\t\t\"resources\": [],\n\t\t\t\t\"state\": \"active\"\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestCostCenterRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CostCenterRequest{}, `{\"name\": \"\"}`)\n\n\tu := &CostCenterRequest{\n\t\tName: \"Engineering\",\n\t}\n\n\twant := `{\n\t\t\"name\": \"Engineering\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestCostCenterResourceRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CostCenterResourceRequest{}, \"{}\")\n\n\tu := &CostCenterResourceRequest{\n\t\tUsers:         []string{\"octocat\"},\n\t\tOrganizations: []string{\"github\"},\n\t\tRepositories:  []string{\"github/go-github\"},\n\t}\n\n\twant := `{\n\t\t\"users\": [\"octocat\"],\n\t\t\"organizations\": [\"github\"],\n\t\t\"repositories\": [\"github/go-github\"]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestDeleteCostCenterResponse_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &DeleteCostCenterResponse{}, `{\"message\":\"\",\"id\":\"\",\"name\":\"\",\"costCenterState\":\"\"}`)\n\n\tu := &DeleteCostCenterResponse{\n\t\tMessage:         \"Cost center successfully deleted.\",\n\t\tID:              \"2eeb8ffe-6903-11ee-8c99-0242ac120002\",\n\t\tName:            \"Engineering Team\",\n\t\tCostCenterState: \"CostCenterArchived\",\n\t}\n\n\twant := `{\n\t\t\"message\": \"Cost center successfully deleted.\",\n\t\t\"id\": \"2eeb8ffe-6903-11ee-8c99-0242ac120002\",\n\t\t\"name\": \"Engineering Team\",\n\t\t\"costCenterState\": \"CostCenterArchived\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/enterprise_budgets.go",
    "content": "// Copyright 2026 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// BudgetScope constants represent the scope of the budget.\nconst (\n\tBudgetScopeEnterprise   = \"enterprise\"\n\tBudgetScopeOrganization = \"organization\"\n\tBudgetScopeRepository   = \"repository\"\n\tBudgetScopeCostCenter   = \"cost_center\"\n)\n\n// BudgetType constants represent the type of pricing for the budget.\nconst (\n\tBudgetTypeProductPricing = \"ProductPricing\"\n\tBudgetTypeSkuPricing     = \"SkuPricing\"\n)\n\n// EnterpriseBudgetAlerting represents alerting settings for a GitHub enterprise budget.\ntype EnterpriseBudgetAlerting struct {\n\tWillAlert       *bool    `json:\"will_alert,omitempty\"`\n\tAlertRecipients []string `json:\"alert_recipients,omitempty\"`\n}\n\n// EnterpriseBudget represents a GitHub enterprise budget.\ntype EnterpriseBudget struct {\n\tID                  *string                   `json:\"id,omitempty\"`\n\tBudgetType          *string                   `json:\"budget_type,omitempty\"`\n\tBudgetProductSKU    *string                   `json:\"budget_product_sku,omitempty\"`\n\tBudgetScope         *string                   `json:\"budget_scope,omitempty\"`\n\tBudgetEntityName    *string                   `json:\"budget_entity_name,omitempty\"`\n\tBudgetAmount        *int                      `json:\"budget_amount,omitempty\"`\n\tPreventFurtherUsage *bool                     `json:\"prevent_further_usage,omitempty\"`\n\tBudgetAlerting      *EnterpriseBudgetAlerting `json:\"budget_alerting,omitempty\"`\n}\n\nfunc (b EnterpriseBudget) String() string {\n\treturn Stringify(b)\n}\n\n// EnterpriseListBudgets represents a collection of GitHub enterprise budgets.\ntype EnterpriseListBudgets struct {\n\tBudgets     []*EnterpriseBudget `json:\"budgets\"`\n\tHasNextPage *bool               `json:\"has_next_page,omitempty\"`\n\tTotalCount  *int                `json:\"total_count,omitempty\"`\n}\n\n// EnterpriseCreateBudget represents the payload to create a GitHub enterprise budget.\ntype EnterpriseCreateBudget struct {\n\tBudgetAmount        int                       `json:\"budget_amount\"`\n\tPreventFurtherUsage bool                      `json:\"prevent_further_usage\"`\n\tBudgetAlerting      *EnterpriseBudgetAlerting `json:\"budget_alerting\"`\n\tBudgetScope         string                    `json:\"budget_scope\"`\n\tBudgetEntityName    *string                   `json:\"budget_entity_name,omitempty\"`\n\tBudgetType          string                    `json:\"budget_type\"`\n\tBudgetProductSKU    *string                   `json:\"budget_product_sku,omitempty\"`\n}\n\n// EnterpriseUpdateBudget represents the payload to update a GitHub enterprise budget.\ntype EnterpriseUpdateBudget struct {\n\tBudgetAmount        *int                      `json:\"budget_amount,omitempty\"`\n\tPreventFurtherUsage *bool                     `json:\"prevent_further_usage,omitempty\"`\n\tBudgetAlerting      *EnterpriseBudgetAlerting `json:\"budget_alerting,omitempty\"`\n\tBudgetScope         *string                   `json:\"budget_scope,omitempty\"`\n\tBudgetEntityName    *string                   `json:\"budget_entity_name,omitempty\"`\n\tBudgetType          *string                   `json:\"budget_type,omitempty\"`\n\tBudgetProductSKU    *string                   `json:\"budget_product_sku,omitempty\"`\n}\n\n// EnterpriseCreateOrUpdateBudgetResponse represents the response when creating or updating a budget.\ntype EnterpriseCreateOrUpdateBudgetResponse struct {\n\tMessage string            `json:\"message\"`\n\tBudget  *EnterpriseBudget `json:\"budget\"`\n}\n\n// EnterpriseDeleteBudgetResponse represents the response when deleting a budget.\ntype EnterpriseDeleteBudgetResponse struct {\n\tMessage string `json:\"message\"`\n\tID      string `json:\"id\"`\n}\n\n// ListBudgets gets all budgets for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/budgets#get-all-budgets\n//\n//meta:operation GET /enterprises/{enterprise}/settings/billing/budgets\nfunc (s *EnterpriseService) ListBudgets(ctx context.Context, enterprise string) (*EnterpriseListBudgets, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/settings/billing/budgets\", enterprise)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar budgets *EnterpriseListBudgets\n\tresp, err := s.client.Do(ctx, req, &budgets)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn budgets, resp, nil\n}\n\n// CreateBudget creates a new budget for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/budgets#create-a-budget\n//\n//meta:operation POST /enterprises/{enterprise}/settings/billing/budgets\nfunc (s *EnterpriseService) CreateBudget(ctx context.Context, enterprise string, budget EnterpriseCreateBudget) (*EnterpriseCreateOrUpdateBudgetResponse, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/settings/billing/budgets\", enterprise)\n\n\treq, err := s.client.NewRequest(\"POST\", u, budget)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar createBudgetResponse *EnterpriseCreateOrUpdateBudgetResponse\n\tresp, err := s.client.Do(ctx, req, &createBudgetResponse)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn createBudgetResponse, resp, nil\n}\n\n// GetBudget gets a budget by ID for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/budgets#get-a-budget-by-id\n//\n//meta:operation GET /enterprises/{enterprise}/settings/billing/budgets/{budget_id}\nfunc (s *EnterpriseService) GetBudget(ctx context.Context, enterprise, budgetID string) (*EnterpriseBudget, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/settings/billing/budgets/%v\", enterprise, budgetID)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar budget *EnterpriseBudget\n\tresp, err := s.client.Do(ctx, req, &budget)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn budget, resp, nil\n}\n\n// UpdateBudget updates an existing budget for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/budgets#update-a-budget\n//\n//meta:operation PATCH /enterprises/{enterprise}/settings/billing/budgets/{budget_id}\nfunc (s *EnterpriseService) UpdateBudget(ctx context.Context, enterprise, budgetID string, budget EnterpriseUpdateBudget) (*EnterpriseCreateOrUpdateBudgetResponse, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/settings/billing/budgets/%v\", enterprise, budgetID)\n\n\treq, err := s.client.NewRequest(\"PATCH\", u, budget)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar updateBudgetResponse *EnterpriseCreateOrUpdateBudgetResponse\n\tresp, err := s.client.Do(ctx, req, &updateBudgetResponse)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn updateBudgetResponse, resp, nil\n}\n\n// DeleteBudget deletes a budget by ID for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/billing/budgets#delete-a-budget\n//\n//meta:operation DELETE /enterprises/{enterprise}/settings/billing/budgets/{budget_id}\nfunc (s *EnterpriseService) DeleteBudget(ctx context.Context, enterprise, budgetID string) (*EnterpriseDeleteBudgetResponse, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/settings/billing/budgets/%v\", enterprise, budgetID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar deleteBudgetResponse *EnterpriseDeleteBudgetResponse\n\tresp, err := s.client.Do(ctx, req, &deleteBudgetResponse)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn deleteBudgetResponse, resp, nil\n}\n"
  },
  {
    "path": "github/enterprise_budgets_test.go",
    "content": "// Copyright 2026 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestEnterpriseService_ListBudgets(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/settings/billing/budgets\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"budgets\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"2066deda-923f-43f9-88d2-62395a28c0cdd\",\n\t\t\t\t\t\"budget_type\": \"ProductPricing\",\n\t\t\t\t\t\"budget_product_sku\": \"actions\",\n\t\t\t\t\t\"budget_scope\": \"enterprise\",\n\t\t\t\t\t\"budget_amount\": 1000,\n\t\t\t\t\t\"prevent_further_usage\": true,\n\t\t\t\t\t\"budget_alerting\": {\n\t\t\t\t\t\t\"will_alert\": true,\n\t\t\t\t\t\t\"alert_recipients\": [\"enterprise-admin\"]\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"has_next_page\": true,\n\t\t\t\"total_count\": 1\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tbudgets, _, err := client.Enterprise.ListBudgets(ctx, \"e\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.ListBudgets returned error: %v\", err)\n\t}\n\n\twant := &EnterpriseListBudgets{\n\t\tBudgets: []*EnterpriseBudget{\n\t\t\t{\n\t\t\t\tID:                  Ptr(\"2066deda-923f-43f9-88d2-62395a28c0cdd\"),\n\t\t\t\tBudgetType:          Ptr(BudgetTypeProductPricing),\n\t\t\t\tBudgetProductSKU:    Ptr(\"actions\"),\n\t\t\t\tBudgetScope:         Ptr(BudgetScopeEnterprise),\n\t\t\t\tBudgetAmount:        Ptr(1000),\n\t\t\t\tPreventFurtherUsage: Ptr(true),\n\t\t\t\tBudgetAlerting: &EnterpriseBudgetAlerting{\n\t\t\t\t\tWillAlert:       Ptr(true),\n\t\t\t\t\tAlertRecipients: []string{\"enterprise-admin\"},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tHasNextPage: Ptr(true),\n\t\tTotalCount:  Ptr(1),\n\t}\n\tif !cmp.Equal(budgets, want) {\n\t\tt.Errorf(\"Enterprise.ListBudgets returned %+v, want %+v\", budgets, want)\n\t}\n\n\tconst methodName = \"ListBudgets\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ListBudgets(ctx, \"e\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.ListBudgets(ctx, \"\\n\")\n\t\treturn err\n\t})\n}\n\nfunc TestEnterpriseService_ListBudgets_invalidEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Enterprise.ListBudgets(ctx, \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestEnterpriseService_CreateBudget(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/settings/billing/budgets\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestBody(t, r, `{\"budget_amount\":200,\"prevent_further_usage\":true,\"budget_alerting\":{},\"budget_scope\":\"enterprise\",\"budget_type\":\"ProductPricing\",\"budget_product_sku\":\"actions\"}`+\"\\n\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"message\": \"Budget successfully created.\",\n\t\t\t\"budget\": {\n\t\t\t\t\"id\": \"b-123\",\n\t\t\t\t\"budget_amount\": 200,\n\t\t\t\t\"prevent_further_usage\": true\n\t\t\t}\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\treq := EnterpriseCreateBudget{\n\t\tBudgetAmount:        200,\n\t\tPreventFurtherUsage: true,\n\t\tBudgetScope:         BudgetScopeEnterprise,\n\t\tBudgetType:          BudgetTypeProductPricing,\n\t\tBudgetProductSKU:    Ptr(\"actions\"),\n\t\tBudgetAlerting:      &EnterpriseBudgetAlerting{},\n\t}\n\n\tresp, _, err := client.Enterprise.CreateBudget(ctx, \"e\", req)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.CreateBudget returned error: %v\", err)\n\t}\n\n\twant := &EnterpriseCreateOrUpdateBudgetResponse{\n\t\tMessage: \"Budget successfully created.\",\n\t\tBudget: &EnterpriseBudget{\n\t\t\tID:                  Ptr(\"b-123\"),\n\t\t\tBudgetAmount:        Ptr(200),\n\t\t\tPreventFurtherUsage: Ptr(true),\n\t\t},\n\t}\n\tif !cmp.Equal(resp, want) {\n\t\tt.Errorf(\"Enterprise.CreateBudget returned %+v, want %+v\", resp, want)\n\t}\n\n\tconst methodName = \"CreateBudget\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.CreateBudget(ctx, \"e\", req)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.CreateBudget(ctx, \"\\n\", req)\n\t\treturn err\n\t})\n}\n\nfunc TestEnterpriseService_CreateBudget_invalidEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Enterprise.CreateBudget(ctx, \"%\", EnterpriseCreateBudget{})\n\ttestURLParseError(t, err)\n}\n\nfunc TestEnterpriseService_GetBudget(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/settings/billing/budgets/2066deda-923f-43f9-88d2-62395a28c0cdd\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": \"2066deda-923f-43f9-88d2-62395a28c0cdd\",\n\t\t\t\"budget_type\": \"ProductPricing\",\n\t\t\t\"budget_product_sku\": \"actions_linux\",\n\t\t\t\"budget_scope\": \"repository\",\n\t\t\t\"budget_amount\": 0,\n\t\t\t\"prevent_further_usage\": true\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tbudget, _, err := client.Enterprise.GetBudget(ctx, \"e\", \"2066deda-923f-43f9-88d2-62395a28c0cdd\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.GetBudget returned error: %v\", err)\n\t}\n\n\twant := &EnterpriseBudget{\n\t\tID:                  Ptr(\"2066deda-923f-43f9-88d2-62395a28c0cdd\"),\n\t\tBudgetType:          Ptr(BudgetTypeProductPricing),\n\t\tBudgetProductSKU:    Ptr(\"actions_linux\"),\n\t\tBudgetScope:         Ptr(BudgetScopeRepository),\n\t\tBudgetAmount:        Ptr(0),\n\t\tPreventFurtherUsage: Ptr(true),\n\t}\n\tif !cmp.Equal(budget, want) {\n\t\tt.Errorf(\"Enterprise.GetBudget returned %+v, want %+v\", budget, want)\n\t}\n\n\tconst methodName = \"GetBudget\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetBudget(ctx, \"e\", \"2066deda-923f-43f9-88d2-62395a28c0cdd\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.GetBudget(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n}\n\nfunc TestEnterpriseService_GetBudget_invalidEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Enterprise.GetBudget(ctx, \"%\", \"b-123\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestEnterpriseService_UpdateBudget(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/settings/billing/budgets/b-123\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\ttestBody(t, r, `{\"budget_amount\":10,\"prevent_further_usage\":false}`+\"\\n\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"message\": \"Budget successfully updated.\",\n\t\t\t\"budget\": {\n\t\t\t\t\"id\": \"b-123\",\n\t\t\t\t\"budget_amount\": 10,\n\t\t\t\t\"prevent_further_usage\": false\n\t\t\t}\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\treq := EnterpriseUpdateBudget{\n\t\tBudgetAmount:        Ptr(10),\n\t\tPreventFurtherUsage: Ptr(false),\n\t}\n\n\tresp, _, err := client.Enterprise.UpdateBudget(ctx, \"e\", \"b-123\", req)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.UpdateBudget returned error: %v\", err)\n\t}\n\n\twant := &EnterpriseCreateOrUpdateBudgetResponse{\n\t\tMessage: \"Budget successfully updated.\",\n\t\tBudget: &EnterpriseBudget{\n\t\t\tID:                  Ptr(\"b-123\"),\n\t\t\tBudgetAmount:        Ptr(10),\n\t\t\tPreventFurtherUsage: Ptr(false),\n\t\t},\n\t}\n\tif !cmp.Equal(resp, want) {\n\t\tt.Errorf(\"Enterprise.UpdateBudget returned %+v, want %+v\", resp, want)\n\t}\n\n\tconst methodName = \"UpdateBudget\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.UpdateBudget(ctx, \"e\", \"b-123\", req)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.UpdateBudget(ctx, \"\\n\", \"\\n\", req)\n\t\treturn err\n\t})\n}\n\nfunc TestEnterpriseService_UpdateBudget_invalidEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Enterprise.UpdateBudget(ctx, \"%\", \"b-123\", EnterpriseUpdateBudget{})\n\ttestURLParseError(t, err)\n}\n\nfunc TestEnterpriseService_DeleteBudget(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/settings/billing/budgets/b-123\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"message\": \"Budget successfully deleted.\",\n\t\t\t\"id\": \"b-123\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tresp, _, err := client.Enterprise.DeleteBudget(ctx, \"e\", \"b-123\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.DeleteBudget returned error: %v\", err)\n\t}\n\n\twant := &EnterpriseDeleteBudgetResponse{\n\t\tMessage: \"Budget successfully deleted.\",\n\t\tID:      \"b-123\",\n\t}\n\tif !cmp.Equal(resp, want) {\n\t\tt.Errorf(\"Enterprise.DeleteBudget returned %+v, want %+v\", resp, want)\n\t}\n\n\tconst methodName = \"DeleteBudget\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.DeleteBudget(ctx, \"e\", \"b-123\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.DeleteBudget(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n}\n\nfunc TestEnterpriseService_DeleteBudget_invalidEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Enterprise.DeleteBudget(ctx, \"%\", \"b-123\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestEnterpriseBudget_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &EnterpriseBudget{}, \"{}\")\n\n\tu := &EnterpriseBudget{\n\t\tID:                  Ptr(\"b-123\"),\n\t\tBudgetType:          Ptr(BudgetTypeProductPricing),\n\t\tBudgetProductSKU:    Ptr(\"actions\"),\n\t\tBudgetScope:         Ptr(BudgetScopeEnterprise),\n\t\tBudgetEntityName:    Ptr(\"org-name\"),\n\t\tBudgetAmount:        Ptr(100),\n\t\tPreventFurtherUsage: Ptr(true),\n\t\tBudgetAlerting: &EnterpriseBudgetAlerting{\n\t\t\tWillAlert:       Ptr(true),\n\t\t\tAlertRecipients: []string{\"mona\"},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"id\": \"b-123\",\n\t\t\"budget_type\": \"ProductPricing\",\n\t\t\"budget_product_sku\": \"actions\",\n\t\t\"budget_scope\": \"enterprise\",\n\t\t\"budget_entity_name\": \"org-name\",\n\t\t\"budget_amount\": 100,\n\t\t\"prevent_further_usage\": true,\n\t\t\"budget_alerting\": {\n\t\t\t\"will_alert\": true,\n\t\t\t\"alert_recipients\": [\n\t\t\t\t\"mona\"\n\t\t\t]\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestEnterpriseBudgetAlerting_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &EnterpriseBudgetAlerting{}, \"{}\")\n\n\tu := &EnterpriseBudgetAlerting{\n\t\tWillAlert:       Ptr(true),\n\t\tAlertRecipients: []string{\"admin1\", \"admin2\"},\n\t}\n\n\twant := `{\n\t\t\"will_alert\": true,\n\t\t\"alert_recipients\": [\n\t\t\t\"admin1\",\n\t\t\t\"admin2\"\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestEnterpriseListBudgets_Marshal(t *testing.T) {\n\tt.Parallel()\n\n\tu := &EnterpriseListBudgets{\n\t\tBudgets: []*EnterpriseBudget{\n\t\t\t{\n\t\t\t\tID: Ptr(\"1\"),\n\t\t\t},\n\t\t},\n\t\tHasNextPage: Ptr(true),\n\t\tTotalCount:  Ptr(50),\n\t}\n\n\twant := `{\n\t\t\"budgets\": [\n\t\t\t{\n\t\t\t\t\"id\": \"1\"\n\t\t\t}\n\t\t],\n\t\t\"has_next_page\": true,\n\t\t\"total_count\": 50\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestEnterpriseCreateOrUpdateBudgetResponse_Marshal(t *testing.T) {\n\tt.Parallel()\n\n\tu := &EnterpriseCreateOrUpdateBudgetResponse{\n\t\tMessage: \"Success\",\n\t\tBudget: &EnterpriseBudget{\n\t\t\tID: Ptr(\"123\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"message\": \"Success\",\n\t\t\"budget\": {\n\t\t\t\"id\": \"123\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestEnterpriseDeleteBudgetResponse_Marshal(t *testing.T) {\n\tt.Parallel()\n\n\tu := &EnterpriseDeleteBudgetResponse{\n\t\tMessage: \"Budget successfully deleted.\",\n\t\tID:      \"123\",\n\t}\n\n\twant := `{\n\t\t\"message\": \"Budget successfully deleted.\",\n\t\t\"id\": \"123\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/enterprise_code_security_and_analysis.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// EnterpriseSecurityAnalysisSettings represents security analysis settings for an enterprise.\ntype EnterpriseSecurityAnalysisSettings struct {\n\tAdvancedSecurityEnabledForNewRepositories             *bool   `json:\"advanced_security_enabled_for_new_repositories,omitempty\"`\n\tSecretScanningEnabledForNewRepositories               *bool   `json:\"secret_scanning_enabled_for_new_repositories,omitempty\"`\n\tSecretScanningPushProtectionEnabledForNewRepositories *bool   `json:\"secret_scanning_push_protection_enabled_for_new_repositories,omitempty\"`\n\tSecretScanningPushProtectionCustomLink                *string `json:\"secret_scanning_push_protection_custom_link,omitempty\"`\n\tSecretScanningValidityChecksEnabled                   *bool   `json:\"secret_scanning_validity_checks_enabled,omitempty\"`\n}\n\n// GetCodeSecurityAndAnalysis gets code security and analysis features for an enterprise.\n//\n// 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\n//\n//meta:operation GET /enterprises/{enterprise}/code_security_and_analysis\nfunc (s *EnterpriseService) GetCodeSecurityAndAnalysis(ctx context.Context, enterprise string) (*EnterpriseSecurityAnalysisSettings, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/code_security_and_analysis\", enterprise)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar settings *EnterpriseSecurityAnalysisSettings\n\tresp, err := s.client.Do(ctx, req, &settings)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn settings, resp, nil\n}\n\n// UpdateCodeSecurityAndAnalysis updates code security and analysis features for new repositories in an enterprise.\n//\n// 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\n//\n//meta:operation PATCH /enterprises/{enterprise}/code_security_and_analysis\nfunc (s *EnterpriseService) UpdateCodeSecurityAndAnalysis(ctx context.Context, enterprise string, settings *EnterpriseSecurityAnalysisSettings) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/code_security_and_analysis\", enterprise)\n\treq, err := s.client.NewRequest(\"PATCH\", u, settings)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// EnableDisableSecurityFeature enables or disables a security feature for all repositories in an enterprise.\n//\n// Valid values for securityProduct: \"advanced_security\", \"secret_scanning\", \"secret_scanning_push_protection\".\n// Valid values for enablement:  \"enable_all\", \"disable_all\".\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/code-security-and-analysis#enable-or-disable-a-security-feature\n//\n//meta:operation POST /enterprises/{enterprise}/{security_product}/{enablement}\nfunc (s *EnterpriseService) EnableDisableSecurityFeature(ctx context.Context, enterprise, securityProduct, enablement string) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/%v/%v\", enterprise, securityProduct, enablement)\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n"
  },
  {
    "path": "github/enterprise_code_security_and_analysis_test.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestEnterpriseService_GetCodeSecurityAndAnalysis(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/code_security_and_analysis\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\n\t\tfmt.Fprint(w, `\n\t\t{\n\t\t  \"advanced_security_enabled_for_new_repositories\": true,\n\t\t  \"secret_scanning_enabled_for_new_repositories\": true,\n\t\t  \"secret_scanning_push_protection_enabled_for_new_repositories\": true,\n\t\t  \"secret_scanning_push_protection_custom_link\": \"https://github.com/test-org/test-repo/blob/main/README.md\",\n\t\t  \"secret_scanning_validity_checks_enabled\": true\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\n\tconst methodName = \"GetCodeSecurityAndAnalysis\"\n\n\tsettings, _, err := client.Enterprise.GetCodeSecurityAndAnalysis(ctx, \"e\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.%v returned error: %v\", methodName, err)\n\t}\n\twant := &EnterpriseSecurityAnalysisSettings{\n\t\tAdvancedSecurityEnabledForNewRepositories:             Ptr(true),\n\t\tSecretScanningEnabledForNewRepositories:               Ptr(true),\n\t\tSecretScanningPushProtectionEnabledForNewRepositories: Ptr(true),\n\t\tSecretScanningPushProtectionCustomLink:                Ptr(\"https://github.com/test-org/test-repo/blob/main/README.md\"),\n\t\tSecretScanningValidityChecksEnabled:                   Ptr(true),\n\t}\n\n\tif !cmp.Equal(settings, want) {\n\t\tt.Errorf(\"Enterprise.%v return \\ngot: %+v,\\nwant:%+v\", methodName, settings, want)\n\t}\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.GetCodeSecurityAndAnalysis(ctx, \"o\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetCodeSecurityAndAnalysis(ctx, \"e\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_UpdateCodeSecurityAndAnalysis(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &EnterpriseSecurityAnalysisSettings{\n\t\tAdvancedSecurityEnabledForNewRepositories:             Ptr(true),\n\t\tSecretScanningEnabledForNewRepositories:               Ptr(true),\n\t\tSecretScanningPushProtectionEnabledForNewRepositories: Ptr(true),\n\t\tSecretScanningPushProtectionCustomLink:                Ptr(\"https://github.com/test-org/test-repo/blob/main/README.md\"),\n\t\tSecretScanningValidityChecksEnabled:                   Ptr(true),\n\t}\n\n\tmux.HandleFunc(\"/enterprises/e/code_security_and_analysis\", func(_ http.ResponseWriter, r *http.Request) {\n\t\tvar v *EnterpriseSecurityAnalysisSettings\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\t})\n\n\tctx := t.Context()\n\n\tconst methodName = \"UpdateCodeSecurityAndAnalysis\"\n\n\t_, err := client.Enterprise.UpdateCodeSecurityAndAnalysis(ctx, \"e\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.%v returned error: %v\", methodName, err)\n\t}\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Enterprise.UpdateCodeSecurityAndAnalysis(ctx, \"o\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Enterprise.UpdateCodeSecurityAndAnalysis(ctx, \"e\", input)\n\t})\n}\n\nfunc TestEnterpriseService_EnableAdvancedSecurity(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/advanced_security/enable_all\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t})\n\n\tctx := t.Context()\n\n\tconst methodName = \"EnableDisableSecurityFeature\"\n\n\t_, err := client.Enterprise.EnableDisableSecurityFeature(ctx, \"e\", \"advanced_security\", \"enable_all\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.%v returned error: %v\", methodName, err)\n\t}\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Enterprise.EnableDisableSecurityFeature(ctx, \"o\", \"advanced_security\", \"enable_all\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Enterprise.EnableDisableSecurityFeature(ctx, \"e\", \"advanced_security\", \"enable_all\")\n\t})\n}\n"
  },
  {
    "path": "github/enterprise_codesecurity_configurations.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/http\"\n)\n\n// ListEnterpriseCodeSecurityConfigurationOptions specifies optional parameters to get security configurations for enterprises.\n//\n// Note: Pagination is powered by before/after cursor-style pagination. After the initial call,\n// inspect the returned *Response. Use resp.After as the opts.After value to request\n// the next page, and resp.Before as the opts.Before value to request the previous\n// page. Set either Before or After for a request; if both are\n// supplied GitHub API will return an error. PerPage controls the number of items\n// per page (max 100 per GitHub API docs).\ntype ListEnterpriseCodeSecurityConfigurationOptions struct {\n\t// A cursor, as given in the Link header. If specified, the query only searches for security configurations before this cursor.\n\tBefore string `url:\"before,omitempty\"`\n\n\t// A cursor, as given in the Link header. If specified, the query only searches for security configurations after this cursor.\n\tAfter string `url:\"after,omitempty\"`\n\n\t// For paginated result sets, the number of results to include per page.\n\tPerPage int `url:\"per_page,omitempty\"`\n}\n\n// ListCodeSecurityConfigurations lists all code security configurations available in an enterprise.\n//\n// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-code-security-configurations-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/code-security/configurations\nfunc (s *EnterpriseService) ListCodeSecurityConfigurations(ctx context.Context, enterprise string, opts *ListEnterpriseCodeSecurityConfigurationOptions) ([]*CodeSecurityConfiguration, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/code-security/configurations\", enterprise)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar configurations []*CodeSecurityConfiguration\n\tresp, err := s.client.Do(ctx, req, &configurations)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn configurations, resp, nil\n}\n\n// CreateCodeSecurityConfiguration creates a code security configuration in an enterprise.\n//\n// GitHub API docs: https://docs.github.com/rest/code-security/configurations#create-a-code-security-configuration-for-an-enterprise\n//\n//meta:operation POST /enterprises/{enterprise}/code-security/configurations\nfunc (s *EnterpriseService) CreateCodeSecurityConfiguration(ctx context.Context, enterprise string, config CodeSecurityConfiguration) (*CodeSecurityConfiguration, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/code-security/configurations\", enterprise)\n\n\treq, err := s.client.NewRequest(\"POST\", u, config)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar configuration *CodeSecurityConfiguration\n\tresp, err := s.client.Do(ctx, req, &configuration)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn configuration, resp, nil\n}\n\n// ListDefaultCodeSecurityConfigurations lists the default code security configurations for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-default-code-security-configurations-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/code-security/configurations/defaults\nfunc (s *EnterpriseService) ListDefaultCodeSecurityConfigurations(ctx context.Context, enterprise string) ([]*CodeSecurityConfigurationWithDefaultForNewRepos, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/code-security/configurations/defaults\", enterprise)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar configurations []*CodeSecurityConfigurationWithDefaultForNewRepos\n\tresp, err := s.client.Do(ctx, req, &configurations)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn configurations, resp, nil\n}\n\n// GetCodeSecurityConfiguration gets a code security configuration available in an enterprise.\n//\n// GitHub API docs: https://docs.github.com/rest/code-security/configurations#retrieve-a-code-security-configuration-of-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}\nfunc (s *EnterpriseService) GetCodeSecurityConfiguration(ctx context.Context, enterprise string, configurationID int64) (*CodeSecurityConfiguration, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/code-security/configurations/%v\", enterprise, configurationID)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar configuration *CodeSecurityConfiguration\n\tresp, err := s.client.Do(ctx, req, &configuration)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn configuration, resp, nil\n}\n\n// UpdateCodeSecurityConfiguration updates a code security configuration in an enterprise.\n//\n// GitHub API docs: https://docs.github.com/rest/code-security/configurations#update-a-custom-code-security-configuration-for-an-enterprise\n//\n//meta:operation PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}\nfunc (s *EnterpriseService) UpdateCodeSecurityConfiguration(ctx context.Context, enterprise string, configurationID int64, config CodeSecurityConfiguration) (*CodeSecurityConfiguration, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/code-security/configurations/%v\", enterprise, configurationID)\n\n\treq, err := s.client.NewRequest(\"PATCH\", u, config)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar configuration *CodeSecurityConfiguration\n\tresp, err := s.client.Do(ctx, req, &configuration)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn configuration, resp, nil\n}\n\n// DeleteCodeSecurityConfiguration deletes a code security configuration from an enterprise.\n//\n// GitHub API docs: https://docs.github.com/rest/code-security/configurations#delete-a-code-security-configuration-for-an-enterprise\n//\n//meta:operation DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}\nfunc (s *EnterpriseService) DeleteCodeSecurityConfiguration(ctx context.Context, enterprise string, configurationID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/code-security/configurations/%v\", enterprise, configurationID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\treturn resp, nil\n}\n\n// AttachCodeSecurityConfigurationToRepositories attaches an enterprise code security configuration to repositories.\n// `scope` is the type of repositories to attach the configuration to.\n// Can be one of: `all`, `all_without_configurations`.\n//\n// GitHub API docs: https://docs.github.com/rest/code-security/configurations#attach-an-enterprise-configuration-to-repositories\n//\n//meta:operation POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach\nfunc (s *EnterpriseService) AttachCodeSecurityConfigurationToRepositories(ctx context.Context, enterprise string, configurationID int64, scope string) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/code-security/configurations/%v/attach\", enterprise, configurationID)\n\ttype scopeType struct {\n\t\tScope string `json:\"scope\"`\n\t}\n\n\treq, err := s.client.NewRequest(\"POST\", u, scopeType{Scope: scope})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil && resp.StatusCode != http.StatusAccepted { // StatusAccepted(202) is the expected status code as job is queued for processing\n\t\treturn resp, err\n\t}\n\treturn resp, nil\n}\n\n// SetDefaultCodeSecurityConfiguration sets a code security configuration as a default for an enterprise.\n// `defaultForNewRepos` specifies which types of repository this security configuration should be applied to by default.\n// Can be one of: `all`, `none`, `private_and_internal`, `public`.\n//\n// GitHub API docs: https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-enterprise\n//\n//meta:operation PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults\nfunc (s *EnterpriseService) SetDefaultCodeSecurityConfiguration(ctx context.Context, enterprise string, configurationID int64, defaultForNewRepos string) (*CodeSecurityConfigurationWithDefaultForNewRepos, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/code-security/configurations/%v/defaults\", enterprise, configurationID)\n\ttype configParam struct {\n\t\tDefaultForNewRepos string `json:\"default_for_new_repos\"`\n\t}\n\n\treq, err := s.client.NewRequest(\"PUT\", u, configParam{DefaultForNewRepos: defaultForNewRepos})\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tvar config *CodeSecurityConfigurationWithDefaultForNewRepos\n\tresp, err := s.client.Do(ctx, req, &config)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn config, resp, nil\n}\n\n// ListCodeSecurityConfigurationRepositories lists the repositories associated with an enterprise code security configuration.\n//\n// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-repositories-associated-with-an-enterprise-code-security-configuration\n//\n//meta:operation GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories\nfunc (s *EnterpriseService) ListCodeSecurityConfigurationRepositories(ctx context.Context, enterprise string, configurationID int64, opts *ListCodeSecurityConfigurationRepositoriesOptions) ([]*RepositoryAttachment, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/code-security/configurations/%v/repositories\", enterprise, configurationID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tvar attachments []*RepositoryAttachment\n\tresp, err := s.client.Do(ctx, req, &attachments)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn attachments, resp, nil\n}\n"
  },
  {
    "path": "github/enterprise_codesecurity_configurations_test.go",
    "content": "// Copyright 2024 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestEnterpriseService_ListCodeSecurityConfigurations(t *testing.T) {\n\tt.Parallel()\n\topts := &ListEnterpriseCodeSecurityConfigurationOptions{Before: \"1\", After: \"2\", PerPage: 30}\n\tctx := t.Context()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/code-security/configurations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"before\": \"1\", \"after\": \"2\", \"per_page\": \"30\"})\n\t\tfmt.Fprint(w, `[\n\t\t{\n\t\t\t\"id\":1,\n\t\t\t\"name\":\"config1\",\n\t\t\t\"description\":\"desc1\",\n\t\t\t\"code_scanning_default_setup\": \"enabled\"\n\t\t},\n\t\t{\n\t\t\t\"id\":2,\n\t\t\t\"name\":\"config2\",\n\t\t\t\"description\":\"desc2\",\n\t\t\t\"private_vulnerability_reporting\": \"enabled\"\n\t\t}]`)\n\t})\n\n\tconfigurations, _, err := client.Enterprise.ListCodeSecurityConfigurations(ctx, \"e\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.ListCodeSecurityConfigurations returned error: %v\", err)\n\t}\n\n\twant := []*CodeSecurityConfiguration{\n\t\t{ID: Ptr(int64(1)), Name: \"config1\", Description: \"desc1\", CodeScanningDefaultSetup: Ptr(\"enabled\")},\n\t\t{ID: Ptr(int64(2)), Name: \"config2\", Description: \"desc2\", PrivateVulnerabilityReporting: Ptr(\"enabled\")},\n\t}\n\tif !cmp.Equal(configurations, want) {\n\t\tt.Errorf(\"Enterprise.ListCodeSecurityConfigurations returned %+v, want %+v\", configurations, want)\n\t}\n\tconst methodName = \"ListCodeSecurityConfigurations\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.ListCodeSecurityConfigurations(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ListCodeSecurityConfigurations(ctx, \"e\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_GetCodeSecurityConfiguration(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tctx := t.Context()\n\n\tmux.HandleFunc(\"/enterprises/e/code-security/configurations/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\":1,\n\t\t\t\"name\":\"config1\",\n\t\t\t\"description\":\"desc1\",\n\t\t\t\"code_scanning_default_setup\": \"enabled\"\n\t\t}`)\n\t})\n\n\tconfiguration, _, err := client.Enterprise.GetCodeSecurityConfiguration(ctx, \"e\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.GetCodeSecurityConfiguration returned error: %v\", err)\n\t}\n\n\twant := &CodeSecurityConfiguration{ID: Ptr(int64(1)), Name: \"config1\", Description: \"desc1\", CodeScanningDefaultSetup: Ptr(\"enabled\")}\n\tif !cmp.Equal(configuration, want) {\n\t\tt.Errorf(\"Enterprise.GetCodeSecurityConfiguration returned %+v, want %+v\", configuration, want)\n\t}\n\n\tconst methodName = \"GetCodeSecurityConfiguration\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.GetCodeSecurityConfiguration(ctx, \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetCodeSecurityConfiguration(ctx, \"e\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_CreateCodeSecurityConfiguration(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tctx := t.Context()\n\n\tinput := CodeSecurityConfiguration{\n\t\tName:                     \"config1\",\n\t\tDescription:              \"desc1\",\n\t\tCodeScanningDefaultSetup: Ptr(\"enabled\"),\n\t}\n\n\tmux.HandleFunc(\"/enterprises/e/code-security/configurations\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v CodeSecurityConfiguration\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Enterprise.CreateCodeSecurityConfiguration request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\":1,\n\t\t\t\"name\":\"config1\",\n\t\t\t\"description\":\"desc1\",\n\t\t\t\"code_scanning_default_setup\": \"enabled\"\n\t\t}`)\n\t})\n\n\tconfiguration, _, err := client.Enterprise.CreateCodeSecurityConfiguration(ctx, \"e\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.CreateCodeSecurityConfiguration returned error: %v\", err)\n\t}\n\n\twant := &CodeSecurityConfiguration{ID: Ptr(int64(1)), Name: \"config1\", Description: \"desc1\", CodeScanningDefaultSetup: Ptr(\"enabled\")}\n\tif !cmp.Equal(configuration, want) {\n\t\tt.Errorf(\"Enterprise.CreateCodeSecurityConfiguration returned %+v, want %+v\", configuration, want)\n\t}\n\n\tconst methodName = \"CreateCodeSecurityConfiguration\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.CreateCodeSecurityConfiguration(ctx, \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.CreateCodeSecurityConfiguration(ctx, \"e\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_ListDefaultCodeSecurityConfigurations(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tctx := t.Context()\n\n\tmux.HandleFunc(\"/enterprises/e/code-security/configurations/defaults\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[\n\t\t{\n\t\t\t\"default_for_new_repos\": \"public\",\n\t\t\t\"configuration\": {\n\t\t\t\t\"id\":1,\n\t\t\t\t\"name\":\"config1\",\n\t\t\t\t\"description\":\"desc1\",\n\t\t\t\t\"code_scanning_default_setup\": \"enabled\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"default_for_new_repos\": \"private_and_internal\",\n\t\t\t\"configuration\": {\n\t\t\t\t\"id\":2,\n\t\t\t\t\"name\":\"config2\",\n\t\t\t\t\"description\":\"desc2\",\n\t\t\t\t\"private_vulnerability_reporting\": \"enabled\"\n\t\t\t}\n\t\t}\n\t]`)\n\t})\n\n\tconfigurations, _, err := client.Enterprise.ListDefaultCodeSecurityConfigurations(ctx, \"e\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.ListDefaultCodeSecurityConfigurations returned error: %v\", err)\n\t}\n\n\twant := []*CodeSecurityConfigurationWithDefaultForNewRepos{\n\t\t{DefaultForNewRepos: Ptr(\"public\"), Configuration: &CodeSecurityConfiguration{ID: Ptr(int64(1)), Name: \"config1\", Description: \"desc1\", CodeScanningDefaultSetup: Ptr(\"enabled\")}},\n\t\t{DefaultForNewRepos: Ptr(\"private_and_internal\"), Configuration: &CodeSecurityConfiguration{ID: Ptr(int64(2)), Name: \"config2\", Description: \"desc2\", PrivateVulnerabilityReporting: Ptr(\"enabled\")}},\n\t}\n\tif !cmp.Equal(configurations, want) {\n\t\tt.Errorf(\"Enterprise.ListDefaultCodeSecurityConfigurations returned %+v, want %+v\", configurations, want)\n\t}\n\n\tconst methodName = \"ListDefaultCodeSecurityConfigurations\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.ListDefaultCodeSecurityConfigurations(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ListDefaultCodeSecurityConfigurations(ctx, \"e\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_UpdateCodeSecurityConfiguration(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\tclient, mux, _ := setup(t)\n\n\tinput := CodeSecurityConfiguration{\n\t\tName:                     \"config1\",\n\t\tDescription:              \"desc1\",\n\t\tCodeScanningDefaultSetup: Ptr(\"enabled\"),\n\t}\n\n\tmux.HandleFunc(\"/enterprises/e/code-security/configurations/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v CodeSecurityConfiguration\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Enterprise.UpdateCodeSecurityConfiguration request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\":1,\n\t\t\t\"name\":\"config1\",\n\t\t\t\"description\":\"desc1\",\n\t\t\t\"code_scanning_default_setup\": \"enabled\"\n\t\t}`)\n\t})\n\n\tconfiguration, _, err := client.Enterprise.UpdateCodeSecurityConfiguration(ctx, \"e\", 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.UpdateCodeSecurityConfiguration returned error: %v\", err)\n\t}\n\n\twant := &CodeSecurityConfiguration{ID: Ptr(int64(1)), Name: \"config1\", Description: \"desc1\", CodeScanningDefaultSetup: Ptr(\"enabled\")}\n\tif !cmp.Equal(configuration, want) {\n\t\tt.Errorf(\"Enterprise.UpdateCodeSecurityConfiguration returned %+v, want %+v\", configuration, want)\n\t}\n\n\tconst methodName = \"UpdateCodeSecurityConfiguration\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.UpdateCodeSecurityConfiguration(ctx, \"\\n\", -1, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.UpdateCodeSecurityConfiguration(ctx, \"e\", 1, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_DeleteCodeSecurityConfiguration(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/code-security/configurations/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tresp, err := client.Enterprise.DeleteCodeSecurityConfiguration(ctx, \"e\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.DeleteCodeSecurityConfiguration returned error: %v\", err)\n\t}\n\n\twant := http.StatusNoContent\n\tif resp.StatusCode != want {\n\t\tt.Errorf(\"Enterprise.DeleteCodeSecurityConfiguration returned status %v, want %v\", resp.StatusCode, want)\n\t}\n\n\tconst methodName = \"DeleteCodeSecurityConfiguration\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Enterprise.DeleteCodeSecurityConfiguration(ctx, \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tresp, err := client.Enterprise.DeleteCodeSecurityConfiguration(ctx, \"e\", 1)\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_AttachCodeSecurityConfigurationToRepositories(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/code-security/configurations/1/attach\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttype request struct {\n\t\t\tScope string `json:\"scope\"`\n\t\t}\n\t\tvar v *request\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\t\tif v.Scope != \"all_without_configurations\" {\n\t\t\tt.Errorf(\"Enterprise.AttachCodeSecurityConfigurationToRepositories request body scope = %v, want selected\", v.Scope)\n\t\t}\n\t\tw.WriteHeader(http.StatusAccepted)\n\t})\n\n\tresp, err := client.Enterprise.AttachCodeSecurityConfigurationToRepositories(ctx, \"e\", int64(1), \"all_without_configurations\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.AttachCodeSecurityConfigurationToRepositories returned error: %v\", err)\n\t}\n\n\twant := http.StatusAccepted\n\tif resp.StatusCode != want {\n\t\tt.Errorf(\"Enterprise.AttachCodeSecurityConfigurationToRepositories returned status %v, want %v\", resp.StatusCode, want)\n\t}\n\n\tconst methodName = \"AttachCodeSecurityConfigurationToRepositories\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Enterprise.AttachCodeSecurityConfigurationToRepositories(ctx, \"\\n\", -1, \"\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tresp, err := client.Enterprise.AttachCodeSecurityConfigurationToRepositories(ctx, \"e\", 1, \"all_without_configurations\")\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_SetDefaultCodeSecurityConfiguration(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/code-security/configurations/1/defaults\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tfmt.Fprint(w, `\n\t\t{\n\t\t\t\"default_for_new_repos\": \"all\",\n\t\t\t\"configuration\":\n\t\t\t\t{\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"name\": \"config1\",\n\t\t\t\t\t\"description\": \"desc1\",\n\t\t\t\t\t\"code_scanning_default_setup\": \"enabled\"\n\t\t\t\t}\n\t\t}`)\n\t})\n\tgot, resp, err := client.Enterprise.SetDefaultCodeSecurityConfiguration(ctx, \"e\", 1, \"all\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.SetDefaultCodeSecurityConfiguration returned error: %v\", err)\n\t}\n\twantStatus := http.StatusOK\n\tif resp.StatusCode != wantStatus {\n\t\tt.Errorf(\"Enterprise.SetDefaultCodeSecurityConfiguration returned status %v, want %v\", resp.StatusCode, wantStatus)\n\t}\n\twant := &CodeSecurityConfigurationWithDefaultForNewRepos{\n\t\tDefaultForNewRepos: Ptr(\"all\"),\n\t\tConfiguration: &CodeSecurityConfiguration{\n\t\t\tID: Ptr(int64(1)), Name: \"config1\", Description: \"desc1\", CodeScanningDefaultSetup: Ptr(\"enabled\"),\n\t\t},\n\t}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Enterprise.SetDefaultCodeSecurityConfiguration returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"SetDefaultCodeSecurityConfiguration\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.SetDefaultCodeSecurityConfiguration(ctx, \"\\n\", -1, \"\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.SetDefaultCodeSecurityConfiguration(ctx, \"e\", 1, \"all\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_ListCodeSecurityConfigurationRepositories(t *testing.T) {\n\tt.Parallel()\n\topts := &ListCodeSecurityConfigurationRepositoriesOptions{Before: \"1\", After: \"2\", PerPage: 30, Status: \"attached\"}\n\tctx := t.Context()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/code-security/configurations/1/repositories\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"before\": \"1\", \"after\": \"2\", \"per_page\": \"30\", \"status\": \"attached\"})\n\t\tfmt.Fprint(w, `[\n\t\t{\n\t\t\t\"status\": \"attached\",\n\t\t\t\"repository\": {\n\t\t\t\t\"id\":8,\n\t\t\t\t\"name\":\"repo8\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"status\": \"attached\",\n\t\t\t\"repository\": {\n\t\t\t\t\"id\":42,\n\t\t\t\t\"name\":\"repo42\"\n\t\t\t}\n\t\t}\n\t]`)\n\t})\n\n\tattachments, _, err := client.Enterprise.ListCodeSecurityConfigurationRepositories(ctx, \"e\", 1, opts)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.ListCodeSecurityConfigurationRepositories returned error: %v\", err)\n\t}\n\twant := []*RepositoryAttachment{\n\t\t{Status: Ptr(\"attached\"), Repository: &Repository{ID: Ptr(int64(8)), Name: Ptr(\"repo8\")}},\n\t\t{Status: Ptr(\"attached\"), Repository: &Repository{ID: Ptr(int64(42)), Name: Ptr(\"repo42\")}},\n\t}\n\tif !cmp.Equal(attachments, want) {\n\t\tt.Errorf(\"Enterprise.ListCodeSecurityConfigurationRepositories returned %+v, want %+v\", attachments, want)\n\t}\n\n\tconst methodName = \"ListCodeSecurityConfigurationRepositories\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.ListCodeSecurityConfigurationRepositories(ctx, \"\\n\", -1, opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ListCodeSecurityConfigurationRepositories(ctx, \"e\", 1, opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/enterprise_licenses.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// EnterpriseConsumedLicenses represents information about users with consumed enterprise licenses.\ntype EnterpriseConsumedLicenses struct {\n\tTotalSeatsConsumed  int                        `json:\"total_seats_consumed\"`\n\tTotalSeatsPurchased int                        `json:\"total_seats_purchased\"`\n\tUsers               []*EnterpriseLicensedUsers `json:\"users,omitempty\"`\n}\n\n// EnterpriseLicensedUsers represents a user with license information in an enterprise.\ntype EnterpriseLicensedUsers struct {\n\tGithubComLogin                  string   `json:\"github_com_login\"`\n\tGithubComName                   *string  `json:\"github_com_name\"`\n\tEnterpriseServerUserIDs         []string `json:\"enterprise_server_user_ids,omitempty\"`\n\tGithubComUser                   bool     `json:\"github_com_user\"`\n\tEnterpriseServerUser            *bool    `json:\"enterprise_server_user\"`\n\tVisualStudioSubscriptionUser    bool     `json:\"visual_studio_subscription_user\"`\n\tLicenseType                     string   `json:\"license_type\"`\n\tGithubComProfile                *string  `json:\"github_com_profile\"`\n\tGithubComMemberRoles            []string `json:\"github_com_member_roles,omitempty\"`\n\tGithubComEnterpriseRoles        []string `json:\"github_com_enterprise_roles,omitempty\"`\n\tGithubComVerifiedDomainEmails   []string `json:\"github_com_verified_domain_emails,omitempty\"`\n\tGithubComSamlNameID             *string  `json:\"github_com_saml_name_id\"`\n\tGithubComOrgsWithPendingInvites []string `json:\"github_com_orgs_with_pending_invites,omitempty\"`\n\tGithubComTwoFactorAuth          *bool    `json:\"github_com_two_factor_auth\"`\n\tEnterpriseServerEmails          []string `json:\"enterprise_server_emails,omitempty\"`\n\tVisualStudioLicenseStatus       *string  `json:\"visual_studio_license_status\"`\n\tVisualStudioSubscriptionEmail   *string  `json:\"visual_studio_subscription_email\"`\n\tTotalUserAccounts               int      `json:\"total_user_accounts\"`\n}\n\n// EnterpriseLicenseSyncStatus represents the synchronization status of\n// GitHub Enterprise Server instances with an enterprise account.\ntype EnterpriseLicenseSyncStatus struct {\n\tTitle       string                    `json:\"title\"`\n\tDescription string                    `json:\"description\"`\n\tProperties  *ServerInstanceProperties `json:\"properties,omitempty\"`\n}\n\n// ServerInstanceProperties contains the collection of server instances.\ntype ServerInstanceProperties struct {\n\tServerInstances *ServerInstances `json:\"server_instances,omitempty\"`\n}\n\n// ServerInstances represents a collection of GitHub Enterprise Server instances\n// and their synchronization status.\ntype ServerInstances struct {\n\tType  string                `json:\"type\"`\n\tItems *ServiceInstanceItems `json:\"items,omitempty\"`\n}\n\n// ServiceInstanceItems defines the structure and properties of individual server instances\n// in the collection.\ntype ServiceInstanceItems struct {\n\tType       string                `json:\"type\"`\n\tProperties *ServerItemProperties `json:\"properties,omitempty\"`\n}\n\n// ServerItemProperties represents the properties of a GitHub Enterprise Server instance,\n// including its identifier, hostname, and last synchronization status.\ntype ServerItemProperties struct {\n\tServerID string           `json:\"server_id\"`\n\tHostname string           `json:\"hostname\"`\n\tLastSync *LastLicenseSync `json:\"last_sync,omitempty\"`\n}\n\n// LastLicenseSync contains information about the most recent license synchronization\n// attempt for a server instance.\ntype LastLicenseSync struct {\n\tType       string                     `json:\"type\"`\n\tProperties *LastLicenseSyncProperties `json:\"properties,omitempty\"`\n}\n\n// LastLicenseSyncProperties represents the details of the last synchronization attempt,\n// including the date, status, and any error that occurred.\ntype LastLicenseSyncProperties struct {\n\tDate   *Timestamp `json:\"date,omitempty\"`\n\tStatus string     `json:\"status\"`\n\tError  string     `json:\"error\"`\n}\n\n// GetConsumedLicenses collect information about the number of consumed licenses and a collection with all the users with consumed enterprise licenses.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/licensing#list-enterprise-consumed-licenses\n//\n//meta:operation GET /enterprises/{enterprise}/consumed-licenses\nfunc (s *EnterpriseService) GetConsumedLicenses(ctx context.Context, enterprise string, opts *ListOptions) (*EnterpriseConsumedLicenses, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/consumed-licenses\", enterprise)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar consumedLicenses *EnterpriseConsumedLicenses\n\tresp, err := s.client.Do(ctx, req, &consumedLicenses)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn consumedLicenses, resp, nil\n}\n\n// GetLicenseSyncStatus collects information about the status of a license sync job for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/licensing#get-a-license-sync-status\n//\n//meta:operation GET /enterprises/{enterprise}/license-sync-status\nfunc (s *EnterpriseService) GetLicenseSyncStatus(ctx context.Context, enterprise string) (*EnterpriseLicenseSyncStatus, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/license-sync-status\", enterprise)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar syncStatus *EnterpriseLicenseSyncStatus\n\tresp, err := s.client.Do(ctx, req, &syncStatus)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn syncStatus, resp, nil\n}\n"
  },
  {
    "path": "github/enterprise_licenses_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestEnterpriseService_GetConsumedLicenses(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/consumed-licenses\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\", \"per_page\": \"10\"})\n\t\tfmt.Fprint(w, `{\n\t\t\t\"total_seats_consumed\": 20,\n\t\t\t\"total_seats_purchased\": 25,\n\t\t\t\"users\": [{\n\t\t\t\t\"github_com_login\": \"user1\",\n\t\t\t\t\"github_com_name\": \"User One\",\n\t\t\t\t\"enterprise_server_user_ids\": [\"123\", \"456\"],\n\t\t\t\t\"github_com_user\": true,\n\t\t\t\t\"enterprise_server_user\": false,\n\t\t\t\t\"visual_studio_subscription_user\": false,\n\t\t\t\t\"license_type\": \"Enterprise\",\n\t\t\t\t\"github_com_profile\": \"https://github.com/user1\",\n\t\t\t\t\"github_com_member_roles\": [\"member\"],\n\t\t\t\t\"github_com_enterprise_roles\": [\"member\"],\n\t\t\t\t\"github_com_verified_domain_emails\": [\"user1@example.com\"],\n\t\t\t\t\"github_com_saml_name_id\": \"saml123\",\n\t\t\t\t\"github_com_orgs_with_pending_invites\": [],\n\t\t\t\t\"github_com_two_factor_auth\": true,\n\t\t\t\t\"enterprise_server_emails\": [\"user1@example.com\"],\n\t\t\t\t\"visual_studio_license_status\": \"active\",\n\t\t\t\t\"visual_studio_subscription_email\": \"user1@example.com\",\n\t\t\t\t\"total_user_accounts\": 1\n\t\t\t}]\n\t\t}`)\n\t})\n\n\topt := &ListOptions{Page: 2, PerPage: 10}\n\tctx := t.Context()\n\tlicenses, _, err := client.Enterprise.GetConsumedLicenses(ctx, \"e\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.GetConsumedLicenses returned error: %v\", err)\n\t}\n\n\tuserName := \"User One\"\n\tserverUser := false\n\tprofile := \"https://github.com/user1\"\n\tsamlNameID := \"saml123\"\n\ttwoFactorAuth := true\n\tlicenseStatus := \"active\"\n\tvsEmail := \"user1@example.com\"\n\n\twant := &EnterpriseConsumedLicenses{\n\t\tTotalSeatsConsumed:  20,\n\t\tTotalSeatsPurchased: 25,\n\t\tUsers: []*EnterpriseLicensedUsers{\n\t\t\t{\n\t\t\t\tGithubComLogin:                  \"user1\",\n\t\t\t\tGithubComName:                   &userName,\n\t\t\t\tEnterpriseServerUserIDs:         []string{\"123\", \"456\"},\n\t\t\t\tGithubComUser:                   true,\n\t\t\t\tEnterpriseServerUser:            &serverUser,\n\t\t\t\tVisualStudioSubscriptionUser:    false,\n\t\t\t\tLicenseType:                     \"Enterprise\",\n\t\t\t\tGithubComProfile:                &profile,\n\t\t\t\tGithubComMemberRoles:            []string{\"member\"},\n\t\t\t\tGithubComEnterpriseRoles:        []string{\"member\"},\n\t\t\t\tGithubComVerifiedDomainEmails:   []string{\"user1@example.com\"},\n\t\t\t\tGithubComSamlNameID:             &samlNameID,\n\t\t\t\tGithubComOrgsWithPendingInvites: []string{},\n\t\t\t\tGithubComTwoFactorAuth:          &twoFactorAuth,\n\t\t\t\tEnterpriseServerEmails:          []string{\"user1@example.com\"},\n\t\t\t\tVisualStudioLicenseStatus:       &licenseStatus,\n\t\t\t\tVisualStudioSubscriptionEmail:   &vsEmail,\n\t\t\t\tTotalUserAccounts:               1,\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(licenses, want) {\n\t\tt.Errorf(\"Enterprise.GetConsumedLicenses returned %+v, want %+v\", licenses, want)\n\t}\n\n\tconst methodName = \"GetConsumedLicenses\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.GetConsumedLicenses(ctx, \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetConsumedLicenses(ctx, \"e\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_GetLicenseSyncStatus(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/license-sync-status\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"title\": \"Enterprise License Sync Status\",\n\t\t\t\"description\": \"Status of license synchronization\",\n\t\t\t\"properties\": {\n\t\t\t\t\"server_instances\": {\n\t\t\t\t\t\"type\": \"array\",\n\t\t\t\t\t\"items\": {\n\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\"server_id\": \"ghes-1\",\n\t\t\t\t\t\t\t\"hostname\": \"github.enterprise.local\",\n\t\t\t\t\t\t\t\"last_sync\": {\n\t\t\t\t\t\t\t\t\"type\": \"object\",\n\t\t\t\t\t\t\t\t\"properties\": {\n\t\t\t\t\t\t\t\t\t\"date\": \"2025-10-30T10:30:00Z\",\n\t\t\t\t\t\t\t\t\t\"status\": \"success\",\n\t\t\t\t\t\t\t\t\t\"error\": \"\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tsyncStatus, _, err := client.Enterprise.GetLicenseSyncStatus(ctx, \"e\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.GetLicenseSyncStatus returned error: %v\", err)\n\t}\n\n\twant := &EnterpriseLicenseSyncStatus{\n\t\tTitle:       \"Enterprise License Sync Status\",\n\t\tDescription: \"Status of license synchronization\",\n\t\tProperties: &ServerInstanceProperties{\n\t\t\tServerInstances: &ServerInstances{\n\t\t\t\tType: \"array\",\n\t\t\t\tItems: &ServiceInstanceItems{\n\t\t\t\t\tType: \"object\",\n\t\t\t\t\tProperties: &ServerItemProperties{\n\t\t\t\t\t\tServerID: \"ghes-1\",\n\t\t\t\t\t\tHostname: \"github.enterprise.local\",\n\t\t\t\t\t\tLastSync: &LastLicenseSync{\n\t\t\t\t\t\t\tType: \"object\",\n\t\t\t\t\t\t\tProperties: &LastLicenseSyncProperties{\n\t\t\t\t\t\t\t\tDate:   &Timestamp{time.Date(2025, 10, 30, 10, 30, 0, 0, time.UTC)},\n\t\t\t\t\t\t\t\tStatus: \"success\",\n\t\t\t\t\t\t\t\tError:  \"\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(syncStatus, want) {\n\t\tt.Errorf(\"Enterprise.GetLicenseSyncStatus returned %+v, want %+v\", syncStatus, want)\n\t}\n\n\tconst methodName = \"GetLicenseSyncStatus\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.GetLicenseSyncStatus(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetLicenseSyncStatus(ctx, \"e\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/enterprise_manage_ghes.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n)\n\n// NodeQueryOptions specifies the optional parameters to the EnterpriseService\n// Node management APIs.\ntype NodeQueryOptions struct {\n\t// UUID filters issues based on the node UUID.\n\tUUID *string `url:\"uuid,omitempty\"`\n\n\t// ClusterRoles filters the cluster roles from the cluster configuration file.\n\tClusterRoles *string `url:\"cluster_roles,omitempty\"`\n}\n\n// ClusterStatus represents a response from the ClusterStatus and ReplicationStatus methods.\ntype ClusterStatus struct {\n\tStatus *string              `json:\"status,omitempty\"`\n\tNodes  []*ClusterStatusNode `json:\"nodes\"`\n}\n\n// ClusterStatusNode represents the status of a cluster node.\ntype ClusterStatusNode struct {\n\tHostname *string                         `json:\"hostname,omitempty\"`\n\tStatus   *string                         `json:\"status,omitempty\"`\n\tServices []*ClusterStatusNodeServiceItem `json:\"services\"`\n}\n\n// ClusterStatusNodeServiceItem represents the status of a service running on a cluster node.\ntype ClusterStatusNodeServiceItem struct {\n\tStatus  *string `json:\"status,omitempty\"`\n\tName    *string `json:\"name,omitempty\"`\n\tDetails *string `json:\"details,omitempty\"`\n}\n\n// SystemRequirements represents a response from the CheckSystemRequirements method.\ntype SystemRequirements struct {\n\tStatus *string                   `json:\"status,omitempty\"`\n\tNodes  []*SystemRequirementsNode `json:\"nodes\"`\n}\n\n// SystemRequirementsNode represents the status of a system node.\ntype SystemRequirementsNode struct {\n\tHostname    *string                             `json:\"hostname,omitempty\"`\n\tStatus      *string                             `json:\"status,omitempty\"`\n\tRolesStatus []*SystemRequirementsNodeRoleStatus `json:\"roles_status\"`\n}\n\n// SystemRequirementsNodeRoleStatus represents the status of a role on a system node.\ntype SystemRequirementsNodeRoleStatus struct {\n\tStatus *string `json:\"status,omitempty\"`\n\tRole   *string `json:\"role,omitempty\"`\n}\n\n// NodeReleaseVersion represents a response from the GetNodeReleaseVersions method.\ntype NodeReleaseVersion struct {\n\tHostname *string         `json:\"hostname,omitempty\"`\n\tVersion  *ReleaseVersion `json:\"version\"`\n}\n\n// ReleaseVersion holds the release version information of the node.\ntype ReleaseVersion struct {\n\tVersion   *string `json:\"version,omitempty\"`\n\tPlatform  *string `json:\"platform,omitempty\"`\n\tBuildID   *string `json:\"build_id,omitempty\"`\n\tBuildDate *string `json:\"build_date,omitempty\"`\n}\n\n// CheckSystemRequirements checks if GHES system nodes meet the system requirements.\n//\n// 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\n//\n//meta:operation GET /manage/v1/checks/system-requirements\nfunc (s *EnterpriseService) CheckSystemRequirements(ctx context.Context) (*SystemRequirements, *Response, error) {\n\tu := \"manage/v1/checks/system-requirements\"\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar systemRequirements *SystemRequirements\n\tresp, err := s.client.Do(ctx, req, &systemRequirements)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn systemRequirements, resp, nil\n}\n\n// ClusterStatus gets the status of all services running on each cluster node.\n//\n// 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\n//\n//meta:operation GET /manage/v1/cluster/status\nfunc (s *EnterpriseService) ClusterStatus(ctx context.Context) (*ClusterStatus, *Response, error) {\n\tu := \"manage/v1/cluster/status\"\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar clusterStatus *ClusterStatus\n\tresp, err := s.client.Do(ctx, req, &clusterStatus)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn clusterStatus, resp, nil\n}\n\n// ReplicationStatus gets the status of all services running on each replica node.\n//\n// 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\n//\n//meta:operation GET /manage/v1/replication/status\nfunc (s *EnterpriseService) ReplicationStatus(ctx context.Context, opts *NodeQueryOptions) (*ClusterStatus, *Response, error) {\n\tu, err := addOptions(\"manage/v1/replication/status\", opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar status *ClusterStatus\n\tresp, err := s.client.Do(ctx, req, &status)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn status, resp, nil\n}\n\n// GetNodeReleaseVersions gets the version information deployed to each node.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes\n//\n//meta:operation GET /manage/v1/version\nfunc (s *EnterpriseService) GetNodeReleaseVersions(ctx context.Context, opts *NodeQueryOptions) ([]*NodeReleaseVersion, *Response, error) {\n\tu, err := addOptions(\"manage/v1/version\", opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar releaseVersions []*NodeReleaseVersion\n\tresp, err := s.client.Do(ctx, req, &releaseVersions)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn releaseVersions, resp, nil\n}\n"
  },
  {
    "path": "github/enterprise_manage_ghes_config.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"errors\"\n)\n\n// ConfigApplyOptions is a struct to hold the options for the ConfigApply API and the response.\ntype ConfigApplyOptions struct {\n\t// RunID is the ID of the run to get the status of. If empty a random one will be generated.\n\tRunID *string `json:\"run_id,omitempty\"`\n}\n\n// ConfigApplyStatus is a struct to hold the response from the ConfigApply API.\ntype ConfigApplyStatus struct {\n\tRunning    *bool                    `json:\"running,omitempty\"`\n\tSuccessful *bool                    `json:\"successful,omitempty\"`\n\tNodes      []*ConfigApplyStatusNode `json:\"nodes\"`\n}\n\n// ConfigApplyStatusNode is a struct to hold the response from the ConfigApply API.\ntype ConfigApplyStatusNode struct {\n\tHostname   *string `json:\"hostname,omitempty\"`\n\tRunning    *bool   `json:\"running,omitempty\"`\n\tSuccessful *bool   `json:\"successful,omitempty\"`\n\tRunID      *string `json:\"run_id,omitempty\"`\n}\n\n// ConfigApplyEventsOptions is used to enable pagination.\ntype ConfigApplyEventsOptions struct {\n\tLastRequestID *string `url:\"last_request_id,omitempty\"`\n}\n\n// ConfigApplyEvents is a struct to hold the response from the ConfigApplyEvents API.\ntype ConfigApplyEvents struct {\n\tNodes []*ConfigApplyEventsNode `json:\"nodes\"`\n}\n\n// ConfigApplyEventsNode is a struct to hold the response from the ConfigApplyEvents API.\ntype ConfigApplyEventsNode struct {\n\tNode          *string                       `json:\"node,omitempty\"`\n\tLastRequestID *string                       `json:\"last_request_id,omitempty\"`\n\tEvents        []*ConfigApplyEventsNodeEvent `json:\"events\"`\n}\n\n// ConfigApplyEventsNodeEvent is a struct to hold the response from the ConfigApplyEvents API.\ntype ConfigApplyEventsNodeEvent struct {\n\tTimestamp    *Timestamp `json:\"timestamp,omitempty\"`\n\tSeverityText *string    `json:\"severity_text,omitempty\"`\n\tBody         *string    `json:\"body,omitempty\"`\n\tEventName    *string    `json:\"event_name,omitempty\"`\n\tTopology     *string    `json:\"topology,omitempty\"`\n\tHostname     *string    `json:\"hostname,omitempty\"`\n\tConfigRunID  *string    `json:\"config_run_id,omitempty\"`\n\tTraceID      *string    `json:\"trace_id,omitempty\"`\n\tSpanID       *string    `json:\"span_id,omitempty\"`\n\tSpanParentID *int64     `json:\"span_parent_id,omitempty\"`\n\tSpanDepth    *int       `json:\"span_depth,omitempty\"`\n}\n\n// InitialConfigOptions represents the payload for initializing instance configuration.\ntype InitialConfigOptions struct {\n\tLicense  string `json:\"license\"`\n\tPassword string `json:\"password\"`\n}\n\n// LicenseStatus is a struct to hold the response from the License API.\ntype LicenseStatus struct {\n\tAdvancedSecurityEnabled      *bool      `json:\"advancedSecurityEnabled,omitempty\"`\n\tAdvancedSecuritySeats        *int       `json:\"advancedSecuritySeats,omitempty\"`\n\tClusterSupport               *bool      `json:\"clusterSupport,omitempty\"`\n\tCompany                      *string    `json:\"company,omitempty\"`\n\tCroquetSupport               *bool      `json:\"croquetSupport,omitempty\"`\n\tCustomTerms                  *bool      `json:\"customTerms,omitempty\"`\n\tEvaluation                   *bool      `json:\"evaluation,omitempty\"`\n\tExpireAt                     *Timestamp `json:\"expireAt,omitempty\"`\n\tInsightsEnabled              *bool      `json:\"insightsEnabled,omitempty\"`\n\tInsightsExpireAt             *Timestamp `json:\"insightsExpireAt,omitempty\"`\n\tLearningLabEvaluationExpires *Timestamp `json:\"learningLabEvaluationExpires,omitempty\"`\n\tLearningLabSeats             *int       `json:\"learningLabSeats,omitempty\"`\n\tPerpetual                    *bool      `json:\"perpetual,omitempty\"`\n\tReferenceNumber              *string    `json:\"referenceNumber,omitempty\"`\n\tSeats                        *int       `json:\"seats,omitempty\"`\n\tSSHAllowed                   *bool      `json:\"sshAllowed,omitempty\"`\n\tSupportKey                   *string    `json:\"supportKey,omitempty\"`\n\tUnlimitedSeating             *bool      `json:\"unlimitedSeating,omitempty\"`\n}\n\n// UploadLicenseOptions is a struct to hold the options for the UploadLicense API.\ntype UploadLicenseOptions struct {\n\tLicense string `url:\"license\"`\n}\n\n// LicenseCheck is a struct to hold the response from the LicenseStatus API.\ntype LicenseCheck struct {\n\tStatus *string `json:\"status,omitempty\"`\n}\n\n// ConfigSettings is a struct to hold the response from the Settings API.\n// There are many fields that link to other structs.\ntype ConfigSettings struct {\n\tPrivateMode           *bool                          `json:\"private_mode,omitempty\"`\n\tPublicPages           *bool                          `json:\"public_pages,omitempty\"`\n\tSubdomainIsolation    *bool                          `json:\"subdomain_isolation,omitempty\"`\n\tSignupEnabled         *bool                          `json:\"signup_enabled,omitempty\"`\n\tGithubHostname        *string                        `json:\"github_hostname,omitempty\"`\n\tIdenticonsHost        *string                        `json:\"identicons_host,omitempty\"`\n\tHTTPProxy             *string                        `json:\"http_proxy,omitempty\"`\n\tAuthMode              *string                        `json:\"auth_mode,omitempty\"`\n\tExpireSessions        *bool                          `json:\"expire_sessions,omitempty\"`\n\tAdminPassword         *string                        `json:\"admin_password,omitempty\"`\n\tConfigurationID       *int64                         `json:\"configuration_id,omitempty\"`\n\tConfigurationRunCount *int                           `json:\"configuration_run_count,omitempty\"`\n\tAvatar                *ConfigSettingsAvatar          `json:\"avatar,omitempty\"`\n\tCustomer              *ConfigSettingsCustomer        `json:\"customer,omitempty\"`\n\tLicense               *ConfigSettingsLicenseSettings `json:\"license,omitempty\"`\n\tGithubSSL             *ConfigSettingsGithubSSL       `json:\"github_ssl,omitempty\"`\n\tLDAP                  *ConfigSettingsLDAP            `json:\"ldap,omitempty\"`\n\tCAS                   *ConfigSettingsCAS             `json:\"cas,omitempty\"`\n\tSAML                  *ConfigSettingsSAML            `json:\"saml,omitempty\"`\n\tGithubOAuth           *ConfigSettingsGithubOAuth     `json:\"github_oauth,omitempty\"`\n\tSMTP                  *ConfigSettingsSMTP            `json:\"smtp,omitempty\"`\n\tNTP                   *ConfigSettingsNTP             `json:\"ntp,omitempty\"`\n\tTimezone              *string                        `json:\"timezone,omitempty\"`\n\tSNMP                  *ConfigSettingsSNMP            `json:\"snmp,omitempty\"`\n\tSyslog                *ConfigSettingsSyslog          `json:\"syslog,omitempty\"`\n\tAssets                *string                        `json:\"assets,omitempty\"`\n\tPages                 *ConfigSettingsPagesSettings   `json:\"pages,omitempty\"`\n\tCollectd              *ConfigSettingsCollectd        `json:\"collectd,omitempty\"`\n\tMapping               *ConfigSettingsMapping         `json:\"mapping,omitempty\"`\n\tLoadBalancer          *string                        `json:\"load_balancer,omitempty\"`\n}\n\n// ConfigSettingsAvatar is a struct to hold the response from the Settings API.\ntype ConfigSettingsAvatar struct {\n\tEnabled *bool   `json:\"enabled,omitempty\"`\n\tURI     *string `json:\"uri,omitempty\"`\n}\n\n// ConfigSettingsCustomer is a struct to hold the response from the Settings API.\ntype ConfigSettingsCustomer struct {\n\tName          *string `json:\"name,omitempty\"`\n\tEmail         *string `json:\"email,omitempty\"`\n\tUUID          *string `json:\"uuid,omitempty\"`\n\tSecret        *string `json:\"secret,omitempty\"`\n\tPublicKeyData *string `json:\"public_key_data,omitempty\"`\n}\n\n// ConfigSettingsLicenseSettings is a struct to hold the response from the Settings API.\ntype ConfigSettingsLicenseSettings struct {\n\tSeats            *int       `json:\"seats,omitempty\"`\n\tEvaluation       *bool      `json:\"evaluation,omitempty\"`\n\tPerpetual        *bool      `json:\"perpetual,omitempty\"`\n\tUnlimitedSeating *bool      `json:\"unlimited_seating,omitempty\"`\n\tSupportKey       *string    `json:\"support_key,omitempty\"`\n\tSSHAllowed       *bool      `json:\"ssh_allowed,omitempty\"`\n\tClusterSupport   *bool      `json:\"cluster_support,omitempty\"`\n\tExpireAt         *Timestamp `json:\"expire_at,omitempty\"`\n}\n\n// ConfigSettingsGithubSSL is a struct to hold the response from the Settings API.\ntype ConfigSettingsGithubSSL struct {\n\tEnabled *bool   `json:\"enabled,omitempty\"`\n\tCert    *string `json:\"cert,omitempty\"`\n\tKey     *string `json:\"key,omitempty\"`\n}\n\n// ConfigSettingsLDAP is a struct to hold the response from the Settings API.\ntype ConfigSettingsLDAP struct {\n\tHost                    *string                           `json:\"host,omitempty\"`\n\tPort                    *int                              `json:\"port,omitempty\"`\n\tBase                    []string                          `json:\"base,omitempty\"`\n\tUID                     *string                           `json:\"uid,omitempty\"`\n\tBindDN                  *string                           `json:\"bind_dn,omitempty\"`\n\tPassword                *string                           `json:\"password,omitempty\"`\n\tMethod                  *string                           `json:\"method,omitempty\"`\n\tSearchStrategy          *string                           `json:\"search_strategy,omitempty\"`\n\tUserGroups              []string                          `json:\"user_groups,omitempty\"`\n\tAdminGroup              *string                           `json:\"admin_group,omitempty\"`\n\tVirtualAttributeEnabled *bool                             `json:\"virtual_attribute_enabled,omitempty\"`\n\tRecursiveGroupSearch    *bool                             `json:\"recursive_group_search,omitempty\"`\n\tPosixSupport            *bool                             `json:\"posix_support,omitempty\"`\n\tUserSyncEmails          *bool                             `json:\"user_sync_emails,omitempty\"`\n\tUserSyncKeys            *bool                             `json:\"user_sync_keys,omitempty\"`\n\tUserSyncInterval        *int                              `json:\"user_sync_interval,omitempty\"`\n\tTeamSyncInterval        *int                              `json:\"team_sync_interval,omitempty\"`\n\tSyncEnabled             *bool                             `json:\"sync_enabled,omitempty\"`\n\tReconciliation          *ConfigSettingsLDAPReconciliation `json:\"reconciliation,omitempty\"`\n\tProfile                 *ConfigSettingsLDAPProfile        `json:\"profile,omitempty\"`\n}\n\n// ConfigSettingsLDAPReconciliation is part of the ConfigSettingsLDAP struct.\ntype ConfigSettingsLDAPReconciliation struct {\n\tUser *string `json:\"user,omitempty\"`\n\tOrg  *string `json:\"org,omitempty\"`\n}\n\n// ConfigSettingsLDAPProfile is part of the ConfigSettingsLDAP struct.\ntype ConfigSettingsLDAPProfile struct {\n\tUID  *string `json:\"uid,omitempty\"`\n\tName *string `json:\"name,omitempty\"`\n\tMail *string `json:\"mail,omitempty\"`\n\tKey  *string `json:\"key,omitempty\"`\n}\n\n// ConfigSettingsCAS is a struct to hold the response from the Settings API.\ntype ConfigSettingsCAS struct {\n\tURL *string `json:\"url,omitempty\"`\n}\n\n// ConfigSettingsSAML is a struct to hold the response from the Settings API.\ntype ConfigSettingsSAML struct {\n\tSSOURL             *string `json:\"sso_url,omitempty\"`\n\tCertificate        *string `json:\"certificate,omitempty\"`\n\tCertificatePath    *string `json:\"certificate_path,omitempty\"`\n\tIssuer             *string `json:\"issuer,omitempty\"`\n\tIDPInitiatedSSO    *bool   `json:\"idp_initiated_sso,omitempty\"`\n\tDisableAdminDemote *bool   `json:\"disable_admin_demote,omitempty\"`\n}\n\n// ConfigSettingsGithubOAuth is a struct to hold the response from the Settings API.\ntype ConfigSettingsGithubOAuth struct {\n\tClientID         *string `json:\"client_id,omitempty\"`\n\tClientSecret     *string `json:\"client_secret,omitempty\"`\n\tOrganizationName *string `json:\"organization_name,omitempty\"`\n\tOrganizationTeam *string `json:\"organization_team,omitempty\"`\n}\n\n// ConfigSettingsSMTP is a struct to hold the response from the Settings API.\ntype ConfigSettingsSMTP struct {\n\tEnabled                 *bool   `json:\"enabled,omitempty\"`\n\tAddress                 *string `json:\"address,omitempty\"`\n\tAuthentication          *string `json:\"authentication,omitempty\"`\n\tPort                    *string `json:\"port,omitempty\"`\n\tDomain                  *string `json:\"domain,omitempty\"`\n\tUsername                *string `json:\"username,omitempty\"`\n\tUserName                *string `json:\"user_name,omitempty\"`\n\tEnableStarttlsAuto      *bool   `json:\"enable_starttls_auto,omitempty\"`\n\tPassword                *string `json:\"password,omitempty\"`\n\tDiscardToNoreplyAddress *bool   `json:\"discard-to-noreply-address,omitempty\"`\n\tSupportAddress          *string `json:\"support_address,omitempty\"`\n\tSupportAddressType      *string `json:\"support_address_type,omitempty\"`\n\tNoreplyAddress          *string `json:\"noreply_address,omitempty\"`\n}\n\n// ConfigSettingsNTP is a struct to hold the response from the Settings API.\ntype ConfigSettingsNTP struct {\n\tPrimaryServer   *string `json:\"primary_server,omitempty\"`\n\tSecondaryServer *string `json:\"secondary_server,omitempty\"`\n}\n\n// ConfigSettingsSNMP is a struct to hold the response from the Settings API.\ntype ConfigSettingsSNMP struct {\n\tEnabled   *bool   `json:\"enabled,omitempty\"`\n\tCommunity *string `json:\"community,omitempty\"`\n}\n\n// ConfigSettingsSyslog is a struct to hold the response from the Settings API.\ntype ConfigSettingsSyslog struct {\n\tEnabled      *bool   `json:\"enabled,omitempty\"`\n\tServer       *string `json:\"server,omitempty\"`\n\tProtocolName *string `json:\"protocol_name,omitempty\"`\n}\n\n// ConfigSettingsPagesSettings is a struct to hold the response from the Settings API.\ntype ConfigSettingsPagesSettings struct {\n\tEnabled *bool `json:\"enabled,omitempty\"`\n}\n\n// ConfigSettingsCollectd is a struct to hold the response from the Settings API.\ntype ConfigSettingsCollectd struct {\n\tEnabled    *bool   `json:\"enabled,omitempty\"`\n\tServer     *string `json:\"server,omitempty\"`\n\tPort       *int    `json:\"port,omitempty\"`\n\tEncryption *string `json:\"encryption,omitempty\"`\n\tUsername   *string `json:\"username,omitempty\"`\n\tPassword   *string `json:\"password,omitempty\"`\n}\n\n// ConfigSettingsMapping is a struct to hold the response from the Settings API.\ntype ConfigSettingsMapping struct {\n\tEnabled    *bool   `json:\"enabled,omitempty\"`\n\tTileserver *string `json:\"tileserver,omitempty\"`\n\tBasemap    *string `json:\"basemap,omitempty\"`\n\tToken      *string `json:\"token,omitempty\"`\n}\n\n// NodeMetadataStatus is a struct to hold the response from the NodeMetadata API.\ntype NodeMetadataStatus struct {\n\tTopology *string        `json:\"topology,omitempty\"`\n\tNodes    []*NodeDetails `json:\"nodes\"`\n}\n\n// NodeDetails is a struct to hold the response from the NodeMetadata API.\ntype NodeDetails struct {\n\tHostname     *string  `json:\"hostname,omitempty\"`\n\tUUID         *string  `json:\"uuid,omitempty\"`\n\tClusterRoles []string `json:\"cluster_roles,omitempty\"`\n}\n\n// ConfigApplyEvents gets events from the command ghe-config-apply.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#list-events-from-ghe-config-apply\n//\n//meta:operation GET /manage/v1/config/apply/events\nfunc (s *EnterpriseService) ConfigApplyEvents(ctx context.Context, opts *ConfigApplyEventsOptions) (*ConfigApplyEvents, *Response, error) {\n\tu, err := addOptions(\"manage/v1/config/apply/events\", opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar configApplyEvents *ConfigApplyEvents\n\tresp, err := s.client.Do(ctx, req, &configApplyEvents)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn configApplyEvents, resp, nil\n}\n\n// InitialConfig initializes the GitHub Enterprise instance with a license and password.\n// After initializing the instance, you need to run an apply to apply the configuration.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#initialize-instance-configuration-with-license-and-password\n//\n//meta:operation POST /manage/v1/config/init\nfunc (s *EnterpriseService) InitialConfig(ctx context.Context, license, password string) (*Response, error) {\n\tu := \"manage/v1/config/init\"\n\n\tpayload := &InitialConfigOptions{\n\t\tLicense:  license,\n\t\tPassword: password,\n\t}\n\n\treq, err := s.client.NewRequest(\"POST\", u, payload)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// License gets the current license information for the GitHub Enterprise instance.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-the-enterprise-license-information\n//\n//meta:operation GET /manage/v1/config/license\nfunc (s *EnterpriseService) License(ctx context.Context) ([]*LicenseStatus, *Response, error) {\n\tu := \"manage/v1/config/license\"\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar licenseStatus []*LicenseStatus\n\tresp, err := s.client.Do(ctx, req, &licenseStatus)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn licenseStatus, resp, nil\n}\n\n// UploadLicense uploads a new license to the GitHub Enterprise instance.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#upload-an-enterprise-license\n//\n//meta:operation PUT /manage/v1/config/license\nfunc (s *EnterpriseService) UploadLicense(ctx context.Context, license string) (*Response, error) {\n\tu := \"manage/v1/config/license\"\n\topts := &UploadLicenseOptions{\n\t\tLicense: license,\n\t}\n\treq, err := s.client.NewRequest(\"PUT\", u, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// LicenseStatus gets the current license status for the GitHub Enterprise instance.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#check-a-license\n//\n//meta:operation GET /manage/v1/config/license/check\nfunc (s *EnterpriseService) LicenseStatus(ctx context.Context) ([]*LicenseCheck, *Response, error) {\n\tu := \"manage/v1/config/license/check\"\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar checks []*LicenseCheck\n\tresp, err := s.client.Do(ctx, req, &checks)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn checks, resp, nil\n}\n\n// NodeMetadata gets the metadata for all nodes in the GitHub Enterprise instance.\n// This is required for clustered setups.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes\n//\n//meta:operation GET /manage/v1/config/nodes\nfunc (s *EnterpriseService) NodeMetadata(ctx context.Context, opts *NodeQueryOptions) (*NodeMetadataStatus, *Response, error) {\n\tu, err := addOptions(\"manage/v1/config/nodes\", opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar status *NodeMetadataStatus\n\tresp, err := s.client.Do(ctx, req, &status)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn status, resp, nil\n}\n\n// Settings gets the current configuration settings for the GitHub Enterprise instance.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-the-ghes-settings\n//\n//meta:operation GET /manage/v1/config/settings\nfunc (s *EnterpriseService) Settings(ctx context.Context) (*ConfigSettings, *Response, error) {\n\tu := \"manage/v1/config/settings\"\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar configSettings *ConfigSettings\n\tresp, err := s.client.Do(ctx, req, &configSettings)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn configSettings, resp, nil\n}\n\n// UpdateSettings updates the configuration settings for the GitHub Enterprise instance.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#set-settings\n//\n//meta:operation PUT /manage/v1/config/settings\nfunc (s *EnterpriseService) UpdateSettings(ctx context.Context, opts *ConfigSettings) (*Response, error) {\n\tu := \"manage/v1/config/settings\"\n\n\tif opts == nil {\n\t\treturn nil, errors.New(\"opts should not be nil\")\n\t}\n\treq, err := s.client.NewRequest(\"PUT\", u, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// ConfigApply triggers a configuration apply run on the GitHub Enterprise instance.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#trigger-a-ghe-config-apply-run\n//\n//meta:operation POST /manage/v1/config/apply\nfunc (s *EnterpriseService) ConfigApply(ctx context.Context, opts *ConfigApplyOptions) (*ConfigApplyOptions, *Response, error) {\n\tu := \"manage/v1/config/apply\"\n\treq, err := s.client.NewRequest(\"POST\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar configApplyOptions *ConfigApplyOptions\n\tresp, err := s.client.Do(ctx, req, &configApplyOptions)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn configApplyOptions, resp, nil\n}\n\n// ConfigApplyStatus gets the status of a ghe-config-apply run on the GitHub Enterprise instance.\n// You can request lat one or specific id one.\n//\n// 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\n//\n//meta:operation GET /manage/v1/config/apply\nfunc (s *EnterpriseService) ConfigApplyStatus(ctx context.Context, opts *ConfigApplyOptions) (*ConfigApplyStatus, *Response, error) {\n\tu := \"manage/v1/config/apply\"\n\treq, err := s.client.NewRequest(\"GET\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar status *ConfigApplyStatus\n\tresp, err := s.client.Do(ctx, req, &status)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn status, resp, nil\n}\n"
  },
  {
    "path": "github/enterprise_manage_ghes_config_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestEnterpriseService_Settings(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/manage/v1/config/settings\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"private_mode\": false,\n\t\t\t\"public_pages\": false,\n\t\t\t\"subdomain_isolation\": true,\n\t\t\t\"signup_enabled\": false,\n\t\t\t\"github_hostname\": \"ghe.local\",\n\t\t\t\"identicons_host\": \"dotcom\",\n\t\t\t\"http_proxy\": null,\n\t\t\t\"auth_mode\": \"default\",\n\t\t\t\"expire_sessions\": false,\n\t\t\t\"admin_password\": null,\n\t\t\t\"configuration_id\": 1401777404,\n\t\t\t\"configuration_run_count\": 4,\n\t\t\t\"avatar\": {\n\t\t\t\t\"enabled\": false,\n\t\t\t\t\"uri\": \"\"\n\t\t\t},\n\t\t\t\"customer\": {\n\t\t\t\t\"name\": \"GitHub\",\n\t\t\t\t\"email\": \"stannis\",\n\t\t\t\t\"uuid\": \"af6cac80-e4e1-012e-d822-1231380e52e9\",\n\t\t\t\t\"secret_key_data\": \"-\",\n\t\t\t\t\"public_key_data\": \"-\"\n\t\t\t},\n\t\t\t\"license\": {\n\t\t\t\t\"seats\": 0,\n\t\t\t\t\"evaluation\": false,\n\t\t\t\t\"perpetual\": false,\n\t\t\t\t\"unlimited_seating\": true,\n\t\t\t\t\"support_key\": \"ssh-rsa AAAAB3N....\",\n\t\t\t\t\"ssh_allowed\": true,\n\t\t\t\t\"cluster_support\": false,\n\t\t\t\t\"expire_at\": \"2018-01-01T00:00:00-00:00\"\n\t\t\t},\n\t\t\t\"github_ssl\": {\n\t\t\t\t\"enabled\": false,\n\t\t\t\t\"cert\": null,\n\t\t\t\t\"key\": null\n\t\t\t},\n\t\t\t\"ldap\": {\n\t\t\t\t\"host\": null,\n\t\t\t\t\"port\": 0,\n\t\t\t\t\"base\": [],\n\t\t\t\t\"uid\": null,\n\t\t\t\t\"bind_dn\": null,\n\t\t\t\t\"password\": null,\n\t\t\t\t\"method\": \"Plain\",\n\t\t\t\t\"search_strategy\": \"detect\",\n\t\t\t\t\"user_groups\": [],\n\t\t\t\t\"admin_group\": null,\n\t\t\t\t\"virtual_attribute_enabled\": false,\n\t\t\t\t\"recursive_group_search\": false,\n\t\t\t\t\"posix_support\": true,\n\t\t\t\t\"user_sync_emails\": false,\n\t\t\t\t\"user_sync_keys\": false,\n\t\t\t\t\"user_sync_interval\": 4,\n\t\t\t\t\"team_sync_interval\": 4,\n\t\t\t\t\"sync_enabled\": false,\n\t\t\t\t\"reconciliation\": {\n\t\t\t\t\"user\": null,\n\t\t\t\t\"org\": null\n\t\t\t\t},\n\t\t\t\t\"profile\": {\n\t\t\t\t\"uid\": \"uid\",\n\t\t\t\t\"name\": null,\n\t\t\t\t\"mail\": null,\n\t\t\t\t\"key\": null\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"cas\": {\n\t\t\t\t\"url\": null\n\t\t\t},\n\t\t\t\"saml\": {\n\t\t\t\t\"sso_url\": null,\n\t\t\t\t\"certificate\": null,\n\t\t\t\t\"certificate_path\": null,\n\t\t\t\t\"issuer\": null,\n\t\t\t\t\"idp_initiated_sso\": false,\n\t\t\t\t\"disable_admin_demote\": false\n\t\t\t},\n\t\t\t\"github_oauth\": {\n\t\t\t\t\"client_id\": \"12313412\",\n\t\t\t\t\"client_secret\": \"kj123131132\",\n\t\t\t\t\"organization_name\": \"Homestar Runners\",\n\t\t\t\t\"organization_team\": \"homestarrunners/characters\"\n\t\t\t},\n\t\t\t\"smtp\": {\n\t\t\t\t\"enabled\": true,\n\t\t\t\t\"address\": \"smtp.example.com\",\n\t\t\t\t\"authentication\": \"plain\",\n\t\t\t\t\"port\": \"1234\",\n\t\t\t\t\"domain\": \"blah\",\n\t\t\t\t\"username\": \"foo\",\n\t\t\t\t\"user_name\": \"mr_foo\",\n\t\t\t\t\"enable_starttls_auto\": true,\n\t\t\t\t\"password\": \"bar\",\n\t\t\t\t\"discard-to-noreply-address\": true,\n\t\t\t\t\"support_address\": \"enterprise@github.com\",\n\t\t\t\t\"support_address_type\": \"email\",\n\t\t\t\t\"noreply_address\": \"noreply@github.com\"\n\t\t\t},\n\t\t\t\"ntp\": {\n\t\t\t\t\"primary_server\": \"example.com/primary\",\n\t\t\t\t\"secondary_server\": \"example.com/secondary\"\n\t\t\t},\n\t\t\t\"timezone\": null,\n\t\t\t\"snmp\": {\n\t\t\t\t\"enabled\": false,\n\t\t\t\t\"community\": \"\"\n\t\t\t},\n\t\t\t\"syslog\": {\n\t\t\t\t\"enabled\": false,\n\t\t\t\t\"server\": null,\n\t\t\t\t\"protocol_name\": \"udp\"\n\t\t\t},\n\t\t\t\"assets\": null,\n\t\t\t\"pages\": {\n\t\t\t\t\"enabled\": true\n\t\t\t},\n\t\t\t\"collectd\": {\n\t\t\t\t\"enabled\": false,\n\t\t\t\t\"server\": null,\n\t\t\t\t\"port\": 0,\n\t\t\t\t\"encryption\": null,\n\t\t\t\t\"username\": null,\n\t\t\t\t\"password\": null\n\t\t\t},\n\t\t\t\"mapping\": {\n\t\t\t\t\"enabled\": true,\n\t\t\t\t\"tileserver\": null,\n\t\t\t\t\"basemap\": \"company.map-qsz2zrvs\",\n\t\t\t\t\"token\": null\n\t\t\t},\n\t\t\t\"load_balancer\": null\n\t\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tconfigSettings, _, err := client.Enterprise.Settings(ctx)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.Settings returned error: %v\", err)\n\t}\n\n\twant := &ConfigSettings{\n\t\tPrivateMode:           Ptr(false),\n\t\tPublicPages:           Ptr(false),\n\t\tSubdomainIsolation:    Ptr(true),\n\t\tSignupEnabled:         Ptr(false),\n\t\tGithubHostname:        Ptr(\"ghe.local\"),\n\t\tIdenticonsHost:        Ptr(\"dotcom\"),\n\t\tHTTPProxy:             nil,\n\t\tAuthMode:              Ptr(\"default\"),\n\t\tExpireSessions:        Ptr(false),\n\t\tAdminPassword:         nil,\n\t\tConfigurationID:       Ptr(int64(1401777404)),\n\t\tConfigurationRunCount: Ptr(4),\n\t\tAvatar: &ConfigSettingsAvatar{\n\t\t\tEnabled: Ptr(false),\n\t\t\tURI:     Ptr(\"\"),\n\t\t},\n\t\tCustomer: &ConfigSettingsCustomer{\n\t\t\tName:          Ptr(\"GitHub\"),\n\t\t\tEmail:         Ptr(\"stannis\"),\n\t\t\tUUID:          Ptr(\"af6cac80-e4e1-012e-d822-1231380e52e9\"),\n\t\t\tSecret:        nil,\n\t\t\tPublicKeyData: Ptr(\"-\"),\n\t\t},\n\t\tLicense: &ConfigSettingsLicenseSettings{\n\t\t\tSeats:            Ptr(0),\n\t\t\tEvaluation:       Ptr(false),\n\t\t\tPerpetual:        Ptr(false),\n\t\t\tUnlimitedSeating: Ptr(true),\n\t\t\tSupportKey:       Ptr(\"ssh-rsa AAAAB3N....\"),\n\t\t\tSSHAllowed:       Ptr(true),\n\t\t\tClusterSupport:   Ptr(false),\n\t\t\tExpireAt:         &Timestamp{time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)},\n\t\t},\n\t\tGithubSSL: &ConfigSettingsGithubSSL{\n\t\t\tEnabled: Ptr(false),\n\t\t\tCert:    nil,\n\t\t\tKey:     nil,\n\t\t},\n\t\tLDAP: &ConfigSettingsLDAP{\n\t\t\tHost:                    nil,\n\t\t\tPort:                    Ptr(0),\n\t\t\tBase:                    []string{},\n\t\t\tUID:                     nil,\n\t\t\tBindDN:                  nil,\n\t\t\tPassword:                nil,\n\t\t\tMethod:                  Ptr(\"Plain\"),\n\t\t\tSearchStrategy:          Ptr(\"detect\"),\n\t\t\tUserGroups:              []string{},\n\t\t\tAdminGroup:              nil,\n\t\t\tVirtualAttributeEnabled: Ptr(false),\n\t\t\tRecursiveGroupSearch:    Ptr(false),\n\t\t\tPosixSupport:            Ptr(true),\n\t\t\tUserSyncEmails:          Ptr(false),\n\t\t\tUserSyncKeys:            Ptr(false),\n\t\t\tUserSyncInterval:        Ptr(4),\n\t\t\tTeamSyncInterval:        Ptr(4),\n\t\t\tSyncEnabled:             Ptr(false),\n\t\t\tReconciliation: &ConfigSettingsLDAPReconciliation{\n\t\t\t\tUser: nil,\n\t\t\t\tOrg:  nil,\n\t\t\t},\n\t\t\tProfile: &ConfigSettingsLDAPProfile{\n\t\t\t\tUID:  Ptr(\"uid\"),\n\t\t\t\tName: nil,\n\t\t\t\tMail: nil,\n\t\t\t\tKey:  nil,\n\t\t\t},\n\t\t},\n\t\tCAS: &ConfigSettingsCAS{\n\t\t\tURL: nil,\n\t\t},\n\t\tSAML: &ConfigSettingsSAML{\n\t\t\tSSOURL:             nil,\n\t\t\tCertificate:        nil,\n\t\t\tCertificatePath:    nil,\n\t\t\tIssuer:             nil,\n\t\t\tIDPInitiatedSSO:    Ptr(false),\n\t\t\tDisableAdminDemote: Ptr(false),\n\t\t},\n\t\tGithubOAuth: &ConfigSettingsGithubOAuth{\n\t\t\tClientID:         Ptr(\"12313412\"),\n\t\t\tClientSecret:     Ptr(\"kj123131132\"),\n\t\t\tOrganizationName: Ptr(\"Homestar Runners\"),\n\t\t\tOrganizationTeam: Ptr(\"homestarrunners/characters\"),\n\t\t},\n\t\tSMTP: &ConfigSettingsSMTP{\n\t\t\tEnabled:                 Ptr(true),\n\t\t\tAddress:                 Ptr(\"smtp.example.com\"),\n\t\t\tAuthentication:          Ptr(\"plain\"),\n\t\t\tPort:                    Ptr(\"1234\"),\n\t\t\tDomain:                  Ptr(\"blah\"),\n\t\t\tUsername:                Ptr(\"foo\"),\n\t\t\tUserName:                Ptr(\"mr_foo\"),\n\t\t\tPassword:                Ptr(\"bar\"),\n\t\t\tDiscardToNoreplyAddress: Ptr(true),\n\t\t\tSupportAddress:          Ptr(\"enterprise@github.com\"),\n\t\t\tSupportAddressType:      Ptr(\"email\"),\n\t\t\tNoreplyAddress:          Ptr(\"noreply@github.com\"),\n\t\t\tEnableStarttlsAuto:      Ptr(true),\n\t\t},\n\t\tNTP: &ConfigSettingsNTP{\n\t\t\tPrimaryServer:   Ptr(\"example.com/primary\"),\n\t\t\tSecondaryServer: Ptr(\"example.com/secondary\"),\n\t\t},\n\t\tTimezone: nil,\n\t\tSNMP: &ConfigSettingsSNMP{\n\t\t\tEnabled:   Ptr(false),\n\t\t\tCommunity: Ptr(\"\"),\n\t\t},\n\t\tSyslog: &ConfigSettingsSyslog{\n\t\t\tEnabled:      Ptr(false),\n\t\t\tServer:       nil,\n\t\t\tProtocolName: Ptr(\"udp\"),\n\t\t},\n\t\tAssets: nil,\n\t\tPages: &ConfigSettingsPagesSettings{\n\t\t\tEnabled: Ptr(true),\n\t\t},\n\t\tCollectd: &ConfigSettingsCollectd{\n\t\t\tEnabled:    Ptr(false),\n\t\t\tServer:     nil,\n\t\t\tPort:       Ptr(0),\n\t\t\tEncryption: nil,\n\t\t\tUsername:   nil,\n\t\t\tPassword:   nil,\n\t\t},\n\t\tMapping: &ConfigSettingsMapping{\n\t\t\tEnabled:    Ptr(true),\n\t\t\tTileserver: nil,\n\t\t\tBasemap:    Ptr(\"company.map-qsz2zrvs\"),\n\t\t\tToken:      nil,\n\t\t},\n\t\tLoadBalancer: nil,\n\t}\n\tif diff := cmp.Diff(want, configSettings); diff != \"\" {\n\t\tt.Errorf(\"diff mismatch (-want +got):\\n%v\", diff)\n\t}\n\n\tconst methodName = \"Settings\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.Settings(ctx)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_NodeMetadata(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/manage/v1/config/nodes\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"uuid\":          \"1234-1234\",\n\t\t\t\"cluster_roles\": \"primary\",\n\t\t})\n\t\tfmt.Fprint(w, `{\n\t\t\t\"topology\": \"Cluster\",\n\t\t\t\"nodes\": [{\n\t\t\t\t\"hostname\": \"data1\",\n\t\t\t\t\"uuid\": \"1b6cf518-f97c-11ed-8544-061d81f7eedb\",\n\t\t\t\t\"cluster_roles\": [\n\t\t\t\t\t\"ConsulServer\"\n\t\t\t\t]\n\t\t\t}]\n\t\t}`)\n\t})\n\n\topt := &NodeQueryOptions{\n\t\tUUID: Ptr(\"1234-1234\"), ClusterRoles: Ptr(\"primary\"),\n\t}\n\tctx := t.Context()\n\tconfigNodes, _, err := client.Enterprise.NodeMetadata(ctx, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.NodeMetadata returned error: %v\", err)\n\t}\n\n\twant := &NodeMetadataStatus{\n\t\tTopology: Ptr(\"Cluster\"),\n\t\tNodes: []*NodeDetails{{\n\t\t\tHostname: Ptr(\"data1\"),\n\t\t\tUUID:     Ptr(\"1b6cf518-f97c-11ed-8544-061d81f7eedb\"),\n\t\t\tClusterRoles: []string{\n\t\t\t\t\"ConsulServer\",\n\t\t\t},\n\t\t}},\n\t}\n\tif !cmp.Equal(configNodes, want) {\n\t\tt.Errorf(\"Enterprise.NodeMetadata returned %+v, want %+v\", configNodes, want)\n\t}\n\n\tconst methodName = \"NodeMetadata\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.NodeMetadata(ctx, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_LicenseStatus(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/manage/v1/config/license/check\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"status\": \"valid\"\n\t\t\t}]`)\n\t})\n\n\tctx := t.Context()\n\tlicenseCheck, _, err := client.Enterprise.LicenseStatus(ctx)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.LicenseStatus returned error: %v\", err)\n\t}\n\n\twant := []*LicenseCheck{{\n\t\tStatus: Ptr(\"valid\"),\n\t}}\n\tif !cmp.Equal(licenseCheck, want) {\n\t\tt.Errorf(\"Enterprise.LicenseStatus returned %+v, want %+v\", licenseCheck, want)\n\t}\n\n\tconst methodName = \"LicenseStatus\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.LicenseStatus(ctx)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_License(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/manage/v1/config/license\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"advancedSecurityEnabled\": true,\n\t\t\t\"advancedSecuritySeats\": 0,\n\t\t\t\"clusterSupport\": false,\n\t\t\t\"company\": \"GitHub\",\n\t\t\t\"croquetSupport\": true,\n\t\t\t\"customTerms\": true,\n\t\t\t\"evaluation\": false,\n\t\t\t\"expireAt\": \"2018-01-01T00:00:00Z\",\n\t\t\t\"insightsEnabled\": true,\n\t\t\t\"insightsExpireAt\": \"2018-01-01T00:00:00Z\",\n\t\t\t\"learningLabEvaluationExpires\": \"2018-01-01T00:00:00Z\",\n\t\t\t\"learningLabSeats\": 100,\n\t\t\t\"perpetual\": false,\n\t\t\t\"referenceNumber\": \"32a145\",\n\t\t\t\"seats\": 0,\n\t\t\t\"sshAllowed\": true,\n\t\t\t\"supportKey\": \"\",\n\t\t\t\"unlimitedSeating\": true\n\t\t}]`)\n\t})\n\n\tctx := t.Context()\n\tlicense, _, err := client.Enterprise.License(ctx)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.License returned error: %v\", err)\n\t}\n\n\twant := []*LicenseStatus{{\n\t\tAdvancedSecurityEnabled:      Ptr(true),\n\t\tAdvancedSecuritySeats:        Ptr(0),\n\t\tClusterSupport:               Ptr(false),\n\t\tCompany:                      Ptr(\"GitHub\"),\n\t\tCroquetSupport:               Ptr(true),\n\t\tCustomTerms:                  Ptr(true),\n\t\tEvaluation:                   Ptr(false),\n\t\tExpireAt:                     &Timestamp{time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)},\n\t\tInsightsEnabled:              Ptr(true),\n\t\tInsightsExpireAt:             &Timestamp{time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)},\n\t\tLearningLabEvaluationExpires: &Timestamp{time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)},\n\t\tLearningLabSeats:             Ptr(100),\n\t\tPerpetual:                    Ptr(false),\n\t\tReferenceNumber:              Ptr(\"32a145\"),\n\t\tSeats:                        Ptr(0),\n\t\tSSHAllowed:                   Ptr(true),\n\t\tSupportKey:                   Ptr(\"\"),\n\t\tUnlimitedSeating:             Ptr(true),\n\t}}\n\tif diff := cmp.Diff(want, license); diff != \"\" {\n\t\tt.Errorf(\"diff mismatch (-want +got):\\n%v\", diff)\n\t}\n\tconst methodName = \"License\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.License(ctx)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_ConfigApplyEvents(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/manage/v1/config/apply/events\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"nodes\": [{\n\t\t\t\t\"node\": \"ghes-01.lan\",\n\t\t\t\t\"last_request_id\": \"387cd628c06d606700e79be368e5e574:0cde553750689c76:0000000000000000\",\n\t\t\t\t\"events\": [{\n\t\t\t\t\t\"timestamp\": \"2018-01-01T00:00:00+00:00\",\n\t\t\t\t\t\"severity_text\": \"INFO\",\n\t\t\t\t\t\"body\": \"Validating services\",\n\t\t\t\t\t\"event_name\": \"Enterprise::ConfigApply::PhaseValidation#config_phase_validation\",\n\t\t\t\t\t\"topology\": \"multinode\",\n\t\t\t\t\t\"hostname\": \"ghes-01.lan\",\n\t\t\t\t\t\"config_run_id\": \"d34db33f\",\n\t\t\t\t\t\"trace_id\": \"387cd628c06d606700e79be368e5e574\",\n\t\t\t\t\t\"span_id\": \"0cde553750689c76\",\n\t\t\t\t\t\"span_parent_id\": 0,\n\t\t\t\t\t\"span_depth\": 0\n\t\t\t\t\t}]\n\t\t\t\t}]\n\t\t\t}`)\n\t})\n\n\tinput := &ConfigApplyEventsOptions{\n\t\tLastRequestID: Ptr(\"387cd628c06d606700e79be368e5e574:0cde553750689\"),\n\t}\n\n\tctx := t.Context()\n\tconfigEvents, _, err := client.Enterprise.ConfigApplyEvents(ctx, input)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.ConfigApplyEvents returned error: %v\", err)\n\t}\n\n\twant := &ConfigApplyEvents{\n\t\tNodes: []*ConfigApplyEventsNode{{\n\t\t\tNode:          Ptr(\"ghes-01.lan\"),\n\t\t\tLastRequestID: Ptr(\"387cd628c06d606700e79be368e5e574:0cde553750689c76:0000000000000000\"),\n\t\t\tEvents: []*ConfigApplyEventsNodeEvent{{\n\t\t\t\tTimestamp:    &Timestamp{time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)},\n\t\t\t\tSeverityText: Ptr(\"INFO\"),\n\t\t\t\tBody:         Ptr(\"Validating services\"),\n\t\t\t\tEventName:    Ptr(\"Enterprise::ConfigApply::PhaseValidation#config_phase_validation\"),\n\t\t\t\tTopology:     Ptr(\"multinode\"),\n\t\t\t\tHostname:     Ptr(\"ghes-01.lan\"),\n\t\t\t\tConfigRunID:  Ptr(\"d34db33f\"),\n\t\t\t\tTraceID:      Ptr(\"387cd628c06d606700e79be368e5e574\"),\n\t\t\t\tSpanID:       Ptr(\"0cde553750689c76\"),\n\t\t\t\tSpanParentID: Ptr(int64(0)),\n\t\t\t\tSpanDepth:    Ptr(0),\n\t\t\t}},\n\t\t}},\n\t}\n\tif diff := cmp.Diff(want, configEvents); diff != \"\" {\n\t\tt.Errorf(\"diff mismatch (-want +got):\\n%v\", diff)\n\t}\n\tif !cmp.Equal(configEvents, want) {\n\t\tt.Errorf(\"Enterprise.ConfigApplyEvents returned %+v, want %+v\", configEvents, want)\n\t}\n\n\tconst methodName = \"ConfigApplyEvents\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ConfigApplyEvents(ctx, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_UpdateSettings(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/manage/v1/config/settings\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tinput := &ConfigSettings{\n\t\tPrivateMode: Ptr(false),\n\t}\n\n\tctx := t.Context()\n\tif _, err := client.Enterprise.UpdateSettings(ctx, input); err != nil {\n\t\tt.Errorf(\"Enterprise.UpdateSettings returned error: %v\", err)\n\t}\n\n\tconst methodName = \"UpdateSettings\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Enterprise.UpdateSettings(ctx, nil)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Enterprise.UpdateSettings(ctx, input)\n\t})\n}\n\nfunc TestEnterpriseService_UploadLicense(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/manage/v1/config/license\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Enterprise.UploadLicense(ctx, \"abc\"); err != nil {\n\t\tt.Errorf(\"Enterprise.UploadLicense returned error: %v\", err)\n\t}\n\n\tconst methodName = \"UploadLicense\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Enterprise.UploadLicense(ctx, \"\")\n\t})\n}\n\nfunc TestEnterpriseService_InitialConfig(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &InitialConfigOptions{\n\t\tLicense:  \"1234-1234\",\n\t\tPassword: \"password\",\n\t}\n\n\tmux.HandleFunc(\"/manage/v1/config/init\", func(_ http.ResponseWriter, r *http.Request) {\n\t\tvar v *InitialConfigOptions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif diff := cmp.Diff(v, input); diff != \"\" {\n\t\t\tt.Errorf(\"diff mismatch (-want +got):\\n%v\", diff)\n\t\t}\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Enterprise.InitialConfig(ctx, \"1234-1234\", \"password\"); err != nil {\n\t\tt.Errorf(\"Enterprise.InitialConfig returned error: %v\", err)\n\t}\n\n\tconst methodName = \"InitialConfig\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Enterprise.InitialConfig(ctx, \"\", \"\")\n\t})\n}\n\nfunc TestEnterpriseService_ConfigApply(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/manage/v1/config/apply\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tvar got *ConfigApplyOptions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&got))\n\n\t\twant := &ConfigApplyOptions{\n\t\t\tRunID: Ptr(\"1234\"),\n\t\t}\n\t\tif diff := cmp.Diff(want, got); diff != \"\" {\n\t\t\tt.Errorf(\"diff mismatch (-want +got):\\n%v\", diff)\n\t\t}\n\t\tfmt.Fprint(w, `{ \"run_id\": \"1234\" }`)\n\t})\n\n\tinput := &ConfigApplyOptions{\n\t\tRunID: Ptr(\"1234\"),\n\t}\n\n\tctx := t.Context()\n\tconfigApply, _, err := client.Enterprise.ConfigApply(ctx, input)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.ConfigApply returned error: %v\", err)\n\t}\n\twant := &ConfigApplyOptions{\n\t\tRunID: Ptr(\"1234\"),\n\t}\n\tif !cmp.Equal(configApply, want) {\n\t\tt.Errorf(\"Enterprise.ConfigApply returned %+v, want %+v\", configApply, want)\n\t}\n\tconst methodName = \"ConfigApply\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ConfigApply(ctx, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_ConfigApplyStatus(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/manage/v1/config/apply\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tvar got *ConfigApplyOptions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&got))\n\n\t\twant := &ConfigApplyOptions{\n\t\t\tRunID: Ptr(\"1234\"),\n\t\t}\n\t\tif diff := cmp.Diff(want, got); diff != \"\" {\n\t\t\tt.Errorf(\"diff mismatch (-want +got):\\n%v\", diff)\n\t\t}\n\t\tfmt.Fprint(w, `{\n\t\t\t\"running\": true,\n\t\t\t\"successful\": false,\n\t\t\t\"nodes\": [\n\t\t\t\t{\n\t\t\t\t\"run_id\": \"d34db33f\",\n\t\t\t\t\"hostname\": \"ghes-01.lan\",\n\t\t\t\t\"running\": true,\n\t\t\t\t\"successful\": false\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\tinput := &ConfigApplyOptions{\n\t\tRunID: Ptr(\"1234\"),\n\t}\n\tctx := t.Context()\n\tconfigApplyStatus, _, err := client.Enterprise.ConfigApplyStatus(ctx, input)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.ConfigApplyStatus returned error: %v\", err)\n\t}\n\twant := &ConfigApplyStatus{\n\t\tRunning:    Ptr(true),\n\t\tSuccessful: Ptr(false),\n\t\tNodes: []*ConfigApplyStatusNode{{\n\t\t\tRunID:      Ptr(\"d34db33f\"),\n\t\t\tHostname:   Ptr(\"ghes-01.lan\"),\n\t\t\tRunning:    Ptr(true),\n\t\t\tSuccessful: Ptr(false),\n\t\t}},\n\t}\n\tif !cmp.Equal(configApplyStatus, want) {\n\t\tt.Errorf(\"Enterprise.ConfigApplyStatus returned %+v, want %+v\", configApplyStatus, want)\n\t}\n\tconst methodName = \"ConfigApplyStatus\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ConfigApplyStatus(ctx, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/enterprise_manage_ghes_maintenance.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n)\n\n// MaintenanceOperationStatus represents the message to be displayed when the instance gets a maintenance operation request.\ntype MaintenanceOperationStatus struct {\n\tHostname *string `json:\"hostname,omitempty\"`\n\tUUID     *string `json:\"uuid,omitempty\"`\n\tMessage  *string `json:\"message,omitempty\"`\n}\n\n// MaintenanceStatus represents the status of maintenance mode for all nodes.\ntype MaintenanceStatus struct {\n\tHostname               *string                  `json:\"hostname,omitempty\"`\n\tUUID                   *string                  `json:\"uuid,omitempty\"`\n\tStatus                 *string                  `json:\"status,omitempty\"`\n\tScheduledTime          *Timestamp               `json:\"scheduled_time,omitempty\"`\n\tConnectionServices     []*ConnectionServiceItem `json:\"connection_services,omitempty\"`\n\tCanUnsetMaintenance    *bool                    `json:\"can_unset_maintenance,omitempty\"`\n\tIPExceptionList        []string                 `json:\"ip_exception_list,omitempty\"`\n\tMaintenanceModeMessage *string                  `json:\"maintenance_mode_message,omitempty\"`\n}\n\n// ConnectionServiceItem represents the connection services for the maintenance status.\ntype ConnectionServiceItem struct {\n\tName   *string `json:\"name,omitempty\"`\n\tNumber *int    `json:\"number,omitempty\"`\n}\n\n// MaintenanceOptions represents the options for setting the maintenance mode for the instance.\n// When can be a string, so we can't use a Timestamp type.\ntype MaintenanceOptions struct {\n\tEnabled                bool     `json:\"enabled\"`\n\tUUID                   *string  `json:\"uuid,omitempty\"`\n\tWhen                   *string  `json:\"when,omitempty\"`\n\tIPExceptionList        []string `json:\"ip_exception_list,omitempty\"`\n\tMaintenanceModeMessage *string  `json:\"maintenance_mode_message,omitempty\"`\n}\n\n// GetMaintenanceStatus gets the status of maintenance mode for all nodes.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode\n//\n//meta:operation GET /manage/v1/maintenance\nfunc (s *EnterpriseService) GetMaintenanceStatus(ctx context.Context, opts *NodeQueryOptions) ([]*MaintenanceStatus, *Response, error) {\n\tu, err := addOptions(\"manage/v1/maintenance\", opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar status []*MaintenanceStatus\n\tresp, err := s.client.Do(ctx, req, &status)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn status, resp, nil\n}\n\n// CreateMaintenance sets the maintenance mode for the instance.\n// With the enable parameter we can control to put instance into maintenance mode or not. With false we can disable the maintenance mode.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode\n//\n//meta:operation POST /manage/v1/maintenance\nfunc (s *EnterpriseService) CreateMaintenance(ctx context.Context, enable bool, opts *MaintenanceOptions) ([]*MaintenanceOperationStatus, *Response, error) {\n\tu := \"manage/v1/maintenance\"\n\n\topts.Enabled = enable\n\n\treq, err := s.client.NewRequest(\"POST\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar i []*MaintenanceOperationStatus\n\tresp, err := s.client.Do(ctx, req, &i)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn i, resp, nil\n}\n"
  },
  {
    "path": "github/enterprise_manage_ghes_maintenance_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestEnterpriseService_GetMaintenanceStatus(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/manage/v1/maintenance\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"uuid\":          \"1234-1234\",\n\t\t\t\"cluster_roles\": \"primary\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"hostname\": \"primary\",\n\t\t\t\"uuid\": \"1b6cf518-f97c-11ed-8544-061d81f7eedb\",\n\t\t\t\"status\": \"scheduled\",\n\t\t\t\"scheduled_time\": \"2018-01-01T00:00:00+00:00\",\n\t\t\t\"connection_services\": [\n\t\t\t{\n\t\t\t\t\"name\": \"git operations\",\n\t\t\t\t\"number\": 15\n\t\t\t}\n\t\t\t],\n\t\t\t\"can_unset_maintenance\": true,\n\t\t\t\"ip_exception_list\": [\n\t\t\t\"1.1.1.1\"\n\t\t\t],\n\t\t\t\"maintenance_mode_message\": \"Scheduled maintenance for upgrading.\"\n\t\t}]`)\n\t})\n\n\topt := &NodeQueryOptions{\n\t\tUUID: Ptr(\"1234-1234\"), ClusterRoles: Ptr(\"primary\"),\n\t}\n\tctx := t.Context()\n\tmaintenanceStatus, _, err := client.Enterprise.GetMaintenanceStatus(ctx, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.GetMaintenanceStatus returned error: %v\", err)\n\t}\n\n\twant := []*MaintenanceStatus{{\n\t\tHostname:      Ptr(\"primary\"),\n\t\tUUID:          Ptr(\"1b6cf518-f97c-11ed-8544-061d81f7eedb\"),\n\t\tStatus:        Ptr(\"scheduled\"),\n\t\tScheduledTime: &Timestamp{time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)},\n\t\tConnectionServices: []*ConnectionServiceItem{{\n\t\t\tName:   Ptr(\"git operations\"),\n\t\t\tNumber: Ptr(15),\n\t\t}},\n\t\tCanUnsetMaintenance:    Ptr(true),\n\t\tIPExceptionList:        []string{\"1.1.1.1\"},\n\t\tMaintenanceModeMessage: Ptr(\"Scheduled maintenance for upgrading.\"),\n\t}}\n\tif !cmp.Equal(maintenanceStatus, want) {\n\t\tt.Errorf(\"Enterprise.GetMaintenanceStatus returned %+v, want %+v\", maintenanceStatus, want)\n\t}\n\n\tconst methodName = \"GetMaintenanceStatus\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetMaintenanceStatus(ctx, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_CreateMaintenance(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &MaintenanceOptions{\n\t\tEnabled: true,\n\t\tUUID:    Ptr(\"1234-1234\"),\n\t\tWhen:    Ptr(\"now\"),\n\t\tIPExceptionList: []string{\n\t\t\t\"1.1.1.1\",\n\t\t},\n\t\tMaintenanceModeMessage: Ptr(\"Scheduled maintenance for upgrading.\"),\n\t}\n\n\tmux.HandleFunc(\"/manage/v1/maintenance\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *MaintenanceOptions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `[ { \"hostname\": \"primary\", \"uuid\": \"1b6cf518-f97c-11ed-8544-061d81f7eedb\", \"message\": \"Scheduled maintenance for upgrading.\" } ]`)\n\t})\n\n\tctx := t.Context()\n\tmaintenanceStatus, _, err := client.Enterprise.CreateMaintenance(ctx, true, input)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.CreateMaintenance returned error: %v\", err)\n\t}\n\n\twant := []*MaintenanceOperationStatus{{Hostname: Ptr(\"primary\"), UUID: Ptr(\"1b6cf518-f97c-11ed-8544-061d81f7eedb\"), Message: Ptr(\"Scheduled maintenance for upgrading.\")}}\n\tif diff := cmp.Diff(want, maintenanceStatus); diff != \"\" {\n\t\tt.Errorf(\"diff mismatch (-want +got):\\n%v\", diff)\n\t}\n\n\tconst methodName = \"CreateMaintenance\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.CreateMaintenance(ctx, true, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/enterprise_manage_ghes_ssh.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n)\n\n// SSHKeyStatus represents the status of a SSH key operation.\ntype SSHKeyStatus struct {\n\tHostname *string `json:\"hostname,omitempty\"`\n\tUUID     *string `json:\"uuid,omitempty\"`\n\tMessage  *string `json:\"message,omitempty\"`\n\tModified *bool   `json:\"modified,omitempty\"`\n}\n\n// SSHKeyOptions specifies the parameters to the SSH create and delete functions.\ntype SSHKeyOptions struct {\n\t// Key is the SSH key to add to the instance.\n\tKey string `json:\"key\"`\n}\n\n// ClusterSSHKey represents the SSH keys configured for the instance.\ntype ClusterSSHKey struct {\n\tKey         *string `json:\"key,omitempty\"`\n\tFingerprint *string `json:\"fingerprint,omitempty\"`\n}\n\n// DeleteSSHKey deletes the SSH key from the instance.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#delete-a-ssh-key\n//\n//meta:operation DELETE /manage/v1/access/ssh\nfunc (s *EnterpriseService) DeleteSSHKey(ctx context.Context, key string) ([]*SSHKeyStatus, *Response, error) {\n\tu := \"manage/v1/access/ssh\"\n\topts := &SSHKeyOptions{\n\t\tKey: key,\n\t}\n\treq, err := s.client.NewRequest(\"DELETE\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar sshStatus []*SSHKeyStatus\n\tresp, err := s.client.Do(ctx, req, &sshStatus)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn sshStatus, resp, nil\n}\n\n// GetSSHKey gets the SSH keys configured for the instance.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-the-configured-ssh-keys\n//\n//meta:operation GET /manage/v1/access/ssh\nfunc (s *EnterpriseService) GetSSHKey(ctx context.Context) ([]*ClusterSSHKey, *Response, error) {\n\tu := \"manage/v1/access/ssh\"\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar sshKeys []*ClusterSSHKey\n\tresp, err := s.client.Do(ctx, req, &sshKeys)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn sshKeys, resp, nil\n}\n\n// CreateSSHKey adds a new SSH key to the instance.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#set-a-new-ssh-key\n//\n//meta:operation POST /manage/v1/access/ssh\nfunc (s *EnterpriseService) CreateSSHKey(ctx context.Context, key string) ([]*SSHKeyStatus, *Response, error) {\n\tu := \"manage/v1/access/ssh\"\n\topts := &SSHKeyOptions{\n\t\tKey: key,\n\t}\n\treq, err := s.client.NewRequest(\"POST\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar sshKeyResponse []*SSHKeyStatus\n\tresp, err := s.client.Do(ctx, req, &sshKeyResponse)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn sshKeyResponse, resp, nil\n}\n"
  },
  {
    "path": "github/enterprise_manage_ghes_ssh_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestEnterpriseService_GetSSHKey(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/manage/v1/access/ssh\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\n\t\t\t\t\"key\": \"ssh-rsa 1234\",\n\t\t\t\t\"fingerprint\": \"bd\"\n\t\t\t}]`)\n\t})\n\n\tctx := t.Context()\n\taccessSSH, _, err := client.Enterprise.GetSSHKey(ctx)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.GetSSHKey returned error: %v\", err)\n\t}\n\n\twant := []*ClusterSSHKey{{\n\t\tKey:         Ptr(\"ssh-rsa 1234\"),\n\t\tFingerprint: Ptr(\"bd\"),\n\t}}\n\tif !cmp.Equal(accessSSH, want) {\n\t\tt.Errorf(\"Enterprise.GetSSHKey returned %+v, want %+v\", accessSSH, want)\n\t}\n\n\tconst methodName = \"GetSSHKey\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetSSHKey(ctx)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_DeleteSSHKey(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &SSHKeyOptions{\n\t\tKey: \"ssh-rsa 1234\",\n\t}\n\n\tmux.HandleFunc(\"/manage/v1/access/ssh\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *SSHKeyOptions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `[ { \"hostname\": \"primary\", \"uuid\": \"1b6cf518-f97c-11ed-8544-061d81f7eedb\", \"message\": \"SSH key removed successfully\" } ]`)\n\t})\n\n\tctx := t.Context()\n\tsshStatus, _, err := client.Enterprise.DeleteSSHKey(ctx, \"ssh-rsa 1234\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.DeleteSSHKey returned error: %v\", err)\n\t}\n\n\twant := []*SSHKeyStatus{{Hostname: Ptr(\"primary\"), UUID: Ptr(\"1b6cf518-f97c-11ed-8544-061d81f7eedb\"), Message: Ptr(\"SSH key removed successfully\")}}\n\tif diff := cmp.Diff(want, sshStatus); diff != \"\" {\n\t\tt.Errorf(\"diff mismatch (-want +got):\\n%v\", diff)\n\t}\n\n\tconst methodName = \"DeleteSSHKey\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.DeleteSSHKey(ctx, \"ssh-rsa 1234\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_CreateSSHKey(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &SSHKeyOptions{\n\t\tKey: \"ssh-rsa 1234\",\n\t}\n\n\tmux.HandleFunc(\"/manage/v1/access/ssh\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *SSHKeyOptions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `[ { \"hostname\": \"primary\", \"uuid\": \"1b6cf518-f97c-11ed-8544-061d81f7eedb\", \"message\": \"SSH key added successfully\", \"modified\": true } ]`)\n\t})\n\n\tctx := t.Context()\n\tsshStatus, _, err := client.Enterprise.CreateSSHKey(ctx, \"ssh-rsa 1234\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.CreateSSHKey returned error: %v\", err)\n\t}\n\n\twant := []*SSHKeyStatus{{Hostname: Ptr(\"primary\"), UUID: Ptr(\"1b6cf518-f97c-11ed-8544-061d81f7eedb\"), Message: Ptr(\"SSH key added successfully\"), Modified: Ptr(true)}}\n\tif diff := cmp.Diff(want, sshStatus); diff != \"\" {\n\t\tt.Errorf(\"diff mismatch (-want +got):\\n%v\", diff)\n\t}\n\n\tconst methodName = \"CreateSSHKey\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.CreateSSHKey(ctx, \"ssh-rsa 1234\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/enterprise_manage_ghes_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestEnterpriseService_CheckSystemRequirements(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/manage/v1/checks/system-requirements\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"status\": \"OK\",\n\t\t\t\"nodes\": [{\n\t\t\t\t\"hostname\": \"primary\",\n\t\t\t\t\"status\": \"OK\",\n\t\t\t\t\"roles_status\": [{\n\t\t\t\t\t\"status\": \"OK\",\n\t\t\t\t\t\"role\": \"ConsulServer\"\n\t\t\t\t\t}\n\t\t\t\t]}\n\t\t\t]}`)\n\t})\n\n\tctx := t.Context()\n\tsystemRequirements, _, err := client.Enterprise.CheckSystemRequirements(ctx)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.CheckSystemRequirements returned error: %v\", err)\n\t}\n\n\twant := &SystemRequirements{\n\t\tStatus: Ptr(\"OK\"),\n\t\tNodes: []*SystemRequirementsNode{{\n\t\t\tHostname: Ptr(\"primary\"),\n\t\t\tStatus:   Ptr(\"OK\"),\n\t\t\tRolesStatus: []*SystemRequirementsNodeRoleStatus{{\n\t\t\t\tStatus: Ptr(\"OK\"),\n\t\t\t\tRole:   Ptr(\"ConsulServer\"),\n\t\t\t}},\n\t\t}},\n\t}\n\tif !cmp.Equal(systemRequirements, want) {\n\t\tt.Errorf(\"Enterprise.CheckSystemRequirements returned %+v, want %+v\", systemRequirements, want)\n\t}\n\n\tconst methodName = \"CheckSystemRequirements\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.CheckSystemRequirements(ctx)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_ClusterStatus(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/manage/v1/cluster/status\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n    \t\t\"status\": \"OK\",\n   \t\t\t\"nodes\": [{\n            \t\"hostname\": \"primary\",\n            \t\"status\": \"OK\",\n            \t\"services\": []\n        \t}]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tclusterStatus, _, err := client.Enterprise.ClusterStatus(ctx)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.ClusterStatus returned error: %v\", err)\n\t}\n\n\twant := &ClusterStatus{\n\t\tStatus: Ptr(\"OK\"),\n\t\tNodes: []*ClusterStatusNode{{\n\t\t\tHostname: Ptr(\"primary\"),\n\t\t\tStatus:   Ptr(\"OK\"),\n\t\t\tServices: []*ClusterStatusNodeServiceItem{},\n\t\t}},\n\t}\n\tif !cmp.Equal(clusterStatus, want) {\n\t\tt.Errorf(\"Enterprise.ClusterStatus returned %+v, want %+v\", clusterStatus, want)\n\t}\n\n\tconst methodName = \"ClusterStatus\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ClusterStatus(ctx)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_ReplicationStatus(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/manage/v1/replication/status\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"uuid\":          \"1234-1234\",\n\t\t\t\"cluster_roles\": \"primary\",\n\t\t})\n\t\tfmt.Fprint(w, `{\n    \t\t\"status\": \"OK\",\n   \t\t\t\"nodes\": [{\n            \t\"hostname\": \"primary\",\n            \t\"status\": \"OK\",\n            \t\"services\": []\n        \t}]\n\t\t}`)\n\t})\n\n\topt := &NodeQueryOptions{\n\t\tUUID: Ptr(\"1234-1234\"), ClusterRoles: Ptr(\"primary\"),\n\t}\n\tctx := t.Context()\n\treplicationStatus, _, err := client.Enterprise.ReplicationStatus(ctx, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.ReplicationStatus returned error: %v\", err)\n\t}\n\n\twant := &ClusterStatus{\n\t\tStatus: Ptr(\"OK\"),\n\t\tNodes: []*ClusterStatusNode{{\n\t\t\tHostname: Ptr(\"primary\"),\n\t\t\tStatus:   Ptr(\"OK\"),\n\t\t\tServices: []*ClusterStatusNodeServiceItem{},\n\t\t}},\n\t}\n\tif !cmp.Equal(replicationStatus, want) {\n\t\tt.Errorf(\"Enterprise.ReplicationStatus returned %+v, want %+v\", replicationStatus, want)\n\t}\n\n\tconst methodName = \"ReplicationStatus\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ReplicationStatus(ctx, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_Versions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/manage/v1/version\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"uuid\":          \"1234-1234\",\n\t\t\t\"cluster_roles\": \"primary\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\n    \t\t\"hostname\": \"primary\",\n   \t\t\t\"version\": {\n            \t\"version\": \"3.9.0\",\n            \t\"platform\": \"azure\",\n            \t\"build_id\": \"fc542058b5\",\n\t\t\t\t\"build_date\": \"2023-05-02\"\n        \t}\n\t\t}]`)\n\t})\n\n\topt := &NodeQueryOptions{\n\t\tUUID: Ptr(\"1234-1234\"), ClusterRoles: Ptr(\"primary\"),\n\t}\n\tctx := t.Context()\n\treleaseVersions, _, err := client.Enterprise.GetNodeReleaseVersions(ctx, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.GetNodeReleaseVersions returned error: %v\", err)\n\t}\n\n\twant := []*NodeReleaseVersion{{\n\t\tHostname: Ptr(\"primary\"),\n\t\tVersion: &ReleaseVersion{\n\t\t\tVersion:   Ptr(\"3.9.0\"),\n\t\t\tPlatform:  Ptr(\"azure\"),\n\t\t\tBuildID:   Ptr(\"fc542058b5\"),\n\t\t\tBuildDate: Ptr(\"2023-05-02\"),\n\t\t},\n\t}}\n\tif !cmp.Equal(releaseVersions, want) {\n\t\tt.Errorf(\"Enterprise.GetNodeReleaseVersions returned %+v, want %+v\", releaseVersions, want)\n\t}\n\n\tconst methodName = \"GetNodeReleaseVersions\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetNodeReleaseVersions(ctx, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/enterprise_network_configurations.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// ListEnterpriseNetworkConfigurations lists all hosted compute network configurations configured in an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#list-hosted-compute-network-configurations-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/network-configurations\nfunc (s *EnterpriseService) ListEnterpriseNetworkConfigurations(ctx context.Context, enterprise string, opts *ListOptions) (*NetworkConfigurations, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/network-configurations\", enterprise)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar networks *NetworkConfigurations\n\tresp, err := s.client.Do(ctx, req, &networks)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn networks, resp, nil\n}\n\n// CreateEnterpriseNetworkConfiguration creates a hosted compute network configuration for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#create-a-hosted-compute-network-configuration-for-an-enterprise\n//\n//meta:operation POST /enterprises/{enterprise}/network-configurations\nfunc (s *EnterpriseService) CreateEnterpriseNetworkConfiguration(ctx context.Context, enterprise string, createReq NetworkConfigurationRequest) (*NetworkConfiguration, *Response, error) {\n\tif err := validateNetworkConfigurationRequest(createReq); err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"validation failed: %w\", err)\n\t}\n\n\tu := fmt.Sprintf(\"enterprises/%v/network-configurations\", enterprise)\n\treq, err := s.client.NewRequest(\"POST\", u, createReq)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar network *NetworkConfiguration\n\tresp, err := s.client.Do(ctx, req, &network)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn network, resp, nil\n}\n\n// GetEnterpriseNetworkConfiguration gets a hosted compute network configuration configured in an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#get-a-hosted-compute-network-configuration-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/network-configurations/{network_configuration_id}\nfunc (s *EnterpriseService) GetEnterpriseNetworkConfiguration(ctx context.Context, enterprise, networkID string) (*NetworkConfiguration, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/network-configurations/%v\", enterprise, networkID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar network *NetworkConfiguration\n\tresp, err := s.client.Do(ctx, req, &network)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn network, resp, nil\n}\n\n// UpdateEnterpriseNetworkConfiguration updates a hosted compute network configuration for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#update-a-hosted-compute-network-configuration-for-an-enterprise\n//\n//meta:operation PATCH /enterprises/{enterprise}/network-configurations/{network_configuration_id}\nfunc (s *EnterpriseService) UpdateEnterpriseNetworkConfiguration(ctx context.Context, enterprise, networkID string, updateReq NetworkConfigurationRequest) (*NetworkConfiguration, *Response, error) {\n\tif err := validateNetworkConfigurationRequest(updateReq); err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"validation failed: %w\", err)\n\t}\n\n\tu := fmt.Sprintf(\"enterprises/%v/network-configurations/%v\", enterprise, networkID)\n\treq, err := s.client.NewRequest(\"PATCH\", u, updateReq)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar network *NetworkConfiguration\n\tresp, err := s.client.Do(ctx, req, &network)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn network, resp, nil\n}\n\n// DeleteEnterpriseNetworkConfiguration deletes a hosted compute network configuration from an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/network-configurations#delete-a-hosted-compute-network-configuration-from-an-enterprise\n//\n//meta:operation DELETE /enterprises/{enterprise}/network-configurations/{network_configuration_id}\nfunc (s *EnterpriseService) DeleteEnterpriseNetworkConfiguration(ctx context.Context, enterprise, networkID string) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/network-configurations/%v\", enterprise, networkID)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// GetEnterpriseNetworkSettingsResource gets a hosted compute network settings resource configured for an enterprise.\n//\n// 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\n//\n//meta:operation GET /enterprises/{enterprise}/network-settings/{network_settings_id}\nfunc (s *EnterpriseService) GetEnterpriseNetworkSettingsResource(ctx context.Context, enterprise, networkID string) (*NetworkSettingsResource, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/network-settings/%v\", enterprise, networkID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar resource *NetworkSettingsResource\n\tresp, err := s.client.Do(ctx, req, &resource)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn resource, resp, err\n}\n"
  },
  {
    "path": "github/enterprise_network_configurations_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestEnterpriseService_ListEnterpriseNetworkConfigurations(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\" /enterprises/e/network-configurations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"3\", \"per_page\": \"2\"})\n\t\tfmt.Fprint(w, `{\n\t\t  \"total_count\": 2,\n\t\t  \"network_configurations\": [\n\t\t\t{\n\t\t\t  \"id\": \"123456789ABCDEF\",\n\t\t\t  \"name\": \"configuration one\",\n\t\t\t  \"compute_service\": \"actions\",\n\t\t\t  \"network_settings_ids\": [\n\t\t\t\t\"23456789ABDCEF1\",\n\t\t\t\t\"3456789ABDCEF12\"\n\t\t\t  ],\n\t\t\t  \"created_on\": \"2024-04-09T17:30:15Z\"\n\t\t\t},\n\t\t\t{\n\t\t\t  \"id\": \"456789ABDCEF123\",\n\t\t\t  \"name\": \"configuration two\",\n\t\t\t  \"compute_service\": \"none\",\n\t\t\t  \"network_settings_ids\": [\n\t\t\t\t\"56789ABDCEF1234\",\n\t\t\t\t\"6789ABDCEF12345\"\n\t\t\t  ],\n\t\t\t  \"created_on\": \"2024-11-02T12:30:30Z\"\n\t\t\t}\n\t\t  ]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\n\topts := &ListOptions{Page: 3, PerPage: 2}\n\tconfigurations, _, err := client.Enterprise.ListEnterpriseNetworkConfigurations(ctx, \"e\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.ListEnterpriseNetworkConfigurations returned error: %v\", err)\n\t}\n\n\twant := &NetworkConfigurations{\n\t\tTotalCount: Ptr(int64(2)),\n\t\tNetworkConfigurations: []*NetworkConfiguration{\n\t\t\t{\n\t\t\t\tID:                 Ptr(\"123456789ABCDEF\"),\n\t\t\t\tName:               Ptr(\"configuration one\"),\n\t\t\t\tComputeService:     Ptr(ComputeService(\"actions\")),\n\t\t\t\tNetworkSettingsIDs: []string{\"23456789ABDCEF1\", \"3456789ABDCEF12\"},\n\t\t\t\tCreatedOn:          &Timestamp{time.Date(2024, 4, 9, 17, 30, 15, 0, time.UTC)},\n\t\t\t},\n\t\t\t{\n\t\t\t\tID:                 Ptr(\"456789ABDCEF123\"),\n\t\t\t\tName:               Ptr(\"configuration two\"),\n\t\t\t\tComputeService:     Ptr(ComputeService(\"none\")),\n\t\t\t\tNetworkSettingsIDs: []string{\"56789ABDCEF1234\", \"6789ABDCEF12345\"},\n\t\t\t\tCreatedOn:          &Timestamp{time.Date(2024, 11, 2, 12, 30, 30, 0, time.UTC)},\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(configurations, want) {\n\t\tt.Errorf(\"Enterprise.ListEnterpriseNetworkConfigurations mismatch (-want +got):\\n%v\", cmp.Diff(want, configurations))\n\t}\n\n\tconst methodName = \"ListEnterpriseNetworkConfigurations\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err = client.Enterprise.ListEnterpriseNetworkConfigurations(ctx, \"\\ne\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ListEnterpriseNetworkConfigurations(ctx, \"e\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_CreateEnterpriseNetworkConfiguration(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/network-configurations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\n\t\t  \"id\": \"123456789ABCDEF\",\n\t\t  \"name\": \"configuration one\",\n\t\t  \"compute_service\": \"actions\",\n\t\t  \"network_settings_ids\": [\n\t\t\t\"23456789ABDCEF1\"\n\t\t  ],\n\t\t  \"created_on\": \"2024-04-09T17:30:15Z\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\n\treq := NetworkConfigurationRequest{\n\t\tName:           Ptr(\"configuration-one\"),\n\t\tComputeService: Ptr(ComputeService(\"actions\")),\n\t\tNetworkSettingsIDs: []string{\n\t\t\t\"23456789ABDCEF1\",\n\t\t},\n\t}\n\tconfiguration, _, err := client.Enterprise.CreateEnterpriseNetworkConfiguration(ctx, \"e\", req)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.CreateEnterpriseNetworkConfiguration returned error: %v\", err)\n\t}\n\n\twant := &NetworkConfiguration{\n\t\tID:                 Ptr(\"123456789ABCDEF\"),\n\t\tName:               Ptr(\"configuration one\"),\n\t\tComputeService:     Ptr(ComputeService(\"actions\")),\n\t\tNetworkSettingsIDs: []string{\"23456789ABDCEF1\"},\n\t\tCreatedOn:          &Timestamp{time.Date(2024, 4, 9, 17, 30, 15, 0, time.UTC)},\n\t}\n\tif !cmp.Equal(configuration, want) {\n\t\tt.Errorf(\"Enterprise.CreateEnterpriseNetworkConfiguration mismatch (-want +got):\\n%v\", cmp.Diff(want, configuration))\n\t}\n\n\tvalidationTest := []struct {\n\t\tname    string\n\t\trequest NetworkConfigurationRequest\n\t\twant    string\n\t}{\n\t\t{\n\t\t\tname: \"invalid network settings id\",\n\t\t\trequest: NetworkConfigurationRequest{\n\t\t\t\tName:               Ptr(\"\"),\n\t\t\t\tNetworkSettingsIDs: []string{\"56789ABDCEF1234\"},\n\t\t\t},\n\t\t\twant: \"validation failed: must be between 1 and 100 characters\",\n\t\t},\n\t\t{\n\t\t\tname: \"invalid network settings id\",\n\t\t\trequest: NetworkConfigurationRequest{\n\t\t\t\tName: Ptr(\"updated-configuration-one\"),\n\t\t\t},\n\t\t\twant: \"validation failed: exactly one network settings id must be specified\",\n\t\t},\n\t\t{\n\t\t\tname: \"invalid compute service\",\n\t\t\trequest: NetworkConfigurationRequest{\n\t\t\t\tName:               Ptr(\"updated-configuration-one\"),\n\t\t\t\tComputeService:     Ptr(ComputeService(\"\")),\n\t\t\t\tNetworkSettingsIDs: []string{\"56789ABDCEF1234\"},\n\t\t\t},\n\t\t\twant: \"validation failed: compute service can only be one of: none, actions\",\n\t\t},\n\t}\n\tfor _, tc := range validationTest {\n\t\t_, _, err = client.Enterprise.CreateEnterpriseNetworkConfiguration(ctx, \"e\", tc.request)\n\t\tif err == nil || err.Error() != tc.want {\n\t\t\tt.Errorf(\"expected error to be %v, got %v\", tc.want, err)\n\t\t}\n\t}\n\n\tconst methodName = \"CreateEnterpriseNetworkConfiguration\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err = client.Enterprise.CreateEnterpriseNetworkConfiguration(ctx, \"\\ne\", req)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.CreateEnterpriseNetworkConfiguration(ctx, \"e\", req)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_GetEnterpriseNetworkConfiguration(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/network-configurations/123456789ABCDEF\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t  \"id\": \"123456789ABCDEF\",\n\t\t  \"name\": \"configuration one\",\n\t\t  \"compute_service\": \"actions\",\n\t\t  \"network_settings_ids\": [\n\t\t\t\"23456789ABDCEF1\",\n\t\t\t\"3456789ABDCEF12\"\n\t\t  ],\n\t\t  \"created_on\": \"2024-12-10T19:00:15Z\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tconfiguration, _, err := client.Enterprise.GetEnterpriseNetworkConfiguration(ctx, \"e\", \"123456789ABCDEF\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.GetEnterpriseNetworkConfiguration returned err: %v\", err)\n\t}\n\n\twant := &NetworkConfiguration{\n\t\tID:                 Ptr(\"123456789ABCDEF\"),\n\t\tName:               Ptr(\"configuration one\"),\n\t\tComputeService:     Ptr(ComputeService(\"actions\")),\n\t\tNetworkSettingsIDs: []string{\"23456789ABDCEF1\", \"3456789ABDCEF12\"},\n\t\tCreatedOn:          &Timestamp{time.Date(2024, 12, 10, 19, 0, 15, 0, time.UTC)},\n\t}\n\tif !cmp.Equal(configuration, want) {\n\t\tt.Errorf(\"Enterprise.GetEnterpriseNetworkConfiguration mismatch (-want +got):\\n%v\", cmp.Diff(want, configuration))\n\t}\n\n\tconst methodName = \"GetEnterpriseNetworkConfiguration\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err = client.Enterprise.GetEnterpriseNetworkConfiguration(ctx, \"\\ne\", \"123456789ABCDEF\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetEnterpriseNetworkConfiguration(ctx, \"e\", \"123456789ABCDEF\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_UpdateEnterpriseNetworkConfiguration(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/network-configurations/123456789ABCDEF\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tfmt.Fprint(w, `{\n\t\t  \"id\": \"123456789ABCDEF\",\n\t\t  \"name\": \"updated configuration one\",\n\t\t  \"compute_service\": \"none\",\n\t\t  \"network_settings_ids\": [\n\t\t\t\"456789ABDCEF123\"\n\t\t  ],\n\t\t  \"created_on\": \"2024-12-10T19:00:15Z\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\treq := NetworkConfigurationRequest{\n\t\tName: Ptr(\"updated-configuration-one\"),\n\t\tNetworkSettingsIDs: []string{\n\t\t\t\"456789ABDCEF123\",\n\t\t},\n\t\tComputeService: Ptr(ComputeService(\"none\")),\n\t}\n\tconfiguration, _, err := client.Enterprise.UpdateEnterpriseNetworkConfiguration(ctx, \"e\", \"123456789ABCDEF\", req)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.UpdateEnterpriseNetworkConfiguration returned error %v\", err)\n\t}\n\n\twant := &NetworkConfiguration{\n\t\tID:                 Ptr(\"123456789ABCDEF\"),\n\t\tName:               Ptr(\"updated configuration one\"),\n\t\tComputeService:     Ptr(ComputeService(\"none\")),\n\t\tNetworkSettingsIDs: []string{\"456789ABDCEF123\"},\n\t\tCreatedOn:          &Timestamp{time.Date(2024, 12, 10, 19, 0, 15, 0, time.UTC)},\n\t}\n\tif !cmp.Equal(configuration, want) {\n\t\tt.Errorf(\"Enterprise.UpdateEnterpriseNetworkConfiguration mismatch (-want +get)\\n%v\", cmp.Diff(want, configuration))\n\t}\n\n\tvalidationTest := []struct {\n\t\tname    string\n\t\trequest NetworkConfigurationRequest\n\t\twant    string\n\t}{\n\t\t{\n\t\t\tname: \"invalid network settings id\",\n\t\t\trequest: NetworkConfigurationRequest{\n\t\t\t\tName:               Ptr(\"\"),\n\t\t\t\tNetworkSettingsIDs: []string{\"56789ABDCEF1234\"},\n\t\t\t},\n\t\t\twant: \"validation failed: must be between 1 and 100 characters\",\n\t\t},\n\t\t{\n\t\t\tname: \"invalid network settings id\",\n\t\t\trequest: NetworkConfigurationRequest{\n\t\t\t\tName: Ptr(\"updated-configuration-one\"),\n\t\t\t},\n\t\t\twant: \"validation failed: exactly one network settings id must be specified\",\n\t\t},\n\t\t{\n\t\t\tname: \"invalid compute service\",\n\t\t\trequest: NetworkConfigurationRequest{\n\t\t\t\tName:               Ptr(\"updated-configuration-one\"),\n\t\t\t\tComputeService:     Ptr(ComputeService(\"something\")),\n\t\t\t\tNetworkSettingsIDs: []string{\"56789ABDCEF1234\"},\n\t\t\t},\n\t\t\twant: \"validation failed: compute service can only be one of: none, actions\",\n\t\t},\n\t}\n\tfor _, tc := range validationTest {\n\t\t_, _, err = client.Enterprise.UpdateEnterpriseNetworkConfiguration(ctx, \"e\", \"123456789ABCDEF\", tc.request)\n\t\tif err == nil || err.Error() != tc.want {\n\t\t\tt.Errorf(\"expected error to be %v, got %v\", tc.want, err)\n\t\t}\n\t}\n\n\tconst methodName = \"UpdateEnterpriseNetworkConfiguration\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err = client.Enterprise.UpdateEnterpriseNetworkConfiguration(ctx, \"\\ne\", \"123456789ABCDEF\", req)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.UpdateEnterpriseNetworkConfiguration(ctx, \"e\", \"123456789ABCDEF\", req)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_DeleteEnterpriseNetworkConfiguration(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/network-configurations/123456789ABCDEF\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Enterprise.DeleteEnterpriseNetworkConfiguration(ctx, \"e\", \"123456789ABCDEF\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.DeleteEnterpriseNetworkConfiguration returned error %v\", err)\n\t}\n\n\tconst methodName = \"DeleteEnterpriseNetworkConfiguration\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, err = client.Enterprise.DeleteEnterpriseNetworkConfiguration(ctx, \"\\ne\", \"123456789ABCDEF\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Enterprise.DeleteEnterpriseNetworkConfiguration(ctx, \"e\", \"123456789ABCDEF\")\n\t})\n}\n\nfunc TestEnterpriseService_GetEnterpriseNetworkSettingsResource(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/network-settings/123456789ABCDEF\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": \"220F78DACB92BBFBC5E6F22DE1CCF52309D\",\n\t\t\t\"network_configuration_id\": \"934E208B3EE0BD60CF5F752C426BFB53562\",\n\t\t\t\"name\": \"my_network_settings\",\n\t\t\t\"subnet_id\": \"/subscriptions/14839728-3ad9-43ab-bd2b-fa6ad0f75e2a/resourceGroups/my-rg/providers/Microsoft.Network/virtualNetworks/my-vnet/subnets/my-subnet\",\n\t\t\t\"region\": \"germanywestcentral\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tresource, _, err := client.Enterprise.GetEnterpriseNetworkSettingsResource(ctx, \"e\", \"123456789ABCDEF\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.GetEnterpriseNetworkSettingsResource returned error %v\", err)\n\t}\n\n\twant := &NetworkSettingsResource{\n\t\tID:                     Ptr(\"220F78DACB92BBFBC5E6F22DE1CCF52309D\"),\n\t\tNetworkConfigurationID: Ptr(\"934E208B3EE0BD60CF5F752C426BFB53562\"),\n\t\tName:                   Ptr(\"my_network_settings\"),\n\t\tSubnetID:               Ptr(\"/subscriptions/14839728-3ad9-43ab-bd2b-fa6ad0f75e2a/resourceGroups/my-rg/providers/Microsoft.Network/virtualNetworks/my-vnet/subnets/my-subnet\"),\n\t\tRegion:                 Ptr(\"germanywestcentral\"),\n\t}\n\tif !cmp.Equal(resource, want) {\n\t\tt.Errorf(\"Enterprise.GetEnterpriseNetworkSettingsResource mismatch (-want +got):\\n%v\", cmp.Diff(want, resource))\n\t}\n\n\tconst methodName = \"GetEnterpriseNetworkSettingsResource\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err = client.Enterprise.GetEnterpriseNetworkSettingsResource(ctx, \"\\ne\", \"123456789ABCDEF\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetEnterpriseNetworkSettingsResource(ctx, \"e\", \"123456789ABCDEF\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/enterprise_organization_properties.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// EnterpriseCustomPropertySchema represents the schema response for GetEnterpriseCustomPropertiesSchema.\ntype EnterpriseCustomPropertySchema struct {\n\t// An ordered list of the custom property defined in the enterprise.\n\tProperties []*CustomProperty `json:\"properties,omitempty\"`\n}\n\n// EnterpriseCustomPropertiesValues represents the custom properties values for an organization within an enterprise.\ntype EnterpriseCustomPropertiesValues struct {\n\t// The Organization ID that the custom property values will be applied to.\n\tOrganizationID *int64 `json:\"organization_id,omitempty\"`\n\t// The names of organizations that the custom property values will be applied to.\n\tOrganizationLogin *string `json:\"organization_login,omitempty\"`\n\t// List of custom property names and associated values to apply to the organizations.\n\tProperties []*CustomPropertyValue `json:\"properties,omitempty\"`\n}\n\n// EnterpriseCustomPropertyValuesRequest represents the request to update custom property values for organizations within an enterprise.\ntype EnterpriseCustomPropertyValuesRequest struct {\n\t// The names of organizations that the custom property values will be applied to.\n\t// OrganizationLogin specifies the organization name when updating multiple organizations.\n\tOrganizationLogin []string `json:\"organization_login\"`\n\t// List of custom property names and associated values to apply to the organizations.\n\tProperties []*CustomPropertyValue `json:\"properties\"`\n}\n\n// GetOrganizationCustomPropertySchema gets all organization custom property definitions that are defined on an enterprise.\n//\n// 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\n//\n//meta:operation GET /enterprises/{enterprise}/org-properties/schema\nfunc (s *EnterpriseService) GetOrganizationCustomPropertySchema(ctx context.Context, enterprise string) (*EnterpriseCustomPropertySchema, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/org-properties/schema\", enterprise)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar schema *EnterpriseCustomPropertySchema\n\tresp, err := s.client.Do(ctx, req, &schema)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn schema, resp, nil\n}\n\n// CreateOrUpdateOrganizationCustomPropertySchema creates new or updates existing organization custom properties defined on an enterprise in a batch.\n//\n// 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\n//\n//meta:operation PATCH /enterprises/{enterprise}/org-properties/schema\nfunc (s *EnterpriseService) CreateOrUpdateOrganizationCustomPropertySchema(ctx context.Context, enterprise string, schema EnterpriseCustomPropertySchema) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/org-properties/schema\", enterprise)\n\treq, err := s.client.NewRequest(\"PATCH\", u, schema)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// GetOrganizationCustomProperty retrieves a specific organization custom property definition from an enterprise.\n//\n// 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\n//\n//meta:operation GET /enterprises/{enterprise}/org-properties/schema/{custom_property_name}\nfunc (s *EnterpriseService) GetOrganizationCustomProperty(ctx context.Context, enterprise, customPropertyName string) (*CustomProperty, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/org-properties/schema/%v\", enterprise, customPropertyName)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar property *CustomProperty\n\tresp, err := s.client.Do(ctx, req, &property)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn property, resp, nil\n}\n\n// CreateOrUpdateOrganizationCustomProperty creates a new or updates an existing organization custom property definition that is defined on an enterprise.\n//\n// 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\n//\n//meta:operation PUT /enterprises/{enterprise}/org-properties/schema/{custom_property_name}\nfunc (s *EnterpriseService) CreateOrUpdateOrganizationCustomProperty(ctx context.Context, enterprise, customPropertyName string, property CustomProperty) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/org-properties/schema/%v\", enterprise, customPropertyName)\n\treq, err := s.client.NewRequest(\"PUT\", u, property)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// DeleteOrganizationCustomProperty removes an organization custom property definition that is defined on an enterprise.\n//\n// 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\n//\n//meta:operation DELETE /enterprises/{enterprise}/org-properties/schema/{custom_property_name}\nfunc (s *EnterpriseService) DeleteOrganizationCustomProperty(ctx context.Context, enterprise, customPropertyName string) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/org-properties/schema/%v\", enterprise, customPropertyName)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// ListOrganizationCustomPropertyValues lists enterprise organizations with all of their custom property values.\n// Returns a list of organizations and their custom property values defined in the enterprise.\n//\n// 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\n//\n//meta:operation GET /enterprises/{enterprise}/org-properties/values\nfunc (s *EnterpriseService) ListOrganizationCustomPropertyValues(ctx context.Context, enterprise string, opts *ListOptions) ([]*EnterpriseCustomPropertiesValues, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/org-properties/values\", enterprise)\n\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar values []*EnterpriseCustomPropertiesValues\n\tresp, err := s.client.Do(ctx, req, &values)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn values, resp, nil\n}\n\n// CreateOrUpdateOrganizationCustomPropertyValues creates or updates custom property values for organizations in an enterprise.\n// To remove a custom property value from an organization, set the property value to null.\n//\n// 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\n//\n//meta:operation PATCH /enterprises/{enterprise}/org-properties/values\nfunc (s *EnterpriseService) CreateOrUpdateOrganizationCustomPropertyValues(ctx context.Context, enterprise string, values EnterpriseCustomPropertyValuesRequest) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/org-properties/values\", enterprise)\n\treq, err := s.client.NewRequest(\"PATCH\", u, values)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n"
  },
  {
    "path": "github/enterprise_organization_properties_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestEnterpriseService_GetOrganizationCustomPropertySchema(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/org-properties/schema\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"properties\": [{\n\t\t\t\t\"property_name\": \"team\",\n\t\t\t\t\"value_type\": \"string\",\n\t\t\t\t\"description\": \"Team name\"\n\t\t\t}]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Enterprise.GetOrganizationCustomPropertySchema(ctx, \"e\")\n\tif err != nil {\n\t\tt.Fatalf(\"Enterprise.GetOrganizationCustomPropertySchema returned error: %v\", err)\n\t}\n\n\twant := &EnterpriseCustomPropertySchema{\n\t\tProperties: []*CustomProperty{\n\t\t\t{\n\t\t\t\tPropertyName: Ptr(\"team\"),\n\t\t\t\tValueType:    PropertyValueTypeString,\n\t\t\t\tDescription:  Ptr(\"Team name\"),\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Enterprise.GetOrganizationCustomPropertySchema = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"GetOrganizationCustomPropertySchema\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err := client.Enterprise.GetOrganizationCustomPropertySchema(ctx, \"\\n\")\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetOrganizationCustomPropertySchema(ctx, \"e\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_CreateOrUpdateOrganizationCustomPropertySchema(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/org-properties/schema\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tfmt.Fprint(w, `{}`)\n\t})\n\n\tctx := t.Context()\n\tschema := EnterpriseCustomPropertySchema{\n\t\tProperties: []*CustomProperty{{PropertyName: Ptr(\"team\")}},\n\t}\n\t_, err := client.Enterprise.CreateOrUpdateOrganizationCustomPropertySchema(ctx, \"e\", schema)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.CreateOrUpdateOrganizationCustomPropertySchema returned error: %v\", err)\n\t}\n\n\tconst methodName = \"CreateOrUpdateOrganizationCustomPropertySchema\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, err := client.Enterprise.CreateOrUpdateOrganizationCustomPropertySchema(ctx, \"\\n\", schema)\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Enterprise.CreateOrUpdateOrganizationCustomPropertySchema(ctx, \"e\", schema)\n\t})\n}\n\nfunc TestEnterpriseService_GetOrganizationCustomProperty(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/org-properties/schema/prop\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"property_name\": \"team\",\n\t\t\t\"value_type\": \"string\",\n\t\t\t\"description\": \"Team name\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Enterprise.GetOrganizationCustomProperty(ctx, \"e\", \"prop\")\n\tif err != nil {\n\t\tt.Fatalf(\"Enterprise.GetOrganizationCustomProperty returned error: %v\", err)\n\t}\n\n\twant := &CustomProperty{\n\t\tPropertyName: Ptr(\"team\"),\n\t\tValueType:    PropertyValueTypeString,\n\t\tDescription:  Ptr(\"Team name\"),\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Enterprise.GetOrganizationCustomProperty = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"GetOrganizationCustomProperty\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err := client.Enterprise.GetOrganizationCustomProperty(ctx, \"\\n\", \"prop\")\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetOrganizationCustomProperty(ctx, \"e\", \"prop\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_CreateOrUpdateOrganizationCustomProperty(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/org-properties/schema/prop\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tfmt.Fprint(w, `{}`)\n\t})\n\n\tctx := t.Context()\n\tproperty := CustomProperty{PropertyName: Ptr(\"team\")}\n\t_, err := client.Enterprise.CreateOrUpdateOrganizationCustomProperty(ctx, \"e\", \"prop\", property)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.CreateOrUpdateOrganizationCustomProperty returned error: %v\", err)\n\t}\n\n\tconst methodName = \"CreateOrUpdateOrganizationCustomProperty\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, err := client.Enterprise.CreateOrUpdateOrganizationCustomProperty(ctx, \"\\n\", \"prop\", property)\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Enterprise.CreateOrUpdateOrganizationCustomProperty(ctx, \"e\", \"prop\", property)\n\t})\n}\n\nfunc TestEnterpriseService_DeleteOrganizationCustomProperty(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/org-properties/schema/prop\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Enterprise.DeleteOrganizationCustomProperty(ctx, \"e\", \"prop\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.DeleteOrganizationCustomProperty returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteOrganizationCustomProperty\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, err := client.Enterprise.DeleteOrganizationCustomProperty(ctx, \"\\n\", \"prop\")\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Enterprise.DeleteOrganizationCustomProperty(ctx, \"e\", \"prop\")\n\t})\n}\n\nfunc TestEnterpriseService_ListOrganizationCustomPropertyValues(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/org-properties/values\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"organization_id\": 1,\n\t\t\t\"organization_login\": \"org1\",\n\t\t\t\"properties\": [\n\t\t\t\t{\"property_name\": \"team\", \"value\": \"core\"}\n\t\t\t]\n\t\t}]`)\n\t})\n\n\tctx := t.Context()\n\topts := &ListOptions{Page: 1, PerPage: 10}\n\tgot, _, err := client.Enterprise.ListOrganizationCustomPropertyValues(ctx, \"e\", opts)\n\tif err != nil {\n\t\tt.Fatalf(\"Enterprise.ListOrganizationCustomPropertyValues returned error: %v\", err)\n\t}\n\n\twant := []*EnterpriseCustomPropertiesValues{\n\t\t{\n\t\t\tOrganizationID:    Ptr(int64(1)),\n\t\t\tOrganizationLogin: Ptr(\"org1\"),\n\t\t\tProperties: []*CustomPropertyValue{\n\t\t\t\t{PropertyName: \"team\", Value: \"core\"},\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Enterprise.ListOrganizationCustomPropertyValues = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ListEnterpriseCustomPropertyValues\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err := client.Enterprise.ListOrganizationCustomPropertyValues(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ListOrganizationCustomPropertyValues(ctx, \"e\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_CreateOrUpdateOrganizationCustomPropertyValues(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/org-properties/values\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tfmt.Fprint(w, `{}`)\n\t})\n\n\tctx := t.Context()\n\tvalues := []*CustomPropertyValue{{PropertyName: \"team\", Value: Ptr(\"core\")}}\n\torgs := []string{\"org1\"}\n\n\topts := EnterpriseCustomPropertyValuesRequest{\n\t\tOrganizationLogin: orgs,\n\t\tProperties:        values,\n\t}\n\t_, err := client.Enterprise.CreateOrUpdateOrganizationCustomPropertyValues(ctx, \"e\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.CreateOrUpdateOrganizationCustomPropertyValues returned error: %v\", err)\n\t}\n\n\tconst methodName = \"CreateOrUpdateOrganizationCustomPropertyValues\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, err := client.Enterprise.CreateOrUpdateOrganizationCustomPropertyValues(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Enterprise.CreateOrUpdateOrganizationCustomPropertyValues(ctx, \"e\", opts)\n\t})\n}\n"
  },
  {
    "path": "github/enterprise_properties.go",
    "content": "// Copyright 2024 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// GetAllCustomProperties gets all custom properties that are defined for the specified enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties#get-custom-properties-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/properties/schema\nfunc (s *EnterpriseService) GetAllCustomProperties(ctx context.Context, enterprise string) ([]*CustomProperty, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/properties/schema\", enterprise)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar customProperties []*CustomProperty\n\tresp, err := s.client.Do(ctx, req, &customProperties)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn customProperties, resp, nil\n}\n\n// CreateOrUpdateCustomProperties creates new or updates existing custom properties that are defined for the specified enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties#create-or-update-custom-properties-for-an-enterprise\n//\n//meta:operation PATCH /enterprises/{enterprise}/properties/schema\nfunc (s *EnterpriseService) CreateOrUpdateCustomProperties(ctx context.Context, enterprise string, properties []*CustomProperty) ([]*CustomProperty, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/properties/schema\", enterprise)\n\n\tparams := struct {\n\t\tProperties []*CustomProperty `json:\"properties\"`\n\t}{\n\t\tProperties: properties,\n\t}\n\n\treq, err := s.client.NewRequest(\"PATCH\", u, params)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar customProperties []*CustomProperty\n\tresp, err := s.client.Do(ctx, req, &customProperties)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn customProperties, resp, nil\n}\n\n// GetCustomProperty gets a custom property that is defined for the specified enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties#get-a-custom-property-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/properties/schema/{custom_property_name}\nfunc (s *EnterpriseService) GetCustomProperty(ctx context.Context, enterprise, customPropertyName string) (*CustomProperty, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/properties/schema/%v\", enterprise, customPropertyName)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar customProperty *CustomProperty\n\tresp, err := s.client.Do(ctx, req, &customProperty)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn customProperty, resp, nil\n}\n\n// CreateOrUpdateCustomProperty creates a new or updates an existing custom property that is defined for the specified enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties#create-or-update-a-custom-property-for-an-enterprise\n//\n//meta:operation PUT /enterprises/{enterprise}/properties/schema/{custom_property_name}\nfunc (s *EnterpriseService) CreateOrUpdateCustomProperty(ctx context.Context, enterprise, customPropertyName string, property *CustomProperty) (*CustomProperty, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/properties/schema/%v\", enterprise, customPropertyName)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, property)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar customProperty *CustomProperty\n\tresp, err := s.client.Do(ctx, req, &customProperty)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn customProperty, resp, nil\n}\n\n// RemoveCustomProperty removes a custom property that is defined for the specified enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/custom-properties#remove-a-custom-property-for-an-enterprise\n//\n//meta:operation DELETE /enterprises/{enterprise}/properties/schema/{custom_property_name}\nfunc (s *EnterpriseService) RemoveCustomProperty(ctx context.Context, enterprise, customPropertyName string) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/properties/schema/%v\", enterprise, customPropertyName)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/enterprise_properties_test.go",
    "content": "// Copyright 2024 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestEnterpriseService_GetAllCustomProperties(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/properties/schema\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[\n\t\t{\n          \"property_name\": \"name\",\n          \"value_type\": \"single_select\",\n          \"required\": true,\n          \"default_value\": \"production\",\n          \"description\": \"Prod or dev environment\",\n          \"allowed_values\":[\n            \"production\",\n            \"development\"\n          ],\n          \"values_editable_by\": \"org_actors\"\n        },\n        {\n          \"property_name\": \"service\",\n          \"value_type\": \"string\"\n        },\n        {\n          \"property_name\": \"team\",\n          \"value_type\": \"string\",\n          \"description\": \"Team owning the repository\"\n        }\n        ]`)\n\t})\n\n\tctx := t.Context()\n\tproperties, _, err := client.Enterprise.GetAllCustomProperties(ctx, \"e\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.GetAllCustomProperties returned error: %v\", err)\n\t}\n\n\twant := []*CustomProperty{\n\t\t{\n\t\t\tPropertyName:     Ptr(\"name\"),\n\t\t\tValueType:        PropertyValueTypeSingleSelect,\n\t\t\tRequired:         Ptr(true),\n\t\t\tDefaultValue:     \"production\",\n\t\t\tDescription:      Ptr(\"Prod or dev environment\"),\n\t\t\tAllowedValues:    []string{\"production\", \"development\"},\n\t\t\tValuesEditableBy: Ptr(\"org_actors\"),\n\t\t},\n\t\t{\n\t\t\tPropertyName: Ptr(\"service\"),\n\t\t\tValueType:    PropertyValueTypeString,\n\t\t},\n\t\t{\n\t\t\tPropertyName: Ptr(\"team\"),\n\t\t\tValueType:    PropertyValueTypeString,\n\t\t\tDescription:  Ptr(\"Team owning the repository\"),\n\t\t},\n\t}\n\tif !cmp.Equal(properties, want) {\n\t\tt.Errorf(\"Enterprise.GetAllCustomProperties returned %+v, want %+v\", properties, want)\n\t}\n\n\tconst methodName = \"GetAllCustomProperties\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetAllCustomProperties(ctx, \"e\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_CreateOrUpdateCustomProperties(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/properties/schema\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\ttestBody(t, r, `{\"properties\":[{\"property_name\":\"name\",\"value_type\":\"single_select\",\"required\":true},{\"property_name\":\"service\",\"value_type\":\"string\"}]}`+\"\\n\")\n\t\tfmt.Fprint(w, `[\n\t\t{\n          \"property_name\": \"name\",\n          \"value_type\": \"single_select\",\n          \"required\": true\n        },\n        {\n          \"property_name\": \"service\",\n          \"value_type\": \"string\"\n        }\n        ]`)\n\t})\n\n\tctx := t.Context()\n\tproperties, _, err := client.Enterprise.CreateOrUpdateCustomProperties(ctx, \"e\", []*CustomProperty{\n\t\t{\n\t\t\tPropertyName: Ptr(\"name\"),\n\t\t\tValueType:    PropertyValueTypeSingleSelect,\n\t\t\tRequired:     Ptr(true),\n\t\t},\n\t\t{\n\t\t\tPropertyName: Ptr(\"service\"),\n\t\t\tValueType:    PropertyValueTypeString,\n\t\t},\n\t})\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.CreateOrUpdateCustomProperties returned error: %v\", err)\n\t}\n\n\twant := []*CustomProperty{\n\t\t{\n\t\t\tPropertyName: Ptr(\"name\"),\n\t\t\tValueType:    PropertyValueTypeSingleSelect,\n\t\t\tRequired:     Ptr(true),\n\t\t},\n\t\t{\n\t\t\tPropertyName: Ptr(\"service\"),\n\t\t\tValueType:    PropertyValueTypeString,\n\t\t},\n\t}\n\n\tif !cmp.Equal(properties, want) {\n\t\tt.Errorf(\"Enterprise.CreateOrUpdateCustomProperties returned %+v, want %+v\", properties, want)\n\t}\n\n\tconst methodName = \"CreateOrUpdateCustomProperties\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.CreateOrUpdateCustomProperties(ctx, \"e\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_GetCustomProperty(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/properties/schema/name\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\"property_name\": \"name\",\n\t\t\"value_type\": \"single_select\",\n\t\t\"required\": true,\n\t\t\"default_value\": \"production\",\n\t\t\"description\": \"Prod or dev environment\",\n\t\t\"allowed_values\":[\n\t\t  \"production\",\n\t\t  \"development\"\n\t\t],\n\t\t\"values_editable_by\": \"org_actors\"\n\t  }`)\n\t})\n\n\tctx := t.Context()\n\tproperty, _, err := client.Enterprise.GetCustomProperty(ctx, \"e\", \"name\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.GetCustomProperty returned error: %v\", err)\n\t}\n\n\twant := &CustomProperty{\n\t\tPropertyName:     Ptr(\"name\"),\n\t\tValueType:        PropertyValueTypeSingleSelect,\n\t\tRequired:         Ptr(true),\n\t\tDefaultValue:     \"production\",\n\t\tDescription:      Ptr(\"Prod or dev environment\"),\n\t\tAllowedValues:    []string{\"production\", \"development\"},\n\t\tValuesEditableBy: Ptr(\"org_actors\"),\n\t}\n\tif !cmp.Equal(property, want) {\n\t\tt.Errorf(\"Enterprise.GetCustomProperty returned %+v, want %+v\", property, want)\n\t}\n\n\tconst methodName = \"GetCustomProperty\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetCustomProperty(ctx, \"e\", \"name\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_CreateOrUpdateCustomProperty(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/properties/schema/name\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tfmt.Fprint(w, `{\n\t\t\"property_name\": \"name\",\n\t\t\"value_type\": \"single_select\",\n\t\t\"required\": true,\n\t\t\"default_value\": \"production\",\n\t\t\"description\": \"Prod or dev environment\",\n\t\t\"allowed_values\":[\n\t\t  \"production\",\n\t\t  \"development\"\n\t\t],\n\t\t\"values_editable_by\": \"org_actors\"\n\t  }`)\n\t})\n\n\tctx := t.Context()\n\tproperty, _, err := client.Enterprise.CreateOrUpdateCustomProperty(ctx, \"e\", \"name\", &CustomProperty{\n\t\tValueType:        PropertyValueTypeSingleSelect,\n\t\tRequired:         Ptr(true),\n\t\tDefaultValue:     \"production\",\n\t\tDescription:      Ptr(\"Prod or dev environment\"),\n\t\tAllowedValues:    []string{\"production\", \"development\"},\n\t\tValuesEditableBy: Ptr(\"org_actors\"),\n\t})\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.CreateOrUpdateCustomProperty returned error: %v\", err)\n\t}\n\n\twant := &CustomProperty{\n\t\tPropertyName:     Ptr(\"name\"),\n\t\tValueType:        PropertyValueTypeSingleSelect,\n\t\tRequired:         Ptr(true),\n\t\tDefaultValue:     \"production\",\n\t\tDescription:      Ptr(\"Prod or dev environment\"),\n\t\tAllowedValues:    []string{\"production\", \"development\"},\n\t\tValuesEditableBy: Ptr(\"org_actors\"),\n\t}\n\tif !cmp.Equal(property, want) {\n\t\tt.Errorf(\"Enterprise.CreateOrUpdateCustomProperty returned %+v, want %+v\", property, want)\n\t}\n\n\tconst methodName = \"CreateOrUpdateCustomProperty\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.CreateOrUpdateCustomProperty(ctx, \"e\", \"name\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_RemoveCustomProperty(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/properties/schema/name\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Enterprise.RemoveCustomProperty(ctx, \"e\", \"name\")\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.RemoveCustomProperty returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveCustomProperty\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Enterprise.RemoveCustomProperty(ctx, \"e\", \"name\")\n\t})\n}\n"
  },
  {
    "path": "github/enterprise_rules.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// CreateRepositoryRuleset creates a repository ruleset for the specified enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules#create-an-enterprise-repository-ruleset\n//\n//meta:operation POST /enterprises/{enterprise}/rulesets\nfunc (s *EnterpriseService) CreateRepositoryRuleset(ctx context.Context, enterprise string, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/rulesets\", enterprise)\n\n\treq, err := s.client.NewRequest(\"POST\", u, ruleset)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar rs *RepositoryRuleset\n\tresp, err := s.client.Do(ctx, req, &rs)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn rs, resp, nil\n}\n\n// GetRepositoryRuleset gets a repository ruleset for the specified enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules#get-an-enterprise-repository-ruleset\n//\n//meta:operation GET /enterprises/{enterprise}/rulesets/{ruleset_id}\nfunc (s *EnterpriseService) GetRepositoryRuleset(ctx context.Context, enterprise string, rulesetID int64) (*RepositoryRuleset, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/rulesets/%v\", enterprise, rulesetID)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar ruleset *RepositoryRuleset\n\tresp, err := s.client.Do(ctx, req, &ruleset)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn ruleset, resp, nil\n}\n\n// UpdateRepositoryRuleset updates a repository ruleset for the specified enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules#update-an-enterprise-repository-ruleset\n//\n//meta:operation PUT /enterprises/{enterprise}/rulesets/{ruleset_id}\nfunc (s *EnterpriseService) UpdateRepositoryRuleset(ctx context.Context, enterprise string, rulesetID int64, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/rulesets/%v\", enterprise, rulesetID)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, ruleset)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar rs *RepositoryRuleset\n\tresp, err := s.client.Do(ctx, req, &rs)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn rs, resp, nil\n}\n\n// DeleteRepositoryRuleset deletes a repository ruleset from the specified enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/rules#delete-an-enterprise-repository-ruleset\n//\n//meta:operation DELETE /enterprises/{enterprise}/rulesets/{ruleset_id}\nfunc (s *EnterpriseService) DeleteRepositoryRuleset(ctx context.Context, enterprise string, rulesetID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/rulesets/%v\", enterprise, rulesetID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/enterprise_rules_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestEnterpriseService_CreateRepositoryRuleset_OrgNameRepoName(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/rulesets\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 84,\n\t\t\t\"name\": \"ruleset\",\n\t\t\t\"target\": \"branch\",\n\t\t\t\"source_type\": \"Enterprise\",\n\t\t\t\"source\": \"e\",\n\t\t\t\"enforcement\": \"active\",\n\t\t\t\"bypass_actors\": [\n\t\t\t\t{\n\t\t\t\t\t\"actor_id\": 234,\n\t\t\t\t\t\"actor_type\": \"Team\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"conditions\": {\n\t\t\t\t\"organization_name\": {\n\t\t\t\t\t\"include\": [\n\t\t\t\t\t\t\"important_organization\",\n\t\t\t\t\t\t\"another_important_organization\"\n\t\t\t\t\t],\n\t\t\t\t\t\"exclude\": [\n\t\t\t\t\t\t\"unimportant_organization\"\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t  \"repository_name\": {\n\t\t\t\t\t\"include\": [\n\t\t\t\t\t\t\"important_repository\",\n\t\t\t\t\t\t\"another_important_repository\"\n\t\t\t\t\t],\n\t\t\t\t\t\"exclude\": [\n\t\t\t\t\t\t\"unimportant_repository\"\n\t\t\t\t\t],\n\t\t\t\t\t\"protected\": true\n\t\t\t\t},\n\t\t\t  \"ref_name\": {\n\t\t\t\t\t\"include\": [\n\t\t\t\t\t\t\"refs/heads/main\",\n\t\t\t\t\t\t\"refs/heads/master\"\n\t\t\t\t\t],\n\t\t\t\t\t\"exclude\": [\n\t\t\t\t\t\t\"refs/heads/dev*\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"rules\": [\n\t\t\t  {\n\t\t\t\t\"type\": \"creation\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"update\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"update_allows_fetch_and_merge\": true\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"deletion\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"required_linear_history\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"required_deployments\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"required_deployment_environments\": [\"test\"]\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"required_signatures\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"pull_request\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t\t\"allowed_merge_methods\": [\"rebase\",\"squash\"],\n\t\t\t\t  \"dismiss_stale_reviews_on_push\": true,\n\t\t\t\t  \"require_code_owner_review\": true,\n\t\t\t\t  \"require_last_push_approval\": true,\n\t\t\t\t  \"required_approving_review_count\": 1,\n\t\t\t\t  \"required_review_thread_resolution\": true\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"required_status_checks\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t\t\"do_not_enforce_on_create\": true,\n\t\t\t\t  \"required_status_checks\": [\n\t\t\t\t\t{\n\t\t\t\t\t  \"context\": \"test\",\n\t\t\t\t\t  \"integration_id\": 1\n\t\t\t\t\t}\n\t\t\t\t  ],\n\t\t\t\t  \"strict_required_status_checks_policy\": true\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"non_fast_forward\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"commit_message_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"name\": \"avoid test commits\",\n\t\t\t\t  \"negate\": true,\n\t\t\t\t  \"operator\": \"starts_with\",\n\t\t\t\t  \"pattern\": \"[test]\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"commit_author_email_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"operator\": \"contains\",\n\t\t\t\t  \"pattern\": \"github\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"committer_email_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"name\": \"avoid commit emails\",\n\t\t\t\t  \"negate\": true,\n\t\t\t\t  \"operator\": \"ends_with\",\n\t\t\t\t  \"pattern\": \"abc\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"branch_name_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"name\": \"avoid branch names\",\n\t\t\t\t  \"negate\": true,\n\t\t\t\t  \"operator\": \"regex\",\n\t\t\t\t  \"pattern\": \"github$\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"tag_name_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"name\": \"avoid tag names\",\n\t\t\t\t  \"negate\": true,\n\t\t\t\t  \"operator\": \"contains\",\n\t\t\t\t  \"pattern\": \"github\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t    \"type\": \"code_scanning\",\n\t\t\t    \"parameters\": {\n\t\t\t\t  \"code_scanning_tools\": [\n\t\t\t\t    {\n\t\t\t\t\t  \"tool\": \"CodeQL\",\n\t\t\t\t\t  \"security_alerts_threshold\": \"high_or_higher\",\n\t\t\t\t\t  \"alerts_threshold\": \"errors\"\n\t\t\t\t    }\n\t\t\t\t  ]\n\t\t\t    }\n\t\t\t  }\n\t\t\t]\n\t\t  }`)\n\t})\n\n\tctx := t.Context()\n\truleset, _, err := client.Enterprise.CreateRepositoryRuleset(ctx, \"e\", RepositoryRuleset{\n\t\tName:        \"ruleset\",\n\t\tTarget:      Ptr(RulesetTargetBranch),\n\t\tEnforcement: \"active\",\n\t\tBypassActors: []*BypassActor{\n\t\t\t{\n\t\t\t\tActorID:   Ptr(int64(234)),\n\t\t\t\tActorType: Ptr(BypassActorTypeTeam),\n\t\t\t},\n\t\t},\n\t\tConditions: &RepositoryRulesetConditions{\n\t\t\tOrganizationName: &RepositoryRulesetOrganizationNamesConditionParameters{\n\t\t\t\tInclude: []string{\"important_organization\", \"another_important_organization\"},\n\t\t\t\tExclude: []string{\"unimportant_organization\"},\n\t\t\t},\n\t\t\tRepositoryName: &RepositoryRulesetRepositoryNamesConditionParameters{\n\t\t\t\tInclude:   []string{\"important_repository\", \"another_important_repository\"},\n\t\t\t\tExclude:   []string{\"unimportant_repository\"},\n\t\t\t\tProtected: Ptr(true),\n\t\t\t},\n\t\t\tRefName: &RepositoryRulesetRefConditionParameters{\n\t\t\t\tInclude: []string{\"refs/heads/main\", \"refs/heads/master\"},\n\t\t\t\tExclude: []string{\"refs/heads/dev*\"},\n\t\t\t},\n\t\t},\n\t\tRules: &RepositoryRulesetRules{\n\t\t\tCreation: &EmptyRuleParameters{},\n\t\t\tUpdate: &UpdateRuleParameters{\n\t\t\t\tUpdateAllowsFetchAndMerge: true,\n\t\t\t},\n\t\t\tDeletion:              &EmptyRuleParameters{},\n\t\t\tRequiredLinearHistory: &EmptyRuleParameters{},\n\t\t\tRequiredDeployments: &RequiredDeploymentsRuleParameters{\n\t\t\t\tRequiredDeploymentEnvironments: []string{\"test\"},\n\t\t\t},\n\t\t\tRequiredSignatures: &EmptyRuleParameters{},\n\t\t\tPullRequest: &PullRequestRuleParameters{\n\t\t\t\tAllowedMergeMethods:            []PullRequestMergeMethod{PullRequestMergeMethodRebase, PullRequestMergeMethodSquash},\n\t\t\t\tDismissStaleReviewsOnPush:      true,\n\t\t\t\tRequireCodeOwnerReview:         true,\n\t\t\t\tRequireLastPushApproval:        true,\n\t\t\t\tRequiredApprovingReviewCount:   1,\n\t\t\t\tRequiredReviewThreadResolution: true,\n\t\t\t},\n\t\t\tRequiredStatusChecks: &RequiredStatusChecksRuleParameters{\n\t\t\t\tDoNotEnforceOnCreate: Ptr(true),\n\t\t\t\tRequiredStatusChecks: []*RuleStatusCheck{\n\t\t\t\t\t{\n\t\t\t\t\t\tContext:       \"test\",\n\t\t\t\t\t\tIntegrationID: Ptr(int64(1)),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tStrictRequiredStatusChecksPolicy: true,\n\t\t\t},\n\t\t\tNonFastForward: &EmptyRuleParameters{},\n\t\t\tCommitMessagePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid test commits\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"starts_with\",\n\t\t\t\tPattern:  \"[test]\",\n\t\t\t},\n\t\t\tCommitAuthorEmailPattern: &PatternRuleParameters{\n\t\t\t\tOperator: \"contains\",\n\t\t\t\tPattern:  \"github\",\n\t\t\t},\n\t\t\tCommitterEmailPattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid commit emails\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"ends_with\",\n\t\t\t\tPattern:  \"abc\",\n\t\t\t},\n\t\t\tBranchNamePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid branch names\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"regex\",\n\t\t\t\tPattern:  \"github$\",\n\t\t\t},\n\t\t\tTagNamePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid tag names\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"contains\",\n\t\t\t\tPattern:  \"github\",\n\t\t\t},\n\t\t\tCodeScanning: &CodeScanningRuleParameters{\n\t\t\t\tCodeScanningTools: []*RuleCodeScanningTool{\n\t\t\t\t\t{\n\t\t\t\t\t\tAlertsThreshold:         CodeScanningAlertsThresholdErrors,\n\t\t\t\t\t\tSecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher,\n\t\t\t\t\t\tTool:                    \"CodeQL\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.CreateRepositoryRuleset returned error: %v\", err)\n\t}\n\n\twant := &RepositoryRuleset{\n\t\tID:          Ptr(int64(84)),\n\t\tName:        \"ruleset\",\n\t\tTarget:      Ptr(RulesetTargetBranch),\n\t\tSourceType:  Ptr(RulesetSourceTypeEnterprise),\n\t\tSource:      \"e\",\n\t\tEnforcement: \"active\",\n\t\tBypassActors: []*BypassActor{\n\t\t\t{\n\t\t\t\tActorID:   Ptr(int64(234)),\n\t\t\t\tActorType: Ptr(BypassActorTypeTeam),\n\t\t\t},\n\t\t},\n\t\tConditions: &RepositoryRulesetConditions{\n\t\t\tOrganizationName: &RepositoryRulesetOrganizationNamesConditionParameters{\n\t\t\t\tInclude: []string{\"important_organization\", \"another_important_organization\"},\n\t\t\t\tExclude: []string{\"unimportant_organization\"},\n\t\t\t},\n\t\t\tRepositoryName: &RepositoryRulesetRepositoryNamesConditionParameters{\n\t\t\t\tInclude:   []string{\"important_repository\", \"another_important_repository\"},\n\t\t\t\tExclude:   []string{\"unimportant_repository\"},\n\t\t\t\tProtected: Ptr(true),\n\t\t\t},\n\t\t\tRefName: &RepositoryRulesetRefConditionParameters{\n\t\t\t\tInclude: []string{\"refs/heads/main\", \"refs/heads/master\"},\n\t\t\t\tExclude: []string{\"refs/heads/dev*\"},\n\t\t\t},\n\t\t},\n\t\tRules: &RepositoryRulesetRules{\n\t\t\tCreation: &EmptyRuleParameters{},\n\t\t\tUpdate: &UpdateRuleParameters{\n\t\t\t\tUpdateAllowsFetchAndMerge: true,\n\t\t\t},\n\t\t\tDeletion:              &EmptyRuleParameters{},\n\t\t\tRequiredLinearHistory: &EmptyRuleParameters{},\n\t\t\tRequiredDeployments: &RequiredDeploymentsRuleParameters{\n\t\t\t\tRequiredDeploymentEnvironments: []string{\"test\"},\n\t\t\t},\n\t\t\tRequiredSignatures: &EmptyRuleParameters{},\n\t\t\tPullRequest: &PullRequestRuleParameters{\n\t\t\t\tAllowedMergeMethods:            []PullRequestMergeMethod{PullRequestMergeMethodRebase, PullRequestMergeMethodSquash},\n\t\t\t\tDismissStaleReviewsOnPush:      true,\n\t\t\t\tRequireCodeOwnerReview:         true,\n\t\t\t\tRequireLastPushApproval:        true,\n\t\t\t\tRequiredApprovingReviewCount:   1,\n\t\t\t\tRequiredReviewThreadResolution: true,\n\t\t\t},\n\t\t\tRequiredStatusChecks: &RequiredStatusChecksRuleParameters{\n\t\t\t\tDoNotEnforceOnCreate: Ptr(true),\n\t\t\t\tRequiredStatusChecks: []*RuleStatusCheck{\n\t\t\t\t\t{\n\t\t\t\t\t\tContext:       \"test\",\n\t\t\t\t\t\tIntegrationID: Ptr(int64(1)),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tStrictRequiredStatusChecksPolicy: true,\n\t\t\t},\n\t\t\tNonFastForward: &EmptyRuleParameters{},\n\t\t\tCommitMessagePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid test commits\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"starts_with\",\n\t\t\t\tPattern:  \"[test]\",\n\t\t\t},\n\t\t\tCommitAuthorEmailPattern: &PatternRuleParameters{\n\t\t\t\tOperator: \"contains\",\n\t\t\t\tPattern:  \"github\",\n\t\t\t},\n\t\t\tCommitterEmailPattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid commit emails\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"ends_with\",\n\t\t\t\tPattern:  \"abc\",\n\t\t\t},\n\t\t\tBranchNamePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid branch names\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"regex\",\n\t\t\t\tPattern:  \"github$\",\n\t\t\t},\n\t\t\tTagNamePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid tag names\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"contains\",\n\t\t\t\tPattern:  \"github\",\n\t\t\t},\n\t\t\tCodeScanning: &CodeScanningRuleParameters{\n\t\t\t\tCodeScanningTools: []*RuleCodeScanningTool{\n\t\t\t\t\t{\n\t\t\t\t\t\tAlertsThreshold:         CodeScanningAlertsThresholdErrors,\n\t\t\t\t\t\tSecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher,\n\t\t\t\t\t\tTool:                    \"CodeQL\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(ruleset, want) {\n\t\tt.Errorf(\"Enterprise.CreateRepositoryRuleset returned %+v, want %+v\", ruleset, want)\n\t}\n\n\tconst methodName = \"CreateRepositoryRuleset\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.CreateRepositoryRuleset(ctx, \"e\", RepositoryRuleset{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_UpdateRepositoryRuleset_OmitZero_Nil(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/rulesets/84\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\n\t\tvar v map[string]any\n\t\tif err := json.NewDecoder(r.Body).Decode(&v); err != nil {\n\t\t\tt.Errorf(\"could not decode body: %v\", err)\n\t\t}\n\n\t\tif _, ok := v[\"bypass_actors\"]; ok {\n\t\t\tt.Error(\"Request body contained 'bypass_actors', expected it to be omitted\")\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\": 84, \"name\": \"test ruleset\"}`)\n\t})\n\n\tctx := t.Context()\n\tinput := RepositoryRuleset{\n\t\tName:         \"test ruleset\",\n\t\tBypassActors: nil,\n\t}\n\n\t_, _, err := client.Enterprise.UpdateRepositoryRuleset(ctx, \"e\", 84, input)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.UpdateRepositoryRuleset returned error: %v\", err)\n\t}\n}\n\nfunc TestEnterpriseService_UpdateRepositoryRuleset_OmitZero_EmptySlice(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/rulesets/84\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\n\t\ttestBody(t, r, `{\"name\":\"test ruleset\",\"source\":\"\",\"enforcement\":\"\",\"bypass_actors\":[]}`+\"\\n\")\n\n\t\tfmt.Fprint(w, `{\"id\": 84, \"name\": \"test ruleset\", \"bypass_actors\": []}`)\n\t})\n\n\tctx := t.Context()\n\tinput := RepositoryRuleset{\n\t\tName:         \"test ruleset\",\n\t\tBypassActors: []*BypassActor{},\n\t}\n\n\t_, _, err := client.Enterprise.UpdateRepositoryRuleset(ctx, \"e\", 84, input)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.UpdateRepositoryRuleset returned error: %v\", err)\n\t}\n}\n\nfunc TestEnterpriseService_CreateRepositoryRuleset_OrgNameRepoProperty(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/rulesets\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 84,\n\t\t\t\"name\": \"ruleset\",\n\t\t\t\"target\": \"branch\",\n\t\t\t\"source_type\": \"Enterprise\",\n\t\t\t\"source\": \"e\",\n\t\t\t\"enforcement\": \"active\",\n\t\t\t\"bypass_actors\": [\n\t\t\t\t{\n\t\t\t\t\t\"actor_id\": 234,\n\t\t\t\t\t\"actor_type\": \"Team\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"conditions\": {\n\t\t\t\t\"organization_name\": {\n\t\t\t\t\t\"include\": [\n\t\t\t\t\t\t\"important_organization\",\n\t\t\t\t\t\t\"another_important_organization\"\n\t\t\t\t\t],\n\t\t\t\t\t\"exclude\": [\n\t\t\t\t\t\t\"unimportant_organization\"\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t  \"repository_property\": {\n\t\t\t\t\t\"include\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"testIncludeProp\",\n\t\t\t\t\t\t\t\"source\": \"custom\",\n\t\t\t\t\t\t\t\"property_values\": [\n\t\t\t\t\t\t\t\t\"true\"\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"exclude\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"testExcludeProp\",\n\t\t\t\t\t\t\t\"property_values\": [\n\t\t\t\t\t\t\t\t\"false\"\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t  \"ref_name\": {\n\t\t\t\t\t\"include\": [\n\t\t\t\t\t\t\"refs/heads/main\",\n\t\t\t\t\t\t\"refs/heads/master\"\n\t\t\t\t\t],\n\t\t\t\t\t\"exclude\": [\n\t\t\t\t\t\t\"refs/heads/dev*\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"rules\": [\n\t\t\t  {\n\t\t\t\t\"type\": \"creation\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"update\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"update_allows_fetch_and_merge\": true\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"deletion\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"required_linear_history\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"required_deployments\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"required_deployment_environments\": [\"test\"]\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"required_signatures\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"pull_request\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t\t\"allowed_merge_methods\": [\"rebase\",\"squash\"],\n\t\t\t\t  \"dismiss_stale_reviews_on_push\": true,\n\t\t\t\t  \"require_code_owner_review\": true,\n\t\t\t\t  \"require_last_push_approval\": true,\n\t\t\t\t  \"required_approving_review_count\": 1,\n\t\t\t\t  \"required_review_thread_resolution\": true\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"required_status_checks\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t\t\"do_not_enforce_on_create\": true,\n\t\t\t\t  \"required_status_checks\": [\n\t\t\t\t\t{\n\t\t\t\t\t  \"context\": \"test\",\n\t\t\t\t\t  \"integration_id\": 1\n\t\t\t\t\t}\n\t\t\t\t  ],\n\t\t\t\t  \"strict_required_status_checks_policy\": true\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"non_fast_forward\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"commit_message_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"name\": \"avoid test commits\",\n\t\t\t\t  \"negate\": true,\n\t\t\t\t  \"operator\": \"starts_with\",\n\t\t\t\t  \"pattern\": \"[test]\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"commit_author_email_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"operator\": \"contains\",\n\t\t\t\t  \"pattern\": \"github\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"committer_email_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"name\": \"avoid commit emails\",\n\t\t\t\t  \"negate\": true,\n\t\t\t\t  \"operator\": \"ends_with\",\n\t\t\t\t  \"pattern\": \"abc\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"branch_name_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"name\": \"avoid branch names\",\n\t\t\t\t  \"negate\": true,\n\t\t\t\t  \"operator\": \"regex\",\n\t\t\t\t  \"pattern\": \"github$\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"tag_name_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"name\": \"avoid tag names\",\n\t\t\t\t  \"negate\": true,\n\t\t\t\t  \"operator\": \"contains\",\n\t\t\t\t  \"pattern\": \"github\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t    \"type\": \"code_scanning\",\n\t\t\t    \"parameters\": {\n\t\t\t\t  \"code_scanning_tools\": [\n\t\t\t\t    {\n\t\t\t\t\t  \"tool\": \"CodeQL\",\n\t\t\t\t\t  \"security_alerts_threshold\": \"high_or_higher\",\n\t\t\t\t\t  \"alerts_threshold\": \"errors\"\n\t\t\t\t    }\n\t\t\t\t  ]\n\t\t\t    }\n\t\t\t  }\n\t\t\t]\n\t\t  }`)\n\t})\n\n\tctx := t.Context()\n\truleset, _, err := client.Enterprise.CreateRepositoryRuleset(ctx, \"e\", RepositoryRuleset{\n\t\tName:        \"ruleset\",\n\t\tTarget:      Ptr(RulesetTargetBranch),\n\t\tEnforcement: \"active\",\n\t\tBypassActors: []*BypassActor{\n\t\t\t{\n\t\t\t\tActorID:   Ptr(int64(234)),\n\t\t\t\tActorType: Ptr(BypassActorTypeTeam),\n\t\t\t},\n\t\t},\n\t\tConditions: &RepositoryRulesetConditions{\n\t\t\tOrganizationName: &RepositoryRulesetOrganizationNamesConditionParameters{\n\t\t\t\tInclude: []string{\"important_organization\", \"another_important_organization\"},\n\t\t\t\tExclude: []string{\"unimportant_organization\"},\n\t\t\t},\n\t\t\tRepositoryProperty: &RepositoryRulesetRepositoryPropertyConditionParameters{\n\t\t\t\tInclude: []*RepositoryRulesetRepositoryPropertyTargetParameters{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:           \"testIncludeProp\",\n\t\t\t\t\t\tSource:         Ptr(\"custom\"),\n\t\t\t\t\t\tPropertyValues: []string{\"true\"},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tExclude: []*RepositoryRulesetRepositoryPropertyTargetParameters{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:           \"testExcludeProp\",\n\t\t\t\t\t\tPropertyValues: []string{\"false\"},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tRefName: &RepositoryRulesetRefConditionParameters{\n\t\t\t\tInclude: []string{\"refs/heads/main\", \"refs/heads/master\"},\n\t\t\t\tExclude: []string{\"refs/heads/dev*\"},\n\t\t\t},\n\t\t},\n\t\tRules: &RepositoryRulesetRules{\n\t\t\tCreation: &EmptyRuleParameters{},\n\t\t\tUpdate: &UpdateRuleParameters{\n\t\t\t\tUpdateAllowsFetchAndMerge: true,\n\t\t\t},\n\t\t\tDeletion:              &EmptyRuleParameters{},\n\t\t\tRequiredLinearHistory: &EmptyRuleParameters{},\n\t\t\tRequiredDeployments: &RequiredDeploymentsRuleParameters{\n\t\t\t\tRequiredDeploymentEnvironments: []string{\"test\"},\n\t\t\t},\n\t\t\tRequiredSignatures: &EmptyRuleParameters{},\n\t\t\tPullRequest: &PullRequestRuleParameters{\n\t\t\t\tAllowedMergeMethods:            []PullRequestMergeMethod{PullRequestMergeMethodRebase, PullRequestMergeMethodSquash},\n\t\t\t\tDismissStaleReviewsOnPush:      true,\n\t\t\t\tRequireCodeOwnerReview:         true,\n\t\t\t\tRequireLastPushApproval:        true,\n\t\t\t\tRequiredApprovingReviewCount:   1,\n\t\t\t\tRequiredReviewThreadResolution: true,\n\t\t\t},\n\t\t\tRequiredStatusChecks: &RequiredStatusChecksRuleParameters{\n\t\t\t\tDoNotEnforceOnCreate: Ptr(true),\n\t\t\t\tRequiredStatusChecks: []*RuleStatusCheck{\n\t\t\t\t\t{\n\t\t\t\t\t\tContext:       \"test\",\n\t\t\t\t\t\tIntegrationID: Ptr(int64(1)),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tStrictRequiredStatusChecksPolicy: true,\n\t\t\t},\n\t\t\tNonFastForward: &EmptyRuleParameters{},\n\t\t\tCommitMessagePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid test commits\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"starts_with\",\n\t\t\t\tPattern:  \"[test]\",\n\t\t\t},\n\t\t\tCommitAuthorEmailPattern: &PatternRuleParameters{\n\t\t\t\tOperator: \"contains\",\n\t\t\t\tPattern:  \"github\",\n\t\t\t},\n\t\t\tCommitterEmailPattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid commit emails\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"ends_with\",\n\t\t\t\tPattern:  \"abc\",\n\t\t\t},\n\t\t\tBranchNamePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid branch names\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"regex\",\n\t\t\t\tPattern:  \"github$\",\n\t\t\t},\n\t\t\tTagNamePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid tag names\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"contains\",\n\t\t\t\tPattern:  \"github\",\n\t\t\t},\n\t\t\tCodeScanning: &CodeScanningRuleParameters{\n\t\t\t\tCodeScanningTools: []*RuleCodeScanningTool{\n\t\t\t\t\t{\n\t\t\t\t\t\tAlertsThreshold:         CodeScanningAlertsThresholdErrors,\n\t\t\t\t\t\tSecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher,\n\t\t\t\t\t\tTool:                    \"CodeQL\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.CreateRepositoryRuleset returned error: %v\", err)\n\t}\n\n\twant := &RepositoryRuleset{\n\t\tID:          Ptr(int64(84)),\n\t\tName:        \"ruleset\",\n\t\tTarget:      Ptr(RulesetTargetBranch),\n\t\tSourceType:  Ptr(RulesetSourceTypeEnterprise),\n\t\tSource:      \"e\",\n\t\tEnforcement: \"active\",\n\t\tBypassActors: []*BypassActor{\n\t\t\t{\n\t\t\t\tActorID:   Ptr(int64(234)),\n\t\t\t\tActorType: Ptr(BypassActorTypeTeam),\n\t\t\t},\n\t\t},\n\t\tConditions: &RepositoryRulesetConditions{\n\t\t\tOrganizationName: &RepositoryRulesetOrganizationNamesConditionParameters{\n\t\t\t\tInclude: []string{\"important_organization\", \"another_important_organization\"},\n\t\t\t\tExclude: []string{\"unimportant_organization\"},\n\t\t\t},\n\t\t\tRepositoryProperty: &RepositoryRulesetRepositoryPropertyConditionParameters{\n\t\t\t\tInclude: []*RepositoryRulesetRepositoryPropertyTargetParameters{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:           \"testIncludeProp\",\n\t\t\t\t\t\tSource:         Ptr(\"custom\"),\n\t\t\t\t\t\tPropertyValues: []string{\"true\"},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tExclude: []*RepositoryRulesetRepositoryPropertyTargetParameters{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:           \"testExcludeProp\",\n\t\t\t\t\t\tPropertyValues: []string{\"false\"},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tRefName: &RepositoryRulesetRefConditionParameters{\n\t\t\t\tInclude: []string{\"refs/heads/main\", \"refs/heads/master\"},\n\t\t\t\tExclude: []string{\"refs/heads/dev*\"},\n\t\t\t},\n\t\t},\n\t\tRules: &RepositoryRulesetRules{\n\t\t\tCreation: &EmptyRuleParameters{},\n\t\t\tUpdate: &UpdateRuleParameters{\n\t\t\t\tUpdateAllowsFetchAndMerge: true,\n\t\t\t},\n\t\t\tDeletion:              &EmptyRuleParameters{},\n\t\t\tRequiredLinearHistory: &EmptyRuleParameters{},\n\t\t\tRequiredDeployments: &RequiredDeploymentsRuleParameters{\n\t\t\t\tRequiredDeploymentEnvironments: []string{\"test\"},\n\t\t\t},\n\t\t\tRequiredSignatures: &EmptyRuleParameters{},\n\t\t\tPullRequest: &PullRequestRuleParameters{\n\t\t\t\tAllowedMergeMethods:            []PullRequestMergeMethod{PullRequestMergeMethodRebase, PullRequestMergeMethodSquash},\n\t\t\t\tDismissStaleReviewsOnPush:      true,\n\t\t\t\tRequireCodeOwnerReview:         true,\n\t\t\t\tRequireLastPushApproval:        true,\n\t\t\t\tRequiredApprovingReviewCount:   1,\n\t\t\t\tRequiredReviewThreadResolution: true,\n\t\t\t},\n\t\t\tRequiredStatusChecks: &RequiredStatusChecksRuleParameters{\n\t\t\t\tDoNotEnforceOnCreate: Ptr(true),\n\t\t\t\tRequiredStatusChecks: []*RuleStatusCheck{\n\t\t\t\t\t{\n\t\t\t\t\t\tContext:       \"test\",\n\t\t\t\t\t\tIntegrationID: Ptr(int64(1)),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tStrictRequiredStatusChecksPolicy: true,\n\t\t\t},\n\t\t\tNonFastForward: &EmptyRuleParameters{},\n\t\t\tCommitMessagePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid test commits\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"starts_with\",\n\t\t\t\tPattern:  \"[test]\",\n\t\t\t},\n\t\t\tCommitAuthorEmailPattern: &PatternRuleParameters{\n\t\t\t\tOperator: \"contains\",\n\t\t\t\tPattern:  \"github\",\n\t\t\t},\n\t\t\tCommitterEmailPattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid commit emails\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"ends_with\",\n\t\t\t\tPattern:  \"abc\",\n\t\t\t},\n\t\t\tBranchNamePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid branch names\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"regex\",\n\t\t\t\tPattern:  \"github$\",\n\t\t\t},\n\t\t\tTagNamePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid tag names\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"contains\",\n\t\t\t\tPattern:  \"github\",\n\t\t\t},\n\t\t\tCodeScanning: &CodeScanningRuleParameters{\n\t\t\t\tCodeScanningTools: []*RuleCodeScanningTool{\n\t\t\t\t\t{\n\t\t\t\t\t\tAlertsThreshold:         CodeScanningAlertsThresholdErrors,\n\t\t\t\t\t\tSecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher,\n\t\t\t\t\t\tTool:                    \"CodeQL\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(ruleset, want) {\n\t\tt.Errorf(\"Enterprise.CreateRepositoryRuleset returned %+v, want %+v\", ruleset, want)\n\t}\n\n\tconst methodName = \"CreateRepositoryRuleset\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.CreateRepositoryRuleset(ctx, \"e\", RepositoryRuleset{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_CreateRepositoryRuleset_OrgIdRepoName(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/rulesets\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 84,\n\t\t\t\"name\": \"ruleset\",\n\t\t\t\"target\": \"branch\",\n\t\t\t\"source_type\": \"Enterprise\",\n\t\t\t\"source\": \"e\",\n\t\t\t\"enforcement\": \"active\",\n\t\t\t\"bypass_actors\": [\n\t\t\t\t{\n\t\t\t\t\t\"actor_id\": 234,\n\t\t\t\t\t\"actor_type\": \"Team\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"conditions\": {\n\t\t\t\t\"organization_id\": {\n\t\t\t\t\t\"organization_ids\": [1001, 1002]\n\t\t\t\t},\n\t\t\t  \"repository_name\": {\n\t\t\t\t\t\"include\": [\n\t\t\t\t\t\t\"important_repository\",\n\t\t\t\t\t\t\"another_important_repository\"\n\t\t\t\t\t],\n\t\t\t\t\t\"exclude\": [\n\t\t\t\t\t\t\"unimportant_repository\"\n\t\t\t\t\t],\n\t\t\t\t\t\"protected\": true\n\t\t\t\t},\n\t\t\t  \"ref_name\": {\n\t\t\t\t\t\"include\": [\n\t\t\t\t\t\t\"refs/heads/main\",\n\t\t\t\t\t\t\"refs/heads/master\"\n\t\t\t\t\t],\n\t\t\t\t\t\"exclude\": [\n\t\t\t\t\t\t\"refs/heads/dev*\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"rules\": [\n\t\t\t  {\n\t\t\t\t\"type\": \"creation\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"update\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"update_allows_fetch_and_merge\": true\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"deletion\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"required_linear_history\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"required_deployments\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"required_deployment_environments\": [\"test\"]\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"required_signatures\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"pull_request\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t\t\"allowed_merge_methods\": [\"rebase\",\"squash\"],\n\t\t\t\t  \"dismiss_stale_reviews_on_push\": true,\n\t\t\t\t  \"require_code_owner_review\": true,\n\t\t\t\t  \"require_last_push_approval\": true,\n\t\t\t\t  \"required_approving_review_count\": 1,\n\t\t\t\t  \"required_review_thread_resolution\": true\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"required_status_checks\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t\t\"do_not_enforce_on_create\": true,\n\t\t\t\t  \"required_status_checks\": [\n\t\t\t\t\t{\n\t\t\t\t\t  \"context\": \"test\",\n\t\t\t\t\t  \"integration_id\": 1\n\t\t\t\t\t}\n\t\t\t\t  ],\n\t\t\t\t  \"strict_required_status_checks_policy\": true\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"non_fast_forward\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"commit_message_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"name\": \"avoid test commits\",\n\t\t\t\t  \"negate\": true,\n\t\t\t\t  \"operator\": \"starts_with\",\n\t\t\t\t  \"pattern\": \"[test]\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"commit_author_email_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"operator\": \"contains\",\n\t\t\t\t  \"pattern\": \"github\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"committer_email_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"name\": \"avoid commit emails\",\n\t\t\t\t  \"negate\": true,\n\t\t\t\t  \"operator\": \"ends_with\",\n\t\t\t\t  \"pattern\": \"abc\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"branch_name_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"name\": \"avoid branch names\",\n\t\t\t\t  \"negate\": true,\n\t\t\t\t  \"operator\": \"regex\",\n\t\t\t\t  \"pattern\": \"github$\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"tag_name_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"name\": \"avoid tag names\",\n\t\t\t\t  \"negate\": true,\n\t\t\t\t  \"operator\": \"contains\",\n\t\t\t\t  \"pattern\": \"github\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t    \"type\": \"code_scanning\",\n\t\t\t    \"parameters\": {\n\t\t\t\t  \"code_scanning_tools\": [\n\t\t\t\t    {\n\t\t\t\t\t  \"tool\": \"CodeQL\",\n\t\t\t\t\t  \"security_alerts_threshold\": \"high_or_higher\",\n\t\t\t\t\t  \"alerts_threshold\": \"errors\"\n\t\t\t\t    }\n\t\t\t\t  ]\n\t\t\t    }\n\t\t\t  }\n\t\t\t]\n\t\t  }`)\n\t})\n\n\tctx := t.Context()\n\truleset, _, err := client.Enterprise.CreateRepositoryRuleset(ctx, \"e\", RepositoryRuleset{\n\t\tName:        \"ruleset\",\n\t\tTarget:      Ptr(RulesetTargetBranch),\n\t\tEnforcement: \"active\",\n\t\tBypassActors: []*BypassActor{\n\t\t\t{\n\t\t\t\tActorID:   Ptr(int64(234)),\n\t\t\t\tActorType: Ptr(BypassActorTypeTeam),\n\t\t\t},\n\t\t},\n\t\tConditions: &RepositoryRulesetConditions{\n\t\t\tOrganizationID: &RepositoryRulesetOrganizationIDsConditionParameters{\n\t\t\t\tOrganizationIDs: []int64{1001, 1002},\n\t\t\t},\n\t\t\tRepositoryName: &RepositoryRulesetRepositoryNamesConditionParameters{\n\t\t\t\tInclude:   []string{\"important_repository\", \"another_important_repository\"},\n\t\t\t\tExclude:   []string{\"unimportant_repository\"},\n\t\t\t\tProtected: Ptr(true),\n\t\t\t},\n\t\t\tRefName: &RepositoryRulesetRefConditionParameters{\n\t\t\t\tInclude: []string{\"refs/heads/main\", \"refs/heads/master\"},\n\t\t\t\tExclude: []string{\"refs/heads/dev*\"},\n\t\t\t},\n\t\t},\n\t\tRules: &RepositoryRulesetRules{\n\t\t\tCreation: &EmptyRuleParameters{},\n\t\t\tUpdate: &UpdateRuleParameters{\n\t\t\t\tUpdateAllowsFetchAndMerge: true,\n\t\t\t},\n\t\t\tDeletion:              &EmptyRuleParameters{},\n\t\t\tRequiredLinearHistory: &EmptyRuleParameters{},\n\t\t\tRequiredDeployments: &RequiredDeploymentsRuleParameters{\n\t\t\t\tRequiredDeploymentEnvironments: []string{\"test\"},\n\t\t\t},\n\t\t\tRequiredSignatures: &EmptyRuleParameters{},\n\t\t\tPullRequest: &PullRequestRuleParameters{\n\t\t\t\tAllowedMergeMethods:            []PullRequestMergeMethod{PullRequestMergeMethodRebase, PullRequestMergeMethodSquash},\n\t\t\t\tDismissStaleReviewsOnPush:      true,\n\t\t\t\tRequireCodeOwnerReview:         true,\n\t\t\t\tRequireLastPushApproval:        true,\n\t\t\t\tRequiredApprovingReviewCount:   1,\n\t\t\t\tRequiredReviewThreadResolution: true,\n\t\t\t},\n\t\t\tRequiredStatusChecks: &RequiredStatusChecksRuleParameters{\n\t\t\t\tDoNotEnforceOnCreate: Ptr(true),\n\t\t\t\tRequiredStatusChecks: []*RuleStatusCheck{\n\t\t\t\t\t{\n\t\t\t\t\t\tContext:       \"test\",\n\t\t\t\t\t\tIntegrationID: Ptr(int64(1)),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tStrictRequiredStatusChecksPolicy: true,\n\t\t\t},\n\t\t\tNonFastForward: &EmptyRuleParameters{},\n\t\t\tCommitMessagePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid test commits\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"starts_with\",\n\t\t\t\tPattern:  \"[test]\",\n\t\t\t},\n\t\t\tCommitAuthorEmailPattern: &PatternRuleParameters{\n\t\t\t\tOperator: \"contains\",\n\t\t\t\tPattern:  \"github\",\n\t\t\t},\n\t\t\tCommitterEmailPattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid commit emails\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"ends_with\",\n\t\t\t\tPattern:  \"abc\",\n\t\t\t},\n\t\t\tBranchNamePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid branch names\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"regex\",\n\t\t\t\tPattern:  \"github$\",\n\t\t\t},\n\t\t\tTagNamePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid tag names\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"contains\",\n\t\t\t\tPattern:  \"github\",\n\t\t\t},\n\t\t\tCodeScanning: &CodeScanningRuleParameters{\n\t\t\t\tCodeScanningTools: []*RuleCodeScanningTool{\n\t\t\t\t\t{\n\t\t\t\t\t\tAlertsThreshold:         CodeScanningAlertsThresholdErrors,\n\t\t\t\t\t\tSecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher,\n\t\t\t\t\t\tTool:                    \"CodeQL\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.CreateRepositoryRuleset returned error: %v\", err)\n\t}\n\n\twant := &RepositoryRuleset{\n\t\tID:          Ptr(int64(84)),\n\t\tName:        \"ruleset\",\n\t\tTarget:      Ptr(RulesetTargetBranch),\n\t\tSourceType:  Ptr(RulesetSourceTypeEnterprise),\n\t\tSource:      \"e\",\n\t\tEnforcement: \"active\",\n\t\tBypassActors: []*BypassActor{\n\t\t\t{\n\t\t\t\tActorID:   Ptr(int64(234)),\n\t\t\t\tActorType: Ptr(BypassActorTypeTeam),\n\t\t\t},\n\t\t},\n\t\tConditions: &RepositoryRulesetConditions{\n\t\t\tOrganizationID: &RepositoryRulesetOrganizationIDsConditionParameters{\n\t\t\t\tOrganizationIDs: []int64{1001, 1002},\n\t\t\t},\n\t\t\tRepositoryName: &RepositoryRulesetRepositoryNamesConditionParameters{\n\t\t\t\tInclude:   []string{\"important_repository\", \"another_important_repository\"},\n\t\t\t\tExclude:   []string{\"unimportant_repository\"},\n\t\t\t\tProtected: Ptr(true),\n\t\t\t},\n\t\t\tRefName: &RepositoryRulesetRefConditionParameters{\n\t\t\t\tInclude: []string{\"refs/heads/main\", \"refs/heads/master\"},\n\t\t\t\tExclude: []string{\"refs/heads/dev*\"},\n\t\t\t},\n\t\t},\n\t\tRules: &RepositoryRulesetRules{\n\t\t\tCreation: &EmptyRuleParameters{},\n\t\t\tUpdate: &UpdateRuleParameters{\n\t\t\t\tUpdateAllowsFetchAndMerge: true,\n\t\t\t},\n\t\t\tDeletion:              &EmptyRuleParameters{},\n\t\t\tRequiredLinearHistory: &EmptyRuleParameters{},\n\t\t\tRequiredDeployments: &RequiredDeploymentsRuleParameters{\n\t\t\t\tRequiredDeploymentEnvironments: []string{\"test\"},\n\t\t\t},\n\t\t\tRequiredSignatures: &EmptyRuleParameters{},\n\t\t\tPullRequest: &PullRequestRuleParameters{\n\t\t\t\tAllowedMergeMethods:            []PullRequestMergeMethod{PullRequestMergeMethodRebase, PullRequestMergeMethodSquash},\n\t\t\t\tDismissStaleReviewsOnPush:      true,\n\t\t\t\tRequireCodeOwnerReview:         true,\n\t\t\t\tRequireLastPushApproval:        true,\n\t\t\t\tRequiredApprovingReviewCount:   1,\n\t\t\t\tRequiredReviewThreadResolution: true,\n\t\t\t},\n\t\t\tRequiredStatusChecks: &RequiredStatusChecksRuleParameters{\n\t\t\t\tDoNotEnforceOnCreate: Ptr(true),\n\t\t\t\tRequiredStatusChecks: []*RuleStatusCheck{\n\t\t\t\t\t{\n\t\t\t\t\t\tContext:       \"test\",\n\t\t\t\t\t\tIntegrationID: Ptr(int64(1)),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tStrictRequiredStatusChecksPolicy: true,\n\t\t\t},\n\t\t\tNonFastForward: &EmptyRuleParameters{},\n\t\t\tCommitMessagePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid test commits\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"starts_with\",\n\t\t\t\tPattern:  \"[test]\",\n\t\t\t},\n\t\t\tCommitAuthorEmailPattern: &PatternRuleParameters{\n\t\t\t\tOperator: \"contains\",\n\t\t\t\tPattern:  \"github\",\n\t\t\t},\n\t\t\tCommitterEmailPattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid commit emails\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"ends_with\",\n\t\t\t\tPattern:  \"abc\",\n\t\t\t},\n\t\t\tBranchNamePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid branch names\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"regex\",\n\t\t\t\tPattern:  \"github$\",\n\t\t\t},\n\t\t\tTagNamePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid tag names\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"contains\",\n\t\t\t\tPattern:  \"github\",\n\t\t\t},\n\t\t\tCodeScanning: &CodeScanningRuleParameters{\n\t\t\t\tCodeScanningTools: []*RuleCodeScanningTool{\n\t\t\t\t\t{\n\t\t\t\t\t\tAlertsThreshold:         CodeScanningAlertsThresholdErrors,\n\t\t\t\t\t\tSecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher,\n\t\t\t\t\t\tTool:                    \"CodeQL\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(ruleset, want) {\n\t\tt.Errorf(\"Enterprise.CreateRepositoryRuleset returned %+v, want %+v\", ruleset, want)\n\t}\n\n\tconst methodName = \"CreateRepositoryRuleset\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.CreateRepositoryRuleset(ctx, \"e\", RepositoryRuleset{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_CreateRepositoryRuleset_OrgIdRepoProperty(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/rulesets\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 84,\n\t\t\t\"name\": \"ruleset\",\n\t\t\t\"target\": \"branch\",\n\t\t\t\"source_type\": \"Enterprise\",\n\t\t\t\"source\": \"e\",\n\t\t\t\"enforcement\": \"active\",\n\t\t\t\"bypass_actors\": [\n\t\t\t\t{\n\t\t\t\t\t\"actor_id\": 234,\n\t\t\t\t\t\"actor_type\": \"Team\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"conditions\": {\n\t\t\t\t\"organization_id\": {\n\t\t\t\t\t\"organization_ids\": [1001, 1002]\n\t\t\t\t},\n\t\t\t  \"repository_property\": {\n\t\t\t\t\t\"include\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"testIncludeProp\",\n\t\t\t\t\t\t\t\"source\": \"custom\",\n\t\t\t\t\t\t\t\"property_values\": [\n\t\t\t\t\t\t\t\t\"true\"\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"exclude\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"name\": \"testExcludeProp\",\n\t\t\t\t\t\t\t\"property_values\": [\n\t\t\t\t\t\t\t\t\"false\"\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t  \"ref_name\": {\n\t\t\t\t\t\"include\": [\n\t\t\t\t\t\t\"refs/heads/main\",\n\t\t\t\t\t\t\"refs/heads/master\"\n\t\t\t\t\t],\n\t\t\t\t\t\"exclude\": [\n\t\t\t\t\t\t\"refs/heads/dev*\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"rules\": [\n\t\t\t  {\n\t\t\t\t\"type\": \"creation\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"update\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"update_allows_fetch_and_merge\": true\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"deletion\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"required_linear_history\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"required_deployments\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"required_deployment_environments\": [\"test\"]\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"required_signatures\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"pull_request\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t\t\"allowed_merge_methods\": [\"rebase\",\"squash\"],\n\t\t\t\t  \"dismiss_stale_reviews_on_push\": true,\n\t\t\t\t  \"require_code_owner_review\": true,\n\t\t\t\t  \"require_last_push_approval\": true,\n\t\t\t\t  \"required_approving_review_count\": 1,\n\t\t\t\t  \"required_review_thread_resolution\": true\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"required_status_checks\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t\t\"do_not_enforce_on_create\": true,\n\t\t\t\t  \"required_status_checks\": [\n\t\t\t\t\t{\n\t\t\t\t\t  \"context\": \"test\",\n\t\t\t\t\t  \"integration_id\": 1\n\t\t\t\t\t}\n\t\t\t\t  ],\n\t\t\t\t  \"strict_required_status_checks_policy\": true\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"non_fast_forward\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"commit_message_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"name\": \"avoid test commits\",\n\t\t\t\t  \"negate\": true,\n\t\t\t\t  \"operator\": \"starts_with\",\n\t\t\t\t  \"pattern\": \"[test]\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"commit_author_email_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"operator\": \"contains\",\n\t\t\t\t  \"pattern\": \"github\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"committer_email_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"name\": \"avoid commit emails\",\n\t\t\t\t  \"negate\": true,\n\t\t\t\t  \"operator\": \"ends_with\",\n\t\t\t\t  \"pattern\": \"abc\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"branch_name_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"name\": \"avoid branch names\",\n\t\t\t\t  \"negate\": true,\n\t\t\t\t  \"operator\": \"regex\",\n\t\t\t\t  \"pattern\": \"github$\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"tag_name_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"name\": \"avoid tag names\",\n\t\t\t\t  \"negate\": true,\n\t\t\t\t  \"operator\": \"contains\",\n\t\t\t\t  \"pattern\": \"github\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t    \"type\": \"code_scanning\",\n\t\t\t    \"parameters\": {\n\t\t\t\t  \"code_scanning_tools\": [\n\t\t\t\t    {\n\t\t\t\t\t  \"tool\": \"CodeQL\",\n\t\t\t\t\t  \"security_alerts_threshold\": \"high_or_higher\",\n\t\t\t\t\t  \"alerts_threshold\": \"errors\"\n\t\t\t\t    }\n\t\t\t\t  ]\n\t\t\t    }\n\t\t\t  }\n\t\t\t]\n\t\t  }`)\n\t})\n\n\tctx := t.Context()\n\truleset, _, err := client.Enterprise.CreateRepositoryRuleset(ctx, \"e\", RepositoryRuleset{\n\t\tName:        \"ruleset\",\n\t\tTarget:      Ptr(RulesetTargetBranch),\n\t\tEnforcement: \"active\",\n\t\tBypassActors: []*BypassActor{\n\t\t\t{\n\t\t\t\tActorID:   Ptr(int64(234)),\n\t\t\t\tActorType: Ptr(BypassActorTypeTeam),\n\t\t\t},\n\t\t},\n\t\tConditions: &RepositoryRulesetConditions{\n\t\t\tOrganizationID: &RepositoryRulesetOrganizationIDsConditionParameters{\n\t\t\t\tOrganizationIDs: []int64{1001, 1002},\n\t\t\t},\n\t\t\tRepositoryProperty: &RepositoryRulesetRepositoryPropertyConditionParameters{\n\t\t\t\tInclude: []*RepositoryRulesetRepositoryPropertyTargetParameters{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:           \"testIncludeProp\",\n\t\t\t\t\t\tSource:         Ptr(\"custom\"),\n\t\t\t\t\t\tPropertyValues: []string{\"true\"},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tExclude: []*RepositoryRulesetRepositoryPropertyTargetParameters{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:           \"testExcludeProp\",\n\t\t\t\t\t\tPropertyValues: []string{\"false\"},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tRefName: &RepositoryRulesetRefConditionParameters{\n\t\t\t\tInclude: []string{\"refs/heads/main\", \"refs/heads/master\"},\n\t\t\t\tExclude: []string{\"refs/heads/dev*\"},\n\t\t\t},\n\t\t},\n\t\tRules: &RepositoryRulesetRules{\n\t\t\tCreation: &EmptyRuleParameters{},\n\t\t\tUpdate: &UpdateRuleParameters{\n\t\t\t\tUpdateAllowsFetchAndMerge: true,\n\t\t\t},\n\t\t\tDeletion:              &EmptyRuleParameters{},\n\t\t\tRequiredLinearHistory: &EmptyRuleParameters{},\n\t\t\tRequiredDeployments: &RequiredDeploymentsRuleParameters{\n\t\t\t\tRequiredDeploymentEnvironments: []string{\"test\"},\n\t\t\t},\n\t\t\tRequiredSignatures: &EmptyRuleParameters{},\n\t\t\tPullRequest: &PullRequestRuleParameters{\n\t\t\t\tAllowedMergeMethods:            []PullRequestMergeMethod{PullRequestMergeMethodRebase, PullRequestMergeMethodSquash},\n\t\t\t\tDismissStaleReviewsOnPush:      true,\n\t\t\t\tRequireCodeOwnerReview:         true,\n\t\t\t\tRequireLastPushApproval:        true,\n\t\t\t\tRequiredApprovingReviewCount:   1,\n\t\t\t\tRequiredReviewThreadResolution: true,\n\t\t\t},\n\t\t\tRequiredStatusChecks: &RequiredStatusChecksRuleParameters{\n\t\t\t\tDoNotEnforceOnCreate: Ptr(true),\n\t\t\t\tRequiredStatusChecks: []*RuleStatusCheck{\n\t\t\t\t\t{\n\t\t\t\t\t\tContext:       \"test\",\n\t\t\t\t\t\tIntegrationID: Ptr(int64(1)),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tStrictRequiredStatusChecksPolicy: true,\n\t\t\t},\n\t\t\tNonFastForward: &EmptyRuleParameters{},\n\t\t\tCommitMessagePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid test commits\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"starts_with\",\n\t\t\t\tPattern:  \"[test]\",\n\t\t\t},\n\t\t\tCommitAuthorEmailPattern: &PatternRuleParameters{\n\t\t\t\tOperator: \"contains\",\n\t\t\t\tPattern:  \"github\",\n\t\t\t},\n\t\t\tCommitterEmailPattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid commit emails\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"ends_with\",\n\t\t\t\tPattern:  \"abc\",\n\t\t\t},\n\t\t\tBranchNamePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid branch names\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"regex\",\n\t\t\t\tPattern:  \"github$\",\n\t\t\t},\n\t\t\tTagNamePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid tag names\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"contains\",\n\t\t\t\tPattern:  \"github\",\n\t\t\t},\n\t\t\tCodeScanning: &CodeScanningRuleParameters{\n\t\t\t\tCodeScanningTools: []*RuleCodeScanningTool{\n\t\t\t\t\t{\n\t\t\t\t\t\tAlertsThreshold:         CodeScanningAlertsThresholdErrors,\n\t\t\t\t\t\tSecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher,\n\t\t\t\t\t\tTool:                    \"CodeQL\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.CreateRepositoryRuleset returned error: %v\", err)\n\t}\n\n\twant := &RepositoryRuleset{\n\t\tID:          Ptr(int64(84)),\n\t\tName:        \"ruleset\",\n\t\tTarget:      Ptr(RulesetTargetBranch),\n\t\tSourceType:  Ptr(RulesetSourceTypeEnterprise),\n\t\tSource:      \"e\",\n\t\tEnforcement: \"active\",\n\t\tBypassActors: []*BypassActor{\n\t\t\t{\n\t\t\t\tActorID:   Ptr(int64(234)),\n\t\t\t\tActorType: Ptr(BypassActorTypeTeam),\n\t\t\t},\n\t\t},\n\t\tConditions: &RepositoryRulesetConditions{\n\t\t\tOrganizationID: &RepositoryRulesetOrganizationIDsConditionParameters{\n\t\t\t\tOrganizationIDs: []int64{1001, 1002},\n\t\t\t},\n\t\t\tRepositoryProperty: &RepositoryRulesetRepositoryPropertyConditionParameters{\n\t\t\t\tInclude: []*RepositoryRulesetRepositoryPropertyTargetParameters{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:           \"testIncludeProp\",\n\t\t\t\t\t\tSource:         Ptr(\"custom\"),\n\t\t\t\t\t\tPropertyValues: []string{\"true\"},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tExclude: []*RepositoryRulesetRepositoryPropertyTargetParameters{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:           \"testExcludeProp\",\n\t\t\t\t\t\tPropertyValues: []string{\"false\"},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tRefName: &RepositoryRulesetRefConditionParameters{\n\t\t\t\tInclude: []string{\"refs/heads/main\", \"refs/heads/master\"},\n\t\t\t\tExclude: []string{\"refs/heads/dev*\"},\n\t\t\t},\n\t\t},\n\t\tRules: &RepositoryRulesetRules{\n\t\t\tCreation: &EmptyRuleParameters{},\n\t\t\tUpdate: &UpdateRuleParameters{\n\t\t\t\tUpdateAllowsFetchAndMerge: true,\n\t\t\t},\n\t\t\tDeletion:              &EmptyRuleParameters{},\n\t\t\tRequiredLinearHistory: &EmptyRuleParameters{},\n\t\t\tRequiredDeployments: &RequiredDeploymentsRuleParameters{\n\t\t\t\tRequiredDeploymentEnvironments: []string{\"test\"},\n\t\t\t},\n\t\t\tRequiredSignatures: &EmptyRuleParameters{},\n\t\t\tPullRequest: &PullRequestRuleParameters{\n\t\t\t\tAllowedMergeMethods:            []PullRequestMergeMethod{PullRequestMergeMethodRebase, PullRequestMergeMethodSquash},\n\t\t\t\tDismissStaleReviewsOnPush:      true,\n\t\t\t\tRequireCodeOwnerReview:         true,\n\t\t\t\tRequireLastPushApproval:        true,\n\t\t\t\tRequiredApprovingReviewCount:   1,\n\t\t\t\tRequiredReviewThreadResolution: true,\n\t\t\t},\n\t\t\tRequiredStatusChecks: &RequiredStatusChecksRuleParameters{\n\t\t\t\tDoNotEnforceOnCreate: Ptr(true),\n\t\t\t\tRequiredStatusChecks: []*RuleStatusCheck{\n\t\t\t\t\t{\n\t\t\t\t\t\tContext:       \"test\",\n\t\t\t\t\t\tIntegrationID: Ptr(int64(1)),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tStrictRequiredStatusChecksPolicy: true,\n\t\t\t},\n\t\t\tNonFastForward: &EmptyRuleParameters{},\n\t\t\tCommitMessagePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid test commits\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"starts_with\",\n\t\t\t\tPattern:  \"[test]\",\n\t\t\t},\n\t\t\tCommitAuthorEmailPattern: &PatternRuleParameters{\n\t\t\t\tOperator: \"contains\",\n\t\t\t\tPattern:  \"github\",\n\t\t\t},\n\t\t\tCommitterEmailPattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid commit emails\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"ends_with\",\n\t\t\t\tPattern:  \"abc\",\n\t\t\t},\n\t\t\tBranchNamePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid branch names\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"regex\",\n\t\t\t\tPattern:  \"github$\",\n\t\t\t},\n\t\t\tTagNamePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid tag names\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"contains\",\n\t\t\t\tPattern:  \"github\",\n\t\t\t},\n\t\t\tCodeScanning: &CodeScanningRuleParameters{\n\t\t\t\tCodeScanningTools: []*RuleCodeScanningTool{\n\t\t\t\t\t{\n\t\t\t\t\t\tAlertsThreshold:         CodeScanningAlertsThresholdErrors,\n\t\t\t\t\t\tSecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher,\n\t\t\t\t\t\tTool:                    \"CodeQL\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(ruleset, want) {\n\t\tt.Errorf(\"Enterprise.CreateRepositoryRuleset returned %+v, want %+v\", ruleset, want)\n\t}\n\n\tconst methodName = \"CreateRepositoryRuleset\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.CreateRepositoryRuleset(ctx, \"e\", RepositoryRuleset{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_GetRepositoryRuleset(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/rulesets/84\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 84,\n\t\t\t\"name\": \"test ruleset\",\n\t\t\t\"target\": \"branch\",\n\t\t\t\"source_type\": \"Enterprise\",\n\t\t\t\"source\": \"e\",\n\t\t\t\"enforcement\": \"active\",\n\t\t\t\"bypass_mode\": \"none\",\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"_links\": {\n\t\t\t  \"self\": {\n\t\t\t\t\t\"href\": \"https://api.github.com/enterprises/e/rulesets/84\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"conditions\": {\n\t\t\t\t\"organization_name\": {\n\t\t\t\t\t\"include\": [\n\t\t\t\t\t\t\"important_organization\",\n\t\t\t\t\t\t\"another_important_organization\"\n\t\t\t\t\t],\n\t\t\t\t\t\"exclude\": [\n\t\t\t\t\t\t\"unimportant_organization\"\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"repository_name\": {\n\t\t\t\t\t\"include\": [\n\t\t\t\t\t\t\"important_repository\",\n\t\t\t\t\t\t\"another_important_repository\"\n\t\t\t\t\t],\n\t\t\t\t\t\"exclude\": [\n\t\t\t\t\t\t\"unimportant_repository\"\n\t\t\t\t  ],\n\t\t\t\t  \"protected\": true\n\t\t\t\t},\n\t\t\t\t\"ref_name\": {\n\t\t\t\t\t\"include\": [\n\t\t\t\t\t\t\"refs/heads/main\",\n\t\t\t\t\t\t\"refs/heads/master\"\n\t\t\t\t  ],\n\t\t\t\t  \"exclude\": [\n\t\t\t\t\t\t\"refs/heads/dev*\"\n\t\t\t\t  ]\n\t\t\t\t}\n\t\t\t},\n\t\t\t  \"rules\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"creation\"\n\t\t\t\t\t}\n\t\t\t  ]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\trulesets, _, err := client.Enterprise.GetRepositoryRuleset(ctx, \"e\", 84)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.GetRepositoryRuleset returned error: %v\", err)\n\t}\n\n\twant := &RepositoryRuleset{\n\t\tID:          Ptr(int64(84)),\n\t\tName:        \"test ruleset\",\n\t\tTarget:      Ptr(RulesetTargetBranch),\n\t\tSourceType:  Ptr(RulesetSourceTypeEnterprise),\n\t\tSource:      \"e\",\n\t\tEnforcement: \"active\",\n\t\tNodeID:      Ptr(\"nid\"),\n\t\tLinks: &RepositoryRulesetLinks{\n\t\t\tSelf: &RepositoryRulesetLink{HRef: Ptr(\"https://api.github.com/enterprises/e/rulesets/84\")},\n\t\t},\n\t\tConditions: &RepositoryRulesetConditions{\n\t\t\tOrganizationName: &RepositoryRulesetOrganizationNamesConditionParameters{\n\t\t\t\tInclude: []string{\"important_organization\", \"another_important_organization\"},\n\t\t\t\tExclude: []string{\"unimportant_organization\"},\n\t\t\t},\n\t\t\tRepositoryName: &RepositoryRulesetRepositoryNamesConditionParameters{\n\t\t\t\tInclude:   []string{\"important_repository\", \"another_important_repository\"},\n\t\t\t\tExclude:   []string{\"unimportant_repository\"},\n\t\t\t\tProtected: Ptr(true),\n\t\t\t},\n\t\t\tRefName: &RepositoryRulesetRefConditionParameters{\n\t\t\t\tInclude: []string{\"refs/heads/main\", \"refs/heads/master\"},\n\t\t\t\tExclude: []string{\"refs/heads/dev*\"},\n\t\t\t},\n\t\t},\n\t\tRules: &RepositoryRulesetRules{Creation: &EmptyRuleParameters{}},\n\t}\n\tif !cmp.Equal(rulesets, want) {\n\t\tt.Errorf(\"Enterprise.GetRepositoryRuleset returned %+v, want %+v\", rulesets, want)\n\t}\n\n\tconst methodName = \"GetRepositoryRuleset\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetRepositoryRuleset(ctx, \"e\", 84)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_UpdateRepositoryRuleset(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/rulesets/84\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 84,\n\t\t\t\"name\": \"test ruleset\",\n\t\t\t\"target\": \"branch\",\n\t\t\t\"source_type\": \"Enterprise\",\n\t\t\t\"source\": \"e\",\n\t\t\t\"enforcement\": \"active\",\n\t\t\t\"bypass_mode\": \"none\",\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"_links\": {\n\t\t\t  \"self\": {\n\t\t\t\t\"href\": \"https://api.github.com/enterprises/e/rulesets/84\"\n\t\t\t  }\n\t\t\t},\n\t\t\t\"conditions\": {\n\t\t\t\t\"organization_name\": {\n\t\t\t\t\t\"include\": [\n\t\t\t\t\t\t\"important_organization\",\n\t\t\t\t\t\t\"another_important_organization\"\n\t\t\t\t\t],\n\t\t\t\t\t\"exclude\": [\n\t\t\t\t\t\t\"unimportant_organization\"\n\t\t\t\t\t]\n\t\t\t\t},\n\t\t\t\t\"repository_name\": {\n\t\t\t\t\t\"include\": [\n\t\t\t\t\t\t\"important_repository\",\n\t\t\t\t\t\t\"another_important_repository\"\n\t\t\t\t  ],\n\t\t\t\t\t\"exclude\": [\n\t\t\t\t\t\t\"unimportant_repository\"\n\t\t\t\t\t],\n\t\t\t\t  \"protected\": true\n\t\t\t\t},\n\t\t\t\t\"ref_name\": {\n\t\t\t\t\t\"include\": [\n\t\t\t\t\t\t\"refs/heads/main\",\n\t\t\t\t\t\t\"refs/heads/master\"\n\t\t\t\t\t],\n\t\t\t\t\t\"exclude\": [\n\t\t\t\t\t\t\"refs/heads/dev*\"\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"rules\": [\n\t\t\t\t{\n\t\t\t\t  \"type\": \"creation\"\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\trulesets, _, err := client.Enterprise.UpdateRepositoryRuleset(ctx, \"e\", 84, RepositoryRuleset{\n\t\tName:        \"test ruleset\",\n\t\tTarget:      Ptr(RulesetTargetBranch),\n\t\tEnforcement: \"active\",\n\t\tConditions: &RepositoryRulesetConditions{\n\t\t\tRefName: &RepositoryRulesetRefConditionParameters{\n\t\t\t\tInclude: []string{\"refs/heads/main\", \"refs/heads/master\"},\n\t\t\t\tExclude: []string{\"refs/heads/dev*\"},\n\t\t\t},\n\t\t\tRepositoryName: &RepositoryRulesetRepositoryNamesConditionParameters{\n\t\t\t\tInclude:   []string{\"important_repository\", \"another_important_repository\"},\n\t\t\t\tExclude:   []string{\"unimportant_repository\"},\n\t\t\t\tProtected: Ptr(true),\n\t\t\t},\n\t\t},\n\t\tRules: &RepositoryRulesetRules{Creation: &EmptyRuleParameters{}},\n\t})\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.UpdateRepositoryRuleset returned error: %v\", err)\n\t}\n\n\twant := &RepositoryRuleset{\n\t\tID:          Ptr(int64(84)),\n\t\tName:        \"test ruleset\",\n\t\tTarget:      Ptr(RulesetTargetBranch),\n\t\tSourceType:  Ptr(RulesetSourceTypeEnterprise),\n\t\tSource:      \"e\",\n\t\tEnforcement: \"active\",\n\t\tNodeID:      Ptr(\"nid\"),\n\t\tLinks: &RepositoryRulesetLinks{\n\t\t\tSelf: &RepositoryRulesetLink{HRef: Ptr(\"https://api.github.com/enterprises/e/rulesets/84\")},\n\t\t},\n\t\tConditions: &RepositoryRulesetConditions{\n\t\t\tOrganizationName: &RepositoryRulesetOrganizationNamesConditionParameters{\n\t\t\t\tInclude: []string{\"important_organization\", \"another_important_organization\"},\n\t\t\t\tExclude: []string{\"unimportant_organization\"},\n\t\t\t},\n\t\t\tRepositoryName: &RepositoryRulesetRepositoryNamesConditionParameters{\n\t\t\t\tInclude:   []string{\"important_repository\", \"another_important_repository\"},\n\t\t\t\tExclude:   []string{\"unimportant_repository\"},\n\t\t\t\tProtected: Ptr(true),\n\t\t\t},\n\t\t\tRefName: &RepositoryRulesetRefConditionParameters{\n\t\t\t\tInclude: []string{\"refs/heads/main\", \"refs/heads/master\"},\n\t\t\t\tExclude: []string{\"refs/heads/dev*\"},\n\t\t\t},\n\t\t},\n\t\tRules: &RepositoryRulesetRules{Creation: &EmptyRuleParameters{}},\n\t}\n\tif !cmp.Equal(rulesets, want) {\n\t\tt.Errorf(\"Enterprise.UpdateRepositoryRuleset returned %+v, want %+v\", rulesets, want)\n\t}\n\n\tconst methodName = \"UpdateRepositoryRuleset\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.UpdateRepositoryRuleset(ctx, \"e\", 84, RepositoryRuleset{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_DeleteRepositoryRuleset(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/rulesets/84\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Enterprise.DeleteRepositoryRuleset(ctx, \"e\", 84)\n\tif err != nil {\n\t\tt.Errorf(\"Enterprise.DeleteRepositoryRuleset returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteRepositoryRuleset\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Enterprise.DeleteRepositoryRuleset(ctx, \"e\", 84)\n\t})\n}\n"
  },
  {
    "path": "github/enterprise_scim.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// SCIMSchemasURINamespacesGroups is the SCIM schema URI namespace for group resources.\n// This constant represents the standard SCIM core schema for group objects as defined by RFC 7643.\nconst SCIMSchemasURINamespacesGroups = \"urn:ietf:params:scim:schemas:core:2.0:Group\"\n\n// SCIMSchemasURINamespacesUser is the SCIM schema URI namespace for user resources.\n// This constant represents the standard SCIM core schema for user objects as defined by RFC 7643.\nconst SCIMSchemasURINamespacesUser = \"urn:ietf:params:scim:schemas:core:2.0:User\"\n\n// SCIMSchemasURINamespacesListResponse is the SCIM schema URI namespace for list response resources.\n// This constant represents the standard SCIM namespace for list responses used in paginated queries, as defined by RFC 7644.\nconst SCIMSchemasURINamespacesListResponse = \"urn:ietf:params:scim:api:messages:2.0:ListResponse\"\n\n// SCIMSchemasURINamespacesPatchOp is the SCIM schema URI namespace for patch operations.\n// This constant represents the standard SCIM namespace for patch operations as defined by RFC 7644.\nconst SCIMSchemasURINamespacesPatchOp = \"urn:ietf:params:scim:api:messages:2.0:PatchOp\"\n\n// SCIMEnterpriseGroupAttributes represents supported SCIM Enterprise group attributes, and represents the result of calling UpdateSCIMGroupAttribute.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#supported-scim-group-attributes\ntype SCIMEnterpriseGroupAttributes struct {\n\tDisplayName *string                           `json:\"displayName,omitempty\"` // Human-readable name for a group.\n\tMembers     []*SCIMEnterpriseDisplayReference `json:\"members,omitempty\"`     // List of members who are assigned to the group in SCIM provider\n\tExternalID  *string                           `json:\"externalId,omitempty\"`  // This identifier is generated by a SCIM provider. Must be unique per group.\n\tSchemas     []string                          `json:\"schemas,omitempty\"`     // The URIs that are used to indicate the namespaces of the SCIM schemas.\n\t// Bellow: Only populated as a result of calling UpdateSCIMGroupAttribute:\n\tID   *string             `json:\"id,omitempty\"`   // The internally generated id for the group object.\n\tMeta *SCIMEnterpriseMeta `json:\"meta,omitempty\"` // The metadata associated with the creation/updates to the group.\n}\n\n// SCIMEnterpriseDisplayReference represents a JSON SCIM (System for Cross-domain Identity Management) resource reference.\ntype SCIMEnterpriseDisplayReference struct {\n\tValue   string  `json:\"value\"`             // The local unique identifier for the member (e.g., user ID or group ID).\n\tRef     *string `json:\"$ref,omitempty\"`    // The URI reference to the Members or Groups resource (e.g., /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}).\n\tDisplay *string `json:\"display,omitempty\"` // The display name associated with the member (e.g., user name or group name).\n}\n\n// SCIMEnterpriseMeta represents metadata about the SCIM resource.\ntype SCIMEnterpriseMeta struct {\n\tResourceType string     `json:\"resourceType\"`           // A type of a resource (`User` or `Group`).\n\tCreated      *Timestamp `json:\"created,omitempty\"`      // A date and time when the user was created.\n\tLastModified *Timestamp `json:\"lastModified,omitempty\"` // A date and time when the user was last modified.\n\tLocation     *string    `json:\"location,omitempty\"`     // A URL location of an object\n}\n\n// SCIMEnterpriseGroups represents the result of calling ListProvisionedSCIMGroups.\ntype SCIMEnterpriseGroups struct {\n\tSchemas      []string                         `json:\"schemas,omitempty\"`\n\tTotalResults *int                             `json:\"totalResults,omitempty\"`\n\tResources    []*SCIMEnterpriseGroupAttributes `json:\"Resources,omitempty\"`\n\tStartIndex   *int                             `json:\"startIndex,omitempty\"`\n\tItemsPerPage *int                             `json:\"itemsPerPage,omitempty\"`\n}\n\n// ListProvisionedSCIMGroupsEnterpriseOptions represents query parameters for ListProvisionedSCIMGroups.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise--parameters\ntype ListProvisionedSCIMGroupsEnterpriseOptions struct {\n\t// If specified, only results that match the specified filter will be returned.\n\t// Possible filters are `externalId`, `id`, and `displayName`. For example, `externalId eq \"a123\"`.\n\tFilter *string `url:\"filter,omitempty\"`\n\t// Excludes the specified attributes from being returned in the results.\n\tExcludedAttributes *string `url:\"excludedAttributes,omitempty\"`\n\t// Used for pagination: the starting index of the first result to return when paginating through values.\n\t// Default: 1.\n\tStartIndex *int `url:\"startIndex,omitempty\"`\n\t// Used for pagination: the number of results to return per page.\n\t// Default: 30.\n\tCount *int `url:\"count,omitempty\"`\n}\n\n// GetProvisionedSCIMGroupEnterpriseOptions represents query parameters for GetProvisionedSCIMGroup.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-group\ntype GetProvisionedSCIMGroupEnterpriseOptions struct {\n\t// Excludes the specified attributes from being returned in the results.\n\tExcludedAttributes *string `url:\"excludedAttributes,omitempty\"`\n}\n\n// SCIMEnterpriseUserAttributes represents supported SCIM enterprise user attributes, and represents the result of calling UpdateSCIMUserAttribute.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#supported-scim-user-attributes\ntype SCIMEnterpriseUserAttributes struct {\n\tDisplayName string                     `json:\"displayName\"`     // Human-readable name for a user\n\tName        *SCIMEnterpriseUserName    `json:\"name,omitempty\"`  // The user's full name\n\tUserName    string                     `json:\"userName\"`        // The username for the user (GitHub Account after normalized), generated by the SCIM provider. Must be unique per user.\n\tEmails      []*SCIMEnterpriseUserEmail `json:\"emails\"`          // List of the user's emails. They all must be unique per user.\n\tRoles       []*SCIMEnterpriseUserRole  `json:\"roles,omitempty\"` // List of the user's roles.\n\tExternalID  string                     `json:\"externalId\"`      // This identifier is generated by a SCIM provider. Must be unique per user.\n\tActive      bool                       `json:\"active\"`          // Indicates whether the identity is active (true) or should be suspended (false).\n\tSchemas     []string                   `json:\"schemas\"`         // The URIs that are used to indicate the namespaces of the SCIM schemas.\n\t// Bellow: Only populated as a result of calling UpdateSCIMUserAttribute:\n\tID     *string                           `json:\"id,omitempty\"`     // Identifier generated by the GitHub's SCIM endpoint.\n\tGroups []*SCIMEnterpriseDisplayReference `json:\"groups,omitempty\"` // List of groups who are assigned to the user in SCIM provider\n\tMeta   *SCIMEnterpriseMeta               `json:\"meta,omitempty\"`   // The metadata associated with the creation/updates to the user.\n}\n\n// SCIMEnterpriseUserName represents SCIM enterprise user's name information.\ntype SCIMEnterpriseUserName struct {\n\tGivenName  string  `json:\"givenName\"`            // The first name of the user.\n\tFamilyName string  `json:\"familyName\"`           // The last name of the user.\n\tFormatted  *string `json:\"formatted,omitempty\"`  // The user's full name, including all middle names, titles, and suffixes, formatted for display.\n\tMiddleName *string `json:\"middleName,omitempty\"` // The middle name(s) of the user.\n}\n\n// SCIMEnterpriseUserEmail represents SCIM enterprise user's emails.\ntype SCIMEnterpriseUserEmail struct {\n\tValue   string `json:\"value\"`   // The email address.\n\tPrimary bool   `json:\"primary\"` // Whether this email address is the primary address.\n\tType    string `json:\"type\"`    // The type of email address\n}\n\n// SCIMEnterpriseUserRole is an enterprise-wide role granted to the user.\ntype SCIMEnterpriseUserRole struct {\n\tValue   string  `json:\"value\"` // The role value representing a user role in GitHub.\n\tDisplay *string `json:\"display,omitempty\"`\n\tType    *string `json:\"type,omitempty\"`\n\tPrimary *bool   `json:\"primary,omitempty\"` // Is the role a primary role for the user?\n}\n\n// SCIMEnterpriseUsers represents the result of calling ListProvisionedSCIMUsers.\ntype SCIMEnterpriseUsers struct {\n\tSchemas      []string                        `json:\"schemas,omitempty\"`\n\tTotalResults *int                            `json:\"totalResults,omitempty\"`\n\tItemsPerPage *int                            `json:\"itemsPerPage,omitempty\"`\n\tStartIndex   *int                            `json:\"startIndex,omitempty\"`\n\tResources    []*SCIMEnterpriseUserAttributes `json:\"Resources,omitempty\"`\n}\n\n// ListProvisionedSCIMUsersEnterpriseOptions represents query parameters for ListProvisionedSCIMUsers.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#list-scim-provisioned-identities-for-an-enterprise\ntype ListProvisionedSCIMUsersEnterpriseOptions struct {\n\t// If specified, only results that match the specified filter will be returned.\n\t// Possible filters are `userName`, `externalId`, `id`, and `displayName`. For example, `externalId eq \"a123\"`.\n\tFilter *string `url:\"filter,omitempty\"`\n\t// Used for pagination: the starting index of the first result to return when paginating through values.\n\t// Default: 1.\n\tStartIndex *int `url:\"startIndex,omitempty\"`\n\t// Used for pagination: the number of results to return per page.\n\t// Default: 30.\n\tCount *int `url:\"count,omitempty\"`\n}\n\n// SCIMEnterpriseAttribute represents attribute operations for UpdateSCIMGroupAttribute or UpdateSCIMUserAttribute.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-group\ntype SCIMEnterpriseAttribute struct {\n\tSchemas    []string                            `json:\"schemas\"`    // The URIs that are used to indicate the namespaces for a SCIM patch operation.\n\tOperations []*SCIMEnterpriseAttributeOperation `json:\"Operations\"` // Set of operations to be performed.\n}\n\n// SCIMEnterpriseAttributeOperation represents an operation for UpdateSCIMGroupAttribute or UpdateSCIMUserAttribute.\ntype SCIMEnterpriseAttributeOperation struct {\n\tOp    string  `json:\"op\"`              // Can be one of: `add`, `replace`, `remove`.\n\tPath  *string `json:\"path,omitempty\"`  // Path to the attribute being modified (Filters are not supported).\n\tValue any     `json:\"value,omitempty\"` // New value for the attribute being modified.\n}\n\n// ListProvisionedSCIMGroups lists provisioned SCIM groups in an enterprise.\n//\n// You can improve query search time by using the `excludedAttributes` and\n// exclude the specified attributes, e.g. `members` to exclude members from the\n// response.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise\n//\n//meta:operation GET /scim/v2/enterprises/{enterprise}/Groups\nfunc (s *EnterpriseService) ListProvisionedSCIMGroups(ctx context.Context, enterprise string, opts *ListProvisionedSCIMGroupsEnterpriseOptions) (*SCIMEnterpriseGroups, *Response, error) {\n\tu := fmt.Sprintf(\"scim/v2/enterprises/%v/Groups\", enterprise)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treq.Header.Set(\"Accept\", mediaTypeSCIM)\n\n\tvar groups *SCIMEnterpriseGroups\n\tresp, err := s.client.Do(ctx, req, &groups)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn groups, resp, nil\n}\n\n// ListProvisionedSCIMUsers lists provisioned SCIM enterprise users.\n//\n// When members are part of the group provisioning payload, they're designated\n// as external group members. Providers are responsible for maintaining a\n// mapping between the `externalId` and `id` for each user.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#list-scim-provisioned-identities-for-an-enterprise\n//\n//meta:operation GET /scim/v2/enterprises/{enterprise}/Users\nfunc (s *EnterpriseService) ListProvisionedSCIMUsers(ctx context.Context, enterprise string, opts *ListProvisionedSCIMUsersEnterpriseOptions) (*SCIMEnterpriseUsers, *Response, error) {\n\tu := fmt.Sprintf(\"scim/v2/enterprises/%v/Users\", enterprise)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treq.Header.Set(\"Accept\", mediaTypeSCIM)\n\n\tvar users *SCIMEnterpriseUsers\n\tresp, err := s.client.Do(ctx, req, &users)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn users, resp, nil\n}\n\n// SetProvisionedSCIMGroup replaces an existing provisioned group’s information.\n//\n// You must provide all the information required for the group as if you were provisioning it for the first time. Any\n// existing group information that you don't provide will be removed, including group membership. To update only\n// specific attributes, refer to the `Enterprise.UpdateSCIMGroupAttribute()` method.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-group\n//\n//meta:operation PUT /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}\nfunc (s *EnterpriseService) SetProvisionedSCIMGroup(ctx context.Context, enterprise, scimGroupID string, group SCIMEnterpriseGroupAttributes) (*SCIMEnterpriseGroupAttributes, *Response, error) {\n\tu := fmt.Sprintf(\"scim/v2/enterprises/%v/Groups/%v\", enterprise, scimGroupID)\n\treq, err := s.client.NewRequest(\"PUT\", u, group)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treq.Header.Set(\"Accept\", mediaTypeSCIM)\n\n\tvar groupNew *SCIMEnterpriseGroupAttributes\n\tresp, err := s.client.Do(ctx, req, &groupNew)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn groupNew, resp, nil\n}\n\n// SetProvisionedSCIMUser replaces an existing provisioned user's information.\n//\n// You must supply complete user information, just as you would when provisioning them initially. Any previously\n// existing data not provided will be deleted. To update specific attributes only, refer to the\n// `Enterprise.UpdateSCIMUserAttribute()` method.\n//\n// **Warning**: Setting `active: false` will suspend a user, and their handle and email will be obfuscated.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-user\n//\n//meta:operation PUT /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}\nfunc (s *EnterpriseService) SetProvisionedSCIMUser(ctx context.Context, enterprise, scimUserID string, user SCIMEnterpriseUserAttributes) (*SCIMEnterpriseUserAttributes, *Response, error) {\n\tu := fmt.Sprintf(\"scim/v2/enterprises/%v/Users/%v\", enterprise, scimUserID)\n\treq, err := s.client.NewRequest(\"PUT\", u, user)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treq.Header.Set(\"Accept\", mediaTypeSCIM)\n\n\tvar userNew *SCIMEnterpriseUserAttributes\n\tresp, err := s.client.Do(ctx, req, &userNew)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn userNew, resp, nil\n}\n\n// UpdateSCIMGroupAttribute updates a provisioned group’s individual attributes.\n//\n// The `attribute` parameter must include at least one of the following\n// Operations: `add`, `remove`, or `replace`.\n//\n// The update function can also be used to add group memberships.\n//\n// You can submit group memberships individually or in batches for improved\n// efficiency.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-group\n//\n//meta:operation PATCH /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}\nfunc (s *EnterpriseService) UpdateSCIMGroupAttribute(ctx context.Context, enterprise, scimGroupID string, attribute SCIMEnterpriseAttribute) (*SCIMEnterpriseGroupAttributes, *Response, error) {\n\tu := fmt.Sprintf(\"scim/v2/enterprises/%v/Groups/%v\", enterprise, scimGroupID)\n\treq, err := s.client.NewRequest(\"PATCH\", u, attribute)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treq.Header.Set(\"Accept\", mediaTypeSCIM)\n\n\tvar group *SCIMEnterpriseGroupAttributes\n\tresp, err := s.client.Do(ctx, req, &group)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn group, resp, nil\n}\n\n// UpdateSCIMUserAttribute updates a provisioned user's individual attributes.\n//\n// The `attribute` parameter must include at least one of the following\n// Operations: `add`, `remove`, or `replace`.\n//\n// Note: Complex SCIM path selectors that include filters are not supported.\n// For example, a path selector defined as `\"path\": \"emails[type eq \\\"work\\\"]\"`\n// will be ineffective.\n//\n// Warning: Setting `active: false` will suspend a user, and their handle and\n// email will be obfuscated.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-user\n//\n//meta:operation PATCH /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}\nfunc (s *EnterpriseService) UpdateSCIMUserAttribute(ctx context.Context, enterprise, scimUserID string, attribute SCIMEnterpriseAttribute) (*SCIMEnterpriseUserAttributes, *Response, error) {\n\tu := fmt.Sprintf(\"scim/v2/enterprises/%v/Users/%v\", enterprise, scimUserID)\n\treq, err := s.client.NewRequest(\"PATCH\", u, attribute)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treq.Header.Set(\"Accept\", mediaTypeSCIM)\n\n\tvar user *SCIMEnterpriseUserAttributes\n\tresp, err := s.client.Do(ctx, req, &user)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn user, resp, nil\n}\n\n// ProvisionSCIMGroup creates a SCIM group for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#provision-a-scim-enterprise-group\n//\n//meta:operation POST /scim/v2/enterprises/{enterprise}/Groups\nfunc (s *EnterpriseService) ProvisionSCIMGroup(ctx context.Context, enterprise string, group SCIMEnterpriseGroupAttributes) (*SCIMEnterpriseGroupAttributes, *Response, error) {\n\tu := fmt.Sprintf(\"scim/v2/enterprises/%v/Groups\", enterprise)\n\treq, err := s.client.NewRequest(\"POST\", u, group)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treq.Header.Set(\"Accept\", mediaTypeSCIM)\n\n\tvar groupProvisioned *SCIMEnterpriseGroupAttributes\n\tresp, err := s.client.Do(ctx, req, &groupProvisioned)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn groupProvisioned, resp, nil\n}\n\n// ProvisionSCIMUser creates an external identity for a new SCIM enterprise user.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#provision-a-scim-enterprise-user\n//\n//meta:operation POST /scim/v2/enterprises/{enterprise}/Users\nfunc (s *EnterpriseService) ProvisionSCIMUser(ctx context.Context, enterprise string, user SCIMEnterpriseUserAttributes) (*SCIMEnterpriseUserAttributes, *Response, error) {\n\tu := fmt.Sprintf(\"scim/v2/enterprises/%v/Users\", enterprise)\n\treq, err := s.client.NewRequest(\"POST\", u, user)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treq.Header.Set(\"Accept\", mediaTypeSCIM)\n\n\tvar userProvisioned *SCIMEnterpriseUserAttributes\n\tresp, err := s.client.Do(ctx, req, &userProvisioned)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn userProvisioned, resp, nil\n}\n\n// GetProvisionedSCIMGroup gets information about a SCIM group.\n//\n// You can use the `excludedAttributes` from `opts` and exclude the specified\n// attributes from being returned in the results. Using this parameter can\n// speed up response time.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-group\n//\n//meta:operation GET /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}\nfunc (s *EnterpriseService) GetProvisionedSCIMGroup(ctx context.Context, enterprise, scimGroupID string, opts *GetProvisionedSCIMGroupEnterpriseOptions) (*SCIMEnterpriseGroupAttributes, *Response, error) {\n\tu := fmt.Sprintf(\"scim/v2/enterprises/%v/Groups/%v\", enterprise, scimGroupID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treq.Header.Set(\"Accept\", mediaTypeSCIM)\n\n\tvar group *SCIMEnterpriseGroupAttributes\n\tresp, err := s.client.Do(ctx, req, &group)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn group, resp, nil\n}\n\n// GetProvisionedSCIMUser gets information about a SCIM user.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-user\n//\n//meta:operation GET /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}\nfunc (s *EnterpriseService) GetProvisionedSCIMUser(ctx context.Context, enterprise, scimUserID string) (*SCIMEnterpriseUserAttributes, *Response, error) {\n\tu := fmt.Sprintf(\"scim/v2/enterprises/%v/Users/%v\", enterprise, scimUserID)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treq.Header.Set(\"Accept\", mediaTypeSCIM)\n\n\tvar user *SCIMEnterpriseUserAttributes\n\tresp, err := s.client.Do(ctx, req, &user)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn user, resp, nil\n}\n\n// DeleteSCIMGroup deletes a SCIM group from an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#delete-a-scim-group-from-an-enterprise\n//\n//meta:operation DELETE /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}\nfunc (s *EnterpriseService) DeleteSCIMGroup(ctx context.Context, enterprise, scimGroupID string) (*Response, error) {\n\tu := fmt.Sprintf(\"scim/v2/enterprises/%v/Groups/%v\", enterprise, scimGroupID)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// DeleteSCIMUser deletes a SCIM user from an enterprise.\n//\n// Suspends a SCIM user permanently from an enterprise. This action will:\n// remove all the user's data, anonymize their login, email, and display name,\n// erase all external identity SCIM attributes, delete the user's emails,\n// avatar, PATs, SSH keys, OAuth authorizations, GPG keys, and SAML mappings.\n// This action is irreversible.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/enterprise-admin/scim#delete-a-scim-user-from-an-enterprise\n//\n//meta:operation DELETE /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}\nfunc (s *EnterpriseService) DeleteSCIMUser(ctx context.Context, enterprise, scimUserID string) (*Response, error) {\n\tu := fmt.Sprintf(\"scim/v2/enterprises/%v/Users/%v\", enterprise, scimUserID)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/enterprise_scim_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestSCIMEnterpriseGroups_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SCIMEnterpriseGroups{}, \"{}\")\n\n\tu := &SCIMEnterpriseGroups{\n\t\tSchemas:      []string{SCIMSchemasURINamespacesListResponse},\n\t\tTotalResults: Ptr(1),\n\t\tItemsPerPage: Ptr(1),\n\t\tStartIndex:   Ptr(1),\n\t\tResources: []*SCIMEnterpriseGroupAttributes{{\n\t\t\tDisplayName: Ptr(\"gn1\"),\n\t\t\tMembers: []*SCIMEnterpriseDisplayReference{{\n\t\t\t\tValue:   \"idm1\",\n\t\t\t\tRef:     Ptr(\"https://api.github.com/scim/v2/enterprises/ee/Users/idm1\"),\n\t\t\t\tDisplay: Ptr(\"m1\"),\n\t\t\t}},\n\t\t\tSchemas:    []string{SCIMSchemasURINamespacesGroups},\n\t\t\tExternalID: Ptr(\"eidgn1\"),\n\t\t\tID:         Ptr(\"idgn1\"),\n\t\t\tMeta: &SCIMEnterpriseMeta{\n\t\t\t\tResourceType: \"Group\",\n\t\t\t\tCreated:      &Timestamp{referenceTime},\n\t\t\t\tLastModified: &Timestamp{referenceTime},\n\t\t\t\tLocation:     Ptr(\"https://api.github.com/scim/v2/enterprises/ee/Groups/idgn1\"),\n\t\t\t},\n\t\t}},\n\t}\n\n\twant := `{\n\t\t\"schemas\": [\"` + SCIMSchemasURINamespacesListResponse + `\"],\n\t\t\"totalResults\": 1,\n\t\t\"itemsPerPage\": 1,\n\t\t\"startIndex\": 1,\n\t\t\"Resources\": [{\n\t\t\t\"schemas\": [\"` + SCIMSchemasURINamespacesGroups + `\"],\n\t\t\t\"id\": \"idgn1\",\n\t\t\t\"externalId\": \"eidgn1\",\n\t\t\t\"displayName\": \"gn1\",\n\t\t\t\"meta\": {\n\t\t\t\t\"resourceType\": \"Group\",\n\t\t\t\t\"created\": ` + referenceTimeStr + `,\n\t\t\t\t\"lastModified\": ` + referenceTimeStr + `,\n\t\t\t\t\"location\": \"https://api.github.com/scim/v2/enterprises/ee/Groups/idgn1\"\n\t\t\t},\n\t\t\t\"members\": [{\n\t\t\t\t\"value\": \"idm1\",\n\t\t\t\t\"$ref\": \"https://api.github.com/scim/v2/enterprises/ee/Users/idm1\",\n\t\t\t\t\"display\": \"m1\"\n\t\t\t}]\n\t\t}]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestSCIMEnterpriseUsers_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SCIMEnterpriseUsers{}, \"{}\")\n\n\tu := &SCIMEnterpriseUsers{\n\t\tSchemas:      []string{SCIMSchemasURINamespacesListResponse},\n\t\tTotalResults: Ptr(1),\n\t\tItemsPerPage: Ptr(1),\n\t\tStartIndex:   Ptr(1),\n\t\tResources: []*SCIMEnterpriseUserAttributes{{\n\t\t\tActive: true,\n\t\t\tEmails: []*SCIMEnterpriseUserEmail{{\n\t\t\t\tPrimary: true,\n\t\t\t\tType:    \"work\",\n\t\t\t\tValue:   \"un1@example.com\",\n\t\t\t}},\n\t\t\tRoles: []*SCIMEnterpriseUserRole{{\n\t\t\t\tDisplay: Ptr(\"rd1\"),\n\t\t\t\tPrimary: Ptr(true),\n\t\t\t\tType:    Ptr(\"rt1\"),\n\t\t\t\tValue:   \"rv1\",\n\t\t\t}},\n\t\t\tSchemas:  []string{SCIMSchemasURINamespacesUser},\n\t\t\tUserName: \"un1\",\n\t\t\tGroups: []*SCIMEnterpriseDisplayReference{{\n\t\t\t\tValue:   \"idgn1\",\n\t\t\t\tRef:     Ptr(\"https://api.github.com/scim/v2/enterprises/ee/Groups/idgn1\"),\n\t\t\t\tDisplay: Ptr(\"gn1\"),\n\t\t\t}},\n\t\t\tID:          Ptr(\"idun1\"),\n\t\t\tExternalID:  \"eidun1\",\n\t\t\tDisplayName: \"dun1\",\n\t\t\tMeta: &SCIMEnterpriseMeta{\n\t\t\t\tResourceType: \"User\",\n\t\t\t\tCreated:      &Timestamp{referenceTime},\n\t\t\t\tLastModified: &Timestamp{referenceTime},\n\t\t\t\tLocation:     Ptr(\"https://api.github.com/scim/v2/enterprises/ee/User/idun1\"),\n\t\t\t},\n\t\t\tName: &SCIMEnterpriseUserName{\n\t\t\t\tGivenName:  \"gnn1\",\n\t\t\t\tFamilyName: \"fnn1\",\n\t\t\t\tFormatted:  Ptr(\"f1\"),\n\t\t\t\tMiddleName: Ptr(\"mn1\"),\n\t\t\t},\n\t\t}},\n\t}\n\n\twant := `{\n\t\t\"schemas\": [\"` + SCIMSchemasURINamespacesListResponse + `\"],\n\t\t\"totalResults\": 1,\n\t\t\"itemsPerPage\": 1,\n\t\t\"startIndex\": 1,\n\t\t\"Resources\": [{\n\t\t\t\"active\": true,\n\t\t\t\"emails\": [{\n\t\t\t\t\"primary\": true,\n\t\t\t\t\"type\": \"work\",\n\t\t\t\t\"value\": \"un1@example.com\"\n\t\t\t}],\n\t\t\t\"roles\": [{\n\t\t\t\t\"display\": \"rd1\",\n\t\t\t\t\"primary\": true,\n\t\t\t\t\"type\": \"rt1\",\n\t\t\t\t\"value\": \"rv1\"\n\t\t\t}],\n\t\t\t\"schemas\": [\"` + SCIMSchemasURINamespacesUser + `\"],\n\t\t\t\"userName\": \"un1\",\n\t\t\t\"groups\": [{\n\t\t\t\t\"value\": \"idgn1\",\n\t\t\t\t\"$ref\": \"https://api.github.com/scim/v2/enterprises/ee/Groups/idgn1\",\n\t\t\t\t\"display\": \"gn1\"\n\t\t\t}],\n\t\t\t\"id\": \"idun1\",\n\t\t\t\"externalId\": \"eidun1\",\n\t\t\t\"name\": {\n\t\t\t\t\"givenName\": \"gnn1\",\n\t\t\t\t\"familyName\": \"fnn1\",\n\t\t\t\t\"formatted\": \"f1\",\n\t\t\t\t\"middleName\": \"mn1\"\n\t\t\t},\n\t\t\t\"displayName\": \"dun1\",\n\t\t\t\"meta\": {\n\t\t\t\t\"resourceType\": \"User\",\n\t\t\t\t\"created\": ` + referenceTimeStr + `,\n\t\t\t\t\"lastModified\": ` + referenceTimeStr + `,\n\t\t\t\t\"location\": \"https://api.github.com/scim/v2/enterprises/ee/User/idun1\"\n\t\t\t}\n\t\t}]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestSCIMEnterpriseGroupAttributes_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SCIMEnterpriseGroupAttributes{}, \"{}\")\n\n\tu := &SCIMEnterpriseGroupAttributes{\n\t\tDisplayName: Ptr(\"dn\"),\n\t\tMembers: []*SCIMEnterpriseDisplayReference{{\n\t\t\tValue:   \"v\",\n\t\t\tRef:     Ptr(\"r\"),\n\t\t\tDisplay: Ptr(\"d\"),\n\t\t}},\n\t\tExternalID: Ptr(\"eid\"),\n\t\tID:         Ptr(\"id\"),\n\t\tSchemas:    []string{\"s1\"},\n\t\tMeta: &SCIMEnterpriseMeta{\n\t\t\tResourceType: \"rt\",\n\t\t\tCreated:      &Timestamp{referenceTime},\n\t\t\tLastModified: &Timestamp{referenceTime},\n\t\t\tLocation:     Ptr(\"l\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"schemas\": [\"s1\"],\n\t\t\"externalId\": \"eid\",\n\t\t\"displayName\": \"dn\",\n\t\t\"members\" : [{\n\t\t\t\"value\": \"v\",\n\t\t\t\"$ref\": \"r\",\n\t\t\t\"display\": \"d\"\n\t\t}],\n\t\t\"id\": \"id\",\n\t\t\"meta\": {\n\t\t\t\"resourceType\": \"rt\",\n\t\t\t\"created\": ` + referenceTimeStr + `,\n\t\t\t\"lastModified\": ` + referenceTimeStr + `,\n\t\t\t\"location\": \"l\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestSCIMEnterpriseAttribute_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SCIMEnterpriseAttribute{}, `{\n\t\t\"schemas\": null,\n\t\t\"Operations\": null\n\t}`)\n\n\tu := &SCIMEnterpriseAttribute{\n\t\tSchemas: []string{\"s\"},\n\t\tOperations: []*SCIMEnterpriseAttributeOperation{\n\t\t\t{Op: \"o1\"},\n\t\t\t{\n\t\t\t\tOp:    \"o2\",\n\t\t\t\tPath:  Ptr(\"p2\"),\n\t\t\t\tValue: \"v2\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tOp:    \"replace\",\n\t\t\t\tPath:  Ptr(\"emails[type eq 'work'].value\"),\n\t\t\t\tValue: \"v@example.com\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tOp:   \"add\",\n\t\t\t\tPath: Ptr(\"members\"),\n\t\t\t\tValue: []*SCIMEnterpriseDisplayReference{\n\t\t\t\t\t{Value: \"v-1\"},\n\t\t\t\t\t{Value: \"v-2\"},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"schemas\": [\"s\"],\n\t\t\"Operations\": [\n\t\t\t{\"op\": \"o1\"},\n\t\t\t{\n\t\t\t\t\"op\": \"o2\",\n\t\t\t\t\"path\": \"p2\",\n\t\t\t\t\"value\": \"v2\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"op\": \"replace\",\n\t\t\t\t\"path\": \"emails[type eq 'work'].value\",\n\t\t\t\t\"value\": \"v@example.com\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"op\": \"add\",\n\t\t\t\t\"path\": \"members\",\n\t\t\t\t\"value\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"value\": \"v-1\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"value\": \"v-2\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshalOnly(t, u, want)\n\t// can't unmarshal Operations back into []*SCIMEnterpriseAttributeOperation, so skip testJSONUnmarshalOnly\n}\n\nfunc TestEnterpriseService_ListProvisionedSCIMGroups(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/scim/v2/enterprises/ee/Groups\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeSCIM)\n\t\ttestFormValues(t, r, values{\n\t\t\t\"startIndex\":         \"1\",\n\t\t\t\"excludedAttributes\": \"members,meta\",\n\t\t\t\"count\":              \"3\",\n\t\t\t\"filter\":             `externalId eq \"914a\"`,\n\t\t})\n\t\tw.WriteHeader(http.StatusOK)\n\t\tfmt.Fprint(w, `{\n\t\t\t\"schemas\": [\"`+SCIMSchemasURINamespacesListResponse+`\"],\n\t\t\t\"totalResults\": 1,\n\t\t\t\"itemsPerPage\": 1,\n\t\t\t\"startIndex\": 1,\n\t\t\t\"Resources\": [{\n\t\t\t\t\"schemas\": [\"`+SCIMSchemasURINamespacesGroups+`\"],\n\t\t\t\t\"id\": \"914a\",\n\t\t\t\t\"externalId\": \"de88\",\n\t\t\t\t\"displayName\": \"gn1\",\n\t\t\t\t\"meta\": {\n\t\t\t\t\t\"resourceType\": \"Group\",\n\t\t\t\t\t\"created\": `+referenceTimeStr+`,\n\t\t\t\t\t\"lastModified\": `+referenceTimeStr+`,\n\t\t\t\t\t\"location\": \"https://api.github.com/scim/v2/enterprises/ee/Groups/914a\"\n\t\t\t\t},\n\t\t\t\t\"members\": [{\n\t\t\t\t\t\"value\": \"e7f9\",\n\t\t\t\t\t\"$ref\": \"https://api.github.com/scim/v2/enterprises/ee/Users/e7f9\",\n\t\t\t\t\t\"display\": \"d1\"\n\t\t\t\t}]\n\t\t\t}]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\topts := &ListProvisionedSCIMGroupsEnterpriseOptions{\n\t\tStartIndex:         Ptr(1),\n\t\tExcludedAttributes: Ptr(\"members,meta\"),\n\t\tCount:              Ptr(3),\n\t\tFilter:             Ptr(`externalId eq \"914a\"`),\n\t}\n\tgot, _, err := client.Enterprise.ListProvisionedSCIMGroups(ctx, \"ee\", opts)\n\tif err != nil {\n\t\tt.Fatalf(\"Enterprise.ListProvisionedSCIMGroups returned unexpected error: %v\", err)\n\t}\n\n\twant := &SCIMEnterpriseGroups{\n\t\tSchemas:      []string{SCIMSchemasURINamespacesListResponse},\n\t\tTotalResults: Ptr(1),\n\t\tItemsPerPage: Ptr(1),\n\t\tStartIndex:   Ptr(1),\n\t\tResources: []*SCIMEnterpriseGroupAttributes{{\n\t\t\tID: Ptr(\"914a\"),\n\t\t\tMeta: &SCIMEnterpriseMeta{\n\t\t\t\tResourceType: \"Group\",\n\t\t\t\tCreated:      &Timestamp{referenceTime},\n\t\t\t\tLastModified: &Timestamp{referenceTime},\n\t\t\t\tLocation:     Ptr(\"https://api.github.com/scim/v2/enterprises/ee/Groups/914a\"),\n\t\t\t},\n\t\t\tDisplayName: Ptr(\"gn1\"),\n\t\t\tSchemas:     []string{SCIMSchemasURINamespacesGroups},\n\t\t\tExternalID:  Ptr(\"de88\"),\n\t\t\tMembers: []*SCIMEnterpriseDisplayReference{{\n\t\t\t\tValue:   \"e7f9\",\n\t\t\t\tRef:     Ptr(\"https://api.github.com/scim/v2/enterprises/ee/Users/e7f9\"),\n\t\t\t\tDisplay: Ptr(\"d1\"),\n\t\t\t}},\n\t\t}},\n\t}\n\n\tif diff := cmp.Diff(want, got); diff != \"\" {\n\t\tt.Fatalf(\"Enterprise.ListProvisionedSCIMGroups diff mismatch (-want +got):\\n%v\", diff)\n\t}\n\n\tconst methodName = \"ListProvisionedSCIMGroups\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.ListProvisionedSCIMGroups(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ListProvisionedSCIMGroups(ctx, \"ee\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_ListProvisionedSCIMUsers(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/scim/v2/enterprises/ee/Users\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeSCIM)\n\t\ttestFormValues(t, r, values{\n\t\t\t\"startIndex\": \"1\",\n\t\t\t\"count\":      \"3\",\n\t\t\t\"filter\":     `userName eq \"octocat@github.com\"`,\n\t\t})\n\t\tw.WriteHeader(http.StatusOK)\n\t\tfmt.Fprint(w, `{\n\t\t\t\"schemas\": [\"`+SCIMSchemasURINamespacesListResponse+`\"],\n\t\t\t\"totalResults\": 1,\n\t\t\t\"itemsPerPage\": 1,\n\t\t\t\"startIndex\": 1,\n\t\t\t\"Resources\": [\n\t\t\t  {\n\t\t\t\t\"schemas\": [\"`+SCIMSchemasURINamespacesUser+`\"],\n\t\t\t\t\"id\": \"5fc0\",\n\t\t\t\t\"externalId\": \"00u1\",\n\t\t\t\t\"userName\": \"octocat@github.com\",\n\t\t\t\t\"displayName\": \"Mona Octocat\",\n\t\t\t\t\"name\": {\n\t\t\t\t  \"givenName\": \"Mona\",\n\t\t\t\t  \"familyName\": \"Octocat\",\n\t\t\t\t  \"formatted\": \"Mona Octocat\"\n\t\t\t\t},\n\t\t\t\t\"emails\": [\n\t\t\t\t  {\n\t\t\t\t\t\"value\": \"octocat@github.com\",\n\t\t\t\t\t\"primary\": true\n\t\t\t\t  }\n\t\t\t\t],\n\t\t\t\t\"active\": true,\n\t\t\t\t\"meta\": {\n\t\t\t\t  \"resourceType\": \"User\",\n\t\t\t\t  \"created\": `+referenceTimeStr+`,\n\t\t\t\t  \"lastModified\": `+referenceTimeStr+`,\n\t\t\t\t  \"location\": \"https://api.github.com/scim/v2/enterprises/ee/Users/5fc0\"\n\t\t\t\t}\n\t\t\t  }\n\t\t\t]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\topts := &ListProvisionedSCIMUsersEnterpriseOptions{\n\t\tStartIndex: Ptr(1),\n\t\tCount:      Ptr(3),\n\t\tFilter:     Ptr(`userName eq \"octocat@github.com\"`),\n\t}\n\tgot, _, err := client.Enterprise.ListProvisionedSCIMUsers(ctx, \"ee\", opts)\n\tif err != nil {\n\t\tt.Fatalf(\"Enterprise.ListProvisionedSCIMUsers returned unexpected error: %v\", err)\n\t}\n\n\twant := &SCIMEnterpriseUsers{\n\t\tSchemas:      []string{SCIMSchemasURINamespacesListResponse},\n\t\tTotalResults: Ptr(1),\n\t\tItemsPerPage: Ptr(1),\n\t\tStartIndex:   Ptr(1),\n\t\tResources: []*SCIMEnterpriseUserAttributes{{\n\t\t\tSchemas:     []string{SCIMSchemasURINamespacesUser},\n\t\t\tID:          Ptr(\"5fc0\"),\n\t\t\tExternalID:  \"00u1\",\n\t\t\tUserName:    \"octocat@github.com\",\n\t\t\tDisplayName: \"Mona Octocat\",\n\t\t\tName: &SCIMEnterpriseUserName{\n\t\t\t\tGivenName:  \"Mona\",\n\t\t\t\tFamilyName: \"Octocat\",\n\t\t\t\tFormatted:  Ptr(\"Mona Octocat\"),\n\t\t\t},\n\t\t\tEmails: []*SCIMEnterpriseUserEmail{{\n\t\t\t\tValue:   \"octocat@github.com\",\n\t\t\t\tPrimary: true,\n\t\t\t}},\n\t\t\tActive: true,\n\t\t\tMeta: &SCIMEnterpriseMeta{\n\t\t\t\tResourceType: \"User\",\n\t\t\t\tCreated:      &Timestamp{referenceTime},\n\t\t\t\tLastModified: &Timestamp{referenceTime},\n\t\t\t\tLocation:     Ptr(\"https://api.github.com/scim/v2/enterprises/ee/Users/5fc0\"),\n\t\t\t},\n\t\t}},\n\t}\n\n\tif diff := cmp.Diff(want, got); diff != \"\" {\n\t\tt.Fatalf(\"Enterprise.ListProvisionedSCIMUsers diff mismatch (-want +got):\\n%v\", diff)\n\t}\n\n\tconst methodName = \"ListProvisionedSCIMUsers\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.ListProvisionedSCIMUsers(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ListProvisionedSCIMUsers(ctx, \"ee\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_SetProvisionedSCIMGroup(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/scim/v2/enterprises/ee/Groups/abcd\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeSCIM)\n\t\ttestBody(t, r, `{\"displayName\":\"dn\",\"externalId\":\"8aa1\",\"schemas\":[\"`+SCIMSchemasURINamespacesGroups+`\"]}`+\"\\n\")\n\t\tw.WriteHeader(http.StatusOK)\n\t\tfmt.Fprint(w, `{\n\t\t\t\"schemas\": [\"`+SCIMSchemasURINamespacesGroups+`\"],\n\t\t\t\"id\": \"abcd\",\n\t\t\t\"externalId\": \"8aa1\",\n\t\t\t\"displayName\": \"dn\",\n\t\t\t\"meta\": {\n\t\t\t  \"resourceType\": \"Group\",\n\t\t\t  \"created\": `+referenceTimeStr+`,\n\t\t\t  \"lastModified\": `+referenceTimeStr+`,\n\t\t\t  \"location\": \"https://api.github.localhost/scim/v2/enterprises/ee/Groups/abcd\"\n\t\t\t}\n\t\t}`)\n\t})\n\twant := &SCIMEnterpriseGroupAttributes{\n\t\tSchemas:     []string{SCIMSchemasURINamespacesGroups},\n\t\tID:          Ptr(\"abcd\"),\n\t\tExternalID:  Ptr(\"8aa1\"),\n\t\tDisplayName: Ptr(\"dn\"),\n\t\tMeta: &SCIMEnterpriseMeta{\n\t\t\tResourceType: \"Group\",\n\t\t\tCreated:      &Timestamp{referenceTime},\n\t\t\tLastModified: &Timestamp{referenceTime},\n\t\t\tLocation:     Ptr(\"https://api.github.localhost/scim/v2/enterprises/ee/Groups/abcd\"),\n\t\t},\n\t}\n\n\tctx := t.Context()\n\tinput := SCIMEnterpriseGroupAttributes{\n\t\tSchemas:     []string{SCIMSchemasURINamespacesGroups},\n\t\tExternalID:  Ptr(\"8aa1\"),\n\t\tDisplayName: Ptr(\"dn\"),\n\t}\n\tgot, _, err := client.Enterprise.SetProvisionedSCIMGroup(ctx, \"ee\", \"abcd\", input)\n\tif err != nil {\n\t\tt.Fatalf(\"Enterprise.SetProvisionedSCIMGroup returned unexpected error: %v\", err)\n\t}\n\tif diff := cmp.Diff(want, got); diff != \"\" {\n\t\tt.Fatalf(\"Enterprise.SetProvisionedSCIMGroup diff mismatch (-want +got):\\n%v\", diff)\n\t}\n\n\tconst methodName = \"SetProvisionedSCIMGroup\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.SetProvisionedSCIMGroup(ctx, \"\\n\", \"\\n\", SCIMEnterpriseGroupAttributes{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.SetProvisionedSCIMGroup(ctx, \"ee\", \"abcd\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_SetProvisionedSCIMUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/scim/v2/enterprises/ee/Users/7fce\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeSCIM)\n\t\ttestBody(t, r, `{\"displayName\":\"John Doe\",\"userName\":\"e123\",\"emails\":[{\"value\":\"john@example.com\",\"primary\":true,\"type\":\"work\"}],\"externalId\":\"e123\",\"active\":true,\"schemas\":[\"`+SCIMSchemasURINamespacesUser+`\"]}`+\"\\n\")\n\t\tw.WriteHeader(http.StatusOK)\n\t\tfmt.Fprint(w, `{\n\t\t\t\"schemas\": [\"`+SCIMSchemasURINamespacesUser+`\"],\n\t\t\t\"id\": \"7fce\",\n\t\t\t\"externalId\": \"e123\",\n\t\t\t\"active\": true,\n\t\t\t\"userName\": \"e123\",\n\t\t\t\"displayName\": \"John Doe\",\n\t\t\t\"emails\": [{\n\t\t\t\t\"value\": \"john@example.com\",\n\t\t\t\t\"type\": \"work\",\n\t\t\t\t\"primary\": true\n\t\t\t}],\n\t\t\t\"meta\": {\n\t\t\t\t\"resourceType\": \"User\",\n\t\t\t\t\"created\": `+referenceTimeStr+`,\n\t\t\t\t\"lastModified\": `+referenceTimeStr+`,\n\t\t\t\t\"location\": \"https://api.github.localhost/scim/v2/enterprises/ee/Users/7fce\"\n\t\t\t}\n\t\t}`)\n\t})\n\twant := &SCIMEnterpriseUserAttributes{\n\t\tSchemas:     []string{SCIMSchemasURINamespacesUser},\n\t\tID:          Ptr(\"7fce\"),\n\t\tExternalID:  \"e123\",\n\t\tActive:      true,\n\t\tUserName:    \"e123\",\n\t\tDisplayName: \"John Doe\",\n\t\tEmails: []*SCIMEnterpriseUserEmail{{\n\t\t\tValue:   \"john@example.com\",\n\t\t\tType:    \"work\",\n\t\t\tPrimary: true,\n\t\t}},\n\t\tMeta: &SCIMEnterpriseMeta{\n\t\t\tResourceType: \"User\",\n\t\t\tCreated:      &Timestamp{referenceTime},\n\t\t\tLastModified: &Timestamp{referenceTime},\n\t\t\tLocation:     Ptr(\"https://api.github.localhost/scim/v2/enterprises/ee/Users/7fce\"),\n\t\t},\n\t}\n\n\tctx := t.Context()\n\tinput := SCIMEnterpriseUserAttributes{\n\t\tSchemas:     []string{SCIMSchemasURINamespacesUser},\n\t\tExternalID:  \"e123\",\n\t\tActive:      true,\n\t\tUserName:    \"e123\",\n\t\tDisplayName: \"John Doe\",\n\t\tEmails: []*SCIMEnterpriseUserEmail{{\n\t\t\tValue:   \"john@example.com\",\n\t\t\tType:    \"work\",\n\t\t\tPrimary: true,\n\t\t}},\n\t}\n\tgot, _, err := client.Enterprise.SetProvisionedSCIMUser(ctx, \"ee\", \"7fce\", input)\n\tif err != nil {\n\t\tt.Fatalf(\"Enterprise.SetProvisionedSCIMUser returned unexpected error: %v\", err)\n\t}\n\tif diff := cmp.Diff(want, got); diff != \"\" {\n\t\tt.Fatalf(\"Enterprise.SetProvisionedSCIMUser diff mismatch (-want +got):\\n%v\", diff)\n\t}\n\n\tconst methodName = \"SetProvisionedSCIMUser\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.SetProvisionedSCIMUser(ctx, \"\\n\", \"\\n\", SCIMEnterpriseUserAttributes{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.SetProvisionedSCIMUser(ctx, \"ee\", \"7fce\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_UpdateSCIMGroupAttribute(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/scim/v2/enterprises/ee/Groups/abcd\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeSCIM)\n\t\ttestBody(t, r, `{\"schemas\":[\"`+SCIMSchemasURINamespacesPatchOp+`\"],\"Operations\":[{\"op\":\"replace\",\"path\":\"displayName\",\"value\":\"Employees\"}]}`+\"\\n\")\n\t\tw.WriteHeader(http.StatusOK)\n\t\tfmt.Fprint(w, `{\n\t\t\t\"schemas\": [\"`+SCIMSchemasURINamespacesGroups+`\"],\n\t\t\t\"id\": \"abcd\",\n\t\t\t\"externalId\": \"8aa1\",\n\t\t\t\"displayName\": \"Employees\",\n\t\t\t\"members\": [{\n\t\t\t\t\"value\": \"879d\",\n\t\t\t\t\"$ref\": \"https://api.github.localhost/scim/v2/enterprises/ee/Users/879d\",\n\t\t\t\t\"display\": \"User 1\"\n\t\t\t}],\n\t\t\t\"meta\": {\n\t\t\t\t\"resourceType\": \"Group\",\n\t\t\t\t\"created\": `+referenceTimeStr+`,\n\t\t\t\t\"lastModified\": `+referenceTimeStr+`,\n\t\t\t\t\"location\": \"https://api.github.localhost/scim/v2/enterprises/ee/Groups/abcd\"\n\t\t\t}\n\t\t}`)\n\t})\n\twant := &SCIMEnterpriseGroupAttributes{\n\t\tSchemas:     []string{SCIMSchemasURINamespacesGroups},\n\t\tID:          Ptr(\"abcd\"),\n\t\tExternalID:  Ptr(\"8aa1\"),\n\t\tDisplayName: Ptr(\"Employees\"),\n\t\tMembers: []*SCIMEnterpriseDisplayReference{{\n\t\t\tValue:   \"879d\",\n\t\t\tRef:     Ptr(\"https://api.github.localhost/scim/v2/enterprises/ee/Users/879d\"),\n\t\t\tDisplay: Ptr(\"User 1\"),\n\t\t}},\n\t\tMeta: &SCIMEnterpriseMeta{\n\t\t\tResourceType: \"Group\",\n\t\t\tCreated:      &Timestamp{referenceTime},\n\t\t\tLastModified: &Timestamp{referenceTime},\n\t\t\tLocation:     Ptr(\"https://api.github.localhost/scim/v2/enterprises/ee/Groups/abcd\"),\n\t\t},\n\t}\n\n\tctx := t.Context()\n\tinput := SCIMEnterpriseAttribute{\n\t\tSchemas: []string{SCIMSchemasURINamespacesPatchOp},\n\t\tOperations: []*SCIMEnterpriseAttributeOperation{{\n\t\t\tOp:    \"replace\",\n\t\t\tPath:  Ptr(\"displayName\"),\n\t\t\tValue: Ptr(\"Employees\"),\n\t\t}},\n\t}\n\tgot, _, err := client.Enterprise.UpdateSCIMGroupAttribute(ctx, \"ee\", \"abcd\", input)\n\tif err != nil {\n\t\tt.Fatalf(\"Enterprise.UpdateSCIMGroupAttribute returned unexpected error: %v\", err)\n\t}\n\tif diff := cmp.Diff(want, got); diff != \"\" {\n\t\tt.Fatalf(\"Enterprise.UpdateSCIMGroupAttribute diff mismatch (-want +got):\\n%v\", diff)\n\t}\n\n\tconst methodName = \"UpdateSCIMGroupAttribute\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.UpdateSCIMGroupAttribute(ctx, \"\\n\", \"\\n\", SCIMEnterpriseAttribute{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.UpdateSCIMGroupAttribute(ctx, \"ee\", \"abcd\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_UpdateSCIMUserAttribute(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/scim/v2/enterprises/ee/Users/7fce\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeSCIM)\n\t\ttestBody(t, r, `{\"schemas\":[\"`+SCIMSchemasURINamespacesPatchOp+`\"],\"Operations\":[{\"op\":\"replace\",\"path\":\"emails[type eq 'work'].value\",\"value\":\"updatedEmail@example.com\"},{\"op\":\"replace\",\"path\":\"name.familyName\",\"value\":\"updatedFamilyName\"}]}`+\"\\n\")\n\t\tw.WriteHeader(http.StatusOK)\n\t\tfmt.Fprint(w, `{\n\t\t\t\"schemas\": [\"`+SCIMSchemasURINamespacesUser+`\"],\n\t\t\t\"id\": \"7fce\",\n\t\t\t\"externalId\": \"e123\",\n\t\t\t\"active\": true,\n\t\t\t\"userName\": \"e123\",\n\t\t\t\"name\": {\n\t\t\t\t\"formatted\": \"John Doe X\",\n\t\t\t\t\"familyName\": \"updatedFamilyName\",\n\t\t\t\t\"givenName\": \"John\",\n\t\t\t\t\"middleName\": \"X\"\n\t\t\t},\n\t\t\t\"displayName\": \"John Doe\",\n\t\t\t\"emails\": [{\n\t\t\t\t\"value\": \"john@example.com\",\n\t\t\t\t\"type\": \"work\",\n\t\t\t\t\"primary\": true\n\t\t\t}],\n\t\t\t\"roles\": [{\n\t\t\t\t\"value\": \"User\",\n\t\t\t\t\"primary\": false\n\t\t\t}],\n\t\t\t\"meta\": {\n\t\t\t\t\"resourceType\": \"User\",\n\t\t\t\t\"created\": `+referenceTimeStr+`,\n\t\t\t\t\"lastModified\": `+referenceTimeStr+`,\n\t\t\t\t\"location\": \"https://api.github.localhost/scim/v2/enterprises/ee/Users/7fce\"\n\t\t\t}\n\t\t}`)\n\t})\n\twant := &SCIMEnterpriseUserAttributes{\n\t\tSchemas:     []string{SCIMSchemasURINamespacesUser},\n\t\tID:          Ptr(\"7fce\"),\n\t\tExternalID:  \"e123\",\n\t\tActive:      true,\n\t\tUserName:    \"e123\",\n\t\tDisplayName: \"John Doe\",\n\t\tName: &SCIMEnterpriseUserName{\n\t\t\tFormatted:  Ptr(\"John Doe X\"),\n\t\t\tFamilyName: \"updatedFamilyName\",\n\t\t\tGivenName:  \"John\",\n\t\t\tMiddleName: Ptr(\"X\"),\n\t\t},\n\t\tEmails: []*SCIMEnterpriseUserEmail{{\n\t\t\tValue:   \"john@example.com\",\n\t\t\tType:    \"work\",\n\t\t\tPrimary: true,\n\t\t}},\n\t\tRoles: []*SCIMEnterpriseUserRole{{\n\t\t\tValue:   \"User\",\n\t\t\tPrimary: Ptr(false),\n\t\t}},\n\t\tMeta: &SCIMEnterpriseMeta{\n\t\t\tResourceType: \"User\",\n\t\t\tCreated:      &Timestamp{referenceTime},\n\t\t\tLastModified: &Timestamp{referenceTime},\n\t\t\tLocation:     Ptr(\"https://api.github.localhost/scim/v2/enterprises/ee/Users/7fce\"),\n\t\t},\n\t}\n\n\tctx := t.Context()\n\tinput := SCIMEnterpriseAttribute{\n\t\tSchemas: []string{SCIMSchemasURINamespacesPatchOp},\n\t\tOperations: []*SCIMEnterpriseAttributeOperation{{\n\t\t\tOp:    \"replace\",\n\t\t\tPath:  Ptr(\"emails[type eq 'work'].value\"),\n\t\t\tValue: Ptr(\"updatedEmail@example.com\"),\n\t\t}, {\n\t\t\tOp:    \"replace\",\n\t\t\tPath:  Ptr(\"name.familyName\"),\n\t\t\tValue: Ptr(\"updatedFamilyName\"),\n\t\t}},\n\t}\n\tgot, _, err := client.Enterprise.UpdateSCIMUserAttribute(ctx, \"ee\", \"7fce\", input)\n\tif err != nil {\n\t\tt.Fatalf(\"Enterprise.UpdateSCIMUserAttribute returned unexpected error: %v\", err)\n\t}\n\tif diff := cmp.Diff(want, got); diff != \"\" {\n\t\tt.Fatalf(\"Enterprise.UpdateSCIMUserAttribute diff mismatch (-want +got):\\n%v\", diff)\n\t}\n\n\tconst methodName = \"UpdateSCIMUserAttribute\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.UpdateSCIMUserAttribute(ctx, \"\\n\", \"\\n\", SCIMEnterpriseAttribute{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.UpdateSCIMUserAttribute(ctx, \"ee\", \"7fce\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_ProvisionSCIMGroup(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/scim/v2/enterprises/ee/Groups\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeSCIM)\n\t\ttestBody(t, r, `{\"displayName\":\"dn\",\"members\":[{\"value\":\"879d\",\"display\":\"d1\"},{\"value\":\"0db5\",\"display\":\"d2\"}],\"externalId\":\"8aa1\",\"schemas\":[\"`+SCIMSchemasURINamespacesGroups+`\"]}`+\"\\n\")\n\t\tw.WriteHeader(http.StatusCreated)\n\t\tfmt.Fprint(w, `{\n\t\t\t\"schemas\": [\"`+SCIMSchemasURINamespacesGroups+`\"],\n\t\t\t\"id\": \"abcd\",\n\t\t\t\"externalId\": \"8aa1\",\n\t\t\t\"displayName\": \"dn\",\n\t\t\t\"members\": [\n\t\t\t  {\n\t\t\t    \"value\": \"879d\",\n\t\t\t    \"$ref\": \"https://api.github.localhost/scim/v2/enterprises/ee/Users/879d\",\n\t\t\t    \"display\": \"d1\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t    \"value\": \"0db5\",\n\t\t\t    \"$ref\": \"https://api.github.localhost/scim/v2/enterprises/ee/Users/0db5\",\n\t\t\t    \"display\": \"d2\"\n\t\t\t  }\n\t\t\t],\n\t\t\t\"meta\": {\n\t\t\t  \"resourceType\": \"Group\",\n\t\t\t  \"created\": `+referenceTimeStr+`,\n\t\t\t  \"lastModified\": `+referenceTimeStr+`,\n\t\t\t  \"location\": \"https://api.github.localhost/scim/v2/enterprises/ee/Groups/abcd\"\n\t\t\t}\n\t\t}`)\n\t})\n\twant := &SCIMEnterpriseGroupAttributes{\n\t\tSchemas:     []string{SCIMSchemasURINamespacesGroups},\n\t\tID:          Ptr(\"abcd\"),\n\t\tExternalID:  Ptr(\"8aa1\"),\n\t\tDisplayName: Ptr(\"dn\"),\n\t\tMembers: []*SCIMEnterpriseDisplayReference{{\n\t\t\tValue:   \"879d\",\n\t\t\tRef:     Ptr(\"https://api.github.localhost/scim/v2/enterprises/ee/Users/879d\"),\n\t\t\tDisplay: Ptr(\"d1\"),\n\t\t}, {\n\t\t\tValue:   \"0db5\",\n\t\t\tRef:     Ptr(\"https://api.github.localhost/scim/v2/enterprises/ee/Users/0db5\"),\n\t\t\tDisplay: Ptr(\"d2\"),\n\t\t}},\n\t\tMeta: &SCIMEnterpriseMeta{\n\t\t\tResourceType: \"Group\",\n\t\t\tCreated:      &Timestamp{referenceTime},\n\t\t\tLastModified: &Timestamp{referenceTime},\n\t\t\tLocation:     Ptr(\"https://api.github.localhost/scim/v2/enterprises/ee/Groups/abcd\"),\n\t\t},\n\t}\n\n\tctx := t.Context()\n\tinput := SCIMEnterpriseGroupAttributes{\n\t\tSchemas:     []string{SCIMSchemasURINamespacesGroups},\n\t\tExternalID:  Ptr(\"8aa1\"),\n\t\tDisplayName: Ptr(\"dn\"),\n\t\tMembers: []*SCIMEnterpriseDisplayReference{{\n\t\t\tValue:   \"879d\",\n\t\t\tDisplay: Ptr(\"d1\"),\n\t\t}, {\n\t\t\tValue:   \"0db5\",\n\t\t\tDisplay: Ptr(\"d2\"),\n\t\t}},\n\t}\n\tgot, _, err := client.Enterprise.ProvisionSCIMGroup(ctx, \"ee\", input)\n\tif err != nil {\n\t\tt.Fatalf(\"Enterprise.ProvisionSCIMGroup returned unexpected error: %v\", err)\n\t}\n\tif diff := cmp.Diff(want, got); diff != \"\" {\n\t\tt.Fatalf(\"Enterprise.ProvisionSCIMGroup diff mismatch (-want +got):\\n%v\", diff)\n\t}\n\n\tconst methodName = \"ProvisionSCIMGroup\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.ProvisionSCIMGroup(ctx, \"\\n\", SCIMEnterpriseGroupAttributes{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ProvisionSCIMGroup(ctx, \"ee\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_ProvisionSCIMUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/scim/v2/enterprises/ee/Users\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeSCIM)\n\t\ttestBody(t, r, `{\"displayName\":\"DOE John\",\"name\":{\"givenName\":\"John\",\"familyName\":\"Doe\",\"formatted\":\"John Doe\"},\"userName\":\"e123\",\"emails\":[{\"value\":\"john@example.com\",\"primary\":true,\"type\":\"work\"}],\"roles\":[{\"value\":\"User\",\"primary\":false}],\"externalId\":\"e123\",\"active\":true,\"schemas\":[\"`+SCIMSchemasURINamespacesUser+`\"]}`+\"\\n\")\n\t\tw.WriteHeader(http.StatusCreated)\n\t\tfmt.Fprint(w, `{\n\t\t\t\"schemas\": [\"`+SCIMSchemasURINamespacesUser+`\"],\n\t\t\t\"id\": \"7fce\",\n\t\t\t\"externalId\": \"e123\",\n\t\t\t\"active\": true,\n\t\t\t\"userName\": \"e123\",\n\t\t\t\"name\": {\n\t\t\t\t\"formatted\": \"John Doe\",\n\t\t\t\t\"familyName\": \"Doe\",\n\t\t\t\t\"givenName\": \"John\"\n\t\t\t},\n\t\t\t\"displayName\": \"DOE John\",\n\t\t\t\"emails\": [{\n\t\t\t\t\"value\": \"john@example.com\",\n\t\t\t\t\"type\": \"work\",\n\t\t\t\t\"primary\": true\n\t\t\t}],\n\t\t\t\"roles\": [{\n\t\t\t\t\"value\": \"User\",\n\t\t\t\t\"primary\": false\n\t\t\t}],\n\t\t\t\"meta\": {\n\t\t\t\t\"resourceType\": \"User\",\n\t\t\t\t\"created\": `+referenceTimeStr+`,\n\t\t\t\t\"lastModified\": `+referenceTimeStr+`,\n\t\t\t\t\"location\": \"https://api.github.localhost/scim/v2/enterprises/ee/Users/7fce\"\n\t\t\t}\n\t\t}`)\n\t})\n\twant := &SCIMEnterpriseUserAttributes{\n\t\tSchemas:     []string{SCIMSchemasURINamespacesUser},\n\t\tID:          Ptr(\"7fce\"),\n\t\tExternalID:  \"e123\",\n\t\tActive:      true,\n\t\tUserName:    \"e123\",\n\t\tDisplayName: \"DOE John\",\n\t\tName: &SCIMEnterpriseUserName{\n\t\t\tFormatted:  Ptr(\"John Doe\"),\n\t\t\tFamilyName: \"Doe\",\n\t\t\tGivenName:  \"John\",\n\t\t},\n\t\tEmails: []*SCIMEnterpriseUserEmail{{\n\t\t\tValue:   \"john@example.com\",\n\t\t\tType:    \"work\",\n\t\t\tPrimary: true,\n\t\t}},\n\t\tRoles: []*SCIMEnterpriseUserRole{{\n\t\t\tValue:   \"User\",\n\t\t\tPrimary: Ptr(false),\n\t\t}},\n\t\tMeta: &SCIMEnterpriseMeta{\n\t\t\tResourceType: \"User\",\n\t\t\tCreated:      &Timestamp{referenceTime},\n\t\t\tLastModified: &Timestamp{referenceTime},\n\t\t\tLocation:     Ptr(\"https://api.github.localhost/scim/v2/enterprises/ee/Users/7fce\"),\n\t\t},\n\t}\n\n\tctx := t.Context()\n\tinput := SCIMEnterpriseUserAttributes{\n\t\tSchemas:    []string{SCIMSchemasURINamespacesUser},\n\t\tExternalID: \"e123\",\n\t\tActive:     true,\n\t\tUserName:   \"e123\",\n\t\tName: &SCIMEnterpriseUserName{\n\t\t\tFormatted:  Ptr(\"John Doe\"),\n\t\t\tFamilyName: \"Doe\",\n\t\t\tGivenName:  \"John\",\n\t\t},\n\t\tDisplayName: \"DOE John\",\n\t\tEmails: []*SCIMEnterpriseUserEmail{{\n\t\t\tValue:   \"john@example.com\",\n\t\t\tType:    \"work\",\n\t\t\tPrimary: true,\n\t\t}},\n\t\tRoles: []*SCIMEnterpriseUserRole{{\n\t\t\tValue:   \"User\",\n\t\t\tPrimary: Ptr(false),\n\t\t}},\n\t}\n\tgot, _, err := client.Enterprise.ProvisionSCIMUser(ctx, \"ee\", input)\n\tif err != nil {\n\t\tt.Fatalf(\"Enterprise.ProvisionSCIMUser returned unexpected error: %v\", err)\n\t}\n\tif diff := cmp.Diff(want, got); diff != \"\" {\n\t\tt.Fatalf(\"Enterprise.ProvisionSCIMUser diff mismatch (-want +got):\\n%v\", diff)\n\t}\n\n\tconst methodName = \"ProvisionSCIMUser\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.ProvisionSCIMUser(ctx, \"\\n\", SCIMEnterpriseUserAttributes{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ProvisionSCIMUser(ctx, \"ee\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_GetProvisionedSCIMGroup(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/scim/v2/enterprises/ee/Groups/914a\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeSCIM)\n\t\ttestFormValues(t, r, values{\"excludedAttributes\": \"members,meta\"})\n\t\tw.WriteHeader(http.StatusOK)\n\t\tfmt.Fprint(w, `{\n\t\t\t\"schemas\": [\"`+SCIMSchemasURINamespacesGroups+`\"],\n\t\t\t\"id\": \"914a\",\n\t\t\t\"externalId\": \"de88\",\n\t\t\t\"displayName\": \"gn1\",\n\t\t\t\"meta\": {\n\t\t\t\t\"resourceType\": \"Group\",\n\t\t\t\t\"created\": `+referenceTimeStr+`,\n\t\t\t\t\"lastModified\": `+referenceTimeStr+`,\n\t\t\t\t\"location\": \"https://api.github.com/scim/v2/enterprises/ee/Groups/914a\"\n\t\t\t},\n\t\t\t\"members\": [{\n\t\t\t\t\"value\": \"e7f9\",\n\t\t\t\t\"$ref\": \"https://api.github.com/scim/v2/enterprises/ee/Users/e7f9\",\n\t\t\t\t\"display\": \"d1\"\n\t\t\t}]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\topts := &GetProvisionedSCIMGroupEnterpriseOptions{ExcludedAttributes: Ptr(\"members,meta\")}\n\tgot, _, err := client.Enterprise.GetProvisionedSCIMGroup(ctx, \"ee\", \"914a\", opts)\n\tif err != nil {\n\t\tt.Fatalf(\"Enterprise.GetProvisionedSCIMGroup returned unexpected error: %v\", err)\n\t}\n\n\twant := &SCIMEnterpriseGroupAttributes{\n\t\tID: Ptr(\"914a\"),\n\t\tMeta: &SCIMEnterpriseMeta{\n\t\t\tResourceType: \"Group\",\n\t\t\tCreated:      &Timestamp{referenceTime},\n\t\t\tLastModified: &Timestamp{referenceTime},\n\t\t\tLocation:     Ptr(\"https://api.github.com/scim/v2/enterprises/ee/Groups/914a\"),\n\t\t},\n\t\tDisplayName: Ptr(\"gn1\"),\n\t\tSchemas:     []string{SCIMSchemasURINamespacesGroups},\n\t\tExternalID:  Ptr(\"de88\"),\n\t\tMembers: []*SCIMEnterpriseDisplayReference{{\n\t\t\tValue:   \"e7f9\",\n\t\t\tRef:     Ptr(\"https://api.github.com/scim/v2/enterprises/ee/Users/e7f9\"),\n\t\t\tDisplay: Ptr(\"d1\"),\n\t\t}},\n\t}\n\n\tif diff := cmp.Diff(want, got); diff != \"\" {\n\t\tt.Fatalf(\"Enterprise.GetProvisionedSCIMGroup diff mismatch (-want +got):\\n%v\", diff)\n\t}\n\n\tconst methodName = \"GetProvisionedSCIMGroup\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.GetProvisionedSCIMGroup(ctx, \"ee\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetProvisionedSCIMGroup(ctx, \"ee\", \"914a\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_GetProvisionedSCIMUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/scim/v2/enterprises/ee/Users/5fc0\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeSCIM)\n\t\tw.WriteHeader(http.StatusOK)\n\t\tfmt.Fprint(w, `{\n\t\t\t\"schemas\": [\"`+SCIMSchemasURINamespacesUser+`\"],\n\t\t\t\"id\": \"5fc0\",\n\t\t\t\"externalId\": \"00u1\",\n\t\t\t\"userName\": \"octocat@github.com\",\n\t\t\t\"displayName\": \"Mona Octocat\",\n\t\t\t\"name\": {\n\t\t\t\t\"givenName\": \"Mona\",\n\t\t\t\t\"familyName\": \"Octocat\",\n\t\t\t\t\"formatted\": \"Mona Octocat\"\n\t\t\t},\n\t\t\t\"emails\": [\n\t\t\t\t{\n\t\t\t\t\"value\": \"octocat@github.com\",\n\t\t\t\t\"primary\": true\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"active\": true,\n\t\t\t\"meta\": {\n\t\t\t\t\"resourceType\": \"User\",\n\t\t\t\t\"created\": `+referenceTimeStr+`,\n\t\t\t\t\"lastModified\": `+referenceTimeStr+`,\n\t\t\t\t\"location\": \"https://api.github.com/scim/v2/enterprises/ee/Users/5fc0\"\n\t\t\t}\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Enterprise.GetProvisionedSCIMUser(ctx, \"ee\", \"5fc0\")\n\tif err != nil {\n\t\tt.Fatalf(\"Enterprise.GetProvisionedSCIMUser returned unexpected error: %v\", err)\n\t}\n\n\twant := &SCIMEnterpriseUserAttributes{\n\t\tSchemas:     []string{SCIMSchemasURINamespacesUser},\n\t\tID:          Ptr(\"5fc0\"),\n\t\tExternalID:  \"00u1\",\n\t\tUserName:    \"octocat@github.com\",\n\t\tDisplayName: \"Mona Octocat\",\n\t\tName: &SCIMEnterpriseUserName{\n\t\t\tGivenName:  \"Mona\",\n\t\t\tFamilyName: \"Octocat\",\n\t\t\tFormatted:  Ptr(\"Mona Octocat\"),\n\t\t},\n\t\tEmails: []*SCIMEnterpriseUserEmail{{\n\t\t\tValue:   \"octocat@github.com\",\n\t\t\tPrimary: true,\n\t\t}},\n\t\tActive: true,\n\t\tMeta: &SCIMEnterpriseMeta{\n\t\t\tResourceType: \"User\",\n\t\t\tCreated:      &Timestamp{referenceTime},\n\t\t\tLastModified: &Timestamp{referenceTime},\n\t\t\tLocation:     Ptr(\"https://api.github.com/scim/v2/enterprises/ee/Users/5fc0\"),\n\t\t},\n\t}\n\n\tif diff := cmp.Diff(want, got); diff != \"\" {\n\t\tt.Fatalf(\"Enterprise.GetProvisionedSCIMUser diff mismatch (-want +got):\\n%v\", diff)\n\t}\n\n\tconst methodName = \"GetProvisionedSCIMUser\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Enterprise.GetProvisionedSCIMUser(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetProvisionedSCIMUser(ctx, \"ee\", \"5fc0\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_DeleteSCIMGroup(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/scim/v2/enterprises/ee/Groups/abcd\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeV3)\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Enterprise.DeleteSCIMGroup(ctx, \"ee\", \"abcd\")\n\tif err != nil {\n\t\tt.Fatalf(\"Enterprise.DeleteSCIMGroup returned unexpected error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteSCIMGroup\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Enterprise.DeleteSCIMGroup(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Enterprise.DeleteSCIMGroup(ctx, \"ee\", \"abcd\")\n\t})\n}\n\nfunc TestEnterpriseService_DeleteSCIMUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/scim/v2/enterprises/ee/Users/7fce\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeV3)\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Enterprise.DeleteSCIMUser(ctx, \"ee\", \"7fce\")\n\tif err != nil {\n\t\tt.Fatalf(\"Enterprise.DeleteSCIMUser returned unexpected error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteSCIMUser\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Enterprise.DeleteSCIMUser(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Enterprise.DeleteSCIMUser(ctx, \"ee\", \"7fce\")\n\t})\n}\n"
  },
  {
    "path": "github/enterprise_team.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// EnterpriseTeam represent a team in a GitHub Enterprise.\ntype EnterpriseTeam struct {\n\tID                        int64     `json:\"id\"`\n\tURL                       string    `json:\"url\"`\n\tMemberURL                 string    `json:\"member_url\"`\n\tName                      string    `json:\"name\"`\n\tDescription               *string   `json:\"description,omitempty\"`\n\tHTMLURL                   string    `json:\"html_url\"`\n\tSlug                      string    `json:\"slug\"`\n\tCreatedAt                 Timestamp `json:\"created_at\"`\n\tUpdatedAt                 Timestamp `json:\"updated_at\"`\n\tGroupID                   string    `json:\"group_id\"`\n\tOrganizationSelectionType *string   `json:\"organization_selection_type,omitempty\"`\n}\n\n// EnterpriseTeamCreateOrUpdateRequest is used to create or update an enterprise team.\ntype EnterpriseTeamCreateOrUpdateRequest struct {\n\t// The name of the team.\n\tName string `json:\"name\"`\n\t// A description of the team.\n\tDescription *string `json:\"description,omitempty\"`\n\t// Specifies which organizations in the enterprise should have access to this team.\n\t// Possible values are \"disabled\" , \"all\" and \"selected\". If not specified, the default is \"disabled\".\n\tOrganizationSelectionType *string `json:\"organization_selection_type,omitempty\"`\n\t// The ID of the IdP group to assign team membership with.\n\tGroupID *string `json:\"group_id,omitempty\"`\n}\n\n// ListTeams lists all teams in an enterprise.\n//\n// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-teams#list-enterprise-teams\n//\n//meta:operation GET /enterprises/{enterprise}/teams\nfunc (s *EnterpriseService) ListTeams(ctx context.Context, enterprise string, opts *ListOptions) ([]*EnterpriseTeam, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/teams\", enterprise)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar teams []*EnterpriseTeam\n\tresp, err := s.client.Do(ctx, req, &teams)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn teams, resp, nil\n}\n\n// CreateTeam creates a new team in an enterprise.\n//\n// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-teams#create-an-enterprise-team\n//\n//meta:operation POST /enterprises/{enterprise}/teams\nfunc (s *EnterpriseService) CreateTeam(ctx context.Context, enterprise string, team EnterpriseTeamCreateOrUpdateRequest) (*EnterpriseTeam, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/teams\", enterprise)\n\n\treq, err := s.client.NewRequest(\"POST\", u, team)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar createdTeam *EnterpriseTeam\n\tresp, err := s.client.Do(ctx, req, &createdTeam)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn createdTeam, resp, nil\n}\n\n// GetTeam retrieves a team in an enterprise.\n//\n// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-teams#get-an-enterprise-team\n//\n//meta:operation GET /enterprises/{enterprise}/teams/{team_slug}\nfunc (s *EnterpriseService) GetTeam(ctx context.Context, enterprise, teamSlug string) (*EnterpriseTeam, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/teams/%v\", enterprise, teamSlug)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar team *EnterpriseTeam\n\tresp, err := s.client.Do(ctx, req, &team)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn team, resp, nil\n}\n\n// UpdateTeam updates a team in an enterprise.\n//\n// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-teams#update-an-enterprise-team\n//\n//meta:operation PATCH /enterprises/{enterprise}/teams/{team_slug}\nfunc (s *EnterpriseService) UpdateTeam(ctx context.Context, enterprise, teamSlug string, team EnterpriseTeamCreateOrUpdateRequest) (*EnterpriseTeam, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/teams/%v\", enterprise, teamSlug)\n\n\treq, err := s.client.NewRequest(\"PATCH\", u, team)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar updatedTeam *EnterpriseTeam\n\tresp, err := s.client.Do(ctx, req, &updatedTeam)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn updatedTeam, resp, nil\n}\n\n// DeleteTeam deletes a team in an enterprise.\n//\n// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-teams#delete-an-enterprise-team\n//\n//meta:operation DELETE /enterprises/{enterprise}/teams/{team_slug}\nfunc (s *EnterpriseService) DeleteTeam(ctx context.Context, enterprise, teamSlug string) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/teams/%v\", enterprise, teamSlug)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// ListTeamMembers lists all members of an enterprise team.\n//\n// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#list-members-in-an-enterprise-team\n//\n//meta:operation GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships\nfunc (s *EnterpriseService) ListTeamMembers(ctx context.Context, enterprise, enterpriseTeam string, opts *ListOptions) ([]*User, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/teams/%v/memberships\", enterprise, enterpriseTeam)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar members []*User\n\tresp, err := s.client.Do(ctx, req, &members)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn members, resp, nil\n}\n\n// BulkAddTeamMembers adds multiple members to an enterprise team.\n//\n// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#bulk-add-team-members\n//\n//meta:operation POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add\nfunc (s *EnterpriseService) BulkAddTeamMembers(ctx context.Context, enterprise, enterpriseTeam string, username []string) ([]*User, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/teams/%v/memberships/add\", enterprise, enterpriseTeam)\n\treq, err := s.client.NewRequest(\"POST\", u, map[string][]string{\"usernames\": username})\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar members []*User\n\tresp, err := s.client.Do(ctx, req, &members)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn members, resp, nil\n}\n\n// BulkRemoveTeamMembers removes multiple members from an enterprise team.\n//\n// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#bulk-remove-team-members\n//\n//meta:operation POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove\nfunc (s *EnterpriseService) BulkRemoveTeamMembers(ctx context.Context, enterprise, enterpriseTeam string, username []string) ([]*User, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/teams/%v/memberships/remove\", enterprise, enterpriseTeam)\n\treq, err := s.client.NewRequest(\"POST\", u, map[string][]string{\"usernames\": username})\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar members []*User\n\tresp, err := s.client.Do(ctx, req, &members)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn members, resp, nil\n}\n\n// GetTeamMembership retrieves a team membership for a user in an enterprise team.\n//\n// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#get-enterprise-team-membership\n//\n//meta:operation GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}\nfunc (s *EnterpriseService) GetTeamMembership(ctx context.Context, enterprise, enterpriseTeam, username string) (*User, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/teams/%v/memberships/%v\", enterprise, enterpriseTeam, username)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar membership *User\n\tresp, err := s.client.Do(ctx, req, &membership)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn membership, resp, nil\n}\n\n// AddTeamMember adds a member to an enterprise team.\n//\n// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#add-team-member\n//\n//meta:operation PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}\nfunc (s *EnterpriseService) AddTeamMember(ctx context.Context, enterprise, enterpriseTeam, username string) (*User, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/teams/%v/memberships/%v\", enterprise, enterpriseTeam, username)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar member *User\n\tresp, err := s.client.Do(ctx, req, &member)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn member, resp, nil\n}\n\n// RemoveTeamMember removes a member from an enterprise team.\n//\n// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#remove-team-membership\n//\n//meta:operation DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}\nfunc (s *EnterpriseService) RemoveTeamMember(ctx context.Context, enterprise, enterpriseTeam, username string) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/teams/%v/memberships/%v\", enterprise, enterpriseTeam, username)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// ListAssignments gets all organizations assigned to an enterprise team.\n//\n// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations#get-organization-assignments\n//\n//meta:operation GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations\nfunc (s *EnterpriseService) ListAssignments(ctx context.Context, enterprise, enterpriseTeam string, opts *ListOptions) ([]*Organization, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/teams/%v/organizations\", enterprise, enterpriseTeam)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar orgs []*Organization\n\tresp, err := s.client.Do(ctx, req, &orgs)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn orgs, resp, nil\n}\n\n// AddMultipleAssignments assigns an enterprise team to multiple organizations.\n//\n// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations#add-organization-assignments\n//\n//meta:operation POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/add\nfunc (s *EnterpriseService) AddMultipleAssignments(ctx context.Context, enterprise, enterpriseTeam string, organizationSlugs []string) ([]*Organization, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/teams/%v/organizations/add\", enterprise, enterpriseTeam)\n\n\treq, err := s.client.NewRequest(\"POST\", u, map[string][]string{\"organization_slugs\": organizationSlugs})\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar orgs []*Organization\n\tresp, err := s.client.Do(ctx, req, &orgs)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn orgs, resp, nil\n}\n\n// RemoveMultipleAssignments unassigns an enterprise team from multiple organizations.\n//\n// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations#remove-organization-assignments\n//\n//meta:operation POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove\nfunc (s *EnterpriseService) RemoveMultipleAssignments(ctx context.Context, enterprise, enterpriseTeam string, organizationSlugs []string) ([]*Organization, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/teams/%v/organizations/remove\", enterprise, enterpriseTeam)\n\n\treq, err := s.client.NewRequest(\"POST\", u, map[string][]string{\"organization_slugs\": organizationSlugs})\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar orgs []*Organization\n\tresp, err := s.client.Do(ctx, req, &orgs)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn orgs, resp, nil\n}\n\n// GetAssignment checks if an enterprise team is assigned to an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations#get-organization-assignment\n//\n//meta:operation GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}\nfunc (s *EnterpriseService) GetAssignment(ctx context.Context, enterprise, enterpriseTeam, org string) (*Organization, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/teams/%v/organizations/%v\", enterprise, enterpriseTeam, org)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar organization *Organization\n\tresp, err := s.client.Do(ctx, req, &organization)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn organization, resp, nil\n}\n\n// AddAssignment assigns an enterprise team to an organizations.\n//\n// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations#add-an-organization-assignment\n//\n//meta:operation PUT /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}\nfunc (s *EnterpriseService) AddAssignment(ctx context.Context, enterprise, enterpriseTeam, org string) (*Organization, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/teams/%v/organizations/%v\", enterprise, enterpriseTeam, org)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar organization *Organization\n\tresp, err := s.client.Do(ctx, req, &organization)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn organization, resp, nil\n}\n\n// RemoveAssignment unassigns an enterprise team from an organizations.\n//\n// GitHub API docs: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations#delete-an-organization-assignment\n//\n//meta:operation DELETE /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}\nfunc (s *EnterpriseService) RemoveAssignment(ctx context.Context, enterprise, enterpriseTeam, org string) (*Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/teams/%v/organizations/%v\", enterprise, enterpriseTeam, org)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n"
  },
  {
    "path": "github/enterprise_team_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestEnterpriseService_ListTeams(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/teams\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"id\": 1,\n\t\t\t\"url\": \"https://example.com/team1\",\n\t\t\t\"member_url\": \"https://example.com/members\",\n\t\t\t\"name\": \"Team One\",\n\t\t\t\"html_url\": \"https://example.com/html\",\n\t\t\t\"slug\": \"team-one\",\n\t\t\t\"created_at\": \"2020-01-01T00:00:00Z\",\n\t\t\t\"updated_at\": \"2020-01-02T00:00:00Z\",\n\t\t\t\"group_id\": \"99\"\n\t\t}]`)\n\t})\n\n\tctx := t.Context()\n\topts := &ListOptions{Page: 1, PerPage: 10}\n\tgot, _, err := client.Enterprise.ListTeams(ctx, \"e\", opts)\n\tif err != nil {\n\t\tt.Fatalf(\"Enterprise.ListTeams returned error: %v\", err)\n\t}\n\n\twant := []*EnterpriseTeam{\n\t\t{\n\t\t\tID:        1,\n\t\t\tURL:       \"https://example.com/team1\",\n\t\t\tMemberURL: \"https://example.com/members\",\n\t\t\tName:      \"Team One\",\n\t\t\tHTMLURL:   \"https://example.com/html\",\n\t\t\tSlug:      \"team-one\",\n\t\t\tGroupID:   \"99\",\n\t\t\tCreatedAt: Timestamp{Time: time.Date(2020, time.January, 1, 0, 0, 0, 0, time.UTC)},\n\t\t\tUpdatedAt: Timestamp{Time: time.Date(2020, time.January, 2, 0, 0, 0, 0, time.UTC)},\n\t\t},\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Enterprise.ListTeams = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ListTeams\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err := client.Enterprise.ListTeams(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ListTeams(ctx, \"e\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_CreateTeam(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := EnterpriseTeamCreateOrUpdateRequest{\n\t\tName: \"New Team\",\n\t}\n\n\tmux.HandleFunc(\"/enterprises/e/teams\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestBody(t, r, `{\"name\":\"New Team\"}`+\"\\n\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 10,\n\t\t\t\"name\": \"New Team\",\n\t\t\t\"slug\": \"new-team\",\n\t\t\t\"url\": \"https://example.com/team\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Enterprise.CreateTeam(ctx, \"e\", input)\n\tif err != nil {\n\t\tt.Fatalf(\"Enterprise.CreateTeam returned error: %v\", err)\n\t}\n\n\twant := &EnterpriseTeam{\n\t\tID:   10,\n\t\tName: \"New Team\",\n\t\tSlug: \"new-team\",\n\t\tURL:  \"https://example.com/team\",\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Enterprise.CreateTeam = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"CreateTeam\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.CreateTeam(ctx, \"e\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_GetTeam(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/teams/t1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 2,\n\t\t\t\"name\": \"Team One\",\n\t\t\t\"slug\": \"t1\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Enterprise.GetTeam(ctx, \"e\", \"t1\")\n\tif err != nil {\n\t\tt.Fatalf(\"Enterprise.GetTeam returned error: %v\", err)\n\t}\n\n\twant := &EnterpriseTeam{\n\t\tID:   2,\n\t\tName: \"Team One\",\n\t\tSlug: \"t1\",\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Enterprise.GetTeam = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"GetTeam\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err := client.Enterprise.GetTeam(ctx, \"\\n\", \"t1\")\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetTeam(ctx, \"e\", \"t1\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_UpdateTeam(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := EnterpriseTeamCreateOrUpdateRequest{\n\t\tName: \"Updated Team\",\n\t}\n\n\tmux.HandleFunc(\"/enterprises/e/teams/t1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\ttestBody(t, r, `{\"name\":\"Updated Team\"}`+\"\\n\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 3,\n\t\t\t\"name\": \"Updated Team\",\n\t\t\t\"slug\": \"t1\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Enterprise.UpdateTeam(ctx, \"e\", \"t1\", input)\n\tif err != nil {\n\t\tt.Fatalf(\"Enterprise.UpdateTeam returned error: %v\", err)\n\t}\n\n\twant := &EnterpriseTeam{\n\t\tID:   3,\n\t\tName: \"Updated Team\",\n\t\tSlug: \"t1\",\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Enterprise.UpdateTeam = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"UpdateTeam\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err := client.Enterprise.UpdateTeam(ctx, \"\\n\", \"t1\", input)\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.UpdateTeam(ctx, \"e\", \"t1\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_DeleteTeam(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/teams/t1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Enterprise.DeleteTeam(ctx, \"e\", \"t1\")\n\tif err != nil {\n\t\tt.Fatalf(\"Enterprise.DeleteTeam returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteTeam\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, err := client.Enterprise.DeleteTeam(ctx, \"\\n\", \"t1\")\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Enterprise.DeleteTeam(ctx, \"e\", \"t1\")\n\t})\n}\n\nfunc TestEnterpriseService_ListTeamMembers(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/teams/t1/memberships\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"login\": \"user1\",\n\t\t\t\"id\": 1001,\n\t\t\t\"url\": \"https://example.com/user1\"\n\t\t}]`)\n\t})\n\tctx := t.Context()\n\topts := &ListOptions{Page: 1, PerPage: 10}\n\tgot, _, err := client.Enterprise.ListTeamMembers(ctx, \"e\", \"t1\", opts)\n\tif err != nil {\n\t\tt.Fatalf(\"Enterprise.ListTeamMembers returned error: %v\", err)\n\t}\n\n\twant := []*User{\n\t\t{\n\t\t\tLogin: Ptr(\"user1\"),\n\t\t\tID:    Ptr(int64(1001)),\n\t\t\tURL:   Ptr(\"https://example.com/user1\"),\n\t\t},\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Enterprise.ListTeamMembers = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ListTeamMembers\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err := client.Enterprise.ListTeamMembers(ctx, \"\\n\", \"t1\", opts)\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ListTeamMembers(ctx, \"e\", \"t1\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_BulkAddTeamMembers(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/teams/t1/memberships/add\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"login\": \"u1\",\n\t\t\t\"id\": 1\n\t\t},{\n\t\t\t\"login\": \"u2\",\n\t\t\t\"id\": 2\n\t\t}]`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Enterprise.BulkAddTeamMembers(ctx, \"e\", \"t1\", []string{\"u1\", \"u2\"})\n\tif err != nil {\n\t\tt.Fatalf(\"BulkAddTeamMembers returned error: %v\", err)\n\t}\n\n\twant := []*User{\n\t\t{Login: Ptr(\"u1\"), ID: Ptr(int64(1))},\n\t\t{Login: Ptr(\"u2\"), ID: Ptr(int64(2))},\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"BulkAddTeamMembers = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"BulkAddTeamMembers\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err := client.Enterprise.BulkAddTeamMembers(ctx, \"\\n\", \"t1\", []string{\"u1\"})\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.BulkAddTeamMembers(ctx, \"e\", \"t1\", []string{\"u1\"})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_BulkRemoveTeamMembers(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/teams/t1/memberships/remove\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"login\": \"u1\",\n\t\t\t\"id\": 1\n\t\t},{\n\t\t\t\"login\": \"u2\",\n\t\t\t\"id\": 2\n\t\t}]`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Enterprise.BulkRemoveTeamMembers(ctx, \"e\", \"t1\", []string{\"u1\", \"u2\"})\n\tif err != nil {\n\t\tt.Fatalf(\"BulkRemoveTeamMembers returned error: %v\", err)\n\t}\n\n\twant := []*User{\n\t\t{Login: Ptr(\"u1\"), ID: Ptr(int64(1))},\n\t\t{Login: Ptr(\"u2\"), ID: Ptr(int64(2))},\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"BulkRemoveTeamMembers = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"BulkRemoveTeamMembers\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err := client.Enterprise.BulkRemoveTeamMembers(ctx, \"\\n\", \"t1\", []string{\"u1\"})\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.BulkRemoveTeamMembers(ctx, \"e\", \"t1\", []string{\"u1\"})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_GetTeamMembership(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/teams/t1/memberships/u1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"login\": \"u1\",\n\t\t\t\"id\": 10\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Enterprise.GetTeamMembership(ctx, \"e\", \"t1\", \"u1\")\n\tif err != nil {\n\t\tt.Fatalf(\"GetTeamMembership returned error: %v\", err)\n\t}\n\n\twant := &User{\n\t\tLogin: Ptr(\"u1\"),\n\t\tID:    Ptr(int64(10)),\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"GetTeamMembership = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"GetTeamMembership\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err := client.Enterprise.GetTeamMembership(ctx, \"\\n\", \"t1\", \"u1\")\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetTeamMembership(ctx, \"e\", \"t1\", \"u1\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_AddTeamMember(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/teams/t1/memberships/u1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"login\": \"u1\",\n\t\t\t\"id\": 5\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Enterprise.AddTeamMember(ctx, \"e\", \"t1\", \"u1\")\n\tif err != nil {\n\t\tt.Fatalf(\"AddTeamMember returned error: %v\", err)\n\t}\n\n\twant := &User{\n\t\tLogin: Ptr(\"u1\"),\n\t\tID:    Ptr(int64(5)),\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"AddTeamMember = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"AddTeamMember\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err := client.Enterprise.AddTeamMember(ctx, \"\\n\", \"t1\", \"u1\")\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.AddTeamMember(ctx, \"e\", \"t1\", \"u1\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_RemoveTeamMember(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/teams/t1/memberships/u1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Enterprise.RemoveTeamMember(ctx, \"e\", \"t1\", \"u1\")\n\tif err != nil {\n\t\tt.Fatalf(\"RemoveTeamMember returned error: %v\", err)\n\t}\n\tif resp == nil {\n\t\tt.Fatal(\"RemoveTeamMember returned nil Response\")\n\t}\n\n\tconst methodName = \"RemoveTeamMember\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, err := client.Enterprise.RemoveTeamMember(ctx, \"\\n\", \"t1\", \"u1\")\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Enterprise.RemoveTeamMember(ctx, \"e\", \"t1\", \"u1\")\n\t})\n}\n\nfunc TestEnterpriseService_ListAssignments(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/teams/t1/organizations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[\n        {\n            \"login\": \"team-one\",\n            \"id\": 1,\n            \"node_id\": \"node-id\",\n            \"url\": \"https://example.com/team1\",\n            \"repos_url\": \"https://example.com/members\",\n            \"events_url\": \"https://example.com/events\",\n            \"hooks_url\": \"https://api.github.com/orgs/team-one/hooks\",\n            \"issues_url\": \"https://api.github.com/orgs/team-one/issues\",\n            \"members_url\": \"https://api.github.com/orgs/team-one/members\",\n            \"public_members_url\": \"https://api.github.com/orgs/team-one/public_members\",\n            \"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n            \"description\": \"Team One\"\n        }\n    ]`)\n\t})\n\n\tctx := t.Context()\n\topts := &ListOptions{Page: 1, PerPage: 10}\n\tgot, _, err := client.Enterprise.ListAssignments(ctx, \"e\", \"t1\", opts)\n\tif err != nil {\n\t\tt.Fatalf(\"Enterprise.ListAssignments returned error: %v\", err)\n\t}\n\n\twant := []*Organization{\n\t\t{\n\t\t\tLogin:            Ptr(\"team-one\"),\n\t\t\tURL:              Ptr(\"https://example.com/team1\"),\n\t\t\tNodeID:           Ptr(\"node-id\"),\n\t\t\tReposURL:         Ptr(\"https://example.com/members\"),\n\t\t\tEventsURL:        Ptr(\"https://example.com/events\"),\n\t\t\tID:               Ptr(int64(1)),\n\t\t\tHooksURL:         Ptr(\"https://api.github.com/orgs/team-one/hooks\"),\n\t\t\tIssuesURL:        Ptr(\"https://api.github.com/orgs/team-one/issues\"),\n\t\t\tMembersURL:       Ptr(\"https://api.github.com/orgs/team-one/members\"),\n\t\t\tPublicMembersURL: Ptr(\"https://api.github.com/orgs/team-one/public_members\"),\n\t\t\tAvatarURL:        Ptr(\"https://github.com/images/error/octocat_happy.gif\"),\n\t\t\tDescription:      Ptr(\"Team One\"),\n\t\t},\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Enterprise.ListAssignments = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ListAssignments\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err := client.Enterprise.ListAssignments(ctx, \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.ListAssignments(ctx, \"e\", \"t1\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_AddMultipleAssignments(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/teams/t1/organizations/add\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"login\": \"o1\",\n\t\t\t\"id\": 1\n\t\t},{\n\t\t\t\"login\": \"o2\",\n\t\t\t\"id\": 2\n\t\t}]`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Enterprise.AddMultipleAssignments(ctx, \"e\", \"t1\", []string{\"o1\", \"o2\"})\n\tif err != nil {\n\t\tt.Fatalf(\"AddMultipleAssignments returned error: %v\", err)\n\t}\n\n\twant := []*Organization{\n\t\t{Login: Ptr(\"o1\"), ID: Ptr(int64(1))},\n\t\t{Login: Ptr(\"o2\"), ID: Ptr(int64(2))},\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"AddMultipleAssignments = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"AddMultipleAssignments\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err := client.Enterprise.AddMultipleAssignments(ctx, \"\\n\", \"t1\", []string{\"o1\"})\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.AddMultipleAssignments(ctx, \"e\", \"t1\", []string{\"o1\"})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_RemoveMultipleAssignments(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/teams/t1/organizations/remove\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"login\": \"o1\",\n\t\t\t\"id\": 1\n\t\t},{\n\t\t\t\"login\": \"o2\",\n\t\t\t\"id\": 2\n\t\t}]`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Enterprise.RemoveMultipleAssignments(ctx, \"e\", \"t1\", []string{\"o1\", \"o2\"})\n\tif err != nil {\n\t\tt.Fatalf(\"RemoveMultipleAssignments returned error: %v\", err)\n\t}\n\n\twant := []*Organization{\n\t\t{Login: Ptr(\"o1\"), ID: Ptr(int64(1))},\n\t\t{Login: Ptr(\"o2\"), ID: Ptr(int64(2))},\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"RemoveMultipleAssignments = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"RemoveMultipleAssignments\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err := client.Enterprise.RemoveMultipleAssignments(ctx, \"\\n\", \"t1\", []string{\"o1\"})\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.RemoveMultipleAssignments(ctx, \"e\", \"t1\", []string{\"o1\"})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_GetAssignment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/teams/t1/organizations/o1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"login\": \"o1\",\n\t\t\t\"id\": 10\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Enterprise.GetAssignment(ctx, \"e\", \"t1\", \"o1\")\n\tif err != nil {\n\t\tt.Fatalf(\"GetAssignment returned error: %v\", err)\n\t}\n\n\twant := &Organization{\n\t\tLogin: Ptr(\"o1\"),\n\t\tID:    Ptr(int64(10)),\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"GetAssignment = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"GetAssignment\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err := client.Enterprise.GetAssignment(ctx, \"\\n\", \"t1\", \"o1\")\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.GetAssignment(ctx, \"e\", \"t1\", \"o1\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_AddAssignment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/teams/t1/organizations/o1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"login\": \"o1\",\n\t\t\t\"id\": 5\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Enterprise.AddAssignment(ctx, \"e\", \"t1\", \"o1\")\n\tif err != nil {\n\t\tt.Fatalf(\"AddAssignment returned error: %v\", err)\n\t}\n\n\twant := &Organization{\n\t\tLogin: Ptr(\"o1\"),\n\t\tID:    Ptr(int64(5)),\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"AddAssignment = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"AddAssignment\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err := client.Enterprise.AddAssignment(ctx, \"\\n\", \"t1\", \"o1\")\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Enterprise.AddAssignment(ctx, \"e\", \"t1\", \"o1\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestEnterpriseService_RemoveAssignment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/teams/t1/organizations/o1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Enterprise.RemoveAssignment(ctx, \"e\", \"t1\", \"o1\")\n\tif err != nil {\n\t\tt.Fatalf(\"RemoveAssignment returned error: %v\", err)\n\t}\n\tif resp == nil {\n\t\tt.Fatal(\"RemoveAssignment returned nil Response\")\n\t}\n\n\tconst methodName = \"RemoveAssignment\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, err := client.Enterprise.RemoveAssignment(ctx, \"\\n\", \"t1\", \"o1\")\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Enterprise.RemoveAssignment(ctx, \"e\", \"t1\", \"o1\")\n\t})\n}\n"
  },
  {
    "path": "github/event.go",
    "content": "// Copyright 2018 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n)\n\n// Event represents a GitHub event.\ntype Event struct {\n\tType       *string          `json:\"type,omitempty\"`\n\tPublic     *bool            `json:\"public,omitempty\"`\n\tRawPayload *json.RawMessage `json:\"payload,omitempty\"`\n\tRepo       *Repository      `json:\"repo,omitempty\"`\n\tActor      *User            `json:\"actor,omitempty\"`\n\tOrg        *Organization    `json:\"org,omitempty\"`\n\tCreatedAt  *Timestamp       `json:\"created_at,omitempty\"`\n\tID         *string          `json:\"id,omitempty\"`\n}\n\nfunc (e Event) String() string {\n\treturn Stringify(e)\n}\n\n// ParsePayload parses the event payload. For recognized event types,\n// a value of the corresponding struct type will be returned.\nfunc (e *Event) ParsePayload() (any, error) {\n\t// It would be nice if e.Type were the snake_case name of the event,\n\t// but the existing interface uses the struct name instead.\n\tpayload := EventForType(typeToMessageMapping[e.GetType()])\n\n\tif err := json.Unmarshal(e.GetRawPayload(), &payload); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn payload, nil\n}\n\n// Payload returns the parsed event payload. For recognized event types,\n// a value of the corresponding struct type will be returned.\n//\n// Deprecated: Use ParsePayload instead, which returns an error\n// rather than panics if JSON unmarshaling raw payload fails.\nfunc (e *Event) Payload() (payload any) {\n\tvar err error\n\tpayload, err = e.ParsePayload()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn payload\n}\n"
  },
  {
    "path": "github/event_test.go",
    "content": "// Copyright 2020 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"testing\"\n)\n\nfunc TestPayload_Panic(t *testing.T) {\n\tt.Parallel()\n\tdefer func() {\n\t\tif r := recover(); r == nil {\n\t\t\tt.Error(\"Payload did not panic but should have\")\n\t\t}\n\t}()\n\n\tname := \"UserEvent\"\n\tbody := json.RawMessage(\"[\") // bogus JSON\n\te := &Event{Type: &name, RawPayload: &body}\n\te.Payload()\n}\n\nfunc TestPayload_NoPanic(t *testing.T) {\n\tt.Parallel()\n\tname := \"UserEvent\"\n\tbody := json.RawMessage(\"{}\")\n\te := &Event{Type: &name, RawPayload: &body}\n\te.Payload()\n}\n\nfunc TestEmptyEvent_NoPanic(t *testing.T) {\n\tt.Parallel()\n\te := &Event{}\n\tif _, err := e.ParsePayload(); err == nil {\n\t\tt.Error(\"ParsePayload unexpectedly succeeded on empty event\")\n\t}\n\n\te = nil\n\tif _, err := e.ParsePayload(); err == nil {\n\t\tt.Error(\"ParsePayload unexpectedly succeeded on nil event\")\n\t}\n}\n\nfunc TestEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Event{}, \"{}\")\n\n\tl := make(map[string]any)\n\tl[\"key\"] = \"value\"\n\n\tjsonMsg, _ := json.Marshal(&l)\n\n\tu := &Event{\n\t\tType:       Ptr(\"t\"),\n\t\tPublic:     Ptr(false),\n\t\tRawPayload: (*json.RawMessage)(&jsonMsg),\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tActor: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tOrg: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tCreatedAt: &Timestamp{referenceTime},\n\t\tID:        Ptr(\"id\"),\n\t}\n\n\twant := `{\n\t\t\"type\": \"t\",\n\t\t\"public\": false,\n\t\t\"payload\": {\n\t\t\t\"key\": \"value\"\n\t\t},\n\t\t\"repo\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"actor\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"org\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"id\": \"id\"\n\t}`\n\n\ttestJSONMarshal(t, u, want, cmpJSONRawMessageComparator())\n}\n"
  },
  {
    "path": "github/event_types.go",
    "content": "// Copyright 2016 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// These event types are shared between the Events API and used as Webhook payloads.\n\npackage github\n\nimport \"encoding/json\"\n\n// RequestedAction is included in a CheckRunEvent when a user has invoked an action,\n// i.e. when the CheckRunEvent's Action field is \"requested_action\".\ntype RequestedAction struct {\n\tIdentifier string `json:\"identifier\"` // The integrator reference of the action requested by the user.\n}\n\n// BranchProtectionRuleEvent triggered when a check suite is \"created\", \"edited\", or \"deleted\".\n// The Webhook event name is \"branch_protection_rule\".\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#branch_protection_rule\ntype BranchProtectionRuleEvent struct {\n\tAction       *string               `json:\"action,omitempty\"`\n\tRule         *BranchProtectionRule `json:\"rule,omitempty\"`\n\tChanges      *ProtectionChanges    `json:\"changes,omitempty\"`\n\tRepo         *Repository           `json:\"repository,omitempty\"`\n\tOrg          *Organization         `json:\"organization,omitempty\"`\n\tSender       *User                 `json:\"sender,omitempty\"`\n\tInstallation *Installation         `json:\"installation,omitempty\"`\n}\n\n// BranchProtectionConfigurationEvent is triggered when there is a change to branch protection configurations for a repository.\n// The Webhook event name is \"branch_protection_configuration\".\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#branch_protection_configuration\ntype BranchProtectionConfigurationEvent struct {\n\tAction       *string       `json:\"action,omitempty\"`\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tOrg          *Organization `json:\"organization,omitempty\"`\n\tEnterprise   *Enterprise   `json:\"enterprise,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n}\n\n// CheckRunEvent is triggered when a check run is \"created\", \"completed\", or \"rerequested\".\n// The Webhook event name is \"check_run\".\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#check_run\ntype CheckRunEvent struct {\n\tCheckRun *CheckRun `json:\"check_run,omitempty\"`\n\t// The action performed. Possible values are: \"created\", \"completed\", \"rerequested\" or \"requested_action\".\n\tAction *string `json:\"action,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tOrg          *Organization `json:\"organization,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n\n\t// The action requested by the user. Populated when the Action is \"requested_action\".\n\tRequestedAction *RequestedAction `json:\"requested_action,omitempty\"` //\n}\n\n// CheckSuiteEvent is triggered when a check suite is \"completed\", \"requested\", or \"rerequested\".\n// The Webhook event name is \"check_suite\".\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#check_suite\ntype CheckSuiteEvent struct {\n\tCheckSuite *CheckSuite `json:\"check_suite,omitempty\"`\n\t// The action performed. Possible values are: \"completed\", \"requested\" or \"rerequested\".\n\tAction *string `json:\"action,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tOrg          *Organization `json:\"organization,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n}\n\n// CommitCommentEvent is triggered when a commit comment is created.\n// The Webhook event name is \"commit_comment\".\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#commit_comment\ntype CommitCommentEvent struct {\n\tComment *RepositoryComment `json:\"comment,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tAction       *string       `json:\"action,omitempty\"`\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n\n\t// The following field is only present when the webhook is triggered on\n\t// a repository belonging to an organization.\n\tOrg *Organization `json:\"organization,omitempty\"`\n}\n\n// ContentReferenceEvent is triggered when the body or comment of an issue or\n// pull request includes a URL that matches a configured content reference\n// domain.\n// The Webhook event name is \"content_reference\".\n//\n// GitHub API docs: https://developer.github.com/webhooks/event-payloads/#content_reference\ntype ContentReferenceEvent struct {\n\tAction           *string           `json:\"action,omitempty\"`\n\tContentReference *ContentReference `json:\"content_reference,omitempty\"`\n\tRepo             *Repository       `json:\"repository,omitempty\"`\n\tSender           *User             `json:\"sender,omitempty\"`\n\tInstallation     *Installation     `json:\"installation,omitempty\"`\n}\n\n// CreateEvent represents a created repository, branch, or tag.\n// The Webhook event name is \"create\".\n//\n// Note: webhooks will not receive this event for created repositories.\n// Additionally, webhooks will not receive this event for tags if more\n// than three tags are pushed at once.\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/github-event-types#createevent\ntype CreateEvent struct {\n\tRef *string `json:\"ref,omitempty\"`\n\t// RefType is the object that was created. Possible values are: \"repository\", \"branch\", \"tag\".\n\tRefType      *string `json:\"ref_type,omitempty\"`\n\tMasterBranch *string `json:\"master_branch,omitempty\"`\n\tDescription  *string `json:\"description,omitempty\"`\n\tPusherType   *string `json:\"pusher_type,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tOrg          *Organization `json:\"organization,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n}\n\n// CustomPropertyEvent represents a created, deleted or updated custom property.\n// The Webhook event name is \"custom_property\".\n//\n// Note: this is related to custom property configuration at the enterprise or organization level.\n// See CustomPropertyValuesEvent for activity related to custom property values for a repository.\n//\n// GitHub API docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#custom_property\ntype CustomPropertyEvent struct {\n\t// Action possible values are: \"created\", \"deleted\", \"updated\".\n\tAction     *string         `json:\"action,omitempty\"`\n\tDefinition *CustomProperty `json:\"definition,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tEnterprise   *Enterprise   `json:\"enterprise,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n\tOrg          *Organization `json:\"organization,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n}\n\n// CustomPropertyValuesEvent represents an update to a custom property.\n// The Webhook event name is \"custom_property_values\".\n//\n// GitHub API docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#custom_property_values\ntype CustomPropertyValuesEvent struct {\n\t// Action possible values are: \"updated\".\n\tAction            *string                `json:\"action,omitempty\"`\n\tNewPropertyValues []*CustomPropertyValue `json:\"new_property_values,omitempty\"`\n\tOldPropertyValues []*CustomPropertyValue `json:\"old_property_values,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tEnterprise   *Enterprise   `json:\"enterprise,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tOrg          *Organization `json:\"organization,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n}\n\n// DeleteEvent represents a deleted branch or tag.\n// The Webhook event name is \"delete\".\n//\n// Note: webhooks will not receive this event for tags if more than three tags\n// are deleted at once.\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/github-event-types#deleteevent\ntype DeleteEvent struct {\n\tRef *string `json:\"ref,omitempty\"`\n\t// RefType is the object that was deleted. Possible values are: \"branch\", \"tag\".\n\tRefType *string `json:\"ref_type,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tPusherType   *string       `json:\"pusher_type,omitempty\"`\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n\n\t// The following field is only present when the webhook is triggered on\n\t// a repository belonging to an organization.\n\tOrg *Organization `json:\"organization,omitempty\"`\n}\n\n// DependabotAlertEvent is triggered when there is activity relating to Dependabot alerts.\n// The Webhook event name is \"dependabot_alert\".\n//\n// GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#dependabot_alert\ntype DependabotAlertEvent struct {\n\tAction *string          `json:\"action,omitempty\"`\n\tAlert  *DependabotAlert `json:\"alert,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tInstallation *Installation `json:\"installation,omitempty\"`\n\tEnterprise   *Enterprise   `json:\"enterprise,omitempty\"`\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\n\t// The following field is only present when the webhook is triggered on\n\t// a repository belonging to an organization.\n\tOrganization *Organization `json:\"organization,omitempty\"`\n}\n\n// DeployKeyEvent is triggered when a deploy key is added or removed from a repository.\n// The Webhook event name is \"deploy_key\".\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#deploy_key\ntype DeployKeyEvent struct {\n\t// Action is the action that was performed. Possible values are:\n\t// \"created\" or \"deleted\".\n\tAction *string `json:\"action,omitempty\"`\n\n\t// The deploy key resource.\n\tKey *Key `json:\"key,omitempty\"`\n\n\t// The Repository where the event occurred\n\tRepo *Repository `json:\"repository,omitempty\"`\n\n\t// The following field is only present when the webhook is triggered on\n\t// a repository belonging to an organization.\n\tOrganization *Organization `json:\"organization,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n}\n\n// DeploymentEvent represents a deployment.\n// The Webhook event name is \"deployment\".\n//\n// Events of this type are not visible in timelines, they are only used to trigger hooks.\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#deployment\ntype DeploymentEvent struct {\n\tDeployment  *Deployment  `json:\"deployment,omitempty\"`\n\tRepo        *Repository  `json:\"repository,omitempty\"`\n\tWorkflow    *Workflow    `json:\"workflow,omitempty\"`\n\tWorkflowRun *WorkflowRun `json:\"workflow_run,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n\n\t// The following field is only present when the webhook is triggered on\n\t// a repository belonging to an organization.\n\tOrg *Organization `json:\"organization,omitempty\"`\n}\n\n// DeploymentProtectionRuleEvent represents a deployment protection rule event.\n// The Webhook event name is \"deployment_protection_rule\".\n//\n// GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#deployment_protection_rule\ntype DeploymentProtectionRuleEvent struct {\n\tAction      *string `json:\"action,omitempty\"`\n\tEnvironment *string `json:\"environment,omitempty\"`\n\tEvent       *string `json:\"event,omitempty\"`\n\n\t// The URL GitHub provides for a third-party to use in order to pass/fail a deployment gate\n\tDeploymentCallbackURL *string        `json:\"deployment_callback_url,omitempty\"`\n\tDeployment            *Deployment    `json:\"deployment,omitempty\"`\n\tRepo                  *Repository    `json:\"repository,omitempty\"`\n\tOrganization          *Organization  `json:\"organization,omitempty\"`\n\tPullRequests          []*PullRequest `json:\"pull_requests,omitempty\"`\n\tSender                *User          `json:\"sender,omitempty\"`\n\tInstallation          *Installation  `json:\"installation,omitempty\"`\n}\n\n// DeploymentReviewEvent represents a deployment review event.\n// The Webhook event name is \"deployment_review\".\n//\n// GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads?#deployment_review\ntype DeploymentReviewEvent struct {\n\t// The action performed. Possible values are: \"requested\", \"approved\", or \"rejected\".\n\tAction *string `json:\"action,omitempty\"`\n\n\t// The following will be populated only if requested.\n\tRequester   *User   `json:\"requester,omitempty\"`\n\tEnvironment *string `json:\"environment,omitempty\"`\n\n\t// The following will be populated only if approved or rejected.\n\tApprover        *User             `json:\"approver,omitempty\"`\n\tComment         *string           `json:\"comment,omitempty\"`\n\tWorkflowJobRuns []*WorkflowJobRun `json:\"workflow_job_runs,omitempty\"`\n\n\tEnterprise     *Enterprise         `json:\"enterprise,omitempty\"`\n\tInstallation   *Installation       `json:\"installation,omitempty\"`\n\tOrganization   *Organization       `json:\"organization,omitempty\"`\n\tRepo           *Repository         `json:\"repository,omitempty\"`\n\tReviewers      []*RequiredReviewer `json:\"reviewers,omitempty\"`\n\tSender         *User               `json:\"sender,omitempty\"`\n\tSince          *string             `json:\"since,omitempty\"`\n\tWorkflowJobRun *WorkflowJobRun     `json:\"workflow_job_run,omitempty\"`\n\tWorkflowRun    *WorkflowRun        `json:\"workflow_run,omitempty\"`\n}\n\n// WorkflowJobRun represents a workflow_job_run in a GitHub DeploymentReviewEvent.\ntype WorkflowJobRun struct {\n\tConclusion  *string    `json:\"conclusion,omitempty\"`\n\tCreatedAt   *Timestamp `json:\"created_at,omitempty\"`\n\tEnvironment *string    `json:\"environment,omitempty\"`\n\tHTMLURL     *string    `json:\"html_url,omitempty\"`\n\tID          *int64     `json:\"id,omitempty\"`\n\tName        *string    `json:\"name,omitempty\"`\n\tStatus      *string    `json:\"status,omitempty\"`\n\tUpdatedAt   *Timestamp `json:\"updated_at,omitempty\"`\n}\n\n// DeploymentStatusEvent represents a deployment status.\n// The Webhook event name is \"deployment_status\".\n//\n// Events of this type are not visible in timelines, they are only used to trigger hooks.\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#deployment_status\ntype DeploymentStatusEvent struct {\n\tAction           *string           `json:\"action,omitempty\"`\n\tDeployment       *Deployment       `json:\"deployment,omitempty\"`\n\tDeploymentStatus *DeploymentStatus `json:\"deployment_status,omitempty\"`\n\tRepo             *Repository       `json:\"repository,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n\n\t// The following field is only present when the webhook is triggered on\n\t// a repository belonging to an organization.\n\tOrg *Organization `json:\"organization,omitempty\"`\n}\n\n// DiscussionCommentEvent represents a webhook event for a comment on discussion.\n// The Webhook event name is \"discussion_comment\".\n//\n// GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#discussion_comment\ntype DiscussionCommentEvent struct {\n\t// Action is the action that was performed on the comment.\n\t// Possible values are: \"created\", \"edited\", \"deleted\". ** check what all can be added\n\tAction       *string            `json:\"action,omitempty\"`\n\tDiscussion   *Discussion        `json:\"discussion,omitempty\"`\n\tComment      *CommentDiscussion `json:\"comment,omitempty\"`\n\tRepo         *Repository        `json:\"repository,omitempty\"`\n\tOrg          *Organization      `json:\"organization,omitempty\"`\n\tSender       *User              `json:\"sender,omitempty\"`\n\tInstallation *Installation      `json:\"installation,omitempty\"`\n}\n\n// CommentDiscussion represents a comment in a GitHub DiscussionCommentEvent.\ntype CommentDiscussion struct {\n\t// AuthorAssociation is the comment author's relationship to the repository.\n\t// Possible values are \"COLLABORATOR\", \"CONTRIBUTOR\", \"FIRST_TIMER\", \"FIRST_TIME_CONTRIBUTOR\", \"MEMBER\", \"OWNER\", or \"NONE\".\n\t//\n\t// Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025.\n\t// Use the Discussions REST API endpoint to retrieve this information.\n\t// See: https://docs.github.com/rest/discussions/comments#get-a-discussion-comment\n\tAuthorAssociation *string    `json:\"author_association,omitempty\"`\n\tBody              *string    `json:\"body,omitempty\"`\n\tChildCommentCount *int       `json:\"child_comment_count,omitempty\"`\n\tCreatedAt         *Timestamp `json:\"created_at,omitempty\"`\n\tDiscussionID      *int64     `json:\"discussion_id,omitempty\"`\n\tHTMLURL           *string    `json:\"html_url,omitempty\"`\n\tID                *int64     `json:\"id,omitempty\"`\n\tNodeID            *string    `json:\"node_id,omitempty\"`\n\tParentID          *int64     `json:\"parent_id,omitempty\"`\n\tReactions         *Reactions `json:\"reactions,omitempty\"`\n\tRepositoryURL     *string    `json:\"repository_url,omitempty\"`\n\tUpdatedAt         *Timestamp `json:\"updated_at,omitempty\"`\n\tUser              *User      `json:\"user,omitempty\"`\n}\n\n// DiscussionEvent represents a webhook event for a discussion.\n// The Webhook event name is \"discussion\".\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#discussion\ntype DiscussionEvent struct {\n\t// Action is the action that was performed. Possible values are:\n\t// created, edited, deleted, pinned, unpinned, locked, unlocked,\n\t// transferred, category_changed, answered, or unanswered.\n\tAction       *string       `json:\"action,omitempty\"`\n\tDiscussion   *Discussion   `json:\"discussion,omitempty\"`\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tOrg          *Organization `json:\"organization,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n}\n\n// Discussion represents a discussion in a GitHub DiscussionEvent.\ntype Discussion struct {\n\tRepositoryURL      *string             `json:\"repository_url,omitempty\"`\n\tDiscussionCategory *DiscussionCategory `json:\"category,omitempty\"`\n\tAnswerHTMLURL      *string             `json:\"answer_html_url,omitempty\"`\n\tAnswerChosenAt     *Timestamp          `json:\"answer_chosen_at,omitempty\"`\n\tAnswerChosenBy     *string             `json:\"answer_chosen_by,omitempty\"`\n\tHTMLURL            *string             `json:\"html_url,omitempty\"`\n\tID                 *int64              `json:\"id,omitempty\"`\n\tNodeID             *string             `json:\"node_id,omitempty\"`\n\tNumber             *int                `json:\"number,omitempty\"`\n\tTitle              *string             `json:\"title,omitempty\"`\n\tUser               *User               `json:\"user,omitempty\"`\n\tState              *string             `json:\"state,omitempty\"`\n\tLocked             *bool               `json:\"locked,omitempty\"`\n\tComments           *int                `json:\"comments,omitempty\"`\n\tCreatedAt          *Timestamp          `json:\"created_at,omitempty\"`\n\tUpdatedAt          *Timestamp          `json:\"updated_at,omitempty\"`\n\t// AuthorAssociation is the discussion author's relationship to the repository.\n\t// Possible values are \"COLLABORATOR\", \"CONTRIBUTOR\", \"FIRST_TIMER\", \"FIRST_TIME_CONTRIBUTOR\", \"MEMBER\", \"OWNER\", or \"NONE\".\n\t//\n\t// Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025.\n\t// Use the Discussions REST API endpoint to retrieve this information.\n\t// See: https://docs.github.com/rest/discussions/discussions#get-a-discussion\n\tAuthorAssociation *string `json:\"author_association,omitempty\"`\n\tActiveLockReason  *string `json:\"active_lock_reason,omitempty\"`\n\tBody              *string `json:\"body,omitempty\"`\n}\n\n// DiscussionCategory represents a discussion category in a GitHub DiscussionEvent.\ntype DiscussionCategory struct {\n\tID           *int64     `json:\"id,omitempty\"`\n\tNodeID       *string    `json:\"node_id,omitempty\"`\n\tRepositoryID *int64     `json:\"repository_id,omitempty\"`\n\tEmoji        *string    `json:\"emoji,omitempty\"`\n\tName         *string    `json:\"name,omitempty\"`\n\tDescription  *string    `json:\"description,omitempty\"`\n\tCreatedAt    *Timestamp `json:\"created_at,omitempty\"`\n\tUpdatedAt    *Timestamp `json:\"updated_at,omitempty\"`\n\tSlug         *string    `json:\"slug,omitempty\"`\n\tIsAnswerable *bool      `json:\"is_answerable,omitempty\"`\n}\n\n// ForkEvent is triggered when a user forks a repository.\n// The Webhook event name is \"fork\".\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#fork\ntype ForkEvent struct {\n\t// Forkee is the created repository.\n\tForkee *Repository `json:\"forkee,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n}\n\n// GitHubAppAuthorizationEvent is triggered when a user's authorization for a\n// GitHub Application is revoked.\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#github_app_authorization\ntype GitHubAppAuthorizationEvent struct {\n\t// The action performed. Possible value is: \"revoked\".\n\tAction *string `json:\"action,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n}\n\n// Page represents a single Wiki page.\ntype Page struct {\n\tPageName *string `json:\"page_name,omitempty\"`\n\tTitle    *string `json:\"title,omitempty\"`\n\tSummary  *string `json:\"summary,omitempty\"`\n\tAction   *string `json:\"action,omitempty\"`\n\tSHA      *string `json:\"sha,omitempty\"`\n\tHTMLURL  *string `json:\"html_url,omitempty\"`\n}\n\n// GollumEvent is triggered when a Wiki page is created or updated.\n// The Webhook event name is \"gollum\".\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#gollum\ntype GollumEvent struct {\n\tPages []*Page `json:\"pages,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n\n\t// The following field is only present when the webhook is triggered on\n\t// a repository belonging to an organization.\n\tOrg *Organization `json:\"organization,omitempty\"`\n}\n\n// EditChange represents the changes when an issue, pull request, comment,\n// or repository has been edited.\ntype EditChange struct {\n\tTitle         *EditTitle         `json:\"title,omitempty\"`\n\tBody          *EditBody          `json:\"body,omitempty\"`\n\tBase          *EditBase          `json:\"base,omitempty\"`\n\tRepo          *EditRepo          `json:\"repository,omitempty\"`\n\tOwner         *EditOwner         `json:\"owner,omitempty\"`\n\tDefaultBranch *EditDefaultBranch `json:\"default_branch,omitempty\"`\n\tTopics        *EditTopics        `json:\"topics,omitempty\"`\n}\n\n// EditTitle represents a pull-request title change.\ntype EditTitle struct {\n\tFrom *string `json:\"from,omitempty\"`\n}\n\n// EditBody represents a change of pull-request body.\ntype EditBody struct {\n\tFrom *string `json:\"from,omitempty\"`\n}\n\n// EditBase represents the change of a pull-request base branch.\ntype EditBase struct {\n\tRef *EditRef `json:\"ref,omitempty\"`\n\tSHA *EditSHA `json:\"sha,omitempty\"`\n}\n\n// EditRef represents a ref change of a pull-request.\ntype EditRef struct {\n\tFrom *string `json:\"from,omitempty\"`\n}\n\n// EditRepo represents a change of repository name.\ntype EditRepo struct {\n\tName *RepoName `json:\"name,omitempty\"`\n}\n\n// EditOwner represents a change of repository ownership.\ntype EditOwner struct {\n\tOwnerInfo *OwnerInfo `json:\"from,omitempty\"`\n}\n\n// OwnerInfo represents the account info of the owner of the repo (could be User or Organization but both are User structs).\ntype OwnerInfo struct {\n\tUser *User `json:\"user,omitempty\"`\n\tOrg  *User `json:\"organization,omitempty\"`\n}\n\n// RepoName represents a change of repository name.\ntype RepoName struct {\n\tFrom *string `json:\"from,omitempty\"`\n}\n\n// EditTopics represents a change of repository topics.\ntype EditTopics struct {\n\tFrom []string `json:\"from,omitempty\"`\n}\n\n// EditSHA represents a sha change of a pull-request.\ntype EditSHA struct {\n\tFrom *string `json:\"from,omitempty\"`\n}\n\n// EditDefaultBranch represents a change of repository's default branch name.\ntype EditDefaultBranch struct {\n\tFrom *string `json:\"from,omitempty\"`\n}\n\n// ProjectChange represents the changes when a project has been edited.\ntype ProjectChange struct {\n\tName *ProjectName `json:\"name,omitempty\"`\n\tBody *ProjectBody `json:\"body,omitempty\"`\n}\n\n// ProjectName represents a project name change.\ntype ProjectName struct {\n\tFrom *string `json:\"from,omitempty\"`\n}\n\n// ProjectBody represents a project body change.\ntype ProjectBody struct {\n\tFrom *string `json:\"from,omitempty\"`\n}\n\n// ProjectCardChange represents the changes when a project card has been edited.\ntype ProjectCardChange struct {\n\tNote *ProjectCardNote `json:\"note,omitempty\"`\n}\n\n// ProjectCardNote represents a change of a note of a project card.\ntype ProjectCardNote struct {\n\tFrom *string `json:\"from,omitempty\"`\n}\n\n// ProjectColumnChange represents the changes when a project column has been edited.\ntype ProjectColumnChange struct {\n\tName *ProjectColumnName `json:\"name,omitempty\"`\n}\n\n// ProjectColumnName represents a project column name change.\ntype ProjectColumnName struct {\n\tFrom *string `json:\"from,omitempty\"`\n}\n\n// TeamChange represents the changes when a team has been edited.\ntype TeamChange struct {\n\tDescription *TeamDescription `json:\"description,omitempty\"`\n\tName        *TeamName        `json:\"name,omitempty\"`\n\tPrivacy     *TeamPrivacy     `json:\"privacy,omitempty\"`\n\tRepository  *TeamRepository  `json:\"repository,omitempty\"`\n}\n\n// TeamDescription represents a team description change.\ntype TeamDescription struct {\n\tFrom *string `json:\"from,omitempty\"`\n}\n\n// TeamName represents a team name change.\ntype TeamName struct {\n\tFrom *string `json:\"from,omitempty\"`\n}\n\n// TeamPrivacy represents a team privacy change.\ntype TeamPrivacy struct {\n\tFrom *string `json:\"from,omitempty\"`\n}\n\n// TeamRepository represents a team repository permission change.\ntype TeamRepository struct {\n\tPermissions *TeamPermissions `json:\"permissions,omitempty\"`\n}\n\n// TeamPermissions represents a team permission change.\ntype TeamPermissions struct {\n\tFrom *TeamPermissionsFrom `json:\"from,omitempty\"`\n}\n\n// TeamPermissionsFrom represents a team permission change.\ntype TeamPermissionsFrom struct {\n\tAdmin *bool `json:\"admin,omitempty\"`\n\tPull  *bool `json:\"pull,omitempty\"`\n\tPush  *bool `json:\"push,omitempty\"`\n}\n\n// InstallationEvent is triggered when a GitHub App has been installed, uninstalled, suspend, unsuspended\n// or new permissions have been accepted.\n// The Webhook event name is \"installation\".\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#installation\ntype InstallationEvent struct {\n\t// The action that was performed. Can be either \"created\", \"deleted\", \"suspend\", \"unsuspend\" or \"new_permissions_accepted\".\n\tAction       *string       `json:\"action,omitempty\"`\n\tRepositories []*Repository `json:\"repositories,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n\tRequester    *User         `json:\"requester,omitempty\"`\n\n\t// The following field is only present when the webhook is triggered on\n\t// a repository belonging to an organization.\n\tOrg *Organization `json:\"organization,omitempty\"`\n}\n\n// InstallationRepositoriesEvent is triggered when a repository is added or\n// removed from an installation. The Webhook event name is \"installation_repositories\".\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#installation_repositories\ntype InstallationRepositoriesEvent struct {\n\t// The action that was performed. Can be either \"added\" or \"removed\".\n\tAction              *string       `json:\"action,omitempty\"`\n\tRepositoriesAdded   []*Repository `json:\"repositories_added,omitempty\"`\n\tRepositoriesRemoved []*Repository `json:\"repositories_removed,omitempty\"`\n\tRepositorySelection *string       `json:\"repository_selection,omitempty\"`\n\tSender              *User         `json:\"sender,omitempty\"`\n\tInstallation        *Installation `json:\"installation,omitempty\"`\n\n\t// The following field is only present when the webhook is triggered on\n\t// a repository belonging to an organization.\n\tOrg *Organization `json:\"organization,omitempty\"`\n}\n\n// InstallationLoginChange represents a change in login on an installation.\ntype InstallationLoginChange struct {\n\tFrom *string `json:\"from,omitempty\"`\n}\n\n// InstallationSlugChange represents a change in slug on an installation.\ntype InstallationSlugChange struct {\n\tFrom *string `json:\"from,omitempty\"`\n}\n\n// InstallationChanges represents a change in slug or login on an installation.\ntype InstallationChanges struct {\n\tLogin *InstallationLoginChange `json:\"login,omitempty\"`\n\tSlug  *InstallationSlugChange  `json:\"slug,omitempty\"`\n}\n\n// InstallationTargetEvent is triggered when there is activity on an installation from a user or organization account.\n// The Webhook event name is \"installation_target\".\n//\n// GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#installation_target\ntype InstallationTargetEvent struct {\n\tAccount      *User                `json:\"account,omitempty\"`\n\tAction       *string              `json:\"action,omitempty\"`\n\tChanges      *InstallationChanges `json:\"changes,omitempty\"`\n\tEnterprise   *Enterprise          `json:\"enterprise,omitempty\"`\n\tInstallation *Installation        `json:\"installation,omitempty\"`\n\tOrganization *Organization        `json:\"organization,omitempty\"`\n\tRepository   *Repository          `json:\"repository,omitempty\"`\n\tSender       *User                `json:\"sender,omitempty\"`\n\tTargetType   *string              `json:\"target_type,omitempty\"`\n}\n\n// IssueCommentEvent is triggered when an issue comment is created on an issue\n// or pull request.\n// The Webhook event name is \"issue_comment\".\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#issue_comment\ntype IssueCommentEvent struct {\n\t// Action is the action that was performed on the comment.\n\t// Possible values are: \"created\", \"edited\", \"deleted\".\n\tAction  *string       `json:\"action,omitempty\"`\n\tIssue   *Issue        `json:\"issue,omitempty\"`\n\tComment *IssueComment `json:\"comment,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tChanges      *EditChange   `json:\"changes,omitempty\"`\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n\n\t// The following field is only present when the webhook is triggered on\n\t// a repository belonging to an organization.\n\tOrganization *Organization `json:\"organization,omitempty\"`\n}\n\n// IssuesEvent is triggered when an issue is opened, edited, deleted, transferred,\n// pinned, unpinned, closed, reopened, assigned, unassigned, labeled, unlabeled,\n// locked, unlocked, milestoned, or demilestoned.\n// The Webhook event name is \"issues\".\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#issues\ntype IssuesEvent struct {\n\t// Action is the action that was performed. Possible values are: \"opened\",\n\t// \"edited\", \"deleted\", \"transferred\", \"pinned\", \"unpinned\", \"closed\", \"reopened\",\n\t// \"assigned\", \"unassigned\", \"labeled\", \"unlabeled\", \"locked\", \"unlocked\",\n\t// \"milestoned\", or \"demilestoned\".\n\tAction   *string `json:\"action,omitempty\"`\n\tIssue    *Issue  `json:\"issue,omitempty\"`\n\tAssignee *User   `json:\"assignee,omitempty\"`\n\tLabel    *Label  `json:\"label,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tChanges      *EditChange   `json:\"changes,omitempty\"`\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n\tMilestone    *Milestone    `json:\"milestone,omitempty\"`\n\n\t// The following field is only present when the webhook is triggered on\n\t// a repository belonging to an organization.\n\tOrg *Organization `json:\"organization,omitempty\"`\n}\n\n// LabelEvent is triggered when a repository's label is created, edited, or deleted.\n// The Webhook event name is \"label\"\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#label\ntype LabelEvent struct {\n\t// Action is the action that was performed. Possible values are:\n\t// \"created\", \"edited\", \"deleted\"\n\tAction  *string     `json:\"action,omitempty\"`\n\tLabel   *Label      `json:\"label,omitempty\"`\n\tChanges *EditChange `json:\"changes,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tOrg          *Organization `json:\"organization,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n}\n\n// MarketplacePurchaseEvent is triggered when a user purchases, cancels, or changes\n// their GitHub Marketplace plan.\n// Webhook event name \"marketplace_purchase\".\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#marketplace_purchase\ntype MarketplacePurchaseEvent struct {\n\t// Action is the action that was performed. Possible values are:\n\t// \"purchased\", \"cancelled\", \"pending_change\", \"pending_change_cancelled\", \"changed\".\n\tAction *string `json:\"action,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tEffectiveDate               *Timestamp           `json:\"effective_date,omitempty\"`\n\tMarketplacePurchase         *MarketplacePurchase `json:\"marketplace_purchase,omitempty\"`\n\tPreviousMarketplacePurchase *MarketplacePurchase `json:\"previous_marketplace_purchase,omitempty\"`\n\tSender                      *User                `json:\"sender,omitempty\"`\n\tInstallation                *Installation        `json:\"installation,omitempty\"`\n\n\t// The following field is only present when the webhook is triggered on\n\t// a repository belonging to an organization.\n\tOrg *Organization `json:\"organization,omitempty\"`\n}\n\n// MemberChangesPermission represents changes to a repository collaborator's permissions.\ntype MemberChangesPermission struct {\n\tFrom *string `json:\"from,omitempty\"`\n\tTo   *string `json:\"to,omitempty\"`\n}\n\n// MemberChangesRoleName represents changes to a repository collaborator's role.\ntype MemberChangesRoleName struct {\n\tFrom *string `json:\"from,omitempty\"`\n\tTo   *string `json:\"to,omitempty\"`\n}\n\n// MemberChanges represents changes to a repository collaborator's role or permission.\ntype MemberChanges struct {\n\tPermission *MemberChangesPermission `json:\"permission,omitempty\"`\n\tRoleName   *MemberChangesRoleName   `json:\"role_name,omitempty\"`\n}\n\n// MemberEvent is triggered when a user's membership as a collaborator to a repository changes.\n// The Webhook event name is \"member\".\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#member\ntype MemberEvent struct {\n\t// Action is the action that was performed. Possible values are: \"added\", \"edited\", \"removed\".\n\tAction  *string        `json:\"action,omitempty\"`\n\tMember  *User          `json:\"member,omitempty\"`\n\tChanges *MemberChanges `json:\"changes,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n\n\t// The following field is only present when the webhook is triggered on\n\t// a repository belonging to an organization.\n\tOrg *Organization `json:\"organization,omitempty\"`\n}\n\n// MembershipEvent is triggered when a user is added or removed from a team.\n// The Webhook event name is \"membership\".\n//\n// Events of this type are not visible in timelines, they are only used to\n// trigger organization webhooks.\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#membership\ntype MembershipEvent struct {\n\t// Action is the action that was performed. Possible values are: \"added\", \"removed\".\n\tAction *string `json:\"action,omitempty\"`\n\t// Scope is the scope of the membership. Possible value is: \"team\".\n\tScope  *string `json:\"scope,omitempty\"`\n\tMember *User   `json:\"member,omitempty\"`\n\tTeam   *Team   `json:\"team,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tOrg          *Organization `json:\"organization,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n}\n\n// MergeGroup represents the merge group in a merge queue.\ntype MergeGroup struct {\n\t// The SHA of the merge group.\n\tHeadSHA *string `json:\"head_sha,omitempty\"`\n\t// The full ref of the merge group.\n\tHeadRef *string `json:\"head_ref,omitempty\"`\n\t// The SHA of the merge group's parent commit.\n\tBaseSHA *string `json:\"base_sha,omitempty\"`\n\t// The full ref of the branch into which the merge group will be merged.\n\tBaseRef *string `json:\"base_ref,omitempty\"`\n\t// An expanded representation of the head_sha commit.\n\tHeadCommit *Commit `json:\"head_commit,omitempty\"`\n}\n\n// MergeGroupEvent represents activity related to merge groups in a merge queue. The type of activity is specified\n// in the action property of the payload object.\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#merge_group\ntype MergeGroupEvent struct {\n\t// The action that was performed. Possible values are: \"checks_requested\", \"destroyed\".\n\tAction *string `json:\"action,omitempty\"`\n\t// Reason is populated when the action is \"destroyed\". Possible values: \"merged\", \"invalidated\", \"dequeued\".\n\tReason *string `json:\"reason,omitempty\"`\n\t// The merge group.\n\tMergeGroup *MergeGroup `json:\"merge_group,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tOrg          *Organization `json:\"organization,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n}\n\n// MetaEvent is triggered when the webhook that this event is configured on is deleted.\n// This event will only listen for changes to the particular hook the event is installed on.\n// Therefore, it must be selected for each hook that you'd like to receive meta events for.\n// The Webhook event name is \"meta\".\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#meta\ntype MetaEvent struct {\n\t// Action is the action that was performed. Possible value is: \"deleted\".\n\tAction *string `json:\"action,omitempty\"`\n\t// The ID of the modified webhook.\n\tHookID *int64 `json:\"hook_id,omitempty\"`\n\t// The modified webhook.\n\t// This will contain different keys based on the type of webhook it is: repository,\n\t// organization, business, app, or GitHub Marketplace.\n\tHook *Hook `json:\"hook,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tOrg          *Organization `json:\"organization,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n}\n\n// MilestoneEvent is triggered when a milestone is created, closed, opened, edited, or deleted.\n// The Webhook event name is \"milestone\".\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#milestone\ntype MilestoneEvent struct {\n\t// Action is the action that was performed. Possible values are:\n\t// \"created\", \"closed\", \"opened\", \"edited\", \"deleted\"\n\tAction    *string    `json:\"action,omitempty\"`\n\tMilestone *Milestone `json:\"milestone,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tChanges      *EditChange   `json:\"changes,omitempty\"`\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tOrg          *Organization `json:\"organization,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n}\n\n// OrganizationEvent is triggered when an organization is deleted and renamed, and when a user is added,\n// removed, or invited to an organization.\n// Events of this type are not visible in timelines. These events are only used to trigger organization hooks.\n// Webhook event name is \"organization\".\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#organization\ntype OrganizationEvent struct {\n\t// Action is the action that was performed.\n\t// Possible values are: \"deleted\", \"renamed\", \"member_added\", \"member_removed\", or \"member_invited\".\n\tAction *string `json:\"action,omitempty\"`\n\n\t// Invitation is the invitation for the user or email if the action is \"member_invited\".\n\tInvitation *Invitation `json:\"invitation,omitempty\"`\n\n\t// Membership is the membership between the user and the organization.\n\t// Not present when the action is \"member_invited\".\n\tMembership *Membership `json:\"membership,omitempty\"`\n\n\tOrganization *Organization `json:\"organization,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n}\n\n// OrgBlockEvent is triggered when an organization blocks or unblocks a user.\n// The Webhook event name is \"org_block\".\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#org_block\ntype OrgBlockEvent struct {\n\t// Action is the action that was performed.\n\t// Can be \"blocked\" or \"unblocked\".\n\tAction       *string       `json:\"action,omitempty\"`\n\tBlockedUser  *User         `json:\"blocked_user,omitempty\"`\n\tOrganization *Organization `json:\"organization,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tInstallation *Installation `json:\"installation,omitempty\"`\n}\n\n// PackageEvent represents activity related to GitHub Packages.\n// The Webhook event name is \"package\".\n//\n// This event is triggered when a GitHub Package is published or updated.\n//\n// GitHub API docs: https://developer.github.com/webhooks/event-payloads/#package\ntype PackageEvent struct {\n\t// Action is the action that was performed.\n\t// Can be \"published\" or \"updated\".\n\tAction  *string       `json:\"action,omitempty\"`\n\tPackage *Package      `json:\"package,omitempty\"`\n\tRepo    *Repository   `json:\"repository,omitempty\"`\n\tOrg     *Organization `json:\"organization,omitempty\"`\n\tSender  *User         `json:\"sender,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tInstallation *Installation `json:\"installation,omitempty\"`\n}\n\n// PageBuildEvent represents an attempted build of a GitHub Pages site, whether\n// successful or not.\n// The Webhook event name is \"page_build\".\n//\n// This event is triggered on push to a GitHub Pages enabled branch (gh-pages\n// for project pages, master for user and organization pages).\n//\n// Events of this type are not visible in timelines, they are only used to trigger hooks.\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#page_build\ntype PageBuildEvent struct {\n\tBuild *PagesBuild `json:\"build,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tID           *int64        `json:\"id,omitempty\"`\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n\n\t// The following field is only present when the webhook is triggered on\n\t// a repository belonging to an organization.\n\tOrg *Organization `json:\"organization,omitempty\"`\n}\n\n// PersonalAccessTokenRequestEvent occurs when there is activity relating to a\n// request for a fine-grained personal access token to access resources that\n// belong to a resource owner that requires approval for token access.\n// The webhook event name is \"personal_access_token_request\".\n//\n// GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#personal_access_token_request\ntype PersonalAccessTokenRequestEvent struct {\n\t// Action is the action that was performed. Possible values are:\n\t// \"approved\", \"cancelled\", \"created\" or \"denied\"\n\tAction                     *string                     `json:\"action,omitempty\"`\n\tPersonalAccessTokenRequest *PersonalAccessTokenRequest `json:\"personal_access_token_request,omitempty\"`\n\tOrg                        *Organization               `json:\"organization,omitempty\"`\n\tSender                     *User                       `json:\"sender,omitempty\"`\n\tInstallation               *Installation               `json:\"installation,omitempty\"`\n}\n\n// PersonalAccessTokenRequest contains the details of a PersonalAccessTokenRequestEvent.\ntype PersonalAccessTokenRequest struct {\n\t// Unique identifier of the request for access via fine-grained personal\n\t// access token. Used as the pat_request_id parameter in the list and review\n\t// API calls.\n\tID    *int64 `json:\"id,omitempty\"`\n\tOwner *User  `json:\"owner,omitempty\"`\n\n\t// New requested permissions, categorized by type of permission.\n\tPermissionsAdded *PersonalAccessTokenPermissions `json:\"permissions_added,omitempty\"`\n\n\t// Requested permissions that elevate access for a previously approved\n\t// request for access, categorized by type of permission.\n\tPermissionsUpgraded *PersonalAccessTokenPermissions `json:\"permissions_upgraded,omitempty\"`\n\n\t// Permissions requested, categorized by type of permission.\n\t// This field incorporates permissions_added and permissions_upgraded.\n\tPermissionsResult *PersonalAccessTokenPermissions `json:\"permissions_result,omitempty\"`\n\n\t// Type of repository selection requested. Possible values are:\n\t// \"none\", \"all\" or \"subset\"\n\tRepositorySelection *string `json:\"repository_selection,omitempty\"`\n\n\t// The number of repositories the token is requesting access to.\n\t// This field is only populated when repository_selection is subset.\n\tRepositoryCount *int64 `json:\"repository_count,omitempty\"`\n\n\t// An array of repository objects the token is requesting access to.\n\t// This field is only populated when repository_selection is subset.\n\tRepositories []*Repository `json:\"repositories,omitempty\"`\n\n\t// Date and time when the request for access was created.\n\tCreatedAt *Timestamp `json:\"created_at,omitempty\"`\n\n\t// Whether the associated fine-grained personal access token has expired.\n\tTokenExpired *bool `json:\"token_expired,omitempty\"`\n\n\t// Date and time when the associated fine-grained personal access token expires.\n\tTokenExpiresAt *Timestamp `json:\"token_expires_at,omitempty\"`\n\n\t// Date and time when the associated fine-grained personal access token was last used for authentication.\n\tTokenLastUsedAt *Timestamp `json:\"token_last_used_at,omitempty\"`\n\n\t// The following field is only present when the webhook is triggered on\n\t// a repository belonging to an organization.\n\tOrg *Organization `json:\"organization,omitempty\"`\n}\n\n// PersonalAccessTokenPermissions represents the original or newly requested\n// scope of permissions for a fine-grained personal access token within a PersonalAccessTokenRequest.\ntype PersonalAccessTokenPermissions struct {\n\tOrg   map[string]string `json:\"organization,omitempty\"`\n\tRepo  map[string]string `json:\"repository,omitempty\"`\n\tOther map[string]string `json:\"other,omitempty\"`\n}\n\n// PingEvent is triggered when a Webhook is added to GitHub.\n//\n// GitHub API docs: https://developer.github.com/webhooks/#ping-event\ntype PingEvent struct {\n\t// Random string of GitHub zen.\n\tZen *string `json:\"zen,omitempty\"`\n\t// The ID of the webhook that triggered the ping.\n\tHookID *int64 `json:\"hook_id,omitempty\"`\n\t// The webhook configuration.\n\tHook *Hook `json:\"hook,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tOrg          *Organization `json:\"organization,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n}\n\n// ProjectV2Event is triggered when there is activity relating to an organization-level project.\n// The Webhook event name is \"projects_v2\".\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#projects_v2\ntype ProjectV2Event struct {\n\tAction     *string    `json:\"action,omitempty\"`\n\tProjectsV2 *ProjectV2 `json:\"projects_v2,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tInstallation *Installation `json:\"installation,omitempty\"`\n\tOrg          *Organization `json:\"organization,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n}\n\n// ProjectV2ItemEvent is triggered when there is activity relating to an item on an organization-level project.\n// The Webhook event name is \"projects_v2_item\".\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#projects_v2_item\ntype ProjectV2ItemEvent struct {\n\tAction        *string              `json:\"action,omitempty\"`\n\tChanges       *ProjectV2ItemChange `json:\"changes,omitempty\"`\n\tProjectV2Item *ProjectV2Item       `json:\"projects_v2_item,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tInstallation *Installation `json:\"installation,omitempty\"`\n\tOrg          *Organization `json:\"organization,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n}\n\n// ProjectV2ItemChange represents a project v2 item change.\ntype ProjectV2ItemChange struct {\n\tArchivedAt *ArchivedAt `json:\"archived_at,omitempty\"`\n\tFieldValue *FieldValue `json:\"field_value,omitempty\"`\n}\n\n// ArchivedAt represents an archiving date change.\ntype ArchivedAt struct {\n\tFrom *Timestamp `json:\"from,omitempty\"`\n\tTo   *Timestamp `json:\"to,omitempty\"`\n}\n\n// FieldValue represents an editing field value change.\ntype FieldValue struct {\n\tFieldNodeID   *string         `json:\"field_node_id,omitempty\"`\n\tFieldType     *string         `json:\"field_type,omitempty\"`\n\tFieldName     *string         `json:\"field_name,omitempty\"`\n\tProjectNumber *int64          `json:\"project_number,omitempty\"`\n\tFrom          json.RawMessage `json:\"from,omitempty\"`\n\tTo            json.RawMessage `json:\"to,omitempty\"`\n}\n\n// PublicEvent is triggered when a private repository is open sourced.\n// According to GitHub: \"Without a doubt: the best GitHub event.\"\n// The Webhook event name is \"public\".\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#public\ntype PublicEvent struct {\n\t// The following fields are only populated by Webhook events.\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n\n\t// The following field is only present when the webhook is triggered on\n\t// a repository belonging to an organization.\n\tOrg *Organization `json:\"organization,omitempty\"`\n}\n\n// PullRequestEvent is triggered when a pull request is assigned, unassigned, labeled,\n// unlabeled, opened, edited, closed, reopened, synchronize, ready_for_review,\n// locked, unlocked, a pull request review is requested, or a review request is removed.\n// The Webhook event name is \"pull_request\".\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/github-event-types#pullrequestevent\ntype PullRequestEvent struct {\n\t// Action is the action that was performed. Possible values are:\n\t// \"assigned\", \"unassigned\", \"review_requested\", \"review_request_removed\", \"labeled\", \"unlabeled\",\n\t// \"opened\", \"edited\", \"closed\", \"ready_for_review\", \"locked\", \"unlocked\", or \"reopened\".\n\t// If the action is \"closed\" and the \"merged\" key is \"false\", the pull request was closed with unmerged commits.\n\t// If the action is \"closed\" and the \"merged\" key is \"true\", the pull request was merged.\n\t// While webhooks are also triggered when a pull request is synchronized, Events API timelines\n\t// don't include pull request events with the \"synchronize\" action.\n\tAction      *string      `json:\"action,omitempty\"`\n\tAssignee    *User        `json:\"assignee,omitempty\"`\n\tNumber      *int         `json:\"number,omitempty\"`\n\tPullRequest *PullRequest `json:\"pull_request,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tChanges *EditChange `json:\"changes,omitempty\"`\n\t// RequestedReviewer is populated in \"review_requested\", \"review_request_removed\" event deliveries.\n\t// A request affecting multiple reviewers at once is split into multiple\n\t// such event deliveries, each with a single, different RequestedReviewer.\n\tRequestedReviewer *User `json:\"requested_reviewer,omitempty\"`\n\t// In the event that a team is requested instead of a user, \"requested_team\" gets sent in place of\n\t// \"requested_user\" with the same delivery behavior.\n\tRequestedTeam *Team         `json:\"requested_team,omitempty\"`\n\tRepo          *Repository   `json:\"repository,omitempty\"`\n\tSender        *User         `json:\"sender,omitempty\"`\n\tInstallation  *Installation `json:\"installation,omitempty\"`\n\tLabel         *Label        `json:\"label,omitempty\"`  // Populated in \"labeled\" event deliveries.\n\tReason        *string       `json:\"reason,omitempty\"` // Populated in \"dequeued\" event deliveries.\n\n\t// The following field is only present when the webhook is triggered on\n\t// a repository belonging to an organization.\n\tOrganization *Organization `json:\"organization,omitempty\"`\n\n\t// The following fields are only populated when the Action is \"synchronize\".\n\tBefore *string `json:\"before,omitempty\"`\n\tAfter  *string `json:\"after,omitempty\"`\n\n\t// The following will be populated if the event was performed by an App\n\tPerformedViaGithubApp *App `json:\"performed_via_github_app,omitempty\"`\n}\n\n// PullRequestReviewEvent is triggered when a review is submitted on a pull\n// request.\n// The Webhook event name is \"pull_request_review\".\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#pull_request_review\ntype PullRequestReviewEvent struct {\n\t// Action is always \"submitted\".\n\tAction      *string            `json:\"action,omitempty\"`\n\tReview      *PullRequestReview `json:\"review,omitempty\"`\n\tPullRequest *PullRequest       `json:\"pull_request,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n\n\t// The following field is only present when the webhook is triggered on\n\t// a repository belonging to an organization.\n\tOrganization *Organization `json:\"organization,omitempty\"`\n}\n\n// PullRequestReviewCommentEvent is triggered when a comment is created on a\n// portion of the unified diff of a pull request.\n// The Webhook event name is \"pull_request_review_comment\".\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#pull_request_review_comment\ntype PullRequestReviewCommentEvent struct {\n\t// Action is the action that was performed on the comment.\n\t// Possible values are: \"created\", \"edited\", \"deleted\".\n\tAction      *string             `json:\"action,omitempty\"`\n\tPullRequest *PullRequest        `json:\"pull_request,omitempty\"`\n\tComment     *PullRequestComment `json:\"comment,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tChanges      *EditChange   `json:\"changes,omitempty\"`\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n\n\t// The following field is only present when the webhook is triggered on\n\t// a repository belonging to an organization.\n\tOrg *Organization `json:\"organization,omitempty\"`\n}\n\n// PullRequestReviewThreadEvent is triggered when a comment made as part of a\n// review of a pull request is marked resolved or unresolved.\n// The Webhook event name is \"pull_request_review_thread\".\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#pull_request_review_thread\ntype PullRequestReviewThreadEvent struct {\n\t// Action is the action that was performed on the comment.\n\t// Possible values are: \"resolved\", \"unresolved\".\n\tAction      *string            `json:\"action,omitempty\"`\n\tThread      *PullRequestThread `json:\"thread,omitempty\"`\n\tPullRequest *PullRequest       `json:\"pull_request,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n\n\t// The following field is only present when the webhook is triggered on\n\t// a repository belonging to an organization.\n\tOrg *Organization `json:\"organization,omitempty\"`\n}\n\n// PullRequestTargetEvent is triggered when a pull request is assigned, unassigned, labeled,\n// unlabeled, opened, edited, closed, reopened, synchronize, ready_for_review,\n// locked, unlocked, a pull request review is requested, or a review request is removed.\n// The Webhook event name is \"pull_request_target\".\n//\n// GitHub API docs: https://docs.github.com/actions/events-that-trigger-workflows#pull_request_target\ntype PullRequestTargetEvent struct {\n\t// Action is the action that was performed. Possible values are:\n\t// \"assigned\", \"unassigned\", \"labeled\", \"unlabeled\", \"opened\", \"edited\", \"closed\", \"reopened\",\n\t// \"ready_for_review\", \"locked\", \"unlocked\", \"review_requested\" or \"review_request_removed\".\n\t// If the action is \"closed\" and the \"merged\" key is \"false\", the pull request was closed with unmerged commits.\n\t// If the action is \"closed\" and the \"merged\" key is \"true\", the pull request was merged.\n\t// While webhooks are also triggered when a pull request is synchronized, Events API timelines\n\t// don't include pull request events with the \"synchronize\" action.\n\tAction      *string      `json:\"action,omitempty\"`\n\tAssignee    *User        `json:\"assignee,omitempty\"`\n\tNumber      *int         `json:\"number,omitempty\"`\n\tPullRequest *PullRequest `json:\"pull_request,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tChanges *EditChange `json:\"changes,omitempty\"`\n\t// RequestedReviewer is populated in \"review_requested\", \"review_request_removed\" event deliveries.\n\t// A request affecting multiple reviewers at once is split into multiple\n\t// such event deliveries, each with a single, different RequestedReviewer.\n\tRequestedReviewer *User `json:\"requested_reviewer,omitempty\"`\n\t// In the event that a team is requested instead of a user, \"requested_team\" gets sent in place of\n\t// \"requested_user\" with the same delivery behavior.\n\tRequestedTeam *Team         `json:\"requested_team,omitempty\"`\n\tRepo          *Repository   `json:\"repository,omitempty\"`\n\tSender        *User         `json:\"sender,omitempty\"`\n\tInstallation  *Installation `json:\"installation,omitempty\"`\n\tLabel         *Label        `json:\"label,omitempty\"` // Populated in \"labeled\" event deliveries.\n\n\t// The following field is only present when the webhook is triggered on\n\t// a repository belonging to an organization.\n\tOrganization *Organization `json:\"organization,omitempty\"`\n\n\t// The following fields are only populated when the Action is \"synchronize\".\n\tBefore *string `json:\"before,omitempty\"`\n\tAfter  *string `json:\"after,omitempty\"`\n\n\t// The following will be populated if the event was performed by an App\n\tPerformedViaGithubApp *App `json:\"performed_via_github_app,omitempty\"`\n}\n\n// PushEvent represents a git push to a GitHub repository.\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#push\ntype PushEvent struct {\n\tPushID *int64  `json:\"push_id,omitempty\"`\n\tHead   *string `json:\"head,omitempty\"`\n\tRef    *string `json:\"ref,omitempty\"`\n\t// Size is the number of commits in the push.\n\t//\n\t// Deprecated: GitHub will remove commit counts from Events API payloads on October 7, 2025.\n\t// Use the Commits REST API endpoint to get commit information.\n\t// See: https://docs.github.com/rest/commits/commits#list-commits\n\tSize *int `json:\"size,omitempty\"`\n\t// Commits is the list of commits in the push event.\n\t//\n\t// This field is only populated for webhook events.\n\t// It has been removed from Events API payloads on October 7, 2025.\n\t// Use the Commits REST API endpoint to get detailed commit information.\n\t// See: https://docs.github.com/rest/commits/commits#list-commits\n\tCommits []*HeadCommit `json:\"commits,omitempty\"`\n\tBefore  *string       `json:\"before,omitempty\"`\n\t// DistinctSize is the number of distinct commits in the push.\n\t//\n\t// Deprecated: GitHub will remove commit counts from Events API payloads on October 7, 2025.\n\t// Use the Compare REST API endpoint to get detailed comparison information.\n\t// See: https://docs.github.com/rest/commits/commits#compare-two-commits\n\tDistinctSize *int `json:\"distinct_size,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tAction       *string              `json:\"action,omitempty\"`\n\tAfter        *string              `json:\"after,omitempty\"`\n\tCreated      *bool                `json:\"created,omitempty\"`\n\tDeleted      *bool                `json:\"deleted,omitempty\"`\n\tForced       *bool                `json:\"forced,omitempty\"`\n\tBaseRef      *string              `json:\"base_ref,omitempty\"`\n\tCompare      *string              `json:\"compare,omitempty\"`\n\tRepo         *PushEventRepository `json:\"repository,omitempty\"`\n\tHeadCommit   *HeadCommit          `json:\"head_commit,omitempty\"`\n\tPusher       *CommitAuthor        `json:\"pusher,omitempty\"`\n\tSender       *User                `json:\"sender,omitempty\"`\n\tInstallation *Installation        `json:\"installation,omitempty\"`\n\n\t// The following field is only present when the webhook is triggered on\n\t// a repository belonging to an organization.\n\tOrganization *Organization `json:\"organization,omitempty\"`\n}\n\nfunc (p PushEvent) String() string {\n\treturn Stringify(p)\n}\n\n// HeadCommit represents a git commit in a GitHub PushEvent.\ntype HeadCommit struct {\n\tMessage  *string       `json:\"message,omitempty\"`\n\tAuthor   *CommitAuthor `json:\"author,omitempty\"`\n\tURL      *string       `json:\"url,omitempty\"`\n\tDistinct *bool         `json:\"distinct,omitempty\"`\n\n\t// The following fields are only populated by Events API.\n\tSHA *string `json:\"sha,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tID        *string       `json:\"id,omitempty\"`\n\tTreeID    *string       `json:\"tree_id,omitempty\"`\n\tTimestamp *Timestamp    `json:\"timestamp,omitempty\"`\n\tCommitter *CommitAuthor `json:\"committer,omitempty\"`\n\tAdded     []string      `json:\"added,omitempty\"`\n\tRemoved   []string      `json:\"removed,omitempty\"`\n\tModified  []string      `json:\"modified,omitempty\"`\n}\n\nfunc (h HeadCommit) String() string {\n\treturn Stringify(h)\n}\n\n// PushEventRepository represents the repo object in a PushEvent payload.\ntype PushEventRepository struct {\n\tID               *int64         `json:\"id,omitempty\"`\n\tNodeID           *string        `json:\"node_id,omitempty\"`\n\tName             *string        `json:\"name,omitempty\"`\n\tFullName         *string        `json:\"full_name,omitempty\"`\n\tOwner            *User          `json:\"owner,omitempty\"`\n\tPrivate          *bool          `json:\"private,omitempty\"`\n\tDescription      *string        `json:\"description,omitempty\"`\n\tFork             *bool          `json:\"fork,omitempty\"`\n\tCreatedAt        *Timestamp     `json:\"created_at,omitempty\"`\n\tPushedAt         *Timestamp     `json:\"pushed_at,omitempty\"`\n\tUpdatedAt        *Timestamp     `json:\"updated_at,omitempty\"`\n\tHomepage         *string        `json:\"homepage,omitempty\"`\n\tPullsURL         *string        `json:\"pulls_url,omitempty\"`\n\tSize             *int           `json:\"size,omitempty\"`\n\tStargazersCount  *int           `json:\"stargazers_count,omitempty\"`\n\tWatchersCount    *int           `json:\"watchers_count,omitempty\"`\n\tLanguage         *string        `json:\"language,omitempty\"`\n\tHasIssues        *bool          `json:\"has_issues,omitempty\"`\n\tHasDownloads     *bool          `json:\"has_downloads,omitempty\"`\n\tHasWiki          *bool          `json:\"has_wiki,omitempty\"`\n\tHasPages         *bool          `json:\"has_pages,omitempty\"`\n\tForksCount       *int           `json:\"forks_count,omitempty\"`\n\tArchived         *bool          `json:\"archived,omitempty\"`\n\tDisabled         *bool          `json:\"disabled,omitempty\"`\n\tOpenIssuesCount  *int           `json:\"open_issues_count,omitempty\"`\n\tDefaultBranch    *string        `json:\"default_branch,omitempty\"`\n\tMasterBranch     *string        `json:\"master_branch,omitempty\"`\n\tOrganization     *string        `json:\"organization,omitempty\"`\n\tURL              *string        `json:\"url,omitempty\"`\n\tArchiveURL       *string        `json:\"archive_url,omitempty\"`\n\tHTMLURL          *string        `json:\"html_url,omitempty\"`\n\tStatusesURL      *string        `json:\"statuses_url,omitempty\"`\n\tGitURL           *string        `json:\"git_url,omitempty\"`\n\tSSHURL           *string        `json:\"ssh_url,omitempty\"`\n\tCloneURL         *string        `json:\"clone_url,omitempty\"`\n\tSVNURL           *string        `json:\"svn_url,omitempty\"`\n\tTopics           []string       `json:\"topics,omitempty\"`\n\tCustomProperties map[string]any `json:\"custom_properties,omitempty\"`\n}\n\n// PushEventRepoOwner is a basic representation of user/org in a PushEvent payload.\ntype PushEventRepoOwner struct {\n\tName  *string `json:\"name,omitempty\"`\n\tEmail *string `json:\"email,omitempty\"`\n}\n\n// RegistryPackageEvent represents activity related to GitHub Packages.\n// The Webhook event name is \"registry_package\".\n//\n// This event is triggered when a GitHub Package is published or updated.\n//\n// GitHub API docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#registry_package\ntype RegistryPackageEvent struct {\n\t// Action is the action that was performed.\n\t// Can be \"published\" or \"updated\".\n\tAction          *string       `json:\"action,omitempty\"`\n\tRegistryPackage *Package      `json:\"registry_package,omitempty\"`\n\tRepository      *Repository   `json:\"repository,omitempty\"`\n\tOrganization    *Organization `json:\"organization,omitempty\"`\n\tEnterprise      *Enterprise   `json:\"enterprise,omitempty\"`\n\tSender          *User         `json:\"sender,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tInstallation *Installation `json:\"installation,omitempty\"`\n}\n\n// ReleaseEvent is triggered when a release is published, unpublished, created,\n// edited, deleted, or prereleased.\n// The Webhook event name is \"release\".\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#release\ntype ReleaseEvent struct {\n\t// Action is the action that was performed. Possible values are: \"published\", \"unpublished\",\n\t// \"created\", \"edited\", \"deleted\", or \"prereleased\".\n\tAction  *string            `json:\"action,omitempty\"`\n\tRelease *RepositoryRelease `json:\"release,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n\n\t// The following field is only present when the webhook is triggered on\n\t// a repository belonging to an organization.\n\tOrg *Organization `json:\"organization,omitempty\"`\n}\n\n// RepositoryEvent is triggered when a repository is created, archived, unarchived,\n// renamed, edited, transferred, made public, or made private. Organization hooks are\n// also triggered when a repository is deleted.\n// The Webhook event name is \"repository\".\n//\n// Events of this type are not visible in timelines, they are only used to\n// trigger organization webhooks.\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#repository\ntype RepositoryEvent struct {\n\t// Action is the action that was performed. Possible values are: \"created\",\n\t// \"deleted\" (organization hooks only), \"archived\", \"unarchived\", \"edited\", \"renamed\",\n\t// \"transferred\", \"publicized\", or \"privatized\".\n\tAction *string     `json:\"action,omitempty\"`\n\tRepo   *Repository `json:\"repository,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tChanges      *EditChange   `json:\"changes,omitempty\"`\n\tOrg          *Organization `json:\"organization,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n}\n\n// RepositoryDispatchEvent is triggered when a client sends a POST request to the repository dispatch event endpoint.\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#repository_dispatch\ntype RepositoryDispatchEvent struct {\n\t// Action is the event_type that submitted with the repository dispatch payload. Value can be any string.\n\tAction        *string         `json:\"action,omitempty\"`\n\tBranch        *string         `json:\"branch,omitempty\"`\n\tClientPayload json.RawMessage `json:\"client_payload,omitempty\"`\n\tRepo          *Repository     `json:\"repository,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tOrg          *Organization `json:\"organization,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n}\n\n// RepositoryImportEvent represents the activity related to a repository being imported to GitHub.\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#repository_import\ntype RepositoryImportEvent struct {\n\t// Status represents the final state of the import. This can be one of \"success\", \"cancelled\", or \"failure\".\n\tStatus *string       `json:\"status,omitempty\"`\n\tRepo   *Repository   `json:\"repository,omitempty\"`\n\tOrg    *Organization `json:\"organization,omitempty\"`\n\tSender *User         `json:\"sender,omitempty\"`\n}\n\n// RepositoryRulesetEvent triggers whenever there is a change to the repository's ruleset configuration.\n//\n// This can include updates to protection rules, required status checks, code owners, or other related configurations.\n//\n// GitHub API docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#repository_ruleset\ntype RepositoryRulesetEvent struct {\n\tAction            *string                   `json:\"action,omitempty\"`\n\tEnterprise        *Enterprise               `json:\"enterprise,omitempty\"`\n\tInstallation      *Installation             `json:\"installation,omitempty\"`\n\tOrganization      *Organization             `json:\"organization,omitempty\"`\n\tRepository        *Repository               `json:\"repository,omitempty\"`\n\tRepositoryRuleset *RepositoryRuleset        `json:\"repository_ruleset\"`\n\tChanges           *RepositoryRulesetChanges `json:\"changes,omitempty\"`\n\tSender            *User                     `json:\"sender\"`\n}\n\n// RepositoryRulesetChanges represents the changes made to a repository ruleset.\ntype RepositoryRulesetChanges struct {\n\tName        *RepositoryRulesetChangeSource      `json:\"name,omitempty\"`\n\tEnforcement *RepositoryRulesetChangeSource      `json:\"enforcement,omitempty\"`\n\tConditions  *RepositoryRulesetChangedConditions `json:\"conditions,omitempty\"`\n\tRules       *RepositoryRulesetChangedRules      `json:\"rules,omitempty\"`\n}\n\n// RepositoryRulesetChangeSource represents a source change for the ruleset.\ntype RepositoryRulesetChangeSource struct {\n\tFrom *string `json:\"from,omitempty\"`\n}\n\n// RepositoryRulesetChangeSources represents multiple source changes for the ruleset.\ntype RepositoryRulesetChangeSources struct {\n\tFrom []string `json:\"from,omitempty\"`\n}\n\n// RepositoryRulesetChangedConditions holds changes to conditions in a ruleset.\ntype RepositoryRulesetChangedConditions struct {\n\tAdded   []*RepositoryRulesetConditions        `json:\"added,omitempty\"`\n\tDeleted []*RepositoryRulesetConditions        `json:\"deleted,omitempty\"`\n\tUpdated []*RepositoryRulesetUpdatedConditions `json:\"updated,omitempty\"`\n}\n\n// RepositoryRulesetUpdatedConditions represents the edited updates to conditions in a ruleset.\ntype RepositoryRulesetUpdatedConditions struct {\n\tCondition *RepositoryRulesetConditions       `json:\"condition,omitempty\"`\n\tChanges   *RepositoryRulesetUpdatedCondition `json:\"changes,omitempty\"`\n}\n\n// RepositoryRulesetUpdatedCondition represents the changes to a condition in a ruleset.\ntype RepositoryRulesetUpdatedCondition struct {\n\tConditionType *RepositoryRulesetChangeSource  `json:\"condition_type,omitempty\"`\n\tTarget        *RepositoryRulesetChangeSource  `json:\"target,omitempty\"`\n\tInclude       *RepositoryRulesetChangeSources `json:\"include,omitempty\"`\n\tExclude       *RepositoryRulesetChangeSources `json:\"exclude,omitempty\"`\n}\n\n// RepositoryRulesetChangedRules holds changes to rules in a ruleset.\ntype RepositoryRulesetChangedRules struct {\n\tAdded   []*RepositoryRule                `json:\"added,omitempty\"`\n\tDeleted []*RepositoryRule                `json:\"deleted,omitempty\"`\n\tUpdated []*RepositoryRulesetUpdatedRules `json:\"updated,omitempty\"`\n}\n\n// RepositoryRulesetUpdatedRules holds updates to rules in a ruleset.\ntype RepositoryRulesetUpdatedRules struct {\n\tRule    *RepositoryRule               `json:\"rule,omitempty\"`\n\tChanges *RepositoryRulesetChangedRule `json:\"changes,omitempty\"`\n}\n\n// RepositoryRulesetChangedRule holds changes made to a rule in a ruleset.\ntype RepositoryRulesetChangedRule struct {\n\tConfiguration *RepositoryRulesetChangeSource `json:\"configuration,omitempty\"`\n\tRuleType      *RepositoryRulesetChangeSource `json:\"rule_type,omitempty\"`\n\tPattern       *RepositoryRulesetChangeSource `json:\"pattern,omitempty\"`\n}\n\n// RepositoryVulnerabilityAlertEvent is triggered when a security alert is created, dismissed, or resolved.\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#repository_vulnerability_alert\ntype RepositoryVulnerabilityAlertEvent struct {\n\t// Action is the action that was performed. Possible values are: \"create\", \"dismiss\", \"resolve\".\n\tAction *string `json:\"action,omitempty\"`\n\n\t// The security alert of the vulnerable dependency.\n\tAlert *RepositoryVulnerabilityAlert `json:\"alert,omitempty\"`\n\n\t// The repository of the vulnerable dependency.\n\tRepository *Repository `json:\"repository,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tInstallation *Installation `json:\"installation,omitempty\"`\n\n\t// The user that triggered the event.\n\tSender *User `json:\"sender,omitempty\"`\n\n\t// The following field is only present when the webhook is triggered on\n\t// a repository belonging to an organization.\n\tOrg *Organization `json:\"organization,omitempty\"`\n}\n\n// RepositoryVulnerabilityAlert represents a repository security alert.\ntype RepositoryVulnerabilityAlert struct {\n\tID                       *int64     `json:\"id,omitempty\"`\n\tAffectedRange            *string    `json:\"affected_range,omitempty\"`\n\tAffectedPackageName      *string    `json:\"affected_package_name,omitempty\"`\n\tExternalReference        *string    `json:\"external_reference,omitempty\"`\n\tExternalIdentifier       *string    `json:\"external_identifier,omitempty\"`\n\tGitHubSecurityAdvisoryID *string    `json:\"ghsa_id,omitempty\"`\n\tSeverity                 *string    `json:\"severity,omitempty\"`\n\tCreatedAt                *Timestamp `json:\"created_at,omitempty\"`\n\tFixedIn                  *string    `json:\"fixed_in,omitempty\"`\n\tDismisser                *User      `json:\"dismisser,omitempty\"`\n\tDismissReason            *string    `json:\"dismiss_reason,omitempty\"`\n\tDismissedAt              *Timestamp `json:\"dismissed_at,omitempty\"`\n}\n\n// SecretScanningAlertEvent is triggered when a secret scanning alert occurs in a repository.\n// The Webhook name is secret_scanning_alert.\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#secret_scanning_alert\ntype SecretScanningAlertEvent struct {\n\t// Action is the action that was performed. Possible values are: \"created\", \"resolved\", or \"reopened\".\n\tAction *string `json:\"action,omitempty\"`\n\n\t// Alert is the secret scanning alert involved in the event.\n\tAlert *SecretScanningAlert `json:\"alert,omitempty\"`\n\n\t// Only populated by the \"resolved\" and \"reopen\" actions\n\tSender *User `json:\"sender,omitempty\"`\n\t// The following fields are only populated by Webhook events.\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tOrganization *Organization `json:\"organization,omitempty\"`\n\tEnterprise   *Enterprise   `json:\"enterprise,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n}\n\n// SecretScanningAlertLocationEvent is triggered when there is activity relating to the locations of a secret in a secret scanning alert.\n// The Webhook event name is \"secret_scanning_alert_location\".\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#secret_scanning_alert_location\ntype SecretScanningAlertLocationEvent struct {\n\tAction       *string                      `json:\"action,omitempty\"`\n\tAlert        *SecretScanningAlert         `json:\"alert,omitempty\"`\n\tInstallation *Installation                `json:\"installation,omitempty\"`\n\tLocation     *SecretScanningAlertLocation `json:\"location,omitempty\"`\n\tOrganization *Organization                `json:\"organization,omitempty\"`\n\tRepo         *Repository                  `json:\"repository,omitempty\"`\n\tSender       *User                        `json:\"sender,omitempty\"`\n}\n\n// SecurityAndAnalysisEvent is triggered when code security and analysis features\n// are enabled or disabled for a repository.\n//\n// GitHub API docs: https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#security_and_analysis\ntype SecurityAndAnalysisEvent struct {\n\tChanges      *SecurityAndAnalysisChange `json:\"changes,omitempty\"`\n\tEnterprise   *Enterprise                `json:\"enterprise,omitempty\"`\n\tInstallation *Installation              `json:\"installation,omitempty\"`\n\tOrganization *Organization              `json:\"organization,omitempty\"`\n\tRepository   *Repository                `json:\"repository,omitempty\"`\n\tSender       *User                      `json:\"sender,omitempty\"`\n}\n\n// SecurityAndAnalysisChange represents the changes when security and analysis\n// features are enabled or disabled for a repository.\ntype SecurityAndAnalysisChange struct {\n\tFrom *SecurityAndAnalysisChangeFrom `json:\"from,omitempty\"`\n}\n\n// SecurityAndAnalysisChangeFrom represents which change was made when security\n// and analysis features are enabled or disabled for a repository.\ntype SecurityAndAnalysisChangeFrom struct {\n\tSecurityAndAnalysis *SecurityAndAnalysis `json:\"security_and_analysis,omitempty\"`\n}\n\n// StarEvent is triggered when a star is added or removed from a repository.\n// The Webhook event name is \"star\".\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#star\ntype StarEvent struct {\n\t// Action is the action that was performed. Possible values are: \"created\" or \"deleted\".\n\tAction *string `json:\"action,omitempty\"`\n\n\t// StarredAt is the time the star was created. It will be null for the \"deleted\" action.\n\tStarredAt *Timestamp `json:\"starred_at,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tOrg          *Organization `json:\"organization,omitempty\"`\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n}\n\n// StatusEvent is triggered when the status of a Git commit changes.\n// The Webhook event name is \"status\".\n//\n// Events of this type are not visible in timelines, they are only used to\n// trigger hooks.\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#status\ntype StatusEvent struct {\n\tSHA *string `json:\"sha,omitempty\"`\n\t// State is the new state. Possible values are: \"pending\", \"success\", \"failure\", \"error\".\n\tState       *string   `json:\"state,omitempty\"`\n\tDescription *string   `json:\"description,omitempty\"`\n\tTargetURL   *string   `json:\"target_url,omitempty\"`\n\tBranches    []*Branch `json:\"branches,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tID           *int64            `json:\"id,omitempty\"`\n\tName         *string           `json:\"name,omitempty\"`\n\tContext      *string           `json:\"context,omitempty\"`\n\tCommit       *RepositoryCommit `json:\"commit,omitempty\"`\n\tCreatedAt    *Timestamp        `json:\"created_at,omitempty\"`\n\tUpdatedAt    *Timestamp        `json:\"updated_at,omitempty\"`\n\tRepo         *Repository       `json:\"repository,omitempty\"`\n\tSender       *User             `json:\"sender,omitempty\"`\n\tInstallation *Installation     `json:\"installation,omitempty\"`\n\n\t// The following field is only present when the webhook is triggered on\n\t// a repository belonging to an organization.\n\tOrg *Organization `json:\"organization,omitempty\"`\n}\n\n// TeamEvent is triggered when an organization's team is created, modified or deleted.\n// The Webhook event name is \"team\".\n//\n// Events of this type are not visible in timelines. These events are only used\n// to trigger hooks.\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#team\ntype TeamEvent struct {\n\tAction  *string     `json:\"action,omitempty\"`\n\tTeam    *Team       `json:\"team,omitempty\"`\n\tChanges *TeamChange `json:\"changes,omitempty\"`\n\tRepo    *Repository `json:\"repository,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tOrg          *Organization `json:\"organization,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n}\n\n// TeamAddEvent is triggered when a repository is added to a team.\n// The Webhook event name is \"team_add\".\n//\n// Events of this type are not visible in timelines. These events are only used\n// to trigger hooks.\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#team_add\ntype TeamAddEvent struct {\n\tTeam *Team       `json:\"team,omitempty\"`\n\tRepo *Repository `json:\"repository,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tOrg          *Organization `json:\"organization,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n}\n\n// UserEvent is triggered when a user is created or deleted.\n// The Webhook event name is \"user\".\n//\n// Only global webhooks can subscribe to this event type.\n//\n// GitHub API docs: https://developer.github.com/enterprise/v3/activity/events/types/#userevent-enterprise\ntype UserEvent struct {\n\tUser *User `json:\"user,omitempty\"`\n\t// The action performed. Possible values are: \"created\" or \"deleted\".\n\tAction     *string     `json:\"action,omitempty\"`\n\tEnterprise *Enterprise `json:\"enterprise,omitempty\"`\n\tSender     *User       `json:\"sender,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tInstallation *Installation `json:\"installation,omitempty\"`\n}\n\n// WatchEvent is related to starring a repository, not watching. See this API\n// blog post for an explanation: https://developer.github.com/changes/2012-09-05-watcher-api/\n//\n// The event’s actor is the user who starred a repository, and the event’s\n// repository is the repository that was starred.\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#watch\ntype WatchEvent struct {\n\t// Action is the action that was performed. Possible value is: \"started\".\n\tAction *string `json:\"action,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n\n\t// The following field is only present when the webhook is triggered on\n\t// a repository belonging to an organization.\n\tOrg *Organization `json:\"organization,omitempty\"`\n}\n\n// WorkflowDispatchEvent is triggered when someone triggers a workflow run on GitHub or\n// sends a POST request to the endpoint to create a workflow dispatch event.\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch\ntype WorkflowDispatchEvent struct {\n\tInputs   json.RawMessage `json:\"inputs,omitempty\"`\n\tRef      *string         `json:\"ref,omitempty\"`\n\tWorkflow *string         `json:\"workflow,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tOrg          *Organization `json:\"organization,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n}\n\n// WorkflowJobEvent is triggered when a job is queued, started or completed.\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_job\ntype WorkflowJobEvent struct {\n\tWorkflowJob *WorkflowJob `json:\"workflow_job,omitempty\"`\n\n\tAction *string `json:\"action,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\n\t// Org is not nil when the webhook is configured for an organization or the event\n\t// occurs from activity in a repository owned by an organization.\n\tOrg          *Organization `json:\"organization,omitempty\"`\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n\tDeployment   *Deployment   `json:\"deployment,omitempty\"`\n}\n\n// WorkflowRunEvent is triggered when a GitHub Actions workflow run is requested or completed.\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#workflow_run\ntype WorkflowRunEvent struct {\n\tAction      *string      `json:\"action,omitempty\"`\n\tWorkflow    *Workflow    `json:\"workflow,omitempty\"`\n\tWorkflowRun *WorkflowRun `json:\"workflow_run,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tOrg          *Organization `json:\"organization,omitempty\"`\n\tRepo         *Repository   `json:\"repository,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n}\n\n// SecurityAdvisory represents the advisory object in SecurityAdvisoryEvent payload.\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#security_advisory\ntype SecurityAdvisory struct {\n\tCVSS               *AdvisoryCVSS                 `json:\"cvss,omitempty\"`\n\tCWEs               []*AdvisoryCWEs               `json:\"cwes,omitempty\"`\n\tGHSAID             *string                       `json:\"ghsa_id,omitempty\"`\n\tSummary            *string                       `json:\"summary,omitempty\"`\n\tDescription        *string                       `json:\"description,omitempty\"`\n\tSeverity           *string                       `json:\"severity,omitempty\"`\n\tIdentifiers        []*AdvisoryIdentifier         `json:\"identifiers,omitempty\"`\n\tReferences         []*AdvisoryReference          `json:\"references,omitempty\"`\n\tPublishedAt        *Timestamp                    `json:\"published_at,omitempty\"`\n\tUpdatedAt          *Timestamp                    `json:\"updated_at,omitempty\"`\n\tWithdrawnAt        *Timestamp                    `json:\"withdrawn_at,omitempty\"`\n\tVulnerabilities    []*AdvisoryVulnerability      `json:\"vulnerabilities,omitempty\"`\n\tCVEID              *string                       `json:\"cve_id,omitempty\"`\n\tURL                *string                       `json:\"url,omitempty\"`\n\tHTMLURL            *string                       `json:\"html_url,omitempty\"`\n\tAuthor             *User                         `json:\"author,omitempty\"`\n\tPublisher          *User                         `json:\"publisher,omitempty\"`\n\tState              *string                       `json:\"state,omitempty\"`\n\tCreatedAt          *Timestamp                    `json:\"created_at,omitempty\"`\n\tClosedAt           *Timestamp                    `json:\"closed_at,omitempty\"`\n\tSubmission         *SecurityAdvisorySubmission   `json:\"submission,omitempty\"`\n\tCWEIDs             []string                      `json:\"cwe_ids,omitempty\"`\n\tCredits            []*RepoAdvisoryCredit         `json:\"credits,omitempty\"`\n\tCreditsDetailed    []*RepoAdvisoryCreditDetailed `json:\"credits_detailed,omitempty\"`\n\tCollaboratingUsers []*User                       `json:\"collaborating_users,omitempty\"`\n\tCollaboratingTeams []*Team                       `json:\"collaborating_teams,omitempty\"`\n\tPrivateFork        *Repository                   `json:\"private_fork,omitempty\"`\n}\n\n// AdvisoryIdentifier represents the identifier for a Security Advisory.\ntype AdvisoryIdentifier struct {\n\tValue *string `json:\"value,omitempty\"`\n\tType  *string `json:\"type,omitempty\"`\n}\n\n// AdvisoryReference represents the reference url for the security advisory.\ntype AdvisoryReference struct {\n\tURL *string `json:\"url,omitempty\"`\n}\n\n// AdvisoryVulnerability represents the vulnerability object for a Security Advisory.\ntype AdvisoryVulnerability struct {\n\tPackage                *VulnerabilityPackage `json:\"package,omitempty\"`\n\tSeverity               *string               `json:\"severity,omitempty\"`\n\tVulnerableVersionRange *string               `json:\"vulnerable_version_range,omitempty\"`\n\tFirstPatchedVersion    *FirstPatchedVersion  `json:\"first_patched_version,omitempty\"`\n\n\t// PatchedVersions and VulnerableFunctions are used in the following APIs:\n\t// - https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories-for-an-organization\n\t// - https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories\n\tPatchedVersions     *string  `json:\"patched_versions,omitempty\"`\n\tVulnerableFunctions []string `json:\"vulnerable_functions,omitempty\"`\n}\n\n// VulnerabilityPackage represents the package object for an Advisory Vulnerability.\ntype VulnerabilityPackage struct {\n\tEcosystem *string `json:\"ecosystem,omitempty\"`\n\tName      *string `json:\"name,omitempty\"`\n}\n\n// FirstPatchedVersion represents the identifier for the first patched version of that vulnerability.\ntype FirstPatchedVersion struct {\n\tIdentifier *string `json:\"identifier,omitempty\"`\n}\n\n// SecurityAdvisoryEvent is triggered when a security-related vulnerability is found in software on GitHub.\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#security_advisory\ntype SecurityAdvisoryEvent struct {\n\tAction           *string           `json:\"action,omitempty\"`\n\tSecurityAdvisory *SecurityAdvisory `json:\"security_advisory,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tEnterprise   *Enterprise   `json:\"enterprise,omitempty\"`\n\tInstallation *Installation `json:\"installation,omitempty\"`\n\tOrganization *Organization `json:\"organization,omitempty\"`\n\tRepository   *Repository   `json:\"repository,omitempty\"`\n\tSender       *User         `json:\"sender,omitempty\"`\n}\n\n// CodeScanningAlertEvent is triggered when a code scanning finds a potential vulnerability or error in your code.\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#code_scanning_alert\ntype CodeScanningAlertEvent struct {\n\tAction *string `json:\"action,omitempty\"`\n\tAlert  *Alert  `json:\"alert,omitempty\"`\n\tRef    *string `json:\"ref,omitempty\"`\n\t// CommitOID is the commit SHA of the code scanning alert\n\tCommitOID *string       `json:\"commit_oid,omitempty\"`\n\tRepo      *Repository   `json:\"repository,omitempty\"`\n\tOrg       *Organization `json:\"organization,omitempty\"`\n\tSender    *User         `json:\"sender,omitempty\"`\n\n\tInstallation *Installation `json:\"installation,omitempty\"`\n}\n\n// SponsorshipEvent represents a sponsorship event in GitHub.\n//\n// GitHub API docs: https://docs.github.com/en/rest/overview/github-event-types?apiVersion=2022-11-28#sponsorshipevent\ntype SponsorshipEvent struct {\n\tAction        *string             `json:\"action,omitempty\"`\n\tEffectiveDate *string             `json:\"effective_date,omitempty\"`\n\tChanges       *SponsorshipChanges `json:\"changes,omitempty\"`\n\tRepository    *Repository         `json:\"repository,omitempty\"`\n\tOrganization  *Organization       `json:\"organization,omitempty\"`\n\tSender        *User               `json:\"sender,omitempty\"`\n\tInstallation  *Installation       `json:\"installation,omitempty\"`\n}\n\n// SponsorshipChanges represents changes made to the sponsorship.\ntype SponsorshipChanges struct {\n\tTier         *SponsorshipTier `json:\"tier,omitempty\"`\n\tPrivacyLevel *string          `json:\"privacy_level,omitempty\"`\n}\n\n// SponsorshipTier represents the tier information of a sponsorship.\ntype SponsorshipTier struct {\n\tFrom *string `json:\"from,omitempty\"`\n}\n"
  },
  {
    "path": "github/event_types_test.go",
    "content": "// Copyright 2020 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestEditChange_Marshal_TitleChange(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &EditChange{}, \"{}\")\n\n\tu := &EditChange{\n\t\tTitle: &EditTitle{\n\t\t\tFrom: Ptr(\"TitleFrom\"),\n\t\t},\n\t\tBody: nil,\n\t\tBase: nil,\n\t}\n\n\twant := `{\n\t\t\"title\": {\n\t\t\t\"from\": \"TitleFrom\"\n\t\t  }\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestEditChange_Marshal_BodyChange(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &EditChange{}, \"{}\")\n\n\tu := &EditChange{\n\t\tTitle: nil,\n\t\tBody: &EditBody{\n\t\t\tFrom: Ptr(\"BodyFrom\"),\n\t\t},\n\t\tBase: nil,\n\t}\n\n\twant := `{\n\t\t\"body\": {\n\t\t\t\"from\": \"BodyFrom\"\n\t\t  }\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestEditChange_Marshal_BaseChange(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &EditChange{}, \"{}\")\n\n\tbase := EditBase{\n\t\tRef: &EditRef{\n\t\t\tFrom: Ptr(\"BaseRefFrom\"),\n\t\t},\n\t\tSHA: &EditSHA{\n\t\t\tFrom: Ptr(\"BaseSHAFrom\"),\n\t\t},\n\t}\n\n\tu := &EditChange{\n\t\tTitle: nil,\n\t\tBody:  nil,\n\t\tBase:  &base,\n\t}\n\n\twant := `{\n\t\t\"base\": {\n\t\t\t\"ref\": {\n\t\t\t\t\"from\": \"BaseRefFrom\"\n\t\t\t},\n\t\t\t\"sha\": {\n\t\t\t\t\"from\": \"BaseSHAFrom\"\n\t\t\t}\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestEditChange_Marshal_Repo(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &EditChange{}, \"{}\")\n\n\tu := &EditChange{\n\t\tRepo: &EditRepo{\n\t\t\tName: &RepoName{\n\t\t\t\tFrom: Ptr(\"old-repo-name\"),\n\t\t\t},\n\t\t},\n\t\tTopics: &EditTopics{\n\t\t\tFrom: []string{\"topic1\", \"topic2\"},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"repository\": {\n\t\t\t\"name\": {\n\t\t\t\t\"from\": \"old-repo-name\"\n\t\t\t}\n\t\t},\n\t\t\"topics\": {\n\t\t\t\"from\": [\n\t\t\t\t\"topic1\",\n\t\t\t\t\"topic2\"\n\t\t\t]\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestEditChange_Marshal_TransferFromUser(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &EditChange{}, \"{}\")\n\n\tu := &EditChange{\n\t\tOwner: &EditOwner{\n\t\t\tOwnerInfo: &OwnerInfo{\n\t\t\t\tUser: &User{\n\t\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"owner\": {\n\t\t\t\"from\": {\n\t\t\t\t\"user\": {\n\t\t\t\t\t\"login\": \"l\",\n          \t\t\t\"id\": 1,\n         \t\t \t\"node_id\": \"n\",\n          \t\t\t\"avatar_url\": \"a\",\n          \t\t\t\"url\": \"u\",\n          \t\t\t\"repos_url\": \"r\",\n          \t\t\t\"events_url\": \"e\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestEditChange_Marshal_TransferFromOrg(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &EditChange{}, \"{}\")\n\n\tu := &EditChange{\n\t\tOwner: &EditOwner{\n\t\t\tOwnerInfo: &OwnerInfo{\n\t\t\t\tOrg: &User{\n\t\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"owner\": {\n\t\t\t\"from\": {\n\t\t\t\t\"organization\": {\n\t\t\t\t\t\"login\": \"l\",\n          \t\t\t\"id\": 1,\n         \t\t \t\"node_id\": \"n\",\n          \t\t\t\"avatar_url\": \"a\",\n          \t\t\t\"url\": \"u\",\n          \t\t\t\"repos_url\": \"r\",\n          \t\t\t\"events_url\": \"e\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestProjectChange_Marshal_NameChange(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ProjectChange{}, \"{}\")\n\n\tu := &ProjectChange{\n\t\tName: &ProjectName{From: Ptr(\"NameFrom\")},\n\t\tBody: nil,\n\t}\n\n\twant := `{\n\t\t\"name\": {\n\t\t\t\"from\": \"NameFrom\"\n\t\t  }\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestProjectChange_Marshal_BodyChange(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ProjectChange{}, \"{}\")\n\n\tu := &ProjectChange{\n\t\tName: nil,\n\t\tBody: &ProjectBody{From: Ptr(\"BodyFrom\")},\n\t}\n\n\twant := `{\n\t\t\"body\": {\n\t\t\t\"from\": \"BodyFrom\"\n\t\t  }\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestProjectCardChange_Marshal_NoteChange(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ProjectCardChange{}, \"{}\")\n\n\tu := &ProjectCardChange{\n\t\tNote: &ProjectCardNote{From: Ptr(\"NoteFrom\")},\n\t}\n\n\twant := `{\n\t\t\"note\": {\n\t\t\t\"from\": \"NoteFrom\"\n\t\t  }\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestProjectColumnChange_Marshal_NameChange(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ProjectColumnChange{}, \"{}\")\n\n\tu := &ProjectColumnChange{\n\t\tName: &ProjectColumnName{From: Ptr(\"NameFrom\")},\n\t}\n\n\twant := `{\n\t\t\"name\": {\n\t\t\t\"from\": \"NameFrom\"\n\t\t  }\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestBranchProtectionConfigurationEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &BranchProtectionConfigurationEvent{}, \"{}\")\n\tu := &BranchProtectionConfigurationEvent{\n\t\tAction: Ptr(\"enabled\"),\n\t\tRepo: &Repository{\n\t\t\tID:     Ptr(int64(12345)),\n\t\t\tNodeID: Ptr(\"MDEwOlJlcG9zaXRvcnkxMjM0NQ==\"),\n\t\t\tName:   Ptr(\"example-repo\"),\n\t\t},\n\t\tOrg: &Organization{\n\t\t\tLogin: Ptr(\"example-org\"),\n\t\t\tID:    Ptr(int64(67890)),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin: Ptr(\"example-user\"),\n\t\t\tID:    Ptr(int64(1111)),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID: Ptr(int64(2222)),\n\t\t},\n\t\tEnterprise: &Enterprise{\n\t\t\tID:   Ptr(3333),\n\t\t\tSlug: Ptr(\"example-enterprise\"),\n\t\t\tName: Ptr(\"Example Enterprise\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"enabled\",\n\t\t\"repository\": {\n\t\t\t\"id\": 12345,\n\t\t\t\"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjM0NQ==\",\n\t\t\t\"name\": \"example-repo\"\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"login\": \"example-org\",\n\t\t\t\"id\": 67890\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"example-user\",\n\t\t\t\"id\": 1111\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 2222\n\t\t},\n\t\t\"enterprise\": {\n\t\t\t\"id\": 3333,\n\t\t\t\"slug\": \"example-enterprise\",\n\t\t\t\"name\": \"Example Enterprise\"\n\t\t}\n\t}`\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestTeamAddEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &TeamAddEvent{}, \"{}\")\n\n\tu := &TeamAddEvent{\n\t\tTeam: &Team{\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tNodeID:          Ptr(\"n\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tDescription:     Ptr(\"d\"),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tSlug:            Ptr(\"s\"),\n\t\t\tPermission:      Ptr(\"p\"),\n\t\t\tPrivacy:         Ptr(\"p\"),\n\t\t\tMembersCount:    Ptr(1),\n\t\t\tReposCount:      Ptr(1),\n\t\t\tMembersURL:      Ptr(\"m\"),\n\t\t\tRepositoriesURL: Ptr(\"r\"),\n\t\t\tOrganization: &Organization{\n\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t\tHTMLURL:   Ptr(\"h\"),\n\t\t\t\tName:      Ptr(\"n\"),\n\t\t\t\tCompany:   Ptr(\"c\"),\n\t\t\t\tBlog:      Ptr(\"b\"),\n\t\t\t\tLocation:  Ptr(\"l\"),\n\t\t\t\tEmail:     Ptr(\"e\"),\n\t\t\t},\n\t\t\tParent: &Team{\n\t\t\t\tID:           Ptr(int64(1)),\n\t\t\t\tNodeID:       Ptr(\"n\"),\n\t\t\t\tName:         Ptr(\"n\"),\n\t\t\t\tDescription:  Ptr(\"d\"),\n\t\t\t\tURL:          Ptr(\"u\"),\n\t\t\t\tSlug:         Ptr(\"s\"),\n\t\t\t\tPermission:   Ptr(\"p\"),\n\t\t\t\tPrivacy:      Ptr(\"p\"),\n\t\t\t\tMembersCount: Ptr(1),\n\t\t\t\tReposCount:   Ptr(1),\n\t\t\t},\n\t\t\tLDAPDN: Ptr(\"l\"),\n\t\t},\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tOrg: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"team\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"slug\": \"s\",\n\t\t\t\"permission\": \"p\",\n\t\t\t\"privacy\": \"p\",\n\t\t\t\"members_count\": 1,\n\t\t\t\"repos_count\": 1,\n\t\t\t\"organization\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"html_url\": \"h\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\"\n\t\t\t},\n\t\t\t\"members_url\": \"m\",\n\t\t\t\"repositories_url\": \"r\",\n\t\t\t\"parent\": {\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"description\": \"d\",\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"slug\": \"s\",\n\t\t\t\t\"permission\": \"p\",\n\t\t\t\t\"privacy\": \"p\",\n\t\t\t\t\"members_count\": 1,\n\t\t\t\t\"repos_count\": 1\n\t\t\t},\n\t\t\t\"ldap_dn\": \"l\"\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestStarEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &StarEvent{}, \"{}\")\n\n\tu := &StarEvent{\n\t\tAction:    Ptr(\"a\"),\n\t\tStarredAt: &Timestamp{referenceTime},\n\t\tOrg: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"starred_at\": ` + referenceTimeStr + `,\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestTeamEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &TeamEvent{}, \"{}\")\n\n\tu := &TeamEvent{\n\t\tAction: Ptr(\"a\"),\n\t\tTeam: &Team{\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tNodeID:          Ptr(\"n\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tDescription:     Ptr(\"d\"),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tSlug:            Ptr(\"s\"),\n\t\t\tPermission:      Ptr(\"p\"),\n\t\t\tPrivacy:         Ptr(\"p\"),\n\t\t\tMembersCount:    Ptr(1),\n\t\t\tReposCount:      Ptr(1),\n\t\t\tMembersURL:      Ptr(\"m\"),\n\t\t\tRepositoriesURL: Ptr(\"r\"),\n\t\t\tOrganization: &Organization{\n\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t\tHTMLURL:   Ptr(\"h\"),\n\t\t\t\tName:      Ptr(\"n\"),\n\t\t\t\tCompany:   Ptr(\"c\"),\n\t\t\t\tBlog:      Ptr(\"b\"),\n\t\t\t\tLocation:  Ptr(\"l\"),\n\t\t\t\tEmail:     Ptr(\"e\"),\n\t\t\t},\n\t\t\tParent: &Team{\n\t\t\t\tID:           Ptr(int64(1)),\n\t\t\t\tNodeID:       Ptr(\"n\"),\n\t\t\t\tName:         Ptr(\"n\"),\n\t\t\t\tDescription:  Ptr(\"d\"),\n\t\t\t\tURL:          Ptr(\"u\"),\n\t\t\t\tSlug:         Ptr(\"s\"),\n\t\t\t\tPermission:   Ptr(\"p\"),\n\t\t\t\tPrivacy:      Ptr(\"p\"),\n\t\t\t\tMembersCount: Ptr(1),\n\t\t\t\tReposCount:   Ptr(1),\n\t\t\t},\n\t\t\tLDAPDN: Ptr(\"l\"),\n\t\t},\n\t\tChanges: &TeamChange{\n\t\t\tDescription: &TeamDescription{\n\t\t\t\tFrom: Ptr(\"from\"),\n\t\t\t},\n\t\t\tName: &TeamName{\n\t\t\t\tFrom: Ptr(\"from\"),\n\t\t\t},\n\t\t\tPrivacy: &TeamPrivacy{\n\t\t\t\tFrom: Ptr(\"from\"),\n\t\t\t},\n\t\t\tRepository: &TeamRepository{\n\t\t\t\tPermissions: &TeamPermissions{\n\t\t\t\t\tFrom: &TeamPermissionsFrom{\n\t\t\t\t\t\tAdmin: Ptr(true),\n\t\t\t\t\t\tPull:  Ptr(true),\n\t\t\t\t\t\tPush:  Ptr(true),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tOrg: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"team\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"slug\": \"s\",\n\t\t\t\"permission\": \"p\",\n\t\t\t\"privacy\": \"p\",\n\t\t\t\"members_count\": 1,\n\t\t\t\"repos_count\": 1,\n\t\t\t\"organization\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"html_url\": \"h\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\"\n\t\t\t},\n\t\t\t\"members_url\": \"m\",\n\t\t\t\"repositories_url\": \"r\",\n\t\t\t\"parent\": {\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"description\": \"d\",\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"slug\": \"s\",\n\t\t\t\t\"permission\": \"p\",\n\t\t\t\t\"privacy\": \"p\",\n\t\t\t\t\"members_count\": 1,\n\t\t\t\t\"repos_count\": 1\n\t\t\t},\n\t\t\t\"ldap_dn\": \"l\"\n\t\t},\n\t\t\"changes\": {\n\t\t\t\"description\": {\n\t\t\t\t\"from\": \"from\"\n\t\t\t},\n\t\t\t\"name\": {\n\t\t\t\t\"from\": \"from\"\n\t\t\t},\n\t\t\t\"privacy\": {\n\t\t\t\t\"from\": \"from\"\n\t\t\t},\n\t\t\t\"repository\": {\n\t\t\t\t\"permissions\": {\n\t\t\t\t\t\"from\": {\n\t\t\t\t\t\t\"admin\": true,\n\t\t\t\t\t\t\"pull\": true,\n\t\t\t\t\t\t\"push\": true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestInstallationRepositoriesEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &InstallationRepositoriesEvent{}, \"{}\")\n\n\tu := &InstallationRepositoriesEvent{\n\t\tAction: Ptr(\"a\"),\n\t\tRepositoriesAdded: []*Repository{\n\t\t\t{\n\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\tURL:  Ptr(\"s\"),\n\t\t\t\tName: Ptr(\"n\"),\n\t\t\t},\n\t\t},\n\t\tRepositoriesRemoved: []*Repository{\n\t\t\t{\n\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\tURL:  Ptr(\"s\"),\n\t\t\t\tName: Ptr(\"n\"),\n\t\t\t},\n\t\t},\n\t\tRepositorySelection: Ptr(\"rs\"),\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"repositories_added\": [\n\t\t\t{\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"url\": \"s\"\n\t\t\t}\n\t\t],\n\t\t\"repositories_removed\": [\n\t\t\t{\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"url\": \"s\"\n\t\t\t}\n\t\t],\n\t\t\"repository_selection\": \"rs\",\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestInstallationTargetEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &InstallationTargetEvent{}, \"{}\")\n\n\tu := &InstallationTargetEvent{\n\t\tAccount: &User{\n\t\t\tLogin:     Ptr(\"u\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"l\"),\n\t\t},\n\t\tAction: Ptr(\"a\"),\n\t\tChanges: &InstallationChanges{\n\t\t\tLogin: &InstallationLoginChange{\n\t\t\t\tFrom: Ptr(\"p\"),\n\t\t\t},\n\t\t\tSlug: &InstallationSlugChange{\n\t\t\t\tFrom: Ptr(\"j\"),\n\t\t\t},\n\t\t},\n\t\tEnterprise: &Enterprise{\n\t\t\tID:          Ptr(1),\n\t\t\tSlug:        Ptr(\"s\"),\n\t\t\tName:        Ptr(\"n\"),\n\t\t\tNodeID:      Ptr(\"nid\"),\n\t\t\tAvatarURL:   Ptr(\"au\"),\n\t\t\tDescription: Ptr(\"d\"),\n\t\t\tWebsiteURL:  Ptr(\"wu\"),\n\t\t\tHTMLURL:     Ptr(\"hu\"),\n\t\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\t\tUpdatedAt:   &Timestamp{referenceTime},\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t\tOrganization: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tRepository: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tTargetType: Ptr(\"running\"),\n\t}\n\n\twant := `{\n\t\t\"account\": {\n\t\t\t\"login\": \"u\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"l\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"action\": \"a\",\n\t\t\"changes\": {\n\t\t\t\"login\": {\n\t\t\t\t\"from\": \"p\"\n\t\t\t},\n\t\t\t\"slug\": {\n\t\t\t\t\"from\": \"j\"\n\t\t\t}\n\t\t},\n\t\t\"enterprise\": {\n\t\t\t\"id\": 1,\n\t\t\t\"slug\": \"s\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"avatar_url\": \"au\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"website_url\": \"wu\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"url\": \"s\",\n\t\t\t\"name\": \"n\"\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"target_type\": \"running\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestEditTitle_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &EditTitle{}, \"{}\")\n\n\tu := &EditTitle{\n\t\tFrom: Ptr(\"EditTitleFrom\"),\n\t}\n\n\twant := `{\n\t\t\"from\": \"EditTitleFrom\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestEditBody_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &EditBody{}, \"{}\")\n\n\tu := &EditBody{\n\t\tFrom: Ptr(\"EditBodyFrom\"),\n\t}\n\n\twant := `{\n\t\t\"from\": \"EditBodyFrom\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestEditBase_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &EditBase{}, \"{}\")\n\n\tu := &EditBase{\n\t\tRef: &EditRef{\n\t\t\tFrom: Ptr(\"EditRefFrom\"),\n\t\t},\n\t\tSHA: &EditSHA{\n\t\t\tFrom: Ptr(\"EditSHAFrom\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"ref\": {\n\t\t\t\"from\": \"EditRefFrom\"\n\t\t},\n\t\t\"sha\": {\n\t\t\t\"from\": \"EditSHAFrom\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestEditRef_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &EditRef{}, \"{}\")\n\n\tu := &EditRef{\n\t\tFrom: Ptr(\"EditRefFrom\"),\n\t}\n\n\twant := `{\n\t\t\"from\": \"EditRefFrom\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestEditSHA_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &EditSHA{}, \"{}\")\n\n\tu := &EditSHA{\n\t\tFrom: Ptr(\"EditSHAFrom\"),\n\t}\n\n\twant := `{\n\t\t\"from\": \"EditSHAFrom\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestProjectName_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ProjectName{}, \"{}\")\n\n\tu := &ProjectName{\n\t\tFrom: Ptr(\"ProjectNameFrom\"),\n\t}\n\n\twant := `{\n\t\t\"from\": \"ProjectNameFrom\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestProjectBody_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ProjectBody{}, \"{}\")\n\n\tu := &ProjectBody{\n\t\tFrom: Ptr(\"ProjectBodyFrom\"),\n\t}\n\n\twant := `{\n\t\t\"from\": \"ProjectBodyFrom\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestProjectCardNote_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ProjectCardNote{}, \"{}\")\n\n\tu := &ProjectCardNote{\n\t\tFrom: Ptr(\"ProjectCardNoteFrom\"),\n\t}\n\n\twant := `{\n\t\t\"from\": \"ProjectCardNoteFrom\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestProjectColumnName_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ProjectColumnName{}, \"{}\")\n\n\tu := &ProjectColumnName{\n\t\tFrom: Ptr(\"ProjectColumnNameFrom\"),\n\t}\n\n\twant := `{\n\t\t\"from\": \"ProjectColumnNameFrom\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestTeamDescription_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &TeamDescription{}, \"{}\")\n\n\tu := &TeamDescription{\n\t\tFrom: Ptr(\"TeamDescriptionFrom\"),\n\t}\n\n\twant := `{\n\t\t\"from\": \"TeamDescriptionFrom\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestTeamName_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &TeamName{}, \"{}\")\n\n\tu := &TeamName{\n\t\tFrom: Ptr(\"TeamNameFrom\"),\n\t}\n\n\twant := `{\n\t\t\"from\": \"TeamNameFrom\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestTeamPrivacy_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &TeamPrivacy{}, \"{}\")\n\n\tu := &TeamPrivacy{\n\t\tFrom: Ptr(\"TeamPrivacyFrom\"),\n\t}\n\n\twant := `{\n\t\t\"from\": \"TeamPrivacyFrom\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestTeamRepository_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &TeamRepository{}, \"{}\")\n\n\tu := &TeamRepository{\n\t\tPermissions: &TeamPermissions{\n\t\t\tFrom: &TeamPermissionsFrom{\n\t\t\t\tAdmin: Ptr(true),\n\t\t\t\tPull:  Ptr(true),\n\t\t\t\tPush:  Ptr(true),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"permissions\": {\n\t\t\t\"from\": {\n\t\t\t\t\"admin\": true,\n\t\t\t\t\"pull\": true,\n\t\t\t\t\"push\": true\n\t\t\t}\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestTeamPermissions_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &TeamPermissions{}, \"{}\")\n\n\tu := &TeamPermissions{\n\t\tFrom: &TeamPermissionsFrom{\n\t\t\tAdmin: Ptr(true),\n\t\t\tPull:  Ptr(true),\n\t\t\tPush:  Ptr(true),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"from\": {\n\t\t\t\"admin\": true,\n\t\t\t\"pull\": true,\n\t\t\t\"push\": true\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestTeamPermissionsFrom_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &TeamPermissionsFrom{}, \"{}\")\n\n\tu := &TeamPermissionsFrom{\n\t\tAdmin: Ptr(true),\n\t\tPull:  Ptr(true),\n\t\tPush:  Ptr(true),\n\t}\n\n\twant := `{\n\t\t\"admin\": true,\n\t\t\"pull\": true,\n\t\t\"push\": true\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestRepositoryVulnerabilityAlert_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RepositoryVulnerabilityAlert{}, \"{}\")\n\n\tu := &RepositoryVulnerabilityAlert{\n\t\tID:                  Ptr(int64(1)),\n\t\tAffectedRange:       Ptr(\"ar\"),\n\t\tAffectedPackageName: Ptr(\"apn\"),\n\t\tExternalReference:   Ptr(\"er\"),\n\t\tExternalIdentifier:  Ptr(\"ei\"),\n\t\tFixedIn:             Ptr(\"fi\"),\n\t\tDismisser: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tDismissReason: Ptr(\"dr\"),\n\t\tDismissedAt:   &Timestamp{referenceTime},\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"affected_range\": \"ar\",\n\t\t\"affected_package_name\": \"apn\",\n\t\t\"external_reference\": \"er\",\n\t\t\"external_identifier\": \"ei\",\n\t\t\"fixed_in\": \"fi\",\n\t\t\"dismisser\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"dismiss_reason\": \"dr\",\n\t\t\"dismissed_at\": ` + referenceTimeStr + `\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPage_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Page{}, \"{}\")\n\n\tu := &Page{\n\t\tPageName: Ptr(\"p\"),\n\t\tTitle:    Ptr(\"t\"),\n\t\tSummary:  Ptr(\"s\"),\n\t\tAction:   Ptr(\"a\"),\n\t\tSHA:      Ptr(\"s\"),\n\t\tHTMLURL:  Ptr(\"h\"),\n\t}\n\n\twant := `{\n\t\t\"page_name\": \"p\",\n\t\t\"title\": \"t\",\n\t\t\"summary\": \"s\",\n\t\t\"action\": \"a\",\n\t\t\"sha\": \"s\",\n\t\t\"html_url\": \"h\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestTeamChange_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &TeamChange{}, \"{}\")\n\n\tu := &TeamChange{\n\t\tDescription: &TeamDescription{\n\t\t\tFrom: Ptr(\"DescriptionFrom\"),\n\t\t},\n\t\tName: &TeamName{\n\t\t\tFrom: Ptr(\"NameFrom\"),\n\t\t},\n\t\tPrivacy: &TeamPrivacy{\n\t\t\tFrom: Ptr(\"PrivacyFrom\"),\n\t\t},\n\t\tRepository: &TeamRepository{\n\t\t\tPermissions: &TeamPermissions{\n\t\t\t\tFrom: &TeamPermissionsFrom{\n\t\t\t\t\tAdmin: Ptr(false),\n\t\t\t\t\tPull:  Ptr(false),\n\t\t\t\t\tPush:  Ptr(false),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"description\": {\n\t\t\t\"from\": \"DescriptionFrom\"\n\t\t},\n\t\t\"name\": {\n\t\t\t\"from\": \"NameFrom\"\n\t\t},\n\t\t\"privacy\": {\n\t\t\t\"from\": \"PrivacyFrom\"\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"permissions\": {\n\t\t\t\t\"from\": {\n\t\t\t\t\t\"admin\": false,\n\t\t\t\t\t\"pull\": false,\n\t\t\t\t\t\"push\": false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestIssueCommentEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &IssueCommentEvent{}, \"{}\")\n\n\tu := &IssueCommentEvent{\n\t\tAction:  Ptr(\"a\"),\n\t\tIssue:   &Issue{ID: Ptr(int64(1))},\n\t\tComment: &IssueComment{ID: Ptr(int64(1))},\n\t\tChanges: &EditChange{\n\t\t\tTitle: &EditTitle{\n\t\t\t\tFrom: Ptr(\"TitleFrom\"),\n\t\t\t},\n\t\t\tBody: &EditBody{\n\t\t\t\tFrom: Ptr(\"BodyFrom\"),\n\t\t\t},\n\t\t\tBase: &EditBase{\n\t\t\t\tRef: &EditRef{\n\t\t\t\t\tFrom: Ptr(\"BaseRefFrom\"),\n\t\t\t\t},\n\t\t\t\tSHA: &EditSHA{\n\t\t\t\t\tFrom: Ptr(\"BaseSHAFrom\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t\tOrganization: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"issue\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"comment\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"changes\": {\n\t\t\t\"title\": {\n\t\t\t\t\"from\": \"TitleFrom\"\n\t\t\t},\n\t\t\t\"body\": {\n\t\t\t\t\"from\": \"BodyFrom\"\n\t\t\t},\n\t\t\t\"base\": {\n\t\t\t\t\"ref\": {\n\t\t\t\t\t\"from\": \"BaseRefFrom\"\n\t\t\t\t},\n\t\t\t\t\"sha\": {\n\t\t\t\t\t\"from\": \"BaseSHAFrom\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestIssuesEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &IssuesEvent{}, \"{}\")\n\n\tu := &IssuesEvent{\n\t\tAction: Ptr(\"a\"),\n\t\tIssue:  &Issue{ID: Ptr(int64(1))},\n\t\tAssignee: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tLabel: &Label{ID: Ptr(int64(1))},\n\t\tChanges: &EditChange{\n\t\t\tTitle: &EditTitle{\n\t\t\t\tFrom: Ptr(\"TitleFrom\"),\n\t\t\t},\n\t\t\tBody: &EditBody{\n\t\t\t\tFrom: Ptr(\"BodyFrom\"),\n\t\t\t},\n\t\t\tBase: &EditBase{\n\t\t\t\tRef: &EditRef{\n\t\t\t\t\tFrom: Ptr(\"BaseRefFrom\"),\n\t\t\t\t},\n\t\t\t\tSHA: &EditSHA{\n\t\t\t\t\tFrom: Ptr(\"BaseSHAFrom\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"issue\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"assignee\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"label\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"changes\": {\n\t\t\t\"title\": {\n\t\t\t\t\"from\": \"TitleFrom\"\n\t\t\t},\n\t\t\t\"body\": {\n\t\t\t\t\"from\": \"BodyFrom\"\n\t\t\t},\n\t\t\t\"base\": {\n\t\t\t\t\"ref\": {\n\t\t\t\t\t\"from\": \"BaseRefFrom\"\n\t\t\t\t},\n\t\t\t\t\"sha\": {\n\t\t\t\t\t\"from\": \"BaseSHAFrom\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestLabelEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &LabelEvent{}, \"{}\")\n\n\tu := &LabelEvent{\n\t\tAction: Ptr(\"a\"),\n\t\tLabel:  &Label{ID: Ptr(int64(1))},\n\t\tChanges: &EditChange{\n\t\t\tTitle: &EditTitle{\n\t\t\t\tFrom: Ptr(\"TitleFrom\"),\n\t\t\t},\n\t\t\tBody: &EditBody{\n\t\t\t\tFrom: Ptr(\"BodyFrom\"),\n\t\t\t},\n\t\t\tBase: &EditBase{\n\t\t\t\tRef: &EditRef{\n\t\t\t\t\tFrom: Ptr(\"BaseRefFrom\"),\n\t\t\t\t},\n\t\t\t\tSHA: &EditSHA{\n\t\t\t\t\tFrom: Ptr(\"BaseSHAFrom\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tOrg: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"label\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"changes\": {\n\t\t\t\"title\": {\n\t\t\t\t\"from\": \"TitleFrom\"\n\t\t\t},\n\t\t\t\"body\": {\n\t\t\t\t\"from\": \"BodyFrom\"\n\t\t\t},\n\t\t\t\"base\": {\n\t\t\t\t\"ref\": {\n\t\t\t\t\t\"from\": \"BaseRefFrom\"\n\t\t\t\t},\n\t\t\t\t\"sha\": {\n\t\t\t\t\t\"from\": \"BaseSHAFrom\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestMilestoneEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &MilestoneEvent{}, \"{}\")\n\n\tu := &MilestoneEvent{\n\t\tAction:    Ptr(\"a\"),\n\t\tMilestone: &Milestone{ID: Ptr(int64(1))},\n\t\tChanges: &EditChange{\n\t\t\tTitle: &EditTitle{\n\t\t\t\tFrom: Ptr(\"TitleFrom\"),\n\t\t\t},\n\t\t\tBody: &EditBody{\n\t\t\t\tFrom: Ptr(\"BodyFrom\"),\n\t\t\t},\n\t\t\tBase: &EditBase{\n\t\t\t\tRef: &EditRef{\n\t\t\t\t\tFrom: Ptr(\"BaseRefFrom\"),\n\t\t\t\t},\n\t\t\t\tSHA: &EditSHA{\n\t\t\t\t\tFrom: Ptr(\"BaseSHAFrom\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tOrg: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"milestone\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"changes\": {\n\t\t\t\"title\": {\n\t\t\t\t\"from\": \"TitleFrom\"\n\t\t\t},\n\t\t\t\"body\": {\n\t\t\t\t\"from\": \"BodyFrom\"\n\t\t\t},\n\t\t\t\"base\": {\n\t\t\t\t\"ref\": {\n\t\t\t\t\t\"from\": \"BaseRefFrom\"\n\t\t\t\t},\n\t\t\t\t\"sha\": {\n\t\t\t\t\t\"from\": \"BaseSHAFrom\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPublicEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PublicEvent{}, \"{}\")\n\n\tu := &PublicEvent{\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPullRequestReviewEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PullRequestReviewEvent{}, \"{}\")\n\n\tu := &PullRequestReviewEvent{\n\t\tAction:      Ptr(\"a\"),\n\t\tReview:      &PullRequestReview{ID: Ptr(int64(1))},\n\t\tPullRequest: &PullRequest{ID: Ptr(int64(1))},\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t\tOrganization: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"review\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"pull_request\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPushEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PushEvent{}, \"{}\")\n\n\tu := &PushEvent{\n\t\tPushID: Ptr(int64(1)),\n\t\tHead:   Ptr(\"h\"),\n\t\tRef:    Ptr(\"ref\"),\n\t\tSize:   Ptr(1),\n\t\tCommits: []*HeadCommit{\n\t\t\t{ID: Ptr(\"id\")},\n\t\t},\n\t\tBefore:       Ptr(\"b\"),\n\t\tDistinctSize: Ptr(1),\n\t\tAfter:        Ptr(\"a\"),\n\t\tCreated:      Ptr(true),\n\t\tDeleted:      Ptr(true),\n\t\tForced:       Ptr(true),\n\t\tBaseRef:      Ptr(\"a\"),\n\t\tCompare:      Ptr(\"a\"),\n\t\tRepo:         &PushEventRepository{ID: Ptr(int64(1))},\n\t\tHeadCommit:   &HeadCommit{ID: Ptr(\"id\")},\n\t\tPusher: &CommitAuthor{\n\t\t\tLogin: Ptr(\"l\"),\n\t\t\tDate:  &Timestamp{referenceTime},\n\t\t\tName:  Ptr(\"n\"),\n\t\t\tEmail: Ptr(\"e\"),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t\tOrganization: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"push_id\": 1,\n\t\t\"head\": \"h\",\n\t\t\"ref\": \"ref\",\n\t\t\"size\": 1,\n\t\t\"commits\": [\n\t\t\t{\n\t\t\t\t\"id\": \"id\"\n\t\t\t}\n\t\t],\n\t\t\"before\": \"b\",\n\t\t\"distinct_size\": 1,\n\t\t\"after\": \"a\",\n\t\t\"created\": true,\n\t\t\"deleted\": true,\n\t\t\"forced\": true,\n\t\t\"base_ref\": \"a\",\n\t\t\"compare\": \"a\",\n\t\t\"repository\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"head_commit\": {\n\t\t\t\"id\": \"id\"\n\t\t},\n\t\t\"pusher\": {\n\t\t\t\"date\": ` + referenceTimeStr + `,\n\t\t\t\"name\": \"n\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"username\": \"l\"\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestStatusEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &StatusEvent{}, \"{}\")\n\n\tu := &StatusEvent{\n\t\tSHA:         Ptr(\"sha\"),\n\t\tState:       Ptr(\"s\"),\n\t\tDescription: Ptr(\"d\"),\n\t\tTargetURL:   Ptr(\"turl\"),\n\t\tBranches: []*Branch{\n\t\t\t{\n\t\t\t\tName:      Ptr(\"n\"),\n\t\t\t\tCommit:    &RepositoryCommit{NodeID: Ptr(\"nid\")},\n\t\t\t\tProtected: Ptr(false),\n\t\t\t},\n\t\t},\n\t\tID:        Ptr(int64(1)),\n\t\tName:      Ptr(\"n\"),\n\t\tContext:   Ptr(\"c\"),\n\t\tCommit:    &RepositoryCommit{NodeID: Ptr(\"nid\")},\n\t\tCreatedAt: &Timestamp{referenceTime},\n\t\tUpdatedAt: &Timestamp{referenceTime},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"sha\": \"sha\",\n\t\t\"state\": \"s\",\n\t\t\"description\": \"d\",\n\t\t\"target_url\": \"turl\",\n\t\t\"branches\": [\n\t\t\t{\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"commit\": {\n\t\t\t\t\t\"node_id\": \"nid\"\n\t\t\t\t},\n\t\t\t\t\"protected\": false\n\t\t\t}\n\t\t],\n\t\t\"id\": 1,\n\t\t\"name\": \"n\",\n\t\t\"context\": \"c\",\n\t\t\"commit\": {\n\t\t\t\"node_id\": \"nid\"\n\t\t},\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestMarketplacePurchaseEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &MarketplacePurchaseEvent{}, \"{}\")\n\n\tu := &MarketplacePurchaseEvent{\n\t\tAction:        Ptr(\"a\"),\n\t\tEffectiveDate: &Timestamp{referenceTime},\n\t\tMarketplacePurchase: &MarketplacePurchase{\n\t\t\tBillingCycle:    Ptr(\"bc\"),\n\t\t\tNextBillingDate: &Timestamp{referenceTime},\n\t\t\tUnitCount:       Ptr(1),\n\t\t\tPlan: &MarketplacePlan{\n\t\t\t\tURL:                 Ptr(\"u\"),\n\t\t\t\tAccountsURL:         Ptr(\"au\"),\n\t\t\t\tID:                  Ptr(int64(1)),\n\t\t\t\tNumber:              Ptr(1),\n\t\t\t\tName:                Ptr(\"n\"),\n\t\t\t\tDescription:         Ptr(\"d\"),\n\t\t\t\tMonthlyPriceInCents: Ptr(1),\n\t\t\t\tYearlyPriceInCents:  Ptr(1),\n\t\t\t\tPriceModel:          Ptr(\"pm\"),\n\t\t\t\tUnitName:            Ptr(\"un\"),\n\t\t\t\tBullets:             &[]string{\"b\"},\n\t\t\t\tState:               Ptr(\"s\"),\n\t\t\t\tHasFreeTrial:        Ptr(false),\n\t\t\t},\n\t\t\tOnFreeTrial:     Ptr(false),\n\t\t\tFreeTrialEndsOn: &Timestamp{referenceTime},\n\t\t\tUpdatedAt:       &Timestamp{referenceTime},\n\t\t},\n\t\tPreviousMarketplacePurchase: &MarketplacePurchase{\n\t\t\tBillingCycle:    Ptr(\"bc\"),\n\t\t\tNextBillingDate: &Timestamp{referenceTime},\n\t\t\tUnitCount:       Ptr(1),\n\t\t\tPlan: &MarketplacePlan{\n\t\t\t\tURL:                 Ptr(\"u\"),\n\t\t\t\tAccountsURL:         Ptr(\"au\"),\n\t\t\t\tID:                  Ptr(int64(1)),\n\t\t\t\tNumber:              Ptr(1),\n\t\t\t\tName:                Ptr(\"n\"),\n\t\t\t\tDescription:         Ptr(\"d\"),\n\t\t\t\tMonthlyPriceInCents: Ptr(1),\n\t\t\t\tYearlyPriceInCents:  Ptr(1),\n\t\t\t\tPriceModel:          Ptr(\"pm\"),\n\t\t\t\tUnitName:            Ptr(\"un\"),\n\t\t\t\tBullets:             &[]string{\"b\"},\n\t\t\t\tState:               Ptr(\"s\"),\n\t\t\t\tHasFreeTrial:        Ptr(false),\n\t\t\t},\n\t\t\tOnFreeTrial:     Ptr(false),\n\t\t\tFreeTrialEndsOn: &Timestamp{referenceTime},\n\t\t\tUpdatedAt:       &Timestamp{referenceTime},\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"effective_date\": ` + referenceTimeStr + `,\n\t\t\"marketplace_purchase\": {\n\t\t\t\"billing_cycle\": \"bc\",\n\t\t\t\"next_billing_date\": ` + referenceTimeStr + `,\n\t\t\t\"unit_count\": 1,\n\t\t\t\"plan\": {\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"accounts_url\": \"au\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"number\": 1,\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"description\": \"d\",\n\t\t\t\t\"monthly_price_in_cents\": 1,\n\t\t\t\t\"yearly_price_in_cents\": 1,\n\t\t\t\t\"price_model\": \"pm\",\n\t\t\t\t\"unit_name\": \"un\",\n\t\t\t\t\"bullets\": [\n\t\t\t\t\t\"b\"\n\t\t\t\t],\n\t\t\t\t\"state\": \"s\",\n\t\t\t\t\"has_free_trial\": false\n\t\t\t},\n\t\t\t\"on_free_trial\": false,\n\t\t\t\"free_trial_ends_on\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"previous_marketplace_purchase\": {\n\t\t\t\"billing_cycle\": \"bc\",\n\t\t\t\"next_billing_date\": ` + referenceTimeStr + `,\n\t\t\t\"unit_count\": 1,\n\t\t\t\"plan\": {\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"accounts_url\": \"au\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"number\": 1,\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"description\": \"d\",\n\t\t\t\t\"monthly_price_in_cents\": 1,\n\t\t\t\t\"yearly_price_in_cents\": 1,\n\t\t\t\t\"price_model\": \"pm\",\n\t\t\t\t\"unit_name\": \"un\",\n\t\t\t\t\"bullets\": [\n\t\t\t\t\t\"b\"\n\t\t\t\t],\n\t\t\t\t\"state\": \"s\",\n\t\t\t\t\"has_free_trial\": false\n\t\t\t},\n\t\t\t\"on_free_trial\": false,\n\t\t\t\"free_trial_ends_on\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestOrganizationEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &OrganizationEvent{}, \"{}\")\n\n\tu := &OrganizationEvent{\n\t\tAction:     Ptr(\"a\"),\n\t\tInvitation: &Invitation{ID: Ptr(int64(1))},\n\t\tMembership: &Membership{\n\t\t\tURL:             Ptr(\"url\"),\n\t\t\tState:           Ptr(\"s\"),\n\t\t\tRole:            Ptr(\"r\"),\n\t\t\tOrganizationURL: Ptr(\"ou\"),\n\t\t\tOrganization: &Organization{\n\t\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\t\tName:                                 Ptr(\"n\"),\n\t\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\t\tIsVerified:                           Ptr(true),\n\t\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t\t},\n\t\t\tUser: &User{\n\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t},\n\t\t},\n\t\tOrganization: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"invitation\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"membership\": {\n\t\t\t\"url\": \"url\",\n\t\t\t\"state\": \"s\",\n\t\t\t\"role\": \"r\",\n\t\t\t\"organization_url\": \"ou\",\n\t\t\t\"organization\": {\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"loc\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\t\"description\": \"d\",\n\t\t\t\t\"billing_email\": \"be\",\n\t\t\t\t\"is_verified\": true,\n\t\t\t\t\"has_organization_projects\": true,\n\t\t\t\t\"has_repository_projects\": true,\n\t\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\t\"members_can_create_pages\": true,\n\t\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\t\"members_can_create_private_pages\": true\n\t\t\t},\n\t\t\t\"user\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"events_url\": \"e\",\n\t\t\t\t\"repos_url\": \"r\"\n\t\t\t}\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPageBuildEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PageBuildEvent{}, \"{}\")\n\n\tu := &PageBuildEvent{\n\t\tBuild: &PagesBuild{URL: Ptr(\"url\")},\n\t\tID:    Ptr(int64(1)),\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"build\": {\n\t\t\t\"url\": \"url\"\n\t\t},\n\t\t\"id\": 1,\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestCommitCommentEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CommitCommentEvent{}, \"{}\")\n\n\tu := &CommitCommentEvent{\n\t\tComment: &RepositoryComment{\n\t\t\tHTMLURL:  Ptr(\"hurl\"),\n\t\t\tURL:      Ptr(\"url\"),\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tCommitID: Ptr(\"cid\"),\n\t\t\tUser: &User{\n\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t},\n\t\t\tReactions: &Reactions{\n\t\t\t\tTotalCount: Ptr(1),\n\t\t\t\tPlusOne:    Ptr(1),\n\t\t\t\tMinusOne:   Ptr(1),\n\t\t\t\tLaugh:      Ptr(1),\n\t\t\t\tConfused:   Ptr(1),\n\t\t\t\tHeart:      Ptr(1),\n\t\t\t\tHooray:     Ptr(1),\n\t\t\t\tRocket:     Ptr(1),\n\t\t\t\tEyes:       Ptr(1),\n\t\t\t\tURL:        Ptr(\"url\"),\n\t\t\t},\n\t\t\tCreatedAt: &Timestamp{referenceTime},\n\t\t\tUpdatedAt: &Timestamp{referenceTime},\n\t\t\tBody:      Ptr(\"b\"),\n\t\t\tPath:      Ptr(\"path\"),\n\t\t\tPosition:  Ptr(1),\n\t\t},\n\t\tAction: Ptr(\"a\"),\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"comment\": {\n\t\t\t\"html_url\": \"hurl\",\n\t\t\t\"url\": \"url\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"commit_id\": \"cid\",\n\t\t\t\"user\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"events_url\": \"e\",\n\t\t\t\t\"repos_url\": \"r\"\n\t\t\t},\n\t\t\t\"reactions\": {\n\t\t\t\t\"total_count\": 1,\n\t\t\t\t\"+1\": 1,\n\t\t\t\t\"-1\": 1,\n\t\t\t\t\"laugh\": 1,\n\t\t\t\t\"confused\": 1,\n\t\t\t\t\"heart\": 1,\n\t\t\t\t\"hooray\": 1,\n\t\t\t\t\"rocket\": 1,\n\t\t\t\t\"eyes\": 1,\n\t\t\t\t\"url\": \"url\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"body\": \"b\",\n\t\t\t\"path\": \"path\",\n\t\t\t\"position\": 1\n\t\t},\n\t\t\"action\": \"a\",\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestDeploymentEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &DeploymentEvent{}, \"{}\")\n\n\tl := make(map[string]any)\n\tl[\"key\"] = \"value\"\n\n\tjsonMsg, _ := json.Marshal(&l)\n\n\tu := &DeploymentEvent{\n\t\tDeployment: &Deployment{\n\t\t\tURL:         Ptr(\"url\"),\n\t\t\tID:          Ptr(int64(1)),\n\t\t\tSHA:         Ptr(\"sha\"),\n\t\t\tRef:         Ptr(\"ref\"),\n\t\t\tTask:        Ptr(\"t\"),\n\t\t\tPayload:     jsonMsg,\n\t\t\tEnvironment: Ptr(\"e\"),\n\t\t\tDescription: Ptr(\"d\"),\n\t\t\tCreator: &User{\n\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t},\n\t\t\tCreatedAt:     &Timestamp{referenceTime},\n\t\t\tUpdatedAt:     &Timestamp{referenceTime},\n\t\t\tStatusesURL:   Ptr(\"surl\"),\n\t\t\tRepositoryURL: Ptr(\"rurl\"),\n\t\t\tNodeID:        Ptr(\"nid\"),\n\t\t},\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t\tWorkflow: &Workflow{\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"nid\"),\n\t\t\tName:      Ptr(\"n\"),\n\t\t\tPath:      Ptr(\"p\"),\n\t\t\tState:     Ptr(\"s\"),\n\t\t\tCreatedAt: &Timestamp{referenceTime},\n\t\t\tUpdatedAt: &Timestamp{referenceTime},\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tHTMLURL:   Ptr(\"h\"),\n\t\t\tBadgeURL:  Ptr(\"b\"),\n\t\t},\n\t\tWorkflowRun: &WorkflowRun{\n\t\t\tID:         Ptr(int64(1)),\n\t\t\tName:       Ptr(\"n\"),\n\t\t\tNodeID:     Ptr(\"nid\"),\n\t\t\tHeadBranch: Ptr(\"hb\"),\n\t\t\tHeadSHA:    Ptr(\"hs\"),\n\t\t\tRunNumber:  Ptr(1),\n\t\t\tRunAttempt: Ptr(1),\n\t\t\tEvent:      Ptr(\"e\"),\n\t\t\tStatus:     Ptr(\"s\"),\n\t\t\tConclusion: Ptr(\"c\"),\n\t\t\tWorkflowID: Ptr(int64(1)),\n\t\t\tURL:        Ptr(\"u\"),\n\t\t\tHTMLURL:    Ptr(\"h\"),\n\t\t\tPullRequests: []*PullRequest{\n\t\t\t\t{\n\t\t\t\t\tURL:    Ptr(\"u\"),\n\t\t\t\t\tID:     Ptr(int64(1)),\n\t\t\t\t\tNumber: Ptr(1),\n\t\t\t\t\tHead: &PullRequestBranch{\n\t\t\t\t\t\tRef: Ptr(\"r\"),\n\t\t\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\t\t\tRepo: &Repository{\n\t\t\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\t\t\tURL:  Ptr(\"s\"),\n\t\t\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tBase: &PullRequestBranch{\n\t\t\t\t\t\tRef: Ptr(\"r\"),\n\t\t\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\t\t\tRepo: &Repository{\n\t\t\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\t\t\tURL:  Ptr(\"u\"),\n\t\t\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tCreatedAt:          &Timestamp{referenceTime},\n\t\t\tUpdatedAt:          &Timestamp{referenceTime},\n\t\t\tRunStartedAt:       &Timestamp{referenceTime},\n\t\t\tJobsURL:            Ptr(\"j\"),\n\t\t\tLogsURL:            Ptr(\"l\"),\n\t\t\tCheckSuiteURL:      Ptr(\"c\"),\n\t\t\tArtifactsURL:       Ptr(\"a\"),\n\t\t\tCancelURL:          Ptr(\"c\"),\n\t\t\tRerunURL:           Ptr(\"r\"),\n\t\t\tPreviousAttemptURL: Ptr(\"p\"),\n\t\t\tHeadCommit: &HeadCommit{\n\t\t\t\tMessage: Ptr(\"m\"),\n\t\t\t\tAuthor: &CommitAuthor{\n\t\t\t\t\tName:  Ptr(\"n\"),\n\t\t\t\t\tEmail: Ptr(\"e\"),\n\t\t\t\t\tLogin: Ptr(\"l\"),\n\t\t\t\t},\n\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\tDistinct:  Ptr(false),\n\t\t\t\tSHA:       Ptr(\"s\"),\n\t\t\t\tID:        Ptr(\"i\"),\n\t\t\t\tTreeID:    Ptr(\"tid\"),\n\t\t\t\tTimestamp: &Timestamp{referenceTime},\n\t\t\t\tCommitter: &CommitAuthor{\n\t\t\t\t\tName:  Ptr(\"n\"),\n\t\t\t\t\tEmail: Ptr(\"e\"),\n\t\t\t\t\tLogin: Ptr(\"l\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tWorkflowURL: Ptr(\"w\"),\n\t\t\tRepository: &Repository{\n\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\tURL:  Ptr(\"u\"),\n\t\t\t\tName: Ptr(\"n\"),\n\t\t\t},\n\t\t\tHeadRepository: &Repository{\n\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\tURL:  Ptr(\"u\"),\n\t\t\t\tName: Ptr(\"n\"),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"deployment\": {\n\t\t\t\"url\": \"url\",\n\t\t\t\"id\": 1,\n\t\t\t\"sha\": \"sha\",\n\t\t\t\"ref\": \"ref\",\n\t\t\t\"task\": \"t\",\n\t\t\t\"payload\": {\n\t\t\t\t\"key\": \"value\"\n\t\t\t},\n\t\t\t\"environment\": \"e\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"creator\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"events_url\": \"e\",\n\t\t\t\t\"repos_url\": \"r\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"statuses_url\": \"surl\",\n\t\t\t\"repository_url\": \"rurl\",\n\t\t\t\"node_id\": \"nid\"\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"workflow\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"path\": \"p\",\n\t\t\t\"state\": \"s\",\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\",\n\t\t\t\"html_url\": \"h\",\n\t\t\t\"badge_url\": \"b\"\n\t\t},\n\t\t\"workflow_run\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"head_branch\": \"hb\",\n\t\t\t\"head_sha\": \"hs\",\n\t\t\t\"run_number\": 1,\n\t\t\t\"run_attempt\": 1,\n\t\t\t\"event\": \"e\",\n\t\t\t\"status\": \"s\",\n\t\t\t\"conclusion\": \"c\",\n\t\t\t\"workflow_id\": 1,\n\t\t\t\"url\": \"u\",\n\t\t\t\"html_url\": \"h\",\n\t\t\t\"pull_requests\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"number\": 1,\n\t\t\t\t\t\"url\": \"u\",\n\t\t\t\t\t\"head\": {\n\t\t\t\t\t\t\"ref\": \"r\",\n\t\t\t\t\t\t\"sha\": \"s\",\n\t\t\t\t\t\t\"repo\": {\n\t\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\t\t\"url\": \"s\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"base\": {\n\t\t\t\t\t\t\"ref\": \"r\",\n\t\t\t\t\t\t\"sha\": \"s\",\n\t\t\t\t\t\t\"repo\": {\n\t\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\t\t\"url\": \"u\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"run_started_at\": ` + referenceTimeStr + `,\n\t\t\t\"jobs_url\": \"j\",\n\t\t\t\"logs_url\": \"l\",\n\t\t\t\"check_suite_url\": \"c\",\n\t\t\t\"artifacts_url\": \"a\",\n\t\t\t\"cancel_url\": \"c\",\n\t\t\t\"rerun_url\": \"r\",\n\t\t\t\"previous_attempt_url\": \"p\",\n\t\t\t\"head_commit\": {\n\t\t\t\t\"message\": \"m\",\n\t\t\t\t\"author\": {\n\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\"email\": \"e\",\n\t\t\t\t\t\"username\": \"l\"\n\t\t\t\t},\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"distinct\": false,\n\t\t\t\t\"sha\": \"s\",\n\t\t\t\t\"id\": \"i\",\n\t\t\t\t\"tree_id\": \"tid\",\n\t\t\t\t\"timestamp\": ` + referenceTimeStr + `,\n\t\t\t\t\"committer\": {\n\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\"email\": \"e\",\n\t\t\t\t\t\"username\": \"l\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"workflow_url\": \"w\",\n\t\t\t\"repository\": {\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"head_repository\": {\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"url\": \"u\"\n\t\t\t}\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want, cmpJSONRawMessageComparator())\n}\n\nfunc TestDeploymentProtectionRuleEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &DeploymentProtectionRuleEvent{}, \"{}\")\n\n\tl := make(map[string]any)\n\tl[\"key\"] = \"value\"\n\n\tjsonMsg, _ := json.Marshal(&l)\n\n\tu := &DeploymentProtectionRuleEvent{\n\t\tAction:                Ptr(\"a\"),\n\t\tEnvironment:           Ptr(\"e\"),\n\t\tDeploymentCallbackURL: Ptr(\"b\"),\n\t\tDeployment: &Deployment{\n\t\t\tURL:         Ptr(\"url\"),\n\t\t\tID:          Ptr(int64(1)),\n\t\t\tSHA:         Ptr(\"sha\"),\n\t\t\tRef:         Ptr(\"ref\"),\n\t\t\tTask:        Ptr(\"t\"),\n\t\t\tPayload:     jsonMsg,\n\t\t\tEnvironment: Ptr(\"e\"),\n\t\t\tDescription: Ptr(\"d\"),\n\t\t\tCreator: &User{\n\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t},\n\t\t\tCreatedAt:     &Timestamp{referenceTime},\n\t\t\tUpdatedAt:     &Timestamp{referenceTime},\n\t\t\tStatusesURL:   Ptr(\"surl\"),\n\t\t\tRepositoryURL: Ptr(\"rurl\"),\n\t\t\tNodeID:        Ptr(\"nid\"),\n\t\t},\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tOrganization: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tPullRequests: []*PullRequest{\n\t\t\t{\n\t\t\t\tURL:    Ptr(\"u\"),\n\t\t\t\tID:     Ptr(int64(1)),\n\t\t\t\tNumber: Ptr(1),\n\t\t\t\tHead: &PullRequestBranch{\n\t\t\t\t\tRef: Ptr(\"r\"),\n\t\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\t\tRepo: &Repository{\n\t\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\t\tURL:  Ptr(\"s\"),\n\t\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tBase: &PullRequestBranch{\n\t\t\t\t\tRef: Ptr(\"r\"),\n\t\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\t\tRepo: &Repository{\n\t\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\t\tURL:  Ptr(\"u\"),\n\t\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"environment\": \"e\",\n\t\t\"deployment_callback_url\": \"b\",\n\t\t\"deployment\": {\n\t\t\t\"url\": \"url\",\n\t\t\t\"id\": 1,\n\t\t\t\"sha\": \"sha\",\n\t\t\t\"ref\": \"ref\",\n\t\t\t\"task\": \"t\",\n\t\t\t\"payload\": {\n\t\t\t\t\"key\": \"value\"\n\t\t\t},\n\t\t\t\"environment\": \"e\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"creator\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"events_url\": \"e\",\n\t\t\t\t\"repos_url\": \"r\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"statuses_url\": \"surl\",\n\t\t\t\"repository_url\": \"rurl\",\n\t\t\t\"node_id\": \"nid\"\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"pull_requests\": [\n\t\t\t{\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"number\": 1,\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"head\": {\n\t\t\t\t\t\"ref\": \"r\",\n\t\t\t\t\t\"sha\": \"s\",\n\t\t\t\t\t\"repo\": {\n\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\t\"url\": \"s\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"base\": {\n\t\t\t\t\t\"ref\": \"r\",\n\t\t\t\t\t\"sha\": \"s\",\n\t\t\t\t\t\"repo\": {\n\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\t\"url\": \"u\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want, cmpJSONRawMessageComparator())\n}\n\nfunc TestDeploymentReviewEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &DeploymentReviewEvent{}, \"{}\")\n\n\tu := &DeploymentReviewEvent{\n\t\tAction:      Ptr(\"a\"),\n\t\tEnvironment: Ptr(\"e\"),\n\t\tRequester: &User{\n\t\t\tAvatarURL:         Ptr(\"a\"),\n\t\t\tEmail:             Ptr(\"e\"),\n\t\t\tEventsURL:         Ptr(\"e\"),\n\t\t\tFollowersURL:      Ptr(\"f\"),\n\t\t\tFollowingURL:      Ptr(\"f\"),\n\t\t\tGistsURL:          Ptr(\"g\"),\n\t\t\tGravatarID:        Ptr(\"g\"),\n\t\t\tHTMLURL:           Ptr(\"h\"),\n\t\t\tID:                Ptr(int64(1)),\n\t\t\tLogin:             Ptr(\"l\"),\n\t\t\tName:              Ptr(\"n\"),\n\t\t\tNodeID:            Ptr(\"n\"),\n\t\t\tOrganizationsURL:  Ptr(\"o\"),\n\t\t\tReceivedEventsURL: Ptr(\"r\"),\n\t\t\tReposURL:          Ptr(\"r\"),\n\t\t\tSiteAdmin:         Ptr(false),\n\t\t\tStarredURL:        Ptr(\"s\"),\n\t\t\tSubscriptionsURL:  Ptr(\"s\"),\n\t\t\tType:              Ptr(\"User\"),\n\t\t\tURL:               Ptr(\"u\"),\n\t\t},\n\t\tReviewers: []*RequiredReviewer{\n\t\t\t{\n\t\t\t\tType: Ptr(\"User\"),\n\t\t\t\tReviewer: &User{\n\t\t\t\t\tAvatarURL:         Ptr(\"a\"),\n\t\t\t\t\tEmail:             Ptr(\"e\"),\n\t\t\t\t\tEventsURL:         Ptr(\"e\"),\n\t\t\t\t\tFollowersURL:      Ptr(\"f\"),\n\t\t\t\t\tFollowingURL:      Ptr(\"f\"),\n\t\t\t\t\tGistsURL:          Ptr(\"g\"),\n\t\t\t\t\tGravatarID:        Ptr(\"g\"),\n\t\t\t\t\tHTMLURL:           Ptr(\"h\"),\n\t\t\t\t\tID:                Ptr(int64(1)),\n\t\t\t\t\tLogin:             Ptr(\"l\"),\n\t\t\t\t\tName:              Ptr(\"n\"),\n\t\t\t\t\tNodeID:            Ptr(\"n\"),\n\t\t\t\t\tOrganizationsURL:  Ptr(\"o\"),\n\t\t\t\t\tReceivedEventsURL: Ptr(\"r\"),\n\t\t\t\t\tReposURL:          Ptr(\"r\"),\n\t\t\t\t\tSiteAdmin:         Ptr(false),\n\t\t\t\t\tStarredURL:        Ptr(\"s\"),\n\t\t\t\t\tSubscriptionsURL:  Ptr(\"s\"),\n\t\t\t\t\tType:              Ptr(\"User\"),\n\t\t\t\t\tURL:               Ptr(\"u\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tType: Ptr(\"Team\"),\n\t\t\t\tReviewer: &Team{\n\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t\tSlug: Ptr(\"s\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tEnterprise: &Enterprise{\n\t\t\tID:          Ptr(1),\n\t\t\tSlug:        Ptr(\"s\"),\n\t\t\tName:        Ptr(\"n\"),\n\t\t\tNodeID:      Ptr(\"nid\"),\n\t\t\tAvatarURL:   Ptr(\"au\"),\n\t\t\tDescription: Ptr(\"d\"),\n\t\t\tWebsiteURL:  Ptr(\"wu\"),\n\t\t\tHTMLURL:     Ptr(\"hu\"),\n\t\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\t\tUpdatedAt:   &Timestamp{referenceTime},\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t\tOrganization: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tSince: Ptr(\"s\"),\n\t\tWorkflowJobRun: &WorkflowJobRun{\n\t\t\tID:          Ptr(int64(1)),\n\t\t\tConclusion:  Ptr(\"c\"),\n\t\t\tEnvironment: Ptr(\"e\"),\n\t\t\tHTMLURL:     Ptr(\"h\"),\n\t\t\tName:        Ptr(\"n\"),\n\t\t\tStatus:      Ptr(\"s\"),\n\t\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\t\tUpdatedAt:   &Timestamp{referenceTime},\n\t\t},\n\t\tWorkflowRun: &WorkflowRun{\n\t\t\tID:         Ptr(int64(1)),\n\t\t\tName:       Ptr(\"n\"),\n\t\t\tNodeID:     Ptr(\"nid\"),\n\t\t\tHeadBranch: Ptr(\"hb\"),\n\t\t\tHeadSHA:    Ptr(\"hs\"),\n\t\t\tRunNumber:  Ptr(1),\n\t\t\tRunAttempt: Ptr(1),\n\t\t\tEvent:      Ptr(\"e\"),\n\t\t\tStatus:     Ptr(\"s\"),\n\t\t\tConclusion: Ptr(\"c\"),\n\t\t\tWorkflowID: Ptr(int64(1)),\n\t\t\tURL:        Ptr(\"u\"),\n\t\t\tHTMLURL:    Ptr(\"h\"),\n\t\t\tPullRequests: []*PullRequest{\n\t\t\t\t{\n\t\t\t\t\tURL:    Ptr(\"u\"),\n\t\t\t\t\tID:     Ptr(int64(1)),\n\t\t\t\t\tNumber: Ptr(1),\n\t\t\t\t\tHead: &PullRequestBranch{\n\t\t\t\t\t\tRef: Ptr(\"r\"),\n\t\t\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\t\t\tRepo: &Repository{\n\t\t\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\t\t\tURL:  Ptr(\"s\"),\n\t\t\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tBase: &PullRequestBranch{\n\t\t\t\t\t\tRef: Ptr(\"r\"),\n\t\t\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\t\t\tRepo: &Repository{\n\t\t\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\t\t\tURL:  Ptr(\"u\"),\n\t\t\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tCreatedAt:          &Timestamp{referenceTime},\n\t\t\tUpdatedAt:          &Timestamp{referenceTime},\n\t\t\tRunStartedAt:       &Timestamp{referenceTime},\n\t\t\tJobsURL:            Ptr(\"j\"),\n\t\t\tLogsURL:            Ptr(\"l\"),\n\t\t\tCheckSuiteURL:      Ptr(\"c\"),\n\t\t\tArtifactsURL:       Ptr(\"a\"),\n\t\t\tCancelURL:          Ptr(\"c\"),\n\t\t\tRerunURL:           Ptr(\"r\"),\n\t\t\tPreviousAttemptURL: Ptr(\"p\"),\n\t\t\tHeadCommit: &HeadCommit{\n\t\t\t\tMessage: Ptr(\"m\"),\n\t\t\t\tAuthor: &CommitAuthor{\n\t\t\t\t\tName:  Ptr(\"n\"),\n\t\t\t\t\tEmail: Ptr(\"e\"),\n\t\t\t\t\tLogin: Ptr(\"l\"),\n\t\t\t\t},\n\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\tDistinct:  Ptr(false),\n\t\t\t\tSHA:       Ptr(\"s\"),\n\t\t\t\tID:        Ptr(\"i\"),\n\t\t\t\tTreeID:    Ptr(\"tid\"),\n\t\t\t\tTimestamp: &Timestamp{referenceTime},\n\t\t\t\tCommitter: &CommitAuthor{\n\t\t\t\t\tName:  Ptr(\"n\"),\n\t\t\t\t\tEmail: Ptr(\"e\"),\n\t\t\t\t\tLogin: Ptr(\"l\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tWorkflowURL: Ptr(\"w\"),\n\t\t\tRepository: &Repository{\n\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\tURL:  Ptr(\"u\"),\n\t\t\t\tName: Ptr(\"n\"),\n\t\t\t},\n\t\t\tHeadRepository: &Repository{\n\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\tURL:  Ptr(\"u\"),\n\t\t\t\tName: Ptr(\"n\"),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"requester\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"html_url\": \"h\",\n\t\t\t\"followers_url\": \"f\",\n\t\t\t\"following_url\": \"f\",\n\t\t\t\"gists_url\": \"g\",\n\t\t\t\"starred_url\": \"s\",\n\t\t\t\"subscriptions_url\": \"s\",\n\t\t\t\"organizations_url\": \"o\",\n\t\t\t\"repos_url\": \"r\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"received_events_url\": \"r\",\n\t\t\t\"type\": \"User\",\n\t\t\t\"site_admin\": false,\n\t\t\t\"name\": \"n\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"gravatar_id\": \"g\"\n\t\t},\n\t\t\"reviewers\": [\n\t\t\t{\n\t\t\t\t\"type\": \"User\",\n\t\t\t\t\"reviewer\": {\n\t\t\t\t\t\"login\": \"l\",\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\t\"url\": \"u\",\n\t\t\t\t\t\"html_url\": \"h\",\n\t\t\t\t\t\"followers_url\": \"f\",\n\t\t\t\t\t\"following_url\": \"f\",\n\t\t\t\t\t\"gists_url\": \"g\",\n\t\t\t\t\t\"starred_url\": \"s\",\n\t\t\t\t\t\"subscriptions_url\": \"s\",\n\t\t\t\t\t\"organizations_url\": \"o\",\n\t\t\t\t\t\"repos_url\": \"r\",\n\t\t\t\t\t\"events_url\": \"e\",\n\t\t\t\t\t\"received_events_url\": \"r\",\n\t\t\t\t\t\"type\": \"User\",\n\t\t\t\t\t\"site_admin\": false,\n\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\"email\": \"e\",\n\t\t\t\t\t\"gravatar_id\": \"g\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\": \"Team\",\n\t\t\t\t\"reviewer\": {\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\"slug\": \"s\"\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n        \"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"environment\": \"e\",\n        \"enterprise\": {\n\t\t\t\"id\": 1,\n\t\t\t\"slug\": \"s\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"avatar_url\": \"au\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"website_url\": \"wu\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n        \"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"since\": \"s\",\n\t\t\"workflow_job_run\": {\n\t\t\t\"conclusion\": \"c\",\n\t\t\t\"created_at\": \"2006-01-02T15:04:05Z\",\n\t\t\t\"environment\": \"e\",\n\t\t\t\"html_url\": \"h\",\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"status\": \"s\",\n\t\t\t\"updated_at\": \"2006-01-02T15:04:05Z\"\n\t\t},\n\t\t\"workflow_run\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"head_branch\": \"hb\",\n\t\t\t\"head_sha\": \"hs\",\n\t\t\t\"run_number\": 1,\n\t\t\t\"run_attempt\": 1,\n\t\t\t\"event\": \"e\",\n\t\t\t\"status\": \"s\",\n\t\t\t\"conclusion\": \"c\",\n\t\t\t\"workflow_id\": 1,\n\t\t\t\"url\": \"u\",\n\t\t\t\"html_url\": \"h\",\n\t\t\t\"pull_requests\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"number\": 1,\n\t\t\t\t\t\"url\": \"u\",\n\t\t\t\t\t\"head\": {\n\t\t\t\t\t\t\"ref\": \"r\",\n\t\t\t\t\t\t\"sha\": \"s\",\n\t\t\t\t\t\t\"repo\": {\n\t\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\t\t\"url\": \"s\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"base\": {\n\t\t\t\t\t\t\"ref\": \"r\",\n\t\t\t\t\t\t\"sha\": \"s\",\n\t\t\t\t\t\t\"repo\": {\n\t\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\t\t\"url\": \"u\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"run_started_at\": ` + referenceTimeStr + `,\n\t\t\t\"jobs_url\": \"j\",\n\t\t\t\"logs_url\": \"l\",\n\t\t\t\"check_suite_url\": \"c\",\n\t\t\t\"artifacts_url\": \"a\",\n\t\t\t\"cancel_url\": \"c\",\n\t\t\t\"rerun_url\": \"r\",\n\t\t\t\"previous_attempt_url\": \"p\",\n\t\t\t\"head_commit\": {\n\t\t\t\t\"message\": \"m\",\n\t\t\t\t\"author\": {\n\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\"email\": \"e\",\n\t\t\t\t\t\"username\": \"l\"\n\t\t\t\t},\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"distinct\": false,\n\t\t\t\t\"sha\": \"s\",\n\t\t\t\t\"id\": \"i\",\n\t\t\t\t\"tree_id\": \"tid\",\n\t\t\t\t\"timestamp\": ` + referenceTimeStr + `,\n\t\t\t\t\"committer\": {\n\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\"email\": \"e\",\n\t\t\t\t\t\"username\": \"l\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"workflow_url\": \"w\",\n\t\t\t\"repository\": {\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"head_repository\": {\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"url\": \"u\"\n\t\t\t}\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestDeploymentStatusEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &DeploymentStatusEvent{}, \"{}\")\n\n\tl := make(map[string]any)\n\tl[\"key\"] = \"value\"\n\n\tjsonMsg, _ := json.Marshal(&l)\n\n\tu := &DeploymentStatusEvent{\n\t\tDeployment: &Deployment{\n\t\t\tURL:         Ptr(\"url\"),\n\t\t\tID:          Ptr(int64(1)),\n\t\t\tSHA:         Ptr(\"sha\"),\n\t\t\tRef:         Ptr(\"ref\"),\n\t\t\tTask:        Ptr(\"t\"),\n\t\t\tPayload:     jsonMsg,\n\t\t\tEnvironment: Ptr(\"e\"),\n\t\t\tDescription: Ptr(\"d\"),\n\t\t\tCreator: &User{\n\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t},\n\t\t\tCreatedAt:     &Timestamp{referenceTime},\n\t\t\tUpdatedAt:     &Timestamp{referenceTime},\n\t\t\tStatusesURL:   Ptr(\"surl\"),\n\t\t\tRepositoryURL: Ptr(\"rurl\"),\n\t\t\tNodeID:        Ptr(\"nid\"),\n\t\t},\n\t\tDeploymentStatus: &DeploymentStatus{\n\t\t\tID:    Ptr(int64(1)),\n\t\t\tState: Ptr(\"s\"),\n\t\t\tCreator: &User{\n\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t},\n\t\t\tDescription:    Ptr(\"s\"),\n\t\t\tEnvironment:    Ptr(\"s\"),\n\t\t\tNodeID:         Ptr(\"s\"),\n\t\t\tCreatedAt:      &Timestamp{referenceTime},\n\t\t\tUpdatedAt:      &Timestamp{referenceTime},\n\t\t\tTargetURL:      Ptr(\"s\"),\n\t\t\tDeploymentURL:  Ptr(\"s\"),\n\t\t\tRepositoryURL:  Ptr(\"s\"),\n\t\t\tEnvironmentURL: Ptr(\"s\"),\n\t\t\tLogURL:         Ptr(\"s\"),\n\t\t\tURL:            Ptr(\"s\"),\n\t\t},\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"deployment\": {\n\t\t\t\"url\": \"url\",\n\t\t\t\"id\": 1,\n\t\t\t\"sha\": \"sha\",\n\t\t\t\"ref\": \"ref\",\n\t\t\t\"task\": \"t\",\n\t\t\t\"payload\": {\n\t\t\t\t\"key\": \"value\"\n\t\t\t},\n\t\t\t\"environment\": \"e\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"creator\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"events_url\": \"e\",\n\t\t\t\t\"repos_url\": \"r\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"statuses_url\": \"surl\",\n\t\t\t\"repository_url\": \"rurl\",\n\t\t\t\"node_id\": \"nid\"\n\t\t},\n\t\t\"deployment_status\": {\n\t\t\t\"id\": 1,\n\t\t\t\"state\": \"s\",\n\t\t\t\"creator\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"events_url\": \"e\",\n\t\t\t\t\"repos_url\": \"r\"\n\t\t\t},\n\t\t\t\"description\": \"s\",\n\t\t\t\"environment\": \"s\",\n\t\t\t\"node_id\": \"s\",\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"target_url\": \"s\",\n\t\t\t\"deployment_url\": \"s\",\n\t\t\t\"repository_url\": \"s\",\n\t\t\t\"environment_url\": \"s\",\n\t\t\t\"log_url\": \"s\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want, cmpJSONRawMessageComparator())\n}\n\nfunc TestDiscussionCommentEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &DiscussionCommentEvent{}, \"{}\")\n\n\tu := &DiscussionCommentEvent{\n\t\tComment: &CommentDiscussion{\n\t\t\tAuthorAssociation: Ptr(\"aa\"),\n\t\t\tBody:              Ptr(\"bo\"),\n\t\t\tChildCommentCount: Ptr(1),\n\t\t\tCreatedAt:         &Timestamp{referenceTime},\n\t\t\tDiscussionID:      Ptr(int64(1)),\n\t\t\tHTMLURL:           Ptr(\"hurl\"),\n\t\t\tID:                Ptr(int64(1)),\n\t\t\tNodeID:            Ptr(\"nid\"),\n\t\t\tParentID:          Ptr(int64(1)),\n\t\t\tReactions: &Reactions{\n\t\t\t\tTotalCount: Ptr(1),\n\t\t\t\tPlusOne:    Ptr(1),\n\t\t\t\tMinusOne:   Ptr(1),\n\t\t\t\tLaugh:      Ptr(1),\n\t\t\t\tConfused:   Ptr(1),\n\t\t\t\tHeart:      Ptr(1),\n\t\t\t\tHooray:     Ptr(1),\n\t\t\t\tRocket:     Ptr(1),\n\t\t\t\tEyes:       Ptr(1),\n\t\t\t\tURL:        Ptr(\"url\"),\n\t\t\t},\n\t\t\tRepositoryURL: Ptr(\"rurl\"),\n\t\t\tUpdatedAt:     &Timestamp{referenceTime},\n\t\t\tUser: &User{\n\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t},\n\t\t},\n\t\tDiscussion: &Discussion{\n\t\t\tRepositoryURL: Ptr(\"rurl\"),\n\t\t\tDiscussionCategory: &DiscussionCategory{\n\t\t\t\tID:           Ptr(int64(1)),\n\t\t\t\tNodeID:       Ptr(\"nid\"),\n\t\t\t\tRepositoryID: Ptr(int64(1)),\n\t\t\t\tEmoji:        Ptr(\"emoji\"),\n\t\t\t\tName:         Ptr(\"name\"),\n\t\t\t\tDescription:  Ptr(\"description\"),\n\t\t\t\tCreatedAt:    &Timestamp{referenceTime},\n\t\t\t\tUpdatedAt:    &Timestamp{referenceTime},\n\t\t\t\tSlug:         Ptr(\"slug\"),\n\t\t\t\tIsAnswerable: Ptr(false),\n\t\t\t},\n\t\t\tHTMLURL: Ptr(\"hurl\"),\n\t\t\tID:      Ptr(int64(1)),\n\t\t\tNodeID:  Ptr(\"nurl\"),\n\t\t\tNumber:  Ptr(1),\n\t\t\tTitle:   Ptr(\"title\"),\n\t\t\tUser: &User{\n\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t},\n\t\t\tState:             Ptr(\"st\"),\n\t\t\tLocked:            Ptr(false),\n\t\t\tComments:          Ptr(1),\n\t\t\tCreatedAt:         &Timestamp{referenceTime},\n\t\t\tUpdatedAt:         &Timestamp{referenceTime},\n\t\t\tAuthorAssociation: Ptr(\"aa\"),\n\t\t\tBody:              Ptr(\"bo\"),\n\t\t},\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tOrg: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"comment\": {\n\t\t\t\"author_association\": \"aa\",\n\t\t\t\"body\": \"bo\",\n\t\t\t\"child_comment_count\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"discussion_id\": 1,\n\t\t\t\"html_url\": \"hurl\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"parent_id\": 1,\n\t\t\t\"reactions\": {\n\t\t\t\t\"total_count\": 1,\n\t\t\t\t\"+1\": 1,\n\t\t\t\t\"-1\": 1,\n\t\t\t\t\"laugh\": 1,\n\t\t\t\t\"confused\": 1,\n\t\t\t\t\"heart\": 1,\n\t\t\t\t\"hooray\": 1,\n\t\t\t\t\"rocket\": 1,\n\t\t\t\t\"eyes\": 1,\n\t\t\t\t\"url\": \"url\"\n\t\t\t},\n\t\t\t\"repository_url\": \"rurl\",\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"user\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"events_url\": \"e\",\n\t\t\t\t\"repos_url\": \"r\"\n\t\t\t}\n\t\t},\n\t\t\"discussion\": {\n\t\t\t\"repository_url\": \"rurl\",\n\t\t\t\"category\": {\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"nid\",\n\t\t\t\t\"repository_id\": 1,\n\t\t\t\t\"emoji\": \"emoji\",\n\t\t\t\t\"name\": \"name\",\n\t\t\t\t\"description\": \"description\",\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"slug\": \"slug\",\n\t\t\t\t\"is_answerable\": false\n\t\t\t},\n\t\t\t\"html_url\": \"hurl\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nurl\",\n\t\t\t\"number\": 1,\n\t\t\t\"title\": \"title\",\n\t\t\t\"user\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"events_url\": \"e\",\n\t\t\t\t\"repos_url\": \"r\"\n\t\t\t},\n\t\t\t\"state\": \"st\",\n\t\t\t\"locked\": false,\n\t\t\t\"comments\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"author_association\": \"aa\",\n\t\t\t\"body\": \"bo\"\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestDiscussionEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &DiscussionEvent{}, \"{}\")\n\n\tu := &DiscussionEvent{\n\t\tDiscussion: &Discussion{\n\t\t\tRepositoryURL: Ptr(\"rurl\"),\n\t\t\tDiscussionCategory: &DiscussionCategory{\n\t\t\t\tID:           Ptr(int64(1)),\n\t\t\t\tNodeID:       Ptr(\"nid\"),\n\t\t\t\tRepositoryID: Ptr(int64(1)),\n\t\t\t\tEmoji:        Ptr(\"emoji\"),\n\t\t\t\tName:         Ptr(\"name\"),\n\t\t\t\tDescription:  Ptr(\"description\"),\n\t\t\t\tCreatedAt:    &Timestamp{referenceTime},\n\t\t\t\tUpdatedAt:    &Timestamp{referenceTime},\n\t\t\t\tSlug:         Ptr(\"slug\"),\n\t\t\t\tIsAnswerable: Ptr(false),\n\t\t\t},\n\t\t\tHTMLURL: Ptr(\"hurl\"),\n\t\t\tID:      Ptr(int64(1)),\n\t\t\tNodeID:  Ptr(\"nurl\"),\n\t\t\tNumber:  Ptr(1),\n\t\t\tTitle:   Ptr(\"title\"),\n\t\t\tUser: &User{\n\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t},\n\t\t\tState:             Ptr(\"st\"),\n\t\t\tLocked:            Ptr(false),\n\t\t\tComments:          Ptr(1),\n\t\t\tCreatedAt:         &Timestamp{referenceTime},\n\t\t\tUpdatedAt:         &Timestamp{referenceTime},\n\t\t\tAuthorAssociation: Ptr(\"aa\"),\n\t\t\tBody:              Ptr(\"bo\"),\n\t\t},\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tOrg: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"discussion\": {\n\t\t\t\"repository_url\": \"rurl\",\n\t\t\t\"category\": {\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"nid\",\n\t\t\t\t\"repository_id\": 1,\n\t\t\t\t\"emoji\": \"emoji\",\n\t\t\t\t\"name\": \"name\",\n\t\t\t\t\"description\": \"description\",\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"slug\": \"slug\",\n\t\t\t\t\"is_answerable\": false\n\t\t\t},\n\t\t\t\"html_url\": \"hurl\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nurl\",\n\t\t\t\"number\": 1,\n\t\t\t\"title\": \"title\",\n\t\t\t\"user\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"events_url\": \"e\",\n\t\t\t\t\"repos_url\": \"r\"\n\t\t\t},\n\t\t\t\"state\": \"st\",\n\t\t\t\"locked\": false,\n\t\t\t\"comments\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"author_association\": \"aa\",\n\t\t\t\"body\": \"bo\"\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPackageEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PackageEvent{}, \"{}\")\n\n\tu := &PackageEvent{\n\t\tAction: Ptr(\"a\"),\n\t\tPackage: &Package{\n\t\t\tID:          Ptr(int64(1)),\n\t\t\tName:        Ptr(\"n\"),\n\t\t\tPackageType: Ptr(\"pt\"),\n\t\t\tHTMLURL:     Ptr(\"hurl\"),\n\t\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\t\tUpdatedAt:   &Timestamp{referenceTime},\n\t\t\tOwner: &User{\n\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t},\n\t\t\tPackageVersion: &PackageVersion{ID: Ptr(int64(1))},\n\t\t\tRegistry:       &PackageRegistry{Name: Ptr(\"n\")},\n\t\t},\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tOrg: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"package\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"package_type\": \"pt\",\n\t\t\t\"html_url\": \"hurl\",\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"owner\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"events_url\": \"e\",\n\t\t\t\t\"repos_url\": \"r\"\n\t\t\t},\n\t\t\t\"package_version\": {\n\t\t\t\t\"id\": 1\n\t\t\t},\n\t\t\t\"registry\": {\n\t\t\t\t\"name\": \"n\"\n\t\t\t}\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPersonalAccessTokenRequestEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PersonalAccessTokenRequestEvent{}, \"{}\")\n\n\tevent := &PersonalAccessTokenRequestEvent{\n\t\tAction: Ptr(\"a\"),\n\t\tPersonalAccessTokenRequest: &PersonalAccessTokenRequest{\n\t\t\tID:    Ptr(int64(1)),\n\t\t\tOwner: &User{Login: Ptr(\"l\")},\n\t\t\tPermissionsAdded: &PersonalAccessTokenPermissions{\n\t\t\t\tOrg:  map[string]string{\"organization_events\": \"read\"},\n\t\t\t\tRepo: map[string]string{\"security_events\": \"write\"},\n\t\t\t},\n\t\t\tCreatedAt:           &Timestamp{referenceTime},\n\t\t\tTokenExpired:        Ptr(false),\n\t\t\tTokenExpiresAt:      &Timestamp{referenceTime},\n\t\t\tTokenLastUsedAt:     &Timestamp{referenceTime},\n\t\t\tRepositoryCount:     Ptr(int64(1)),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tRepositories: []*Repository{\n\t\t\t\t{\n\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tOrg: &Organization{Name: Ptr(\"n\")},\n\t\tSender: &User{\n\t\t\tLogin: Ptr(\"l\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID: Ptr(int64(1)),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"personal_access_token_request\": {\n\t\t\t\"id\": 1,\n\t\t\t\"owner\": {\n\t\t\t\t\"login\": \"l\"\n\t\t\t},\n\t\t\t\"permissions_added\": {\n\t\t\t\t\"organization\": {\n\t\t\t\t\t\"organization_events\": \"read\"\n\t\t\t\t},\n\t\t\t\t\"repository\": {\n\t\t\t\t\t\"security_events\": \"write\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"token_expired\": false,\n\t\t\t\"token_expires_at\": ` + referenceTimeStr + `,\n\t\t\t\"token_last_used_at\": ` + referenceTimeStr + `,\n\t\t\t\"repository_count\": 1,\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"repositories\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"n\"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\"\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, event, want)\n}\n\nfunc TestPingEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PingEvent{}, \"{}\")\n\n\tl := make(map[string]any)\n\tl[\"key\"] = \"value\"\n\n\tu := &PingEvent{\n\t\tZen:    Ptr(\"z\"),\n\t\tHookID: Ptr(int64(1)),\n\t\tHook: &Hook{\n\t\t\tCreatedAt:    &Timestamp{referenceTime},\n\t\t\tUpdatedAt:    &Timestamp{referenceTime},\n\t\t\tURL:          Ptr(\"url\"),\n\t\t\tID:           Ptr(int64(1)),\n\t\t\tType:         Ptr(\"t\"),\n\t\t\tName:         Ptr(\"n\"),\n\t\t\tTestURL:      Ptr(\"tu\"),\n\t\t\tPingURL:      Ptr(\"pu\"),\n\t\t\tLastResponse: l,\n\t\t\tConfig:       &HookConfig{},\n\t\t\tEvents:       []string{\"a\"},\n\t\t\tActive:       Ptr(true),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"zen\": \"z\",\n\t\t\"hook_id\": 1,\n\t\t\"hook\": {\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"url\",\n\t\t\t\"id\": 1,\n\t\t\t\"type\": \"t\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"test_url\": \"tu\",\n\t\t\t\"ping_url\": \"pu\",\n\t\t\t\"last_response\": {\n\t\t\t\t\"key\": \"value\"\n\t\t\t},\n\t\t\t\"config\": {\n\t\t\t},\n\t\t\t\"events\": [\n\t\t\t\t\"a\"\n\t\t\t],\n\t\t\t\"active\": true\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestRegistryPackageEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RegistryPackageEvent{}, \"{}\")\n\n\tu := &RegistryPackageEvent{\n\t\tAction: Ptr(\"a\"),\n\t\tRegistryPackage: &Package{\n\t\t\tID:          Ptr(int64(1)),\n\t\t\tName:        Ptr(\"n\"),\n\t\t\tPackageType: Ptr(\"pt\"),\n\t\t\tHTMLURL:     Ptr(\"hurl\"),\n\t\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\t\tUpdatedAt:   &Timestamp{referenceTime},\n\t\t\tOwner: &User{\n\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t},\n\t\t\tPackageVersion: &PackageVersion{ID: Ptr(int64(1))},\n\t\t\tRegistry:       &PackageRegistry{Name: Ptr(\"n\")},\n\t\t},\n\t\tRepository: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tOrganization: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"registry_package\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"package_type\": \"pt\",\n\t\t\t\"html_url\": \"hurl\",\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"owner\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"events_url\": \"e\",\n\t\t\t\t\"repos_url\": \"r\"\n\t\t\t},\n\t\t\t\"package_version\": {\n\t\t\t\t\"id\": 1\n\t\t\t},\n\t\t\t\"registry\": {\n\t\t\t\t\"name\": \"n\"\n\t\t\t}\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestRepositoryDispatchEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RepositoryDispatchEvent{}, \"{}\")\n\n\tl := make(map[string]any)\n\tl[\"key\"] = \"value\"\n\n\tjsonMsg, _ := json.Marshal(&l)\n\n\tu := &RepositoryDispatchEvent{\n\t\tAction:        Ptr(\"a\"),\n\t\tBranch:        Ptr(\"b\"),\n\t\tClientPayload: jsonMsg,\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tOrg: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"branch\": \"b\",\n\t\t\"client_payload\": {\n\t\t\t\"key\": \"value\"\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want, cmpJSONRawMessageComparator())\n}\n\nfunc TestRepositoryImportEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RepositoryImportEvent{}, \"{}\")\n\n\tu := &RepositoryImportEvent{\n\t\tStatus: Ptr(\"success\"),\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tOrg: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"status\": \"success\",\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestRepositoryEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RepositoryEvent{}, \"{}\")\n\n\tu := &RepositoryEvent{\n\t\tAction: Ptr(\"a\"),\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tOrg: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestReleaseEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ReleaseEvent{}, \"{}\")\n\n\tu := &ReleaseEvent{\n\t\tAction: Ptr(\"a\"),\n\t\tRelease: &RepositoryRelease{\n\t\t\tName:                   Ptr(\"n\"),\n\t\t\tDiscussionCategoryName: Ptr(\"dcn\"),\n\t\t\tID:                     Ptr(int64(2)),\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tPublishedAt:            &Timestamp{referenceTime},\n\t\t\tURL:                    Ptr(\"url\"),\n\t\t\tHTMLURL:                Ptr(\"htmlurl\"),\n\t\t\tAssetsURL:              Ptr(\"assetsurl\"),\n\t\t\tAssets:                 []*ReleaseAsset{{ID: Ptr(int64(1))}},\n\t\t\tUploadURL:              Ptr(\"uploadurl\"),\n\t\t\tZipballURL:             Ptr(\"zipballurl\"),\n\t\t\tTarballURL:             Ptr(\"tarballurl\"),\n\t\t\tAuthor:                 &User{Name: Ptr(\"octocat\")},\n\t\t\tNodeID:                 Ptr(\"nid\"),\n\t\t},\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"release\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"discussion_category_name\": \"dcn\",\n\t\t\t\"id\": 2,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"published_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"url\",\n\t\t\t\"html_url\": \"htmlurl\",\n\t\t\t\"assets_url\": \"assetsurl\",\n\t\t\t\"assets\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": 1\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"upload_url\": \"uploadurl\",\n\t\t\t\"zipball_url\": \"zipballurl\",\n\t\t\t\"tarball_url\": \"tarballurl\",\n\t\t\t\"author\": {\n\t\t\t\t\"name\": \"octocat\"\n\t\t\t},\n\t\t\t\"node_id\": \"nid\"\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestRepositoryRulesetEvent_Unmarshal(t *testing.T) {\n\tt.Parallel()\n\n\tenterprise := &Enterprise{\n\t\tID:     Ptr(1),\n\t\tNodeID: Ptr(\"n\"),\n\t\tSlug:   Ptr(\"e\"),\n\t\tName:   Ptr(\"e\"),\n\t}\n\n\tinstallation := &Installation{\n\t\tID:      Ptr(int64(1)),\n\t\tNodeID:  Ptr(\"n\"),\n\t\tAppID:   Ptr(int64(1)),\n\t\tAppSlug: Ptr(\"a\"),\n\t}\n\n\torganization := &Organization{\n\t\tID:     Ptr(int64(1)),\n\t\tNodeID: Ptr(\"n\"),\n\t\tName:   Ptr(\"o\"),\n\t}\n\n\trepository := &Repository{\n\t\tID:       Ptr(int64(1)),\n\t\tNodeID:   Ptr(\"n\"),\n\t\tName:     Ptr(\"r\"),\n\t\tFullName: Ptr(\"o/r\"),\n\t}\n\n\tsender := &User{\n\t\tID:     Ptr(int64(1)),\n\t\tNodeID: Ptr(\"n\"),\n\t\tLogin:  Ptr(\"l\"),\n\t}\n\n\ttests := []struct {\n\t\tname  string\n\t\tjson  string\n\t\tevent *RepositoryRulesetEvent\n\t}{\n\t\t{\"empty\", `{}`, &RepositoryRulesetEvent{}},\n\t\t{\n\t\t\t\"created\",\n\t\t\tfmt.Sprintf(\n\t\t\t\t`{\"action\":\"created\",\"repository_ruleset\":{\"id\":1,\"name\":\"r\",\"target\":\"branch\",\"source_type\":\"Repository\",\"source\":\"o/r\",\"enforcement\":\"active\",\"conditions\":{\"ref_name\":{\"exclude\":[],\"include\":[\"~ALL\"]}},\"rules\":[{\"type\":\"deletion\"},{\"type\":\"creation\"},{\"type\":\"update\"},{\"type\":\"required_linear_history\"},{\"type\":\"pull_request\",\"parameters\":{\"required_approving_review_count\":2,\"dismiss_stale_reviews_on_push\":false,\"require_code_owner_review\":false,\"require_last_push_approval\":false,\"required_review_thread_resolution\":false,\"allowed_merge_methods\":[\"squash\",\"rebase\",\"merge\"]}},{\"type\":\"code_scanning\",\"parameters\":{\"code_scanning_tools\":[{\"tool\":\"CodeQL\",\"security_alerts_threshold\":\"high_or_higher\",\"alerts_threshold\":\"errors\"}]}}],\"node_id\":\"n\",\"created_at\":%[1]s,\"updated_at\":%[1]s,\"_links\":{\"self\":{\"href\":\"a\"},\"html\":{\"href\":\"a\"}}},\"repository\":{\"id\":1,\"node_id\":\"n\",\"name\":\"r\",\"full_name\":\"o/r\"},\"organization\":{\"id\":1,\"node_id\":\"n\",\"name\":\"o\"},\"enterprise\":{\"id\":1,\"node_id\":\"n\",\"slug\":\"e\",\"name\":\"e\"},\"installation\":{\"id\":1,\"node_id\":\"n\",\"app_id\":1,\"app_slug\":\"a\"},\"sender\":{\"id\":1,\"node_id\":\"n\",\"login\":\"l\"}}`,\n\t\t\t\treferenceTimeStr,\n\t\t\t),\n\t\t\t&RepositoryRulesetEvent{\n\t\t\t\tAction: Ptr(\"created\"),\n\t\t\t\tRepositoryRuleset: &RepositoryRuleset{\n\t\t\t\t\tID:          Ptr(int64(1)),\n\t\t\t\t\tName:        \"r\",\n\t\t\t\t\tTarget:      Ptr(RulesetTargetBranch),\n\t\t\t\t\tSourceType:  Ptr(RulesetSourceTypeRepository),\n\t\t\t\t\tSource:      \"o/r\",\n\t\t\t\t\tEnforcement: RulesetEnforcementActive,\n\t\t\t\t\tConditions: &RepositoryRulesetConditions{\n\t\t\t\t\t\tRefName: &RepositoryRulesetRefConditionParameters{\n\t\t\t\t\t\t\tInclude: []string{\"~ALL\"},\n\t\t\t\t\t\t\tExclude: []string{},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tRules: &RepositoryRulesetRules{\n\t\t\t\t\t\tCreation:              &EmptyRuleParameters{},\n\t\t\t\t\t\tUpdate:                &UpdateRuleParameters{},\n\t\t\t\t\t\tDeletion:              &EmptyRuleParameters{},\n\t\t\t\t\t\tRequiredLinearHistory: &EmptyRuleParameters{},\n\t\t\t\t\t\tPullRequest: &PullRequestRuleParameters{\n\t\t\t\t\t\t\tAllowedMergeMethods: []PullRequestMergeMethod{\n\t\t\t\t\t\t\t\tPullRequestMergeMethodSquash,\n\t\t\t\t\t\t\t\tPullRequestMergeMethodRebase,\n\t\t\t\t\t\t\t\tPullRequestMergeMethodMerge,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tDismissStaleReviewsOnPush:      false,\n\t\t\t\t\t\t\tRequireCodeOwnerReview:         false,\n\t\t\t\t\t\t\tRequireLastPushApproval:        false,\n\t\t\t\t\t\t\tRequiredApprovingReviewCount:   2,\n\t\t\t\t\t\t\tRequiredReviewThreadResolution: false,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tCodeScanning: &CodeScanningRuleParameters{\n\t\t\t\t\t\t\tCodeScanningTools: []*RuleCodeScanningTool{\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tAlertsThreshold:         CodeScanningAlertsThresholdErrors,\n\t\t\t\t\t\t\t\t\tSecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher,\n\t\t\t\t\t\t\t\t\tTool:                    \"CodeQL\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\t\tCreatedAt: &Timestamp{referenceTime},\n\t\t\t\t\tUpdatedAt: &Timestamp{referenceTime},\n\t\t\t\t\tLinks: &RepositoryRulesetLinks{\n\t\t\t\t\t\tSelf: &RepositoryRulesetLink{HRef: Ptr(\"a\")},\n\t\t\t\t\t\tHTML: &RepositoryRulesetLink{HRef: Ptr(\"a\")},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tRepository:   repository,\n\t\t\t\tOrganization: organization,\n\t\t\t\tEnterprise:   enterprise,\n\t\t\t\tInstallation: installation,\n\t\t\t\tSender:       sender,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t\"edited\",\n\t\t\tfmt.Sprintf(\n\t\t\t\t`{\"action\":\"edited\",\"repository_ruleset\":{\"id\":1,\"name\":\"r\",\"target\":\"branch\",\"source_type\":\"Repository\",\"source\":\"o/r\",\"enforcement\":\"active\",\"conditions\":{\"ref_name\":{\"exclude\":[],\"include\":[\"~DEFAULT_BRANCH\",\"refs/heads/dev-*\"]}},\"rules\":[{\"type\":\"deletion\"},{\"type\":\"creation\"},{\"type\":\"update\"},{\"type\": \"required_signatures\"},{\"type\":\"pull_request\",\"parameters\":{\"required_approving_review_count\":2,\"dismiss_stale_reviews_on_push\":false,\"require_code_owner_review\":false,\"require_last_push_approval\":false,\"required_review_thread_resolution\":false,\"allowed_merge_methods\":[\"squash\",\"rebase\"]}},{\"type\":\"code_scanning\",\"parameters\":{\"code_scanning_tools\":[{\"tool\":\"CodeQL\",\"security_alerts_threshold\":\"medium_or_higher\",\"alerts_threshold\":\"errors\"}]}}],\"node_id\":\"n\",\"created_at\":%[1]s,\"updated_at\":%[1]s,\"_links\":{\"self\":{\"href\":\"a\"},\"html\":{\"href\":\"a\"}}},\"changes\":{\"rules\":{\"added\":[{\"type\": \"required_signatures\"}],\"updated\":[{\"rule\":{\"type\":\"pull_request\",\"parameters\":{\"required_approving_review_count\":2,\"dismiss_stale_reviews_on_push\":false,\"require_code_owner_review\":false,\"require_last_push_approval\":false,\"required_review_thread_resolution\":false,\"allowed_merge_methods\":[\"squash\",\"rebase\"]}},\"changes\":{\"configuration\":{\"from\":\"{\\\\\\\"required_reviewers\\\\\\\":[],\\\\\\\"allowed_merge_methods\\\\\\\":[\\\\\\\"squash\\\\\\\",\\\\\\\"rebase\\\\\\\",\\\\\\\"merge\\\\\\\"],\\\\\\\"require_code_owner_review\\\\\\\":false,\\\\\\\"require_last_push_approval\\\\\\\":false,\\\\\\\"dismiss_stale_reviews_on_push\\\\\\\":false,\\\\\\\"required_approving_review_count\\\\\\\":2,\\\\\\\"authorized_dismissal_actors_only\\\\\\\":false,\\\\\\\"required_review_thread_resolution\\\\\\\":false,\\\\\\\"ignore_approvals_from_contributors\\\\\\\":false}\"}}},{\"rule\":{\"type\":\"code_scanning\",\"parameters\":{\"code_scanning_tools\":[{\"tool\":\"CodeQL\",\"security_alerts_threshold\":\"medium_or_higher\",\"alerts_threshold\":\"errors\"}]}},\"changes\":{\"configuration\":{\"from\":\"{\\\\\\\"code_scanning_tools\\\\\\\":[{\\\\\\\"tool\\\\\\\":\\\\\\\"CodeQL\\\\\\\",\\\\\\\"alerts_threshold\\\\\\\":\\\\\\\"errors\\\\\\\",\\\\\\\"security_alerts_threshold\\\\\\\":\\\\\\\"high_or_higher\\\\\\\"}]}\"}}}],\"deleted\":[{\"type\":\"required_linear_history\"}]},\"conditions\":{\"updated\":[{\"condition\":{\"ref_name\":{\"exclude\":[],\"include\":[\"~DEFAULT_BRANCH\",\"refs/heads/dev-*\"]}},\"changes\":{\"include\":{\"from\":[\"~ALL\"]}}}],\"deleted\":[]}},\"repository\":{\"id\":1,\"node_id\":\"n\",\"name\":\"r\",\"full_name\":\"o/r\"},\"organization\":{\"id\":1,\"node_id\":\"n\",\"name\":\"o\"},\"enterprise\":{\"id\":1,\"node_id\":\"n\",\"slug\":\"e\",\"name\":\"e\"},\"installation\":{\"id\":1,\"node_id\":\"n\",\"app_id\":1,\"app_slug\":\"a\"},\"sender\":{\"id\":1,\"node_id\":\"n\",\"login\":\"l\"}}`,\n\t\t\t\treferenceTimeStr,\n\t\t\t),\n\t\t\t&RepositoryRulesetEvent{\n\t\t\t\tAction: Ptr(\"edited\"),\n\t\t\t\tRepositoryRuleset: &RepositoryRuleset{\n\t\t\t\t\tID:          Ptr(int64(1)),\n\t\t\t\t\tName:        \"r\",\n\t\t\t\t\tTarget:      Ptr(RulesetTargetBranch),\n\t\t\t\t\tSourceType:  Ptr(RulesetSourceTypeRepository),\n\t\t\t\t\tSource:      \"o/r\",\n\t\t\t\t\tEnforcement: RulesetEnforcementActive,\n\t\t\t\t\tConditions: &RepositoryRulesetConditions{\n\t\t\t\t\t\tRefName: &RepositoryRulesetRefConditionParameters{\n\t\t\t\t\t\t\tInclude: []string{\"~DEFAULT_BRANCH\", \"refs/heads/dev-*\"},\n\t\t\t\t\t\t\tExclude: []string{},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tRules: &RepositoryRulesetRules{\n\t\t\t\t\t\tCreation:           &EmptyRuleParameters{},\n\t\t\t\t\t\tUpdate:             &UpdateRuleParameters{},\n\t\t\t\t\t\tDeletion:           &EmptyRuleParameters{},\n\t\t\t\t\t\tRequiredSignatures: &EmptyRuleParameters{},\n\t\t\t\t\t\tPullRequest: &PullRequestRuleParameters{\n\t\t\t\t\t\t\tAllowedMergeMethods: []PullRequestMergeMethod{\n\t\t\t\t\t\t\t\tPullRequestMergeMethodSquash,\n\t\t\t\t\t\t\t\tPullRequestMergeMethodRebase,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tDismissStaleReviewsOnPush:      false,\n\t\t\t\t\t\t\tRequireCodeOwnerReview:         false,\n\t\t\t\t\t\t\tRequireLastPushApproval:        false,\n\t\t\t\t\t\t\tRequiredApprovingReviewCount:   2,\n\t\t\t\t\t\t\tRequiredReviewThreadResolution: false,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tCodeScanning: &CodeScanningRuleParameters{\n\t\t\t\t\t\t\tCodeScanningTools: []*RuleCodeScanningTool{\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tAlertsThreshold:         CodeScanningAlertsThresholdErrors,\n\t\t\t\t\t\t\t\t\tSecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdMediumOrHigher,\n\t\t\t\t\t\t\t\t\tTool:                    \"CodeQL\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\t\tCreatedAt: &Timestamp{referenceTime},\n\t\t\t\t\tUpdatedAt: &Timestamp{referenceTime},\n\t\t\t\t\tLinks: &RepositoryRulesetLinks{\n\t\t\t\t\t\tSelf: &RepositoryRulesetLink{HRef: Ptr(\"a\")},\n\t\t\t\t\t\tHTML: &RepositoryRulesetLink{HRef: Ptr(\"a\")},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tChanges: &RepositoryRulesetChanges{\n\t\t\t\t\tConditions: &RepositoryRulesetChangedConditions{\n\t\t\t\t\t\tUpdated: []*RepositoryRulesetUpdatedConditions{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tCondition: &RepositoryRulesetConditions{\n\t\t\t\t\t\t\t\t\tRefName: &RepositoryRulesetRefConditionParameters{\n\t\t\t\t\t\t\t\t\t\tInclude: []string{\"~DEFAULT_BRANCH\", \"refs/heads/dev-*\"},\n\t\t\t\t\t\t\t\t\t\tExclude: []string{},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tChanges: &RepositoryRulesetUpdatedCondition{\n\t\t\t\t\t\t\t\t\tInclude: &RepositoryRulesetChangeSources{\n\t\t\t\t\t\t\t\t\t\tFrom: []string{\"~ALL\"},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tDeleted: []*RepositoryRulesetConditions{},\n\t\t\t\t\t},\n\t\t\t\t\tRules: &RepositoryRulesetChangedRules{\n\t\t\t\t\t\tAdded: []*RepositoryRule{{Type: RulesetRuleTypeRequiredSignatures}},\n\t\t\t\t\t\tUpdated: []*RepositoryRulesetUpdatedRules{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tRule: &RepositoryRule{\n\t\t\t\t\t\t\t\t\tType: RulesetRuleTypePullRequest,\n\t\t\t\t\t\t\t\t\tParameters: &PullRequestRuleParameters{\n\t\t\t\t\t\t\t\t\t\tAllowedMergeMethods: []PullRequestMergeMethod{\n\t\t\t\t\t\t\t\t\t\t\tPullRequestMergeMethodSquash,\n\t\t\t\t\t\t\t\t\t\t\tPullRequestMergeMethodRebase,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tDismissStaleReviewsOnPush:      false,\n\t\t\t\t\t\t\t\t\t\tRequireCodeOwnerReview:         false,\n\t\t\t\t\t\t\t\t\t\tRequireLastPushApproval:        false,\n\t\t\t\t\t\t\t\t\t\tRequiredApprovingReviewCount:   2,\n\t\t\t\t\t\t\t\t\t\tRequiredReviewThreadResolution: false,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tChanges: &RepositoryRulesetChangedRule{\n\t\t\t\t\t\t\t\t\tConfiguration: &RepositoryRulesetChangeSource{\n\t\t\t\t\t\t\t\t\t\tFrom: Ptr(\n\t\t\t\t\t\t\t\t\t\t\t`{\\\"required_reviewers\\\":[],\\\"allowed_merge_methods\\\":[\\\"squash\\\",\\\"rebase\\\",\\\"merge\\\"],\\\"require_code_owner_review\\\":false,\\\"require_last_push_approval\\\":false,\\\"dismiss_stale_reviews_on_push\\\":false,\\\"required_approving_review_count\\\":2,\\\"authorized_dismissal_actors_only\\\":false,\\\"required_review_thread_resolution\\\":false,\\\"ignore_approvals_from_contributors\\\":false}`,\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tRule: &RepositoryRule{\n\t\t\t\t\t\t\t\t\tType: RulesetRuleTypeCodeScanning,\n\t\t\t\t\t\t\t\t\tParameters: &CodeScanningRuleParameters{\n\t\t\t\t\t\t\t\t\t\tCodeScanningTools: []*RuleCodeScanningTool{\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tAlertsThreshold:         CodeScanningAlertsThresholdErrors,\n\t\t\t\t\t\t\t\t\t\t\t\tSecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdMediumOrHigher,\n\t\t\t\t\t\t\t\t\t\t\t\tTool:                    \"CodeQL\",\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tChanges: &RepositoryRulesetChangedRule{\n\t\t\t\t\t\t\t\t\tConfiguration: &RepositoryRulesetChangeSource{\n\t\t\t\t\t\t\t\t\t\tFrom: Ptr(\n\t\t\t\t\t\t\t\t\t\t\t`{\\\"code_scanning_tools\\\":[{\\\"tool\\\":\\\"CodeQL\\\",\\\"alerts_threshold\\\":\\\"errors\\\",\\\"security_alerts_threshold\\\":\\\"high_or_higher\\\"}]}`,\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tDeleted: []*RepositoryRule{{Type: RulesetRuleTypeRequiredLinearHistory}},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tRepository:   repository,\n\t\t\t\tOrganization: organization,\n\t\t\t\tEnterprise:   enterprise,\n\t\t\t\tInstallation: installation,\n\t\t\t\tSender:       sender,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t\"deleted\",\n\t\t\tfmt.Sprintf(\n\t\t\t\t`{\"action\":\"deleted\",\"repository_ruleset\":{\"id\":1,\"name\":\"r\",\"target\":\"branch\",\"source_type\":\"Repository\",\"source\":\"o/r\",\"enforcement\":\"active\",\"conditions\":{\"ref_name\":{\"exclude\":[],\"include\":[\"~DEFAULT_BRANCH\",\"refs/heads/dev-*\"]}},\"rules\":[{\"type\":\"deletion\"},{\"type\":\"creation\"},{\"type\":\"update\"},{\"type\":\"required_linear_history\"}],\"node_id\":\"n\",\"created_at\":%[1]s,\"updated_at\":%[1]s,\"_links\":{\"self\":{\"href\":\"a\"},\"html\":{\"href\":\"a\"}}},\"repository\":{\"id\":1,\"node_id\":\"n\",\"name\":\"r\",\"full_name\":\"o/r\"},\"organization\":{\"id\":1,\"node_id\":\"n\",\"name\":\"o\"},\"enterprise\":{\"id\":1,\"node_id\":\"n\",\"slug\":\"e\",\"name\":\"e\"},\"installation\":{\"id\":1,\"node_id\":\"n\",\"app_id\":1,\"app_slug\":\"a\"},\"sender\":{\"id\":1,\"node_id\":\"n\",\"login\":\"l\"}}`,\n\t\t\t\treferenceTimeStr,\n\t\t\t),\n\t\t\t&RepositoryRulesetEvent{\n\t\t\t\tAction: Ptr(\"deleted\"),\n\t\t\t\tRepositoryRuleset: &RepositoryRuleset{\n\t\t\t\t\tID:          Ptr(int64(1)),\n\t\t\t\t\tName:        \"r\",\n\t\t\t\t\tTarget:      Ptr(RulesetTargetBranch),\n\t\t\t\t\tSourceType:  Ptr(RulesetSourceTypeRepository),\n\t\t\t\t\tSource:      \"o/r\",\n\t\t\t\t\tEnforcement: RulesetEnforcementActive,\n\t\t\t\t\tConditions: &RepositoryRulesetConditions{\n\t\t\t\t\t\tRefName: &RepositoryRulesetRefConditionParameters{\n\t\t\t\t\t\t\tInclude: []string{\"~DEFAULT_BRANCH\", \"refs/heads/dev-*\"},\n\t\t\t\t\t\t\tExclude: []string{},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tRules: &RepositoryRulesetRules{\n\t\t\t\t\t\tCreation:              &EmptyRuleParameters{},\n\t\t\t\t\t\tUpdate:                &UpdateRuleParameters{},\n\t\t\t\t\t\tDeletion:              &EmptyRuleParameters{},\n\t\t\t\t\t\tRequiredLinearHistory: &EmptyRuleParameters{},\n\t\t\t\t\t},\n\t\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\t\tCreatedAt: &Timestamp{referenceTime},\n\t\t\t\t\tUpdatedAt: &Timestamp{referenceTime},\n\t\t\t\t\tLinks: &RepositoryRulesetLinks{\n\t\t\t\t\t\tSelf: &RepositoryRulesetLink{HRef: Ptr(\"a\")},\n\t\t\t\t\t\tHTML: &RepositoryRulesetLink{HRef: Ptr(\"a\")},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tRepository:   repository,\n\t\t\t\tOrganization: organization,\n\t\t\t\tEnterprise:   enterprise,\n\t\t\t\tInstallation: installation,\n\t\t\t\tSender:       sender,\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\n\t\t\tgot := &RepositoryRulesetEvent{}\n\t\t\terr := json.Unmarshal([]byte(test.json), got)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Unable to unmarshal JSON %v: %v\", test.json, err)\n\t\t\t}\n\n\t\t\tif diff := cmp.Diff(test.event, got); diff != \"\" {\n\t\t\t\tt.Errorf(\"json.Unmarshal returned:\\n%#v\\nwant:\\n%#v\\ndiff:\\n%v\", got, test.event, diff)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestContentReferenceEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ContentReferenceEvent{}, \"{}\")\n\n\tu := &ContentReferenceEvent{\n\t\tAction: Ptr(\"a\"),\n\t\tContentReference: &ContentReference{\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"nid\"),\n\t\t\tReference: Ptr(\"ref\"),\n\t\t},\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"content_reference\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"reference\": \"ref\"\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestMemberEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &MemberEvent{}, \"{}\")\n\n\tu := &MemberEvent{\n\t\tAction: Ptr(\"a\"),\n\t\tMember: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tChanges: &MemberChanges{\n\t\t\tPermission: &MemberChangesPermission{\n\t\t\t\tFrom: Ptr(\"f\"),\n\t\t\t\tTo:   Ptr(\"t\"),\n\t\t\t},\n\t\t\tRoleName: &MemberChangesRoleName{\n\t\t\t\tFrom: Ptr(\"f\"),\n\t\t\t\tTo:   Ptr(\"t\"),\n\t\t\t},\n\t\t},\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"member\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"changes\": {\n\t\t\t\"permission\": {\n\t\t\t\t\"from\": \"f\",\n\t\t\t\t\"to\": \"t\"\n\t\t\t},\n\t\t\t\"role_name\": {\n\t\t\t\t\"from\": \"f\",\n\t\t\t\t\"to\": \"t\"\n\t\t\t}\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestMembershipEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &MembershipEvent{}, \"{}\")\n\n\tu := &MembershipEvent{\n\t\tAction: Ptr(\"a\"),\n\t\tScope:  Ptr(\"s\"),\n\t\tMember: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tTeam: &Team{\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tNodeID:          Ptr(\"n\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tDescription:     Ptr(\"d\"),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tSlug:            Ptr(\"s\"),\n\t\t\tPermission:      Ptr(\"p\"),\n\t\t\tPrivacy:         Ptr(\"p\"),\n\t\t\tMembersCount:    Ptr(1),\n\t\t\tReposCount:      Ptr(1),\n\t\t\tMembersURL:      Ptr(\"m\"),\n\t\t\tRepositoriesURL: Ptr(\"r\"),\n\t\t\tOrganization: &Organization{\n\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t\tHTMLURL:   Ptr(\"h\"),\n\t\t\t\tName:      Ptr(\"n\"),\n\t\t\t\tCompany:   Ptr(\"c\"),\n\t\t\t\tBlog:      Ptr(\"b\"),\n\t\t\t\tLocation:  Ptr(\"l\"),\n\t\t\t\tEmail:     Ptr(\"e\"),\n\t\t\t},\n\t\t\tParent: &Team{\n\t\t\t\tID:           Ptr(int64(1)),\n\t\t\t\tNodeID:       Ptr(\"n\"),\n\t\t\t\tName:         Ptr(\"n\"),\n\t\t\t\tDescription:  Ptr(\"d\"),\n\t\t\t\tURL:          Ptr(\"u\"),\n\t\t\t\tSlug:         Ptr(\"s\"),\n\t\t\t\tPermission:   Ptr(\"p\"),\n\t\t\t\tPrivacy:      Ptr(\"p\"),\n\t\t\t\tMembersCount: Ptr(1),\n\t\t\t\tReposCount:   Ptr(1),\n\t\t\t},\n\t\t\tLDAPDN: Ptr(\"l\"),\n\t\t},\n\t\tOrg: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"scope\": \"s\",\n\t\t\"member\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"team\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"slug\": \"s\",\n\t\t\t\"permission\": \"p\",\n\t\t\t\"privacy\": \"p\",\n\t\t\t\"members_count\": 1,\n\t\t\t\"repos_count\": 1,\n\t\t\t\"organization\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"html_url\": \"h\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\"\n\t\t\t},\n\t\t\t\"members_url\": \"m\",\n\t\t\t\"repositories_url\": \"r\",\n\t\t\t\"parent\": {\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"description\": \"d\",\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"slug\": \"s\",\n\t\t\t\t\"permission\": \"p\",\n\t\t\t\t\"privacy\": \"p\",\n\t\t\t\t\"members_count\": 1,\n\t\t\t\t\"repos_count\": 1\n\t\t\t},\n\t\t\t\"ldap_dn\": \"l\"\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestMergeGroupEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &MergeGroupEvent{}, \"{}\")\n\n\tu := &MergeGroupEvent{\n\t\tAction: Ptr(\"a\"),\n\t\tReason: Ptr(\"r\"),\n\t\tMergeGroup: &MergeGroup{\n\t\t\tHeadSHA:    Ptr(\"hs\"),\n\t\t\tHeadRef:    Ptr(\"hr\"),\n\t\t\tBaseSHA:    Ptr(\"bs\"),\n\t\t\tBaseRef:    Ptr(\"br\"),\n\t\t\tHeadCommit: &Commit{NodeID: Ptr(\"nid\")},\n\t\t},\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tOrg: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"reason\": \"r\",\n\t\t\"merge_group\": {\n\t\t\t\"head_sha\": \"hs\",\n\t\t\t\"head_ref\": \"hr\",\n\t\t\t\"base_sha\": \"bs\",\n\t\t\t\"base_ref\": \"br\",\n\t\t\t\"head_commit\": {\n\t\t\t\t\"node_id\": \"nid\"\n\t\t\t}\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestOrgBlockEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &OrgBlockEvent{}, \"{}\")\n\n\tu := &OrgBlockEvent{\n\t\tAction: Ptr(\"a\"),\n\t\tBlockedUser: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tOrganization: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"blocked_user\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestGollumEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &GollumEvent{}, \"{}\")\n\n\tu := &GollumEvent{\n\t\tPages: []*Page{\n\t\t\t{\n\t\t\t\tPageName: Ptr(\"pn\"),\n\t\t\t\tTitle:    Ptr(\"t\"),\n\t\t\t\tSummary:  Ptr(\"s\"),\n\t\t\t\tAction:   Ptr(\"a\"),\n\t\t\t\tSHA:      Ptr(\"sha\"),\n\t\t\t\tHTMLURL:  Ptr(\"hu\"),\n\t\t\t},\n\t\t},\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"pages\": [\n\t\t\t{\n\t\t\t\t\"page_name\": \"pn\",\n\t\t\t\t\"title\": \"t\",\n\t\t\t\t\"summary\": \"s\",\n\t\t\t\t\"action\": \"a\",\n\t\t\t\t\"sha\": \"sha\",\n\t\t\t\t\"html_url\": \"hu\"\n\t\t\t}\n\t\t],\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestWorkflowRunEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &WorkflowRunEvent{}, \"{}\")\n\n\tu := &WorkflowRunEvent{\n\t\tAction: Ptr(\"a\"),\n\t\tWorkflow: &Workflow{\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"nid\"),\n\t\t\tName:      Ptr(\"n\"),\n\t\t\tPath:      Ptr(\"p\"),\n\t\t\tState:     Ptr(\"s\"),\n\t\t\tCreatedAt: &Timestamp{referenceTime},\n\t\t\tUpdatedAt: &Timestamp{referenceTime},\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tHTMLURL:   Ptr(\"h\"),\n\t\t\tBadgeURL:  Ptr(\"b\"),\n\t\t},\n\t\tWorkflowRun: &WorkflowRun{\n\t\t\tID:         Ptr(int64(1)),\n\t\t\tName:       Ptr(\"n\"),\n\t\t\tNodeID:     Ptr(\"nid\"),\n\t\t\tHeadBranch: Ptr(\"hb\"),\n\t\t\tHeadSHA:    Ptr(\"hs\"),\n\t\t\tRunNumber:  Ptr(1),\n\t\t\tRunAttempt: Ptr(1),\n\t\t\tEvent:      Ptr(\"e\"),\n\t\t\tStatus:     Ptr(\"s\"),\n\t\t\tConclusion: Ptr(\"c\"),\n\t\t\tWorkflowID: Ptr(int64(1)),\n\t\t\tURL:        Ptr(\"u\"),\n\t\t\tHTMLURL:    Ptr(\"h\"),\n\t\t\tPullRequests: []*PullRequest{\n\t\t\t\t{\n\t\t\t\t\tURL:    Ptr(\"u\"),\n\t\t\t\t\tID:     Ptr(int64(1)),\n\t\t\t\t\tNumber: Ptr(1),\n\t\t\t\t\tHead: &PullRequestBranch{\n\t\t\t\t\t\tRef: Ptr(\"r\"),\n\t\t\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\t\t\tRepo: &Repository{\n\t\t\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\t\t\tURL:  Ptr(\"s\"),\n\t\t\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tBase: &PullRequestBranch{\n\t\t\t\t\t\tRef: Ptr(\"r\"),\n\t\t\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\t\t\tRepo: &Repository{\n\t\t\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\t\t\tURL:  Ptr(\"u\"),\n\t\t\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tCreatedAt:          &Timestamp{referenceTime},\n\t\t\tUpdatedAt:          &Timestamp{referenceTime},\n\t\t\tRunStartedAt:       &Timestamp{referenceTime},\n\t\t\tJobsURL:            Ptr(\"j\"),\n\t\t\tLogsURL:            Ptr(\"l\"),\n\t\t\tCheckSuiteURL:      Ptr(\"c\"),\n\t\t\tArtifactsURL:       Ptr(\"a\"),\n\t\t\tCancelURL:          Ptr(\"c\"),\n\t\t\tRerunURL:           Ptr(\"r\"),\n\t\t\tPreviousAttemptURL: Ptr(\"p\"),\n\t\t\tHeadCommit: &HeadCommit{\n\t\t\t\tMessage: Ptr(\"m\"),\n\t\t\t\tAuthor: &CommitAuthor{\n\t\t\t\t\tName:  Ptr(\"n\"),\n\t\t\t\t\tEmail: Ptr(\"e\"),\n\t\t\t\t\tLogin: Ptr(\"l\"),\n\t\t\t\t},\n\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\tDistinct:  Ptr(false),\n\t\t\t\tSHA:       Ptr(\"s\"),\n\t\t\t\tID:        Ptr(\"i\"),\n\t\t\t\tTreeID:    Ptr(\"tid\"),\n\t\t\t\tTimestamp: &Timestamp{referenceTime},\n\t\t\t\tCommitter: &CommitAuthor{\n\t\t\t\t\tName:  Ptr(\"n\"),\n\t\t\t\t\tEmail: Ptr(\"e\"),\n\t\t\t\t\tLogin: Ptr(\"l\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tWorkflowURL: Ptr(\"w\"),\n\t\t\tRepository: &Repository{\n\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\tURL:  Ptr(\"u\"),\n\t\t\t\tName: Ptr(\"n\"),\n\t\t\t},\n\t\t\tHeadRepository: &Repository{\n\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\tURL:  Ptr(\"u\"),\n\t\t\t\tName: Ptr(\"n\"),\n\t\t\t},\n\t\t},\n\t\tOrg: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"workflow\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"path\": \"p\",\n\t\t\t\"state\": \"s\",\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\",\n\t\t\t\"html_url\": \"h\",\n\t\t\t\"badge_url\": \"b\"\n\t\t},\n\t\t\"workflow_run\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"head_branch\": \"hb\",\n\t\t\t\"head_sha\": \"hs\",\n\t\t\t\"run_number\": 1,\n\t\t\t\"run_attempt\": 1,\n\t\t\t\"event\": \"e\",\n\t\t\t\"status\": \"s\",\n\t\t\t\"conclusion\": \"c\",\n\t\t\t\"workflow_id\": 1,\n\t\t\t\"url\": \"u\",\n\t\t\t\"html_url\": \"h\",\n\t\t\t\"pull_requests\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"number\": 1,\n\t\t\t\t\t\"url\": \"u\",\n\t\t\t\t\t\"head\": {\n\t\t\t\t\t\t\"ref\": \"r\",\n\t\t\t\t\t\t\"sha\": \"s\",\n\t\t\t\t\t\t\"repo\": {\n\t\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\t\t\"url\": \"s\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"base\": {\n\t\t\t\t\t\t\"ref\": \"r\",\n\t\t\t\t\t\t\"sha\": \"s\",\n\t\t\t\t\t\t\"repo\": {\n\t\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\t\t\"url\": \"u\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"run_started_at\": ` + referenceTimeStr + `,\n\t\t\t\"jobs_url\": \"j\",\n\t\t\t\"logs_url\": \"l\",\n\t\t\t\"check_suite_url\": \"c\",\n\t\t\t\"artifacts_url\": \"a\",\n\t\t\t\"cancel_url\": \"c\",\n\t\t\t\"rerun_url\": \"r\",\n\t\t\t\"previous_attempt_url\": \"p\",\n\t\t\t\"head_commit\": {\n\t\t\t\t\"message\": \"m\",\n\t\t\t\t\"author\": {\n\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\"email\": \"e\",\n\t\t\t\t\t\"username\": \"l\"\n\t\t\t\t},\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"distinct\": false,\n\t\t\t\t\"sha\": \"s\",\n\t\t\t\t\"id\": \"i\",\n\t\t\t\t\"tree_id\": \"tid\",\n\t\t\t\t\"timestamp\": ` + referenceTimeStr + `,\n\t\t\t\t\"committer\": {\n\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\"email\": \"e\",\n\t\t\t\t\t\"username\": \"l\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"workflow_url\": \"w\",\n\t\t\t\"repository\": {\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"head_repository\": {\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"url\": \"u\"\n\t\t\t}\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestWorkflowDispatchEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &WorkflowDispatchEvent{}, \"{}\")\n\n\ti := make(map[string]any)\n\ti[\"key\"] = \"value\"\n\n\tjsonMsg, _ := json.Marshal(i)\n\tu := &WorkflowDispatchEvent{\n\t\tInputs:   jsonMsg,\n\t\tRef:      Ptr(\"r\"),\n\t\tWorkflow: Ptr(\"w\"),\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tOrg: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"inputs\": {\n\t\t\t\"key\": \"value\"\n\t\t},\n\t\t\"ref\": \"r\",\n\t\t\"workflow\": \"w\",\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want, cmpJSONRawMessageComparator())\n}\n\nfunc TestWatchEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &WatchEvent{}, \"{}\")\n\n\tu := &WatchEvent{\n\t\tAction: Ptr(\"a\"),\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestUserEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &UserEvent{}, \"{}\")\n\n\tu := &UserEvent{\n\t\tUser: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\t// The action performed. Possible values are: \"created\" or \"deleted\".\n\t\tAction: Ptr(\"a\"),\n\t\tEnterprise: &Enterprise{\n\t\t\tID:          Ptr(1),\n\t\t\tSlug:        Ptr(\"s\"),\n\t\t\tName:        Ptr(\"n\"),\n\t\t\tNodeID:      Ptr(\"nid\"),\n\t\t\tAvatarURL:   Ptr(\"au\"),\n\t\t\tDescription: Ptr(\"d\"),\n\t\t\tWebsiteURL:  Ptr(\"wu\"),\n\t\t\tHTMLURL:     Ptr(\"hu\"),\n\t\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\t\tUpdatedAt:   &Timestamp{referenceTime},\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"user\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"action\": \"a\",\n\t\t\"enterprise\": {\n\t\t\t\"id\": 1,\n\t\t\t\"slug\": \"s\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"avatar_url\": \"au\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"website_url\": \"wu\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestCheckRunEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CheckRunEvent{}, \"{}\")\n\n\tr := &CheckRunEvent{\n\t\tCheckRun: &CheckRun{\n\t\t\tID:          Ptr(int64(1)),\n\t\t\tNodeID:      Ptr(\"n\"),\n\t\t\tHeadSHA:     Ptr(\"h\"),\n\t\t\tExternalID:  Ptr(\"1\"),\n\t\t\tURL:         Ptr(\"u\"),\n\t\t\tHTMLURL:     Ptr(\"u\"),\n\t\t\tDetailsURL:  Ptr(\"u\"),\n\t\t\tStatus:      Ptr(\"s\"),\n\t\t\tConclusion:  Ptr(\"c\"),\n\t\t\tStartedAt:   &Timestamp{referenceTime},\n\t\t\tCompletedAt: &Timestamp{referenceTime},\n\t\t\tOutput: &CheckRunOutput{\n\t\t\t\tAnnotations: []*CheckRunAnnotation{\n\t\t\t\t\t{\n\t\t\t\t\t\tAnnotationLevel: Ptr(\"a\"),\n\t\t\t\t\t\tEndLine:         Ptr(1),\n\t\t\t\t\t\tMessage:         Ptr(\"m\"),\n\t\t\t\t\t\tPath:            Ptr(\"p\"),\n\t\t\t\t\t\tRawDetails:      Ptr(\"r\"),\n\t\t\t\t\t\tStartLine:       Ptr(1),\n\t\t\t\t\t\tTitle:           Ptr(\"t\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tAnnotationsCount: Ptr(1),\n\t\t\t\tAnnotationsURL:   Ptr(\"a\"),\n\t\t\t\tImages: []*CheckRunImage{\n\t\t\t\t\t{\n\t\t\t\t\t\tAlt:      Ptr(\"a\"),\n\t\t\t\t\t\tImageURL: Ptr(\"i\"),\n\t\t\t\t\t\tCaption:  Ptr(\"c\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tTitle:   Ptr(\"t\"),\n\t\t\t\tSummary: Ptr(\"s\"),\n\t\t\t\tText:    Ptr(\"t\"),\n\t\t\t},\n\t\t\tName: Ptr(\"n\"),\n\t\t\tCheckSuite: &CheckSuite{\n\t\t\t\tID: Ptr(int64(1)),\n\t\t\t},\n\t\t\tApp: &App{\n\t\t\t\tID:     Ptr(int64(1)),\n\t\t\t\tNodeID: Ptr(\"n\"),\n\t\t\t\tOwner: &User{\n\t\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t\t},\n\t\t\t\tName:        Ptr(\"n\"),\n\t\t\t\tDescription: Ptr(\"d\"),\n\t\t\t\tHTMLURL:     Ptr(\"h\"),\n\t\t\t\tExternalURL: Ptr(\"u\"),\n\t\t\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\t\t\tUpdatedAt:   &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tPullRequests: []*PullRequest{\n\t\t\t\t{\n\t\t\t\t\tURL:    Ptr(\"u\"),\n\t\t\t\t\tID:     Ptr(int64(1)),\n\t\t\t\t\tNumber: Ptr(1),\n\t\t\t\t\tHead: &PullRequestBranch{\n\t\t\t\t\t\tRef: Ptr(\"r\"),\n\t\t\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\t\t\tRepo: &Repository{\n\t\t\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\t\t\tURL:  Ptr(\"s\"),\n\t\t\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tBase: &PullRequestBranch{\n\t\t\t\t\t\tRef: Ptr(\"r\"),\n\t\t\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\t\t\tRepo: &Repository{\n\t\t\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\t\t\tURL:  Ptr(\"u\"),\n\t\t\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tAction: Ptr(\"a\"),\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tOrg: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t\tRequestedAction: &RequestedAction{\n\t\t\tIdentifier: \"i\",\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"check_run\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"head_sha\": \"h\",\n\t\t\t\"external_id\": \"1\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"html_url\": \"u\",\n\t\t\t\"details_url\": \"u\",\n\t\t\t\"status\": \"s\",\n\t\t\t\"conclusion\": \"c\",\n\t\t\t\"started_at\": ` + referenceTimeStr + `,\n\t\t\t\"completed_at\": ` + referenceTimeStr + `,\n\t\t\t\"output\": {\n\t\t\t\t\"title\": \"t\",\n\t\t\t\t\"summary\": \"s\",\n\t\t\t\t\"text\": \"t\",\n\t\t\t\t\"annotations_count\": 1,\n\t\t\t\t\"annotations_url\": \"a\",\n\t\t\t\t\"annotations\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"path\": \"p\",\n\t\t\t\t\t\t\"start_line\": 1,\n\t\t\t\t\t\t\"end_line\": 1,\n\t\t\t\t\t\t\"annotation_level\": \"a\",\n\t\t\t\t\t\t\"message\": \"m\",\n\t\t\t\t\t\t\"title\": \"t\",\n\t\t\t\t\t\t\"raw_details\": \"r\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"images\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"alt\": \"a\",\n\t\t\t\t\t\t\"image_url\": \"i\",\n\t\t\t\t\t\t\"caption\": \"c\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"name\": \"n\",\n\t\t\t\"check_suite\": {\n\t\t\t\t\"id\": 1\n\t\t\t},\n\t\t\t\"app\": {\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"owner\": {\n\t\t\t\t\t\"login\": \"l\",\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\t\"url\": \"u\",\n\t\t\t\t\t\"events_url\": \"e\",\n\t\t\t\t\t\"repos_url\": \"r\"\n\t\t\t\t},\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"description\": \"d\",\n\t\t\t\t\"external_url\": \"u\",\n\t\t\t\t\"html_url\": \"h\",\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"updated_at\": ` + referenceTimeStr + `\n\t\t\t},\n\t\t\t\"pull_requests\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"number\": 1,\n\t\t\t\t\t\"url\": \"u\",\n\t\t\t\t\t\"head\": {\n\t\t\t\t\t\t\"ref\": \"r\",\n\t\t\t\t\t\t\"sha\": \"s\",\n\t\t\t\t\t\t\"repo\": {\n\t\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\t\t\"url\": \"s\"\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"base\": {\n\t\t\t\t\t\t\"ref\": \"r\",\n\t\t\t\t\t\t\"sha\": \"s\",\n\t\t\t\t\t\t\"repo\": {\n\t\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\t\t\"url\": \"u\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t\"action\": \"a\",\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"requested_action\": {\n\t\t\t\"identifier\": \"i\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n\nfunc TestCheckSuiteEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CheckSuiteEvent{}, \"{}\")\n\n\tr := &CheckSuiteEvent{\n\t\tCheckSuite: &CheckSuite{\n\t\t\tID:         Ptr(int64(1)),\n\t\t\tNodeID:     Ptr(\"n\"),\n\t\t\tHeadBranch: Ptr(\"h\"),\n\t\t\tHeadSHA:    Ptr(\"h\"),\n\t\t\tURL:        Ptr(\"u\"),\n\t\t\tBeforeSHA:  Ptr(\"b\"),\n\t\t\tAfterSHA:   Ptr(\"a\"),\n\t\t\tStatus:     Ptr(\"s\"),\n\t\t\tConclusion: Ptr(\"c\"),\n\t\t\tApp: &App{\n\t\t\t\tID:     Ptr(int64(1)),\n\t\t\t\tNodeID: Ptr(\"n\"),\n\t\t\t\tOwner: &User{\n\t\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t\t},\n\t\t\t\tName:        Ptr(\"n\"),\n\t\t\t\tDescription: Ptr(\"d\"),\n\t\t\t\tHTMLURL:     Ptr(\"h\"),\n\t\t\t\tExternalURL: Ptr(\"u\"),\n\t\t\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\t\t\tUpdatedAt:   &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tRepository: &Repository{\n\t\t\t\tID: Ptr(int64(1)),\n\t\t\t},\n\t\t\tPullRequests: []*PullRequest{\n\t\t\t\t{\n\t\t\t\t\tURL:    Ptr(\"u\"),\n\t\t\t\t\tID:     Ptr(int64(1)),\n\t\t\t\t\tNumber: Ptr(1),\n\t\t\t\t\tHead: &PullRequestBranch{\n\t\t\t\t\t\tRef: Ptr(\"r\"),\n\t\t\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\t\t\tRepo: &Repository{\n\t\t\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\t\t\tURL:  Ptr(\"s\"),\n\t\t\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tBase: &PullRequestBranch{\n\t\t\t\t\t\tRef: Ptr(\"r\"),\n\t\t\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\t\t\tRepo: &Repository{\n\t\t\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\t\t\tURL:  Ptr(\"u\"),\n\t\t\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tHeadCommit: &Commit{\n\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t},\n\t\t},\n\t\tAction: Ptr(\"a\"),\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tOrg: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"check_suite\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"head_branch\": \"h\",\n\t\t\t\"head_sha\": \"h\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"before\": \"b\",\n\t\t\t\"after\": \"a\",\n\t\t\t\"status\": \"s\",\n\t\t\t\"conclusion\": \"c\",\n\t\t\t\"app\": {\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"owner\": {\n\t\t\t\t\t\"login\": \"l\",\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\t\"url\": \"u\",\n\t\t\t\t\t\"events_url\": \"e\",\n\t\t\t\t\t\"repos_url\": \"r\"\n\t\t\t\t},\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"description\": \"d\",\n\t\t\t\t\"external_url\": \"u\",\n\t\t\t\t\"html_url\": \"h\",\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"updated_at\": ` + referenceTimeStr + `\n\t\t\t},\n\t\t\t\"repository\": {\n\t\t\t\t\"id\": 1\n\t\t\t},\n\t\t\t\"pull_requests\": [\n\t\t\t{\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"number\": 1,\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"head\": {\n\t\t\t\t\t\"ref\": \"r\",\n\t\t\t\t\t\"sha\": \"s\",\n\t\t\t\t\t\"repo\": {\n\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\t\"url\": \"s\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"base\": {\n\t\t\t\t\t\"ref\": \"r\",\n\t\t\t\t\t\"sha\": \"s\",\n\t\t\t\t\t\"repo\": {\n\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\t\"url\": \"u\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\t\"head_commit\": {\n\t\t\t\"sha\": \"s\"\n\t\t}\n\t\t},\n\t\t\"action\": \"a\",\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n\nfunc TestDeployKeyEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &DeployKeyEvent{}, \"{}\")\n\n\tu := &DeployKeyEvent{\n\t\tAction: Ptr(\"a\"),\n\t\tKey: &Key{\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tKey:       Ptr(\"k\"),\n\t\t\tURL:       Ptr(\"k\"),\n\t\t\tTitle:     Ptr(\"k\"),\n\t\t\tReadOnly:  Ptr(false),\n\t\t\tVerified:  Ptr(false),\n\t\t\tCreatedAt: &Timestamp{referenceTime},\n\t\t},\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tOrganization: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"key\": {\n\t\t\t\"id\": 1,\n\t\t\t\"key\": \"k\",\n\t\t\t\"url\": \"k\",\n\t\t\t\"title\": \"k\",\n\t\t\t\"read_only\": false,\n\t\t\t\"verified\": false,\n\t\t\t\"created_at\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestMetaEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &MetaEvent{}, \"{}\")\n\n\tv := make(map[string]any)\n\tv[\"a\"] = \"b\"\n\thookConfig := &HookConfig{\n\t\tContentType: Ptr(\"json\"),\n\t}\n\n\tu := &MetaEvent{\n\t\tAction: Ptr(\"a\"),\n\t\tHookID: Ptr(int64(1)),\n\t\tHook: &Hook{\n\t\t\tCreatedAt:    &Timestamp{referenceTime},\n\t\t\tUpdatedAt:    &Timestamp{referenceTime},\n\t\t\tURL:          Ptr(\"u\"),\n\t\t\tID:           Ptr(int64(1)),\n\t\t\tType:         Ptr(\"t\"),\n\t\t\tName:         Ptr(\"n\"),\n\t\t\tTestURL:      Ptr(\"tu\"),\n\t\t\tPingURL:      Ptr(\"pu\"),\n\t\t\tLastResponse: v,\n\t\t\tConfig:       hookConfig,\n\t\t\tEvents:       []string{\"a\"},\n\t\t\tActive:       Ptr(true),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"hook_id\": 1,\n\t\t\"hook\": {\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\",\n\t\t\t\"id\": 1,\n\t\t\t\"type\": \"t\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"test_url\": \"tu\",\n\t\t\t\"ping_url\": \"pu\",\n\t\t\t\"last_response\": {\n\t\t\t\t\"a\": \"b\"\n\t\t\t},\n\t\t\t\"config\": {\n\t\t\t\t\"content_type\": \"json\"\n\t\t\t},\n\t\t\t\"events\": [\n\t\t\t\t\"a\"\n\t\t\t],\n\t\t\t\"active\": true\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestRequestedAction_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RequestedAction{}, `{\"identifier\": \"\"}`)\n\n\tr := &RequestedAction{\n\t\tIdentifier: \"i\",\n\t}\n\n\twant := `{\n\t\t\"identifier\": \"i\"\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n\nfunc TestCreateEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CreateEvent{}, \"{}\")\n\n\tr := &CreateEvent{\n\t\tRef:          Ptr(\"r\"),\n\t\tRefType:      Ptr(\"rt\"),\n\t\tMasterBranch: Ptr(\"mb\"),\n\t\tDescription:  Ptr(\"d\"),\n\t\tPusherType:   Ptr(\"pt\"),\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"ref\": \"r\",\n\t\t\"ref_type\": \"rt\",\n\t\t\"master_branch\": \"mb\",\n\t\t\"description\": \"d\",\n\t\t\"pusher_type\": \"pt\",\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n\nfunc TestCustomPropertyEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CustomPropertyEvent{}, \"{}\")\n\n\tr := &CustomPropertyEvent{\n\t\tAction: Ptr(\"created\"),\n\t\tDefinition: &CustomProperty{\n\t\t\tPropertyName:     Ptr(\"name\"),\n\t\t\tValueType:        PropertyValueTypeSingleSelect,\n\t\t\tSourceType:       Ptr(\"enterprise\"),\n\t\t\tRequired:         Ptr(true),\n\t\t\tDefaultValue:     \"production\",\n\t\t\tDescription:      Ptr(\"Prod or dev environment\"),\n\t\t\tAllowedValues:    []string{\"production\", \"development\"},\n\t\t\tValuesEditableBy: Ptr(\"org_actors\"),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"created\",\n\t\t\"definition\": {\n\t\t\t\"property_name\": \"name\",\n          \t\"source_type\": \"enterprise\",\n          \t\"value_type\": \"single_select\",\n          \t\"required\": true,\n          \t\"default_value\": \"production\",\n          \t\"description\": \"Prod or dev environment\",\n          \t\"allowed_values\": [\n            \t\"production\",\n            \t\"development\"\n          \t],\n          \t\"values_editable_by\": \"org_actors\"\n        },\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n\nfunc TestCustomPropertyValuesEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CustomPropertyValuesEvent{}, \"{}\")\n\n\tr := &CustomPropertyValuesEvent{\n\t\tAction: Ptr(\"updated\"),\n\t\tNewPropertyValues: []*CustomPropertyValue{\n\t\t\t{\n\t\t\t\tPropertyName: \"environment\",\n\t\t\t\tValue:        \"production\",\n\t\t\t},\n\t\t},\n\t\tOldPropertyValues: []*CustomPropertyValue{\n\t\t\t{\n\t\t\t\tPropertyName: \"environment\",\n\t\t\t\tValue:        \"staging\",\n\t\t\t},\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"updated\",\n\t\t\"new_property_values\": [{\n\t\t\t\"property_name\": \"environment\",\n\t\t\t\"value\": \"production\"\n        }],\n\t\t\"old_property_values\": [{\n\t\t\t\"property_name\": \"environment\",\n\t\t\t\"value\": \"staging\"\n        }],\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n\nfunc TestDeleteEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &DeleteEvent{}, \"{}\")\n\n\tr := &DeleteEvent{\n\t\tRef:        Ptr(\"r\"),\n\t\tRefType:    Ptr(\"rt\"),\n\t\tPusherType: Ptr(\"pt\"),\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"ref\": \"r\",\n\t\t\"ref_type\": \"rt\",\n\t\t\"pusher_type\": \"pt\",\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n\nfunc TestDependabotAlertEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &DependabotAlertEvent{}, \"{}\")\n\n\te := &DependabotAlertEvent{\n\t\tAction: Ptr(\"a\"),\n\t\tAlert: &DependabotAlert{\n\t\t\tNumber: Ptr(1),\n\t\t\tState:  Ptr(\"s\"),\n\t\t\tDependency: &Dependency{\n\t\t\t\tPackage: &VulnerabilityPackage{\n\t\t\t\t\tEcosystem: Ptr(\"e\"),\n\t\t\t\t\tName:      Ptr(\"n\"),\n\t\t\t\t},\n\t\t\t\tManifestPath: Ptr(\"mp\"),\n\t\t\t\tScope:        Ptr(\"s\"),\n\t\t\t},\n\t\t\tSecurityAdvisory: &DependabotSecurityAdvisory{\n\t\t\t\tGHSAID:      Ptr(\"ghsaid\"),\n\t\t\t\tCVEID:       Ptr(\"cveid\"),\n\t\t\t\tSummary:     Ptr(\"s\"),\n\t\t\t\tDescription: Ptr(\"d\"),\n\t\t\t\tVulnerabilities: []*AdvisoryVulnerability{\n\t\t\t\t\t{\n\t\t\t\t\t\tPackage: &VulnerabilityPackage{\n\t\t\t\t\t\t\tEcosystem: Ptr(\"e\"),\n\t\t\t\t\t\t\tName:      Ptr(\"n\"),\n\t\t\t\t\t\t},\n\t\t\t\t\t\tSeverity: Ptr(\"s\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tSeverity: Ptr(\"s\"),\n\t\t\t\tCVSS: &AdvisoryCVSS{\n\t\t\t\t\tScore:        Ptr(1.0),\n\t\t\t\t\tVectorString: Ptr(\"vs\"),\n\t\t\t\t},\n\t\t\t\tCWEs: []*AdvisoryCWEs{\n\t\t\t\t\t{\n\t\t\t\t\t\tCWEID: Ptr(\"cweid\"),\n\t\t\t\t\t\tName:  Ptr(\"n\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tIdentifiers: []*AdvisoryIdentifier{\n\t\t\t\t\t{\n\t\t\t\t\t\tValue: Ptr(\"v\"),\n\t\t\t\t\t\tType:  Ptr(\"t\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tReferences: []*AdvisoryReference{\n\t\t\t\t\t{\n\t\t\t\t\t\tURL: Ptr(\"u\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tPublishedAt: &Timestamp{referenceTime},\n\t\t\t\tUpdatedAt:   &Timestamp{referenceTime},\n\t\t\t\tWithdrawnAt: &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSecurityVulnerability: &AdvisoryVulnerability{\n\t\t\t\tPackage: &VulnerabilityPackage{\n\t\t\t\t\tEcosystem: Ptr(\"e\"),\n\t\t\t\t\tName:      Ptr(\"n\"),\n\t\t\t\t},\n\t\t\t\tSeverity:               Ptr(\"s\"),\n\t\t\t\tVulnerableVersionRange: Ptr(\"vvr\"),\n\t\t\t\tFirstPatchedVersion: &FirstPatchedVersion{\n\t\t\t\t\tIdentifier: Ptr(\"i\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tURL:         Ptr(\"u\"),\n\t\t\tHTMLURL:     Ptr(\"hu\"),\n\t\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\t\tUpdatedAt:   &Timestamp{referenceTime},\n\t\t\tDismissedAt: &Timestamp{referenceTime},\n\t\t\tDismissedBy: &User{\n\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t},\n\t\t\tDismissedReason:  Ptr(\"dr\"),\n\t\t\tDismissedComment: Ptr(\"dc\"),\n\t\t\tFixedAt:          &Timestamp{referenceTime},\n\t\t\tAutoDismissedAt:  &Timestamp{referenceTime},\n\t\t},\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tOrganization: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tEnterprise: &Enterprise{\n\t\t\tID:          Ptr(1),\n\t\t\tSlug:        Ptr(\"s\"),\n\t\t\tName:        Ptr(\"n\"),\n\t\t\tNodeID:      Ptr(\"nid\"),\n\t\t\tAvatarURL:   Ptr(\"au\"),\n\t\t\tDescription: Ptr(\"d\"),\n\t\t\tWebsiteURL:  Ptr(\"wu\"),\n\t\t\tHTMLURL:     Ptr(\"hu\"),\n\t\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\t\tUpdatedAt:   &Timestamp{referenceTime},\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"alert\": {\n\t\t\t\"number\": 1,\n\t\t\t\"state\": \"s\",\n\t\t\t\"dependency\": {\n\t\t\t\t\"package\": {\n\t\t\t\t\t\"ecosystem\": \"e\",\n\t\t\t\t\t\"name\": \"n\"\n\t\t\t\t},\n\t\t\t\t\"manifest_path\": \"mp\",\n\t\t\t\t\"scope\": \"s\"\n\t\t\t},\n\t\t\t\"security_advisory\": {\n\t\t\t\t\"ghsa_id\": \"ghsaid\",\n\t\t\t\t\"cve_id\": \"cveid\",\n\t\t\t\t\"summary\": \"s\",\n\t\t\t\t\"description\": \"d\",\n\t\t\t\t\"vulnerabilities\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"package\": {\n\t\t\t\t\t\t\t\"ecosystem\": \"e\",\n\t\t\t\t\t\t\t\"name\": \"n\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"severity\": \"s\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"severity\": \"s\",\n\t\t\t\t\"cvss\": {\n\t\t\t\t\t\"score\": 1.0,\n\t\t\t\t\t\"vector_string\": \"vs\"\n\t\t\t\t},\n\t\t\t\t\"cwes\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"cwe_id\": \"cweid\",\n\t\t\t\t\t\t\"name\": \"n\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"identifiers\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"value\": \"v\",\n\t\t\t\t\t\t\"type\": \"t\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"references\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"url\": \"u\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"published_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"withdrawn_at\": ` + referenceTimeStr + `\n\t\t\t},\n\t\t\t\"security_vulnerability\": {\n\t\t\t\t\"package\": {\n\t\t\t\t\t\"ecosystem\": \"e\",\n\t\t\t\t\t\"name\": \"n\"\n\t\t\t\t},\n\t\t\t\t\"severity\": \"s\",\n\t\t\t\t\"vulnerable_version_range\": \"vvr\",\n\t\t\t\t\"first_patched_version\": {\n\t\t\t\t\t\"identifier\": \"i\"\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"url\": \"u\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"dismissed_at\": ` + referenceTimeStr + `,\n\t\t\t\"dismissed_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"events_url\": \"e\",\n\t\t\t\t\"repos_url\": \"r\"\n\t\t\t},\n\t\t\t\"dismissed_reason\": \"dr\",\n\t\t\t\"dismissed_comment\": \"dc\",\n\t\t\t\"fixed_at\": ` + referenceTimeStr + `,\n\t\t\t\"auto_dismissed_at\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n        \"enterprise\": {\n\t\t\t\"id\": 1,\n\t\t\t\"slug\": \"s\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"avatar_url\": \"au\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"website_url\": \"wu\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, e, want)\n}\n\nfunc TestForkEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ForkEvent{}, \"{}\")\n\n\tu := &ForkEvent{\n\t\tForkee: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"forkee\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestGitHubAppAuthorizationEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &GitHubAppAuthorizationEvent{}, \"{}\")\n\n\tu := &GitHubAppAuthorizationEvent{\n\t\tAction: Ptr(\"a\"),\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestInstallationEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &InstallationEvent{}, \"{}\")\n\n\tu := &InstallationEvent{\n\t\tAction: Ptr(\"a\"),\n\t\tRepositories: []*Repository{\n\t\t\t{\n\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\tURL:  Ptr(\"u\"),\n\t\t\t\tName: Ptr(\"n\"),\n\t\t\t},\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"repositories\": [\n\t\t\t{\n\t\t\t\t\"id\":1,\n\t\t\t\t\"name\":\"n\",\n\t\t\t\t\"url\":\"u\"\n\t\t\t}\n\t\t],\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestHeadCommit_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &HeadCommit{}, \"{}\")\n\n\tu := &HeadCommit{\n\t\tMessage: Ptr(\"m\"),\n\t\tAuthor: &CommitAuthor{\n\t\t\tDate:  &Timestamp{referenceTime},\n\t\t\tName:  Ptr(\"n\"),\n\t\t\tEmail: Ptr(\"e\"),\n\t\t\tLogin: Ptr(\"u\"),\n\t\t},\n\t\tURL:       Ptr(\"u\"),\n\t\tDistinct:  Ptr(true),\n\t\tSHA:       Ptr(\"s\"),\n\t\tID:        Ptr(\"id\"),\n\t\tTreeID:    Ptr(\"tid\"),\n\t\tTimestamp: &Timestamp{referenceTime},\n\t\tCommitter: &CommitAuthor{\n\t\t\tDate:  &Timestamp{referenceTime},\n\t\t\tName:  Ptr(\"n\"),\n\t\t\tEmail: Ptr(\"e\"),\n\t\t\tLogin: Ptr(\"u\"),\n\t\t},\n\t\tAdded:    []string{\"a\"},\n\t\tRemoved:  []string{\"r\"},\n\t\tModified: []string{\"m\"},\n\t}\n\n\twant := `{\n\t\t\"message\": \"m\",\n\t\t\"author\": {\n\t\t\t\"date\": ` + referenceTimeStr + `,\n\t\t\t\"name\": \"n\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"username\": \"u\"\n\t\t},\n\t\t\"url\": \"u\",\n\t\t\"distinct\": true,\n\t\t\"sha\": \"s\",\n\t\t\"id\": \"id\",\n\t\t\"tree_id\": \"tid\",\n\t\t\"timestamp\": ` + referenceTimeStr + `,\n\t\t\"committer\": {\n\t\t\t\"date\": ` + referenceTimeStr + `,\n\t\t\t\"name\": \"n\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"username\": \"u\"\n\t\t},\n\t\t\"added\": [\n\t\t\t\"a\"\n\t\t],\n\t\t\"removed\":  [\n\t\t\t\"r\"\n\t\t],\n\t\t\"modified\":  [\n\t\t\t\"m\"\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPushEventRepository_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PushEventRepository{}, \"{}\")\n\n\tu := &PushEventRepository{\n\t\tID:       Ptr(int64(1)),\n\t\tNodeID:   Ptr(\"nid\"),\n\t\tName:     Ptr(\"n\"),\n\t\tFullName: Ptr(\"fn\"),\n\t\tOwner: &User{\n\t\t\tLogin:       Ptr(\"l\"),\n\t\t\tID:          Ptr(int64(1)),\n\t\t\tAvatarURL:   Ptr(\"a\"),\n\t\t\tGravatarID:  Ptr(\"g\"),\n\t\t\tName:        Ptr(\"n\"),\n\t\t\tCompany:     Ptr(\"c\"),\n\t\t\tBlog:        Ptr(\"b\"),\n\t\t\tLocation:    Ptr(\"l\"),\n\t\t\tEmail:       Ptr(\"e\"),\n\t\t\tHireable:    Ptr(true),\n\t\t\tPublicRepos: Ptr(1),\n\t\t\tFollowers:   Ptr(1),\n\t\t\tFollowing:   Ptr(1),\n\t\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\t\tURL:         Ptr(\"u\"),\n\t\t},\n\t\tPrivate:         Ptr(true),\n\t\tDescription:     Ptr(\"d\"),\n\t\tFork:            Ptr(true),\n\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\tPushedAt:        &Timestamp{referenceTime},\n\t\tUpdatedAt:       &Timestamp{referenceTime},\n\t\tHomepage:        Ptr(\"h\"),\n\t\tPullsURL:        Ptr(\"p\"),\n\t\tSize:            Ptr(1),\n\t\tStargazersCount: Ptr(1),\n\t\tWatchersCount:   Ptr(1),\n\t\tLanguage:        Ptr(\"l\"),\n\t\tHasIssues:       Ptr(true),\n\t\tHasDownloads:    Ptr(true),\n\t\tHasWiki:         Ptr(true),\n\t\tHasPages:        Ptr(true),\n\t\tForksCount:      Ptr(1),\n\t\tArchived:        Ptr(true),\n\t\tDisabled:        Ptr(true),\n\t\tOpenIssuesCount: Ptr(1),\n\t\tDefaultBranch:   Ptr(\"d\"),\n\t\tMasterBranch:    Ptr(\"m\"),\n\t\tOrganization:    Ptr(\"o\"),\n\t\tURL:             Ptr(\"u\"),\n\t\tArchiveURL:      Ptr(\"a\"),\n\t\tHTMLURL:         Ptr(\"h\"),\n\t\tStatusesURL:     Ptr(\"s\"),\n\t\tGitURL:          Ptr(\"g\"),\n\t\tSSHURL:          Ptr(\"s\"),\n\t\tCloneURL:        Ptr(\"c\"),\n\t\tSVNURL:          Ptr(\"s\"),\n\t\tTopics:          []string{\"octocat\", \"api\"},\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"node_id\": \"nid\",\n\t\t\"name\": \"n\",\n\t\t\"full_name\": \"fn\",\n\t\t\"owner\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"private\": true,\n\t\t\"description\": \"d\",\n\t\t\"fork\": true,\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"pushed_at\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"homepage\": \"h\",\n\t\t\"pulls_url\": \"p\",\n\t\t\"size\": 1,\n\t\t\"stargazers_count\": 1,\n\t\t\"watchers_count\": 1,\n\t\t\"language\": \"l\",\n\t\t\"has_issues\": true,\n\t\t\"has_downloads\": true,\n\t\t\"has_wiki\": true,\n\t\t\"has_pages\": true,\n\t\t\"forks_count\": 1,\n\t\t\"archived\": true,\n\t\t\"disabled\": true,\n\t\t\"open_issues_count\": 1,\n\t\t\"default_branch\": \"d\",\n\t\t\"master_branch\": \"m\",\n\t\t\"organization\": \"o\",\n\t\t\"url\": \"u\",\n\t\t\"archive_url\": \"a\",\n\t\t\"html_url\": \"h\",\n\t\t\"statuses_url\": \"s\",\n\t\t\"git_url\": \"g\",\n\t\t\"ssh_url\": \"s\",\n\t\t\"clone_url\": \"c\",\n\t\t\"svn_url\": \"s\",\n\t\t\"topics\": [\"octocat\",\"api\"]\n    }`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPushEventRepoOwner_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PushEventRepoOwner{}, \"{}\")\n\n\tu := &PushEventRepoOwner{\n\t\tName:  Ptr(\"n\"),\n\t\tEmail: Ptr(\"e\"),\n\t}\n\n\twant := `{\n\t\t\"name\": \"n\",\n\t\t\"email\": \"e\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestProjectV2Event_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ProjectV2Event{}, \"{}\")\n\n\tu := &ProjectV2Event{\n\t\tAction: Ptr(\"a\"),\n\t\tProjectsV2: &ProjectV2{\n\t\t\tID:     Ptr(int64(1)),\n\t\t\tNodeID: Ptr(\"nid\"),\n\t\t\tOwner: &User{\n\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t},\n\t\t\tCreator: &User{\n\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t},\n\t\t\tTitle:            Ptr(\"t\"),\n\t\t\tDescription:      Ptr(\"d\"),\n\t\t\tPublic:           Ptr(true),\n\t\t\tClosedAt:         &Timestamp{referenceTime},\n\t\t\tCreatedAt:        &Timestamp{referenceTime},\n\t\t\tUpdatedAt:        &Timestamp{referenceTime},\n\t\t\tDeletedAt:        &Timestamp{referenceTime},\n\t\t\tNumber:           Ptr(1),\n\t\t\tShortDescription: Ptr(\"sd\"),\n\t\t\tDeletedBy: &User{\n\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t},\n\t\t},\n\t\tOrg: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"projects_v2\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"owner\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"events_url\": \"e\",\n\t\t\t\t\"repos_url\": \"r\"\n\t\t\t},\n\t\t\t\"creator\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"events_url\": \"e\",\n\t\t\t\t\"repos_url\": \"r\"\n\t\t\t},\n\t\t\t\"title\": \"t\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"public\": true,\n\t\t\t\"closed_at\": ` + referenceTimeStr + `,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"deleted_at\": ` + referenceTimeStr + `,\n\t\t\t\"number\": 1,\n\t\t\t\"short_description\": \"sd\",\n\t\t\t\"deleted_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"events_url\": \"e\",\n\t\t\t\t\"repos_url\": \"r\"\n\t\t\t}\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t}\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestProjectV2ItemEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ProjectV2ItemEvent{}, \"{}\")\n\n\tu := &ProjectV2ItemEvent{\n\t\tAction: Ptr(\"a\"),\n\t\tChanges: &ProjectV2ItemChange{\n\t\t\tArchivedAt: &ArchivedAt{\n\t\t\t\tFrom: &Timestamp{referenceTime},\n\t\t\t\tTo:   &Timestamp{referenceTime},\n\t\t\t},\n\t\t},\n\t\tProjectV2Item: &ProjectV2Item{\n\t\t\tID:            Ptr(int64(1)),\n\t\t\tNodeID:        Ptr(\"nid\"),\n\t\t\tProjectNodeID: Ptr(\"pnid\"),\n\t\t\tContentNodeID: Ptr(\"cnid\"),\n\t\t\tContentType:   Ptr(ProjectV2ItemContentType(\"ct\")),\n\t\t\tCreator: &User{\n\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t},\n\t\t\tCreatedAt:  &Timestamp{referenceTime},\n\t\t\tUpdatedAt:  &Timestamp{referenceTime},\n\t\t\tArchivedAt: &Timestamp{referenceTime},\n\t\t},\n\t\tOrg: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\":  \"a\",\n\t\t\"changes\": {\n\t\t\t\"archived_at\": {\n\t\t\t\t\"from\": ` + referenceTimeStr + `,\n\t\t\t\t\"to\": ` + referenceTimeStr + `\n\t\t\t}\n\t\t},\n\t\t\"projects_v2_item\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"project_node_id\": \"pnid\",\n\t\t\t\"content_node_id\": \"cnid\",\n\t\t\t\"content_type\": \"ct\",\n\t\t\t\"creator\":  {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"events_url\": \"e\",\n\t\t\t\t\"repos_url\": \"r\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"archived_at\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t}\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPullRequestEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PullRequestEvent{}, \"{}\")\n\n\tu := &PullRequestEvent{\n\t\tAction: Ptr(\"a\"),\n\t\tAssignee: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tNumber:      Ptr(1),\n\t\tPullRequest: &PullRequest{ID: Ptr(int64(1))},\n\t\tChanges: &EditChange{\n\t\t\tTitle: &EditTitle{\n\t\t\t\tFrom: Ptr(\"TitleFrom\"),\n\t\t\t},\n\t\t\tBody: &EditBody{\n\t\t\t\tFrom: Ptr(\"BodyFrom\"),\n\t\t\t},\n\t\t\tBase: &EditBase{\n\t\t\t\tRef: &EditRef{\n\t\t\t\t\tFrom: Ptr(\"BaseRefFrom\"),\n\t\t\t\t},\n\t\t\t\tSHA: &EditSHA{\n\t\t\t\t\tFrom: Ptr(\"BaseSHAFrom\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tRequestedReviewer: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tRequestedTeam: &Team{ID: Ptr(int64(1))},\n\t\tLabel:         &Label{ID: Ptr(int64(1))},\n\t\tReason:        Ptr(\"CI_FAILURE\"),\n\t\tBefore:        Ptr(\"before\"),\n\t\tAfter:         Ptr(\"after\"),\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tPerformedViaGithubApp: &App{\n\t\t\tID:          Ptr(int64(1)),\n\t\t\tNodeID:      Ptr(\"n\"),\n\t\t\tSlug:        Ptr(\"s\"),\n\t\t\tName:        Ptr(\"n\"),\n\t\t\tDescription: Ptr(\"d\"),\n\t\t\tExternalURL: Ptr(\"e\"),\n\t\t\tHTMLURL:     Ptr(\"h\"),\n\t\t},\n\t\tOrganization: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"assignee\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"number\": 1,\n\t\t\"pull_request\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"changes\": {\n\t\t\t\"title\": {\n\t\t\t\t\"from\": \"TitleFrom\"\n\t\t\t},\n\t\t\t\"body\": {\n\t\t\t\t\"from\": \"BodyFrom\"\n\t\t\t},\n\t\t\t\"base\": {\n\t\t\t\t\"ref\": {\n\t\t\t\t\t\"from\": \"BaseRefFrom\"\n\t\t\t\t},\n\t\t\t\t\"sha\": {\n\t\t\t\t\t\"from\": \"BaseSHAFrom\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"requested_reviewer\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"requested_team\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"label\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"reason\": \"CI_FAILURE\",\n\t\t\"before\": \"before\",\n\t\t\"after\": \"after\",\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"performed_via_github_app\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"slug\": \"s\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"external_url\": \"e\",\n\t\t\t\"html_url\": \"h\"\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want, cmpJSONRawMessageComparator())\n}\n\nfunc TestPullRequestReviewCommentEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PullRequestReviewCommentEvent{}, \"{}\")\n\n\tu := &PullRequestReviewCommentEvent{\n\t\tAction:      Ptr(\"a\"),\n\t\tPullRequest: &PullRequest{ID: Ptr(int64(1))},\n\t\tComment:     &PullRequestComment{ID: Ptr(int64(1))},\n\t\tChanges: &EditChange{\n\t\t\tTitle: &EditTitle{\n\t\t\t\tFrom: Ptr(\"TitleFrom\"),\n\t\t\t},\n\t\t\tBody: &EditBody{\n\t\t\t\tFrom: Ptr(\"BodyFrom\"),\n\t\t\t},\n\t\t\tBase: &EditBase{\n\t\t\t\tRef: &EditRef{\n\t\t\t\t\tFrom: Ptr(\"BaseRefFrom\"),\n\t\t\t\t},\n\t\t\t\tSHA: &EditSHA{\n\t\t\t\t\tFrom: Ptr(\"BaseSHAFrom\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"pull_request\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"comment\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"changes\": {\n\t\t\t\"title\": {\n\t\t\t\t\"from\": \"TitleFrom\"\n\t\t\t},\n\t\t\t\"body\": {\n\t\t\t\t\"from\": \"BodyFrom\"\n\t\t\t},\n\t\t\t\"base\": {\n\t\t\t\t\"ref\": {\n\t\t\t\t\t\"from\": \"BaseRefFrom\"\n\t\t\t\t},\n\t\t\t\t\"sha\": {\n\t\t\t\t\t\"from\": \"BaseSHAFrom\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPullRequestReviewThreadEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PullRequestReviewThreadEvent{}, \"{}\")\n\n\tu := &PullRequestReviewThreadEvent{\n\t\tAction:      Ptr(\"a\"),\n\t\tPullRequest: &PullRequest{ID: Ptr(int64(1))},\n\t\tThread: &PullRequestThread{\n\t\t\tComments: []*PullRequestComment{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}},\n\t\t},\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"pull_request\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"thread\": {\n\t\t\t\"comments\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": 1\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"id\": 2\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPullRequestTargetEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PullRequestTargetEvent{}, \"{}\")\n\n\tu := &PullRequestTargetEvent{\n\t\tAction: Ptr(\"a\"),\n\t\tAssignee: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tNumber:      Ptr(1),\n\t\tPullRequest: &PullRequest{ID: Ptr(int64(1))},\n\t\tChanges: &EditChange{\n\t\t\tTitle: &EditTitle{\n\t\t\t\tFrom: Ptr(\"TitleFrom\"),\n\t\t\t},\n\t\t\tBody: &EditBody{\n\t\t\t\tFrom: Ptr(\"BodyFrom\"),\n\t\t\t},\n\t\t\tBase: &EditBase{\n\t\t\t\tRef: &EditRef{\n\t\t\t\t\tFrom: Ptr(\"BaseRefFrom\"),\n\t\t\t\t},\n\t\t\t\tSHA: &EditSHA{\n\t\t\t\t\tFrom: Ptr(\"BaseSHAFrom\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tRequestedReviewer: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tRequestedTeam: &Team{ID: Ptr(int64(1))},\n\t\tLabel:         &Label{ID: Ptr(int64(1))},\n\t\tBefore:        Ptr(\"before\"),\n\t\tAfter:         Ptr(\"after\"),\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tPerformedViaGithubApp: &App{\n\t\t\tID:          Ptr(int64(1)),\n\t\t\tNodeID:      Ptr(\"n\"),\n\t\t\tSlug:        Ptr(\"s\"),\n\t\t\tName:        Ptr(\"n\"),\n\t\t\tDescription: Ptr(\"d\"),\n\t\t\tExternalURL: Ptr(\"e\"),\n\t\t\tHTMLURL:     Ptr(\"h\"),\n\t\t},\n\t\tOrganization: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"assignee\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"number\": 1,\n\t\t\"pull_request\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"changes\": {\n\t\t\t\"title\": {\n\t\t\t\t\"from\": \"TitleFrom\"\n\t\t\t},\n\t\t\t\"body\": {\n\t\t\t\t\"from\": \"BodyFrom\"\n\t\t\t},\n\t\t\t\"base\": {\n\t\t\t\t\"ref\": {\n\t\t\t\t\t\"from\": \"BaseRefFrom\"\n\t\t\t\t},\n\t\t\t\t\"sha\": {\n\t\t\t\t\t\"from\": \"BaseSHAFrom\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"requested_reviewer\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"requested_team\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"label\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"before\": \"before\",\n\t\t\"after\": \"after\",\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"performed_via_github_app\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"slug\": \"s\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"external_url\": \"e\",\n\t\t\t\"html_url\": \"h\"\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestRepositoryVulnerabilityAlertEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RepositoryVulnerabilityAlertEvent{}, \"{}\")\n\n\tu := &RepositoryVulnerabilityAlertEvent{\n\t\tAction: Ptr(\"a\"),\n\t\tAlert: &RepositoryVulnerabilityAlert{\n\t\t\tID:                  Ptr(int64(1)),\n\t\t\tAffectedRange:       Ptr(\"ar\"),\n\t\t\tAffectedPackageName: Ptr(\"apn\"),\n\t\t\tExternalReference:   Ptr(\"er\"),\n\t\t\tExternalIdentifier:  Ptr(\"ei\"),\n\t\t\tFixedIn:             Ptr(\"fi\"),\n\t\t\tDismisser: &User{\n\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t},\n\t\t\tDismissReason: Ptr(\"dr\"),\n\t\t\tDismissedAt:   &Timestamp{referenceTime},\n\t\t},\n\t\tRepository: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"alert\": {\n\t\t\t\"id\": 1,\n\t\t\t\"affected_range\": \"ar\",\n\t\t\t\"affected_package_name\": \"apn\",\n\t\t\t\"external_reference\": \"er\",\n\t\t\t\"external_identifier\": \"ei\",\n\t\t\t\"fixed_in\": \"fi\",\n\t\t\t\"dismisser\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"events_url\": \"e\",\n\t\t\t\t\"repos_url\": \"r\"\n\t\t\t},\n\t\t\t\"dismiss_reason\": \"dr\",\n\t\t\t\"dismissed_at\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestSecretScanningAlertEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SecretScanningAlertEvent{}, \"{}\")\n\n\tu := &SecretScanningAlertEvent{\n\t\tAction: Ptr(\"a\"),\n\t\tAlert: &SecretScanningAlert{\n\t\t\tNumber:     Ptr(1),\n\t\t\tSecretType: Ptr(\"t\"),\n\t\t\tResolution: Ptr(\"r\"),\n\t\t\tResolvedBy: &User{\n\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t},\n\t\t\tResolvedAt: &Timestamp{referenceTime},\n\t\t},\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tOrganization: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tEnterprise: &Enterprise{\n\t\t\tID:          Ptr(1),\n\t\t\tSlug:        Ptr(\"s\"),\n\t\t\tName:        Ptr(\"n\"),\n\t\t\tNodeID:      Ptr(\"nid\"),\n\t\t\tAvatarURL:   Ptr(\"au\"),\n\t\t\tDescription: Ptr(\"d\"),\n\t\t\tWebsiteURL:  Ptr(\"wu\"),\n\t\t\tHTMLURL:     Ptr(\"hu\"),\n\t\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\t\tUpdatedAt:   &Timestamp{referenceTime},\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"alert\": {\n\t\t\t\"number\": 1,\n\t\t\t\"secret_type\": \"t\",\n\t\t\t\"resolution\": \"r\",\n\t\t\t\"resolved_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"events_url\": \"e\",\n\t\t\t\t\"repos_url\": \"r\"\n\t\t\t},\n\t\t\t\"resolved_at\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"s\"\n\t\t},\n        \"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n        \"enterprise\": {\n\t\t\t\"id\": 1,\n\t\t\t\"slug\": \"s\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"avatar_url\": \"au\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"website_url\": \"wu\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n        \"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestSecretScanningAlertLocationEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SecretScanningAlertLocationEvent{}, \"{}\")\n\tu := &SecretScanningAlertLocationEvent{\n\t\tAction: Ptr(\"created\"),\n\t\tAlert: &SecretScanningAlert{\n\t\t\tNumber:     Ptr(10),\n\t\t\tCreatedAt:  &Timestamp{referenceTime},\n\t\t\tUpdatedAt:  &Timestamp{referenceTime},\n\t\t\tURL:        Ptr(\"a\"),\n\t\t\tHTMLURL:    Ptr(\"a\"),\n\t\t\tSecretType: Ptr(\"mailchimp_api_key\"),\n\t\t},\n\t\tLocation: &SecretScanningAlertLocation{\n\t\t\tType: Ptr(\"blob\"),\n\t\t\tDetails: &SecretScanningAlertLocationDetails{\n\t\t\t\tPath:        Ptr(\"path/to/file\"),\n\t\t\t\tStartline:   Ptr(10),\n\t\t\t\tEndLine:     Ptr(20),\n\t\t\t\tStartColumn: Ptr(1),\n\t\t\t\tEndColumn:   Ptr(2),\n\t\t\t\tBlobSHA:     Ptr(\"d6e4c75c141dbacecc279b721b8bsomeSHA\"),\n\t\t\t\tBlobURL:     Ptr(\"a\"),\n\t\t\t\tCommitSHA:   Ptr(\"d6e4c75c141dbacecc279b721b8bsomeSHA\"),\n\t\t\t\tCommitURL:   Ptr(\"a\"),\n\t\t\t},\n\t\t},\n\t\tRepo: &Repository{\n\t\t\tID:     Ptr(int64(12345)),\n\t\t\tNodeID: Ptr(\"MDEwOlJlcG9zaXRvcnkxMjM0NQ==\"),\n\t\t\tName:   Ptr(\"example-repo\"),\n\t\t},\n\t\tOrganization: &Organization{\n\t\t\tLogin: Ptr(\"example-org\"),\n\t\t\tID:    Ptr(int64(67890)),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin: Ptr(\"example-user\"),\n\t\t\tID:    Ptr(int64(1111)),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID: Ptr(int64(2222)),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"created\",\n\t\t\"alert\": {\n\t\t\t\"number\": 10,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"a\",\n\t\t\t\"html_url\": \"a\",\n\t\t\t\"secret_type\": \"mailchimp_api_key\"\n\t\t},\n\t\t\"location\": {\n\n\t\t\t\"type\": \"blob\",\n\t\t\t\"details\": {\n\t\t\t\t\"path\": \"path/to/file\",\n\t\t\t\t\"start_line\": 10,\n\t\t\t\t\"end_line\": 20,\n\t\t\t\t\"start_column\": 1,\n\t\t\t\t\"end_column\": 2,\n\t\t\t\t\"blob_sha\": \"d6e4c75c141dbacecc279b721b8bsomeSHA\",\n\t\t\t\t\"blob_url\": \"a\",\n\t\t\t\t\"commit_sha\": \"d6e4c75c141dbacecc279b721b8bsomeSHA\",\n\t\t\t\t\"commit_url\": \"a\"\n\t\t\t}\n\t\t},\n\t\t\"repository\": {\n\n\t\t\t\"id\": 12345,\n\t\t\t\"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjM0NQ==\",\n\t\t\t\"name\": \"example-repo\"\n\t\t},\n\t\t\"organization\": {\n\t\t\"login\": \"example-org\",\n\t\t\"id\": 67890\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"example-user\",\n\t\t\t\"id\": 1111\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 2222\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestSecurityAdvisoryEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SecurityAdvisoryEvent{}, \"{}\")\n\tu := &SecurityAdvisoryEvent{\n\t\tAction: Ptr(\"published\"),\n\t\tSecurityAdvisory: &SecurityAdvisory{\n\t\t\tCVSS: &AdvisoryCVSS{\n\t\t\t\tScore:        Ptr(1.0),\n\t\t\t\tVectorString: Ptr(\"vs\"),\n\t\t\t},\n\t\t\tCWEs: []*AdvisoryCWEs{\n\t\t\t\t{\n\t\t\t\t\tCWEID: Ptr(\"cweid\"),\n\t\t\t\t\tName:  Ptr(\"n\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tGHSAID:      Ptr(\"GHSA-rf4j-j272-some\"),\n\t\t\tSummary:     Ptr(\"Siuuuuuuuuu\"),\n\t\t\tDescription: Ptr(\"desc\"),\n\t\t\tSeverity:    Ptr(\"moderate\"),\n\t\t\tIdentifiers: []*AdvisoryIdentifier{\n\t\t\t\t{\n\t\t\t\t\tValue: Ptr(\"GHSA-rf4j-j272-some\"),\n\t\t\t\t\tType:  Ptr(\"GHSA\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tReferences: []*AdvisoryReference{\n\t\t\t\t{\n\t\t\t\t\tURL: Ptr(\"https://some-url\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tPublishedAt: &Timestamp{referenceTime},\n\t\t\tUpdatedAt:   &Timestamp{referenceTime},\n\t\t\tWithdrawnAt: nil,\n\t\t\tVulnerabilities: []*AdvisoryVulnerability{\n\t\t\t\t{\n\t\t\t\t\tPackage: &VulnerabilityPackage{\n\t\t\t\t\t\tEcosystem: Ptr(\"ucl\"),\n\t\t\t\t\t\tName:      Ptr(\"penaldo\"),\n\t\t\t\t\t},\n\t\t\t\t\tSeverity:               Ptr(\"moderate\"),\n\t\t\t\t\tVulnerableVersionRange: Ptr(\">= 2.0.0, < 2.0.2\"),\n\t\t\t\t\tFirstPatchedVersion: &FirstPatchedVersion{\n\t\t\t\t\t\tIdentifier: Ptr(\"2.0.2\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tEnterprise: &Enterprise{\n\t\t\tID:          Ptr(1),\n\t\t\tSlug:        Ptr(\"s\"),\n\t\t\tName:        Ptr(\"n\"),\n\t\t\tNodeID:      Ptr(\"nid\"),\n\t\t\tAvatarURL:   Ptr(\"au\"),\n\t\t\tDescription: Ptr(\"d\"),\n\t\t\tWebsiteURL:  Ptr(\"wu\"),\n\t\t\tHTMLURL:     Ptr(\"hu\"),\n\t\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\t\tUpdatedAt:   &Timestamp{referenceTime},\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t\tOrganization: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tRepository: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"published\",\n\t\t\"security_advisory\": {\n\t\t  \"ghsa_id\": \"GHSA-rf4j-j272-some\",\n\t\t  \"summary\": \"Siuuuuuuuuu\",\n\t\t  \"cvss\": {\n\t\t\t\"score\": 1.0,\n\t\t\t\"vector_string\": \"vs\"\n\t\t  },\n\t\t  \"cwes\": [\n\t\t\t{\n\t\t\t\t\"cwe_id\": \"cweid\",\n\t\t\t\t\"name\": \"n\"\n\t\t\t}\n\t\t  ],\n\t\t  \"description\": \"desc\",\n\t\t  \"severity\": \"moderate\",\n\t\t  \"identifiers\": [\n\t\t\t{\n\t\t\t  \"value\": \"GHSA-rf4j-j272-some\",\n\t\t\t  \"type\": \"GHSA\"\n\t\t\t}\n\t\t  ],\n\t\t  \"references\": [\n\t\t\t{\n\t\t\t  \"url\": \"https://some-url\"\n\t\t\t}\n\t\t  ],\n\t\t  \"published_at\": ` + referenceTimeStr + `,\n\t\t  \"updated_at\": ` + referenceTimeStr + `,\n\t\t  \"vulnerabilities\": [\n\t\t\t{\n\t\t\t  \"package\": {\n\t\t\t\t\"ecosystem\": \"ucl\",\n\t\t\t\t\"name\": \"penaldo\"\n\t\t\t  },\n\t\t\t  \"severity\": \"moderate\",\n\t\t\t  \"vulnerable_version_range\": \">= 2.0.0, < 2.0.2\",\n\t\t\t  \"first_patched_version\": {\n\t\t\t\t\"identifier\": \"2.0.2\"\n\t\t\t  }\n\t\t\t}\n\t\t  ]\n\t\t},\n\t\t\"enterprise\": {\n\t\t\t\"id\": 1,\n\t\t\t\"slug\": \"s\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"avatar_url\": \"au\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"website_url\": \"wu\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"url\": \"s\",\n\t\t\t\"name\": \"n\"\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t}\n\t  }`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestSecurityAndAnalysisEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SecurityAndAnalysisEvent{}, \"{}\")\n\n\tu := &SecurityAndAnalysisEvent{\n\t\tChanges: &SecurityAndAnalysisChange{\n\t\t\tFrom: &SecurityAndAnalysisChangeFrom{\n\t\t\t\tSecurityAndAnalysis: &SecurityAndAnalysis{\n\t\t\t\t\tAdvancedSecurity: &AdvancedSecurity{\n\t\t\t\t\t\tStatus: Ptr(\"enabled\"),\n\t\t\t\t\t},\n\t\t\t\t\tSecretScanning: &SecretScanning{\n\t\t\t\t\t\tStatus: Ptr(\"enabled\"),\n\t\t\t\t\t},\n\t\t\t\t\tSecretScanningPushProtection: &SecretScanningPushProtection{\n\t\t\t\t\t\tStatus: Ptr(\"enabled\"),\n\t\t\t\t\t},\n\t\t\t\t\tDependabotSecurityUpdates: &DependabotSecurityUpdates{\n\t\t\t\t\t\tStatus: Ptr(\"enabled\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tEnterprise: &Enterprise{\n\t\t\tID:          Ptr(1),\n\t\t\tSlug:        Ptr(\"s\"),\n\t\t\tName:        Ptr(\"n\"),\n\t\t\tNodeID:      Ptr(\"nid\"),\n\t\t\tAvatarURL:   Ptr(\"au\"),\n\t\t\tDescription: Ptr(\"d\"),\n\t\t\tWebsiteURL:  Ptr(\"wu\"),\n\t\t\tHTMLURL:     Ptr(\"hu\"),\n\t\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\t\tUpdatedAt:   &Timestamp{referenceTime},\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tNodeID:   Ptr(\"nid\"),\n\t\t\tClientID: Ptr(\"cid\"),\n\t\t\tAppID:    Ptr(int64(1)),\n\t\t\tAppSlug:  Ptr(\"as\"),\n\t\t\tTargetID: Ptr(int64(1)),\n\t\t\tAccount: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tAccessTokensURL:     Ptr(\"atu\"),\n\t\t\tRepositoriesURL:     Ptr(\"ru\"),\n\t\t\tHTMLURL:             Ptr(\"hu\"),\n\t\t\tTargetType:          Ptr(\"tt\"),\n\t\t\tSingleFileName:      Ptr(\"sfn\"),\n\t\t\tRepositorySelection: Ptr(\"rs\"),\n\t\t\tEvents:              []string{\"e\"},\n\t\t\tSingleFilePaths:     []string{\"s\"},\n\t\t\tPermissions: &InstallationPermissions{\n\t\t\t\tActions:                       Ptr(\"a\"),\n\t\t\t\tAdministration:                Ptr(\"ad\"),\n\t\t\t\tChecks:                        Ptr(\"c\"),\n\t\t\t\tContents:                      Ptr(\"co\"),\n\t\t\t\tContentReferences:             Ptr(\"cr\"),\n\t\t\t\tDeployments:                   Ptr(\"d\"),\n\t\t\t\tEnvironments:                  Ptr(\"e\"),\n\t\t\t\tIssues:                        Ptr(\"i\"),\n\t\t\t\tMetadata:                      Ptr(\"md\"),\n\t\t\t\tMembers:                       Ptr(\"m\"),\n\t\t\t\tOrganizationAdministration:    Ptr(\"oa\"),\n\t\t\t\tOrganizationHooks:             Ptr(\"oh\"),\n\t\t\t\tOrganizationPlan:              Ptr(\"op\"),\n\t\t\t\tOrganizationPreReceiveHooks:   Ptr(\"opr\"),\n\t\t\t\tOrganizationProjects:          Ptr(\"op\"),\n\t\t\t\tOrganizationSecrets:           Ptr(\"os\"),\n\t\t\t\tOrganizationSelfHostedRunners: Ptr(\"osh\"),\n\t\t\t\tOrganizationUserBlocking:      Ptr(\"oub\"),\n\t\t\t\tPackages:                      Ptr(\"pkg\"),\n\t\t\t\tPages:                         Ptr(\"pg\"),\n\t\t\t\tPullRequests:                  Ptr(\"pr\"),\n\t\t\t\tRepositoryHooks:               Ptr(\"rh\"),\n\t\t\t\tRepositoryProjects:            Ptr(\"rp\"),\n\t\t\t\tRepositoryPreReceiveHooks:     Ptr(\"rprh\"),\n\t\t\t\tSecrets:                       Ptr(\"s\"),\n\t\t\t\tSecretScanningAlerts:          Ptr(\"ssa\"),\n\t\t\t\tSecurityEvents:                Ptr(\"se\"),\n\t\t\t\tSingleFile:                    Ptr(\"sf\"),\n\t\t\t\tStatuses:                      Ptr(\"s\"),\n\t\t\t\tTeamDiscussions:               Ptr(\"td\"),\n\t\t\t\tVulnerabilityAlerts:           Ptr(\"va\"),\n\t\t\t\tWorkflows:                     Ptr(\"w\"),\n\t\t\t},\n\t\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\t\tUpdatedAt:              &Timestamp{referenceTime},\n\t\t\tHasMultipleSingleFiles: Ptr(false),\n\t\t\tSuspendedBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t\tOrganization: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tRepository: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"changes\": {\n\t\t\t\"from\": {\n\t\t\t\t\"security_and_analysis\": {\n\t\t\t\t\t\"advanced_security\": {\n\t\t\t\t\t\t\"status\": \"enabled\"\n\t\t\t\t\t},\n\t\t\t\t\t\"secret_scanning\": {\n\t\t\t\t\t\t\"status\": \"enabled\"\n\t\t\t\t\t},\n\t\t\t\t\t\"secret_scanning_push_protection\": {\n\t\t\t\t\t\t\"status\": \"enabled\"\n\t\t\t\t\t},\n\t\t\t\t\t\"dependabot_security_updates\": {\n\t\t\t\t\t\t\"status\": \"enabled\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t\"enterprise\": {\n\t\t\t\"id\": 1,\n\t\t\t\"slug\": \"s\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"avatar_url\": \"au\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"website_url\": \"wu\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"client_id\": \"cid\",\n\t\t\t\"app_id\": 1,\n\t\t\t\"app_slug\": \"as\",\n\t\t\t\"target_id\": 1,\n\t\t\t\"account\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"access_tokens_url\": \"atu\",\n\t\t\t\"repositories_url\": \"ru\",\n\t\t\t\"html_url\": \"hu\",\n\t\t\t\"target_type\": \"tt\",\n\t\t\t\"single_file_name\": \"sfn\",\n\t\t\t\"repository_selection\": \"rs\",\n\t\t\t\"events\": [\n\t\t\t\t\"e\"\n\t\t\t],\n\t\t\t\"single_file_paths\": [\n\t\t\t\t\"s\"\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\t\"actions\": \"a\",\n\t\t\t\t\"administration\": \"ad\",\n\t\t\t\t\"checks\": \"c\",\n\t\t\t\t\"contents\": \"co\",\n\t\t\t\t\"content_references\": \"cr\",\n\t\t\t\t\"deployments\": \"d\",\n\t\t\t\t\"environments\": \"e\",\n\t\t\t\t\"issues\": \"i\",\n\t\t\t\t\"metadata\": \"md\",\n\t\t\t\t\"members\": \"m\",\n\t\t\t\t\"organization_administration\": \"oa\",\n\t\t\t\t\"organization_hooks\": \"oh\",\n\t\t\t\t\"organization_plan\": \"op\",\n\t\t\t\t\"organization_pre_receive_hooks\": \"opr\",\n\t\t\t\t\"organization_projects\": \"op\",\n\t\t\t\t\"organization_secrets\": \"os\",\n\t\t\t\t\"organization_self_hosted_runners\": \"osh\",\n\t\t\t\t\"organization_user_blocking\": \"oub\",\n\t\t\t\t\"packages\": \"pkg\",\n\t\t\t\t\"pages\": \"pg\",\n\t\t\t\t\"pull_requests\": \"pr\",\n\t\t\t\t\"repository_hooks\": \"rh\",\n\t\t\t\t\"repository_projects\": \"rp\",\n\t\t\t\t\"repository_pre_receive_hooks\": \"rprh\",\n\t\t\t\t\"secrets\": \"s\",\n\t\t\t\t\"secret_scanning_alerts\": \"ssa\",\n\t\t\t\t\"security_events\": \"se\",\n\t\t\t\t\"single_file\": \"sf\",\n\t\t\t\t\"statuses\": \"s\",\n\t\t\t\t\"team_discussions\": \"td\",\n\t\t\t\t\"vulnerability_alerts\": \"va\",\n\t\t\t\t\"workflows\": \"w\"\n\t\t\t},\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"has_multiple_single_files\": false,\n\t\t\t\"suspended_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"url\": \"s\",\n\t\t\t\"name\": \"n\"\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestCodeScanningAlertEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CodeScanningAlertEvent{}, \"{}\")\n\n\tu := &CodeScanningAlertEvent{\n\t\tAction: Ptr(\"reopened\"),\n\t\tAlert: &Alert{\n\t\t\tNumber: Ptr(10),\n\t\t\tRule: &Rule{\n\t\t\t\tID:              Ptr(\"Style/FrozenStringLiteralComment\"),\n\t\t\t\tSeverity:        Ptr(\"note\"),\n\t\t\t\tDescription:     Ptr(\"desc\"),\n\t\t\t\tFullDescription: Ptr(\"full desc\"),\n\t\t\t\tTags:            []string{\"style\"},\n\t\t\t\tHelp:            Ptr(\"help\"),\n\t\t\t},\n\t\t\tTool: &Tool{\n\t\t\t\tName:    Ptr(\"Rubocop\"),\n\t\t\t\tVersion: nil,\n\t\t\t},\n\t\t\tCreatedAt: &Timestamp{referenceTime},\n\t\t\tUpdatedAt: &Timestamp{referenceTime},\n\t\t\tFixedAt:   nil,\n\t\t\tState:     Ptr(\"open\"),\n\t\t\tURL:       Ptr(\"a\"),\n\t\t\tHTMLURL:   Ptr(\"a\"),\n\t\t\tInstances: []*MostRecentInstance{\n\t\t\t\t{\n\t\t\t\t\tRef:         Ptr(\"refs/heads/main\"),\n\t\t\t\t\tAnalysisKey: Ptr(\".github/workflows/workflow.yml:upload\"),\n\t\t\t\t\tEnvironment: Ptr(\"{}\"),\n\t\t\t\t\tState:       Ptr(\"open\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tDismissedBy:     nil,\n\t\t\tDismissedAt:     nil,\n\t\t\tDismissedReason: nil,\n\t\t},\n\t\tRef:       Ptr(\"refs/heads/main\"),\n\t\tCommitOID: Ptr(\"d6e4c75c141dbacecc279b721b8bsomeSHA\"),\n\t\tRepo: &Repository{\n\t\t\tID:     Ptr(int64(1234234535)),\n\t\t\tNodeID: Ptr(\"MDEwOlJlcG9zaXRvcnkxODY4NT==\"),\n\t\t\tOwner: &User{\n\t\t\t\tLogin:             Ptr(\"Codertocat\"),\n\t\t\t\tID:                Ptr(int64(21031067)),\n\t\t\t\tNodeID:            Ptr(\"MDQ6VXNlcjIxMDMxMDY3\"),\n\t\t\t\tAvatarURL:         Ptr(\"a\"),\n\t\t\t\tGravatarID:        Ptr(\"\"),\n\t\t\t\tURL:               Ptr(\"a\"),\n\t\t\t\tHTMLURL:           Ptr(\"a\"),\n\t\t\t\tType:              Ptr(\"User\"),\n\t\t\t\tSiteAdmin:         Ptr(false),\n\t\t\t\tFollowersURL:      Ptr(\"a\"),\n\t\t\t\tFollowingURL:      Ptr(\"a\"),\n\t\t\t\tEventsURL:         Ptr(\"a\"),\n\t\t\t\tGistsURL:          Ptr(\"a\"),\n\t\t\t\tOrganizationsURL:  Ptr(\"a\"),\n\t\t\t\tReceivedEventsURL: Ptr(\"a\"),\n\t\t\t\tReposURL:          Ptr(\"a\"),\n\t\t\t\tStarredURL:        Ptr(\"a\"),\n\t\t\t\tSubscriptionsURL:  Ptr(\"a\"),\n\t\t\t},\n\t\t\tHTMLURL:          Ptr(\"a\"),\n\t\t\tName:             Ptr(\"Hello-World\"),\n\t\t\tFullName:         Ptr(\"Codertocat/Hello-World\"),\n\t\t\tDescription:      nil,\n\t\t\tFork:             Ptr(false),\n\t\t\tHomepage:         nil,\n\t\t\tDefaultBranch:    Ptr(\"main\"),\n\t\t\tCreatedAt:        &Timestamp{referenceTime},\n\t\t\tPushedAt:         &Timestamp{referenceTime},\n\t\t\tUpdatedAt:        &Timestamp{referenceTime},\n\t\t\tCloneURL:         Ptr(\"a\"),\n\t\t\tGitURL:           Ptr(\"a\"),\n\t\t\tMirrorURL:        nil,\n\t\t\tSSHURL:           Ptr(\"a\"),\n\t\t\tSVNURL:           Ptr(\"a\"),\n\t\t\tLanguage:         nil,\n\t\t\tForksCount:       Ptr(0),\n\t\t\tOpenIssuesCount:  Ptr(2),\n\t\t\tOpenIssues:       Ptr(2),\n\t\t\tStargazersCount:  Ptr(0),\n\t\t\tWatchersCount:    Ptr(0),\n\t\t\tWatchers:         Ptr(0),\n\t\t\tSize:             Ptr(0),\n\t\t\tArchived:         Ptr(false),\n\t\t\tDisabled:         Ptr(false),\n\t\t\tLicense:          nil,\n\t\t\tPrivate:          Ptr(false),\n\t\t\tHasIssues:        Ptr(true),\n\t\t\tHasWiki:          Ptr(true),\n\t\t\tHasPages:         Ptr(true),\n\t\t\tHasProjects:      Ptr(true),\n\t\t\tHasDownloads:     Ptr(true),\n\t\t\tURL:              Ptr(\"a\"),\n\t\t\tArchiveURL:       Ptr(\"a\"),\n\t\t\tAssigneesURL:     Ptr(\"a\"),\n\t\t\tBlobsURL:         Ptr(\"a\"),\n\t\t\tBranchesURL:      Ptr(\"a\"),\n\t\t\tCollaboratorsURL: Ptr(\"a\"),\n\t\t\tCommentsURL:      Ptr(\"a\"),\n\t\t\tCommitsURL:       Ptr(\"a\"),\n\t\t\tCompareURL:       Ptr(\"a\"),\n\t\t\tContentsURL:      Ptr(\"a\"),\n\t\t\tContributorsURL:  Ptr(\"a\"),\n\t\t\tDeploymentsURL:   Ptr(\"a\"),\n\t\t\tDownloadsURL:     Ptr(\"a\"),\n\t\t\tEventsURL:        Ptr(\"a\"),\n\t\t\tForksURL:         Ptr(\"a\"),\n\t\t\tGitCommitsURL:    Ptr(\"a\"),\n\t\t\tGitRefsURL:       Ptr(\"a\"),\n\t\t\tGitTagsURL:       Ptr(\"a\"),\n\t\t\tHooksURL:         Ptr(\"a\"),\n\t\t\tIssueCommentURL:  Ptr(\"a\"),\n\t\t\tIssueEventsURL:   Ptr(\"a\"),\n\t\t\tIssuesURL:        Ptr(\"a\"),\n\t\t\tKeysURL:          Ptr(\"a\"),\n\t\t\tLabelsURL:        Ptr(\"a\"),\n\t\t\tLanguagesURL:     Ptr(\"a\"),\n\t\t\tMergesURL:        Ptr(\"a\"),\n\t\t\tMilestonesURL:    Ptr(\"a\"),\n\t\t\tNotificationsURL: Ptr(\"a\"),\n\t\t\tPullsURL:         Ptr(\"a\"),\n\t\t\tReleasesURL:      Ptr(\"a\"),\n\t\t\tStargazersURL:    Ptr(\"a\"),\n\t\t\tStatusesURL:      Ptr(\"a\"),\n\t\t\tSubscribersURL:   Ptr(\"a\"),\n\t\t\tSubscriptionURL:  Ptr(\"a\"),\n\t\t\tTagsURL:          Ptr(\"a\"),\n\t\t\tTreesURL:         Ptr(\"a\"),\n\t\t\tTeamsURL:         Ptr(\"a\"),\n\t\t},\n\t\tOrg: &Organization{\n\t\t\tLogin:            Ptr(\"Octocoders\"),\n\t\t\tID:               Ptr(int64(6)),\n\t\t\tNodeID:           Ptr(\"MDEyOk9yZ2FuaXphdGlvbjY=\"),\n\t\t\tAvatarURL:        Ptr(\"a\"),\n\t\t\tDescription:      Ptr(\"\"),\n\t\t\tURL:              Ptr(\"a\"),\n\t\t\tEventsURL:        Ptr(\"a\"),\n\t\t\tHooksURL:         Ptr(\"a\"),\n\t\t\tIssuesURL:        Ptr(\"a\"),\n\t\t\tMembersURL:       Ptr(\"a\"),\n\t\t\tPublicMembersURL: Ptr(\"a\"),\n\t\t\tReposURL:         Ptr(\"a\"),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin:             Ptr(\"github\"),\n\t\t\tID:                Ptr(int64(9919)),\n\t\t\tNodeID:            Ptr(\"MDEyOk9yZ2FuaXphdGlvbjk5MTk=\"),\n\t\t\tAvatarURL:         Ptr(\"a\"),\n\t\t\tHTMLURL:           Ptr(\"a\"),\n\t\t\tGravatarID:        Ptr(\"\"),\n\t\t\tType:              Ptr(\"Organization\"),\n\t\t\tSiteAdmin:         Ptr(false),\n\t\t\tURL:               Ptr(\"a\"),\n\t\t\tEventsURL:         Ptr(\"a\"),\n\t\t\tFollowingURL:      Ptr(\"a\"),\n\t\t\tFollowersURL:      Ptr(\"a\"),\n\t\t\tGistsURL:          Ptr(\"a\"),\n\t\t\tOrganizationsURL:  Ptr(\"a\"),\n\t\t\tReceivedEventsURL: Ptr(\"a\"),\n\t\t\tReposURL:          Ptr(\"a\"),\n\t\t\tStarredURL:        Ptr(\"a\"),\n\t\t\tSubscriptionsURL:  Ptr(\"a\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"reopened\",\n\t\t\"alert\": {\n\t\t  \"number\": 10,\n\t\t  \"created_at\": ` + referenceTimeStr + `,\n\t\t  \"updated_at\": ` + referenceTimeStr + `,\n\t\t  \"url\": \"a\",\n\t\t  \"html_url\": \"a\",\n\t\t  \"instances\": [\n\t\t\t{\n\t\t\t  \"ref\": \"refs/heads/main\",\n\t\t\t  \"analysis_key\": \".github/workflows/workflow.yml:upload\",\n\t\t\t  \"environment\": \"{}\",\n\t\t\t  \"state\": \"open\"\n\t\t\t}\n\t\t  ],\n\t\t  \"state\": \"open\",\n\t\t  \"rule\": {\n\t\t\t\"id\": \"Style/FrozenStringLiteralComment\",\n\t\t\t\"severity\": \"note\",\n\t\t\t\"description\": \"desc\",\n\t\t\t\"full_description\": \"full desc\",\n\t\t\t\"tags\": [\n\t\t\t  \"style\"\n\t\t\t],\n\t\t\t\"help\": \"help\"\n\t\t  },\n\t\t  \"tool\": {\n\t\t\t\"name\": \"Rubocop\"\n\t\t  }\n\t\t},\n\t\t\"ref\": \"refs/heads/main\",\n\t\t\"commit_oid\": \"d6e4c75c141dbacecc279b721b8bsomeSHA\",\n\t\t\"repository\": {\n\t\t  \"id\": 1234234535,\n\t\t  \"node_id\": \"MDEwOlJlcG9zaXRvcnkxODY4NT==\",\n\t\t  \"name\": \"Hello-World\",\n\t\t  \"full_name\": \"Codertocat/Hello-World\",\n\t\t  \"private\": false,\n\t\t  \"owner\": {\n\t\t\t\"login\": \"Codertocat\",\n\t\t\t\"id\": 21031067,\n\t\t\t\"node_id\": \"MDQ6VXNlcjIxMDMxMDY3\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"\",\n\t\t\t\"url\": \"a\",\n\t\t\t\"html_url\": \"a\",\n\t\t\t\"followers_url\": \"a\",\n\t\t\t\"following_url\": \"a\",\n\t\t\t\"gists_url\": \"a\",\n\t\t\t\"starred_url\": \"a\",\n\t\t\t\"subscriptions_url\": \"a\",\n\t\t\t\"organizations_url\": \"a\",\n\t\t\t\"repos_url\": \"a\",\n\t\t\t\"events_url\": \"a\",\n\t\t\t\"received_events_url\": \"a\",\n\t\t\t\"type\": \"User\",\n\t\t\t\"site_admin\": false\n\t\t  },\n\t\t  \"html_url\": \"a\",\n\t\t  \"fork\": false,\n\t\t  \"url\": \"a\",\n\t\t  \"forks_url\": \"a\",\n\t\t  \"keys_url\": \"a\",\n\t\t  \"collaborators_url\": \"a\",\n\t\t  \"teams_url\": \"a\",\n\t\t  \"hooks_url\": \"a\",\n\t\t  \"issue_events_url\": \"a\",\n\t\t  \"events_url\": \"a\",\n\t\t  \"assignees_url\": \"a\",\n\t\t  \"branches_url\": \"a\",\n\t\t  \"tags_url\": \"a\",\n\t\t  \"blobs_url\": \"a\",\n\t\t  \"git_tags_url\": \"a\",\n\t\t  \"git_refs_url\": \"a\",\n\t\t  \"trees_url\": \"a\",\n\t\t  \"statuses_url\": \"a\",\n\t\t  \"languages_url\": \"a\",\n\t\t  \"stargazers_url\": \"a\",\n\t\t  \"contributors_url\": \"a\",\n\t\t  \"subscribers_url\": \"a\",\n\t\t  \"subscription_url\": \"a\",\n\t\t  \"commits_url\": \"a\",\n\t\t  \"git_commits_url\": \"a\",\n\t\t  \"comments_url\": \"a\",\n\t\t  \"issue_comment_url\": \"a\",\n\t\t  \"contents_url\": \"a\",\n\t\t  \"compare_url\": \"a\",\n\t\t  \"merges_url\": \"a\",\n\t\t  \"archive_url\": \"a\",\n\t\t  \"downloads_url\": \"a\",\n\t\t  \"issues_url\": \"a\",\n\t\t  \"pulls_url\": \"a\",\n\t\t  \"milestones_url\": \"a\",\n\t\t  \"notifications_url\": \"a\",\n\t\t  \"labels_url\": \"a\",\n\t\t  \"releases_url\": \"a\",\n\t\t  \"deployments_url\": \"a\",\n\t\t  \"created_at\": ` + referenceTimeStr + `,\n\t\t  \"updated_at\": ` + referenceTimeStr + `,\n\t\t  \"pushed_at\": ` + referenceTimeStr + `,\n\t\t  \"git_url\": \"a\",\n\t\t  \"ssh_url\": \"a\",\n\t\t  \"clone_url\": \"a\",\n\t\t  \"svn_url\": \"a\",\n\t\t  \"size\": 0,\n\t\t  \"stargazers_count\": 0,\n\t\t  \"watchers_count\": 0,\n\t\t  \"has_issues\": true,\n\t\t  \"has_projects\": true,\n\t\t  \"has_downloads\": true,\n\t\t  \"has_wiki\": true,\n\t\t  \"has_pages\": true,\n\t\t  \"forks_count\": 0,\n\t\t  \"archived\": false,\n\t\t  \"disabled\": false,\n\t\t  \"open_issues_count\": 2,\n\t\t  \"open_issues\": 2,\n\t\t  \"watchers\": 0,\n\t\t  \"default_branch\": \"main\"\n\t\t},\n\t\t\"organization\": {\n\t\t  \"login\": \"Octocoders\",\n\t\t  \"id\": 6,\n\t\t  \"node_id\": \"MDEyOk9yZ2FuaXphdGlvbjY=\",\n\t\t  \"url\": \"a\",\n\t\t  \"repos_url\": \"a\",\n\t\t  \"events_url\": \"a\",\n\t\t  \"hooks_url\": \"a\",\n\t\t  \"issues_url\": \"a\",\n\t\t  \"members_url\": \"a\",\n\t\t  \"public_members_url\": \"a\",\n\t\t  \"avatar_url\": \"a\",\n\t\t  \"description\": \"\"\n\t\t},\n\t\t\"sender\": {\n\t\t  \"login\": \"github\",\n\t\t  \"id\": 9919,\n\t\t  \"node_id\": \"MDEyOk9yZ2FuaXphdGlvbjk5MTk=\",\n\t\t  \"avatar_url\": \"a\",\n\t\t  \"gravatar_id\": \"\",\n\t\t  \"url\": \"a\",\n\t\t  \"html_url\": \"a\",\n\t\t  \"followers_url\": \"a\",\n\t\t  \"following_url\": \"a\",\n\t\t  \"gists_url\": \"a\",\n\t\t  \"starred_url\": \"a\",\n\t\t  \"subscriptions_url\": \"a\",\n\t\t  \"organizations_url\": \"a\",\n\t\t  \"repos_url\": \"a\",\n\t\t  \"events_url\": \"a\",\n\t\t  \"received_events_url\": \"a\",\n\t\t  \"type\": \"Organization\",\n\t\t  \"site_admin\": false\n\t\t}\n\t  }`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestSponsorshipEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SponsorshipEvent{}, \"{}\")\n\n\tu := &SponsorshipEvent{\n\t\tAction:        Ptr(\"created\"),\n\t\tEffectiveDate: Ptr(\"2023-01-01T00:00:00Z\"),\n\t\tChanges: &SponsorshipChanges{\n\t\t\tTier: &SponsorshipTier{\n\t\t\t\tFrom: Ptr(\"basic\"),\n\t\t\t},\n\t\t\tPrivacyLevel: Ptr(\"public\"),\n\t\t},\n\t\tRepository: &Repository{\n\t\t\tID:     Ptr(int64(12345)),\n\t\t\tNodeID: Ptr(\"MDEwOlJlcG9zaXRvcnkxMjM0NQ==\"),\n\t\t\tName:   Ptr(\"example-repo\"),\n\t\t},\n\t\tOrganization: &Organization{\n\t\t\tLogin: Ptr(\"example-org\"),\n\t\t\tID:    Ptr(int64(67890)),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin: Ptr(\"example-user\"),\n\t\t\tID:    Ptr(int64(1111)),\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID: Ptr(int64(2222)),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"created\",\n\t\t\"effective_date\": \"2023-01-01T00:00:00Z\",\n\t\t\"changes\": {\n\t\t\t\"tier\": {\n\t\t\t\t\"from\": \"basic\"\n\t\t\t},\n\t\t\t\"privacy_level\": \"public\"\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 12345,\n\t\t\t\"node_id\": \"MDEwOlJlcG9zaXRvcnkxMjM0NQ==\",\n\t\t\t\"name\": \"example-repo\"\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"login\": \"example-org\",\n\t\t\t\"id\": 67890\n\t\t},\n\t\t\"sender\": {\n\t\t\t\"login\": \"example-user\",\n\t\t\t\"id\": 1111\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 2222\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestSponsorshipChanges_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SponsorshipChanges{}, \"{}\")\n\n\tu := &SponsorshipChanges{\n\t\tTier: &SponsorshipTier{\n\t\t\tFrom: Ptr(\"premium\"),\n\t\t},\n\t\tPrivacyLevel: Ptr(\"private\"),\n\t}\n\n\twant := `{\n\t\t\"tier\": {\n\t\t\t\"from\": \"premium\"\n\t\t},\n\t\t\"privacy_level\": \"private\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestSponsorshipTier_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SponsorshipTier{}, \"{}\")\n\n\tu := &SponsorshipTier{\n\t\tFrom: Ptr(\"gold\"),\n\t}\n\n\twant := `{\n\t\t\"from\": \"gold\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/example_iterators_test.go",
    "content": "// Copyright 2026 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github_test\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/google/go-github/v84/github\"\n)\n\nfunc ExampleRepositoriesService_ListByUserIter() {\n\tclient := github.NewClient(nil)\n\tctx := context.Background()\n\n\t// List all repositories for a user using the iterator.\n\t// This automatically handles pagination.\n\t// Note that if `opts` is `nil`, a new empty `opts` will be created and used within the iterator.\n\topts := &github.RepositoryListByUserOptions{Type: \"public\"}\n\tfor repo, err := range client.Repositories.ListByUserIter(ctx, \"octocat\", opts) {\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Error listing repos: %v\", err)\n\t\t}\n\t\tfmt.Println(repo.GetName())\n\t}\n}\n"
  },
  {
    "path": "github/examples_test.go",
    "content": "// Copyright 2016 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// These examples are inlined in godoc.\n\npackage github_test\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/google/go-github/v84/github\"\n)\n\nfunc ExampleMarkdownService_Render() {\n\tclient := github.NewClient(nil)\n\n\tinput := \"# heading #\\n\\nLink to issue #1\"\n\topt := &github.MarkdownOptions{Mode: \"gfm\", Context: \"google/go-github\"}\n\n\tctx := context.Background()\n\toutput, _, err := client.Markdown.Render(ctx, input, opt)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\n\tfmt.Println(output)\n}\n\nfunc ExampleRepositoriesService_GetReadme() {\n\tclient := github.NewClient(nil)\n\n\tctx := context.Background()\n\treadme, _, err := client.Repositories.GetReadme(ctx, \"google\", \"go-github\", nil)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n\tcontent, err := readme.GetContent()\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n\tfmt.Printf(\"google/go-github README:\\n%v\\n\", content)\n}\n\nfunc ExampleRepositoriesService_ListByUser() {\n\tclient := github.NewClient(nil)\n\n\tuser := \"willnorris\"\n\topt := &github.RepositoryListByUserOptions{Type: \"owner\", Sort: \"updated\", Direction: \"desc\"}\n\n\tctx := context.Background()\n\trepos, _, err := client.Repositories.ListByUser(ctx, user, opt)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\n\tfmt.Printf(\"Recently updated repositories by %q: %v\", user, github.Stringify(repos))\n}\n\nfunc ExampleRepositoriesService_CreateFile() {\n\t// In this example we're creating a new file in a repository using the\n\t// Contents API. Only 1 file per commit can be managed through that API.\n\n\t// Note that authentication is needed here as you are performing a modification\n\t// so you will need to modify the example to provide an oauth client to\n\t// github.NewClient() instead of nil. See the following documentation for more\n\t// information on how to authenticate with the client:\n\t// https://pkg.go.dev/github.com/google/go-github/v84/github#hdr-Authentication\n\tclient := github.NewClient(nil)\n\n\tctx := context.Background()\n\tfileContent := []byte(\"This is the content of my file\\nand the 2nd line of it\")\n\n\t// Note: the file needs to be absent from the repository as you are not\n\t// specifying a SHA reference here.\n\topts := &github.RepositoryContentFileOptions{\n\t\tMessage:   github.Ptr(\"This is my commit message\"),\n\t\tContent:   fileContent,\n\t\tBranch:    github.Ptr(\"master\"),\n\t\tCommitter: &github.CommitAuthor{Name: github.Ptr(\"FirstName LastName\"), Email: github.Ptr(\"user@example.com\")},\n\t}\n\t_, _, err := client.Repositories.CreateFile(ctx, \"myOrganization\", \"myRepository\", \"myNewFile.md\", opts)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n}\n\nfunc ExampleUsersService_ListAll() {\n\tclient := github.NewClient(nil)\n\tctx := context.Background()\n\topts := &github.UserListOptions{}\n\tfor {\n\t\tusers, _, err := client.Users.ListAll(ctx, opts)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"error listing users: %v\", err)\n\t\t}\n\t\tif len(users) == 0 {\n\t\t\tbreak\n\t\t}\n\t\topts.Since = users[len(users)-1].GetID()\n\t\t// Process users...\n\t}\n}\n\nfunc ExamplePullRequestsService_Create() {\n\t// In this example we're creating a PR and displaying the HTML url at the end.\n\n\t// Note that authentication is needed here as you are performing a modification\n\t// so you will need to modify the example to provide an oauth client to\n\t// github.NewClient() instead of nil. See the following documentation for more\n\t// information on how to authenticate with the client:\n\t// https://pkg.go.dev/github.com/google/go-github/v84/github#hdr-Authentication\n\tclient := github.NewClient(nil)\n\n\tnewPR := &github.NewPullRequest{\n\t\tTitle:               github.Ptr(\"My awesome pull request\"),\n\t\tHead:                github.Ptr(\"branch_to_merge\"),\n\t\tBase:                github.Ptr(\"master\"),\n\t\tBody:                github.Ptr(\"This is the description of the PR created with the package `github.com/google/go-github/github`\"),\n\t\tMaintainerCanModify: github.Ptr(true),\n\t}\n\n\tctx := context.Background()\n\tpr, _, err := client.PullRequests.Create(ctx, \"myOrganization\", \"myRepository\", newPR)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n\tfmt.Printf(\"PR created: %v\\n\", pr.GetHTMLURL())\n}\n\nfunc ExampleTeamsService_ListTeams() {\n\t// This example shows how to get a team ID corresponding to a given team name.\n\n\t// Note that authentication is needed here as you are performing a lookup on\n\t// an organization's administrative configuration, so you will need to modify\n\t// the example to provide an oauth client to github.NewClient() instead of nil.\n\t// See the following documentation for more information on how to authenticate\n\t// with the client:\n\t// https://pkg.go.dev/github.com/google/go-github/v84/github#hdr-Authentication\n\tclient := github.NewClient(nil)\n\n\tteamName := \"Developers team\"\n\tctx := context.Background()\n\topts := &github.ListOptions{}\n\n\tfor {\n\t\tteams, resp, err := client.Teams.ListTeams(ctx, \"myOrganization\", opts)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\treturn\n\t\t}\n\t\tfor _, t := range teams {\n\t\t\tif t.GetName() == teamName {\n\t\t\t\tfmt.Printf(\"Team %q has ID %v\\n\", teamName, t.GetID())\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif resp.NextPage == 0 {\n\t\t\tbreak\n\t\t}\n\t\topts.Page = resp.NextPage\n\t}\n\n\tfmt.Printf(\"Team %q was not found\\n\", teamName)\n}\n\nfunc ExampleUsersService_ListUserSocialAccounts() {\n\tclient := github.NewClient(nil)\n\tctx := context.Background()\n\topts := &github.ListOptions{}\n\tfor {\n\t\taccounts, resp, err := client.Users.ListUserSocialAccounts(ctx, \"shreyjain13\", opts)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Failed to list user social accounts: %v\", err)\n\t\t}\n\t\tif resp.NextPage == 0 || len(accounts) == 0 {\n\t\t\tbreak\n\t\t}\n\t\topts.Page = resp.NextPage\n\t}\n}\n"
  },
  {
    "path": "github/fuzz_messages_test.go",
    "content": "// Copyright 2026 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"testing\"\n)\n\n// FuzzParseWebHook tests ParseWebHook against arbitrary event types and payloads.\n// It verifies that no input triggers a panic or nil pointer dereference.\n//\n// This fuzz test is intended for integration with OSS-Fuzz (https://google.github.io/oss-fuzz/)\n// for continuous fuzzing in the cloud.\n//\n// To run:\n//\n//\tgo test -fuzz=^FuzzParseWebHook$ -fuzztime=30s .\nfunc FuzzParseWebHook(f *testing.F) {\n\tseeds := []struct {\n\t\teventType string\n\t\tpayload   string\n\t}{\n\t\t{\"push\", `{\"ref\": \"refs/heads/main\", \"before\": \"000000\", \"after\": \"123456\", \"commits\": [{\"id\": \"abc\", \"message\": \"msg\", \"added\": [], \"removed\": [], \"modified\": []}]}`},\n\t\t{\"pull_request\", `{\"action\": \"opened\", \"number\": 1, \"pull_request\": {\"title\": \"test\", \"state\": \"open\", \"user\": {\"login\": \"u\"}}}`},\n\t\t{\"issues\", `{\"action\": \"opened\", \"issue\": {\"number\": 42, \"title\": \"bug\", \"state\": \"open\"}}`},\n\t\t{\"release\", `{\"action\": \"published\", \"release\": {\"tag_name\": \"v1.0.0\", \"draft\": false}}`},\n\t\t{\"check_run\", `{\"action\": \"created\", \"check_run\": {\"status\": \"in_progress\", \"id\": 1}}`},\n\t\t{\"check_suite\", `{\"action\": \"completed\", \"check_suite\": {\"id\": 1, \"status\": \"completed\"}}`},\n\t\t{\"workflow_run\", `{\"action\": \"requested\", \"workflow_run\": {\"id\": 123, \"status\": \"queued\"}}`},\n\t\t{\"workflow_job\", `{\"action\": \"queued\", \"workflow_job\": {\"id\": 1, \"status\": \"queued\"}}`},\n\t\t{\"discussion\", `{\"action\": \"created\", \"discussion\": {\"title\": \"hello\", \"number\": 1}}`},\n\t\t{\"ping\", `{\"zen\": \"Keep it logically awesome.\", \"hook_id\": 1}`},\n\t\t{\"repository\", `{\"action\": \"created\", \"repository\": {\"name\": \"test-repo\", \"private\": false}}`},\n\t\t{\"star\", `{\"action\": \"created\", \"starred_at\": \"2026-03-11T00:00:00Z\"}`},\n\t\t{\"create\", `{\"ref\": \"main\", \"ref_type\": \"branch\"}`},\n\t\t{\"delete\", `{\"ref\": \"old-branch\", \"ref_type\": \"branch\"}`},\n\t\t{\"fork\", `{\"forkee\": {\"name\": \"forked-repo\"}}`},\n\t\t{\"deployment\", `{\"action\": \"created\", \"deployment\": {\"id\": 1, \"ref\": \"main\"}}`},\n\t\t{\"deployment_status\", `{\"action\": \"created\", \"deployment_status\": {\"id\": 1, \"state\": \"pending\"}}`},\n\t\t{\"member\", `{\"action\": \"added\", \"member\": {\"login\": \"user\"}}`},\n\t\t{\"public\", `{\"repository\": {\"name\": \"now-public\"}}`},\n\t\t{\"commit_comment\", `{\"action\": \"created\", \"comment\": {\"id\": 1, \"body\": \"comment\"}}`},\n\t}\n\tfor _, s := range seeds {\n\t\tf.Add(s.eventType, []byte(s.payload))\n\t}\n\n\tfor _, messageType := range MessageTypes() {\n\t\tproto := EventForType(messageType)\n\t\tif proto == nil {\n\t\t\tf.Add(messageType, []byte(`{}`))\n\t\t\tcontinue\n\t\t}\n\t\t// Generate a seed by marshaling the zero-value struct so the fuzzer\n\t\t// starts from a structurally valid JSON skeleton for each event type.\n\t\tb, err := json.Marshal(proto)\n\t\tif err != nil {\n\t\t\tf.Add(messageType, []byte(`{}`))\n\t\t\tcontinue\n\t\t}\n\t\tf.Add(messageType, b)\n\t}\n\n\tf.Fuzz(func(_ *testing.T, eventType string, payload []byte) {\n\t\tif len(payload) > 1<<20 {\n\t\t\treturn\n\t\t}\n\t\tevent, err := ParseWebHook(eventType, payload)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tif event != nil {\n\t\t\t// Traverse all fields recursively to catch nil pointer dereferences\n\t\t\t_ = fmt.Sprintf(\"%+v\", event)\n\t\t}\n\t})\n}\n"
  },
  {
    "path": "github/gen-accessors.go",
    "content": "// Copyright 2017 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n//go:build ignore\n\n// gen-accessors generates accessor methods for all struct fields.\n// This is so that interfaces can be easily crafted by users of this repo\n// within their own code bases.\n// See https://github.com/google/go-github/issues/4059 for details.\n//\n// It is meant to be used by go-github contributors in conjunction with the\n// go generate tool before sending a PR to GitHub.\n// Please see the CONTRIBUTING.md file for more information.\n//\n// Usage:\n//\n//\tgo run gen-accessors.go [-v [file1.go file2.go ...]]\npackage main\n\nimport (\n\t\"bytes\"\n\t\"flag\"\n\t\"fmt\"\n\t\"go/ast\"\n\t\"go/format\"\n\t\"go/parser\"\n\t\"go/token\"\n\t\"log\"\n\t\"os\"\n\t\"slices\"\n\t\"strings\"\n\t\"text/template\"\n)\n\nconst (\n\tfileSuffix = \"-accessors.go\"\n)\n\nvar (\n\tverbose = flag.Bool(\"v\", false, \"Print verbose log messages\")\n\n\tsourceTmpl = template.Must(template.New(\"source\").Parse(source))\n\ttestTmpl   = template.Must(template.New(\"test\").Parse(test))\n\n\t// skipStructMethods lists \"struct.method\" combos to skip.\n\tskipStructMethods = map[string]bool{\n\t\t\"AbuseRateLimitError.GetResponse\": true,\n\t\t\"Client.GetBaseURL\":               true,\n\t\t\"Client.GetUploadURL\":             true,\n\t\t\"ErrorResponse.GetResponse\":       true,\n\t\t\"MarketplaceService.GetStubbed\":   true,\n\t\t\"PackageVersion.GetBody\":          true,\n\t\t\"PackageVersion.GetMetadata\":      true,\n\t\t\"RateLimitError.GetResponse\":      true,\n\t\t\"RepositoryContent.GetContent\":    true,\n\t}\n\t// skipStructs lists structs to skip.\n\tskipStructs = map[string]bool{\n\t\t\"Client\": true,\n\t}\n\n\t// whitelistSliceGetters lists \"struct.field\" to add getter method\n\twhitelistSliceGetters = map[string]bool{\n\t\t\"PushEvent.Commits\": true,\n\t}\n)\n\nfunc logf(fmt string, args ...any) {\n\tif *verbose {\n\t\tlog.Printf(fmt, args...)\n\t}\n}\n\nfunc main() {\n\tflag.Parse()\n\n\t// For debugging purposes, processing just a single or a few files is helpful:\n\tvar processOnly map[string]bool\n\tif *verbose { // Only create the map if args are provided.\n\t\tfor _, arg := range flag.Args() {\n\t\t\tif processOnly == nil {\n\t\t\t\tprocessOnly = map[string]bool{}\n\t\t\t}\n\t\t\tprocessOnly[arg] = true\n\t\t}\n\t}\n\n\tfset := token.NewFileSet()\n\n\tpkgs, err := parser.ParseDir(fset, \".\", sourceFilter, 0)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t\treturn\n\t}\n\n\tfor pkgName, pkg := range pkgs {\n\t\tt := &templateData{\n\t\t\tfilename: pkgName + fileSuffix,\n\t\t\tYear:     2017,\n\t\t\tPackage:  pkgName,\n\t\t\tImports:  map[string]string{},\n\t\t}\n\t\tfor filename, f := range pkg.Files {\n\t\t\tif *verbose && processOnly != nil && !processOnly[filename] {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tlogf(\"Processing %v...\", filename)\n\t\t\tif err := t.processAST(f); err != nil {\n\t\t\t\tlog.Fatal(err)\n\t\t\t}\n\t\t}\n\t\tif err := t.dump(); err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t}\n\tlogf(\"Done.\")\n}\n\nfunc (t *templateData) processAST(f *ast.File) error {\n\tfor _, decl := range f.Decls {\n\t\tgd, ok := decl.(*ast.GenDecl)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tfor _, spec := range gd.Specs {\n\t\t\tts, ok := spec.(*ast.TypeSpec)\n\t\t\tif !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// Skip unexported identifiers.\n\t\t\tif !ts.Name.IsExported() {\n\t\t\t\tlogf(\"Struct %v is unexported; skipping.\", ts.Name)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// Check if the struct should be skipped.\n\t\t\tif skipStructs[ts.Name.Name] {\n\t\t\t\tlogf(\"Struct %v is in skip list; skipping.\", ts.Name)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif _, ok := ts.Type.(*ast.Ident); ok { // e.g. type SomeService service\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tst, ok := ts.Type.(*ast.StructType)\n\t\t\tif !ok {\n\t\t\t\tlogf(\"Skipping TypeSpec of type %T\", ts.Type)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor _, field := range st.Fields.List {\n\t\t\t\tif len(field.Names) == 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tfieldName := field.Names[0]\n\t\t\t\t// Skip unexported identifiers.\n\t\t\t\tif !fieldName.IsExported() {\n\t\t\t\t\tlogf(\"Field %v is unexported; skipping.\", fieldName)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t// Check if \"struct.method\" should be skipped.\n\t\t\t\tif key := fmt.Sprintf(\"%v.Get%v\", ts.Name, fieldName); skipStructMethods[key] {\n\t\t\t\t\tlogf(\"Method %v is skip list; skipping.\", key)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tse, ok := field.Type.(*ast.StarExpr)\n\t\t\t\tif !ok {\n\t\t\t\t\tswitch x := field.Type.(type) {\n\t\t\t\t\tcase *ast.MapType:\n\t\t\t\t\t\tlogf(\"processAST: addMapType(x, %q, %q)\", ts.Name.String(), fieldName.String())\n\t\t\t\t\t\tt.addMapType(x, ts.Name.String(), fieldName.String(), false)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\tcase *ast.ArrayType:\n\t\t\t\t\t\tlogf(\"processAST: addArrayType(x, %q, %q)\", ts.Name.String(), fieldName.String())\n\t\t\t\t\t\tt.addArrayType(x, ts.Name.String(), fieldName.String(), false)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\tcase *ast.Ident:\n\t\t\t\t\t\tlogf(\"processAST: addSimpleValueIdent(x, %q, %q)\", ts.Name.String(), fieldName.String())\n\t\t\t\t\t\tt.addSimpleValueIdent(x, ts.Name.String(), fieldName.String())\n\t\t\t\t\t\tcontinue\n\t\t\t\t\tcase *ast.SelectorExpr:\n\t\t\t\t\t\tlogf(\"processAST: addSimpleValueSelectorExpr(x, %q, %q)\", ts.Name.String(), fieldName.String())\n\t\t\t\t\t\tt.addSimpleValueSelectorExpr(x, ts.Name.String(), fieldName.String())\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\tlogf(\"Skipping field type %T, fieldName=%v\", field.Type, fieldName)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tswitch x := se.X.(type) {\n\t\t\t\tcase *ast.ArrayType:\n\t\t\t\t\tt.addArrayType(x, ts.Name.String(), fieldName.String(), true)\n\t\t\t\tcase *ast.Ident:\n\t\t\t\t\tt.addIdent(x, ts.Name.String(), fieldName.String())\n\t\t\t\tcase *ast.MapType:\n\t\t\t\t\tt.addMapType(x, ts.Name.String(), fieldName.String(), true)\n\t\t\t\tcase *ast.SelectorExpr:\n\t\t\t\t\tt.addSelectorExpr(x, ts.Name.String(), fieldName.String())\n\t\t\t\tdefault:\n\t\t\t\t\tlogf(\"processAST: type %q, field %q, unknown %T: %+v\", ts.Name, fieldName, x, x)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc sourceFilter(fi os.FileInfo) bool {\n\treturn !strings.HasSuffix(fi.Name(), \"_test.go\") && !strings.HasSuffix(fi.Name(), fileSuffix)\n}\n\nfunc (t *templateData) dump() error {\n\tif len(t.Getters) == 0 {\n\t\tlogf(\"No getters for %v; skipping.\", t.filename)\n\t\treturn nil\n\t}\n\n\t// Sort getters by ReceiverType.FieldName.\n\tslices.SortStableFunc(t.Getters, func(a, b *getter) int {\n\t\treturn strings.Compare(a.sortVal, b.sortVal)\n\t})\n\n\tprocessTemplate := func(tmpl *template.Template, filename string) error {\n\t\tvar buf bytes.Buffer\n\t\tif err := tmpl.Execute(&buf, t); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tclean, err := format.Source(buf.Bytes())\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"format.Source:\\n%v\\n%v\", buf.String(), err)\n\t\t}\n\n\t\tlogf(\"Writing %v...\", filename)\n\t\tif err := os.Chmod(filename, 0o644); err != nil {\n\t\t\treturn fmt.Errorf(\"os.Chmod(%q, 0644): %v\", filename, err)\n\t\t}\n\n\t\tif err := os.WriteFile(filename, clean, 0o444); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err := os.Chmod(filename, 0o444); err != nil {\n\t\t\treturn fmt.Errorf(\"os.Chmod(%q, 0444): %v\", filename, err)\n\t\t}\n\n\t\treturn nil\n\t}\n\n\tif err := processTemplate(sourceTmpl, t.filename); err != nil {\n\t\treturn err\n\t}\n\treturn processTemplate(testTmpl, strings.ReplaceAll(t.filename, \".go\", \"_test.go\"))\n}\n\nfunc newGetter(receiverType, fieldName, fieldType, zeroValue string, namedStruct bool) *getter {\n\treturn &getter{\n\t\tsortVal:      strings.ToLower(receiverType) + \".\" + strings.ToLower(fieldName),\n\t\tReceiverVar:  strings.ToLower(receiverType[:1]),\n\t\tReceiverType: receiverType,\n\t\tFieldName:    fieldName,\n\t\tFieldType:    fieldType,\n\t\tZeroValue:    zeroValue,\n\t\tNamedStruct:  namedStruct,\n\t}\n}\n\nfunc (t *templateData) addArrayType(x *ast.ArrayType, receiverType, fieldName string, isAPointer bool) {\n\tvar eltType string\n\tvar ng *getter\n\tswitch elt := x.Elt.(type) {\n\tcase *ast.Ident:\n\t\teltType = elt.String()\n\t\tng = newGetter(receiverType, fieldName, \"[]\"+eltType, \"nil\", false)\n\tcase *ast.StarExpr:\n\t\tident, ok := elt.X.(*ast.Ident)\n\t\tif !ok {\n\t\t\treturn\n\t\t}\n\t\tng = newGetter(receiverType, fieldName, \"[]*\"+ident.String(), \"nil\", false)\n\tdefault:\n\t\tlogf(\"addArrayType: type %q, field %q: unknown elt type: %T %+v; skipping.\", receiverType, fieldName, elt, elt)\n\t\treturn\n\t}\n\n\tng.ArrayType = !isAPointer\n\tt.Getters = append(t.Getters, ng)\n}\n\nfunc (t *templateData) addSimpleValueIdent(x *ast.Ident, receiverType, fieldName string) {\n\tgetter := genIdentGetter(x, receiverType, fieldName)\n\tgetter.IsSimpleValue = true\n\tlogf(\"addSimpleValueIdent: Processing %q - fieldName=%q, getter.ZeroValue=%q, x.Obj=%#v\", x.String(), fieldName, getter.ZeroValue, x.Obj)\n\tif getter.ZeroValue == \"nil\" {\n\t\tif x.Obj == nil {\n\t\t\tswitch x.String() {\n\t\t\tcase \"any\": // NOOP - leave as `nil`\n\t\t\tdefault:\n\t\t\t\tgetter.ZeroValue = x.String() + \"{}\"\n\t\t\t}\n\t\t} else {\n\t\t\tif ts, ok := x.Obj.Decl.(*ast.TypeSpec); ok {\n\t\t\t\tlogf(\"addSimpleValueIdent: Processing %q of type %T\", x.String(), ts.Type)\n\t\t\t\tswitch xX := ts.Type.(type) {\n\t\t\t\tcase *ast.Ident:\n\t\t\t\t\tlogf(\"addSimpleValueIdent: Processing %q of type %T - zero value is %q\", x.String(), ts.Type, getter.ZeroValue)\n\t\t\t\t\tgetter.ZeroValue = zeroValueOfIdent(xX)\n\t\t\t\tcase *ast.StructType:\n\t\t\t\t\tgetter.ZeroValue = x.String() + \"{}\"\n\t\t\t\t\tlogf(\"addSimpleValueIdent: Processing %q of type %T - zero value is %q\", x.String(), ts.Type, getter.ZeroValue)\n\t\t\t\tcase *ast.InterfaceType, *ast.ArrayType: // NOOP - leave as `nil`\n\t\t\t\t\tlogf(\"addSimpleValueIdent: Processing %q of type %T - zero value is %q\", x.String(), ts.Type, getter.ZeroValue)\n\t\t\t\tdefault:\n\t\t\t\t\tlog.Fatalf(\"addSimpleValueIdent: unhandled case %T\", xX)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tt.Getters = append(t.Getters, getter)\n}\n\nfunc (t *templateData) addIdent(x *ast.Ident, receiverType, fieldName string) {\n\tgetter := genIdentGetter(x, receiverType, fieldName)\n\tt.Getters = append(t.Getters, getter)\n}\n\nfunc zeroValueOfIdent(x *ast.Ident) string {\n\tswitch x.String() {\n\tcase \"int\", \"int64\", \"float64\", \"uint8\", \"uint16\":\n\t\treturn \"0\"\n\tcase \"string\":\n\t\treturn `\"\"`\n\tcase \"bool\":\n\t\treturn \"false\"\n\tcase \"Timestamp\":\n\t\treturn \"Timestamp{}\"\n\tdefault:\n\t\treturn \"nil\"\n\t}\n}\n\nfunc genIdentGetter(x *ast.Ident, receiverType, fieldName string) *getter {\n\tzeroValue := zeroValueOfIdent(x)\n\tnamedStruct := zeroValue == \"nil\"\n\treturn newGetter(receiverType, fieldName, x.String(), zeroValue, namedStruct)\n}\n\nfunc (t *templateData) addMapType(x *ast.MapType, receiverType, fieldName string, isAPointer bool) {\n\tvar keyType string\n\tswitch key := x.Key.(type) {\n\tcase *ast.Ident:\n\t\tkeyType = key.String()\n\tdefault:\n\t\tlogf(\"addMapType: type %q, field %q: unknown key type: %T %+v; skipping.\", receiverType, fieldName, key, key)\n\t\treturn\n\t}\n\n\tvar valueType string\n\tswitch value := x.Value.(type) {\n\tcase *ast.Ident:\n\t\tvalueType = value.String()\n\tdefault:\n\t\tlogf(\"addMapType: type %q, field %q: unknown value type: %T %+v; skipping.\", receiverType, fieldName, value, value)\n\t\treturn\n\t}\n\n\tfieldType := fmt.Sprintf(\"map[%v]%v\", keyType, valueType)\n\tzeroValue := fmt.Sprintf(\"map[%v]%v{}\", keyType, valueType)\n\tng := newGetter(receiverType, fieldName, fieldType, zeroValue, false)\n\tng.MapType = !isAPointer\n\tt.Getters = append(t.Getters, ng)\n}\n\nfunc (t *templateData) addSimpleValueSelectorExpr(x *ast.SelectorExpr, receiverType, fieldName string) {\n\tgetter := t.genSelectorExprGetter(x, receiverType, fieldName)\n\tif getter == nil {\n\t\treturn\n\t}\n\tgetter.IsSimpleValue = true\n\tlogf(\"addSimpleValueSelectorExpr: Processing field name %q - %#v - zero value is %q\", fieldName, x, getter.ZeroValue)\n\tt.Getters = append(t.Getters, getter)\n}\n\nfunc (t *templateData) addSelectorExpr(x *ast.SelectorExpr, receiverType, fieldName string) {\n\tgetter := t.genSelectorExprGetter(x, receiverType, fieldName)\n\tif getter == nil {\n\t\treturn\n\t}\n\tt.Getters = append(t.Getters, getter)\n}\n\nfunc (t *templateData) genSelectorExprGetter(x *ast.SelectorExpr, receiverType, fieldName string) *getter {\n\tif strings.ToLower(fieldName[:1]) == fieldName[:1] { // Non-exported field.\n\t\treturn nil\n\t}\n\n\tvar xX string\n\tif xx, ok := x.X.(*ast.Ident); ok {\n\t\txX = xx.String()\n\t}\n\n\tswitch xX {\n\tcase \"time\", \"json\":\n\t\tif xX == \"json\" {\n\t\t\tt.Imports[\"encoding/json\"] = \"encoding/json\"\n\t\t} else {\n\t\t\tt.Imports[xX] = xX\n\t\t}\n\t\tfieldType := fmt.Sprintf(\"%v.%v\", xX, x.Sel.Name)\n\t\tzeroValue := fmt.Sprintf(\"%v.%v{}\", xX, x.Sel.Name)\n\t\tif xX == \"time\" && x.Sel.Name == \"Duration\" {\n\t\t\tzeroValue = \"0\"\n\t\t}\n\t\treturn newGetter(receiverType, fieldName, fieldType, zeroValue, false)\n\tdefault:\n\t\tlogf(\"addSelectorExpr: xX %q, type %q, field %q: unknown x=%+v; skipping.\", xX, receiverType, fieldName, x)\n\t}\n\n\treturn nil\n}\n\ntype templateData struct {\n\tfilename string\n\tYear     int\n\tPackage  string\n\tImports  map[string]string\n\tGetters  []*getter\n}\n\ntype getter struct {\n\tsortVal       string // Lower-case version of \"ReceiverType.FieldName\".\n\tReceiverVar   string // The one-letter variable name to match the ReceiverType.\n\tReceiverType  string\n\tFieldName     string\n\tFieldType     string\n\tZeroValue     string\n\tNamedStruct   bool // Getter for named struct.\n\tMapType       bool\n\tArrayType     bool\n\tIsSimpleValue bool\n}\n\nconst source = `// Code generated by gen-accessors; DO NOT EDIT.\n// Instead, please run \"go generate ./...\" as described here:\n// https://github.com/google/go-github/blob/master/CONTRIBUTING.md#submitting-a-patch\n\n// Copyright {{.Year}} The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage {{.Package}}\n{{with .Imports}}\nimport (\n  {{- range . -}}\n  \"{{.}}\"\n  {{end -}}\n)\n{{end}}\n{{range .Getters}}\n{{if .IsSimpleValue}}\n// Get{{.FieldName}} returns the {{.FieldName}} field.\nfunc ({{.ReceiverVar}} *{{.ReceiverType}}) Get{{.FieldName}}() {{.FieldType}} {\n  if {{.ReceiverVar}} == nil {\n    return {{.ZeroValue}}\n  }\n  return {{.ReceiverVar}}.{{.FieldName}}\n}\n{{else if .NamedStruct}}\n// Get{{.FieldName}} returns the {{.FieldName}} field.\nfunc ({{.ReceiverVar}} *{{.ReceiverType}}) Get{{.FieldName}}() *{{.FieldType}} {\n  if {{.ReceiverVar}} == nil {\n    return {{.ZeroValue}}\n  }\n  return {{.ReceiverVar}}.{{.FieldName}}\n}\n{{else if or .MapType .ArrayType }}\n// Get{{.FieldName}} returns the {{.FieldName}} {{if .MapType}}map{{else if .ArrayType }}slice{{end}} if it's non-nil, {{if .MapType}}an empty map{{else if .ArrayType }}nil{{end}} otherwise.\nfunc ({{.ReceiverVar}} *{{.ReceiverType}}) Get{{.FieldName}}() {{.FieldType}} {\n  if {{.ReceiverVar}} == nil || {{.ReceiverVar}}.{{.FieldName}} == nil {\n    return {{.ZeroValue}}\n  }\n  return {{.ReceiverVar}}.{{.FieldName}}\n}\n{{else}}\n// Get{{.FieldName}} returns the {{.FieldName}} field if it's non-nil, zero value otherwise.\nfunc ({{.ReceiverVar}} *{{.ReceiverType}}) Get{{.FieldName}}() {{.FieldType}} {\n  if {{.ReceiverVar}} == nil || {{.ReceiverVar}}.{{.FieldName}} == nil {\n    return {{.ZeroValue}}\n  }\n  return *{{.ReceiverVar}}.{{.FieldName}}\n}\n{{end}}\n{{end}}\n`\n\nconst test = `// Code generated by gen-accessors; DO NOT EDIT.\n// Instead, please run \"go generate ./...\" as described here:\n// https://github.com/google/go-github/blob/master/CONTRIBUTING.md#submitting-a-patch\n\n// Copyright {{.Year}} The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage {{.Package}}\n{{with .Imports}}\nimport (\n  \"testing\"\n  {{range . -}}\n  \"{{.}}\"\n  {{end -}}\n)\n{{end}}\n{{range .Getters}}\n{{if .IsSimpleValue}}\nfunc Test{{.ReceiverType}}_Get{{.FieldName}}(tt *testing.T) {\n  tt.Parallel()\n  {{.ReceiverVar}} := &{{.ReceiverType}}{}\n  {{.ReceiverVar}}.Get{{.FieldName}}()\n  {{.ReceiverVar}} = nil\n  {{.ReceiverVar}}.Get{{.FieldName}}()\n}\n{{else if .NamedStruct}}\nfunc Test{{.ReceiverType}}_Get{{.FieldName}}(tt *testing.T) {\n  tt.Parallel()\n  {{.ReceiverVar}} := &{{.ReceiverType}}{}\n  {{.ReceiverVar}}.Get{{.FieldName}}()\n  {{.ReceiverVar}} = nil\n  {{.ReceiverVar}}.Get{{.FieldName}}()\n}\n{{else if or .MapType .ArrayType}}\nfunc Test{{.ReceiverType}}_Get{{.FieldName}}(tt *testing.T) {\n  tt.Parallel()\n  zeroValue := {{.FieldType}}{}\n  {{.ReceiverVar}} := &{{.ReceiverType}}{ {{.FieldName}}: zeroValue }\n  {{.ReceiverVar}}.Get{{.FieldName}}()\n  {{.ReceiverVar}} = &{{.ReceiverType}}{}\n  {{.ReceiverVar}}.Get{{.FieldName}}()\n  {{.ReceiverVar}} = nil\n  {{.ReceiverVar}}.Get{{.FieldName}}()\n}\n{{else}}\nfunc Test{{.ReceiverType}}_Get{{.FieldName}}(tt *testing.T) {\n  tt.Parallel()\n  var zeroValue {{.FieldType}}\n  {{.ReceiverVar}} := &{{.ReceiverType}}{ {{.FieldName}}: &zeroValue }\n  {{.ReceiverVar}}.Get{{.FieldName}}()\n  {{.ReceiverVar}} = &{{.ReceiverType}}{}\n  {{.ReceiverVar}}.Get{{.FieldName}}()\n  {{.ReceiverVar}} = nil\n  {{.ReceiverVar}}.Get{{.FieldName}}()\n}\n{{end}}\n{{end}}\n`\n"
  },
  {
    "path": "github/gen-iterators.go",
    "content": "// Copyright 2026 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n//go:build ignore\n\n// gen-iterators generates iterator methods for List methods.\n//\n// It is meant to be used by go-github contributors in conjunction with the\n// go generate tool before sending a PR to GitHub.\n// Please see the CONTRIBUTING.md file for more information.\npackage main\n\nimport (\n\t\"bytes\"\n\t\"flag\"\n\t\"fmt\"\n\t\"go/ast\"\n\t\"go/format\"\n\t\"go/parser\"\n\t\"go/token\"\n\t\"log\"\n\t\"os\"\n\t\"reflect\"\n\t\"slices\"\n\t\"strconv\"\n\t\"strings\"\n\t\"text/template\"\n)\n\nconst (\n\tfileSuffix = \"-iterators.go\"\n)\n\nvar (\n\tverbose = flag.Bool(\"v\", false, \"Print verbose log messages\")\n\n\tsourceTmpl = template.Must(template.New(\"source\").Funcs(template.FuncMap{\n\t\t\"hasPrefix\": strings.HasPrefix,\n\t}).Parse(source))\n\n\ttestTmpl = template.Must(template.New(\"test\").Parse(test))\n)\n\nfunc logf(fmt string, args ...any) {\n\tif *verbose {\n\t\tlog.Printf(fmt, args...)\n\t}\n}\n\nfunc main() {\n\tflag.Parse()\n\tfset := token.NewFileSet()\n\n\t// Parse the current directory\n\tpkgs, err := parser.ParseDir(fset, \".\", sourceFilter, 0)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t\treturn\n\t}\n\n\tfor pkgName, pkg := range pkgs {\n\t\tt := &templateData{\n\t\t\tfilename: pkgName + fileSuffix,\n\t\t\tPackage:  pkgName,\n\t\t\tMethods:  []*method{},\n\t\t\tStructs:  make(map[string]*structDef),\n\t\t}\n\n\t\tfor _, f := range pkg.Files {\n\t\t\tt.processStructs(f)\n\t\t}\n\n\t\tfor _, f := range pkg.Files {\n\t\t\tif err := t.processMethods(f); err != nil {\n\t\t\t\tlog.Fatal(err)\n\t\t\t}\n\t\t}\n\n\t\tif err := t.dump(); err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t}\n\tlogf(\"Done.\")\n}\n\nfunc sourceFilter(fi os.FileInfo) bool {\n\treturn !strings.HasSuffix(fi.Name(), \"_test.go\") && !strings.HasSuffix(fi.Name(), fileSuffix) && !strings.HasPrefix(fi.Name(), \"gen-\")\n}\n\ntype templateData struct {\n\tfilename string\n\tPackage  string\n\tMethods  []*method\n\tStructs  map[string]*structDef\n}\n\ntype structDef struct {\n\tName      string\n\tFields    map[string]string\n\tFieldJSON map[string]string\n\tEmbeds    []string\n}\n\ntype method struct {\n\tRecvType             string\n\tRecvVar              string\n\tClientField          string\n\tMethodName           string\n\tIterMethod           string\n\tArgs                 string\n\tCallArgs             string\n\tTestCallArgs         string\n\tZeroArgs             string\n\tReturnType           string\n\tOptsType             string\n\tOptsName             string\n\tOptsIsPtr            bool\n\tUseListCursorOptions bool\n\tUseListOptions       bool\n\tUsePage              bool\n\tUseAfter             bool\n\tUseCursor            bool\n\tWrappedItemsField    string\n\tTestJSON1            string\n\tTestJSON2            string\n\tTestJSON3            string\n}\n\ntype methodInfo struct {\n\tRecvTypeRaw          string\n\tRecvType             string\n\tRecvVar              string\n\tClientField          string\n\tArgs                 string\n\tCallArgs             string\n\tTestCallArgs         string\n\tZeroArgs             string\n\tOptsType             string\n\tOptsName             string\n\tOptsIsPtr            bool\n\tUseListCursorOptions bool\n\tUseListOptions       bool\n\tUsePage              bool\n\tUseAfter             bool\n\tUseCursor            bool\n}\n\n// useCursorPagination identifies method names that require `Cursor` pagination\n// instead of using `After`.\nvar useCursorPagination = map[string]bool{\n\t\"AppsService.ListHookDeliveries\":          true,\n\t\"OrganizationsService.ListHookDeliveries\": true,\n\t\"RepositoriesService.ListHookDeliveries\":  true,\n}\n\n// customTestJSON maps method names to the JSON response they expect in tests.\n// This is needed for methods that internally unmarshal a wrapper struct\n// even though they return a slice.\nvar customTestJSON = map[string]string{\n\t\"ListAllTopics\":         `{\"names\": []}`,\n\t\"ListUserInstallations\": `{\"installations\": []}`,\n}\n\nfunc (t *templateData) processStructs(f *ast.File) {\n\tfor _, decl := range f.Decls {\n\t\tgd, ok := decl.(*ast.GenDecl)\n\t\tif !ok || gd.Tok != token.TYPE {\n\t\t\tcontinue\n\t\t}\n\t\tfor _, spec := range gd.Specs {\n\t\t\tts, ok := spec.(*ast.TypeSpec)\n\t\t\tif !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tst, ok := ts.Type.(*ast.StructType)\n\t\t\tif !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tsd := &structDef{\n\t\t\t\tName:      ts.Name.Name,\n\t\t\t\tFields:    make(map[string]string),\n\t\t\t\tFieldJSON: make(map[string]string),\n\t\t\t}\n\n\t\t\tfieldJSON := \"\"\n\t\t\tfor _, field := range st.Fields.List {\n\t\t\t\ttypeStr := typeToString(field.Type)\n\t\t\t\tfieldJSON = \"\"\n\t\t\t\tif field.Tag != nil {\n\t\t\t\t\tif unquotedTag, err := strconv.Unquote(field.Tag.Value); err == nil {\n\t\t\t\t\t\tfieldJSON = reflect.StructTag(unquotedTag).Get(\"json\")\n\t\t\t\t\t\tif idx := strings.Index(fieldJSON, \",\"); idx >= 0 {\n\t\t\t\t\t\t\tfieldJSON = fieldJSON[:idx]\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif fieldJSON == \"-\" {\n\t\t\t\t\t\t\tfieldJSON = \"\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif len(field.Names) == 0 {\n\t\t\t\t\tsd.Embeds = append(sd.Embeds, strings.TrimPrefix(typeStr, \"*\"))\n\t\t\t\t} else {\n\t\t\t\t\tfor _, name := range field.Names {\n\t\t\t\t\t\tsd.Fields[name.Name] = typeStr\n\t\t\t\t\t\tif fieldJSON != \"\" {\n\t\t\t\t\t\t\tsd.FieldJSON[name.Name] = fieldJSON\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tt.Structs[sd.Name] = sd\n\t\t}\n\t}\n}\n\nfunc (t *templateData) hasListCursorOptions(structName string) bool {\n\treturn t.hasOptions(structName, \"ListCursorOptions\")\n}\n\nfunc (t *templateData) hasListOptions(structName string) bool {\n\treturn t.hasOptions(structName, \"ListOptions\")\n}\n\nfunc (t *templateData) hasOptions(structName, optionsType string) bool {\n\tsd, ok := t.Structs[structName]\n\tif !ok {\n\t\treturn false\n\t}\n\tfor _, embed := range sd.Embeds {\n\t\tif embed == optionsType {\n\t\t\treturn true\n\t\t}\n\t\tif t.hasOptions(embed, optionsType) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (t *templateData) hasIntPage(structName string) bool {\n\tsd, ok := t.Structs[structName]\n\tif !ok {\n\t\treturn false\n\t}\n\tif typeStr, ok := sd.Fields[\"Page\"]; ok {\n\t\treturn typeStr == \"int\"\n\t}\n\tfor _, embed := range sd.Embeds {\n\t\tif t.hasIntPage(embed) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (t *templateData) hasStringAfter(structName string) bool {\n\tsd, ok := t.Structs[structName]\n\tif !ok {\n\t\treturn false\n\t}\n\tif typeStr, ok := sd.Fields[\"After\"]; ok {\n\t\treturn typeStr == \"string\"\n\t}\n\tfor _, embed := range sd.Embeds {\n\t\tif t.hasStringAfter(embed) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc getZeroValue(typeStr string) string {\n\tswitch typeStr {\n\tcase \"int\", \"int64\", \"int32\":\n\t\treturn \"0\"\n\tcase \"string\":\n\t\treturn `\"\"`\n\tcase \"bool\":\n\t\treturn \"false\"\n\tcase \"context.Context\":\n\t\treturn \"t.Context()\"\n\tdefault:\n\t\treturn \"nil\"\n\t}\n}\n\nfunc (t *templateData) processMethods(f *ast.File) error {\n\tfor _, decl := range f.Decls {\n\t\tfd, ok := decl.(*ast.FuncDecl)\n\t\tif !ok || fd.Recv == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tif !fd.Name.IsExported() || !strings.HasPrefix(fd.Name.Name, \"List\") {\n\t\t\tcontinue\n\t\t}\n\n\t\tif strings.Contains(fd.Name.Name, \"MatchingRefs\") {\n\t\t\tcontinue\n\t\t}\n\n\t\tif fd.Type.Results == nil || len(fd.Type.Results.List) != 3 {\n\t\t\tcontinue\n\t\t}\n\n\t\tmethodInfo, ok := t.isMethodIterable(fd)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\n\t\tswitch retType := fd.Type.Results.List[0].Type.(type) {\n\t\tcase *ast.ArrayType:\n\t\t\tt.processReturnArrayType(fd, retType, methodInfo)\n\t\tcase *ast.StarExpr:\n\t\t\tt.processReturnStarExpr(fd, retType, methodInfo)\n\t\tdefault:\n\t\t\tlog.Fatalf(\"unhandled return type: %T\", retType)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (t *templateData) isMethodIterable(fd *ast.FuncDecl) (*methodInfo, bool) {\n\tif !validateMethodShape(fd) {\n\t\treturn nil, false\n\t}\n\n\tmethodInfo, ok := t.collectMethodInfo(fd)\n\tif !ok {\n\t\treturn nil, false\n\t}\n\n\treturn methodInfo, true\n}\n\nfunc validateMethodShape(fd *ast.FuncDecl) bool {\n\tif typeToString(fd.Type.Results.List[1].Type) != \"*Response\" {\n\t\treturn false\n\t}\n\tif typeToString(fd.Type.Results.List[2].Type) != \"error\" {\n\t\treturn false\n\t}\n\n\trecvType := typeToString(fd.Recv.List[0].Type)\n\tif !strings.HasPrefix(recvType, \"*\") || !strings.HasSuffix(recvType, \"Service\") {\n\t\treturn false\n\t}\n\n\treturn true\n}\n\nfunc (t *templateData) collectMethodInfo(fd *ast.FuncDecl) (*methodInfo, bool) {\n\trecvType := typeToString(fd.Recv.List[0].Type)\n\trecvVar := \"\"\n\tif len(fd.Recv.List[0].Names) > 0 {\n\t\trecvVar = fd.Recv.List[0].Names[0].Name\n\t}\n\n\targs := []string{}\n\tcallArgs := []string{}\n\ttestCallArgs := []string{}\n\tzeroArgs := []string{}\n\tvar optsType string\n\tvar optsName string\n\thasOpts := false\n\toptsIsPtr := false\n\n\tfor _, field := range fd.Type.Params.List {\n\t\ttypeStr := typeToString(field.Type)\n\t\tzeroArg := getZeroValue(typeStr)\n\t\tfor _, name := range field.Names {\n\t\t\targs = append(args, fmt.Sprintf(\"%v %v\", name.Name, typeStr))\n\t\t\tcallArgs = append(callArgs, name.Name)\n\t\t\tzeroArgs = append(zeroArgs, zeroArg)\n\n\t\t\tif strings.HasSuffix(typeStr, \"Options\") {\n\t\t\t\toptsType = strings.TrimPrefix(typeStr, \"*\")\n\t\t\t\toptsName = name.Name\n\t\t\t\thasOpts = true\n\t\t\t\toptsIsPtr = strings.HasPrefix(typeStr, \"*\")\n\t\t\t}\n\t\t}\n\t\t// second pass: generate testCallArgs after optsName is identified\n\t\tfor _, name := range field.Names {\n\t\t\tif name.Name == optsName {\n\t\t\t\ttestCallArgs = append(testCallArgs, name.Name)\n\t\t\t} else {\n\t\t\t\ttestCallArgs = append(testCallArgs, zeroArg)\n\t\t\t}\n\t\t}\n\t}\n\n\tif !hasOpts {\n\t\treturn nil, false\n\t}\n\n\tuseListCursorOptions := t.hasListCursorOptions(optsType)\n\tuseListOptions := t.hasListOptions(optsType)\n\tusePage := t.hasIntPage(optsType)\n\tuseAfter := t.hasStringAfter(optsType)\n\trecType := strings.TrimPrefix(recvType, \"*\")\n\tvar useCursor bool\n\tif useCursorPagination[recType+\".\"+fd.Name.Name] {\n\t\tuseCursor = true\n\t\tuseAfter = false\n\t}\n\n\tif !useListCursorOptions && !useListOptions && !usePage && !useAfter && !useCursor {\n\t\tlogf(\"Skipping %v.%v: opts %v does not have ListCursorOptions, ListOptions, Page int, or After string\", recvType, fd.Name.Name, optsType)\n\t\treturn nil, false\n\t}\n\n\tclientField := strings.TrimSuffix(recType, \"Service\")\n\tif clientField == \"Migration\" {\n\t\tclientField = \"Migrations\"\n\t}\n\tif clientField == \"s\" {\n\t\tlogf(\"WARNING: clientField is 's' for %v.%v (recvType=%v)\", recvType, fd.Name.Name, recType)\n\t}\n\n\treturn &methodInfo{\n\t\tRecvTypeRaw:          recvType,\n\t\tRecvType:             recType,\n\t\tRecvVar:              recvVar,\n\t\tClientField:          clientField,\n\t\tArgs:                 strings.Join(args, \", \"),\n\t\tCallArgs:             strings.Join(callArgs, \", \"),\n\t\tTestCallArgs:         strings.Join(testCallArgs, \", \"),\n\t\tZeroArgs:             strings.Join(zeroArgs, \", \"),\n\t\tOptsType:             optsType,\n\t\tOptsName:             optsName,\n\t\tOptsIsPtr:            optsIsPtr,\n\t\tUseListCursorOptions: useListCursorOptions,\n\t\tUseListOptions:       useListOptions,\n\t\tUsePage:              usePage,\n\t\tUseAfter:             useAfter,\n\t\tUseCursor:            useCursor,\n\t}, true\n}\n\nfunc (t *templateData) processReturnArrayType(fd *ast.FuncDecl, sliceRet *ast.ArrayType, methodInfo *methodInfo) {\n\ttestJSON, emptyReturnValue := \"[]\", \"{}\"\n\tif val, ok := customTestJSON[fd.Name.Name]; ok {\n\t\ttestJSON = val\n\t}\n\n\teltType := typeToString(sliceRet.Elt)\n\tif eltType == \"string\" {\n\t\temptyReturnValue = `\"\"`\n\t}\n\ttestJSON1 := strings.ReplaceAll(testJSON, \"[]\", fmt.Sprintf(\"[%v,%[1]v,%[1]v]\", emptyReturnValue))       // Call 1 - return 3 items\n\ttestJSON2 := strings.ReplaceAll(testJSON, \"[]\", fmt.Sprintf(\"[%v,%[1]v,%[1]v,%[1]v]\", emptyReturnValue)) // Call 1 part 2 - return 4 items\n\ttestJSON3 := strings.ReplaceAll(testJSON, \"[]\", fmt.Sprintf(\"[%v,%[1]v]\", emptyReturnValue))             // Call 2 - return 2 items\n\n\tm := &method{\n\t\tRecvType:             methodInfo.RecvType,\n\t\tRecvVar:              methodInfo.RecvVar,\n\t\tClientField:          methodInfo.ClientField,\n\t\tMethodName:           fd.Name.Name,\n\t\tIterMethod:           fd.Name.Name + \"Iter\",\n\t\tArgs:                 methodInfo.Args,\n\t\tCallArgs:             methodInfo.CallArgs,\n\t\tTestCallArgs:         methodInfo.TestCallArgs,\n\t\tZeroArgs:             methodInfo.ZeroArgs,\n\t\tReturnType:           eltType,\n\t\tOptsType:             methodInfo.OptsType,\n\t\tOptsName:             methodInfo.OptsName,\n\t\tOptsIsPtr:            methodInfo.OptsIsPtr,\n\t\tUseListCursorOptions: methodInfo.UseListCursorOptions,\n\t\tUseListOptions:       methodInfo.UseListOptions,\n\t\tUsePage:              methodInfo.UsePage,\n\t\tUseAfter:             methodInfo.UseAfter,\n\t\tUseCursor:            methodInfo.UseCursor,\n\t\tTestJSON1:            testJSON1,\n\t\tTestJSON2:            testJSON2,\n\t\tTestJSON3:            testJSON3,\n\t}\n\tt.Methods = append(t.Methods, m)\n}\n\nfunc (t *templateData) processReturnStarExpr(fd *ast.FuncDecl, starRet *ast.StarExpr, methodInfo *methodInfo) {\n\twrapperType := typeToString(starRet.X)\n\twrapperDef, ok := t.Structs[wrapperType]\n\tif !ok {\n\t\tlogf(\"Skipping %v.%v: wrapper type %v not found\", methodInfo.RecvTypeRaw, fd.Name.Name, wrapperType)\n\t\treturn\n\t}\n\n\titemsField, itemsType, ok := findSinglePointerSliceField(wrapperDef)\n\tif !ok {\n\t\tlogf(\"Skipping %v.%v: wrapper %v does not contain exactly one []*T field\", methodInfo.RecvTypeRaw, fd.Name.Name, wrapperType)\n\t\treturn\n\t}\n\n\ttestJSON, emptyReturnValue := \"[]\", \"{}\"\n\tif jsonField, ok := wrapperDef.FieldJSON[itemsField]; ok && jsonField != \"\" {\n\t\ttestJSON = fmt.Sprintf(`{\"%v\": []}`, jsonField)\n\t} else {\n\t\ttestJSON = fmt.Sprintf(`{\"%v\": []}`, lowerFirst(itemsField))\n\t}\n\tif val, ok := customTestJSON[fd.Name.Name]; ok {\n\t\ttestJSON = val\n\t}\n\n\teltType := strings.TrimPrefix(itemsType, \"[]\")\n\tif eltType == \"string\" {\n\t\temptyReturnValue = `\"\"`\n\t}\n\ttestJSON1 := strings.ReplaceAll(testJSON, \"[]\", fmt.Sprintf(\"[%v,%[1]v,%[1]v]\", emptyReturnValue))       // Call 1 - return 3 items\n\ttestJSON2 := strings.ReplaceAll(testJSON, \"[]\", fmt.Sprintf(\"[%v,%[1]v,%[1]v,%[1]v]\", emptyReturnValue)) // Call 1 part 2 - return 4 items\n\ttestJSON3 := strings.ReplaceAll(testJSON, \"[]\", fmt.Sprintf(\"[%v,%[1]v]\", emptyReturnValue))             // Call 2 - return 2 items\n\n\tm := &method{\n\t\tRecvType:             methodInfo.RecvType,\n\t\tRecvVar:              methodInfo.RecvVar,\n\t\tClientField:          methodInfo.ClientField,\n\t\tMethodName:           fd.Name.Name,\n\t\tIterMethod:           fd.Name.Name + \"Iter\",\n\t\tArgs:                 methodInfo.Args,\n\t\tCallArgs:             methodInfo.CallArgs,\n\t\tTestCallArgs:         methodInfo.TestCallArgs,\n\t\tZeroArgs:             methodInfo.ZeroArgs,\n\t\tReturnType:           eltType,\n\t\tOptsType:             methodInfo.OptsType,\n\t\tOptsName:             methodInfo.OptsName,\n\t\tOptsIsPtr:            methodInfo.OptsIsPtr,\n\t\tUseListCursorOptions: methodInfo.UseListCursorOptions,\n\t\tUseListOptions:       methodInfo.UseListOptions,\n\t\tUsePage:              methodInfo.UsePage,\n\t\tUseAfter:             methodInfo.UseAfter,\n\t\tUseCursor:            methodInfo.UseCursor,\n\t\tWrappedItemsField:    itemsField,\n\t\tTestJSON1:            testJSON1,\n\t\tTestJSON2:            testJSON2,\n\t\tTestJSON3:            testJSON3,\n\t}\n\tt.Methods = append(t.Methods, m)\n}\n\nfunc findSinglePointerSliceField(sd *structDef) (fieldName, fieldType string, ok bool) {\n\tmatches := []string{}\n\tfor name, typeStr := range sd.Fields {\n\t\tif strings.HasPrefix(typeStr, \"[]*\") {\n\t\t\tmatches = append(matches, name)\n\t\t}\n\t}\n\tif len(matches) != 1 {\n\t\treturn \"\", \"\", false\n\t}\n\tfieldName = matches[0]\n\treturn fieldName, sd.Fields[fieldName], true\n}\n\nfunc lowerFirst(s string) string {\n\tif s == \"\" {\n\t\treturn s\n\t}\n\treturn strings.ToLower(s[:1]) + s[1:]\n}\n\nfunc typeToString(expr ast.Expr) string {\n\tswitch x := expr.(type) {\n\tcase *ast.Ident:\n\t\treturn x.Name\n\tcase *ast.StarExpr:\n\t\treturn \"*\" + typeToString(x.X)\n\tcase *ast.SelectorExpr:\n\t\treturn typeToString(x.X) + \".\" + x.Sel.Name\n\tcase *ast.ArrayType:\n\t\treturn \"[]\" + typeToString(x.Elt)\n\tcase *ast.MapType:\n\t\treturn fmt.Sprintf(\"map[%v]%v\", typeToString(x.Key), typeToString(x.Value))\n\tdefault:\n\t\treturn \"\"\n\t}\n}\n\nfunc (t *templateData) dump() error {\n\tif len(t.Methods) == 0 {\n\t\treturn nil\n\t}\n\n\tslices.SortStableFunc(t.Methods, func(a, b *method) int {\n\t\tif a.RecvType != b.RecvType {\n\t\t\treturn strings.Compare(a.RecvType, b.RecvType)\n\t\t}\n\t\treturn strings.Compare(a.MethodName, b.MethodName)\n\t})\n\n\tprocessTemplate := func(tmpl *template.Template, filename string) error {\n\t\tvar buf bytes.Buffer\n\t\tif err := tmpl.Execute(&buf, t); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tclean, err := format.Source(buf.Bytes())\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"format.Source: %v\\n%s\", err, buf.String())\n\t\t}\n\t\tlogf(\"Writing %v...\", filename)\n\t\treturn os.WriteFile(filename, clean, 0o644)\n\t}\n\n\tif err := processTemplate(sourceTmpl, t.filename); err != nil {\n\t\treturn err\n\t}\n\treturn processTemplate(testTmpl, strings.ReplaceAll(t.filename, \".go\", \"_test.go\"))\n}\n\nconst doNotEditHeader = `// Code generated by gen-iterators; DO NOT EDIT.\n// Instead, please run \"go generate ./...\" as described here:\n// https://github.com/google/go-github/blob/master/CONTRIBUTING.md#submitting-a-patch\n\n// Copyright 2026 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n`\n\nconst source = doNotEditHeader + `\npackage {{.Package}}\n\nimport (\n\t\"context\"\n\t\"iter\"\n)\n\n{{range .Methods}}\n// {{.IterMethod}} returns an iterator that paginates through all results of {{.MethodName}}.\nfunc ({{.RecvVar}} *{{.RecvType}}) {{.IterMethod}}({{.Args}}) iter.Seq2[{{.ReturnType}}, error] {\n\treturn func(yield func({{.ReturnType}}, error) bool) {\n\t\t{{if .OptsIsPtr -}}\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif {{.OptsName}} == nil {\n\t\t\t{{.OptsName}} = &{{.OptsType}}{}\n\t\t} else {\n\t\t\t{{.OptsName}} = Ptr(*{{.OptsName}})\n\t\t}\n\n\t\t{{end}}\n\t\tfor {\n\t\t\tresults, resp, err := {{.RecvVar}}.{{.MethodName}}({{.CallArgs}})\n\t\t\tif err != nil {\n\t\t\t\tyield({{if hasPrefix .ReturnType \"*\"}}nil{{else}}*new({{.ReturnType}}){{end}}, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t{{if .WrappedItemsField -}}\n\t\t\tvar iterItems []{{.ReturnType}}\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.{{.WrappedItemsField}}\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t{{else -}}\n\t\t\tfor _, item := range results {\n\t\t\t{{end -}}\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t{{if and .UseListCursorOptions .UseListOptions}}\n\t\t\tif resp.After == \"\" && resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{{.OptsName}}.ListCursorOptions.After = resp.After\n\t\t\t{{.OptsName}}.ListOptions.Page = resp.NextPage\n\t\t\t{{else if .UseListCursorOptions}}\n\t\t\tif resp.After == \"\" {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{{.OptsName}}.ListCursorOptions.After = resp.After\n\t\t\t{{else if .UseListOptions}}\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{{.OptsName}}.ListOptions.Page = resp.NextPage\n\t\t\t{{else if .UsePage}}\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{{.OptsName}}.Page = resp.NextPage\n\t\t\t{{else if .UseAfter}}\n\t\t\tif resp.After == \"\" {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{{.OptsName}}.After = resp.After\n\t\t\t{{else if .UseCursor}}\n\t\t\tif resp.Cursor == \"\" {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t{{.OptsName}}.Cursor = resp.Cursor\n\t\t\t{{end -}}\n\t\t}\n\t}\n}\n{{end}}\n`\n\nconst test = doNotEditHeader + `\npackage {{.Package}}\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n)\n\n{{range .Methods}}\nfunc Test{{.RecvType}}_{{.IterMethod}}(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\t{{- if .UseCursor}}\n\t\t\tw.Header().Set(\"Link\", ` + \"`\" + `<https://api.github.com/?cursor=yo>; rel=\"next\"` + \"`\" + `)\n\t\t\t{{else if or .UseListCursorOptions .UseAfter}}\n\t\t\tw.Header().Set(\"Link\", ` + \"`\" + `<https://api.github.com/?after=yo>; rel=\"next\"` + \"`\" + `)\n\t\t\t{{else}}\n\t\t\tw.Header().Set(\"Link\", ` + \"`\" + `<https://api.github.com/?page=1>; rel=\"next\"` + \"`\" + `)\n\t\t\t{{end -}}\n\t\t\tfmt.Fprint(w, ` + \"`\" + `{{.TestJSON1}}` + \"`\" + `)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, ` + \"`\" + `{{.TestJSON2}}` + \"`\" + `)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, ` + \"`\" + `{{.TestJSON3}}` + \"`\" + `)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, ` + \"`\" + `{{.TestJSON3}}` + \"`\" + `)\n\t\t}\n\t})\n\n\titer := client.{{.ClientField}}.{{.IterMethod}}({{.ZeroArgs}})\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.{{.ClientField}}.{{.IterMethod}} call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\t{{.OptsName}} := &{{.OptsType}}{}\n\titer = client.{{.ClientField}}.{{.IterMethod}}({{.TestCallArgs}})\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.{{.ClientField}}.{{.IterMethod}} call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.{{.ClientField}}.{{.IterMethod}}({{.ZeroArgs}})\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.{{.ClientField}}.{{.IterMethod}} call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.{{.ClientField}}.{{.IterMethod}}({{.ZeroArgs}})\n\tgotItems = 0\n\titer(func(item {{.ReturnType}}, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.{{.ClientField}}.{{.IterMethod}} call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n{{end}}\n`\n"
  },
  {
    "path": "github/gen-stringify-test.go",
    "content": "// Copyright 2019 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n//go:build ignore\n\n// gen-stringify-test generates test methods to test the String methods.\n//\n// These tests eliminate most of the code coverage problems so that real\n// code coverage issues can be more readily identified.\n//\n// It is meant to be used by go-github contributors in conjunction with the\n// go generate tool before sending a PR to GitHub.\n// Please see the CONTRIBUTING.md file for more information.\npackage main\n\nimport (\n\t\"bytes\"\n\t\"flag\"\n\t\"fmt\"\n\t\"go/ast\"\n\t\"go/format\"\n\t\"go/parser\"\n\t\"go/token\"\n\t\"log\"\n\t\"os\"\n\t\"strings\"\n\t\"text/template\"\n)\n\nconst (\n\tignoreFilePrefix1 = \"gen-\"\n\tignoreFilePrefix2 = \"github-\"\n\toutputFileSuffix  = \"-stringify_test.go\"\n)\n\nvar (\n\tverbose = flag.Bool(\"v\", false, \"Print verbose log messages\")\n\n\t// skipStructMethods lists \"struct.method\" combos to skip.\n\tskipStructMethods = map[string]bool{}\n\t// skipStructs lists structs to skip.\n\tskipStructs = map[string]bool{\n\t\t\"RateLimits\": true,\n\t}\n\n\tfuncMap = template.FuncMap{\n\t\t\"isNotLast\": func(index int, slice []*structField) string {\n\t\t\tif index+1 < len(slice) {\n\t\t\t\treturn \", \"\n\t\t\t}\n\t\t\treturn \"\"\n\t\t},\n\t\t\"processZeroValue\": func(v string) string {\n\t\t\tswitch v {\n\t\t\tcase \"Ptr(false)\":\n\t\t\t\treturn \"false\"\n\t\t\tcase \"Ptr(0.0)\":\n\t\t\t\treturn \"0\"\n\t\t\tcase \"0\", \"Ptr(0)\", \"Ptr(int64(0))\":\n\t\t\t\treturn \"0\"\n\t\t\tcase `\"\"`, `Ptr(\"\")`:\n\t\t\t\treturn `\"\"`\n\t\t\tcase \"Timestamp{}\", \"&Timestamp{}\":\n\t\t\t\treturn \"github.Timestamp{0001-01-01 00:00:00 +0000 UTC}\"\n\t\t\tcase \"nil\":\n\t\t\t\treturn \"map[]\"\n\t\t\tcase `[]int{0}`:\n\t\t\t\treturn `[0]`\n\t\t\tcase `[]string{\"\"}`:\n\t\t\t\treturn `[\"\"]`\n\t\t\tcase \"[]Scope{ScopeNone}\":\n\t\t\t\treturn `[\"(no scope)\"]`\n\t\t\tcase \"[]any{nil}\":\n\t\t\t\treturn \"[<nil>]\"\n\t\t\t}\n\t\t\tlog.Fatalf(\"Unhandled zero value: %q\", v)\n\t\t\treturn \"\"\n\t\t},\n\t}\n\n\tsourceTmpl = template.Must(template.New(\"source\").Funcs(funcMap).Parse(source))\n)\n\nfunc main() {\n\tflag.Parse()\n\tfset := token.NewFileSet()\n\n\tpkgs, err := parser.ParseDir(fset, \".\", sourceFilter, 0)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t\treturn\n\t}\n\n\tfor pkgName, pkg := range pkgs {\n\t\tt := &templateData{\n\t\t\tfilename:     pkgName + outputFileSuffix,\n\t\t\tYear:         2019, // No need to change this once set (even in following years).\n\t\t\tPackage:      pkgName,\n\t\t\tImports:      map[string]string{\"testing\": \"testing\"},\n\t\t\tStringFuncs:  map[string]bool{},\n\t\t\tStructFields: map[string][]*structField{},\n\t\t}\n\t\tfor filename, f := range pkg.Files {\n\t\t\tlogf(\"Processing %v...\", filename)\n\t\t\tif err := t.processAST(f); err != nil {\n\t\t\t\tlog.Fatal(err)\n\t\t\t}\n\t\t}\n\t\tif err := t.dump(); err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t}\n\tlogf(\"Done.\")\n}\n\nfunc sourceFilter(fi os.FileInfo) bool {\n\treturn !strings.HasSuffix(fi.Name(), \"_test.go\") &&\n\t\t!strings.HasPrefix(fi.Name(), ignoreFilePrefix1) &&\n\t\t!strings.HasPrefix(fi.Name(), ignoreFilePrefix2)\n}\n\ntype templateData struct {\n\tfilename     string\n\tYear         int\n\tPackage      string\n\tImports      map[string]string\n\tStringFuncs  map[string]bool\n\tStructFields map[string][]*structField\n}\n\ntype structField struct {\n\tsortVal      string // Lower-case version of \"ReceiverType.FieldName\".\n\tReceiverVar  string // The one-letter variable name to match the ReceiverType.\n\tReceiverType string\n\tFieldName    string\n\tFieldType    string\n\tZeroValue    string\n\tNamedStruct  bool // Getter for named struct.\n}\n\nfunc (t *templateData) processAST(f *ast.File) error {\n\tfor _, decl := range f.Decls {\n\t\tfn, ok := decl.(*ast.FuncDecl)\n\t\tif ok {\n\t\t\tif fn.Recv != nil && len(fn.Recv.List) > 0 {\n\t\t\t\tid, ok := fn.Recv.List[0].Type.(*ast.Ident)\n\t\t\t\tif ok && fn.Name.Name == \"String\" {\n\t\t\t\t\tlogf(\"Got FuncDecl: Name=%q, id.Name=%#v\", fn.Name.Name, id.Name)\n\t\t\t\t\tt.StringFuncs[id.Name] = true\n\t\t\t\t} else {\n\t\t\t\t\tstar, ok := fn.Recv.List[0].Type.(*ast.StarExpr)\n\t\t\t\t\tif ok && fn.Name.Name == \"String\" {\n\t\t\t\t\t\tid, ok := star.X.(*ast.Ident)\n\t\t\t\t\t\tif ok {\n\t\t\t\t\t\t\tlogf(\"Got FuncDecl: Name=%q, id.Name=%#v\", fn.Name.Name, id.Name)\n\t\t\t\t\t\t\tt.StringFuncs[id.Name] = true\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlogf(\"Ignoring FuncDecl: Name=%q, Type=%T\", fn.Name.Name, fn.Recv.List[0].Type)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlogf(\"Ignoring FuncDecl: Name=%q, Type=%T\", fn.Name.Name, fn.Recv.List[0].Type)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlogf(\"Ignoring FuncDecl: Name=%q, fn=%#v\", fn.Name.Name, fn)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tgd, ok := decl.(*ast.GenDecl)\n\t\tif !ok {\n\t\t\tlogf(\"Ignoring AST decl type %T\", decl)\n\t\t\tcontinue\n\t\t}\n\n\t\tfor _, spec := range gd.Specs {\n\t\t\tts, ok := spec.(*ast.TypeSpec)\n\t\t\tif !ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// Skip unexported identifiers.\n\t\t\tif !ts.Name.IsExported() {\n\t\t\t\tlogf(\"Struct %v is unexported; skipping.\", ts.Name)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// Check if the struct should be skipped.\n\t\t\tif skipStructs[ts.Name.Name] {\n\t\t\t\tlogf(\"Struct %v is in skip list; skipping.\", ts.Name)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tst, ok := ts.Type.(*ast.StructType)\n\t\t\tif !ok {\n\t\t\t\tlogf(\"Ignoring AST type %T, Name=%q\", ts.Type, ts.Name)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor _, field := range st.Fields.List {\n\t\t\t\tif len(field.Names) == 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tfieldName := field.Names[0]\n\t\t\t\tif id, ok := field.Type.(*ast.Ident); ok {\n\t\t\t\t\tt.addIdent(id, ts.Name.String(), fieldName.String())\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif at, ok := field.Type.(*ast.ArrayType); ok {\n\t\t\t\t\tif id, ok := at.Elt.(*ast.Ident); ok {\n\t\t\t\t\t\tt.addIdentSlice(id, ts.Name.String(), fieldName.String())\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tse, ok := field.Type.(*ast.StarExpr)\n\t\t\t\tif !ok {\n\t\t\t\t\tlogf(\"Ignoring type %T for Name=%q, FieldName=%q\", field.Type, ts.Name, fieldName)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\t// Skip unexported identifiers.\n\t\t\t\tif !fieldName.IsExported() {\n\t\t\t\t\tlogf(\"Field %v is unexported; skipping.\", fieldName)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t// Check if \"struct.method\" should be skipped.\n\t\t\t\tif key := fmt.Sprintf(\"%v.Get%v\", ts.Name, fieldName); skipStructMethods[key] {\n\t\t\t\t\tlogf(\"Method %v is in skip list; skipping.\", key)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tswitch x := se.X.(type) {\n\t\t\t\tcase *ast.ArrayType:\n\t\t\t\tcase *ast.Ident:\n\t\t\t\t\tt.addIdentPtr(x, ts.Name.String(), fieldName.String())\n\t\t\t\tcase *ast.MapType:\n\t\t\t\tcase *ast.SelectorExpr:\n\t\t\t\tdefault:\n\t\t\t\t\tlogf(\"processAST: type %q, field %q, unknown %T: %+v\", ts.Name, fieldName, x, x)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (t *templateData) addMapType(receiverType, fieldName string) {\n\tt.StructFields[receiverType] = append(t.StructFields[receiverType], newStructField(receiverType, fieldName, \"map[]\", \"nil\", false))\n}\n\nfunc (t *templateData) addIdent(x *ast.Ident, receiverType, fieldName string) {\n\tvar zeroValue string\n\tvar namedStruct bool\n\tswitch x.String() {\n\tcase \"int\":\n\t\tzeroValue = \"0\"\n\tcase \"int64\":\n\t\tzeroValue = \"0\"\n\tcase \"float64\":\n\t\tzeroValue = \"0.0\"\n\tcase \"string\":\n\t\tzeroValue = `\"\"`\n\tcase \"bool\":\n\t\tzeroValue = \"false\"\n\tcase \"Timestamp\":\n\t\tzeroValue = \"Timestamp{}\"\n\tdefault:\n\t\tzeroValue = \"nil\"\n\t\tnamedStruct = true\n\t}\n\n\tt.StructFields[receiverType] = append(t.StructFields[receiverType], newStructField(receiverType, fieldName, x.String(), zeroValue, namedStruct))\n}\n\nfunc (t *templateData) addIdentPtr(x *ast.Ident, receiverType, fieldName string) {\n\tvar zeroValue string\n\tvar namedStruct bool\n\tswitch x.String() {\n\tcase \"int\":\n\t\tzeroValue = \"Ptr(0)\"\n\tcase \"int64\":\n\t\tzeroValue = \"Ptr(int64(0))\"\n\tcase \"float64\":\n\t\tzeroValue = \"Ptr(0.0)\"\n\tcase \"string\":\n\t\tzeroValue = `Ptr(\"\")`\n\tcase \"bool\":\n\t\tzeroValue = \"Ptr(false)\"\n\tcase \"Timestamp\":\n\t\tzeroValue = \"&Timestamp{}\"\n\tdefault:\n\t\tzeroValue = \"nil\"\n\t\tnamedStruct = true\n\t}\n\n\tt.StructFields[receiverType] = append(t.StructFields[receiverType], newStructField(receiverType, fieldName, x.String(), zeroValue, namedStruct))\n}\n\nfunc (t *templateData) addIdentSlice(x *ast.Ident, receiverType, fieldName string) {\n\tvar zeroValue string\n\tvar namedStruct bool\n\tswitch x.String() {\n\tcase \"int\":\n\t\tzeroValue = \"[]int{0}\"\n\tcase \"int64\":\n\t\tzeroValue = \"[]int64{0}\"\n\tcase \"float64\":\n\t\tzeroValue = \"[]float64{0}\"\n\tcase \"string\":\n\t\tzeroValue = `[]string{\"\"}`\n\tcase \"bool\":\n\t\tzeroValue = \"[]bool{false}\"\n\tcase \"Scope\":\n\t\tzeroValue = \"[]Scope{ScopeNone}\"\n\tcase \"any\":\n\t\tzeroValue = \"[]any{nil}\"\n\t// case \"Timestamp\":\n\t// \tzeroValue = \"&Timestamp{}\"\n\tdefault:\n\t\tzeroValue = \"nil\"\n\t\tnamedStruct = true\n\t}\n\n\tt.StructFields[receiverType] = append(t.StructFields[receiverType], newStructField(receiverType, fieldName, x.String(), zeroValue, namedStruct))\n}\n\nfunc (t *templateData) dump() error {\n\tif len(t.StructFields) == 0 {\n\t\tlogf(\"No StructFields for %v; skipping.\", t.filename)\n\t\treturn nil\n\t}\n\n\t// Remove unused structs.\n\tvar toDelete []string\n\tfor k := range t.StructFields {\n\t\tif !t.StringFuncs[k] {\n\t\t\ttoDelete = append(toDelete, k)\n\t\t\tcontinue\n\t\t}\n\t}\n\tfor _, k := range toDelete {\n\t\tdelete(t.StructFields, k)\n\t}\n\n\tvar buf bytes.Buffer\n\tif err := sourceTmpl.Execute(&buf, t); err != nil {\n\t\treturn err\n\t}\n\tclean, err := format.Source(buf.Bytes())\n\tif err != nil {\n\t\tlog.Printf(\"failed-to-format source:\\n%v\", buf)\n\t\treturn err\n\t}\n\n\tlogf(\"Writing %v...\", t.filename)\n\tif err := os.Chmod(t.filename, 0o644); err != nil {\n\t\treturn fmt.Errorf(\"os.Chmod(%q, 0644): %v\", t.filename, err)\n\t}\n\n\tif err := os.WriteFile(t.filename, clean, 0o444); err != nil {\n\t\treturn err\n\t}\n\n\tif err := os.Chmod(t.filename, 0o444); err != nil {\n\t\treturn fmt.Errorf(\"os.Chmod(%q, 0444): %v\", t.filename, err)\n\t}\n\n\treturn nil\n}\n\nfunc newStructField(receiverType, fieldName, fieldType, zeroValue string, namedStruct bool) *structField {\n\treturn &structField{\n\t\tsortVal:      strings.ToLower(receiverType) + \".\" + strings.ToLower(fieldName),\n\t\tReceiverVar:  strings.ToLower(receiverType[:1]),\n\t\tReceiverType: receiverType,\n\t\tFieldName:    fieldName,\n\t\tFieldType:    fieldType,\n\t\tZeroValue:    zeroValue,\n\t\tNamedStruct:  namedStruct,\n\t}\n}\n\nfunc logf(fmt string, args ...any) {\n\tif *verbose {\n\t\tlog.Printf(fmt, args...)\n\t}\n}\n\nconst source = `// Code generated by gen-stringify-tests; DO NOT EDIT.\n// Instead, please run \"go generate ./...\" as described here:\n// https://github.com/google/go-github/blob/master/CONTRIBUTING.md#submitting-a-patch\n\n// Copyright {{.Year}} The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage {{ $package := .Package}}{{$package}}\n{{with .Imports}}\nimport (\n  {{- range . -}}\n  \"{{.}}\"\n  {{end -}}\n)\n{{end}}\n{{range $key, $value := .StructFields}}\nfunc Test{{ $key }}_String(t *testing.T) {\n  t.Parallel()\n  v := {{ $key }}{ {{range .}}{{if .NamedStruct}}\n    {{ .FieldName }}: &{{ .FieldType }}{},{{else}}\n    {{ .FieldName }}: {{.ZeroValue}},{{end}}{{end}}\n  }\n \twant := ` + \"`\" + `{{ $package }}.{{ $key }}{{ $slice := . }}{\n{{- range $ind, $val := .}}{{if .NamedStruct}}{{ .FieldName }}:{{ $package }}.{{ .FieldType }}{}{{else}}{{ .FieldName }}:{{ processZeroValue .ZeroValue }}{{end}}{{ isNotLast $ind $slice }}{{end}}}` + \"`\" + `\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"{{ $key }}.String = %v, want %v\", got, want)\n\t}\n}\n{{end}}\n`\n"
  },
  {
    "path": "github/gists.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n)\n\n// GistsService handles communication with the Gist related\n// methods of the GitHub API.\n//\n// GitHub API docs: https://docs.github.com/rest/gists\ntype GistsService service\n\n// Gist represents a GitHub's gist.\ntype Gist struct {\n\tID          *string                   `json:\"id,omitempty\"`\n\tDescription *string                   `json:\"description,omitempty\"`\n\tPublic      *bool                     `json:\"public,omitempty\"`\n\tOwner       *User                     `json:\"owner,omitempty\"`\n\tFiles       map[GistFilename]GistFile `json:\"files,omitempty\"`\n\tComments    *int                      `json:\"comments,omitempty\"`\n\tHTMLURL     *string                   `json:\"html_url,omitempty\"`\n\tGitPullURL  *string                   `json:\"git_pull_url,omitempty\"`\n\tGitPushURL  *string                   `json:\"git_push_url,omitempty\"`\n\tCreatedAt   *Timestamp                `json:\"created_at,omitempty\"`\n\tUpdatedAt   *Timestamp                `json:\"updated_at,omitempty\"`\n\tNodeID      *string                   `json:\"node_id,omitempty\"`\n}\n\nfunc (g Gist) String() string {\n\treturn Stringify(g)\n}\n\n// GistFilename represents filename on a gist.\ntype GistFilename string\n\n// GistFile represents a file on a gist.\ntype GistFile struct {\n\tSize     *int    `json:\"size,omitempty\"`\n\tFilename *string `json:\"filename,omitempty\"`\n\tLanguage *string `json:\"language,omitempty\"`\n\tType     *string `json:\"type,omitempty\"`\n\tRawURL   *string `json:\"raw_url,omitempty\"`\n\tContent  *string `json:\"content,omitempty\"`\n}\n\nfunc (g GistFile) String() string {\n\treturn Stringify(g)\n}\n\n// GistCommit represents a commit on a gist.\ntype GistCommit struct {\n\tURL          *string      `json:\"url,omitempty\"`\n\tVersion      *string      `json:\"version,omitempty\"`\n\tUser         *User        `json:\"user,omitempty\"`\n\tChangeStatus *CommitStats `json:\"change_status,omitempty\"`\n\tCommittedAt  *Timestamp   `json:\"committed_at,omitempty\"`\n\tNodeID       *string      `json:\"node_id,omitempty\"`\n}\n\nfunc (gc GistCommit) String() string {\n\treturn Stringify(gc)\n}\n\n// GistFork represents a fork of a gist.\ntype GistFork struct {\n\tURL       *string    `json:\"url,omitempty\"`\n\tUser      *User      `json:\"user,omitempty\"`\n\tID        *string    `json:\"id,omitempty\"`\n\tCreatedAt *Timestamp `json:\"created_at,omitempty\"`\n\tUpdatedAt *Timestamp `json:\"updated_at,omitempty\"`\n\tNodeID    *string    `json:\"node_id,omitempty\"`\n}\n\nfunc (gf GistFork) String() string {\n\treturn Stringify(gf)\n}\n\n// GistListOptions specifies the optional parameters to the\n// GistsService.List, GistsService.ListAll, and GistsService.ListStarred methods.\ntype GistListOptions struct {\n\t// Since filters Gists by time.\n\tSince time.Time `url:\"since,omitempty\"`\n\n\tListOptions\n}\n\n// List gists for a user. Passing the empty string will list\n// all public gists if called anonymously. However, if the call\n// is authenticated, it will returns all gists for the authenticated\n// user.\n//\n// GitHub API docs: https://docs.github.com/rest/gists/gists#list-gists-for-a-user\n//\n// GitHub API docs: https://docs.github.com/rest/gists/gists#list-gists-for-the-authenticated-user\n//\n//meta:operation GET /gists\n//meta:operation GET /users/{username}/gists\nfunc (s *GistsService) List(ctx context.Context, user string, opts *GistListOptions) ([]*Gist, *Response, error) {\n\tvar u string\n\tif user != \"\" {\n\t\tu = fmt.Sprintf(\"users/%v/gists\", user)\n\t} else {\n\t\tu = \"gists\"\n\t}\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar gists []*Gist\n\tresp, err := s.client.Do(ctx, req, &gists)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn gists, resp, nil\n}\n\n// ListAll lists all public gists.\n//\n// GitHub API docs: https://docs.github.com/rest/gists/gists#list-public-gists\n//\n//meta:operation GET /gists/public\nfunc (s *GistsService) ListAll(ctx context.Context, opts *GistListOptions) ([]*Gist, *Response, error) {\n\tu, err := addOptions(\"gists/public\", opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar gists []*Gist\n\tresp, err := s.client.Do(ctx, req, &gists)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn gists, resp, nil\n}\n\n// ListStarred lists starred gists of authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/gists/gists#list-starred-gists\n//\n//meta:operation GET /gists/starred\nfunc (s *GistsService) ListStarred(ctx context.Context, opts *GistListOptions) ([]*Gist, *Response, error) {\n\tu, err := addOptions(\"gists/starred\", opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar gists []*Gist\n\tresp, err := s.client.Do(ctx, req, &gists)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn gists, resp, nil\n}\n\n// Get a single gist.\n//\n// GitHub API docs: https://docs.github.com/rest/gists/gists#get-a-gist\n//\n//meta:operation GET /gists/{gist_id}\nfunc (s *GistsService) Get(ctx context.Context, id string) (*Gist, *Response, error) {\n\tu := fmt.Sprintf(\"gists/%v\", id)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar gist *Gist\n\tresp, err := s.client.Do(ctx, req, &gist)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn gist, resp, nil\n}\n\n// GetRevision gets a specific revision of a gist.\n//\n// GitHub API docs: https://docs.github.com/rest/gists/gists#get-a-gist-revision\n//\n//meta:operation GET /gists/{gist_id}/{sha}\nfunc (s *GistsService) GetRevision(ctx context.Context, id, sha string) (*Gist, *Response, error) {\n\tu := fmt.Sprintf(\"gists/%v/%v\", id, sha)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar gist *Gist\n\tresp, err := s.client.Do(ctx, req, &gist)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn gist, resp, nil\n}\n\n// Create a gist for authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/gists/gists#create-a-gist\n//\n//meta:operation POST /gists\nfunc (s *GistsService) Create(ctx context.Context, gist *Gist) (*Gist, *Response, error) {\n\tu := \"gists\"\n\treq, err := s.client.NewRequest(\"POST\", u, gist)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar g *Gist\n\tresp, err := s.client.Do(ctx, req, &g)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn g, resp, nil\n}\n\n// Edit a gist.\n//\n// GitHub API docs: https://docs.github.com/rest/gists/gists#update-a-gist\n//\n//meta:operation PATCH /gists/{gist_id}\nfunc (s *GistsService) Edit(ctx context.Context, id string, gist *Gist) (*Gist, *Response, error) {\n\tu := fmt.Sprintf(\"gists/%v\", id)\n\treq, err := s.client.NewRequest(\"PATCH\", u, gist)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar g *Gist\n\tresp, err := s.client.Do(ctx, req, &g)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn g, resp, nil\n}\n\n// ListCommits lists commits of a gist.\n//\n// GitHub API docs: https://docs.github.com/rest/gists/gists#list-gist-commits\n//\n//meta:operation GET /gists/{gist_id}/commits\nfunc (s *GistsService) ListCommits(ctx context.Context, id string, opts *ListOptions) ([]*GistCommit, *Response, error) {\n\tu := fmt.Sprintf(\"gists/%v/commits\", id)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar gistCommits []*GistCommit\n\tresp, err := s.client.Do(ctx, req, &gistCommits)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn gistCommits, resp, nil\n}\n\n// Delete a gist.\n//\n// GitHub API docs: https://docs.github.com/rest/gists/gists#delete-a-gist\n//\n//meta:operation DELETE /gists/{gist_id}\nfunc (s *GistsService) Delete(ctx context.Context, id string) (*Response, error) {\n\tu := fmt.Sprintf(\"gists/%v\", id)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// Star a gist on behalf of authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/gists/gists#star-a-gist\n//\n//meta:operation PUT /gists/{gist_id}/star\nfunc (s *GistsService) Star(ctx context.Context, id string) (*Response, error) {\n\tu := fmt.Sprintf(\"gists/%v/star\", id)\n\treq, err := s.client.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// Unstar a gist on a behalf of authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/gists/gists#unstar-a-gist\n//\n//meta:operation DELETE /gists/{gist_id}/star\nfunc (s *GistsService) Unstar(ctx context.Context, id string) (*Response, error) {\n\tu := fmt.Sprintf(\"gists/%v/star\", id)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// IsStarred checks if a gist is starred by authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/gists/gists#check-if-a-gist-is-starred\n//\n//meta:operation GET /gists/{gist_id}/star\nfunc (s *GistsService) IsStarred(ctx context.Context, id string) (bool, *Response, error) {\n\tu := fmt.Sprintf(\"gists/%v/star\", id)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn false, nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tstarred, err := parseBoolResponse(err)\n\treturn starred, resp, err\n}\n\n// Fork a gist.\n//\n// GitHub API docs: https://docs.github.com/rest/gists/gists#fork-a-gist\n//\n//meta:operation POST /gists/{gist_id}/forks\nfunc (s *GistsService) Fork(ctx context.Context, id string) (*Gist, *Response, error) {\n\tu := fmt.Sprintf(\"gists/%v/forks\", id)\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar g *Gist\n\tresp, err := s.client.Do(ctx, req, &g)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn g, resp, nil\n}\n\n// ListForks lists forks of a gist.\n//\n// GitHub API docs: https://docs.github.com/rest/gists/gists#list-gist-forks\n//\n//meta:operation GET /gists/{gist_id}/forks\nfunc (s *GistsService) ListForks(ctx context.Context, id string, opts *ListOptions) ([]*GistFork, *Response, error) {\n\tu := fmt.Sprintf(\"gists/%v/forks\", id)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar gistForks []*GistFork\n\tresp, err := s.client.Do(ctx, req, &gistForks)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn gistForks, resp, nil\n}\n"
  },
  {
    "path": "github/gists_comments.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// GistComment represents a Gist comment.\ntype GistComment struct {\n\tID        *int64     `json:\"id,omitempty\"`\n\tURL       *string    `json:\"url,omitempty\"`\n\tBody      *string    `json:\"body,omitempty\"`\n\tUser      *User      `json:\"user,omitempty\"`\n\tCreatedAt *Timestamp `json:\"created_at,omitempty\"`\n}\n\nfunc (g GistComment) String() string {\n\treturn Stringify(g)\n}\n\n// ListComments lists all comments for a gist.\n//\n// GitHub API docs: https://docs.github.com/rest/gists/comments#list-gist-comments\n//\n//meta:operation GET /gists/{gist_id}/comments\nfunc (s *GistsService) ListComments(ctx context.Context, gistID string, opts *ListOptions) ([]*GistComment, *Response, error) {\n\tu := fmt.Sprintf(\"gists/%v/comments\", gistID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar comments []*GistComment\n\tresp, err := s.client.Do(ctx, req, &comments)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn comments, resp, nil\n}\n\n// GetComment retrieves a single comment from a gist.\n//\n// GitHub API docs: https://docs.github.com/rest/gists/comments#get-a-gist-comment\n//\n//meta:operation GET /gists/{gist_id}/comments/{comment_id}\nfunc (s *GistsService) GetComment(ctx context.Context, gistID string, commentID int64) (*GistComment, *Response, error) {\n\tu := fmt.Sprintf(\"gists/%v/comments/%v\", gistID, commentID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar c *GistComment\n\tresp, err := s.client.Do(ctx, req, &c)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn c, resp, nil\n}\n\n// CreateComment creates a comment for a gist.\n//\n// GitHub API docs: https://docs.github.com/rest/gists/comments#create-a-gist-comment\n//\n//meta:operation POST /gists/{gist_id}/comments\nfunc (s *GistsService) CreateComment(ctx context.Context, gistID string, comment *GistComment) (*GistComment, *Response, error) {\n\tu := fmt.Sprintf(\"gists/%v/comments\", gistID)\n\treq, err := s.client.NewRequest(\"POST\", u, comment)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar c *GistComment\n\tresp, err := s.client.Do(ctx, req, &c)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn c, resp, nil\n}\n\n// EditComment edits an existing gist comment.\n//\n// GitHub API docs: https://docs.github.com/rest/gists/comments#update-a-gist-comment\n//\n//meta:operation PATCH /gists/{gist_id}/comments/{comment_id}\nfunc (s *GistsService) EditComment(ctx context.Context, gistID string, commentID int64, comment *GistComment) (*GistComment, *Response, error) {\n\tu := fmt.Sprintf(\"gists/%v/comments/%v\", gistID, commentID)\n\treq, err := s.client.NewRequest(\"PATCH\", u, comment)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar c *GistComment\n\tresp, err := s.client.Do(ctx, req, &c)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn c, resp, nil\n}\n\n// DeleteComment deletes a gist comment.\n//\n// GitHub API docs: https://docs.github.com/rest/gists/comments#delete-a-gist-comment\n//\n//meta:operation DELETE /gists/{gist_id}/comments/{comment_id}\nfunc (s *GistsService) DeleteComment(ctx context.Context, gistID string, commentID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"gists/%v/comments/%v\", gistID, commentID)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/gists_comments_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestGistComments_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &GistComment{}, \"{}\")\n\n\tcreatedAt := time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC)\n\n\tu := &GistComment{\n\t\tID:   Ptr(int64(1)),\n\t\tURL:  Ptr(\"u\"),\n\t\tBody: Ptr(\"test gist comment\"),\n\t\tUser: &User{\n\t\t\tLogin:       Ptr(\"ll\"),\n\t\t\tID:          Ptr(int64(123)),\n\t\t\tAvatarURL:   Ptr(\"a\"),\n\t\t\tGravatarID:  Ptr(\"g\"),\n\t\t\tName:        Ptr(\"n\"),\n\t\t\tCompany:     Ptr(\"c\"),\n\t\t\tBlog:        Ptr(\"b\"),\n\t\t\tLocation:    Ptr(\"l\"),\n\t\t\tEmail:       Ptr(\"e\"),\n\t\t\tHireable:    Ptr(true),\n\t\t\tPublicRepos: Ptr(1),\n\t\t\tFollowers:   Ptr(1),\n\t\t\tFollowing:   Ptr(1),\n\t\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\t\tURL:         Ptr(\"u\"),\n\t\t},\n\t\tCreatedAt: &Timestamp{createdAt},\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"url\": \"u\",\n\t\t\"body\": \"test gist comment\",\n\t\t\"user\": {\n\t\t\t\"login\": \"ll\",\n\t\t\t\"id\": 123,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"created_at\": \"2002-02-10T15:30:00Z\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestGistsService_ListComments(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/gists/1/comments\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\": 1}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tcomments, _, err := client.Gists.ListComments(ctx, \"1\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Gists.Comments returned error: %v\", err)\n\t}\n\n\twant := []*GistComment{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(comments, want) {\n\t\tt.Errorf(\"Gists.ListComments returned %+v, want %+v\", comments, want)\n\t}\n\n\tconst methodName = \"ListComments\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Gists.ListComments(ctx, \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Gists.ListComments(ctx, \"1\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGistsService_ListComments_invalidID(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Gists.ListComments(ctx, \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestGistsService_GetComment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/gists/1/comments/2\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\": 1}`)\n\t})\n\n\tctx := t.Context()\n\tcomment, _, err := client.Gists.GetComment(ctx, \"1\", 2)\n\tif err != nil {\n\t\tt.Errorf(\"Gists.GetComment returned error: %v\", err)\n\t}\n\n\twant := &GistComment{ID: Ptr(int64(1))}\n\tif !cmp.Equal(comment, want) {\n\t\tt.Errorf(\"Gists.GetComment returned %+v, want %+v\", comment, want)\n\t}\n\n\tconst methodName = \"GetComment\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Gists.GetComment(ctx, \"\\n\", -2)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Gists.GetComment(ctx, \"1\", 2)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGistsService_GetComment_invalidID(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Gists.GetComment(ctx, \"%\", 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestGistsService_CreateComment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &GistComment{ID: Ptr(int64(1)), Body: Ptr(\"b\")}\n\n\tmux.HandleFunc(\"/gists/1/comments\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *GistComment\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tcomment, _, err := client.Gists.CreateComment(ctx, \"1\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Gists.CreateComment returned error: %v\", err)\n\t}\n\n\twant := &GistComment{ID: Ptr(int64(1))}\n\tif !cmp.Equal(comment, want) {\n\t\tt.Errorf(\"Gists.CreateComment returned %+v, want %+v\", comment, want)\n\t}\n\n\tconst methodName = \"CreateComment\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Gists.CreateComment(ctx, \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Gists.CreateComment(ctx, \"1\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGistsService_CreateComment_invalidID(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Gists.CreateComment(ctx, \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestGistsService_EditComment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &GistComment{ID: Ptr(int64(1)), Body: Ptr(\"b\")}\n\n\tmux.HandleFunc(\"/gists/1/comments/2\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *GistComment\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tcomment, _, err := client.Gists.EditComment(ctx, \"1\", 2, input)\n\tif err != nil {\n\t\tt.Errorf(\"Gists.EditComment returned error: %v\", err)\n\t}\n\n\twant := &GistComment{ID: Ptr(int64(1))}\n\tif !cmp.Equal(comment, want) {\n\t\tt.Errorf(\"Gists.EditComment returned %+v, want %+v\", comment, want)\n\t}\n\n\tconst methodName = \"EditComment\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Gists.EditComment(ctx, \"\\n\", -2, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Gists.EditComment(ctx, \"1\", 2, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGistsService_EditComment_invalidID(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Gists.EditComment(ctx, \"%\", 1, nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestGistsService_DeleteComment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/gists/1/comments/2\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Gists.DeleteComment(ctx, \"1\", 2)\n\tif err != nil {\n\t\tt.Errorf(\"Gists.Delete returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteComment\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Gists.DeleteComment(ctx, \"\\n\", -2)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Gists.DeleteComment(ctx, \"1\", 2)\n\t})\n}\n\nfunc TestGistsService_DeleteComment_invalidID(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Gists.DeleteComment(ctx, \"%\", 1)\n\ttestURLParseError(t, err)\n}\n"
  },
  {
    "path": "github/gists_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestGist_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Gist{}, \"{}\")\n\n\tcreatedAt := time.Date(2010, time.February, 10, 10, 10, 0, 0, time.UTC)\n\tupdatedAt := time.Date(2010, time.February, 10, 10, 10, 0, 0, time.UTC)\n\n\tu := &Gist{\n\t\tID:          Ptr(\"i\"),\n\t\tDescription: Ptr(\"description\"),\n\t\tPublic:      Ptr(true),\n\t\tOwner: &User{\n\t\t\tLogin:       Ptr(\"ll\"),\n\t\t\tID:          Ptr(int64(123)),\n\t\t\tAvatarURL:   Ptr(\"a\"),\n\t\t\tGravatarID:  Ptr(\"g\"),\n\t\t\tName:        Ptr(\"n\"),\n\t\t\tCompany:     Ptr(\"c\"),\n\t\t\tBlog:        Ptr(\"b\"),\n\t\t\tLocation:    Ptr(\"l\"),\n\t\t\tEmail:       Ptr(\"e\"),\n\t\t\tHireable:    Ptr(true),\n\t\t\tPublicRepos: Ptr(1),\n\t\t\tFollowers:   Ptr(1),\n\t\t\tFollowing:   Ptr(1),\n\t\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\t\tURL:         Ptr(\"u\"),\n\t\t},\n\t\tFiles: map[GistFilename]GistFile{\n\t\t\t\"gistfile.py\": {\n\t\t\t\tSize:     Ptr(167),\n\t\t\t\tFilename: Ptr(\"gistfile.py\"),\n\t\t\t\tLanguage: Ptr(\"Python\"),\n\t\t\t\tType:     Ptr(\"application/x-python\"),\n\t\t\t\tRawURL:   Ptr(\"raw-url\"),\n\t\t\t\tContent:  Ptr(\"c\"),\n\t\t\t},\n\t\t},\n\t\tComments:   Ptr(1),\n\t\tHTMLURL:    Ptr(\"html-url\"),\n\t\tGitPullURL: Ptr(\"gitpull-url\"),\n\t\tGitPushURL: Ptr(\"gitpush-url\"),\n\t\tCreatedAt:  &Timestamp{createdAt},\n\t\tUpdatedAt:  &Timestamp{updatedAt},\n\t\tNodeID:     Ptr(\"node\"),\n\t}\n\n\twant := `{\n\t\t\"id\": \"i\",\n\t\t\"description\": \"description\",\n\t\t\"public\": true,\n\t\t\"owner\": {\n\t\t\t\"login\": \"ll\",\n\t\t\t\"id\": 123,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"files\": {\n\t\t\t\"gistfile.py\": {\n\t\t\t\t\"size\": 167,\n\t\t\t\t\"filename\": \"gistfile.py\",\n\t\t\t\t\"language\": \"Python\",\n\t\t\t\t\"type\": \"application/x-python\",\n\t\t\t\t\"raw_url\": \"raw-url\",\n\t\t\t\t\"content\": \"c\"\n\t\t\t}\n\t\t},\n\t\t\"comments\": 1,\n\t\t\"html_url\": \"html-url\",\n\t\t\"git_pull_url\": \"gitpull-url\",\n\t\t\"git_push_url\": \"gitpush-url\",\n\t\t\"created_at\": \"2010-02-10T10:10:00Z\",\n\t\t\"updated_at\": \"2010-02-10T10:10:00Z\",\n\t\t\"node_id\": \"node\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestGistCommit_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &GistCommit{}, \"{}\")\n\n\tu := &GistCommit{\n\t\tURL:     Ptr(\"u\"),\n\t\tVersion: Ptr(\"v\"),\n\t\tUser: &User{\n\t\t\tLogin:       Ptr(\"ll\"),\n\t\t\tID:          Ptr(int64(123)),\n\t\t\tAvatarURL:   Ptr(\"a\"),\n\t\t\tGravatarID:  Ptr(\"g\"),\n\t\t\tName:        Ptr(\"n\"),\n\t\t\tCompany:     Ptr(\"c\"),\n\t\t\tBlog:        Ptr(\"b\"),\n\t\t\tLocation:    Ptr(\"l\"),\n\t\t\tEmail:       Ptr(\"e\"),\n\t\t\tHireable:    Ptr(true),\n\t\t\tPublicRepos: Ptr(1),\n\t\t\tFollowers:   Ptr(1),\n\t\t\tFollowing:   Ptr(1),\n\t\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\t\tURL:         Ptr(\"u\"),\n\t\t},\n\t\tChangeStatus: &CommitStats{\n\t\t\tAdditions: Ptr(1),\n\t\t\tDeletions: Ptr(1),\n\t\t\tTotal:     Ptr(2),\n\t\t},\n\t\tCommittedAt: &Timestamp{referenceTime},\n\t\tNodeID:      Ptr(\"node\"),\n\t}\n\n\twant := `{\n\t\t\"url\": \"u\",\n\t\t\"version\": \"v\",\n\t\t\"user\": {\n\t\t\t\"login\": \"ll\",\n\t\t\t\"id\": 123,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"change_status\": {\n\t\t\t\"additions\": 1,\n\t\t\t\"deletions\": 1,\n\t\t\t\"total\": 2\n\t\t},\n\t\t\"committed_at\": ` + referenceTimeStr + `,\n\t\t\"node_id\": \"node\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestGistFork_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &GistFork{}, \"{}\")\n\n\tu := &GistFork{\n\t\tURL: Ptr(\"u\"),\n\t\tUser: &User{\n\t\t\tLogin:       Ptr(\"ll\"),\n\t\t\tID:          Ptr(int64(123)),\n\t\t\tAvatarURL:   Ptr(\"a\"),\n\t\t\tGravatarID:  Ptr(\"g\"),\n\t\t\tName:        Ptr(\"n\"),\n\t\t\tCompany:     Ptr(\"c\"),\n\t\t\tBlog:        Ptr(\"b\"),\n\t\t\tLocation:    Ptr(\"l\"),\n\t\t\tEmail:       Ptr(\"e\"),\n\t\t\tHireable:    Ptr(true),\n\t\t\tPublicRepos: Ptr(1),\n\t\t\tFollowers:   Ptr(1),\n\t\t\tFollowing:   Ptr(1),\n\t\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\t\tURL:         Ptr(\"u\"),\n\t\t},\n\t\tID:        Ptr(\"id\"),\n\t\tCreatedAt: &Timestamp{referenceTime},\n\t\tUpdatedAt: &Timestamp{referenceTime},\n\t\tNodeID:    Ptr(\"node\"),\n\t}\n\n\twant := `{\n\t\t\"url\": \"u\",\n\t\t\"user\": {\n\t\t\t\"login\": \"ll\",\n\t\t\t\"id\": 123,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"id\": \"id\",\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"node_id\": \"node\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestGistsService_List_specifiedUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tsince := \"2013-01-01T00:00:00Z\"\n\n\tmux.HandleFunc(\"/users/u/gists\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"since\": since,\n\t\t})\n\t\tfmt.Fprint(w, `[{\"id\": \"1\"}]`)\n\t})\n\n\topt := &GistListOptions{Since: time.Date(2013, time.January, 1, 0, 0, 0, 0, time.UTC)}\n\tctx := t.Context()\n\tgists, _, err := client.Gists.List(ctx, \"u\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Gists.List returned error: %v\", err)\n\t}\n\n\twant := []*Gist{{ID: Ptr(\"1\")}}\n\tif !cmp.Equal(gists, want) {\n\t\tt.Errorf(\"Gists.List returned %+v, want %+v\", gists, want)\n\t}\n\n\tconst methodName = \"List\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Gists.List(ctx, \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Gists.List(ctx, \"u\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGistsService_List_authenticatedUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/gists\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"id\": \"1\"}]`)\n\t})\n\n\tctx := t.Context()\n\tgists, _, err := client.Gists.List(ctx, \"\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"Gists.List returned error: %v\", err)\n\t}\n\n\twant := []*Gist{{ID: Ptr(\"1\")}}\n\tif !cmp.Equal(gists, want) {\n\t\tt.Errorf(\"Gists.List returned %+v, want %+v\", gists, want)\n\t}\n\n\tconst methodName = \"List\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Gists.List(ctx, \"\\n\", nil)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Gists.List(ctx, \"\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGistsService_List_invalidUser(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Gists.List(ctx, \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestGistsService_ListAll(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tsince := \"2013-01-01T00:00:00Z\"\n\n\tmux.HandleFunc(\"/gists/public\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"since\": since,\n\t\t})\n\t\tfmt.Fprint(w, `[{\"id\": \"1\"}]`)\n\t})\n\n\topt := &GistListOptions{Since: time.Date(2013, time.January, 1, 0, 0, 0, 0, time.UTC)}\n\tctx := t.Context()\n\tgists, _, err := client.Gists.ListAll(ctx, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Gists.ListAll returned error: %v\", err)\n\t}\n\n\twant := []*Gist{{ID: Ptr(\"1\")}}\n\tif !cmp.Equal(gists, want) {\n\t\tt.Errorf(\"Gists.ListAll returned %+v, want %+v\", gists, want)\n\t}\n\n\tconst methodName = \"ListAll\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Gists.ListAll(ctx, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGistsService_ListStarred(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tsince := \"2013-01-01T00:00:00Z\"\n\n\tmux.HandleFunc(\"/gists/starred\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"since\": since,\n\t\t})\n\t\tfmt.Fprint(w, `[{\"id\": \"1\"}]`)\n\t})\n\n\topt := &GistListOptions{Since: time.Date(2013, time.January, 1, 0, 0, 0, 0, time.UTC)}\n\tctx := t.Context()\n\tgists, _, err := client.Gists.ListStarred(ctx, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Gists.ListStarred returned error: %v\", err)\n\t}\n\n\twant := []*Gist{{ID: Ptr(\"1\")}}\n\tif !cmp.Equal(gists, want) {\n\t\tt.Errorf(\"Gists.ListStarred returned %+v, want %+v\", gists, want)\n\t}\n\n\tconst methodName = \"ListStarred\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Gists.ListStarred(ctx, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGistsService_Get(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/gists/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\": \"1\"}`)\n\t})\n\n\tctx := t.Context()\n\tgist, _, err := client.Gists.Get(ctx, \"1\")\n\tif err != nil {\n\t\tt.Errorf(\"Gists.Get returned error: %v\", err)\n\t}\n\n\twant := &Gist{ID: Ptr(\"1\")}\n\tif !cmp.Equal(gist, want) {\n\t\tt.Errorf(\"Gists.Get returned %+v, want %+v\", gist, want)\n\t}\n\n\tconst methodName = \"Get\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Gists.Get(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Gists.Get(ctx, \"1\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGistsService_Get_invalidID(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Gists.Get(ctx, \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestGistsService_GetRevision(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/gists/1/s\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\": \"1\"}`)\n\t})\n\n\tctx := t.Context()\n\tgist, _, err := client.Gists.GetRevision(ctx, \"1\", \"s\")\n\tif err != nil {\n\t\tt.Errorf(\"Gists.Get returned error: %v\", err)\n\t}\n\n\twant := &Gist{ID: Ptr(\"1\")}\n\tif !cmp.Equal(gist, want) {\n\t\tt.Errorf(\"Gists.Get returned %+v, want %+v\", gist, want)\n\t}\n\n\tconst methodName = \"GetRevision\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Gists.GetRevision(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Gists.GetRevision(ctx, \"1\", \"s\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGistsService_GetRevision_invalidID(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Gists.GetRevision(ctx, \"%\", \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestGistsService_Create(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &Gist{\n\t\tDescription: Ptr(\"Gist description\"),\n\t\tPublic:      Ptr(false),\n\t\tFiles: map[GistFilename]GistFile{\n\t\t\t\"test.txt\": {Content: Ptr(\"Gist file content\")},\n\t\t},\n\t}\n\n\tmux.HandleFunc(\"/gists\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *Gist\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w,\n\t\t\t`\n\t\t\t{\n\t\t\t\t\"id\": \"1\",\n\t\t\t\t\"description\": \"Gist description\",\n\t\t\t\t\"public\": false,\n\t\t\t\t\"files\": {\n\t\t\t\t\t\"test.txt\": {\n\t\t\t\t\t\t\"filename\": \"test.txt\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tgist, _, err := client.Gists.Create(ctx, input)\n\tif err != nil {\n\t\tt.Errorf(\"Gists.Create returned error: %v\", err)\n\t}\n\n\twant := &Gist{\n\t\tID:          Ptr(\"1\"),\n\t\tDescription: Ptr(\"Gist description\"),\n\t\tPublic:      Ptr(false),\n\t\tFiles: map[GistFilename]GistFile{\n\t\t\t\"test.txt\": {Filename: Ptr(\"test.txt\")},\n\t\t},\n\t}\n\tif !cmp.Equal(gist, want) {\n\t\tt.Errorf(\"Gists.Create returned %+v, want %+v\", gist, want)\n\t}\n\n\tconst methodName = \"Create\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Gists.Create(ctx, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGistsService_Edit(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &Gist{\n\t\tDescription: Ptr(\"New description\"),\n\t\tFiles: map[GistFilename]GistFile{\n\t\t\t\"new.txt\": {Content: Ptr(\"new file content\")},\n\t\t},\n\t}\n\n\tmux.HandleFunc(\"/gists/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *Gist\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w,\n\t\t\t`\n\t\t\t{\n\t\t\t\t\"id\": \"1\",\n\t\t\t\t\"description\": \"new description\",\n\t\t\t\t\"public\": false,\n\t\t\t\t\"files\": {\n\t\t\t\t\t\"test.txt\": {\n\t\t\t\t\t\t\"filename\": \"test.txt\"\n\t\t\t\t\t},\n\t\t\t\t\t\"new.txt\": {\n\t\t\t\t\t\t\"filename\": \"new.txt\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tgist, _, err := client.Gists.Edit(ctx, \"1\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Gists.Edit returned error: %v\", err)\n\t}\n\n\twant := &Gist{\n\t\tID:          Ptr(\"1\"),\n\t\tDescription: Ptr(\"new description\"),\n\t\tPublic:      Ptr(false),\n\t\tFiles: map[GistFilename]GistFile{\n\t\t\t\"test.txt\": {Filename: Ptr(\"test.txt\")},\n\t\t\t\"new.txt\":  {Filename: Ptr(\"new.txt\")},\n\t\t},\n\t}\n\tif !cmp.Equal(gist, want) {\n\t\tt.Errorf(\"Gists.Edit returned %+v, want %+v\", gist, want)\n\t}\n\n\tconst methodName = \"Edit\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Gists.Edit(ctx, \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Gists.Edit(ctx, \"1\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGistsService_Edit_invalidID(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Gists.Edit(ctx, \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestGistsService_ListCommits(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/gists/1/commits\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, nil)\n\t\tfmt.Fprint(w, `\n\t\t  [\n\t\t    {\n\t\t      \"url\": \"https://api.github.com/gists/1/1\",\n\t\t      \"version\": \"1\",\n\t\t      \"user\": {\n\t\t        \"id\": 1\n\t\t      },\n\t\t      \"change_status\": {\n\t\t        \"deletions\": 0,\n\t\t        \"additions\": 180,\n\t\t        \"total\": 180\n\t\t      },\n\t\t      \"committed_at\": \"2010-01-01T00:00:00Z\"\n\t\t    }\n\t\t  ]\n\t\t`)\n\t})\n\n\tctx := t.Context()\n\tgistCommits, _, err := client.Gists.ListCommits(ctx, \"1\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"Gists.ListCommits returned error: %v\", err)\n\t}\n\n\twant := []*GistCommit{{\n\t\tURL:         Ptr(\"https://api.github.com/gists/1/1\"),\n\t\tVersion:     Ptr(\"1\"),\n\t\tUser:        &User{ID: Ptr(int64(1))},\n\t\tCommittedAt: &Timestamp{time.Date(2010, time.January, 1, 0, 0, 0, 0, time.UTC)},\n\t\tChangeStatus: &CommitStats{\n\t\t\tAdditions: Ptr(180),\n\t\t\tDeletions: Ptr(0),\n\t\t\tTotal:     Ptr(180),\n\t\t},\n\t}}\n\n\tif !cmp.Equal(gistCommits, want) {\n\t\tt.Errorf(\"Gists.ListCommits returned %+v, want %+v\", gistCommits, want)\n\t}\n\n\tconst methodName = \"ListCommits\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Gists.ListCommits(ctx, \"\\n\", nil)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Gists.ListCommits(ctx, \"1\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGistsService_ListCommits_withOptions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/gists/1/commits\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[]`)\n\t})\n\n\tctx := t.Context()\n\t_, _, err := client.Gists.ListCommits(ctx, \"1\", &ListOptions{Page: 2})\n\tif err != nil {\n\t\tt.Errorf(\"Gists.ListCommits returned error: %v\", err)\n\t}\n\n\tconst methodName = \"ListCommits\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Gists.ListCommits(ctx, \"\\n\", &ListOptions{Page: 2})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Gists.ListCommits(ctx, \"1\", &ListOptions{Page: 2})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGistsService_ListCommits_invalidID(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Gists.ListCommits(ctx, \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestGistsService_Delete(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/gists/1\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Gists.Delete(ctx, \"1\")\n\tif err != nil {\n\t\tt.Errorf(\"Gists.Delete returned error: %v\", err)\n\t}\n\n\tconst methodName = \"Delete\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Gists.Delete(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Gists.Delete(ctx, \"1\")\n\t})\n}\n\nfunc TestGistsService_Delete_invalidID(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Gists.Delete(ctx, \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestGistsService_Star(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/gists/1/star\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Gists.Star(ctx, \"1\")\n\tif err != nil {\n\t\tt.Errorf(\"Gists.Star returned error: %v\", err)\n\t}\n\n\tconst methodName = \"Star\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Gists.Star(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Gists.Star(ctx, \"1\")\n\t})\n}\n\nfunc TestGistsService_Star_invalidID(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Gists.Star(ctx, \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestGistsService_Unstar(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/gists/1/star\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Gists.Unstar(ctx, \"1\")\n\tif err != nil {\n\t\tt.Errorf(\"Gists.Unstar returned error: %v\", err)\n\t}\n\n\tconst methodName = \"Unstar\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Gists.Unstar(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Gists.Unstar(ctx, \"1\")\n\t})\n}\n\nfunc TestGistsService_Unstar_invalidID(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Gists.Unstar(ctx, \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestGistsService_IsStarred_hasStar(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/gists/1/star\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tstar, _, err := client.Gists.IsStarred(ctx, \"1\")\n\tif err != nil {\n\t\tt.Errorf(\"Gists.Starred returned error: %v\", err)\n\t}\n\tif want := true; star != want {\n\t\tt.Errorf(\"Gists.Starred returned %+v, want %+v\", star, want)\n\t}\n\n\tconst methodName = \"IsStarred\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Gists.IsStarred(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Gists.IsStarred(ctx, \"1\")\n\t\tif got {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want false\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGistsService_IsStarred_noStar(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/gists/1/star\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tstar, _, err := client.Gists.IsStarred(ctx, \"1\")\n\tif err != nil {\n\t\tt.Errorf(\"Gists.Starred returned error: %v\", err)\n\t}\n\tif want := false; star != want {\n\t\tt.Errorf(\"Gists.Starred returned %+v, want %+v\", star, want)\n\t}\n\n\tconst methodName = \"IsStarred\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Gists.IsStarred(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Gists.IsStarred(ctx, \"1\")\n\t\tif got {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want false\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGistsService_IsStarred_invalidID(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Gists.IsStarred(ctx, \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestGistsService_Fork(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/gists/1/forks\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\"id\": \"2\"}`)\n\t})\n\n\tctx := t.Context()\n\tgist, _, err := client.Gists.Fork(ctx, \"1\")\n\tif err != nil {\n\t\tt.Errorf(\"Gists.Fork returned error: %v\", err)\n\t}\n\n\twant := &Gist{ID: Ptr(\"2\")}\n\tif !cmp.Equal(gist, want) {\n\t\tt.Errorf(\"Gists.Fork returned %+v, want %+v\", gist, want)\n\t}\n\n\tconst methodName = \"Fork\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Gists.Fork(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Gists.Fork(ctx, \"1\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGistsService_ListForks(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/gists/1/forks\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, nil)\n\t\tfmt.Fprint(w, `\n\t\t  [\n\t\t    {\"url\": \"https://api.github.com/gists/1\",\n\t\t     \"user\": {\"id\": 1},\n\t\t     \"id\": \"1\",\n\t\t     \"created_at\": \"2010-01-01T00:00:00Z\",\n\t\t     \"updated_at\": \"2013-01-01T00:00:00Z\"\n\t\t    }\n\t\t  ]\n\t\t`)\n\t})\n\n\tctx := t.Context()\n\tgistForks, _, err := client.Gists.ListForks(ctx, \"1\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"Gists.ListForks returned error: %v\", err)\n\t}\n\n\twant := []*GistFork{{\n\t\tURL:       Ptr(\"https://api.github.com/gists/1\"),\n\t\tID:        Ptr(\"1\"),\n\t\tUser:      &User{ID: Ptr(int64(1))},\n\t\tCreatedAt: &Timestamp{time.Date(2010, time.January, 1, 0, 0, 0, 0, time.UTC)},\n\t\tUpdatedAt: &Timestamp{time.Date(2013, time.January, 1, 0, 0, 0, 0, time.UTC)},\n\t}}\n\n\tif !cmp.Equal(gistForks, want) {\n\t\tt.Errorf(\"Gists.ListForks returned %+v, want %+v\", gistForks, want)\n\t}\n\n\tconst methodName = \"ListForks\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Gists.ListForks(ctx, \"\\n\", nil)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Gists.ListForks(ctx, \"1\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGistsService_ListForks_withOptions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/gists/1/forks\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[]`)\n\t})\n\n\tctx := t.Context()\n\tgistForks, _, err := client.Gists.ListForks(ctx, \"1\", &ListOptions{Page: 2})\n\tif err != nil {\n\t\tt.Errorf(\"Gists.ListForks returned error: %v\", err)\n\t}\n\n\twant := []*GistFork{}\n\tif !cmp.Equal(gistForks, want) {\n\t\tt.Errorf(\"Gists.ListForks returned %+v, want %+v\", gistForks, want)\n\t}\n\n\tconst methodName = \"ListForks\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Gists.ListForks(ctx, \"\\n\", &ListOptions{Page: 2})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Gists.ListForks(ctx, \"1\", &ListOptions{Page: 2})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGistFile_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &GistFile{}, \"{}\")\n\n\tu := &GistFile{\n\t\tSize:     Ptr(1),\n\t\tFilename: Ptr(\"fn\"),\n\t\tLanguage: Ptr(\"lan\"),\n\t\tType:     Ptr(\"type\"),\n\t\tRawURL:   Ptr(\"rurl\"),\n\t\tContent:  Ptr(\"con\"),\n\t}\n\n\twant := `{\n\t\t\"size\": 1,\n\t\t\"filename\": \"fn\",\n\t\t\"language\": \"lan\",\n\t\t\"type\": \"type\",\n\t\t\"raw_url\": \"rurl\",\n\t\t\"content\": \"con\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/git.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\n// GitService handles communication with the git data related\n// methods of the GitHub API.\n//\n// GitHub API docs: https://docs.github.com/rest/git/\ntype GitService service\n"
  },
  {
    "path": "github/git_blobs.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n)\n\n// Blob represents a blob object.\ntype Blob struct {\n\tContent  *string `json:\"content,omitempty\"`\n\tEncoding *string `json:\"encoding,omitempty\"`\n\tSHA      *string `json:\"sha,omitempty\"`\n\tSize     *int    `json:\"size,omitempty\"`\n\tURL      *string `json:\"url,omitempty\"`\n\tNodeID   *string `json:\"node_id,omitempty\"`\n}\n\n// GetBlob fetches a blob from a repo given a SHA.\n//\n// GitHub API docs: https://docs.github.com/rest/git/blobs#get-a-blob\n//\n//meta:operation GET /repos/{owner}/{repo}/git/blobs/{file_sha}\nfunc (s *GitService) GetBlob(ctx context.Context, owner, repo, sha string) (*Blob, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/git/blobs/%v\", owner, repo, sha)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar blob *Blob\n\tresp, err := s.client.Do(ctx, req, &blob)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn blob, resp, nil\n}\n\n// GetBlobRaw fetches a blob's contents from a repo.\n// Unlike GetBlob, it returns the raw bytes rather than the base64-encoded data.\n//\n// GitHub API docs: https://docs.github.com/rest/git/blobs#get-a-blob\n//\n//meta:operation GET /repos/{owner}/{repo}/git/blobs/{file_sha}\nfunc (s *GitService) GetBlobRaw(ctx context.Context, owner, repo, sha string) ([]byte, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/git/blobs/%v\", owner, repo, sha)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", \"application/vnd.github.v3.raw\")\n\n\tvar buf bytes.Buffer\n\tresp, err := s.client.Do(ctx, req, &buf)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn buf.Bytes(), resp, nil\n}\n\n// CreateBlob creates a blob object.\n//\n// GitHub API docs: https://docs.github.com/rest/git/blobs#create-a-blob\n//\n//meta:operation POST /repos/{owner}/{repo}/git/blobs\nfunc (s *GitService) CreateBlob(ctx context.Context, owner, repo string, blob Blob) (*Blob, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/git/blobs\", owner, repo)\n\treq, err := s.client.NewRequest(\"POST\", u, blob)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar v *Blob\n\tresp, err := s.client.Do(ctx, req, &v)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn v, resp, nil\n}\n"
  },
  {
    "path": "github/git_blobs_test.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestGitService_GetBlob(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/git/blobs/s\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\n\t\tfmt.Fprint(w, `{\n\t\t\t  \"sha\": \"s\",\n\t\t\t  \"content\": \"blob content\"\n\t\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tblob, _, err := client.Git.GetBlob(ctx, \"o\", \"r\", \"s\")\n\tif err != nil {\n\t\tt.Errorf(\"Git.GetBlob returned error: %v\", err)\n\t}\n\n\twant := Blob{\n\t\tSHA:     Ptr(\"s\"),\n\t\tContent: Ptr(\"blob content\"),\n\t}\n\n\tif !cmp.Equal(*blob, want) {\n\t\tt.Errorf(\"Blob.Get returned %+v, want %+v\", *blob, want)\n\t}\n\n\tconst methodName = \"GetBlob\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Git.GetBlob(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Git.GetBlob(ctx, \"o\", \"r\", \"s\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGitService_GetBlob_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Git.GetBlob(ctx, \"%\", \"%\", \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestGitService_GetBlobRaw(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/git/blobs/s\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", \"application/vnd.github.v3.raw\")\n\n\t\tfmt.Fprint(w, `raw contents here`)\n\t})\n\n\tctx := t.Context()\n\tblob, _, err := client.Git.GetBlobRaw(ctx, \"o\", \"r\", \"s\")\n\tif err != nil {\n\t\tt.Errorf(\"Git.GetBlobRaw returned error: %v\", err)\n\t}\n\n\twant := []byte(\"raw contents here\")\n\tif !bytes.Equal(blob, want) {\n\t\tt.Errorf(\"GetBlobRaw returned %q, want %q\", blob, want)\n\t}\n\n\tconst methodName = \"GetBlobRaw\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Git.GetBlobRaw(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Git.GetBlobRaw(ctx, \"o\", \"r\", \"s\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGitService_CreateBlob(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := Blob{\n\t\tSHA:      Ptr(\"s\"),\n\t\tContent:  Ptr(\"blob content\"),\n\t\tEncoding: Ptr(\"utf-8\"),\n\t\tSize:     Ptr(12),\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/git/blobs\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *Blob\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\n\t\twant := input\n\t\tif !cmp.Equal(*v, want) {\n\t\t\tt.Errorf(\"Git.CreateBlob request body: %+v, want %+v\", *v, want)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\n\t\t \"sha\": \"s\",\n\t\t \"content\": \"blob content\",\n\t\t \"encoding\": \"utf-8\",\n\t\t \"size\": 12\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tblob, _, err := client.Git.CreateBlob(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Git.CreateBlob returned error: %v\", err)\n\t}\n\n\twant := input\n\n\tif !cmp.Equal(*blob, want) {\n\t\tt.Errorf(\"Git.CreateBlob returned %+v, want %+v\", *blob, want)\n\t}\n\n\tconst methodName = \"CreateBlob\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Git.CreateBlob(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Git.CreateBlob(ctx, \"o\", \"r\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGitService_CreateBlob_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Git.CreateBlob(ctx, \"%\", \"%\", Blob{})\n\ttestURLParseError(t, err)\n}\n\nfunc TestBlob_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Blob{}, \"{}\")\n\n\tu := &Blob{\n\t\tContent:  Ptr(\"content\"),\n\t\tEncoding: Ptr(\"encoding\"),\n\t\tSHA:      Ptr(\"sha\"),\n\t\tSize:     Ptr(1),\n\t\tURL:      Ptr(\"url\"),\n\t\tNodeID:   Ptr(\"nid\"),\n\t}\n\n\twant := `{\n\t\t\"content\": \"content\",\n\t\t\"encoding\": \"encoding\",\n\t\t\"sha\": \"sha\",\n\t\t\"size\": 1,\n\t\t\"url\": \"url\",\n\t\t\"node_id\": \"nid\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/git_commits.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n)\n\n// SignatureVerification represents GPG signature verification.\ntype SignatureVerification struct {\n\tVerified  *bool   `json:\"verified,omitempty\"`\n\tReason    *string `json:\"reason,omitempty\"`\n\tSignature *string `json:\"signature,omitempty\"`\n\tPayload   *string `json:\"payload,omitempty\"`\n}\n\n// MessageSigner is used by GitService.CreateCommit to sign a commit.\n//\n// To create a MessageSigner that signs a commit with a [golang.org/x/crypto/openpgp.Entity],\n// or [github.com/ProtonMail/go-crypto/openpgp.Entity], use:\n//\n//\tcommit.Signer = github.MessageSignerFunc(func(w io.Writer, r io.Reader) error {\n//\t\treturn openpgp.ArmoredDetachSign(w, openpgpEntity, r, nil)\n//\t})\ntype MessageSigner interface {\n\tSign(w io.Writer, r io.Reader) error\n}\n\n// MessageSignerFunc is a single function implementation of MessageSigner.\ntype MessageSignerFunc func(w io.Writer, r io.Reader) error\n\n// Sign implements the MessageSigner interface for MessageSignerFunc.\nfunc (f MessageSignerFunc) Sign(w io.Writer, r io.Reader) error {\n\treturn f(w, r)\n}\n\n// Commit represents a GitHub commit.\ntype Commit struct {\n\tSHA          *string                `json:\"sha,omitempty\"`\n\tAuthor       *CommitAuthor          `json:\"author,omitempty\"`\n\tCommitter    *CommitAuthor          `json:\"committer,omitempty\"`\n\tMessage      *string                `json:\"message,omitempty\"`\n\tTree         *Tree                  `json:\"tree,omitempty\"`\n\tParents      []*Commit              `json:\"parents,omitempty\"`\n\tHTMLURL      *string                `json:\"html_url,omitempty\"`\n\tURL          *string                `json:\"url,omitempty\"`\n\tVerification *SignatureVerification `json:\"verification,omitempty\"`\n\tNodeID       *string                `json:\"node_id,omitempty\"`\n\n\t// CommentCount is the number of GitHub comments on the commit. This\n\t// is only populated for requests that fetch GitHub data like\n\t// Pulls.ListCommits, Repositories.ListCommits, etc.\n\tCommentCount *int `json:\"comment_count,omitempty\"`\n}\n\nfunc (c Commit) String() string {\n\treturn Stringify(c)\n}\n\n// CommitAuthor represents the author or committer of a commit. The commit\n// author may not correspond to a GitHub User.\ntype CommitAuthor struct {\n\tDate  *Timestamp `json:\"date,omitempty\"`\n\tName  *string    `json:\"name,omitempty\"`\n\tEmail *string    `json:\"email,omitempty\"`\n\n\t// The following fields are only populated by Webhook events.\n\tLogin *string `json:\"username,omitempty\"` // Renamed for go-github consistency.\n}\n\nfunc (c CommitAuthor) String() string {\n\treturn Stringify(c)\n}\n\n// GetCommit fetches the Commit object for a given SHA.\n//\n// GitHub API docs: https://docs.github.com/rest/git/commits#get-a-commit-object\n//\n//meta:operation GET /repos/{owner}/{repo}/git/commits/{commit_sha}\nfunc (s *GitService) GetCommit(ctx context.Context, owner, repo, sha string) (*Commit, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/git/commits/%v\", owner, repo, sha)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar c *Commit\n\tresp, err := s.client.Do(ctx, req, &c)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn c, resp, nil\n}\n\n// createCommit represents the body of a CreateCommit request.\ntype createCommit struct {\n\tAuthor    *CommitAuthor `json:\"author,omitempty\"`\n\tCommitter *CommitAuthor `json:\"committer,omitempty\"`\n\tMessage   *string       `json:\"message,omitempty\"`\n\tTree      *string       `json:\"tree,omitempty\"`\n\tParents   []string      `json:\"parents,omitempty\"`\n\tSignature *string       `json:\"signature,omitempty\"`\n}\n\n// CreateCommitOptions specifies optional parameters to creates\n// a new commit in a repository.\ntype CreateCommitOptions struct {\n\t// CreateCommit will sign the commit with this signer. See MessageSigner doc for more details.\n\t// Ignored on commits where Verification.Signature is defined.\n\tSigner MessageSigner\n}\n\n// CreateCommit creates a new commit in a repository.\n// commit must not be nil.\n//\n// The commit.Committer is optional and will be filled with the commit.Author\n// data if omitted. If the commit.Author is omitted, it will be filled in with\n// the authenticated user’s information and the current date.\n//\n// GitHub API docs: https://docs.github.com/rest/git/commits#create-a-commit\n//\n//meta:operation POST /repos/{owner}/{repo}/git/commits\nfunc (s *GitService) CreateCommit(ctx context.Context, owner, repo string, commit Commit, opts *CreateCommitOptions) (*Commit, *Response, error) {\n\tif opts == nil {\n\t\topts = &CreateCommitOptions{}\n\t}\n\n\tu := fmt.Sprintf(\"repos/%v/%v/git/commits\", owner, repo)\n\n\tparents := make([]string, len(commit.Parents))\n\tfor i, parent := range commit.Parents {\n\t\tparents[i] = *parent.SHA\n\t}\n\n\tbody := &createCommit{\n\t\tAuthor:    commit.Author,\n\t\tCommitter: commit.Committer,\n\t\tMessage:   commit.Message,\n\t\tParents:   parents,\n\t}\n\tif commit.Tree != nil {\n\t\tbody.Tree = commit.Tree.SHA\n\t}\n\tswitch {\n\tcase commit.Verification != nil:\n\t\tbody.Signature = commit.Verification.Signature\n\tcase opts.Signer != nil:\n\t\tsignature, err := createSignature(opts.Signer, body)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tbody.Signature = &signature\n\t}\n\n\treq, err := s.client.NewRequest(\"POST\", u, body)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar c *Commit\n\tresp, err := s.client.Do(ctx, req, &c)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn c, resp, nil\n}\n\nfunc createSignature(signer MessageSigner, commit *createCommit) (string, error) {\n\tif signer == nil {\n\t\treturn \"\", errors.New(\"createSignature: invalid parameters\")\n\t}\n\n\tmessage, err := createSignatureMessage(commit)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tvar writer bytes.Buffer\n\terr = signer.Sign(&writer, strings.NewReader(message))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn writer.String(), nil\n}\n\nfunc createSignatureMessage(commit *createCommit) (string, error) {\n\tif commit == nil || commit.Message == nil || *commit.Message == \"\" || commit.Author == nil {\n\t\treturn \"\", errors.New(\"createSignatureMessage: invalid parameters\")\n\t}\n\n\tvar message []string\n\n\tif commit.Tree != nil {\n\t\tmessage = append(message, fmt.Sprintf(\"tree %v\", *commit.Tree))\n\t}\n\n\tfor _, parent := range commit.Parents {\n\t\tmessage = append(message, fmt.Sprintf(\"parent %v\", parent))\n\t}\n\n\tmessage = append(message, fmt.Sprintf(\"author %v <%v> %v %v\", commit.Author.GetName(), commit.Author.GetEmail(), commit.Author.GetDate().Unix(), commit.Author.GetDate().Format(\"-0700\")))\n\n\tcommitter := commit.Committer\n\tif committer == nil {\n\t\tcommitter = commit.Author\n\t}\n\n\t// There needs to be a double newline after committer\n\tmessage = append(message, fmt.Sprintf(\"committer %v <%v> %v %v\\n\", committer.GetName(), committer.GetEmail(), committer.GetDate().Unix(), committer.GetDate().Format(\"-0700\")))\n\tmessage = append(message, *commit.Message)\n\n\treturn strings.Join(message, \"\\n\"), nil\n}\n"
  },
  {
    "path": "github/git_commits_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc mockSigner(t *testing.T, signature string, emitErr error, wantMessage string) MessageSignerFunc {\n\treturn func(w io.Writer, r io.Reader) error {\n\t\tt.Helper()\n\t\tmessage, err := io.ReadAll(r)\n\t\tassertNilError(t, err)\n\t\tif wantMessage != \"\" && string(message) != wantMessage {\n\t\t\tt.Errorf(\"MessageSignerFunc got %q, want %q\", string(message), wantMessage)\n\t\t}\n\t\tassertWrite(t, w, []byte(signature))\n\t\treturn emitErr\n\t}\n}\n\nfunc uncalledSigner(t *testing.T) MessageSignerFunc {\n\treturn func(io.Writer, io.Reader) error {\n\t\tt.Error(\"MessageSignerFunc should not be called\")\n\t\treturn nil\n\t}\n}\n\nfunc TestCommit_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Commit{}, \"{}\")\n\n\tu := &Commit{\n\t\tSHA: Ptr(\"s\"),\n\t\tAuthor: &CommitAuthor{\n\t\t\tDate:  &Timestamp{referenceTime},\n\t\t\tName:  Ptr(\"n\"),\n\t\t\tEmail: Ptr(\"e\"),\n\t\t\tLogin: Ptr(\"u\"),\n\t\t},\n\t\tCommitter: &CommitAuthor{\n\t\t\tDate:  &Timestamp{referenceTime},\n\t\t\tName:  Ptr(\"n\"),\n\t\t\tEmail: Ptr(\"e\"),\n\t\t\tLogin: Ptr(\"u\"),\n\t\t},\n\t\tMessage: Ptr(\"m\"),\n\t\tTree: &Tree{\n\t\t\tSHA: Ptr(\"s\"),\n\t\t\tEntries: []*TreeEntry{{\n\t\t\t\tSHA:     Ptr(\"s\"),\n\t\t\t\tPath:    Ptr(\"p\"),\n\t\t\t\tMode:    Ptr(\"m\"),\n\t\t\t\tType:    Ptr(\"t\"),\n\t\t\t\tSize:    Ptr(1),\n\t\t\t\tContent: Ptr(\"c\"),\n\t\t\t\tURL:     Ptr(\"u\"),\n\t\t\t}},\n\t\t\tTruncated: Ptr(false),\n\t\t},\n\t\tParents: nil,\n\t\tHTMLURL: Ptr(\"h\"),\n\t\tURL:     Ptr(\"u\"),\n\t\tVerification: &SignatureVerification{\n\t\t\tVerified:  Ptr(false),\n\t\t\tReason:    Ptr(\"r\"),\n\t\t\tSignature: Ptr(\"s\"),\n\t\t\tPayload:   Ptr(\"p\"),\n\t\t},\n\t\tNodeID:       Ptr(\"n\"),\n\t\tCommentCount: Ptr(1),\n\t}\n\n\twant := `{\n\t\t\"sha\": \"s\",\n\t\t\"author\": {\n\t\t\t\"date\": ` + referenceTimeStr + `,\n\t\t\t\"name\": \"n\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"username\": \"u\"\n\t\t},\n\t\t\"committer\": {\n\t\t\t\"date\": ` + referenceTimeStr + `,\n\t\t\t\"name\": \"n\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"username\": \"u\"\n\t\t},\n\t\t\"message\": \"m\",\n\t\t\"tree\": {\n\t\t\t\"sha\": \"s\",\n\t\t\t\"tree\": [\n\t\t\t\t{\n\t\t\t\t\t\"sha\": \"s\",\n\t\t\t\t\t\"path\": \"p\",\n\t\t\t\t\t\"mode\": \"m\",\n\t\t\t\t\t\"type\": \"t\",\n\t\t\t\t\t\"size\": 1,\n\t\t\t\t\t\"content\": \"c\",\n\t\t\t\t\t\"url\": \"u\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"truncated\": false\n\t\t},\n\t\t\"html_url\": \"h\",\n\t\t\"url\": \"u\",\n\t\t\"verification\": {\n\t\t\t\"verified\": false,\n\t\t\t\"reason\": \"r\",\n\t\t\t\"signature\": \"s\",\n\t\t\t\"payload\": \"p\"\n\t\t},\n\t\t\"node_id\": \"n\",\n\t\t\"comment_count\": 1\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestGitService_GetCommit(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/git/commits/s\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"sha\":\"s\",\"message\":\"Commit Message.\",\"author\":{\"name\":\"n\"}}`)\n\t})\n\n\tctx := t.Context()\n\tcommit, _, err := client.Git.GetCommit(ctx, \"o\", \"r\", \"s\")\n\tif err != nil {\n\t\tt.Errorf(\"Git.GetCommit returned error: %v\", err)\n\t}\n\n\twant := &Commit{SHA: Ptr(\"s\"), Message: Ptr(\"Commit Message.\"), Author: &CommitAuthor{Name: Ptr(\"n\")}}\n\tif !cmp.Equal(commit, want) {\n\t\tt.Errorf(\"Git.GetCommit returned %+v, want %+v\", commit, want)\n\t}\n\n\tconst methodName = \"GetCommit\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Git.GetCommit(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Git.GetCommit(ctx, \"o\", \"r\", \"s\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGitService_GetCommit_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Git.GetCommit(ctx, \"%\", \"%\", \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestGitService_CreateCommit(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := Commit{\n\t\tMessage: Ptr(\"Commit Message.\"),\n\t\tTree:    &Tree{SHA: Ptr(\"t\")},\n\t\tParents: []*Commit{{SHA: Ptr(\"p\")}},\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/git/commits\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *createCommit\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\n\t\twant := &createCommit{\n\t\t\tMessage: input.Message,\n\t\t\tTree:    Ptr(\"t\"),\n\t\t\tParents: []string{\"p\"},\n\t\t}\n\t\tif !cmp.Equal(v, want) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, want)\n\t\t}\n\t\tfmt.Fprint(w, `{\"sha\":\"s\"}`)\n\t})\n\n\tctx := t.Context()\n\tcommit, _, err := client.Git.CreateCommit(ctx, \"o\", \"r\", input, nil)\n\tif err != nil {\n\t\tt.Errorf(\"Git.CreateCommit returned error: %v\", err)\n\t}\n\n\twant := &Commit{SHA: Ptr(\"s\")}\n\tif !cmp.Equal(commit, want) {\n\t\tt.Errorf(\"Git.CreateCommit returned %+v, want %+v\", commit, want)\n\t}\n\n\tconst methodName = \"CreateCommit\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Git.CreateCommit(ctx, \"\\n\", \"\\n\", input, nil)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Git.CreateCommit(ctx, \"o\", \"r\", input, nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGitService_CreateSignedCommit(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tsignature := \"----- BEGIN PGP SIGNATURE -----\\n\\naaaa\\naaaa\\n----- END PGP SIGNATURE -----\"\n\n\tinput := Commit{\n\t\tMessage: Ptr(\"Commit Message.\"),\n\t\tTree:    &Tree{SHA: Ptr(\"t\")},\n\t\tParents: []*Commit{{SHA: Ptr(\"p\")}},\n\t\tVerification: &SignatureVerification{\n\t\t\tSignature: Ptr(signature),\n\t\t},\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/git/commits\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *createCommit\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\n\t\twant := &createCommit{\n\t\t\tMessage:   input.Message,\n\t\t\tTree:      Ptr(\"t\"),\n\t\t\tParents:   []string{\"p\"},\n\t\t\tSignature: Ptr(signature),\n\t\t}\n\t\tif !cmp.Equal(v, want) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, want)\n\t\t}\n\t\tfmt.Fprint(w, `{\"sha\":\"commitSha\"}`)\n\t})\n\n\tctx := t.Context()\n\tcommit, _, err := client.Git.CreateCommit(ctx, \"o\", \"r\", input, nil)\n\tif err != nil {\n\t\tt.Errorf(\"Git.CreateCommit returned error: %v\", err)\n\t}\n\n\twant := &Commit{SHA: Ptr(\"commitSha\")}\n\tif !cmp.Equal(commit, want) {\n\t\tt.Errorf(\"Git.CreateCommit returned %+v, want %+v\", commit, want)\n\t}\n\n\tconst methodName = \"CreateCommit\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Git.CreateCommit(ctx, \"\\n\", \"\\n\", input, nil)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Git.CreateCommit(ctx, \"o\", \"r\", input, nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGitService_CreateSignedCommitWithInvalidParams(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tinput := Commit{}\n\n\tctx := t.Context()\n\topts := CreateCommitOptions{Signer: uncalledSigner(t)}\n\t_, _, err := client.Git.CreateCommit(ctx, \"o\", \"r\", input, &opts)\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned because invalid params were passed\")\n\t}\n}\n\nfunc TestGitService_CreateCommit_WithSigner(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tsignature := \"my voice is my password\"\n\tdate := time.Date(2017, time.May, 4, 0, 3, 43, 0, time.FixedZone(\"CEST\", 2*3600))\n\tauthor := CommitAuthor{\n\t\tName:  Ptr(\"go-github\"),\n\t\tEmail: Ptr(\"go-github@github.com\"),\n\t\tDate:  &Timestamp{date},\n\t}\n\twantMessage := `tree t\nparent p\nauthor go-github <go-github@github.com> 1493849023 +0200\ncommitter go-github <go-github@github.com> 1493849023 +0200\n\nCommit Message.`\n\tsha := \"commitSha\"\n\tinput := Commit{\n\t\tSHA:     &sha,\n\t\tMessage: Ptr(\"Commit Message.\"),\n\t\tTree:    &Tree{SHA: Ptr(\"t\")},\n\t\tParents: []*Commit{{SHA: Ptr(\"p\")}},\n\t\tAuthor:  &author,\n\t}\n\twantBody := createCommit{\n\t\tMessage:   input.Message,\n\t\tTree:      Ptr(\"t\"),\n\t\tParents:   []string{\"p\"},\n\t\tAuthor:    &author,\n\t\tSignature: &signature,\n\t}\n\tvar gotBody createCommit\n\tmux.HandleFunc(\"/repos/o/r/git/commits\", func(w http.ResponseWriter, r *http.Request) {\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&gotBody))\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprintf(w, `{\"sha\":\"%v\"}`, sha)\n\t})\n\tctx := t.Context()\n\twantCommit := &Commit{SHA: Ptr(sha)}\n\topts := CreateCommitOptions{Signer: mockSigner(t, signature, nil, wantMessage)}\n\tcommit, _, err := client.Git.CreateCommit(ctx, \"o\", \"r\", input, &opts)\n\tassertNilError(t, err)\n\tif cmp.Diff(gotBody, wantBody) != \"\" {\n\t\tt.Errorf(\"Request body = %+v, want %+v\\n%v\", gotBody, wantBody, cmp.Diff(gotBody, wantBody))\n\t}\n\tif cmp.Diff(commit, wantCommit) != \"\" {\n\t\tt.Errorf(\"Git.CreateCommit returned %+v, want %+v\\n%v\", commit, wantCommit, cmp.Diff(commit, wantCommit))\n\t}\n}\n\nfunc TestGitService_createSignature_nilSigner(t *testing.T) {\n\tt.Parallel()\n\ta := &createCommit{\n\t\tMessage: Ptr(\"Commit Message.\"),\n\t\tTree:    Ptr(\"t\"),\n\t\tParents: []string{\"p\"},\n\t}\n\n\t_, err := createSignature(nil, a)\n\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned because no author was passed\")\n\t}\n}\n\nfunc TestGitService_createSignature_nilCommit(t *testing.T) {\n\tt.Parallel()\n\t_, err := createSignature(uncalledSigner(t), nil)\n\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned because no author was passed\")\n\t}\n}\n\nfunc TestGitService_createSignature_signerError(t *testing.T) {\n\tt.Parallel()\n\ta := &createCommit{\n\t\tMessage: Ptr(\"Commit Message.\"),\n\t\tTree:    Ptr(\"t\"),\n\t\tParents: []string{\"p\"},\n\t\tAuthor:  &CommitAuthor{Name: Ptr(\"go-github\")},\n\t}\n\n\tsigner := mockSigner(t, \"\", errors.New(\"signer error\"), \"\")\n\t_, err := createSignature(signer, a)\n\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned because signer returned an error\")\n\t}\n}\n\nfunc TestGitService_createSignatureMessage_nilCommit(t *testing.T) {\n\tt.Parallel()\n\t_, err := createSignatureMessage(nil)\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned due to nil key\")\n\t}\n}\n\nfunc TestGitService_createSignatureMessage_nilMessage(t *testing.T) {\n\tt.Parallel()\n\tdate, _ := time.Parse(\"Mon Jan 02 15:04:05 2006 -0700\", \"Thu May 04 00:03:43 2017 +0200\")\n\n\t_, err := createSignatureMessage(&createCommit{\n\t\tMessage: nil,\n\t\tParents: []string{\"p\"},\n\t\tAuthor: &CommitAuthor{\n\t\t\tName:  Ptr(\"go-github\"),\n\t\t\tEmail: Ptr(\"go-github@github.com\"),\n\t\t\tDate:  &Timestamp{date},\n\t\t},\n\t})\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned due to nil key\")\n\t}\n}\n\nfunc TestGitService_createSignatureMessage_emptyMessage(t *testing.T) {\n\tt.Parallel()\n\tdate, _ := time.Parse(\"Mon Jan 02 15:04:05 2006 -0700\", \"Thu May 04 00:03:43 2017 +0200\")\n\temptyString := \"\"\n\t_, err := createSignatureMessage(&createCommit{\n\t\tMessage: &emptyString,\n\t\tParents: []string{\"p\"},\n\t\tAuthor: &CommitAuthor{\n\t\t\tName:  Ptr(\"go-github\"),\n\t\t\tEmail: Ptr(\"go-github@github.com\"),\n\t\t\tDate:  &Timestamp{date},\n\t\t},\n\t})\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned due to nil key\")\n\t}\n}\n\nfunc TestGitService_createSignatureMessage_nilAuthor(t *testing.T) {\n\tt.Parallel()\n\t_, err := createSignatureMessage(&createCommit{\n\t\tMessage: Ptr(\"Commit Message.\"),\n\t\tParents: []string{\"p\"},\n\t\tAuthor:  nil,\n\t})\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned due to nil key\")\n\t}\n}\n\nfunc TestGitService_createSignatureMessage_withoutTree(t *testing.T) {\n\tt.Parallel()\n\tdate, _ := time.Parse(\"Mon Jan 02 15:04:05 2006 -0700\", \"Thu May 04 00:03:43 2017 +0200\")\n\n\tmsg, _ := createSignatureMessage(&createCommit{\n\t\tMessage: Ptr(\"Commit Message.\"),\n\t\tParents: []string{\"p\"},\n\t\tAuthor: &CommitAuthor{\n\t\t\tName:  Ptr(\"go-github\"),\n\t\t\tEmail: Ptr(\"go-github@github.com\"),\n\t\t\tDate:  &Timestamp{date},\n\t\t},\n\t})\n\texpected := `parent p\nauthor go-github <go-github@github.com> 1493849023 +0200\ncommitter go-github <go-github@github.com> 1493849023 +0200\n\nCommit Message.`\n\tif msg != expected {\n\t\tt.Errorf(\"Returned message incorrect. returned %v, want %v\", msg, expected)\n\t}\n}\n\nfunc TestGitService_createSignatureMessage_withoutCommitter(t *testing.T) {\n\tt.Parallel()\n\tdate, _ := time.Parse(\"Mon Jan 02 15:04:05 2006 -0700\", \"Thu May 04 00:03:43 2017 +0200\")\n\n\tmsg, _ := createSignatureMessage(&createCommit{\n\t\tMessage: Ptr(\"Commit Message.\"),\n\t\tParents: []string{\"p\"},\n\t\tAuthor: &CommitAuthor{\n\t\t\tName:  Ptr(\"go-github\"),\n\t\t\tEmail: Ptr(\"go-github@github.com\"),\n\t\t\tDate:  &Timestamp{date},\n\t\t},\n\t\tCommitter: &CommitAuthor{\n\t\t\tName:  Ptr(\"foo\"),\n\t\t\tEmail: Ptr(\"foo@example.com\"),\n\t\t\tDate:  &Timestamp{date},\n\t\t},\n\t})\n\texpected := `parent p\nauthor go-github <go-github@github.com> 1493849023 +0200\ncommitter foo <foo@example.com> 1493849023 +0200\n\nCommit Message.`\n\tif msg != expected {\n\t\tt.Errorf(\"Returned message incorrect. returned %v, want %v\", msg, expected)\n\t}\n}\n\nfunc TestGitService_CreateCommit_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Git.CreateCommit(ctx, \"%\", \"%\", Commit{}, nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestSignatureVerification_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SignatureVerification{}, \"{}\")\n\n\tu := &SignatureVerification{\n\t\tVerified:  Ptr(true),\n\t\tReason:    Ptr(\"reason\"),\n\t\tSignature: Ptr(\"sign\"),\n\t\tPayload:   Ptr(\"payload\"),\n\t}\n\n\twant := `{\n\t\t\"verified\": true,\n\t\t\"reason\": \"reason\",\n\t\t\"signature\": \"sign\",\n\t\t\"payload\": \"payload\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestCommitAuthor_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CommitAuthor{}, \"{}\")\n\n\tu := &CommitAuthor{\n\t\tDate:  &Timestamp{referenceTime},\n\t\tName:  Ptr(\"name\"),\n\t\tEmail: Ptr(\"email\"),\n\t\tLogin: Ptr(\"login\"),\n\t}\n\n\twant := `{\n\t\t\"date\": ` + referenceTimeStr + `,\n\t\t\"name\": \"name\",\n\t\t\"email\": \"email\",\n\t\t\"username\": \"login\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestCreateCommit_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &createCommit{}, \"{}\")\n\n\tu := &createCommit{\n\t\tAuthor: &CommitAuthor{\n\t\t\tDate:  &Timestamp{referenceTime},\n\t\t\tName:  Ptr(\"name\"),\n\t\t\tEmail: Ptr(\"email\"),\n\t\t\tLogin: Ptr(\"login\"),\n\t\t},\n\t\tCommitter: &CommitAuthor{\n\t\t\tDate:  &Timestamp{referenceTime},\n\t\t\tName:  Ptr(\"name\"),\n\t\t\tEmail: Ptr(\"email\"),\n\t\t\tLogin: Ptr(\"login\"),\n\t\t},\n\t\tMessage:   Ptr(\"message\"),\n\t\tTree:      Ptr(\"tree\"),\n\t\tParents:   []string{\"p\"},\n\t\tSignature: Ptr(\"sign\"),\n\t}\n\n\twant := `{\n\t\t\"author\": {\n\t\t\t\"date\": ` + referenceTimeStr + `,\n\t\t\t\"name\": \"name\",\n\t\t\t\"email\": \"email\",\n\t\t\t\"username\": \"login\"\n\t\t},\n\t\t\"committer\": {\n\t\t\t\"date\": ` + referenceTimeStr + `,\n\t\t\t\"name\": \"name\",\n\t\t\t\"email\": \"email\",\n\t\t\t\"username\": \"login\"\n\t\t},\n\t\t\"message\": \"message\",\n\t\t\"tree\": \"tree\",\n\t\t\"parents\": [\n\t\t\t\"p\"\n\t\t],\n\t\t\"signature\": \"sign\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/git_refs.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net/url\"\n\t\"strings\"\n)\n\n// Reference represents a GitHub reference.\ntype Reference struct {\n\t// The name of the fully qualified reference, i.e.: `refs/heads/master`.\n\tRef    *string    `json:\"ref\"`\n\tURL    *string    `json:\"url\"`\n\tObject *GitObject `json:\"object\"`\n\tNodeID *string    `json:\"node_id,omitempty\"`\n}\n\nfunc (r Reference) String() string {\n\treturn Stringify(r)\n}\n\n// GitObject represents a Git object.\ntype GitObject struct {\n\tType *string `json:\"type\"`\n\tSHA  *string `json:\"sha\"`\n\tURL  *string `json:\"url\"`\n}\n\nfunc (o GitObject) String() string {\n\treturn Stringify(o)\n}\n\n// CreateRef represents the payload for creating a reference.\ntype CreateRef struct {\n\tRef string `json:\"ref\"`\n\tSHA string `json:\"sha\"`\n}\n\n// UpdateRef represents the payload for updating a reference.\ntype UpdateRef struct {\n\tSHA   string `json:\"sha\"`\n\tForce *bool  `json:\"force,omitempty\"`\n}\n\n// GetRef fetches a single reference in a repository.\n// The ref must be formatted as `heads/<branch name>` for branches and `tags/<tag name>` for tags.\n//\n// GitHub API docs: https://docs.github.com/rest/git/refs#get-a-reference\n//\n//meta:operation GET /repos/{owner}/{repo}/git/ref/{ref}\nfunc (s *GitService) GetRef(ctx context.Context, owner, repo, ref string) (*Reference, *Response, error) {\n\tref = strings.TrimPrefix(ref, \"refs/\")\n\tu := fmt.Sprintf(\"repos/%v/%v/git/ref/%v\", owner, repo, refURLEscape(ref))\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar r *Reference\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}\n\n// refURLEscape escapes every path segment of the given ref. Those must\n// not contain escaped \"/\" - as \"%2F\" - or github will not recognize it.\nfunc refURLEscape(ref string) string {\n\tparts := strings.Split(ref, \"/\")\n\tfor i, s := range parts {\n\t\tparts[i] = url.PathEscape(s)\n\t}\n\treturn strings.Join(parts, \"/\")\n}\n\n// ListMatchingRefs lists references in a repository that match a supplied ref.\n// The ref in the URL must be formatted as `heads/<branch name>` for branches and `tags/<tag name>` for tags.\n// If the ref doesn't exist in the repository, but existing refs start with ref, they will be returned as an array.\n// Use an empty ref to list all references.\n//\n// GitHub API docs: https://docs.github.com/rest/git/refs#list-matching-references\n//\n//meta:operation GET /repos/{owner}/{repo}/git/matching-refs/{ref}\nfunc (s *GitService) ListMatchingRefs(ctx context.Context, owner, repo, ref string) ([]*Reference, *Response, error) {\n\tref = strings.TrimPrefix(ref, \"refs/\") // API expects no \"refs/\" prefix\n\tu := fmt.Sprintf(\"repos/%v/%v/git/matching-refs/%v\", owner, repo, refURLEscape(ref))\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar rs []*Reference\n\tresp, err := s.client.Do(ctx, req, &rs)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn rs, resp, nil\n}\n\n// CreateRef creates a new ref in a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/git/refs#create-a-reference\n//\n//meta:operation POST /repos/{owner}/{repo}/git/refs\nfunc (s *GitService) CreateRef(ctx context.Context, owner, repo string, ref CreateRef) (*Reference, *Response, error) {\n\tif ref.Ref == \"\" {\n\t\treturn nil, nil, errors.New(\"ref must be provided\")\n\t}\n\n\tif ref.SHA == \"\" {\n\t\treturn nil, nil, errors.New(\"sha must be provided\")\n\t}\n\n\t// ensure the 'refs/' prefix is present\n\tref.Ref = \"refs/\" + strings.TrimPrefix(ref.Ref, \"refs/\")\n\n\tu := fmt.Sprintf(\"repos/%v/%v/git/refs\", owner, repo)\n\treq, err := s.client.NewRequest(\"POST\", u, ref)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar r *Reference\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}\n\n// UpdateRef updates an existing ref in a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/git/refs#update-a-reference\n//\n//meta:operation PATCH /repos/{owner}/{repo}/git/refs/{ref}\nfunc (s *GitService) UpdateRef(ctx context.Context, owner, repo, ref string, updateRef UpdateRef) (*Reference, *Response, error) {\n\tif ref == \"\" {\n\t\treturn nil, nil, errors.New(\"ref must be provided\")\n\t}\n\n\tif updateRef.SHA == \"\" {\n\t\treturn nil, nil, errors.New(\"sha must be provided\")\n\t}\n\n\trefPath := strings.TrimPrefix(ref, \"refs/\")\n\tu := fmt.Sprintf(\"repos/%v/%v/git/refs/%v\", owner, repo, refURLEscape(refPath))\n\treq, err := s.client.NewRequest(\"PATCH\", u, updateRef)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar r *Reference\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}\n\n// DeleteRef deletes a ref from a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/git/refs#delete-a-reference\n//\n//meta:operation DELETE /repos/{owner}/{repo}/git/refs/{ref}\nfunc (s *GitService) DeleteRef(ctx context.Context, owner, repo, ref string) (*Response, error) {\n\tref = strings.TrimPrefix(ref, \"refs/\")\n\tu := fmt.Sprintf(\"repos/%v/%v/git/refs/%v\", owner, repo, refURLEscape(ref))\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/git_refs_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestGitService_GetRef_singleRef(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/git/ref/heads/b\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `\n\t\t  {\n\t\t    \"ref\": \"refs/heads/b\",\n\t\t    \"url\": \"https://api.github.com/repos/o/r/git/refs/heads/b\",\n\t\t    \"object\": {\n\t\t      \"type\": \"commit\",\n\t\t      \"sha\": \"aa218f56b14c9653891f9e74264a383fa43fefbd\",\n\t\t      \"url\": \"https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd\"\n\t\t    }\n\t\t  }`)\n\t})\n\n\tctx := t.Context()\n\tref, _, err := client.Git.GetRef(ctx, \"o\", \"r\", \"refs/heads/b\")\n\tif err != nil {\n\t\tt.Fatalf(\"Git.GetRef returned error: %v\", err)\n\t}\n\n\twant := &Reference{\n\t\tRef: Ptr(\"refs/heads/b\"),\n\t\tURL: Ptr(\"https://api.github.com/repos/o/r/git/refs/heads/b\"),\n\t\tObject: &GitObject{\n\t\t\tType: Ptr(\"commit\"),\n\t\t\tSHA:  Ptr(\"aa218f56b14c9653891f9e74264a383fa43fefbd\"),\n\t\t\tURL:  Ptr(\"https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd\"),\n\t\t},\n\t}\n\tif !cmp.Equal(ref, want) {\n\t\tt.Errorf(\"Git.GetRef returned %+v, want %+v\", ref, want)\n\t}\n\n\t// without 'refs/' prefix\n\tif _, _, err := client.Git.GetRef(ctx, \"o\", \"r\", \"heads/b\"); err != nil {\n\t\tt.Errorf(\"Git.GetRef returned error: %v\", err)\n\t}\n\n\tconst methodName = \"GetRef\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Git.GetRef(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Git.GetRef(ctx, \"o\", \"r\", \"refs/heads/b\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGitService_GetRef_noRefs(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/git/refs/heads/b\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tref, resp, err := client.Git.GetRef(ctx, \"o\", \"r\", \"refs/heads/b\")\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Git.GetRef returned status %v, want %v\", got, want)\n\t}\n\tif ref != nil {\n\t\tt.Errorf(\"Git.GetRef return %+v, want nil\", ref)\n\t}\n\n\tconst methodName = \"GetRef\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Git.GetRef(ctx, \"o\", \"r\", \"refs/heads/b\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Git.GetRef(ctx, \"o\", \"r\", \"refs/heads/b\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGitService_ListMatchingRefs_singleRef(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/git/matching-refs/heads/b\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `\n\t\t  [\n\t\t    {\n\t\t      \"ref\": \"refs/heads/b\",\n\t\t      \"url\": \"https://api.github.com/repos/o/r/git/refs/heads/b\",\n\t\t      \"object\": {\n\t\t        \"type\": \"commit\",\n\t\t        \"sha\": \"aa218f56b14c9653891f9e74264a383fa43fefbd\",\n\t\t        \"url\": \"https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd\"\n\t\t      }\n\t\t    }\n\t\t  ]`)\n\t})\n\n\tctx := t.Context()\n\trefs, _, err := client.Git.ListMatchingRefs(ctx, \"o\", \"r\", \"heads/b\")\n\tif err != nil {\n\t\tt.Fatalf(\"Git.ListMatchingRefs returned error: %v\", err)\n\t}\n\n\tref := refs[0]\n\twant := &Reference{\n\t\tRef: Ptr(\"refs/heads/b\"),\n\t\tURL: Ptr(\"https://api.github.com/repos/o/r/git/refs/heads/b\"),\n\t\tObject: &GitObject{\n\t\t\tType: Ptr(\"commit\"),\n\t\t\tSHA:  Ptr(\"aa218f56b14c9653891f9e74264a383fa43fefbd\"),\n\t\t\tURL:  Ptr(\"https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd\"),\n\t\t},\n\t}\n\tif !cmp.Equal(ref, want) {\n\t\tt.Errorf(\"Git.ListMatchingRefs returned %+v, want %+v\", ref, want)\n\t}\n\n\tconst methodName = \"ListMatchingRefs\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Git.ListMatchingRefs(ctx, \"\\n\", \"\\n\", \"\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Git.ListMatchingRefs(ctx, \"o\", \"r\", \"\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGitService_ListMatchingRefs_multipleRefs(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/git/matching-refs/heads/b\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `\n\t\t  [\n\t\t    {\n\t\t\t    \"ref\": \"refs/heads/booger\",\n\t\t\t    \"url\": \"https://api.github.com/repos/o/r/git/refs/heads/booger\",\n\t\t\t    \"object\": {\n\t\t\t      \"type\": \"commit\",\n\t\t\t      \"sha\": \"aa218f56b14c9653891f9e74264a383fa43fefbd\",\n\t\t\t      \"url\": \"https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd\"\n\t\t\t    }\n\t\t  \t},\n\t\t    {\n\t\t      \"ref\": \"refs/heads/bandsaw\",\n\t\t      \"url\": \"https://api.github.com/repos/o/r/git/refs/heads/bandsaw\",\n\t\t      \"object\": {\n\t\t        \"type\": \"commit\",\n\t\t        \"sha\": \"612077ae6dffb4d2fbd8ce0cccaa58893b07b5ac\",\n\t\t        \"url\": \"https://api.github.com/repos/o/r/git/commits/612077ae6dffb4d2fbd8ce0cccaa58893b07b5ac\"\n\t\t      }\n\t\t    }\n\t\t  ]\n\t\t`)\n\t})\n\n\tctx := t.Context()\n\trefs, _, err := client.Git.ListMatchingRefs(ctx, \"o\", \"r\", \"heads/b\")\n\tif err != nil {\n\t\tt.Errorf(\"Git.ListMatchingRefs returned error: %v\", err)\n\t}\n\n\twant := &Reference{\n\t\tRef: Ptr(\"refs/heads/booger\"),\n\t\tURL: Ptr(\"https://api.github.com/repos/o/r/git/refs/heads/booger\"),\n\t\tObject: &GitObject{\n\t\t\tType: Ptr(\"commit\"),\n\t\t\tSHA:  Ptr(\"aa218f56b14c9653891f9e74264a383fa43fefbd\"),\n\t\t\tURL:  Ptr(\"https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd\"),\n\t\t},\n\t}\n\tif !cmp.Equal(refs[0], want) {\n\t\tt.Errorf(\"Git.ListMatchingRefs returned %+v, want %+v\", refs[0], want)\n\t}\n\n\tconst methodName = \"ListMatchingRefs\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Git.ListMatchingRefs(ctx, \"\\n\", \"\\n\", \"\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Git.ListMatchingRefs(ctx, \"o\", \"r\", \"\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGitService_ListMatchingRefs_noRefs(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/git/matching-refs/heads/b\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, \"[]\")\n\t})\n\n\tctx := t.Context()\n\trefs, _, err := client.Git.ListMatchingRefs(ctx, \"o\", \"r\", \"heads/b\")\n\tif err != nil {\n\t\tt.Errorf(\"Git.ListMatchingRefs returned error: %v\", err)\n\t}\n\n\tif len(refs) != 0 {\n\t\tt.Errorf(\"Git.ListMatchingRefs returned %+v, want an empty slice\", refs)\n\t}\n\n\tconst methodName = \"ListMatchingRefs\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Git.ListMatchingRefs(ctx, \"\\n\", \"\\n\", \"\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Git.ListMatchingRefs(ctx, \"o\", \"r\", \"\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGitService_ListMatchingRefs_allRefs(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/git/matching-refs/\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `\n\t\t  [\n\t\t    {\n\t\t      \"ref\": \"refs/heads/branchA\",\n\t\t      \"url\": \"https://api.github.com/repos/o/r/git/refs/heads/branchA\",\n\t\t      \"object\": {\n\t\t        \"type\": \"commit\",\n\t\t        \"sha\": \"aa218f56b14c9653891f9e74264a383fa43fefbd\",\n\t\t        \"url\": \"https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd\"\n\t\t      }\n\t\t    },\n\t\t    {\n\t\t      \"ref\": \"refs/heads/branchB\",\n\t\t      \"url\": \"https://api.github.com/repos/o/r/git/refs/heads/branchB\",\n\t\t      \"object\": {\n\t\t        \"type\": \"commit\",\n\t\t        \"sha\": \"aa218f56b14c9653891f9e74264a383fa43fefbd\",\n\t\t        \"url\": \"https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd\"\n\t\t      }\n\t\t    }\n\t\t  ]`)\n\t})\n\n\tctx := t.Context()\n\trefs, _, err := client.Git.ListMatchingRefs(ctx, \"o\", \"r\", \"\")\n\tif err != nil {\n\t\tt.Errorf(\"Git.ListMatchingRefs returned error: %v\", err)\n\t}\n\n\twant := []*Reference{\n\t\t{\n\t\t\tRef: Ptr(\"refs/heads/branchA\"),\n\t\t\tURL: Ptr(\"https://api.github.com/repos/o/r/git/refs/heads/branchA\"),\n\t\t\tObject: &GitObject{\n\t\t\t\tType: Ptr(\"commit\"),\n\t\t\t\tSHA:  Ptr(\"aa218f56b14c9653891f9e74264a383fa43fefbd\"),\n\t\t\t\tURL:  Ptr(\"https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd\"),\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tRef: Ptr(\"refs/heads/branchB\"),\n\t\t\tURL: Ptr(\"https://api.github.com/repos/o/r/git/refs/heads/branchB\"),\n\t\t\tObject: &GitObject{\n\t\t\t\tType: Ptr(\"commit\"),\n\t\t\t\tSHA:  Ptr(\"aa218f56b14c9653891f9e74264a383fa43fefbd\"),\n\t\t\t\tURL:  Ptr(\"https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd\"),\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(refs, want) {\n\t\tt.Errorf(\"Git.ListMatchingRefs returned %+v, want %+v\", refs, want)\n\t}\n\n\tconst methodName = \"ListMatchingRefs\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Git.ListMatchingRefs(ctx, \"\\n\", \"\\n\", \"\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Git.ListMatchingRefs(ctx, \"o\", \"r\", \"\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGitService_CreateRef(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\targs := CreateRef{\n\t\tRef: \"refs/heads/b\",\n\t\tSHA: \"aa218f56b14c9653891f9e74264a383fa43fefbd\",\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/git/refs\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *CreateRef\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(*v, args) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", *v, args)\n\t\t}\n\t\tfmt.Fprint(w, `\n\t\t  {\n\t\t    \"ref\": \"refs/heads/b\",\n\t\t    \"url\": \"https://api.github.com/repos/o/r/git/refs/heads/b\",\n\t\t    \"object\": {\n\t\t      \"type\": \"commit\",\n\t\t      \"sha\": \"aa218f56b14c9653891f9e74264a383fa43fefbd\",\n\t\t      \"url\": \"https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd\"\n\t\t    }\n\t\t  }`)\n\t})\n\n\tctx := t.Context()\n\tref, _, err := client.Git.CreateRef(ctx, \"o\", \"r\", CreateRef{\n\t\tRef: \"refs/heads/b\",\n\t\tSHA: \"aa218f56b14c9653891f9e74264a383fa43fefbd\",\n\t})\n\tif err != nil {\n\t\tt.Errorf(\"Git.CreateRef returned error: %v\", err)\n\t}\n\n\twant := &Reference{\n\t\tRef: Ptr(\"refs/heads/b\"),\n\t\tURL: Ptr(\"https://api.github.com/repos/o/r/git/refs/heads/b\"),\n\t\tObject: &GitObject{\n\t\t\tType: Ptr(\"commit\"),\n\t\t\tSHA:  Ptr(\"aa218f56b14c9653891f9e74264a383fa43fefbd\"),\n\t\t\tURL:  Ptr(\"https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd\"),\n\t\t},\n\t}\n\tif !cmp.Equal(ref, want) {\n\t\tt.Errorf(\"Git.CreateRef returned %+v, want %+v\", ref, want)\n\t}\n\n\t// without 'refs/' prefix\n\t_, _, err = client.Git.CreateRef(ctx, \"o\", \"r\", CreateRef{\n\t\tRef: \"heads/b\",\n\t\tSHA: \"aa218f56b14c9653891f9e74264a383fa43fefbd\",\n\t})\n\tif err != nil {\n\t\tt.Errorf(\"Git.CreateRef returned error: %v\", err)\n\t}\n\n\tconst methodName = \"CreateRef\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Git.CreateRef(ctx, \"o\", \"r\", CreateRef{Ref: \"\"})\n\t\treturn err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Git.CreateRef(ctx, \"\\n\", \"\\n\", CreateRef{\n\t\t\tRef: \"refs/heads/b\",\n\t\t\tSHA: \"aa218f56b14c9653891f9e74264a383fa43fefbd\",\n\t\t})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Git.CreateRef(ctx, \"o\", \"r\", CreateRef{\n\t\t\tRef: \"refs/heads/b\",\n\t\t\tSHA: \"aa218f56b14c9653891f9e74264a383fa43fefbd\",\n\t\t})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGitService_UpdateRef(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\targs := UpdateRef{\n\t\tSHA:   \"aa218f56b14c9653891f9e74264a383fa43fefbd\",\n\t\tForce: Ptr(true),\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/git/refs/heads/b\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *UpdateRef\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(*v, args) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", *v, args)\n\t\t}\n\t\tfmt.Fprint(w, `\n\t\t  {\n\t\t    \"ref\": \"refs/heads/b\",\n\t\t    \"url\": \"https://api.github.com/repos/o/r/git/refs/heads/b\",\n\t\t    \"object\": {\n\t\t      \"type\": \"commit\",\n\t\t      \"sha\": \"aa218f56b14c9653891f9e74264a383fa43fefbd\",\n\t\t      \"url\": \"https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd\"\n\t\t    }\n\t\t  }`)\n\t})\n\n\tctx := t.Context()\n\tref, _, err := client.Git.UpdateRef(ctx, \"o\", \"r\", \"refs/heads/b\", UpdateRef{\n\t\tSHA:   \"aa218f56b14c9653891f9e74264a383fa43fefbd\",\n\t\tForce: Ptr(true),\n\t})\n\tif err != nil {\n\t\tt.Errorf(\"Git.UpdateRef returned error: %v\", err)\n\t}\n\n\twant := &Reference{\n\t\tRef: Ptr(\"refs/heads/b\"),\n\t\tURL: Ptr(\"https://api.github.com/repos/o/r/git/refs/heads/b\"),\n\t\tObject: &GitObject{\n\t\t\tType: Ptr(\"commit\"),\n\t\t\tSHA:  Ptr(\"aa218f56b14c9653891f9e74264a383fa43fefbd\"),\n\t\t\tURL:  Ptr(\"https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd\"),\n\t\t},\n\t}\n\tif !cmp.Equal(ref, want) {\n\t\tt.Errorf(\"Git.UpdateRef returned %+v, want %+v\", ref, want)\n\t}\n\n\t// without 'refs/' prefix\n\t_, _, err = client.Git.UpdateRef(ctx, \"o\", \"r\", \"heads/b\", UpdateRef{\n\t\tSHA:   \"aa218f56b14c9653891f9e74264a383fa43fefbd\",\n\t\tForce: Ptr(true),\n\t})\n\tif err != nil {\n\t\tt.Errorf(\"Git.UpdateRef returned error: %v\", err)\n\t}\n\n\tconst methodName = \"UpdateRef\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Git.UpdateRef(ctx, \"o\", \"r\", \"\", UpdateRef{SHA: \"aa218f56b14c9653891f9e74264a383fa43fefbd\"})\n\t\treturn err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Git.UpdateRef(ctx, \"o\", \"r\", \"refs/heads/b\", UpdateRef{SHA: \"\"})\n\t\treturn err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Git.UpdateRef(ctx, \"\\n\", \"\\n\", \"refs/heads/b\", UpdateRef{\n\t\t\tSHA:   \"aa218f56b14c9653891f9e74264a383fa43fefbd\",\n\t\t\tForce: Ptr(true),\n\t\t})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Git.UpdateRef(ctx, \"o\", \"r\", \"refs/heads/b\", UpdateRef{\n\t\t\tSHA:   \"aa218f56b14c9653891f9e74264a383fa43fefbd\",\n\t\t\tForce: Ptr(true),\n\t\t})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGitService_DeleteRef(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/git/refs/heads/b\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Git.DeleteRef(ctx, \"o\", \"r\", \"refs/heads/b\")\n\tif err != nil {\n\t\tt.Errorf(\"Git.DeleteRef returned error: %v\", err)\n\t}\n\n\t// without 'refs/' prefix\n\tif _, err := client.Git.DeleteRef(ctx, \"o\", \"r\", \"heads/b\"); err != nil {\n\t\tt.Errorf(\"Git.DeleteRef returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteRef\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Git.DeleteRef(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Git.DeleteRef(ctx, \"o\", \"r\", \"refs/heads/b\")\n\t})\n}\n\nfunc TestGitService_GetRef_pathEscape(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/git/ref/heads/b\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tif strings.Contains(r.URL.RawPath, \"%2F\") {\n\t\t\tt.Errorf(\"RawPath still contains escaped / as %%2F: %v\", r.URL.RawPath)\n\t\t}\n\t\tfmt.Fprint(w, `\n\t\t  {\n\t\t    \"ref\": \"refs/heads/b\",\n\t\t    \"url\": \"https://api.github.com/repos/o/r/git/refs/heads/b\",\n\t\t    \"object\": {\n\t\t      \"type\": \"commit\",\n\t\t      \"sha\": \"aa218f56b14c9653891f9e74264a383fa43fefbd\",\n\t\t      \"url\": \"https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd\"\n\t\t    }\n\t\t  }`)\n\t})\n\n\tctx := t.Context()\n\t_, _, err := client.Git.GetRef(ctx, \"o\", \"r\", \"refs/heads/b\")\n\tif err != nil {\n\t\tt.Fatalf(\"Git.GetRef returned error: %v\", err)\n\t}\n\n\tconst methodName = \"GetRef\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Git.GetRef(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Git.GetRef(ctx, \"o\", \"r\", \"refs/heads/b\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGitService_UpdateRef_pathEscape(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\targs := UpdateRef{\n\t\tSHA:   \"aa218f56b14c9653891f9e74264a383fa43fefbd\",\n\t\tForce: Ptr(true),\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/git/refs/heads/b#1\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *UpdateRef\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(*v, args) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", *v, args)\n\t\t}\n\t\tfmt.Fprint(w, `\n\t\t  {\n\t\t    \"ref\": \"refs/heads/b#1\",\n\t\t    \"url\": \"https://api.github.com/repos/o/r/git/refs/heads/b%231\",\n\t\t    \"object\": {\n\t\t      \"type\": \"commit\",\n\t\t      \"sha\": \"aa218f56b14c9653891f9e74264a383fa43fefbd\",\n\t\t      \"url\": \"https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd\"\n\t\t    }\n\t\t  }`)\n\t})\n\n\tctx := t.Context()\n\tref, _, err := client.Git.UpdateRef(ctx, \"o\", \"r\", \"refs/heads/b#1\", UpdateRef{\n\t\tSHA:   \"aa218f56b14c9653891f9e74264a383fa43fefbd\",\n\t\tForce: Ptr(true),\n\t})\n\tif err != nil {\n\t\tt.Errorf(\"Git.UpdateRef returned error: %v\", err)\n\t}\n\n\twant := &Reference{\n\t\tRef: Ptr(\"refs/heads/b#1\"),\n\t\tURL: Ptr(\"https://api.github.com/repos/o/r/git/refs/heads/b%231\"),\n\t\tObject: &GitObject{\n\t\t\tType: Ptr(\"commit\"),\n\t\t\tSHA:  Ptr(\"aa218f56b14c9653891f9e74264a383fa43fefbd\"),\n\t\t\tURL:  Ptr(\"https://api.github.com/repos/o/r/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd\"),\n\t\t},\n\t}\n\tif !cmp.Equal(ref, want) {\n\t\tt.Errorf(\"Git.UpdateRef returned %+v, want %+v\", ref, want)\n\t}\n}\n\nfunc TestReference_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Reference{}, `{\n\t\t\"ref\": null,\n\t\t\"url\": null,\n\t\t\"object\": null\n\t}`)\n\n\tu := &Reference{\n\t\tRef: Ptr(\"ref\"),\n\t\tURL: Ptr(\"url\"),\n\t\tObject: &GitObject{\n\t\t\tType: Ptr(\"type\"),\n\t\t\tSHA:  Ptr(\"sha\"),\n\t\t\tURL:  Ptr(\"url\"),\n\t\t},\n\t\tNodeID: Ptr(\"nid\"),\n\t}\n\n\twant := `{\n\t\t\"ref\": \"ref\",\n\t\t\"url\": \"url\",\n\t\t\"object\": {\n\t\t\t\"type\": \"type\",\n\t\t\t\"sha\": \"sha\",\n\t\t\t\"url\": \"url\"\n\t\t},\n\t\t\"node_id\": \"nid\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestGitObject_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &GitObject{}, `{\n\t\t\"type\": null,\n\t\t\"sha\": null,\n\t\t\"url\": null\n\t}`)\n\n\tu := &GitObject{\n\t\tType: Ptr(\"type\"),\n\t\tSHA:  Ptr(\"sha\"),\n\t\tURL:  Ptr(\"url\"),\n\t}\n\n\twant := `{\n\t\t\"type\": \"type\",\n\t\t\"sha\": \"sha\",\n\t\t\"url\": \"url\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestCreateRef_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, CreateRef{}, `{\"ref\":\"\",\"sha\":\"\"}`)\n\n\tu := CreateRef{\n\t\tRef: \"ref\",\n\t\tSHA: \"sha\",\n\t}\n\n\twant := `{\n\t\t\"ref\": \"ref\",\n\t\t\"sha\": \"sha\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestUpdateRef_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, UpdateRef{}, `{\"sha\":\"\"}`)\n\n\tu := UpdateRef{\n\t\tSHA:   \"sha\",\n\t\tForce: Ptr(true),\n\t}\n\n\twant := `{\n\t\t\"sha\": \"sha\",\n\t\t\"force\": true\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/git_tags.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// Tag represents a tag object.\ntype Tag struct {\n\tTag          *string                `json:\"tag,omitempty\"`\n\tSHA          *string                `json:\"sha,omitempty\"`\n\tURL          *string                `json:\"url,omitempty\"`\n\tMessage      *string                `json:\"message,omitempty\"`\n\tTagger       *CommitAuthor          `json:\"tagger,omitempty\"`\n\tObject       *GitObject             `json:\"object,omitempty\"`\n\tVerification *SignatureVerification `json:\"verification,omitempty\"`\n\tNodeID       *string                `json:\"node_id,omitempty\"`\n}\n\n// CreateTag represents the payload for creating a tag.\ntype CreateTag struct {\n\tTag     string        `json:\"tag,omitempty\"`\n\tMessage string        `json:\"message,omitempty\"`\n\tObject  string        `json:\"object,omitempty\"`\n\tType    string        `json:\"type,omitempty\"`\n\tTagger  *CommitAuthor `json:\"tagger,omitempty\"`\n}\n\n// GetTag fetches a tag from a repo given a SHA.\n//\n// GitHub API docs: https://docs.github.com/rest/git/tags#get-a-tag\n//\n//meta:operation GET /repos/{owner}/{repo}/git/tags/{tag_sha}\nfunc (s *GitService) GetTag(ctx context.Context, owner, repo, sha string) (*Tag, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/git/tags/%v\", owner, repo, sha)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar tag *Tag\n\tresp, err := s.client.Do(ctx, req, &tag)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn tag, resp, nil\n}\n\n// CreateTag creates a tag object.\n//\n// GitHub API docs: https://docs.github.com/rest/git/tags#create-a-tag-object\n//\n//meta:operation POST /repos/{owner}/{repo}/git/tags\nfunc (s *GitService) CreateTag(ctx context.Context, owner, repo string, tag CreateTag) (*Tag, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/git/tags\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"POST\", u, tag)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar t *Tag\n\tresp, err := s.client.Do(ctx, req, &t)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn t, resp, nil\n}\n"
  },
  {
    "path": "github/git_tags_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestGitService_GetTag(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/git/tags/s\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"tag\": \"t\"}`)\n\t})\n\n\tctx := t.Context()\n\ttag, _, err := client.Git.GetTag(ctx, \"o\", \"r\", \"s\")\n\tif err != nil {\n\t\tt.Errorf(\"Git.GetTag returned error: %v\", err)\n\t}\n\n\twant := &Tag{Tag: Ptr(\"t\")}\n\tif !cmp.Equal(tag, want) {\n\t\tt.Errorf(\"Git.GetTag returned %+v, want %+v\", tag, want)\n\t}\n\n\tconst methodName = \"GetTag\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Git.GetTag(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Git.GetTag(ctx, \"o\", \"r\", \"s\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGitService_CreateTag(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinputTag := CreateTag{\n\t\tTag:     \"t\",\n\t\tObject:  \"s\",\n\t\tType:    \"commit\",\n\t\tMessage: \"test message\",\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/git/tags\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *CreateTag\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(*v, inputTag) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", *v, inputTag)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"tag\": \"t\"}`)\n\t})\n\n\tctx := t.Context()\n\ttag, _, err := client.Git.CreateTag(ctx, \"o\", \"r\", inputTag)\n\tif err != nil {\n\t\tt.Errorf(\"Git.CreateTag returned error: %v\", err)\n\t}\n\n\twant := &Tag{Tag: Ptr(\"t\")}\n\tif !cmp.Equal(tag, want) {\n\t\tt.Errorf(\"Git.CreateTag returned %+v, want %+v\", tag, want)\n\t}\n\n\tconst methodName = \"CreateTag\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Git.CreateTag(ctx, \"\\n\", \"\\n\", inputTag)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Git.CreateTag(ctx, \"o\", \"r\", inputTag)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTag_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Tag{}, \"{}\")\n\n\tu := &Tag{\n\t\tTag:     Ptr(\"tag\"),\n\t\tSHA:     Ptr(\"sha\"),\n\t\tURL:     Ptr(\"url\"),\n\t\tMessage: Ptr(\"msg\"),\n\t\tTagger: &CommitAuthor{\n\t\t\tDate:  &Timestamp{referenceTime},\n\t\t\tName:  Ptr(\"name\"),\n\t\t\tEmail: Ptr(\"email\"),\n\t\t\tLogin: Ptr(\"login\"),\n\t\t},\n\t\tObject: &GitObject{\n\t\t\tType: Ptr(\"type\"),\n\t\t\tSHA:  Ptr(\"sha\"),\n\t\t\tURL:  Ptr(\"url\"),\n\t\t},\n\t\tVerification: &SignatureVerification{\n\t\t\tVerified:  Ptr(true),\n\t\t\tReason:    Ptr(\"reason\"),\n\t\t\tSignature: Ptr(\"sign\"),\n\t\t\tPayload:   Ptr(\"payload\"),\n\t\t},\n\t\tNodeID: Ptr(\"nid\"),\n\t}\n\n\twant := `{\n\t\t\"tag\": \"tag\",\n\t\t\"sha\": \"sha\",\n\t\t\"url\": \"url\",\n\t\t\"message\": \"msg\",\n\t\t\"tagger\": {\n\t\t\t\"date\": ` + referenceTimeStr + `,\n\t\t\t\"name\": \"name\",\n\t\t\t\"email\": \"email\",\n\t\t\t\"username\": \"login\"\n\t\t},\n\t\t\"object\": {\n\t\t\t\"type\": \"type\",\n\t\t\t\"sha\": \"sha\",\n\t\t\t\"url\": \"url\"\n\t\t},\n\t\t\"verification\": {\n\t\t\t\"verified\": true,\n\t\t\t\"reason\": \"reason\",\n\t\t\t\"signature\": \"sign\",\n\t\t\t\"payload\": \"payload\"\n\t\t},\n\t\t\"node_id\": \"nid\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestCreateTag_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, CreateTag{}, \"{}\")\n\n\tu := CreateTag{\n\t\tTag:     \"tag\",\n\t\tMessage: \"msg\",\n\t\tObject:  \"obj\",\n\t\tType:    \"type\",\n\t\tTagger: &CommitAuthor{\n\t\t\tDate:  &Timestamp{referenceTime},\n\t\t\tName:  Ptr(\"name\"),\n\t\t\tEmail: Ptr(\"email\"),\n\t\t\tLogin: Ptr(\"login\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"tag\": \"tag\",\n\t\t\"message\": \"msg\",\n\t\t\"object\": \"obj\",\n\t\t\"type\": \"type\",\n\t\t\"tagger\": {\n\t\t\t\"date\": ` + referenceTimeStr + `,\n\t\t\t\"name\": \"name\",\n\t\t\t\"email\": \"email\",\n\t\t\t\"username\": \"login\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/git_trees.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n)\n\n// Tree represents a GitHub tree.\ntype Tree struct {\n\tSHA     *string      `json:\"sha,omitempty\"`\n\tEntries []*TreeEntry `json:\"tree,omitempty\"`\n\n\t// Truncated is true if the number of items in the tree\n\t// exceeded GitHub's maximum limit and the Entries were truncated\n\t// in the response. Only populated for requests that fetch\n\t// trees like Git.GetTree.\n\tTruncated *bool `json:\"truncated,omitempty\"`\n}\n\nfunc (t Tree) String() string {\n\treturn Stringify(t)\n}\n\n// TreeEntry represents the contents of a tree structure. TreeEntry can\n// represent either a blob, a commit (in the case of a submodule), or another\n// tree.\n//\n// When used with [GitService.CreateTree], set Content for small text files,\n// or set SHA to reference an existing blob (use [GitService.CreateBlob] for\n// binary files or large content). To delete an entry, set both Content and SHA\n// to nil; the entry will be serialized with `\"sha\": null` which the API interprets\n// as a deletion. When deleting, the Type and Mode fields are ignored; only Path\n// is required.\ntype TreeEntry struct {\n\tSHA     *string `json:\"sha,omitempty\"`\n\tPath    *string `json:\"path,omitempty\"`\n\tMode    *string `json:\"mode,omitempty\"`\n\tType    *string `json:\"type,omitempty\"`\n\tSize    *int    `json:\"size,omitempty\"`\n\tContent *string `json:\"content,omitempty\"`\n\tURL     *string `json:\"url,omitempty\"`\n}\n\nfunc (t TreeEntry) String() string {\n\treturn Stringify(t)\n}\n\n// treeEntryWithFileDelete is used internally to delete a file whose\n// Content and SHA fields are empty. It does this by removing the \"omitempty\"\n// tag modifier on the SHA field which causes the GitHub API to receive\n// {\"sha\":null} and thereby delete the file.\ntype treeEntryWithFileDelete struct {\n\tSHA     *string `json:\"sha\"`\n\tPath    *string `json:\"path,omitempty\"`\n\tMode    *string `json:\"mode,omitempty\"`\n\tType    *string `json:\"type,omitempty\"`\n\tSize    *int    `json:\"size,omitempty\"`\n\tContent *string `json:\"content,omitempty\"`\n\tURL     *string `json:\"url,omitempty\"`\n}\n\n// MarshalJSON implements the json.Marshaler interface.\nfunc (t *TreeEntry) MarshalJSON() ([]byte, error) {\n\tif t.SHA == nil && t.Content == nil {\n\t\treturn json.Marshal(struct {\n\t\t\tSHA  *string `json:\"sha\"`\n\t\t\tPath *string `json:\"path,omitempty\"`\n\t\t\tMode *string `json:\"mode,omitempty\"`\n\t\t\tType *string `json:\"type,omitempty\"`\n\t\t}{\n\t\t\tnil,\n\t\t\tt.Path,\n\t\t\tt.Mode,\n\t\t\tt.Type,\n\t\t})\n\t}\n\treturn json.Marshal(struct {\n\t\tSHA     *string `json:\"sha,omitempty\"`\n\t\tPath    *string `json:\"path,omitempty\"`\n\t\tMode    *string `json:\"mode,omitempty\"`\n\t\tType    *string `json:\"type,omitempty\"`\n\t\tSize    *int    `json:\"size,omitempty\"`\n\t\tContent *string `json:\"content,omitempty\"`\n\t\tURL     *string `json:\"url,omitempty\"`\n\t}{\n\t\tSHA:     t.SHA,\n\t\tPath:    t.Path,\n\t\tMode:    t.Mode,\n\t\tType:    t.Type,\n\t\tSize:    t.Size,\n\t\tContent: t.Content,\n\t\tURL:     t.URL,\n\t})\n}\n\n// GetTree fetches the Tree object for a given sha hash from a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/git/trees#get-a-tree\n//\n//meta:operation GET /repos/{owner}/{repo}/git/trees/{tree_sha}\nfunc (s *GitService) GetTree(ctx context.Context, owner, repo, sha string, recursive bool) (*Tree, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/git/trees/%v\", owner, repo, sha)\n\tif recursive {\n\t\tu += \"?recursive=1\"\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar t *Tree\n\tresp, err := s.client.Do(ctx, req, &t)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn t, resp, nil\n}\n\n// createTree represents the body of a CreateTree request.\ntype createTree struct {\n\tBaseTree string `json:\"base_tree,omitempty\"`\n\tEntries  []any  `json:\"tree\"`\n}\n\n// CreateTree creates a new tree in a repository. If both a tree and a nested\n// path modifying that tree are specified, it will overwrite the contents of\n// that tree with the new path contents and write a new tree out.\n//\n// When baseTree is provided, entries are merged with that tree: paths not\n// mentioned in entries are preserved from the base tree. If the same path\n// appears multiple times in entries, the last entry wins. To delete an entry,\n// include a [TreeEntry] with the path and both SHA and Content set to nil.\n// Entire directories can be deleted this way.\n//\n// GitHub API docs: https://docs.github.com/rest/git/trees#create-a-tree\n//\n//meta:operation POST /repos/{owner}/{repo}/git/trees\nfunc (s *GitService) CreateTree(ctx context.Context, owner, repo, baseTree string, entries []*TreeEntry) (*Tree, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/git/trees\", owner, repo)\n\n\tnewEntries := make([]any, 0, len(entries))\n\tfor _, entry := range entries {\n\t\tif entry.Content == nil && entry.SHA == nil {\n\t\t\tnewEntries = append(newEntries, treeEntryWithFileDelete{\n\t\t\t\tPath: entry.Path,\n\t\t\t\tMode: entry.Mode,\n\t\t\t\tType: entry.Type,\n\t\t\t\tSize: entry.Size,\n\t\t\t\tURL:  entry.URL,\n\t\t\t})\n\t\t\tcontinue\n\t\t}\n\t\tnewEntries = append(newEntries, entry)\n\t}\n\n\tbody := &createTree{\n\t\tBaseTree: baseTree,\n\t\tEntries:  newEntries,\n\t}\n\treq, err := s.client.NewRequest(\"POST\", u, body)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar t *Tree\n\tresp, err := s.client.Do(ctx, req, &t)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn t, resp, nil\n}\n"
  },
  {
    "path": "github/git_trees_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestMarshalJSON_withNilContentAndSHA(t *testing.T) {\n\tt.Parallel()\n\tte := &TreeEntry{\n\t\tPath: Ptr(\"path\"),\n\t\tMode: Ptr(\"mode\"),\n\t\tType: Ptr(\"type\"),\n\t\tSize: Ptr(1),\n\t\tURL:  Ptr(\"url\"),\n\t}\n\n\tgot, err := te.MarshalJSON()\n\tif err != nil {\n\t\tt.Errorf(\"MarshalJSON: %v\", err)\n\t}\n\n\twant := `{\"sha\":null,\"path\":\"path\",\"mode\":\"mode\",\"type\":\"type\"}`\n\tif string(got) != want {\n\t\tt.Errorf(\"MarshalJSON = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestGitService_GetTree(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/git/trees/s\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t  \"sha\": \"s\",\n\t\t\t  \"tree\": [ { \"type\": \"blob\" } ],\n\t\t\t  \"truncated\": true\n\t\t\t}`)\n\t})\n\n\tctx := t.Context()\n\ttree, _, err := client.Git.GetTree(ctx, \"o\", \"r\", \"s\", true)\n\tif err != nil {\n\t\tt.Errorf(\"Git.GetTree returned error: %v\", err)\n\t}\n\n\twant := Tree{\n\t\tSHA: Ptr(\"s\"),\n\t\tEntries: []*TreeEntry{\n\t\t\t{\n\t\t\t\tType: Ptr(\"blob\"),\n\t\t\t},\n\t\t},\n\t\tTruncated: Ptr(true),\n\t}\n\tif !cmp.Equal(*tree, want) {\n\t\tt.Errorf(\"Tree.Get returned %+v, want %+v\", *tree, want)\n\t}\n\n\tconst methodName = \"GetTree\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Git.GetTree(ctx, \"\\n\", \"\\n\", \"\\n\", true)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Git.GetTree(ctx, \"o\", \"r\", \"s\", true)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGitService_GetTree_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Git.GetTree(ctx, \"%\", \"%\", \"%\", false)\n\ttestURLParseError(t, err)\n}\n\nfunc TestGitService_CreateTree(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := []*TreeEntry{\n\t\t{\n\t\t\tPath: Ptr(\"file.rb\"),\n\t\t\tMode: Ptr(\"100644\"),\n\t\t\tType: Ptr(\"blob\"),\n\t\t\tSHA:  Ptr(\"7c258a9869f33c1e1e1f74fbb32f07c86cb5a75b\"),\n\t\t},\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/git/trees\", func(w http.ResponseWriter, r *http.Request) {\n\t\tgot, err := io.ReadAll(r.Body)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"unable to read body: %v\", err)\n\t\t}\n\n\t\ttestMethod(t, r, \"POST\")\n\n\t\twant := []byte(`{\"base_tree\":\"b\",\"tree\":[{\"sha\":\"7c258a9869f33c1e1e1f74fbb32f07c86cb5a75b\",\"path\":\"file.rb\",\"mode\":\"100644\",\"type\":\"blob\"}]}` + \"\\n\")\n\t\tif !bytes.Equal(got, want) {\n\t\t\tt.Errorf(\"Git.CreateTree request body: %v, want %v\", got, want)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\n\t\t  \"sha\": \"cd8274d15fa3ae2ab983129fb037999f264ba9a7\",\n\t\t  \"tree\": [\n\t\t    {\n\t\t      \"path\": \"file.rb\",\n\t\t      \"mode\": \"100644\",\n\t\t      \"type\": \"blob\",\n\t\t      \"size\": 132,\n\t\t      \"sha\": \"7c258a9869f33c1e1e1f74fbb32f07c86cb5a75b\"\n\t\t    }\n\t\t  ]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\ttree, _, err := client.Git.CreateTree(ctx, \"o\", \"r\", \"b\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Git.CreateTree returned error: %v\", err)\n\t}\n\n\twant := Tree{\n\t\tPtr(\"cd8274d15fa3ae2ab983129fb037999f264ba9a7\"),\n\t\t[]*TreeEntry{\n\t\t\t{\n\t\t\t\tPath: Ptr(\"file.rb\"),\n\t\t\t\tMode: Ptr(\"100644\"),\n\t\t\t\tType: Ptr(\"blob\"),\n\t\t\t\tSize: Ptr(132),\n\t\t\t\tSHA:  Ptr(\"7c258a9869f33c1e1e1f74fbb32f07c86cb5a75b\"),\n\t\t\t},\n\t\t},\n\t\tnil,\n\t}\n\n\tif !cmp.Equal(*tree, want) {\n\t\tt.Errorf(\"Git.CreateTree returned %+v, want %+v\", *tree, want)\n\t}\n\n\tconst methodName = \"CreateTree\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Git.CreateTree(ctx, \"\\n\", \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Git.CreateTree(ctx, \"o\", \"r\", \"b\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGitService_CreateTree_Content(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := []*TreeEntry{\n\t\t{\n\t\t\tPath:    Ptr(\"content.md\"),\n\t\t\tMode:    Ptr(\"100644\"),\n\t\t\tContent: Ptr(\"file content\"),\n\t\t},\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/git/trees\", func(w http.ResponseWriter, r *http.Request) {\n\t\tgot, err := io.ReadAll(r.Body)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"unable to read body: %v\", err)\n\t\t}\n\n\t\ttestMethod(t, r, \"POST\")\n\n\t\twant := []byte(`{\"base_tree\":\"b\",\"tree\":[{\"path\":\"content.md\",\"mode\":\"100644\",\"content\":\"file content\"}]}` + \"\\n\")\n\t\tif !bytes.Equal(got, want) {\n\t\t\tt.Errorf(\"Git.CreateTree request body: %v, want %v\", got, want)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\n\t\t  \"sha\": \"5c6780ad2c68743383b740fd1dab6f6a33202b11\",\n\t\t  \"url\": \"https://api.github.com/repos/o/r/git/trees/5c6780ad2c68743383b740fd1dab6f6a33202b11\",\n\t\t  \"tree\": [\n\t\t    {\n\t\t\t  \"mode\": \"100644\",\n\t\t\t  \"type\": \"blob\",\n\t\t\t  \"sha\":  \"aad8feacf6f8063150476a7b2bd9770f2794c08b\",\n\t\t\t  \"path\": \"content.md\",\n\t\t\t  \"size\": 12,\n\t\t\t  \"url\": \"https://api.github.com/repos/o/r/git/blobs/aad8feacf6f8063150476a7b2bd9770f2794c08b\"\n\t\t    }\n\t\t  ]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\ttree, _, err := client.Git.CreateTree(ctx, \"o\", \"r\", \"b\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Git.CreateTree returned error: %v\", err)\n\t}\n\n\twant := Tree{\n\t\tPtr(\"5c6780ad2c68743383b740fd1dab6f6a33202b11\"),\n\t\t[]*TreeEntry{\n\t\t\t{\n\t\t\t\tPath: Ptr(\"content.md\"),\n\t\t\t\tMode: Ptr(\"100644\"),\n\t\t\t\tType: Ptr(\"blob\"),\n\t\t\t\tSize: Ptr(12),\n\t\t\t\tSHA:  Ptr(\"aad8feacf6f8063150476a7b2bd9770f2794c08b\"),\n\t\t\t\tURL:  Ptr(\"https://api.github.com/repos/o/r/git/blobs/aad8feacf6f8063150476a7b2bd9770f2794c08b\"),\n\t\t\t},\n\t\t},\n\t\tnil,\n\t}\n\n\tif !cmp.Equal(*tree, want) {\n\t\tt.Errorf(\"Git.CreateTree returned %+v, want %+v\", *tree, want)\n\t}\n\n\tconst methodName = \"CreateTree\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Git.CreateTree(ctx, \"\\n\", \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Git.CreateTree(ctx, \"o\", \"r\", \"b\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGitService_CreateTree_Delete(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := []*TreeEntry{\n\t\t{\n\t\t\tPath: Ptr(\"content.md\"),\n\t\t\tMode: Ptr(\"100644\"),\n\t\t},\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/git/trees\", func(w http.ResponseWriter, r *http.Request) {\n\t\tgot, err := io.ReadAll(r.Body)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"unable to read body: %v\", err)\n\t\t}\n\n\t\ttestMethod(t, r, \"POST\")\n\n\t\twant := []byte(`{\"base_tree\":\"b\",\"tree\":[{\"sha\":null,\"path\":\"content.md\",\"mode\":\"100644\"}]}` + \"\\n\")\n\t\tif !bytes.Equal(got, want) {\n\t\t\tt.Errorf(\"Git.CreateTree request body: %v, want %v\", got, want)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\n\t\t  \"sha\": \"5c6780ad2c68743383b740fd1dab6f6a33202b11\",\n\t\t  \"url\": \"https://api.github.com/repos/o/r/git/trees/5c6780ad2c68743383b740fd1dab6f6a33202b11\",\n\t\t  \"tree\": [\n\t\t    {\n\t\t\t  \"mode\": \"100644\",\n\t\t\t  \"type\": \"blob\",\n\t\t\t  \"sha\":  null,\n\t\t\t  \"path\": \"content.md\",\n\t\t\t  \"size\": 12,\n\t\t\t  \"url\": \"https://api.github.com/repos/o/r/git/blobs/aad8feacf6f8063150476a7b2bd9770f2794c08b\"\n\t\t    }\n\t\t  ]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\ttree, _, err := client.Git.CreateTree(ctx, \"o\", \"r\", \"b\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Git.CreateTree returned error: %v\", err)\n\t}\n\n\twant := Tree{\n\t\tPtr(\"5c6780ad2c68743383b740fd1dab6f6a33202b11\"),\n\t\t[]*TreeEntry{\n\t\t\t{\n\t\t\t\tPath: Ptr(\"content.md\"),\n\t\t\t\tMode: Ptr(\"100644\"),\n\t\t\t\tType: Ptr(\"blob\"),\n\t\t\t\tSize: Ptr(12),\n\t\t\t\tSHA:  nil,\n\t\t\t\tURL:  Ptr(\"https://api.github.com/repos/o/r/git/blobs/aad8feacf6f8063150476a7b2bd9770f2794c08b\"),\n\t\t\t},\n\t\t},\n\t\tnil,\n\t}\n\n\tif !cmp.Equal(*tree, want) {\n\t\tt.Errorf(\"Git.CreateTree returned %+v, want %+v\", *tree, want)\n\t}\n\n\tconst methodName = \"CreateTree\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Git.CreateTree(ctx, \"\\n\", \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Git.CreateTree(ctx, \"o\", \"r\", \"b\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGitService_CreateTree_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Git.CreateTree(ctx, \"%\", \"%\", \"\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestTree_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Tree{}, \"{}\")\n\n\tu := &Tree{\n\t\tSHA: Ptr(\"sha\"),\n\t\tEntries: []*TreeEntry{\n\t\t\t{\n\t\t\t\tSHA:     Ptr(\"sha\"),\n\t\t\t\tPath:    Ptr(\"path\"),\n\t\t\t\tMode:    Ptr(\"mode\"),\n\t\t\t\tType:    Ptr(\"type\"),\n\t\t\t\tSize:    Ptr(1),\n\t\t\t\tContent: Ptr(\"content\"),\n\t\t\t\tURL:     Ptr(\"url\"),\n\t\t\t},\n\t\t},\n\t\tTruncated: Ptr(false),\n\t}\n\n\twant := `{\n\t\t\"sha\": \"sha\",\n\t\t\"tree\": [\n\t\t\t{\n\t\t\t\t\"sha\": \"sha\",\n\t\t\t\t\"path\": \"path\",\n\t\t\t\t\"mode\": \"mode\",\n\t\t\t\t\"type\": \"type\",\n\t\t\t\t\"size\": 1,\n\t\t\t\t\"content\": \"content\",\n\t\t\t\t\"url\": \"url\"\n\t\t\t}\n\t\t],\n\t\t\"truncated\": false\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestTreeEntry_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &TreeEntry{}, `{\"sha\": null}`)\n\n\tu := &TreeEntry{\n\t\tSHA:     Ptr(\"sha\"),\n\t\tPath:    Ptr(\"path\"),\n\t\tMode:    Ptr(\"mode\"),\n\t\tType:    Ptr(\"type\"),\n\t\tSize:    Ptr(1),\n\t\tContent: Ptr(\"content\"),\n\t\tURL:     Ptr(\"url\"),\n\t}\n\n\twant := `{\n\t\t\"sha\": \"sha\",\n\t\t\"path\": \"path\",\n\t\t\"mode\": \"mode\",\n\t\t\"type\": \"type\",\n\t\t\"size\": 1,\n\t\t\"content\": \"content\",\n\t\t\"url\": \"url\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestTreeEntryWithFileDelete_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &treeEntryWithFileDelete{}, `{\"sha\": null}`)\n\n\tu := &treeEntryWithFileDelete{\n\t\tSHA:     Ptr(\"sha\"),\n\t\tPath:    Ptr(\"path\"),\n\t\tMode:    Ptr(\"mode\"),\n\t\tType:    Ptr(\"type\"),\n\t\tSize:    Ptr(1),\n\t\tContent: Ptr(\"content\"),\n\t\tURL:     Ptr(\"url\"),\n\t}\n\n\twant := `{\n\t\t\"sha\": \"sha\",\n\t\t\"path\": \"path\",\n\t\t\"mode\": \"mode\",\n\t\t\"type\": \"type\",\n\t\t\"size\": 1,\n\t\t\"content\": \"content\",\n\t\t\"url\": \"url\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestCreateTree_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &createTree{}, `{\"tree\": null}`)\n\n\tu := &createTree{\n\t\tBaseTree: \"bt\",\n\t\tEntries:  []any{\"e\"},\n\t}\n\n\twant := `{\n\t\t\"base_tree\": \"bt\",\n\t\t\"tree\": [\"e\"]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/github-accessors.go",
    "content": "// Code generated by gen-accessors; DO NOT EDIT.\n// Instead, please run \"go generate ./...\" as described here:\n// https://github.com/google/go-github/blob/master/CONTRIBUTING.md#submitting-a-patch\n\n// Copyright 2017 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"time\"\n)\n\n// GetMessage returns the Message field.\nfunc (a *AbuseRateLimitError) GetMessage() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.Message\n}\n\n// GetRetryAfter returns the RetryAfter field if it's non-nil, zero value otherwise.\nfunc (a *AbuseRateLimitError) GetRetryAfter() time.Duration {\n\tif a == nil || a.RetryAfter == nil {\n\t\treturn 0\n\t}\n\treturn *a.RetryAfter\n}\n\n// GetAssignment returns the Assignment field.\nfunc (a *AcceptedAssignment) GetAssignment() *ClassroomAssignment {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.Assignment\n}\n\n// GetCommitCount returns the CommitCount field if it's non-nil, zero value otherwise.\nfunc (a *AcceptedAssignment) GetCommitCount() int {\n\tif a == nil || a.CommitCount == nil {\n\t\treturn 0\n\t}\n\treturn *a.CommitCount\n}\n\n// GetGrade returns the Grade field if it's non-nil, zero value otherwise.\nfunc (a *AcceptedAssignment) GetGrade() string {\n\tif a == nil || a.Grade == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Grade\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (a *AcceptedAssignment) GetID() int64 {\n\tif a == nil || a.ID == nil {\n\t\treturn 0\n\t}\n\treturn *a.ID\n}\n\n// GetPassing returns the Passing field if it's non-nil, zero value otherwise.\nfunc (a *AcceptedAssignment) GetPassing() bool {\n\tif a == nil || a.Passing == nil {\n\t\treturn false\n\t}\n\treturn *a.Passing\n}\n\n// GetRepository returns the Repository field.\nfunc (a *AcceptedAssignment) GetRepository() *Repository {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.Repository\n}\n\n// GetStudents returns the Students slice if it's non-nil, nil otherwise.\nfunc (a *AcceptedAssignment) GetStudents() []*ClassroomUser {\n\tif a == nil || a.Students == nil {\n\t\treturn nil\n\t}\n\treturn a.Students\n}\n\n// GetSubmitted returns the Submitted field if it's non-nil, zero value otherwise.\nfunc (a *AcceptedAssignment) GetSubmitted() bool {\n\tif a == nil || a.Submitted == nil {\n\t\treturn false\n\t}\n\treturn *a.Submitted\n}\n\n// GetRaw returns the Raw slice if it's non-nil, nil otherwise.\nfunc (a *AcceptedError) GetRaw() []byte {\n\tif a == nil || a.Raw == nil {\n\t\treturn nil\n\t}\n\treturn a.Raw\n}\n\n// GetFullName returns the FullName field.\nfunc (a *AccessibleRepository) GetFullName() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.FullName\n}\n\n// GetID returns the ID field.\nfunc (a *AccessibleRepository) GetID() int64 {\n\tif a == nil {\n\t\treturn 0\n\t}\n\treturn a.ID\n}\n\n// GetName returns the Name field.\nfunc (a *AccessibleRepository) GetName() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.Name\n}\n\n// GetGithubOwnedAllowed returns the GithubOwnedAllowed field if it's non-nil, zero value otherwise.\nfunc (a *ActionsAllowed) GetGithubOwnedAllowed() bool {\n\tif a == nil || a.GithubOwnedAllowed == nil {\n\t\treturn false\n\t}\n\treturn *a.GithubOwnedAllowed\n}\n\n// GetPatternsAllowed returns the PatternsAllowed slice if it's non-nil, nil otherwise.\nfunc (a *ActionsAllowed) GetPatternsAllowed() []string {\n\tif a == nil || a.PatternsAllowed == nil {\n\t\treturn nil\n\t}\n\treturn a.PatternsAllowed\n}\n\n// GetVerifiedAllowed returns the VerifiedAllowed field if it's non-nil, zero value otherwise.\nfunc (a *ActionsAllowed) GetVerifiedAllowed() bool {\n\tif a == nil || a.VerifiedAllowed == nil {\n\t\treturn false\n\t}\n\treturn *a.VerifiedAllowed\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (a *ActionsCache) GetCreatedAt() Timestamp {\n\tif a == nil || a.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *a.CreatedAt\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (a *ActionsCache) GetID() int64 {\n\tif a == nil || a.ID == nil {\n\t\treturn 0\n\t}\n\treturn *a.ID\n}\n\n// GetKey returns the Key field if it's non-nil, zero value otherwise.\nfunc (a *ActionsCache) GetKey() string {\n\tif a == nil || a.Key == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Key\n}\n\n// GetLastAccessedAt returns the LastAccessedAt field if it's non-nil, zero value otherwise.\nfunc (a *ActionsCache) GetLastAccessedAt() Timestamp {\n\tif a == nil || a.LastAccessedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *a.LastAccessedAt\n}\n\n// GetRef returns the Ref field if it's non-nil, zero value otherwise.\nfunc (a *ActionsCache) GetRef() string {\n\tif a == nil || a.Ref == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Ref\n}\n\n// GetSizeInBytes returns the SizeInBytes field if it's non-nil, zero value otherwise.\nfunc (a *ActionsCache) GetSizeInBytes() int64 {\n\tif a == nil || a.SizeInBytes == nil {\n\t\treturn 0\n\t}\n\treturn *a.SizeInBytes\n}\n\n// GetVersion returns the Version field if it's non-nil, zero value otherwise.\nfunc (a *ActionsCache) GetVersion() string {\n\tif a == nil || a.Version == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Version\n}\n\n// GetActionsCaches returns the ActionsCaches slice if it's non-nil, nil otherwise.\nfunc (a *ActionsCacheList) GetActionsCaches() []*ActionsCache {\n\tif a == nil || a.ActionsCaches == nil {\n\t\treturn nil\n\t}\n\treturn a.ActionsCaches\n}\n\n// GetTotalCount returns the TotalCount field.\nfunc (a *ActionsCacheList) GetTotalCount() int {\n\tif a == nil {\n\t\treturn 0\n\t}\n\treturn a.TotalCount\n}\n\n// GetDirection returns the Direction field if it's non-nil, zero value otherwise.\nfunc (a *ActionsCacheListOptions) GetDirection() string {\n\tif a == nil || a.Direction == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Direction\n}\n\n// GetKey returns the Key field if it's non-nil, zero value otherwise.\nfunc (a *ActionsCacheListOptions) GetKey() string {\n\tif a == nil || a.Key == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Key\n}\n\n// GetRef returns the Ref field if it's non-nil, zero value otherwise.\nfunc (a *ActionsCacheListOptions) GetRef() string {\n\tif a == nil || a.Ref == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Ref\n}\n\n// GetSort returns the Sort field if it's non-nil, zero value otherwise.\nfunc (a *ActionsCacheListOptions) GetSort() string {\n\tif a == nil || a.Sort == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Sort\n}\n\n// GetActiveCachesCount returns the ActiveCachesCount field.\nfunc (a *ActionsCacheUsage) GetActiveCachesCount() int {\n\tif a == nil {\n\t\treturn 0\n\t}\n\treturn a.ActiveCachesCount\n}\n\n// GetActiveCachesSizeInBytes returns the ActiveCachesSizeInBytes field.\nfunc (a *ActionsCacheUsage) GetActiveCachesSizeInBytes() int64 {\n\tif a == nil {\n\t\treturn 0\n\t}\n\treturn a.ActiveCachesSizeInBytes\n}\n\n// GetFullName returns the FullName field.\nfunc (a *ActionsCacheUsage) GetFullName() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.FullName\n}\n\n// GetRepoCacheUsage returns the RepoCacheUsage slice if it's non-nil, nil otherwise.\nfunc (a *ActionsCacheUsageList) GetRepoCacheUsage() []*ActionsCacheUsage {\n\tif a == nil || a.RepoCacheUsage == nil {\n\t\treturn nil\n\t}\n\treturn a.RepoCacheUsage\n}\n\n// GetTotalCount returns the TotalCount field.\nfunc (a *ActionsCacheUsageList) GetTotalCount() int {\n\tif a == nil {\n\t\treturn 0\n\t}\n\treturn a.TotalCount\n}\n\n// GetOrganizations returns the Organizations slice if it's non-nil, nil otherwise.\nfunc (a *ActionsEnabledOnEnterpriseRepos) GetOrganizations() []*Organization {\n\tif a == nil || a.Organizations == nil {\n\t\treturn nil\n\t}\n\treturn a.Organizations\n}\n\n// GetTotalCount returns the TotalCount field.\nfunc (a *ActionsEnabledOnEnterpriseRepos) GetTotalCount() int {\n\tif a == nil {\n\t\treturn 0\n\t}\n\treturn a.TotalCount\n}\n\n// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise.\nfunc (a *ActionsEnabledOnOrgRepos) GetRepositories() []*Repository {\n\tif a == nil || a.Repositories == nil {\n\t\treturn nil\n\t}\n\treturn a.Repositories\n}\n\n// GetTotalCount returns the TotalCount field.\nfunc (a *ActionsEnabledOnOrgRepos) GetTotalCount() int {\n\tif a == nil {\n\t\treturn 0\n\t}\n\treturn a.TotalCount\n}\n\n// GetFullDomains returns the FullDomains slice if it's non-nil, nil otherwise.\nfunc (a *ActionsInboundDomains) GetFullDomains() []string {\n\tif a == nil || a.FullDomains == nil {\n\t\treturn nil\n\t}\n\treturn a.FullDomains\n}\n\n// GetWildcardDomains returns the WildcardDomains slice if it's non-nil, nil otherwise.\nfunc (a *ActionsInboundDomains) GetWildcardDomains() []string {\n\tif a == nil || a.WildcardDomains == nil {\n\t\treturn nil\n\t}\n\treturn a.WildcardDomains\n}\n\n// GetAllowedActions returns the AllowedActions field if it's non-nil, zero value otherwise.\nfunc (a *ActionsPermissions) GetAllowedActions() string {\n\tif a == nil || a.AllowedActions == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.AllowedActions\n}\n\n// GetEnabledRepositories returns the EnabledRepositories field if it's non-nil, zero value otherwise.\nfunc (a *ActionsPermissions) GetEnabledRepositories() string {\n\tif a == nil || a.EnabledRepositories == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.EnabledRepositories\n}\n\n// GetSelectedActionsURL returns the SelectedActionsURL field if it's non-nil, zero value otherwise.\nfunc (a *ActionsPermissions) GetSelectedActionsURL() string {\n\tif a == nil || a.SelectedActionsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.SelectedActionsURL\n}\n\n// GetSHAPinningRequired returns the SHAPinningRequired field if it's non-nil, zero value otherwise.\nfunc (a *ActionsPermissions) GetSHAPinningRequired() bool {\n\tif a == nil || a.SHAPinningRequired == nil {\n\t\treturn false\n\t}\n\treturn *a.SHAPinningRequired\n}\n\n// GetAllowedActions returns the AllowedActions field if it's non-nil, zero value otherwise.\nfunc (a *ActionsPermissionsEnterprise) GetAllowedActions() string {\n\tif a == nil || a.AllowedActions == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.AllowedActions\n}\n\n// GetEnabledOrganizations returns the EnabledOrganizations field if it's non-nil, zero value otherwise.\nfunc (a *ActionsPermissionsEnterprise) GetEnabledOrganizations() string {\n\tif a == nil || a.EnabledOrganizations == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.EnabledOrganizations\n}\n\n// GetSelectedActionsURL returns the SelectedActionsURL field if it's non-nil, zero value otherwise.\nfunc (a *ActionsPermissionsEnterprise) GetSelectedActionsURL() string {\n\tif a == nil || a.SelectedActionsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.SelectedActionsURL\n}\n\n// GetAllowedActions returns the AllowedActions field if it's non-nil, zero value otherwise.\nfunc (a *ActionsPermissionsRepository) GetAllowedActions() string {\n\tif a == nil || a.AllowedActions == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.AllowedActions\n}\n\n// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise.\nfunc (a *ActionsPermissionsRepository) GetEnabled() bool {\n\tif a == nil || a.Enabled == nil {\n\t\treturn false\n\t}\n\treturn *a.Enabled\n}\n\n// GetSelectedActionsURL returns the SelectedActionsURL field if it's non-nil, zero value otherwise.\nfunc (a *ActionsPermissionsRepository) GetSelectedActionsURL() string {\n\tif a == nil || a.SelectedActionsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.SelectedActionsURL\n}\n\n// GetSHAPinningRequired returns the SHAPinningRequired field if it's non-nil, zero value otherwise.\nfunc (a *ActionsPermissionsRepository) GetSHAPinningRequired() bool {\n\tif a == nil || a.SHAPinningRequired == nil {\n\t\treturn false\n\t}\n\treturn *a.SHAPinningRequired\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (a *ActionsVariable) GetCreatedAt() Timestamp {\n\tif a == nil || a.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *a.CreatedAt\n}\n\n// GetName returns the Name field.\nfunc (a *ActionsVariable) GetName() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.Name\n}\n\n// GetSelectedRepositoriesURL returns the SelectedRepositoriesURL field if it's non-nil, zero value otherwise.\nfunc (a *ActionsVariable) GetSelectedRepositoriesURL() string {\n\tif a == nil || a.SelectedRepositoriesURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.SelectedRepositoriesURL\n}\n\n// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs field.\nfunc (a *ActionsVariable) GetSelectedRepositoryIDs() *SelectedRepoIDs {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.SelectedRepositoryIDs\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (a *ActionsVariable) GetUpdatedAt() Timestamp {\n\tif a == nil || a.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *a.UpdatedAt\n}\n\n// GetValue returns the Value field.\nfunc (a *ActionsVariable) GetValue() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.Value\n}\n\n// GetVisibility returns the Visibility field if it's non-nil, zero value otherwise.\nfunc (a *ActionsVariable) GetVisibility() string {\n\tif a == nil || a.Visibility == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Visibility\n}\n\n// GetTotalCount returns the TotalCount field.\nfunc (a *ActionsVariables) GetTotalCount() int {\n\tif a == nil {\n\t\treturn 0\n\t}\n\treturn a.TotalCount\n}\n\n// GetVariables returns the Variables slice if it's non-nil, nil otherwise.\nfunc (a *ActionsVariables) GetVariables() []*ActionsVariable {\n\tif a == nil || a.Variables == nil {\n\t\treturn nil\n\t}\n\treturn a.Variables\n}\n\n// GetMaximumAdvancedSecurityCommitters returns the MaximumAdvancedSecurityCommitters field if it's non-nil, zero value otherwise.\nfunc (a *ActiveCommitters) GetMaximumAdvancedSecurityCommitters() int {\n\tif a == nil || a.MaximumAdvancedSecurityCommitters == nil {\n\t\treturn 0\n\t}\n\treturn *a.MaximumAdvancedSecurityCommitters\n}\n\n// GetPurchasedAdvancedSecurityCommitters returns the PurchasedAdvancedSecurityCommitters field if it's non-nil, zero value otherwise.\nfunc (a *ActiveCommitters) GetPurchasedAdvancedSecurityCommitters() int {\n\tif a == nil || a.PurchasedAdvancedSecurityCommitters == nil {\n\t\treturn 0\n\t}\n\treturn *a.PurchasedAdvancedSecurityCommitters\n}\n\n// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise.\nfunc (a *ActiveCommitters) GetRepositories() []*RepositoryActiveCommitters {\n\tif a == nil || a.Repositories == nil {\n\t\treturn nil\n\t}\n\treturn a.Repositories\n}\n\n// GetTotalAdvancedSecurityCommitters returns the TotalAdvancedSecurityCommitters field if it's non-nil, zero value otherwise.\nfunc (a *ActiveCommitters) GetTotalAdvancedSecurityCommitters() int {\n\tif a == nil || a.TotalAdvancedSecurityCommitters == nil {\n\t\treturn 0\n\t}\n\treturn *a.TotalAdvancedSecurityCommitters\n}\n\n// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.\nfunc (a *ActiveCommitters) GetTotalCount() int {\n\tif a == nil || a.TotalCount == nil {\n\t\treturn 0\n\t}\n\treturn *a.TotalCount\n}\n\n// GetAdvancedSecurityProduct returns the AdvancedSecurityProduct field if it's non-nil, zero value otherwise.\nfunc (a *ActiveCommittersListOptions) GetAdvancedSecurityProduct() string {\n\tif a == nil || a.AdvancedSecurityProduct == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.AdvancedSecurityProduct\n}\n\n// GetDirection returns the Direction field.\nfunc (a *ActivityListStarredOptions) GetDirection() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.Direction\n}\n\n// GetSort returns the Sort field.\nfunc (a *ActivityListStarredOptions) GetSort() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.Sort\n}\n\n// GetCountryCode returns the CountryCode field if it's non-nil, zero value otherwise.\nfunc (a *ActorLocation) GetCountryCode() string {\n\tif a == nil || a.CountryCode == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.CountryCode\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (a *AddProjectItemOptions) GetID() int64 {\n\tif a == nil || a.ID == nil {\n\t\treturn 0\n\t}\n\treturn *a.ID\n}\n\n// GetType returns the Type field.\nfunc (a *AddProjectItemOptions) GetType() *ProjectV2ItemContentType {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.Type\n}\n\n// GetMessage returns the Message field if it's non-nil, zero value otherwise.\nfunc (a *AddResourcesToCostCenterResponse) GetMessage() string {\n\tif a == nil || a.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Message\n}\n\n// GetReassignedResources returns the ReassignedResources slice if it's non-nil, nil otherwise.\nfunc (a *AddResourcesToCostCenterResponse) GetReassignedResources() []*ReassignedResource {\n\tif a == nil || a.ReassignedResources == nil {\n\t\treturn nil\n\t}\n\treturn a.ReassignedResources\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (a *AdminEnforcedChanges) GetFrom() bool {\n\tif a == nil || a.From == nil {\n\t\treturn false\n\t}\n\treturn *a.From\n}\n\n// GetEnabled returns the Enabled field.\nfunc (a *AdminEnforcement) GetEnabled() bool {\n\tif a == nil {\n\t\treturn false\n\t}\n\treturn a.Enabled\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (a *AdminEnforcement) GetURL() string {\n\tif a == nil || a.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.URL\n}\n\n// GetComments returns the Comments field.\nfunc (a *AdminStats) GetComments() *CommentStats {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.Comments\n}\n\n// GetGists returns the Gists field.\nfunc (a *AdminStats) GetGists() *GistStats {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.Gists\n}\n\n// GetHooks returns the Hooks field.\nfunc (a *AdminStats) GetHooks() *HookStats {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.Hooks\n}\n\n// GetIssues returns the Issues field.\nfunc (a *AdminStats) GetIssues() *IssueStats {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.Issues\n}\n\n// GetMilestones returns the Milestones field.\nfunc (a *AdminStats) GetMilestones() *MilestoneStats {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.Milestones\n}\n\n// GetOrgs returns the Orgs field.\nfunc (a *AdminStats) GetOrgs() *OrgStats {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.Orgs\n}\n\n// GetPages returns the Pages field.\nfunc (a *AdminStats) GetPages() *PageStats {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.Pages\n}\n\n// GetPulls returns the Pulls field.\nfunc (a *AdminStats) GetPulls() *PullStats {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.Pulls\n}\n\n// GetRepos returns the Repos field.\nfunc (a *AdminStats) GetRepos() *RepoStats {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.Repos\n}\n\n// GetUsers returns the Users field.\nfunc (a *AdminStats) GetUsers() *UserStats {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.Users\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (a *AdvancedSecurity) GetStatus() string {\n\tif a == nil || a.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Status\n}\n\n// GetLastPushedDate returns the LastPushedDate field.\nfunc (a *AdvancedSecurityCommittersBreakdown) GetLastPushedDate() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.LastPushedDate\n}\n\n// GetLastPushedEmail returns the LastPushedEmail field.\nfunc (a *AdvancedSecurityCommittersBreakdown) GetLastPushedEmail() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.LastPushedEmail\n}\n\n// GetUserLogin returns the UserLogin field.\nfunc (a *AdvancedSecurityCommittersBreakdown) GetUserLogin() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.UserLogin\n}\n\n// GetScore returns the Score field if it's non-nil, zero value otherwise.\nfunc (a *AdvisoryCVSS) GetScore() float64 {\n\tif a == nil || a.Score == nil {\n\t\treturn 0\n\t}\n\treturn *a.Score\n}\n\n// GetVectorString returns the VectorString field if it's non-nil, zero value otherwise.\nfunc (a *AdvisoryCVSS) GetVectorString() string {\n\tif a == nil || a.VectorString == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.VectorString\n}\n\n// GetCWEID returns the CWEID field if it's non-nil, zero value otherwise.\nfunc (a *AdvisoryCWEs) GetCWEID() string {\n\tif a == nil || a.CWEID == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.CWEID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (a *AdvisoryCWEs) GetName() string {\n\tif a == nil || a.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Name\n}\n\n// GetPercentage returns the Percentage field.\nfunc (a *AdvisoryEPSS) GetPercentage() float64 {\n\tif a == nil {\n\t\treturn 0\n\t}\n\treturn a.Percentage\n}\n\n// GetPercentile returns the Percentile field.\nfunc (a *AdvisoryEPSS) GetPercentile() float64 {\n\tif a == nil {\n\t\treturn 0\n\t}\n\treturn a.Percentile\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (a *AdvisoryIdentifier) GetType() string {\n\tif a == nil || a.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Type\n}\n\n// GetValue returns the Value field if it's non-nil, zero value otherwise.\nfunc (a *AdvisoryIdentifier) GetValue() string {\n\tif a == nil || a.Value == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Value\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (a *AdvisoryReference) GetURL() string {\n\tif a == nil || a.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.URL\n}\n\n// GetFirstPatchedVersion returns the FirstPatchedVersion field.\nfunc (a *AdvisoryVulnerability) GetFirstPatchedVersion() *FirstPatchedVersion {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.FirstPatchedVersion\n}\n\n// GetPackage returns the Package field.\nfunc (a *AdvisoryVulnerability) GetPackage() *VulnerabilityPackage {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.Package\n}\n\n// GetPatchedVersions returns the PatchedVersions field if it's non-nil, zero value otherwise.\nfunc (a *AdvisoryVulnerability) GetPatchedVersions() string {\n\tif a == nil || a.PatchedVersions == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.PatchedVersions\n}\n\n// GetSeverity returns the Severity field if it's non-nil, zero value otherwise.\nfunc (a *AdvisoryVulnerability) GetSeverity() string {\n\tif a == nil || a.Severity == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Severity\n}\n\n// GetVulnerableFunctions returns the VulnerableFunctions slice if it's non-nil, nil otherwise.\nfunc (a *AdvisoryVulnerability) GetVulnerableFunctions() []string {\n\tif a == nil || a.VulnerableFunctions == nil {\n\t\treturn nil\n\t}\n\treturn a.VulnerableFunctions\n}\n\n// GetVulnerableVersionRange returns the VulnerableVersionRange field if it's non-nil, zero value otherwise.\nfunc (a *AdvisoryVulnerability) GetVulnerableVersionRange() string {\n\tif a == nil || a.VulnerableVersionRange == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.VulnerableVersionRange\n}\n\n// GetClosedAt returns the ClosedAt field if it's non-nil, zero value otherwise.\nfunc (a *Alert) GetClosedAt() Timestamp {\n\tif a == nil || a.ClosedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *a.ClosedAt\n}\n\n// GetClosedBy returns the ClosedBy field.\nfunc (a *Alert) GetClosedBy() *User {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.ClosedBy\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (a *Alert) GetCreatedAt() Timestamp {\n\tif a == nil || a.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *a.CreatedAt\n}\n\n// GetDismissedAt returns the DismissedAt field if it's non-nil, zero value otherwise.\nfunc (a *Alert) GetDismissedAt() Timestamp {\n\tif a == nil || a.DismissedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *a.DismissedAt\n}\n\n// GetDismissedBy returns the DismissedBy field.\nfunc (a *Alert) GetDismissedBy() *User {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.DismissedBy\n}\n\n// GetDismissedComment returns the DismissedComment field if it's non-nil, zero value otherwise.\nfunc (a *Alert) GetDismissedComment() string {\n\tif a == nil || a.DismissedComment == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.DismissedComment\n}\n\n// GetDismissedReason returns the DismissedReason field if it's non-nil, zero value otherwise.\nfunc (a *Alert) GetDismissedReason() string {\n\tif a == nil || a.DismissedReason == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.DismissedReason\n}\n\n// GetFixedAt returns the FixedAt field if it's non-nil, zero value otherwise.\nfunc (a *Alert) GetFixedAt() Timestamp {\n\tif a == nil || a.FixedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *a.FixedAt\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (a *Alert) GetHTMLURL() string {\n\tif a == nil || a.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.HTMLURL\n}\n\n// GetInstances returns the Instances slice if it's non-nil, nil otherwise.\nfunc (a *Alert) GetInstances() []*MostRecentInstance {\n\tif a == nil || a.Instances == nil {\n\t\treturn nil\n\t}\n\treturn a.Instances\n}\n\n// GetInstancesURL returns the InstancesURL field if it's non-nil, zero value otherwise.\nfunc (a *Alert) GetInstancesURL() string {\n\tif a == nil || a.InstancesURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.InstancesURL\n}\n\n// GetMostRecentInstance returns the MostRecentInstance field.\nfunc (a *Alert) GetMostRecentInstance() *MostRecentInstance {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.MostRecentInstance\n}\n\n// GetNumber returns the Number field if it's non-nil, zero value otherwise.\nfunc (a *Alert) GetNumber() int {\n\tif a == nil || a.Number == nil {\n\t\treturn 0\n\t}\n\treturn *a.Number\n}\n\n// GetRepository returns the Repository field.\nfunc (a *Alert) GetRepository() *Repository {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.Repository\n}\n\n// GetRule returns the Rule field.\nfunc (a *Alert) GetRule() *Rule {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.Rule\n}\n\n// GetRuleDescription returns the RuleDescription field if it's non-nil, zero value otherwise.\nfunc (a *Alert) GetRuleDescription() string {\n\tif a == nil || a.RuleDescription == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.RuleDescription\n}\n\n// GetRuleID returns the RuleID field if it's non-nil, zero value otherwise.\nfunc (a *Alert) GetRuleID() string {\n\tif a == nil || a.RuleID == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.RuleID\n}\n\n// GetRuleSeverity returns the RuleSeverity field if it's non-nil, zero value otherwise.\nfunc (a *Alert) GetRuleSeverity() string {\n\tif a == nil || a.RuleSeverity == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.RuleSeverity\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (a *Alert) GetState() string {\n\tif a == nil || a.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.State\n}\n\n// GetTool returns the Tool field.\nfunc (a *Alert) GetTool() *Tool {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.Tool\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (a *Alert) GetUpdatedAt() Timestamp {\n\tif a == nil || a.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *a.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (a *Alert) GetURL() string {\n\tif a == nil || a.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.URL\n}\n\n// GetRef returns the Ref field.\nfunc (a *AlertInstancesListOptions) GetRef() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.Ref\n}\n\n// GetDirection returns the Direction field.\nfunc (a *AlertListOptions) GetDirection() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.Direction\n}\n\n// GetRef returns the Ref field.\nfunc (a *AlertListOptions) GetRef() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.Ref\n}\n\n// GetSeverity returns the Severity field.\nfunc (a *AlertListOptions) GetSeverity() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.Severity\n}\n\n// GetSort returns the Sort field.\nfunc (a *AlertListOptions) GetSort() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.Sort\n}\n\n// GetState returns the State field.\nfunc (a *AlertListOptions) GetState() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.State\n}\n\n// GetToolGUID returns the ToolGUID field.\nfunc (a *AlertListOptions) GetToolGUID() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.ToolGUID\n}\n\n// GetToolName returns the ToolName field.\nfunc (a *AlertListOptions) GetToolName() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.ToolName\n}\n\n// GetEnabled returns the Enabled field.\nfunc (a *AllowDeletions) GetEnabled() bool {\n\tif a == nil {\n\t\treturn false\n\t}\n\treturn a.Enabled\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (a *AllowDeletionsEnforcementLevelChanges) GetFrom() string {\n\tif a == nil || a.From == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.From\n}\n\n// GetEnabled returns the Enabled field.\nfunc (a *AllowForcePushes) GetEnabled() bool {\n\tif a == nil {\n\t\treturn false\n\t}\n\treturn a.Enabled\n}\n\n// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise.\nfunc (a *AllowForkSyncing) GetEnabled() bool {\n\tif a == nil || a.Enabled == nil {\n\t\treturn false\n\t}\n\treturn *a.Enabled\n}\n\n// GetAuthenticationType returns the AuthenticationType field.\nfunc (a *AmazonS3AccessKeysConfig) GetAuthenticationType() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.AuthenticationType\n}\n\n// GetBucket returns the Bucket field.\nfunc (a *AmazonS3AccessKeysConfig) GetBucket() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.Bucket\n}\n\n// GetEncryptedAccessKeyID returns the EncryptedAccessKeyID field.\nfunc (a *AmazonS3AccessKeysConfig) GetEncryptedAccessKeyID() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.EncryptedAccessKeyID\n}\n\n// GetEncryptedSecretKey returns the EncryptedSecretKey field.\nfunc (a *AmazonS3AccessKeysConfig) GetEncryptedSecretKey() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.EncryptedSecretKey\n}\n\n// GetKeyID returns the KeyID field.\nfunc (a *AmazonS3AccessKeysConfig) GetKeyID() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.KeyID\n}\n\n// GetRegion returns the Region field.\nfunc (a *AmazonS3AccessKeysConfig) GetRegion() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.Region\n}\n\n// GetArnRole returns the ArnRole field.\nfunc (a *AmazonS3OIDCConfig) GetArnRole() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.ArnRole\n}\n\n// GetAuthenticationType returns the AuthenticationType field.\nfunc (a *AmazonS3OIDCConfig) GetAuthenticationType() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.AuthenticationType\n}\n\n// GetBucket returns the Bucket field.\nfunc (a *AmazonS3OIDCConfig) GetBucket() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.Bucket\n}\n\n// GetKeyID returns the KeyID field.\nfunc (a *AmazonS3OIDCConfig) GetKeyID() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.KeyID\n}\n\n// GetRegion returns the Region field.\nfunc (a *AmazonS3OIDCConfig) GetRegion() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.Region\n}\n\n// GetRef returns the Ref field if it's non-nil, zero value otherwise.\nfunc (a *AnalysesListOptions) GetRef() string {\n\tif a == nil || a.Ref == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Ref\n}\n\n// GetSarifID returns the SarifID field if it's non-nil, zero value otherwise.\nfunc (a *AnalysesListOptions) GetSarifID() string {\n\tif a == nil || a.SarifID == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.SarifID\n}\n\n// GetActions returns the Actions slice if it's non-nil, nil otherwise.\nfunc (a *APIMeta) GetActions() []string {\n\tif a == nil || a.Actions == nil {\n\t\treturn nil\n\t}\n\treturn a.Actions\n}\n\n// GetActionsMacos returns the ActionsMacos slice if it's non-nil, nil otherwise.\nfunc (a *APIMeta) GetActionsMacos() []string {\n\tif a == nil || a.ActionsMacos == nil {\n\t\treturn nil\n\t}\n\treturn a.ActionsMacos\n}\n\n// GetAPI returns the API slice if it's non-nil, nil otherwise.\nfunc (a *APIMeta) GetAPI() []string {\n\tif a == nil || a.API == nil {\n\t\treturn nil\n\t}\n\treturn a.API\n}\n\n// GetCodespaces returns the Codespaces slice if it's non-nil, nil otherwise.\nfunc (a *APIMeta) GetCodespaces() []string {\n\tif a == nil || a.Codespaces == nil {\n\t\treturn nil\n\t}\n\treturn a.Codespaces\n}\n\n// GetCopilot returns the Copilot slice if it's non-nil, nil otherwise.\nfunc (a *APIMeta) GetCopilot() []string {\n\tif a == nil || a.Copilot == nil {\n\t\treturn nil\n\t}\n\treturn a.Copilot\n}\n\n// GetDependabot returns the Dependabot slice if it's non-nil, nil otherwise.\nfunc (a *APIMeta) GetDependabot() []string {\n\tif a == nil || a.Dependabot == nil {\n\t\treturn nil\n\t}\n\treturn a.Dependabot\n}\n\n// GetDomains returns the Domains field.\nfunc (a *APIMeta) GetDomains() *APIMetaDomains {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.Domains\n}\n\n// GetGit returns the Git slice if it's non-nil, nil otherwise.\nfunc (a *APIMeta) GetGit() []string {\n\tif a == nil || a.Git == nil {\n\t\treturn nil\n\t}\n\treturn a.Git\n}\n\n// GetGithubEnterpriseImporter returns the GithubEnterpriseImporter slice if it's non-nil, nil otherwise.\nfunc (a *APIMeta) GetGithubEnterpriseImporter() []string {\n\tif a == nil || a.GithubEnterpriseImporter == nil {\n\t\treturn nil\n\t}\n\treturn a.GithubEnterpriseImporter\n}\n\n// GetHooks returns the Hooks slice if it's non-nil, nil otherwise.\nfunc (a *APIMeta) GetHooks() []string {\n\tif a == nil || a.Hooks == nil {\n\t\treturn nil\n\t}\n\treturn a.Hooks\n}\n\n// GetImporter returns the Importer slice if it's non-nil, nil otherwise.\nfunc (a *APIMeta) GetImporter() []string {\n\tif a == nil || a.Importer == nil {\n\t\treturn nil\n\t}\n\treturn a.Importer\n}\n\n// GetPackages returns the Packages slice if it's non-nil, nil otherwise.\nfunc (a *APIMeta) GetPackages() []string {\n\tif a == nil || a.Packages == nil {\n\t\treturn nil\n\t}\n\treturn a.Packages\n}\n\n// GetPages returns the Pages slice if it's non-nil, nil otherwise.\nfunc (a *APIMeta) GetPages() []string {\n\tif a == nil || a.Pages == nil {\n\t\treturn nil\n\t}\n\treturn a.Pages\n}\n\n// GetSSHKeyFingerprints returns the SSHKeyFingerprints map if it's non-nil, an empty map otherwise.\nfunc (a *APIMeta) GetSSHKeyFingerprints() map[string]string {\n\tif a == nil || a.SSHKeyFingerprints == nil {\n\t\treturn map[string]string{}\n\t}\n\treturn a.SSHKeyFingerprints\n}\n\n// GetSSHKeys returns the SSHKeys slice if it's non-nil, nil otherwise.\nfunc (a *APIMeta) GetSSHKeys() []string {\n\tif a == nil || a.SSHKeys == nil {\n\t\treturn nil\n\t}\n\treturn a.SSHKeys\n}\n\n// GetVerifiablePasswordAuthentication returns the VerifiablePasswordAuthentication field if it's non-nil, zero value otherwise.\nfunc (a *APIMeta) GetVerifiablePasswordAuthentication() bool {\n\tif a == nil || a.VerifiablePasswordAuthentication == nil {\n\t\treturn false\n\t}\n\treturn *a.VerifiablePasswordAuthentication\n}\n\n// GetWeb returns the Web slice if it's non-nil, nil otherwise.\nfunc (a *APIMeta) GetWeb() []string {\n\tif a == nil || a.Web == nil {\n\t\treturn nil\n\t}\n\treturn a.Web\n}\n\n// GetServices returns the Services slice if it's non-nil, nil otherwise.\nfunc (a *APIMetaArtifactAttestations) GetServices() []string {\n\tif a == nil || a.Services == nil {\n\t\treturn nil\n\t}\n\treturn a.Services\n}\n\n// GetTrustDomain returns the TrustDomain field.\nfunc (a *APIMetaArtifactAttestations) GetTrustDomain() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.TrustDomain\n}\n\n// GetActions returns the Actions slice if it's non-nil, nil otherwise.\nfunc (a *APIMetaDomains) GetActions() []string {\n\tif a == nil || a.Actions == nil {\n\t\treturn nil\n\t}\n\treturn a.Actions\n}\n\n// GetActionsInbound returns the ActionsInbound field.\nfunc (a *APIMetaDomains) GetActionsInbound() *ActionsInboundDomains {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.ActionsInbound\n}\n\n// GetArtifactAttestations returns the ArtifactAttestations field.\nfunc (a *APIMetaDomains) GetArtifactAttestations() *APIMetaArtifactAttestations {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.ArtifactAttestations\n}\n\n// GetCodespaces returns the Codespaces slice if it's non-nil, nil otherwise.\nfunc (a *APIMetaDomains) GetCodespaces() []string {\n\tif a == nil || a.Codespaces == nil {\n\t\treturn nil\n\t}\n\treturn a.Codespaces\n}\n\n// GetCopilot returns the Copilot slice if it's non-nil, nil otherwise.\nfunc (a *APIMetaDomains) GetCopilot() []string {\n\tif a == nil || a.Copilot == nil {\n\t\treturn nil\n\t}\n\treturn a.Copilot\n}\n\n// GetPackages returns the Packages slice if it's non-nil, nil otherwise.\nfunc (a *APIMetaDomains) GetPackages() []string {\n\tif a == nil || a.Packages == nil {\n\t\treturn nil\n\t}\n\treturn a.Packages\n}\n\n// GetWebsite returns the Website slice if it's non-nil, nil otherwise.\nfunc (a *APIMetaDomains) GetWebsite() []string {\n\tif a == nil || a.Website == nil {\n\t\treturn nil\n\t}\n\treturn a.Website\n}\n\n// GetClientID returns the ClientID field if it's non-nil, zero value otherwise.\nfunc (a *App) GetClientID() string {\n\tif a == nil || a.ClientID == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.ClientID\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (a *App) GetCreatedAt() Timestamp {\n\tif a == nil || a.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *a.CreatedAt\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (a *App) GetDescription() string {\n\tif a == nil || a.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Description\n}\n\n// GetEvents returns the Events slice if it's non-nil, nil otherwise.\nfunc (a *App) GetEvents() []string {\n\tif a == nil || a.Events == nil {\n\t\treturn nil\n\t}\n\treturn a.Events\n}\n\n// GetExternalURL returns the ExternalURL field if it's non-nil, zero value otherwise.\nfunc (a *App) GetExternalURL() string {\n\tif a == nil || a.ExternalURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.ExternalURL\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (a *App) GetHTMLURL() string {\n\tif a == nil || a.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (a *App) GetID() int64 {\n\tif a == nil || a.ID == nil {\n\t\treturn 0\n\t}\n\treturn *a.ID\n}\n\n// GetInstallationsCount returns the InstallationsCount field if it's non-nil, zero value otherwise.\nfunc (a *App) GetInstallationsCount() int {\n\tif a == nil || a.InstallationsCount == nil {\n\t\treturn 0\n\t}\n\treturn *a.InstallationsCount\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (a *App) GetName() string {\n\tif a == nil || a.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Name\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (a *App) GetNodeID() string {\n\tif a == nil || a.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.NodeID\n}\n\n// GetOwner returns the Owner field.\nfunc (a *App) GetOwner() *User {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.Owner\n}\n\n// GetPermissions returns the Permissions field.\nfunc (a *App) GetPermissions() *InstallationPermissions {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.Permissions\n}\n\n// GetSlug returns the Slug field if it's non-nil, zero value otherwise.\nfunc (a *App) GetSlug() string {\n\tif a == nil || a.Slug == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Slug\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (a *App) GetUpdatedAt() Timestamp {\n\tif a == nil || a.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *a.UpdatedAt\n}\n\n// GetClientID returns the ClientID field if it's non-nil, zero value otherwise.\nfunc (a *AppConfig) GetClientID() string {\n\tif a == nil || a.ClientID == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.ClientID\n}\n\n// GetClientSecret returns the ClientSecret field if it's non-nil, zero value otherwise.\nfunc (a *AppConfig) GetClientSecret() string {\n\tif a == nil || a.ClientSecret == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.ClientSecret\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (a *AppConfig) GetCreatedAt() Timestamp {\n\tif a == nil || a.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *a.CreatedAt\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (a *AppConfig) GetDescription() string {\n\tif a == nil || a.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Description\n}\n\n// GetExternalURL returns the ExternalURL field if it's non-nil, zero value otherwise.\nfunc (a *AppConfig) GetExternalURL() string {\n\tif a == nil || a.ExternalURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.ExternalURL\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (a *AppConfig) GetHTMLURL() string {\n\tif a == nil || a.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (a *AppConfig) GetID() int64 {\n\tif a == nil || a.ID == nil {\n\t\treturn 0\n\t}\n\treturn *a.ID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (a *AppConfig) GetName() string {\n\tif a == nil || a.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Name\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (a *AppConfig) GetNodeID() string {\n\tif a == nil || a.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.NodeID\n}\n\n// GetOwner returns the Owner field.\nfunc (a *AppConfig) GetOwner() *User {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.Owner\n}\n\n// GetPEM returns the PEM field if it's non-nil, zero value otherwise.\nfunc (a *AppConfig) GetPEM() string {\n\tif a == nil || a.PEM == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.PEM\n}\n\n// GetSlug returns the Slug field if it's non-nil, zero value otherwise.\nfunc (a *AppConfig) GetSlug() string {\n\tif a == nil || a.Slug == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Slug\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (a *AppConfig) GetUpdatedAt() Timestamp {\n\tif a == nil || a.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *a.UpdatedAt\n}\n\n// GetWebhookSecret returns the WebhookSecret field if it's non-nil, zero value otherwise.\nfunc (a *AppConfig) GetWebhookSecret() string {\n\tif a == nil || a.WebhookSecret == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.WebhookSecret\n}\n\n// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs slice if it's non-nil, nil otherwise.\nfunc (a *AppInstallationRepositoriesOptions) GetSelectedRepositoryIDs() []int64 {\n\tif a == nil || a.SelectedRepositoryIDs == nil {\n\t\treturn nil\n\t}\n\treturn a.SelectedRepositoryIDs\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (a *ArchivedAt) GetFrom() Timestamp {\n\tif a == nil || a.From == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *a.From\n}\n\n// GetTo returns the To field if it's non-nil, zero value otherwise.\nfunc (a *ArchivedAt) GetTo() Timestamp {\n\tif a == nil || a.To == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *a.To\n}\n\n// GetArchiveDownloadURL returns the ArchiveDownloadURL field if it's non-nil, zero value otherwise.\nfunc (a *Artifact) GetArchiveDownloadURL() string {\n\tif a == nil || a.ArchiveDownloadURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.ArchiveDownloadURL\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (a *Artifact) GetCreatedAt() Timestamp {\n\tif a == nil || a.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *a.CreatedAt\n}\n\n// GetDigest returns the Digest field if it's non-nil, zero value otherwise.\nfunc (a *Artifact) GetDigest() string {\n\tif a == nil || a.Digest == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Digest\n}\n\n// GetExpired returns the Expired field if it's non-nil, zero value otherwise.\nfunc (a *Artifact) GetExpired() bool {\n\tif a == nil || a.Expired == nil {\n\t\treturn false\n\t}\n\treturn *a.Expired\n}\n\n// GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise.\nfunc (a *Artifact) GetExpiresAt() Timestamp {\n\tif a == nil || a.ExpiresAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *a.ExpiresAt\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (a *Artifact) GetID() int64 {\n\tif a == nil || a.ID == nil {\n\t\treturn 0\n\t}\n\treturn *a.ID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (a *Artifact) GetName() string {\n\tif a == nil || a.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Name\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (a *Artifact) GetNodeID() string {\n\tif a == nil || a.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.NodeID\n}\n\n// GetSizeInBytes returns the SizeInBytes field if it's non-nil, zero value otherwise.\nfunc (a *Artifact) GetSizeInBytes() int64 {\n\tif a == nil || a.SizeInBytes == nil {\n\t\treturn 0\n\t}\n\treturn *a.SizeInBytes\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (a *Artifact) GetUpdatedAt() Timestamp {\n\tif a == nil || a.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *a.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (a *Artifact) GetURL() string {\n\tif a == nil || a.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.URL\n}\n\n// GetWorkflowRun returns the WorkflowRun field.\nfunc (a *Artifact) GetWorkflowRun() *ArtifactWorkflowRun {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.WorkflowRun\n}\n\n// GetAttestationID returns the AttestationID field if it's non-nil, zero value otherwise.\nfunc (a *ArtifactDeploymentRecord) GetAttestationID() int64 {\n\tif a == nil || a.AttestationID == nil {\n\t\treturn 0\n\t}\n\treturn *a.AttestationID\n}\n\n// GetCluster returns the Cluster field if it's non-nil, zero value otherwise.\nfunc (a *ArtifactDeploymentRecord) GetCluster() string {\n\tif a == nil || a.Cluster == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Cluster\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (a *ArtifactDeploymentRecord) GetCreatedAt() Timestamp {\n\tif a == nil || a.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *a.CreatedAt\n}\n\n// GetDeploymentName returns the DeploymentName field if it's non-nil, zero value otherwise.\nfunc (a *ArtifactDeploymentRecord) GetDeploymentName() string {\n\tif a == nil || a.DeploymentName == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.DeploymentName\n}\n\n// GetDigest returns the Digest field if it's non-nil, zero value otherwise.\nfunc (a *ArtifactDeploymentRecord) GetDigest() string {\n\tif a == nil || a.Digest == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Digest\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (a *ArtifactDeploymentRecord) GetID() int64 {\n\tif a == nil || a.ID == nil {\n\t\treturn 0\n\t}\n\treturn *a.ID\n}\n\n// GetLogicalEnvironment returns the LogicalEnvironment field if it's non-nil, zero value otherwise.\nfunc (a *ArtifactDeploymentRecord) GetLogicalEnvironment() string {\n\tif a == nil || a.LogicalEnvironment == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.LogicalEnvironment\n}\n\n// GetPhysicalEnvironment returns the PhysicalEnvironment field if it's non-nil, zero value otherwise.\nfunc (a *ArtifactDeploymentRecord) GetPhysicalEnvironment() string {\n\tif a == nil || a.PhysicalEnvironment == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.PhysicalEnvironment\n}\n\n// GetRuntimeRisks returns the RuntimeRisks slice if it's non-nil, nil otherwise.\nfunc (a *ArtifactDeploymentRecord) GetRuntimeRisks() []DeploymentRuntimeRisk {\n\tif a == nil || a.RuntimeRisks == nil {\n\t\treturn nil\n\t}\n\treturn a.RuntimeRisks\n}\n\n// GetTags returns the Tags map if it's non-nil, an empty map otherwise.\nfunc (a *ArtifactDeploymentRecord) GetTags() map[string]string {\n\tif a == nil || a.Tags == nil {\n\t\treturn map[string]string{}\n\t}\n\treturn a.Tags\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (a *ArtifactDeploymentRecord) GetUpdatedAt() Timestamp {\n\tif a == nil || a.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *a.UpdatedAt\n}\n\n// GetDeploymentRecords returns the DeploymentRecords slice if it's non-nil, nil otherwise.\nfunc (a *ArtifactDeploymentResponse) GetDeploymentRecords() []*ArtifactDeploymentRecord {\n\tif a == nil || a.DeploymentRecords == nil {\n\t\treturn nil\n\t}\n\treturn a.DeploymentRecords\n}\n\n// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.\nfunc (a *ArtifactDeploymentResponse) GetTotalCount() int {\n\tif a == nil || a.TotalCount == nil {\n\t\treturn 0\n\t}\n\treturn *a.TotalCount\n}\n\n// GetArtifacts returns the Artifacts slice if it's non-nil, nil otherwise.\nfunc (a *ArtifactList) GetArtifacts() []*Artifact {\n\tif a == nil || a.Artifacts == nil {\n\t\treturn nil\n\t}\n\treturn a.Artifacts\n}\n\n// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.\nfunc (a *ArtifactList) GetTotalCount() int64 {\n\tif a == nil || a.TotalCount == nil {\n\t\treturn 0\n\t}\n\treturn *a.TotalCount\n}\n\n// GetDays returns the Days field if it's non-nil, zero value otherwise.\nfunc (a *ArtifactPeriod) GetDays() int {\n\tif a == nil || a.Days == nil {\n\t\treturn 0\n\t}\n\treturn *a.Days\n}\n\n// GetMaximumAllowedDays returns the MaximumAllowedDays field if it's non-nil, zero value otherwise.\nfunc (a *ArtifactPeriod) GetMaximumAllowedDays() int {\n\tif a == nil || a.MaximumAllowedDays == nil {\n\t\treturn 0\n\t}\n\treturn *a.MaximumAllowedDays\n}\n\n// GetDays returns the Days field if it's non-nil, zero value otherwise.\nfunc (a *ArtifactPeriodOpt) GetDays() int {\n\tif a == nil || a.Days == nil {\n\t\treturn 0\n\t}\n\treturn *a.Days\n}\n\n// GetArtifactURL returns the ArtifactURL field if it's non-nil, zero value otherwise.\nfunc (a *ArtifactStorageRecord) GetArtifactURL() string {\n\tif a == nil || a.ArtifactURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.ArtifactURL\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (a *ArtifactStorageRecord) GetCreatedAt() Timestamp {\n\tif a == nil || a.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *a.CreatedAt\n}\n\n// GetDigest returns the Digest field if it's non-nil, zero value otherwise.\nfunc (a *ArtifactStorageRecord) GetDigest() string {\n\tif a == nil || a.Digest == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Digest\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (a *ArtifactStorageRecord) GetID() int64 {\n\tif a == nil || a.ID == nil {\n\t\treturn 0\n\t}\n\treturn *a.ID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (a *ArtifactStorageRecord) GetName() string {\n\tif a == nil || a.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Name\n}\n\n// GetRegistryURL returns the RegistryURL field if it's non-nil, zero value otherwise.\nfunc (a *ArtifactStorageRecord) GetRegistryURL() string {\n\tif a == nil || a.RegistryURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.RegistryURL\n}\n\n// GetRepository returns the Repository field if it's non-nil, zero value otherwise.\nfunc (a *ArtifactStorageRecord) GetRepository() string {\n\tif a == nil || a.Repository == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Repository\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (a *ArtifactStorageRecord) GetStatus() string {\n\tif a == nil || a.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Status\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (a *ArtifactStorageRecord) GetUpdatedAt() Timestamp {\n\tif a == nil || a.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *a.UpdatedAt\n}\n\n// GetStorageRecords returns the StorageRecords slice if it's non-nil, nil otherwise.\nfunc (a *ArtifactStorageResponse) GetStorageRecords() []*ArtifactStorageRecord {\n\tif a == nil || a.StorageRecords == nil {\n\t\treturn nil\n\t}\n\treturn a.StorageRecords\n}\n\n// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.\nfunc (a *ArtifactStorageResponse) GetTotalCount() int {\n\tif a == nil || a.TotalCount == nil {\n\t\treturn 0\n\t}\n\treturn *a.TotalCount\n}\n\n// GetHeadBranch returns the HeadBranch field if it's non-nil, zero value otherwise.\nfunc (a *ArtifactWorkflowRun) GetHeadBranch() string {\n\tif a == nil || a.HeadBranch == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.HeadBranch\n}\n\n// GetHeadRepositoryID returns the HeadRepositoryID field if it's non-nil, zero value otherwise.\nfunc (a *ArtifactWorkflowRun) GetHeadRepositoryID() int64 {\n\tif a == nil || a.HeadRepositoryID == nil {\n\t\treturn 0\n\t}\n\treturn *a.HeadRepositoryID\n}\n\n// GetHeadSHA returns the HeadSHA field if it's non-nil, zero value otherwise.\nfunc (a *ArtifactWorkflowRun) GetHeadSHA() string {\n\tif a == nil || a.HeadSHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.HeadSHA\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (a *ArtifactWorkflowRun) GetID() int64 {\n\tif a == nil || a.ID == nil {\n\t\treturn 0\n\t}\n\treturn *a.ID\n}\n\n// GetRepositoryID returns the RepositoryID field if it's non-nil, zero value otherwise.\nfunc (a *ArtifactWorkflowRun) GetRepositoryID() int64 {\n\tif a == nil || a.RepositoryID == nil {\n\t\treturn 0\n\t}\n\treturn *a.RepositoryID\n}\n\n// GetAssignmentName returns the AssignmentName field if it's non-nil, zero value otherwise.\nfunc (a *AssignmentGrade) GetAssignmentName() string {\n\tif a == nil || a.AssignmentName == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.AssignmentName\n}\n\n// GetAssignmentURL returns the AssignmentURL field if it's non-nil, zero value otherwise.\nfunc (a *AssignmentGrade) GetAssignmentURL() string {\n\tif a == nil || a.AssignmentURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.AssignmentURL\n}\n\n// GetGithubUsername returns the GithubUsername field if it's non-nil, zero value otherwise.\nfunc (a *AssignmentGrade) GetGithubUsername() string {\n\tif a == nil || a.GithubUsername == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.GithubUsername\n}\n\n// GetGroupName returns the GroupName field if it's non-nil, zero value otherwise.\nfunc (a *AssignmentGrade) GetGroupName() string {\n\tif a == nil || a.GroupName == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.GroupName\n}\n\n// GetPointsAvailable returns the PointsAvailable field if it's non-nil, zero value otherwise.\nfunc (a *AssignmentGrade) GetPointsAvailable() int {\n\tif a == nil || a.PointsAvailable == nil {\n\t\treturn 0\n\t}\n\treturn *a.PointsAvailable\n}\n\n// GetPointsAwarded returns the PointsAwarded field if it's non-nil, zero value otherwise.\nfunc (a *AssignmentGrade) GetPointsAwarded() int {\n\tif a == nil || a.PointsAwarded == nil {\n\t\treturn 0\n\t}\n\treturn *a.PointsAwarded\n}\n\n// GetRosterIdentifier returns the RosterIdentifier field if it's non-nil, zero value otherwise.\nfunc (a *AssignmentGrade) GetRosterIdentifier() string {\n\tif a == nil || a.RosterIdentifier == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.RosterIdentifier\n}\n\n// GetStarterCodeURL returns the StarterCodeURL field if it's non-nil, zero value otherwise.\nfunc (a *AssignmentGrade) GetStarterCodeURL() string {\n\tif a == nil || a.StarterCodeURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.StarterCodeURL\n}\n\n// GetStudentRepositoryName returns the StudentRepositoryName field if it's non-nil, zero value otherwise.\nfunc (a *AssignmentGrade) GetStudentRepositoryName() string {\n\tif a == nil || a.StudentRepositoryName == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.StudentRepositoryName\n}\n\n// GetStudentRepositoryURL returns the StudentRepositoryURL field if it's non-nil, zero value otherwise.\nfunc (a *AssignmentGrade) GetStudentRepositoryURL() string {\n\tif a == nil || a.StudentRepositoryURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.StudentRepositoryURL\n}\n\n// GetSubmissionTimestamp returns the SubmissionTimestamp field if it's non-nil, zero value otherwise.\nfunc (a *AssignmentGrade) GetSubmissionTimestamp() Timestamp {\n\tif a == nil || a.SubmissionTimestamp == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *a.SubmissionTimestamp\n}\n\n// GetBody returns the Body field if it's non-nil, zero value otherwise.\nfunc (a *Attachment) GetBody() string {\n\tif a == nil || a.Body == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Body\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (a *Attachment) GetID() int64 {\n\tif a == nil || a.ID == nil {\n\t\treturn 0\n\t}\n\treturn *a.ID\n}\n\n// GetTitle returns the Title field if it's non-nil, zero value otherwise.\nfunc (a *Attachment) GetTitle() string {\n\tif a == nil || a.Title == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Title\n}\n\n// GetBundle returns the Bundle field.\nfunc (a *Attestation) GetBundle() json.RawMessage {\n\tif a == nil {\n\t\treturn json.RawMessage{}\n\t}\n\treturn a.Bundle\n}\n\n// GetRepositoryID returns the RepositoryID field.\nfunc (a *Attestation) GetRepositoryID() int64 {\n\tif a == nil {\n\t\treturn 0\n\t}\n\treturn a.RepositoryID\n}\n\n// GetAttestations returns the Attestations slice if it's non-nil, nil otherwise.\nfunc (a *AttestationsResponse) GetAttestations() []*Attestation {\n\tif a == nil || a.Attestations == nil {\n\t\treturn nil\n\t}\n\treturn a.Attestations\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (a *AuditEntry) GetAction() string {\n\tif a == nil || a.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Action\n}\n\n// GetActor returns the Actor field if it's non-nil, zero value otherwise.\nfunc (a *AuditEntry) GetActor() string {\n\tif a == nil || a.Actor == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Actor\n}\n\n// GetActorID returns the ActorID field if it's non-nil, zero value otherwise.\nfunc (a *AuditEntry) GetActorID() int64 {\n\tif a == nil || a.ActorID == nil {\n\t\treturn 0\n\t}\n\treturn *a.ActorID\n}\n\n// GetActorLocation returns the ActorLocation field.\nfunc (a *AuditEntry) GetActorLocation() *ActorLocation {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.ActorLocation\n}\n\n// GetAdditionalFields returns the AdditionalFields map if it's non-nil, an empty map otherwise.\nfunc (a *AuditEntry) GetAdditionalFields() map[string]any {\n\tif a == nil || a.AdditionalFields == nil {\n\t\treturn map[string]any{}\n\t}\n\treturn a.AdditionalFields\n}\n\n// GetBusiness returns the Business field if it's non-nil, zero value otherwise.\nfunc (a *AuditEntry) GetBusiness() string {\n\tif a == nil || a.Business == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Business\n}\n\n// GetBusinessID returns the BusinessID field if it's non-nil, zero value otherwise.\nfunc (a *AuditEntry) GetBusinessID() int64 {\n\tif a == nil || a.BusinessID == nil {\n\t\treturn 0\n\t}\n\treturn *a.BusinessID\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (a *AuditEntry) GetCreatedAt() Timestamp {\n\tif a == nil || a.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *a.CreatedAt\n}\n\n// GetData returns the Data map if it's non-nil, an empty map otherwise.\nfunc (a *AuditEntry) GetData() map[string]any {\n\tif a == nil || a.Data == nil {\n\t\treturn map[string]any{}\n\t}\n\treturn a.Data\n}\n\n// GetDocumentID returns the DocumentID field if it's non-nil, zero value otherwise.\nfunc (a *AuditEntry) GetDocumentID() string {\n\tif a == nil || a.DocumentID == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.DocumentID\n}\n\n// GetExternalIdentityNameID returns the ExternalIdentityNameID field if it's non-nil, zero value otherwise.\nfunc (a *AuditEntry) GetExternalIdentityNameID() string {\n\tif a == nil || a.ExternalIdentityNameID == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.ExternalIdentityNameID\n}\n\n// GetExternalIdentityUsername returns the ExternalIdentityUsername field if it's non-nil, zero value otherwise.\nfunc (a *AuditEntry) GetExternalIdentityUsername() string {\n\tif a == nil || a.ExternalIdentityUsername == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.ExternalIdentityUsername\n}\n\n// GetHashedToken returns the HashedToken field if it's non-nil, zero value otherwise.\nfunc (a *AuditEntry) GetHashedToken() string {\n\tif a == nil || a.HashedToken == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.HashedToken\n}\n\n// GetOrg returns the Org field if it's non-nil, zero value otherwise.\nfunc (a *AuditEntry) GetOrg() string {\n\tif a == nil || a.Org == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Org\n}\n\n// GetOrgID returns the OrgID field if it's non-nil, zero value otherwise.\nfunc (a *AuditEntry) GetOrgID() int64 {\n\tif a == nil || a.OrgID == nil {\n\t\treturn 0\n\t}\n\treturn *a.OrgID\n}\n\n// GetTimestamp returns the Timestamp field if it's non-nil, zero value otherwise.\nfunc (a *AuditEntry) GetTimestamp() Timestamp {\n\tif a == nil || a.Timestamp == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *a.Timestamp\n}\n\n// GetTokenID returns the TokenID field if it's non-nil, zero value otherwise.\nfunc (a *AuditEntry) GetTokenID() int64 {\n\tif a == nil || a.TokenID == nil {\n\t\treturn 0\n\t}\n\treturn *a.TokenID\n}\n\n// GetTokenScopes returns the TokenScopes field if it's non-nil, zero value otherwise.\nfunc (a *AuditEntry) GetTokenScopes() string {\n\tif a == nil || a.TokenScopes == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.TokenScopes\n}\n\n// GetUser returns the User field if it's non-nil, zero value otherwise.\nfunc (a *AuditEntry) GetUser() string {\n\tif a == nil || a.User == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.User\n}\n\n// GetUserID returns the UserID field if it's non-nil, zero value otherwise.\nfunc (a *AuditEntry) GetUserID() int64 {\n\tif a == nil || a.UserID == nil {\n\t\treturn 0\n\t}\n\treturn *a.UserID\n}\n\n// GetCreatedAt returns the CreatedAt field.\nfunc (a *AuditLogStream) GetCreatedAt() Timestamp {\n\tif a == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn a.CreatedAt\n}\n\n// GetEnabled returns the Enabled field.\nfunc (a *AuditLogStream) GetEnabled() bool {\n\tif a == nil {\n\t\treturn false\n\t}\n\treturn a.Enabled\n}\n\n// GetID returns the ID field.\nfunc (a *AuditLogStream) GetID() int64 {\n\tif a == nil {\n\t\treturn 0\n\t}\n\treturn a.ID\n}\n\n// GetPausedAt returns the PausedAt field if it's non-nil, zero value otherwise.\nfunc (a *AuditLogStream) GetPausedAt() Timestamp {\n\tif a == nil || a.PausedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *a.PausedAt\n}\n\n// GetStreamDetails returns the StreamDetails field.\nfunc (a *AuditLogStream) GetStreamDetails() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.StreamDetails\n}\n\n// GetStreamType returns the StreamType field.\nfunc (a *AuditLogStream) GetStreamType() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.StreamType\n}\n\n// GetUpdatedAt returns the UpdatedAt field.\nfunc (a *AuditLogStream) GetUpdatedAt() Timestamp {\n\tif a == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn a.UpdatedAt\n}\n\n// GetEnabled returns the Enabled field.\nfunc (a *AuditLogStreamConfig) GetEnabled() bool {\n\tif a == nil {\n\t\treturn false\n\t}\n\treturn a.Enabled\n}\n\n// GetStreamType returns the StreamType field.\nfunc (a *AuditLogStreamConfig) GetStreamType() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.StreamType\n}\n\n// GetVendorSpecific returns the VendorSpecific field.\nfunc (a *AuditLogStreamConfig) GetVendorSpecific() AuditLogStreamVendorConfig {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.VendorSpecific\n}\n\n// GetKey returns the Key field.\nfunc (a *AuditLogStreamKey) GetKey() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.Key\n}\n\n// GetKeyID returns the KeyID field.\nfunc (a *AuditLogStreamKey) GetKeyID() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.KeyID\n}\n\n// GetApp returns the App field.\nfunc (a *Authorization) GetApp() *AuthorizationApp {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.App\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (a *Authorization) GetCreatedAt() Timestamp {\n\tif a == nil || a.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *a.CreatedAt\n}\n\n// GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise.\nfunc (a *Authorization) GetFingerprint() string {\n\tif a == nil || a.Fingerprint == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Fingerprint\n}\n\n// GetHashedToken returns the HashedToken field if it's non-nil, zero value otherwise.\nfunc (a *Authorization) GetHashedToken() string {\n\tif a == nil || a.HashedToken == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.HashedToken\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (a *Authorization) GetID() int64 {\n\tif a == nil || a.ID == nil {\n\t\treturn 0\n\t}\n\treturn *a.ID\n}\n\n// GetNote returns the Note field if it's non-nil, zero value otherwise.\nfunc (a *Authorization) GetNote() string {\n\tif a == nil || a.Note == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Note\n}\n\n// GetNoteURL returns the NoteURL field if it's non-nil, zero value otherwise.\nfunc (a *Authorization) GetNoteURL() string {\n\tif a == nil || a.NoteURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.NoteURL\n}\n\n// GetScopes returns the Scopes slice if it's non-nil, nil otherwise.\nfunc (a *Authorization) GetScopes() []Scope {\n\tif a == nil || a.Scopes == nil {\n\t\treturn nil\n\t}\n\treturn a.Scopes\n}\n\n// GetToken returns the Token field if it's non-nil, zero value otherwise.\nfunc (a *Authorization) GetToken() string {\n\tif a == nil || a.Token == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Token\n}\n\n// GetTokenLastEight returns the TokenLastEight field if it's non-nil, zero value otherwise.\nfunc (a *Authorization) GetTokenLastEight() string {\n\tif a == nil || a.TokenLastEight == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.TokenLastEight\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (a *Authorization) GetUpdatedAt() Timestamp {\n\tif a == nil || a.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *a.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (a *Authorization) GetURL() string {\n\tif a == nil || a.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.URL\n}\n\n// GetUser returns the User field.\nfunc (a *Authorization) GetUser() *User {\n\tif a == nil {\n\t\treturn nil\n\t}\n\treturn a.User\n}\n\n// GetClientID returns the ClientID field if it's non-nil, zero value otherwise.\nfunc (a *AuthorizationApp) GetClientID() string {\n\tif a == nil || a.ClientID == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.ClientID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (a *AuthorizationApp) GetName() string {\n\tif a == nil || a.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Name\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (a *AuthorizationApp) GetURL() string {\n\tif a == nil || a.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.URL\n}\n\n// GetClientID returns the ClientID field if it's non-nil, zero value otherwise.\nfunc (a *AuthorizationRequest) GetClientID() string {\n\tif a == nil || a.ClientID == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.ClientID\n}\n\n// GetClientSecret returns the ClientSecret field if it's non-nil, zero value otherwise.\nfunc (a *AuthorizationRequest) GetClientSecret() string {\n\tif a == nil || a.ClientSecret == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.ClientSecret\n}\n\n// GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise.\nfunc (a *AuthorizationRequest) GetFingerprint() string {\n\tif a == nil || a.Fingerprint == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Fingerprint\n}\n\n// GetNote returns the Note field if it's non-nil, zero value otherwise.\nfunc (a *AuthorizationRequest) GetNote() string {\n\tif a == nil || a.Note == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Note\n}\n\n// GetNoteURL returns the NoteURL field if it's non-nil, zero value otherwise.\nfunc (a *AuthorizationRequest) GetNoteURL() string {\n\tif a == nil || a.NoteURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.NoteURL\n}\n\n// GetScopes returns the Scopes slice if it's non-nil, nil otherwise.\nfunc (a *AuthorizationRequest) GetScopes() []Scope {\n\tif a == nil || a.Scopes == nil {\n\t\treturn nil\n\t}\n\treturn a.Scopes\n}\n\n// GetAddScopes returns the AddScopes slice if it's non-nil, nil otherwise.\nfunc (a *AuthorizationUpdateRequest) GetAddScopes() []string {\n\tif a == nil || a.AddScopes == nil {\n\t\treturn nil\n\t}\n\treturn a.AddScopes\n}\n\n// GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise.\nfunc (a *AuthorizationUpdateRequest) GetFingerprint() string {\n\tif a == nil || a.Fingerprint == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Fingerprint\n}\n\n// GetNote returns the Note field if it's non-nil, zero value otherwise.\nfunc (a *AuthorizationUpdateRequest) GetNote() string {\n\tif a == nil || a.Note == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.Note\n}\n\n// GetNoteURL returns the NoteURL field if it's non-nil, zero value otherwise.\nfunc (a *AuthorizationUpdateRequest) GetNoteURL() string {\n\tif a == nil || a.NoteURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.NoteURL\n}\n\n// GetRemoveScopes returns the RemoveScopes slice if it's non-nil, nil otherwise.\nfunc (a *AuthorizationUpdateRequest) GetRemoveScopes() []string {\n\tif a == nil || a.RemoveScopes == nil {\n\t\treturn nil\n\t}\n\treturn a.RemoveScopes\n}\n\n// GetScopes returns the Scopes slice if it's non-nil, nil otherwise.\nfunc (a *AuthorizationUpdateRequest) GetScopes() []string {\n\tif a == nil || a.Scopes == nil {\n\t\treturn nil\n\t}\n\treturn a.Scopes\n}\n\n// GetFrom returns the From slice if it's non-nil, nil otherwise.\nfunc (a *AuthorizedActorNames) GetFrom() []string {\n\tif a == nil || a.From == nil {\n\t\treturn nil\n\t}\n\treturn a.From\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (a *AuthorizedActorsOnly) GetFrom() bool {\n\tif a == nil || a.From == nil {\n\t\treturn false\n\t}\n\treturn *a.From\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (a *AuthorizedDismissalActorsOnlyChanges) GetFrom() bool {\n\tif a == nil || a.From == nil {\n\t\treturn false\n\t}\n\treturn *a.From\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (a *Autolink) GetID() int64 {\n\tif a == nil || a.ID == nil {\n\t\treturn 0\n\t}\n\treturn *a.ID\n}\n\n// GetIsAlphanumeric returns the IsAlphanumeric field if it's non-nil, zero value otherwise.\nfunc (a *Autolink) GetIsAlphanumeric() bool {\n\tif a == nil || a.IsAlphanumeric == nil {\n\t\treturn false\n\t}\n\treturn *a.IsAlphanumeric\n}\n\n// GetKeyPrefix returns the KeyPrefix field if it's non-nil, zero value otherwise.\nfunc (a *Autolink) GetKeyPrefix() string {\n\tif a == nil || a.KeyPrefix == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.KeyPrefix\n}\n\n// GetURLTemplate returns the URLTemplate field if it's non-nil, zero value otherwise.\nfunc (a *Autolink) GetURLTemplate() string {\n\tif a == nil || a.URLTemplate == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.URLTemplate\n}\n\n// GetIsAlphanumeric returns the IsAlphanumeric field if it's non-nil, zero value otherwise.\nfunc (a *AutolinkOptions) GetIsAlphanumeric() bool {\n\tif a == nil || a.IsAlphanumeric == nil {\n\t\treturn false\n\t}\n\treturn *a.IsAlphanumeric\n}\n\n// GetKeyPrefix returns the KeyPrefix field if it's non-nil, zero value otherwise.\nfunc (a *AutolinkOptions) GetKeyPrefix() string {\n\tif a == nil || a.KeyPrefix == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.KeyPrefix\n}\n\n// GetURLTemplate returns the URLTemplate field if it's non-nil, zero value otherwise.\nfunc (a *AutolinkOptions) GetURLTemplate() string {\n\tif a == nil || a.URLTemplate == nil {\n\t\treturn \"\"\n\t}\n\treturn *a.URLTemplate\n}\n\n// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise.\nfunc (a *AutomatedSecurityFixes) GetEnabled() bool {\n\tif a == nil || a.Enabled == nil {\n\t\treturn false\n\t}\n\treturn *a.Enabled\n}\n\n// GetPaused returns the Paused field if it's non-nil, zero value otherwise.\nfunc (a *AutomatedSecurityFixes) GetPaused() bool {\n\tif a == nil || a.Paused == nil {\n\t\treturn false\n\t}\n\treturn *a.Paused\n}\n\n// GetAppID returns the AppID field if it's non-nil, zero value otherwise.\nfunc (a *AutoTriggerCheck) GetAppID() int64 {\n\tif a == nil || a.AppID == nil {\n\t\treturn 0\n\t}\n\treturn *a.AppID\n}\n\n// GetSetting returns the Setting field if it's non-nil, zero value otherwise.\nfunc (a *AutoTriggerCheck) GetSetting() bool {\n\tif a == nil || a.Setting == nil {\n\t\treturn false\n\t}\n\treturn *a.Setting\n}\n\n// GetContainer returns the Container field.\nfunc (a *AzureBlobConfig) GetContainer() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.Container\n}\n\n// GetEncryptedSASURL returns the EncryptedSASURL field.\nfunc (a *AzureBlobConfig) GetEncryptedSASURL() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.EncryptedSASURL\n}\n\n// GetKeyID returns the KeyID field.\nfunc (a *AzureBlobConfig) GetKeyID() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.KeyID\n}\n\n// GetEncryptedConnstring returns the EncryptedConnstring field.\nfunc (a *AzureHubConfig) GetEncryptedConnstring() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.EncryptedConnstring\n}\n\n// GetKeyID returns the KeyID field.\nfunc (a *AzureHubConfig) GetKeyID() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.KeyID\n}\n\n// GetName returns the Name field.\nfunc (a *AzureHubConfig) GetName() string {\n\tif a == nil {\n\t\treturn \"\"\n\t}\n\treturn a.Name\n}\n\n// GetOTP returns the OTP field.\nfunc (b *BasicAuthTransport) GetOTP() string {\n\tif b == nil {\n\t\treturn \"\"\n\t}\n\treturn b.OTP\n}\n\n// GetPassword returns the Password field.\nfunc (b *BasicAuthTransport) GetPassword() string {\n\tif b == nil {\n\t\treturn \"\"\n\t}\n\treturn b.Password\n}\n\n// GetUsername returns the Username field.\nfunc (b *BasicAuthTransport) GetUsername() string {\n\tif b == nil {\n\t\treturn \"\"\n\t}\n\treturn b.Username\n}\n\n// GetContent returns the Content field if it's non-nil, zero value otherwise.\nfunc (b *Blob) GetContent() string {\n\tif b == nil || b.Content == nil {\n\t\treturn \"\"\n\t}\n\treturn *b.Content\n}\n\n// GetEncoding returns the Encoding field if it's non-nil, zero value otherwise.\nfunc (b *Blob) GetEncoding() string {\n\tif b == nil || b.Encoding == nil {\n\t\treturn \"\"\n\t}\n\treturn *b.Encoding\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (b *Blob) GetNodeID() string {\n\tif b == nil || b.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *b.NodeID\n}\n\n// GetSHA returns the SHA field if it's non-nil, zero value otherwise.\nfunc (b *Blob) GetSHA() string {\n\tif b == nil || b.SHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *b.SHA\n}\n\n// GetSize returns the Size field if it's non-nil, zero value otherwise.\nfunc (b *Blob) GetSize() int {\n\tif b == nil || b.Size == nil {\n\t\treturn 0\n\t}\n\treturn *b.Size\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (b *Blob) GetURL() string {\n\tif b == nil || b.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *b.URL\n}\n\n// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise.\nfunc (b *BlockCreations) GetEnabled() bool {\n\tif b == nil || b.Enabled == nil {\n\t\treturn false\n\t}\n\treturn *b.Enabled\n}\n\n// GetCommit returns the Commit field.\nfunc (b *Branch) GetCommit() *RepositoryCommit {\n\tif b == nil {\n\t\treturn nil\n\t}\n\treturn b.Commit\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (b *Branch) GetName() string {\n\tif b == nil || b.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *b.Name\n}\n\n// GetProtected returns the Protected field if it's non-nil, zero value otherwise.\nfunc (b *Branch) GetProtected() bool {\n\tif b == nil || b.Protected == nil {\n\t\treturn false\n\t}\n\treturn *b.Protected\n}\n\n// GetProtection returns the Protection field.\nfunc (b *Branch) GetProtection() *Protection {\n\tif b == nil {\n\t\treturn nil\n\t}\n\treturn b.Protection\n}\n\n// GetProtectionURL returns the ProtectionURL field if it's non-nil, zero value otherwise.\nfunc (b *Branch) GetProtectionURL() string {\n\tif b == nil || b.ProtectionURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *b.ProtectionURL\n}\n\n// GetCommit returns the Commit field.\nfunc (b *BranchCommit) GetCommit() *Commit {\n\tif b == nil {\n\t\treturn nil\n\t}\n\treturn b.Commit\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (b *BranchCommit) GetName() string {\n\tif b == nil || b.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *b.Name\n}\n\n// GetProtected returns the Protected field if it's non-nil, zero value otherwise.\nfunc (b *BranchCommit) GetProtected() bool {\n\tif b == nil || b.Protected == nil {\n\t\treturn false\n\t}\n\treturn *b.Protected\n}\n\n// GetProtected returns the Protected field if it's non-nil, zero value otherwise.\nfunc (b *BranchListOptions) GetProtected() bool {\n\tif b == nil || b.Protected == nil {\n\t\treturn false\n\t}\n\treturn *b.Protected\n}\n\n// GetCustomBranchPolicies returns the CustomBranchPolicies field if it's non-nil, zero value otherwise.\nfunc (b *BranchPolicy) GetCustomBranchPolicies() bool {\n\tif b == nil || b.CustomBranchPolicies == nil {\n\t\treturn false\n\t}\n\treturn *b.CustomBranchPolicies\n}\n\n// GetProtectedBranches returns the ProtectedBranches field if it's non-nil, zero value otherwise.\nfunc (b *BranchPolicy) GetProtectedBranches() bool {\n\tif b == nil || b.ProtectedBranches == nil {\n\t\treturn false\n\t}\n\treturn *b.ProtectedBranches\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (b *BranchProtectionConfigurationEvent) GetAction() string {\n\tif b == nil || b.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *b.Action\n}\n\n// GetEnterprise returns the Enterprise field.\nfunc (b *BranchProtectionConfigurationEvent) GetEnterprise() *Enterprise {\n\tif b == nil {\n\t\treturn nil\n\t}\n\treturn b.Enterprise\n}\n\n// GetInstallation returns the Installation field.\nfunc (b *BranchProtectionConfigurationEvent) GetInstallation() *Installation {\n\tif b == nil {\n\t\treturn nil\n\t}\n\treturn b.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (b *BranchProtectionConfigurationEvent) GetOrg() *Organization {\n\tif b == nil {\n\t\treturn nil\n\t}\n\treturn b.Org\n}\n\n// GetRepo returns the Repo field.\nfunc (b *BranchProtectionConfigurationEvent) GetRepo() *Repository {\n\tif b == nil {\n\t\treturn nil\n\t}\n\treturn b.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (b *BranchProtectionConfigurationEvent) GetSender() *User {\n\tif b == nil {\n\t\treturn nil\n\t}\n\treturn b.Sender\n}\n\n// GetAdminEnforced returns the AdminEnforced field if it's non-nil, zero value otherwise.\nfunc (b *BranchProtectionRule) GetAdminEnforced() bool {\n\tif b == nil || b.AdminEnforced == nil {\n\t\treturn false\n\t}\n\treturn *b.AdminEnforced\n}\n\n// GetAllowDeletionsEnforcementLevel returns the AllowDeletionsEnforcementLevel field if it's non-nil, zero value otherwise.\nfunc (b *BranchProtectionRule) GetAllowDeletionsEnforcementLevel() string {\n\tif b == nil || b.AllowDeletionsEnforcementLevel == nil {\n\t\treturn \"\"\n\t}\n\treturn *b.AllowDeletionsEnforcementLevel\n}\n\n// GetAllowForcePushesEnforcementLevel returns the AllowForcePushesEnforcementLevel field if it's non-nil, zero value otherwise.\nfunc (b *BranchProtectionRule) GetAllowForcePushesEnforcementLevel() string {\n\tif b == nil || b.AllowForcePushesEnforcementLevel == nil {\n\t\treturn \"\"\n\t}\n\treturn *b.AllowForcePushesEnforcementLevel\n}\n\n// GetAuthorizedActorNames returns the AuthorizedActorNames slice if it's non-nil, nil otherwise.\nfunc (b *BranchProtectionRule) GetAuthorizedActorNames() []string {\n\tif b == nil || b.AuthorizedActorNames == nil {\n\t\treturn nil\n\t}\n\treturn b.AuthorizedActorNames\n}\n\n// GetAuthorizedActorsOnly returns the AuthorizedActorsOnly field if it's non-nil, zero value otherwise.\nfunc (b *BranchProtectionRule) GetAuthorizedActorsOnly() bool {\n\tif b == nil || b.AuthorizedActorsOnly == nil {\n\t\treturn false\n\t}\n\treturn *b.AuthorizedActorsOnly\n}\n\n// GetAuthorizedDismissalActorsOnly returns the AuthorizedDismissalActorsOnly field if it's non-nil, zero value otherwise.\nfunc (b *BranchProtectionRule) GetAuthorizedDismissalActorsOnly() bool {\n\tif b == nil || b.AuthorizedDismissalActorsOnly == nil {\n\t\treturn false\n\t}\n\treturn *b.AuthorizedDismissalActorsOnly\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (b *BranchProtectionRule) GetCreatedAt() Timestamp {\n\tif b == nil || b.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *b.CreatedAt\n}\n\n// GetDismissStaleReviewsOnPush returns the DismissStaleReviewsOnPush field if it's non-nil, zero value otherwise.\nfunc (b *BranchProtectionRule) GetDismissStaleReviewsOnPush() bool {\n\tif b == nil || b.DismissStaleReviewsOnPush == nil {\n\t\treturn false\n\t}\n\treturn *b.DismissStaleReviewsOnPush\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (b *BranchProtectionRule) GetID() int64 {\n\tif b == nil || b.ID == nil {\n\t\treturn 0\n\t}\n\treturn *b.ID\n}\n\n// GetIgnoreApprovalsFromContributors returns the IgnoreApprovalsFromContributors field if it's non-nil, zero value otherwise.\nfunc (b *BranchProtectionRule) GetIgnoreApprovalsFromContributors() bool {\n\tif b == nil || b.IgnoreApprovalsFromContributors == nil {\n\t\treturn false\n\t}\n\treturn *b.IgnoreApprovalsFromContributors\n}\n\n// GetLinearHistoryRequirementEnforcementLevel returns the LinearHistoryRequirementEnforcementLevel field if it's non-nil, zero value otherwise.\nfunc (b *BranchProtectionRule) GetLinearHistoryRequirementEnforcementLevel() string {\n\tif b == nil || b.LinearHistoryRequirementEnforcementLevel == nil {\n\t\treturn \"\"\n\t}\n\treturn *b.LinearHistoryRequirementEnforcementLevel\n}\n\n// GetMergeQueueEnforcementLevel returns the MergeQueueEnforcementLevel field if it's non-nil, zero value otherwise.\nfunc (b *BranchProtectionRule) GetMergeQueueEnforcementLevel() string {\n\tif b == nil || b.MergeQueueEnforcementLevel == nil {\n\t\treturn \"\"\n\t}\n\treturn *b.MergeQueueEnforcementLevel\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (b *BranchProtectionRule) GetName() string {\n\tif b == nil || b.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *b.Name\n}\n\n// GetPullRequestReviewsEnforcementLevel returns the PullRequestReviewsEnforcementLevel field if it's non-nil, zero value otherwise.\nfunc (b *BranchProtectionRule) GetPullRequestReviewsEnforcementLevel() string {\n\tif b == nil || b.PullRequestReviewsEnforcementLevel == nil {\n\t\treturn \"\"\n\t}\n\treturn *b.PullRequestReviewsEnforcementLevel\n}\n\n// GetRepositoryID returns the RepositoryID field if it's non-nil, zero value otherwise.\nfunc (b *BranchProtectionRule) GetRepositoryID() int64 {\n\tif b == nil || b.RepositoryID == nil {\n\t\treturn 0\n\t}\n\treturn *b.RepositoryID\n}\n\n// GetRequireCodeOwnerReview returns the RequireCodeOwnerReview field if it's non-nil, zero value otherwise.\nfunc (b *BranchProtectionRule) GetRequireCodeOwnerReview() bool {\n\tif b == nil || b.RequireCodeOwnerReview == nil {\n\t\treturn false\n\t}\n\treturn *b.RequireCodeOwnerReview\n}\n\n// GetRequiredApprovingReviewCount returns the RequiredApprovingReviewCount field if it's non-nil, zero value otherwise.\nfunc (b *BranchProtectionRule) GetRequiredApprovingReviewCount() int {\n\tif b == nil || b.RequiredApprovingReviewCount == nil {\n\t\treturn 0\n\t}\n\treturn *b.RequiredApprovingReviewCount\n}\n\n// GetRequiredConversationResolutionLevel returns the RequiredConversationResolutionLevel field if it's non-nil, zero value otherwise.\nfunc (b *BranchProtectionRule) GetRequiredConversationResolutionLevel() string {\n\tif b == nil || b.RequiredConversationResolutionLevel == nil {\n\t\treturn \"\"\n\t}\n\treturn *b.RequiredConversationResolutionLevel\n}\n\n// GetRequiredDeploymentsEnforcementLevel returns the RequiredDeploymentsEnforcementLevel field if it's non-nil, zero value otherwise.\nfunc (b *BranchProtectionRule) GetRequiredDeploymentsEnforcementLevel() string {\n\tif b == nil || b.RequiredDeploymentsEnforcementLevel == nil {\n\t\treturn \"\"\n\t}\n\treturn *b.RequiredDeploymentsEnforcementLevel\n}\n\n// GetRequiredStatusChecks returns the RequiredStatusChecks slice if it's non-nil, nil otherwise.\nfunc (b *BranchProtectionRule) GetRequiredStatusChecks() []string {\n\tif b == nil || b.RequiredStatusChecks == nil {\n\t\treturn nil\n\t}\n\treturn b.RequiredStatusChecks\n}\n\n// GetRequiredStatusChecksEnforcementLevel returns the RequiredStatusChecksEnforcementLevel field if it's non-nil, zero value otherwise.\nfunc (b *BranchProtectionRule) GetRequiredStatusChecksEnforcementLevel() string {\n\tif b == nil || b.RequiredStatusChecksEnforcementLevel == nil {\n\t\treturn \"\"\n\t}\n\treturn *b.RequiredStatusChecksEnforcementLevel\n}\n\n// GetRequireLastPushApproval returns the RequireLastPushApproval field if it's non-nil, zero value otherwise.\nfunc (b *BranchProtectionRule) GetRequireLastPushApproval() bool {\n\tif b == nil || b.RequireLastPushApproval == nil {\n\t\treturn false\n\t}\n\treturn *b.RequireLastPushApproval\n}\n\n// GetSignatureRequirementEnforcementLevel returns the SignatureRequirementEnforcementLevel field if it's non-nil, zero value otherwise.\nfunc (b *BranchProtectionRule) GetSignatureRequirementEnforcementLevel() string {\n\tif b == nil || b.SignatureRequirementEnforcementLevel == nil {\n\t\treturn \"\"\n\t}\n\treturn *b.SignatureRequirementEnforcementLevel\n}\n\n// GetStrictRequiredStatusChecksPolicy returns the StrictRequiredStatusChecksPolicy field if it's non-nil, zero value otherwise.\nfunc (b *BranchProtectionRule) GetStrictRequiredStatusChecksPolicy() bool {\n\tif b == nil || b.StrictRequiredStatusChecksPolicy == nil {\n\t\treturn false\n\t}\n\treturn *b.StrictRequiredStatusChecksPolicy\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (b *BranchProtectionRule) GetUpdatedAt() Timestamp {\n\tif b == nil || b.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *b.UpdatedAt\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (b *BranchProtectionRuleEvent) GetAction() string {\n\tif b == nil || b.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *b.Action\n}\n\n// GetChanges returns the Changes field.\nfunc (b *BranchProtectionRuleEvent) GetChanges() *ProtectionChanges {\n\tif b == nil {\n\t\treturn nil\n\t}\n\treturn b.Changes\n}\n\n// GetInstallation returns the Installation field.\nfunc (b *BranchProtectionRuleEvent) GetInstallation() *Installation {\n\tif b == nil {\n\t\treturn nil\n\t}\n\treturn b.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (b *BranchProtectionRuleEvent) GetOrg() *Organization {\n\tif b == nil {\n\t\treturn nil\n\t}\n\treturn b.Org\n}\n\n// GetRepo returns the Repo field.\nfunc (b *BranchProtectionRuleEvent) GetRepo() *Repository {\n\tif b == nil {\n\t\treturn nil\n\t}\n\treturn b.Repo\n}\n\n// GetRule returns the Rule field.\nfunc (b *BranchProtectionRuleEvent) GetRule() *BranchProtectionRule {\n\tif b == nil {\n\t\treturn nil\n\t}\n\treturn b.Rule\n}\n\n// GetSender returns the Sender field.\nfunc (b *BranchProtectionRuleEvent) GetSender() *User {\n\tif b == nil {\n\t\treturn nil\n\t}\n\treturn b.Sender\n}\n\n// GetApps returns the Apps slice if it's non-nil, nil otherwise.\nfunc (b *BranchRestrictions) GetApps() []*App {\n\tif b == nil || b.Apps == nil {\n\t\treturn nil\n\t}\n\treturn b.Apps\n}\n\n// GetTeams returns the Teams slice if it's non-nil, nil otherwise.\nfunc (b *BranchRestrictions) GetTeams() []*Team {\n\tif b == nil || b.Teams == nil {\n\t\treturn nil\n\t}\n\treturn b.Teams\n}\n\n// GetUsers returns the Users slice if it's non-nil, nil otherwise.\nfunc (b *BranchRestrictions) GetUsers() []*User {\n\tif b == nil || b.Users == nil {\n\t\treturn nil\n\t}\n\treturn b.Users\n}\n\n// GetApps returns the Apps slice if it's non-nil, nil otherwise.\nfunc (b *BranchRestrictionsRequest) GetApps() []string {\n\tif b == nil || b.Apps == nil {\n\t\treturn nil\n\t}\n\treturn b.Apps\n}\n\n// GetTeams returns the Teams slice if it's non-nil, nil otherwise.\nfunc (b *BranchRestrictionsRequest) GetTeams() []string {\n\tif b == nil || b.Teams == nil {\n\t\treturn nil\n\t}\n\treturn b.Teams\n}\n\n// GetUsers returns the Users slice if it's non-nil, nil otherwise.\nfunc (b *BranchRestrictionsRequest) GetUsers() []string {\n\tif b == nil || b.Users == nil {\n\t\treturn nil\n\t}\n\treturn b.Users\n}\n\n// GetRulesetID returns the RulesetID field.\nfunc (b *BranchRuleMetadata) GetRulesetID() int64 {\n\tif b == nil {\n\t\treturn 0\n\t}\n\treturn b.RulesetID\n}\n\n// GetRulesetSource returns the RulesetSource field.\nfunc (b *BranchRuleMetadata) GetRulesetSource() string {\n\tif b == nil {\n\t\treturn \"\"\n\t}\n\treturn b.RulesetSource\n}\n\n// GetRulesetSourceType returns the RulesetSourceType field.\nfunc (b *BranchRuleMetadata) GetRulesetSourceType() RulesetSourceType {\n\tif b == nil {\n\t\treturn \"\"\n\t}\n\treturn b.RulesetSourceType\n}\n\n// GetBranchNamePattern returns the BranchNamePattern slice if it's non-nil, nil otherwise.\nfunc (b *BranchRules) GetBranchNamePattern() []*PatternBranchRule {\n\tif b == nil || b.BranchNamePattern == nil {\n\t\treturn nil\n\t}\n\treturn b.BranchNamePattern\n}\n\n// GetCodeScanning returns the CodeScanning slice if it's non-nil, nil otherwise.\nfunc (b *BranchRules) GetCodeScanning() []*CodeScanningBranchRule {\n\tif b == nil || b.CodeScanning == nil {\n\t\treturn nil\n\t}\n\treturn b.CodeScanning\n}\n\n// GetCommitAuthorEmailPattern returns the CommitAuthorEmailPattern slice if it's non-nil, nil otherwise.\nfunc (b *BranchRules) GetCommitAuthorEmailPattern() []*PatternBranchRule {\n\tif b == nil || b.CommitAuthorEmailPattern == nil {\n\t\treturn nil\n\t}\n\treturn b.CommitAuthorEmailPattern\n}\n\n// GetCommitMessagePattern returns the CommitMessagePattern slice if it's non-nil, nil otherwise.\nfunc (b *BranchRules) GetCommitMessagePattern() []*PatternBranchRule {\n\tif b == nil || b.CommitMessagePattern == nil {\n\t\treturn nil\n\t}\n\treturn b.CommitMessagePattern\n}\n\n// GetCommitterEmailPattern returns the CommitterEmailPattern slice if it's non-nil, nil otherwise.\nfunc (b *BranchRules) GetCommitterEmailPattern() []*PatternBranchRule {\n\tif b == nil || b.CommitterEmailPattern == nil {\n\t\treturn nil\n\t}\n\treturn b.CommitterEmailPattern\n}\n\n// GetCopilotCodeReview returns the CopilotCodeReview slice if it's non-nil, nil otherwise.\nfunc (b *BranchRules) GetCopilotCodeReview() []*CopilotCodeReviewBranchRule {\n\tif b == nil || b.CopilotCodeReview == nil {\n\t\treturn nil\n\t}\n\treturn b.CopilotCodeReview\n}\n\n// GetCreation returns the Creation slice if it's non-nil, nil otherwise.\nfunc (b *BranchRules) GetCreation() []*BranchRuleMetadata {\n\tif b == nil || b.Creation == nil {\n\t\treturn nil\n\t}\n\treturn b.Creation\n}\n\n// GetDeletion returns the Deletion slice if it's non-nil, nil otherwise.\nfunc (b *BranchRules) GetDeletion() []*BranchRuleMetadata {\n\tif b == nil || b.Deletion == nil {\n\t\treturn nil\n\t}\n\treturn b.Deletion\n}\n\n// GetFileExtensionRestriction returns the FileExtensionRestriction slice if it's non-nil, nil otherwise.\nfunc (b *BranchRules) GetFileExtensionRestriction() []*FileExtensionRestrictionBranchRule {\n\tif b == nil || b.FileExtensionRestriction == nil {\n\t\treturn nil\n\t}\n\treturn b.FileExtensionRestriction\n}\n\n// GetFilePathRestriction returns the FilePathRestriction slice if it's non-nil, nil otherwise.\nfunc (b *BranchRules) GetFilePathRestriction() []*FilePathRestrictionBranchRule {\n\tif b == nil || b.FilePathRestriction == nil {\n\t\treturn nil\n\t}\n\treturn b.FilePathRestriction\n}\n\n// GetMaxFilePathLength returns the MaxFilePathLength slice if it's non-nil, nil otherwise.\nfunc (b *BranchRules) GetMaxFilePathLength() []*MaxFilePathLengthBranchRule {\n\tif b == nil || b.MaxFilePathLength == nil {\n\t\treturn nil\n\t}\n\treturn b.MaxFilePathLength\n}\n\n// GetMaxFileSize returns the MaxFileSize slice if it's non-nil, nil otherwise.\nfunc (b *BranchRules) GetMaxFileSize() []*MaxFileSizeBranchRule {\n\tif b == nil || b.MaxFileSize == nil {\n\t\treturn nil\n\t}\n\treturn b.MaxFileSize\n}\n\n// GetMergeQueue returns the MergeQueue slice if it's non-nil, nil otherwise.\nfunc (b *BranchRules) GetMergeQueue() []*MergeQueueBranchRule {\n\tif b == nil || b.MergeQueue == nil {\n\t\treturn nil\n\t}\n\treturn b.MergeQueue\n}\n\n// GetNonFastForward returns the NonFastForward slice if it's non-nil, nil otherwise.\nfunc (b *BranchRules) GetNonFastForward() []*BranchRuleMetadata {\n\tif b == nil || b.NonFastForward == nil {\n\t\treturn nil\n\t}\n\treturn b.NonFastForward\n}\n\n// GetPullRequest returns the PullRequest slice if it's non-nil, nil otherwise.\nfunc (b *BranchRules) GetPullRequest() []*PullRequestBranchRule {\n\tif b == nil || b.PullRequest == nil {\n\t\treturn nil\n\t}\n\treturn b.PullRequest\n}\n\n// GetRequiredDeployments returns the RequiredDeployments slice if it's non-nil, nil otherwise.\nfunc (b *BranchRules) GetRequiredDeployments() []*RequiredDeploymentsBranchRule {\n\tif b == nil || b.RequiredDeployments == nil {\n\t\treturn nil\n\t}\n\treturn b.RequiredDeployments\n}\n\n// GetRequiredLinearHistory returns the RequiredLinearHistory slice if it's non-nil, nil otherwise.\nfunc (b *BranchRules) GetRequiredLinearHistory() []*BranchRuleMetadata {\n\tif b == nil || b.RequiredLinearHistory == nil {\n\t\treturn nil\n\t}\n\treturn b.RequiredLinearHistory\n}\n\n// GetRequiredSignatures returns the RequiredSignatures slice if it's non-nil, nil otherwise.\nfunc (b *BranchRules) GetRequiredSignatures() []*BranchRuleMetadata {\n\tif b == nil || b.RequiredSignatures == nil {\n\t\treturn nil\n\t}\n\treturn b.RequiredSignatures\n}\n\n// GetRequiredStatusChecks returns the RequiredStatusChecks slice if it's non-nil, nil otherwise.\nfunc (b *BranchRules) GetRequiredStatusChecks() []*RequiredStatusChecksBranchRule {\n\tif b == nil || b.RequiredStatusChecks == nil {\n\t\treturn nil\n\t}\n\treturn b.RequiredStatusChecks\n}\n\n// GetTagNamePattern returns the TagNamePattern slice if it's non-nil, nil otherwise.\nfunc (b *BranchRules) GetTagNamePattern() []*PatternBranchRule {\n\tif b == nil || b.TagNamePattern == nil {\n\t\treturn nil\n\t}\n\treturn b.TagNamePattern\n}\n\n// GetUpdate returns the Update slice if it's non-nil, nil otherwise.\nfunc (b *BranchRules) GetUpdate() []*UpdateBranchRule {\n\tif b == nil || b.Update == nil {\n\t\treturn nil\n\t}\n\treturn b.Update\n}\n\n// GetWorkflows returns the Workflows slice if it's non-nil, nil otherwise.\nfunc (b *BranchRules) GetWorkflows() []*WorkflowsBranchRule {\n\tif b == nil || b.Workflows == nil {\n\t\treturn nil\n\t}\n\treturn b.Workflows\n}\n\n// GetActorID returns the ActorID field if it's non-nil, zero value otherwise.\nfunc (b *BypassActor) GetActorID() int64 {\n\tif b == nil || b.ActorID == nil {\n\t\treturn 0\n\t}\n\treturn *b.ActorID\n}\n\n// GetActorType returns the ActorType field.\nfunc (b *BypassActor) GetActorType() *BypassActorType {\n\tif b == nil {\n\t\treturn nil\n\t}\n\treturn b.ActorType\n}\n\n// GetBypassMode returns the BypassMode field.\nfunc (b *BypassActor) GetBypassMode() *BypassMode {\n\tif b == nil {\n\t\treturn nil\n\t}\n\treturn b.BypassMode\n}\n\n// GetApps returns the Apps slice if it's non-nil, nil otherwise.\nfunc (b *BypassPullRequestAllowances) GetApps() []*App {\n\tif b == nil || b.Apps == nil {\n\t\treturn nil\n\t}\n\treturn b.Apps\n}\n\n// GetTeams returns the Teams slice if it's non-nil, nil otherwise.\nfunc (b *BypassPullRequestAllowances) GetTeams() []*Team {\n\tif b == nil || b.Teams == nil {\n\t\treturn nil\n\t}\n\treturn b.Teams\n}\n\n// GetUsers returns the Users slice if it's non-nil, nil otherwise.\nfunc (b *BypassPullRequestAllowances) GetUsers() []*User {\n\tif b == nil || b.Users == nil {\n\t\treturn nil\n\t}\n\treturn b.Users\n}\n\n// GetApps returns the Apps slice if it's non-nil, nil otherwise.\nfunc (b *BypassPullRequestAllowancesRequest) GetApps() []string {\n\tif b == nil || b.Apps == nil {\n\t\treturn nil\n\t}\n\treturn b.Apps\n}\n\n// GetTeams returns the Teams slice if it's non-nil, nil otherwise.\nfunc (b *BypassPullRequestAllowancesRequest) GetTeams() []string {\n\tif b == nil || b.Teams == nil {\n\t\treturn nil\n\t}\n\treturn b.Teams\n}\n\n// GetUsers returns the Users slice if it's non-nil, nil otherwise.\nfunc (b *BypassPullRequestAllowancesRequest) GetUsers() []string {\n\tif b == nil || b.Users == nil {\n\t\treturn nil\n\t}\n\treturn b.Users\n}\n\n// GetReviewerID returns the ReviewerID field.\nfunc (b *BypassReviewer) GetReviewerID() int64 {\n\tif b == nil {\n\t\treturn 0\n\t}\n\treturn b.ReviewerID\n}\n\n// GetReviewerType returns the ReviewerType field.\nfunc (b *BypassReviewer) GetReviewerType() string {\n\tif b == nil {\n\t\treturn \"\"\n\t}\n\treturn b.ReviewerType\n}\n\n// GetSecurityConfigurationID returns the SecurityConfigurationID field if it's non-nil, zero value otherwise.\nfunc (b *BypassReviewer) GetSecurityConfigurationID() int64 {\n\tif b == nil || b.SecurityConfigurationID == nil {\n\t\treturn 0\n\t}\n\treturn *b.SecurityConfigurationID\n}\n\n// GetApp returns the App field.\nfunc (c *CheckRun) GetApp() *App {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.App\n}\n\n// GetCheckSuite returns the CheckSuite field.\nfunc (c *CheckRun) GetCheckSuite() *CheckSuite {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.CheckSuite\n}\n\n// GetCompletedAt returns the CompletedAt field if it's non-nil, zero value otherwise.\nfunc (c *CheckRun) GetCompletedAt() Timestamp {\n\tif c == nil || c.CompletedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.CompletedAt\n}\n\n// GetConclusion returns the Conclusion field if it's non-nil, zero value otherwise.\nfunc (c *CheckRun) GetConclusion() string {\n\tif c == nil || c.Conclusion == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Conclusion\n}\n\n// GetDetailsURL returns the DetailsURL field if it's non-nil, zero value otherwise.\nfunc (c *CheckRun) GetDetailsURL() string {\n\tif c == nil || c.DetailsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.DetailsURL\n}\n\n// GetExternalID returns the ExternalID field if it's non-nil, zero value otherwise.\nfunc (c *CheckRun) GetExternalID() string {\n\tif c == nil || c.ExternalID == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.ExternalID\n}\n\n// GetHeadSHA returns the HeadSHA field if it's non-nil, zero value otherwise.\nfunc (c *CheckRun) GetHeadSHA() string {\n\tif c == nil || c.HeadSHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.HeadSHA\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (c *CheckRun) GetHTMLURL() string {\n\tif c == nil || c.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (c *CheckRun) GetID() int64 {\n\tif c == nil || c.ID == nil {\n\t\treturn 0\n\t}\n\treturn *c.ID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (c *CheckRun) GetName() string {\n\tif c == nil || c.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Name\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (c *CheckRun) GetNodeID() string {\n\tif c == nil || c.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.NodeID\n}\n\n// GetOutput returns the Output field.\nfunc (c *CheckRun) GetOutput() *CheckRunOutput {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Output\n}\n\n// GetPullRequests returns the PullRequests slice if it's non-nil, nil otherwise.\nfunc (c *CheckRun) GetPullRequests() []*PullRequest {\n\tif c == nil || c.PullRequests == nil {\n\t\treturn nil\n\t}\n\treturn c.PullRequests\n}\n\n// GetStartedAt returns the StartedAt field if it's non-nil, zero value otherwise.\nfunc (c *CheckRun) GetStartedAt() Timestamp {\n\tif c == nil || c.StartedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.StartedAt\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (c *CheckRun) GetStatus() string {\n\tif c == nil || c.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Status\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (c *CheckRun) GetURL() string {\n\tif c == nil || c.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.URL\n}\n\n// GetDescription returns the Description field.\nfunc (c *CheckRunAction) GetDescription() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Description\n}\n\n// GetIdentifier returns the Identifier field.\nfunc (c *CheckRunAction) GetIdentifier() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Identifier\n}\n\n// GetLabel returns the Label field.\nfunc (c *CheckRunAction) GetLabel() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Label\n}\n\n// GetAnnotationLevel returns the AnnotationLevel field if it's non-nil, zero value otherwise.\nfunc (c *CheckRunAnnotation) GetAnnotationLevel() string {\n\tif c == nil || c.AnnotationLevel == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.AnnotationLevel\n}\n\n// GetEndColumn returns the EndColumn field if it's non-nil, zero value otherwise.\nfunc (c *CheckRunAnnotation) GetEndColumn() int {\n\tif c == nil || c.EndColumn == nil {\n\t\treturn 0\n\t}\n\treturn *c.EndColumn\n}\n\n// GetEndLine returns the EndLine field if it's non-nil, zero value otherwise.\nfunc (c *CheckRunAnnotation) GetEndLine() int {\n\tif c == nil || c.EndLine == nil {\n\t\treturn 0\n\t}\n\treturn *c.EndLine\n}\n\n// GetMessage returns the Message field if it's non-nil, zero value otherwise.\nfunc (c *CheckRunAnnotation) GetMessage() string {\n\tif c == nil || c.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Message\n}\n\n// GetPath returns the Path field if it's non-nil, zero value otherwise.\nfunc (c *CheckRunAnnotation) GetPath() string {\n\tif c == nil || c.Path == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Path\n}\n\n// GetRawDetails returns the RawDetails field if it's non-nil, zero value otherwise.\nfunc (c *CheckRunAnnotation) GetRawDetails() string {\n\tif c == nil || c.RawDetails == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.RawDetails\n}\n\n// GetStartColumn returns the StartColumn field if it's non-nil, zero value otherwise.\nfunc (c *CheckRunAnnotation) GetStartColumn() int {\n\tif c == nil || c.StartColumn == nil {\n\t\treturn 0\n\t}\n\treturn *c.StartColumn\n}\n\n// GetStartLine returns the StartLine field if it's non-nil, zero value otherwise.\nfunc (c *CheckRunAnnotation) GetStartLine() int {\n\tif c == nil || c.StartLine == nil {\n\t\treturn 0\n\t}\n\treturn *c.StartLine\n}\n\n// GetTitle returns the Title field if it's non-nil, zero value otherwise.\nfunc (c *CheckRunAnnotation) GetTitle() string {\n\tif c == nil || c.Title == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Title\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (c *CheckRunEvent) GetAction() string {\n\tif c == nil || c.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Action\n}\n\n// GetCheckRun returns the CheckRun field.\nfunc (c *CheckRunEvent) GetCheckRun() *CheckRun {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.CheckRun\n}\n\n// GetInstallation returns the Installation field.\nfunc (c *CheckRunEvent) GetInstallation() *Installation {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (c *CheckRunEvent) GetOrg() *Organization {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Org\n}\n\n// GetRepo returns the Repo field.\nfunc (c *CheckRunEvent) GetRepo() *Repository {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Repo\n}\n\n// GetRequestedAction returns the RequestedAction field.\nfunc (c *CheckRunEvent) GetRequestedAction() *RequestedAction {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.RequestedAction\n}\n\n// GetSender returns the Sender field.\nfunc (c *CheckRunEvent) GetSender() *User {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Sender\n}\n\n// GetAlt returns the Alt field if it's non-nil, zero value otherwise.\nfunc (c *CheckRunImage) GetAlt() string {\n\tif c == nil || c.Alt == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Alt\n}\n\n// GetCaption returns the Caption field if it's non-nil, zero value otherwise.\nfunc (c *CheckRunImage) GetCaption() string {\n\tif c == nil || c.Caption == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Caption\n}\n\n// GetImageURL returns the ImageURL field if it's non-nil, zero value otherwise.\nfunc (c *CheckRunImage) GetImageURL() string {\n\tif c == nil || c.ImageURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.ImageURL\n}\n\n// GetAnnotations returns the Annotations slice if it's non-nil, nil otherwise.\nfunc (c *CheckRunOutput) GetAnnotations() []*CheckRunAnnotation {\n\tif c == nil || c.Annotations == nil {\n\t\treturn nil\n\t}\n\treturn c.Annotations\n}\n\n// GetAnnotationsCount returns the AnnotationsCount field if it's non-nil, zero value otherwise.\nfunc (c *CheckRunOutput) GetAnnotationsCount() int {\n\tif c == nil || c.AnnotationsCount == nil {\n\t\treturn 0\n\t}\n\treturn *c.AnnotationsCount\n}\n\n// GetAnnotationsURL returns the AnnotationsURL field if it's non-nil, zero value otherwise.\nfunc (c *CheckRunOutput) GetAnnotationsURL() string {\n\tif c == nil || c.AnnotationsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.AnnotationsURL\n}\n\n// GetImages returns the Images slice if it's non-nil, nil otherwise.\nfunc (c *CheckRunOutput) GetImages() []*CheckRunImage {\n\tif c == nil || c.Images == nil {\n\t\treturn nil\n\t}\n\treturn c.Images\n}\n\n// GetSummary returns the Summary field if it's non-nil, zero value otherwise.\nfunc (c *CheckRunOutput) GetSummary() string {\n\tif c == nil || c.Summary == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Summary\n}\n\n// GetText returns the Text field if it's non-nil, zero value otherwise.\nfunc (c *CheckRunOutput) GetText() string {\n\tif c == nil || c.Text == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Text\n}\n\n// GetTitle returns the Title field if it's non-nil, zero value otherwise.\nfunc (c *CheckRunOutput) GetTitle() string {\n\tif c == nil || c.Title == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Title\n}\n\n// GetAfterSHA returns the AfterSHA field if it's non-nil, zero value otherwise.\nfunc (c *CheckSuite) GetAfterSHA() string {\n\tif c == nil || c.AfterSHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.AfterSHA\n}\n\n// GetApp returns the App field.\nfunc (c *CheckSuite) GetApp() *App {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.App\n}\n\n// GetBeforeSHA returns the BeforeSHA field if it's non-nil, zero value otherwise.\nfunc (c *CheckSuite) GetBeforeSHA() string {\n\tif c == nil || c.BeforeSHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.BeforeSHA\n}\n\n// GetConclusion returns the Conclusion field if it's non-nil, zero value otherwise.\nfunc (c *CheckSuite) GetConclusion() string {\n\tif c == nil || c.Conclusion == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Conclusion\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (c *CheckSuite) GetCreatedAt() Timestamp {\n\tif c == nil || c.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.CreatedAt\n}\n\n// GetHeadBranch returns the HeadBranch field if it's non-nil, zero value otherwise.\nfunc (c *CheckSuite) GetHeadBranch() string {\n\tif c == nil || c.HeadBranch == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.HeadBranch\n}\n\n// GetHeadCommit returns the HeadCommit field.\nfunc (c *CheckSuite) GetHeadCommit() *Commit {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.HeadCommit\n}\n\n// GetHeadSHA returns the HeadSHA field if it's non-nil, zero value otherwise.\nfunc (c *CheckSuite) GetHeadSHA() string {\n\tif c == nil || c.HeadSHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.HeadSHA\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (c *CheckSuite) GetID() int64 {\n\tif c == nil || c.ID == nil {\n\t\treturn 0\n\t}\n\treturn *c.ID\n}\n\n// GetLatestCheckRunsCount returns the LatestCheckRunsCount field if it's non-nil, zero value otherwise.\nfunc (c *CheckSuite) GetLatestCheckRunsCount() int64 {\n\tif c == nil || c.LatestCheckRunsCount == nil {\n\t\treturn 0\n\t}\n\treturn *c.LatestCheckRunsCount\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (c *CheckSuite) GetNodeID() string {\n\tif c == nil || c.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.NodeID\n}\n\n// GetPullRequests returns the PullRequests slice if it's non-nil, nil otherwise.\nfunc (c *CheckSuite) GetPullRequests() []*PullRequest {\n\tif c == nil || c.PullRequests == nil {\n\t\treturn nil\n\t}\n\treturn c.PullRequests\n}\n\n// GetRepository returns the Repository field.\nfunc (c *CheckSuite) GetRepository() *Repository {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Repository\n}\n\n// GetRerequestable returns the Rerequestable field if it's non-nil, zero value otherwise.\nfunc (c *CheckSuite) GetRerequestable() bool {\n\tif c == nil || c.Rerequestable == nil {\n\t\treturn false\n\t}\n\treturn *c.Rerequestable\n}\n\n// GetRunsRerequestable returns the RunsRerequestable field if it's non-nil, zero value otherwise.\nfunc (c *CheckSuite) GetRunsRerequestable() bool {\n\tif c == nil || c.RunsRerequestable == nil {\n\t\treturn false\n\t}\n\treturn *c.RunsRerequestable\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (c *CheckSuite) GetStatus() string {\n\tif c == nil || c.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Status\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (c *CheckSuite) GetUpdatedAt() Timestamp {\n\tif c == nil || c.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (c *CheckSuite) GetURL() string {\n\tif c == nil || c.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.URL\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (c *CheckSuiteEvent) GetAction() string {\n\tif c == nil || c.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Action\n}\n\n// GetCheckSuite returns the CheckSuite field.\nfunc (c *CheckSuiteEvent) GetCheckSuite() *CheckSuite {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.CheckSuite\n}\n\n// GetInstallation returns the Installation field.\nfunc (c *CheckSuiteEvent) GetInstallation() *Installation {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (c *CheckSuiteEvent) GetOrg() *Organization {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Org\n}\n\n// GetRepo returns the Repo field.\nfunc (c *CheckSuiteEvent) GetRepo() *Repository {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (c *CheckSuiteEvent) GetSender() *User {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Sender\n}\n\n// GetAutoTriggerChecks returns the AutoTriggerChecks slice if it's non-nil, nil otherwise.\nfunc (c *CheckSuitePreferenceOptions) GetAutoTriggerChecks() []*AutoTriggerCheck {\n\tif c == nil || c.AutoTriggerChecks == nil {\n\t\treturn nil\n\t}\n\treturn c.AutoTriggerChecks\n}\n\n// GetPreferences returns the Preferences field.\nfunc (c *CheckSuitePreferenceResults) GetPreferences() *PreferenceList {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Preferences\n}\n\n// GetRepository returns the Repository field.\nfunc (c *CheckSuitePreferenceResults) GetRepository() *Repository {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Repository\n}\n\n// GetArchived returns the Archived field if it's non-nil, zero value otherwise.\nfunc (c *Classroom) GetArchived() bool {\n\tif c == nil || c.Archived == nil {\n\t\treturn false\n\t}\n\treturn *c.Archived\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (c *Classroom) GetID() int64 {\n\tif c == nil || c.ID == nil {\n\t\treturn 0\n\t}\n\treturn *c.ID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (c *Classroom) GetName() string {\n\tif c == nil || c.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Name\n}\n\n// GetOrganization returns the Organization field.\nfunc (c *Classroom) GetOrganization() *Organization {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Organization\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (c *Classroom) GetURL() string {\n\tif c == nil || c.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.URL\n}\n\n// GetAccepted returns the Accepted field if it's non-nil, zero value otherwise.\nfunc (c *ClassroomAssignment) GetAccepted() int {\n\tif c == nil || c.Accepted == nil {\n\t\treturn 0\n\t}\n\treturn *c.Accepted\n}\n\n// GetClassroom returns the Classroom field.\nfunc (c *ClassroomAssignment) GetClassroom() *Classroom {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Classroom\n}\n\n// GetDeadline returns the Deadline field if it's non-nil, zero value otherwise.\nfunc (c *ClassroomAssignment) GetDeadline() Timestamp {\n\tif c == nil || c.Deadline == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.Deadline\n}\n\n// GetEditor returns the Editor field if it's non-nil, zero value otherwise.\nfunc (c *ClassroomAssignment) GetEditor() string {\n\tif c == nil || c.Editor == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Editor\n}\n\n// GetFeedbackPullRequestsEnabled returns the FeedbackPullRequestsEnabled field if it's non-nil, zero value otherwise.\nfunc (c *ClassroomAssignment) GetFeedbackPullRequestsEnabled() bool {\n\tif c == nil || c.FeedbackPullRequestsEnabled == nil {\n\t\treturn false\n\t}\n\treturn *c.FeedbackPullRequestsEnabled\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (c *ClassroomAssignment) GetID() int64 {\n\tif c == nil || c.ID == nil {\n\t\treturn 0\n\t}\n\treturn *c.ID\n}\n\n// GetInvitationsEnabled returns the InvitationsEnabled field if it's non-nil, zero value otherwise.\nfunc (c *ClassroomAssignment) GetInvitationsEnabled() bool {\n\tif c == nil || c.InvitationsEnabled == nil {\n\t\treturn false\n\t}\n\treturn *c.InvitationsEnabled\n}\n\n// GetInviteLink returns the InviteLink field if it's non-nil, zero value otherwise.\nfunc (c *ClassroomAssignment) GetInviteLink() string {\n\tif c == nil || c.InviteLink == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.InviteLink\n}\n\n// GetLanguage returns the Language field if it's non-nil, zero value otherwise.\nfunc (c *ClassroomAssignment) GetLanguage() string {\n\tif c == nil || c.Language == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Language\n}\n\n// GetMaxMembers returns the MaxMembers field if it's non-nil, zero value otherwise.\nfunc (c *ClassroomAssignment) GetMaxMembers() int {\n\tif c == nil || c.MaxMembers == nil {\n\t\treturn 0\n\t}\n\treturn *c.MaxMembers\n}\n\n// GetMaxTeams returns the MaxTeams field if it's non-nil, zero value otherwise.\nfunc (c *ClassroomAssignment) GetMaxTeams() int {\n\tif c == nil || c.MaxTeams == nil {\n\t\treturn 0\n\t}\n\treturn *c.MaxTeams\n}\n\n// GetPassing returns the Passing field if it's non-nil, zero value otherwise.\nfunc (c *ClassroomAssignment) GetPassing() int {\n\tif c == nil || c.Passing == nil {\n\t\treturn 0\n\t}\n\treturn *c.Passing\n}\n\n// GetPublicRepo returns the PublicRepo field if it's non-nil, zero value otherwise.\nfunc (c *ClassroomAssignment) GetPublicRepo() bool {\n\tif c == nil || c.PublicRepo == nil {\n\t\treturn false\n\t}\n\treturn *c.PublicRepo\n}\n\n// GetSlug returns the Slug field if it's non-nil, zero value otherwise.\nfunc (c *ClassroomAssignment) GetSlug() string {\n\tif c == nil || c.Slug == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Slug\n}\n\n// GetStarterCodeRepository returns the StarterCodeRepository field.\nfunc (c *ClassroomAssignment) GetStarterCodeRepository() *Repository {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.StarterCodeRepository\n}\n\n// GetStudentsAreRepoAdmins returns the StudentsAreRepoAdmins field if it's non-nil, zero value otherwise.\nfunc (c *ClassroomAssignment) GetStudentsAreRepoAdmins() bool {\n\tif c == nil || c.StudentsAreRepoAdmins == nil {\n\t\treturn false\n\t}\n\treturn *c.StudentsAreRepoAdmins\n}\n\n// GetSubmitted returns the Submitted field if it's non-nil, zero value otherwise.\nfunc (c *ClassroomAssignment) GetSubmitted() int {\n\tif c == nil || c.Submitted == nil {\n\t\treturn 0\n\t}\n\treturn *c.Submitted\n}\n\n// GetTitle returns the Title field if it's non-nil, zero value otherwise.\nfunc (c *ClassroomAssignment) GetTitle() string {\n\tif c == nil || c.Title == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Title\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (c *ClassroomAssignment) GetType() string {\n\tif c == nil || c.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Type\n}\n\n// GetAvatarURL returns the AvatarURL field if it's non-nil, zero value otherwise.\nfunc (c *ClassroomUser) GetAvatarURL() string {\n\tif c == nil || c.AvatarURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.AvatarURL\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (c *ClassroomUser) GetHTMLURL() string {\n\tif c == nil || c.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (c *ClassroomUser) GetID() int64 {\n\tif c == nil || c.ID == nil {\n\t\treturn 0\n\t}\n\treturn *c.ID\n}\n\n// GetLogin returns the Login field if it's non-nil, zero value otherwise.\nfunc (c *ClassroomUser) GetLogin() string {\n\tif c == nil || c.Login == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Login\n}\n\n// GetDeploymentName returns the DeploymentName field.\nfunc (c *ClusterArtifactDeployment) GetDeploymentName() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.DeploymentName\n}\n\n// GetDigest returns the Digest field.\nfunc (c *ClusterArtifactDeployment) GetDigest() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Digest\n}\n\n// GetGithubRepository returns the GithubRepository field if it's non-nil, zero value otherwise.\nfunc (c *ClusterArtifactDeployment) GetGithubRepository() string {\n\tif c == nil || c.GithubRepository == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.GithubRepository\n}\n\n// GetName returns the Name field.\nfunc (c *ClusterArtifactDeployment) GetName() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Name\n}\n\n// GetRuntimeRisks returns the RuntimeRisks slice if it's non-nil, nil otherwise.\nfunc (c *ClusterArtifactDeployment) GetRuntimeRisks() []DeploymentRuntimeRisk {\n\tif c == nil || c.RuntimeRisks == nil {\n\t\treturn nil\n\t}\n\treturn c.RuntimeRisks\n}\n\n// GetStatus returns the Status field.\nfunc (c *ClusterArtifactDeployment) GetStatus() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Status\n}\n\n// GetTags returns the Tags map if it's non-nil, an empty map otherwise.\nfunc (c *ClusterArtifactDeployment) GetTags() map[string]string {\n\tif c == nil || c.Tags == nil {\n\t\treturn map[string]string{}\n\t}\n\treturn c.Tags\n}\n\n// GetVersion returns the Version field if it's non-nil, zero value otherwise.\nfunc (c *ClusterArtifactDeployment) GetVersion() string {\n\tif c == nil || c.Version == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Version\n}\n\n// GetDeployments returns the Deployments slice if it's non-nil, nil otherwise.\nfunc (c *ClusterDeploymentRecordsRequest) GetDeployments() []*ClusterArtifactDeployment {\n\tif c == nil || c.Deployments == nil {\n\t\treturn nil\n\t}\n\treturn c.Deployments\n}\n\n// GetLogicalEnvironment returns the LogicalEnvironment field.\nfunc (c *ClusterDeploymentRecordsRequest) GetLogicalEnvironment() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.LogicalEnvironment\n}\n\n// GetPhysicalEnvironment returns the PhysicalEnvironment field if it's non-nil, zero value otherwise.\nfunc (c *ClusterDeploymentRecordsRequest) GetPhysicalEnvironment() string {\n\tif c == nil || c.PhysicalEnvironment == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.PhysicalEnvironment\n}\n\n// GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise.\nfunc (c *ClusterSSHKey) GetFingerprint() string {\n\tif c == nil || c.Fingerprint == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Fingerprint\n}\n\n// GetKey returns the Key field if it's non-nil, zero value otherwise.\nfunc (c *ClusterSSHKey) GetKey() string {\n\tif c == nil || c.Key == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Key\n}\n\n// GetNodes returns the Nodes slice if it's non-nil, nil otherwise.\nfunc (c *ClusterStatus) GetNodes() []*ClusterStatusNode {\n\tif c == nil || c.Nodes == nil {\n\t\treturn nil\n\t}\n\treturn c.Nodes\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (c *ClusterStatus) GetStatus() string {\n\tif c == nil || c.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Status\n}\n\n// GetHostname returns the Hostname field if it's non-nil, zero value otherwise.\nfunc (c *ClusterStatusNode) GetHostname() string {\n\tif c == nil || c.Hostname == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Hostname\n}\n\n// GetServices returns the Services slice if it's non-nil, nil otherwise.\nfunc (c *ClusterStatusNode) GetServices() []*ClusterStatusNodeServiceItem {\n\tif c == nil || c.Services == nil {\n\t\treturn nil\n\t}\n\treturn c.Services\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (c *ClusterStatusNode) GetStatus() string {\n\tif c == nil || c.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Status\n}\n\n// GetDetails returns the Details field if it's non-nil, zero value otherwise.\nfunc (c *ClusterStatusNodeServiceItem) GetDetails() string {\n\tif c == nil || c.Details == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Details\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (c *ClusterStatusNodeServiceItem) GetName() string {\n\tif c == nil || c.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Name\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (c *ClusterStatusNodeServiceItem) GetStatus() string {\n\tif c == nil || c.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Status\n}\n\n// GetBody returns the Body field if it's non-nil, zero value otherwise.\nfunc (c *CodeOfConduct) GetBody() string {\n\tif c == nil || c.Body == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Body\n}\n\n// GetKey returns the Key field if it's non-nil, zero value otherwise.\nfunc (c *CodeOfConduct) GetKey() string {\n\tif c == nil || c.Key == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Key\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (c *CodeOfConduct) GetName() string {\n\tif c == nil || c.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Name\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (c *CodeOfConduct) GetURL() string {\n\tif c == nil || c.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.URL\n}\n\n// GetColumn returns the Column field.\nfunc (c *CodeownersError) GetColumn() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.Column\n}\n\n// GetKind returns the Kind field.\nfunc (c *CodeownersError) GetKind() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Kind\n}\n\n// GetLine returns the Line field.\nfunc (c *CodeownersError) GetLine() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.Line\n}\n\n// GetMessage returns the Message field.\nfunc (c *CodeownersError) GetMessage() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Message\n}\n\n// GetPath returns the Path field.\nfunc (c *CodeownersError) GetPath() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Path\n}\n\n// GetSource returns the Source field.\nfunc (c *CodeownersError) GetSource() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Source\n}\n\n// GetSuggestion returns the Suggestion field if it's non-nil, zero value otherwise.\nfunc (c *CodeownersError) GetSuggestion() string {\n\tif c == nil || c.Suggestion == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Suggestion\n}\n\n// GetErrors returns the Errors slice if it's non-nil, nil otherwise.\nfunc (c *CodeownersErrors) GetErrors() []*CodeownersError {\n\tif c == nil || c.Errors == nil {\n\t\treturn nil\n\t}\n\treturn c.Errors\n}\n\n// GetContentType returns the ContentType field if it's non-nil, zero value otherwise.\nfunc (c *CodeQLDatabase) GetContentType() string {\n\tif c == nil || c.ContentType == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.ContentType\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (c *CodeQLDatabase) GetCreatedAt() Timestamp {\n\tif c == nil || c.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.CreatedAt\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (c *CodeQLDatabase) GetID() int64 {\n\tif c == nil || c.ID == nil {\n\t\treturn 0\n\t}\n\treturn *c.ID\n}\n\n// GetLanguage returns the Language field if it's non-nil, zero value otherwise.\nfunc (c *CodeQLDatabase) GetLanguage() string {\n\tif c == nil || c.Language == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Language\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (c *CodeQLDatabase) GetName() string {\n\tif c == nil || c.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Name\n}\n\n// GetSize returns the Size field if it's non-nil, zero value otherwise.\nfunc (c *CodeQLDatabase) GetSize() int64 {\n\tif c == nil || c.Size == nil {\n\t\treturn 0\n\t}\n\treturn *c.Size\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (c *CodeQLDatabase) GetUpdatedAt() Timestamp {\n\tif c == nil || c.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.UpdatedAt\n}\n\n// GetUploader returns the Uploader field.\nfunc (c *CodeQLDatabase) GetUploader() *User {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Uploader\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (c *CodeQLDatabase) GetURL() string {\n\tif c == nil || c.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.URL\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (c *CodeResult) GetHTMLURL() string {\n\tif c == nil || c.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.HTMLURL\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (c *CodeResult) GetName() string {\n\tif c == nil || c.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Name\n}\n\n// GetPath returns the Path field if it's non-nil, zero value otherwise.\nfunc (c *CodeResult) GetPath() string {\n\tif c == nil || c.Path == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Path\n}\n\n// GetRepository returns the Repository field.\nfunc (c *CodeResult) GetRepository() *Repository {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Repository\n}\n\n// GetSHA returns the SHA field if it's non-nil, zero value otherwise.\nfunc (c *CodeResult) GetSHA() string {\n\tif c == nil || c.SHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.SHA\n}\n\n// GetTextMatches returns the TextMatches slice if it's non-nil, nil otherwise.\nfunc (c *CodeResult) GetTextMatches() []*TextMatch {\n\tif c == nil || c.TextMatches == nil {\n\t\treturn nil\n\t}\n\treturn c.TextMatches\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (c *CodeScanningAlertEvent) GetAction() string {\n\tif c == nil || c.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Action\n}\n\n// GetAlert returns the Alert field.\nfunc (c *CodeScanningAlertEvent) GetAlert() *Alert {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Alert\n}\n\n// GetCommitOID returns the CommitOID field if it's non-nil, zero value otherwise.\nfunc (c *CodeScanningAlertEvent) GetCommitOID() string {\n\tif c == nil || c.CommitOID == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.CommitOID\n}\n\n// GetInstallation returns the Installation field.\nfunc (c *CodeScanningAlertEvent) GetInstallation() *Installation {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (c *CodeScanningAlertEvent) GetOrg() *Organization {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Org\n}\n\n// GetRef returns the Ref field if it's non-nil, zero value otherwise.\nfunc (c *CodeScanningAlertEvent) GetRef() string {\n\tif c == nil || c.Ref == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Ref\n}\n\n// GetRepo returns the Repo field.\nfunc (c *CodeScanningAlertEvent) GetRepo() *Repository {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (c *CodeScanningAlertEvent) GetSender() *User {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Sender\n}\n\n// GetDismissedComment returns the DismissedComment field if it's non-nil, zero value otherwise.\nfunc (c *CodeScanningAlertState) GetDismissedComment() string {\n\tif c == nil || c.DismissedComment == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.DismissedComment\n}\n\n// GetDismissedReason returns the DismissedReason field if it's non-nil, zero value otherwise.\nfunc (c *CodeScanningAlertState) GetDismissedReason() string {\n\tif c == nil || c.DismissedReason == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.DismissedReason\n}\n\n// GetState returns the State field.\nfunc (c *CodeScanningAlertState) GetState() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.State\n}\n\n// GetParameters returns the Parameters field.\nfunc (c *CodeScanningBranchRule) GetParameters() CodeScanningRuleParameters {\n\tif c == nil {\n\t\treturn CodeScanningRuleParameters{}\n\t}\n\treturn c.Parameters\n}\n\n// GetRunnerLabel returns the RunnerLabel field if it's non-nil, zero value otherwise.\nfunc (c *CodeScanningDefaultSetupOptions) GetRunnerLabel() string {\n\tif c == nil || c.RunnerLabel == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.RunnerLabel\n}\n\n// GetRunnerType returns the RunnerType field.\nfunc (c *CodeScanningDefaultSetupOptions) GetRunnerType() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.RunnerType\n}\n\n// GetAllowAdvanced returns the AllowAdvanced field if it's non-nil, zero value otherwise.\nfunc (c *CodeScanningOptions) GetAllowAdvanced() bool {\n\tif c == nil || c.AllowAdvanced == nil {\n\t\treturn false\n\t}\n\treturn *c.AllowAdvanced\n}\n\n// GetCodeScanningTools returns the CodeScanningTools slice if it's non-nil, nil otherwise.\nfunc (c *CodeScanningRuleParameters) GetCodeScanningTools() []*RuleCodeScanningTool {\n\tif c == nil || c.CodeScanningTools == nil {\n\t\treturn nil\n\t}\n\treturn c.CodeScanningTools\n}\n\n// GetCodeResults returns the CodeResults slice if it's non-nil, nil otherwise.\nfunc (c *CodeSearchResult) GetCodeResults() []*CodeResult {\n\tif c == nil || c.CodeResults == nil {\n\t\treturn nil\n\t}\n\treturn c.CodeResults\n}\n\n// GetIncompleteResults returns the IncompleteResults field if it's non-nil, zero value otherwise.\nfunc (c *CodeSearchResult) GetIncompleteResults() bool {\n\tif c == nil || c.IncompleteResults == nil {\n\t\treturn false\n\t}\n\treturn *c.IncompleteResults\n}\n\n// GetTotal returns the Total field if it's non-nil, zero value otherwise.\nfunc (c *CodeSearchResult) GetTotal() int {\n\tif c == nil || c.Total == nil {\n\t\treturn 0\n\t}\n\treturn *c.Total\n}\n\n// GetAdvancedSecurity returns the AdvancedSecurity field if it's non-nil, zero value otherwise.\nfunc (c *CodeSecurityConfiguration) GetAdvancedSecurity() string {\n\tif c == nil || c.AdvancedSecurity == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.AdvancedSecurity\n}\n\n// GetCodeScanningDefaultSetup returns the CodeScanningDefaultSetup field if it's non-nil, zero value otherwise.\nfunc (c *CodeSecurityConfiguration) GetCodeScanningDefaultSetup() string {\n\tif c == nil || c.CodeScanningDefaultSetup == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.CodeScanningDefaultSetup\n}\n\n// GetCodeScanningDefaultSetupOptions returns the CodeScanningDefaultSetupOptions field.\nfunc (c *CodeSecurityConfiguration) GetCodeScanningDefaultSetupOptions() *CodeScanningDefaultSetupOptions {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.CodeScanningDefaultSetupOptions\n}\n\n// GetCodeScanningDelegatedAlertDismissal returns the CodeScanningDelegatedAlertDismissal field if it's non-nil, zero value otherwise.\nfunc (c *CodeSecurityConfiguration) GetCodeScanningDelegatedAlertDismissal() string {\n\tif c == nil || c.CodeScanningDelegatedAlertDismissal == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.CodeScanningDelegatedAlertDismissal\n}\n\n// GetCodeScanningOptions returns the CodeScanningOptions field.\nfunc (c *CodeSecurityConfiguration) GetCodeScanningOptions() *CodeScanningOptions {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.CodeScanningOptions\n}\n\n// GetCodeSecurity returns the CodeSecurity field if it's non-nil, zero value otherwise.\nfunc (c *CodeSecurityConfiguration) GetCodeSecurity() string {\n\tif c == nil || c.CodeSecurity == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.CodeSecurity\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (c *CodeSecurityConfiguration) GetCreatedAt() Timestamp {\n\tif c == nil || c.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.CreatedAt\n}\n\n// GetDependabotAlerts returns the DependabotAlerts field if it's non-nil, zero value otherwise.\nfunc (c *CodeSecurityConfiguration) GetDependabotAlerts() string {\n\tif c == nil || c.DependabotAlerts == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.DependabotAlerts\n}\n\n// GetDependabotSecurityUpdates returns the DependabotSecurityUpdates field if it's non-nil, zero value otherwise.\nfunc (c *CodeSecurityConfiguration) GetDependabotSecurityUpdates() string {\n\tif c == nil || c.DependabotSecurityUpdates == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.DependabotSecurityUpdates\n}\n\n// GetDependencyGraph returns the DependencyGraph field if it's non-nil, zero value otherwise.\nfunc (c *CodeSecurityConfiguration) GetDependencyGraph() string {\n\tif c == nil || c.DependencyGraph == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.DependencyGraph\n}\n\n// GetDependencyGraphAutosubmitAction returns the DependencyGraphAutosubmitAction field if it's non-nil, zero value otherwise.\nfunc (c *CodeSecurityConfiguration) GetDependencyGraphAutosubmitAction() string {\n\tif c == nil || c.DependencyGraphAutosubmitAction == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.DependencyGraphAutosubmitAction\n}\n\n// GetDependencyGraphAutosubmitActionOptions returns the DependencyGraphAutosubmitActionOptions field.\nfunc (c *CodeSecurityConfiguration) GetDependencyGraphAutosubmitActionOptions() *DependencyGraphAutosubmitActionOptions {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.DependencyGraphAutosubmitActionOptions\n}\n\n// GetDescription returns the Description field.\nfunc (c *CodeSecurityConfiguration) GetDescription() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Description\n}\n\n// GetEnforcement returns the Enforcement field if it's non-nil, zero value otherwise.\nfunc (c *CodeSecurityConfiguration) GetEnforcement() string {\n\tif c == nil || c.Enforcement == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Enforcement\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (c *CodeSecurityConfiguration) GetHTMLURL() string {\n\tif c == nil || c.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (c *CodeSecurityConfiguration) GetID() int64 {\n\tif c == nil || c.ID == nil {\n\t\treturn 0\n\t}\n\treturn *c.ID\n}\n\n// GetName returns the Name field.\nfunc (c *CodeSecurityConfiguration) GetName() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Name\n}\n\n// GetPrivateVulnerabilityReporting returns the PrivateVulnerabilityReporting field if it's non-nil, zero value otherwise.\nfunc (c *CodeSecurityConfiguration) GetPrivateVulnerabilityReporting() string {\n\tif c == nil || c.PrivateVulnerabilityReporting == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.PrivateVulnerabilityReporting\n}\n\n// GetSecretProtection returns the SecretProtection field if it's non-nil, zero value otherwise.\nfunc (c *CodeSecurityConfiguration) GetSecretProtection() string {\n\tif c == nil || c.SecretProtection == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.SecretProtection\n}\n\n// GetSecretScanning returns the SecretScanning field if it's non-nil, zero value otherwise.\nfunc (c *CodeSecurityConfiguration) GetSecretScanning() string {\n\tif c == nil || c.SecretScanning == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.SecretScanning\n}\n\n// GetSecretScanningDelegatedAlertDismissal returns the SecretScanningDelegatedAlertDismissal field if it's non-nil, zero value otherwise.\nfunc (c *CodeSecurityConfiguration) GetSecretScanningDelegatedAlertDismissal() string {\n\tif c == nil || c.SecretScanningDelegatedAlertDismissal == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.SecretScanningDelegatedAlertDismissal\n}\n\n// GetSecretScanningDelegatedBypass returns the SecretScanningDelegatedBypass field if it's non-nil, zero value otherwise.\nfunc (c *CodeSecurityConfiguration) GetSecretScanningDelegatedBypass() string {\n\tif c == nil || c.SecretScanningDelegatedBypass == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.SecretScanningDelegatedBypass\n}\n\n// GetSecretScanningDelegatedBypassOptions returns the SecretScanningDelegatedBypassOptions field.\nfunc (c *CodeSecurityConfiguration) GetSecretScanningDelegatedBypassOptions() *SecretScanningDelegatedBypassOptions {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.SecretScanningDelegatedBypassOptions\n}\n\n// GetSecretScanningGenericSecrets returns the SecretScanningGenericSecrets field if it's non-nil, zero value otherwise.\nfunc (c *CodeSecurityConfiguration) GetSecretScanningGenericSecrets() string {\n\tif c == nil || c.SecretScanningGenericSecrets == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.SecretScanningGenericSecrets\n}\n\n// GetSecretScanningNonProviderPatterns returns the SecretScanningNonProviderPatterns field if it's non-nil, zero value otherwise.\nfunc (c *CodeSecurityConfiguration) GetSecretScanningNonProviderPatterns() string {\n\tif c == nil || c.SecretScanningNonProviderPatterns == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.SecretScanningNonProviderPatterns\n}\n\n// GetSecretScanningPushProtection returns the SecretScanningPushProtection field if it's non-nil, zero value otherwise.\nfunc (c *CodeSecurityConfiguration) GetSecretScanningPushProtection() string {\n\tif c == nil || c.SecretScanningPushProtection == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.SecretScanningPushProtection\n}\n\n// GetSecretScanningValidityChecks returns the SecretScanningValidityChecks field if it's non-nil, zero value otherwise.\nfunc (c *CodeSecurityConfiguration) GetSecretScanningValidityChecks() string {\n\tif c == nil || c.SecretScanningValidityChecks == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.SecretScanningValidityChecks\n}\n\n// GetTargetType returns the TargetType field if it's non-nil, zero value otherwise.\nfunc (c *CodeSecurityConfiguration) GetTargetType() string {\n\tif c == nil || c.TargetType == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.TargetType\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (c *CodeSecurityConfiguration) GetUpdatedAt() Timestamp {\n\tif c == nil || c.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (c *CodeSecurityConfiguration) GetURL() string {\n\tif c == nil || c.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.URL\n}\n\n// GetConfiguration returns the Configuration field.\nfunc (c *CodeSecurityConfigurationWithDefaultForNewRepos) GetConfiguration() *CodeSecurityConfiguration {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Configuration\n}\n\n// GetDefaultForNewRepos returns the DefaultForNewRepos field if it's non-nil, zero value otherwise.\nfunc (c *CodeSecurityConfigurationWithDefaultForNewRepos) GetDefaultForNewRepos() string {\n\tif c == nil || c.DefaultForNewRepos == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.DefaultForNewRepos\n}\n\n// GetBillableOwner returns the BillableOwner field.\nfunc (c *Codespace) GetBillableOwner() *User {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.BillableOwner\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (c *Codespace) GetCreatedAt() Timestamp {\n\tif c == nil || c.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.CreatedAt\n}\n\n// GetDevcontainerPath returns the DevcontainerPath field if it's non-nil, zero value otherwise.\nfunc (c *Codespace) GetDevcontainerPath() string {\n\tif c == nil || c.DevcontainerPath == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.DevcontainerPath\n}\n\n// GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise.\nfunc (c *Codespace) GetDisplayName() string {\n\tif c == nil || c.DisplayName == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.DisplayName\n}\n\n// GetEnvironmentID returns the EnvironmentID field if it's non-nil, zero value otherwise.\nfunc (c *Codespace) GetEnvironmentID() string {\n\tif c == nil || c.EnvironmentID == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.EnvironmentID\n}\n\n// GetGitStatus returns the GitStatus field.\nfunc (c *Codespace) GetGitStatus() *CodespacesGitStatus {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.GitStatus\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (c *Codespace) GetID() int64 {\n\tif c == nil || c.ID == nil {\n\t\treturn 0\n\t}\n\treturn *c.ID\n}\n\n// GetIdleTimeoutMinutes returns the IdleTimeoutMinutes field if it's non-nil, zero value otherwise.\nfunc (c *Codespace) GetIdleTimeoutMinutes() int {\n\tif c == nil || c.IdleTimeoutMinutes == nil {\n\t\treturn 0\n\t}\n\treturn *c.IdleTimeoutMinutes\n}\n\n// GetIdleTimeoutNotice returns the IdleTimeoutNotice field if it's non-nil, zero value otherwise.\nfunc (c *Codespace) GetIdleTimeoutNotice() string {\n\tif c == nil || c.IdleTimeoutNotice == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.IdleTimeoutNotice\n}\n\n// GetLastKnownStopNotice returns the LastKnownStopNotice field if it's non-nil, zero value otherwise.\nfunc (c *Codespace) GetLastKnownStopNotice() string {\n\tif c == nil || c.LastKnownStopNotice == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.LastKnownStopNotice\n}\n\n// GetLastUsedAt returns the LastUsedAt field if it's non-nil, zero value otherwise.\nfunc (c *Codespace) GetLastUsedAt() Timestamp {\n\tif c == nil || c.LastUsedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.LastUsedAt\n}\n\n// GetLocation returns the Location field if it's non-nil, zero value otherwise.\nfunc (c *Codespace) GetLocation() string {\n\tif c == nil || c.Location == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Location\n}\n\n// GetMachine returns the Machine field.\nfunc (c *Codespace) GetMachine() *CodespacesMachine {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Machine\n}\n\n// GetMachinesURL returns the MachinesURL field if it's non-nil, zero value otherwise.\nfunc (c *Codespace) GetMachinesURL() string {\n\tif c == nil || c.MachinesURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.MachinesURL\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (c *Codespace) GetName() string {\n\tif c == nil || c.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Name\n}\n\n// GetOwner returns the Owner field.\nfunc (c *Codespace) GetOwner() *User {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Owner\n}\n\n// GetPendingOperation returns the PendingOperation field if it's non-nil, zero value otherwise.\nfunc (c *Codespace) GetPendingOperation() bool {\n\tif c == nil || c.PendingOperation == nil {\n\t\treturn false\n\t}\n\treturn *c.PendingOperation\n}\n\n// GetPendingOperationDisabledReason returns the PendingOperationDisabledReason field if it's non-nil, zero value otherwise.\nfunc (c *Codespace) GetPendingOperationDisabledReason() string {\n\tif c == nil || c.PendingOperationDisabledReason == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.PendingOperationDisabledReason\n}\n\n// GetPrebuild returns the Prebuild field if it's non-nil, zero value otherwise.\nfunc (c *Codespace) GetPrebuild() bool {\n\tif c == nil || c.Prebuild == nil {\n\t\treturn false\n\t}\n\treturn *c.Prebuild\n}\n\n// GetPullsURL returns the PullsURL field if it's non-nil, zero value otherwise.\nfunc (c *Codespace) GetPullsURL() string {\n\tif c == nil || c.PullsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.PullsURL\n}\n\n// GetRecentFolders returns the RecentFolders slice if it's non-nil, nil otherwise.\nfunc (c *Codespace) GetRecentFolders() []string {\n\tif c == nil || c.RecentFolders == nil {\n\t\treturn nil\n\t}\n\treturn c.RecentFolders\n}\n\n// GetRepository returns the Repository field.\nfunc (c *Codespace) GetRepository() *Repository {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Repository\n}\n\n// GetRetentionExpiresAt returns the RetentionExpiresAt field if it's non-nil, zero value otherwise.\nfunc (c *Codespace) GetRetentionExpiresAt() Timestamp {\n\tif c == nil || c.RetentionExpiresAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.RetentionExpiresAt\n}\n\n// GetRetentionPeriodMinutes returns the RetentionPeriodMinutes field if it's non-nil, zero value otherwise.\nfunc (c *Codespace) GetRetentionPeriodMinutes() int {\n\tif c == nil || c.RetentionPeriodMinutes == nil {\n\t\treturn 0\n\t}\n\treturn *c.RetentionPeriodMinutes\n}\n\n// GetRuntimeConstraints returns the RuntimeConstraints field.\nfunc (c *Codespace) GetRuntimeConstraints() *CodespacesRuntimeConstraints {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.RuntimeConstraints\n}\n\n// GetStartURL returns the StartURL field if it's non-nil, zero value otherwise.\nfunc (c *Codespace) GetStartURL() string {\n\tif c == nil || c.StartURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.StartURL\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (c *Codespace) GetState() string {\n\tif c == nil || c.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.State\n}\n\n// GetStopURL returns the StopURL field if it's non-nil, zero value otherwise.\nfunc (c *Codespace) GetStopURL() string {\n\tif c == nil || c.StopURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.StopURL\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (c *Codespace) GetUpdatedAt() Timestamp {\n\tif c == nil || c.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (c *Codespace) GetURL() string {\n\tif c == nil || c.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.URL\n}\n\n// GetWebURL returns the WebURL field if it's non-nil, zero value otherwise.\nfunc (c *Codespace) GetWebURL() string {\n\tif c == nil || c.WebURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.WebURL\n}\n\n// GetClientIP returns the ClientIP field if it's non-nil, zero value otherwise.\nfunc (c *CodespaceCreateForUserOptions) GetClientIP() string {\n\tif c == nil || c.ClientIP == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.ClientIP\n}\n\n// GetDevcontainerPath returns the DevcontainerPath field if it's non-nil, zero value otherwise.\nfunc (c *CodespaceCreateForUserOptions) GetDevcontainerPath() string {\n\tif c == nil || c.DevcontainerPath == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.DevcontainerPath\n}\n\n// GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise.\nfunc (c *CodespaceCreateForUserOptions) GetDisplayName() string {\n\tif c == nil || c.DisplayName == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.DisplayName\n}\n\n// GetGeo returns the Geo field if it's non-nil, zero value otherwise.\nfunc (c *CodespaceCreateForUserOptions) GetGeo() string {\n\tif c == nil || c.Geo == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Geo\n}\n\n// GetIdleTimeoutMinutes returns the IdleTimeoutMinutes field if it's non-nil, zero value otherwise.\nfunc (c *CodespaceCreateForUserOptions) GetIdleTimeoutMinutes() int {\n\tif c == nil || c.IdleTimeoutMinutes == nil {\n\t\treturn 0\n\t}\n\treturn *c.IdleTimeoutMinutes\n}\n\n// GetLocation returns the Location field if it's non-nil, zero value otherwise.\nfunc (c *CodespaceCreateForUserOptions) GetLocation() string {\n\tif c == nil || c.Location == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Location\n}\n\n// GetMachine returns the Machine field if it's non-nil, zero value otherwise.\nfunc (c *CodespaceCreateForUserOptions) GetMachine() string {\n\tif c == nil || c.Machine == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Machine\n}\n\n// GetMultiRepoPermissionsOptOut returns the MultiRepoPermissionsOptOut field if it's non-nil, zero value otherwise.\nfunc (c *CodespaceCreateForUserOptions) GetMultiRepoPermissionsOptOut() bool {\n\tif c == nil || c.MultiRepoPermissionsOptOut == nil {\n\t\treturn false\n\t}\n\treturn *c.MultiRepoPermissionsOptOut\n}\n\n// GetPullRequest returns the PullRequest field.\nfunc (c *CodespaceCreateForUserOptions) GetPullRequest() *CodespacePullRequestOptions {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.PullRequest\n}\n\n// GetRef returns the Ref field if it's non-nil, zero value otherwise.\nfunc (c *CodespaceCreateForUserOptions) GetRef() string {\n\tif c == nil || c.Ref == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Ref\n}\n\n// GetRepositoryID returns the RepositoryID field.\nfunc (c *CodespaceCreateForUserOptions) GetRepositoryID() int64 {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.RepositoryID\n}\n\n// GetRetentionPeriodMinutes returns the RetentionPeriodMinutes field if it's non-nil, zero value otherwise.\nfunc (c *CodespaceCreateForUserOptions) GetRetentionPeriodMinutes() int {\n\tif c == nil || c.RetentionPeriodMinutes == nil {\n\t\treturn 0\n\t}\n\treturn *c.RetentionPeriodMinutes\n}\n\n// GetWorkingDirectory returns the WorkingDirectory field if it's non-nil, zero value otherwise.\nfunc (c *CodespaceCreateForUserOptions) GetWorkingDirectory() string {\n\tif c == nil || c.WorkingDirectory == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.WorkingDirectory\n}\n\n// GetBillableOwner returns the BillableOwner field.\nfunc (c *CodespaceDefaultAttributes) GetBillableOwner() *User {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.BillableOwner\n}\n\n// GetDefaults returns the Defaults field.\nfunc (c *CodespaceDefaultAttributes) GetDefaults() *CodespaceDefaults {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Defaults\n}\n\n// GetDevcontainerPath returns the DevcontainerPath field if it's non-nil, zero value otherwise.\nfunc (c *CodespaceDefaults) GetDevcontainerPath() string {\n\tif c == nil || c.DevcontainerPath == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.DevcontainerPath\n}\n\n// GetLocation returns the Location field.\nfunc (c *CodespaceDefaults) GetLocation() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Location\n}\n\n// GetBranch returns the Branch field if it's non-nil, zero value otherwise.\nfunc (c *CodespaceExport) GetBranch() string {\n\tif c == nil || c.Branch == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Branch\n}\n\n// GetCompletedAt returns the CompletedAt field if it's non-nil, zero value otherwise.\nfunc (c *CodespaceExport) GetCompletedAt() Timestamp {\n\tif c == nil || c.CompletedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.CompletedAt\n}\n\n// GetExportURL returns the ExportURL field if it's non-nil, zero value otherwise.\nfunc (c *CodespaceExport) GetExportURL() string {\n\tif c == nil || c.ExportURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.ExportURL\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (c *CodespaceExport) GetHTMLURL() string {\n\tif c == nil || c.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (c *CodespaceExport) GetID() string {\n\tif c == nil || c.ID == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.ID\n}\n\n// GetSHA returns the SHA field if it's non-nil, zero value otherwise.\nfunc (c *CodespaceExport) GetSHA() string {\n\tif c == nil || c.SHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.SHA\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (c *CodespaceExport) GetState() string {\n\tif c == nil || c.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.State\n}\n\n// GetClientIP returns the ClientIP field if it's non-nil, zero value otherwise.\nfunc (c *CodespaceGetDefaultAttributesOptions) GetClientIP() string {\n\tif c == nil || c.ClientIP == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.ClientIP\n}\n\n// GetRef returns the Ref field if it's non-nil, zero value otherwise.\nfunc (c *CodespaceGetDefaultAttributesOptions) GetRef() string {\n\tif c == nil || c.Ref == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Ref\n}\n\n// GetAccepted returns the Accepted field.\nfunc (c *CodespacePermissions) GetAccepted() bool {\n\tif c == nil {\n\t\treturn false\n\t}\n\treturn c.Accepted\n}\n\n// GetPullRequestNumber returns the PullRequestNumber field.\nfunc (c *CodespacePullRequestOptions) GetPullRequestNumber() int64 {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.PullRequestNumber\n}\n\n// GetRepositoryID returns the RepositoryID field.\nfunc (c *CodespacePullRequestOptions) GetRepositoryID() int64 {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.RepositoryID\n}\n\n// GetAhead returns the Ahead field if it's non-nil, zero value otherwise.\nfunc (c *CodespacesGitStatus) GetAhead() int {\n\tif c == nil || c.Ahead == nil {\n\t\treturn 0\n\t}\n\treturn *c.Ahead\n}\n\n// GetBehind returns the Behind field if it's non-nil, zero value otherwise.\nfunc (c *CodespacesGitStatus) GetBehind() int {\n\tif c == nil || c.Behind == nil {\n\t\treturn 0\n\t}\n\treturn *c.Behind\n}\n\n// GetHasUncommittedChanges returns the HasUncommittedChanges field if it's non-nil, zero value otherwise.\nfunc (c *CodespacesGitStatus) GetHasUncommittedChanges() bool {\n\tif c == nil || c.HasUncommittedChanges == nil {\n\t\treturn false\n\t}\n\treturn *c.HasUncommittedChanges\n}\n\n// GetHasUnpushedChanges returns the HasUnpushedChanges field if it's non-nil, zero value otherwise.\nfunc (c *CodespacesGitStatus) GetHasUnpushedChanges() bool {\n\tif c == nil || c.HasUnpushedChanges == nil {\n\t\treturn false\n\t}\n\treturn *c.HasUnpushedChanges\n}\n\n// GetRef returns the Ref field if it's non-nil, zero value otherwise.\nfunc (c *CodespacesGitStatus) GetRef() string {\n\tif c == nil || c.Ref == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Ref\n}\n\n// GetCPUs returns the CPUs field if it's non-nil, zero value otherwise.\nfunc (c *CodespacesMachine) GetCPUs() int {\n\tif c == nil || c.CPUs == nil {\n\t\treturn 0\n\t}\n\treturn *c.CPUs\n}\n\n// GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise.\nfunc (c *CodespacesMachine) GetDisplayName() string {\n\tif c == nil || c.DisplayName == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.DisplayName\n}\n\n// GetMemoryInBytes returns the MemoryInBytes field if it's non-nil, zero value otherwise.\nfunc (c *CodespacesMachine) GetMemoryInBytes() int64 {\n\tif c == nil || c.MemoryInBytes == nil {\n\t\treturn 0\n\t}\n\treturn *c.MemoryInBytes\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (c *CodespacesMachine) GetName() string {\n\tif c == nil || c.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Name\n}\n\n// GetOperatingSystem returns the OperatingSystem field if it's non-nil, zero value otherwise.\nfunc (c *CodespacesMachine) GetOperatingSystem() string {\n\tif c == nil || c.OperatingSystem == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.OperatingSystem\n}\n\n// GetPrebuildAvailability returns the PrebuildAvailability field if it's non-nil, zero value otherwise.\nfunc (c *CodespacesMachine) GetPrebuildAvailability() string {\n\tif c == nil || c.PrebuildAvailability == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.PrebuildAvailability\n}\n\n// GetStorageInBytes returns the StorageInBytes field if it's non-nil, zero value otherwise.\nfunc (c *CodespacesMachine) GetStorageInBytes() int64 {\n\tif c == nil || c.StorageInBytes == nil {\n\t\treturn 0\n\t}\n\treturn *c.StorageInBytes\n}\n\n// GetMachines returns the Machines slice if it's non-nil, nil otherwise.\nfunc (c *CodespacesMachines) GetMachines() []*CodespacesMachine {\n\tif c == nil || c.Machines == nil {\n\t\treturn nil\n\t}\n\treturn c.Machines\n}\n\n// GetTotalCount returns the TotalCount field.\nfunc (c *CodespacesMachines) GetTotalCount() int64 {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.TotalCount\n}\n\n// GetSelectedUsernames returns the SelectedUsernames slice if it's non-nil, nil otherwise.\nfunc (c *CodespacesOrgAccessControlRequest) GetSelectedUsernames() []string {\n\tif c == nil || c.SelectedUsernames == nil {\n\t\treturn nil\n\t}\n\treturn c.SelectedUsernames\n}\n\n// GetVisibility returns the Visibility field.\nfunc (c *CodespacesOrgAccessControlRequest) GetVisibility() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Visibility\n}\n\n// GetAllowedPortPrivacySettings returns the AllowedPortPrivacySettings slice if it's non-nil, nil otherwise.\nfunc (c *CodespacesRuntimeConstraints) GetAllowedPortPrivacySettings() []string {\n\tif c == nil || c.AllowedPortPrivacySettings == nil {\n\t\treturn nil\n\t}\n\treturn c.AllowedPortPrivacySettings\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (c *CollaboratorInvitation) GetCreatedAt() Timestamp {\n\tif c == nil || c.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.CreatedAt\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (c *CollaboratorInvitation) GetHTMLURL() string {\n\tif c == nil || c.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (c *CollaboratorInvitation) GetID() int64 {\n\tif c == nil || c.ID == nil {\n\t\treturn 0\n\t}\n\treturn *c.ID\n}\n\n// GetInvitee returns the Invitee field.\nfunc (c *CollaboratorInvitation) GetInvitee() *User {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Invitee\n}\n\n// GetInviter returns the Inviter field.\nfunc (c *CollaboratorInvitation) GetInviter() *User {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Inviter\n}\n\n// GetPermissions returns the Permissions field if it's non-nil, zero value otherwise.\nfunc (c *CollaboratorInvitation) GetPermissions() string {\n\tif c == nil || c.Permissions == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Permissions\n}\n\n// GetRepo returns the Repo field.\nfunc (c *CollaboratorInvitation) GetRepo() *Repository {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Repo\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (c *CollaboratorInvitation) GetURL() string {\n\tif c == nil || c.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.URL\n}\n\n// GetCommitURL returns the CommitURL field if it's non-nil, zero value otherwise.\nfunc (c *CombinedStatus) GetCommitURL() string {\n\tif c == nil || c.CommitURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.CommitURL\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (c *CombinedStatus) GetName() string {\n\tif c == nil || c.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Name\n}\n\n// GetRepositoryURL returns the RepositoryURL field if it's non-nil, zero value otherwise.\nfunc (c *CombinedStatus) GetRepositoryURL() string {\n\tif c == nil || c.RepositoryURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.RepositoryURL\n}\n\n// GetSHA returns the SHA field if it's non-nil, zero value otherwise.\nfunc (c *CombinedStatus) GetSHA() string {\n\tif c == nil || c.SHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.SHA\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (c *CombinedStatus) GetState() string {\n\tif c == nil || c.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.State\n}\n\n// GetStatuses returns the Statuses slice if it's non-nil, nil otherwise.\nfunc (c *CombinedStatus) GetStatuses() []*RepoStatus {\n\tif c == nil || c.Statuses == nil {\n\t\treturn nil\n\t}\n\treturn c.Statuses\n}\n\n// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.\nfunc (c *CombinedStatus) GetTotalCount() int {\n\tif c == nil || c.TotalCount == nil {\n\t\treturn 0\n\t}\n\treturn *c.TotalCount\n}\n\n// GetBody returns the Body field.\nfunc (c *Comment) GetBody() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Body\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (c *Comment) GetCreatedAt() Timestamp {\n\tif c == nil || c.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.CreatedAt\n}\n\n// GetAuthorAssociation returns the AuthorAssociation field if it's non-nil, zero value otherwise.\nfunc (c *CommentDiscussion) GetAuthorAssociation() string {\n\tif c == nil || c.AuthorAssociation == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.AuthorAssociation\n}\n\n// GetBody returns the Body field if it's non-nil, zero value otherwise.\nfunc (c *CommentDiscussion) GetBody() string {\n\tif c == nil || c.Body == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Body\n}\n\n// GetChildCommentCount returns the ChildCommentCount field if it's non-nil, zero value otherwise.\nfunc (c *CommentDiscussion) GetChildCommentCount() int {\n\tif c == nil || c.ChildCommentCount == nil {\n\t\treturn 0\n\t}\n\treturn *c.ChildCommentCount\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (c *CommentDiscussion) GetCreatedAt() Timestamp {\n\tif c == nil || c.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.CreatedAt\n}\n\n// GetDiscussionID returns the DiscussionID field if it's non-nil, zero value otherwise.\nfunc (c *CommentDiscussion) GetDiscussionID() int64 {\n\tif c == nil || c.DiscussionID == nil {\n\t\treturn 0\n\t}\n\treturn *c.DiscussionID\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (c *CommentDiscussion) GetHTMLURL() string {\n\tif c == nil || c.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (c *CommentDiscussion) GetID() int64 {\n\tif c == nil || c.ID == nil {\n\t\treturn 0\n\t}\n\treturn *c.ID\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (c *CommentDiscussion) GetNodeID() string {\n\tif c == nil || c.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.NodeID\n}\n\n// GetParentID returns the ParentID field if it's non-nil, zero value otherwise.\nfunc (c *CommentDiscussion) GetParentID() int64 {\n\tif c == nil || c.ParentID == nil {\n\t\treturn 0\n\t}\n\treturn *c.ParentID\n}\n\n// GetReactions returns the Reactions field.\nfunc (c *CommentDiscussion) GetReactions() *Reactions {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Reactions\n}\n\n// GetRepositoryURL returns the RepositoryURL field if it's non-nil, zero value otherwise.\nfunc (c *CommentDiscussion) GetRepositoryURL() string {\n\tif c == nil || c.RepositoryURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.RepositoryURL\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (c *CommentDiscussion) GetUpdatedAt() Timestamp {\n\tif c == nil || c.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.UpdatedAt\n}\n\n// GetUser returns the User field.\nfunc (c *CommentDiscussion) GetUser() *User {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.User\n}\n\n// GetTotalCommitComments returns the TotalCommitComments field if it's non-nil, zero value otherwise.\nfunc (c *CommentStats) GetTotalCommitComments() int {\n\tif c == nil || c.TotalCommitComments == nil {\n\t\treturn 0\n\t}\n\treturn *c.TotalCommitComments\n}\n\n// GetTotalGistComments returns the TotalGistComments field if it's non-nil, zero value otherwise.\nfunc (c *CommentStats) GetTotalGistComments() int {\n\tif c == nil || c.TotalGistComments == nil {\n\t\treturn 0\n\t}\n\treturn *c.TotalGistComments\n}\n\n// GetTotalIssueComments returns the TotalIssueComments field if it's non-nil, zero value otherwise.\nfunc (c *CommentStats) GetTotalIssueComments() int {\n\tif c == nil || c.TotalIssueComments == nil {\n\t\treturn 0\n\t}\n\treturn *c.TotalIssueComments\n}\n\n// GetTotalPullRequestComments returns the TotalPullRequestComments field if it's non-nil, zero value otherwise.\nfunc (c *CommentStats) GetTotalPullRequestComments() int {\n\tif c == nil || c.TotalPullRequestComments == nil {\n\t\treturn 0\n\t}\n\treturn *c.TotalPullRequestComments\n}\n\n// GetAuthor returns the Author field.\nfunc (c *Commit) GetAuthor() *CommitAuthor {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Author\n}\n\n// GetCommentCount returns the CommentCount field if it's non-nil, zero value otherwise.\nfunc (c *Commit) GetCommentCount() int {\n\tif c == nil || c.CommentCount == nil {\n\t\treturn 0\n\t}\n\treturn *c.CommentCount\n}\n\n// GetCommitter returns the Committer field.\nfunc (c *Commit) GetCommitter() *CommitAuthor {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Committer\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (c *Commit) GetHTMLURL() string {\n\tif c == nil || c.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.HTMLURL\n}\n\n// GetMessage returns the Message field if it's non-nil, zero value otherwise.\nfunc (c *Commit) GetMessage() string {\n\tif c == nil || c.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Message\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (c *Commit) GetNodeID() string {\n\tif c == nil || c.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.NodeID\n}\n\n// GetParents returns the Parents slice if it's non-nil, nil otherwise.\nfunc (c *Commit) GetParents() []*Commit {\n\tif c == nil || c.Parents == nil {\n\t\treturn nil\n\t}\n\treturn c.Parents\n}\n\n// GetSHA returns the SHA field if it's non-nil, zero value otherwise.\nfunc (c *Commit) GetSHA() string {\n\tif c == nil || c.SHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.SHA\n}\n\n// GetTree returns the Tree field.\nfunc (c *Commit) GetTree() *Tree {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Tree\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (c *Commit) GetURL() string {\n\tif c == nil || c.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.URL\n}\n\n// GetVerification returns the Verification field.\nfunc (c *Commit) GetVerification() *SignatureVerification {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Verification\n}\n\n// GetDate returns the Date field if it's non-nil, zero value otherwise.\nfunc (c *CommitAuthor) GetDate() Timestamp {\n\tif c == nil || c.Date == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.Date\n}\n\n// GetEmail returns the Email field if it's non-nil, zero value otherwise.\nfunc (c *CommitAuthor) GetEmail() string {\n\tif c == nil || c.Email == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Email\n}\n\n// GetLogin returns the Login field if it's non-nil, zero value otherwise.\nfunc (c *CommitAuthor) GetLogin() string {\n\tif c == nil || c.Login == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Login\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (c *CommitAuthor) GetName() string {\n\tif c == nil || c.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Name\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (c *CommitCommentEvent) GetAction() string {\n\tif c == nil || c.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Action\n}\n\n// GetComment returns the Comment field.\nfunc (c *CommitCommentEvent) GetComment() *RepositoryComment {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Comment\n}\n\n// GetInstallation returns the Installation field.\nfunc (c *CommitCommentEvent) GetInstallation() *Installation {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (c *CommitCommentEvent) GetOrg() *Organization {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Org\n}\n\n// GetRepo returns the Repo field.\nfunc (c *CommitCommentEvent) GetRepo() *Repository {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (c *CommitCommentEvent) GetSender() *User {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Sender\n}\n\n// GetAdditions returns the Additions field if it's non-nil, zero value otherwise.\nfunc (c *CommitFile) GetAdditions() int {\n\tif c == nil || c.Additions == nil {\n\t\treturn 0\n\t}\n\treturn *c.Additions\n}\n\n// GetBlobURL returns the BlobURL field if it's non-nil, zero value otherwise.\nfunc (c *CommitFile) GetBlobURL() string {\n\tif c == nil || c.BlobURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.BlobURL\n}\n\n// GetChanges returns the Changes field if it's non-nil, zero value otherwise.\nfunc (c *CommitFile) GetChanges() int {\n\tif c == nil || c.Changes == nil {\n\t\treturn 0\n\t}\n\treturn *c.Changes\n}\n\n// GetContentsURL returns the ContentsURL field if it's non-nil, zero value otherwise.\nfunc (c *CommitFile) GetContentsURL() string {\n\tif c == nil || c.ContentsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.ContentsURL\n}\n\n// GetDeletions returns the Deletions field if it's non-nil, zero value otherwise.\nfunc (c *CommitFile) GetDeletions() int {\n\tif c == nil || c.Deletions == nil {\n\t\treturn 0\n\t}\n\treturn *c.Deletions\n}\n\n// GetFilename returns the Filename field if it's non-nil, zero value otherwise.\nfunc (c *CommitFile) GetFilename() string {\n\tif c == nil || c.Filename == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Filename\n}\n\n// GetPatch returns the Patch field if it's non-nil, zero value otherwise.\nfunc (c *CommitFile) GetPatch() string {\n\tif c == nil || c.Patch == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Patch\n}\n\n// GetPreviousFilename returns the PreviousFilename field if it's non-nil, zero value otherwise.\nfunc (c *CommitFile) GetPreviousFilename() string {\n\tif c == nil || c.PreviousFilename == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.PreviousFilename\n}\n\n// GetRawURL returns the RawURL field if it's non-nil, zero value otherwise.\nfunc (c *CommitFile) GetRawURL() string {\n\tif c == nil || c.RawURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.RawURL\n}\n\n// GetSHA returns the SHA field if it's non-nil, zero value otherwise.\nfunc (c *CommitFile) GetSHA() string {\n\tif c == nil || c.SHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.SHA\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (c *CommitFile) GetStatus() string {\n\tif c == nil || c.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Status\n}\n\n// GetAuthor returns the Author field.\nfunc (c *CommitResult) GetAuthor() *User {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Author\n}\n\n// GetCommentsURL returns the CommentsURL field if it's non-nil, zero value otherwise.\nfunc (c *CommitResult) GetCommentsURL() string {\n\tif c == nil || c.CommentsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.CommentsURL\n}\n\n// GetCommit returns the Commit field.\nfunc (c *CommitResult) GetCommit() *Commit {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Commit\n}\n\n// GetCommitter returns the Committer field.\nfunc (c *CommitResult) GetCommitter() *User {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Committer\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (c *CommitResult) GetHTMLURL() string {\n\tif c == nil || c.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.HTMLURL\n}\n\n// GetParents returns the Parents slice if it's non-nil, nil otherwise.\nfunc (c *CommitResult) GetParents() []*Commit {\n\tif c == nil || c.Parents == nil {\n\t\treturn nil\n\t}\n\treturn c.Parents\n}\n\n// GetRepository returns the Repository field.\nfunc (c *CommitResult) GetRepository() *Repository {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Repository\n}\n\n// GetScore returns the Score field if it's non-nil, zero value otherwise.\nfunc (c *CommitResult) GetScore() float64 {\n\tif c == nil || c.Score == nil {\n\t\treturn 0\n\t}\n\treturn *c.Score\n}\n\n// GetSHA returns the SHA field if it's non-nil, zero value otherwise.\nfunc (c *CommitResult) GetSHA() string {\n\tif c == nil || c.SHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.SHA\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (c *CommitResult) GetURL() string {\n\tif c == nil || c.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.URL\n}\n\n// GetAheadBy returns the AheadBy field if it's non-nil, zero value otherwise.\nfunc (c *CommitsComparison) GetAheadBy() int {\n\tif c == nil || c.AheadBy == nil {\n\t\treturn 0\n\t}\n\treturn *c.AheadBy\n}\n\n// GetBaseCommit returns the BaseCommit field.\nfunc (c *CommitsComparison) GetBaseCommit() *RepositoryCommit {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.BaseCommit\n}\n\n// GetBehindBy returns the BehindBy field if it's non-nil, zero value otherwise.\nfunc (c *CommitsComparison) GetBehindBy() int {\n\tif c == nil || c.BehindBy == nil {\n\t\treturn 0\n\t}\n\treturn *c.BehindBy\n}\n\n// GetCommits returns the Commits slice if it's non-nil, nil otherwise.\nfunc (c *CommitsComparison) GetCommits() []*RepositoryCommit {\n\tif c == nil || c.Commits == nil {\n\t\treturn nil\n\t}\n\treturn c.Commits\n}\n\n// GetDiffURL returns the DiffURL field if it's non-nil, zero value otherwise.\nfunc (c *CommitsComparison) GetDiffURL() string {\n\tif c == nil || c.DiffURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.DiffURL\n}\n\n// GetFiles returns the Files slice if it's non-nil, nil otherwise.\nfunc (c *CommitsComparison) GetFiles() []*CommitFile {\n\tif c == nil || c.Files == nil {\n\t\treturn nil\n\t}\n\treturn c.Files\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (c *CommitsComparison) GetHTMLURL() string {\n\tif c == nil || c.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.HTMLURL\n}\n\n// GetMergeBaseCommit returns the MergeBaseCommit field.\nfunc (c *CommitsComparison) GetMergeBaseCommit() *RepositoryCommit {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.MergeBaseCommit\n}\n\n// GetPatchURL returns the PatchURL field if it's non-nil, zero value otherwise.\nfunc (c *CommitsComparison) GetPatchURL() string {\n\tif c == nil || c.PatchURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.PatchURL\n}\n\n// GetPermalinkURL returns the PermalinkURL field if it's non-nil, zero value otherwise.\nfunc (c *CommitsComparison) GetPermalinkURL() string {\n\tif c == nil || c.PermalinkURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.PermalinkURL\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (c *CommitsComparison) GetStatus() string {\n\tif c == nil || c.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Status\n}\n\n// GetTotalCommits returns the TotalCommits field if it's non-nil, zero value otherwise.\nfunc (c *CommitsComparison) GetTotalCommits() int {\n\tif c == nil || c.TotalCommits == nil {\n\t\treturn 0\n\t}\n\treturn *c.TotalCommits\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (c *CommitsComparison) GetURL() string {\n\tif c == nil || c.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.URL\n}\n\n// GetAuthor returns the Author field.\nfunc (c *CommitsListOptions) GetAuthor() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Author\n}\n\n// GetPath returns the Path field.\nfunc (c *CommitsListOptions) GetPath() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Path\n}\n\n// GetSHA returns the SHA field.\nfunc (c *CommitsListOptions) GetSHA() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.SHA\n}\n\n// GetSince returns the Since field.\nfunc (c *CommitsListOptions) GetSince() time.Time {\n\tif c == nil {\n\t\treturn time.Time{}\n\t}\n\treturn c.Since\n}\n\n// GetUntil returns the Until field.\nfunc (c *CommitsListOptions) GetUntil() time.Time {\n\tif c == nil {\n\t\treturn time.Time{}\n\t}\n\treturn c.Until\n}\n\n// GetCommits returns the Commits slice if it's non-nil, nil otherwise.\nfunc (c *CommitsSearchResult) GetCommits() []*CommitResult {\n\tif c == nil || c.Commits == nil {\n\t\treturn nil\n\t}\n\treturn c.Commits\n}\n\n// GetIncompleteResults returns the IncompleteResults field if it's non-nil, zero value otherwise.\nfunc (c *CommitsSearchResult) GetIncompleteResults() bool {\n\tif c == nil || c.IncompleteResults == nil {\n\t\treturn false\n\t}\n\treturn *c.IncompleteResults\n}\n\n// GetTotal returns the Total field if it's non-nil, zero value otherwise.\nfunc (c *CommitsSearchResult) GetTotal() int {\n\tif c == nil || c.Total == nil {\n\t\treturn 0\n\t}\n\treturn *c.Total\n}\n\n// GetAdditions returns the Additions field if it's non-nil, zero value otherwise.\nfunc (c *CommitStats) GetAdditions() int {\n\tif c == nil || c.Additions == nil {\n\t\treturn 0\n\t}\n\treturn *c.Additions\n}\n\n// GetDeletions returns the Deletions field if it's non-nil, zero value otherwise.\nfunc (c *CommitStats) GetDeletions() int {\n\tif c == nil || c.Deletions == nil {\n\t\treturn 0\n\t}\n\treturn *c.Deletions\n}\n\n// GetTotal returns the Total field if it's non-nil, zero value otherwise.\nfunc (c *CommitStats) GetTotal() int {\n\tif c == nil || c.Total == nil {\n\t\treturn 0\n\t}\n\treturn *c.Total\n}\n\n// GetCodeOfConduct returns the CodeOfConduct field.\nfunc (c *CommunityHealthFiles) GetCodeOfConduct() *Metric {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.CodeOfConduct\n}\n\n// GetCodeOfConductFile returns the CodeOfConductFile field.\nfunc (c *CommunityHealthFiles) GetCodeOfConductFile() *Metric {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.CodeOfConductFile\n}\n\n// GetContributing returns the Contributing field.\nfunc (c *CommunityHealthFiles) GetContributing() *Metric {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Contributing\n}\n\n// GetIssueTemplate returns the IssueTemplate field.\nfunc (c *CommunityHealthFiles) GetIssueTemplate() *Metric {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.IssueTemplate\n}\n\n// GetLicense returns the License field.\nfunc (c *CommunityHealthFiles) GetLicense() *Metric {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.License\n}\n\n// GetPullRequestTemplate returns the PullRequestTemplate field.\nfunc (c *CommunityHealthFiles) GetPullRequestTemplate() *Metric {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.PullRequestTemplate\n}\n\n// GetReadme returns the Readme field.\nfunc (c *CommunityHealthFiles) GetReadme() *Metric {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Readme\n}\n\n// GetContentReportsEnabled returns the ContentReportsEnabled field if it's non-nil, zero value otherwise.\nfunc (c *CommunityHealthMetrics) GetContentReportsEnabled() bool {\n\tif c == nil || c.ContentReportsEnabled == nil {\n\t\treturn false\n\t}\n\treturn *c.ContentReportsEnabled\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (c *CommunityHealthMetrics) GetDescription() string {\n\tif c == nil || c.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Description\n}\n\n// GetDocumentation returns the Documentation field if it's non-nil, zero value otherwise.\nfunc (c *CommunityHealthMetrics) GetDocumentation() string {\n\tif c == nil || c.Documentation == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Documentation\n}\n\n// GetFiles returns the Files field.\nfunc (c *CommunityHealthMetrics) GetFiles() *CommunityHealthFiles {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Files\n}\n\n// GetHealthPercentage returns the HealthPercentage field if it's non-nil, zero value otherwise.\nfunc (c *CommunityHealthMetrics) GetHealthPercentage() int {\n\tif c == nil || c.HealthPercentage == nil {\n\t\treturn 0\n\t}\n\treturn *c.HealthPercentage\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (c *CommunityHealthMetrics) GetUpdatedAt() Timestamp {\n\tif c == nil || c.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.UpdatedAt\n}\n\n// GetNodes returns the Nodes slice if it's non-nil, nil otherwise.\nfunc (c *ConfigApplyEvents) GetNodes() []*ConfigApplyEventsNode {\n\tif c == nil || c.Nodes == nil {\n\t\treturn nil\n\t}\n\treturn c.Nodes\n}\n\n// GetEvents returns the Events slice if it's non-nil, nil otherwise.\nfunc (c *ConfigApplyEventsNode) GetEvents() []*ConfigApplyEventsNodeEvent {\n\tif c == nil || c.Events == nil {\n\t\treturn nil\n\t}\n\treturn c.Events\n}\n\n// GetLastRequestID returns the LastRequestID field if it's non-nil, zero value otherwise.\nfunc (c *ConfigApplyEventsNode) GetLastRequestID() string {\n\tif c == nil || c.LastRequestID == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.LastRequestID\n}\n\n// GetNode returns the Node field if it's non-nil, zero value otherwise.\nfunc (c *ConfigApplyEventsNode) GetNode() string {\n\tif c == nil || c.Node == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Node\n}\n\n// GetBody returns the Body field if it's non-nil, zero value otherwise.\nfunc (c *ConfigApplyEventsNodeEvent) GetBody() string {\n\tif c == nil || c.Body == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Body\n}\n\n// GetConfigRunID returns the ConfigRunID field if it's non-nil, zero value otherwise.\nfunc (c *ConfigApplyEventsNodeEvent) GetConfigRunID() string {\n\tif c == nil || c.ConfigRunID == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.ConfigRunID\n}\n\n// GetEventName returns the EventName field if it's non-nil, zero value otherwise.\nfunc (c *ConfigApplyEventsNodeEvent) GetEventName() string {\n\tif c == nil || c.EventName == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.EventName\n}\n\n// GetHostname returns the Hostname field if it's non-nil, zero value otherwise.\nfunc (c *ConfigApplyEventsNodeEvent) GetHostname() string {\n\tif c == nil || c.Hostname == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Hostname\n}\n\n// GetSeverityText returns the SeverityText field if it's non-nil, zero value otherwise.\nfunc (c *ConfigApplyEventsNodeEvent) GetSeverityText() string {\n\tif c == nil || c.SeverityText == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.SeverityText\n}\n\n// GetSpanDepth returns the SpanDepth field if it's non-nil, zero value otherwise.\nfunc (c *ConfigApplyEventsNodeEvent) GetSpanDepth() int {\n\tif c == nil || c.SpanDepth == nil {\n\t\treturn 0\n\t}\n\treturn *c.SpanDepth\n}\n\n// GetSpanID returns the SpanID field if it's non-nil, zero value otherwise.\nfunc (c *ConfigApplyEventsNodeEvent) GetSpanID() string {\n\tif c == nil || c.SpanID == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.SpanID\n}\n\n// GetSpanParentID returns the SpanParentID field if it's non-nil, zero value otherwise.\nfunc (c *ConfigApplyEventsNodeEvent) GetSpanParentID() int64 {\n\tif c == nil || c.SpanParentID == nil {\n\t\treturn 0\n\t}\n\treturn *c.SpanParentID\n}\n\n// GetTimestamp returns the Timestamp field if it's non-nil, zero value otherwise.\nfunc (c *ConfigApplyEventsNodeEvent) GetTimestamp() Timestamp {\n\tif c == nil || c.Timestamp == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.Timestamp\n}\n\n// GetTopology returns the Topology field if it's non-nil, zero value otherwise.\nfunc (c *ConfigApplyEventsNodeEvent) GetTopology() string {\n\tif c == nil || c.Topology == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Topology\n}\n\n// GetTraceID returns the TraceID field if it's non-nil, zero value otherwise.\nfunc (c *ConfigApplyEventsNodeEvent) GetTraceID() string {\n\tif c == nil || c.TraceID == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.TraceID\n}\n\n// GetLastRequestID returns the LastRequestID field if it's non-nil, zero value otherwise.\nfunc (c *ConfigApplyEventsOptions) GetLastRequestID() string {\n\tif c == nil || c.LastRequestID == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.LastRequestID\n}\n\n// GetRunID returns the RunID field if it's non-nil, zero value otherwise.\nfunc (c *ConfigApplyOptions) GetRunID() string {\n\tif c == nil || c.RunID == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.RunID\n}\n\n// GetNodes returns the Nodes slice if it's non-nil, nil otherwise.\nfunc (c *ConfigApplyStatus) GetNodes() []*ConfigApplyStatusNode {\n\tif c == nil || c.Nodes == nil {\n\t\treturn nil\n\t}\n\treturn c.Nodes\n}\n\n// GetRunning returns the Running field if it's non-nil, zero value otherwise.\nfunc (c *ConfigApplyStatus) GetRunning() bool {\n\tif c == nil || c.Running == nil {\n\t\treturn false\n\t}\n\treturn *c.Running\n}\n\n// GetSuccessful returns the Successful field if it's non-nil, zero value otherwise.\nfunc (c *ConfigApplyStatus) GetSuccessful() bool {\n\tif c == nil || c.Successful == nil {\n\t\treturn false\n\t}\n\treturn *c.Successful\n}\n\n// GetHostname returns the Hostname field if it's non-nil, zero value otherwise.\nfunc (c *ConfigApplyStatusNode) GetHostname() string {\n\tif c == nil || c.Hostname == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Hostname\n}\n\n// GetRunID returns the RunID field if it's non-nil, zero value otherwise.\nfunc (c *ConfigApplyStatusNode) GetRunID() string {\n\tif c == nil || c.RunID == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.RunID\n}\n\n// GetRunning returns the Running field if it's non-nil, zero value otherwise.\nfunc (c *ConfigApplyStatusNode) GetRunning() bool {\n\tif c == nil || c.Running == nil {\n\t\treturn false\n\t}\n\treturn *c.Running\n}\n\n// GetSuccessful returns the Successful field if it's non-nil, zero value otherwise.\nfunc (c *ConfigApplyStatusNode) GetSuccessful() bool {\n\tif c == nil || c.Successful == nil {\n\t\treturn false\n\t}\n\treturn *c.Successful\n}\n\n// GetAdminPassword returns the AdminPassword field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettings) GetAdminPassword() string {\n\tif c == nil || c.AdminPassword == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.AdminPassword\n}\n\n// GetAssets returns the Assets field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettings) GetAssets() string {\n\tif c == nil || c.Assets == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Assets\n}\n\n// GetAuthMode returns the AuthMode field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettings) GetAuthMode() string {\n\tif c == nil || c.AuthMode == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.AuthMode\n}\n\n// GetAvatar returns the Avatar field.\nfunc (c *ConfigSettings) GetAvatar() *ConfigSettingsAvatar {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Avatar\n}\n\n// GetCAS returns the CAS field.\nfunc (c *ConfigSettings) GetCAS() *ConfigSettingsCAS {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.CAS\n}\n\n// GetCollectd returns the Collectd field.\nfunc (c *ConfigSettings) GetCollectd() *ConfigSettingsCollectd {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Collectd\n}\n\n// GetConfigurationID returns the ConfigurationID field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettings) GetConfigurationID() int64 {\n\tif c == nil || c.ConfigurationID == nil {\n\t\treturn 0\n\t}\n\treturn *c.ConfigurationID\n}\n\n// GetConfigurationRunCount returns the ConfigurationRunCount field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettings) GetConfigurationRunCount() int {\n\tif c == nil || c.ConfigurationRunCount == nil {\n\t\treturn 0\n\t}\n\treturn *c.ConfigurationRunCount\n}\n\n// GetCustomer returns the Customer field.\nfunc (c *ConfigSettings) GetCustomer() *ConfigSettingsCustomer {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Customer\n}\n\n// GetExpireSessions returns the ExpireSessions field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettings) GetExpireSessions() bool {\n\tif c == nil || c.ExpireSessions == nil {\n\t\treturn false\n\t}\n\treturn *c.ExpireSessions\n}\n\n// GetGithubHostname returns the GithubHostname field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettings) GetGithubHostname() string {\n\tif c == nil || c.GithubHostname == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.GithubHostname\n}\n\n// GetGithubOAuth returns the GithubOAuth field.\nfunc (c *ConfigSettings) GetGithubOAuth() *ConfigSettingsGithubOAuth {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.GithubOAuth\n}\n\n// GetGithubSSL returns the GithubSSL field.\nfunc (c *ConfigSettings) GetGithubSSL() *ConfigSettingsGithubSSL {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.GithubSSL\n}\n\n// GetHTTPProxy returns the HTTPProxy field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettings) GetHTTPProxy() string {\n\tif c == nil || c.HTTPProxy == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.HTTPProxy\n}\n\n// GetIdenticonsHost returns the IdenticonsHost field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettings) GetIdenticonsHost() string {\n\tif c == nil || c.IdenticonsHost == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.IdenticonsHost\n}\n\n// GetLDAP returns the LDAP field.\nfunc (c *ConfigSettings) GetLDAP() *ConfigSettingsLDAP {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.LDAP\n}\n\n// GetLicense returns the License field.\nfunc (c *ConfigSettings) GetLicense() *ConfigSettingsLicenseSettings {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.License\n}\n\n// GetLoadBalancer returns the LoadBalancer field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettings) GetLoadBalancer() string {\n\tif c == nil || c.LoadBalancer == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.LoadBalancer\n}\n\n// GetMapping returns the Mapping field.\nfunc (c *ConfigSettings) GetMapping() *ConfigSettingsMapping {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Mapping\n}\n\n// GetNTP returns the NTP field.\nfunc (c *ConfigSettings) GetNTP() *ConfigSettingsNTP {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.NTP\n}\n\n// GetPages returns the Pages field.\nfunc (c *ConfigSettings) GetPages() *ConfigSettingsPagesSettings {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Pages\n}\n\n// GetPrivateMode returns the PrivateMode field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettings) GetPrivateMode() bool {\n\tif c == nil || c.PrivateMode == nil {\n\t\treturn false\n\t}\n\treturn *c.PrivateMode\n}\n\n// GetPublicPages returns the PublicPages field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettings) GetPublicPages() bool {\n\tif c == nil || c.PublicPages == nil {\n\t\treturn false\n\t}\n\treturn *c.PublicPages\n}\n\n// GetSAML returns the SAML field.\nfunc (c *ConfigSettings) GetSAML() *ConfigSettingsSAML {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.SAML\n}\n\n// GetSignupEnabled returns the SignupEnabled field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettings) GetSignupEnabled() bool {\n\tif c == nil || c.SignupEnabled == nil {\n\t\treturn false\n\t}\n\treturn *c.SignupEnabled\n}\n\n// GetSMTP returns the SMTP field.\nfunc (c *ConfigSettings) GetSMTP() *ConfigSettingsSMTP {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.SMTP\n}\n\n// GetSNMP returns the SNMP field.\nfunc (c *ConfigSettings) GetSNMP() *ConfigSettingsSNMP {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.SNMP\n}\n\n// GetSubdomainIsolation returns the SubdomainIsolation field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettings) GetSubdomainIsolation() bool {\n\tif c == nil || c.SubdomainIsolation == nil {\n\t\treturn false\n\t}\n\treturn *c.SubdomainIsolation\n}\n\n// GetSyslog returns the Syslog field.\nfunc (c *ConfigSettings) GetSyslog() *ConfigSettingsSyslog {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Syslog\n}\n\n// GetTimezone returns the Timezone field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettings) GetTimezone() string {\n\tif c == nil || c.Timezone == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Timezone\n}\n\n// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsAvatar) GetEnabled() bool {\n\tif c == nil || c.Enabled == nil {\n\t\treturn false\n\t}\n\treturn *c.Enabled\n}\n\n// GetURI returns the URI field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsAvatar) GetURI() string {\n\tif c == nil || c.URI == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.URI\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsCAS) GetURL() string {\n\tif c == nil || c.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.URL\n}\n\n// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsCollectd) GetEnabled() bool {\n\tif c == nil || c.Enabled == nil {\n\t\treturn false\n\t}\n\treturn *c.Enabled\n}\n\n// GetEncryption returns the Encryption field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsCollectd) GetEncryption() string {\n\tif c == nil || c.Encryption == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Encryption\n}\n\n// GetPassword returns the Password field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsCollectd) GetPassword() string {\n\tif c == nil || c.Password == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Password\n}\n\n// GetPort returns the Port field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsCollectd) GetPort() int {\n\tif c == nil || c.Port == nil {\n\t\treturn 0\n\t}\n\treturn *c.Port\n}\n\n// GetServer returns the Server field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsCollectd) GetServer() string {\n\tif c == nil || c.Server == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Server\n}\n\n// GetUsername returns the Username field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsCollectd) GetUsername() string {\n\tif c == nil || c.Username == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Username\n}\n\n// GetEmail returns the Email field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsCustomer) GetEmail() string {\n\tif c == nil || c.Email == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Email\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsCustomer) GetName() string {\n\tif c == nil || c.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Name\n}\n\n// GetPublicKeyData returns the PublicKeyData field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsCustomer) GetPublicKeyData() string {\n\tif c == nil || c.PublicKeyData == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.PublicKeyData\n}\n\n// GetSecret returns the Secret field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsCustomer) GetSecret() string {\n\tif c == nil || c.Secret == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Secret\n}\n\n// GetUUID returns the UUID field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsCustomer) GetUUID() string {\n\tif c == nil || c.UUID == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.UUID\n}\n\n// GetClientID returns the ClientID field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsGithubOAuth) GetClientID() string {\n\tif c == nil || c.ClientID == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.ClientID\n}\n\n// GetClientSecret returns the ClientSecret field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsGithubOAuth) GetClientSecret() string {\n\tif c == nil || c.ClientSecret == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.ClientSecret\n}\n\n// GetOrganizationName returns the OrganizationName field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsGithubOAuth) GetOrganizationName() string {\n\tif c == nil || c.OrganizationName == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.OrganizationName\n}\n\n// GetOrganizationTeam returns the OrganizationTeam field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsGithubOAuth) GetOrganizationTeam() string {\n\tif c == nil || c.OrganizationTeam == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.OrganizationTeam\n}\n\n// GetCert returns the Cert field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsGithubSSL) GetCert() string {\n\tif c == nil || c.Cert == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Cert\n}\n\n// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsGithubSSL) GetEnabled() bool {\n\tif c == nil || c.Enabled == nil {\n\t\treturn false\n\t}\n\treturn *c.Enabled\n}\n\n// GetKey returns the Key field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsGithubSSL) GetKey() string {\n\tif c == nil || c.Key == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Key\n}\n\n// GetAdminGroup returns the AdminGroup field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLDAP) GetAdminGroup() string {\n\tif c == nil || c.AdminGroup == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.AdminGroup\n}\n\n// GetBase returns the Base slice if it's non-nil, nil otherwise.\nfunc (c *ConfigSettingsLDAP) GetBase() []string {\n\tif c == nil || c.Base == nil {\n\t\treturn nil\n\t}\n\treturn c.Base\n}\n\n// GetBindDN returns the BindDN field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLDAP) GetBindDN() string {\n\tif c == nil || c.BindDN == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.BindDN\n}\n\n// GetHost returns the Host field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLDAP) GetHost() string {\n\tif c == nil || c.Host == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Host\n}\n\n// GetMethod returns the Method field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLDAP) GetMethod() string {\n\tif c == nil || c.Method == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Method\n}\n\n// GetPassword returns the Password field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLDAP) GetPassword() string {\n\tif c == nil || c.Password == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Password\n}\n\n// GetPort returns the Port field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLDAP) GetPort() int {\n\tif c == nil || c.Port == nil {\n\t\treturn 0\n\t}\n\treturn *c.Port\n}\n\n// GetPosixSupport returns the PosixSupport field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLDAP) GetPosixSupport() bool {\n\tif c == nil || c.PosixSupport == nil {\n\t\treturn false\n\t}\n\treturn *c.PosixSupport\n}\n\n// GetProfile returns the Profile field.\nfunc (c *ConfigSettingsLDAP) GetProfile() *ConfigSettingsLDAPProfile {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Profile\n}\n\n// GetReconciliation returns the Reconciliation field.\nfunc (c *ConfigSettingsLDAP) GetReconciliation() *ConfigSettingsLDAPReconciliation {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Reconciliation\n}\n\n// GetRecursiveGroupSearch returns the RecursiveGroupSearch field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLDAP) GetRecursiveGroupSearch() bool {\n\tif c == nil || c.RecursiveGroupSearch == nil {\n\t\treturn false\n\t}\n\treturn *c.RecursiveGroupSearch\n}\n\n// GetSearchStrategy returns the SearchStrategy field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLDAP) GetSearchStrategy() string {\n\tif c == nil || c.SearchStrategy == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.SearchStrategy\n}\n\n// GetSyncEnabled returns the SyncEnabled field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLDAP) GetSyncEnabled() bool {\n\tif c == nil || c.SyncEnabled == nil {\n\t\treturn false\n\t}\n\treturn *c.SyncEnabled\n}\n\n// GetTeamSyncInterval returns the TeamSyncInterval field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLDAP) GetTeamSyncInterval() int {\n\tif c == nil || c.TeamSyncInterval == nil {\n\t\treturn 0\n\t}\n\treturn *c.TeamSyncInterval\n}\n\n// GetUID returns the UID field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLDAP) GetUID() string {\n\tif c == nil || c.UID == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.UID\n}\n\n// GetUserGroups returns the UserGroups slice if it's non-nil, nil otherwise.\nfunc (c *ConfigSettingsLDAP) GetUserGroups() []string {\n\tif c == nil || c.UserGroups == nil {\n\t\treturn nil\n\t}\n\treturn c.UserGroups\n}\n\n// GetUserSyncEmails returns the UserSyncEmails field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLDAP) GetUserSyncEmails() bool {\n\tif c == nil || c.UserSyncEmails == nil {\n\t\treturn false\n\t}\n\treturn *c.UserSyncEmails\n}\n\n// GetUserSyncInterval returns the UserSyncInterval field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLDAP) GetUserSyncInterval() int {\n\tif c == nil || c.UserSyncInterval == nil {\n\t\treturn 0\n\t}\n\treturn *c.UserSyncInterval\n}\n\n// GetUserSyncKeys returns the UserSyncKeys field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLDAP) GetUserSyncKeys() bool {\n\tif c == nil || c.UserSyncKeys == nil {\n\t\treturn false\n\t}\n\treturn *c.UserSyncKeys\n}\n\n// GetVirtualAttributeEnabled returns the VirtualAttributeEnabled field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLDAP) GetVirtualAttributeEnabled() bool {\n\tif c == nil || c.VirtualAttributeEnabled == nil {\n\t\treturn false\n\t}\n\treturn *c.VirtualAttributeEnabled\n}\n\n// GetKey returns the Key field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLDAPProfile) GetKey() string {\n\tif c == nil || c.Key == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Key\n}\n\n// GetMail returns the Mail field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLDAPProfile) GetMail() string {\n\tif c == nil || c.Mail == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Mail\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLDAPProfile) GetName() string {\n\tif c == nil || c.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Name\n}\n\n// GetUID returns the UID field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLDAPProfile) GetUID() string {\n\tif c == nil || c.UID == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.UID\n}\n\n// GetOrg returns the Org field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLDAPReconciliation) GetOrg() string {\n\tif c == nil || c.Org == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Org\n}\n\n// GetUser returns the User field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLDAPReconciliation) GetUser() string {\n\tif c == nil || c.User == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.User\n}\n\n// GetClusterSupport returns the ClusterSupport field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLicenseSettings) GetClusterSupport() bool {\n\tif c == nil || c.ClusterSupport == nil {\n\t\treturn false\n\t}\n\treturn *c.ClusterSupport\n}\n\n// GetEvaluation returns the Evaluation field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLicenseSettings) GetEvaluation() bool {\n\tif c == nil || c.Evaluation == nil {\n\t\treturn false\n\t}\n\treturn *c.Evaluation\n}\n\n// GetExpireAt returns the ExpireAt field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLicenseSettings) GetExpireAt() Timestamp {\n\tif c == nil || c.ExpireAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.ExpireAt\n}\n\n// GetPerpetual returns the Perpetual field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLicenseSettings) GetPerpetual() bool {\n\tif c == nil || c.Perpetual == nil {\n\t\treturn false\n\t}\n\treturn *c.Perpetual\n}\n\n// GetSeats returns the Seats field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLicenseSettings) GetSeats() int {\n\tif c == nil || c.Seats == nil {\n\t\treturn 0\n\t}\n\treturn *c.Seats\n}\n\n// GetSSHAllowed returns the SSHAllowed field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLicenseSettings) GetSSHAllowed() bool {\n\tif c == nil || c.SSHAllowed == nil {\n\t\treturn false\n\t}\n\treturn *c.SSHAllowed\n}\n\n// GetSupportKey returns the SupportKey field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLicenseSettings) GetSupportKey() string {\n\tif c == nil || c.SupportKey == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.SupportKey\n}\n\n// GetUnlimitedSeating returns the UnlimitedSeating field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsLicenseSettings) GetUnlimitedSeating() bool {\n\tif c == nil || c.UnlimitedSeating == nil {\n\t\treturn false\n\t}\n\treturn *c.UnlimitedSeating\n}\n\n// GetBasemap returns the Basemap field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsMapping) GetBasemap() string {\n\tif c == nil || c.Basemap == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Basemap\n}\n\n// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsMapping) GetEnabled() bool {\n\tif c == nil || c.Enabled == nil {\n\t\treturn false\n\t}\n\treturn *c.Enabled\n}\n\n// GetTileserver returns the Tileserver field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsMapping) GetTileserver() string {\n\tif c == nil || c.Tileserver == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Tileserver\n}\n\n// GetToken returns the Token field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsMapping) GetToken() string {\n\tif c == nil || c.Token == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Token\n}\n\n// GetPrimaryServer returns the PrimaryServer field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsNTP) GetPrimaryServer() string {\n\tif c == nil || c.PrimaryServer == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.PrimaryServer\n}\n\n// GetSecondaryServer returns the SecondaryServer field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsNTP) GetSecondaryServer() string {\n\tif c == nil || c.SecondaryServer == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.SecondaryServer\n}\n\n// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsPagesSettings) GetEnabled() bool {\n\tif c == nil || c.Enabled == nil {\n\t\treturn false\n\t}\n\treturn *c.Enabled\n}\n\n// GetCertificate returns the Certificate field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsSAML) GetCertificate() string {\n\tif c == nil || c.Certificate == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Certificate\n}\n\n// GetCertificatePath returns the CertificatePath field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsSAML) GetCertificatePath() string {\n\tif c == nil || c.CertificatePath == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.CertificatePath\n}\n\n// GetDisableAdminDemote returns the DisableAdminDemote field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsSAML) GetDisableAdminDemote() bool {\n\tif c == nil || c.DisableAdminDemote == nil {\n\t\treturn false\n\t}\n\treturn *c.DisableAdminDemote\n}\n\n// GetIDPInitiatedSSO returns the IDPInitiatedSSO field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsSAML) GetIDPInitiatedSSO() bool {\n\tif c == nil || c.IDPInitiatedSSO == nil {\n\t\treturn false\n\t}\n\treturn *c.IDPInitiatedSSO\n}\n\n// GetIssuer returns the Issuer field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsSAML) GetIssuer() string {\n\tif c == nil || c.Issuer == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Issuer\n}\n\n// GetSSOURL returns the SSOURL field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsSAML) GetSSOURL() string {\n\tif c == nil || c.SSOURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.SSOURL\n}\n\n// GetAddress returns the Address field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsSMTP) GetAddress() string {\n\tif c == nil || c.Address == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Address\n}\n\n// GetAuthentication returns the Authentication field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsSMTP) GetAuthentication() string {\n\tif c == nil || c.Authentication == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Authentication\n}\n\n// GetDiscardToNoreplyAddress returns the DiscardToNoreplyAddress field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsSMTP) GetDiscardToNoreplyAddress() bool {\n\tif c == nil || c.DiscardToNoreplyAddress == nil {\n\t\treturn false\n\t}\n\treturn *c.DiscardToNoreplyAddress\n}\n\n// GetDomain returns the Domain field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsSMTP) GetDomain() string {\n\tif c == nil || c.Domain == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Domain\n}\n\n// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsSMTP) GetEnabled() bool {\n\tif c == nil || c.Enabled == nil {\n\t\treturn false\n\t}\n\treturn *c.Enabled\n}\n\n// GetEnableStarttlsAuto returns the EnableStarttlsAuto field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsSMTP) GetEnableStarttlsAuto() bool {\n\tif c == nil || c.EnableStarttlsAuto == nil {\n\t\treturn false\n\t}\n\treturn *c.EnableStarttlsAuto\n}\n\n// GetNoreplyAddress returns the NoreplyAddress field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsSMTP) GetNoreplyAddress() string {\n\tif c == nil || c.NoreplyAddress == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.NoreplyAddress\n}\n\n// GetPassword returns the Password field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsSMTP) GetPassword() string {\n\tif c == nil || c.Password == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Password\n}\n\n// GetPort returns the Port field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsSMTP) GetPort() string {\n\tif c == nil || c.Port == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Port\n}\n\n// GetSupportAddress returns the SupportAddress field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsSMTP) GetSupportAddress() string {\n\tif c == nil || c.SupportAddress == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.SupportAddress\n}\n\n// GetSupportAddressType returns the SupportAddressType field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsSMTP) GetSupportAddressType() string {\n\tif c == nil || c.SupportAddressType == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.SupportAddressType\n}\n\n// GetUsername returns the Username field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsSMTP) GetUsername() string {\n\tif c == nil || c.Username == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Username\n}\n\n// GetUserName returns the UserName field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsSMTP) GetUserName() string {\n\tif c == nil || c.UserName == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.UserName\n}\n\n// GetCommunity returns the Community field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsSNMP) GetCommunity() string {\n\tif c == nil || c.Community == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Community\n}\n\n// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsSNMP) GetEnabled() bool {\n\tif c == nil || c.Enabled == nil {\n\t\treturn false\n\t}\n\treturn *c.Enabled\n}\n\n// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsSyslog) GetEnabled() bool {\n\tif c == nil || c.Enabled == nil {\n\t\treturn false\n\t}\n\treturn *c.Enabled\n}\n\n// GetProtocolName returns the ProtocolName field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsSyslog) GetProtocolName() string {\n\tif c == nil || c.ProtocolName == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.ProtocolName\n}\n\n// GetServer returns the Server field if it's non-nil, zero value otherwise.\nfunc (c *ConfigSettingsSyslog) GetServer() string {\n\tif c == nil || c.Server == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Server\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (c *ConnectionServiceItem) GetName() string {\n\tif c == nil || c.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Name\n}\n\n// GetNumber returns the Number field if it's non-nil, zero value otherwise.\nfunc (c *ConnectionServiceItem) GetNumber() int {\n\tif c == nil || c.Number == nil {\n\t\treturn 0\n\t}\n\treturn *c.Number\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (c *ContentReference) GetID() int64 {\n\tif c == nil || c.ID == nil {\n\t\treturn 0\n\t}\n\treturn *c.ID\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (c *ContentReference) GetNodeID() string {\n\tif c == nil || c.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.NodeID\n}\n\n// GetReference returns the Reference field if it's non-nil, zero value otherwise.\nfunc (c *ContentReference) GetReference() string {\n\tif c == nil || c.Reference == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Reference\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (c *ContentReferenceEvent) GetAction() string {\n\tif c == nil || c.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Action\n}\n\n// GetContentReference returns the ContentReference field.\nfunc (c *ContentReferenceEvent) GetContentReference() *ContentReference {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.ContentReference\n}\n\n// GetInstallation returns the Installation field.\nfunc (c *ContentReferenceEvent) GetInstallation() *Installation {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Installation\n}\n\n// GetRepo returns the Repo field.\nfunc (c *ContentReferenceEvent) GetRepo() *Repository {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (c *ContentReferenceEvent) GetSender() *User {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Sender\n}\n\n// GetAvatarURL returns the AvatarURL field if it's non-nil, zero value otherwise.\nfunc (c *Contributor) GetAvatarURL() string {\n\tif c == nil || c.AvatarURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.AvatarURL\n}\n\n// GetContributions returns the Contributions field if it's non-nil, zero value otherwise.\nfunc (c *Contributor) GetContributions() int {\n\tif c == nil || c.Contributions == nil {\n\t\treturn 0\n\t}\n\treturn *c.Contributions\n}\n\n// GetEmail returns the Email field if it's non-nil, zero value otherwise.\nfunc (c *Contributor) GetEmail() string {\n\tif c == nil || c.Email == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Email\n}\n\n// GetEventsURL returns the EventsURL field if it's non-nil, zero value otherwise.\nfunc (c *Contributor) GetEventsURL() string {\n\tif c == nil || c.EventsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.EventsURL\n}\n\n// GetFollowersURL returns the FollowersURL field if it's non-nil, zero value otherwise.\nfunc (c *Contributor) GetFollowersURL() string {\n\tif c == nil || c.FollowersURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.FollowersURL\n}\n\n// GetFollowingURL returns the FollowingURL field if it's non-nil, zero value otherwise.\nfunc (c *Contributor) GetFollowingURL() string {\n\tif c == nil || c.FollowingURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.FollowingURL\n}\n\n// GetGistsURL returns the GistsURL field if it's non-nil, zero value otherwise.\nfunc (c *Contributor) GetGistsURL() string {\n\tif c == nil || c.GistsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.GistsURL\n}\n\n// GetGravatarID returns the GravatarID field if it's non-nil, zero value otherwise.\nfunc (c *Contributor) GetGravatarID() string {\n\tif c == nil || c.GravatarID == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.GravatarID\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (c *Contributor) GetHTMLURL() string {\n\tif c == nil || c.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (c *Contributor) GetID() int64 {\n\tif c == nil || c.ID == nil {\n\t\treturn 0\n\t}\n\treturn *c.ID\n}\n\n// GetLogin returns the Login field if it's non-nil, zero value otherwise.\nfunc (c *Contributor) GetLogin() string {\n\tif c == nil || c.Login == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Login\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (c *Contributor) GetName() string {\n\tif c == nil || c.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Name\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (c *Contributor) GetNodeID() string {\n\tif c == nil || c.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.NodeID\n}\n\n// GetOrganizationsURL returns the OrganizationsURL field if it's non-nil, zero value otherwise.\nfunc (c *Contributor) GetOrganizationsURL() string {\n\tif c == nil || c.OrganizationsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.OrganizationsURL\n}\n\n// GetReceivedEventsURL returns the ReceivedEventsURL field if it's non-nil, zero value otherwise.\nfunc (c *Contributor) GetReceivedEventsURL() string {\n\tif c == nil || c.ReceivedEventsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.ReceivedEventsURL\n}\n\n// GetReposURL returns the ReposURL field if it's non-nil, zero value otherwise.\nfunc (c *Contributor) GetReposURL() string {\n\tif c == nil || c.ReposURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.ReposURL\n}\n\n// GetSiteAdmin returns the SiteAdmin field if it's non-nil, zero value otherwise.\nfunc (c *Contributor) GetSiteAdmin() bool {\n\tif c == nil || c.SiteAdmin == nil {\n\t\treturn false\n\t}\n\treturn *c.SiteAdmin\n}\n\n// GetStarredURL returns the StarredURL field if it's non-nil, zero value otherwise.\nfunc (c *Contributor) GetStarredURL() string {\n\tif c == nil || c.StarredURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.StarredURL\n}\n\n// GetSubscriptionsURL returns the SubscriptionsURL field if it's non-nil, zero value otherwise.\nfunc (c *Contributor) GetSubscriptionsURL() string {\n\tif c == nil || c.SubscriptionsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.SubscriptionsURL\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (c *Contributor) GetType() string {\n\tif c == nil || c.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Type\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (c *Contributor) GetURL() string {\n\tif c == nil || c.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.URL\n}\n\n// GetApprovalPolicy returns the ApprovalPolicy field.\nfunc (c *ContributorApprovalPermissions) GetApprovalPolicy() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.ApprovalPolicy\n}\n\n// GetAuthor returns the Author field.\nfunc (c *ContributorStats) GetAuthor() *Contributor {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Author\n}\n\n// GetTotal returns the Total field if it's non-nil, zero value otherwise.\nfunc (c *ContributorStats) GetTotal() int {\n\tif c == nil || c.Total == nil {\n\t\treturn 0\n\t}\n\treturn *c.Total\n}\n\n// GetWeeks returns the Weeks slice if it's non-nil, nil otherwise.\nfunc (c *ContributorStats) GetWeeks() []*WeeklyStats {\n\tif c == nil || c.Weeks == nil {\n\t\treturn nil\n\t}\n\treturn c.Weeks\n}\n\n// GetParameters returns the Parameters field.\nfunc (c *CopilotCodeReviewBranchRule) GetParameters() CopilotCodeReviewRuleParameters {\n\tif c == nil {\n\t\treturn CopilotCodeReviewRuleParameters{}\n\t}\n\treturn c.Parameters\n}\n\n// GetReviewDraftPullRequests returns the ReviewDraftPullRequests field.\nfunc (c *CopilotCodeReviewRuleParameters) GetReviewDraftPullRequests() bool {\n\tif c == nil {\n\t\treturn false\n\t}\n\treturn c.ReviewDraftPullRequests\n}\n\n// GetReviewOnPush returns the ReviewOnPush field.\nfunc (c *CopilotCodeReviewRuleParameters) GetReviewOnPush() bool {\n\tif c == nil {\n\t\treturn false\n\t}\n\treturn c.ReviewOnPush\n}\n\n// GetDownloadLinks returns the DownloadLinks slice if it's non-nil, nil otherwise.\nfunc (c *CopilotDailyMetricsReport) GetDownloadLinks() []string {\n\tif c == nil || c.DownloadLinks == nil {\n\t\treturn nil\n\t}\n\treturn c.DownloadLinks\n}\n\n// GetReportDay returns the ReportDay field.\nfunc (c *CopilotDailyMetricsReport) GetReportDay() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.ReportDay\n}\n\n// GetModels returns the Models slice if it's non-nil, nil otherwise.\nfunc (c *CopilotDotcomChat) GetModels() []*CopilotDotcomChatModel {\n\tif c == nil || c.Models == nil {\n\t\treturn nil\n\t}\n\treturn c.Models\n}\n\n// GetTotalEngagedUsers returns the TotalEngagedUsers field.\nfunc (c *CopilotDotcomChat) GetTotalEngagedUsers() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.TotalEngagedUsers\n}\n\n// GetCustomModelTrainingDate returns the CustomModelTrainingDate field if it's non-nil, zero value otherwise.\nfunc (c *CopilotDotcomChatModel) GetCustomModelTrainingDate() string {\n\tif c == nil || c.CustomModelTrainingDate == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.CustomModelTrainingDate\n}\n\n// GetIsCustomModel returns the IsCustomModel field.\nfunc (c *CopilotDotcomChatModel) GetIsCustomModel() bool {\n\tif c == nil {\n\t\treturn false\n\t}\n\treturn c.IsCustomModel\n}\n\n// GetName returns the Name field.\nfunc (c *CopilotDotcomChatModel) GetName() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Name\n}\n\n// GetTotalChats returns the TotalChats field.\nfunc (c *CopilotDotcomChatModel) GetTotalChats() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.TotalChats\n}\n\n// GetTotalEngagedUsers returns the TotalEngagedUsers field.\nfunc (c *CopilotDotcomChatModel) GetTotalEngagedUsers() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.TotalEngagedUsers\n}\n\n// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise.\nfunc (c *CopilotDotcomPullRequests) GetRepositories() []*CopilotDotcomPullRequestsRepository {\n\tif c == nil || c.Repositories == nil {\n\t\treturn nil\n\t}\n\treturn c.Repositories\n}\n\n// GetTotalEngagedUsers returns the TotalEngagedUsers field.\nfunc (c *CopilotDotcomPullRequests) GetTotalEngagedUsers() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.TotalEngagedUsers\n}\n\n// GetCustomModelTrainingDate returns the CustomModelTrainingDate field if it's non-nil, zero value otherwise.\nfunc (c *CopilotDotcomPullRequestsModel) GetCustomModelTrainingDate() string {\n\tif c == nil || c.CustomModelTrainingDate == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.CustomModelTrainingDate\n}\n\n// GetIsCustomModel returns the IsCustomModel field.\nfunc (c *CopilotDotcomPullRequestsModel) GetIsCustomModel() bool {\n\tif c == nil {\n\t\treturn false\n\t}\n\treturn c.IsCustomModel\n}\n\n// GetName returns the Name field.\nfunc (c *CopilotDotcomPullRequestsModel) GetName() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Name\n}\n\n// GetTotalEngagedUsers returns the TotalEngagedUsers field.\nfunc (c *CopilotDotcomPullRequestsModel) GetTotalEngagedUsers() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.TotalEngagedUsers\n}\n\n// GetTotalPRSummariesCreated returns the TotalPRSummariesCreated field.\nfunc (c *CopilotDotcomPullRequestsModel) GetTotalPRSummariesCreated() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.TotalPRSummariesCreated\n}\n\n// GetModels returns the Models slice if it's non-nil, nil otherwise.\nfunc (c *CopilotDotcomPullRequestsRepository) GetModels() []*CopilotDotcomPullRequestsModel {\n\tif c == nil || c.Models == nil {\n\t\treturn nil\n\t}\n\treturn c.Models\n}\n\n// GetName returns the Name field.\nfunc (c *CopilotDotcomPullRequestsRepository) GetName() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Name\n}\n\n// GetTotalEngagedUsers returns the TotalEngagedUsers field.\nfunc (c *CopilotDotcomPullRequestsRepository) GetTotalEngagedUsers() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.TotalEngagedUsers\n}\n\n// GetEditors returns the Editors slice if it's non-nil, nil otherwise.\nfunc (c *CopilotIDEChat) GetEditors() []*CopilotIDEChatEditor {\n\tif c == nil || c.Editors == nil {\n\t\treturn nil\n\t}\n\treturn c.Editors\n}\n\n// GetTotalEngagedUsers returns the TotalEngagedUsers field.\nfunc (c *CopilotIDEChat) GetTotalEngagedUsers() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.TotalEngagedUsers\n}\n\n// GetModels returns the Models slice if it's non-nil, nil otherwise.\nfunc (c *CopilotIDEChatEditor) GetModels() []*CopilotIDEChatModel {\n\tif c == nil || c.Models == nil {\n\t\treturn nil\n\t}\n\treturn c.Models\n}\n\n// GetName returns the Name field.\nfunc (c *CopilotIDEChatEditor) GetName() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Name\n}\n\n// GetTotalEngagedUsers returns the TotalEngagedUsers field.\nfunc (c *CopilotIDEChatEditor) GetTotalEngagedUsers() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.TotalEngagedUsers\n}\n\n// GetCustomModelTrainingDate returns the CustomModelTrainingDate field if it's non-nil, zero value otherwise.\nfunc (c *CopilotIDEChatModel) GetCustomModelTrainingDate() string {\n\tif c == nil || c.CustomModelTrainingDate == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.CustomModelTrainingDate\n}\n\n// GetIsCustomModel returns the IsCustomModel field.\nfunc (c *CopilotIDEChatModel) GetIsCustomModel() bool {\n\tif c == nil {\n\t\treturn false\n\t}\n\treturn c.IsCustomModel\n}\n\n// GetName returns the Name field.\nfunc (c *CopilotIDEChatModel) GetName() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Name\n}\n\n// GetTotalChatCopyEvents returns the TotalChatCopyEvents field.\nfunc (c *CopilotIDEChatModel) GetTotalChatCopyEvents() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.TotalChatCopyEvents\n}\n\n// GetTotalChatInsertionEvents returns the TotalChatInsertionEvents field.\nfunc (c *CopilotIDEChatModel) GetTotalChatInsertionEvents() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.TotalChatInsertionEvents\n}\n\n// GetTotalChats returns the TotalChats field.\nfunc (c *CopilotIDEChatModel) GetTotalChats() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.TotalChats\n}\n\n// GetTotalEngagedUsers returns the TotalEngagedUsers field.\nfunc (c *CopilotIDEChatModel) GetTotalEngagedUsers() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.TotalEngagedUsers\n}\n\n// GetEditors returns the Editors slice if it's non-nil, nil otherwise.\nfunc (c *CopilotIDECodeCompletions) GetEditors() []*CopilotIDECodeCompletionsEditor {\n\tif c == nil || c.Editors == nil {\n\t\treturn nil\n\t}\n\treturn c.Editors\n}\n\n// GetLanguages returns the Languages slice if it's non-nil, nil otherwise.\nfunc (c *CopilotIDECodeCompletions) GetLanguages() []*CopilotIDECodeCompletionsLanguage {\n\tif c == nil || c.Languages == nil {\n\t\treturn nil\n\t}\n\treturn c.Languages\n}\n\n// GetTotalEngagedUsers returns the TotalEngagedUsers field.\nfunc (c *CopilotIDECodeCompletions) GetTotalEngagedUsers() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.TotalEngagedUsers\n}\n\n// GetModels returns the Models slice if it's non-nil, nil otherwise.\nfunc (c *CopilotIDECodeCompletionsEditor) GetModels() []*CopilotIDECodeCompletionsModel {\n\tif c == nil || c.Models == nil {\n\t\treturn nil\n\t}\n\treturn c.Models\n}\n\n// GetName returns the Name field.\nfunc (c *CopilotIDECodeCompletionsEditor) GetName() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Name\n}\n\n// GetTotalEngagedUsers returns the TotalEngagedUsers field.\nfunc (c *CopilotIDECodeCompletionsEditor) GetTotalEngagedUsers() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.TotalEngagedUsers\n}\n\n// GetName returns the Name field.\nfunc (c *CopilotIDECodeCompletionsLanguage) GetName() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Name\n}\n\n// GetTotalEngagedUsers returns the TotalEngagedUsers field.\nfunc (c *CopilotIDECodeCompletionsLanguage) GetTotalEngagedUsers() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.TotalEngagedUsers\n}\n\n// GetCustomModelTrainingDate returns the CustomModelTrainingDate field if it's non-nil, zero value otherwise.\nfunc (c *CopilotIDECodeCompletionsModel) GetCustomModelTrainingDate() string {\n\tif c == nil || c.CustomModelTrainingDate == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.CustomModelTrainingDate\n}\n\n// GetIsCustomModel returns the IsCustomModel field.\nfunc (c *CopilotIDECodeCompletionsModel) GetIsCustomModel() bool {\n\tif c == nil {\n\t\treturn false\n\t}\n\treturn c.IsCustomModel\n}\n\n// GetLanguages returns the Languages slice if it's non-nil, nil otherwise.\nfunc (c *CopilotIDECodeCompletionsModel) GetLanguages() []*CopilotIDECodeCompletionsModelLanguage {\n\tif c == nil || c.Languages == nil {\n\t\treturn nil\n\t}\n\treturn c.Languages\n}\n\n// GetName returns the Name field.\nfunc (c *CopilotIDECodeCompletionsModel) GetName() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Name\n}\n\n// GetTotalEngagedUsers returns the TotalEngagedUsers field.\nfunc (c *CopilotIDECodeCompletionsModel) GetTotalEngagedUsers() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.TotalEngagedUsers\n}\n\n// GetName returns the Name field.\nfunc (c *CopilotIDECodeCompletionsModelLanguage) GetName() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Name\n}\n\n// GetTotalCodeAcceptances returns the TotalCodeAcceptances field.\nfunc (c *CopilotIDECodeCompletionsModelLanguage) GetTotalCodeAcceptances() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.TotalCodeAcceptances\n}\n\n// GetTotalCodeLinesAccepted returns the TotalCodeLinesAccepted field.\nfunc (c *CopilotIDECodeCompletionsModelLanguage) GetTotalCodeLinesAccepted() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.TotalCodeLinesAccepted\n}\n\n// GetTotalCodeLinesSuggested returns the TotalCodeLinesSuggested field.\nfunc (c *CopilotIDECodeCompletionsModelLanguage) GetTotalCodeLinesSuggested() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.TotalCodeLinesSuggested\n}\n\n// GetTotalCodeSuggestions returns the TotalCodeSuggestions field.\nfunc (c *CopilotIDECodeCompletionsModelLanguage) GetTotalCodeSuggestions() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.TotalCodeSuggestions\n}\n\n// GetTotalEngagedUsers returns the TotalEngagedUsers field.\nfunc (c *CopilotIDECodeCompletionsModelLanguage) GetTotalEngagedUsers() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.TotalEngagedUsers\n}\n\n// GetCopilotDotcomChat returns the CopilotDotcomChat field.\nfunc (c *CopilotMetrics) GetCopilotDotcomChat() *CopilotDotcomChat {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.CopilotDotcomChat\n}\n\n// GetCopilotDotcomPullRequests returns the CopilotDotcomPullRequests field.\nfunc (c *CopilotMetrics) GetCopilotDotcomPullRequests() *CopilotDotcomPullRequests {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.CopilotDotcomPullRequests\n}\n\n// GetCopilotIDEChat returns the CopilotIDEChat field.\nfunc (c *CopilotMetrics) GetCopilotIDEChat() *CopilotIDEChat {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.CopilotIDEChat\n}\n\n// GetCopilotIDECodeCompletions returns the CopilotIDECodeCompletions field.\nfunc (c *CopilotMetrics) GetCopilotIDECodeCompletions() *CopilotIDECodeCompletions {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.CopilotIDECodeCompletions\n}\n\n// GetDate returns the Date field.\nfunc (c *CopilotMetrics) GetDate() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Date\n}\n\n// GetTotalActiveUsers returns the TotalActiveUsers field if it's non-nil, zero value otherwise.\nfunc (c *CopilotMetrics) GetTotalActiveUsers() int {\n\tif c == nil || c.TotalActiveUsers == nil {\n\t\treturn 0\n\t}\n\treturn *c.TotalActiveUsers\n}\n\n// GetTotalEngagedUsers returns the TotalEngagedUsers field if it's non-nil, zero value otherwise.\nfunc (c *CopilotMetrics) GetTotalEngagedUsers() int {\n\tif c == nil || c.TotalEngagedUsers == nil {\n\t\treturn 0\n\t}\n\treturn *c.TotalEngagedUsers\n}\n\n// GetSince returns the Since field if it's non-nil, zero value otherwise.\nfunc (c *CopilotMetricsListOptions) GetSince() time.Time {\n\tif c == nil || c.Since == nil {\n\t\treturn time.Time{}\n\t}\n\treturn *c.Since\n}\n\n// GetUntil returns the Until field if it's non-nil, zero value otherwise.\nfunc (c *CopilotMetricsListOptions) GetUntil() time.Time {\n\tif c == nil || c.Until == nil {\n\t\treturn time.Time{}\n\t}\n\treturn *c.Until\n}\n\n// GetDownloadLinks returns the DownloadLinks slice if it's non-nil, nil otherwise.\nfunc (c *CopilotMetricsReport) GetDownloadLinks() []string {\n\tif c == nil || c.DownloadLinks == nil {\n\t\treturn nil\n\t}\n\treturn c.DownloadLinks\n}\n\n// GetReportEndDay returns the ReportEndDay field.\nfunc (c *CopilotMetricsReport) GetReportEndDay() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.ReportEndDay\n}\n\n// GetReportStartDay returns the ReportStartDay field.\nfunc (c *CopilotMetricsReport) GetReportStartDay() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.ReportStartDay\n}\n\n// GetDay returns the Day field.\nfunc (c *CopilotMetricsReportOptions) GetDay() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Day\n}\n\n// GetCopilotChat returns the CopilotChat field.\nfunc (c *CopilotOrganizationDetails) GetCopilotChat() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.CopilotChat\n}\n\n// GetPublicCodeSuggestions returns the PublicCodeSuggestions field.\nfunc (c *CopilotOrganizationDetails) GetPublicCodeSuggestions() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.PublicCodeSuggestions\n}\n\n// GetSeatBreakdown returns the SeatBreakdown field.\nfunc (c *CopilotOrganizationDetails) GetSeatBreakdown() *CopilotSeatBreakdown {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.SeatBreakdown\n}\n\n// GetSeatManagementSetting returns the SeatManagementSetting field.\nfunc (c *CopilotOrganizationDetails) GetSeatManagementSetting() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.SeatManagementSetting\n}\n\n// GetActiveThisCycle returns the ActiveThisCycle field.\nfunc (c *CopilotSeatBreakdown) GetActiveThisCycle() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.ActiveThisCycle\n}\n\n// GetAddedThisCycle returns the AddedThisCycle field.\nfunc (c *CopilotSeatBreakdown) GetAddedThisCycle() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.AddedThisCycle\n}\n\n// GetInactiveThisCycle returns the InactiveThisCycle field.\nfunc (c *CopilotSeatBreakdown) GetInactiveThisCycle() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.InactiveThisCycle\n}\n\n// GetPendingCancellation returns the PendingCancellation field.\nfunc (c *CopilotSeatBreakdown) GetPendingCancellation() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.PendingCancellation\n}\n\n// GetPendingInvitation returns the PendingInvitation field.\nfunc (c *CopilotSeatBreakdown) GetPendingInvitation() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.PendingInvitation\n}\n\n// GetTotal returns the Total field.\nfunc (c *CopilotSeatBreakdown) GetTotal() int {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.Total\n}\n\n// GetAssignee returns the Assignee field.\nfunc (c *CopilotSeatDetails) GetAssignee() any {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Assignee\n}\n\n// GetAssigningTeam returns the AssigningTeam field.\nfunc (c *CopilotSeatDetails) GetAssigningTeam() *Team {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.AssigningTeam\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (c *CopilotSeatDetails) GetCreatedAt() Timestamp {\n\tif c == nil || c.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.CreatedAt\n}\n\n// GetLastActivityAt returns the LastActivityAt field if it's non-nil, zero value otherwise.\nfunc (c *CopilotSeatDetails) GetLastActivityAt() Timestamp {\n\tif c == nil || c.LastActivityAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.LastActivityAt\n}\n\n// GetLastActivityEditor returns the LastActivityEditor field if it's non-nil, zero value otherwise.\nfunc (c *CopilotSeatDetails) GetLastActivityEditor() string {\n\tif c == nil || c.LastActivityEditor == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.LastActivityEditor\n}\n\n// GetPendingCancellationDate returns the PendingCancellationDate field if it's non-nil, zero value otherwise.\nfunc (c *CopilotSeatDetails) GetPendingCancellationDate() string {\n\tif c == nil || c.PendingCancellationDate == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.PendingCancellationDate\n}\n\n// GetPlanType returns the PlanType field if it's non-nil, zero value otherwise.\nfunc (c *CopilotSeatDetails) GetPlanType() string {\n\tif c == nil || c.PlanType == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.PlanType\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (c *CopilotSeatDetails) GetUpdatedAt() Timestamp {\n\tif c == nil || c.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.UpdatedAt\n}\n\n// GetAzureSubscription returns the AzureSubscription field if it's non-nil, zero value otherwise.\nfunc (c *CostCenter) GetAzureSubscription() string {\n\tif c == nil || c.AzureSubscription == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.AzureSubscription\n}\n\n// GetID returns the ID field.\nfunc (c *CostCenter) GetID() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.ID\n}\n\n// GetName returns the Name field.\nfunc (c *CostCenter) GetName() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Name\n}\n\n// GetResources returns the Resources slice if it's non-nil, nil otherwise.\nfunc (c *CostCenter) GetResources() []*CostCenterResource {\n\tif c == nil || c.Resources == nil {\n\t\treturn nil\n\t}\n\treturn c.Resources\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (c *CostCenter) GetState() string {\n\tif c == nil || c.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.State\n}\n\n// GetName returns the Name field.\nfunc (c *CostCenterRequest) GetName() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Name\n}\n\n// GetName returns the Name field.\nfunc (c *CostCenterResource) GetName() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Name\n}\n\n// GetType returns the Type field.\nfunc (c *CostCenterResource) GetType() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Type\n}\n\n// GetOrganizations returns the Organizations slice if it's non-nil, nil otherwise.\nfunc (c *CostCenterResourceRequest) GetOrganizations() []string {\n\tif c == nil || c.Organizations == nil {\n\t\treturn nil\n\t}\n\treturn c.Organizations\n}\n\n// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise.\nfunc (c *CostCenterResourceRequest) GetRepositories() []string {\n\tif c == nil || c.Repositories == nil {\n\t\treturn nil\n\t}\n\treturn c.Repositories\n}\n\n// GetUsers returns the Users slice if it's non-nil, nil otherwise.\nfunc (c *CostCenterResourceRequest) GetUsers() []string {\n\tif c == nil || c.Users == nil {\n\t\treturn nil\n\t}\n\treturn c.Users\n}\n\n// GetCostCenters returns the CostCenters slice if it's non-nil, nil otherwise.\nfunc (c *CostCenters) GetCostCenters() []*CostCenter {\n\tif c == nil || c.CostCenters == nil {\n\t\treturn nil\n\t}\n\treturn c.CostCenters\n}\n\n// GetCluster returns the Cluster field if it's non-nil, zero value otherwise.\nfunc (c *CreateArtifactDeploymentRequest) GetCluster() string {\n\tif c == nil || c.Cluster == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Cluster\n}\n\n// GetDeploymentName returns the DeploymentName field.\nfunc (c *CreateArtifactDeploymentRequest) GetDeploymentName() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.DeploymentName\n}\n\n// GetDigest returns the Digest field.\nfunc (c *CreateArtifactDeploymentRequest) GetDigest() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Digest\n}\n\n// GetGithubRepository returns the GithubRepository field if it's non-nil, zero value otherwise.\nfunc (c *CreateArtifactDeploymentRequest) GetGithubRepository() string {\n\tif c == nil || c.GithubRepository == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.GithubRepository\n}\n\n// GetLogicalEnvironment returns the LogicalEnvironment field.\nfunc (c *CreateArtifactDeploymentRequest) GetLogicalEnvironment() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.LogicalEnvironment\n}\n\n// GetName returns the Name field.\nfunc (c *CreateArtifactDeploymentRequest) GetName() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Name\n}\n\n// GetPhysicalEnvironment returns the PhysicalEnvironment field if it's non-nil, zero value otherwise.\nfunc (c *CreateArtifactDeploymentRequest) GetPhysicalEnvironment() string {\n\tif c == nil || c.PhysicalEnvironment == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.PhysicalEnvironment\n}\n\n// GetRuntimeRisks returns the RuntimeRisks slice if it's non-nil, nil otherwise.\nfunc (c *CreateArtifactDeploymentRequest) GetRuntimeRisks() []DeploymentRuntimeRisk {\n\tif c == nil || c.RuntimeRisks == nil {\n\t\treturn nil\n\t}\n\treturn c.RuntimeRisks\n}\n\n// GetStatus returns the Status field.\nfunc (c *CreateArtifactDeploymentRequest) GetStatus() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Status\n}\n\n// GetTags returns the Tags map if it's non-nil, an empty map otherwise.\nfunc (c *CreateArtifactDeploymentRequest) GetTags() map[string]string {\n\tif c == nil || c.Tags == nil {\n\t\treturn map[string]string{}\n\t}\n\treturn c.Tags\n}\n\n// GetVersion returns the Version field if it's non-nil, zero value otherwise.\nfunc (c *CreateArtifactDeploymentRequest) GetVersion() string {\n\tif c == nil || c.Version == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Version\n}\n\n// GetArtifactURL returns the ArtifactURL field if it's non-nil, zero value otherwise.\nfunc (c *CreateArtifactStorageRequest) GetArtifactURL() string {\n\tif c == nil || c.ArtifactURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.ArtifactURL\n}\n\n// GetDigest returns the Digest field.\nfunc (c *CreateArtifactStorageRequest) GetDigest() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Digest\n}\n\n// GetGithubRepository returns the GithubRepository field if it's non-nil, zero value otherwise.\nfunc (c *CreateArtifactStorageRequest) GetGithubRepository() string {\n\tif c == nil || c.GithubRepository == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.GithubRepository\n}\n\n// GetName returns the Name field.\nfunc (c *CreateArtifactStorageRequest) GetName() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Name\n}\n\n// GetPath returns the Path field if it's non-nil, zero value otherwise.\nfunc (c *CreateArtifactStorageRequest) GetPath() string {\n\tif c == nil || c.Path == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Path\n}\n\n// GetRegistryURL returns the RegistryURL field.\nfunc (c *CreateArtifactStorageRequest) GetRegistryURL() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.RegistryURL\n}\n\n// GetRepository returns the Repository field if it's non-nil, zero value otherwise.\nfunc (c *CreateArtifactStorageRequest) GetRepository() string {\n\tif c == nil || c.Repository == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Repository\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (c *CreateArtifactStorageRequest) GetStatus() string {\n\tif c == nil || c.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Status\n}\n\n// GetVersion returns the Version field if it's non-nil, zero value otherwise.\nfunc (c *CreateArtifactStorageRequest) GetVersion() string {\n\tif c == nil || c.Version == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Version\n}\n\n// GetActions returns the Actions slice if it's non-nil, nil otherwise.\nfunc (c *CreateCheckRunOptions) GetActions() []*CheckRunAction {\n\tif c == nil || c.Actions == nil {\n\t\treturn nil\n\t}\n\treturn c.Actions\n}\n\n// GetCompletedAt returns the CompletedAt field if it's non-nil, zero value otherwise.\nfunc (c *CreateCheckRunOptions) GetCompletedAt() Timestamp {\n\tif c == nil || c.CompletedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.CompletedAt\n}\n\n// GetConclusion returns the Conclusion field if it's non-nil, zero value otherwise.\nfunc (c *CreateCheckRunOptions) GetConclusion() string {\n\tif c == nil || c.Conclusion == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Conclusion\n}\n\n// GetDetailsURL returns the DetailsURL field if it's non-nil, zero value otherwise.\nfunc (c *CreateCheckRunOptions) GetDetailsURL() string {\n\tif c == nil || c.DetailsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.DetailsURL\n}\n\n// GetExternalID returns the ExternalID field if it's non-nil, zero value otherwise.\nfunc (c *CreateCheckRunOptions) GetExternalID() string {\n\tif c == nil || c.ExternalID == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.ExternalID\n}\n\n// GetHeadSHA returns the HeadSHA field.\nfunc (c *CreateCheckRunOptions) GetHeadSHA() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.HeadSHA\n}\n\n// GetName returns the Name field.\nfunc (c *CreateCheckRunOptions) GetName() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Name\n}\n\n// GetOutput returns the Output field.\nfunc (c *CreateCheckRunOptions) GetOutput() *CheckRunOutput {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Output\n}\n\n// GetStartedAt returns the StartedAt field if it's non-nil, zero value otherwise.\nfunc (c *CreateCheckRunOptions) GetStartedAt() Timestamp {\n\tif c == nil || c.StartedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.StartedAt\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (c *CreateCheckRunOptions) GetStatus() string {\n\tif c == nil || c.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Status\n}\n\n// GetHeadBranch returns the HeadBranch field if it's non-nil, zero value otherwise.\nfunc (c *CreateCheckSuiteOptions) GetHeadBranch() string {\n\tif c == nil || c.HeadBranch == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.HeadBranch\n}\n\n// GetHeadSHA returns the HeadSHA field.\nfunc (c *CreateCheckSuiteOptions) GetHeadSHA() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.HeadSHA\n}\n\n// GetClientIP returns the ClientIP field if it's non-nil, zero value otherwise.\nfunc (c *CreateCodespaceOptions) GetClientIP() string {\n\tif c == nil || c.ClientIP == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.ClientIP\n}\n\n// GetDevcontainerPath returns the DevcontainerPath field if it's non-nil, zero value otherwise.\nfunc (c *CreateCodespaceOptions) GetDevcontainerPath() string {\n\tif c == nil || c.DevcontainerPath == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.DevcontainerPath\n}\n\n// GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise.\nfunc (c *CreateCodespaceOptions) GetDisplayName() string {\n\tif c == nil || c.DisplayName == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.DisplayName\n}\n\n// GetGeo returns the Geo field if it's non-nil, zero value otherwise.\nfunc (c *CreateCodespaceOptions) GetGeo() string {\n\tif c == nil || c.Geo == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Geo\n}\n\n// GetIdleTimeoutMinutes returns the IdleTimeoutMinutes field if it's non-nil, zero value otherwise.\nfunc (c *CreateCodespaceOptions) GetIdleTimeoutMinutes() int {\n\tif c == nil || c.IdleTimeoutMinutes == nil {\n\t\treturn 0\n\t}\n\treturn *c.IdleTimeoutMinutes\n}\n\n// GetLocation returns the Location field if it's non-nil, zero value otherwise.\nfunc (c *CreateCodespaceOptions) GetLocation() string {\n\tif c == nil || c.Location == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Location\n}\n\n// GetMachine returns the Machine field if it's non-nil, zero value otherwise.\nfunc (c *CreateCodespaceOptions) GetMachine() string {\n\tif c == nil || c.Machine == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Machine\n}\n\n// GetMultiRepoPermissionsOptOut returns the MultiRepoPermissionsOptOut field if it's non-nil, zero value otherwise.\nfunc (c *CreateCodespaceOptions) GetMultiRepoPermissionsOptOut() bool {\n\tif c == nil || c.MultiRepoPermissionsOptOut == nil {\n\t\treturn false\n\t}\n\treturn *c.MultiRepoPermissionsOptOut\n}\n\n// GetRef returns the Ref field if it's non-nil, zero value otherwise.\nfunc (c *CreateCodespaceOptions) GetRef() string {\n\tif c == nil || c.Ref == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Ref\n}\n\n// GetRetentionPeriodMinutes returns the RetentionPeriodMinutes field if it's non-nil, zero value otherwise.\nfunc (c *CreateCodespaceOptions) GetRetentionPeriodMinutes() int {\n\tif c == nil || c.RetentionPeriodMinutes == nil {\n\t\treturn 0\n\t}\n\treturn *c.RetentionPeriodMinutes\n}\n\n// GetWorkingDirectory returns the WorkingDirectory field if it's non-nil, zero value otherwise.\nfunc (c *CreateCodespaceOptions) GetWorkingDirectory() string {\n\tif c == nil || c.WorkingDirectory == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.WorkingDirectory\n}\n\n// GetSigner returns the Signer field.\nfunc (c *CreateCommitOptions) GetSigner() MessageSigner {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Signer\n}\n\n// GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise.\nfunc (c *CreateCustomOrgRoleRequest) GetBaseRole() string {\n\tif c == nil || c.BaseRole == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.BaseRole\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (c *CreateCustomOrgRoleRequest) GetDescription() string {\n\tif c == nil || c.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Description\n}\n\n// GetName returns the Name field.\nfunc (c *CreateCustomOrgRoleRequest) GetName() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Name\n}\n\n// GetPermissions returns the Permissions slice if it's non-nil, nil otherwise.\nfunc (c *CreateCustomOrgRoleRequest) GetPermissions() []string {\n\tif c == nil || c.Permissions == nil {\n\t\treturn nil\n\t}\n\treturn c.Permissions\n}\n\n// GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise.\nfunc (c *CreateEnterpriseRunnerGroupRequest) GetAllowsPublicRepositories() bool {\n\tif c == nil || c.AllowsPublicRepositories == nil {\n\t\treturn false\n\t}\n\treturn *c.AllowsPublicRepositories\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (c *CreateEnterpriseRunnerGroupRequest) GetName() string {\n\tif c == nil || c.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Name\n}\n\n// GetNetworkConfigurationID returns the NetworkConfigurationID field if it's non-nil, zero value otherwise.\nfunc (c *CreateEnterpriseRunnerGroupRequest) GetNetworkConfigurationID() string {\n\tif c == nil || c.NetworkConfigurationID == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.NetworkConfigurationID\n}\n\n// GetRestrictedToWorkflows returns the RestrictedToWorkflows field if it's non-nil, zero value otherwise.\nfunc (c *CreateEnterpriseRunnerGroupRequest) GetRestrictedToWorkflows() bool {\n\tif c == nil || c.RestrictedToWorkflows == nil {\n\t\treturn false\n\t}\n\treturn *c.RestrictedToWorkflows\n}\n\n// GetRunners returns the Runners slice if it's non-nil, nil otherwise.\nfunc (c *CreateEnterpriseRunnerGroupRequest) GetRunners() []int64 {\n\tif c == nil || c.Runners == nil {\n\t\treturn nil\n\t}\n\treturn c.Runners\n}\n\n// GetSelectedOrganizationIDs returns the SelectedOrganizationIDs slice if it's non-nil, nil otherwise.\nfunc (c *CreateEnterpriseRunnerGroupRequest) GetSelectedOrganizationIDs() []int64 {\n\tif c == nil || c.SelectedOrganizationIDs == nil {\n\t\treturn nil\n\t}\n\treturn c.SelectedOrganizationIDs\n}\n\n// GetSelectedWorkflows returns the SelectedWorkflows slice if it's non-nil, nil otherwise.\nfunc (c *CreateEnterpriseRunnerGroupRequest) GetSelectedWorkflows() []string {\n\tif c == nil || c.SelectedWorkflows == nil {\n\t\treturn nil\n\t}\n\treturn c.SelectedWorkflows\n}\n\n// GetVisibility returns the Visibility field if it's non-nil, zero value otherwise.\nfunc (c *CreateEnterpriseRunnerGroupRequest) GetVisibility() string {\n\tif c == nil || c.Visibility == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Visibility\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (c *CreateEvent) GetDescription() string {\n\tif c == nil || c.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Description\n}\n\n// GetInstallation returns the Installation field.\nfunc (c *CreateEvent) GetInstallation() *Installation {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Installation\n}\n\n// GetMasterBranch returns the MasterBranch field if it's non-nil, zero value otherwise.\nfunc (c *CreateEvent) GetMasterBranch() string {\n\tif c == nil || c.MasterBranch == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.MasterBranch\n}\n\n// GetOrg returns the Org field.\nfunc (c *CreateEvent) GetOrg() *Organization {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Org\n}\n\n// GetPusherType returns the PusherType field if it's non-nil, zero value otherwise.\nfunc (c *CreateEvent) GetPusherType() string {\n\tif c == nil || c.PusherType == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.PusherType\n}\n\n// GetRef returns the Ref field if it's non-nil, zero value otherwise.\nfunc (c *CreateEvent) GetRef() string {\n\tif c == nil || c.Ref == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Ref\n}\n\n// GetRefType returns the RefType field if it's non-nil, zero value otherwise.\nfunc (c *CreateEvent) GetRefType() string {\n\tif c == nil || c.RefType == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.RefType\n}\n\n// GetRepo returns the Repo field.\nfunc (c *CreateEvent) GetRepo() *Repository {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (c *CreateEvent) GetSender() *User {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Sender\n}\n\n// GetEnableStaticIP returns the EnableStaticIP field if it's non-nil, zero value otherwise.\nfunc (c *CreateHostedRunnerRequest) GetEnableStaticIP() bool {\n\tif c == nil || c.EnableStaticIP == nil {\n\t\treturn false\n\t}\n\treturn *c.EnableStaticIP\n}\n\n// GetImage returns the Image field.\nfunc (c *CreateHostedRunnerRequest) GetImage() HostedRunnerImage {\n\tif c == nil {\n\t\treturn HostedRunnerImage{}\n\t}\n\treturn c.Image\n}\n\n// GetImageGen returns the ImageGen field if it's non-nil, zero value otherwise.\nfunc (c *CreateHostedRunnerRequest) GetImageGen() bool {\n\tif c == nil || c.ImageGen == nil {\n\t\treturn false\n\t}\n\treturn *c.ImageGen\n}\n\n// GetMaximumRunners returns the MaximumRunners field if it's non-nil, zero value otherwise.\nfunc (c *CreateHostedRunnerRequest) GetMaximumRunners() int64 {\n\tif c == nil || c.MaximumRunners == nil {\n\t\treturn 0\n\t}\n\treturn *c.MaximumRunners\n}\n\n// GetName returns the Name field.\nfunc (c *CreateHostedRunnerRequest) GetName() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Name\n}\n\n// GetRunnerGroupID returns the RunnerGroupID field.\nfunc (c *CreateHostedRunnerRequest) GetRunnerGroupID() int64 {\n\tif c == nil {\n\t\treturn 0\n\t}\n\treturn c.RunnerGroupID\n}\n\n// GetSize returns the Size field.\nfunc (c *CreateHostedRunnerRequest) GetSize() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Size\n}\n\n// GetEncryptedValue returns the EncryptedValue field.\nfunc (c *CreateOrganizationPrivateRegistry) GetEncryptedValue() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.EncryptedValue\n}\n\n// GetKeyID returns the KeyID field.\nfunc (c *CreateOrganizationPrivateRegistry) GetKeyID() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.KeyID\n}\n\n// GetRegistryType returns the RegistryType field.\nfunc (c *CreateOrganizationPrivateRegistry) GetRegistryType() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.RegistryType\n}\n\n// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs slice if it's non-nil, nil otherwise.\nfunc (c *CreateOrganizationPrivateRegistry) GetSelectedRepositoryIDs() []int64 {\n\tif c == nil || c.SelectedRepositoryIDs == nil {\n\t\treturn nil\n\t}\n\treturn c.SelectedRepositoryIDs\n}\n\n// GetURL returns the URL field.\nfunc (c *CreateOrganizationPrivateRegistry) GetURL() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.URL\n}\n\n// GetUsername returns the Username field if it's non-nil, zero value otherwise.\nfunc (c *CreateOrganizationPrivateRegistry) GetUsername() string {\n\tif c == nil || c.Username == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Username\n}\n\n// GetVisibility returns the Visibility field.\nfunc (c *CreateOrganizationPrivateRegistry) GetVisibility() PrivateRegistryVisibility {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Visibility\n}\n\n// GetEmail returns the Email field if it's non-nil, zero value otherwise.\nfunc (c *CreateOrgInvitationOptions) GetEmail() string {\n\tif c == nil || c.Email == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Email\n}\n\n// GetInviteeID returns the InviteeID field if it's non-nil, zero value otherwise.\nfunc (c *CreateOrgInvitationOptions) GetInviteeID() int64 {\n\tif c == nil || c.InviteeID == nil {\n\t\treturn 0\n\t}\n\treturn *c.InviteeID\n}\n\n// GetRole returns the Role field if it's non-nil, zero value otherwise.\nfunc (c *CreateOrgInvitationOptions) GetRole() string {\n\tif c == nil || c.Role == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Role\n}\n\n// GetTeamID returns the TeamID slice if it's non-nil, nil otherwise.\nfunc (c *CreateOrgInvitationOptions) GetTeamID() []int64 {\n\tif c == nil || c.TeamID == nil {\n\t\treturn nil\n\t}\n\treturn c.TeamID\n}\n\n// GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise.\nfunc (c *CreateOrUpdateCustomRepoRoleOptions) GetBaseRole() string {\n\tif c == nil || c.BaseRole == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.BaseRole\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (c *CreateOrUpdateCustomRepoRoleOptions) GetDescription() string {\n\tif c == nil || c.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Description\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (c *CreateOrUpdateCustomRepoRoleOptions) GetName() string {\n\tif c == nil || c.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Name\n}\n\n// GetPermissions returns the Permissions slice if it's non-nil, nil otherwise.\nfunc (c *CreateOrUpdateCustomRepoRoleOptions) GetPermissions() []string {\n\tif c == nil || c.Permissions == nil {\n\t\treturn nil\n\t}\n\treturn c.Permissions\n}\n\n// GetColor returns the Color field if it's non-nil, zero value otherwise.\nfunc (c *CreateOrUpdateIssueTypesOptions) GetColor() string {\n\tif c == nil || c.Color == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Color\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (c *CreateOrUpdateIssueTypesOptions) GetDescription() string {\n\tif c == nil || c.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Description\n}\n\n// GetIsEnabled returns the IsEnabled field.\nfunc (c *CreateOrUpdateIssueTypesOptions) GetIsEnabled() bool {\n\tif c == nil {\n\t\treturn false\n\t}\n\treturn c.IsEnabled\n}\n\n// GetIsPrivate returns the IsPrivate field if it's non-nil, zero value otherwise.\nfunc (c *CreateOrUpdateIssueTypesOptions) GetIsPrivate() bool {\n\tif c == nil || c.IsPrivate == nil {\n\t\treturn false\n\t}\n\treturn *c.IsPrivate\n}\n\n// GetName returns the Name field.\nfunc (c *CreateOrUpdateIssueTypesOptions) GetName() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Name\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (c *CreateProtectedChanges) GetFrom() bool {\n\tif c == nil || c.From == nil {\n\t\treturn false\n\t}\n\treturn *c.From\n}\n\n// GetRef returns the Ref field.\nfunc (c *CreateRef) GetRef() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Ref\n}\n\n// GetSHA returns the SHA field.\nfunc (c *CreateRef) GetSHA() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.SHA\n}\n\n// GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise.\nfunc (c *CreateRunnerGroupRequest) GetAllowsPublicRepositories() bool {\n\tif c == nil || c.AllowsPublicRepositories == nil {\n\t\treturn false\n\t}\n\treturn *c.AllowsPublicRepositories\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (c *CreateRunnerGroupRequest) GetName() string {\n\tif c == nil || c.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Name\n}\n\n// GetNetworkConfigurationID returns the NetworkConfigurationID field if it's non-nil, zero value otherwise.\nfunc (c *CreateRunnerGroupRequest) GetNetworkConfigurationID() string {\n\tif c == nil || c.NetworkConfigurationID == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.NetworkConfigurationID\n}\n\n// GetRestrictedToWorkflows returns the RestrictedToWorkflows field if it's non-nil, zero value otherwise.\nfunc (c *CreateRunnerGroupRequest) GetRestrictedToWorkflows() bool {\n\tif c == nil || c.RestrictedToWorkflows == nil {\n\t\treturn false\n\t}\n\treturn *c.RestrictedToWorkflows\n}\n\n// GetRunners returns the Runners slice if it's non-nil, nil otherwise.\nfunc (c *CreateRunnerGroupRequest) GetRunners() []int64 {\n\tif c == nil || c.Runners == nil {\n\t\treturn nil\n\t}\n\treturn c.Runners\n}\n\n// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs slice if it's non-nil, nil otherwise.\nfunc (c *CreateRunnerGroupRequest) GetSelectedRepositoryIDs() []int64 {\n\tif c == nil || c.SelectedRepositoryIDs == nil {\n\t\treturn nil\n\t}\n\treturn c.SelectedRepositoryIDs\n}\n\n// GetSelectedWorkflows returns the SelectedWorkflows slice if it's non-nil, nil otherwise.\nfunc (c *CreateRunnerGroupRequest) GetSelectedWorkflows() []string {\n\tif c == nil || c.SelectedWorkflows == nil {\n\t\treturn nil\n\t}\n\treturn c.SelectedWorkflows\n}\n\n// GetVisibility returns the Visibility field if it's non-nil, zero value otherwise.\nfunc (c *CreateRunnerGroupRequest) GetVisibility() string {\n\tif c == nil || c.Visibility == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Visibility\n}\n\n// GetMessage returns the Message field.\nfunc (c *CreateTag) GetMessage() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Message\n}\n\n// GetObject returns the Object field.\nfunc (c *CreateTag) GetObject() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Object\n}\n\n// GetTag returns the Tag field.\nfunc (c *CreateTag) GetTag() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Tag\n}\n\n// GetTagger returns the Tagger field.\nfunc (c *CreateTag) GetTagger() *CommitAuthor {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Tagger\n}\n\n// GetType returns the Type field.\nfunc (c *CreateTag) GetType() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Type\n}\n\n// GetCanAdminsBypass returns the CanAdminsBypass field if it's non-nil, zero value otherwise.\nfunc (c *CreateUpdateEnvironment) GetCanAdminsBypass() bool {\n\tif c == nil || c.CanAdminsBypass == nil {\n\t\treturn false\n\t}\n\treturn *c.CanAdminsBypass\n}\n\n// GetDeploymentBranchPolicy returns the DeploymentBranchPolicy field.\nfunc (c *CreateUpdateEnvironment) GetDeploymentBranchPolicy() *BranchPolicy {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.DeploymentBranchPolicy\n}\n\n// GetPreventSelfReview returns the PreventSelfReview field if it's non-nil, zero value otherwise.\nfunc (c *CreateUpdateEnvironment) GetPreventSelfReview() bool {\n\tif c == nil || c.PreventSelfReview == nil {\n\t\treturn false\n\t}\n\treturn *c.PreventSelfReview\n}\n\n// GetReviewers returns the Reviewers slice if it's non-nil, nil otherwise.\nfunc (c *CreateUpdateEnvironment) GetReviewers() []*EnvReviewers {\n\tif c == nil || c.Reviewers == nil {\n\t\treturn nil\n\t}\n\treturn c.Reviewers\n}\n\n// GetWaitTimer returns the WaitTimer field if it's non-nil, zero value otherwise.\nfunc (c *CreateUpdateEnvironment) GetWaitTimer() int {\n\tif c == nil || c.WaitTimer == nil {\n\t\treturn 0\n\t}\n\treturn *c.WaitTimer\n}\n\n// GetEmail returns the Email field if it's non-nil, zero value otherwise.\nfunc (c *CreateUserRequest) GetEmail() string {\n\tif c == nil || c.Email == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Email\n}\n\n// GetLogin returns the Login field.\nfunc (c *CreateUserRequest) GetLogin() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Login\n}\n\n// GetSuspended returns the Suspended field if it's non-nil, zero value otherwise.\nfunc (c *CreateUserRequest) GetSuspended() bool {\n\tif c == nil || c.Suspended == nil {\n\t\treturn false\n\t}\n\treturn *c.Suspended\n}\n\n// GetInputs returns the Inputs map if it's non-nil, an empty map otherwise.\nfunc (c *CreateWorkflowDispatchEventRequest) GetInputs() map[string]any {\n\tif c == nil || c.Inputs == nil {\n\t\treturn map[string]any{}\n\t}\n\treturn c.Inputs\n}\n\n// GetRef returns the Ref field.\nfunc (c *CreateWorkflowDispatchEventRequest) GetRef() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Ref\n}\n\n// GetReturnRunDetails returns the ReturnRunDetails field if it's non-nil, zero value otherwise.\nfunc (c *CreateWorkflowDispatchEventRequest) GetReturnRunDetails() bool {\n\tif c == nil || c.ReturnRunDetails == nil {\n\t\treturn false\n\t}\n\treturn *c.ReturnRunDetails\n}\n\n// GetCreated returns the Created field if it's non-nil, zero value otherwise.\nfunc (c *CreationInfo) GetCreated() Timestamp {\n\tif c == nil || c.Created == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.Created\n}\n\n// GetCreators returns the Creators slice if it's non-nil, nil otherwise.\nfunc (c *CreationInfo) GetCreators() []string {\n\tif c == nil || c.Creators == nil {\n\t\treturn nil\n\t}\n\treturn c.Creators\n}\n\n// GetAuthorizedCredentialExpiresAt returns the AuthorizedCredentialExpiresAt field if it's non-nil, zero value otherwise.\nfunc (c *CredentialAuthorization) GetAuthorizedCredentialExpiresAt() Timestamp {\n\tif c == nil || c.AuthorizedCredentialExpiresAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.AuthorizedCredentialExpiresAt\n}\n\n// GetAuthorizedCredentialID returns the AuthorizedCredentialID field if it's non-nil, zero value otherwise.\nfunc (c *CredentialAuthorization) GetAuthorizedCredentialID() int64 {\n\tif c == nil || c.AuthorizedCredentialID == nil {\n\t\treturn 0\n\t}\n\treturn *c.AuthorizedCredentialID\n}\n\n// GetAuthorizedCredentialNote returns the AuthorizedCredentialNote field if it's non-nil, zero value otherwise.\nfunc (c *CredentialAuthorization) GetAuthorizedCredentialNote() string {\n\tif c == nil || c.AuthorizedCredentialNote == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.AuthorizedCredentialNote\n}\n\n// GetAuthorizedCredentialTitle returns the AuthorizedCredentialTitle field if it's non-nil, zero value otherwise.\nfunc (c *CredentialAuthorization) GetAuthorizedCredentialTitle() string {\n\tif c == nil || c.AuthorizedCredentialTitle == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.AuthorizedCredentialTitle\n}\n\n// GetCredentialAccessedAt returns the CredentialAccessedAt field if it's non-nil, zero value otherwise.\nfunc (c *CredentialAuthorization) GetCredentialAccessedAt() Timestamp {\n\tif c == nil || c.CredentialAccessedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.CredentialAccessedAt\n}\n\n// GetCredentialAuthorizedAt returns the CredentialAuthorizedAt field if it's non-nil, zero value otherwise.\nfunc (c *CredentialAuthorization) GetCredentialAuthorizedAt() Timestamp {\n\tif c == nil || c.CredentialAuthorizedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.CredentialAuthorizedAt\n}\n\n// GetCredentialID returns the CredentialID field if it's non-nil, zero value otherwise.\nfunc (c *CredentialAuthorization) GetCredentialID() int64 {\n\tif c == nil || c.CredentialID == nil {\n\t\treturn 0\n\t}\n\treturn *c.CredentialID\n}\n\n// GetCredentialType returns the CredentialType field if it's non-nil, zero value otherwise.\nfunc (c *CredentialAuthorization) GetCredentialType() string {\n\tif c == nil || c.CredentialType == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.CredentialType\n}\n\n// GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise.\nfunc (c *CredentialAuthorization) GetFingerprint() string {\n\tif c == nil || c.Fingerprint == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Fingerprint\n}\n\n// GetLogin returns the Login field if it's non-nil, zero value otherwise.\nfunc (c *CredentialAuthorization) GetLogin() string {\n\tif c == nil || c.Login == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Login\n}\n\n// GetScopes returns the Scopes slice if it's non-nil, nil otherwise.\nfunc (c *CredentialAuthorization) GetScopes() []string {\n\tif c == nil || c.Scopes == nil {\n\t\treturn nil\n\t}\n\treturn c.Scopes\n}\n\n// GetTokenLastEight returns the TokenLastEight field if it's non-nil, zero value otherwise.\nfunc (c *CredentialAuthorization) GetTokenLastEight() string {\n\tif c == nil || c.TokenLastEight == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.TokenLastEight\n}\n\n// GetLogin returns the Login field.\nfunc (c *CredentialAuthorizationsListOptions) GetLogin() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.Login\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (c *Credit) GetType() string {\n\tif c == nil || c.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Type\n}\n\n// GetUser returns the User field.\nfunc (c *Credit) GetUser() *User {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.User\n}\n\n// GetApp returns the App field.\nfunc (c *CustomDeploymentProtectionRule) GetApp() *CustomDeploymentProtectionRuleApp {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.App\n}\n\n// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise.\nfunc (c *CustomDeploymentProtectionRule) GetEnabled() bool {\n\tif c == nil || c.Enabled == nil {\n\t\treturn false\n\t}\n\treturn *c.Enabled\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (c *CustomDeploymentProtectionRule) GetID() int64 {\n\tif c == nil || c.ID == nil {\n\t\treturn 0\n\t}\n\treturn *c.ID\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (c *CustomDeploymentProtectionRule) GetNodeID() string {\n\tif c == nil || c.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.NodeID\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (c *CustomDeploymentProtectionRuleApp) GetID() int64 {\n\tif c == nil || c.ID == nil {\n\t\treturn 0\n\t}\n\treturn *c.ID\n}\n\n// GetIntegrationURL returns the IntegrationURL field if it's non-nil, zero value otherwise.\nfunc (c *CustomDeploymentProtectionRuleApp) GetIntegrationURL() string {\n\tif c == nil || c.IntegrationURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.IntegrationURL\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (c *CustomDeploymentProtectionRuleApp) GetNodeID() string {\n\tif c == nil || c.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.NodeID\n}\n\n// GetSlug returns the Slug field if it's non-nil, zero value otherwise.\nfunc (c *CustomDeploymentProtectionRuleApp) GetSlug() string {\n\tif c == nil || c.Slug == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Slug\n}\n\n// GetIntegrationID returns the IntegrationID field if it's non-nil, zero value otherwise.\nfunc (c *CustomDeploymentProtectionRuleRequest) GetIntegrationID() int64 {\n\tif c == nil || c.IntegrationID == nil {\n\t\treturn 0\n\t}\n\treturn *c.IntegrationID\n}\n\n// GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise.\nfunc (c *CustomOrgRole) GetBaseRole() string {\n\tif c == nil || c.BaseRole == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.BaseRole\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (c *CustomOrgRole) GetCreatedAt() Timestamp {\n\tif c == nil || c.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.CreatedAt\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (c *CustomOrgRole) GetDescription() string {\n\tif c == nil || c.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Description\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (c *CustomOrgRole) GetID() int64 {\n\tif c == nil || c.ID == nil {\n\t\treturn 0\n\t}\n\treturn *c.ID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (c *CustomOrgRole) GetName() string {\n\tif c == nil || c.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Name\n}\n\n// GetOrg returns the Org field.\nfunc (c *CustomOrgRole) GetOrg() *Organization {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Org\n}\n\n// GetPermissions returns the Permissions slice if it's non-nil, nil otherwise.\nfunc (c *CustomOrgRole) GetPermissions() []string {\n\tif c == nil || c.Permissions == nil {\n\t\treturn nil\n\t}\n\treturn c.Permissions\n}\n\n// GetSource returns the Source field if it's non-nil, zero value otherwise.\nfunc (c *CustomOrgRole) GetSource() string {\n\tif c == nil || c.Source == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Source\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (c *CustomOrgRole) GetUpdatedAt() Timestamp {\n\tif c == nil || c.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.UpdatedAt\n}\n\n// GetPatternScope returns the PatternScope field if it's non-nil, zero value otherwise.\nfunc (c *CustomPatternBackfillScan) GetPatternScope() string {\n\tif c == nil || c.PatternScope == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.PatternScope\n}\n\n// GetPatternSlug returns the PatternSlug field if it's non-nil, zero value otherwise.\nfunc (c *CustomPatternBackfillScan) GetPatternSlug() string {\n\tif c == nil || c.PatternSlug == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.PatternSlug\n}\n\n// GetAllowedValues returns the AllowedValues slice if it's non-nil, nil otherwise.\nfunc (c *CustomProperty) GetAllowedValues() []string {\n\tif c == nil || c.AllowedValues == nil {\n\t\treturn nil\n\t}\n\treturn c.AllowedValues\n}\n\n// GetDefaultValue returns the DefaultValue field.\nfunc (c *CustomProperty) GetDefaultValue() any {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.DefaultValue\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (c *CustomProperty) GetDescription() string {\n\tif c == nil || c.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Description\n}\n\n// GetPropertyName returns the PropertyName field if it's non-nil, zero value otherwise.\nfunc (c *CustomProperty) GetPropertyName() string {\n\tif c == nil || c.PropertyName == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.PropertyName\n}\n\n// GetRequired returns the Required field if it's non-nil, zero value otherwise.\nfunc (c *CustomProperty) GetRequired() bool {\n\tif c == nil || c.Required == nil {\n\t\treturn false\n\t}\n\treturn *c.Required\n}\n\n// GetSourceType returns the SourceType field if it's non-nil, zero value otherwise.\nfunc (c *CustomProperty) GetSourceType() string {\n\tif c == nil || c.SourceType == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.SourceType\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (c *CustomProperty) GetURL() string {\n\tif c == nil || c.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.URL\n}\n\n// GetValuesEditableBy returns the ValuesEditableBy field if it's non-nil, zero value otherwise.\nfunc (c *CustomProperty) GetValuesEditableBy() string {\n\tif c == nil || c.ValuesEditableBy == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.ValuesEditableBy\n}\n\n// GetValueType returns the ValueType field.\nfunc (c *CustomProperty) GetValueType() PropertyValueType {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.ValueType\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (c *CustomPropertyEvent) GetAction() string {\n\tif c == nil || c.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Action\n}\n\n// GetDefinition returns the Definition field.\nfunc (c *CustomPropertyEvent) GetDefinition() *CustomProperty {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Definition\n}\n\n// GetEnterprise returns the Enterprise field.\nfunc (c *CustomPropertyEvent) GetEnterprise() *Enterprise {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Enterprise\n}\n\n// GetInstallation returns the Installation field.\nfunc (c *CustomPropertyEvent) GetInstallation() *Installation {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (c *CustomPropertyEvent) GetOrg() *Organization {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Org\n}\n\n// GetSender returns the Sender field.\nfunc (c *CustomPropertyEvent) GetSender() *User {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Sender\n}\n\n// GetPropertyName returns the PropertyName field.\nfunc (c *CustomPropertyValue) GetPropertyName() string {\n\tif c == nil {\n\t\treturn \"\"\n\t}\n\treturn c.PropertyName\n}\n\n// GetValue returns the Value field.\nfunc (c *CustomPropertyValue) GetValue() any {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Value\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (c *CustomPropertyValuesEvent) GetAction() string {\n\tif c == nil || c.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Action\n}\n\n// GetEnterprise returns the Enterprise field.\nfunc (c *CustomPropertyValuesEvent) GetEnterprise() *Enterprise {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Enterprise\n}\n\n// GetInstallation returns the Installation field.\nfunc (c *CustomPropertyValuesEvent) GetInstallation() *Installation {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Installation\n}\n\n// GetNewPropertyValues returns the NewPropertyValues slice if it's non-nil, nil otherwise.\nfunc (c *CustomPropertyValuesEvent) GetNewPropertyValues() []*CustomPropertyValue {\n\tif c == nil || c.NewPropertyValues == nil {\n\t\treturn nil\n\t}\n\treturn c.NewPropertyValues\n}\n\n// GetOldPropertyValues returns the OldPropertyValues slice if it's non-nil, nil otherwise.\nfunc (c *CustomPropertyValuesEvent) GetOldPropertyValues() []*CustomPropertyValue {\n\tif c == nil || c.OldPropertyValues == nil {\n\t\treturn nil\n\t}\n\treturn c.OldPropertyValues\n}\n\n// GetOrg returns the Org field.\nfunc (c *CustomPropertyValuesEvent) GetOrg() *Organization {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Org\n}\n\n// GetRepo returns the Repo field.\nfunc (c *CustomPropertyValuesEvent) GetRepo() *Repository {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (c *CustomPropertyValuesEvent) GetSender() *User {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Sender\n}\n\n// GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise.\nfunc (c *CustomRepoRoles) GetBaseRole() string {\n\tif c == nil || c.BaseRole == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.BaseRole\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (c *CustomRepoRoles) GetCreatedAt() Timestamp {\n\tif c == nil || c.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.CreatedAt\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (c *CustomRepoRoles) GetDescription() string {\n\tif c == nil || c.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Description\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (c *CustomRepoRoles) GetID() int64 {\n\tif c == nil || c.ID == nil {\n\t\treturn 0\n\t}\n\treturn *c.ID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (c *CustomRepoRoles) GetName() string {\n\tif c == nil || c.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *c.Name\n}\n\n// GetOrg returns the Org field.\nfunc (c *CustomRepoRoles) GetOrg() *Organization {\n\tif c == nil {\n\t\treturn nil\n\t}\n\treturn c.Org\n}\n\n// GetPermissions returns the Permissions slice if it's non-nil, nil otherwise.\nfunc (c *CustomRepoRoles) GetPermissions() []string {\n\tif c == nil || c.Permissions == nil {\n\t\treturn nil\n\t}\n\treturn c.Permissions\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (c *CustomRepoRoles) GetUpdatedAt() Timestamp {\n\tif c == nil || c.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *c.UpdatedAt\n}\n\n// GetEncryptedToken returns the EncryptedToken field.\nfunc (d *DatadogConfig) GetEncryptedToken() string {\n\tif d == nil {\n\t\treturn \"\"\n\t}\n\treturn d.EncryptedToken\n}\n\n// GetKeyID returns the KeyID field.\nfunc (d *DatadogConfig) GetKeyID() string {\n\tif d == nil {\n\t\treturn \"\"\n\t}\n\treturn d.KeyID\n}\n\n// GetSite returns the Site field.\nfunc (d *DatadogConfig) GetSite() string {\n\tif d == nil {\n\t\treturn \"\"\n\t}\n\treturn d.Site\n}\n\n// GetLanguages returns the Languages slice if it's non-nil, nil otherwise.\nfunc (d *DefaultSetupConfiguration) GetLanguages() []string {\n\tif d == nil || d.Languages == nil {\n\t\treturn nil\n\t}\n\treturn d.Languages\n}\n\n// GetQuerySuite returns the QuerySuite field if it's non-nil, zero value otherwise.\nfunc (d *DefaultSetupConfiguration) GetQuerySuite() string {\n\tif d == nil || d.QuerySuite == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.QuerySuite\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (d *DefaultSetupConfiguration) GetState() string {\n\tif d == nil || d.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.State\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (d *DefaultSetupConfiguration) GetUpdatedAt() Timestamp {\n\tif d == nil || d.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *d.UpdatedAt\n}\n\n// GetCanApprovePullRequestReviews returns the CanApprovePullRequestReviews field if it's non-nil, zero value otherwise.\nfunc (d *DefaultWorkflowPermissionEnterprise) GetCanApprovePullRequestReviews() bool {\n\tif d == nil || d.CanApprovePullRequestReviews == nil {\n\t\treturn false\n\t}\n\treturn *d.CanApprovePullRequestReviews\n}\n\n// GetDefaultWorkflowPermissions returns the DefaultWorkflowPermissions field if it's non-nil, zero value otherwise.\nfunc (d *DefaultWorkflowPermissionEnterprise) GetDefaultWorkflowPermissions() string {\n\tif d == nil || d.DefaultWorkflowPermissions == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.DefaultWorkflowPermissions\n}\n\n// GetCanApprovePullRequestReviews returns the CanApprovePullRequestReviews field if it's non-nil, zero value otherwise.\nfunc (d *DefaultWorkflowPermissionOrganization) GetCanApprovePullRequestReviews() bool {\n\tif d == nil || d.CanApprovePullRequestReviews == nil {\n\t\treturn false\n\t}\n\treturn *d.CanApprovePullRequestReviews\n}\n\n// GetDefaultWorkflowPermissions returns the DefaultWorkflowPermissions field if it's non-nil, zero value otherwise.\nfunc (d *DefaultWorkflowPermissionOrganization) GetDefaultWorkflowPermissions() string {\n\tif d == nil || d.DefaultWorkflowPermissions == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.DefaultWorkflowPermissions\n}\n\n// GetCanApprovePullRequestReviews returns the CanApprovePullRequestReviews field if it's non-nil, zero value otherwise.\nfunc (d *DefaultWorkflowPermissionRepository) GetCanApprovePullRequestReviews() bool {\n\tif d == nil || d.CanApprovePullRequestReviews == nil {\n\t\treturn false\n\t}\n\treturn *d.CanApprovePullRequestReviews\n}\n\n// GetDefaultWorkflowPermissions returns the DefaultWorkflowPermissions field if it's non-nil, zero value otherwise.\nfunc (d *DefaultWorkflowPermissionRepository) GetDefaultWorkflowPermissions() string {\n\tif d == nil || d.DefaultWorkflowPermissions == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.DefaultWorkflowPermissions\n}\n\n// GetConfirmDeleteURL returns the ConfirmDeleteURL field if it's non-nil, zero value otherwise.\nfunc (d *DeleteAnalysis) GetConfirmDeleteURL() string {\n\tif d == nil || d.ConfirmDeleteURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.ConfirmDeleteURL\n}\n\n// GetNextAnalysisURL returns the NextAnalysisURL field if it's non-nil, zero value otherwise.\nfunc (d *DeleteAnalysis) GetNextAnalysisURL() string {\n\tif d == nil || d.NextAnalysisURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.NextAnalysisURL\n}\n\n// GetCostCenterState returns the CostCenterState field.\nfunc (d *DeleteCostCenterResponse) GetCostCenterState() string {\n\tif d == nil {\n\t\treturn \"\"\n\t}\n\treturn d.CostCenterState\n}\n\n// GetID returns the ID field.\nfunc (d *DeleteCostCenterResponse) GetID() string {\n\tif d == nil {\n\t\treturn \"\"\n\t}\n\treturn d.ID\n}\n\n// GetMessage returns the Message field.\nfunc (d *DeleteCostCenterResponse) GetMessage() string {\n\tif d == nil {\n\t\treturn \"\"\n\t}\n\treturn d.Message\n}\n\n// GetName returns the Name field.\nfunc (d *DeleteCostCenterResponse) GetName() string {\n\tif d == nil {\n\t\treturn \"\"\n\t}\n\treturn d.Name\n}\n\n// GetInstallation returns the Installation field.\nfunc (d *DeleteEvent) GetInstallation() *Installation {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (d *DeleteEvent) GetOrg() *Organization {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Org\n}\n\n// GetPusherType returns the PusherType field if it's non-nil, zero value otherwise.\nfunc (d *DeleteEvent) GetPusherType() string {\n\tif d == nil || d.PusherType == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.PusherType\n}\n\n// GetRef returns the Ref field if it's non-nil, zero value otherwise.\nfunc (d *DeleteEvent) GetRef() string {\n\tif d == nil || d.Ref == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Ref\n}\n\n// GetRefType returns the RefType field if it's non-nil, zero value otherwise.\nfunc (d *DeleteEvent) GetRefType() string {\n\tif d == nil || d.RefType == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.RefType\n}\n\n// GetRepo returns the Repo field.\nfunc (d *DeleteEvent) GetRepo() *Repository {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (d *DeleteEvent) GetSender() *User {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Sender\n}\n\n// GetAutoDismissedAt returns the AutoDismissedAt field if it's non-nil, zero value otherwise.\nfunc (d *DependabotAlert) GetAutoDismissedAt() Timestamp {\n\tif d == nil || d.AutoDismissedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *d.AutoDismissedAt\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (d *DependabotAlert) GetCreatedAt() Timestamp {\n\tif d == nil || d.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *d.CreatedAt\n}\n\n// GetDependency returns the Dependency field.\nfunc (d *DependabotAlert) GetDependency() *Dependency {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Dependency\n}\n\n// GetDismissedAt returns the DismissedAt field if it's non-nil, zero value otherwise.\nfunc (d *DependabotAlert) GetDismissedAt() Timestamp {\n\tif d == nil || d.DismissedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *d.DismissedAt\n}\n\n// GetDismissedBy returns the DismissedBy field.\nfunc (d *DependabotAlert) GetDismissedBy() *User {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.DismissedBy\n}\n\n// GetDismissedComment returns the DismissedComment field if it's non-nil, zero value otherwise.\nfunc (d *DependabotAlert) GetDismissedComment() string {\n\tif d == nil || d.DismissedComment == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.DismissedComment\n}\n\n// GetDismissedReason returns the DismissedReason field if it's non-nil, zero value otherwise.\nfunc (d *DependabotAlert) GetDismissedReason() string {\n\tif d == nil || d.DismissedReason == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.DismissedReason\n}\n\n// GetFixedAt returns the FixedAt field if it's non-nil, zero value otherwise.\nfunc (d *DependabotAlert) GetFixedAt() Timestamp {\n\tif d == nil || d.FixedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *d.FixedAt\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (d *DependabotAlert) GetHTMLURL() string {\n\tif d == nil || d.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.HTMLURL\n}\n\n// GetNumber returns the Number field if it's non-nil, zero value otherwise.\nfunc (d *DependabotAlert) GetNumber() int {\n\tif d == nil || d.Number == nil {\n\t\treturn 0\n\t}\n\treturn *d.Number\n}\n\n// GetRepository returns the Repository field.\nfunc (d *DependabotAlert) GetRepository() *Repository {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Repository\n}\n\n// GetSecurityAdvisory returns the SecurityAdvisory field.\nfunc (d *DependabotAlert) GetSecurityAdvisory() *DependabotSecurityAdvisory {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.SecurityAdvisory\n}\n\n// GetSecurityVulnerability returns the SecurityVulnerability field.\nfunc (d *DependabotAlert) GetSecurityVulnerability() *AdvisoryVulnerability {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.SecurityVulnerability\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (d *DependabotAlert) GetState() string {\n\tif d == nil || d.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.State\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (d *DependabotAlert) GetUpdatedAt() Timestamp {\n\tif d == nil || d.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *d.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (d *DependabotAlert) GetURL() string {\n\tif d == nil || d.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.URL\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (d *DependabotAlertEvent) GetAction() string {\n\tif d == nil || d.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Action\n}\n\n// GetAlert returns the Alert field.\nfunc (d *DependabotAlertEvent) GetAlert() *DependabotAlert {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Alert\n}\n\n// GetEnterprise returns the Enterprise field.\nfunc (d *DependabotAlertEvent) GetEnterprise() *Enterprise {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Enterprise\n}\n\n// GetInstallation returns the Installation field.\nfunc (d *DependabotAlertEvent) GetInstallation() *Installation {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Installation\n}\n\n// GetOrganization returns the Organization field.\nfunc (d *DependabotAlertEvent) GetOrganization() *Organization {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Organization\n}\n\n// GetRepo returns the Repo field.\nfunc (d *DependabotAlertEvent) GetRepo() *Repository {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (d *DependabotAlertEvent) GetSender() *User {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Sender\n}\n\n// GetDismissedComment returns the DismissedComment field if it's non-nil, zero value otherwise.\nfunc (d *DependabotAlertState) GetDismissedComment() string {\n\tif d == nil || d.DismissedComment == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.DismissedComment\n}\n\n// GetDismissedReason returns the DismissedReason field if it's non-nil, zero value otherwise.\nfunc (d *DependabotAlertState) GetDismissedReason() string {\n\tif d == nil || d.DismissedReason == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.DismissedReason\n}\n\n// GetState returns the State field.\nfunc (d *DependabotAlertState) GetState() string {\n\tif d == nil {\n\t\treturn \"\"\n\t}\n\treturn d.State\n}\n\n// GetEncryptedValue returns the EncryptedValue field.\nfunc (d *DependabotEncryptedSecret) GetEncryptedValue() string {\n\tif d == nil {\n\t\treturn \"\"\n\t}\n\treturn d.EncryptedValue\n}\n\n// GetKeyID returns the KeyID field.\nfunc (d *DependabotEncryptedSecret) GetKeyID() string {\n\tif d == nil {\n\t\treturn \"\"\n\t}\n\treturn d.KeyID\n}\n\n// GetName returns the Name field.\nfunc (d *DependabotEncryptedSecret) GetName() string {\n\tif d == nil {\n\t\treturn \"\"\n\t}\n\treturn d.Name\n}\n\n// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs field.\nfunc (d *DependabotEncryptedSecret) GetSelectedRepositoryIDs() DependabotSecretsSelectedRepoIDs {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.SelectedRepositoryIDs\n}\n\n// GetVisibility returns the Visibility field.\nfunc (d *DependabotEncryptedSecret) GetVisibility() string {\n\tif d == nil {\n\t\treturn \"\"\n\t}\n\treturn d.Visibility\n}\n\n// GetCVEID returns the CVEID field if it's non-nil, zero value otherwise.\nfunc (d *DependabotSecurityAdvisory) GetCVEID() string {\n\tif d == nil || d.CVEID == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.CVEID\n}\n\n// GetCVSS returns the CVSS field.\nfunc (d *DependabotSecurityAdvisory) GetCVSS() *AdvisoryCVSS {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.CVSS\n}\n\n// GetCWEs returns the CWEs slice if it's non-nil, nil otherwise.\nfunc (d *DependabotSecurityAdvisory) GetCWEs() []*AdvisoryCWEs {\n\tif d == nil || d.CWEs == nil {\n\t\treturn nil\n\t}\n\treturn d.CWEs\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (d *DependabotSecurityAdvisory) GetDescription() string {\n\tif d == nil || d.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Description\n}\n\n// GetEPSS returns the EPSS field.\nfunc (d *DependabotSecurityAdvisory) GetEPSS() *AdvisoryEPSS {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.EPSS\n}\n\n// GetGHSAID returns the GHSAID field if it's non-nil, zero value otherwise.\nfunc (d *DependabotSecurityAdvisory) GetGHSAID() string {\n\tif d == nil || d.GHSAID == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.GHSAID\n}\n\n// GetIdentifiers returns the Identifiers slice if it's non-nil, nil otherwise.\nfunc (d *DependabotSecurityAdvisory) GetIdentifiers() []*AdvisoryIdentifier {\n\tif d == nil || d.Identifiers == nil {\n\t\treturn nil\n\t}\n\treturn d.Identifiers\n}\n\n// GetPublishedAt returns the PublishedAt field if it's non-nil, zero value otherwise.\nfunc (d *DependabotSecurityAdvisory) GetPublishedAt() Timestamp {\n\tif d == nil || d.PublishedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *d.PublishedAt\n}\n\n// GetReferences returns the References slice if it's non-nil, nil otherwise.\nfunc (d *DependabotSecurityAdvisory) GetReferences() []*AdvisoryReference {\n\tif d == nil || d.References == nil {\n\t\treturn nil\n\t}\n\treturn d.References\n}\n\n// GetSeverity returns the Severity field if it's non-nil, zero value otherwise.\nfunc (d *DependabotSecurityAdvisory) GetSeverity() string {\n\tif d == nil || d.Severity == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Severity\n}\n\n// GetSummary returns the Summary field if it's non-nil, zero value otherwise.\nfunc (d *DependabotSecurityAdvisory) GetSummary() string {\n\tif d == nil || d.Summary == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Summary\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (d *DependabotSecurityAdvisory) GetUpdatedAt() Timestamp {\n\tif d == nil || d.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *d.UpdatedAt\n}\n\n// GetVulnerabilities returns the Vulnerabilities slice if it's non-nil, nil otherwise.\nfunc (d *DependabotSecurityAdvisory) GetVulnerabilities() []*AdvisoryVulnerability {\n\tif d == nil || d.Vulnerabilities == nil {\n\t\treturn nil\n\t}\n\treturn d.Vulnerabilities\n}\n\n// GetWithdrawnAt returns the WithdrawnAt field if it's non-nil, zero value otherwise.\nfunc (d *DependabotSecurityAdvisory) GetWithdrawnAt() Timestamp {\n\tif d == nil || d.WithdrawnAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *d.WithdrawnAt\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (d *DependabotSecurityUpdates) GetStatus() string {\n\tif d == nil || d.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Status\n}\n\n// GetManifestPath returns the ManifestPath field if it's non-nil, zero value otherwise.\nfunc (d *Dependency) GetManifestPath() string {\n\tif d == nil || d.ManifestPath == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.ManifestPath\n}\n\n// GetPackage returns the Package field.\nfunc (d *Dependency) GetPackage() *VulnerabilityPackage {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Package\n}\n\n// GetScope returns the Scope field if it's non-nil, zero value otherwise.\nfunc (d *Dependency) GetScope() string {\n\tif d == nil || d.Scope == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Scope\n}\n\n// GetLabeledRunners returns the LabeledRunners field if it's non-nil, zero value otherwise.\nfunc (d *DependencyGraphAutosubmitActionOptions) GetLabeledRunners() bool {\n\tif d == nil || d.LabeledRunners == nil {\n\t\treturn false\n\t}\n\treturn *d.LabeledRunners\n}\n\n// GetDetector returns the Detector field.\nfunc (d *DependencyGraphSnapshot) GetDetector() *DependencyGraphSnapshotDetector {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Detector\n}\n\n// GetJob returns the Job field.\nfunc (d *DependencyGraphSnapshot) GetJob() *DependencyGraphSnapshotJob {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Job\n}\n\n// GetMetadata returns the Metadata map if it's non-nil, an empty map otherwise.\nfunc (d *DependencyGraphSnapshot) GetMetadata() map[string]any {\n\tif d == nil || d.Metadata == nil {\n\t\treturn map[string]any{}\n\t}\n\treturn d.Metadata\n}\n\n// GetRef returns the Ref field if it's non-nil, zero value otherwise.\nfunc (d *DependencyGraphSnapshot) GetRef() string {\n\tif d == nil || d.Ref == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Ref\n}\n\n// GetScanned returns the Scanned field if it's non-nil, zero value otherwise.\nfunc (d *DependencyGraphSnapshot) GetScanned() Timestamp {\n\tif d == nil || d.Scanned == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *d.Scanned\n}\n\n// GetSha returns the Sha field if it's non-nil, zero value otherwise.\nfunc (d *DependencyGraphSnapshot) GetSha() string {\n\tif d == nil || d.Sha == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Sha\n}\n\n// GetVersion returns the Version field.\nfunc (d *DependencyGraphSnapshot) GetVersion() int {\n\tif d == nil {\n\t\treturn 0\n\t}\n\treturn d.Version\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (d *DependencyGraphSnapshotCreationData) GetCreatedAt() Timestamp {\n\tif d == nil || d.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *d.CreatedAt\n}\n\n// GetID returns the ID field.\nfunc (d *DependencyGraphSnapshotCreationData) GetID() int64 {\n\tif d == nil {\n\t\treturn 0\n\t}\n\treturn d.ID\n}\n\n// GetMessage returns the Message field if it's non-nil, zero value otherwise.\nfunc (d *DependencyGraphSnapshotCreationData) GetMessage() string {\n\tif d == nil || d.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Message\n}\n\n// GetResult returns the Result field if it's non-nil, zero value otherwise.\nfunc (d *DependencyGraphSnapshotCreationData) GetResult() string {\n\tif d == nil || d.Result == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Result\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (d *DependencyGraphSnapshotDetector) GetName() string {\n\tif d == nil || d.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Name\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (d *DependencyGraphSnapshotDetector) GetURL() string {\n\tif d == nil || d.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.URL\n}\n\n// GetVersion returns the Version field if it's non-nil, zero value otherwise.\nfunc (d *DependencyGraphSnapshotDetector) GetVersion() string {\n\tif d == nil || d.Version == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Version\n}\n\n// GetCorrelator returns the Correlator field if it's non-nil, zero value otherwise.\nfunc (d *DependencyGraphSnapshotJob) GetCorrelator() string {\n\tif d == nil || d.Correlator == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Correlator\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (d *DependencyGraphSnapshotJob) GetHTMLURL() string {\n\tif d == nil || d.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (d *DependencyGraphSnapshotJob) GetID() string {\n\tif d == nil || d.ID == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.ID\n}\n\n// GetFile returns the File field.\nfunc (d *DependencyGraphSnapshotManifest) GetFile() *DependencyGraphSnapshotManifestFile {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.File\n}\n\n// GetMetadata returns the Metadata map if it's non-nil, an empty map otherwise.\nfunc (d *DependencyGraphSnapshotManifest) GetMetadata() map[string]any {\n\tif d == nil || d.Metadata == nil {\n\t\treturn map[string]any{}\n\t}\n\treturn d.Metadata\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (d *DependencyGraphSnapshotManifest) GetName() string {\n\tif d == nil || d.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Name\n}\n\n// GetSourceLocation returns the SourceLocation field if it's non-nil, zero value otherwise.\nfunc (d *DependencyGraphSnapshotManifestFile) GetSourceLocation() string {\n\tif d == nil || d.SourceLocation == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.SourceLocation\n}\n\n// GetDependencies returns the Dependencies slice if it's non-nil, nil otherwise.\nfunc (d *DependencyGraphSnapshotResolvedDependency) GetDependencies() []string {\n\tif d == nil || d.Dependencies == nil {\n\t\treturn nil\n\t}\n\treturn d.Dependencies\n}\n\n// GetMetadata returns the Metadata map if it's non-nil, an empty map otherwise.\nfunc (d *DependencyGraphSnapshotResolvedDependency) GetMetadata() map[string]any {\n\tif d == nil || d.Metadata == nil {\n\t\treturn map[string]any{}\n\t}\n\treturn d.Metadata\n}\n\n// GetPackageURL returns the PackageURL field if it's non-nil, zero value otherwise.\nfunc (d *DependencyGraphSnapshotResolvedDependency) GetPackageURL() string {\n\tif d == nil || d.PackageURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.PackageURL\n}\n\n// GetRelationship returns the Relationship field if it's non-nil, zero value otherwise.\nfunc (d *DependencyGraphSnapshotResolvedDependency) GetRelationship() string {\n\tif d == nil || d.Relationship == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Relationship\n}\n\n// GetScope returns the Scope field if it's non-nil, zero value otherwise.\nfunc (d *DependencyGraphSnapshotResolvedDependency) GetScope() string {\n\tif d == nil || d.Scope == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Scope\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (d *DeployKeyEvent) GetAction() string {\n\tif d == nil || d.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Action\n}\n\n// GetInstallation returns the Installation field.\nfunc (d *DeployKeyEvent) GetInstallation() *Installation {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Installation\n}\n\n// GetKey returns the Key field.\nfunc (d *DeployKeyEvent) GetKey() *Key {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Key\n}\n\n// GetOrganization returns the Organization field.\nfunc (d *DeployKeyEvent) GetOrganization() *Organization {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Organization\n}\n\n// GetRepo returns the Repo field.\nfunc (d *DeployKeyEvent) GetRepo() *Repository {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (d *DeployKeyEvent) GetSender() *User {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Sender\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (d *Deployment) GetCreatedAt() Timestamp {\n\tif d == nil || d.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *d.CreatedAt\n}\n\n// GetCreator returns the Creator field.\nfunc (d *Deployment) GetCreator() *User {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Creator\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (d *Deployment) GetDescription() string {\n\tif d == nil || d.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Description\n}\n\n// GetEnvironment returns the Environment field if it's non-nil, zero value otherwise.\nfunc (d *Deployment) GetEnvironment() string {\n\tif d == nil || d.Environment == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Environment\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (d *Deployment) GetID() int64 {\n\tif d == nil || d.ID == nil {\n\t\treturn 0\n\t}\n\treturn *d.ID\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (d *Deployment) GetNodeID() string {\n\tif d == nil || d.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.NodeID\n}\n\n// GetPayload returns the Payload field.\nfunc (d *Deployment) GetPayload() json.RawMessage {\n\tif d == nil {\n\t\treturn json.RawMessage{}\n\t}\n\treturn d.Payload\n}\n\n// GetRef returns the Ref field if it's non-nil, zero value otherwise.\nfunc (d *Deployment) GetRef() string {\n\tif d == nil || d.Ref == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Ref\n}\n\n// GetRepositoryURL returns the RepositoryURL field if it's non-nil, zero value otherwise.\nfunc (d *Deployment) GetRepositoryURL() string {\n\tif d == nil || d.RepositoryURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.RepositoryURL\n}\n\n// GetSHA returns the SHA field if it's non-nil, zero value otherwise.\nfunc (d *Deployment) GetSHA() string {\n\tif d == nil || d.SHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.SHA\n}\n\n// GetStatusesURL returns the StatusesURL field if it's non-nil, zero value otherwise.\nfunc (d *Deployment) GetStatusesURL() string {\n\tif d == nil || d.StatusesURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.StatusesURL\n}\n\n// GetTask returns the Task field if it's non-nil, zero value otherwise.\nfunc (d *Deployment) GetTask() string {\n\tif d == nil || d.Task == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Task\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (d *Deployment) GetUpdatedAt() Timestamp {\n\tif d == nil || d.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *d.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (d *Deployment) GetURL() string {\n\tif d == nil || d.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.URL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentBranchPolicy) GetID() int64 {\n\tif d == nil || d.ID == nil {\n\t\treturn 0\n\t}\n\treturn *d.ID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentBranchPolicy) GetName() string {\n\tif d == nil || d.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Name\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentBranchPolicy) GetNodeID() string {\n\tif d == nil || d.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.NodeID\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentBranchPolicy) GetType() string {\n\tif d == nil || d.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Type\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentBranchPolicyRequest) GetName() string {\n\tif d == nil || d.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Name\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentBranchPolicyRequest) GetType() string {\n\tif d == nil || d.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Type\n}\n\n// GetBranchPolicies returns the BranchPolicies slice if it's non-nil, nil otherwise.\nfunc (d *DeploymentBranchPolicyResponse) GetBranchPolicies() []*DeploymentBranchPolicy {\n\tif d == nil || d.BranchPolicies == nil {\n\t\treturn nil\n\t}\n\treturn d.BranchPolicies\n}\n\n// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentBranchPolicyResponse) GetTotalCount() int {\n\tif d == nil || d.TotalCount == nil {\n\t\treturn 0\n\t}\n\treturn *d.TotalCount\n}\n\n// GetDeployment returns the Deployment field.\nfunc (d *DeploymentEvent) GetDeployment() *Deployment {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Deployment\n}\n\n// GetInstallation returns the Installation field.\nfunc (d *DeploymentEvent) GetInstallation() *Installation {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (d *DeploymentEvent) GetOrg() *Organization {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Org\n}\n\n// GetRepo returns the Repo field.\nfunc (d *DeploymentEvent) GetRepo() *Repository {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (d *DeploymentEvent) GetSender() *User {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Sender\n}\n\n// GetWorkflow returns the Workflow field.\nfunc (d *DeploymentEvent) GetWorkflow() *Workflow {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Workflow\n}\n\n// GetWorkflowRun returns the WorkflowRun field.\nfunc (d *DeploymentEvent) GetWorkflowRun() *WorkflowRun {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.WorkflowRun\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentProtectionRuleEvent) GetAction() string {\n\tif d == nil || d.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Action\n}\n\n// GetDeployment returns the Deployment field.\nfunc (d *DeploymentProtectionRuleEvent) GetDeployment() *Deployment {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Deployment\n}\n\n// GetDeploymentCallbackURL returns the DeploymentCallbackURL field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentProtectionRuleEvent) GetDeploymentCallbackURL() string {\n\tif d == nil || d.DeploymentCallbackURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.DeploymentCallbackURL\n}\n\n// GetEnvironment returns the Environment field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentProtectionRuleEvent) GetEnvironment() string {\n\tif d == nil || d.Environment == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Environment\n}\n\n// GetEvent returns the Event field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentProtectionRuleEvent) GetEvent() string {\n\tif d == nil || d.Event == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Event\n}\n\n// GetInstallation returns the Installation field.\nfunc (d *DeploymentProtectionRuleEvent) GetInstallation() *Installation {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Installation\n}\n\n// GetOrganization returns the Organization field.\nfunc (d *DeploymentProtectionRuleEvent) GetOrganization() *Organization {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Organization\n}\n\n// GetPullRequests returns the PullRequests slice if it's non-nil, nil otherwise.\nfunc (d *DeploymentProtectionRuleEvent) GetPullRequests() []*PullRequest {\n\tif d == nil || d.PullRequests == nil {\n\t\treturn nil\n\t}\n\treturn d.PullRequests\n}\n\n// GetRepo returns the Repo field.\nfunc (d *DeploymentProtectionRuleEvent) GetRepo() *Repository {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (d *DeploymentProtectionRuleEvent) GetSender() *User {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Sender\n}\n\n// GetAutoMerge returns the AutoMerge field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentRequest) GetAutoMerge() bool {\n\tif d == nil || d.AutoMerge == nil {\n\t\treturn false\n\t}\n\treturn *d.AutoMerge\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentRequest) GetDescription() string {\n\tif d == nil || d.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Description\n}\n\n// GetEnvironment returns the Environment field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentRequest) GetEnvironment() string {\n\tif d == nil || d.Environment == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Environment\n}\n\n// GetPayload returns the Payload field.\nfunc (d *DeploymentRequest) GetPayload() any {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Payload\n}\n\n// GetProductionEnvironment returns the ProductionEnvironment field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentRequest) GetProductionEnvironment() bool {\n\tif d == nil || d.ProductionEnvironment == nil {\n\t\treturn false\n\t}\n\treturn *d.ProductionEnvironment\n}\n\n// GetRef returns the Ref field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentRequest) GetRef() string {\n\tif d == nil || d.Ref == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Ref\n}\n\n// GetRequiredContexts returns the RequiredContexts field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentRequest) GetRequiredContexts() []string {\n\tif d == nil || d.RequiredContexts == nil {\n\t\treturn nil\n\t}\n\treturn *d.RequiredContexts\n}\n\n// GetTask returns the Task field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentRequest) GetTask() string {\n\tif d == nil || d.Task == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Task\n}\n\n// GetTransientEnvironment returns the TransientEnvironment field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentRequest) GetTransientEnvironment() bool {\n\tif d == nil || d.TransientEnvironment == nil {\n\t\treturn false\n\t}\n\treturn *d.TransientEnvironment\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentReviewEvent) GetAction() string {\n\tif d == nil || d.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Action\n}\n\n// GetApprover returns the Approver field.\nfunc (d *DeploymentReviewEvent) GetApprover() *User {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Approver\n}\n\n// GetComment returns the Comment field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentReviewEvent) GetComment() string {\n\tif d == nil || d.Comment == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Comment\n}\n\n// GetEnterprise returns the Enterprise field.\nfunc (d *DeploymentReviewEvent) GetEnterprise() *Enterprise {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Enterprise\n}\n\n// GetEnvironment returns the Environment field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentReviewEvent) GetEnvironment() string {\n\tif d == nil || d.Environment == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Environment\n}\n\n// GetInstallation returns the Installation field.\nfunc (d *DeploymentReviewEvent) GetInstallation() *Installation {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Installation\n}\n\n// GetOrganization returns the Organization field.\nfunc (d *DeploymentReviewEvent) GetOrganization() *Organization {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Organization\n}\n\n// GetRepo returns the Repo field.\nfunc (d *DeploymentReviewEvent) GetRepo() *Repository {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Repo\n}\n\n// GetRequester returns the Requester field.\nfunc (d *DeploymentReviewEvent) GetRequester() *User {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Requester\n}\n\n// GetReviewers returns the Reviewers slice if it's non-nil, nil otherwise.\nfunc (d *DeploymentReviewEvent) GetReviewers() []*RequiredReviewer {\n\tif d == nil || d.Reviewers == nil {\n\t\treturn nil\n\t}\n\treturn d.Reviewers\n}\n\n// GetSender returns the Sender field.\nfunc (d *DeploymentReviewEvent) GetSender() *User {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Sender\n}\n\n// GetSince returns the Since field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentReviewEvent) GetSince() string {\n\tif d == nil || d.Since == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Since\n}\n\n// GetWorkflowJobRun returns the WorkflowJobRun field.\nfunc (d *DeploymentReviewEvent) GetWorkflowJobRun() *WorkflowJobRun {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.WorkflowJobRun\n}\n\n// GetWorkflowJobRuns returns the WorkflowJobRuns slice if it's non-nil, nil otherwise.\nfunc (d *DeploymentReviewEvent) GetWorkflowJobRuns() []*WorkflowJobRun {\n\tif d == nil || d.WorkflowJobRuns == nil {\n\t\treturn nil\n\t}\n\treturn d.WorkflowJobRuns\n}\n\n// GetWorkflowRun returns the WorkflowRun field.\nfunc (d *DeploymentReviewEvent) GetWorkflowRun() *WorkflowRun {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.WorkflowRun\n}\n\n// GetEnvironment returns the Environment field.\nfunc (d *DeploymentsListOptions) GetEnvironment() string {\n\tif d == nil {\n\t\treturn \"\"\n\t}\n\treturn d.Environment\n}\n\n// GetRef returns the Ref field.\nfunc (d *DeploymentsListOptions) GetRef() string {\n\tif d == nil {\n\t\treturn \"\"\n\t}\n\treturn d.Ref\n}\n\n// GetSHA returns the SHA field.\nfunc (d *DeploymentsListOptions) GetSHA() string {\n\tif d == nil {\n\t\treturn \"\"\n\t}\n\treturn d.SHA\n}\n\n// GetTask returns the Task field.\nfunc (d *DeploymentsListOptions) GetTask() string {\n\tif d == nil {\n\t\treturn \"\"\n\t}\n\treturn d.Task\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentStatus) GetCreatedAt() Timestamp {\n\tif d == nil || d.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *d.CreatedAt\n}\n\n// GetCreator returns the Creator field.\nfunc (d *DeploymentStatus) GetCreator() *User {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Creator\n}\n\n// GetDeploymentURL returns the DeploymentURL field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentStatus) GetDeploymentURL() string {\n\tif d == nil || d.DeploymentURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.DeploymentURL\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentStatus) GetDescription() string {\n\tif d == nil || d.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Description\n}\n\n// GetEnvironment returns the Environment field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentStatus) GetEnvironment() string {\n\tif d == nil || d.Environment == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Environment\n}\n\n// GetEnvironmentURL returns the EnvironmentURL field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentStatus) GetEnvironmentURL() string {\n\tif d == nil || d.EnvironmentURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.EnvironmentURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentStatus) GetID() int64 {\n\tif d == nil || d.ID == nil {\n\t\treturn 0\n\t}\n\treturn *d.ID\n}\n\n// GetLogURL returns the LogURL field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentStatus) GetLogURL() string {\n\tif d == nil || d.LogURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.LogURL\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentStatus) GetNodeID() string {\n\tif d == nil || d.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.NodeID\n}\n\n// GetRepositoryURL returns the RepositoryURL field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentStatus) GetRepositoryURL() string {\n\tif d == nil || d.RepositoryURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.RepositoryURL\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentStatus) GetState() string {\n\tif d == nil || d.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.State\n}\n\n// GetTargetURL returns the TargetURL field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentStatus) GetTargetURL() string {\n\tif d == nil || d.TargetURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.TargetURL\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentStatus) GetUpdatedAt() Timestamp {\n\tif d == nil || d.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *d.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentStatus) GetURL() string {\n\tif d == nil || d.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.URL\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentStatusEvent) GetAction() string {\n\tif d == nil || d.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Action\n}\n\n// GetDeployment returns the Deployment field.\nfunc (d *DeploymentStatusEvent) GetDeployment() *Deployment {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Deployment\n}\n\n// GetDeploymentStatus returns the DeploymentStatus field.\nfunc (d *DeploymentStatusEvent) GetDeploymentStatus() *DeploymentStatus {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.DeploymentStatus\n}\n\n// GetInstallation returns the Installation field.\nfunc (d *DeploymentStatusEvent) GetInstallation() *Installation {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (d *DeploymentStatusEvent) GetOrg() *Organization {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Org\n}\n\n// GetRepo returns the Repo field.\nfunc (d *DeploymentStatusEvent) GetRepo() *Repository {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (d *DeploymentStatusEvent) GetSender() *User {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Sender\n}\n\n// GetAutoInactive returns the AutoInactive field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentStatusRequest) GetAutoInactive() bool {\n\tif d == nil || d.AutoInactive == nil {\n\t\treturn false\n\t}\n\treturn *d.AutoInactive\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentStatusRequest) GetDescription() string {\n\tif d == nil || d.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Description\n}\n\n// GetEnvironment returns the Environment field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentStatusRequest) GetEnvironment() string {\n\tif d == nil || d.Environment == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Environment\n}\n\n// GetEnvironmentURL returns the EnvironmentURL field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentStatusRequest) GetEnvironmentURL() string {\n\tif d == nil || d.EnvironmentURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.EnvironmentURL\n}\n\n// GetLogURL returns the LogURL field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentStatusRequest) GetLogURL() string {\n\tif d == nil || d.LogURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.LogURL\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (d *DeploymentStatusRequest) GetState() string {\n\tif d == nil || d.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.State\n}\n\n// GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise.\nfunc (d *DevContainer) GetDisplayName() string {\n\tif d == nil || d.DisplayName == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.DisplayName\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (d *DevContainer) GetName() string {\n\tif d == nil || d.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Name\n}\n\n// GetPath returns the Path field.\nfunc (d *DevContainer) GetPath() string {\n\tif d == nil {\n\t\treturn \"\"\n\t}\n\treturn d.Path\n}\n\n// GetDevcontainers returns the Devcontainers slice if it's non-nil, nil otherwise.\nfunc (d *DevContainerConfigurations) GetDevcontainers() []*DevContainer {\n\tif d == nil || d.Devcontainers == nil {\n\t\treturn nil\n\t}\n\treturn d.Devcontainers\n}\n\n// GetTotalCount returns the TotalCount field.\nfunc (d *DevContainerConfigurations) GetTotalCount() int64 {\n\tif d == nil {\n\t\treturn 0\n\t}\n\treturn d.TotalCount\n}\n\n// GetActiveLockReason returns the ActiveLockReason field if it's non-nil, zero value otherwise.\nfunc (d *Discussion) GetActiveLockReason() string {\n\tif d == nil || d.ActiveLockReason == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.ActiveLockReason\n}\n\n// GetAnswerChosenAt returns the AnswerChosenAt field if it's non-nil, zero value otherwise.\nfunc (d *Discussion) GetAnswerChosenAt() Timestamp {\n\tif d == nil || d.AnswerChosenAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *d.AnswerChosenAt\n}\n\n// GetAnswerChosenBy returns the AnswerChosenBy field if it's non-nil, zero value otherwise.\nfunc (d *Discussion) GetAnswerChosenBy() string {\n\tif d == nil || d.AnswerChosenBy == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.AnswerChosenBy\n}\n\n// GetAnswerHTMLURL returns the AnswerHTMLURL field if it's non-nil, zero value otherwise.\nfunc (d *Discussion) GetAnswerHTMLURL() string {\n\tif d == nil || d.AnswerHTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.AnswerHTMLURL\n}\n\n// GetAuthorAssociation returns the AuthorAssociation field if it's non-nil, zero value otherwise.\nfunc (d *Discussion) GetAuthorAssociation() string {\n\tif d == nil || d.AuthorAssociation == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.AuthorAssociation\n}\n\n// GetBody returns the Body field if it's non-nil, zero value otherwise.\nfunc (d *Discussion) GetBody() string {\n\tif d == nil || d.Body == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Body\n}\n\n// GetComments returns the Comments field if it's non-nil, zero value otherwise.\nfunc (d *Discussion) GetComments() int {\n\tif d == nil || d.Comments == nil {\n\t\treturn 0\n\t}\n\treturn *d.Comments\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (d *Discussion) GetCreatedAt() Timestamp {\n\tif d == nil || d.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *d.CreatedAt\n}\n\n// GetDiscussionCategory returns the DiscussionCategory field.\nfunc (d *Discussion) GetDiscussionCategory() *DiscussionCategory {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.DiscussionCategory\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (d *Discussion) GetHTMLURL() string {\n\tif d == nil || d.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (d *Discussion) GetID() int64 {\n\tif d == nil || d.ID == nil {\n\t\treturn 0\n\t}\n\treturn *d.ID\n}\n\n// GetLocked returns the Locked field if it's non-nil, zero value otherwise.\nfunc (d *Discussion) GetLocked() bool {\n\tif d == nil || d.Locked == nil {\n\t\treturn false\n\t}\n\treturn *d.Locked\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (d *Discussion) GetNodeID() string {\n\tif d == nil || d.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.NodeID\n}\n\n// GetNumber returns the Number field if it's non-nil, zero value otherwise.\nfunc (d *Discussion) GetNumber() int {\n\tif d == nil || d.Number == nil {\n\t\treturn 0\n\t}\n\treturn *d.Number\n}\n\n// GetRepositoryURL returns the RepositoryURL field if it's non-nil, zero value otherwise.\nfunc (d *Discussion) GetRepositoryURL() string {\n\tif d == nil || d.RepositoryURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.RepositoryURL\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (d *Discussion) GetState() string {\n\tif d == nil || d.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.State\n}\n\n// GetTitle returns the Title field if it's non-nil, zero value otherwise.\nfunc (d *Discussion) GetTitle() string {\n\tif d == nil || d.Title == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Title\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (d *Discussion) GetUpdatedAt() Timestamp {\n\tif d == nil || d.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *d.UpdatedAt\n}\n\n// GetUser returns the User field.\nfunc (d *Discussion) GetUser() *User {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.User\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (d *DiscussionCategory) GetCreatedAt() Timestamp {\n\tif d == nil || d.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *d.CreatedAt\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (d *DiscussionCategory) GetDescription() string {\n\tif d == nil || d.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Description\n}\n\n// GetEmoji returns the Emoji field if it's non-nil, zero value otherwise.\nfunc (d *DiscussionCategory) GetEmoji() string {\n\tif d == nil || d.Emoji == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Emoji\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (d *DiscussionCategory) GetID() int64 {\n\tif d == nil || d.ID == nil {\n\t\treturn 0\n\t}\n\treturn *d.ID\n}\n\n// GetIsAnswerable returns the IsAnswerable field if it's non-nil, zero value otherwise.\nfunc (d *DiscussionCategory) GetIsAnswerable() bool {\n\tif d == nil || d.IsAnswerable == nil {\n\t\treturn false\n\t}\n\treturn *d.IsAnswerable\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (d *DiscussionCategory) GetName() string {\n\tif d == nil || d.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Name\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (d *DiscussionCategory) GetNodeID() string {\n\tif d == nil || d.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.NodeID\n}\n\n// GetRepositoryID returns the RepositoryID field if it's non-nil, zero value otherwise.\nfunc (d *DiscussionCategory) GetRepositoryID() int64 {\n\tif d == nil || d.RepositoryID == nil {\n\t\treturn 0\n\t}\n\treturn *d.RepositoryID\n}\n\n// GetSlug returns the Slug field if it's non-nil, zero value otherwise.\nfunc (d *DiscussionCategory) GetSlug() string {\n\tif d == nil || d.Slug == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Slug\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (d *DiscussionCategory) GetUpdatedAt() Timestamp {\n\tif d == nil || d.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *d.UpdatedAt\n}\n\n// GetAuthor returns the Author field.\nfunc (d *DiscussionComment) GetAuthor() *User {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Author\n}\n\n// GetBody returns the Body field if it's non-nil, zero value otherwise.\nfunc (d *DiscussionComment) GetBody() string {\n\tif d == nil || d.Body == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Body\n}\n\n// GetBodyHTML returns the BodyHTML field if it's non-nil, zero value otherwise.\nfunc (d *DiscussionComment) GetBodyHTML() string {\n\tif d == nil || d.BodyHTML == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.BodyHTML\n}\n\n// GetBodyVersion returns the BodyVersion field if it's non-nil, zero value otherwise.\nfunc (d *DiscussionComment) GetBodyVersion() string {\n\tif d == nil || d.BodyVersion == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.BodyVersion\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (d *DiscussionComment) GetCreatedAt() Timestamp {\n\tif d == nil || d.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *d.CreatedAt\n}\n\n// GetDiscussionURL returns the DiscussionURL field if it's non-nil, zero value otherwise.\nfunc (d *DiscussionComment) GetDiscussionURL() string {\n\tif d == nil || d.DiscussionURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.DiscussionURL\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (d *DiscussionComment) GetHTMLURL() string {\n\tif d == nil || d.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.HTMLURL\n}\n\n// GetLastEditedAt returns the LastEditedAt field if it's non-nil, zero value otherwise.\nfunc (d *DiscussionComment) GetLastEditedAt() Timestamp {\n\tif d == nil || d.LastEditedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *d.LastEditedAt\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (d *DiscussionComment) GetNodeID() string {\n\tif d == nil || d.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.NodeID\n}\n\n// GetNumber returns the Number field if it's non-nil, zero value otherwise.\nfunc (d *DiscussionComment) GetNumber() int {\n\tif d == nil || d.Number == nil {\n\t\treturn 0\n\t}\n\treturn *d.Number\n}\n\n// GetReactions returns the Reactions field.\nfunc (d *DiscussionComment) GetReactions() *Reactions {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Reactions\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (d *DiscussionComment) GetUpdatedAt() Timestamp {\n\tif d == nil || d.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *d.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (d *DiscussionComment) GetURL() string {\n\tif d == nil || d.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.URL\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (d *DiscussionCommentEvent) GetAction() string {\n\tif d == nil || d.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Action\n}\n\n// GetComment returns the Comment field.\nfunc (d *DiscussionCommentEvent) GetComment() *CommentDiscussion {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Comment\n}\n\n// GetDiscussion returns the Discussion field.\nfunc (d *DiscussionCommentEvent) GetDiscussion() *Discussion {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Discussion\n}\n\n// GetInstallation returns the Installation field.\nfunc (d *DiscussionCommentEvent) GetInstallation() *Installation {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (d *DiscussionCommentEvent) GetOrg() *Organization {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Org\n}\n\n// GetRepo returns the Repo field.\nfunc (d *DiscussionCommentEvent) GetRepo() *Repository {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (d *DiscussionCommentEvent) GetSender() *User {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Sender\n}\n\n// GetDirection returns the Direction field.\nfunc (d *DiscussionCommentListOptions) GetDirection() string {\n\tif d == nil {\n\t\treturn \"\"\n\t}\n\treturn d.Direction\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (d *DiscussionEvent) GetAction() string {\n\tif d == nil || d.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Action\n}\n\n// GetDiscussion returns the Discussion field.\nfunc (d *DiscussionEvent) GetDiscussion() *Discussion {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Discussion\n}\n\n// GetInstallation returns the Installation field.\nfunc (d *DiscussionEvent) GetInstallation() *Installation {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (d *DiscussionEvent) GetOrg() *Organization {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Org\n}\n\n// GetRepo returns the Repo field.\nfunc (d *DiscussionEvent) GetRepo() *Repository {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (d *DiscussionEvent) GetSender() *User {\n\tif d == nil {\n\t\treturn nil\n\t}\n\treturn d.Sender\n}\n\n// GetDirection returns the Direction field.\nfunc (d *DiscussionListOptions) GetDirection() string {\n\tif d == nil {\n\t\treturn \"\"\n\t}\n\treturn d.Direction\n}\n\n// GetApps returns the Apps slice if it's non-nil, nil otherwise.\nfunc (d *DismissalRestrictions) GetApps() []*App {\n\tif d == nil || d.Apps == nil {\n\t\treturn nil\n\t}\n\treturn d.Apps\n}\n\n// GetTeams returns the Teams slice if it's non-nil, nil otherwise.\nfunc (d *DismissalRestrictions) GetTeams() []*Team {\n\tif d == nil || d.Teams == nil {\n\t\treturn nil\n\t}\n\treturn d.Teams\n}\n\n// GetUsers returns the Users slice if it's non-nil, nil otherwise.\nfunc (d *DismissalRestrictions) GetUsers() []*User {\n\tif d == nil || d.Users == nil {\n\t\treturn nil\n\t}\n\treturn d.Users\n}\n\n// GetApps returns the Apps field if it's non-nil, zero value otherwise.\nfunc (d *DismissalRestrictionsRequest) GetApps() []string {\n\tif d == nil || d.Apps == nil {\n\t\treturn nil\n\t}\n\treturn *d.Apps\n}\n\n// GetTeams returns the Teams field if it's non-nil, zero value otherwise.\nfunc (d *DismissalRestrictionsRequest) GetTeams() []string {\n\tif d == nil || d.Teams == nil {\n\t\treturn nil\n\t}\n\treturn *d.Teams\n}\n\n// GetUsers returns the Users field if it's non-nil, zero value otherwise.\nfunc (d *DismissalRestrictionsRequest) GetUsers() []string {\n\tif d == nil || d.Users == nil {\n\t\treturn nil\n\t}\n\treturn *d.Users\n}\n\n// GetDismissalCommitID returns the DismissalCommitID field if it's non-nil, zero value otherwise.\nfunc (d *DismissedReview) GetDismissalCommitID() string {\n\tif d == nil || d.DismissalCommitID == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.DismissalCommitID\n}\n\n// GetDismissalMessage returns the DismissalMessage field if it's non-nil, zero value otherwise.\nfunc (d *DismissedReview) GetDismissalMessage() string {\n\tif d == nil || d.DismissalMessage == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.DismissalMessage\n}\n\n// GetReviewID returns the ReviewID field if it's non-nil, zero value otherwise.\nfunc (d *DismissedReview) GetReviewID() int64 {\n\tif d == nil || d.ReviewID == nil {\n\t\treturn 0\n\t}\n\treturn *d.ReviewID\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (d *DismissedReview) GetState() string {\n\tif d == nil || d.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.State\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (d *DismissStaleReviewsOnPushChanges) GetFrom() bool {\n\tif d == nil || d.From == nil {\n\t\treturn false\n\t}\n\treturn *d.From\n}\n\n// GetClientPayload returns the ClientPayload field if it's non-nil, zero value otherwise.\nfunc (d *DispatchRequestOptions) GetClientPayload() json.RawMessage {\n\tif d == nil || d.ClientPayload == nil {\n\t\treturn json.RawMessage{}\n\t}\n\treturn *d.ClientPayload\n}\n\n// GetEventType returns the EventType field.\nfunc (d *DispatchRequestOptions) GetEventType() string {\n\tif d == nil {\n\t\treturn \"\"\n\t}\n\treturn d.EventType\n}\n\n// GetBody returns the Body field if it's non-nil, zero value otherwise.\nfunc (d *DraftReviewComment) GetBody() string {\n\tif d == nil || d.Body == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Body\n}\n\n// GetLine returns the Line field if it's non-nil, zero value otherwise.\nfunc (d *DraftReviewComment) GetLine() int {\n\tif d == nil || d.Line == nil {\n\t\treturn 0\n\t}\n\treturn *d.Line\n}\n\n// GetPath returns the Path field if it's non-nil, zero value otherwise.\nfunc (d *DraftReviewComment) GetPath() string {\n\tif d == nil || d.Path == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Path\n}\n\n// GetPosition returns the Position field if it's non-nil, zero value otherwise.\nfunc (d *DraftReviewComment) GetPosition() int {\n\tif d == nil || d.Position == nil {\n\t\treturn 0\n\t}\n\treturn *d.Position\n}\n\n// GetSide returns the Side field if it's non-nil, zero value otherwise.\nfunc (d *DraftReviewComment) GetSide() string {\n\tif d == nil || d.Side == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.Side\n}\n\n// GetStartLine returns the StartLine field if it's non-nil, zero value otherwise.\nfunc (d *DraftReviewComment) GetStartLine() int {\n\tif d == nil || d.StartLine == nil {\n\t\treturn 0\n\t}\n\treturn *d.StartLine\n}\n\n// GetStartSide returns the StartSide field if it's non-nil, zero value otherwise.\nfunc (d *DraftReviewComment) GetStartSide() string {\n\tif d == nil || d.StartSide == nil {\n\t\treturn \"\"\n\t}\n\treturn *d.StartSide\n}\n\n// GetRef returns the Ref field.\nfunc (e *EditBase) GetRef() *EditRef {\n\tif e == nil {\n\t\treturn nil\n\t}\n\treturn e.Ref\n}\n\n// GetSHA returns the SHA field.\nfunc (e *EditBase) GetSHA() *EditSHA {\n\tif e == nil {\n\t\treturn nil\n\t}\n\treturn e.SHA\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (e *EditBody) GetFrom() string {\n\tif e == nil || e.From == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.From\n}\n\n// GetBase returns the Base field.\nfunc (e *EditChange) GetBase() *EditBase {\n\tif e == nil {\n\t\treturn nil\n\t}\n\treturn e.Base\n}\n\n// GetBody returns the Body field.\nfunc (e *EditChange) GetBody() *EditBody {\n\tif e == nil {\n\t\treturn nil\n\t}\n\treturn e.Body\n}\n\n// GetDefaultBranch returns the DefaultBranch field.\nfunc (e *EditChange) GetDefaultBranch() *EditDefaultBranch {\n\tif e == nil {\n\t\treturn nil\n\t}\n\treturn e.DefaultBranch\n}\n\n// GetOwner returns the Owner field.\nfunc (e *EditChange) GetOwner() *EditOwner {\n\tif e == nil {\n\t\treturn nil\n\t}\n\treturn e.Owner\n}\n\n// GetRepo returns the Repo field.\nfunc (e *EditChange) GetRepo() *EditRepo {\n\tif e == nil {\n\t\treturn nil\n\t}\n\treturn e.Repo\n}\n\n// GetTitle returns the Title field.\nfunc (e *EditChange) GetTitle() *EditTitle {\n\tif e == nil {\n\t\treturn nil\n\t}\n\treturn e.Title\n}\n\n// GetTopics returns the Topics field.\nfunc (e *EditChange) GetTopics() *EditTopics {\n\tif e == nil {\n\t\treturn nil\n\t}\n\treturn e.Topics\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (e *EditDefaultBranch) GetFrom() string {\n\tif e == nil || e.From == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.From\n}\n\n// GetOwnerInfo returns the OwnerInfo field.\nfunc (e *EditOwner) GetOwnerInfo() *OwnerInfo {\n\tif e == nil {\n\t\treturn nil\n\t}\n\treturn e.OwnerInfo\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (e *EditRef) GetFrom() string {\n\tif e == nil || e.From == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.From\n}\n\n// GetName returns the Name field.\nfunc (e *EditRepo) GetName() *RepoName {\n\tif e == nil {\n\t\treturn nil\n\t}\n\treturn e.Name\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (e *EditSHA) GetFrom() string {\n\tif e == nil || e.From == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.From\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (e *EditTitle) GetFrom() string {\n\tif e == nil || e.From == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.From\n}\n\n// GetFrom returns the From slice if it's non-nil, nil otherwise.\nfunc (e *EditTopics) GetFrom() []string {\n\tif e == nil || e.From == nil {\n\t\treturn nil\n\t}\n\treturn e.From\n}\n\n// GetEncryptedValue returns the EncryptedValue field.\nfunc (e *EncryptedSecret) GetEncryptedValue() string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\treturn e.EncryptedValue\n}\n\n// GetKeyID returns the KeyID field.\nfunc (e *EncryptedSecret) GetKeyID() string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\treturn e.KeyID\n}\n\n// GetName returns the Name field.\nfunc (e *EncryptedSecret) GetName() string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\treturn e.Name\n}\n\n// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs field.\nfunc (e *EncryptedSecret) GetSelectedRepositoryIDs() SelectedRepoIDs {\n\tif e == nil {\n\t\treturn nil\n\t}\n\treturn e.SelectedRepositoryIDs\n}\n\n// GetVisibility returns the Visibility field.\nfunc (e *EncryptedSecret) GetVisibility() string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\treturn e.Visibility\n}\n\n// GetAvatarURL returns the AvatarURL field if it's non-nil, zero value otherwise.\nfunc (e *Enterprise) GetAvatarURL() string {\n\tif e == nil || e.AvatarURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.AvatarURL\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (e *Enterprise) GetCreatedAt() Timestamp {\n\tif e == nil || e.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *e.CreatedAt\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (e *Enterprise) GetDescription() string {\n\tif e == nil || e.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Description\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (e *Enterprise) GetHTMLURL() string {\n\tif e == nil || e.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (e *Enterprise) GetID() int {\n\tif e == nil || e.ID == nil {\n\t\treturn 0\n\t}\n\treturn *e.ID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (e *Enterprise) GetName() string {\n\tif e == nil || e.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Name\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (e *Enterprise) GetNodeID() string {\n\tif e == nil || e.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.NodeID\n}\n\n// GetSlug returns the Slug field if it's non-nil, zero value otherwise.\nfunc (e *Enterprise) GetSlug() string {\n\tif e == nil || e.Slug == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Slug\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (e *Enterprise) GetUpdatedAt() Timestamp {\n\tif e == nil || e.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *e.UpdatedAt\n}\n\n// GetWebsiteURL returns the WebsiteURL field if it's non-nil, zero value otherwise.\nfunc (e *Enterprise) GetWebsiteURL() string {\n\tif e == nil || e.WebsiteURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.WebsiteURL\n}\n\n// GetBudgetAlerting returns the BudgetAlerting field.\nfunc (e *EnterpriseBudget) GetBudgetAlerting() *EnterpriseBudgetAlerting {\n\tif e == nil {\n\t\treturn nil\n\t}\n\treturn e.BudgetAlerting\n}\n\n// GetBudgetAmount returns the BudgetAmount field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseBudget) GetBudgetAmount() int {\n\tif e == nil || e.BudgetAmount == nil {\n\t\treturn 0\n\t}\n\treturn *e.BudgetAmount\n}\n\n// GetBudgetEntityName returns the BudgetEntityName field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseBudget) GetBudgetEntityName() string {\n\tif e == nil || e.BudgetEntityName == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.BudgetEntityName\n}\n\n// GetBudgetProductSKU returns the BudgetProductSKU field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseBudget) GetBudgetProductSKU() string {\n\tif e == nil || e.BudgetProductSKU == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.BudgetProductSKU\n}\n\n// GetBudgetScope returns the BudgetScope field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseBudget) GetBudgetScope() string {\n\tif e == nil || e.BudgetScope == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.BudgetScope\n}\n\n// GetBudgetType returns the BudgetType field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseBudget) GetBudgetType() string {\n\tif e == nil || e.BudgetType == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.BudgetType\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseBudget) GetID() string {\n\tif e == nil || e.ID == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.ID\n}\n\n// GetPreventFurtherUsage returns the PreventFurtherUsage field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseBudget) GetPreventFurtherUsage() bool {\n\tif e == nil || e.PreventFurtherUsage == nil {\n\t\treturn false\n\t}\n\treturn *e.PreventFurtherUsage\n}\n\n// GetAlertRecipients returns the AlertRecipients slice if it's non-nil, nil otherwise.\nfunc (e *EnterpriseBudgetAlerting) GetAlertRecipients() []string {\n\tif e == nil || e.AlertRecipients == nil {\n\t\treturn nil\n\t}\n\treturn e.AlertRecipients\n}\n\n// GetWillAlert returns the WillAlert field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseBudgetAlerting) GetWillAlert() bool {\n\tif e == nil || e.WillAlert == nil {\n\t\treturn false\n\t}\n\treturn *e.WillAlert\n}\n\n// GetTotalSeatsConsumed returns the TotalSeatsConsumed field.\nfunc (e *EnterpriseConsumedLicenses) GetTotalSeatsConsumed() int {\n\tif e == nil {\n\t\treturn 0\n\t}\n\treturn e.TotalSeatsConsumed\n}\n\n// GetTotalSeatsPurchased returns the TotalSeatsPurchased field.\nfunc (e *EnterpriseConsumedLicenses) GetTotalSeatsPurchased() int {\n\tif e == nil {\n\t\treturn 0\n\t}\n\treturn e.TotalSeatsPurchased\n}\n\n// GetUsers returns the Users slice if it's non-nil, nil otherwise.\nfunc (e *EnterpriseConsumedLicenses) GetUsers() []*EnterpriseLicensedUsers {\n\tif e == nil || e.Users == nil {\n\t\treturn nil\n\t}\n\treturn e.Users\n}\n\n// GetBudgetAlerting returns the BudgetAlerting field.\nfunc (e *EnterpriseCreateBudget) GetBudgetAlerting() *EnterpriseBudgetAlerting {\n\tif e == nil {\n\t\treturn nil\n\t}\n\treturn e.BudgetAlerting\n}\n\n// GetBudgetAmount returns the BudgetAmount field.\nfunc (e *EnterpriseCreateBudget) GetBudgetAmount() int {\n\tif e == nil {\n\t\treturn 0\n\t}\n\treturn e.BudgetAmount\n}\n\n// GetBudgetEntityName returns the BudgetEntityName field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseCreateBudget) GetBudgetEntityName() string {\n\tif e == nil || e.BudgetEntityName == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.BudgetEntityName\n}\n\n// GetBudgetProductSKU returns the BudgetProductSKU field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseCreateBudget) GetBudgetProductSKU() string {\n\tif e == nil || e.BudgetProductSKU == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.BudgetProductSKU\n}\n\n// GetBudgetScope returns the BudgetScope field.\nfunc (e *EnterpriseCreateBudget) GetBudgetScope() string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\treturn e.BudgetScope\n}\n\n// GetBudgetType returns the BudgetType field.\nfunc (e *EnterpriseCreateBudget) GetBudgetType() string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\treturn e.BudgetType\n}\n\n// GetPreventFurtherUsage returns the PreventFurtherUsage field.\nfunc (e *EnterpriseCreateBudget) GetPreventFurtherUsage() bool {\n\tif e == nil {\n\t\treturn false\n\t}\n\treturn e.PreventFurtherUsage\n}\n\n// GetBudget returns the Budget field.\nfunc (e *EnterpriseCreateOrUpdateBudgetResponse) GetBudget() *EnterpriseBudget {\n\tif e == nil {\n\t\treturn nil\n\t}\n\treturn e.Budget\n}\n\n// GetMessage returns the Message field.\nfunc (e *EnterpriseCreateOrUpdateBudgetResponse) GetMessage() string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\treturn e.Message\n}\n\n// GetOrganizationID returns the OrganizationID field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseCustomPropertiesValues) GetOrganizationID() int64 {\n\tif e == nil || e.OrganizationID == nil {\n\t\treturn 0\n\t}\n\treturn *e.OrganizationID\n}\n\n// GetOrganizationLogin returns the OrganizationLogin field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseCustomPropertiesValues) GetOrganizationLogin() string {\n\tif e == nil || e.OrganizationLogin == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.OrganizationLogin\n}\n\n// GetProperties returns the Properties slice if it's non-nil, nil otherwise.\nfunc (e *EnterpriseCustomPropertiesValues) GetProperties() []*CustomPropertyValue {\n\tif e == nil || e.Properties == nil {\n\t\treturn nil\n\t}\n\treturn e.Properties\n}\n\n// GetProperties returns the Properties slice if it's non-nil, nil otherwise.\nfunc (e *EnterpriseCustomPropertySchema) GetProperties() []*CustomProperty {\n\tif e == nil || e.Properties == nil {\n\t\treturn nil\n\t}\n\treturn e.Properties\n}\n\n// GetOrganizationLogin returns the OrganizationLogin slice if it's non-nil, nil otherwise.\nfunc (e *EnterpriseCustomPropertyValuesRequest) GetOrganizationLogin() []string {\n\tif e == nil || e.OrganizationLogin == nil {\n\t\treturn nil\n\t}\n\treturn e.OrganizationLogin\n}\n\n// GetProperties returns the Properties slice if it's non-nil, nil otherwise.\nfunc (e *EnterpriseCustomPropertyValuesRequest) GetProperties() []*CustomPropertyValue {\n\tif e == nil || e.Properties == nil {\n\t\treturn nil\n\t}\n\treturn e.Properties\n}\n\n// GetID returns the ID field.\nfunc (e *EnterpriseDeleteBudgetResponse) GetID() string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\treturn e.ID\n}\n\n// GetMessage returns the Message field.\nfunc (e *EnterpriseDeleteBudgetResponse) GetMessage() string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\treturn e.Message\n}\n\n// GetEnterpriseServerEmails returns the EnterpriseServerEmails slice if it's non-nil, nil otherwise.\nfunc (e *EnterpriseLicensedUsers) GetEnterpriseServerEmails() []string {\n\tif e == nil || e.EnterpriseServerEmails == nil {\n\t\treturn nil\n\t}\n\treturn e.EnterpriseServerEmails\n}\n\n// GetEnterpriseServerUser returns the EnterpriseServerUser field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseLicensedUsers) GetEnterpriseServerUser() bool {\n\tif e == nil || e.EnterpriseServerUser == nil {\n\t\treturn false\n\t}\n\treturn *e.EnterpriseServerUser\n}\n\n// GetEnterpriseServerUserIDs returns the EnterpriseServerUserIDs slice if it's non-nil, nil otherwise.\nfunc (e *EnterpriseLicensedUsers) GetEnterpriseServerUserIDs() []string {\n\tif e == nil || e.EnterpriseServerUserIDs == nil {\n\t\treturn nil\n\t}\n\treturn e.EnterpriseServerUserIDs\n}\n\n// GetGithubComEnterpriseRoles returns the GithubComEnterpriseRoles slice if it's non-nil, nil otherwise.\nfunc (e *EnterpriseLicensedUsers) GetGithubComEnterpriseRoles() []string {\n\tif e == nil || e.GithubComEnterpriseRoles == nil {\n\t\treturn nil\n\t}\n\treturn e.GithubComEnterpriseRoles\n}\n\n// GetGithubComLogin returns the GithubComLogin field.\nfunc (e *EnterpriseLicensedUsers) GetGithubComLogin() string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\treturn e.GithubComLogin\n}\n\n// GetGithubComMemberRoles returns the GithubComMemberRoles slice if it's non-nil, nil otherwise.\nfunc (e *EnterpriseLicensedUsers) GetGithubComMemberRoles() []string {\n\tif e == nil || e.GithubComMemberRoles == nil {\n\t\treturn nil\n\t}\n\treturn e.GithubComMemberRoles\n}\n\n// GetGithubComName returns the GithubComName field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseLicensedUsers) GetGithubComName() string {\n\tif e == nil || e.GithubComName == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.GithubComName\n}\n\n// GetGithubComOrgsWithPendingInvites returns the GithubComOrgsWithPendingInvites slice if it's non-nil, nil otherwise.\nfunc (e *EnterpriseLicensedUsers) GetGithubComOrgsWithPendingInvites() []string {\n\tif e == nil || e.GithubComOrgsWithPendingInvites == nil {\n\t\treturn nil\n\t}\n\treturn e.GithubComOrgsWithPendingInvites\n}\n\n// GetGithubComProfile returns the GithubComProfile field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseLicensedUsers) GetGithubComProfile() string {\n\tif e == nil || e.GithubComProfile == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.GithubComProfile\n}\n\n// GetGithubComSamlNameID returns the GithubComSamlNameID field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseLicensedUsers) GetGithubComSamlNameID() string {\n\tif e == nil || e.GithubComSamlNameID == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.GithubComSamlNameID\n}\n\n// GetGithubComTwoFactorAuth returns the GithubComTwoFactorAuth field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseLicensedUsers) GetGithubComTwoFactorAuth() bool {\n\tif e == nil || e.GithubComTwoFactorAuth == nil {\n\t\treturn false\n\t}\n\treturn *e.GithubComTwoFactorAuth\n}\n\n// GetGithubComUser returns the GithubComUser field.\nfunc (e *EnterpriseLicensedUsers) GetGithubComUser() bool {\n\tif e == nil {\n\t\treturn false\n\t}\n\treturn e.GithubComUser\n}\n\n// GetGithubComVerifiedDomainEmails returns the GithubComVerifiedDomainEmails slice if it's non-nil, nil otherwise.\nfunc (e *EnterpriseLicensedUsers) GetGithubComVerifiedDomainEmails() []string {\n\tif e == nil || e.GithubComVerifiedDomainEmails == nil {\n\t\treturn nil\n\t}\n\treturn e.GithubComVerifiedDomainEmails\n}\n\n// GetLicenseType returns the LicenseType field.\nfunc (e *EnterpriseLicensedUsers) GetLicenseType() string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\treturn e.LicenseType\n}\n\n// GetTotalUserAccounts returns the TotalUserAccounts field.\nfunc (e *EnterpriseLicensedUsers) GetTotalUserAccounts() int {\n\tif e == nil {\n\t\treturn 0\n\t}\n\treturn e.TotalUserAccounts\n}\n\n// GetVisualStudioLicenseStatus returns the VisualStudioLicenseStatus field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseLicensedUsers) GetVisualStudioLicenseStatus() string {\n\tif e == nil || e.VisualStudioLicenseStatus == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.VisualStudioLicenseStatus\n}\n\n// GetVisualStudioSubscriptionEmail returns the VisualStudioSubscriptionEmail field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseLicensedUsers) GetVisualStudioSubscriptionEmail() string {\n\tif e == nil || e.VisualStudioSubscriptionEmail == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.VisualStudioSubscriptionEmail\n}\n\n// GetVisualStudioSubscriptionUser returns the VisualStudioSubscriptionUser field.\nfunc (e *EnterpriseLicensedUsers) GetVisualStudioSubscriptionUser() bool {\n\tif e == nil {\n\t\treturn false\n\t}\n\treturn e.VisualStudioSubscriptionUser\n}\n\n// GetDescription returns the Description field.\nfunc (e *EnterpriseLicenseSyncStatus) GetDescription() string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\treturn e.Description\n}\n\n// GetProperties returns the Properties field.\nfunc (e *EnterpriseLicenseSyncStatus) GetProperties() *ServerInstanceProperties {\n\tif e == nil {\n\t\treturn nil\n\t}\n\treturn e.Properties\n}\n\n// GetTitle returns the Title field.\nfunc (e *EnterpriseLicenseSyncStatus) GetTitle() string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\treturn e.Title\n}\n\n// GetBudgets returns the Budgets slice if it's non-nil, nil otherwise.\nfunc (e *EnterpriseListBudgets) GetBudgets() []*EnterpriseBudget {\n\tif e == nil || e.Budgets == nil {\n\t\treturn nil\n\t}\n\treturn e.Budgets\n}\n\n// GetHasNextPage returns the HasNextPage field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseListBudgets) GetHasNextPage() bool {\n\tif e == nil || e.HasNextPage == nil {\n\t\treturn false\n\t}\n\treturn *e.HasNextPage\n}\n\n// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseListBudgets) GetTotalCount() int {\n\tif e == nil || e.TotalCount == nil {\n\t\treturn 0\n\t}\n\treturn *e.TotalCount\n}\n\n// GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseRunnerGroup) GetAllowsPublicRepositories() bool {\n\tif e == nil || e.AllowsPublicRepositories == nil {\n\t\treturn false\n\t}\n\treturn *e.AllowsPublicRepositories\n}\n\n// GetDefault returns the Default field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseRunnerGroup) GetDefault() bool {\n\tif e == nil || e.Default == nil {\n\t\treturn false\n\t}\n\treturn *e.Default\n}\n\n// GetHostedRunnersURL returns the HostedRunnersURL field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseRunnerGroup) GetHostedRunnersURL() string {\n\tif e == nil || e.HostedRunnersURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.HostedRunnersURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseRunnerGroup) GetID() int64 {\n\tif e == nil || e.ID == nil {\n\t\treturn 0\n\t}\n\treturn *e.ID\n}\n\n// GetInherited returns the Inherited field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseRunnerGroup) GetInherited() bool {\n\tif e == nil || e.Inherited == nil {\n\t\treturn false\n\t}\n\treturn *e.Inherited\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseRunnerGroup) GetName() string {\n\tif e == nil || e.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Name\n}\n\n// GetNetworkConfigurationID returns the NetworkConfigurationID field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseRunnerGroup) GetNetworkConfigurationID() string {\n\tif e == nil || e.NetworkConfigurationID == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.NetworkConfigurationID\n}\n\n// GetRestrictedToWorkflows returns the RestrictedToWorkflows field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseRunnerGroup) GetRestrictedToWorkflows() bool {\n\tif e == nil || e.RestrictedToWorkflows == nil {\n\t\treturn false\n\t}\n\treturn *e.RestrictedToWorkflows\n}\n\n// GetRunnersURL returns the RunnersURL field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseRunnerGroup) GetRunnersURL() string {\n\tif e == nil || e.RunnersURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.RunnersURL\n}\n\n// GetSelectedOrganizationsURL returns the SelectedOrganizationsURL field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseRunnerGroup) GetSelectedOrganizationsURL() string {\n\tif e == nil || e.SelectedOrganizationsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.SelectedOrganizationsURL\n}\n\n// GetSelectedWorkflows returns the SelectedWorkflows slice if it's non-nil, nil otherwise.\nfunc (e *EnterpriseRunnerGroup) GetSelectedWorkflows() []string {\n\tif e == nil || e.SelectedWorkflows == nil {\n\t\treturn nil\n\t}\n\treturn e.SelectedWorkflows\n}\n\n// GetVisibility returns the Visibility field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseRunnerGroup) GetVisibility() string {\n\tif e == nil || e.Visibility == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Visibility\n}\n\n// GetWorkflowRestrictionsReadOnly returns the WorkflowRestrictionsReadOnly field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseRunnerGroup) GetWorkflowRestrictionsReadOnly() bool {\n\tif e == nil || e.WorkflowRestrictionsReadOnly == nil {\n\t\treturn false\n\t}\n\treturn *e.WorkflowRestrictionsReadOnly\n}\n\n// GetRunnerGroups returns the RunnerGroups slice if it's non-nil, nil otherwise.\nfunc (e *EnterpriseRunnerGroups) GetRunnerGroups() []*EnterpriseRunnerGroup {\n\tif e == nil || e.RunnerGroups == nil {\n\t\treturn nil\n\t}\n\treturn e.RunnerGroups\n}\n\n// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseRunnerGroups) GetTotalCount() int {\n\tif e == nil || e.TotalCount == nil {\n\t\treturn 0\n\t}\n\treturn *e.TotalCount\n}\n\n// GetAdvancedSecurityEnabledForNewRepositories returns the AdvancedSecurityEnabledForNewRepositories field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseSecurityAnalysisSettings) GetAdvancedSecurityEnabledForNewRepositories() bool {\n\tif e == nil || e.AdvancedSecurityEnabledForNewRepositories == nil {\n\t\treturn false\n\t}\n\treturn *e.AdvancedSecurityEnabledForNewRepositories\n}\n\n// GetSecretScanningEnabledForNewRepositories returns the SecretScanningEnabledForNewRepositories field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseSecurityAnalysisSettings) GetSecretScanningEnabledForNewRepositories() bool {\n\tif e == nil || e.SecretScanningEnabledForNewRepositories == nil {\n\t\treturn false\n\t}\n\treturn *e.SecretScanningEnabledForNewRepositories\n}\n\n// GetSecretScanningPushProtectionCustomLink returns the SecretScanningPushProtectionCustomLink field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseSecurityAnalysisSettings) GetSecretScanningPushProtectionCustomLink() string {\n\tif e == nil || e.SecretScanningPushProtectionCustomLink == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.SecretScanningPushProtectionCustomLink\n}\n\n// GetSecretScanningPushProtectionEnabledForNewRepositories returns the SecretScanningPushProtectionEnabledForNewRepositories field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseSecurityAnalysisSettings) GetSecretScanningPushProtectionEnabledForNewRepositories() bool {\n\tif e == nil || e.SecretScanningPushProtectionEnabledForNewRepositories == nil {\n\t\treturn false\n\t}\n\treturn *e.SecretScanningPushProtectionEnabledForNewRepositories\n}\n\n// GetSecretScanningValidityChecksEnabled returns the SecretScanningValidityChecksEnabled field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseSecurityAnalysisSettings) GetSecretScanningValidityChecksEnabled() bool {\n\tif e == nil || e.SecretScanningValidityChecksEnabled == nil {\n\t\treturn false\n\t}\n\treturn *e.SecretScanningValidityChecksEnabled\n}\n\n// GetCreatedAt returns the CreatedAt field.\nfunc (e *EnterpriseTeam) GetCreatedAt() Timestamp {\n\tif e == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn e.CreatedAt\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseTeam) GetDescription() string {\n\tif e == nil || e.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Description\n}\n\n// GetGroupID returns the GroupID field.\nfunc (e *EnterpriseTeam) GetGroupID() string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\treturn e.GroupID\n}\n\n// GetHTMLURL returns the HTMLURL field.\nfunc (e *EnterpriseTeam) GetHTMLURL() string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\treturn e.HTMLURL\n}\n\n// GetID returns the ID field.\nfunc (e *EnterpriseTeam) GetID() int64 {\n\tif e == nil {\n\t\treturn 0\n\t}\n\treturn e.ID\n}\n\n// GetMemberURL returns the MemberURL field.\nfunc (e *EnterpriseTeam) GetMemberURL() string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\treturn e.MemberURL\n}\n\n// GetName returns the Name field.\nfunc (e *EnterpriseTeam) GetName() string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\treturn e.Name\n}\n\n// GetOrganizationSelectionType returns the OrganizationSelectionType field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseTeam) GetOrganizationSelectionType() string {\n\tif e == nil || e.OrganizationSelectionType == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.OrganizationSelectionType\n}\n\n// GetSlug returns the Slug field.\nfunc (e *EnterpriseTeam) GetSlug() string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\treturn e.Slug\n}\n\n// GetUpdatedAt returns the UpdatedAt field.\nfunc (e *EnterpriseTeam) GetUpdatedAt() Timestamp {\n\tif e == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn e.UpdatedAt\n}\n\n// GetURL returns the URL field.\nfunc (e *EnterpriseTeam) GetURL() string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\treturn e.URL\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseTeamCreateOrUpdateRequest) GetDescription() string {\n\tif e == nil || e.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Description\n}\n\n// GetGroupID returns the GroupID field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseTeamCreateOrUpdateRequest) GetGroupID() string {\n\tif e == nil || e.GroupID == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.GroupID\n}\n\n// GetName returns the Name field.\nfunc (e *EnterpriseTeamCreateOrUpdateRequest) GetName() string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\treturn e.Name\n}\n\n// GetOrganizationSelectionType returns the OrganizationSelectionType field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseTeamCreateOrUpdateRequest) GetOrganizationSelectionType() string {\n\tif e == nil || e.OrganizationSelectionType == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.OrganizationSelectionType\n}\n\n// GetBudgetAlerting returns the BudgetAlerting field.\nfunc (e *EnterpriseUpdateBudget) GetBudgetAlerting() *EnterpriseBudgetAlerting {\n\tif e == nil {\n\t\treturn nil\n\t}\n\treturn e.BudgetAlerting\n}\n\n// GetBudgetAmount returns the BudgetAmount field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseUpdateBudget) GetBudgetAmount() int {\n\tif e == nil || e.BudgetAmount == nil {\n\t\treturn 0\n\t}\n\treturn *e.BudgetAmount\n}\n\n// GetBudgetEntityName returns the BudgetEntityName field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseUpdateBudget) GetBudgetEntityName() string {\n\tif e == nil || e.BudgetEntityName == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.BudgetEntityName\n}\n\n// GetBudgetProductSKU returns the BudgetProductSKU field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseUpdateBudget) GetBudgetProductSKU() string {\n\tif e == nil || e.BudgetProductSKU == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.BudgetProductSKU\n}\n\n// GetBudgetScope returns the BudgetScope field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseUpdateBudget) GetBudgetScope() string {\n\tif e == nil || e.BudgetScope == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.BudgetScope\n}\n\n// GetBudgetType returns the BudgetType field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseUpdateBudget) GetBudgetType() string {\n\tif e == nil || e.BudgetType == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.BudgetType\n}\n\n// GetPreventFurtherUsage returns the PreventFurtherUsage field if it's non-nil, zero value otherwise.\nfunc (e *EnterpriseUpdateBudget) GetPreventFurtherUsage() bool {\n\tif e == nil || e.PreventFurtherUsage == nil {\n\t\treturn false\n\t}\n\treturn *e.PreventFurtherUsage\n}\n\n// GetCanAdminsBypass returns the CanAdminsBypass field if it's non-nil, zero value otherwise.\nfunc (e *Environment) GetCanAdminsBypass() bool {\n\tif e == nil || e.CanAdminsBypass == nil {\n\t\treturn false\n\t}\n\treturn *e.CanAdminsBypass\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (e *Environment) GetCreatedAt() Timestamp {\n\tif e == nil || e.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *e.CreatedAt\n}\n\n// GetDeploymentBranchPolicy returns the DeploymentBranchPolicy field.\nfunc (e *Environment) GetDeploymentBranchPolicy() *BranchPolicy {\n\tif e == nil {\n\t\treturn nil\n\t}\n\treturn e.DeploymentBranchPolicy\n}\n\n// GetEnvironmentName returns the EnvironmentName field if it's non-nil, zero value otherwise.\nfunc (e *Environment) GetEnvironmentName() string {\n\tif e == nil || e.EnvironmentName == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.EnvironmentName\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (e *Environment) GetHTMLURL() string {\n\tif e == nil || e.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (e *Environment) GetID() int64 {\n\tif e == nil || e.ID == nil {\n\t\treturn 0\n\t}\n\treturn *e.ID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (e *Environment) GetName() string {\n\tif e == nil || e.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Name\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (e *Environment) GetNodeID() string {\n\tif e == nil || e.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.NodeID\n}\n\n// GetOwner returns the Owner field if it's non-nil, zero value otherwise.\nfunc (e *Environment) GetOwner() string {\n\tif e == nil || e.Owner == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Owner\n}\n\n// GetProtectionRules returns the ProtectionRules slice if it's non-nil, nil otherwise.\nfunc (e *Environment) GetProtectionRules() []*ProtectionRule {\n\tif e == nil || e.ProtectionRules == nil {\n\t\treturn nil\n\t}\n\treturn e.ProtectionRules\n}\n\n// GetRepo returns the Repo field if it's non-nil, zero value otherwise.\nfunc (e *Environment) GetRepo() string {\n\tif e == nil || e.Repo == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Repo\n}\n\n// GetReviewers returns the Reviewers slice if it's non-nil, nil otherwise.\nfunc (e *Environment) GetReviewers() []*EnvReviewers {\n\tif e == nil || e.Reviewers == nil {\n\t\treturn nil\n\t}\n\treturn e.Reviewers\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (e *Environment) GetUpdatedAt() Timestamp {\n\tif e == nil || e.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *e.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (e *Environment) GetURL() string {\n\tif e == nil || e.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.URL\n}\n\n// GetWaitTimer returns the WaitTimer field if it's non-nil, zero value otherwise.\nfunc (e *Environment) GetWaitTimer() int {\n\tif e == nil || e.WaitTimer == nil {\n\t\treturn 0\n\t}\n\treturn *e.WaitTimer\n}\n\n// GetEnvironments returns the Environments slice if it's non-nil, nil otherwise.\nfunc (e *EnvResponse) GetEnvironments() []*Environment {\n\tif e == nil || e.Environments == nil {\n\t\treturn nil\n\t}\n\treturn e.Environments\n}\n\n// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.\nfunc (e *EnvResponse) GetTotalCount() int {\n\tif e == nil || e.TotalCount == nil {\n\t\treturn 0\n\t}\n\treturn *e.TotalCount\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (e *EnvReviewers) GetID() int64 {\n\tif e == nil || e.ID == nil {\n\t\treturn 0\n\t}\n\treturn *e.ID\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (e *EnvReviewers) GetType() string {\n\tif e == nil || e.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Type\n}\n\n// GetCode returns the Code field.\nfunc (e *Error) GetCode() string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\treturn e.Code\n}\n\n// GetField returns the Field field.\nfunc (e *Error) GetField() string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\treturn e.Field\n}\n\n// GetMessage returns the Message field.\nfunc (e *Error) GetMessage() string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\treturn e.Message\n}\n\n// GetResource returns the Resource field.\nfunc (e *Error) GetResource() string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\treturn e.Resource\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (e *ErrorBlock) GetCreatedAt() Timestamp {\n\tif e == nil || e.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *e.CreatedAt\n}\n\n// GetReason returns the Reason field.\nfunc (e *ErrorBlock) GetReason() string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\treturn e.Reason\n}\n\n// GetBlock returns the Block field.\nfunc (e *ErrorResponse) GetBlock() *ErrorBlock {\n\tif e == nil {\n\t\treturn nil\n\t}\n\treturn e.Block\n}\n\n// GetDocumentationURL returns the DocumentationURL field.\nfunc (e *ErrorResponse) GetDocumentationURL() string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\treturn e.DocumentationURL\n}\n\n// GetErrors returns the Errors slice if it's non-nil, nil otherwise.\nfunc (e *ErrorResponse) GetErrors() []Error {\n\tif e == nil || e.Errors == nil {\n\t\treturn nil\n\t}\n\treturn e.Errors\n}\n\n// GetMessage returns the Message field.\nfunc (e *ErrorResponse) GetMessage() string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\treturn e.Message\n}\n\n// GetActor returns the Actor field.\nfunc (e *Event) GetActor() *User {\n\tif e == nil {\n\t\treturn nil\n\t}\n\treturn e.Actor\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (e *Event) GetCreatedAt() Timestamp {\n\tif e == nil || e.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *e.CreatedAt\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (e *Event) GetID() string {\n\tif e == nil || e.ID == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.ID\n}\n\n// GetOrg returns the Org field.\nfunc (e *Event) GetOrg() *Organization {\n\tif e == nil {\n\t\treturn nil\n\t}\n\treturn e.Org\n}\n\n// GetPublic returns the Public field if it's non-nil, zero value otherwise.\nfunc (e *Event) GetPublic() bool {\n\tif e == nil || e.Public == nil {\n\t\treturn false\n\t}\n\treturn *e.Public\n}\n\n// GetRawPayload returns the RawPayload field if it's non-nil, zero value otherwise.\nfunc (e *Event) GetRawPayload() json.RawMessage {\n\tif e == nil || e.RawPayload == nil {\n\t\treturn json.RawMessage{}\n\t}\n\treturn *e.RawPayload\n}\n\n// GetRepo returns the Repo field.\nfunc (e *Event) GetRepo() *Repository {\n\tif e == nil {\n\t\treturn nil\n\t}\n\treturn e.Repo\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (e *Event) GetType() string {\n\tif e == nil || e.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.Type\n}\n\n// GetGroupID returns the GroupID field if it's non-nil, zero value otherwise.\nfunc (e *ExternalGroup) GetGroupID() int64 {\n\tif e == nil || e.GroupID == nil {\n\t\treturn 0\n\t}\n\treturn *e.GroupID\n}\n\n// GetGroupName returns the GroupName field if it's non-nil, zero value otherwise.\nfunc (e *ExternalGroup) GetGroupName() string {\n\tif e == nil || e.GroupName == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.GroupName\n}\n\n// GetMembers returns the Members slice if it's non-nil, nil otherwise.\nfunc (e *ExternalGroup) GetMembers() []*ExternalGroupMember {\n\tif e == nil || e.Members == nil {\n\t\treturn nil\n\t}\n\treturn e.Members\n}\n\n// GetTeams returns the Teams slice if it's non-nil, nil otherwise.\nfunc (e *ExternalGroup) GetTeams() []*ExternalGroupTeam {\n\tif e == nil || e.Teams == nil {\n\t\treturn nil\n\t}\n\treturn e.Teams\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (e *ExternalGroup) GetUpdatedAt() Timestamp {\n\tif e == nil || e.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *e.UpdatedAt\n}\n\n// GetGroups returns the Groups slice if it's non-nil, nil otherwise.\nfunc (e *ExternalGroupList) GetGroups() []*ExternalGroup {\n\tif e == nil || e.Groups == nil {\n\t\treturn nil\n\t}\n\treturn e.Groups\n}\n\n// GetMemberEmail returns the MemberEmail field if it's non-nil, zero value otherwise.\nfunc (e *ExternalGroupMember) GetMemberEmail() string {\n\tif e == nil || e.MemberEmail == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.MemberEmail\n}\n\n// GetMemberID returns the MemberID field if it's non-nil, zero value otherwise.\nfunc (e *ExternalGroupMember) GetMemberID() int64 {\n\tif e == nil || e.MemberID == nil {\n\t\treturn 0\n\t}\n\treturn *e.MemberID\n}\n\n// GetMemberLogin returns the MemberLogin field if it's non-nil, zero value otherwise.\nfunc (e *ExternalGroupMember) GetMemberLogin() string {\n\tif e == nil || e.MemberLogin == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.MemberLogin\n}\n\n// GetMemberName returns the MemberName field if it's non-nil, zero value otherwise.\nfunc (e *ExternalGroupMember) GetMemberName() string {\n\tif e == nil || e.MemberName == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.MemberName\n}\n\n// GetTeamID returns the TeamID field if it's non-nil, zero value otherwise.\nfunc (e *ExternalGroupTeam) GetTeamID() int64 {\n\tif e == nil || e.TeamID == nil {\n\t\treturn 0\n\t}\n\treturn *e.TeamID\n}\n\n// GetTeamName returns the TeamName field if it's non-nil, zero value otherwise.\nfunc (e *ExternalGroupTeam) GetTeamName() string {\n\tif e == nil || e.TeamName == nil {\n\t\treturn \"\"\n\t}\n\treturn *e.TeamName\n}\n\n// GetHRef returns the HRef field if it's non-nil, zero value otherwise.\nfunc (f *FeedLink) GetHRef() string {\n\tif f == nil || f.HRef == nil {\n\t\treturn \"\"\n\t}\n\treturn *f.HRef\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (f *FeedLink) GetType() string {\n\tif f == nil || f.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *f.Type\n}\n\n// GetCurrentUser returns the CurrentUser field.\nfunc (f *FeedLinks) GetCurrentUser() *FeedLink {\n\tif f == nil {\n\t\treturn nil\n\t}\n\treturn f.CurrentUser\n}\n\n// GetCurrentUserActor returns the CurrentUserActor field.\nfunc (f *FeedLinks) GetCurrentUserActor() *FeedLink {\n\tif f == nil {\n\t\treturn nil\n\t}\n\treturn f.CurrentUserActor\n}\n\n// GetCurrentUserOrganization returns the CurrentUserOrganization field.\nfunc (f *FeedLinks) GetCurrentUserOrganization() *FeedLink {\n\tif f == nil {\n\t\treturn nil\n\t}\n\treturn f.CurrentUserOrganization\n}\n\n// GetCurrentUserOrganizations returns the CurrentUserOrganizations slice if it's non-nil, nil otherwise.\nfunc (f *FeedLinks) GetCurrentUserOrganizations() []*FeedLink {\n\tif f == nil || f.CurrentUserOrganizations == nil {\n\t\treturn nil\n\t}\n\treturn f.CurrentUserOrganizations\n}\n\n// GetCurrentUserPublic returns the CurrentUserPublic field.\nfunc (f *FeedLinks) GetCurrentUserPublic() *FeedLink {\n\tif f == nil {\n\t\treturn nil\n\t}\n\treturn f.CurrentUserPublic\n}\n\n// GetTimeline returns the Timeline field.\nfunc (f *FeedLinks) GetTimeline() *FeedLink {\n\tif f == nil {\n\t\treturn nil\n\t}\n\treturn f.Timeline\n}\n\n// GetUser returns the User field.\nfunc (f *FeedLinks) GetUser() *FeedLink {\n\tif f == nil {\n\t\treturn nil\n\t}\n\treturn f.User\n}\n\n// GetCurrentUserActorURL returns the CurrentUserActorURL field if it's non-nil, zero value otherwise.\nfunc (f *Feeds) GetCurrentUserActorURL() string {\n\tif f == nil || f.CurrentUserActorURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *f.CurrentUserActorURL\n}\n\n// GetCurrentUserOrganizationURL returns the CurrentUserOrganizationURL field if it's non-nil, zero value otherwise.\nfunc (f *Feeds) GetCurrentUserOrganizationURL() string {\n\tif f == nil || f.CurrentUserOrganizationURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *f.CurrentUserOrganizationURL\n}\n\n// GetCurrentUserOrganizationURLs returns the CurrentUserOrganizationURLs slice if it's non-nil, nil otherwise.\nfunc (f *Feeds) GetCurrentUserOrganizationURLs() []string {\n\tif f == nil || f.CurrentUserOrganizationURLs == nil {\n\t\treturn nil\n\t}\n\treturn f.CurrentUserOrganizationURLs\n}\n\n// GetCurrentUserPublicURL returns the CurrentUserPublicURL field if it's non-nil, zero value otherwise.\nfunc (f *Feeds) GetCurrentUserPublicURL() string {\n\tif f == nil || f.CurrentUserPublicURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *f.CurrentUserPublicURL\n}\n\n// GetCurrentUserURL returns the CurrentUserURL field if it's non-nil, zero value otherwise.\nfunc (f *Feeds) GetCurrentUserURL() string {\n\tif f == nil || f.CurrentUserURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *f.CurrentUserURL\n}\n\n// GetLinks returns the Links field.\nfunc (f *Feeds) GetLinks() *FeedLinks {\n\tif f == nil {\n\t\treturn nil\n\t}\n\treturn f.Links\n}\n\n// GetTimelineURL returns the TimelineURL field if it's non-nil, zero value otherwise.\nfunc (f *Feeds) GetTimelineURL() string {\n\tif f == nil || f.TimelineURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *f.TimelineURL\n}\n\n// GetUserURL returns the UserURL field if it's non-nil, zero value otherwise.\nfunc (f *Feeds) GetUserURL() string {\n\tif f == nil || f.UserURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *f.UserURL\n}\n\n// GetFieldName returns the FieldName field if it's non-nil, zero value otherwise.\nfunc (f *FieldValue) GetFieldName() string {\n\tif f == nil || f.FieldName == nil {\n\t\treturn \"\"\n\t}\n\treturn *f.FieldName\n}\n\n// GetFieldNodeID returns the FieldNodeID field if it's non-nil, zero value otherwise.\nfunc (f *FieldValue) GetFieldNodeID() string {\n\tif f == nil || f.FieldNodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *f.FieldNodeID\n}\n\n// GetFieldType returns the FieldType field if it's non-nil, zero value otherwise.\nfunc (f *FieldValue) GetFieldType() string {\n\tif f == nil || f.FieldType == nil {\n\t\treturn \"\"\n\t}\n\treturn *f.FieldType\n}\n\n// GetFrom returns the From field.\nfunc (f *FieldValue) GetFrom() json.RawMessage {\n\tif f == nil {\n\t\treturn json.RawMessage{}\n\t}\n\treturn f.From\n}\n\n// GetProjectNumber returns the ProjectNumber field if it's non-nil, zero value otherwise.\nfunc (f *FieldValue) GetProjectNumber() int64 {\n\tif f == nil || f.ProjectNumber == nil {\n\t\treturn 0\n\t}\n\treturn *f.ProjectNumber\n}\n\n// GetTo returns the To field.\nfunc (f *FieldValue) GetTo() json.RawMessage {\n\tif f == nil {\n\t\treturn json.RawMessage{}\n\t}\n\treturn f.To\n}\n\n// GetParameters returns the Parameters field.\nfunc (f *FileExtensionRestrictionBranchRule) GetParameters() FileExtensionRestrictionRuleParameters {\n\tif f == nil {\n\t\treturn FileExtensionRestrictionRuleParameters{}\n\t}\n\treturn f.Parameters\n}\n\n// GetRestrictedFileExtensions returns the RestrictedFileExtensions slice if it's non-nil, nil otherwise.\nfunc (f *FileExtensionRestrictionRuleParameters) GetRestrictedFileExtensions() []string {\n\tif f == nil || f.RestrictedFileExtensions == nil {\n\t\treturn nil\n\t}\n\treturn f.RestrictedFileExtensions\n}\n\n// GetParameters returns the Parameters field.\nfunc (f *FilePathRestrictionBranchRule) GetParameters() FilePathRestrictionRuleParameters {\n\tif f == nil {\n\t\treturn FilePathRestrictionRuleParameters{}\n\t}\n\treturn f.Parameters\n}\n\n// GetRestrictedFilePaths returns the RestrictedFilePaths slice if it's non-nil, nil otherwise.\nfunc (f *FilePathRestrictionRuleParameters) GetRestrictedFilePaths() []string {\n\tif f == nil || f.RestrictedFilePaths == nil {\n\t\treturn nil\n\t}\n\treturn f.RestrictedFilePaths\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (f *FineGrainedPersonalAccessTokenRequest) GetCreatedAt() Timestamp {\n\tif f == nil || f.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *f.CreatedAt\n}\n\n// GetID returns the ID field.\nfunc (f *FineGrainedPersonalAccessTokenRequest) GetID() int64 {\n\tif f == nil {\n\t\treturn 0\n\t}\n\treturn f.ID\n}\n\n// GetOwner returns the Owner field.\nfunc (f *FineGrainedPersonalAccessTokenRequest) GetOwner() User {\n\tif f == nil {\n\t\treturn User{}\n\t}\n\treturn f.Owner\n}\n\n// GetPermissions returns the Permissions field.\nfunc (f *FineGrainedPersonalAccessTokenRequest) GetPermissions() PersonalAccessTokenPermissions {\n\tif f == nil {\n\t\treturn PersonalAccessTokenPermissions{}\n\t}\n\treturn f.Permissions\n}\n\n// GetReason returns the Reason field.\nfunc (f *FineGrainedPersonalAccessTokenRequest) GetReason() string {\n\tif f == nil {\n\t\treturn \"\"\n\t}\n\treturn f.Reason\n}\n\n// GetRepositoriesURL returns the RepositoriesURL field.\nfunc (f *FineGrainedPersonalAccessTokenRequest) GetRepositoriesURL() string {\n\tif f == nil {\n\t\treturn \"\"\n\t}\n\treturn f.RepositoriesURL\n}\n\n// GetRepositorySelection returns the RepositorySelection field.\nfunc (f *FineGrainedPersonalAccessTokenRequest) GetRepositorySelection() string {\n\tif f == nil {\n\t\treturn \"\"\n\t}\n\treturn f.RepositorySelection\n}\n\n// GetTokenExpired returns the TokenExpired field.\nfunc (f *FineGrainedPersonalAccessTokenRequest) GetTokenExpired() bool {\n\tif f == nil {\n\t\treturn false\n\t}\n\treturn f.TokenExpired\n}\n\n// GetTokenExpiresAt returns the TokenExpiresAt field if it's non-nil, zero value otherwise.\nfunc (f *FineGrainedPersonalAccessTokenRequest) GetTokenExpiresAt() Timestamp {\n\tif f == nil || f.TokenExpiresAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *f.TokenExpiresAt\n}\n\n// GetTokenID returns the TokenID field.\nfunc (f *FineGrainedPersonalAccessTokenRequest) GetTokenID() int64 {\n\tif f == nil {\n\t\treturn 0\n\t}\n\treturn f.TokenID\n}\n\n// GetTokenLastUsedAt returns the TokenLastUsedAt field if it's non-nil, zero value otherwise.\nfunc (f *FineGrainedPersonalAccessTokenRequest) GetTokenLastUsedAt() Timestamp {\n\tif f == nil || f.TokenLastUsedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *f.TokenLastUsedAt\n}\n\n// GetTokenName returns the TokenName field.\nfunc (f *FineGrainedPersonalAccessTokenRequest) GetTokenName() string {\n\tif f == nil {\n\t\treturn \"\"\n\t}\n\treturn f.TokenName\n}\n\n// GetIdentifier returns the Identifier field if it's non-nil, zero value otherwise.\nfunc (f *FirstPatchedVersion) GetIdentifier() string {\n\tif f == nil || f.Identifier == nil {\n\t\treturn \"\"\n\t}\n\treturn *f.Identifier\n}\n\n// GetForkee returns the Forkee field.\nfunc (f *ForkEvent) GetForkee() *Repository {\n\tif f == nil {\n\t\treturn nil\n\t}\n\treturn f.Forkee\n}\n\n// GetInstallation returns the Installation field.\nfunc (f *ForkEvent) GetInstallation() *Installation {\n\tif f == nil {\n\t\treturn nil\n\t}\n\treturn f.Installation\n}\n\n// GetRepo returns the Repo field.\nfunc (f *ForkEvent) GetRepo() *Repository {\n\tif f == nil {\n\t\treturn nil\n\t}\n\treturn f.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (f *ForkEvent) GetSender() *User {\n\tif f == nil {\n\t\treturn nil\n\t}\n\treturn f.Sender\n}\n\n// GetLabels returns the Labels slice if it's non-nil, nil otherwise.\nfunc (g *GenerateJITConfigRequest) GetLabels() []string {\n\tif g == nil || g.Labels == nil {\n\t\treturn nil\n\t}\n\treturn g.Labels\n}\n\n// GetName returns the Name field.\nfunc (g *GenerateJITConfigRequest) GetName() string {\n\tif g == nil {\n\t\treturn \"\"\n\t}\n\treturn g.Name\n}\n\n// GetRunnerGroupID returns the RunnerGroupID field.\nfunc (g *GenerateJITConfigRequest) GetRunnerGroupID() int64 {\n\tif g == nil {\n\t\treturn 0\n\t}\n\treturn g.RunnerGroupID\n}\n\n// GetWorkFolder returns the WorkFolder field if it's non-nil, zero value otherwise.\nfunc (g *GenerateJITConfigRequest) GetWorkFolder() string {\n\tif g == nil || g.WorkFolder == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.WorkFolder\n}\n\n// GetConfigurationFilePath returns the ConfigurationFilePath field if it's non-nil, zero value otherwise.\nfunc (g *GenerateNotesOptions) GetConfigurationFilePath() string {\n\tif g == nil || g.ConfigurationFilePath == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.ConfigurationFilePath\n}\n\n// GetPreviousTagName returns the PreviousTagName field if it's non-nil, zero value otherwise.\nfunc (g *GenerateNotesOptions) GetPreviousTagName() string {\n\tif g == nil || g.PreviousTagName == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.PreviousTagName\n}\n\n// GetTagName returns the TagName field.\nfunc (g *GenerateNotesOptions) GetTagName() string {\n\tif g == nil {\n\t\treturn \"\"\n\t}\n\treturn g.TagName\n}\n\n// GetTargetCommitish returns the TargetCommitish field if it's non-nil, zero value otherwise.\nfunc (g *GenerateNotesOptions) GetTargetCommitish() string {\n\tif g == nil || g.TargetCommitish == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.TargetCommitish\n}\n\n// GetInclude returns the Include field if it's non-nil, zero value otherwise.\nfunc (g *GetAuditLogOptions) GetInclude() string {\n\tif g == nil || g.Include == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.Include\n}\n\n// GetOrder returns the Order field if it's non-nil, zero value otherwise.\nfunc (g *GetAuditLogOptions) GetOrder() string {\n\tif g == nil || g.Order == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.Order\n}\n\n// GetPhrase returns the Phrase field if it's non-nil, zero value otherwise.\nfunc (g *GetAuditLogOptions) GetPhrase() string {\n\tif g == nil || g.Phrase == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.Phrase\n}\n\n// GetRef returns the Ref field.\nfunc (g *GetCodeownersErrorsOptions) GetRef() string {\n\tif g == nil {\n\t\treturn \"\"\n\t}\n\treturn g.Ref\n}\n\n// GetFields returns the Fields slice if it's non-nil, nil otherwise.\nfunc (g *GetProjectItemOptions) GetFields() []int64 {\n\tif g == nil || g.Fields == nil {\n\t\treturn nil\n\t}\n\treturn g.Fields\n}\n\n// GetExcludedAttributes returns the ExcludedAttributes field if it's non-nil, zero value otherwise.\nfunc (g *GetProvisionedSCIMGroupEnterpriseOptions) GetExcludedAttributes() string {\n\tif g == nil || g.ExcludedAttributes == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.ExcludedAttributes\n}\n\n// GetComments returns the Comments field if it's non-nil, zero value otherwise.\nfunc (g *Gist) GetComments() int {\n\tif g == nil || g.Comments == nil {\n\t\treturn 0\n\t}\n\treturn *g.Comments\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (g *Gist) GetCreatedAt() Timestamp {\n\tif g == nil || g.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *g.CreatedAt\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (g *Gist) GetDescription() string {\n\tif g == nil || g.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.Description\n}\n\n// GetFiles returns the Files map if it's non-nil, an empty map otherwise.\nfunc (g *Gist) GetFiles() map[GistFilename]GistFile {\n\tif g == nil || g.Files == nil {\n\t\treturn map[GistFilename]GistFile{}\n\t}\n\treturn g.Files\n}\n\n// GetGitPullURL returns the GitPullURL field if it's non-nil, zero value otherwise.\nfunc (g *Gist) GetGitPullURL() string {\n\tif g == nil || g.GitPullURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.GitPullURL\n}\n\n// GetGitPushURL returns the GitPushURL field if it's non-nil, zero value otherwise.\nfunc (g *Gist) GetGitPushURL() string {\n\tif g == nil || g.GitPushURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.GitPushURL\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (g *Gist) GetHTMLURL() string {\n\tif g == nil || g.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (g *Gist) GetID() string {\n\tif g == nil || g.ID == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.ID\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (g *Gist) GetNodeID() string {\n\tif g == nil || g.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.NodeID\n}\n\n// GetOwner returns the Owner field.\nfunc (g *Gist) GetOwner() *User {\n\tif g == nil {\n\t\treturn nil\n\t}\n\treturn g.Owner\n}\n\n// GetPublic returns the Public field if it's non-nil, zero value otherwise.\nfunc (g *Gist) GetPublic() bool {\n\tif g == nil || g.Public == nil {\n\t\treturn false\n\t}\n\treturn *g.Public\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (g *Gist) GetUpdatedAt() Timestamp {\n\tif g == nil || g.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *g.UpdatedAt\n}\n\n// GetBody returns the Body field if it's non-nil, zero value otherwise.\nfunc (g *GistComment) GetBody() string {\n\tif g == nil || g.Body == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.Body\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (g *GistComment) GetCreatedAt() Timestamp {\n\tif g == nil || g.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *g.CreatedAt\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (g *GistComment) GetID() int64 {\n\tif g == nil || g.ID == nil {\n\t\treturn 0\n\t}\n\treturn *g.ID\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (g *GistComment) GetURL() string {\n\tif g == nil || g.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.URL\n}\n\n// GetUser returns the User field.\nfunc (g *GistComment) GetUser() *User {\n\tif g == nil {\n\t\treturn nil\n\t}\n\treturn g.User\n}\n\n// GetChangeStatus returns the ChangeStatus field.\nfunc (g *GistCommit) GetChangeStatus() *CommitStats {\n\tif g == nil {\n\t\treturn nil\n\t}\n\treturn g.ChangeStatus\n}\n\n// GetCommittedAt returns the CommittedAt field if it's non-nil, zero value otherwise.\nfunc (g *GistCommit) GetCommittedAt() Timestamp {\n\tif g == nil || g.CommittedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *g.CommittedAt\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (g *GistCommit) GetNodeID() string {\n\tif g == nil || g.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.NodeID\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (g *GistCommit) GetURL() string {\n\tif g == nil || g.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.URL\n}\n\n// GetUser returns the User field.\nfunc (g *GistCommit) GetUser() *User {\n\tif g == nil {\n\t\treturn nil\n\t}\n\treturn g.User\n}\n\n// GetVersion returns the Version field if it's non-nil, zero value otherwise.\nfunc (g *GistCommit) GetVersion() string {\n\tif g == nil || g.Version == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.Version\n}\n\n// GetContent returns the Content field if it's non-nil, zero value otherwise.\nfunc (g *GistFile) GetContent() string {\n\tif g == nil || g.Content == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.Content\n}\n\n// GetFilename returns the Filename field if it's non-nil, zero value otherwise.\nfunc (g *GistFile) GetFilename() string {\n\tif g == nil || g.Filename == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.Filename\n}\n\n// GetLanguage returns the Language field if it's non-nil, zero value otherwise.\nfunc (g *GistFile) GetLanguage() string {\n\tif g == nil || g.Language == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.Language\n}\n\n// GetRawURL returns the RawURL field if it's non-nil, zero value otherwise.\nfunc (g *GistFile) GetRawURL() string {\n\tif g == nil || g.RawURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.RawURL\n}\n\n// GetSize returns the Size field if it's non-nil, zero value otherwise.\nfunc (g *GistFile) GetSize() int {\n\tif g == nil || g.Size == nil {\n\t\treturn 0\n\t}\n\treturn *g.Size\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (g *GistFile) GetType() string {\n\tif g == nil || g.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.Type\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (g *GistFork) GetCreatedAt() Timestamp {\n\tif g == nil || g.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *g.CreatedAt\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (g *GistFork) GetID() string {\n\tif g == nil || g.ID == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.ID\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (g *GistFork) GetNodeID() string {\n\tif g == nil || g.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.NodeID\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (g *GistFork) GetUpdatedAt() Timestamp {\n\tif g == nil || g.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *g.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (g *GistFork) GetURL() string {\n\tif g == nil || g.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.URL\n}\n\n// GetUser returns the User field.\nfunc (g *GistFork) GetUser() *User {\n\tif g == nil {\n\t\treturn nil\n\t}\n\treturn g.User\n}\n\n// GetSince returns the Since field.\nfunc (g *GistListOptions) GetSince() time.Time {\n\tif g == nil {\n\t\treturn time.Time{}\n\t}\n\treturn g.Since\n}\n\n// GetPrivateGists returns the PrivateGists field if it's non-nil, zero value otherwise.\nfunc (g *GistStats) GetPrivateGists() int {\n\tif g == nil || g.PrivateGists == nil {\n\t\treturn 0\n\t}\n\treturn *g.PrivateGists\n}\n\n// GetPublicGists returns the PublicGists field if it's non-nil, zero value otherwise.\nfunc (g *GistStats) GetPublicGists() int {\n\tif g == nil || g.PublicGists == nil {\n\t\treturn 0\n\t}\n\treturn *g.PublicGists\n}\n\n// GetTotalGists returns the TotalGists field if it's non-nil, zero value otherwise.\nfunc (g *GistStats) GetTotalGists() int {\n\tif g == nil || g.TotalGists == nil {\n\t\treturn 0\n\t}\n\treturn *g.TotalGists\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (g *GitHubAppAuthorizationEvent) GetAction() string {\n\tif g == nil || g.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.Action\n}\n\n// GetInstallation returns the Installation field.\nfunc (g *GitHubAppAuthorizationEvent) GetInstallation() *Installation {\n\tif g == nil {\n\t\treturn nil\n\t}\n\treturn g.Installation\n}\n\n// GetSender returns the Sender field.\nfunc (g *GitHubAppAuthorizationEvent) GetSender() *User {\n\tif g == nil {\n\t\treturn nil\n\t}\n\treturn g.Sender\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (g *Gitignore) GetName() string {\n\tif g == nil || g.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.Name\n}\n\n// GetSource returns the Source field if it's non-nil, zero value otherwise.\nfunc (g *Gitignore) GetSource() string {\n\tif g == nil || g.Source == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.Source\n}\n\n// GetSHA returns the SHA field if it's non-nil, zero value otherwise.\nfunc (g *GitObject) GetSHA() string {\n\tif g == nil || g.SHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.SHA\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (g *GitObject) GetType() string {\n\tif g == nil || g.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.Type\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (g *GitObject) GetURL() string {\n\tif g == nil || g.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.URL\n}\n\n// GetCredits returns the Credits slice if it's non-nil, nil otherwise.\nfunc (g *GlobalSecurityAdvisory) GetCredits() []*Credit {\n\tif g == nil || g.Credits == nil {\n\t\treturn nil\n\t}\n\treturn g.Credits\n}\n\n// GetGithubReviewedAt returns the GithubReviewedAt field if it's non-nil, zero value otherwise.\nfunc (g *GlobalSecurityAdvisory) GetGithubReviewedAt() Timestamp {\n\tif g == nil || g.GithubReviewedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *g.GithubReviewedAt\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (g *GlobalSecurityAdvisory) GetID() int64 {\n\tif g == nil || g.ID == nil {\n\t\treturn 0\n\t}\n\treturn *g.ID\n}\n\n// GetNVDPublishedAt returns the NVDPublishedAt field if it's non-nil, zero value otherwise.\nfunc (g *GlobalSecurityAdvisory) GetNVDPublishedAt() Timestamp {\n\tif g == nil || g.NVDPublishedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *g.NVDPublishedAt\n}\n\n// GetReferences returns the References slice if it's non-nil, nil otherwise.\nfunc (g *GlobalSecurityAdvisory) GetReferences() []string {\n\tif g == nil || g.References == nil {\n\t\treturn nil\n\t}\n\treturn g.References\n}\n\n// GetRepositoryAdvisoryURL returns the RepositoryAdvisoryURL field if it's non-nil, zero value otherwise.\nfunc (g *GlobalSecurityAdvisory) GetRepositoryAdvisoryURL() string {\n\tif g == nil || g.RepositoryAdvisoryURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.RepositoryAdvisoryURL\n}\n\n// GetSourceCodeLocation returns the SourceCodeLocation field if it's non-nil, zero value otherwise.\nfunc (g *GlobalSecurityAdvisory) GetSourceCodeLocation() string {\n\tif g == nil || g.SourceCodeLocation == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.SourceCodeLocation\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (g *GlobalSecurityAdvisory) GetType() string {\n\tif g == nil || g.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.Type\n}\n\n// GetVulnerabilities returns the Vulnerabilities slice if it's non-nil, nil otherwise.\nfunc (g *GlobalSecurityAdvisory) GetVulnerabilities() []*GlobalSecurityVulnerability {\n\tif g == nil || g.Vulnerabilities == nil {\n\t\treturn nil\n\t}\n\treturn g.Vulnerabilities\n}\n\n// GetFirstPatchedVersion returns the FirstPatchedVersion field if it's non-nil, zero value otherwise.\nfunc (g *GlobalSecurityVulnerability) GetFirstPatchedVersion() string {\n\tif g == nil || g.FirstPatchedVersion == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.FirstPatchedVersion\n}\n\n// GetPackage returns the Package field.\nfunc (g *GlobalSecurityVulnerability) GetPackage() *VulnerabilityPackage {\n\tif g == nil {\n\t\treturn nil\n\t}\n\treturn g.Package\n}\n\n// GetVulnerableFunctions returns the VulnerableFunctions slice if it's non-nil, nil otherwise.\nfunc (g *GlobalSecurityVulnerability) GetVulnerableFunctions() []string {\n\tif g == nil || g.VulnerableFunctions == nil {\n\t\treturn nil\n\t}\n\treturn g.VulnerableFunctions\n}\n\n// GetVulnerableVersionRange returns the VulnerableVersionRange field if it's non-nil, zero value otherwise.\nfunc (g *GlobalSecurityVulnerability) GetVulnerableVersionRange() string {\n\tif g == nil || g.VulnerableVersionRange == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.VulnerableVersionRange\n}\n\n// GetInstallation returns the Installation field.\nfunc (g *GollumEvent) GetInstallation() *Installation {\n\tif g == nil {\n\t\treturn nil\n\t}\n\treturn g.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (g *GollumEvent) GetOrg() *Organization {\n\tif g == nil {\n\t\treturn nil\n\t}\n\treturn g.Org\n}\n\n// GetPages returns the Pages slice if it's non-nil, nil otherwise.\nfunc (g *GollumEvent) GetPages() []*Page {\n\tif g == nil || g.Pages == nil {\n\t\treturn nil\n\t}\n\treturn g.Pages\n}\n\n// GetRepo returns the Repo field.\nfunc (g *GollumEvent) GetRepo() *Repository {\n\tif g == nil {\n\t\treturn nil\n\t}\n\treturn g.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (g *GollumEvent) GetSender() *User {\n\tif g == nil {\n\t\treturn nil\n\t}\n\treturn g.Sender\n}\n\n// GetBucket returns the Bucket field.\nfunc (g *GoogleCloudConfig) GetBucket() string {\n\tif g == nil {\n\t\treturn \"\"\n\t}\n\treturn g.Bucket\n}\n\n// GetEncryptedJSONCredentials returns the EncryptedJSONCredentials field.\nfunc (g *GoogleCloudConfig) GetEncryptedJSONCredentials() string {\n\tif g == nil {\n\t\treturn \"\"\n\t}\n\treturn g.EncryptedJSONCredentials\n}\n\n// GetKeyID returns the KeyID field.\nfunc (g *GoogleCloudConfig) GetKeyID() string {\n\tif g == nil {\n\t\treturn \"\"\n\t}\n\treturn g.KeyID\n}\n\n// GetEmail returns the Email field if it's non-nil, zero value otherwise.\nfunc (g *GPGEmail) GetEmail() string {\n\tif g == nil || g.Email == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.Email\n}\n\n// GetVerified returns the Verified field if it's non-nil, zero value otherwise.\nfunc (g *GPGEmail) GetVerified() bool {\n\tif g == nil || g.Verified == nil {\n\t\treturn false\n\t}\n\treturn *g.Verified\n}\n\n// GetCanCertify returns the CanCertify field if it's non-nil, zero value otherwise.\nfunc (g *GPGKey) GetCanCertify() bool {\n\tif g == nil || g.CanCertify == nil {\n\t\treturn false\n\t}\n\treturn *g.CanCertify\n}\n\n// GetCanEncryptComms returns the CanEncryptComms field if it's non-nil, zero value otherwise.\nfunc (g *GPGKey) GetCanEncryptComms() bool {\n\tif g == nil || g.CanEncryptComms == nil {\n\t\treturn false\n\t}\n\treturn *g.CanEncryptComms\n}\n\n// GetCanEncryptStorage returns the CanEncryptStorage field if it's non-nil, zero value otherwise.\nfunc (g *GPGKey) GetCanEncryptStorage() bool {\n\tif g == nil || g.CanEncryptStorage == nil {\n\t\treturn false\n\t}\n\treturn *g.CanEncryptStorage\n}\n\n// GetCanSign returns the CanSign field if it's non-nil, zero value otherwise.\nfunc (g *GPGKey) GetCanSign() bool {\n\tif g == nil || g.CanSign == nil {\n\t\treturn false\n\t}\n\treturn *g.CanSign\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (g *GPGKey) GetCreatedAt() Timestamp {\n\tif g == nil || g.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *g.CreatedAt\n}\n\n// GetEmails returns the Emails slice if it's non-nil, nil otherwise.\nfunc (g *GPGKey) GetEmails() []*GPGEmail {\n\tif g == nil || g.Emails == nil {\n\t\treturn nil\n\t}\n\treturn g.Emails\n}\n\n// GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise.\nfunc (g *GPGKey) GetExpiresAt() Timestamp {\n\tif g == nil || g.ExpiresAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *g.ExpiresAt\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (g *GPGKey) GetID() int64 {\n\tif g == nil || g.ID == nil {\n\t\treturn 0\n\t}\n\treturn *g.ID\n}\n\n// GetKeyID returns the KeyID field if it's non-nil, zero value otherwise.\nfunc (g *GPGKey) GetKeyID() string {\n\tif g == nil || g.KeyID == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.KeyID\n}\n\n// GetPrimaryKeyID returns the PrimaryKeyID field if it's non-nil, zero value otherwise.\nfunc (g *GPGKey) GetPrimaryKeyID() int64 {\n\tif g == nil || g.PrimaryKeyID == nil {\n\t\treturn 0\n\t}\n\treturn *g.PrimaryKeyID\n}\n\n// GetPublicKey returns the PublicKey field if it's non-nil, zero value otherwise.\nfunc (g *GPGKey) GetPublicKey() string {\n\tif g == nil || g.PublicKey == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.PublicKey\n}\n\n// GetRawKey returns the RawKey field if it's non-nil, zero value otherwise.\nfunc (g *GPGKey) GetRawKey() string {\n\tif g == nil || g.RawKey == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.RawKey\n}\n\n// GetSubkeys returns the Subkeys slice if it's non-nil, nil otherwise.\nfunc (g *GPGKey) GetSubkeys() []*GPGKey {\n\tif g == nil || g.Subkeys == nil {\n\t\treturn nil\n\t}\n\treturn g.Subkeys\n}\n\n// GetApp returns the App field.\nfunc (g *Grant) GetApp() *AuthorizationApp {\n\tif g == nil {\n\t\treturn nil\n\t}\n\treturn g.App\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (g *Grant) GetCreatedAt() Timestamp {\n\tif g == nil || g.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *g.CreatedAt\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (g *Grant) GetID() int64 {\n\tif g == nil || g.ID == nil {\n\t\treturn 0\n\t}\n\treturn *g.ID\n}\n\n// GetScopes returns the Scopes slice if it's non-nil, nil otherwise.\nfunc (g *Grant) GetScopes() []string {\n\tif g == nil || g.Scopes == nil {\n\t\treturn nil\n\t}\n\treturn g.Scopes\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (g *Grant) GetUpdatedAt() Timestamp {\n\tif g == nil || g.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *g.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (g *Grant) GetURL() string {\n\tif g == nil || g.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *g.URL\n}\n\n// GetAdded returns the Added slice if it's non-nil, nil otherwise.\nfunc (h *HeadCommit) GetAdded() []string {\n\tif h == nil || h.Added == nil {\n\t\treturn nil\n\t}\n\treturn h.Added\n}\n\n// GetAuthor returns the Author field.\nfunc (h *HeadCommit) GetAuthor() *CommitAuthor {\n\tif h == nil {\n\t\treturn nil\n\t}\n\treturn h.Author\n}\n\n// GetCommitter returns the Committer field.\nfunc (h *HeadCommit) GetCommitter() *CommitAuthor {\n\tif h == nil {\n\t\treturn nil\n\t}\n\treturn h.Committer\n}\n\n// GetDistinct returns the Distinct field if it's non-nil, zero value otherwise.\nfunc (h *HeadCommit) GetDistinct() bool {\n\tif h == nil || h.Distinct == nil {\n\t\treturn false\n\t}\n\treturn *h.Distinct\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (h *HeadCommit) GetID() string {\n\tif h == nil || h.ID == nil {\n\t\treturn \"\"\n\t}\n\treturn *h.ID\n}\n\n// GetMessage returns the Message field if it's non-nil, zero value otherwise.\nfunc (h *HeadCommit) GetMessage() string {\n\tif h == nil || h.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *h.Message\n}\n\n// GetModified returns the Modified slice if it's non-nil, nil otherwise.\nfunc (h *HeadCommit) GetModified() []string {\n\tif h == nil || h.Modified == nil {\n\t\treturn nil\n\t}\n\treturn h.Modified\n}\n\n// GetRemoved returns the Removed slice if it's non-nil, nil otherwise.\nfunc (h *HeadCommit) GetRemoved() []string {\n\tif h == nil || h.Removed == nil {\n\t\treturn nil\n\t}\n\treturn h.Removed\n}\n\n// GetSHA returns the SHA field if it's non-nil, zero value otherwise.\nfunc (h *HeadCommit) GetSHA() string {\n\tif h == nil || h.SHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *h.SHA\n}\n\n// GetTimestamp returns the Timestamp field if it's non-nil, zero value otherwise.\nfunc (h *HeadCommit) GetTimestamp() Timestamp {\n\tif h == nil || h.Timestamp == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *h.Timestamp\n}\n\n// GetTreeID returns the TreeID field if it's non-nil, zero value otherwise.\nfunc (h *HeadCommit) GetTreeID() string {\n\tif h == nil || h.TreeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *h.TreeID\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (h *HeadCommit) GetURL() string {\n\tif h == nil || h.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *h.URL\n}\n\n// GetDomain returns the Domain field.\nfunc (h *HecConfig) GetDomain() string {\n\tif h == nil {\n\t\treturn \"\"\n\t}\n\treturn h.Domain\n}\n\n// GetEncryptedToken returns the EncryptedToken field.\nfunc (h *HecConfig) GetEncryptedToken() string {\n\tif h == nil {\n\t\treturn \"\"\n\t}\n\treturn h.EncryptedToken\n}\n\n// GetKeyID returns the KeyID field.\nfunc (h *HecConfig) GetKeyID() string {\n\tif h == nil {\n\t\treturn \"\"\n\t}\n\treturn h.KeyID\n}\n\n// GetPath returns the Path field.\nfunc (h *HecConfig) GetPath() string {\n\tif h == nil {\n\t\treturn \"\"\n\t}\n\treturn h.Path\n}\n\n// GetPort returns the Port field.\nfunc (h *HecConfig) GetPort() uint16 {\n\tif h == nil {\n\t\treturn 0\n\t}\n\treturn h.Port\n}\n\n// GetSSLVerify returns the SSLVerify field.\nfunc (h *HecConfig) GetSSLVerify() bool {\n\tif h == nil {\n\t\treturn false\n\t}\n\treturn h.SSLVerify\n}\n\n// GetActive returns the Active field if it's non-nil, zero value otherwise.\nfunc (h *Hook) GetActive() bool {\n\tif h == nil || h.Active == nil {\n\t\treturn false\n\t}\n\treturn *h.Active\n}\n\n// GetConfig returns the Config field.\nfunc (h *Hook) GetConfig() *HookConfig {\n\tif h == nil {\n\t\treturn nil\n\t}\n\treturn h.Config\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (h *Hook) GetCreatedAt() Timestamp {\n\tif h == nil || h.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *h.CreatedAt\n}\n\n// GetEvents returns the Events slice if it's non-nil, nil otherwise.\nfunc (h *Hook) GetEvents() []string {\n\tif h == nil || h.Events == nil {\n\t\treturn nil\n\t}\n\treturn h.Events\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (h *Hook) GetID() int64 {\n\tif h == nil || h.ID == nil {\n\t\treturn 0\n\t}\n\treturn *h.ID\n}\n\n// GetLastResponse returns the LastResponse map if it's non-nil, an empty map otherwise.\nfunc (h *Hook) GetLastResponse() map[string]any {\n\tif h == nil || h.LastResponse == nil {\n\t\treturn map[string]any{}\n\t}\n\treturn h.LastResponse\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (h *Hook) GetName() string {\n\tif h == nil || h.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *h.Name\n}\n\n// GetPingURL returns the PingURL field if it's non-nil, zero value otherwise.\nfunc (h *Hook) GetPingURL() string {\n\tif h == nil || h.PingURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *h.PingURL\n}\n\n// GetTestURL returns the TestURL field if it's non-nil, zero value otherwise.\nfunc (h *Hook) GetTestURL() string {\n\tif h == nil || h.TestURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *h.TestURL\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (h *Hook) GetType() string {\n\tif h == nil || h.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *h.Type\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (h *Hook) GetUpdatedAt() Timestamp {\n\tif h == nil || h.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *h.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (h *Hook) GetURL() string {\n\tif h == nil || h.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *h.URL\n}\n\n// GetContentType returns the ContentType field if it's non-nil, zero value otherwise.\nfunc (h *HookConfig) GetContentType() string {\n\tif h == nil || h.ContentType == nil {\n\t\treturn \"\"\n\t}\n\treturn *h.ContentType\n}\n\n// GetInsecureSSL returns the InsecureSSL field if it's non-nil, zero value otherwise.\nfunc (h *HookConfig) GetInsecureSSL() string {\n\tif h == nil || h.InsecureSSL == nil {\n\t\treturn \"\"\n\t}\n\treturn *h.InsecureSSL\n}\n\n// GetSecret returns the Secret field if it's non-nil, zero value otherwise.\nfunc (h *HookConfig) GetSecret() string {\n\tif h == nil || h.Secret == nil {\n\t\treturn \"\"\n\t}\n\treturn *h.Secret\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (h *HookConfig) GetURL() string {\n\tif h == nil || h.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *h.URL\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (h *HookDelivery) GetAction() string {\n\tif h == nil || h.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *h.Action\n}\n\n// GetDeliveredAt returns the DeliveredAt field if it's non-nil, zero value otherwise.\nfunc (h *HookDelivery) GetDeliveredAt() Timestamp {\n\tif h == nil || h.DeliveredAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *h.DeliveredAt\n}\n\n// GetDuration returns the Duration field if it's non-nil, zero value otherwise.\nfunc (h *HookDelivery) GetDuration() float64 {\n\tif h == nil || h.Duration == nil {\n\t\treturn 0\n\t}\n\treturn *h.Duration\n}\n\n// GetEvent returns the Event field if it's non-nil, zero value otherwise.\nfunc (h *HookDelivery) GetEvent() string {\n\tif h == nil || h.Event == nil {\n\t\treturn \"\"\n\t}\n\treturn *h.Event\n}\n\n// GetGUID returns the GUID field if it's non-nil, zero value otherwise.\nfunc (h *HookDelivery) GetGUID() string {\n\tif h == nil || h.GUID == nil {\n\t\treturn \"\"\n\t}\n\treturn *h.GUID\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (h *HookDelivery) GetID() int64 {\n\tif h == nil || h.ID == nil {\n\t\treturn 0\n\t}\n\treturn *h.ID\n}\n\n// GetInstallationID returns the InstallationID field if it's non-nil, zero value otherwise.\nfunc (h *HookDelivery) GetInstallationID() int64 {\n\tif h == nil || h.InstallationID == nil {\n\t\treturn 0\n\t}\n\treturn *h.InstallationID\n}\n\n// GetRedelivery returns the Redelivery field if it's non-nil, zero value otherwise.\nfunc (h *HookDelivery) GetRedelivery() bool {\n\tif h == nil || h.Redelivery == nil {\n\t\treturn false\n\t}\n\treturn *h.Redelivery\n}\n\n// GetRepositoryID returns the RepositoryID field if it's non-nil, zero value otherwise.\nfunc (h *HookDelivery) GetRepositoryID() int64 {\n\tif h == nil || h.RepositoryID == nil {\n\t\treturn 0\n\t}\n\treturn *h.RepositoryID\n}\n\n// GetRequest returns the Request field.\nfunc (h *HookDelivery) GetRequest() *HookRequest {\n\tif h == nil {\n\t\treturn nil\n\t}\n\treturn h.Request\n}\n\n// GetResponse returns the Response field.\nfunc (h *HookDelivery) GetResponse() *HookResponse {\n\tif h == nil {\n\t\treturn nil\n\t}\n\treturn h.Response\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (h *HookDelivery) GetStatus() string {\n\tif h == nil || h.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *h.Status\n}\n\n// GetStatusCode returns the StatusCode field if it's non-nil, zero value otherwise.\nfunc (h *HookDelivery) GetStatusCode() int {\n\tif h == nil || h.StatusCode == nil {\n\t\treturn 0\n\t}\n\treturn *h.StatusCode\n}\n\n// GetHeaders returns the Headers map if it's non-nil, an empty map otherwise.\nfunc (h *HookRequest) GetHeaders() map[string]string {\n\tif h == nil || h.Headers == nil {\n\t\treturn map[string]string{}\n\t}\n\treturn h.Headers\n}\n\n// GetRawPayload returns the RawPayload field if it's non-nil, zero value otherwise.\nfunc (h *HookRequest) GetRawPayload() json.RawMessage {\n\tif h == nil || h.RawPayload == nil {\n\t\treturn json.RawMessage{}\n\t}\n\treturn *h.RawPayload\n}\n\n// GetHeaders returns the Headers map if it's non-nil, an empty map otherwise.\nfunc (h *HookResponse) GetHeaders() map[string]string {\n\tif h == nil || h.Headers == nil {\n\t\treturn map[string]string{}\n\t}\n\treturn h.Headers\n}\n\n// GetRawPayload returns the RawPayload field if it's non-nil, zero value otherwise.\nfunc (h *HookResponse) GetRawPayload() json.RawMessage {\n\tif h == nil || h.RawPayload == nil {\n\t\treturn json.RawMessage{}\n\t}\n\treturn *h.RawPayload\n}\n\n// GetActiveHooks returns the ActiveHooks field if it's non-nil, zero value otherwise.\nfunc (h *HookStats) GetActiveHooks() int {\n\tif h == nil || h.ActiveHooks == nil {\n\t\treturn 0\n\t}\n\treturn *h.ActiveHooks\n}\n\n// GetInactiveHooks returns the InactiveHooks field if it's non-nil, zero value otherwise.\nfunc (h *HookStats) GetInactiveHooks() int {\n\tif h == nil || h.InactiveHooks == nil {\n\t\treturn 0\n\t}\n\treturn *h.InactiveHooks\n}\n\n// GetTotalHooks returns the TotalHooks field if it's non-nil, zero value otherwise.\nfunc (h *HookStats) GetTotalHooks() int {\n\tif h == nil || h.TotalHooks == nil {\n\t\treturn 0\n\t}\n\treturn *h.TotalHooks\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (h *HostedRunner) GetID() int64 {\n\tif h == nil || h.ID == nil {\n\t\treturn 0\n\t}\n\treturn *h.ID\n}\n\n// GetImageDetails returns the ImageDetails field.\nfunc (h *HostedRunner) GetImageDetails() *HostedRunnerImageDetail {\n\tif h == nil {\n\t\treturn nil\n\t}\n\treturn h.ImageDetails\n}\n\n// GetLastActiveOn returns the LastActiveOn field if it's non-nil, zero value otherwise.\nfunc (h *HostedRunner) GetLastActiveOn() Timestamp {\n\tif h == nil || h.LastActiveOn == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *h.LastActiveOn\n}\n\n// GetMachineSizeDetails returns the MachineSizeDetails field.\nfunc (h *HostedRunner) GetMachineSizeDetails() *HostedRunnerMachineSpec {\n\tif h == nil {\n\t\treturn nil\n\t}\n\treturn h.MachineSizeDetails\n}\n\n// GetMaximumRunners returns the MaximumRunners field if it's non-nil, zero value otherwise.\nfunc (h *HostedRunner) GetMaximumRunners() int64 {\n\tif h == nil || h.MaximumRunners == nil {\n\t\treturn 0\n\t}\n\treturn *h.MaximumRunners\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (h *HostedRunner) GetName() string {\n\tif h == nil || h.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *h.Name\n}\n\n// GetPlatform returns the Platform field if it's non-nil, zero value otherwise.\nfunc (h *HostedRunner) GetPlatform() string {\n\tif h == nil || h.Platform == nil {\n\t\treturn \"\"\n\t}\n\treturn *h.Platform\n}\n\n// GetPublicIPEnabled returns the PublicIPEnabled field if it's non-nil, zero value otherwise.\nfunc (h *HostedRunner) GetPublicIPEnabled() bool {\n\tif h == nil || h.PublicIPEnabled == nil {\n\t\treturn false\n\t}\n\treturn *h.PublicIPEnabled\n}\n\n// GetPublicIPs returns the PublicIPs slice if it's non-nil, nil otherwise.\nfunc (h *HostedRunner) GetPublicIPs() []*HostedRunnerPublicIP {\n\tif h == nil || h.PublicIPs == nil {\n\t\treturn nil\n\t}\n\treturn h.PublicIPs\n}\n\n// GetRunnerGroupID returns the RunnerGroupID field if it's non-nil, zero value otherwise.\nfunc (h *HostedRunner) GetRunnerGroupID() int64 {\n\tif h == nil || h.RunnerGroupID == nil {\n\t\treturn 0\n\t}\n\treturn *h.RunnerGroupID\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (h *HostedRunner) GetStatus() string {\n\tif h == nil || h.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *h.Status\n}\n\n// GetID returns the ID field.\nfunc (h *HostedRunnerCustomImage) GetID() int64 {\n\tif h == nil {\n\t\treturn 0\n\t}\n\treturn h.ID\n}\n\n// GetLatestVersion returns the LatestVersion field.\nfunc (h *HostedRunnerCustomImage) GetLatestVersion() string {\n\tif h == nil {\n\t\treturn \"\"\n\t}\n\treturn h.LatestVersion\n}\n\n// GetName returns the Name field.\nfunc (h *HostedRunnerCustomImage) GetName() string {\n\tif h == nil {\n\t\treturn \"\"\n\t}\n\treturn h.Name\n}\n\n// GetPlatform returns the Platform field.\nfunc (h *HostedRunnerCustomImage) GetPlatform() string {\n\tif h == nil {\n\t\treturn \"\"\n\t}\n\treturn h.Platform\n}\n\n// GetSource returns the Source field.\nfunc (h *HostedRunnerCustomImage) GetSource() string {\n\tif h == nil {\n\t\treturn \"\"\n\t}\n\treturn h.Source\n}\n\n// GetState returns the State field.\nfunc (h *HostedRunnerCustomImage) GetState() string {\n\tif h == nil {\n\t\treturn \"\"\n\t}\n\treturn h.State\n}\n\n// GetTotalVersionsSize returns the TotalVersionsSize field.\nfunc (h *HostedRunnerCustomImage) GetTotalVersionsSize() int {\n\tif h == nil {\n\t\treturn 0\n\t}\n\treturn h.TotalVersionsSize\n}\n\n// GetVersionsCount returns the VersionsCount field.\nfunc (h *HostedRunnerCustomImage) GetVersionsCount() int {\n\tif h == nil {\n\t\treturn 0\n\t}\n\treturn h.VersionsCount\n}\n\n// GetImages returns the Images slice if it's non-nil, nil otherwise.\nfunc (h *HostedRunnerCustomImages) GetImages() []*HostedRunnerCustomImage {\n\tif h == nil || h.Images == nil {\n\t\treturn nil\n\t}\n\treturn h.Images\n}\n\n// GetTotalCount returns the TotalCount field.\nfunc (h *HostedRunnerCustomImages) GetTotalCount() int {\n\tif h == nil {\n\t\treturn 0\n\t}\n\treturn h.TotalCount\n}\n\n// GetCreatedOn returns the CreatedOn field.\nfunc (h *HostedRunnerCustomImageVersion) GetCreatedOn() Timestamp {\n\tif h == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn h.CreatedOn\n}\n\n// GetSizeGB returns the SizeGB field.\nfunc (h *HostedRunnerCustomImageVersion) GetSizeGB() int {\n\tif h == nil {\n\t\treturn 0\n\t}\n\treturn h.SizeGB\n}\n\n// GetState returns the State field.\nfunc (h *HostedRunnerCustomImageVersion) GetState() string {\n\tif h == nil {\n\t\treturn \"\"\n\t}\n\treturn h.State\n}\n\n// GetStateDetails returns the StateDetails field.\nfunc (h *HostedRunnerCustomImageVersion) GetStateDetails() string {\n\tif h == nil {\n\t\treturn \"\"\n\t}\n\treturn h.StateDetails\n}\n\n// GetVersion returns the Version field.\nfunc (h *HostedRunnerCustomImageVersion) GetVersion() string {\n\tif h == nil {\n\t\treturn \"\"\n\t}\n\treturn h.Version\n}\n\n// GetImageVersions returns the ImageVersions slice if it's non-nil, nil otherwise.\nfunc (h *HostedRunnerCustomImageVersions) GetImageVersions() []*HostedRunnerCustomImageVersion {\n\tif h == nil || h.ImageVersions == nil {\n\t\treturn nil\n\t}\n\treturn h.ImageVersions\n}\n\n// GetTotalCount returns the TotalCount field.\nfunc (h *HostedRunnerCustomImageVersions) GetTotalCount() int {\n\tif h == nil {\n\t\treturn 0\n\t}\n\treturn h.TotalCount\n}\n\n// GetID returns the ID field.\nfunc (h *HostedRunnerImage) GetID() string {\n\tif h == nil {\n\t\treturn \"\"\n\t}\n\treturn h.ID\n}\n\n// GetSource returns the Source field.\nfunc (h *HostedRunnerImage) GetSource() string {\n\tif h == nil {\n\t\treturn \"\"\n\t}\n\treturn h.Source\n}\n\n// GetVersion returns the Version field if it's non-nil, zero value otherwise.\nfunc (h *HostedRunnerImage) GetVersion() string {\n\tif h == nil || h.Version == nil {\n\t\treturn \"\"\n\t}\n\treturn *h.Version\n}\n\n// GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise.\nfunc (h *HostedRunnerImageDetail) GetDisplayName() string {\n\tif h == nil || h.DisplayName == nil {\n\t\treturn \"\"\n\t}\n\treturn *h.DisplayName\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (h *HostedRunnerImageDetail) GetID() string {\n\tif h == nil || h.ID == nil {\n\t\treturn \"\"\n\t}\n\treturn *h.ID\n}\n\n// GetSizeGB returns the SizeGB field if it's non-nil, zero value otherwise.\nfunc (h *HostedRunnerImageDetail) GetSizeGB() int64 {\n\tif h == nil || h.SizeGB == nil {\n\t\treturn 0\n\t}\n\treturn *h.SizeGB\n}\n\n// GetSource returns the Source field if it's non-nil, zero value otherwise.\nfunc (h *HostedRunnerImageDetail) GetSource() string {\n\tif h == nil || h.Source == nil {\n\t\treturn \"\"\n\t}\n\treturn *h.Source\n}\n\n// GetVersion returns the Version field if it's non-nil, zero value otherwise.\nfunc (h *HostedRunnerImageDetail) GetVersion() string {\n\tif h == nil || h.Version == nil {\n\t\treturn \"\"\n\t}\n\treturn *h.Version\n}\n\n// GetImages returns the Images slice if it's non-nil, nil otherwise.\nfunc (h *HostedRunnerImages) GetImages() []*HostedRunnerImageSpecs {\n\tif h == nil || h.Images == nil {\n\t\treturn nil\n\t}\n\treturn h.Images\n}\n\n// GetTotalCount returns the TotalCount field.\nfunc (h *HostedRunnerImages) GetTotalCount() int {\n\tif h == nil {\n\t\treturn 0\n\t}\n\treturn h.TotalCount\n}\n\n// GetDisplayName returns the DisplayName field.\nfunc (h *HostedRunnerImageSpecs) GetDisplayName() string {\n\tif h == nil {\n\t\treturn \"\"\n\t}\n\treturn h.DisplayName\n}\n\n// GetID returns the ID field.\nfunc (h *HostedRunnerImageSpecs) GetID() string {\n\tif h == nil {\n\t\treturn \"\"\n\t}\n\treturn h.ID\n}\n\n// GetPlatform returns the Platform field.\nfunc (h *HostedRunnerImageSpecs) GetPlatform() string {\n\tif h == nil {\n\t\treturn \"\"\n\t}\n\treturn h.Platform\n}\n\n// GetSizeGB returns the SizeGB field.\nfunc (h *HostedRunnerImageSpecs) GetSizeGB() int {\n\tif h == nil {\n\t\treturn 0\n\t}\n\treturn h.SizeGB\n}\n\n// GetSource returns the Source field.\nfunc (h *HostedRunnerImageSpecs) GetSource() string {\n\tif h == nil {\n\t\treturn \"\"\n\t}\n\treturn h.Source\n}\n\n// GetCPUCores returns the CPUCores field.\nfunc (h *HostedRunnerMachineSpec) GetCPUCores() int {\n\tif h == nil {\n\t\treturn 0\n\t}\n\treturn h.CPUCores\n}\n\n// GetID returns the ID field.\nfunc (h *HostedRunnerMachineSpec) GetID() string {\n\tif h == nil {\n\t\treturn \"\"\n\t}\n\treturn h.ID\n}\n\n// GetMemoryGB returns the MemoryGB field.\nfunc (h *HostedRunnerMachineSpec) GetMemoryGB() int {\n\tif h == nil {\n\t\treturn 0\n\t}\n\treturn h.MemoryGB\n}\n\n// GetStorageGB returns the StorageGB field.\nfunc (h *HostedRunnerMachineSpec) GetStorageGB() int {\n\tif h == nil {\n\t\treturn 0\n\t}\n\treturn h.StorageGB\n}\n\n// GetMachineSpecs returns the MachineSpecs slice if it's non-nil, nil otherwise.\nfunc (h *HostedRunnerMachineSpecs) GetMachineSpecs() []*HostedRunnerMachineSpec {\n\tif h == nil || h.MachineSpecs == nil {\n\t\treturn nil\n\t}\n\treturn h.MachineSpecs\n}\n\n// GetTotalCount returns the TotalCount field.\nfunc (h *HostedRunnerMachineSpecs) GetTotalCount() int {\n\tif h == nil {\n\t\treturn 0\n\t}\n\treturn h.TotalCount\n}\n\n// GetPlatforms returns the Platforms slice if it's non-nil, nil otherwise.\nfunc (h *HostedRunnerPlatforms) GetPlatforms() []string {\n\tif h == nil || h.Platforms == nil {\n\t\treturn nil\n\t}\n\treturn h.Platforms\n}\n\n// GetTotalCount returns the TotalCount field.\nfunc (h *HostedRunnerPlatforms) GetTotalCount() int {\n\tif h == nil {\n\t\treturn 0\n\t}\n\treturn h.TotalCount\n}\n\n// GetEnabled returns the Enabled field.\nfunc (h *HostedRunnerPublicIP) GetEnabled() bool {\n\tif h == nil {\n\t\treturn false\n\t}\n\treturn h.Enabled\n}\n\n// GetLength returns the Length field.\nfunc (h *HostedRunnerPublicIP) GetLength() int {\n\tif h == nil {\n\t\treturn 0\n\t}\n\treturn h.Length\n}\n\n// GetPrefix returns the Prefix field.\nfunc (h *HostedRunnerPublicIP) GetPrefix() string {\n\tif h == nil {\n\t\treturn \"\"\n\t}\n\treturn h.Prefix\n}\n\n// GetPublicIPs returns the PublicIPs field.\nfunc (h *HostedRunnerPublicIPLimits) GetPublicIPs() *PublicIPUsage {\n\tif h == nil {\n\t\treturn nil\n\t}\n\treturn h.PublicIPs\n}\n\n// GetRunners returns the Runners slice if it's non-nil, nil otherwise.\nfunc (h *HostedRunners) GetRunners() []*HostedRunner {\n\tif h == nil || h.Runners == nil {\n\t\treturn nil\n\t}\n\treturn h.Runners\n}\n\n// GetTotalCount returns the TotalCount field.\nfunc (h *HostedRunners) GetTotalCount() int {\n\tif h == nil {\n\t\treturn 0\n\t}\n\treturn h.TotalCount\n}\n\n// GetContexts returns the Contexts slice if it's non-nil, nil otherwise.\nfunc (h *Hovercard) GetContexts() []*UserContext {\n\tif h == nil || h.Contexts == nil {\n\t\treturn nil\n\t}\n\treturn h.Contexts\n}\n\n// GetSubjectID returns the SubjectID field.\nfunc (h *HovercardOptions) GetSubjectID() string {\n\tif h == nil {\n\t\treturn \"\"\n\t}\n\treturn h.SubjectID\n}\n\n// GetSubjectType returns the SubjectType field.\nfunc (h *HovercardOptions) GetSubjectType() string {\n\tif h == nil {\n\t\treturn \"\"\n\t}\n\treturn h.SubjectType\n}\n\n// GetGroupDescription returns the GroupDescription field if it's non-nil, zero value otherwise.\nfunc (i *IDPGroup) GetGroupDescription() string {\n\tif i == nil || i.GroupDescription == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.GroupDescription\n}\n\n// GetGroupID returns the GroupID field if it's non-nil, zero value otherwise.\nfunc (i *IDPGroup) GetGroupID() string {\n\tif i == nil || i.GroupID == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.GroupID\n}\n\n// GetGroupName returns the GroupName field if it's non-nil, zero value otherwise.\nfunc (i *IDPGroup) GetGroupName() string {\n\tif i == nil || i.GroupName == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.GroupName\n}\n\n// GetGroups returns the Groups slice if it's non-nil, nil otherwise.\nfunc (i *IDPGroupList) GetGroups() []*IDPGroup {\n\tif i == nil || i.Groups == nil {\n\t\treturn nil\n\t}\n\treturn i.Groups\n}\n\n// GetEnforcedRepositories returns the EnforcedRepositories field if it's non-nil, zero value otherwise.\nfunc (i *ImmutableReleasePolicy) GetEnforcedRepositories() string {\n\tif i == nil || i.EnforcedRepositories == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.EnforcedRepositories\n}\n\n// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs slice if it's non-nil, nil otherwise.\nfunc (i *ImmutableReleasePolicy) GetSelectedRepositoryIDs() []int64 {\n\tif i == nil || i.SelectedRepositoryIDs == nil {\n\t\treturn nil\n\t}\n\treturn i.SelectedRepositoryIDs\n}\n\n// GetEnforcedRepositories returns the EnforcedRepositories field if it's non-nil, zero value otherwise.\nfunc (i *ImmutableReleaseSettings) GetEnforcedRepositories() string {\n\tif i == nil || i.EnforcedRepositories == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.EnforcedRepositories\n}\n\n// GetSelectedRepositoriesURL returns the SelectedRepositoriesURL field if it's non-nil, zero value otherwise.\nfunc (i *ImmutableReleaseSettings) GetSelectedRepositoriesURL() string {\n\tif i == nil || i.SelectedRepositoriesURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.SelectedRepositoriesURL\n}\n\n// GetScopes returns the Scopes slice if it's non-nil, nil otherwise.\nfunc (i *ImpersonateUserOptions) GetScopes() []string {\n\tif i == nil || i.Scopes == nil {\n\t\treturn nil\n\t}\n\treturn i.Scopes\n}\n\n// GetAuthorsCount returns the AuthorsCount field if it's non-nil, zero value otherwise.\nfunc (i *Import) GetAuthorsCount() int {\n\tif i == nil || i.AuthorsCount == nil {\n\t\treturn 0\n\t}\n\treturn *i.AuthorsCount\n}\n\n// GetAuthorsURL returns the AuthorsURL field if it's non-nil, zero value otherwise.\nfunc (i *Import) GetAuthorsURL() string {\n\tif i == nil || i.AuthorsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.AuthorsURL\n}\n\n// GetCommitCount returns the CommitCount field if it's non-nil, zero value otherwise.\nfunc (i *Import) GetCommitCount() int {\n\tif i == nil || i.CommitCount == nil {\n\t\treturn 0\n\t}\n\treturn *i.CommitCount\n}\n\n// GetFailedStep returns the FailedStep field if it's non-nil, zero value otherwise.\nfunc (i *Import) GetFailedStep() string {\n\tif i == nil || i.FailedStep == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.FailedStep\n}\n\n// GetHasLargeFiles returns the HasLargeFiles field if it's non-nil, zero value otherwise.\nfunc (i *Import) GetHasLargeFiles() bool {\n\tif i == nil || i.HasLargeFiles == nil {\n\t\treturn false\n\t}\n\treturn *i.HasLargeFiles\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (i *Import) GetHTMLURL() string {\n\tif i == nil || i.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.HTMLURL\n}\n\n// GetHumanName returns the HumanName field if it's non-nil, zero value otherwise.\nfunc (i *Import) GetHumanName() string {\n\tif i == nil || i.HumanName == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.HumanName\n}\n\n// GetLargeFilesCount returns the LargeFilesCount field if it's non-nil, zero value otherwise.\nfunc (i *Import) GetLargeFilesCount() int {\n\tif i == nil || i.LargeFilesCount == nil {\n\t\treturn 0\n\t}\n\treturn *i.LargeFilesCount\n}\n\n// GetLargeFilesSize returns the LargeFilesSize field if it's non-nil, zero value otherwise.\nfunc (i *Import) GetLargeFilesSize() int {\n\tif i == nil || i.LargeFilesSize == nil {\n\t\treturn 0\n\t}\n\treturn *i.LargeFilesSize\n}\n\n// GetMessage returns the Message field if it's non-nil, zero value otherwise.\nfunc (i *Import) GetMessage() string {\n\tif i == nil || i.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Message\n}\n\n// GetPercent returns the Percent field if it's non-nil, zero value otherwise.\nfunc (i *Import) GetPercent() int {\n\tif i == nil || i.Percent == nil {\n\t\treturn 0\n\t}\n\treturn *i.Percent\n}\n\n// GetProjectChoices returns the ProjectChoices slice if it's non-nil, nil otherwise.\nfunc (i *Import) GetProjectChoices() []*Import {\n\tif i == nil || i.ProjectChoices == nil {\n\t\treturn nil\n\t}\n\treturn i.ProjectChoices\n}\n\n// GetPushPercent returns the PushPercent field if it's non-nil, zero value otherwise.\nfunc (i *Import) GetPushPercent() int {\n\tif i == nil || i.PushPercent == nil {\n\t\treturn 0\n\t}\n\treturn *i.PushPercent\n}\n\n// GetRepositoryURL returns the RepositoryURL field if it's non-nil, zero value otherwise.\nfunc (i *Import) GetRepositoryURL() string {\n\tif i == nil || i.RepositoryURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.RepositoryURL\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (i *Import) GetStatus() string {\n\tif i == nil || i.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Status\n}\n\n// GetStatusText returns the StatusText field if it's non-nil, zero value otherwise.\nfunc (i *Import) GetStatusText() string {\n\tif i == nil || i.StatusText == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.StatusText\n}\n\n// GetTFVCProject returns the TFVCProject field if it's non-nil, zero value otherwise.\nfunc (i *Import) GetTFVCProject() string {\n\tif i == nil || i.TFVCProject == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.TFVCProject\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (i *Import) GetURL() string {\n\tif i == nil || i.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.URL\n}\n\n// GetUseLFS returns the UseLFS field if it's non-nil, zero value otherwise.\nfunc (i *Import) GetUseLFS() string {\n\tif i == nil || i.UseLFS == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.UseLFS\n}\n\n// GetVCS returns the VCS field if it's non-nil, zero value otherwise.\nfunc (i *Import) GetVCS() string {\n\tif i == nil || i.VCS == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.VCS\n}\n\n// GetVCSPassword returns the VCSPassword field if it's non-nil, zero value otherwise.\nfunc (i *Import) GetVCSPassword() string {\n\tif i == nil || i.VCSPassword == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.VCSPassword\n}\n\n// GetVCSURL returns the VCSURL field if it's non-nil, zero value otherwise.\nfunc (i *Import) GetVCSURL() string {\n\tif i == nil || i.VCSURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.VCSURL\n}\n\n// GetVCSUsername returns the VCSUsername field if it's non-nil, zero value otherwise.\nfunc (i *Import) GetVCSUsername() string {\n\tif i == nil || i.VCSUsername == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.VCSUsername\n}\n\n// GetLicense returns the License field.\nfunc (i *InitialConfigOptions) GetLicense() string {\n\tif i == nil {\n\t\treturn \"\"\n\t}\n\treturn i.License\n}\n\n// GetPassword returns the Password field.\nfunc (i *InitialConfigOptions) GetPassword() string {\n\tif i == nil {\n\t\treturn \"\"\n\t}\n\treturn i.Password\n}\n\n// GetAccessibleRepositoriesURL returns the AccessibleRepositoriesURL field if it's non-nil, zero value otherwise.\nfunc (i *InstallableOrganization) GetAccessibleRepositoriesURL() string {\n\tif i == nil || i.AccessibleRepositoriesURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.AccessibleRepositoriesURL\n}\n\n// GetID returns the ID field.\nfunc (i *InstallableOrganization) GetID() int64 {\n\tif i == nil {\n\t\treturn 0\n\t}\n\treturn i.ID\n}\n\n// GetLogin returns the Login field.\nfunc (i *InstallableOrganization) GetLogin() string {\n\tif i == nil {\n\t\treturn \"\"\n\t}\n\treturn i.Login\n}\n\n// GetClientID returns the ClientID field.\nfunc (i *InstallAppRequest) GetClientID() string {\n\tif i == nil {\n\t\treturn \"\"\n\t}\n\treturn i.ClientID\n}\n\n// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise.\nfunc (i *InstallAppRequest) GetRepositories() []string {\n\tif i == nil || i.Repositories == nil {\n\t\treturn nil\n\t}\n\treturn i.Repositories\n}\n\n// GetRepositorySelection returns the RepositorySelection field.\nfunc (i *InstallAppRequest) GetRepositorySelection() string {\n\tif i == nil {\n\t\treturn \"\"\n\t}\n\treturn i.RepositorySelection\n}\n\n// GetAccessTokensURL returns the AccessTokensURL field if it's non-nil, zero value otherwise.\nfunc (i *Installation) GetAccessTokensURL() string {\n\tif i == nil || i.AccessTokensURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.AccessTokensURL\n}\n\n// GetAccount returns the Account field.\nfunc (i *Installation) GetAccount() *User {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Account\n}\n\n// GetAppID returns the AppID field if it's non-nil, zero value otherwise.\nfunc (i *Installation) GetAppID() int64 {\n\tif i == nil || i.AppID == nil {\n\t\treturn 0\n\t}\n\treturn *i.AppID\n}\n\n// GetAppSlug returns the AppSlug field if it's non-nil, zero value otherwise.\nfunc (i *Installation) GetAppSlug() string {\n\tif i == nil || i.AppSlug == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.AppSlug\n}\n\n// GetClientID returns the ClientID field if it's non-nil, zero value otherwise.\nfunc (i *Installation) GetClientID() string {\n\tif i == nil || i.ClientID == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.ClientID\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (i *Installation) GetCreatedAt() Timestamp {\n\tif i == nil || i.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *i.CreatedAt\n}\n\n// GetEvents returns the Events slice if it's non-nil, nil otherwise.\nfunc (i *Installation) GetEvents() []string {\n\tif i == nil || i.Events == nil {\n\t\treturn nil\n\t}\n\treturn i.Events\n}\n\n// GetHasMultipleSingleFiles returns the HasMultipleSingleFiles field if it's non-nil, zero value otherwise.\nfunc (i *Installation) GetHasMultipleSingleFiles() bool {\n\tif i == nil || i.HasMultipleSingleFiles == nil {\n\t\treturn false\n\t}\n\treturn *i.HasMultipleSingleFiles\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (i *Installation) GetHTMLURL() string {\n\tif i == nil || i.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (i *Installation) GetID() int64 {\n\tif i == nil || i.ID == nil {\n\t\treturn 0\n\t}\n\treturn *i.ID\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (i *Installation) GetNodeID() string {\n\tif i == nil || i.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.NodeID\n}\n\n// GetPermissions returns the Permissions field.\nfunc (i *Installation) GetPermissions() *InstallationPermissions {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Permissions\n}\n\n// GetRepositoriesURL returns the RepositoriesURL field if it's non-nil, zero value otherwise.\nfunc (i *Installation) GetRepositoriesURL() string {\n\tif i == nil || i.RepositoriesURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.RepositoriesURL\n}\n\n// GetRepositorySelection returns the RepositorySelection field if it's non-nil, zero value otherwise.\nfunc (i *Installation) GetRepositorySelection() string {\n\tif i == nil || i.RepositorySelection == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.RepositorySelection\n}\n\n// GetSingleFileName returns the SingleFileName field if it's non-nil, zero value otherwise.\nfunc (i *Installation) GetSingleFileName() string {\n\tif i == nil || i.SingleFileName == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.SingleFileName\n}\n\n// GetSingleFilePaths returns the SingleFilePaths slice if it's non-nil, nil otherwise.\nfunc (i *Installation) GetSingleFilePaths() []string {\n\tif i == nil || i.SingleFilePaths == nil {\n\t\treturn nil\n\t}\n\treturn i.SingleFilePaths\n}\n\n// GetSuspendedAt returns the SuspendedAt field if it's non-nil, zero value otherwise.\nfunc (i *Installation) GetSuspendedAt() Timestamp {\n\tif i == nil || i.SuspendedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *i.SuspendedAt\n}\n\n// GetSuspendedBy returns the SuspendedBy field.\nfunc (i *Installation) GetSuspendedBy() *User {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.SuspendedBy\n}\n\n// GetTargetID returns the TargetID field if it's non-nil, zero value otherwise.\nfunc (i *Installation) GetTargetID() int64 {\n\tif i == nil || i.TargetID == nil {\n\t\treturn 0\n\t}\n\treturn *i.TargetID\n}\n\n// GetTargetType returns the TargetType field if it's non-nil, zero value otherwise.\nfunc (i *Installation) GetTargetType() string {\n\tif i == nil || i.TargetType == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.TargetType\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (i *Installation) GetUpdatedAt() Timestamp {\n\tif i == nil || i.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *i.UpdatedAt\n}\n\n// GetLogin returns the Login field.\nfunc (i *InstallationChanges) GetLogin() *InstallationLoginChange {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Login\n}\n\n// GetSlug returns the Slug field.\nfunc (i *InstallationChanges) GetSlug() *InstallationSlugChange {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Slug\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (i *InstallationEvent) GetAction() string {\n\tif i == nil || i.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Action\n}\n\n// GetInstallation returns the Installation field.\nfunc (i *InstallationEvent) GetInstallation() *Installation {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (i *InstallationEvent) GetOrg() *Organization {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Org\n}\n\n// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise.\nfunc (i *InstallationEvent) GetRepositories() []*Repository {\n\tif i == nil || i.Repositories == nil {\n\t\treturn nil\n\t}\n\treturn i.Repositories\n}\n\n// GetRequester returns the Requester field.\nfunc (i *InstallationEvent) GetRequester() *User {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Requester\n}\n\n// GetSender returns the Sender field.\nfunc (i *InstallationEvent) GetSender() *User {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Sender\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (i *InstallationLoginChange) GetFrom() string {\n\tif i == nil || i.From == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.From\n}\n\n// GetActions returns the Actions field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetActions() string {\n\tif i == nil || i.Actions == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Actions\n}\n\n// GetActionsVariables returns the ActionsVariables field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetActionsVariables() string {\n\tif i == nil || i.ActionsVariables == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.ActionsVariables\n}\n\n// GetAdministration returns the Administration field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetAdministration() string {\n\tif i == nil || i.Administration == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Administration\n}\n\n// GetAttestations returns the Attestations field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetAttestations() string {\n\tif i == nil || i.Attestations == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Attestations\n}\n\n// GetBlocking returns the Blocking field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetBlocking() string {\n\tif i == nil || i.Blocking == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Blocking\n}\n\n// GetChecks returns the Checks field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetChecks() string {\n\tif i == nil || i.Checks == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Checks\n}\n\n// GetCodespaces returns the Codespaces field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetCodespaces() string {\n\tif i == nil || i.Codespaces == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Codespaces\n}\n\n// GetCodespacesLifecycleAdmin returns the CodespacesLifecycleAdmin field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetCodespacesLifecycleAdmin() string {\n\tif i == nil || i.CodespacesLifecycleAdmin == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.CodespacesLifecycleAdmin\n}\n\n// GetCodespacesMetadata returns the CodespacesMetadata field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetCodespacesMetadata() string {\n\tif i == nil || i.CodespacesMetadata == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.CodespacesMetadata\n}\n\n// GetCodespacesSecrets returns the CodespacesSecrets field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetCodespacesSecrets() string {\n\tif i == nil || i.CodespacesSecrets == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.CodespacesSecrets\n}\n\n// GetCodespacesUserSecrets returns the CodespacesUserSecrets field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetCodespacesUserSecrets() string {\n\tif i == nil || i.CodespacesUserSecrets == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.CodespacesUserSecrets\n}\n\n// GetContentReferences returns the ContentReferences field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetContentReferences() string {\n\tif i == nil || i.ContentReferences == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.ContentReferences\n}\n\n// GetContents returns the Contents field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetContents() string {\n\tif i == nil || i.Contents == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Contents\n}\n\n// GetCopilotMessages returns the CopilotMessages field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetCopilotMessages() string {\n\tif i == nil || i.CopilotMessages == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.CopilotMessages\n}\n\n// GetDependabotSecrets returns the DependabotSecrets field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetDependabotSecrets() string {\n\tif i == nil || i.DependabotSecrets == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.DependabotSecrets\n}\n\n// GetDeployments returns the Deployments field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetDeployments() string {\n\tif i == nil || i.Deployments == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Deployments\n}\n\n// GetDiscussions returns the Discussions field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetDiscussions() string {\n\tif i == nil || i.Discussions == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Discussions\n}\n\n// GetEmails returns the Emails field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetEmails() string {\n\tif i == nil || i.Emails == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Emails\n}\n\n// GetEnvironments returns the Environments field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetEnvironments() string {\n\tif i == nil || i.Environments == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Environments\n}\n\n// GetFollowers returns the Followers field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetFollowers() string {\n\tif i == nil || i.Followers == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Followers\n}\n\n// GetGists returns the Gists field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetGists() string {\n\tif i == nil || i.Gists == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Gists\n}\n\n// GetGitSigningSSHPublicKeys returns the GitSigningSSHPublicKeys field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetGitSigningSSHPublicKeys() string {\n\tif i == nil || i.GitSigningSSHPublicKeys == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.GitSigningSSHPublicKeys\n}\n\n// GetGPGKeys returns the GPGKeys field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetGPGKeys() string {\n\tif i == nil || i.GPGKeys == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.GPGKeys\n}\n\n// GetInteractionLimits returns the InteractionLimits field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetInteractionLimits() string {\n\tif i == nil || i.InteractionLimits == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.InteractionLimits\n}\n\n// GetIssues returns the Issues field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetIssues() string {\n\tif i == nil || i.Issues == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Issues\n}\n\n// GetKeys returns the Keys field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetKeys() string {\n\tif i == nil || i.Keys == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Keys\n}\n\n// GetMembers returns the Members field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetMembers() string {\n\tif i == nil || i.Members == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Members\n}\n\n// GetMergeQueues returns the MergeQueues field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetMergeQueues() string {\n\tif i == nil || i.MergeQueues == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.MergeQueues\n}\n\n// GetMetadata returns the Metadata field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetMetadata() string {\n\tif i == nil || i.Metadata == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Metadata\n}\n\n// GetOrganizationActionsVariables returns the OrganizationActionsVariables field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetOrganizationActionsVariables() string {\n\tif i == nil || i.OrganizationActionsVariables == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.OrganizationActionsVariables\n}\n\n// GetOrganizationAdministration returns the OrganizationAdministration field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetOrganizationAdministration() string {\n\tif i == nil || i.OrganizationAdministration == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.OrganizationAdministration\n}\n\n// GetOrganizationAnnouncementBanners returns the OrganizationAnnouncementBanners field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetOrganizationAnnouncementBanners() string {\n\tif i == nil || i.OrganizationAnnouncementBanners == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.OrganizationAnnouncementBanners\n}\n\n// GetOrganizationAPIInsights returns the OrganizationAPIInsights field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetOrganizationAPIInsights() string {\n\tif i == nil || i.OrganizationAPIInsights == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.OrganizationAPIInsights\n}\n\n// GetOrganizationCodespaces returns the OrganizationCodespaces field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetOrganizationCodespaces() string {\n\tif i == nil || i.OrganizationCodespaces == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.OrganizationCodespaces\n}\n\n// GetOrganizationCodespacesSecrets returns the OrganizationCodespacesSecrets field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetOrganizationCodespacesSecrets() string {\n\tif i == nil || i.OrganizationCodespacesSecrets == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.OrganizationCodespacesSecrets\n}\n\n// GetOrganizationCodespacesSettings returns the OrganizationCodespacesSettings field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetOrganizationCodespacesSettings() string {\n\tif i == nil || i.OrganizationCodespacesSettings == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.OrganizationCodespacesSettings\n}\n\n// GetOrganizationCopilotMetrics returns the OrganizationCopilotMetrics field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetOrganizationCopilotMetrics() string {\n\tif i == nil || i.OrganizationCopilotMetrics == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.OrganizationCopilotMetrics\n}\n\n// GetOrganizationCopilotSeatManagement returns the OrganizationCopilotSeatManagement field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetOrganizationCopilotSeatManagement() string {\n\tif i == nil || i.OrganizationCopilotSeatManagement == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.OrganizationCopilotSeatManagement\n}\n\n// GetOrganizationCustomOrgRoles returns the OrganizationCustomOrgRoles field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetOrganizationCustomOrgRoles() string {\n\tif i == nil || i.OrganizationCustomOrgRoles == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.OrganizationCustomOrgRoles\n}\n\n// GetOrganizationCustomProperties returns the OrganizationCustomProperties field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetOrganizationCustomProperties() string {\n\tif i == nil || i.OrganizationCustomProperties == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.OrganizationCustomProperties\n}\n\n// GetOrganizationCustomRoles returns the OrganizationCustomRoles field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetOrganizationCustomRoles() string {\n\tif i == nil || i.OrganizationCustomRoles == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.OrganizationCustomRoles\n}\n\n// GetOrganizationDependabotSecrets returns the OrganizationDependabotSecrets field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetOrganizationDependabotSecrets() string {\n\tif i == nil || i.OrganizationDependabotSecrets == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.OrganizationDependabotSecrets\n}\n\n// GetOrganizationEvents returns the OrganizationEvents field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetOrganizationEvents() string {\n\tif i == nil || i.OrganizationEvents == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.OrganizationEvents\n}\n\n// GetOrganizationHooks returns the OrganizationHooks field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetOrganizationHooks() string {\n\tif i == nil || i.OrganizationHooks == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.OrganizationHooks\n}\n\n// GetOrganizationKnowledgeBases returns the OrganizationKnowledgeBases field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetOrganizationKnowledgeBases() string {\n\tif i == nil || i.OrganizationKnowledgeBases == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.OrganizationKnowledgeBases\n}\n\n// GetOrganizationPackages returns the OrganizationPackages field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetOrganizationPackages() string {\n\tif i == nil || i.OrganizationPackages == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.OrganizationPackages\n}\n\n// GetOrganizationPersonalAccessTokenRequests returns the OrganizationPersonalAccessTokenRequests field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetOrganizationPersonalAccessTokenRequests() string {\n\tif i == nil || i.OrganizationPersonalAccessTokenRequests == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.OrganizationPersonalAccessTokenRequests\n}\n\n// GetOrganizationPersonalAccessTokens returns the OrganizationPersonalAccessTokens field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetOrganizationPersonalAccessTokens() string {\n\tif i == nil || i.OrganizationPersonalAccessTokens == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.OrganizationPersonalAccessTokens\n}\n\n// GetOrganizationPlan returns the OrganizationPlan field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetOrganizationPlan() string {\n\tif i == nil || i.OrganizationPlan == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.OrganizationPlan\n}\n\n// GetOrganizationPreReceiveHooks returns the OrganizationPreReceiveHooks field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetOrganizationPreReceiveHooks() string {\n\tif i == nil || i.OrganizationPreReceiveHooks == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.OrganizationPreReceiveHooks\n}\n\n// GetOrganizationProjects returns the OrganizationProjects field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetOrganizationProjects() string {\n\tif i == nil || i.OrganizationProjects == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.OrganizationProjects\n}\n\n// GetOrganizationSecrets returns the OrganizationSecrets field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetOrganizationSecrets() string {\n\tif i == nil || i.OrganizationSecrets == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.OrganizationSecrets\n}\n\n// GetOrganizationSelfHostedRunners returns the OrganizationSelfHostedRunners field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetOrganizationSelfHostedRunners() string {\n\tif i == nil || i.OrganizationSelfHostedRunners == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.OrganizationSelfHostedRunners\n}\n\n// GetOrganizationUserBlocking returns the OrganizationUserBlocking field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetOrganizationUserBlocking() string {\n\tif i == nil || i.OrganizationUserBlocking == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.OrganizationUserBlocking\n}\n\n// GetPackages returns the Packages field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetPackages() string {\n\tif i == nil || i.Packages == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Packages\n}\n\n// GetPages returns the Pages field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetPages() string {\n\tif i == nil || i.Pages == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Pages\n}\n\n// GetPlan returns the Plan field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetPlan() string {\n\tif i == nil || i.Plan == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Plan\n}\n\n// GetProfile returns the Profile field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetProfile() string {\n\tif i == nil || i.Profile == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Profile\n}\n\n// GetPullRequests returns the PullRequests field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetPullRequests() string {\n\tif i == nil || i.PullRequests == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.PullRequests\n}\n\n// GetRepositoryAdvisories returns the RepositoryAdvisories field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetRepositoryAdvisories() string {\n\tif i == nil || i.RepositoryAdvisories == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.RepositoryAdvisories\n}\n\n// GetRepositoryCustomProperties returns the RepositoryCustomProperties field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetRepositoryCustomProperties() string {\n\tif i == nil || i.RepositoryCustomProperties == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.RepositoryCustomProperties\n}\n\n// GetRepositoryHooks returns the RepositoryHooks field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetRepositoryHooks() string {\n\tif i == nil || i.RepositoryHooks == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.RepositoryHooks\n}\n\n// GetRepositoryPreReceiveHooks returns the RepositoryPreReceiveHooks field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetRepositoryPreReceiveHooks() string {\n\tif i == nil || i.RepositoryPreReceiveHooks == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.RepositoryPreReceiveHooks\n}\n\n// GetRepositoryProjects returns the RepositoryProjects field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetRepositoryProjects() string {\n\tif i == nil || i.RepositoryProjects == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.RepositoryProjects\n}\n\n// GetSecrets returns the Secrets field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetSecrets() string {\n\tif i == nil || i.Secrets == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Secrets\n}\n\n// GetSecretScanningAlerts returns the SecretScanningAlerts field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetSecretScanningAlerts() string {\n\tif i == nil || i.SecretScanningAlerts == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.SecretScanningAlerts\n}\n\n// GetSecurityEvents returns the SecurityEvents field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetSecurityEvents() string {\n\tif i == nil || i.SecurityEvents == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.SecurityEvents\n}\n\n// GetSingleFile returns the SingleFile field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetSingleFile() string {\n\tif i == nil || i.SingleFile == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.SingleFile\n}\n\n// GetStarring returns the Starring field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetStarring() string {\n\tif i == nil || i.Starring == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Starring\n}\n\n// GetStatuses returns the Statuses field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetStatuses() string {\n\tif i == nil || i.Statuses == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Statuses\n}\n\n// GetTeamDiscussions returns the TeamDiscussions field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetTeamDiscussions() string {\n\tif i == nil || i.TeamDiscussions == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.TeamDiscussions\n}\n\n// GetUserEvents returns the UserEvents field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetUserEvents() string {\n\tif i == nil || i.UserEvents == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.UserEvents\n}\n\n// GetVulnerabilityAlerts returns the VulnerabilityAlerts field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetVulnerabilityAlerts() string {\n\tif i == nil || i.VulnerabilityAlerts == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.VulnerabilityAlerts\n}\n\n// GetWatching returns the Watching field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetWatching() string {\n\tif i == nil || i.Watching == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Watching\n}\n\n// GetWorkflows returns the Workflows field if it's non-nil, zero value otherwise.\nfunc (i *InstallationPermissions) GetWorkflows() string {\n\tif i == nil || i.Workflows == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Workflows\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (i *InstallationRepositoriesEvent) GetAction() string {\n\tif i == nil || i.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Action\n}\n\n// GetInstallation returns the Installation field.\nfunc (i *InstallationRepositoriesEvent) GetInstallation() *Installation {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (i *InstallationRepositoriesEvent) GetOrg() *Organization {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Org\n}\n\n// GetRepositoriesAdded returns the RepositoriesAdded slice if it's non-nil, nil otherwise.\nfunc (i *InstallationRepositoriesEvent) GetRepositoriesAdded() []*Repository {\n\tif i == nil || i.RepositoriesAdded == nil {\n\t\treturn nil\n\t}\n\treturn i.RepositoriesAdded\n}\n\n// GetRepositoriesRemoved returns the RepositoriesRemoved slice if it's non-nil, nil otherwise.\nfunc (i *InstallationRepositoriesEvent) GetRepositoriesRemoved() []*Repository {\n\tif i == nil || i.RepositoriesRemoved == nil {\n\t\treturn nil\n\t}\n\treturn i.RepositoriesRemoved\n}\n\n// GetRepositorySelection returns the RepositorySelection field if it's non-nil, zero value otherwise.\nfunc (i *InstallationRepositoriesEvent) GetRepositorySelection() string {\n\tif i == nil || i.RepositorySelection == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.RepositorySelection\n}\n\n// GetSender returns the Sender field.\nfunc (i *InstallationRepositoriesEvent) GetSender() *User {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Sender\n}\n\n// GetAccount returns the Account field.\nfunc (i *InstallationRequest) GetAccount() *User {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Account\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (i *InstallationRequest) GetCreatedAt() Timestamp {\n\tif i == nil || i.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *i.CreatedAt\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (i *InstallationRequest) GetID() int64 {\n\tif i == nil || i.ID == nil {\n\t\treturn 0\n\t}\n\treturn *i.ID\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (i *InstallationRequest) GetNodeID() string {\n\tif i == nil || i.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.NodeID\n}\n\n// GetRequester returns the Requester field.\nfunc (i *InstallationRequest) GetRequester() *User {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Requester\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (i *InstallationSlugChange) GetFrom() string {\n\tif i == nil || i.From == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.From\n}\n\n// GetAccount returns the Account field.\nfunc (i *InstallationTargetEvent) GetAccount() *User {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Account\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (i *InstallationTargetEvent) GetAction() string {\n\tif i == nil || i.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Action\n}\n\n// GetChanges returns the Changes field.\nfunc (i *InstallationTargetEvent) GetChanges() *InstallationChanges {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Changes\n}\n\n// GetEnterprise returns the Enterprise field.\nfunc (i *InstallationTargetEvent) GetEnterprise() *Enterprise {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Enterprise\n}\n\n// GetInstallation returns the Installation field.\nfunc (i *InstallationTargetEvent) GetInstallation() *Installation {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Installation\n}\n\n// GetOrganization returns the Organization field.\nfunc (i *InstallationTargetEvent) GetOrganization() *Organization {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Organization\n}\n\n// GetRepository returns the Repository field.\nfunc (i *InstallationTargetEvent) GetRepository() *Repository {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Repository\n}\n\n// GetSender returns the Sender field.\nfunc (i *InstallationTargetEvent) GetSender() *User {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Sender\n}\n\n// GetTargetType returns the TargetType field if it's non-nil, zero value otherwise.\nfunc (i *InstallationTargetEvent) GetTargetType() string {\n\tif i == nil || i.TargetType == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.TargetType\n}\n\n// GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise.\nfunc (i *InstallationToken) GetExpiresAt() Timestamp {\n\tif i == nil || i.ExpiresAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *i.ExpiresAt\n}\n\n// GetPermissions returns the Permissions field.\nfunc (i *InstallationToken) GetPermissions() *InstallationPermissions {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Permissions\n}\n\n// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise.\nfunc (i *InstallationToken) GetRepositories() []*Repository {\n\tif i == nil || i.Repositories == nil {\n\t\treturn nil\n\t}\n\treturn i.Repositories\n}\n\n// GetToken returns the Token field if it's non-nil, zero value otherwise.\nfunc (i *InstallationToken) GetToken() string {\n\tif i == nil || i.Token == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Token\n}\n\n// GetPermissions returns the Permissions field.\nfunc (i *InstallationTokenListRepoOptions) GetPermissions() *InstallationPermissions {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Permissions\n}\n\n// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise.\nfunc (i *InstallationTokenListRepoOptions) GetRepositories() []string {\n\tif i == nil || i.Repositories == nil {\n\t\treturn nil\n\t}\n\treturn i.Repositories\n}\n\n// GetRepositoryIDs returns the RepositoryIDs slice if it's non-nil, nil otherwise.\nfunc (i *InstallationTokenListRepoOptions) GetRepositoryIDs() []int64 {\n\tif i == nil || i.RepositoryIDs == nil {\n\t\treturn nil\n\t}\n\treturn i.RepositoryIDs\n}\n\n// GetPermissions returns the Permissions field.\nfunc (i *InstallationTokenOptions) GetPermissions() *InstallationPermissions {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Permissions\n}\n\n// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise.\nfunc (i *InstallationTokenOptions) GetRepositories() []string {\n\tif i == nil || i.Repositories == nil {\n\t\treturn nil\n\t}\n\treturn i.Repositories\n}\n\n// GetRepositoryIDs returns the RepositoryIDs slice if it's non-nil, nil otherwise.\nfunc (i *InstallationTokenOptions) GetRepositoryIDs() []int64 {\n\tif i == nil || i.RepositoryIDs == nil {\n\t\treturn nil\n\t}\n\treturn i.RepositoryIDs\n}\n\n// GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise.\nfunc (i *InteractionRestriction) GetExpiresAt() Timestamp {\n\tif i == nil || i.ExpiresAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *i.ExpiresAt\n}\n\n// GetLimit returns the Limit field if it's non-nil, zero value otherwise.\nfunc (i *InteractionRestriction) GetLimit() string {\n\tif i == nil || i.Limit == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Limit\n}\n\n// GetOrigin returns the Origin field if it's non-nil, zero value otherwise.\nfunc (i *InteractionRestriction) GetOrigin() string {\n\tif i == nil || i.Origin == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Origin\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (i *Invitation) GetCreatedAt() Timestamp {\n\tif i == nil || i.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *i.CreatedAt\n}\n\n// GetEmail returns the Email field if it's non-nil, zero value otherwise.\nfunc (i *Invitation) GetEmail() string {\n\tif i == nil || i.Email == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Email\n}\n\n// GetFailedAt returns the FailedAt field if it's non-nil, zero value otherwise.\nfunc (i *Invitation) GetFailedAt() Timestamp {\n\tif i == nil || i.FailedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *i.FailedAt\n}\n\n// GetFailedReason returns the FailedReason field if it's non-nil, zero value otherwise.\nfunc (i *Invitation) GetFailedReason() string {\n\tif i == nil || i.FailedReason == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.FailedReason\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (i *Invitation) GetID() int64 {\n\tif i == nil || i.ID == nil {\n\t\treturn 0\n\t}\n\treturn *i.ID\n}\n\n// GetInvitationTeamURL returns the InvitationTeamURL field if it's non-nil, zero value otherwise.\nfunc (i *Invitation) GetInvitationTeamURL() string {\n\tif i == nil || i.InvitationTeamURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.InvitationTeamURL\n}\n\n// GetInviter returns the Inviter field.\nfunc (i *Invitation) GetInviter() *User {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Inviter\n}\n\n// GetLogin returns the Login field if it's non-nil, zero value otherwise.\nfunc (i *Invitation) GetLogin() string {\n\tif i == nil || i.Login == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Login\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (i *Invitation) GetNodeID() string {\n\tif i == nil || i.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.NodeID\n}\n\n// GetRole returns the Role field if it's non-nil, zero value otherwise.\nfunc (i *Invitation) GetRole() string {\n\tif i == nil || i.Role == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Role\n}\n\n// GetTeamCount returns the TeamCount field if it's non-nil, zero value otherwise.\nfunc (i *Invitation) GetTeamCount() int {\n\tif i == nil || i.TeamCount == nil {\n\t\treturn 0\n\t}\n\treturn *i.TeamCount\n}\n\n// GetActiveLockReason returns the ActiveLockReason field if it's non-nil, zero value otherwise.\nfunc (i *Issue) GetActiveLockReason() string {\n\tif i == nil || i.ActiveLockReason == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.ActiveLockReason\n}\n\n// GetAssignee returns the Assignee field.\nfunc (i *Issue) GetAssignee() *User {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Assignee\n}\n\n// GetAssignees returns the Assignees slice if it's non-nil, nil otherwise.\nfunc (i *Issue) GetAssignees() []*User {\n\tif i == nil || i.Assignees == nil {\n\t\treturn nil\n\t}\n\treturn i.Assignees\n}\n\n// GetAuthorAssociation returns the AuthorAssociation field if it's non-nil, zero value otherwise.\nfunc (i *Issue) GetAuthorAssociation() string {\n\tif i == nil || i.AuthorAssociation == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.AuthorAssociation\n}\n\n// GetBody returns the Body field if it's non-nil, zero value otherwise.\nfunc (i *Issue) GetBody() string {\n\tif i == nil || i.Body == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Body\n}\n\n// GetClosedAt returns the ClosedAt field if it's non-nil, zero value otherwise.\nfunc (i *Issue) GetClosedAt() Timestamp {\n\tif i == nil || i.ClosedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *i.ClosedAt\n}\n\n// GetClosedBy returns the ClosedBy field.\nfunc (i *Issue) GetClosedBy() *User {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.ClosedBy\n}\n\n// GetComments returns the Comments field if it's non-nil, zero value otherwise.\nfunc (i *Issue) GetComments() int {\n\tif i == nil || i.Comments == nil {\n\t\treturn 0\n\t}\n\treturn *i.Comments\n}\n\n// GetCommentsURL returns the CommentsURL field if it's non-nil, zero value otherwise.\nfunc (i *Issue) GetCommentsURL() string {\n\tif i == nil || i.CommentsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.CommentsURL\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (i *Issue) GetCreatedAt() Timestamp {\n\tif i == nil || i.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *i.CreatedAt\n}\n\n// GetDraft returns the Draft field if it's non-nil, zero value otherwise.\nfunc (i *Issue) GetDraft() bool {\n\tif i == nil || i.Draft == nil {\n\t\treturn false\n\t}\n\treturn *i.Draft\n}\n\n// GetEventsURL returns the EventsURL field if it's non-nil, zero value otherwise.\nfunc (i *Issue) GetEventsURL() string {\n\tif i == nil || i.EventsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.EventsURL\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (i *Issue) GetHTMLURL() string {\n\tif i == nil || i.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (i *Issue) GetID() int64 {\n\tif i == nil || i.ID == nil {\n\t\treturn 0\n\t}\n\treturn *i.ID\n}\n\n// GetLabels returns the Labels slice if it's non-nil, nil otherwise.\nfunc (i *Issue) GetLabels() []*Label {\n\tif i == nil || i.Labels == nil {\n\t\treturn nil\n\t}\n\treturn i.Labels\n}\n\n// GetLabelsURL returns the LabelsURL field if it's non-nil, zero value otherwise.\nfunc (i *Issue) GetLabelsURL() string {\n\tif i == nil || i.LabelsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.LabelsURL\n}\n\n// GetLocked returns the Locked field if it's non-nil, zero value otherwise.\nfunc (i *Issue) GetLocked() bool {\n\tif i == nil || i.Locked == nil {\n\t\treturn false\n\t}\n\treturn *i.Locked\n}\n\n// GetMilestone returns the Milestone field.\nfunc (i *Issue) GetMilestone() *Milestone {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Milestone\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (i *Issue) GetNodeID() string {\n\tif i == nil || i.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.NodeID\n}\n\n// GetNumber returns the Number field if it's non-nil, zero value otherwise.\nfunc (i *Issue) GetNumber() int {\n\tif i == nil || i.Number == nil {\n\t\treturn 0\n\t}\n\treturn *i.Number\n}\n\n// GetParentIssueURL returns the ParentIssueURL field if it's non-nil, zero value otherwise.\nfunc (i *Issue) GetParentIssueURL() string {\n\tif i == nil || i.ParentIssueURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.ParentIssueURL\n}\n\n// GetPullRequestLinks returns the PullRequestLinks field.\nfunc (i *Issue) GetPullRequestLinks() *PullRequestLinks {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.PullRequestLinks\n}\n\n// GetReactions returns the Reactions field.\nfunc (i *Issue) GetReactions() *Reactions {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Reactions\n}\n\n// GetRepository returns the Repository field.\nfunc (i *Issue) GetRepository() *Repository {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Repository\n}\n\n// GetRepositoryURL returns the RepositoryURL field if it's non-nil, zero value otherwise.\nfunc (i *Issue) GetRepositoryURL() string {\n\tif i == nil || i.RepositoryURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.RepositoryURL\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (i *Issue) GetState() string {\n\tif i == nil || i.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.State\n}\n\n// GetStateReason returns the StateReason field if it's non-nil, zero value otherwise.\nfunc (i *Issue) GetStateReason() string {\n\tif i == nil || i.StateReason == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.StateReason\n}\n\n// GetTextMatches returns the TextMatches slice if it's non-nil, nil otherwise.\nfunc (i *Issue) GetTextMatches() []*TextMatch {\n\tif i == nil || i.TextMatches == nil {\n\t\treturn nil\n\t}\n\treturn i.TextMatches\n}\n\n// GetTitle returns the Title field if it's non-nil, zero value otherwise.\nfunc (i *Issue) GetTitle() string {\n\tif i == nil || i.Title == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Title\n}\n\n// GetType returns the Type field.\nfunc (i *Issue) GetType() *IssueType {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Type\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (i *Issue) GetUpdatedAt() Timestamp {\n\tif i == nil || i.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *i.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (i *Issue) GetURL() string {\n\tif i == nil || i.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.URL\n}\n\n// GetUser returns the User field.\nfunc (i *Issue) GetUser() *User {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.User\n}\n\n// GetAuthorAssociation returns the AuthorAssociation field if it's non-nil, zero value otherwise.\nfunc (i *IssueComment) GetAuthorAssociation() string {\n\tif i == nil || i.AuthorAssociation == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.AuthorAssociation\n}\n\n// GetBody returns the Body field if it's non-nil, zero value otherwise.\nfunc (i *IssueComment) GetBody() string {\n\tif i == nil || i.Body == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Body\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (i *IssueComment) GetCreatedAt() Timestamp {\n\tif i == nil || i.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *i.CreatedAt\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (i *IssueComment) GetHTMLURL() string {\n\tif i == nil || i.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (i *IssueComment) GetID() int64 {\n\tif i == nil || i.ID == nil {\n\t\treturn 0\n\t}\n\treturn *i.ID\n}\n\n// GetIssueURL returns the IssueURL field if it's non-nil, zero value otherwise.\nfunc (i *IssueComment) GetIssueURL() string {\n\tif i == nil || i.IssueURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.IssueURL\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (i *IssueComment) GetNodeID() string {\n\tif i == nil || i.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.NodeID\n}\n\n// GetReactions returns the Reactions field.\nfunc (i *IssueComment) GetReactions() *Reactions {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Reactions\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (i *IssueComment) GetUpdatedAt() Timestamp {\n\tif i == nil || i.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *i.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (i *IssueComment) GetURL() string {\n\tif i == nil || i.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.URL\n}\n\n// GetUser returns the User field.\nfunc (i *IssueComment) GetUser() *User {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.User\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (i *IssueCommentEvent) GetAction() string {\n\tif i == nil || i.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Action\n}\n\n// GetChanges returns the Changes field.\nfunc (i *IssueCommentEvent) GetChanges() *EditChange {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Changes\n}\n\n// GetComment returns the Comment field.\nfunc (i *IssueCommentEvent) GetComment() *IssueComment {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Comment\n}\n\n// GetInstallation returns the Installation field.\nfunc (i *IssueCommentEvent) GetInstallation() *Installation {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Installation\n}\n\n// GetIssue returns the Issue field.\nfunc (i *IssueCommentEvent) GetIssue() *Issue {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Issue\n}\n\n// GetOrganization returns the Organization field.\nfunc (i *IssueCommentEvent) GetOrganization() *Organization {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Organization\n}\n\n// GetRepo returns the Repo field.\nfunc (i *IssueCommentEvent) GetRepo() *Repository {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (i *IssueCommentEvent) GetSender() *User {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Sender\n}\n\n// GetAction returns the Action field.\nfunc (i *IssueEvent) GetAction() string {\n\tif i == nil {\n\t\treturn \"\"\n\t}\n\treturn i.Action\n}\n\n// GetActor returns the Actor field.\nfunc (i *IssueEvent) GetActor() *User {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Actor\n}\n\n// GetAssignee returns the Assignee field.\nfunc (i *IssueEvent) GetAssignee() *User {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Assignee\n}\n\n// GetAssigner returns the Assigner field.\nfunc (i *IssueEvent) GetAssigner() *User {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Assigner\n}\n\n// GetCommitID returns the CommitID field if it's non-nil, zero value otherwise.\nfunc (i *IssueEvent) GetCommitID() string {\n\tif i == nil || i.CommitID == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.CommitID\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (i *IssueEvent) GetCreatedAt() Timestamp {\n\tif i == nil || i.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *i.CreatedAt\n}\n\n// GetDismissedReview returns the DismissedReview field.\nfunc (i *IssueEvent) GetDismissedReview() *DismissedReview {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.DismissedReview\n}\n\n// GetEvent returns the Event field if it's non-nil, zero value otherwise.\nfunc (i *IssueEvent) GetEvent() string {\n\tif i == nil || i.Event == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Event\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (i *IssueEvent) GetID() int64 {\n\tif i == nil || i.ID == nil {\n\t\treturn 0\n\t}\n\treturn *i.ID\n}\n\n// GetIssue returns the Issue field.\nfunc (i *IssueEvent) GetIssue() *Issue {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Issue\n}\n\n// GetLabel returns the Label field.\nfunc (i *IssueEvent) GetLabel() *Label {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Label\n}\n\n// GetLockReason returns the LockReason field if it's non-nil, zero value otherwise.\nfunc (i *IssueEvent) GetLockReason() string {\n\tif i == nil || i.LockReason == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.LockReason\n}\n\n// GetMilestone returns the Milestone field.\nfunc (i *IssueEvent) GetMilestone() *Milestone {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Milestone\n}\n\n// GetPerformedViaGithubApp returns the PerformedViaGithubApp field.\nfunc (i *IssueEvent) GetPerformedViaGithubApp() *App {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.PerformedViaGithubApp\n}\n\n// GetRename returns the Rename field.\nfunc (i *IssueEvent) GetRename() *Rename {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Rename\n}\n\n// GetRepository returns the Repository field.\nfunc (i *IssueEvent) GetRepository() *Repository {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Repository\n}\n\n// GetRequestedReviewer returns the RequestedReviewer field.\nfunc (i *IssueEvent) GetRequestedReviewer() *User {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.RequestedReviewer\n}\n\n// GetRequestedTeam returns the RequestedTeam field.\nfunc (i *IssueEvent) GetRequestedTeam() *Team {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.RequestedTeam\n}\n\n// GetReviewRequester returns the ReviewRequester field.\nfunc (i *IssueEvent) GetReviewRequester() *User {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.ReviewRequester\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (i *IssueEvent) GetURL() string {\n\tif i == nil || i.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.URL\n}\n\n// GetAssignee returns the Assignee field if it's non-nil, zero value otherwise.\nfunc (i *IssueImport) GetAssignee() string {\n\tif i == nil || i.Assignee == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Assignee\n}\n\n// GetBody returns the Body field.\nfunc (i *IssueImport) GetBody() string {\n\tif i == nil {\n\t\treturn \"\"\n\t}\n\treturn i.Body\n}\n\n// GetClosed returns the Closed field if it's non-nil, zero value otherwise.\nfunc (i *IssueImport) GetClosed() bool {\n\tif i == nil || i.Closed == nil {\n\t\treturn false\n\t}\n\treturn *i.Closed\n}\n\n// GetClosedAt returns the ClosedAt field if it's non-nil, zero value otherwise.\nfunc (i *IssueImport) GetClosedAt() Timestamp {\n\tif i == nil || i.ClosedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *i.ClosedAt\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (i *IssueImport) GetCreatedAt() Timestamp {\n\tif i == nil || i.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *i.CreatedAt\n}\n\n// GetLabels returns the Labels slice if it's non-nil, nil otherwise.\nfunc (i *IssueImport) GetLabels() []string {\n\tif i == nil || i.Labels == nil {\n\t\treturn nil\n\t}\n\treturn i.Labels\n}\n\n// GetMilestone returns the Milestone field if it's non-nil, zero value otherwise.\nfunc (i *IssueImport) GetMilestone() int {\n\tif i == nil || i.Milestone == nil {\n\t\treturn 0\n\t}\n\treturn *i.Milestone\n}\n\n// GetTitle returns the Title field.\nfunc (i *IssueImport) GetTitle() string {\n\tif i == nil {\n\t\treturn \"\"\n\t}\n\treturn i.Title\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (i *IssueImport) GetUpdatedAt() Timestamp {\n\tif i == nil || i.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *i.UpdatedAt\n}\n\n// GetCode returns the Code field if it's non-nil, zero value otherwise.\nfunc (i *IssueImportError) GetCode() string {\n\tif i == nil || i.Code == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Code\n}\n\n// GetField returns the Field field if it's non-nil, zero value otherwise.\nfunc (i *IssueImportError) GetField() string {\n\tif i == nil || i.Field == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Field\n}\n\n// GetLocation returns the Location field if it's non-nil, zero value otherwise.\nfunc (i *IssueImportError) GetLocation() string {\n\tif i == nil || i.Location == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Location\n}\n\n// GetResource returns the Resource field if it's non-nil, zero value otherwise.\nfunc (i *IssueImportError) GetResource() string {\n\tif i == nil || i.Resource == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Resource\n}\n\n// GetValue returns the Value field if it's non-nil, zero value otherwise.\nfunc (i *IssueImportError) GetValue() string {\n\tif i == nil || i.Value == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Value\n}\n\n// GetComments returns the Comments slice if it's non-nil, nil otherwise.\nfunc (i *IssueImportRequest) GetComments() []*Comment {\n\tif i == nil || i.Comments == nil {\n\t\treturn nil\n\t}\n\treturn i.Comments\n}\n\n// GetIssueImport returns the IssueImport field.\nfunc (i *IssueImportRequest) GetIssueImport() IssueImport {\n\tif i == nil {\n\t\treturn IssueImport{}\n\t}\n\treturn i.IssueImport\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (i *IssueImportResponse) GetCreatedAt() Timestamp {\n\tif i == nil || i.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *i.CreatedAt\n}\n\n// GetDocumentationURL returns the DocumentationURL field if it's non-nil, zero value otherwise.\nfunc (i *IssueImportResponse) GetDocumentationURL() string {\n\tif i == nil || i.DocumentationURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.DocumentationURL\n}\n\n// GetErrors returns the Errors slice if it's non-nil, nil otherwise.\nfunc (i *IssueImportResponse) GetErrors() []*IssueImportError {\n\tif i == nil || i.Errors == nil {\n\t\treturn nil\n\t}\n\treturn i.Errors\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (i *IssueImportResponse) GetID() int {\n\tif i == nil || i.ID == nil {\n\t\treturn 0\n\t}\n\treturn *i.ID\n}\n\n// GetImportIssuesURL returns the ImportIssuesURL field if it's non-nil, zero value otherwise.\nfunc (i *IssueImportResponse) GetImportIssuesURL() string {\n\tif i == nil || i.ImportIssuesURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.ImportIssuesURL\n}\n\n// GetMessage returns the Message field if it's non-nil, zero value otherwise.\nfunc (i *IssueImportResponse) GetMessage() string {\n\tif i == nil || i.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Message\n}\n\n// GetRepositoryURL returns the RepositoryURL field if it's non-nil, zero value otherwise.\nfunc (i *IssueImportResponse) GetRepositoryURL() string {\n\tif i == nil || i.RepositoryURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.RepositoryURL\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (i *IssueImportResponse) GetStatus() string {\n\tif i == nil || i.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Status\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (i *IssueImportResponse) GetUpdatedAt() Timestamp {\n\tif i == nil || i.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *i.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (i *IssueImportResponse) GetURL() string {\n\tif i == nil || i.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.URL\n}\n\n// GetDirection returns the Direction field.\nfunc (i *IssueListByOrgOptions) GetDirection() string {\n\tif i == nil {\n\t\treturn \"\"\n\t}\n\treturn i.Direction\n}\n\n// GetFilter returns the Filter field.\nfunc (i *IssueListByOrgOptions) GetFilter() string {\n\tif i == nil {\n\t\treturn \"\"\n\t}\n\treturn i.Filter\n}\n\n// GetLabels returns the Labels slice if it's non-nil, nil otherwise.\nfunc (i *IssueListByOrgOptions) GetLabels() []string {\n\tif i == nil || i.Labels == nil {\n\t\treturn nil\n\t}\n\treturn i.Labels\n}\n\n// GetSince returns the Since field.\nfunc (i *IssueListByOrgOptions) GetSince() time.Time {\n\tif i == nil {\n\t\treturn time.Time{}\n\t}\n\treturn i.Since\n}\n\n// GetSort returns the Sort field.\nfunc (i *IssueListByOrgOptions) GetSort() string {\n\tif i == nil {\n\t\treturn \"\"\n\t}\n\treturn i.Sort\n}\n\n// GetState returns the State field.\nfunc (i *IssueListByOrgOptions) GetState() string {\n\tif i == nil {\n\t\treturn \"\"\n\t}\n\treturn i.State\n}\n\n// GetType returns the Type field.\nfunc (i *IssueListByOrgOptions) GetType() string {\n\tif i == nil {\n\t\treturn \"\"\n\t}\n\treturn i.Type\n}\n\n// GetAssignee returns the Assignee field.\nfunc (i *IssueListByRepoOptions) GetAssignee() string {\n\tif i == nil {\n\t\treturn \"\"\n\t}\n\treturn i.Assignee\n}\n\n// GetCreator returns the Creator field.\nfunc (i *IssueListByRepoOptions) GetCreator() string {\n\tif i == nil {\n\t\treturn \"\"\n\t}\n\treturn i.Creator\n}\n\n// GetDirection returns the Direction field.\nfunc (i *IssueListByRepoOptions) GetDirection() string {\n\tif i == nil {\n\t\treturn \"\"\n\t}\n\treturn i.Direction\n}\n\n// GetLabels returns the Labels slice if it's non-nil, nil otherwise.\nfunc (i *IssueListByRepoOptions) GetLabels() []string {\n\tif i == nil || i.Labels == nil {\n\t\treturn nil\n\t}\n\treturn i.Labels\n}\n\n// GetMentioned returns the Mentioned field.\nfunc (i *IssueListByRepoOptions) GetMentioned() string {\n\tif i == nil {\n\t\treturn \"\"\n\t}\n\treturn i.Mentioned\n}\n\n// GetMilestone returns the Milestone field.\nfunc (i *IssueListByRepoOptions) GetMilestone() string {\n\tif i == nil {\n\t\treturn \"\"\n\t}\n\treturn i.Milestone\n}\n\n// GetSince returns the Since field.\nfunc (i *IssueListByRepoOptions) GetSince() time.Time {\n\tif i == nil {\n\t\treturn time.Time{}\n\t}\n\treturn i.Since\n}\n\n// GetSort returns the Sort field.\nfunc (i *IssueListByRepoOptions) GetSort() string {\n\tif i == nil {\n\t\treturn \"\"\n\t}\n\treturn i.Sort\n}\n\n// GetState returns the State field.\nfunc (i *IssueListByRepoOptions) GetState() string {\n\tif i == nil {\n\t\treturn \"\"\n\t}\n\treturn i.State\n}\n\n// GetType returns the Type field.\nfunc (i *IssueListByRepoOptions) GetType() string {\n\tif i == nil {\n\t\treturn \"\"\n\t}\n\treturn i.Type\n}\n\n// GetDirection returns the Direction field if it's non-nil, zero value otherwise.\nfunc (i *IssueListCommentsOptions) GetDirection() string {\n\tif i == nil || i.Direction == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Direction\n}\n\n// GetSince returns the Since field if it's non-nil, zero value otherwise.\nfunc (i *IssueListCommentsOptions) GetSince() time.Time {\n\tif i == nil || i.Since == nil {\n\t\treturn time.Time{}\n\t}\n\treturn *i.Since\n}\n\n// GetSort returns the Sort field if it's non-nil, zero value otherwise.\nfunc (i *IssueListCommentsOptions) GetSort() string {\n\tif i == nil || i.Sort == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Sort\n}\n\n// GetAssignee returns the Assignee field if it's non-nil, zero value otherwise.\nfunc (i *IssueRequest) GetAssignee() string {\n\tif i == nil || i.Assignee == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Assignee\n}\n\n// GetAssignees returns the Assignees field if it's non-nil, zero value otherwise.\nfunc (i *IssueRequest) GetAssignees() []string {\n\tif i == nil || i.Assignees == nil {\n\t\treturn nil\n\t}\n\treturn *i.Assignees\n}\n\n// GetBody returns the Body field if it's non-nil, zero value otherwise.\nfunc (i *IssueRequest) GetBody() string {\n\tif i == nil || i.Body == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Body\n}\n\n// GetLabels returns the Labels field if it's non-nil, zero value otherwise.\nfunc (i *IssueRequest) GetLabels() []string {\n\tif i == nil || i.Labels == nil {\n\t\treturn nil\n\t}\n\treturn *i.Labels\n}\n\n// GetMilestone returns the Milestone field if it's non-nil, zero value otherwise.\nfunc (i *IssueRequest) GetMilestone() int {\n\tif i == nil || i.Milestone == nil {\n\t\treturn 0\n\t}\n\treturn *i.Milestone\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (i *IssueRequest) GetState() string {\n\tif i == nil || i.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.State\n}\n\n// GetStateReason returns the StateReason field if it's non-nil, zero value otherwise.\nfunc (i *IssueRequest) GetStateReason() string {\n\tif i == nil || i.StateReason == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.StateReason\n}\n\n// GetTitle returns the Title field if it's non-nil, zero value otherwise.\nfunc (i *IssueRequest) GetTitle() string {\n\tif i == nil || i.Title == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Title\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (i *IssueRequest) GetType() string {\n\tif i == nil || i.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Type\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (i *IssuesEvent) GetAction() string {\n\tif i == nil || i.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Action\n}\n\n// GetAssignee returns the Assignee field.\nfunc (i *IssuesEvent) GetAssignee() *User {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Assignee\n}\n\n// GetChanges returns the Changes field.\nfunc (i *IssuesEvent) GetChanges() *EditChange {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Changes\n}\n\n// GetInstallation returns the Installation field.\nfunc (i *IssuesEvent) GetInstallation() *Installation {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Installation\n}\n\n// GetIssue returns the Issue field.\nfunc (i *IssuesEvent) GetIssue() *Issue {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Issue\n}\n\n// GetLabel returns the Label field.\nfunc (i *IssuesEvent) GetLabel() *Label {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Label\n}\n\n// GetMilestone returns the Milestone field.\nfunc (i *IssuesEvent) GetMilestone() *Milestone {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Milestone\n}\n\n// GetOrg returns the Org field.\nfunc (i *IssuesEvent) GetOrg() *Organization {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Org\n}\n\n// GetRepo returns the Repo field.\nfunc (i *IssuesEvent) GetRepo() *Repository {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (i *IssuesEvent) GetSender() *User {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn i.Sender\n}\n\n// GetIncompleteResults returns the IncompleteResults field if it's non-nil, zero value otherwise.\nfunc (i *IssuesSearchResult) GetIncompleteResults() bool {\n\tif i == nil || i.IncompleteResults == nil {\n\t\treturn false\n\t}\n\treturn *i.IncompleteResults\n}\n\n// GetIssues returns the Issues slice if it's non-nil, nil otherwise.\nfunc (i *IssuesSearchResult) GetIssues() []*Issue {\n\tif i == nil || i.Issues == nil {\n\t\treturn nil\n\t}\n\treturn i.Issues\n}\n\n// GetTotal returns the Total field if it's non-nil, zero value otherwise.\nfunc (i *IssuesSearchResult) GetTotal() int {\n\tif i == nil || i.Total == nil {\n\t\treturn 0\n\t}\n\treturn *i.Total\n}\n\n// GetClosedIssues returns the ClosedIssues field if it's non-nil, zero value otherwise.\nfunc (i *IssueStats) GetClosedIssues() int {\n\tif i == nil || i.ClosedIssues == nil {\n\t\treturn 0\n\t}\n\treturn *i.ClosedIssues\n}\n\n// GetOpenIssues returns the OpenIssues field if it's non-nil, zero value otherwise.\nfunc (i *IssueStats) GetOpenIssues() int {\n\tif i == nil || i.OpenIssues == nil {\n\t\treturn 0\n\t}\n\treturn *i.OpenIssues\n}\n\n// GetTotalIssues returns the TotalIssues field if it's non-nil, zero value otherwise.\nfunc (i *IssueStats) GetTotalIssues() int {\n\tif i == nil || i.TotalIssues == nil {\n\t\treturn 0\n\t}\n\treturn *i.TotalIssues\n}\n\n// GetColor returns the Color field if it's non-nil, zero value otherwise.\nfunc (i *IssueType) GetColor() string {\n\tif i == nil || i.Color == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Color\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (i *IssueType) GetCreatedAt() Timestamp {\n\tif i == nil || i.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *i.CreatedAt\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (i *IssueType) GetDescription() string {\n\tif i == nil || i.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Description\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (i *IssueType) GetID() int64 {\n\tif i == nil || i.ID == nil {\n\t\treturn 0\n\t}\n\treturn *i.ID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (i *IssueType) GetName() string {\n\tif i == nil || i.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.Name\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (i *IssueType) GetNodeID() string {\n\tif i == nil || i.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *i.NodeID\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (i *IssueType) GetUpdatedAt() Timestamp {\n\tif i == nil || i.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *i.UpdatedAt\n}\n\n// GetEncodedJITConfig returns the EncodedJITConfig field if it's non-nil, zero value otherwise.\nfunc (j *JITRunnerConfig) GetEncodedJITConfig() string {\n\tif j == nil || j.EncodedJITConfig == nil {\n\t\treturn \"\"\n\t}\n\treturn *j.EncodedJITConfig\n}\n\n// GetRunner returns the Runner field.\nfunc (j *JITRunnerConfig) GetRunner() *Runner {\n\tif j == nil {\n\t\treturn nil\n\t}\n\treturn j.Runner\n}\n\n// GetJobs returns the Jobs slice if it's non-nil, nil otherwise.\nfunc (j *Jobs) GetJobs() []*WorkflowJob {\n\tif j == nil || j.Jobs == nil {\n\t\treturn nil\n\t}\n\treturn j.Jobs\n}\n\n// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.\nfunc (j *Jobs) GetTotalCount() int {\n\tif j == nil || j.TotalCount == nil {\n\t\treturn 0\n\t}\n\treturn *j.TotalCount\n}\n\n// GetAddedBy returns the AddedBy field if it's non-nil, zero value otherwise.\nfunc (k *Key) GetAddedBy() string {\n\tif k == nil || k.AddedBy == nil {\n\t\treturn \"\"\n\t}\n\treturn *k.AddedBy\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (k *Key) GetCreatedAt() Timestamp {\n\tif k == nil || k.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *k.CreatedAt\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (k *Key) GetID() int64 {\n\tif k == nil || k.ID == nil {\n\t\treturn 0\n\t}\n\treturn *k.ID\n}\n\n// GetKey returns the Key field if it's non-nil, zero value otherwise.\nfunc (k *Key) GetKey() string {\n\tif k == nil || k.Key == nil {\n\t\treturn \"\"\n\t}\n\treturn *k.Key\n}\n\n// GetLastUsed returns the LastUsed field if it's non-nil, zero value otherwise.\nfunc (k *Key) GetLastUsed() Timestamp {\n\tif k == nil || k.LastUsed == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *k.LastUsed\n}\n\n// GetReadOnly returns the ReadOnly field if it's non-nil, zero value otherwise.\nfunc (k *Key) GetReadOnly() bool {\n\tif k == nil || k.ReadOnly == nil {\n\t\treturn false\n\t}\n\treturn *k.ReadOnly\n}\n\n// GetTitle returns the Title field if it's non-nil, zero value otherwise.\nfunc (k *Key) GetTitle() string {\n\tif k == nil || k.Title == nil {\n\t\treturn \"\"\n\t}\n\treturn *k.Title\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (k *Key) GetURL() string {\n\tif k == nil || k.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *k.URL\n}\n\n// GetVerified returns the Verified field if it's non-nil, zero value otherwise.\nfunc (k *Key) GetVerified() bool {\n\tif k == nil || k.Verified == nil {\n\t\treturn false\n\t}\n\treturn *k.Verified\n}\n\n// GetColor returns the Color field if it's non-nil, zero value otherwise.\nfunc (l *Label) GetColor() string {\n\tif l == nil || l.Color == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Color\n}\n\n// GetDefault returns the Default field if it's non-nil, zero value otherwise.\nfunc (l *Label) GetDefault() bool {\n\tif l == nil || l.Default == nil {\n\t\treturn false\n\t}\n\treturn *l.Default\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (l *Label) GetDescription() string {\n\tif l == nil || l.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Description\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (l *Label) GetID() int64 {\n\tif l == nil || l.ID == nil {\n\t\treturn 0\n\t}\n\treturn *l.ID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (l *Label) GetName() string {\n\tif l == nil || l.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Name\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (l *Label) GetNodeID() string {\n\tif l == nil || l.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.NodeID\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (l *Label) GetURL() string {\n\tif l == nil || l.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.URL\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (l *LabelEvent) GetAction() string {\n\tif l == nil || l.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Action\n}\n\n// GetChanges returns the Changes field.\nfunc (l *LabelEvent) GetChanges() *EditChange {\n\tif l == nil {\n\t\treturn nil\n\t}\n\treturn l.Changes\n}\n\n// GetInstallation returns the Installation field.\nfunc (l *LabelEvent) GetInstallation() *Installation {\n\tif l == nil {\n\t\treturn nil\n\t}\n\treturn l.Installation\n}\n\n// GetLabel returns the Label field.\nfunc (l *LabelEvent) GetLabel() *Label {\n\tif l == nil {\n\t\treturn nil\n\t}\n\treturn l.Label\n}\n\n// GetOrg returns the Org field.\nfunc (l *LabelEvent) GetOrg() *Organization {\n\tif l == nil {\n\t\treturn nil\n\t}\n\treturn l.Org\n}\n\n// GetRepo returns the Repo field.\nfunc (l *LabelEvent) GetRepo() *Repository {\n\tif l == nil {\n\t\treturn nil\n\t}\n\treturn l.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (l *LabelEvent) GetSender() *User {\n\tif l == nil {\n\t\treturn nil\n\t}\n\treturn l.Sender\n}\n\n// GetColor returns the Color field if it's non-nil, zero value otherwise.\nfunc (l *LabelResult) GetColor() string {\n\tif l == nil || l.Color == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Color\n}\n\n// GetDefault returns the Default field if it's non-nil, zero value otherwise.\nfunc (l *LabelResult) GetDefault() bool {\n\tif l == nil || l.Default == nil {\n\t\treturn false\n\t}\n\treturn *l.Default\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (l *LabelResult) GetDescription() string {\n\tif l == nil || l.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Description\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (l *LabelResult) GetID() int64 {\n\tif l == nil || l.ID == nil {\n\t\treturn 0\n\t}\n\treturn *l.ID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (l *LabelResult) GetName() string {\n\tif l == nil || l.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Name\n}\n\n// GetScore returns the Score field if it's non-nil, zero value otherwise.\nfunc (l *LabelResult) GetScore() float64 {\n\tif l == nil || l.Score == nil {\n\t\treturn 0\n\t}\n\treturn *l.Score\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (l *LabelResult) GetURL() string {\n\tif l == nil || l.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.URL\n}\n\n// GetIncompleteResults returns the IncompleteResults field if it's non-nil, zero value otherwise.\nfunc (l *LabelsSearchResult) GetIncompleteResults() bool {\n\tif l == nil || l.IncompleteResults == nil {\n\t\treturn false\n\t}\n\treturn *l.IncompleteResults\n}\n\n// GetLabels returns the Labels slice if it's non-nil, nil otherwise.\nfunc (l *LabelsSearchResult) GetLabels() []*LabelResult {\n\tif l == nil || l.Labels == nil {\n\t\treturn nil\n\t}\n\treturn l.Labels\n}\n\n// GetTotal returns the Total field if it's non-nil, zero value otherwise.\nfunc (l *LabelsSearchResult) GetTotal() int {\n\tif l == nil || l.Total == nil {\n\t\treturn 0\n\t}\n\treturn *l.Total\n}\n\n// GetOID returns the OID field if it's non-nil, zero value otherwise.\nfunc (l *LargeFile) GetOID() string {\n\tif l == nil || l.OID == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.OID\n}\n\n// GetPath returns the Path field if it's non-nil, zero value otherwise.\nfunc (l *LargeFile) GetPath() string {\n\tif l == nil || l.Path == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Path\n}\n\n// GetRefName returns the RefName field if it's non-nil, zero value otherwise.\nfunc (l *LargeFile) GetRefName() string {\n\tif l == nil || l.RefName == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.RefName\n}\n\n// GetSize returns the Size field if it's non-nil, zero value otherwise.\nfunc (l *LargeFile) GetSize() int {\n\tif l == nil || l.Size == nil {\n\t\treturn 0\n\t}\n\treturn *l.Size\n}\n\n// GetProperties returns the Properties field.\nfunc (l *LastLicenseSync) GetProperties() *LastLicenseSyncProperties {\n\tif l == nil {\n\t\treturn nil\n\t}\n\treturn l.Properties\n}\n\n// GetType returns the Type field.\nfunc (l *LastLicenseSync) GetType() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Type\n}\n\n// GetDate returns the Date field if it's non-nil, zero value otherwise.\nfunc (l *LastLicenseSyncProperties) GetDate() Timestamp {\n\tif l == nil || l.Date == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *l.Date\n}\n\n// GetError returns the Error field.\nfunc (l *LastLicenseSyncProperties) GetError() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Error\n}\n\n// GetStatus returns the Status field.\nfunc (l *LastLicenseSyncProperties) GetStatus() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Status\n}\n\n// GetBody returns the Body field if it's non-nil, zero value otherwise.\nfunc (l *License) GetBody() string {\n\tif l == nil || l.Body == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Body\n}\n\n// GetConditions returns the Conditions field if it's non-nil, zero value otherwise.\nfunc (l *License) GetConditions() []string {\n\tif l == nil || l.Conditions == nil {\n\t\treturn nil\n\t}\n\treturn *l.Conditions\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (l *License) GetDescription() string {\n\tif l == nil || l.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Description\n}\n\n// GetFeatured returns the Featured field if it's non-nil, zero value otherwise.\nfunc (l *License) GetFeatured() bool {\n\tif l == nil || l.Featured == nil {\n\t\treturn false\n\t}\n\treturn *l.Featured\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (l *License) GetHTMLURL() string {\n\tif l == nil || l.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.HTMLURL\n}\n\n// GetImplementation returns the Implementation field if it's non-nil, zero value otherwise.\nfunc (l *License) GetImplementation() string {\n\tif l == nil || l.Implementation == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Implementation\n}\n\n// GetKey returns the Key field if it's non-nil, zero value otherwise.\nfunc (l *License) GetKey() string {\n\tif l == nil || l.Key == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Key\n}\n\n// GetLimitations returns the Limitations field if it's non-nil, zero value otherwise.\nfunc (l *License) GetLimitations() []string {\n\tif l == nil || l.Limitations == nil {\n\t\treturn nil\n\t}\n\treturn *l.Limitations\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (l *License) GetName() string {\n\tif l == nil || l.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Name\n}\n\n// GetPermissions returns the Permissions field if it's non-nil, zero value otherwise.\nfunc (l *License) GetPermissions() []string {\n\tif l == nil || l.Permissions == nil {\n\t\treturn nil\n\t}\n\treturn *l.Permissions\n}\n\n// GetSPDXID returns the SPDXID field if it's non-nil, zero value otherwise.\nfunc (l *License) GetSPDXID() string {\n\tif l == nil || l.SPDXID == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.SPDXID\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (l *License) GetURL() string {\n\tif l == nil || l.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.URL\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (l *LicenseCheck) GetStatus() string {\n\tif l == nil || l.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Status\n}\n\n// GetAdvancedSecurityEnabled returns the AdvancedSecurityEnabled field if it's non-nil, zero value otherwise.\nfunc (l *LicenseStatus) GetAdvancedSecurityEnabled() bool {\n\tif l == nil || l.AdvancedSecurityEnabled == nil {\n\t\treturn false\n\t}\n\treturn *l.AdvancedSecurityEnabled\n}\n\n// GetAdvancedSecuritySeats returns the AdvancedSecuritySeats field if it's non-nil, zero value otherwise.\nfunc (l *LicenseStatus) GetAdvancedSecuritySeats() int {\n\tif l == nil || l.AdvancedSecuritySeats == nil {\n\t\treturn 0\n\t}\n\treturn *l.AdvancedSecuritySeats\n}\n\n// GetClusterSupport returns the ClusterSupport field if it's non-nil, zero value otherwise.\nfunc (l *LicenseStatus) GetClusterSupport() bool {\n\tif l == nil || l.ClusterSupport == nil {\n\t\treturn false\n\t}\n\treturn *l.ClusterSupport\n}\n\n// GetCompany returns the Company field if it's non-nil, zero value otherwise.\nfunc (l *LicenseStatus) GetCompany() string {\n\tif l == nil || l.Company == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Company\n}\n\n// GetCroquetSupport returns the CroquetSupport field if it's non-nil, zero value otherwise.\nfunc (l *LicenseStatus) GetCroquetSupport() bool {\n\tif l == nil || l.CroquetSupport == nil {\n\t\treturn false\n\t}\n\treturn *l.CroquetSupport\n}\n\n// GetCustomTerms returns the CustomTerms field if it's non-nil, zero value otherwise.\nfunc (l *LicenseStatus) GetCustomTerms() bool {\n\tif l == nil || l.CustomTerms == nil {\n\t\treturn false\n\t}\n\treturn *l.CustomTerms\n}\n\n// GetEvaluation returns the Evaluation field if it's non-nil, zero value otherwise.\nfunc (l *LicenseStatus) GetEvaluation() bool {\n\tif l == nil || l.Evaluation == nil {\n\t\treturn false\n\t}\n\treturn *l.Evaluation\n}\n\n// GetExpireAt returns the ExpireAt field if it's non-nil, zero value otherwise.\nfunc (l *LicenseStatus) GetExpireAt() Timestamp {\n\tif l == nil || l.ExpireAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *l.ExpireAt\n}\n\n// GetInsightsEnabled returns the InsightsEnabled field if it's non-nil, zero value otherwise.\nfunc (l *LicenseStatus) GetInsightsEnabled() bool {\n\tif l == nil || l.InsightsEnabled == nil {\n\t\treturn false\n\t}\n\treturn *l.InsightsEnabled\n}\n\n// GetInsightsExpireAt returns the InsightsExpireAt field if it's non-nil, zero value otherwise.\nfunc (l *LicenseStatus) GetInsightsExpireAt() Timestamp {\n\tif l == nil || l.InsightsExpireAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *l.InsightsExpireAt\n}\n\n// GetLearningLabEvaluationExpires returns the LearningLabEvaluationExpires field if it's non-nil, zero value otherwise.\nfunc (l *LicenseStatus) GetLearningLabEvaluationExpires() Timestamp {\n\tif l == nil || l.LearningLabEvaluationExpires == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *l.LearningLabEvaluationExpires\n}\n\n// GetLearningLabSeats returns the LearningLabSeats field if it's non-nil, zero value otherwise.\nfunc (l *LicenseStatus) GetLearningLabSeats() int {\n\tif l == nil || l.LearningLabSeats == nil {\n\t\treturn 0\n\t}\n\treturn *l.LearningLabSeats\n}\n\n// GetPerpetual returns the Perpetual field if it's non-nil, zero value otherwise.\nfunc (l *LicenseStatus) GetPerpetual() bool {\n\tif l == nil || l.Perpetual == nil {\n\t\treturn false\n\t}\n\treturn *l.Perpetual\n}\n\n// GetReferenceNumber returns the ReferenceNumber field if it's non-nil, zero value otherwise.\nfunc (l *LicenseStatus) GetReferenceNumber() string {\n\tif l == nil || l.ReferenceNumber == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.ReferenceNumber\n}\n\n// GetSeats returns the Seats field if it's non-nil, zero value otherwise.\nfunc (l *LicenseStatus) GetSeats() int {\n\tif l == nil || l.Seats == nil {\n\t\treturn 0\n\t}\n\treturn *l.Seats\n}\n\n// GetSSHAllowed returns the SSHAllowed field if it's non-nil, zero value otherwise.\nfunc (l *LicenseStatus) GetSSHAllowed() bool {\n\tif l == nil || l.SSHAllowed == nil {\n\t\treturn false\n\t}\n\treturn *l.SSHAllowed\n}\n\n// GetSupportKey returns the SupportKey field if it's non-nil, zero value otherwise.\nfunc (l *LicenseStatus) GetSupportKey() string {\n\tif l == nil || l.SupportKey == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.SupportKey\n}\n\n// GetUnlimitedSeating returns the UnlimitedSeating field if it's non-nil, zero value otherwise.\nfunc (l *LicenseStatus) GetUnlimitedSeating() bool {\n\tif l == nil || l.UnlimitedSeating == nil {\n\t\treturn false\n\t}\n\treturn *l.UnlimitedSeating\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (l *LinearHistoryRequirementEnforcementLevelChanges) GetFrom() string {\n\tif l == nil || l.From == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.From\n}\n\n// GetDirection returns the Direction field if it's non-nil, zero value otherwise.\nfunc (l *ListAlertsOptions) GetDirection() string {\n\tif l == nil || l.Direction == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Direction\n}\n\n// GetEcosystem returns the Ecosystem field if it's non-nil, zero value otherwise.\nfunc (l *ListAlertsOptions) GetEcosystem() string {\n\tif l == nil || l.Ecosystem == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Ecosystem\n}\n\n// GetPackage returns the Package field if it's non-nil, zero value otherwise.\nfunc (l *ListAlertsOptions) GetPackage() string {\n\tif l == nil || l.Package == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Package\n}\n\n// GetScope returns the Scope field if it's non-nil, zero value otherwise.\nfunc (l *ListAlertsOptions) GetScope() string {\n\tif l == nil || l.Scope == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Scope\n}\n\n// GetSeverity returns the Severity field if it's non-nil, zero value otherwise.\nfunc (l *ListAlertsOptions) GetSeverity() string {\n\tif l == nil || l.Severity == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Severity\n}\n\n// GetSort returns the Sort field if it's non-nil, zero value otherwise.\nfunc (l *ListAlertsOptions) GetSort() string {\n\tif l == nil || l.Sort == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Sort\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (l *ListAlertsOptions) GetState() string {\n\tif l == nil || l.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.State\n}\n\n// GetCollab returns the Collab field.\nfunc (l *ListAllIssuesOptions) GetCollab() bool {\n\tif l == nil {\n\t\treturn false\n\t}\n\treturn l.Collab\n}\n\n// GetDirection returns the Direction field.\nfunc (l *ListAllIssuesOptions) GetDirection() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Direction\n}\n\n// GetFilter returns the Filter field.\nfunc (l *ListAllIssuesOptions) GetFilter() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Filter\n}\n\n// GetLabels returns the Labels slice if it's non-nil, nil otherwise.\nfunc (l *ListAllIssuesOptions) GetLabels() []string {\n\tif l == nil || l.Labels == nil {\n\t\treturn nil\n\t}\n\treturn l.Labels\n}\n\n// GetOrgs returns the Orgs field.\nfunc (l *ListAllIssuesOptions) GetOrgs() bool {\n\tif l == nil {\n\t\treturn false\n\t}\n\treturn l.Orgs\n}\n\n// GetOwned returns the Owned field.\nfunc (l *ListAllIssuesOptions) GetOwned() bool {\n\tif l == nil {\n\t\treturn false\n\t}\n\treturn l.Owned\n}\n\n// GetPulls returns the Pulls field.\nfunc (l *ListAllIssuesOptions) GetPulls() bool {\n\tif l == nil {\n\t\treturn false\n\t}\n\treturn l.Pulls\n}\n\n// GetSince returns the Since field.\nfunc (l *ListAllIssuesOptions) GetSince() time.Time {\n\tif l == nil {\n\t\treturn time.Time{}\n\t}\n\treturn l.Since\n}\n\n// GetSort returns the Sort field.\nfunc (l *ListAllIssuesOptions) GetSort() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Sort\n}\n\n// GetState returns the State field.\nfunc (l *ListAllIssuesOptions) GetState() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.State\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (l *ListArtifactsOptions) GetName() string {\n\tif l == nil || l.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Name\n}\n\n// GetAppID returns the AppID field if it's non-nil, zero value otherwise.\nfunc (l *ListCheckRunsOptions) GetAppID() int64 {\n\tif l == nil || l.AppID == nil {\n\t\treturn 0\n\t}\n\treturn *l.AppID\n}\n\n// GetCheckName returns the CheckName field if it's non-nil, zero value otherwise.\nfunc (l *ListCheckRunsOptions) GetCheckName() string {\n\tif l == nil || l.CheckName == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.CheckName\n}\n\n// GetFilter returns the Filter field if it's non-nil, zero value otherwise.\nfunc (l *ListCheckRunsOptions) GetFilter() string {\n\tif l == nil || l.Filter == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Filter\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (l *ListCheckRunsOptions) GetStatus() string {\n\tif l == nil || l.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Status\n}\n\n// GetCheckRuns returns the CheckRuns slice if it's non-nil, nil otherwise.\nfunc (l *ListCheckRunsResults) GetCheckRuns() []*CheckRun {\n\tif l == nil || l.CheckRuns == nil {\n\t\treturn nil\n\t}\n\treturn l.CheckRuns\n}\n\n// GetTotal returns the Total field if it's non-nil, zero value otherwise.\nfunc (l *ListCheckRunsResults) GetTotal() int {\n\tif l == nil || l.Total == nil {\n\t\treturn 0\n\t}\n\treturn *l.Total\n}\n\n// GetAppID returns the AppID field if it's non-nil, zero value otherwise.\nfunc (l *ListCheckSuiteOptions) GetAppID() int64 {\n\tif l == nil || l.AppID == nil {\n\t\treturn 0\n\t}\n\treturn *l.AppID\n}\n\n// GetCheckName returns the CheckName field if it's non-nil, zero value otherwise.\nfunc (l *ListCheckSuiteOptions) GetCheckName() string {\n\tif l == nil || l.CheckName == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.CheckName\n}\n\n// GetCheckSuites returns the CheckSuites slice if it's non-nil, nil otherwise.\nfunc (l *ListCheckSuiteResults) GetCheckSuites() []*CheckSuite {\n\tif l == nil || l.CheckSuites == nil {\n\t\treturn nil\n\t}\n\treturn l.CheckSuites\n}\n\n// GetTotal returns the Total field if it's non-nil, zero value otherwise.\nfunc (l *ListCheckSuiteResults) GetTotal() int {\n\tif l == nil || l.Total == nil {\n\t\treturn 0\n\t}\n\treturn *l.Total\n}\n\n// GetAfter returns the After field.\nfunc (l *ListCodeSecurityConfigurationRepositoriesOptions) GetAfter() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.After\n}\n\n// GetBefore returns the Before field.\nfunc (l *ListCodeSecurityConfigurationRepositoriesOptions) GetBefore() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Before\n}\n\n// GetPerPage returns the PerPage field.\nfunc (l *ListCodeSecurityConfigurationRepositoriesOptions) GetPerPage() int {\n\tif l == nil {\n\t\treturn 0\n\t}\n\treturn l.PerPage\n}\n\n// GetStatus returns the Status field.\nfunc (l *ListCodeSecurityConfigurationRepositoriesOptions) GetStatus() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Status\n}\n\n// GetCodespaces returns the Codespaces slice if it's non-nil, nil otherwise.\nfunc (l *ListCodespaces) GetCodespaces() []*Codespace {\n\tif l == nil || l.Codespaces == nil {\n\t\treturn nil\n\t}\n\treturn l.Codespaces\n}\n\n// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.\nfunc (l *ListCodespaces) GetTotalCount() int {\n\tif l == nil || l.TotalCount == nil {\n\t\treturn 0\n\t}\n\treturn *l.TotalCount\n}\n\n// GetRepositoryID returns the RepositoryID field.\nfunc (l *ListCodespacesOptions) GetRepositoryID() int64 {\n\tif l == nil {\n\t\treturn 0\n\t}\n\treturn l.RepositoryID\n}\n\n// GetAffiliation returns the Affiliation field.\nfunc (l *ListCollaboratorsOptions) GetAffiliation() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Affiliation\n}\n\n// GetPermission returns the Permission field.\nfunc (l *ListCollaboratorsOptions) GetPermission() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Permission\n}\n\n// GetAnon returns the Anon field.\nfunc (l *ListContributorsOptions) GetAnon() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Anon\n}\n\n// GetSeats returns the Seats slice if it's non-nil, nil otherwise.\nfunc (l *ListCopilotSeatsResponse) GetSeats() []*CopilotSeatDetails {\n\tif l == nil || l.Seats == nil {\n\t\treturn nil\n\t}\n\treturn l.Seats\n}\n\n// GetTotalSeats returns the TotalSeats field.\nfunc (l *ListCopilotSeatsResponse) GetTotalSeats() int64 {\n\tif l == nil {\n\t\treturn 0\n\t}\n\treturn l.TotalSeats\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (l *ListCostCenterOptions) GetState() string {\n\tif l == nil || l.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.State\n}\n\n// GetAfter returns the After field.\nfunc (l *ListCursorOptions) GetAfter() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.After\n}\n\n// GetBefore returns the Before field.\nfunc (l *ListCursorOptions) GetBefore() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Before\n}\n\n// GetCursor returns the Cursor field.\nfunc (l *ListCursorOptions) GetCursor() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Cursor\n}\n\n// GetFirst returns the First field.\nfunc (l *ListCursorOptions) GetFirst() int {\n\tif l == nil {\n\t\treturn 0\n\t}\n\treturn l.First\n}\n\n// GetLast returns the Last field.\nfunc (l *ListCursorOptions) GetLast() int {\n\tif l == nil {\n\t\treturn 0\n\t}\n\treturn l.Last\n}\n\n// GetPage returns the Page field.\nfunc (l *ListCursorOptions) GetPage() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Page\n}\n\n// GetPerPage returns the PerPage field.\nfunc (l *ListCursorOptions) GetPerPage() int {\n\tif l == nil {\n\t\treturn 0\n\t}\n\treturn l.PerPage\n}\n\n// GetAvailableIntegrations returns the AvailableIntegrations slice if it's non-nil, nil otherwise.\nfunc (l *ListCustomDeploymentRuleIntegrationsResponse) GetAvailableIntegrations() []*CustomDeploymentProtectionRuleApp {\n\tif l == nil || l.AvailableIntegrations == nil {\n\t\treturn nil\n\t}\n\treturn l.AvailableIntegrations\n}\n\n// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.\nfunc (l *ListCustomDeploymentRuleIntegrationsResponse) GetTotalCount() int {\n\tif l == nil || l.TotalCount == nil {\n\t\treturn 0\n\t}\n\treturn *l.TotalCount\n}\n\n// GetRepositoryQuery returns the RepositoryQuery field.\nfunc (l *ListCustomPropertyValuesOptions) GetRepositoryQuery() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.RepositoryQuery\n}\n\n// GetProtectionRules returns the ProtectionRules slice if it's non-nil, nil otherwise.\nfunc (l *ListDeploymentProtectionRuleResponse) GetProtectionRules() []*CustomDeploymentProtectionRule {\n\tif l == nil || l.ProtectionRules == nil {\n\t\treturn nil\n\t}\n\treturn l.ProtectionRules\n}\n\n// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.\nfunc (l *ListDeploymentProtectionRuleResponse) GetTotalCount() int {\n\tif l == nil || l.TotalCount == nil {\n\t\treturn 0\n\t}\n\treturn *l.TotalCount\n}\n\n// GetAfter returns the After field.\nfunc (l *ListEnterpriseCodeSecurityConfigurationOptions) GetAfter() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.After\n}\n\n// GetBefore returns the Before field.\nfunc (l *ListEnterpriseCodeSecurityConfigurationOptions) GetBefore() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Before\n}\n\n// GetPerPage returns the PerPage field.\nfunc (l *ListEnterpriseCodeSecurityConfigurationOptions) GetPerPage() int {\n\tif l == nil {\n\t\treturn 0\n\t}\n\treturn l.PerPage\n}\n\n// GetVisibleToOrganization returns the VisibleToOrganization field.\nfunc (l *ListEnterpriseRunnerGroupOptions) GetVisibleToOrganization() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.VisibleToOrganization\n}\n\n// GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise.\nfunc (l *ListExternalGroupsOptions) GetDisplayName() string {\n\tif l == nil || l.DisplayName == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.DisplayName\n}\n\n// GetDirection returns the Direction field.\nfunc (l *ListFineGrainedPATOptions) GetDirection() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Direction\n}\n\n// GetLastUsedAfter returns the LastUsedAfter field.\nfunc (l *ListFineGrainedPATOptions) GetLastUsedAfter() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.LastUsedAfter\n}\n\n// GetLastUsedBefore returns the LastUsedBefore field.\nfunc (l *ListFineGrainedPATOptions) GetLastUsedBefore() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.LastUsedBefore\n}\n\n// GetOwner returns the Owner slice if it's non-nil, nil otherwise.\nfunc (l *ListFineGrainedPATOptions) GetOwner() []string {\n\tif l == nil || l.Owner == nil {\n\t\treturn nil\n\t}\n\treturn l.Owner\n}\n\n// GetPermission returns the Permission field.\nfunc (l *ListFineGrainedPATOptions) GetPermission() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Permission\n}\n\n// GetRepository returns the Repository field.\nfunc (l *ListFineGrainedPATOptions) GetRepository() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Repository\n}\n\n// GetSort returns the Sort field.\nfunc (l *ListFineGrainedPATOptions) GetSort() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Sort\n}\n\n// GetTokenID returns the TokenID slice if it's non-nil, nil otherwise.\nfunc (l *ListFineGrainedPATOptions) GetTokenID() []int64 {\n\tif l == nil || l.TokenID == nil {\n\t\treturn nil\n\t}\n\treturn l.TokenID\n}\n\n// GetAffects returns the Affects field if it's non-nil, zero value otherwise.\nfunc (l *ListGlobalSecurityAdvisoriesOptions) GetAffects() string {\n\tif l == nil || l.Affects == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Affects\n}\n\n// GetCVEID returns the CVEID field if it's non-nil, zero value otherwise.\nfunc (l *ListGlobalSecurityAdvisoriesOptions) GetCVEID() string {\n\tif l == nil || l.CVEID == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.CVEID\n}\n\n// GetCWEs returns the CWEs slice if it's non-nil, nil otherwise.\nfunc (l *ListGlobalSecurityAdvisoriesOptions) GetCWEs() []string {\n\tif l == nil || l.CWEs == nil {\n\t\treturn nil\n\t}\n\treturn l.CWEs\n}\n\n// GetEcosystem returns the Ecosystem field if it's non-nil, zero value otherwise.\nfunc (l *ListGlobalSecurityAdvisoriesOptions) GetEcosystem() string {\n\tif l == nil || l.Ecosystem == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Ecosystem\n}\n\n// GetGHSAID returns the GHSAID field if it's non-nil, zero value otherwise.\nfunc (l *ListGlobalSecurityAdvisoriesOptions) GetGHSAID() string {\n\tif l == nil || l.GHSAID == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.GHSAID\n}\n\n// GetIsWithdrawn returns the IsWithdrawn field if it's non-nil, zero value otherwise.\nfunc (l *ListGlobalSecurityAdvisoriesOptions) GetIsWithdrawn() bool {\n\tif l == nil || l.IsWithdrawn == nil {\n\t\treturn false\n\t}\n\treturn *l.IsWithdrawn\n}\n\n// GetModified returns the Modified field if it's non-nil, zero value otherwise.\nfunc (l *ListGlobalSecurityAdvisoriesOptions) GetModified() string {\n\tif l == nil || l.Modified == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Modified\n}\n\n// GetPublished returns the Published field if it's non-nil, zero value otherwise.\nfunc (l *ListGlobalSecurityAdvisoriesOptions) GetPublished() string {\n\tif l == nil || l.Published == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Published\n}\n\n// GetSeverity returns the Severity field if it's non-nil, zero value otherwise.\nfunc (l *ListGlobalSecurityAdvisoriesOptions) GetSeverity() string {\n\tif l == nil || l.Severity == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Severity\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (l *ListGlobalSecurityAdvisoriesOptions) GetType() string {\n\tif l == nil || l.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Type\n}\n\n// GetUpdated returns the Updated field if it's non-nil, zero value otherwise.\nfunc (l *ListGlobalSecurityAdvisoriesOptions) GetUpdated() string {\n\tif l == nil || l.Updated == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Updated\n}\n\n// GetQuery returns the Query field.\nfunc (l *ListIDPGroupsOptions) GetQuery() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Query\n}\n\n// GetFeatured returns the Featured field if it's non-nil, zero value otherwise.\nfunc (l *ListLicensesOptions) GetFeatured() bool {\n\tif l == nil || l.Featured == nil {\n\t\treturn false\n\t}\n\treturn *l.Featured\n}\n\n// GetFilter returns the Filter field.\nfunc (l *ListMembersOptions) GetFilter() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Filter\n}\n\n// GetPublicOnly returns the PublicOnly field.\nfunc (l *ListMembersOptions) GetPublicOnly() bool {\n\tif l == nil {\n\t\treturn false\n\t}\n\treturn l.PublicOnly\n}\n\n// GetRole returns the Role field.\nfunc (l *ListMembersOptions) GetRole() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Role\n}\n\n// GetPage returns the Page field.\nfunc (l *ListOptions) GetPage() int {\n\tif l == nil {\n\t\treturn 0\n\t}\n\treturn l.Page\n}\n\n// GetPerPage returns the PerPage field.\nfunc (l *ListOptions) GetPerPage() int {\n\tif l == nil {\n\t\treturn 0\n\t}\n\treturn l.PerPage\n}\n\n// GetOrganizations returns the Organizations slice if it's non-nil, nil otherwise.\nfunc (l *ListOrganizations) GetOrganizations() []*Organization {\n\tif l == nil || l.Organizations == nil {\n\t\treturn nil\n\t}\n\treturn l.Organizations\n}\n\n// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.\nfunc (l *ListOrganizations) GetTotalCount() int {\n\tif l == nil || l.TotalCount == nil {\n\t\treturn 0\n\t}\n\treturn *l.TotalCount\n}\n\n// GetAfter returns the After field.\nfunc (l *ListOrgCodeSecurityConfigurationOptions) GetAfter() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.After\n}\n\n// GetBefore returns the Before field.\nfunc (l *ListOrgCodeSecurityConfigurationOptions) GetBefore() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Before\n}\n\n// GetPerPage returns the PerPage field.\nfunc (l *ListOrgCodeSecurityConfigurationOptions) GetPerPage() int {\n\tif l == nil {\n\t\treturn 0\n\t}\n\treturn l.PerPage\n}\n\n// GetTargetType returns the TargetType field.\nfunc (l *ListOrgCodeSecurityConfigurationOptions) GetTargetType() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.TargetType\n}\n\n// GetState returns the State field.\nfunc (l *ListOrgMembershipsOptions) GetState() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.State\n}\n\n// GetVisibleToRepository returns the VisibleToRepository field.\nfunc (l *ListOrgRunnerGroupOptions) GetVisibleToRepository() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.VisibleToRepository\n}\n\n// GetFilter returns the Filter field.\nfunc (l *ListOutsideCollaboratorsOptions) GetFilter() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Filter\n}\n\n// GetState returns the State field.\nfunc (l *ListPackageVersionsOptions) GetState() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.State\n}\n\n// GetFields returns the Fields slice if it's non-nil, nil otherwise.\nfunc (l *ListProjectItemsOptions) GetFields() []int64 {\n\tif l == nil || l.Fields == nil {\n\t\treturn nil\n\t}\n\treturn l.Fields\n}\n\n// GetQuery returns the Query field.\nfunc (l *ListProjectsOptions) GetQuery() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Query\n}\n\n// GetAfter returns the After field.\nfunc (l *ListProjectsPaginationOptions) GetAfter() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.After\n}\n\n// GetBefore returns the Before field.\nfunc (l *ListProjectsPaginationOptions) GetBefore() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Before\n}\n\n// GetPerPage returns the PerPage field.\nfunc (l *ListProjectsPaginationOptions) GetPerPage() int {\n\tif l == nil {\n\t\treturn 0\n\t}\n\treturn l.PerPage\n}\n\n// GetCount returns the Count field if it's non-nil, zero value otherwise.\nfunc (l *ListProvisionedSCIMGroupsEnterpriseOptions) GetCount() int {\n\tif l == nil || l.Count == nil {\n\t\treturn 0\n\t}\n\treturn *l.Count\n}\n\n// GetExcludedAttributes returns the ExcludedAttributes field if it's non-nil, zero value otherwise.\nfunc (l *ListProvisionedSCIMGroupsEnterpriseOptions) GetExcludedAttributes() string {\n\tif l == nil || l.ExcludedAttributes == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.ExcludedAttributes\n}\n\n// GetFilter returns the Filter field if it's non-nil, zero value otherwise.\nfunc (l *ListProvisionedSCIMGroupsEnterpriseOptions) GetFilter() string {\n\tif l == nil || l.Filter == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Filter\n}\n\n// GetStartIndex returns the StartIndex field if it's non-nil, zero value otherwise.\nfunc (l *ListProvisionedSCIMGroupsEnterpriseOptions) GetStartIndex() int {\n\tif l == nil || l.StartIndex == nil {\n\t\treturn 0\n\t}\n\treturn *l.StartIndex\n}\n\n// GetCount returns the Count field if it's non-nil, zero value otherwise.\nfunc (l *ListProvisionedSCIMUsersEnterpriseOptions) GetCount() int {\n\tif l == nil || l.Count == nil {\n\t\treturn 0\n\t}\n\treturn *l.Count\n}\n\n// GetFilter returns the Filter field if it's non-nil, zero value otherwise.\nfunc (l *ListProvisionedSCIMUsersEnterpriseOptions) GetFilter() string {\n\tif l == nil || l.Filter == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Filter\n}\n\n// GetStartIndex returns the StartIndex field if it's non-nil, zero value otherwise.\nfunc (l *ListProvisionedSCIMUsersEnterpriseOptions) GetStartIndex() int {\n\tif l == nil || l.StartIndex == nil {\n\t\treturn 0\n\t}\n\treturn *l.StartIndex\n}\n\n// GetContent returns the Content field.\nfunc (l *ListReactionOptions) GetContent() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Content\n}\n\n// GetClientIP returns the ClientIP field if it's non-nil, zero value otherwise.\nfunc (l *ListRepoMachineTypesOptions) GetClientIP() string {\n\tif l == nil || l.ClientIP == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.ClientIP\n}\n\n// GetLocation returns the Location field if it's non-nil, zero value otherwise.\nfunc (l *ListRepoMachineTypesOptions) GetLocation() string {\n\tif l == nil || l.Location == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Location\n}\n\n// GetRef returns the Ref field if it's non-nil, zero value otherwise.\nfunc (l *ListRepoMachineTypesOptions) GetRef() string {\n\tif l == nil || l.Ref == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Ref\n}\n\n// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise.\nfunc (l *ListRepositories) GetRepositories() []*Repository {\n\tif l == nil || l.Repositories == nil {\n\t\treturn nil\n\t}\n\treturn l.Repositories\n}\n\n// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.\nfunc (l *ListRepositories) GetTotalCount() int {\n\tif l == nil || l.TotalCount == nil {\n\t\treturn 0\n\t}\n\treturn *l.TotalCount\n}\n\n// GetActivityType returns the ActivityType field.\nfunc (l *ListRepositoryActivityOptions) GetActivityType() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.ActivityType\n}\n\n// GetActor returns the Actor field.\nfunc (l *ListRepositoryActivityOptions) GetActor() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Actor\n}\n\n// GetAfter returns the After field.\nfunc (l *ListRepositoryActivityOptions) GetAfter() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.After\n}\n\n// GetBefore returns the Before field.\nfunc (l *ListRepositoryActivityOptions) GetBefore() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Before\n}\n\n// GetDirection returns the Direction field.\nfunc (l *ListRepositoryActivityOptions) GetDirection() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Direction\n}\n\n// GetPerPage returns the PerPage field.\nfunc (l *ListRepositoryActivityOptions) GetPerPage() int {\n\tif l == nil {\n\t\treturn 0\n\t}\n\treturn l.PerPage\n}\n\n// GetRef returns the Ref field.\nfunc (l *ListRepositoryActivityOptions) GetRef() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Ref\n}\n\n// GetTimePeriod returns the TimePeriod field.\nfunc (l *ListRepositoryActivityOptions) GetTimePeriod() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.TimePeriod\n}\n\n// GetDirection returns the Direction field.\nfunc (l *ListRepositorySecurityAdvisoriesOptions) GetDirection() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Direction\n}\n\n// GetSort returns the Sort field.\nfunc (l *ListRepositorySecurityAdvisoriesOptions) GetSort() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Sort\n}\n\n// GetState returns the State field.\nfunc (l *ListRepositorySecurityAdvisoriesOptions) GetState() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.State\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (l *ListRunnersOptions) GetName() string {\n\tif l == nil || l.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Name\n}\n\n// GetCount returns the Count field if it's non-nil, zero value otherwise.\nfunc (l *ListSCIMProvisionedIdentitiesOptions) GetCount() int {\n\tif l == nil || l.Count == nil {\n\t\treturn 0\n\t}\n\treturn *l.Count\n}\n\n// GetFilter returns the Filter field if it's non-nil, zero value otherwise.\nfunc (l *ListSCIMProvisionedIdentitiesOptions) GetFilter() string {\n\tif l == nil || l.Filter == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Filter\n}\n\n// GetStartIndex returns the StartIndex field if it's non-nil, zero value otherwise.\nfunc (l *ListSCIMProvisionedIdentitiesOptions) GetStartIndex() int {\n\tif l == nil || l.StartIndex == nil {\n\t\treturn 0\n\t}\n\treturn *l.StartIndex\n}\n\n// GetDirection returns the Direction field.\nfunc (l *ListUserIssuesOptions) GetDirection() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Direction\n}\n\n// GetFilter returns the Filter field.\nfunc (l *ListUserIssuesOptions) GetFilter() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Filter\n}\n\n// GetLabels returns the Labels slice if it's non-nil, nil otherwise.\nfunc (l *ListUserIssuesOptions) GetLabels() []string {\n\tif l == nil || l.Labels == nil {\n\t\treturn nil\n\t}\n\treturn l.Labels\n}\n\n// GetSince returns the Since field.\nfunc (l *ListUserIssuesOptions) GetSince() time.Time {\n\tif l == nil {\n\t\treturn time.Time{}\n\t}\n\treturn l.Since\n}\n\n// GetSort returns the Sort field.\nfunc (l *ListUserIssuesOptions) GetSort() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Sort\n}\n\n// GetState returns the State field.\nfunc (l *ListUserIssuesOptions) GetState() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.State\n}\n\n// GetFilter returns the Filter field.\nfunc (l *ListWorkflowJobsOptions) GetFilter() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Filter\n}\n\n// GetActor returns the Actor field.\nfunc (l *ListWorkflowRunsOptions) GetActor() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Actor\n}\n\n// GetBranch returns the Branch field.\nfunc (l *ListWorkflowRunsOptions) GetBranch() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Branch\n}\n\n// GetCheckSuiteID returns the CheckSuiteID field.\nfunc (l *ListWorkflowRunsOptions) GetCheckSuiteID() int64 {\n\tif l == nil {\n\t\treturn 0\n\t}\n\treturn l.CheckSuiteID\n}\n\n// GetCreated returns the Created field.\nfunc (l *ListWorkflowRunsOptions) GetCreated() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Created\n}\n\n// GetEvent returns the Event field.\nfunc (l *ListWorkflowRunsOptions) GetEvent() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Event\n}\n\n// GetExcludePullRequests returns the ExcludePullRequests field.\nfunc (l *ListWorkflowRunsOptions) GetExcludePullRequests() bool {\n\tif l == nil {\n\t\treturn false\n\t}\n\treturn l.ExcludePullRequests\n}\n\n// GetHeadSHA returns the HeadSHA field.\nfunc (l *ListWorkflowRunsOptions) GetHeadSHA() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.HeadSHA\n}\n\n// GetStatus returns the Status field.\nfunc (l *ListWorkflowRunsOptions) GetStatus() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.Status\n}\n\n// GetEndColumn returns the EndColumn field if it's non-nil, zero value otherwise.\nfunc (l *Location) GetEndColumn() int {\n\tif l == nil || l.EndColumn == nil {\n\t\treturn 0\n\t}\n\treturn *l.EndColumn\n}\n\n// GetEndLine returns the EndLine field if it's non-nil, zero value otherwise.\nfunc (l *Location) GetEndLine() int {\n\tif l == nil || l.EndLine == nil {\n\t\treturn 0\n\t}\n\treturn *l.EndLine\n}\n\n// GetPath returns the Path field if it's non-nil, zero value otherwise.\nfunc (l *Location) GetPath() string {\n\tif l == nil || l.Path == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.Path\n}\n\n// GetStartColumn returns the StartColumn field if it's non-nil, zero value otherwise.\nfunc (l *Location) GetStartColumn() int {\n\tif l == nil || l.StartColumn == nil {\n\t\treturn 0\n\t}\n\treturn *l.StartColumn\n}\n\n// GetStartLine returns the StartLine field if it's non-nil, zero value otherwise.\nfunc (l *Location) GetStartLine() int {\n\tif l == nil || l.StartLine == nil {\n\t\treturn 0\n\t}\n\treturn *l.StartLine\n}\n\n// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise.\nfunc (l *LockBranch) GetEnabled() bool {\n\tif l == nil || l.Enabled == nil {\n\t\treturn false\n\t}\n\treturn *l.Enabled\n}\n\n// GetLockReason returns the LockReason field.\nfunc (l *LockIssueOptions) GetLockReason() string {\n\tif l == nil {\n\t\treturn \"\"\n\t}\n\treturn l.LockReason\n}\n\n// GetHostname returns the Hostname field if it's non-nil, zero value otherwise.\nfunc (m *MaintenanceOperationStatus) GetHostname() string {\n\tif m == nil || m.Hostname == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Hostname\n}\n\n// GetMessage returns the Message field if it's non-nil, zero value otherwise.\nfunc (m *MaintenanceOperationStatus) GetMessage() string {\n\tif m == nil || m.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Message\n}\n\n// GetUUID returns the UUID field if it's non-nil, zero value otherwise.\nfunc (m *MaintenanceOperationStatus) GetUUID() string {\n\tif m == nil || m.UUID == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.UUID\n}\n\n// GetEnabled returns the Enabled field.\nfunc (m *MaintenanceOptions) GetEnabled() bool {\n\tif m == nil {\n\t\treturn false\n\t}\n\treturn m.Enabled\n}\n\n// GetIPExceptionList returns the IPExceptionList slice if it's non-nil, nil otherwise.\nfunc (m *MaintenanceOptions) GetIPExceptionList() []string {\n\tif m == nil || m.IPExceptionList == nil {\n\t\treturn nil\n\t}\n\treturn m.IPExceptionList\n}\n\n// GetMaintenanceModeMessage returns the MaintenanceModeMessage field if it's non-nil, zero value otherwise.\nfunc (m *MaintenanceOptions) GetMaintenanceModeMessage() string {\n\tif m == nil || m.MaintenanceModeMessage == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.MaintenanceModeMessage\n}\n\n// GetUUID returns the UUID field if it's non-nil, zero value otherwise.\nfunc (m *MaintenanceOptions) GetUUID() string {\n\tif m == nil || m.UUID == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.UUID\n}\n\n// GetWhen returns the When field if it's non-nil, zero value otherwise.\nfunc (m *MaintenanceOptions) GetWhen() string {\n\tif m == nil || m.When == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.When\n}\n\n// GetCanUnsetMaintenance returns the CanUnsetMaintenance field if it's non-nil, zero value otherwise.\nfunc (m *MaintenanceStatus) GetCanUnsetMaintenance() bool {\n\tif m == nil || m.CanUnsetMaintenance == nil {\n\t\treturn false\n\t}\n\treturn *m.CanUnsetMaintenance\n}\n\n// GetConnectionServices returns the ConnectionServices slice if it's non-nil, nil otherwise.\nfunc (m *MaintenanceStatus) GetConnectionServices() []*ConnectionServiceItem {\n\tif m == nil || m.ConnectionServices == nil {\n\t\treturn nil\n\t}\n\treturn m.ConnectionServices\n}\n\n// GetHostname returns the Hostname field if it's non-nil, zero value otherwise.\nfunc (m *MaintenanceStatus) GetHostname() string {\n\tif m == nil || m.Hostname == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Hostname\n}\n\n// GetIPExceptionList returns the IPExceptionList slice if it's non-nil, nil otherwise.\nfunc (m *MaintenanceStatus) GetIPExceptionList() []string {\n\tif m == nil || m.IPExceptionList == nil {\n\t\treturn nil\n\t}\n\treturn m.IPExceptionList\n}\n\n// GetMaintenanceModeMessage returns the MaintenanceModeMessage field if it's non-nil, zero value otherwise.\nfunc (m *MaintenanceStatus) GetMaintenanceModeMessage() string {\n\tif m == nil || m.MaintenanceModeMessage == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.MaintenanceModeMessage\n}\n\n// GetScheduledTime returns the ScheduledTime field if it's non-nil, zero value otherwise.\nfunc (m *MaintenanceStatus) GetScheduledTime() Timestamp {\n\tif m == nil || m.ScheduledTime == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *m.ScheduledTime\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (m *MaintenanceStatus) GetStatus() string {\n\tif m == nil || m.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Status\n}\n\n// GetUUID returns the UUID field if it's non-nil, zero value otherwise.\nfunc (m *MaintenanceStatus) GetUUID() string {\n\tif m == nil || m.UUID == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.UUID\n}\n\n// GetContext returns the Context field.\nfunc (m *MarkdownOptions) GetContext() string {\n\tif m == nil {\n\t\treturn \"\"\n\t}\n\treturn m.Context\n}\n\n// GetMode returns the Mode field.\nfunc (m *MarkdownOptions) GetMode() string {\n\tif m == nil {\n\t\treturn \"\"\n\t}\n\treturn m.Mode\n}\n\n// GetEffectiveDate returns the EffectiveDate field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePendingChange) GetEffectiveDate() Timestamp {\n\tif m == nil || m.EffectiveDate == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *m.EffectiveDate\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePendingChange) GetID() int64 {\n\tif m == nil || m.ID == nil {\n\t\treturn 0\n\t}\n\treturn *m.ID\n}\n\n// GetPlan returns the Plan field.\nfunc (m *MarketplacePendingChange) GetPlan() *MarketplacePlan {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Plan\n}\n\n// GetUnitCount returns the UnitCount field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePendingChange) GetUnitCount() int {\n\tif m == nil || m.UnitCount == nil {\n\t\treturn 0\n\t}\n\treturn *m.UnitCount\n}\n\n// GetAccountsURL returns the AccountsURL field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePlan) GetAccountsURL() string {\n\tif m == nil || m.AccountsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.AccountsURL\n}\n\n// GetBullets returns the Bullets field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePlan) GetBullets() []string {\n\tif m == nil || m.Bullets == nil {\n\t\treturn nil\n\t}\n\treturn *m.Bullets\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePlan) GetDescription() string {\n\tif m == nil || m.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Description\n}\n\n// GetHasFreeTrial returns the HasFreeTrial field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePlan) GetHasFreeTrial() bool {\n\tif m == nil || m.HasFreeTrial == nil {\n\t\treturn false\n\t}\n\treturn *m.HasFreeTrial\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePlan) GetID() int64 {\n\tif m == nil || m.ID == nil {\n\t\treturn 0\n\t}\n\treturn *m.ID\n}\n\n// GetMonthlyPriceInCents returns the MonthlyPriceInCents field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePlan) GetMonthlyPriceInCents() int {\n\tif m == nil || m.MonthlyPriceInCents == nil {\n\t\treturn 0\n\t}\n\treturn *m.MonthlyPriceInCents\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePlan) GetName() string {\n\tif m == nil || m.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Name\n}\n\n// GetNumber returns the Number field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePlan) GetNumber() int {\n\tif m == nil || m.Number == nil {\n\t\treturn 0\n\t}\n\treturn *m.Number\n}\n\n// GetPriceModel returns the PriceModel field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePlan) GetPriceModel() string {\n\tif m == nil || m.PriceModel == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.PriceModel\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePlan) GetState() string {\n\tif m == nil || m.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.State\n}\n\n// GetUnitName returns the UnitName field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePlan) GetUnitName() string {\n\tif m == nil || m.UnitName == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.UnitName\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePlan) GetURL() string {\n\tif m == nil || m.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.URL\n}\n\n// GetYearlyPriceInCents returns the YearlyPriceInCents field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePlan) GetYearlyPriceInCents() int {\n\tif m == nil || m.YearlyPriceInCents == nil {\n\t\treturn 0\n\t}\n\treturn *m.YearlyPriceInCents\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePlanAccount) GetID() int64 {\n\tif m == nil || m.ID == nil {\n\t\treturn 0\n\t}\n\treturn *m.ID\n}\n\n// GetLogin returns the Login field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePlanAccount) GetLogin() string {\n\tif m == nil || m.Login == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Login\n}\n\n// GetMarketplacePendingChange returns the MarketplacePendingChange field.\nfunc (m *MarketplacePlanAccount) GetMarketplacePendingChange() *MarketplacePendingChange {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.MarketplacePendingChange\n}\n\n// GetMarketplacePurchase returns the MarketplacePurchase field.\nfunc (m *MarketplacePlanAccount) GetMarketplacePurchase() *MarketplacePurchase {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.MarketplacePurchase\n}\n\n// GetOrganizationBillingEmail returns the OrganizationBillingEmail field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePlanAccount) GetOrganizationBillingEmail() string {\n\tif m == nil || m.OrganizationBillingEmail == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.OrganizationBillingEmail\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePlanAccount) GetType() string {\n\tif m == nil || m.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Type\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePlanAccount) GetURL() string {\n\tif m == nil || m.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.URL\n}\n\n// GetAccount returns the Account field.\nfunc (m *MarketplacePurchase) GetAccount() *MarketplacePurchaseAccount {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Account\n}\n\n// GetBillingCycle returns the BillingCycle field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePurchase) GetBillingCycle() string {\n\tif m == nil || m.BillingCycle == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.BillingCycle\n}\n\n// GetFreeTrialEndsOn returns the FreeTrialEndsOn field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePurchase) GetFreeTrialEndsOn() Timestamp {\n\tif m == nil || m.FreeTrialEndsOn == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *m.FreeTrialEndsOn\n}\n\n// GetNextBillingDate returns the NextBillingDate field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePurchase) GetNextBillingDate() Timestamp {\n\tif m == nil || m.NextBillingDate == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *m.NextBillingDate\n}\n\n// GetOnFreeTrial returns the OnFreeTrial field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePurchase) GetOnFreeTrial() bool {\n\tif m == nil || m.OnFreeTrial == nil {\n\t\treturn false\n\t}\n\treturn *m.OnFreeTrial\n}\n\n// GetPlan returns the Plan field.\nfunc (m *MarketplacePurchase) GetPlan() *MarketplacePlan {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Plan\n}\n\n// GetUnitCount returns the UnitCount field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePurchase) GetUnitCount() int {\n\tif m == nil || m.UnitCount == nil {\n\t\treturn 0\n\t}\n\treturn *m.UnitCount\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePurchase) GetUpdatedAt() Timestamp {\n\tif m == nil || m.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *m.UpdatedAt\n}\n\n// GetEmail returns the Email field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePurchaseAccount) GetEmail() string {\n\tif m == nil || m.Email == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Email\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePurchaseAccount) GetID() int64 {\n\tif m == nil || m.ID == nil {\n\t\treturn 0\n\t}\n\treturn *m.ID\n}\n\n// GetLogin returns the Login field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePurchaseAccount) GetLogin() string {\n\tif m == nil || m.Login == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Login\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePurchaseAccount) GetNodeID() string {\n\tif m == nil || m.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.NodeID\n}\n\n// GetOrganizationBillingEmail returns the OrganizationBillingEmail field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePurchaseAccount) GetOrganizationBillingEmail() string {\n\tif m == nil || m.OrganizationBillingEmail == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.OrganizationBillingEmail\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePurchaseAccount) GetType() string {\n\tif m == nil || m.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Type\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePurchaseAccount) GetURL() string {\n\tif m == nil || m.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.URL\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePurchaseEvent) GetAction() string {\n\tif m == nil || m.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Action\n}\n\n// GetEffectiveDate returns the EffectiveDate field if it's non-nil, zero value otherwise.\nfunc (m *MarketplacePurchaseEvent) GetEffectiveDate() Timestamp {\n\tif m == nil || m.EffectiveDate == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *m.EffectiveDate\n}\n\n// GetInstallation returns the Installation field.\nfunc (m *MarketplacePurchaseEvent) GetInstallation() *Installation {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Installation\n}\n\n// GetMarketplacePurchase returns the MarketplacePurchase field.\nfunc (m *MarketplacePurchaseEvent) GetMarketplacePurchase() *MarketplacePurchase {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.MarketplacePurchase\n}\n\n// GetOrg returns the Org field.\nfunc (m *MarketplacePurchaseEvent) GetOrg() *Organization {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Org\n}\n\n// GetPreviousMarketplacePurchase returns the PreviousMarketplacePurchase field.\nfunc (m *MarketplacePurchaseEvent) GetPreviousMarketplacePurchase() *MarketplacePurchase {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.PreviousMarketplacePurchase\n}\n\n// GetSender returns the Sender field.\nfunc (m *MarketplacePurchaseEvent) GetSender() *User {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Sender\n}\n\n// GetIndices returns the Indices slice if it's non-nil, nil otherwise.\nfunc (m *Match) GetIndices() []int {\n\tif m == nil || m.Indices == nil {\n\t\treturn nil\n\t}\n\treturn m.Indices\n}\n\n// GetText returns the Text field if it's non-nil, zero value otherwise.\nfunc (m *Match) GetText() string {\n\tif m == nil || m.Text == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Text\n}\n\n// GetParameters returns the Parameters field.\nfunc (m *MaxFilePathLengthBranchRule) GetParameters() MaxFilePathLengthRuleParameters {\n\tif m == nil {\n\t\treturn MaxFilePathLengthRuleParameters{}\n\t}\n\treturn m.Parameters\n}\n\n// GetMaxFilePathLength returns the MaxFilePathLength field.\nfunc (m *MaxFilePathLengthRuleParameters) GetMaxFilePathLength() int {\n\tif m == nil {\n\t\treturn 0\n\t}\n\treturn m.MaxFilePathLength\n}\n\n// GetParameters returns the Parameters field.\nfunc (m *MaxFileSizeBranchRule) GetParameters() MaxFileSizeRuleParameters {\n\tif m == nil {\n\t\treturn MaxFileSizeRuleParameters{}\n\t}\n\treturn m.Parameters\n}\n\n// GetMaxFileSize returns the MaxFileSize field.\nfunc (m *MaxFileSizeRuleParameters) GetMaxFileSize() int64 {\n\tif m == nil {\n\t\treturn 0\n\t}\n\treturn m.MaxFileSize\n}\n\n// GetPermission returns the Permission field.\nfunc (m *MemberChanges) GetPermission() *MemberChangesPermission {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Permission\n}\n\n// GetRoleName returns the RoleName field.\nfunc (m *MemberChanges) GetRoleName() *MemberChangesRoleName {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.RoleName\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (m *MemberChangesPermission) GetFrom() string {\n\tif m == nil || m.From == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.From\n}\n\n// GetTo returns the To field if it's non-nil, zero value otherwise.\nfunc (m *MemberChangesPermission) GetTo() string {\n\tif m == nil || m.To == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.To\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (m *MemberChangesRoleName) GetFrom() string {\n\tif m == nil || m.From == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.From\n}\n\n// GetTo returns the To field if it's non-nil, zero value otherwise.\nfunc (m *MemberChangesRoleName) GetTo() string {\n\tif m == nil || m.To == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.To\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (m *MemberEvent) GetAction() string {\n\tif m == nil || m.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Action\n}\n\n// GetChanges returns the Changes field.\nfunc (m *MemberEvent) GetChanges() *MemberChanges {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Changes\n}\n\n// GetInstallation returns the Installation field.\nfunc (m *MemberEvent) GetInstallation() *Installation {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Installation\n}\n\n// GetMember returns the Member field.\nfunc (m *MemberEvent) GetMember() *User {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Member\n}\n\n// GetOrg returns the Org field.\nfunc (m *MemberEvent) GetOrg() *Organization {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Org\n}\n\n// GetRepo returns the Repo field.\nfunc (m *MemberEvent) GetRepo() *Repository {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (m *MemberEvent) GetSender() *User {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Sender\n}\n\n// GetOrganization returns the Organization field.\nfunc (m *Membership) GetOrganization() *Organization {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Organization\n}\n\n// GetOrganizationURL returns the OrganizationURL field if it's non-nil, zero value otherwise.\nfunc (m *Membership) GetOrganizationURL() string {\n\tif m == nil || m.OrganizationURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.OrganizationURL\n}\n\n// GetRole returns the Role field if it's non-nil, zero value otherwise.\nfunc (m *Membership) GetRole() string {\n\tif m == nil || m.Role == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Role\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (m *Membership) GetState() string {\n\tif m == nil || m.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.State\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (m *Membership) GetURL() string {\n\tif m == nil || m.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.URL\n}\n\n// GetUser returns the User field.\nfunc (m *Membership) GetUser() *User {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.User\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (m *MembershipEvent) GetAction() string {\n\tif m == nil || m.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Action\n}\n\n// GetInstallation returns the Installation field.\nfunc (m *MembershipEvent) GetInstallation() *Installation {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Installation\n}\n\n// GetMember returns the Member field.\nfunc (m *MembershipEvent) GetMember() *User {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Member\n}\n\n// GetOrg returns the Org field.\nfunc (m *MembershipEvent) GetOrg() *Organization {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Org\n}\n\n// GetScope returns the Scope field if it's non-nil, zero value otherwise.\nfunc (m *MembershipEvent) GetScope() string {\n\tif m == nil || m.Scope == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Scope\n}\n\n// GetSender returns the Sender field.\nfunc (m *MembershipEvent) GetSender() *User {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Sender\n}\n\n// GetTeam returns the Team field.\nfunc (m *MembershipEvent) GetTeam() *Team {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Team\n}\n\n// GetBaseRef returns the BaseRef field if it's non-nil, zero value otherwise.\nfunc (m *MergeGroup) GetBaseRef() string {\n\tif m == nil || m.BaseRef == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.BaseRef\n}\n\n// GetBaseSHA returns the BaseSHA field if it's non-nil, zero value otherwise.\nfunc (m *MergeGroup) GetBaseSHA() string {\n\tif m == nil || m.BaseSHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.BaseSHA\n}\n\n// GetHeadCommit returns the HeadCommit field.\nfunc (m *MergeGroup) GetHeadCommit() *Commit {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.HeadCommit\n}\n\n// GetHeadRef returns the HeadRef field if it's non-nil, zero value otherwise.\nfunc (m *MergeGroup) GetHeadRef() string {\n\tif m == nil || m.HeadRef == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.HeadRef\n}\n\n// GetHeadSHA returns the HeadSHA field if it's non-nil, zero value otherwise.\nfunc (m *MergeGroup) GetHeadSHA() string {\n\tif m == nil || m.HeadSHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.HeadSHA\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (m *MergeGroupEvent) GetAction() string {\n\tif m == nil || m.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Action\n}\n\n// GetInstallation returns the Installation field.\nfunc (m *MergeGroupEvent) GetInstallation() *Installation {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Installation\n}\n\n// GetMergeGroup returns the MergeGroup field.\nfunc (m *MergeGroupEvent) GetMergeGroup() *MergeGroup {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.MergeGroup\n}\n\n// GetOrg returns the Org field.\nfunc (m *MergeGroupEvent) GetOrg() *Organization {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Org\n}\n\n// GetReason returns the Reason field if it's non-nil, zero value otherwise.\nfunc (m *MergeGroupEvent) GetReason() string {\n\tif m == nil || m.Reason == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Reason\n}\n\n// GetRepo returns the Repo field.\nfunc (m *MergeGroupEvent) GetRepo() *Repository {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (m *MergeGroupEvent) GetSender() *User {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Sender\n}\n\n// GetParameters returns the Parameters field.\nfunc (m *MergeQueueBranchRule) GetParameters() MergeQueueRuleParameters {\n\tif m == nil {\n\t\treturn MergeQueueRuleParameters{}\n\t}\n\treturn m.Parameters\n}\n\n// GetCheckResponseTimeoutMinutes returns the CheckResponseTimeoutMinutes field.\nfunc (m *MergeQueueRuleParameters) GetCheckResponseTimeoutMinutes() int {\n\tif m == nil {\n\t\treturn 0\n\t}\n\treturn m.CheckResponseTimeoutMinutes\n}\n\n// GetGroupingStrategy returns the GroupingStrategy field.\nfunc (m *MergeQueueRuleParameters) GetGroupingStrategy() MergeGroupingStrategy {\n\tif m == nil {\n\t\treturn \"\"\n\t}\n\treturn m.GroupingStrategy\n}\n\n// GetMaxEntriesToBuild returns the MaxEntriesToBuild field.\nfunc (m *MergeQueueRuleParameters) GetMaxEntriesToBuild() int {\n\tif m == nil {\n\t\treturn 0\n\t}\n\treturn m.MaxEntriesToBuild\n}\n\n// GetMaxEntriesToMerge returns the MaxEntriesToMerge field.\nfunc (m *MergeQueueRuleParameters) GetMaxEntriesToMerge() int {\n\tif m == nil {\n\t\treturn 0\n\t}\n\treturn m.MaxEntriesToMerge\n}\n\n// GetMergeMethod returns the MergeMethod field.\nfunc (m *MergeQueueRuleParameters) GetMergeMethod() MergeQueueMergeMethod {\n\tif m == nil {\n\t\treturn \"\"\n\t}\n\treturn m.MergeMethod\n}\n\n// GetMinEntriesToMerge returns the MinEntriesToMerge field.\nfunc (m *MergeQueueRuleParameters) GetMinEntriesToMerge() int {\n\tif m == nil {\n\t\treturn 0\n\t}\n\treturn m.MinEntriesToMerge\n}\n\n// GetMinEntriesToMergeWaitMinutes returns the MinEntriesToMergeWaitMinutes field.\nfunc (m *MergeQueueRuleParameters) GetMinEntriesToMergeWaitMinutes() int {\n\tif m == nil {\n\t\treturn 0\n\t}\n\treturn m.MinEntriesToMergeWaitMinutes\n}\n\n// GetText returns the Text field if it's non-nil, zero value otherwise.\nfunc (m *Message) GetText() string {\n\tif m == nil || m.Text == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Text\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (m *MetaEvent) GetAction() string {\n\tif m == nil || m.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Action\n}\n\n// GetHook returns the Hook field.\nfunc (m *MetaEvent) GetHook() *Hook {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Hook\n}\n\n// GetHookID returns the HookID field if it's non-nil, zero value otherwise.\nfunc (m *MetaEvent) GetHookID() int64 {\n\tif m == nil || m.HookID == nil {\n\t\treturn 0\n\t}\n\treturn *m.HookID\n}\n\n// GetInstallation returns the Installation field.\nfunc (m *MetaEvent) GetInstallation() *Installation {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (m *MetaEvent) GetOrg() *Organization {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Org\n}\n\n// GetRepo returns the Repo field.\nfunc (m *MetaEvent) GetRepo() *Repository {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (m *MetaEvent) GetSender() *User {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Sender\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (m *Metric) GetHTMLURL() string {\n\tif m == nil || m.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.HTMLURL\n}\n\n// GetKey returns the Key field if it's non-nil, zero value otherwise.\nfunc (m *Metric) GetKey() string {\n\tif m == nil || m.Key == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Key\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (m *Metric) GetName() string {\n\tif m == nil || m.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Name\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (m *Metric) GetNodeID() string {\n\tif m == nil || m.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.NodeID\n}\n\n// GetSPDXID returns the SPDXID field if it's non-nil, zero value otherwise.\nfunc (m *Metric) GetSPDXID() string {\n\tif m == nil || m.SPDXID == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.SPDXID\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (m *Metric) GetURL() string {\n\tif m == nil || m.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.URL\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (m *Migration) GetCreatedAt() string {\n\tif m == nil || m.CreatedAt == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.CreatedAt\n}\n\n// GetExcludeAttachments returns the ExcludeAttachments field if it's non-nil, zero value otherwise.\nfunc (m *Migration) GetExcludeAttachments() bool {\n\tif m == nil || m.ExcludeAttachments == nil {\n\t\treturn false\n\t}\n\treturn *m.ExcludeAttachments\n}\n\n// GetGUID returns the GUID field if it's non-nil, zero value otherwise.\nfunc (m *Migration) GetGUID() string {\n\tif m == nil || m.GUID == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.GUID\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (m *Migration) GetID() int64 {\n\tif m == nil || m.ID == nil {\n\t\treturn 0\n\t}\n\treturn *m.ID\n}\n\n// GetLockRepositories returns the LockRepositories field if it's non-nil, zero value otherwise.\nfunc (m *Migration) GetLockRepositories() bool {\n\tif m == nil || m.LockRepositories == nil {\n\t\treturn false\n\t}\n\treturn *m.LockRepositories\n}\n\n// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise.\nfunc (m *Migration) GetRepositories() []*Repository {\n\tif m == nil || m.Repositories == nil {\n\t\treturn nil\n\t}\n\treturn m.Repositories\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (m *Migration) GetState() string {\n\tif m == nil || m.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.State\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (m *Migration) GetUpdatedAt() string {\n\tif m == nil || m.UpdatedAt == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (m *Migration) GetURL() string {\n\tif m == nil || m.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.URL\n}\n\n// GetExclude returns the Exclude slice if it's non-nil, nil otherwise.\nfunc (m *MigrationOptions) GetExclude() []string {\n\tif m == nil || m.Exclude == nil {\n\t\treturn nil\n\t}\n\treturn m.Exclude\n}\n\n// GetExcludeAttachments returns the ExcludeAttachments field.\nfunc (m *MigrationOptions) GetExcludeAttachments() bool {\n\tif m == nil {\n\t\treturn false\n\t}\n\treturn m.ExcludeAttachments\n}\n\n// GetExcludeReleases returns the ExcludeReleases field.\nfunc (m *MigrationOptions) GetExcludeReleases() bool {\n\tif m == nil {\n\t\treturn false\n\t}\n\treturn m.ExcludeReleases\n}\n\n// GetLockRepositories returns the LockRepositories field.\nfunc (m *MigrationOptions) GetLockRepositories() bool {\n\tif m == nil {\n\t\treturn false\n\t}\n\treturn m.LockRepositories\n}\n\n// GetClosedAt returns the ClosedAt field if it's non-nil, zero value otherwise.\nfunc (m *Milestone) GetClosedAt() Timestamp {\n\tif m == nil || m.ClosedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *m.ClosedAt\n}\n\n// GetClosedIssues returns the ClosedIssues field if it's non-nil, zero value otherwise.\nfunc (m *Milestone) GetClosedIssues() int {\n\tif m == nil || m.ClosedIssues == nil {\n\t\treturn 0\n\t}\n\treturn *m.ClosedIssues\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (m *Milestone) GetCreatedAt() Timestamp {\n\tif m == nil || m.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *m.CreatedAt\n}\n\n// GetCreator returns the Creator field.\nfunc (m *Milestone) GetCreator() *User {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Creator\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (m *Milestone) GetDescription() string {\n\tif m == nil || m.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Description\n}\n\n// GetDueOn returns the DueOn field if it's non-nil, zero value otherwise.\nfunc (m *Milestone) GetDueOn() Timestamp {\n\tif m == nil || m.DueOn == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *m.DueOn\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (m *Milestone) GetHTMLURL() string {\n\tif m == nil || m.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (m *Milestone) GetID() int64 {\n\tif m == nil || m.ID == nil {\n\t\treturn 0\n\t}\n\treturn *m.ID\n}\n\n// GetLabelsURL returns the LabelsURL field if it's non-nil, zero value otherwise.\nfunc (m *Milestone) GetLabelsURL() string {\n\tif m == nil || m.LabelsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.LabelsURL\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (m *Milestone) GetNodeID() string {\n\tif m == nil || m.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.NodeID\n}\n\n// GetNumber returns the Number field if it's non-nil, zero value otherwise.\nfunc (m *Milestone) GetNumber() int {\n\tif m == nil || m.Number == nil {\n\t\treturn 0\n\t}\n\treturn *m.Number\n}\n\n// GetOpenIssues returns the OpenIssues field if it's non-nil, zero value otherwise.\nfunc (m *Milestone) GetOpenIssues() int {\n\tif m == nil || m.OpenIssues == nil {\n\t\treturn 0\n\t}\n\treturn *m.OpenIssues\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (m *Milestone) GetState() string {\n\tif m == nil || m.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.State\n}\n\n// GetTitle returns the Title field if it's non-nil, zero value otherwise.\nfunc (m *Milestone) GetTitle() string {\n\tif m == nil || m.Title == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Title\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (m *Milestone) GetUpdatedAt() Timestamp {\n\tif m == nil || m.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *m.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (m *Milestone) GetURL() string {\n\tif m == nil || m.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.URL\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (m *MilestoneEvent) GetAction() string {\n\tif m == nil || m.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Action\n}\n\n// GetChanges returns the Changes field.\nfunc (m *MilestoneEvent) GetChanges() *EditChange {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Changes\n}\n\n// GetInstallation returns the Installation field.\nfunc (m *MilestoneEvent) GetInstallation() *Installation {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Installation\n}\n\n// GetMilestone returns the Milestone field.\nfunc (m *MilestoneEvent) GetMilestone() *Milestone {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Milestone\n}\n\n// GetOrg returns the Org field.\nfunc (m *MilestoneEvent) GetOrg() *Organization {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Org\n}\n\n// GetRepo returns the Repo field.\nfunc (m *MilestoneEvent) GetRepo() *Repository {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (m *MilestoneEvent) GetSender() *User {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Sender\n}\n\n// GetDirection returns the Direction field.\nfunc (m *MilestoneListOptions) GetDirection() string {\n\tif m == nil {\n\t\treturn \"\"\n\t}\n\treturn m.Direction\n}\n\n// GetSort returns the Sort field.\nfunc (m *MilestoneListOptions) GetSort() string {\n\tif m == nil {\n\t\treturn \"\"\n\t}\n\treturn m.Sort\n}\n\n// GetState returns the State field.\nfunc (m *MilestoneListOptions) GetState() string {\n\tif m == nil {\n\t\treturn \"\"\n\t}\n\treturn m.State\n}\n\n// GetClosedMilestones returns the ClosedMilestones field if it's non-nil, zero value otherwise.\nfunc (m *MilestoneStats) GetClosedMilestones() int {\n\tif m == nil || m.ClosedMilestones == nil {\n\t\treturn 0\n\t}\n\treturn *m.ClosedMilestones\n}\n\n// GetOpenMilestones returns the OpenMilestones field if it's non-nil, zero value otherwise.\nfunc (m *MilestoneStats) GetOpenMilestones() int {\n\tif m == nil || m.OpenMilestones == nil {\n\t\treturn 0\n\t}\n\treturn *m.OpenMilestones\n}\n\n// GetTotalMilestones returns the TotalMilestones field if it's non-nil, zero value otherwise.\nfunc (m *MilestoneStats) GetTotalMilestones() int {\n\tif m == nil || m.TotalMilestones == nil {\n\t\treturn 0\n\t}\n\treturn *m.TotalMilestones\n}\n\n// GetAnalysisKey returns the AnalysisKey field if it's non-nil, zero value otherwise.\nfunc (m *MostRecentInstance) GetAnalysisKey() string {\n\tif m == nil || m.AnalysisKey == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.AnalysisKey\n}\n\n// GetCategory returns the Category field if it's non-nil, zero value otherwise.\nfunc (m *MostRecentInstance) GetCategory() string {\n\tif m == nil || m.Category == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Category\n}\n\n// GetClassifications returns the Classifications slice if it's non-nil, nil otherwise.\nfunc (m *MostRecentInstance) GetClassifications() []string {\n\tif m == nil || m.Classifications == nil {\n\t\treturn nil\n\t}\n\treturn m.Classifications\n}\n\n// GetCommitSHA returns the CommitSHA field if it's non-nil, zero value otherwise.\nfunc (m *MostRecentInstance) GetCommitSHA() string {\n\tif m == nil || m.CommitSHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.CommitSHA\n}\n\n// GetEnvironment returns the Environment field if it's non-nil, zero value otherwise.\nfunc (m *MostRecentInstance) GetEnvironment() string {\n\tif m == nil || m.Environment == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Environment\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (m *MostRecentInstance) GetHTMLURL() string {\n\tif m == nil || m.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.HTMLURL\n}\n\n// GetLocation returns the Location field.\nfunc (m *MostRecentInstance) GetLocation() *Location {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Location\n}\n\n// GetMessage returns the Message field.\nfunc (m *MostRecentInstance) GetMessage() *Message {\n\tif m == nil {\n\t\treturn nil\n\t}\n\treturn m.Message\n}\n\n// GetRef returns the Ref field if it's non-nil, zero value otherwise.\nfunc (m *MostRecentInstance) GetRef() string {\n\tif m == nil || m.Ref == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.Ref\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (m *MostRecentInstance) GetState() string {\n\tif m == nil || m.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *m.State\n}\n\n// GetComputeService returns the ComputeService field.\nfunc (n *NetworkConfiguration) GetComputeService() *ComputeService {\n\tif n == nil {\n\t\treturn nil\n\t}\n\treturn n.ComputeService\n}\n\n// GetCreatedOn returns the CreatedOn field if it's non-nil, zero value otherwise.\nfunc (n *NetworkConfiguration) GetCreatedOn() Timestamp {\n\tif n == nil || n.CreatedOn == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *n.CreatedOn\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (n *NetworkConfiguration) GetID() string {\n\tif n == nil || n.ID == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.ID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (n *NetworkConfiguration) GetName() string {\n\tif n == nil || n.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.Name\n}\n\n// GetNetworkSettingsIDs returns the NetworkSettingsIDs slice if it's non-nil, nil otherwise.\nfunc (n *NetworkConfiguration) GetNetworkSettingsIDs() []string {\n\tif n == nil || n.NetworkSettingsIDs == nil {\n\t\treturn nil\n\t}\n\treturn n.NetworkSettingsIDs\n}\n\n// GetComputeService returns the ComputeService field.\nfunc (n *NetworkConfigurationRequest) GetComputeService() *ComputeService {\n\tif n == nil {\n\t\treturn nil\n\t}\n\treturn n.ComputeService\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (n *NetworkConfigurationRequest) GetName() string {\n\tif n == nil || n.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.Name\n}\n\n// GetNetworkSettingsIDs returns the NetworkSettingsIDs slice if it's non-nil, nil otherwise.\nfunc (n *NetworkConfigurationRequest) GetNetworkSettingsIDs() []string {\n\tif n == nil || n.NetworkSettingsIDs == nil {\n\t\treturn nil\n\t}\n\treturn n.NetworkSettingsIDs\n}\n\n// GetNetworkConfigurations returns the NetworkConfigurations slice if it's non-nil, nil otherwise.\nfunc (n *NetworkConfigurations) GetNetworkConfigurations() []*NetworkConfiguration {\n\tif n == nil || n.NetworkConfigurations == nil {\n\t\treturn nil\n\t}\n\treturn n.NetworkConfigurations\n}\n\n// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.\nfunc (n *NetworkConfigurations) GetTotalCount() int64 {\n\tif n == nil || n.TotalCount == nil {\n\t\treturn 0\n\t}\n\treturn *n.TotalCount\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (n *NetworkSettingsResource) GetID() string {\n\tif n == nil || n.ID == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.ID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (n *NetworkSettingsResource) GetName() string {\n\tif n == nil || n.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.Name\n}\n\n// GetNetworkConfigurationID returns the NetworkConfigurationID field if it's non-nil, zero value otherwise.\nfunc (n *NetworkSettingsResource) GetNetworkConfigurationID() string {\n\tif n == nil || n.NetworkConfigurationID == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.NetworkConfigurationID\n}\n\n// GetRegion returns the Region field if it's non-nil, zero value otherwise.\nfunc (n *NetworkSettingsResource) GetRegion() string {\n\tif n == nil || n.Region == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.Region\n}\n\n// GetSubnetID returns the SubnetID field if it's non-nil, zero value otherwise.\nfunc (n *NetworkSettingsResource) GetSubnetID() string {\n\tif n == nil || n.SubnetID == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.SubnetID\n}\n\n// GetBase returns the Base field if it's non-nil, zero value otherwise.\nfunc (n *NewPullRequest) GetBase() string {\n\tif n == nil || n.Base == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.Base\n}\n\n// GetBody returns the Body field if it's non-nil, zero value otherwise.\nfunc (n *NewPullRequest) GetBody() string {\n\tif n == nil || n.Body == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.Body\n}\n\n// GetDraft returns the Draft field if it's non-nil, zero value otherwise.\nfunc (n *NewPullRequest) GetDraft() bool {\n\tif n == nil || n.Draft == nil {\n\t\treturn false\n\t}\n\treturn *n.Draft\n}\n\n// GetHead returns the Head field if it's non-nil, zero value otherwise.\nfunc (n *NewPullRequest) GetHead() string {\n\tif n == nil || n.Head == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.Head\n}\n\n// GetHeadRepo returns the HeadRepo field if it's non-nil, zero value otherwise.\nfunc (n *NewPullRequest) GetHeadRepo() string {\n\tif n == nil || n.HeadRepo == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.HeadRepo\n}\n\n// GetIssue returns the Issue field if it's non-nil, zero value otherwise.\nfunc (n *NewPullRequest) GetIssue() int {\n\tif n == nil || n.Issue == nil {\n\t\treturn 0\n\t}\n\treturn *n.Issue\n}\n\n// GetMaintainerCanModify returns the MaintainerCanModify field if it's non-nil, zero value otherwise.\nfunc (n *NewPullRequest) GetMaintainerCanModify() bool {\n\tif n == nil || n.MaintainerCanModify == nil {\n\t\treturn false\n\t}\n\treturn *n.MaintainerCanModify\n}\n\n// GetTitle returns the Title field if it's non-nil, zero value otherwise.\nfunc (n *NewPullRequest) GetTitle() string {\n\tif n == nil || n.Title == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.Title\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (n *NewTeam) GetDescription() string {\n\tif n == nil || n.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.Description\n}\n\n// GetLDAPDN returns the LDAPDN field if it's non-nil, zero value otherwise.\nfunc (n *NewTeam) GetLDAPDN() string {\n\tif n == nil || n.LDAPDN == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.LDAPDN\n}\n\n// GetMaintainers returns the Maintainers slice if it's non-nil, nil otherwise.\nfunc (n *NewTeam) GetMaintainers() []string {\n\tif n == nil || n.Maintainers == nil {\n\t\treturn nil\n\t}\n\treturn n.Maintainers\n}\n\n// GetName returns the Name field.\nfunc (n *NewTeam) GetName() string {\n\tif n == nil {\n\t\treturn \"\"\n\t}\n\treturn n.Name\n}\n\n// GetNotificationSetting returns the NotificationSetting field if it's non-nil, zero value otherwise.\nfunc (n *NewTeam) GetNotificationSetting() string {\n\tif n == nil || n.NotificationSetting == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.NotificationSetting\n}\n\n// GetParentTeamID returns the ParentTeamID field if it's non-nil, zero value otherwise.\nfunc (n *NewTeam) GetParentTeamID() int64 {\n\tif n == nil || n.ParentTeamID == nil {\n\t\treturn 0\n\t}\n\treturn *n.ParentTeamID\n}\n\n// GetPermission returns the Permission field if it's non-nil, zero value otherwise.\nfunc (n *NewTeam) GetPermission() string {\n\tif n == nil || n.Permission == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.Permission\n}\n\n// GetPrivacy returns the Privacy field if it's non-nil, zero value otherwise.\nfunc (n *NewTeam) GetPrivacy() string {\n\tif n == nil || n.Privacy == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.Privacy\n}\n\n// GetRepoNames returns the RepoNames slice if it's non-nil, nil otherwise.\nfunc (n *NewTeam) GetRepoNames() []string {\n\tif n == nil || n.RepoNames == nil {\n\t\treturn nil\n\t}\n\treturn n.RepoNames\n}\n\n// GetClusterRoles returns the ClusterRoles slice if it's non-nil, nil otherwise.\nfunc (n *NodeDetails) GetClusterRoles() []string {\n\tif n == nil || n.ClusterRoles == nil {\n\t\treturn nil\n\t}\n\treturn n.ClusterRoles\n}\n\n// GetHostname returns the Hostname field if it's non-nil, zero value otherwise.\nfunc (n *NodeDetails) GetHostname() string {\n\tif n == nil || n.Hostname == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.Hostname\n}\n\n// GetUUID returns the UUID field if it's non-nil, zero value otherwise.\nfunc (n *NodeDetails) GetUUID() string {\n\tif n == nil || n.UUID == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.UUID\n}\n\n// GetNodes returns the Nodes slice if it's non-nil, nil otherwise.\nfunc (n *NodeMetadataStatus) GetNodes() []*NodeDetails {\n\tif n == nil || n.Nodes == nil {\n\t\treturn nil\n\t}\n\treturn n.Nodes\n}\n\n// GetTopology returns the Topology field if it's non-nil, zero value otherwise.\nfunc (n *NodeMetadataStatus) GetTopology() string {\n\tif n == nil || n.Topology == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.Topology\n}\n\n// GetClusterRoles returns the ClusterRoles field if it's non-nil, zero value otherwise.\nfunc (n *NodeQueryOptions) GetClusterRoles() string {\n\tif n == nil || n.ClusterRoles == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.ClusterRoles\n}\n\n// GetUUID returns the UUID field if it's non-nil, zero value otherwise.\nfunc (n *NodeQueryOptions) GetUUID() string {\n\tif n == nil || n.UUID == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.UUID\n}\n\n// GetHostname returns the Hostname field if it's non-nil, zero value otherwise.\nfunc (n *NodeReleaseVersion) GetHostname() string {\n\tif n == nil || n.Hostname == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.Hostname\n}\n\n// GetVersion returns the Version field.\nfunc (n *NodeReleaseVersion) GetVersion() *ReleaseVersion {\n\tif n == nil {\n\t\treturn nil\n\t}\n\treturn n.Version\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (n *Notification) GetID() string {\n\tif n == nil || n.ID == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.ID\n}\n\n// GetLastReadAt returns the LastReadAt field if it's non-nil, zero value otherwise.\nfunc (n *Notification) GetLastReadAt() Timestamp {\n\tif n == nil || n.LastReadAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *n.LastReadAt\n}\n\n// GetReason returns the Reason field if it's non-nil, zero value otherwise.\nfunc (n *Notification) GetReason() string {\n\tif n == nil || n.Reason == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.Reason\n}\n\n// GetRepository returns the Repository field.\nfunc (n *Notification) GetRepository() *Repository {\n\tif n == nil {\n\t\treturn nil\n\t}\n\treturn n.Repository\n}\n\n// GetSubject returns the Subject field.\nfunc (n *Notification) GetSubject() *NotificationSubject {\n\tif n == nil {\n\t\treturn nil\n\t}\n\treturn n.Subject\n}\n\n// GetUnread returns the Unread field if it's non-nil, zero value otherwise.\nfunc (n *Notification) GetUnread() bool {\n\tif n == nil || n.Unread == nil {\n\t\treturn false\n\t}\n\treturn *n.Unread\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (n *Notification) GetUpdatedAt() Timestamp {\n\tif n == nil || n.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *n.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (n *Notification) GetURL() string {\n\tif n == nil || n.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.URL\n}\n\n// GetAll returns the All field.\nfunc (n *NotificationListOptions) GetAll() bool {\n\tif n == nil {\n\t\treturn false\n\t}\n\treturn n.All\n}\n\n// GetBefore returns the Before field.\nfunc (n *NotificationListOptions) GetBefore() time.Time {\n\tif n == nil {\n\t\treturn time.Time{}\n\t}\n\treturn n.Before\n}\n\n// GetParticipating returns the Participating field.\nfunc (n *NotificationListOptions) GetParticipating() bool {\n\tif n == nil {\n\t\treturn false\n\t}\n\treturn n.Participating\n}\n\n// GetSince returns the Since field.\nfunc (n *NotificationListOptions) GetSince() time.Time {\n\tif n == nil {\n\t\treturn time.Time{}\n\t}\n\treturn n.Since\n}\n\n// GetLatestCommentURL returns the LatestCommentURL field if it's non-nil, zero value otherwise.\nfunc (n *NotificationSubject) GetLatestCommentURL() string {\n\tif n == nil || n.LatestCommentURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.LatestCommentURL\n}\n\n// GetTitle returns the Title field if it's non-nil, zero value otherwise.\nfunc (n *NotificationSubject) GetTitle() string {\n\tif n == nil || n.Title == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.Title\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (n *NotificationSubject) GetType() string {\n\tif n == nil || n.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.Type\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (n *NotificationSubject) GetURL() string {\n\tif n == nil || n.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *n.URL\n}\n\n// GetClientID returns the ClientID field if it's non-nil, zero value otherwise.\nfunc (o *OAuthAPP) GetClientID() string {\n\tif o == nil || o.ClientID == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.ClientID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (o *OAuthAPP) GetName() string {\n\tif o == nil || o.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.Name\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (o *OAuthAPP) GetURL() string {\n\tif o == nil || o.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.URL\n}\n\n// GetIncludeClaimKeys returns the IncludeClaimKeys slice if it's non-nil, nil otherwise.\nfunc (o *OIDCSubjectClaimCustomTemplate) GetIncludeClaimKeys() []string {\n\tif o == nil || o.IncludeClaimKeys == nil {\n\t\treturn nil\n\t}\n\treturn o.IncludeClaimKeys\n}\n\n// GetUseDefault returns the UseDefault field if it's non-nil, zero value otherwise.\nfunc (o *OIDCSubjectClaimCustomTemplate) GetUseDefault() bool {\n\tif o == nil || o.UseDefault == nil {\n\t\treturn false\n\t}\n\treturn *o.UseDefault\n}\n\n// GetAdvancedSecurityEnabledForNewRepos returns the AdvancedSecurityEnabledForNewRepos field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetAdvancedSecurityEnabledForNewRepos() bool {\n\tif o == nil || o.AdvancedSecurityEnabledForNewRepos == nil {\n\t\treturn false\n\t}\n\treturn *o.AdvancedSecurityEnabledForNewRepos\n}\n\n// GetAvatarURL returns the AvatarURL field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetAvatarURL() string {\n\tif o == nil || o.AvatarURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.AvatarURL\n}\n\n// GetBillingEmail returns the BillingEmail field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetBillingEmail() string {\n\tif o == nil || o.BillingEmail == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.BillingEmail\n}\n\n// GetBlog returns the Blog field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetBlog() string {\n\tif o == nil || o.Blog == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.Blog\n}\n\n// GetCollaborators returns the Collaborators field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetCollaborators() int {\n\tif o == nil || o.Collaborators == nil {\n\t\treturn 0\n\t}\n\treturn *o.Collaborators\n}\n\n// GetCompany returns the Company field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetCompany() string {\n\tif o == nil || o.Company == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.Company\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetCreatedAt() Timestamp {\n\tif o == nil || o.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *o.CreatedAt\n}\n\n// GetDefaultRepoPermission returns the DefaultRepoPermission field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetDefaultRepoPermission() string {\n\tif o == nil || o.DefaultRepoPermission == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.DefaultRepoPermission\n}\n\n// GetDefaultRepoSettings returns the DefaultRepoSettings field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetDefaultRepoSettings() string {\n\tif o == nil || o.DefaultRepoSettings == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.DefaultRepoSettings\n}\n\n// GetDefaultRepositoryBranch returns the DefaultRepositoryBranch field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetDefaultRepositoryBranch() string {\n\tif o == nil || o.DefaultRepositoryBranch == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.DefaultRepositoryBranch\n}\n\n// GetDependabotAlertsEnabledForNewRepos returns the DependabotAlertsEnabledForNewRepos field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetDependabotAlertsEnabledForNewRepos() bool {\n\tif o == nil || o.DependabotAlertsEnabledForNewRepos == nil {\n\t\treturn false\n\t}\n\treturn *o.DependabotAlertsEnabledForNewRepos\n}\n\n// GetDependabotSecurityUpdatesEnabledForNewRepos returns the DependabotSecurityUpdatesEnabledForNewRepos field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetDependabotSecurityUpdatesEnabledForNewRepos() bool {\n\tif o == nil || o.DependabotSecurityUpdatesEnabledForNewRepos == nil {\n\t\treturn false\n\t}\n\treturn *o.DependabotSecurityUpdatesEnabledForNewRepos\n}\n\n// GetDependencyGraphEnabledForNewRepos returns the DependencyGraphEnabledForNewRepos field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetDependencyGraphEnabledForNewRepos() bool {\n\tif o == nil || o.DependencyGraphEnabledForNewRepos == nil {\n\t\treturn false\n\t}\n\treturn *o.DependencyGraphEnabledForNewRepos\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetDescription() string {\n\tif o == nil || o.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.Description\n}\n\n// GetDiskUsage returns the DiskUsage field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetDiskUsage() int {\n\tif o == nil || o.DiskUsage == nil {\n\t\treturn 0\n\t}\n\treturn *o.DiskUsage\n}\n\n// GetDisplayCommenterFullNameSettingEnabled returns the DisplayCommenterFullNameSettingEnabled field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetDisplayCommenterFullNameSettingEnabled() bool {\n\tif o == nil || o.DisplayCommenterFullNameSettingEnabled == nil {\n\t\treturn false\n\t}\n\treturn *o.DisplayCommenterFullNameSettingEnabled\n}\n\n// GetEmail returns the Email field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetEmail() string {\n\tif o == nil || o.Email == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.Email\n}\n\n// GetEventsURL returns the EventsURL field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetEventsURL() string {\n\tif o == nil || o.EventsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.EventsURL\n}\n\n// GetFollowers returns the Followers field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetFollowers() int {\n\tif o == nil || o.Followers == nil {\n\t\treturn 0\n\t}\n\treturn *o.Followers\n}\n\n// GetFollowing returns the Following field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetFollowing() int {\n\tif o == nil || o.Following == nil {\n\t\treturn 0\n\t}\n\treturn *o.Following\n}\n\n// GetHasOrganizationProjects returns the HasOrganizationProjects field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetHasOrganizationProjects() bool {\n\tif o == nil || o.HasOrganizationProjects == nil {\n\t\treturn false\n\t}\n\treturn *o.HasOrganizationProjects\n}\n\n// GetHasRepositoryProjects returns the HasRepositoryProjects field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetHasRepositoryProjects() bool {\n\tif o == nil || o.HasRepositoryProjects == nil {\n\t\treturn false\n\t}\n\treturn *o.HasRepositoryProjects\n}\n\n// GetHooksURL returns the HooksURL field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetHooksURL() string {\n\tif o == nil || o.HooksURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.HooksURL\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetHTMLURL() string {\n\tif o == nil || o.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetID() int64 {\n\tif o == nil || o.ID == nil {\n\t\treturn 0\n\t}\n\treturn *o.ID\n}\n\n// GetIssuesURL returns the IssuesURL field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetIssuesURL() string {\n\tif o == nil || o.IssuesURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.IssuesURL\n}\n\n// GetIsVerified returns the IsVerified field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetIsVerified() bool {\n\tif o == nil || o.IsVerified == nil {\n\t\treturn false\n\t}\n\treturn *o.IsVerified\n}\n\n// GetLocation returns the Location field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetLocation() string {\n\tif o == nil || o.Location == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.Location\n}\n\n// GetLogin returns the Login field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetLogin() string {\n\tif o == nil || o.Login == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.Login\n}\n\n// GetMembersAllowedRepositoryCreationType returns the MembersAllowedRepositoryCreationType field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetMembersAllowedRepositoryCreationType() string {\n\tif o == nil || o.MembersAllowedRepositoryCreationType == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.MembersAllowedRepositoryCreationType\n}\n\n// GetMembersCanChangeRepoVisibility returns the MembersCanChangeRepoVisibility field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetMembersCanChangeRepoVisibility() bool {\n\tif o == nil || o.MembersCanChangeRepoVisibility == nil {\n\t\treturn false\n\t}\n\treturn *o.MembersCanChangeRepoVisibility\n}\n\n// GetMembersCanCreateInternalRepos returns the MembersCanCreateInternalRepos field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetMembersCanCreateInternalRepos() bool {\n\tif o == nil || o.MembersCanCreateInternalRepos == nil {\n\t\treturn false\n\t}\n\treturn *o.MembersCanCreateInternalRepos\n}\n\n// GetMembersCanCreatePages returns the MembersCanCreatePages field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetMembersCanCreatePages() bool {\n\tif o == nil || o.MembersCanCreatePages == nil {\n\t\treturn false\n\t}\n\treturn *o.MembersCanCreatePages\n}\n\n// GetMembersCanCreatePrivatePages returns the MembersCanCreatePrivatePages field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetMembersCanCreatePrivatePages() bool {\n\tif o == nil || o.MembersCanCreatePrivatePages == nil {\n\t\treturn false\n\t}\n\treturn *o.MembersCanCreatePrivatePages\n}\n\n// GetMembersCanCreatePrivateRepos returns the MembersCanCreatePrivateRepos field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetMembersCanCreatePrivateRepos() bool {\n\tif o == nil || o.MembersCanCreatePrivateRepos == nil {\n\t\treturn false\n\t}\n\treturn *o.MembersCanCreatePrivateRepos\n}\n\n// GetMembersCanCreatePublicPages returns the MembersCanCreatePublicPages field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetMembersCanCreatePublicPages() bool {\n\tif o == nil || o.MembersCanCreatePublicPages == nil {\n\t\treturn false\n\t}\n\treturn *o.MembersCanCreatePublicPages\n}\n\n// GetMembersCanCreatePublicRepos returns the MembersCanCreatePublicRepos field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetMembersCanCreatePublicRepos() bool {\n\tif o == nil || o.MembersCanCreatePublicRepos == nil {\n\t\treturn false\n\t}\n\treturn *o.MembersCanCreatePublicRepos\n}\n\n// GetMembersCanCreateRepos returns the MembersCanCreateRepos field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetMembersCanCreateRepos() bool {\n\tif o == nil || o.MembersCanCreateRepos == nil {\n\t\treturn false\n\t}\n\treturn *o.MembersCanCreateRepos\n}\n\n// GetMembersCanCreateTeams returns the MembersCanCreateTeams field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetMembersCanCreateTeams() bool {\n\tif o == nil || o.MembersCanCreateTeams == nil {\n\t\treturn false\n\t}\n\treturn *o.MembersCanCreateTeams\n}\n\n// GetMembersCanDeleteIssues returns the MembersCanDeleteIssues field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetMembersCanDeleteIssues() bool {\n\tif o == nil || o.MembersCanDeleteIssues == nil {\n\t\treturn false\n\t}\n\treturn *o.MembersCanDeleteIssues\n}\n\n// GetMembersCanDeleteRepositories returns the MembersCanDeleteRepositories field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetMembersCanDeleteRepositories() bool {\n\tif o == nil || o.MembersCanDeleteRepositories == nil {\n\t\treturn false\n\t}\n\treturn *o.MembersCanDeleteRepositories\n}\n\n// GetMembersCanForkPrivateRepos returns the MembersCanForkPrivateRepos field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetMembersCanForkPrivateRepos() bool {\n\tif o == nil || o.MembersCanForkPrivateRepos == nil {\n\t\treturn false\n\t}\n\treturn *o.MembersCanForkPrivateRepos\n}\n\n// GetMembersCanInviteOutsideCollaborators returns the MembersCanInviteOutsideCollaborators field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetMembersCanInviteOutsideCollaborators() bool {\n\tif o == nil || o.MembersCanInviteOutsideCollaborators == nil {\n\t\treturn false\n\t}\n\treturn *o.MembersCanInviteOutsideCollaborators\n}\n\n// GetMembersCanViewDependencyInsights returns the MembersCanViewDependencyInsights field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetMembersCanViewDependencyInsights() bool {\n\tif o == nil || o.MembersCanViewDependencyInsights == nil {\n\t\treturn false\n\t}\n\treturn *o.MembersCanViewDependencyInsights\n}\n\n// GetMembersURL returns the MembersURL field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetMembersURL() string {\n\tif o == nil || o.MembersURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.MembersURL\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetName() string {\n\tif o == nil || o.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.Name\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetNodeID() string {\n\tif o == nil || o.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.NodeID\n}\n\n// GetOwnedPrivateRepos returns the OwnedPrivateRepos field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetOwnedPrivateRepos() int64 {\n\tif o == nil || o.OwnedPrivateRepos == nil {\n\t\treturn 0\n\t}\n\treturn *o.OwnedPrivateRepos\n}\n\n// GetPlan returns the Plan field.\nfunc (o *Organization) GetPlan() *Plan {\n\tif o == nil {\n\t\treturn nil\n\t}\n\treturn o.Plan\n}\n\n// GetPrivateGists returns the PrivateGists field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetPrivateGists() int {\n\tif o == nil || o.PrivateGists == nil {\n\t\treturn 0\n\t}\n\treturn *o.PrivateGists\n}\n\n// GetPublicGists returns the PublicGists field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetPublicGists() int {\n\tif o == nil || o.PublicGists == nil {\n\t\treturn 0\n\t}\n\treturn *o.PublicGists\n}\n\n// GetPublicMembersURL returns the PublicMembersURL field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetPublicMembersURL() string {\n\tif o == nil || o.PublicMembersURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.PublicMembersURL\n}\n\n// GetPublicRepos returns the PublicRepos field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetPublicRepos() int {\n\tif o == nil || o.PublicRepos == nil {\n\t\treturn 0\n\t}\n\treturn *o.PublicRepos\n}\n\n// GetReadersCanCreateDiscussions returns the ReadersCanCreateDiscussions field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetReadersCanCreateDiscussions() bool {\n\tif o == nil || o.ReadersCanCreateDiscussions == nil {\n\t\treturn false\n\t}\n\treturn *o.ReadersCanCreateDiscussions\n}\n\n// GetReposURL returns the ReposURL field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetReposURL() string {\n\tif o == nil || o.ReposURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.ReposURL\n}\n\n// GetSecretScanningEnabledForNewRepos returns the SecretScanningEnabledForNewRepos field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetSecretScanningEnabledForNewRepos() bool {\n\tif o == nil || o.SecretScanningEnabledForNewRepos == nil {\n\t\treturn false\n\t}\n\treturn *o.SecretScanningEnabledForNewRepos\n}\n\n// GetSecretScanningPushProtectionEnabledForNewRepos returns the SecretScanningPushProtectionEnabledForNewRepos field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetSecretScanningPushProtectionEnabledForNewRepos() bool {\n\tif o == nil || o.SecretScanningPushProtectionEnabledForNewRepos == nil {\n\t\treturn false\n\t}\n\treturn *o.SecretScanningPushProtectionEnabledForNewRepos\n}\n\n// GetSecretScanningValidityChecksEnabled returns the SecretScanningValidityChecksEnabled field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetSecretScanningValidityChecksEnabled() bool {\n\tif o == nil || o.SecretScanningValidityChecksEnabled == nil {\n\t\treturn false\n\t}\n\treturn *o.SecretScanningValidityChecksEnabled\n}\n\n// GetTotalPrivateRepos returns the TotalPrivateRepos field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetTotalPrivateRepos() int64 {\n\tif o == nil || o.TotalPrivateRepos == nil {\n\t\treturn 0\n\t}\n\treturn *o.TotalPrivateRepos\n}\n\n// GetTwitterUsername returns the TwitterUsername field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetTwitterUsername() string {\n\tif o == nil || o.TwitterUsername == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.TwitterUsername\n}\n\n// GetTwoFactorRequirementEnabled returns the TwoFactorRequirementEnabled field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetTwoFactorRequirementEnabled() bool {\n\tif o == nil || o.TwoFactorRequirementEnabled == nil {\n\t\treturn false\n\t}\n\treturn *o.TwoFactorRequirementEnabled\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetType() string {\n\tif o == nil || o.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.Type\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetUpdatedAt() Timestamp {\n\tif o == nil || o.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *o.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetURL() string {\n\tif o == nil || o.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.URL\n}\n\n// GetWebCommitSignoffRequired returns the WebCommitSignoffRequired field if it's non-nil, zero value otherwise.\nfunc (o *Organization) GetWebCommitSignoffRequired() bool {\n\tif o == nil || o.WebCommitSignoffRequired == nil {\n\t\treturn false\n\t}\n\treturn *o.WebCommitSignoffRequired\n}\n\n// GetProperties returns the Properties slice if it's non-nil, nil otherwise.\nfunc (o *OrganizationCustomPropertyValues) GetProperties() []*CustomPropertyValue {\n\tif o == nil || o.Properties == nil {\n\t\treturn nil\n\t}\n\treturn o.Properties\n}\n\n// GetCustomRepoRoles returns the CustomRepoRoles slice if it's non-nil, nil otherwise.\nfunc (o *OrganizationCustomRepoRoles) GetCustomRepoRoles() []*CustomRepoRoles {\n\tif o == nil || o.CustomRepoRoles == nil {\n\t\treturn nil\n\t}\n\treturn o.CustomRepoRoles\n}\n\n// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.\nfunc (o *OrganizationCustomRepoRoles) GetTotalCount() int {\n\tif o == nil || o.TotalCount == nil {\n\t\treturn 0\n\t}\n\treturn *o.TotalCount\n}\n\n// GetCustomRepoRoles returns the CustomRepoRoles slice if it's non-nil, nil otherwise.\nfunc (o *OrganizationCustomRoles) GetCustomRepoRoles() []*CustomOrgRole {\n\tif o == nil || o.CustomRepoRoles == nil {\n\t\treturn nil\n\t}\n\treturn o.CustomRepoRoles\n}\n\n// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.\nfunc (o *OrganizationCustomRoles) GetTotalCount() int {\n\tif o == nil || o.TotalCount == nil {\n\t\treturn 0\n\t}\n\treturn *o.TotalCount\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (o *OrganizationEvent) GetAction() string {\n\tif o == nil || o.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.Action\n}\n\n// GetInstallation returns the Installation field.\nfunc (o *OrganizationEvent) GetInstallation() *Installation {\n\tif o == nil {\n\t\treturn nil\n\t}\n\treturn o.Installation\n}\n\n// GetInvitation returns the Invitation field.\nfunc (o *OrganizationEvent) GetInvitation() *Invitation {\n\tif o == nil {\n\t\treturn nil\n\t}\n\treturn o.Invitation\n}\n\n// GetMembership returns the Membership field.\nfunc (o *OrganizationEvent) GetMembership() *Membership {\n\tif o == nil {\n\t\treturn nil\n\t}\n\treturn o.Membership\n}\n\n// GetOrganization returns the Organization field.\nfunc (o *OrganizationEvent) GetOrganization() *Organization {\n\tif o == nil {\n\t\treturn nil\n\t}\n\treturn o.Organization\n}\n\n// GetSender returns the Sender field.\nfunc (o *OrganizationEvent) GetSender() *User {\n\tif o == nil {\n\t\treturn nil\n\t}\n\treturn o.Sender\n}\n\n// GetDescription returns the Description field.\nfunc (o *OrganizationFineGrainedPermission) GetDescription() string {\n\tif o == nil {\n\t\treturn \"\"\n\t}\n\treturn o.Description\n}\n\n// GetName returns the Name field.\nfunc (o *OrganizationFineGrainedPermission) GetName() string {\n\tif o == nil {\n\t\treturn \"\"\n\t}\n\treturn o.Name\n}\n\n// GetInstallations returns the Installations slice if it's non-nil, nil otherwise.\nfunc (o *OrganizationInstallations) GetInstallations() []*Installation {\n\tif o == nil || o.Installations == nil {\n\t\treturn nil\n\t}\n\treturn o.Installations\n}\n\n// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.\nfunc (o *OrganizationInstallations) GetTotalCount() int {\n\tif o == nil || o.TotalCount == nil {\n\t\treturn 0\n\t}\n\treturn *o.TotalCount\n}\n\n// GetPerPage returns the PerPage field.\nfunc (o *OrganizationsListOptions) GetPerPage() int {\n\tif o == nil {\n\t\treturn 0\n\t}\n\treturn o.PerPage\n}\n\n// GetSince returns the Since field.\nfunc (o *OrganizationsListOptions) GetSince() int64 {\n\tif o == nil {\n\t\treturn 0\n\t}\n\treturn o.Since\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (o *OrgBlockEvent) GetAction() string {\n\tif o == nil || o.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *o.Action\n}\n\n// GetBlockedUser returns the BlockedUser field.\nfunc (o *OrgBlockEvent) GetBlockedUser() *User {\n\tif o == nil {\n\t\treturn nil\n\t}\n\treturn o.BlockedUser\n}\n\n// GetInstallation returns the Installation field.\nfunc (o *OrgBlockEvent) GetInstallation() *Installation {\n\tif o == nil {\n\t\treturn nil\n\t}\n\treturn o.Installation\n}\n\n// GetOrganization returns the Organization field.\nfunc (o *OrgBlockEvent) GetOrganization() *Organization {\n\tif o == nil {\n\t\treturn nil\n\t}\n\treturn o.Organization\n}\n\n// GetSender returns the Sender field.\nfunc (o *OrgBlockEvent) GetSender() *User {\n\tif o == nil {\n\t\treturn nil\n\t}\n\treturn o.Sender\n}\n\n// GetDisabledOrgs returns the DisabledOrgs field if it's non-nil, zero value otherwise.\nfunc (o *OrgStats) GetDisabledOrgs() int {\n\tif o == nil || o.DisabledOrgs == nil {\n\t\treturn 0\n\t}\n\treturn *o.DisabledOrgs\n}\n\n// GetTotalOrgs returns the TotalOrgs field if it's non-nil, zero value otherwise.\nfunc (o *OrgStats) GetTotalOrgs() int {\n\tif o == nil || o.TotalOrgs == nil {\n\t\treturn 0\n\t}\n\treturn *o.TotalOrgs\n}\n\n// GetTotalTeamMembers returns the TotalTeamMembers field if it's non-nil, zero value otherwise.\nfunc (o *OrgStats) GetTotalTeamMembers() int {\n\tif o == nil || o.TotalTeamMembers == nil {\n\t\treturn 0\n\t}\n\treturn *o.TotalTeamMembers\n}\n\n// GetTotalTeams returns the TotalTeams field if it's non-nil, zero value otherwise.\nfunc (o *OrgStats) GetTotalTeams() int {\n\tif o == nil || o.TotalTeams == nil {\n\t\treturn 0\n\t}\n\treturn *o.TotalTeams\n}\n\n// GetOrg returns the Org field.\nfunc (o *OwnerInfo) GetOrg() *User {\n\tif o == nil {\n\t\treturn nil\n\t}\n\treturn o.Org\n}\n\n// GetUser returns the User field.\nfunc (o *OwnerInfo) GetUser() *User {\n\tif o == nil {\n\t\treturn nil\n\t}\n\treturn o.User\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (p *Package) GetCreatedAt() Timestamp {\n\tif p == nil || p.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.CreatedAt\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (p *Package) GetDescription() string {\n\tif p == nil || p.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Description\n}\n\n// GetEcosystem returns the Ecosystem field if it's non-nil, zero value otherwise.\nfunc (p *Package) GetEcosystem() string {\n\tif p == nil || p.Ecosystem == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Ecosystem\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (p *Package) GetHTMLURL() string {\n\tif p == nil || p.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (p *Package) GetID() int64 {\n\tif p == nil || p.ID == nil {\n\t\treturn 0\n\t}\n\treturn *p.ID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (p *Package) GetName() string {\n\tif p == nil || p.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Name\n}\n\n// GetNamespace returns the Namespace field if it's non-nil, zero value otherwise.\nfunc (p *Package) GetNamespace() string {\n\tif p == nil || p.Namespace == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Namespace\n}\n\n// GetOwner returns the Owner field.\nfunc (p *Package) GetOwner() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Owner\n}\n\n// GetPackageType returns the PackageType field if it's non-nil, zero value otherwise.\nfunc (p *Package) GetPackageType() string {\n\tif p == nil || p.PackageType == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.PackageType\n}\n\n// GetPackageVersion returns the PackageVersion field.\nfunc (p *Package) GetPackageVersion() *PackageVersion {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.PackageVersion\n}\n\n// GetRegistry returns the Registry field.\nfunc (p *Package) GetRegistry() *PackageRegistry {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Registry\n}\n\n// GetRepository returns the Repository field.\nfunc (p *Package) GetRepository() *Repository {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Repository\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (p *Package) GetUpdatedAt() Timestamp {\n\tif p == nil || p.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (p *Package) GetURL() string {\n\tif p == nil || p.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.URL\n}\n\n// GetVersionCount returns the VersionCount field if it's non-nil, zero value otherwise.\nfunc (p *Package) GetVersionCount() int64 {\n\tif p == nil || p.VersionCount == nil {\n\t\treturn 0\n\t}\n\treturn *p.VersionCount\n}\n\n// GetVisibility returns the Visibility field if it's non-nil, zero value otherwise.\nfunc (p *Package) GetVisibility() string {\n\tif p == nil || p.Visibility == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Visibility\n}\n\n// GetTags returns the Tags slice if it's non-nil, nil otherwise.\nfunc (p *PackageContainerMetadata) GetTags() []string {\n\tif p == nil || p.Tags == nil {\n\t\treturn nil\n\t}\n\treturn p.Tags\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (p *PackageEvent) GetAction() string {\n\tif p == nil || p.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Action\n}\n\n// GetInstallation returns the Installation field.\nfunc (p *PackageEvent) GetInstallation() *Installation {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (p *PackageEvent) GetOrg() *Organization {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Org\n}\n\n// GetPackage returns the Package field.\nfunc (p *PackageEvent) GetPackage() *Package {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Package\n}\n\n// GetRepo returns the Repo field.\nfunc (p *PackageEvent) GetRepo() *Repository {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (p *PackageEvent) GetSender() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Sender\n}\n\n// GetLabels returns the Labels map if it's non-nil, an empty map otherwise.\nfunc (p *PackageEventContainerMetadata) GetLabels() map[string]any {\n\tif p == nil || p.Labels == nil {\n\t\treturn map[string]any{}\n\t}\n\treturn p.Labels\n}\n\n// GetManifest returns the Manifest map if it's non-nil, an empty map otherwise.\nfunc (p *PackageEventContainerMetadata) GetManifest() map[string]any {\n\tif p == nil || p.Manifest == nil {\n\t\treturn map[string]any{}\n\t}\n\treturn p.Manifest\n}\n\n// GetTag returns the Tag field.\nfunc (p *PackageEventContainerMetadata) GetTag() *PackageEventContainerMetadataTag {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Tag\n}\n\n// GetDigest returns the Digest field if it's non-nil, zero value otherwise.\nfunc (p *PackageEventContainerMetadataTag) GetDigest() string {\n\tif p == nil || p.Digest == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Digest\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (p *PackageEventContainerMetadataTag) GetName() string {\n\tif p == nil || p.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Name\n}\n\n// GetReferenceCategory returns the ReferenceCategory field.\nfunc (p *PackageExternalRef) GetReferenceCategory() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn p.ReferenceCategory\n}\n\n// GetReferenceLocator returns the ReferenceLocator field.\nfunc (p *PackageExternalRef) GetReferenceLocator() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn p.ReferenceLocator\n}\n\n// GetReferenceType returns the ReferenceType field.\nfunc (p *PackageExternalRef) GetReferenceType() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn p.ReferenceType\n}\n\n// GetAuthor returns the Author field.\nfunc (p *PackageFile) GetAuthor() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Author\n}\n\n// GetContentType returns the ContentType field if it's non-nil, zero value otherwise.\nfunc (p *PackageFile) GetContentType() string {\n\tif p == nil || p.ContentType == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.ContentType\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (p *PackageFile) GetCreatedAt() Timestamp {\n\tif p == nil || p.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.CreatedAt\n}\n\n// GetDownloadURL returns the DownloadURL field if it's non-nil, zero value otherwise.\nfunc (p *PackageFile) GetDownloadURL() string {\n\tif p == nil || p.DownloadURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.DownloadURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (p *PackageFile) GetID() int64 {\n\tif p == nil || p.ID == nil {\n\t\treturn 0\n\t}\n\treturn *p.ID\n}\n\n// GetMD5 returns the MD5 field if it's non-nil, zero value otherwise.\nfunc (p *PackageFile) GetMD5() string {\n\tif p == nil || p.MD5 == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.MD5\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (p *PackageFile) GetName() string {\n\tif p == nil || p.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Name\n}\n\n// GetSHA1 returns the SHA1 field if it's non-nil, zero value otherwise.\nfunc (p *PackageFile) GetSHA1() string {\n\tif p == nil || p.SHA1 == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.SHA1\n}\n\n// GetSHA256 returns the SHA256 field if it's non-nil, zero value otherwise.\nfunc (p *PackageFile) GetSHA256() string {\n\tif p == nil || p.SHA256 == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.SHA256\n}\n\n// GetSize returns the Size field if it's non-nil, zero value otherwise.\nfunc (p *PackageFile) GetSize() int64 {\n\tif p == nil || p.Size == nil {\n\t\treturn 0\n\t}\n\treturn *p.Size\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (p *PackageFile) GetState() string {\n\tif p == nil || p.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.State\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (p *PackageFile) GetUpdatedAt() Timestamp {\n\tif p == nil || p.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.UpdatedAt\n}\n\n// GetPackageType returns the PackageType field if it's non-nil, zero value otherwise.\nfunc (p *PackageListOptions) GetPackageType() string {\n\tif p == nil || p.PackageType == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.PackageType\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (p *PackageListOptions) GetState() string {\n\tif p == nil || p.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.State\n}\n\n// GetVisibility returns the Visibility field if it's non-nil, zero value otherwise.\nfunc (p *PackageListOptions) GetVisibility() string {\n\tif p == nil || p.Visibility == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Visibility\n}\n\n// GetContainer returns the Container field.\nfunc (p *PackageMetadata) GetContainer() *PackageContainerMetadata {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Container\n}\n\n// GetPackageType returns the PackageType field if it's non-nil, zero value otherwise.\nfunc (p *PackageMetadata) GetPackageType() string {\n\tif p == nil || p.PackageType == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.PackageType\n}\n\n// GetAuthor returns the Author map if it's non-nil, an empty map otherwise.\nfunc (p *PackageNPMMetadata) GetAuthor() map[string]string {\n\tif p == nil || p.Author == nil {\n\t\treturn map[string]string{}\n\t}\n\treturn p.Author\n}\n\n// GetBin returns the Bin map if it's non-nil, an empty map otherwise.\nfunc (p *PackageNPMMetadata) GetBin() map[string]any {\n\tif p == nil || p.Bin == nil {\n\t\treturn map[string]any{}\n\t}\n\treturn p.Bin\n}\n\n// GetBugs returns the Bugs map if it's non-nil, an empty map otherwise.\nfunc (p *PackageNPMMetadata) GetBugs() map[string]string {\n\tif p == nil || p.Bugs == nil {\n\t\treturn map[string]string{}\n\t}\n\treturn p.Bugs\n}\n\n// GetCommitOID returns the CommitOID field if it's non-nil, zero value otherwise.\nfunc (p *PackageNPMMetadata) GetCommitOID() string {\n\tif p == nil || p.CommitOID == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.CommitOID\n}\n\n// GetContributors returns the Contributors slice if it's non-nil, nil otherwise.\nfunc (p *PackageNPMMetadata) GetContributors() []any {\n\tif p == nil || p.Contributors == nil {\n\t\treturn nil\n\t}\n\treturn p.Contributors\n}\n\n// GetCPU returns the CPU slice if it's non-nil, nil otherwise.\nfunc (p *PackageNPMMetadata) GetCPU() []string {\n\tif p == nil || p.CPU == nil {\n\t\treturn nil\n\t}\n\treturn p.CPU\n}\n\n// GetDeletedByID returns the DeletedByID field if it's non-nil, zero value otherwise.\nfunc (p *PackageNPMMetadata) GetDeletedByID() int64 {\n\tif p == nil || p.DeletedByID == nil {\n\t\treturn 0\n\t}\n\treturn *p.DeletedByID\n}\n\n// GetDependencies returns the Dependencies map if it's non-nil, an empty map otherwise.\nfunc (p *PackageNPMMetadata) GetDependencies() map[string]string {\n\tif p == nil || p.Dependencies == nil {\n\t\treturn map[string]string{}\n\t}\n\treturn p.Dependencies\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (p *PackageNPMMetadata) GetDescription() string {\n\tif p == nil || p.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Description\n}\n\n// GetDevDependencies returns the DevDependencies map if it's non-nil, an empty map otherwise.\nfunc (p *PackageNPMMetadata) GetDevDependencies() map[string]string {\n\tif p == nil || p.DevDependencies == nil {\n\t\treturn map[string]string{}\n\t}\n\treturn p.DevDependencies\n}\n\n// GetDirectories returns the Directories map if it's non-nil, an empty map otherwise.\nfunc (p *PackageNPMMetadata) GetDirectories() map[string]string {\n\tif p == nil || p.Directories == nil {\n\t\treturn map[string]string{}\n\t}\n\treturn p.Directories\n}\n\n// GetDist returns the Dist map if it's non-nil, an empty map otherwise.\nfunc (p *PackageNPMMetadata) GetDist() map[string]string {\n\tif p == nil || p.Dist == nil {\n\t\treturn map[string]string{}\n\t}\n\treturn p.Dist\n}\n\n// GetEngines returns the Engines map if it's non-nil, an empty map otherwise.\nfunc (p *PackageNPMMetadata) GetEngines() map[string]string {\n\tif p == nil || p.Engines == nil {\n\t\treturn map[string]string{}\n\t}\n\treturn p.Engines\n}\n\n// GetFiles returns the Files slice if it's non-nil, nil otherwise.\nfunc (p *PackageNPMMetadata) GetFiles() []string {\n\tif p == nil || p.Files == nil {\n\t\treturn nil\n\t}\n\treturn p.Files\n}\n\n// GetGitHead returns the GitHead field if it's non-nil, zero value otherwise.\nfunc (p *PackageNPMMetadata) GetGitHead() string {\n\tif p == nil || p.GitHead == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.GitHead\n}\n\n// GetHasShrinkwrap returns the HasShrinkwrap field if it's non-nil, zero value otherwise.\nfunc (p *PackageNPMMetadata) GetHasShrinkwrap() bool {\n\tif p == nil || p.HasShrinkwrap == nil {\n\t\treturn false\n\t}\n\treturn *p.HasShrinkwrap\n}\n\n// GetHomepage returns the Homepage field if it's non-nil, zero value otherwise.\nfunc (p *PackageNPMMetadata) GetHomepage() string {\n\tif p == nil || p.Homepage == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Homepage\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (p *PackageNPMMetadata) GetID() string {\n\tif p == nil || p.ID == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.ID\n}\n\n// GetInstallationCommand returns the InstallationCommand field if it's non-nil, zero value otherwise.\nfunc (p *PackageNPMMetadata) GetInstallationCommand() string {\n\tif p == nil || p.InstallationCommand == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.InstallationCommand\n}\n\n// GetKeywords returns the Keywords slice if it's non-nil, nil otherwise.\nfunc (p *PackageNPMMetadata) GetKeywords() []string {\n\tif p == nil || p.Keywords == nil {\n\t\treturn nil\n\t}\n\treturn p.Keywords\n}\n\n// GetLicense returns the License field if it's non-nil, zero value otherwise.\nfunc (p *PackageNPMMetadata) GetLicense() string {\n\tif p == nil || p.License == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.License\n}\n\n// GetMain returns the Main field if it's non-nil, zero value otherwise.\nfunc (p *PackageNPMMetadata) GetMain() string {\n\tif p == nil || p.Main == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Main\n}\n\n// GetMaintainers returns the Maintainers slice if it's non-nil, nil otherwise.\nfunc (p *PackageNPMMetadata) GetMaintainers() []any {\n\tif p == nil || p.Maintainers == nil {\n\t\treturn nil\n\t}\n\treturn p.Maintainers\n}\n\n// GetMan returns the Man map if it's non-nil, an empty map otherwise.\nfunc (p *PackageNPMMetadata) GetMan() map[string]any {\n\tif p == nil || p.Man == nil {\n\t\treturn map[string]any{}\n\t}\n\treturn p.Man\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (p *PackageNPMMetadata) GetName() string {\n\tif p == nil || p.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Name\n}\n\n// GetNodeVersion returns the NodeVersion field if it's non-nil, zero value otherwise.\nfunc (p *PackageNPMMetadata) GetNodeVersion() string {\n\tif p == nil || p.NodeVersion == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.NodeVersion\n}\n\n// GetNPMUser returns the NPMUser field if it's non-nil, zero value otherwise.\nfunc (p *PackageNPMMetadata) GetNPMUser() string {\n\tif p == nil || p.NPMUser == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.NPMUser\n}\n\n// GetNPMVersion returns the NPMVersion field if it's non-nil, zero value otherwise.\nfunc (p *PackageNPMMetadata) GetNPMVersion() string {\n\tif p == nil || p.NPMVersion == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.NPMVersion\n}\n\n// GetOptionalDependencies returns the OptionalDependencies map if it's non-nil, an empty map otherwise.\nfunc (p *PackageNPMMetadata) GetOptionalDependencies() map[string]string {\n\tif p == nil || p.OptionalDependencies == nil {\n\t\treturn map[string]string{}\n\t}\n\treturn p.OptionalDependencies\n}\n\n// GetOS returns the OS slice if it's non-nil, nil otherwise.\nfunc (p *PackageNPMMetadata) GetOS() []string {\n\tif p == nil || p.OS == nil {\n\t\treturn nil\n\t}\n\treturn p.OS\n}\n\n// GetPeerDependencies returns the PeerDependencies map if it's non-nil, an empty map otherwise.\nfunc (p *PackageNPMMetadata) GetPeerDependencies() map[string]string {\n\tif p == nil || p.PeerDependencies == nil {\n\t\treturn map[string]string{}\n\t}\n\treturn p.PeerDependencies\n}\n\n// GetPublishedViaActions returns the PublishedViaActions field if it's non-nil, zero value otherwise.\nfunc (p *PackageNPMMetadata) GetPublishedViaActions() bool {\n\tif p == nil || p.PublishedViaActions == nil {\n\t\treturn false\n\t}\n\treturn *p.PublishedViaActions\n}\n\n// GetReadme returns the Readme field if it's non-nil, zero value otherwise.\nfunc (p *PackageNPMMetadata) GetReadme() string {\n\tif p == nil || p.Readme == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Readme\n}\n\n// GetReleaseID returns the ReleaseID field if it's non-nil, zero value otherwise.\nfunc (p *PackageNPMMetadata) GetReleaseID() int64 {\n\tif p == nil || p.ReleaseID == nil {\n\t\treturn 0\n\t}\n\treturn *p.ReleaseID\n}\n\n// GetRepository returns the Repository map if it's non-nil, an empty map otherwise.\nfunc (p *PackageNPMMetadata) GetRepository() map[string]string {\n\tif p == nil || p.Repository == nil {\n\t\treturn map[string]string{}\n\t}\n\treturn p.Repository\n}\n\n// GetScripts returns the Scripts map if it's non-nil, an empty map otherwise.\nfunc (p *PackageNPMMetadata) GetScripts() map[string]any {\n\tif p == nil || p.Scripts == nil {\n\t\treturn map[string]any{}\n\t}\n\treturn p.Scripts\n}\n\n// GetVersion returns the Version field if it's non-nil, zero value otherwise.\nfunc (p *PackageNPMMetadata) GetVersion() string {\n\tif p == nil || p.Version == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Version\n}\n\n// GetID returns the ID field.\nfunc (p *PackageNugetMetadata) GetID() json.RawMessage {\n\tif p == nil {\n\t\treturn json.RawMessage{}\n\t}\n\treturn p.ID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (p *PackageNugetMetadata) GetName() string {\n\tif p == nil || p.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Name\n}\n\n// GetValue returns the Value field.\nfunc (p *PackageNugetMetadata) GetValue() json.RawMessage {\n\tif p == nil {\n\t\treturn json.RawMessage{}\n\t}\n\treturn p.Value\n}\n\n// GetAboutURL returns the AboutURL field if it's non-nil, zero value otherwise.\nfunc (p *PackageRegistry) GetAboutURL() string {\n\tif p == nil || p.AboutURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.AboutURL\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (p *PackageRegistry) GetName() string {\n\tif p == nil || p.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Name\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (p *PackageRegistry) GetType() string {\n\tif p == nil || p.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Type\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (p *PackageRegistry) GetURL() string {\n\tif p == nil || p.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.URL\n}\n\n// GetVendor returns the Vendor field if it's non-nil, zero value otherwise.\nfunc (p *PackageRegistry) GetVendor() string {\n\tif p == nil || p.Vendor == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Vendor\n}\n\n// GetAuthor returns the Author field.\nfunc (p *PackageRelease) GetAuthor() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Author\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (p *PackageRelease) GetCreatedAt() Timestamp {\n\tif p == nil || p.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.CreatedAt\n}\n\n// GetDraft returns the Draft field if it's non-nil, zero value otherwise.\nfunc (p *PackageRelease) GetDraft() bool {\n\tif p == nil || p.Draft == nil {\n\t\treturn false\n\t}\n\treturn *p.Draft\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (p *PackageRelease) GetHTMLURL() string {\n\tif p == nil || p.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (p *PackageRelease) GetID() int64 {\n\tif p == nil || p.ID == nil {\n\t\treturn 0\n\t}\n\treturn *p.ID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (p *PackageRelease) GetName() string {\n\tif p == nil || p.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Name\n}\n\n// GetPrerelease returns the Prerelease field if it's non-nil, zero value otherwise.\nfunc (p *PackageRelease) GetPrerelease() bool {\n\tif p == nil || p.Prerelease == nil {\n\t\treturn false\n\t}\n\treturn *p.Prerelease\n}\n\n// GetPublishedAt returns the PublishedAt field if it's non-nil, zero value otherwise.\nfunc (p *PackageRelease) GetPublishedAt() Timestamp {\n\tif p == nil || p.PublishedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.PublishedAt\n}\n\n// GetTagName returns the TagName field if it's non-nil, zero value otherwise.\nfunc (p *PackageRelease) GetTagName() string {\n\tif p == nil || p.TagName == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.TagName\n}\n\n// GetTargetCommitish returns the TargetCommitish field if it's non-nil, zero value otherwise.\nfunc (p *PackageRelease) GetTargetCommitish() string {\n\tif p == nil || p.TargetCommitish == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.TargetCommitish\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (p *PackageRelease) GetURL() string {\n\tif p == nil || p.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.URL\n}\n\n// GetIncludedGigabytesBandwidth returns the IncludedGigabytesBandwidth field.\nfunc (p *PackagesBilling) GetIncludedGigabytesBandwidth() int {\n\tif p == nil {\n\t\treturn 0\n\t}\n\treturn p.IncludedGigabytesBandwidth\n}\n\n// GetTotalGigabytesBandwidthUsed returns the TotalGigabytesBandwidthUsed field.\nfunc (p *PackagesBilling) GetTotalGigabytesBandwidthUsed() int {\n\tif p == nil {\n\t\treturn 0\n\t}\n\treturn p.TotalGigabytesBandwidthUsed\n}\n\n// GetTotalPaidGigabytesBandwidthUsed returns the TotalPaidGigabytesBandwidthUsed field.\nfunc (p *PackagesBilling) GetTotalPaidGigabytesBandwidthUsed() int {\n\tif p == nil {\n\t\treturn 0\n\t}\n\treturn p.TotalPaidGigabytesBandwidthUsed\n}\n\n// GetAuthor returns the Author field.\nfunc (p *PackageVersion) GetAuthor() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Author\n}\n\n// GetBodyHTML returns the BodyHTML field if it's non-nil, zero value otherwise.\nfunc (p *PackageVersion) GetBodyHTML() string {\n\tif p == nil || p.BodyHTML == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.BodyHTML\n}\n\n// GetContainerMetadata returns the ContainerMetadata field.\nfunc (p *PackageVersion) GetContainerMetadata() *PackageEventContainerMetadata {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.ContainerMetadata\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (p *PackageVersion) GetCreatedAt() Timestamp {\n\tif p == nil || p.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.CreatedAt\n}\n\n// GetDeletedAt returns the DeletedAt field if it's non-nil, zero value otherwise.\nfunc (p *PackageVersion) GetDeletedAt() Timestamp {\n\tif p == nil || p.DeletedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.DeletedAt\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (p *PackageVersion) GetDescription() string {\n\tif p == nil || p.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Description\n}\n\n// GetDockerMetadata returns the DockerMetadata slice if it's non-nil, nil otherwise.\nfunc (p *PackageVersion) GetDockerMetadata() []any {\n\tif p == nil || p.DockerMetadata == nil {\n\t\treturn nil\n\t}\n\treturn p.DockerMetadata\n}\n\n// GetDraft returns the Draft field if it's non-nil, zero value otherwise.\nfunc (p *PackageVersion) GetDraft() bool {\n\tif p == nil || p.Draft == nil {\n\t\treturn false\n\t}\n\treturn *p.Draft\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (p *PackageVersion) GetHTMLURL() string {\n\tif p == nil || p.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (p *PackageVersion) GetID() int64 {\n\tif p == nil || p.ID == nil {\n\t\treturn 0\n\t}\n\treturn *p.ID\n}\n\n// GetInstallationCommand returns the InstallationCommand field if it's non-nil, zero value otherwise.\nfunc (p *PackageVersion) GetInstallationCommand() string {\n\tif p == nil || p.InstallationCommand == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.InstallationCommand\n}\n\n// GetLicense returns the License field if it's non-nil, zero value otherwise.\nfunc (p *PackageVersion) GetLicense() string {\n\tif p == nil || p.License == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.License\n}\n\n// GetManifest returns the Manifest field if it's non-nil, zero value otherwise.\nfunc (p *PackageVersion) GetManifest() string {\n\tif p == nil || p.Manifest == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Manifest\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (p *PackageVersion) GetName() string {\n\tif p == nil || p.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Name\n}\n\n// GetNPMMetadata returns the NPMMetadata field.\nfunc (p *PackageVersion) GetNPMMetadata() *PackageNPMMetadata {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.NPMMetadata\n}\n\n// GetNugetMetadata returns the NugetMetadata slice if it's non-nil, nil otherwise.\nfunc (p *PackageVersion) GetNugetMetadata() []*PackageNugetMetadata {\n\tif p == nil || p.NugetMetadata == nil {\n\t\treturn nil\n\t}\n\treturn p.NugetMetadata\n}\n\n// GetPackageFiles returns the PackageFiles slice if it's non-nil, nil otherwise.\nfunc (p *PackageVersion) GetPackageFiles() []*PackageFile {\n\tif p == nil || p.PackageFiles == nil {\n\t\treturn nil\n\t}\n\treturn p.PackageFiles\n}\n\n// GetPackageHTMLURL returns the PackageHTMLURL field if it's non-nil, zero value otherwise.\nfunc (p *PackageVersion) GetPackageHTMLURL() string {\n\tif p == nil || p.PackageHTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.PackageHTMLURL\n}\n\n// GetPackageURL returns the PackageURL field if it's non-nil, zero value otherwise.\nfunc (p *PackageVersion) GetPackageURL() string {\n\tif p == nil || p.PackageURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.PackageURL\n}\n\n// GetPrerelease returns the Prerelease field if it's non-nil, zero value otherwise.\nfunc (p *PackageVersion) GetPrerelease() bool {\n\tif p == nil || p.Prerelease == nil {\n\t\treturn false\n\t}\n\treturn *p.Prerelease\n}\n\n// GetRelease returns the Release field.\nfunc (p *PackageVersion) GetRelease() *PackageRelease {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Release\n}\n\n// GetRubyMetadata returns the RubyMetadata map if it's non-nil, an empty map otherwise.\nfunc (p *PackageVersion) GetRubyMetadata() map[string]any {\n\tif p == nil || p.RubyMetadata == nil {\n\t\treturn map[string]any{}\n\t}\n\treturn p.RubyMetadata\n}\n\n// GetSourceURL returns the SourceURL field if it's non-nil, zero value otherwise.\nfunc (p *PackageVersion) GetSourceURL() string {\n\tif p == nil || p.SourceURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.SourceURL\n}\n\n// GetSummary returns the Summary field if it's non-nil, zero value otherwise.\nfunc (p *PackageVersion) GetSummary() string {\n\tif p == nil || p.Summary == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Summary\n}\n\n// GetTagName returns the TagName field if it's non-nil, zero value otherwise.\nfunc (p *PackageVersion) GetTagName() string {\n\tif p == nil || p.TagName == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.TagName\n}\n\n// GetTargetCommitish returns the TargetCommitish field if it's non-nil, zero value otherwise.\nfunc (p *PackageVersion) GetTargetCommitish() string {\n\tif p == nil || p.TargetCommitish == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.TargetCommitish\n}\n\n// GetTargetOID returns the TargetOID field if it's non-nil, zero value otherwise.\nfunc (p *PackageVersion) GetTargetOID() string {\n\tif p == nil || p.TargetOID == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.TargetOID\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (p *PackageVersion) GetUpdatedAt() Timestamp {\n\tif p == nil || p.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (p *PackageVersion) GetURL() string {\n\tif p == nil || p.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.URL\n}\n\n// GetVersion returns the Version field if it's non-nil, zero value otherwise.\nfunc (p *PackageVersion) GetVersion() string {\n\tif p == nil || p.Version == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Version\n}\n\n// GetInfo returns the Info field.\nfunc (p *PackageVersionBody) GetInfo() *PackageVersionBodyInfo {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Info\n}\n\n// GetRepo returns the Repo field.\nfunc (p *PackageVersionBody) GetRepo() *Repository {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Repo\n}\n\n// GetCollection returns the Collection field if it's non-nil, zero value otherwise.\nfunc (p *PackageVersionBodyInfo) GetCollection() bool {\n\tif p == nil || p.Collection == nil {\n\t\treturn false\n\t}\n\treturn *p.Collection\n}\n\n// GetMode returns the Mode field if it's non-nil, zero value otherwise.\nfunc (p *PackageVersionBodyInfo) GetMode() int64 {\n\tif p == nil || p.Mode == nil {\n\t\treturn 0\n\t}\n\treturn *p.Mode\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (p *PackageVersionBodyInfo) GetName() string {\n\tif p == nil || p.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Name\n}\n\n// GetOID returns the OID field if it's non-nil, zero value otherwise.\nfunc (p *PackageVersionBodyInfo) GetOID() string {\n\tif p == nil || p.OID == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.OID\n}\n\n// GetPath returns the Path field if it's non-nil, zero value otherwise.\nfunc (p *PackageVersionBodyInfo) GetPath() string {\n\tif p == nil || p.Path == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Path\n}\n\n// GetSize returns the Size field if it's non-nil, zero value otherwise.\nfunc (p *PackageVersionBodyInfo) GetSize() int64 {\n\tif p == nil || p.Size == nil {\n\t\treturn 0\n\t}\n\treturn *p.Size\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (p *PackageVersionBodyInfo) GetType() string {\n\tif p == nil || p.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Type\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (p *Page) GetAction() string {\n\tif p == nil || p.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Action\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (p *Page) GetHTMLURL() string {\n\tif p == nil || p.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.HTMLURL\n}\n\n// GetPageName returns the PageName field if it's non-nil, zero value otherwise.\nfunc (p *Page) GetPageName() string {\n\tif p == nil || p.PageName == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.PageName\n}\n\n// GetSHA returns the SHA field if it's non-nil, zero value otherwise.\nfunc (p *Page) GetSHA() string {\n\tif p == nil || p.SHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.SHA\n}\n\n// GetSummary returns the Summary field if it's non-nil, zero value otherwise.\nfunc (p *Page) GetSummary() string {\n\tif p == nil || p.Summary == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Summary\n}\n\n// GetTitle returns the Title field if it's non-nil, zero value otherwise.\nfunc (p *Page) GetTitle() string {\n\tif p == nil || p.Title == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Title\n}\n\n// GetBuild returns the Build field.\nfunc (p *PageBuildEvent) GetBuild() *PagesBuild {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Build\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (p *PageBuildEvent) GetID() int64 {\n\tif p == nil || p.ID == nil {\n\t\treturn 0\n\t}\n\treturn *p.ID\n}\n\n// GetInstallation returns the Installation field.\nfunc (p *PageBuildEvent) GetInstallation() *Installation {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (p *PageBuildEvent) GetOrg() *Organization {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Org\n}\n\n// GetRepo returns the Repo field.\nfunc (p *PageBuildEvent) GetRepo() *Repository {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (p *PageBuildEvent) GetSender() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Sender\n}\n\n// GetBuildType returns the BuildType field if it's non-nil, zero value otherwise.\nfunc (p *Pages) GetBuildType() string {\n\tif p == nil || p.BuildType == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.BuildType\n}\n\n// GetCNAME returns the CNAME field if it's non-nil, zero value otherwise.\nfunc (p *Pages) GetCNAME() string {\n\tif p == nil || p.CNAME == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.CNAME\n}\n\n// GetCustom404 returns the Custom404 field if it's non-nil, zero value otherwise.\nfunc (p *Pages) GetCustom404() bool {\n\tif p == nil || p.Custom404 == nil {\n\t\treturn false\n\t}\n\treturn *p.Custom404\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (p *Pages) GetHTMLURL() string {\n\tif p == nil || p.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.HTMLURL\n}\n\n// GetHTTPSCertificate returns the HTTPSCertificate field.\nfunc (p *Pages) GetHTTPSCertificate() *PagesHTTPSCertificate {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.HTTPSCertificate\n}\n\n// GetHTTPSEnforced returns the HTTPSEnforced field if it's non-nil, zero value otherwise.\nfunc (p *Pages) GetHTTPSEnforced() bool {\n\tif p == nil || p.HTTPSEnforced == nil {\n\t\treturn false\n\t}\n\treturn *p.HTTPSEnforced\n}\n\n// GetPublic returns the Public field if it's non-nil, zero value otherwise.\nfunc (p *Pages) GetPublic() bool {\n\tif p == nil || p.Public == nil {\n\t\treturn false\n\t}\n\treturn *p.Public\n}\n\n// GetSource returns the Source field.\nfunc (p *Pages) GetSource() *PagesSource {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Source\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (p *Pages) GetStatus() string {\n\tif p == nil || p.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Status\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (p *Pages) GetURL() string {\n\tif p == nil || p.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.URL\n}\n\n// GetCommit returns the Commit field if it's non-nil, zero value otherwise.\nfunc (p *PagesBuild) GetCommit() string {\n\tif p == nil || p.Commit == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Commit\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (p *PagesBuild) GetCreatedAt() Timestamp {\n\tif p == nil || p.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.CreatedAt\n}\n\n// GetDuration returns the Duration field if it's non-nil, zero value otherwise.\nfunc (p *PagesBuild) GetDuration() int {\n\tif p == nil || p.Duration == nil {\n\t\treturn 0\n\t}\n\treturn *p.Duration\n}\n\n// GetError returns the Error field.\nfunc (p *PagesBuild) GetError() *PagesError {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Error\n}\n\n// GetPusher returns the Pusher field.\nfunc (p *PagesBuild) GetPusher() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Pusher\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (p *PagesBuild) GetStatus() string {\n\tif p == nil || p.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Status\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (p *PagesBuild) GetUpdatedAt() Timestamp {\n\tif p == nil || p.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (p *PagesBuild) GetURL() string {\n\tif p == nil || p.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.URL\n}\n\n// GetCAAError returns the CAAError field if it's non-nil, zero value otherwise.\nfunc (p *PagesDomain) GetCAAError() string {\n\tif p == nil || p.CAAError == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.CAAError\n}\n\n// GetDNSResolves returns the DNSResolves field if it's non-nil, zero value otherwise.\nfunc (p *PagesDomain) GetDNSResolves() bool {\n\tif p == nil || p.DNSResolves == nil {\n\t\treturn false\n\t}\n\treturn *p.DNSResolves\n}\n\n// GetEnforcesHTTPS returns the EnforcesHTTPS field if it's non-nil, zero value otherwise.\nfunc (p *PagesDomain) GetEnforcesHTTPS() bool {\n\tif p == nil || p.EnforcesHTTPS == nil {\n\t\treturn false\n\t}\n\treturn *p.EnforcesHTTPS\n}\n\n// GetHasCNAMERecord returns the HasCNAMERecord field if it's non-nil, zero value otherwise.\nfunc (p *PagesDomain) GetHasCNAMERecord() bool {\n\tif p == nil || p.HasCNAMERecord == nil {\n\t\treturn false\n\t}\n\treturn *p.HasCNAMERecord\n}\n\n// GetHasMXRecordsPresent returns the HasMXRecordsPresent field if it's non-nil, zero value otherwise.\nfunc (p *PagesDomain) GetHasMXRecordsPresent() bool {\n\tif p == nil || p.HasMXRecordsPresent == nil {\n\t\treturn false\n\t}\n\treturn *p.HasMXRecordsPresent\n}\n\n// GetHost returns the Host field if it's non-nil, zero value otherwise.\nfunc (p *PagesDomain) GetHost() string {\n\tif p == nil || p.Host == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Host\n}\n\n// GetHTTPSError returns the HTTPSError field if it's non-nil, zero value otherwise.\nfunc (p *PagesDomain) GetHTTPSError() string {\n\tif p == nil || p.HTTPSError == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.HTTPSError\n}\n\n// GetIsApexDomain returns the IsApexDomain field if it's non-nil, zero value otherwise.\nfunc (p *PagesDomain) GetIsApexDomain() bool {\n\tif p == nil || p.IsApexDomain == nil {\n\t\treturn false\n\t}\n\treturn *p.IsApexDomain\n}\n\n// GetIsARecord returns the IsARecord field if it's non-nil, zero value otherwise.\nfunc (p *PagesDomain) GetIsARecord() bool {\n\tif p == nil || p.IsARecord == nil {\n\t\treturn false\n\t}\n\treturn *p.IsARecord\n}\n\n// GetIsCloudflareIP returns the IsCloudflareIP field if it's non-nil, zero value otherwise.\nfunc (p *PagesDomain) GetIsCloudflareIP() bool {\n\tif p == nil || p.IsCloudflareIP == nil {\n\t\treturn false\n\t}\n\treturn *p.IsCloudflareIP\n}\n\n// GetIsCNAMEToFastly returns the IsCNAMEToFastly field if it's non-nil, zero value otherwise.\nfunc (p *PagesDomain) GetIsCNAMEToFastly() bool {\n\tif p == nil || p.IsCNAMEToFastly == nil {\n\t\treturn false\n\t}\n\treturn *p.IsCNAMEToFastly\n}\n\n// GetIsCNAMEToGithubUserDomain returns the IsCNAMEToGithubUserDomain field if it's non-nil, zero value otherwise.\nfunc (p *PagesDomain) GetIsCNAMEToGithubUserDomain() bool {\n\tif p == nil || p.IsCNAMEToGithubUserDomain == nil {\n\t\treturn false\n\t}\n\treturn *p.IsCNAMEToGithubUserDomain\n}\n\n// GetIsCNAMEToPagesDotGithubDotCom returns the IsCNAMEToPagesDotGithubDotCom field if it's non-nil, zero value otherwise.\nfunc (p *PagesDomain) GetIsCNAMEToPagesDotGithubDotCom() bool {\n\tif p == nil || p.IsCNAMEToPagesDotGithubDotCom == nil {\n\t\treturn false\n\t}\n\treturn *p.IsCNAMEToPagesDotGithubDotCom\n}\n\n// GetIsFastlyIP returns the IsFastlyIP field if it's non-nil, zero value otherwise.\nfunc (p *PagesDomain) GetIsFastlyIP() bool {\n\tif p == nil || p.IsFastlyIP == nil {\n\t\treturn false\n\t}\n\treturn *p.IsFastlyIP\n}\n\n// GetIsHTTPSEligible returns the IsHTTPSEligible field if it's non-nil, zero value otherwise.\nfunc (p *PagesDomain) GetIsHTTPSEligible() bool {\n\tif p == nil || p.IsHTTPSEligible == nil {\n\t\treturn false\n\t}\n\treturn *p.IsHTTPSEligible\n}\n\n// GetIsNonGithubPagesIPPresent returns the IsNonGithubPagesIPPresent field if it's non-nil, zero value otherwise.\nfunc (p *PagesDomain) GetIsNonGithubPagesIPPresent() bool {\n\tif p == nil || p.IsNonGithubPagesIPPresent == nil {\n\t\treturn false\n\t}\n\treturn *p.IsNonGithubPagesIPPresent\n}\n\n// GetIsOldIPAddress returns the IsOldIPAddress field if it's non-nil, zero value otherwise.\nfunc (p *PagesDomain) GetIsOldIPAddress() bool {\n\tif p == nil || p.IsOldIPAddress == nil {\n\t\treturn false\n\t}\n\treturn *p.IsOldIPAddress\n}\n\n// GetIsPagesDomain returns the IsPagesDomain field if it's non-nil, zero value otherwise.\nfunc (p *PagesDomain) GetIsPagesDomain() bool {\n\tif p == nil || p.IsPagesDomain == nil {\n\t\treturn false\n\t}\n\treturn *p.IsPagesDomain\n}\n\n// GetIsPointedToGithubPagesIP returns the IsPointedToGithubPagesIP field if it's non-nil, zero value otherwise.\nfunc (p *PagesDomain) GetIsPointedToGithubPagesIP() bool {\n\tif p == nil || p.IsPointedToGithubPagesIP == nil {\n\t\treturn false\n\t}\n\treturn *p.IsPointedToGithubPagesIP\n}\n\n// GetIsProxied returns the IsProxied field if it's non-nil, zero value otherwise.\nfunc (p *PagesDomain) GetIsProxied() bool {\n\tif p == nil || p.IsProxied == nil {\n\t\treturn false\n\t}\n\treturn *p.IsProxied\n}\n\n// GetIsServedByPages returns the IsServedByPages field if it's non-nil, zero value otherwise.\nfunc (p *PagesDomain) GetIsServedByPages() bool {\n\tif p == nil || p.IsServedByPages == nil {\n\t\treturn false\n\t}\n\treturn *p.IsServedByPages\n}\n\n// GetIsValid returns the IsValid field if it's non-nil, zero value otherwise.\nfunc (p *PagesDomain) GetIsValid() bool {\n\tif p == nil || p.IsValid == nil {\n\t\treturn false\n\t}\n\treturn *p.IsValid\n}\n\n// GetIsValidDomain returns the IsValidDomain field if it's non-nil, zero value otherwise.\nfunc (p *PagesDomain) GetIsValidDomain() bool {\n\tif p == nil || p.IsValidDomain == nil {\n\t\treturn false\n\t}\n\treturn *p.IsValidDomain\n}\n\n// GetNameservers returns the Nameservers field if it's non-nil, zero value otherwise.\nfunc (p *PagesDomain) GetNameservers() string {\n\tif p == nil || p.Nameservers == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Nameservers\n}\n\n// GetReason returns the Reason field if it's non-nil, zero value otherwise.\nfunc (p *PagesDomain) GetReason() string {\n\tif p == nil || p.Reason == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Reason\n}\n\n// GetRespondsToHTTPS returns the RespondsToHTTPS field if it's non-nil, zero value otherwise.\nfunc (p *PagesDomain) GetRespondsToHTTPS() bool {\n\tif p == nil || p.RespondsToHTTPS == nil {\n\t\treturn false\n\t}\n\treturn *p.RespondsToHTTPS\n}\n\n// GetShouldBeARecord returns the ShouldBeARecord field if it's non-nil, zero value otherwise.\nfunc (p *PagesDomain) GetShouldBeARecord() bool {\n\tif p == nil || p.ShouldBeARecord == nil {\n\t\treturn false\n\t}\n\treturn *p.ShouldBeARecord\n}\n\n// GetURI returns the URI field if it's non-nil, zero value otherwise.\nfunc (p *PagesDomain) GetURI() string {\n\tif p == nil || p.URI == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.URI\n}\n\n// GetMessage returns the Message field if it's non-nil, zero value otherwise.\nfunc (p *PagesError) GetMessage() string {\n\tif p == nil || p.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Message\n}\n\n// GetAltDomain returns the AltDomain field.\nfunc (p *PagesHealthCheckResponse) GetAltDomain() *PagesDomain {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.AltDomain\n}\n\n// GetDomain returns the Domain field.\nfunc (p *PagesHealthCheckResponse) GetDomain() *PagesDomain {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Domain\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (p *PagesHTTPSCertificate) GetDescription() string {\n\tif p == nil || p.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Description\n}\n\n// GetDomains returns the Domains slice if it's non-nil, nil otherwise.\nfunc (p *PagesHTTPSCertificate) GetDomains() []string {\n\tif p == nil || p.Domains == nil {\n\t\treturn nil\n\t}\n\treturn p.Domains\n}\n\n// GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise.\nfunc (p *PagesHTTPSCertificate) GetExpiresAt() string {\n\tif p == nil || p.ExpiresAt == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.ExpiresAt\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (p *PagesHTTPSCertificate) GetState() string {\n\tif p == nil || p.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.State\n}\n\n// GetBranch returns the Branch field if it's non-nil, zero value otherwise.\nfunc (p *PagesSource) GetBranch() string {\n\tif p == nil || p.Branch == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Branch\n}\n\n// GetPath returns the Path field if it's non-nil, zero value otherwise.\nfunc (p *PagesSource) GetPath() string {\n\tif p == nil || p.Path == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Path\n}\n\n// GetTotalPages returns the TotalPages field if it's non-nil, zero value otherwise.\nfunc (p *PageStats) GetTotalPages() int {\n\tif p == nil || p.TotalPages == nil {\n\t\treturn 0\n\t}\n\treturn *p.TotalPages\n}\n\n// GetBuildType returns the BuildType field if it's non-nil, zero value otherwise.\nfunc (p *PagesUpdate) GetBuildType() string {\n\tif p == nil || p.BuildType == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.BuildType\n}\n\n// GetCNAME returns the CNAME field if it's non-nil, zero value otherwise.\nfunc (p *PagesUpdate) GetCNAME() string {\n\tif p == nil || p.CNAME == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.CNAME\n}\n\n// GetHTTPSEnforced returns the HTTPSEnforced field if it's non-nil, zero value otherwise.\nfunc (p *PagesUpdate) GetHTTPSEnforced() bool {\n\tif p == nil || p.HTTPSEnforced == nil {\n\t\treturn false\n\t}\n\treturn *p.HTTPSEnforced\n}\n\n// GetPublic returns the Public field if it's non-nil, zero value otherwise.\nfunc (p *PagesUpdate) GetPublic() bool {\n\tif p == nil || p.Public == nil {\n\t\treturn false\n\t}\n\treturn *p.Public\n}\n\n// GetSource returns the Source field.\nfunc (p *PagesUpdate) GetSource() *PagesSource {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Source\n}\n\n// GetBuildType returns the BuildType field if it's non-nil, zero value otherwise.\nfunc (p *PagesUpdateWithoutCNAME) GetBuildType() string {\n\tif p == nil || p.BuildType == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.BuildType\n}\n\n// GetHTTPSEnforced returns the HTTPSEnforced field if it's non-nil, zero value otherwise.\nfunc (p *PagesUpdateWithoutCNAME) GetHTTPSEnforced() bool {\n\tif p == nil || p.HTTPSEnforced == nil {\n\t\treturn false\n\t}\n\treturn *p.HTTPSEnforced\n}\n\n// GetPublic returns the Public field if it's non-nil, zero value otherwise.\nfunc (p *PagesUpdateWithoutCNAME) GetPublic() bool {\n\tif p == nil || p.Public == nil {\n\t\treturn false\n\t}\n\treturn *p.Public\n}\n\n// GetSource returns the Source field.\nfunc (p *PagesUpdateWithoutCNAME) GetSource() *PagesSource {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Source\n}\n\n// GetParameters returns the Parameters field.\nfunc (p *PatternBranchRule) GetParameters() PatternRuleParameters {\n\tif p == nil {\n\t\treturn PatternRuleParameters{}\n\t}\n\treturn p.Parameters\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (p *PatternRuleParameters) GetName() string {\n\tif p == nil || p.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Name\n}\n\n// GetNegate returns the Negate field if it's non-nil, zero value otherwise.\nfunc (p *PatternRuleParameters) GetNegate() bool {\n\tif p == nil || p.Negate == nil {\n\t\treturn false\n\t}\n\treturn *p.Negate\n}\n\n// GetOperator returns the Operator field.\nfunc (p *PatternRuleParameters) GetOperator() PatternRuleOperator {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn p.Operator\n}\n\n// GetPattern returns the Pattern field.\nfunc (p *PatternRuleParameters) GetPattern() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn p.Pattern\n}\n\n// GetCurrentUserCanApprove returns the CurrentUserCanApprove field if it's non-nil, zero value otherwise.\nfunc (p *PendingDeployment) GetCurrentUserCanApprove() bool {\n\tif p == nil || p.CurrentUserCanApprove == nil {\n\t\treturn false\n\t}\n\treturn *p.CurrentUserCanApprove\n}\n\n// GetEnvironment returns the Environment field.\nfunc (p *PendingDeployment) GetEnvironment() *PendingDeploymentEnvironment {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Environment\n}\n\n// GetReviewers returns the Reviewers slice if it's non-nil, nil otherwise.\nfunc (p *PendingDeployment) GetReviewers() []*RequiredReviewer {\n\tif p == nil || p.Reviewers == nil {\n\t\treturn nil\n\t}\n\treturn p.Reviewers\n}\n\n// GetWaitTimer returns the WaitTimer field if it's non-nil, zero value otherwise.\nfunc (p *PendingDeployment) GetWaitTimer() int64 {\n\tif p == nil || p.WaitTimer == nil {\n\t\treturn 0\n\t}\n\treturn *p.WaitTimer\n}\n\n// GetWaitTimerStartedAt returns the WaitTimerStartedAt field if it's non-nil, zero value otherwise.\nfunc (p *PendingDeployment) GetWaitTimerStartedAt() Timestamp {\n\tif p == nil || p.WaitTimerStartedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.WaitTimerStartedAt\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (p *PendingDeploymentEnvironment) GetHTMLURL() string {\n\tif p == nil || p.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (p *PendingDeploymentEnvironment) GetID() int64 {\n\tif p == nil || p.ID == nil {\n\t\treturn 0\n\t}\n\treturn *p.ID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (p *PendingDeploymentEnvironment) GetName() string {\n\tif p == nil || p.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Name\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (p *PendingDeploymentEnvironment) GetNodeID() string {\n\tif p == nil || p.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.NodeID\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (p *PendingDeploymentEnvironment) GetURL() string {\n\tif p == nil || p.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.URL\n}\n\n// GetComment returns the Comment field.\nfunc (p *PendingDeploymentsRequest) GetComment() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn p.Comment\n}\n\n// GetEnvironmentIDs returns the EnvironmentIDs slice if it's non-nil, nil otherwise.\nfunc (p *PendingDeploymentsRequest) GetEnvironmentIDs() []int64 {\n\tif p == nil || p.EnvironmentIDs == nil {\n\t\treturn nil\n\t}\n\treturn p.EnvironmentIDs\n}\n\n// GetState returns the State field.\nfunc (p *PendingDeploymentsRequest) GetState() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn p.State\n}\n\n// GetAccessGrantedAt returns the AccessGrantedAt field if it's non-nil, zero value otherwise.\nfunc (p *PersonalAccessToken) GetAccessGrantedAt() Timestamp {\n\tif p == nil || p.AccessGrantedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.AccessGrantedAt\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (p *PersonalAccessToken) GetID() int64 {\n\tif p == nil || p.ID == nil {\n\t\treturn 0\n\t}\n\treturn *p.ID\n}\n\n// GetOwner returns the Owner field.\nfunc (p *PersonalAccessToken) GetOwner() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Owner\n}\n\n// GetPermissions returns the Permissions field.\nfunc (p *PersonalAccessToken) GetPermissions() *PersonalAccessTokenPermissions {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Permissions\n}\n\n// GetRepositoriesURL returns the RepositoriesURL field if it's non-nil, zero value otherwise.\nfunc (p *PersonalAccessToken) GetRepositoriesURL() string {\n\tif p == nil || p.RepositoriesURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.RepositoriesURL\n}\n\n// GetRepositorySelection returns the RepositorySelection field if it's non-nil, zero value otherwise.\nfunc (p *PersonalAccessToken) GetRepositorySelection() string {\n\tif p == nil || p.RepositorySelection == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.RepositorySelection\n}\n\n// GetTokenExpired returns the TokenExpired field if it's non-nil, zero value otherwise.\nfunc (p *PersonalAccessToken) GetTokenExpired() bool {\n\tif p == nil || p.TokenExpired == nil {\n\t\treturn false\n\t}\n\treturn *p.TokenExpired\n}\n\n// GetTokenExpiresAt returns the TokenExpiresAt field if it's non-nil, zero value otherwise.\nfunc (p *PersonalAccessToken) GetTokenExpiresAt() Timestamp {\n\tif p == nil || p.TokenExpiresAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.TokenExpiresAt\n}\n\n// GetTokenID returns the TokenID field if it's non-nil, zero value otherwise.\nfunc (p *PersonalAccessToken) GetTokenID() int64 {\n\tif p == nil || p.TokenID == nil {\n\t\treturn 0\n\t}\n\treturn *p.TokenID\n}\n\n// GetTokenLastUsedAt returns the TokenLastUsedAt field if it's non-nil, zero value otherwise.\nfunc (p *PersonalAccessToken) GetTokenLastUsedAt() Timestamp {\n\tif p == nil || p.TokenLastUsedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.TokenLastUsedAt\n}\n\n// GetTokenName returns the TokenName field if it's non-nil, zero value otherwise.\nfunc (p *PersonalAccessToken) GetTokenName() string {\n\tif p == nil || p.TokenName == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.TokenName\n}\n\n// GetOrg returns the Org map if it's non-nil, an empty map otherwise.\nfunc (p *PersonalAccessTokenPermissions) GetOrg() map[string]string {\n\tif p == nil || p.Org == nil {\n\t\treturn map[string]string{}\n\t}\n\treturn p.Org\n}\n\n// GetOther returns the Other map if it's non-nil, an empty map otherwise.\nfunc (p *PersonalAccessTokenPermissions) GetOther() map[string]string {\n\tif p == nil || p.Other == nil {\n\t\treturn map[string]string{}\n\t}\n\treturn p.Other\n}\n\n// GetRepo returns the Repo map if it's non-nil, an empty map otherwise.\nfunc (p *PersonalAccessTokenPermissions) GetRepo() map[string]string {\n\tif p == nil || p.Repo == nil {\n\t\treturn map[string]string{}\n\t}\n\treturn p.Repo\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (p *PersonalAccessTokenRequest) GetCreatedAt() Timestamp {\n\tif p == nil || p.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.CreatedAt\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (p *PersonalAccessTokenRequest) GetID() int64 {\n\tif p == nil || p.ID == nil {\n\t\treturn 0\n\t}\n\treturn *p.ID\n}\n\n// GetOrg returns the Org field.\nfunc (p *PersonalAccessTokenRequest) GetOrg() *Organization {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Org\n}\n\n// GetOwner returns the Owner field.\nfunc (p *PersonalAccessTokenRequest) GetOwner() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Owner\n}\n\n// GetPermissionsAdded returns the PermissionsAdded field.\nfunc (p *PersonalAccessTokenRequest) GetPermissionsAdded() *PersonalAccessTokenPermissions {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.PermissionsAdded\n}\n\n// GetPermissionsResult returns the PermissionsResult field.\nfunc (p *PersonalAccessTokenRequest) GetPermissionsResult() *PersonalAccessTokenPermissions {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.PermissionsResult\n}\n\n// GetPermissionsUpgraded returns the PermissionsUpgraded field.\nfunc (p *PersonalAccessTokenRequest) GetPermissionsUpgraded() *PersonalAccessTokenPermissions {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.PermissionsUpgraded\n}\n\n// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise.\nfunc (p *PersonalAccessTokenRequest) GetRepositories() []*Repository {\n\tif p == nil || p.Repositories == nil {\n\t\treturn nil\n\t}\n\treturn p.Repositories\n}\n\n// GetRepositoryCount returns the RepositoryCount field if it's non-nil, zero value otherwise.\nfunc (p *PersonalAccessTokenRequest) GetRepositoryCount() int64 {\n\tif p == nil || p.RepositoryCount == nil {\n\t\treturn 0\n\t}\n\treturn *p.RepositoryCount\n}\n\n// GetRepositorySelection returns the RepositorySelection field if it's non-nil, zero value otherwise.\nfunc (p *PersonalAccessTokenRequest) GetRepositorySelection() string {\n\tif p == nil || p.RepositorySelection == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.RepositorySelection\n}\n\n// GetTokenExpired returns the TokenExpired field if it's non-nil, zero value otherwise.\nfunc (p *PersonalAccessTokenRequest) GetTokenExpired() bool {\n\tif p == nil || p.TokenExpired == nil {\n\t\treturn false\n\t}\n\treturn *p.TokenExpired\n}\n\n// GetTokenExpiresAt returns the TokenExpiresAt field if it's non-nil, zero value otherwise.\nfunc (p *PersonalAccessTokenRequest) GetTokenExpiresAt() Timestamp {\n\tif p == nil || p.TokenExpiresAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.TokenExpiresAt\n}\n\n// GetTokenLastUsedAt returns the TokenLastUsedAt field if it's non-nil, zero value otherwise.\nfunc (p *PersonalAccessTokenRequest) GetTokenLastUsedAt() Timestamp {\n\tif p == nil || p.TokenLastUsedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.TokenLastUsedAt\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (p *PersonalAccessTokenRequestEvent) GetAction() string {\n\tif p == nil || p.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Action\n}\n\n// GetInstallation returns the Installation field.\nfunc (p *PersonalAccessTokenRequestEvent) GetInstallation() *Installation {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (p *PersonalAccessTokenRequestEvent) GetOrg() *Organization {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Org\n}\n\n// GetPersonalAccessTokenRequest returns the PersonalAccessTokenRequest field.\nfunc (p *PersonalAccessTokenRequestEvent) GetPersonalAccessTokenRequest() *PersonalAccessTokenRequest {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.PersonalAccessTokenRequest\n}\n\n// GetSender returns the Sender field.\nfunc (p *PersonalAccessTokenRequestEvent) GetSender() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Sender\n}\n\n// GetHook returns the Hook field.\nfunc (p *PingEvent) GetHook() *Hook {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Hook\n}\n\n// GetHookID returns the HookID field if it's non-nil, zero value otherwise.\nfunc (p *PingEvent) GetHookID() int64 {\n\tif p == nil || p.HookID == nil {\n\t\treturn 0\n\t}\n\treturn *p.HookID\n}\n\n// GetInstallation returns the Installation field.\nfunc (p *PingEvent) GetInstallation() *Installation {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (p *PingEvent) GetOrg() *Organization {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Org\n}\n\n// GetRepo returns the Repo field.\nfunc (p *PingEvent) GetRepo() *Repository {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (p *PingEvent) GetSender() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Sender\n}\n\n// GetZen returns the Zen field if it's non-nil, zero value otherwise.\nfunc (p *PingEvent) GetZen() string {\n\tif p == nil || p.Zen == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Zen\n}\n\n// GetCollaborators returns the Collaborators field if it's non-nil, zero value otherwise.\nfunc (p *Plan) GetCollaborators() int {\n\tif p == nil || p.Collaborators == nil {\n\t\treturn 0\n\t}\n\treturn *p.Collaborators\n}\n\n// GetFilledSeats returns the FilledSeats field if it's non-nil, zero value otherwise.\nfunc (p *Plan) GetFilledSeats() int {\n\tif p == nil || p.FilledSeats == nil {\n\t\treturn 0\n\t}\n\treturn *p.FilledSeats\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (p *Plan) GetName() string {\n\tif p == nil || p.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Name\n}\n\n// GetPrivateRepos returns the PrivateRepos field if it's non-nil, zero value otherwise.\nfunc (p *Plan) GetPrivateRepos() int64 {\n\tif p == nil || p.PrivateRepos == nil {\n\t\treturn 0\n\t}\n\treturn *p.PrivateRepos\n}\n\n// GetSeats returns the Seats field if it's non-nil, zero value otherwise.\nfunc (p *Plan) GetSeats() int {\n\tif p == nil || p.Seats == nil {\n\t\treturn 0\n\t}\n\treturn *p.Seats\n}\n\n// GetSpace returns the Space field if it's non-nil, zero value otherwise.\nfunc (p *Plan) GetSpace() int {\n\tif p == nil || p.Space == nil {\n\t\treturn 0\n\t}\n\treturn *p.Space\n}\n\n// GetAutoTriggerChecks returns the AutoTriggerChecks slice if it's non-nil, nil otherwise.\nfunc (p *PreferenceList) GetAutoTriggerChecks() []*AutoTriggerCheck {\n\tif p == nil || p.AutoTriggerChecks == nil {\n\t\treturn nil\n\t}\n\treturn p.AutoTriggerChecks\n}\n\n// GetDiscountAmount returns the DiscountAmount field.\nfunc (p *PremiumRequestUsageItem) GetDiscountAmount() float64 {\n\tif p == nil {\n\t\treturn 0\n\t}\n\treturn p.DiscountAmount\n}\n\n// GetDiscountQuantity returns the DiscountQuantity field.\nfunc (p *PremiumRequestUsageItem) GetDiscountQuantity() float64 {\n\tif p == nil {\n\t\treturn 0\n\t}\n\treturn p.DiscountQuantity\n}\n\n// GetGrossAmount returns the GrossAmount field.\nfunc (p *PremiumRequestUsageItem) GetGrossAmount() float64 {\n\tif p == nil {\n\t\treturn 0\n\t}\n\treturn p.GrossAmount\n}\n\n// GetGrossQuantity returns the GrossQuantity field.\nfunc (p *PremiumRequestUsageItem) GetGrossQuantity() float64 {\n\tif p == nil {\n\t\treturn 0\n\t}\n\treturn p.GrossQuantity\n}\n\n// GetModel returns the Model field.\nfunc (p *PremiumRequestUsageItem) GetModel() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn p.Model\n}\n\n// GetNetAmount returns the NetAmount field.\nfunc (p *PremiumRequestUsageItem) GetNetAmount() float64 {\n\tif p == nil {\n\t\treturn 0\n\t}\n\treturn p.NetAmount\n}\n\n// GetNetQuantity returns the NetQuantity field.\nfunc (p *PremiumRequestUsageItem) GetNetQuantity() float64 {\n\tif p == nil {\n\t\treturn 0\n\t}\n\treturn p.NetQuantity\n}\n\n// GetPricePerUnit returns the PricePerUnit field.\nfunc (p *PremiumRequestUsageItem) GetPricePerUnit() float64 {\n\tif p == nil {\n\t\treturn 0\n\t}\n\treturn p.PricePerUnit\n}\n\n// GetProduct returns the Product field.\nfunc (p *PremiumRequestUsageItem) GetProduct() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn p.Product\n}\n\n// GetSKU returns the SKU field.\nfunc (p *PremiumRequestUsageItem) GetSKU() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn p.SKU\n}\n\n// GetUnitType returns the UnitType field.\nfunc (p *PremiumRequestUsageItem) GetUnitType() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn p.UnitType\n}\n\n// GetModel returns the Model field if it's non-nil, zero value otherwise.\nfunc (p *PremiumRequestUsageReport) GetModel() string {\n\tif p == nil || p.Model == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Model\n}\n\n// GetOrganization returns the Organization field if it's non-nil, zero value otherwise.\nfunc (p *PremiumRequestUsageReport) GetOrganization() string {\n\tif p == nil || p.Organization == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Organization\n}\n\n// GetProduct returns the Product field if it's non-nil, zero value otherwise.\nfunc (p *PremiumRequestUsageReport) GetProduct() string {\n\tif p == nil || p.Product == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Product\n}\n\n// GetTimePeriod returns the TimePeriod field.\nfunc (p *PremiumRequestUsageReport) GetTimePeriod() PremiumRequestUsageTimePeriod {\n\tif p == nil {\n\t\treturn PremiumRequestUsageTimePeriod{}\n\t}\n\treturn p.TimePeriod\n}\n\n// GetUsageItems returns the UsageItems slice if it's non-nil, nil otherwise.\nfunc (p *PremiumRequestUsageReport) GetUsageItems() []*PremiumRequestUsageItem {\n\tif p == nil || p.UsageItems == nil {\n\t\treturn nil\n\t}\n\treturn p.UsageItems\n}\n\n// GetUser returns the User field if it's non-nil, zero value otherwise.\nfunc (p *PremiumRequestUsageReport) GetUser() string {\n\tif p == nil || p.User == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.User\n}\n\n// GetDay returns the Day field if it's non-nil, zero value otherwise.\nfunc (p *PremiumRequestUsageReportOptions) GetDay() int {\n\tif p == nil || p.Day == nil {\n\t\treturn 0\n\t}\n\treturn *p.Day\n}\n\n// GetModel returns the Model field if it's non-nil, zero value otherwise.\nfunc (p *PremiumRequestUsageReportOptions) GetModel() string {\n\tif p == nil || p.Model == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Model\n}\n\n// GetMonth returns the Month field if it's non-nil, zero value otherwise.\nfunc (p *PremiumRequestUsageReportOptions) GetMonth() int {\n\tif p == nil || p.Month == nil {\n\t\treturn 0\n\t}\n\treturn *p.Month\n}\n\n// GetProduct returns the Product field if it's non-nil, zero value otherwise.\nfunc (p *PremiumRequestUsageReportOptions) GetProduct() string {\n\tif p == nil || p.Product == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Product\n}\n\n// GetUser returns the User field if it's non-nil, zero value otherwise.\nfunc (p *PremiumRequestUsageReportOptions) GetUser() string {\n\tif p == nil || p.User == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.User\n}\n\n// GetYear returns the Year field if it's non-nil, zero value otherwise.\nfunc (p *PremiumRequestUsageReportOptions) GetYear() int {\n\tif p == nil || p.Year == nil {\n\t\treturn 0\n\t}\n\treturn *p.Year\n}\n\n// GetDay returns the Day field if it's non-nil, zero value otherwise.\nfunc (p *PremiumRequestUsageTimePeriod) GetDay() int {\n\tif p == nil || p.Day == nil {\n\t\treturn 0\n\t}\n\treturn *p.Day\n}\n\n// GetMonth returns the Month field if it's non-nil, zero value otherwise.\nfunc (p *PremiumRequestUsageTimePeriod) GetMonth() int {\n\tif p == nil || p.Month == nil {\n\t\treturn 0\n\t}\n\treturn *p.Month\n}\n\n// GetYear returns the Year field.\nfunc (p *PremiumRequestUsageTimePeriod) GetYear() int {\n\tif p == nil {\n\t\treturn 0\n\t}\n\treturn p.Year\n}\n\n// GetConfigURL returns the ConfigURL field if it's non-nil, zero value otherwise.\nfunc (p *PreReceiveHook) GetConfigURL() string {\n\tif p == nil || p.ConfigURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.ConfigURL\n}\n\n// GetEnforcement returns the Enforcement field if it's non-nil, zero value otherwise.\nfunc (p *PreReceiveHook) GetEnforcement() string {\n\tif p == nil || p.Enforcement == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Enforcement\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (p *PreReceiveHook) GetID() int64 {\n\tif p == nil || p.ID == nil {\n\t\treturn 0\n\t}\n\treturn *p.ID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (p *PreReceiveHook) GetName() string {\n\tif p == nil || p.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Name\n}\n\n// GetConfigurations returns the Configurations slice if it's non-nil, nil otherwise.\nfunc (p *PrivateRegistries) GetConfigurations() []*PrivateRegistry {\n\tif p == nil || p.Configurations == nil {\n\t\treturn nil\n\t}\n\treturn p.Configurations\n}\n\n// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.\nfunc (p *PrivateRegistries) GetTotalCount() int {\n\tif p == nil || p.TotalCount == nil {\n\t\treturn 0\n\t}\n\treturn *p.TotalCount\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (p *PrivateRegistry) GetCreatedAt() Timestamp {\n\tif p == nil || p.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.CreatedAt\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (p *PrivateRegistry) GetName() string {\n\tif p == nil || p.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Name\n}\n\n// GetRegistryType returns the RegistryType field if it's non-nil, zero value otherwise.\nfunc (p *PrivateRegistry) GetRegistryType() string {\n\tif p == nil || p.RegistryType == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.RegistryType\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (p *PrivateRegistry) GetUpdatedAt() Timestamp {\n\tif p == nil || p.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.UpdatedAt\n}\n\n// GetUsername returns the Username field if it's non-nil, zero value otherwise.\nfunc (p *PrivateRegistry) GetUsername() string {\n\tif p == nil || p.Username == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Username\n}\n\n// GetVisibility returns the Visibility field.\nfunc (p *PrivateRegistry) GetVisibility() *PrivateRegistryVisibility {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Visibility\n}\n\n// GetHRef returns the HRef field if it's non-nil, zero value otherwise.\nfunc (p *PRLink) GetHRef() string {\n\tif p == nil || p.HRef == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.HRef\n}\n\n// GetComments returns the Comments field.\nfunc (p *PRLinks) GetComments() *PRLink {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Comments\n}\n\n// GetCommits returns the Commits field.\nfunc (p *PRLinks) GetCommits() *PRLink {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Commits\n}\n\n// GetHTML returns the HTML field.\nfunc (p *PRLinks) GetHTML() *PRLink {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.HTML\n}\n\n// GetIssue returns the Issue field.\nfunc (p *PRLinks) GetIssue() *PRLink {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Issue\n}\n\n// GetReviewComment returns the ReviewComment field.\nfunc (p *PRLinks) GetReviewComment() *PRLink {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.ReviewComment\n}\n\n// GetReviewComments returns the ReviewComments field.\nfunc (p *PRLinks) GetReviewComments() *PRLink {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.ReviewComments\n}\n\n// GetSelf returns the Self field.\nfunc (p *PRLinks) GetSelf() *PRLink {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Self\n}\n\n// GetStatuses returns the Statuses field.\nfunc (p *PRLinks) GetStatuses() *PRLink {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Statuses\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (p *ProjectBody) GetFrom() string {\n\tif p == nil || p.From == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.From\n}\n\n// GetNote returns the Note field.\nfunc (p *ProjectCardChange) GetNote() *ProjectCardNote {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Note\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (p *ProjectCardNote) GetFrom() string {\n\tif p == nil || p.From == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.From\n}\n\n// GetBody returns the Body field.\nfunc (p *ProjectChange) GetBody() *ProjectBody {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Body\n}\n\n// GetName returns the Name field.\nfunc (p *ProjectChange) GetName() *ProjectName {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Name\n}\n\n// GetName returns the Name field.\nfunc (p *ProjectColumnChange) GetName() *ProjectColumnName {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Name\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (p *ProjectColumnName) GetFrom() string {\n\tif p == nil || p.From == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.From\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (p *ProjectName) GetFrom() string {\n\tif p == nil || p.From == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.From\n}\n\n// GetBody returns the Body field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2) GetBody() string {\n\tif p == nil || p.Body == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Body\n}\n\n// GetClosedAt returns the ClosedAt field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2) GetClosedAt() Timestamp {\n\tif p == nil || p.ClosedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.ClosedAt\n}\n\n// GetColumnsURL returns the ColumnsURL field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2) GetColumnsURL() string {\n\tif p == nil || p.ColumnsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.ColumnsURL\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2) GetCreatedAt() Timestamp {\n\tif p == nil || p.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.CreatedAt\n}\n\n// GetCreator returns the Creator field.\nfunc (p *ProjectV2) GetCreator() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Creator\n}\n\n// GetDeletedAt returns the DeletedAt field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2) GetDeletedAt() Timestamp {\n\tif p == nil || p.DeletedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.DeletedAt\n}\n\n// GetDeletedBy returns the DeletedBy field.\nfunc (p *ProjectV2) GetDeletedBy() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.DeletedBy\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2) GetDescription() string {\n\tif p == nil || p.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Description\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2) GetHTMLURL() string {\n\tif p == nil || p.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2) GetID() int64 {\n\tif p == nil || p.ID == nil {\n\t\treturn 0\n\t}\n\treturn *p.ID\n}\n\n// GetIsTemplate returns the IsTemplate field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2) GetIsTemplate() bool {\n\tif p == nil || p.IsTemplate == nil {\n\t\treturn false\n\t}\n\treturn *p.IsTemplate\n}\n\n// GetLatestStatusUpdate returns the LatestStatusUpdate field.\nfunc (p *ProjectV2) GetLatestStatusUpdate() *ProjectV2StatusUpdate {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.LatestStatusUpdate\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2) GetName() string {\n\tif p == nil || p.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Name\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2) GetNodeID() string {\n\tif p == nil || p.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.NodeID\n}\n\n// GetNumber returns the Number field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2) GetNumber() int {\n\tif p == nil || p.Number == nil {\n\t\treturn 0\n\t}\n\treturn *p.Number\n}\n\n// GetOrganizationPermission returns the OrganizationPermission field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2) GetOrganizationPermission() string {\n\tif p == nil || p.OrganizationPermission == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.OrganizationPermission\n}\n\n// GetOwner returns the Owner field.\nfunc (p *ProjectV2) GetOwner() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Owner\n}\n\n// GetOwnerURL returns the OwnerURL field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2) GetOwnerURL() string {\n\tif p == nil || p.OwnerURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.OwnerURL\n}\n\n// GetPrivate returns the Private field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2) GetPrivate() bool {\n\tif p == nil || p.Private == nil {\n\t\treturn false\n\t}\n\treturn *p.Private\n}\n\n// GetPublic returns the Public field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2) GetPublic() bool {\n\tif p == nil || p.Public == nil {\n\t\treturn false\n\t}\n\treturn *p.Public\n}\n\n// GetShortDescription returns the ShortDescription field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2) GetShortDescription() string {\n\tif p == nil || p.ShortDescription == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.ShortDescription\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2) GetState() string {\n\tif p == nil || p.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.State\n}\n\n// GetTitle returns the Title field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2) GetTitle() string {\n\tif p == nil || p.Title == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Title\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2) GetUpdatedAt() Timestamp {\n\tif p == nil || p.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2) GetURL() string {\n\tif p == nil || p.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.URL\n}\n\n// GetBody returns the Body field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2DraftIssue) GetBody() string {\n\tif p == nil || p.Body == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Body\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2DraftIssue) GetCreatedAt() Timestamp {\n\tif p == nil || p.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.CreatedAt\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2DraftIssue) GetID() int64 {\n\tif p == nil || p.ID == nil {\n\t\treturn 0\n\t}\n\treturn *p.ID\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2DraftIssue) GetNodeID() string {\n\tif p == nil || p.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.NodeID\n}\n\n// GetTitle returns the Title field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2DraftIssue) GetTitle() string {\n\tif p == nil || p.Title == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Title\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2DraftIssue) GetUpdatedAt() Timestamp {\n\tif p == nil || p.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.UpdatedAt\n}\n\n// GetUser returns the User field.\nfunc (p *ProjectV2DraftIssue) GetUser() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.User\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2Event) GetAction() string {\n\tif p == nil || p.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Action\n}\n\n// GetInstallation returns the Installation field.\nfunc (p *ProjectV2Event) GetInstallation() *Installation {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (p *ProjectV2Event) GetOrg() *Organization {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Org\n}\n\n// GetProjectsV2 returns the ProjectsV2 field.\nfunc (p *ProjectV2Event) GetProjectsV2() *ProjectV2 {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.ProjectsV2\n}\n\n// GetSender returns the Sender field.\nfunc (p *ProjectV2Event) GetSender() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Sender\n}\n\n// GetConfiguration returns the Configuration field.\nfunc (p *ProjectV2Field) GetConfiguration() *ProjectV2FieldConfiguration {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Configuration\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2Field) GetCreatedAt() Timestamp {\n\tif p == nil || p.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.CreatedAt\n}\n\n// GetDataType returns the DataType field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2Field) GetDataType() string {\n\tif p == nil || p.DataType == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.DataType\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2Field) GetID() int64 {\n\tif p == nil || p.ID == nil {\n\t\treturn 0\n\t}\n\treturn *p.ID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2Field) GetName() string {\n\tif p == nil || p.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Name\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2Field) GetNodeID() string {\n\tif p == nil || p.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.NodeID\n}\n\n// GetOptions returns the Options slice if it's non-nil, nil otherwise.\nfunc (p *ProjectV2Field) GetOptions() []*ProjectV2FieldOption {\n\tif p == nil || p.Options == nil {\n\t\treturn nil\n\t}\n\treturn p.Options\n}\n\n// GetProjectURL returns the ProjectURL field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2Field) GetProjectURL() string {\n\tif p == nil || p.ProjectURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.ProjectURL\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2Field) GetUpdatedAt() Timestamp {\n\tif p == nil || p.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.UpdatedAt\n}\n\n// GetDuration returns the Duration field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2FieldConfiguration) GetDuration() int {\n\tif p == nil || p.Duration == nil {\n\t\treturn 0\n\t}\n\treturn *p.Duration\n}\n\n// GetIterations returns the Iterations slice if it's non-nil, nil otherwise.\nfunc (p *ProjectV2FieldConfiguration) GetIterations() []*ProjectV2FieldIteration {\n\tif p == nil || p.Iterations == nil {\n\t\treturn nil\n\t}\n\treturn p.Iterations\n}\n\n// GetStartDay returns the StartDay field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2FieldConfiguration) GetStartDay() int {\n\tif p == nil || p.StartDay == nil {\n\t\treturn 0\n\t}\n\treturn *p.StartDay\n}\n\n// GetDuration returns the Duration field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2FieldIteration) GetDuration() int {\n\tif p == nil || p.Duration == nil {\n\t\treturn 0\n\t}\n\treturn *p.Duration\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2FieldIteration) GetID() string {\n\tif p == nil || p.ID == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.ID\n}\n\n// GetStartDate returns the StartDate field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2FieldIteration) GetStartDate() string {\n\tif p == nil || p.StartDate == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.StartDate\n}\n\n// GetTitle returns the Title field.\nfunc (p *ProjectV2FieldIteration) GetTitle() *ProjectV2TextContent {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Title\n}\n\n// GetColor returns the Color field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2FieldOption) GetColor() string {\n\tif p == nil || p.Color == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Color\n}\n\n// GetDescription returns the Description field.\nfunc (p *ProjectV2FieldOption) GetDescription() *ProjectV2TextContent {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Description\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2FieldOption) GetID() string {\n\tif p == nil || p.ID == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.ID\n}\n\n// GetName returns the Name field.\nfunc (p *ProjectV2FieldOption) GetName() *ProjectV2TextContent {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Name\n}\n\n// GetArchivedAt returns the ArchivedAt field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2Item) GetArchivedAt() Timestamp {\n\tif p == nil || p.ArchivedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.ArchivedAt\n}\n\n// GetContent returns the Content field.\nfunc (p *ProjectV2Item) GetContent() *ProjectV2ItemContent {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Content\n}\n\n// GetContentNodeID returns the ContentNodeID field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2Item) GetContentNodeID() string {\n\tif p == nil || p.ContentNodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.ContentNodeID\n}\n\n// GetContentType returns the ContentType field.\nfunc (p *ProjectV2Item) GetContentType() *ProjectV2ItemContentType {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.ContentType\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2Item) GetCreatedAt() Timestamp {\n\tif p == nil || p.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.CreatedAt\n}\n\n// GetCreator returns the Creator field.\nfunc (p *ProjectV2Item) GetCreator() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Creator\n}\n\n// GetFields returns the Fields slice if it's non-nil, nil otherwise.\nfunc (p *ProjectV2Item) GetFields() []*ProjectV2ItemFieldValue {\n\tif p == nil || p.Fields == nil {\n\t\treturn nil\n\t}\n\treturn p.Fields\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2Item) GetID() int64 {\n\tif p == nil || p.ID == nil {\n\t\treturn 0\n\t}\n\treturn *p.ID\n}\n\n// GetItemURL returns the ItemURL field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2Item) GetItemURL() string {\n\tif p == nil || p.ItemURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.ItemURL\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2Item) GetNodeID() string {\n\tif p == nil || p.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.NodeID\n}\n\n// GetProjectNodeID returns the ProjectNodeID field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2Item) GetProjectNodeID() string {\n\tif p == nil || p.ProjectNodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.ProjectNodeID\n}\n\n// GetProjectURL returns the ProjectURL field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2Item) GetProjectURL() string {\n\tif p == nil || p.ProjectURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.ProjectURL\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2Item) GetUpdatedAt() Timestamp {\n\tif p == nil || p.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.UpdatedAt\n}\n\n// GetArchivedAt returns the ArchivedAt field.\nfunc (p *ProjectV2ItemChange) GetArchivedAt() *ArchivedAt {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.ArchivedAt\n}\n\n// GetFieldValue returns the FieldValue field.\nfunc (p *ProjectV2ItemChange) GetFieldValue() *FieldValue {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.FieldValue\n}\n\n// GetDraftIssue returns the DraftIssue field.\nfunc (p *ProjectV2ItemContent) GetDraftIssue() *ProjectV2DraftIssue {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.DraftIssue\n}\n\n// GetIssue returns the Issue field.\nfunc (p *ProjectV2ItemContent) GetIssue() *Issue {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Issue\n}\n\n// GetPullRequest returns the PullRequest field.\nfunc (p *ProjectV2ItemContent) GetPullRequest() *PullRequest {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.PullRequest\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2ItemEvent) GetAction() string {\n\tif p == nil || p.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Action\n}\n\n// GetChanges returns the Changes field.\nfunc (p *ProjectV2ItemEvent) GetChanges() *ProjectV2ItemChange {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Changes\n}\n\n// GetInstallation returns the Installation field.\nfunc (p *ProjectV2ItemEvent) GetInstallation() *Installation {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (p *ProjectV2ItemEvent) GetOrg() *Organization {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Org\n}\n\n// GetProjectV2Item returns the ProjectV2Item field.\nfunc (p *ProjectV2ItemEvent) GetProjectV2Item() *ProjectV2Item {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.ProjectV2Item\n}\n\n// GetSender returns the Sender field.\nfunc (p *ProjectV2ItemEvent) GetSender() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Sender\n}\n\n// GetDataType returns the DataType field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2ItemFieldValue) GetDataType() string {\n\tif p == nil || p.DataType == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.DataType\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2ItemFieldValue) GetID() int64 {\n\tif p == nil || p.ID == nil {\n\t\treturn 0\n\t}\n\treturn *p.ID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2ItemFieldValue) GetName() string {\n\tif p == nil || p.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Name\n}\n\n// GetValue returns the Value field.\nfunc (p *ProjectV2ItemFieldValue) GetValue() any {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Value\n}\n\n// GetBody returns the Body field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2StatusUpdate) GetBody() string {\n\tif p == nil || p.Body == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Body\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2StatusUpdate) GetCreatedAt() Timestamp {\n\tif p == nil || p.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.CreatedAt\n}\n\n// GetCreator returns the Creator field.\nfunc (p *ProjectV2StatusUpdate) GetCreator() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Creator\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2StatusUpdate) GetID() int64 {\n\tif p == nil || p.ID == nil {\n\t\treturn 0\n\t}\n\treturn *p.ID\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2StatusUpdate) GetNodeID() string {\n\tif p == nil || p.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.NodeID\n}\n\n// GetProjectNodeID returns the ProjectNodeID field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2StatusUpdate) GetProjectNodeID() string {\n\tif p == nil || p.ProjectNodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.ProjectNodeID\n}\n\n// GetStartDate returns the StartDate field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2StatusUpdate) GetStartDate() string {\n\tif p == nil || p.StartDate == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.StartDate\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2StatusUpdate) GetStatus() string {\n\tif p == nil || p.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Status\n}\n\n// GetTargetDate returns the TargetDate field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2StatusUpdate) GetTargetDate() string {\n\tif p == nil || p.TargetDate == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.TargetDate\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2StatusUpdate) GetUpdatedAt() Timestamp {\n\tif p == nil || p.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.UpdatedAt\n}\n\n// GetHTML returns the HTML field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2TextContent) GetHTML() string {\n\tif p == nil || p.HTML == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.HTML\n}\n\n// GetRaw returns the Raw field if it's non-nil, zero value otherwise.\nfunc (p *ProjectV2TextContent) GetRaw() string {\n\tif p == nil || p.Raw == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Raw\n}\n\n// GetAllowDeletions returns the AllowDeletions field.\nfunc (p *Protection) GetAllowDeletions() *AllowDeletions {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.AllowDeletions\n}\n\n// GetAllowForcePushes returns the AllowForcePushes field.\nfunc (p *Protection) GetAllowForcePushes() *AllowForcePushes {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.AllowForcePushes\n}\n\n// GetAllowForkSyncing returns the AllowForkSyncing field.\nfunc (p *Protection) GetAllowForkSyncing() *AllowForkSyncing {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.AllowForkSyncing\n}\n\n// GetBlockCreations returns the BlockCreations field.\nfunc (p *Protection) GetBlockCreations() *BlockCreations {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.BlockCreations\n}\n\n// GetEnforceAdmins returns the EnforceAdmins field.\nfunc (p *Protection) GetEnforceAdmins() *AdminEnforcement {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.EnforceAdmins\n}\n\n// GetLockBranch returns the LockBranch field.\nfunc (p *Protection) GetLockBranch() *LockBranch {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.LockBranch\n}\n\n// GetRequiredConversationResolution returns the RequiredConversationResolution field.\nfunc (p *Protection) GetRequiredConversationResolution() *RequiredConversationResolution {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.RequiredConversationResolution\n}\n\n// GetRequiredPullRequestReviews returns the RequiredPullRequestReviews field.\nfunc (p *Protection) GetRequiredPullRequestReviews() *PullRequestReviewsEnforcement {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.RequiredPullRequestReviews\n}\n\n// GetRequiredSignatures returns the RequiredSignatures field.\nfunc (p *Protection) GetRequiredSignatures() *SignaturesProtectedBranch {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.RequiredSignatures\n}\n\n// GetRequiredStatusChecks returns the RequiredStatusChecks field.\nfunc (p *Protection) GetRequiredStatusChecks() *RequiredStatusChecks {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.RequiredStatusChecks\n}\n\n// GetRequireLinearHistory returns the RequireLinearHistory field.\nfunc (p *Protection) GetRequireLinearHistory() *RequireLinearHistory {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.RequireLinearHistory\n}\n\n// GetRestrictions returns the Restrictions field.\nfunc (p *Protection) GetRestrictions() *BranchRestrictions {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Restrictions\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (p *Protection) GetURL() string {\n\tif p == nil || p.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.URL\n}\n\n// GetAdminEnforced returns the AdminEnforced field.\nfunc (p *ProtectionChanges) GetAdminEnforced() *AdminEnforcedChanges {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.AdminEnforced\n}\n\n// GetAllowDeletionsEnforcementLevel returns the AllowDeletionsEnforcementLevel field.\nfunc (p *ProtectionChanges) GetAllowDeletionsEnforcementLevel() *AllowDeletionsEnforcementLevelChanges {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.AllowDeletionsEnforcementLevel\n}\n\n// GetAuthorizedActorNames returns the AuthorizedActorNames field.\nfunc (p *ProtectionChanges) GetAuthorizedActorNames() *AuthorizedActorNames {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.AuthorizedActorNames\n}\n\n// GetAuthorizedActorsOnly returns the AuthorizedActorsOnly field.\nfunc (p *ProtectionChanges) GetAuthorizedActorsOnly() *AuthorizedActorsOnly {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.AuthorizedActorsOnly\n}\n\n// GetAuthorizedDismissalActorsOnly returns the AuthorizedDismissalActorsOnly field.\nfunc (p *ProtectionChanges) GetAuthorizedDismissalActorsOnly() *AuthorizedDismissalActorsOnlyChanges {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.AuthorizedDismissalActorsOnly\n}\n\n// GetCreateProtected returns the CreateProtected field.\nfunc (p *ProtectionChanges) GetCreateProtected() *CreateProtectedChanges {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.CreateProtected\n}\n\n// GetDismissStaleReviewsOnPush returns the DismissStaleReviewsOnPush field.\nfunc (p *ProtectionChanges) GetDismissStaleReviewsOnPush() *DismissStaleReviewsOnPushChanges {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.DismissStaleReviewsOnPush\n}\n\n// GetLinearHistoryRequirementEnforcementLevel returns the LinearHistoryRequirementEnforcementLevel field.\nfunc (p *ProtectionChanges) GetLinearHistoryRequirementEnforcementLevel() *LinearHistoryRequirementEnforcementLevelChanges {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.LinearHistoryRequirementEnforcementLevel\n}\n\n// GetPullRequestReviewsEnforcementLevel returns the PullRequestReviewsEnforcementLevel field.\nfunc (p *ProtectionChanges) GetPullRequestReviewsEnforcementLevel() *PullRequestReviewsEnforcementLevelChanges {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.PullRequestReviewsEnforcementLevel\n}\n\n// GetRequireCodeOwnerReview returns the RequireCodeOwnerReview field.\nfunc (p *ProtectionChanges) GetRequireCodeOwnerReview() *RequireCodeOwnerReviewChanges {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.RequireCodeOwnerReview\n}\n\n// GetRequiredConversationResolutionLevel returns the RequiredConversationResolutionLevel field.\nfunc (p *ProtectionChanges) GetRequiredConversationResolutionLevel() *RequiredConversationResolutionLevelChanges {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.RequiredConversationResolutionLevel\n}\n\n// GetRequiredDeploymentsEnforcementLevel returns the RequiredDeploymentsEnforcementLevel field.\nfunc (p *ProtectionChanges) GetRequiredDeploymentsEnforcementLevel() *RequiredDeploymentsEnforcementLevelChanges {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.RequiredDeploymentsEnforcementLevel\n}\n\n// GetRequiredStatusChecks returns the RequiredStatusChecks field.\nfunc (p *ProtectionChanges) GetRequiredStatusChecks() *RequiredStatusChecksChanges {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.RequiredStatusChecks\n}\n\n// GetRequiredStatusChecksEnforcementLevel returns the RequiredStatusChecksEnforcementLevel field.\nfunc (p *ProtectionChanges) GetRequiredStatusChecksEnforcementLevel() *RequiredStatusChecksEnforcementLevelChanges {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.RequiredStatusChecksEnforcementLevel\n}\n\n// GetRequireLastPushApproval returns the RequireLastPushApproval field.\nfunc (p *ProtectionChanges) GetRequireLastPushApproval() *RequireLastPushApprovalChanges {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.RequireLastPushApproval\n}\n\n// GetSignatureRequirementEnforcementLevel returns the SignatureRequirementEnforcementLevel field.\nfunc (p *ProtectionChanges) GetSignatureRequirementEnforcementLevel() *SignatureRequirementEnforcementLevelChanges {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.SignatureRequirementEnforcementLevel\n}\n\n// GetAllowDeletions returns the AllowDeletions field if it's non-nil, zero value otherwise.\nfunc (p *ProtectionRequest) GetAllowDeletions() bool {\n\tif p == nil || p.AllowDeletions == nil {\n\t\treturn false\n\t}\n\treturn *p.AllowDeletions\n}\n\n// GetAllowForcePushes returns the AllowForcePushes field if it's non-nil, zero value otherwise.\nfunc (p *ProtectionRequest) GetAllowForcePushes() bool {\n\tif p == nil || p.AllowForcePushes == nil {\n\t\treturn false\n\t}\n\treturn *p.AllowForcePushes\n}\n\n// GetAllowForkSyncing returns the AllowForkSyncing field if it's non-nil, zero value otherwise.\nfunc (p *ProtectionRequest) GetAllowForkSyncing() bool {\n\tif p == nil || p.AllowForkSyncing == nil {\n\t\treturn false\n\t}\n\treturn *p.AllowForkSyncing\n}\n\n// GetBlockCreations returns the BlockCreations field if it's non-nil, zero value otherwise.\nfunc (p *ProtectionRequest) GetBlockCreations() bool {\n\tif p == nil || p.BlockCreations == nil {\n\t\treturn false\n\t}\n\treturn *p.BlockCreations\n}\n\n// GetEnforceAdmins returns the EnforceAdmins field.\nfunc (p *ProtectionRequest) GetEnforceAdmins() bool {\n\tif p == nil {\n\t\treturn false\n\t}\n\treturn p.EnforceAdmins\n}\n\n// GetLockBranch returns the LockBranch field if it's non-nil, zero value otherwise.\nfunc (p *ProtectionRequest) GetLockBranch() bool {\n\tif p == nil || p.LockBranch == nil {\n\t\treturn false\n\t}\n\treturn *p.LockBranch\n}\n\n// GetRequiredConversationResolution returns the RequiredConversationResolution field if it's non-nil, zero value otherwise.\nfunc (p *ProtectionRequest) GetRequiredConversationResolution() bool {\n\tif p == nil || p.RequiredConversationResolution == nil {\n\t\treturn false\n\t}\n\treturn *p.RequiredConversationResolution\n}\n\n// GetRequiredPullRequestReviews returns the RequiredPullRequestReviews field.\nfunc (p *ProtectionRequest) GetRequiredPullRequestReviews() *PullRequestReviewsEnforcementRequest {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.RequiredPullRequestReviews\n}\n\n// GetRequiredStatusChecks returns the RequiredStatusChecks field.\nfunc (p *ProtectionRequest) GetRequiredStatusChecks() *RequiredStatusChecks {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.RequiredStatusChecks\n}\n\n// GetRequireLinearHistory returns the RequireLinearHistory field if it's non-nil, zero value otherwise.\nfunc (p *ProtectionRequest) GetRequireLinearHistory() bool {\n\tif p == nil || p.RequireLinearHistory == nil {\n\t\treturn false\n\t}\n\treturn *p.RequireLinearHistory\n}\n\n// GetRestrictions returns the Restrictions field.\nfunc (p *ProtectionRequest) GetRestrictions() *BranchRestrictionsRequest {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Restrictions\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (p *ProtectionRule) GetID() int64 {\n\tif p == nil || p.ID == nil {\n\t\treturn 0\n\t}\n\treturn *p.ID\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (p *ProtectionRule) GetNodeID() string {\n\tif p == nil || p.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.NodeID\n}\n\n// GetPreventSelfReview returns the PreventSelfReview field if it's non-nil, zero value otherwise.\nfunc (p *ProtectionRule) GetPreventSelfReview() bool {\n\tif p == nil || p.PreventSelfReview == nil {\n\t\treturn false\n\t}\n\treturn *p.PreventSelfReview\n}\n\n// GetReviewers returns the Reviewers slice if it's non-nil, nil otherwise.\nfunc (p *ProtectionRule) GetReviewers() []*RequiredReviewer {\n\tif p == nil || p.Reviewers == nil {\n\t\treturn nil\n\t}\n\treturn p.Reviewers\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (p *ProtectionRule) GetType() string {\n\tif p == nil || p.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Type\n}\n\n// GetWaitTimer returns the WaitTimer field if it's non-nil, zero value otherwise.\nfunc (p *ProtectionRule) GetWaitTimer() int {\n\tif p == nil || p.WaitTimer == nil {\n\t\treturn 0\n\t}\n\treturn *p.WaitTimer\n}\n\n// GetInstallation returns the Installation field.\nfunc (p *PublicEvent) GetInstallation() *Installation {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (p *PublicEvent) GetOrg() *Organization {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Org\n}\n\n// GetRepo returns the Repo field.\nfunc (p *PublicEvent) GetRepo() *Repository {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (p *PublicEvent) GetSender() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Sender\n}\n\n// GetCurrentUsage returns the CurrentUsage field.\nfunc (p *PublicIPUsage) GetCurrentUsage() int64 {\n\tif p == nil {\n\t\treturn 0\n\t}\n\treturn p.CurrentUsage\n}\n\n// GetMaximum returns the Maximum field.\nfunc (p *PublicIPUsage) GetMaximum() int64 {\n\tif p == nil {\n\t\treturn 0\n\t}\n\treturn p.Maximum\n}\n\n// GetKey returns the Key field if it's non-nil, zero value otherwise.\nfunc (p *PublicKey) GetKey() string {\n\tif p == nil || p.Key == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Key\n}\n\n// GetKeyID returns the KeyID field if it's non-nil, zero value otherwise.\nfunc (p *PublicKey) GetKeyID() string {\n\tif p == nil || p.KeyID == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.KeyID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (p *PublishCodespaceOptions) GetName() string {\n\tif p == nil || p.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Name\n}\n\n// GetPrivate returns the Private field if it's non-nil, zero value otherwise.\nfunc (p *PublishCodespaceOptions) GetPrivate() bool {\n\tif p == nil || p.Private == nil {\n\t\treturn false\n\t}\n\treturn *p.Private\n}\n\n// GetActiveLockReason returns the ActiveLockReason field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetActiveLockReason() string {\n\tif p == nil || p.ActiveLockReason == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.ActiveLockReason\n}\n\n// GetAdditions returns the Additions field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetAdditions() int {\n\tif p == nil || p.Additions == nil {\n\t\treturn 0\n\t}\n\treturn *p.Additions\n}\n\n// GetAssignee returns the Assignee field.\nfunc (p *PullRequest) GetAssignee() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Assignee\n}\n\n// GetAssignees returns the Assignees slice if it's non-nil, nil otherwise.\nfunc (p *PullRequest) GetAssignees() []*User {\n\tif p == nil || p.Assignees == nil {\n\t\treturn nil\n\t}\n\treturn p.Assignees\n}\n\n// GetAuthorAssociation returns the AuthorAssociation field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetAuthorAssociation() string {\n\tif p == nil || p.AuthorAssociation == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.AuthorAssociation\n}\n\n// GetAutoMerge returns the AutoMerge field.\nfunc (p *PullRequest) GetAutoMerge() *PullRequestAutoMerge {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.AutoMerge\n}\n\n// GetBase returns the Base field.\nfunc (p *PullRequest) GetBase() *PullRequestBranch {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Base\n}\n\n// GetBody returns the Body field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetBody() string {\n\tif p == nil || p.Body == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Body\n}\n\n// GetChangedFiles returns the ChangedFiles field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetChangedFiles() int {\n\tif p == nil || p.ChangedFiles == nil {\n\t\treturn 0\n\t}\n\treturn *p.ChangedFiles\n}\n\n// GetClosedAt returns the ClosedAt field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetClosedAt() Timestamp {\n\tif p == nil || p.ClosedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.ClosedAt\n}\n\n// GetComments returns the Comments field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetComments() int {\n\tif p == nil || p.Comments == nil {\n\t\treturn 0\n\t}\n\treturn *p.Comments\n}\n\n// GetCommentsURL returns the CommentsURL field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetCommentsURL() string {\n\tif p == nil || p.CommentsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.CommentsURL\n}\n\n// GetCommits returns the Commits field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetCommits() int {\n\tif p == nil || p.Commits == nil {\n\t\treturn 0\n\t}\n\treturn *p.Commits\n}\n\n// GetCommitsURL returns the CommitsURL field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetCommitsURL() string {\n\tif p == nil || p.CommitsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.CommitsURL\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetCreatedAt() Timestamp {\n\tif p == nil || p.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.CreatedAt\n}\n\n// GetDeletions returns the Deletions field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetDeletions() int {\n\tif p == nil || p.Deletions == nil {\n\t\treturn 0\n\t}\n\treturn *p.Deletions\n}\n\n// GetDiffURL returns the DiffURL field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetDiffURL() string {\n\tif p == nil || p.DiffURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.DiffURL\n}\n\n// GetDraft returns the Draft field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetDraft() bool {\n\tif p == nil || p.Draft == nil {\n\t\treturn false\n\t}\n\treturn *p.Draft\n}\n\n// GetHead returns the Head field.\nfunc (p *PullRequest) GetHead() *PullRequestBranch {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Head\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetHTMLURL() string {\n\tif p == nil || p.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetID() int64 {\n\tif p == nil || p.ID == nil {\n\t\treturn 0\n\t}\n\treturn *p.ID\n}\n\n// GetIssueURL returns the IssueURL field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetIssueURL() string {\n\tif p == nil || p.IssueURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.IssueURL\n}\n\n// GetLabels returns the Labels slice if it's non-nil, nil otherwise.\nfunc (p *PullRequest) GetLabels() []*Label {\n\tif p == nil || p.Labels == nil {\n\t\treturn nil\n\t}\n\treturn p.Labels\n}\n\n// GetLinks returns the Links field.\nfunc (p *PullRequest) GetLinks() *PRLinks {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Links\n}\n\n// GetLocked returns the Locked field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetLocked() bool {\n\tif p == nil || p.Locked == nil {\n\t\treturn false\n\t}\n\treturn *p.Locked\n}\n\n// GetMaintainerCanModify returns the MaintainerCanModify field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetMaintainerCanModify() bool {\n\tif p == nil || p.MaintainerCanModify == nil {\n\t\treturn false\n\t}\n\treturn *p.MaintainerCanModify\n}\n\n// GetMergeable returns the Mergeable field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetMergeable() bool {\n\tif p == nil || p.Mergeable == nil {\n\t\treturn false\n\t}\n\treturn *p.Mergeable\n}\n\n// GetMergeableState returns the MergeableState field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetMergeableState() string {\n\tif p == nil || p.MergeableState == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.MergeableState\n}\n\n// GetMergeCommitSHA returns the MergeCommitSHA field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetMergeCommitSHA() string {\n\tif p == nil || p.MergeCommitSHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.MergeCommitSHA\n}\n\n// GetMerged returns the Merged field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetMerged() bool {\n\tif p == nil || p.Merged == nil {\n\t\treturn false\n\t}\n\treturn *p.Merged\n}\n\n// GetMergedAt returns the MergedAt field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetMergedAt() Timestamp {\n\tif p == nil || p.MergedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.MergedAt\n}\n\n// GetMergedBy returns the MergedBy field.\nfunc (p *PullRequest) GetMergedBy() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.MergedBy\n}\n\n// GetMilestone returns the Milestone field.\nfunc (p *PullRequest) GetMilestone() *Milestone {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Milestone\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetNodeID() string {\n\tif p == nil || p.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.NodeID\n}\n\n// GetNumber returns the Number field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetNumber() int {\n\tif p == nil || p.Number == nil {\n\t\treturn 0\n\t}\n\treturn *p.Number\n}\n\n// GetPatchURL returns the PatchURL field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetPatchURL() string {\n\tif p == nil || p.PatchURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.PatchURL\n}\n\n// GetRebaseable returns the Rebaseable field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetRebaseable() bool {\n\tif p == nil || p.Rebaseable == nil {\n\t\treturn false\n\t}\n\treturn *p.Rebaseable\n}\n\n// GetRequestedReviewers returns the RequestedReviewers slice if it's non-nil, nil otherwise.\nfunc (p *PullRequest) GetRequestedReviewers() []*User {\n\tif p == nil || p.RequestedReviewers == nil {\n\t\treturn nil\n\t}\n\treturn p.RequestedReviewers\n}\n\n// GetRequestedTeams returns the RequestedTeams slice if it's non-nil, nil otherwise.\nfunc (p *PullRequest) GetRequestedTeams() []*Team {\n\tif p == nil || p.RequestedTeams == nil {\n\t\treturn nil\n\t}\n\treturn p.RequestedTeams\n}\n\n// GetReviewComments returns the ReviewComments field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetReviewComments() int {\n\tif p == nil || p.ReviewComments == nil {\n\t\treturn 0\n\t}\n\treturn *p.ReviewComments\n}\n\n// GetReviewCommentsURL returns the ReviewCommentsURL field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetReviewCommentsURL() string {\n\tif p == nil || p.ReviewCommentsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.ReviewCommentsURL\n}\n\n// GetReviewCommentURL returns the ReviewCommentURL field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetReviewCommentURL() string {\n\tif p == nil || p.ReviewCommentURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.ReviewCommentURL\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetState() string {\n\tif p == nil || p.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.State\n}\n\n// GetStatusesURL returns the StatusesURL field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetStatusesURL() string {\n\tif p == nil || p.StatusesURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.StatusesURL\n}\n\n// GetTitle returns the Title field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetTitle() string {\n\tif p == nil || p.Title == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Title\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetUpdatedAt() Timestamp {\n\tif p == nil || p.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (p *PullRequest) GetURL() string {\n\tif p == nil || p.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.URL\n}\n\n// GetUser returns the User field.\nfunc (p *PullRequest) GetUser() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.User\n}\n\n// GetCommitMessage returns the CommitMessage field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestAutoMerge) GetCommitMessage() string {\n\tif p == nil || p.CommitMessage == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.CommitMessage\n}\n\n// GetCommitTitle returns the CommitTitle field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestAutoMerge) GetCommitTitle() string {\n\tif p == nil || p.CommitTitle == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.CommitTitle\n}\n\n// GetEnabledBy returns the EnabledBy field.\nfunc (p *PullRequestAutoMerge) GetEnabledBy() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.EnabledBy\n}\n\n// GetMergeMethod returns the MergeMethod field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestAutoMerge) GetMergeMethod() string {\n\tif p == nil || p.MergeMethod == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.MergeMethod\n}\n\n// GetLabel returns the Label field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestBranch) GetLabel() string {\n\tif p == nil || p.Label == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Label\n}\n\n// GetRef returns the Ref field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestBranch) GetRef() string {\n\tif p == nil || p.Ref == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Ref\n}\n\n// GetRepo returns the Repo field.\nfunc (p *PullRequestBranch) GetRepo() *Repository {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Repo\n}\n\n// GetSHA returns the SHA field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestBranch) GetSHA() string {\n\tif p == nil || p.SHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.SHA\n}\n\n// GetUser returns the User field.\nfunc (p *PullRequestBranch) GetUser() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.User\n}\n\n// GetParameters returns the Parameters field.\nfunc (p *PullRequestBranchRule) GetParameters() PullRequestRuleParameters {\n\tif p == nil {\n\t\treturn PullRequestRuleParameters{}\n\t}\n\treturn p.Parameters\n}\n\n// GetExpectedHeadSHA returns the ExpectedHeadSHA field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestBranchUpdateOptions) GetExpectedHeadSHA() string {\n\tif p == nil || p.ExpectedHeadSHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.ExpectedHeadSHA\n}\n\n// GetMessage returns the Message field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestBranchUpdateResponse) GetMessage() string {\n\tif p == nil || p.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Message\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestBranchUpdateResponse) GetURL() string {\n\tif p == nil || p.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.URL\n}\n\n// GetAuthorAssociation returns the AuthorAssociation field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestComment) GetAuthorAssociation() string {\n\tif p == nil || p.AuthorAssociation == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.AuthorAssociation\n}\n\n// GetBody returns the Body field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestComment) GetBody() string {\n\tif p == nil || p.Body == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Body\n}\n\n// GetCommitID returns the CommitID field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestComment) GetCommitID() string {\n\tif p == nil || p.CommitID == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.CommitID\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestComment) GetCreatedAt() Timestamp {\n\tif p == nil || p.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.CreatedAt\n}\n\n// GetDiffHunk returns the DiffHunk field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestComment) GetDiffHunk() string {\n\tif p == nil || p.DiffHunk == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.DiffHunk\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestComment) GetHTMLURL() string {\n\tif p == nil || p.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestComment) GetID() int64 {\n\tif p == nil || p.ID == nil {\n\t\treturn 0\n\t}\n\treturn *p.ID\n}\n\n// GetInReplyTo returns the InReplyTo field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestComment) GetInReplyTo() int64 {\n\tif p == nil || p.InReplyTo == nil {\n\t\treturn 0\n\t}\n\treturn *p.InReplyTo\n}\n\n// GetLine returns the Line field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestComment) GetLine() int {\n\tif p == nil || p.Line == nil {\n\t\treturn 0\n\t}\n\treturn *p.Line\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestComment) GetNodeID() string {\n\tif p == nil || p.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.NodeID\n}\n\n// GetOriginalCommitID returns the OriginalCommitID field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestComment) GetOriginalCommitID() string {\n\tif p == nil || p.OriginalCommitID == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.OriginalCommitID\n}\n\n// GetOriginalLine returns the OriginalLine field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestComment) GetOriginalLine() int {\n\tif p == nil || p.OriginalLine == nil {\n\t\treturn 0\n\t}\n\treturn *p.OriginalLine\n}\n\n// GetOriginalPosition returns the OriginalPosition field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestComment) GetOriginalPosition() int {\n\tif p == nil || p.OriginalPosition == nil {\n\t\treturn 0\n\t}\n\treturn *p.OriginalPosition\n}\n\n// GetOriginalStartLine returns the OriginalStartLine field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestComment) GetOriginalStartLine() int {\n\tif p == nil || p.OriginalStartLine == nil {\n\t\treturn 0\n\t}\n\treturn *p.OriginalStartLine\n}\n\n// GetPath returns the Path field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestComment) GetPath() string {\n\tif p == nil || p.Path == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Path\n}\n\n// GetPosition returns the Position field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestComment) GetPosition() int {\n\tif p == nil || p.Position == nil {\n\t\treturn 0\n\t}\n\treturn *p.Position\n}\n\n// GetPullRequestReviewID returns the PullRequestReviewID field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestComment) GetPullRequestReviewID() int64 {\n\tif p == nil || p.PullRequestReviewID == nil {\n\t\treturn 0\n\t}\n\treturn *p.PullRequestReviewID\n}\n\n// GetPullRequestURL returns the PullRequestURL field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestComment) GetPullRequestURL() string {\n\tif p == nil || p.PullRequestURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.PullRequestURL\n}\n\n// GetReactions returns the Reactions field.\nfunc (p *PullRequestComment) GetReactions() *Reactions {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Reactions\n}\n\n// GetSide returns the Side field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestComment) GetSide() string {\n\tif p == nil || p.Side == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Side\n}\n\n// GetStartLine returns the StartLine field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestComment) GetStartLine() int {\n\tif p == nil || p.StartLine == nil {\n\t\treturn 0\n\t}\n\treturn *p.StartLine\n}\n\n// GetStartSide returns the StartSide field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestComment) GetStartSide() string {\n\tif p == nil || p.StartSide == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.StartSide\n}\n\n// GetSubjectType returns the SubjectType field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestComment) GetSubjectType() string {\n\tif p == nil || p.SubjectType == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.SubjectType\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestComment) GetUpdatedAt() Timestamp {\n\tif p == nil || p.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestComment) GetURL() string {\n\tif p == nil || p.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.URL\n}\n\n// GetUser returns the User field.\nfunc (p *PullRequestComment) GetUser() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.User\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestEvent) GetAction() string {\n\tif p == nil || p.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Action\n}\n\n// GetAfter returns the After field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestEvent) GetAfter() string {\n\tif p == nil || p.After == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.After\n}\n\n// GetAssignee returns the Assignee field.\nfunc (p *PullRequestEvent) GetAssignee() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Assignee\n}\n\n// GetBefore returns the Before field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestEvent) GetBefore() string {\n\tif p == nil || p.Before == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Before\n}\n\n// GetChanges returns the Changes field.\nfunc (p *PullRequestEvent) GetChanges() *EditChange {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Changes\n}\n\n// GetInstallation returns the Installation field.\nfunc (p *PullRequestEvent) GetInstallation() *Installation {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Installation\n}\n\n// GetLabel returns the Label field.\nfunc (p *PullRequestEvent) GetLabel() *Label {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Label\n}\n\n// GetNumber returns the Number field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestEvent) GetNumber() int {\n\tif p == nil || p.Number == nil {\n\t\treturn 0\n\t}\n\treturn *p.Number\n}\n\n// GetOrganization returns the Organization field.\nfunc (p *PullRequestEvent) GetOrganization() *Organization {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Organization\n}\n\n// GetPerformedViaGithubApp returns the PerformedViaGithubApp field.\nfunc (p *PullRequestEvent) GetPerformedViaGithubApp() *App {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.PerformedViaGithubApp\n}\n\n// GetPullRequest returns the PullRequest field.\nfunc (p *PullRequestEvent) GetPullRequest() *PullRequest {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.PullRequest\n}\n\n// GetReason returns the Reason field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestEvent) GetReason() string {\n\tif p == nil || p.Reason == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Reason\n}\n\n// GetRepo returns the Repo field.\nfunc (p *PullRequestEvent) GetRepo() *Repository {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Repo\n}\n\n// GetRequestedReviewer returns the RequestedReviewer field.\nfunc (p *PullRequestEvent) GetRequestedReviewer() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.RequestedReviewer\n}\n\n// GetRequestedTeam returns the RequestedTeam field.\nfunc (p *PullRequestEvent) GetRequestedTeam() *Team {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.RequestedTeam\n}\n\n// GetSender returns the Sender field.\nfunc (p *PullRequestEvent) GetSender() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Sender\n}\n\n// GetDiffURL returns the DiffURL field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestLinks) GetDiffURL() string {\n\tif p == nil || p.DiffURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.DiffURL\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestLinks) GetHTMLURL() string {\n\tif p == nil || p.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.HTMLURL\n}\n\n// GetMergedAt returns the MergedAt field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestLinks) GetMergedAt() Timestamp {\n\tif p == nil || p.MergedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.MergedAt\n}\n\n// GetPatchURL returns the PatchURL field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestLinks) GetPatchURL() string {\n\tif p == nil || p.PatchURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.PatchURL\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestLinks) GetURL() string {\n\tif p == nil || p.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.URL\n}\n\n// GetDirection returns the Direction field.\nfunc (p *PullRequestListCommentsOptions) GetDirection() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn p.Direction\n}\n\n// GetSince returns the Since field.\nfunc (p *PullRequestListCommentsOptions) GetSince() time.Time {\n\tif p == nil {\n\t\treturn time.Time{}\n\t}\n\treturn p.Since\n}\n\n// GetSort returns the Sort field.\nfunc (p *PullRequestListCommentsOptions) GetSort() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn p.Sort\n}\n\n// GetBase returns the Base field.\nfunc (p *PullRequestListOptions) GetBase() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn p.Base\n}\n\n// GetDirection returns the Direction field.\nfunc (p *PullRequestListOptions) GetDirection() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn p.Direction\n}\n\n// GetHead returns the Head field.\nfunc (p *PullRequestListOptions) GetHead() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn p.Head\n}\n\n// GetSort returns the Sort field.\nfunc (p *PullRequestListOptions) GetSort() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn p.Sort\n}\n\n// GetState returns the State field.\nfunc (p *PullRequestListOptions) GetState() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn p.State\n}\n\n// GetMerged returns the Merged field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestMergeResult) GetMerged() bool {\n\tif p == nil || p.Merged == nil {\n\t\treturn false\n\t}\n\treturn *p.Merged\n}\n\n// GetMessage returns the Message field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestMergeResult) GetMessage() string {\n\tif p == nil || p.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Message\n}\n\n// GetSHA returns the SHA field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestMergeResult) GetSHA() string {\n\tif p == nil || p.SHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.SHA\n}\n\n// GetCommitTitle returns the CommitTitle field.\nfunc (p *PullRequestOptions) GetCommitTitle() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn p.CommitTitle\n}\n\n// GetDontDefaultIfBlank returns the DontDefaultIfBlank field.\nfunc (p *PullRequestOptions) GetDontDefaultIfBlank() bool {\n\tif p == nil {\n\t\treturn false\n\t}\n\treturn p.DontDefaultIfBlank\n}\n\n// GetMergeMethod returns the MergeMethod field.\nfunc (p *PullRequestOptions) GetMergeMethod() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn p.MergeMethod\n}\n\n// GetSHA returns the SHA field.\nfunc (p *PullRequestOptions) GetSHA() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn p.SHA\n}\n\n// GetAuthorAssociation returns the AuthorAssociation field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestReview) GetAuthorAssociation() string {\n\tif p == nil || p.AuthorAssociation == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.AuthorAssociation\n}\n\n// GetBody returns the Body field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestReview) GetBody() string {\n\tif p == nil || p.Body == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Body\n}\n\n// GetCommitID returns the CommitID field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestReview) GetCommitID() string {\n\tif p == nil || p.CommitID == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.CommitID\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestReview) GetHTMLURL() string {\n\tif p == nil || p.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestReview) GetID() int64 {\n\tif p == nil || p.ID == nil {\n\t\treturn 0\n\t}\n\treturn *p.ID\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestReview) GetNodeID() string {\n\tif p == nil || p.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.NodeID\n}\n\n// GetPullRequestURL returns the PullRequestURL field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestReview) GetPullRequestURL() string {\n\tif p == nil || p.PullRequestURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.PullRequestURL\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestReview) GetState() string {\n\tif p == nil || p.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.State\n}\n\n// GetSubmittedAt returns the SubmittedAt field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestReview) GetSubmittedAt() Timestamp {\n\tif p == nil || p.SubmittedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.SubmittedAt\n}\n\n// GetUser returns the User field.\nfunc (p *PullRequestReview) GetUser() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.User\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestReviewCommentEvent) GetAction() string {\n\tif p == nil || p.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Action\n}\n\n// GetChanges returns the Changes field.\nfunc (p *PullRequestReviewCommentEvent) GetChanges() *EditChange {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Changes\n}\n\n// GetComment returns the Comment field.\nfunc (p *PullRequestReviewCommentEvent) GetComment() *PullRequestComment {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Comment\n}\n\n// GetInstallation returns the Installation field.\nfunc (p *PullRequestReviewCommentEvent) GetInstallation() *Installation {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (p *PullRequestReviewCommentEvent) GetOrg() *Organization {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Org\n}\n\n// GetPullRequest returns the PullRequest field.\nfunc (p *PullRequestReviewCommentEvent) GetPullRequest() *PullRequest {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.PullRequest\n}\n\n// GetRepo returns the Repo field.\nfunc (p *PullRequestReviewCommentEvent) GetRepo() *Repository {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (p *PullRequestReviewCommentEvent) GetSender() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Sender\n}\n\n// GetMessage returns the Message field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestReviewDismissalRequest) GetMessage() string {\n\tif p == nil || p.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Message\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestReviewEvent) GetAction() string {\n\tif p == nil || p.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Action\n}\n\n// GetInstallation returns the Installation field.\nfunc (p *PullRequestReviewEvent) GetInstallation() *Installation {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Installation\n}\n\n// GetOrganization returns the Organization field.\nfunc (p *PullRequestReviewEvent) GetOrganization() *Organization {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Organization\n}\n\n// GetPullRequest returns the PullRequest field.\nfunc (p *PullRequestReviewEvent) GetPullRequest() *PullRequest {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.PullRequest\n}\n\n// GetRepo returns the Repo field.\nfunc (p *PullRequestReviewEvent) GetRepo() *Repository {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Repo\n}\n\n// GetReview returns the Review field.\nfunc (p *PullRequestReviewEvent) GetReview() *PullRequestReview {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Review\n}\n\n// GetSender returns the Sender field.\nfunc (p *PullRequestReviewEvent) GetSender() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Sender\n}\n\n// GetBody returns the Body field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestReviewRequest) GetBody() string {\n\tif p == nil || p.Body == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Body\n}\n\n// GetComments returns the Comments slice if it's non-nil, nil otherwise.\nfunc (p *PullRequestReviewRequest) GetComments() []*DraftReviewComment {\n\tif p == nil || p.Comments == nil {\n\t\treturn nil\n\t}\n\treturn p.Comments\n}\n\n// GetCommitID returns the CommitID field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestReviewRequest) GetCommitID() string {\n\tif p == nil || p.CommitID == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.CommitID\n}\n\n// GetEvent returns the Event field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestReviewRequest) GetEvent() string {\n\tif p == nil || p.Event == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Event\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestReviewRequest) GetNodeID() string {\n\tif p == nil || p.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.NodeID\n}\n\n// GetBypassPullRequestAllowances returns the BypassPullRequestAllowances field.\nfunc (p *PullRequestReviewsEnforcement) GetBypassPullRequestAllowances() *BypassPullRequestAllowances {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.BypassPullRequestAllowances\n}\n\n// GetDismissalRestrictions returns the DismissalRestrictions field.\nfunc (p *PullRequestReviewsEnforcement) GetDismissalRestrictions() *DismissalRestrictions {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.DismissalRestrictions\n}\n\n// GetDismissStaleReviews returns the DismissStaleReviews field.\nfunc (p *PullRequestReviewsEnforcement) GetDismissStaleReviews() bool {\n\tif p == nil {\n\t\treturn false\n\t}\n\treturn p.DismissStaleReviews\n}\n\n// GetRequireCodeOwnerReviews returns the RequireCodeOwnerReviews field.\nfunc (p *PullRequestReviewsEnforcement) GetRequireCodeOwnerReviews() bool {\n\tif p == nil {\n\t\treturn false\n\t}\n\treturn p.RequireCodeOwnerReviews\n}\n\n// GetRequiredApprovingReviewCount returns the RequiredApprovingReviewCount field.\nfunc (p *PullRequestReviewsEnforcement) GetRequiredApprovingReviewCount() int {\n\tif p == nil {\n\t\treturn 0\n\t}\n\treturn p.RequiredApprovingReviewCount\n}\n\n// GetRequireLastPushApproval returns the RequireLastPushApproval field.\nfunc (p *PullRequestReviewsEnforcement) GetRequireLastPushApproval() bool {\n\tif p == nil {\n\t\treturn false\n\t}\n\treturn p.RequireLastPushApproval\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestReviewsEnforcementLevelChanges) GetFrom() string {\n\tif p == nil || p.From == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.From\n}\n\n// GetBypassPullRequestAllowancesRequest returns the BypassPullRequestAllowancesRequest field.\nfunc (p *PullRequestReviewsEnforcementRequest) GetBypassPullRequestAllowancesRequest() *BypassPullRequestAllowancesRequest {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.BypassPullRequestAllowancesRequest\n}\n\n// GetDismissalRestrictionsRequest returns the DismissalRestrictionsRequest field.\nfunc (p *PullRequestReviewsEnforcementRequest) GetDismissalRestrictionsRequest() *DismissalRestrictionsRequest {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.DismissalRestrictionsRequest\n}\n\n// GetDismissStaleReviews returns the DismissStaleReviews field.\nfunc (p *PullRequestReviewsEnforcementRequest) GetDismissStaleReviews() bool {\n\tif p == nil {\n\t\treturn false\n\t}\n\treturn p.DismissStaleReviews\n}\n\n// GetRequireCodeOwnerReviews returns the RequireCodeOwnerReviews field.\nfunc (p *PullRequestReviewsEnforcementRequest) GetRequireCodeOwnerReviews() bool {\n\tif p == nil {\n\t\treturn false\n\t}\n\treturn p.RequireCodeOwnerReviews\n}\n\n// GetRequiredApprovingReviewCount returns the RequiredApprovingReviewCount field.\nfunc (p *PullRequestReviewsEnforcementRequest) GetRequiredApprovingReviewCount() int {\n\tif p == nil {\n\t\treturn 0\n\t}\n\treturn p.RequiredApprovingReviewCount\n}\n\n// GetRequireLastPushApproval returns the RequireLastPushApproval field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestReviewsEnforcementRequest) GetRequireLastPushApproval() bool {\n\tif p == nil || p.RequireLastPushApproval == nil {\n\t\treturn false\n\t}\n\treturn *p.RequireLastPushApproval\n}\n\n// GetBypassPullRequestAllowancesRequest returns the BypassPullRequestAllowancesRequest field.\nfunc (p *PullRequestReviewsEnforcementUpdate) GetBypassPullRequestAllowancesRequest() *BypassPullRequestAllowancesRequest {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.BypassPullRequestAllowancesRequest\n}\n\n// GetDismissalRestrictionsRequest returns the DismissalRestrictionsRequest field.\nfunc (p *PullRequestReviewsEnforcementUpdate) GetDismissalRestrictionsRequest() *DismissalRestrictionsRequest {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.DismissalRestrictionsRequest\n}\n\n// GetDismissStaleReviews returns the DismissStaleReviews field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestReviewsEnforcementUpdate) GetDismissStaleReviews() bool {\n\tif p == nil || p.DismissStaleReviews == nil {\n\t\treturn false\n\t}\n\treturn *p.DismissStaleReviews\n}\n\n// GetRequireCodeOwnerReviews returns the RequireCodeOwnerReviews field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestReviewsEnforcementUpdate) GetRequireCodeOwnerReviews() bool {\n\tif p == nil || p.RequireCodeOwnerReviews == nil {\n\t\treturn false\n\t}\n\treturn *p.RequireCodeOwnerReviews\n}\n\n// GetRequiredApprovingReviewCount returns the RequiredApprovingReviewCount field.\nfunc (p *PullRequestReviewsEnforcementUpdate) GetRequiredApprovingReviewCount() int {\n\tif p == nil {\n\t\treturn 0\n\t}\n\treturn p.RequiredApprovingReviewCount\n}\n\n// GetRequireLastPushApproval returns the RequireLastPushApproval field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestReviewsEnforcementUpdate) GetRequireLastPushApproval() bool {\n\tif p == nil || p.RequireLastPushApproval == nil {\n\t\treturn false\n\t}\n\treturn *p.RequireLastPushApproval\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestReviewThreadEvent) GetAction() string {\n\tif p == nil || p.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Action\n}\n\n// GetInstallation returns the Installation field.\nfunc (p *PullRequestReviewThreadEvent) GetInstallation() *Installation {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (p *PullRequestReviewThreadEvent) GetOrg() *Organization {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Org\n}\n\n// GetPullRequest returns the PullRequest field.\nfunc (p *PullRequestReviewThreadEvent) GetPullRequest() *PullRequest {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.PullRequest\n}\n\n// GetRepo returns the Repo field.\nfunc (p *PullRequestReviewThreadEvent) GetRepo() *Repository {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (p *PullRequestReviewThreadEvent) GetSender() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Sender\n}\n\n// GetThread returns the Thread field.\nfunc (p *PullRequestReviewThreadEvent) GetThread() *PullRequestThread {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Thread\n}\n\n// GetAllowedMergeMethods returns the AllowedMergeMethods slice if it's non-nil, nil otherwise.\nfunc (p *PullRequestRuleParameters) GetAllowedMergeMethods() []PullRequestMergeMethod {\n\tif p == nil || p.AllowedMergeMethods == nil {\n\t\treturn nil\n\t}\n\treturn p.AllowedMergeMethods\n}\n\n// GetDismissStaleReviewsOnPush returns the DismissStaleReviewsOnPush field.\nfunc (p *PullRequestRuleParameters) GetDismissStaleReviewsOnPush() bool {\n\tif p == nil {\n\t\treturn false\n\t}\n\treturn p.DismissStaleReviewsOnPush\n}\n\n// GetRequireCodeOwnerReview returns the RequireCodeOwnerReview field.\nfunc (p *PullRequestRuleParameters) GetRequireCodeOwnerReview() bool {\n\tif p == nil {\n\t\treturn false\n\t}\n\treturn p.RequireCodeOwnerReview\n}\n\n// GetRequiredApprovingReviewCount returns the RequiredApprovingReviewCount field.\nfunc (p *PullRequestRuleParameters) GetRequiredApprovingReviewCount() int {\n\tif p == nil {\n\t\treturn 0\n\t}\n\treturn p.RequiredApprovingReviewCount\n}\n\n// GetRequiredReviewers returns the RequiredReviewers slice if it's non-nil, nil otherwise.\nfunc (p *PullRequestRuleParameters) GetRequiredReviewers() []*RulesetRequiredReviewer {\n\tif p == nil || p.RequiredReviewers == nil {\n\t\treturn nil\n\t}\n\treturn p.RequiredReviewers\n}\n\n// GetRequiredReviewThreadResolution returns the RequiredReviewThreadResolution field.\nfunc (p *PullRequestRuleParameters) GetRequiredReviewThreadResolution() bool {\n\tif p == nil {\n\t\treturn false\n\t}\n\treturn p.RequiredReviewThreadResolution\n}\n\n// GetRequireLastPushApproval returns the RequireLastPushApproval field.\nfunc (p *PullRequestRuleParameters) GetRequireLastPushApproval() bool {\n\tif p == nil {\n\t\treturn false\n\t}\n\treturn p.RequireLastPushApproval\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestTargetEvent) GetAction() string {\n\tif p == nil || p.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Action\n}\n\n// GetAfter returns the After field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestTargetEvent) GetAfter() string {\n\tif p == nil || p.After == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.After\n}\n\n// GetAssignee returns the Assignee field.\nfunc (p *PullRequestTargetEvent) GetAssignee() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Assignee\n}\n\n// GetBefore returns the Before field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestTargetEvent) GetBefore() string {\n\tif p == nil || p.Before == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Before\n}\n\n// GetChanges returns the Changes field.\nfunc (p *PullRequestTargetEvent) GetChanges() *EditChange {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Changes\n}\n\n// GetInstallation returns the Installation field.\nfunc (p *PullRequestTargetEvent) GetInstallation() *Installation {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Installation\n}\n\n// GetLabel returns the Label field.\nfunc (p *PullRequestTargetEvent) GetLabel() *Label {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Label\n}\n\n// GetNumber returns the Number field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestTargetEvent) GetNumber() int {\n\tif p == nil || p.Number == nil {\n\t\treturn 0\n\t}\n\treturn *p.Number\n}\n\n// GetOrganization returns the Organization field.\nfunc (p *PullRequestTargetEvent) GetOrganization() *Organization {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Organization\n}\n\n// GetPerformedViaGithubApp returns the PerformedViaGithubApp field.\nfunc (p *PullRequestTargetEvent) GetPerformedViaGithubApp() *App {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.PerformedViaGithubApp\n}\n\n// GetPullRequest returns the PullRequest field.\nfunc (p *PullRequestTargetEvent) GetPullRequest() *PullRequest {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.PullRequest\n}\n\n// GetRepo returns the Repo field.\nfunc (p *PullRequestTargetEvent) GetRepo() *Repository {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Repo\n}\n\n// GetRequestedReviewer returns the RequestedReviewer field.\nfunc (p *PullRequestTargetEvent) GetRequestedReviewer() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.RequestedReviewer\n}\n\n// GetRequestedTeam returns the RequestedTeam field.\nfunc (p *PullRequestTargetEvent) GetRequestedTeam() *Team {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.RequestedTeam\n}\n\n// GetSender returns the Sender field.\nfunc (p *PullRequestTargetEvent) GetSender() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Sender\n}\n\n// GetComments returns the Comments slice if it's non-nil, nil otherwise.\nfunc (p *PullRequestThread) GetComments() []*PullRequestComment {\n\tif p == nil || p.Comments == nil {\n\t\treturn nil\n\t}\n\treturn p.Comments\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestThread) GetID() int64 {\n\tif p == nil || p.ID == nil {\n\t\treturn 0\n\t}\n\treturn *p.ID\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (p *PullRequestThread) GetNodeID() string {\n\tif p == nil || p.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.NodeID\n}\n\n// GetMergeablePulls returns the MergeablePulls field if it's non-nil, zero value otherwise.\nfunc (p *PullStats) GetMergeablePulls() int {\n\tif p == nil || p.MergeablePulls == nil {\n\t\treturn 0\n\t}\n\treturn *p.MergeablePulls\n}\n\n// GetMergedPulls returns the MergedPulls field if it's non-nil, zero value otherwise.\nfunc (p *PullStats) GetMergedPulls() int {\n\tif p == nil || p.MergedPulls == nil {\n\t\treturn 0\n\t}\n\treturn *p.MergedPulls\n}\n\n// GetTotalPulls returns the TotalPulls field if it's non-nil, zero value otherwise.\nfunc (p *PullStats) GetTotalPulls() int {\n\tif p == nil || p.TotalPulls == nil {\n\t\treturn 0\n\t}\n\treturn *p.TotalPulls\n}\n\n// GetUnmergeablePulls returns the UnmergeablePulls field if it's non-nil, zero value otherwise.\nfunc (p *PullStats) GetUnmergeablePulls() int {\n\tif p == nil || p.UnmergeablePulls == nil {\n\t\treturn 0\n\t}\n\treturn *p.UnmergeablePulls\n}\n\n// GetCommits returns the Commits field if it's non-nil, zero value otherwise.\nfunc (p *PunchCard) GetCommits() int {\n\tif p == nil || p.Commits == nil {\n\t\treturn 0\n\t}\n\treturn *p.Commits\n}\n\n// GetDay returns the Day field if it's non-nil, zero value otherwise.\nfunc (p *PunchCard) GetDay() int {\n\tif p == nil || p.Day == nil {\n\t\treturn 0\n\t}\n\treturn *p.Day\n}\n\n// GetHour returns the Hour field if it's non-nil, zero value otherwise.\nfunc (p *PunchCard) GetHour() int {\n\tif p == nil || p.Hour == nil {\n\t\treturn 0\n\t}\n\treturn *p.Hour\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (p *PushEvent) GetAction() string {\n\tif p == nil || p.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Action\n}\n\n// GetAfter returns the After field if it's non-nil, zero value otherwise.\nfunc (p *PushEvent) GetAfter() string {\n\tif p == nil || p.After == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.After\n}\n\n// GetBaseRef returns the BaseRef field if it's non-nil, zero value otherwise.\nfunc (p *PushEvent) GetBaseRef() string {\n\tif p == nil || p.BaseRef == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.BaseRef\n}\n\n// GetBefore returns the Before field if it's non-nil, zero value otherwise.\nfunc (p *PushEvent) GetBefore() string {\n\tif p == nil || p.Before == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Before\n}\n\n// GetCommits returns the Commits slice if it's non-nil, nil otherwise.\nfunc (p *PushEvent) GetCommits() []*HeadCommit {\n\tif p == nil || p.Commits == nil {\n\t\treturn nil\n\t}\n\treturn p.Commits\n}\n\n// GetCompare returns the Compare field if it's non-nil, zero value otherwise.\nfunc (p *PushEvent) GetCompare() string {\n\tif p == nil || p.Compare == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Compare\n}\n\n// GetCreated returns the Created field if it's non-nil, zero value otherwise.\nfunc (p *PushEvent) GetCreated() bool {\n\tif p == nil || p.Created == nil {\n\t\treturn false\n\t}\n\treturn *p.Created\n}\n\n// GetDeleted returns the Deleted field if it's non-nil, zero value otherwise.\nfunc (p *PushEvent) GetDeleted() bool {\n\tif p == nil || p.Deleted == nil {\n\t\treturn false\n\t}\n\treturn *p.Deleted\n}\n\n// GetDistinctSize returns the DistinctSize field if it's non-nil, zero value otherwise.\nfunc (p *PushEvent) GetDistinctSize() int {\n\tif p == nil || p.DistinctSize == nil {\n\t\treturn 0\n\t}\n\treturn *p.DistinctSize\n}\n\n// GetForced returns the Forced field if it's non-nil, zero value otherwise.\nfunc (p *PushEvent) GetForced() bool {\n\tif p == nil || p.Forced == nil {\n\t\treturn false\n\t}\n\treturn *p.Forced\n}\n\n// GetHead returns the Head field if it's non-nil, zero value otherwise.\nfunc (p *PushEvent) GetHead() string {\n\tif p == nil || p.Head == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Head\n}\n\n// GetHeadCommit returns the HeadCommit field.\nfunc (p *PushEvent) GetHeadCommit() *HeadCommit {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.HeadCommit\n}\n\n// GetInstallation returns the Installation field.\nfunc (p *PushEvent) GetInstallation() *Installation {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Installation\n}\n\n// GetOrganization returns the Organization field.\nfunc (p *PushEvent) GetOrganization() *Organization {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Organization\n}\n\n// GetPusher returns the Pusher field.\nfunc (p *PushEvent) GetPusher() *CommitAuthor {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Pusher\n}\n\n// GetPushID returns the PushID field if it's non-nil, zero value otherwise.\nfunc (p *PushEvent) GetPushID() int64 {\n\tif p == nil || p.PushID == nil {\n\t\treturn 0\n\t}\n\treturn *p.PushID\n}\n\n// GetRef returns the Ref field if it's non-nil, zero value otherwise.\nfunc (p *PushEvent) GetRef() string {\n\tif p == nil || p.Ref == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Ref\n}\n\n// GetRepo returns the Repo field.\nfunc (p *PushEvent) GetRepo() *PushEventRepository {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (p *PushEvent) GetSender() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Sender\n}\n\n// GetSize returns the Size field if it's non-nil, zero value otherwise.\nfunc (p *PushEvent) GetSize() int {\n\tif p == nil || p.Size == nil {\n\t\treturn 0\n\t}\n\treturn *p.Size\n}\n\n// GetEmail returns the Email field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepoOwner) GetEmail() string {\n\tif p == nil || p.Email == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Email\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepoOwner) GetName() string {\n\tif p == nil || p.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Name\n}\n\n// GetArchived returns the Archived field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetArchived() bool {\n\tif p == nil || p.Archived == nil {\n\t\treturn false\n\t}\n\treturn *p.Archived\n}\n\n// GetArchiveURL returns the ArchiveURL field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetArchiveURL() string {\n\tif p == nil || p.ArchiveURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.ArchiveURL\n}\n\n// GetCloneURL returns the CloneURL field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetCloneURL() string {\n\tif p == nil || p.CloneURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.CloneURL\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetCreatedAt() Timestamp {\n\tif p == nil || p.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.CreatedAt\n}\n\n// GetCustomProperties returns the CustomProperties map if it's non-nil, an empty map otherwise.\nfunc (p *PushEventRepository) GetCustomProperties() map[string]any {\n\tif p == nil || p.CustomProperties == nil {\n\t\treturn map[string]any{}\n\t}\n\treturn p.CustomProperties\n}\n\n// GetDefaultBranch returns the DefaultBranch field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetDefaultBranch() string {\n\tif p == nil || p.DefaultBranch == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.DefaultBranch\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetDescription() string {\n\tif p == nil || p.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Description\n}\n\n// GetDisabled returns the Disabled field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetDisabled() bool {\n\tif p == nil || p.Disabled == nil {\n\t\treturn false\n\t}\n\treturn *p.Disabled\n}\n\n// GetFork returns the Fork field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetFork() bool {\n\tif p == nil || p.Fork == nil {\n\t\treturn false\n\t}\n\treturn *p.Fork\n}\n\n// GetForksCount returns the ForksCount field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetForksCount() int {\n\tif p == nil || p.ForksCount == nil {\n\t\treturn 0\n\t}\n\treturn *p.ForksCount\n}\n\n// GetFullName returns the FullName field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetFullName() string {\n\tif p == nil || p.FullName == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.FullName\n}\n\n// GetGitURL returns the GitURL field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetGitURL() string {\n\tif p == nil || p.GitURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.GitURL\n}\n\n// GetHasDownloads returns the HasDownloads field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetHasDownloads() bool {\n\tif p == nil || p.HasDownloads == nil {\n\t\treturn false\n\t}\n\treturn *p.HasDownloads\n}\n\n// GetHasIssues returns the HasIssues field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetHasIssues() bool {\n\tif p == nil || p.HasIssues == nil {\n\t\treturn false\n\t}\n\treturn *p.HasIssues\n}\n\n// GetHasPages returns the HasPages field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetHasPages() bool {\n\tif p == nil || p.HasPages == nil {\n\t\treturn false\n\t}\n\treturn *p.HasPages\n}\n\n// GetHasWiki returns the HasWiki field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetHasWiki() bool {\n\tif p == nil || p.HasWiki == nil {\n\t\treturn false\n\t}\n\treturn *p.HasWiki\n}\n\n// GetHomepage returns the Homepage field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetHomepage() string {\n\tif p == nil || p.Homepage == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Homepage\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetHTMLURL() string {\n\tif p == nil || p.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetID() int64 {\n\tif p == nil || p.ID == nil {\n\t\treturn 0\n\t}\n\treturn *p.ID\n}\n\n// GetLanguage returns the Language field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetLanguage() string {\n\tif p == nil || p.Language == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Language\n}\n\n// GetMasterBranch returns the MasterBranch field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetMasterBranch() string {\n\tif p == nil || p.MasterBranch == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.MasterBranch\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetName() string {\n\tif p == nil || p.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Name\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetNodeID() string {\n\tif p == nil || p.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.NodeID\n}\n\n// GetOpenIssuesCount returns the OpenIssuesCount field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetOpenIssuesCount() int {\n\tif p == nil || p.OpenIssuesCount == nil {\n\t\treturn 0\n\t}\n\treturn *p.OpenIssuesCount\n}\n\n// GetOrganization returns the Organization field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetOrganization() string {\n\tif p == nil || p.Organization == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.Organization\n}\n\n// GetOwner returns the Owner field.\nfunc (p *PushEventRepository) GetOwner() *User {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.Owner\n}\n\n// GetPrivate returns the Private field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetPrivate() bool {\n\tif p == nil || p.Private == nil {\n\t\treturn false\n\t}\n\treturn *p.Private\n}\n\n// GetPullsURL returns the PullsURL field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetPullsURL() string {\n\tif p == nil || p.PullsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.PullsURL\n}\n\n// GetPushedAt returns the PushedAt field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetPushedAt() Timestamp {\n\tif p == nil || p.PushedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.PushedAt\n}\n\n// GetSize returns the Size field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetSize() int {\n\tif p == nil || p.Size == nil {\n\t\treturn 0\n\t}\n\treturn *p.Size\n}\n\n// GetSSHURL returns the SSHURL field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetSSHURL() string {\n\tif p == nil || p.SSHURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.SSHURL\n}\n\n// GetStargazersCount returns the StargazersCount field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetStargazersCount() int {\n\tif p == nil || p.StargazersCount == nil {\n\t\treturn 0\n\t}\n\treturn *p.StargazersCount\n}\n\n// GetStatusesURL returns the StatusesURL field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetStatusesURL() string {\n\tif p == nil || p.StatusesURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.StatusesURL\n}\n\n// GetSVNURL returns the SVNURL field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetSVNURL() string {\n\tif p == nil || p.SVNURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.SVNURL\n}\n\n// GetTopics returns the Topics slice if it's non-nil, nil otherwise.\nfunc (p *PushEventRepository) GetTopics() []string {\n\tif p == nil || p.Topics == nil {\n\t\treturn nil\n\t}\n\treturn p.Topics\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetUpdatedAt() Timestamp {\n\tif p == nil || p.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetURL() string {\n\tif p == nil || p.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *p.URL\n}\n\n// GetWatchersCount returns the WatchersCount field if it's non-nil, zero value otherwise.\nfunc (p *PushEventRepository) GetWatchersCount() int {\n\tif p == nil || p.WatchersCount == nil {\n\t\treturn 0\n\t}\n\treturn *p.WatchersCount\n}\n\n// GetExpireAt returns the ExpireAt field if it's non-nil, zero value otherwise.\nfunc (p *PushProtectionBypass) GetExpireAt() Timestamp {\n\tif p == nil || p.ExpireAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *p.ExpireAt\n}\n\n// GetReason returns the Reason field.\nfunc (p *PushProtectionBypass) GetReason() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn p.Reason\n}\n\n// GetTokenType returns the TokenType field.\nfunc (p *PushProtectionBypass) GetTokenType() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn p.TokenType\n}\n\n// GetPlaceholderID returns the PlaceholderID field.\nfunc (p *PushProtectionBypassRequest) GetPlaceholderID() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn p.PlaceholderID\n}\n\n// GetReason returns the Reason field.\nfunc (p *PushProtectionBypassRequest) GetReason() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn p.Reason\n}\n\n// GetLimit returns the Limit field.\nfunc (r *Rate) GetLimit() int {\n\tif r == nil {\n\t\treturn 0\n\t}\n\treturn r.Limit\n}\n\n// GetRemaining returns the Remaining field.\nfunc (r *Rate) GetRemaining() int {\n\tif r == nil {\n\t\treturn 0\n\t}\n\treturn r.Remaining\n}\n\n// GetReset returns the Reset field.\nfunc (r *Rate) GetReset() Timestamp {\n\tif r == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn r.Reset\n}\n\n// GetResource returns the Resource field.\nfunc (r *Rate) GetResource() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Resource\n}\n\n// GetUsed returns the Used field.\nfunc (r *Rate) GetUsed() int {\n\tif r == nil {\n\t\treturn 0\n\t}\n\treturn r.Used\n}\n\n// GetMessage returns the Message field.\nfunc (r *RateLimitError) GetMessage() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Message\n}\n\n// GetRate returns the Rate field.\nfunc (r *RateLimitError) GetRate() Rate {\n\tif r == nil {\n\t\treturn Rate{}\n\t}\n\treturn r.Rate\n}\n\n// GetActionsRunnerRegistration returns the ActionsRunnerRegistration field.\nfunc (r *RateLimits) GetActionsRunnerRegistration() *Rate {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.ActionsRunnerRegistration\n}\n\n// GetAuditLog returns the AuditLog field.\nfunc (r *RateLimits) GetAuditLog() *Rate {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.AuditLog\n}\n\n// GetCodeScanningUpload returns the CodeScanningUpload field.\nfunc (r *RateLimits) GetCodeScanningUpload() *Rate {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.CodeScanningUpload\n}\n\n// GetCodeSearch returns the CodeSearch field.\nfunc (r *RateLimits) GetCodeSearch() *Rate {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.CodeSearch\n}\n\n// GetCore returns the Core field.\nfunc (r *RateLimits) GetCore() *Rate {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Core\n}\n\n// GetDependencySBOM returns the DependencySBOM field.\nfunc (r *RateLimits) GetDependencySBOM() *Rate {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.DependencySBOM\n}\n\n// GetDependencySnapshots returns the DependencySnapshots field.\nfunc (r *RateLimits) GetDependencySnapshots() *Rate {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.DependencySnapshots\n}\n\n// GetGraphQL returns the GraphQL field.\nfunc (r *RateLimits) GetGraphQL() *Rate {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.GraphQL\n}\n\n// GetIntegrationManifest returns the IntegrationManifest field.\nfunc (r *RateLimits) GetIntegrationManifest() *Rate {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.IntegrationManifest\n}\n\n// GetSCIM returns the SCIM field.\nfunc (r *RateLimits) GetSCIM() *Rate {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.SCIM\n}\n\n// GetSearch returns the Search field.\nfunc (r *RateLimits) GetSearch() *Rate {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Search\n}\n\n// GetSourceImport returns the SourceImport field.\nfunc (r *RateLimits) GetSourceImport() *Rate {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.SourceImport\n}\n\n// GetType returns the Type field.\nfunc (r *RawOptions) GetType() RawType {\n\tif r == nil {\n\t\treturn 0\n\t}\n\treturn r.Type\n}\n\n// GetContent returns the Content field if it's non-nil, zero value otherwise.\nfunc (r *Reaction) GetContent() string {\n\tif r == nil || r.Content == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Content\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (r *Reaction) GetCreatedAt() Timestamp {\n\tif r == nil || r.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *r.CreatedAt\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (r *Reaction) GetID() int64 {\n\tif r == nil || r.ID == nil {\n\t\treturn 0\n\t}\n\treturn *r.ID\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (r *Reaction) GetNodeID() string {\n\tif r == nil || r.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.NodeID\n}\n\n// GetUser returns the User field.\nfunc (r *Reaction) GetUser() *User {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.User\n}\n\n// GetConfused returns the Confused field if it's non-nil, zero value otherwise.\nfunc (r *Reactions) GetConfused() int {\n\tif r == nil || r.Confused == nil {\n\t\treturn 0\n\t}\n\treturn *r.Confused\n}\n\n// GetEyes returns the Eyes field if it's non-nil, zero value otherwise.\nfunc (r *Reactions) GetEyes() int {\n\tif r == nil || r.Eyes == nil {\n\t\treturn 0\n\t}\n\treturn *r.Eyes\n}\n\n// GetHeart returns the Heart field if it's non-nil, zero value otherwise.\nfunc (r *Reactions) GetHeart() int {\n\tif r == nil || r.Heart == nil {\n\t\treturn 0\n\t}\n\treturn *r.Heart\n}\n\n// GetHooray returns the Hooray field if it's non-nil, zero value otherwise.\nfunc (r *Reactions) GetHooray() int {\n\tif r == nil || r.Hooray == nil {\n\t\treturn 0\n\t}\n\treturn *r.Hooray\n}\n\n// GetLaugh returns the Laugh field if it's non-nil, zero value otherwise.\nfunc (r *Reactions) GetLaugh() int {\n\tif r == nil || r.Laugh == nil {\n\t\treturn 0\n\t}\n\treturn *r.Laugh\n}\n\n// GetMinusOne returns the MinusOne field if it's non-nil, zero value otherwise.\nfunc (r *Reactions) GetMinusOne() int {\n\tif r == nil || r.MinusOne == nil {\n\t\treturn 0\n\t}\n\treturn *r.MinusOne\n}\n\n// GetPlusOne returns the PlusOne field if it's non-nil, zero value otherwise.\nfunc (r *Reactions) GetPlusOne() int {\n\tif r == nil || r.PlusOne == nil {\n\t\treturn 0\n\t}\n\treturn *r.PlusOne\n}\n\n// GetRocket returns the Rocket field if it's non-nil, zero value otherwise.\nfunc (r *Reactions) GetRocket() int {\n\tif r == nil || r.Rocket == nil {\n\t\treturn 0\n\t}\n\treturn *r.Rocket\n}\n\n// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.\nfunc (r *Reactions) GetTotalCount() int {\n\tif r == nil || r.TotalCount == nil {\n\t\treturn 0\n\t}\n\treturn *r.TotalCount\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (r *Reactions) GetURL() string {\n\tif r == nil || r.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.URL\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (r *ReassignedResource) GetName() string {\n\tif r == nil || r.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Name\n}\n\n// GetPreviousCostCenter returns the PreviousCostCenter field if it's non-nil, zero value otherwise.\nfunc (r *ReassignedResource) GetPreviousCostCenter() string {\n\tif r == nil || r.PreviousCostCenter == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.PreviousCostCenter\n}\n\n// GetResourceType returns the ResourceType field if it's non-nil, zero value otherwise.\nfunc (r *ReassignedResource) GetResourceType() string {\n\tif r == nil || r.ResourceType == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.ResourceType\n}\n\n// GetStatusCode returns the StatusCode field.\nfunc (r *RedirectionError) GetStatusCode() int {\n\tif r == nil {\n\t\treturn 0\n\t}\n\treturn r.StatusCode\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (r *Reference) GetNodeID() string {\n\tif r == nil || r.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.NodeID\n}\n\n// GetObject returns the Object field.\nfunc (r *Reference) GetObject() *GitObject {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Object\n}\n\n// GetRef returns the Ref field if it's non-nil, zero value otherwise.\nfunc (r *Reference) GetRef() string {\n\tif r == nil || r.Ref == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Ref\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (r *Reference) GetURL() string {\n\tif r == nil || r.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.URL\n}\n\n// GetPath returns the Path field if it's non-nil, zero value otherwise.\nfunc (r *ReferencedWorkflow) GetPath() string {\n\tif r == nil || r.Path == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Path\n}\n\n// GetRef returns the Ref field if it's non-nil, zero value otherwise.\nfunc (r *ReferencedWorkflow) GetRef() string {\n\tif r == nil || r.Ref == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Ref\n}\n\n// GetSHA returns the SHA field if it's non-nil, zero value otherwise.\nfunc (r *ReferencedWorkflow) GetSHA() string {\n\tif r == nil || r.SHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.SHA\n}\n\n// GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise.\nfunc (r *RegistrationToken) GetExpiresAt() Timestamp {\n\tif r == nil || r.ExpiresAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *r.ExpiresAt\n}\n\n// GetToken returns the Token field if it's non-nil, zero value otherwise.\nfunc (r *RegistrationToken) GetToken() string {\n\tif r == nil || r.Token == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Token\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (r *RegistryPackageEvent) GetAction() string {\n\tif r == nil || r.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Action\n}\n\n// GetEnterprise returns the Enterprise field.\nfunc (r *RegistryPackageEvent) GetEnterprise() *Enterprise {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Enterprise\n}\n\n// GetInstallation returns the Installation field.\nfunc (r *RegistryPackageEvent) GetInstallation() *Installation {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Installation\n}\n\n// GetOrganization returns the Organization field.\nfunc (r *RegistryPackageEvent) GetOrganization() *Organization {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Organization\n}\n\n// GetRegistryPackage returns the RegistryPackage field.\nfunc (r *RegistryPackageEvent) GetRegistryPackage() *Package {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.RegistryPackage\n}\n\n// GetRepository returns the Repository field.\nfunc (r *RegistryPackageEvent) GetRepository() *Repository {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Repository\n}\n\n// GetSender returns the Sender field.\nfunc (r *RegistryPackageEvent) GetSender() *User {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Sender\n}\n\n// GetBrowserDownloadURL returns the BrowserDownloadURL field if it's non-nil, zero value otherwise.\nfunc (r *ReleaseAsset) GetBrowserDownloadURL() string {\n\tif r == nil || r.BrowserDownloadURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.BrowserDownloadURL\n}\n\n// GetContentType returns the ContentType field if it's non-nil, zero value otherwise.\nfunc (r *ReleaseAsset) GetContentType() string {\n\tif r == nil || r.ContentType == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.ContentType\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (r *ReleaseAsset) GetCreatedAt() Timestamp {\n\tif r == nil || r.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *r.CreatedAt\n}\n\n// GetDigest returns the Digest field if it's non-nil, zero value otherwise.\nfunc (r *ReleaseAsset) GetDigest() string {\n\tif r == nil || r.Digest == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Digest\n}\n\n// GetDownloadCount returns the DownloadCount field if it's non-nil, zero value otherwise.\nfunc (r *ReleaseAsset) GetDownloadCount() int {\n\tif r == nil || r.DownloadCount == nil {\n\t\treturn 0\n\t}\n\treturn *r.DownloadCount\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (r *ReleaseAsset) GetID() int64 {\n\tif r == nil || r.ID == nil {\n\t\treturn 0\n\t}\n\treturn *r.ID\n}\n\n// GetLabel returns the Label field if it's non-nil, zero value otherwise.\nfunc (r *ReleaseAsset) GetLabel() string {\n\tif r == nil || r.Label == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Label\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (r *ReleaseAsset) GetName() string {\n\tif r == nil || r.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Name\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (r *ReleaseAsset) GetNodeID() string {\n\tif r == nil || r.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.NodeID\n}\n\n// GetSize returns the Size field if it's non-nil, zero value otherwise.\nfunc (r *ReleaseAsset) GetSize() int {\n\tif r == nil || r.Size == nil {\n\t\treturn 0\n\t}\n\treturn *r.Size\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (r *ReleaseAsset) GetState() string {\n\tif r == nil || r.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.State\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (r *ReleaseAsset) GetUpdatedAt() Timestamp {\n\tif r == nil || r.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *r.UpdatedAt\n}\n\n// GetUploader returns the Uploader field.\nfunc (r *ReleaseAsset) GetUploader() *User {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Uploader\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (r *ReleaseAsset) GetURL() string {\n\tif r == nil || r.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.URL\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (r *ReleaseEvent) GetAction() string {\n\tif r == nil || r.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Action\n}\n\n// GetInstallation returns the Installation field.\nfunc (r *ReleaseEvent) GetInstallation() *Installation {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (r *ReleaseEvent) GetOrg() *Organization {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Org\n}\n\n// GetRelease returns the Release field.\nfunc (r *ReleaseEvent) GetRelease() *RepositoryRelease {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Release\n}\n\n// GetRepo returns the Repo field.\nfunc (r *ReleaseEvent) GetRepo() *Repository {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (r *ReleaseEvent) GetSender() *User {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Sender\n}\n\n// GetBuildDate returns the BuildDate field if it's non-nil, zero value otherwise.\nfunc (r *ReleaseVersion) GetBuildDate() string {\n\tif r == nil || r.BuildDate == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.BuildDate\n}\n\n// GetBuildID returns the BuildID field if it's non-nil, zero value otherwise.\nfunc (r *ReleaseVersion) GetBuildID() string {\n\tif r == nil || r.BuildID == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.BuildID\n}\n\n// GetPlatform returns the Platform field if it's non-nil, zero value otherwise.\nfunc (r *ReleaseVersion) GetPlatform() string {\n\tif r == nil || r.Platform == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Platform\n}\n\n// GetVersion returns the Version field if it's non-nil, zero value otherwise.\nfunc (r *ReleaseVersion) GetVersion() string {\n\tif r == nil || r.Version == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Version\n}\n\n// GetMessage returns the Message field if it's non-nil, zero value otherwise.\nfunc (r *RemoveResourcesFromCostCenterResponse) GetMessage() string {\n\tif r == nil || r.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Message\n}\n\n// GetExpiresAt returns the ExpiresAt field if it's non-nil, zero value otherwise.\nfunc (r *RemoveToken) GetExpiresAt() Timestamp {\n\tif r == nil || r.ExpiresAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *r.ExpiresAt\n}\n\n// GetToken returns the Token field if it's non-nil, zero value otherwise.\nfunc (r *RemoveToken) GetToken() string {\n\tif r == nil || r.Token == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Token\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (r *Rename) GetFrom() string {\n\tif r == nil || r.From == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.From\n}\n\n// GetTo returns the To field if it's non-nil, zero value otherwise.\nfunc (r *Rename) GetTo() string {\n\tif r == nil || r.To == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.To\n}\n\n// GetMessage returns the Message field if it's non-nil, zero value otherwise.\nfunc (r *RenameOrgResponse) GetMessage() string {\n\tif r == nil || r.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Message\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (r *RenameOrgResponse) GetURL() string {\n\tif r == nil || r.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.URL\n}\n\n// GetLogin returns the Login field if it's non-nil, zero value otherwise.\nfunc (r *RepoAdvisoryCredit) GetLogin() string {\n\tif r == nil || r.Login == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Login\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (r *RepoAdvisoryCredit) GetType() string {\n\tif r == nil || r.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Type\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (r *RepoAdvisoryCreditDetailed) GetState() string {\n\tif r == nil || r.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.State\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (r *RepoAdvisoryCreditDetailed) GetType() string {\n\tif r == nil || r.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Type\n}\n\n// GetUser returns the User field.\nfunc (r *RepoAdvisoryCreditDetailed) GetUser() *User {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.User\n}\n\n// GetProperties returns the Properties slice if it's non-nil, nil otherwise.\nfunc (r *RepoCustomPropertyValue) GetProperties() []*CustomPropertyValue {\n\tif r == nil || r.Properties == nil {\n\t\treturn nil\n\t}\n\treturn r.Properties\n}\n\n// GetRepositoryFullName returns the RepositoryFullName field.\nfunc (r *RepoCustomPropertyValue) GetRepositoryFullName() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.RepositoryFullName\n}\n\n// GetRepositoryID returns the RepositoryID field.\nfunc (r *RepoCustomPropertyValue) GetRepositoryID() int64 {\n\tif r == nil {\n\t\treturn 0\n\t}\n\treturn r.RepositoryID\n}\n\n// GetRepositoryName returns the RepositoryName field.\nfunc (r *RepoCustomPropertyValue) GetRepositoryName() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.RepositoryName\n}\n\n// GetDownloadLocation returns the DownloadLocation field if it's non-nil, zero value otherwise.\nfunc (r *RepoDependencies) GetDownloadLocation() string {\n\tif r == nil || r.DownloadLocation == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.DownloadLocation\n}\n\n// GetExternalRefs returns the ExternalRefs slice if it's non-nil, nil otherwise.\nfunc (r *RepoDependencies) GetExternalRefs() []*PackageExternalRef {\n\tif r == nil || r.ExternalRefs == nil {\n\t\treturn nil\n\t}\n\treturn r.ExternalRefs\n}\n\n// GetFilesAnalyzed returns the FilesAnalyzed field if it's non-nil, zero value otherwise.\nfunc (r *RepoDependencies) GetFilesAnalyzed() bool {\n\tif r == nil || r.FilesAnalyzed == nil {\n\t\treturn false\n\t}\n\treturn *r.FilesAnalyzed\n}\n\n// GetLicenseConcluded returns the LicenseConcluded field if it's non-nil, zero value otherwise.\nfunc (r *RepoDependencies) GetLicenseConcluded() string {\n\tif r == nil || r.LicenseConcluded == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.LicenseConcluded\n}\n\n// GetLicenseDeclared returns the LicenseDeclared field if it's non-nil, zero value otherwise.\nfunc (r *RepoDependencies) GetLicenseDeclared() string {\n\tif r == nil || r.LicenseDeclared == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.LicenseDeclared\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (r *RepoDependencies) GetName() string {\n\tif r == nil || r.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Name\n}\n\n// GetSPDXID returns the SPDXID field if it's non-nil, zero value otherwise.\nfunc (r *RepoDependencies) GetSPDXID() string {\n\tif r == nil || r.SPDXID == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.SPDXID\n}\n\n// GetVersionInfo returns the VersionInfo field if it's non-nil, zero value otherwise.\nfunc (r *RepoDependencies) GetVersionInfo() string {\n\tif r == nil || r.VersionInfo == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.VersionInfo\n}\n\n// GetDescription returns the Description field.\nfunc (r *RepoFineGrainedPermission) GetDescription() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Description\n}\n\n// GetName returns the Name field.\nfunc (r *RepoFineGrainedPermission) GetName() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Name\n}\n\n// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise.\nfunc (r *RepoImmutableReleasesStatus) GetEnabled() bool {\n\tif r == nil || r.Enabled == nil {\n\t\treturn false\n\t}\n\treturn *r.Enabled\n}\n\n// GetEnforcedByOwner returns the EnforcedByOwner field if it's non-nil, zero value otherwise.\nfunc (r *RepoImmutableReleasesStatus) GetEnforcedByOwner() bool {\n\tif r == nil || r.EnforcedByOwner == nil {\n\t\treturn false\n\t}\n\treturn *r.EnforcedByOwner\n}\n\n// GetBranch returns the Branch field if it's non-nil, zero value otherwise.\nfunc (r *RepoMergeUpstreamRequest) GetBranch() string {\n\tif r == nil || r.Branch == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Branch\n}\n\n// GetBaseBranch returns the BaseBranch field if it's non-nil, zero value otherwise.\nfunc (r *RepoMergeUpstreamResult) GetBaseBranch() string {\n\tif r == nil || r.BaseBranch == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.BaseBranch\n}\n\n// GetMergeType returns the MergeType field if it's non-nil, zero value otherwise.\nfunc (r *RepoMergeUpstreamResult) GetMergeType() string {\n\tif r == nil || r.MergeType == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.MergeType\n}\n\n// GetMessage returns the Message field if it's non-nil, zero value otherwise.\nfunc (r *RepoMergeUpstreamResult) GetMessage() string {\n\tif r == nil || r.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Message\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (r *RepoName) GetFrom() string {\n\tif r == nil || r.From == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.From\n}\n\n// GetIncompleteResults returns the IncompleteResults field if it's non-nil, zero value otherwise.\nfunc (r *RepositoriesSearchResult) GetIncompleteResults() bool {\n\tif r == nil || r.IncompleteResults == nil {\n\t\treturn false\n\t}\n\treturn *r.IncompleteResults\n}\n\n// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise.\nfunc (r *RepositoriesSearchResult) GetRepositories() []*Repository {\n\tif r == nil || r.Repositories == nil {\n\t\treturn nil\n\t}\n\treturn r.Repositories\n}\n\n// GetTotal returns the Total field if it's non-nil, zero value otherwise.\nfunc (r *RepositoriesSearchResult) GetTotal() int {\n\tif r == nil || r.Total == nil {\n\t\treturn 0\n\t}\n\treturn *r.Total\n}\n\n// GetAllowAutoMerge returns the AllowAutoMerge field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetAllowAutoMerge() bool {\n\tif r == nil || r.AllowAutoMerge == nil {\n\t\treturn false\n\t}\n\treturn *r.AllowAutoMerge\n}\n\n// GetAllowForking returns the AllowForking field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetAllowForking() bool {\n\tif r == nil || r.AllowForking == nil {\n\t\treturn false\n\t}\n\treturn *r.AllowForking\n}\n\n// GetAllowMergeCommit returns the AllowMergeCommit field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetAllowMergeCommit() bool {\n\tif r == nil || r.AllowMergeCommit == nil {\n\t\treturn false\n\t}\n\treturn *r.AllowMergeCommit\n}\n\n// GetAllowRebaseMerge returns the AllowRebaseMerge field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetAllowRebaseMerge() bool {\n\tif r == nil || r.AllowRebaseMerge == nil {\n\t\treturn false\n\t}\n\treturn *r.AllowRebaseMerge\n}\n\n// GetAllowSquashMerge returns the AllowSquashMerge field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetAllowSquashMerge() bool {\n\tif r == nil || r.AllowSquashMerge == nil {\n\t\treturn false\n\t}\n\treturn *r.AllowSquashMerge\n}\n\n// GetAllowUpdateBranch returns the AllowUpdateBranch field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetAllowUpdateBranch() bool {\n\tif r == nil || r.AllowUpdateBranch == nil {\n\t\treturn false\n\t}\n\treturn *r.AllowUpdateBranch\n}\n\n// GetArchived returns the Archived field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetArchived() bool {\n\tif r == nil || r.Archived == nil {\n\t\treturn false\n\t}\n\treturn *r.Archived\n}\n\n// GetArchiveURL returns the ArchiveURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetArchiveURL() string {\n\tif r == nil || r.ArchiveURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.ArchiveURL\n}\n\n// GetAssigneesURL returns the AssigneesURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetAssigneesURL() string {\n\tif r == nil || r.AssigneesURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.AssigneesURL\n}\n\n// GetAutoInit returns the AutoInit field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetAutoInit() bool {\n\tif r == nil || r.AutoInit == nil {\n\t\treturn false\n\t}\n\treturn *r.AutoInit\n}\n\n// GetBlobsURL returns the BlobsURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetBlobsURL() string {\n\tif r == nil || r.BlobsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.BlobsURL\n}\n\n// GetBranchesURL returns the BranchesURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetBranchesURL() string {\n\tif r == nil || r.BranchesURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.BranchesURL\n}\n\n// GetCloneURL returns the CloneURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetCloneURL() string {\n\tif r == nil || r.CloneURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.CloneURL\n}\n\n// GetCodeOfConduct returns the CodeOfConduct field.\nfunc (r *Repository) GetCodeOfConduct() *CodeOfConduct {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.CodeOfConduct\n}\n\n// GetCollaboratorsURL returns the CollaboratorsURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetCollaboratorsURL() string {\n\tif r == nil || r.CollaboratorsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.CollaboratorsURL\n}\n\n// GetCommentsURL returns the CommentsURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetCommentsURL() string {\n\tif r == nil || r.CommentsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.CommentsURL\n}\n\n// GetCommitsURL returns the CommitsURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetCommitsURL() string {\n\tif r == nil || r.CommitsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.CommitsURL\n}\n\n// GetCompareURL returns the CompareURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetCompareURL() string {\n\tif r == nil || r.CompareURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.CompareURL\n}\n\n// GetContentsURL returns the ContentsURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetContentsURL() string {\n\tif r == nil || r.ContentsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.ContentsURL\n}\n\n// GetContributorsURL returns the ContributorsURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetContributorsURL() string {\n\tif r == nil || r.ContributorsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.ContributorsURL\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetCreatedAt() Timestamp {\n\tif r == nil || r.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *r.CreatedAt\n}\n\n// GetCustomProperties returns the CustomProperties map if it's non-nil, an empty map otherwise.\nfunc (r *Repository) GetCustomProperties() map[string]any {\n\tif r == nil || r.CustomProperties == nil {\n\t\treturn map[string]any{}\n\t}\n\treturn r.CustomProperties\n}\n\n// GetDefaultBranch returns the DefaultBranch field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetDefaultBranch() string {\n\tif r == nil || r.DefaultBranch == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.DefaultBranch\n}\n\n// GetDeleteBranchOnMerge returns the DeleteBranchOnMerge field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetDeleteBranchOnMerge() bool {\n\tif r == nil || r.DeleteBranchOnMerge == nil {\n\t\treturn false\n\t}\n\treturn *r.DeleteBranchOnMerge\n}\n\n// GetDeploymentsURL returns the DeploymentsURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetDeploymentsURL() string {\n\tif r == nil || r.DeploymentsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.DeploymentsURL\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetDescription() string {\n\tif r == nil || r.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Description\n}\n\n// GetDisabled returns the Disabled field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetDisabled() bool {\n\tif r == nil || r.Disabled == nil {\n\t\treturn false\n\t}\n\treturn *r.Disabled\n}\n\n// GetDownloadsURL returns the DownloadsURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetDownloadsURL() string {\n\tif r == nil || r.DownloadsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.DownloadsURL\n}\n\n// GetEventsURL returns the EventsURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetEventsURL() string {\n\tif r == nil || r.EventsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.EventsURL\n}\n\n// GetFork returns the Fork field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetFork() bool {\n\tif r == nil || r.Fork == nil {\n\t\treturn false\n\t}\n\treturn *r.Fork\n}\n\n// GetForksCount returns the ForksCount field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetForksCount() int {\n\tif r == nil || r.ForksCount == nil {\n\t\treturn 0\n\t}\n\treturn *r.ForksCount\n}\n\n// GetForksURL returns the ForksURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetForksURL() string {\n\tif r == nil || r.ForksURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.ForksURL\n}\n\n// GetFullName returns the FullName field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetFullName() string {\n\tif r == nil || r.FullName == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.FullName\n}\n\n// GetGitCommitsURL returns the GitCommitsURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetGitCommitsURL() string {\n\tif r == nil || r.GitCommitsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.GitCommitsURL\n}\n\n// GetGitignoreTemplate returns the GitignoreTemplate field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetGitignoreTemplate() string {\n\tif r == nil || r.GitignoreTemplate == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.GitignoreTemplate\n}\n\n// GetGitRefsURL returns the GitRefsURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetGitRefsURL() string {\n\tif r == nil || r.GitRefsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.GitRefsURL\n}\n\n// GetGitTagsURL returns the GitTagsURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetGitTagsURL() string {\n\tif r == nil || r.GitTagsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.GitTagsURL\n}\n\n// GetGitURL returns the GitURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetGitURL() string {\n\tif r == nil || r.GitURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.GitURL\n}\n\n// GetHasDiscussions returns the HasDiscussions field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetHasDiscussions() bool {\n\tif r == nil || r.HasDiscussions == nil {\n\t\treturn false\n\t}\n\treturn *r.HasDiscussions\n}\n\n// GetHasDownloads returns the HasDownloads field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetHasDownloads() bool {\n\tif r == nil || r.HasDownloads == nil {\n\t\treturn false\n\t}\n\treturn *r.HasDownloads\n}\n\n// GetHasIssues returns the HasIssues field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetHasIssues() bool {\n\tif r == nil || r.HasIssues == nil {\n\t\treturn false\n\t}\n\treturn *r.HasIssues\n}\n\n// GetHasPages returns the HasPages field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetHasPages() bool {\n\tif r == nil || r.HasPages == nil {\n\t\treturn false\n\t}\n\treturn *r.HasPages\n}\n\n// GetHasProjects returns the HasProjects field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetHasProjects() bool {\n\tif r == nil || r.HasProjects == nil {\n\t\treturn false\n\t}\n\treturn *r.HasProjects\n}\n\n// GetHasWiki returns the HasWiki field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetHasWiki() bool {\n\tif r == nil || r.HasWiki == nil {\n\t\treturn false\n\t}\n\treturn *r.HasWiki\n}\n\n// GetHomepage returns the Homepage field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetHomepage() string {\n\tif r == nil || r.Homepage == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Homepage\n}\n\n// GetHooksURL returns the HooksURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetHooksURL() string {\n\tif r == nil || r.HooksURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.HooksURL\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetHTMLURL() string {\n\tif r == nil || r.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetID() int64 {\n\tif r == nil || r.ID == nil {\n\t\treturn 0\n\t}\n\treturn *r.ID\n}\n\n// GetIssueCommentURL returns the IssueCommentURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetIssueCommentURL() string {\n\tif r == nil || r.IssueCommentURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.IssueCommentURL\n}\n\n// GetIssueEventsURL returns the IssueEventsURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetIssueEventsURL() string {\n\tif r == nil || r.IssueEventsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.IssueEventsURL\n}\n\n// GetIssuesURL returns the IssuesURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetIssuesURL() string {\n\tif r == nil || r.IssuesURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.IssuesURL\n}\n\n// GetIsTemplate returns the IsTemplate field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetIsTemplate() bool {\n\tif r == nil || r.IsTemplate == nil {\n\t\treturn false\n\t}\n\treturn *r.IsTemplate\n}\n\n// GetKeysURL returns the KeysURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetKeysURL() string {\n\tif r == nil || r.KeysURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.KeysURL\n}\n\n// GetLabelsURL returns the LabelsURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetLabelsURL() string {\n\tif r == nil || r.LabelsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.LabelsURL\n}\n\n// GetLanguage returns the Language field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetLanguage() string {\n\tif r == nil || r.Language == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Language\n}\n\n// GetLanguagesURL returns the LanguagesURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetLanguagesURL() string {\n\tif r == nil || r.LanguagesURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.LanguagesURL\n}\n\n// GetLicense returns the License field.\nfunc (r *Repository) GetLicense() *License {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.License\n}\n\n// GetLicenseTemplate returns the LicenseTemplate field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetLicenseTemplate() string {\n\tif r == nil || r.LicenseTemplate == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.LicenseTemplate\n}\n\n// GetMasterBranch returns the MasterBranch field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetMasterBranch() string {\n\tif r == nil || r.MasterBranch == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.MasterBranch\n}\n\n// GetMergeCommitMessage returns the MergeCommitMessage field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetMergeCommitMessage() string {\n\tif r == nil || r.MergeCommitMessage == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.MergeCommitMessage\n}\n\n// GetMergeCommitTitle returns the MergeCommitTitle field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetMergeCommitTitle() string {\n\tif r == nil || r.MergeCommitTitle == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.MergeCommitTitle\n}\n\n// GetMergesURL returns the MergesURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetMergesURL() string {\n\tif r == nil || r.MergesURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.MergesURL\n}\n\n// GetMilestonesURL returns the MilestonesURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetMilestonesURL() string {\n\tif r == nil || r.MilestonesURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.MilestonesURL\n}\n\n// GetMirrorURL returns the MirrorURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetMirrorURL() string {\n\tif r == nil || r.MirrorURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.MirrorURL\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetName() string {\n\tif r == nil || r.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Name\n}\n\n// GetNetworkCount returns the NetworkCount field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetNetworkCount() int {\n\tif r == nil || r.NetworkCount == nil {\n\t\treturn 0\n\t}\n\treturn *r.NetworkCount\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetNodeID() string {\n\tif r == nil || r.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.NodeID\n}\n\n// GetNotificationsURL returns the NotificationsURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetNotificationsURL() string {\n\tif r == nil || r.NotificationsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.NotificationsURL\n}\n\n// GetOpenIssues returns the OpenIssues field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetOpenIssues() int {\n\tif r == nil || r.OpenIssues == nil {\n\t\treturn 0\n\t}\n\treturn *r.OpenIssues\n}\n\n// GetOpenIssuesCount returns the OpenIssuesCount field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetOpenIssuesCount() int {\n\tif r == nil || r.OpenIssuesCount == nil {\n\t\treturn 0\n\t}\n\treturn *r.OpenIssuesCount\n}\n\n// GetOrganization returns the Organization field.\nfunc (r *Repository) GetOrganization() *Organization {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Organization\n}\n\n// GetOwner returns the Owner field.\nfunc (r *Repository) GetOwner() *User {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Owner\n}\n\n// GetParent returns the Parent field.\nfunc (r *Repository) GetParent() *Repository {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Parent\n}\n\n// GetPermissions returns the Permissions field.\nfunc (r *Repository) GetPermissions() *RepositoryPermissions {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Permissions\n}\n\n// GetPrivate returns the Private field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetPrivate() bool {\n\tif r == nil || r.Private == nil {\n\t\treturn false\n\t}\n\treturn *r.Private\n}\n\n// GetPullsURL returns the PullsURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetPullsURL() string {\n\tif r == nil || r.PullsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.PullsURL\n}\n\n// GetPushedAt returns the PushedAt field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetPushedAt() Timestamp {\n\tif r == nil || r.PushedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *r.PushedAt\n}\n\n// GetReleasesURL returns the ReleasesURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetReleasesURL() string {\n\tif r == nil || r.ReleasesURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.ReleasesURL\n}\n\n// GetRoleName returns the RoleName field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetRoleName() string {\n\tif r == nil || r.RoleName == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.RoleName\n}\n\n// GetSecurityAndAnalysis returns the SecurityAndAnalysis field.\nfunc (r *Repository) GetSecurityAndAnalysis() *SecurityAndAnalysis {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.SecurityAndAnalysis\n}\n\n// GetSize returns the Size field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetSize() int {\n\tif r == nil || r.Size == nil {\n\t\treturn 0\n\t}\n\treturn *r.Size\n}\n\n// GetSource returns the Source field.\nfunc (r *Repository) GetSource() *Repository {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Source\n}\n\n// GetSquashMergeCommitMessage returns the SquashMergeCommitMessage field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetSquashMergeCommitMessage() string {\n\tif r == nil || r.SquashMergeCommitMessage == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.SquashMergeCommitMessage\n}\n\n// GetSquashMergeCommitTitle returns the SquashMergeCommitTitle field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetSquashMergeCommitTitle() string {\n\tif r == nil || r.SquashMergeCommitTitle == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.SquashMergeCommitTitle\n}\n\n// GetSSHURL returns the SSHURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetSSHURL() string {\n\tif r == nil || r.SSHURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.SSHURL\n}\n\n// GetStargazersCount returns the StargazersCount field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetStargazersCount() int {\n\tif r == nil || r.StargazersCount == nil {\n\t\treturn 0\n\t}\n\treturn *r.StargazersCount\n}\n\n// GetStargazersURL returns the StargazersURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetStargazersURL() string {\n\tif r == nil || r.StargazersURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.StargazersURL\n}\n\n// GetStatusesURL returns the StatusesURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetStatusesURL() string {\n\tif r == nil || r.StatusesURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.StatusesURL\n}\n\n// GetSubscribersCount returns the SubscribersCount field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetSubscribersCount() int {\n\tif r == nil || r.SubscribersCount == nil {\n\t\treturn 0\n\t}\n\treturn *r.SubscribersCount\n}\n\n// GetSubscribersURL returns the SubscribersURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetSubscribersURL() string {\n\tif r == nil || r.SubscribersURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.SubscribersURL\n}\n\n// GetSubscriptionURL returns the SubscriptionURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetSubscriptionURL() string {\n\tif r == nil || r.SubscriptionURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.SubscriptionURL\n}\n\n// GetSVNURL returns the SVNURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetSVNURL() string {\n\tif r == nil || r.SVNURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.SVNURL\n}\n\n// GetTagsURL returns the TagsURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetTagsURL() string {\n\tif r == nil || r.TagsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.TagsURL\n}\n\n// GetTeamID returns the TeamID field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetTeamID() int64 {\n\tif r == nil || r.TeamID == nil {\n\t\treturn 0\n\t}\n\treturn *r.TeamID\n}\n\n// GetTeamsURL returns the TeamsURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetTeamsURL() string {\n\tif r == nil || r.TeamsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.TeamsURL\n}\n\n// GetTemplateRepository returns the TemplateRepository field.\nfunc (r *Repository) GetTemplateRepository() *Repository {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.TemplateRepository\n}\n\n// GetTextMatches returns the TextMatches slice if it's non-nil, nil otherwise.\nfunc (r *Repository) GetTextMatches() []*TextMatch {\n\tif r == nil || r.TextMatches == nil {\n\t\treturn nil\n\t}\n\treturn r.TextMatches\n}\n\n// GetTopics returns the Topics slice if it's non-nil, nil otherwise.\nfunc (r *Repository) GetTopics() []string {\n\tif r == nil || r.Topics == nil {\n\t\treturn nil\n\t}\n\treturn r.Topics\n}\n\n// GetTreesURL returns the TreesURL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetTreesURL() string {\n\tif r == nil || r.TreesURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.TreesURL\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetUpdatedAt() Timestamp {\n\tif r == nil || r.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *r.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetURL() string {\n\tif r == nil || r.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.URL\n}\n\n// GetUseSquashPRTitleAsDefault returns the UseSquashPRTitleAsDefault field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetUseSquashPRTitleAsDefault() bool {\n\tif r == nil || r.UseSquashPRTitleAsDefault == nil {\n\t\treturn false\n\t}\n\treturn *r.UseSquashPRTitleAsDefault\n}\n\n// GetVisibility returns the Visibility field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetVisibility() string {\n\tif r == nil || r.Visibility == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Visibility\n}\n\n// GetWatchers returns the Watchers field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetWatchers() int {\n\tif r == nil || r.Watchers == nil {\n\t\treturn 0\n\t}\n\treturn *r.Watchers\n}\n\n// GetWatchersCount returns the WatchersCount field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetWatchersCount() int {\n\tif r == nil || r.WatchersCount == nil {\n\t\treturn 0\n\t}\n\treturn *r.WatchersCount\n}\n\n// GetWebCommitSignoffRequired returns the WebCommitSignoffRequired field if it's non-nil, zero value otherwise.\nfunc (r *Repository) GetWebCommitSignoffRequired() bool {\n\tif r == nil || r.WebCommitSignoffRequired == nil {\n\t\treturn false\n\t}\n\treturn *r.WebCommitSignoffRequired\n}\n\n// GetAccessLevel returns the AccessLevel field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryActionsAccessLevel) GetAccessLevel() string {\n\tif r == nil || r.AccessLevel == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.AccessLevel\n}\n\n// GetAdvancedSecurityCommitters returns the AdvancedSecurityCommitters field.\nfunc (r *RepositoryActiveCommitters) GetAdvancedSecurityCommitters() int {\n\tif r == nil {\n\t\treturn 0\n\t}\n\treturn r.AdvancedSecurityCommitters\n}\n\n// GetAdvancedSecurityCommittersBreakdown returns the AdvancedSecurityCommittersBreakdown slice if it's non-nil, nil otherwise.\nfunc (r *RepositoryActiveCommitters) GetAdvancedSecurityCommittersBreakdown() []*AdvancedSecurityCommittersBreakdown {\n\tif r == nil || r.AdvancedSecurityCommittersBreakdown == nil {\n\t\treturn nil\n\t}\n\treturn r.AdvancedSecurityCommittersBreakdown\n}\n\n// GetName returns the Name field.\nfunc (r *RepositoryActiveCommitters) GetName() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Name\n}\n\n// GetActivityType returns the ActivityType field.\nfunc (r *RepositoryActivity) GetActivityType() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.ActivityType\n}\n\n// GetActor returns the Actor field.\nfunc (r *RepositoryActivity) GetActor() *RepositoryActor {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Actor\n}\n\n// GetAfter returns the After field.\nfunc (r *RepositoryActivity) GetAfter() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.After\n}\n\n// GetBefore returns the Before field.\nfunc (r *RepositoryActivity) GetBefore() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Before\n}\n\n// GetID returns the ID field.\nfunc (r *RepositoryActivity) GetID() int64 {\n\tif r == nil {\n\t\treturn 0\n\t}\n\treturn r.ID\n}\n\n// GetNodeID returns the NodeID field.\nfunc (r *RepositoryActivity) GetNodeID() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.NodeID\n}\n\n// GetRef returns the Ref field.\nfunc (r *RepositoryActivity) GetRef() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Ref\n}\n\n// GetTimestamp returns the Timestamp field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryActivity) GetTimestamp() Timestamp {\n\tif r == nil || r.Timestamp == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *r.Timestamp\n}\n\n// GetAvatarURL returns the AvatarURL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryActor) GetAvatarURL() string {\n\tif r == nil || r.AvatarURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.AvatarURL\n}\n\n// GetEventsURL returns the EventsURL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryActor) GetEventsURL() string {\n\tif r == nil || r.EventsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.EventsURL\n}\n\n// GetFollowersURL returns the FollowersURL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryActor) GetFollowersURL() string {\n\tif r == nil || r.FollowersURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.FollowersURL\n}\n\n// GetFollowingURL returns the FollowingURL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryActor) GetFollowingURL() string {\n\tif r == nil || r.FollowingURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.FollowingURL\n}\n\n// GetGistsURL returns the GistsURL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryActor) GetGistsURL() string {\n\tif r == nil || r.GistsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.GistsURL\n}\n\n// GetGravatarID returns the GravatarID field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryActor) GetGravatarID() string {\n\tif r == nil || r.GravatarID == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.GravatarID\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryActor) GetHTMLURL() string {\n\tif r == nil || r.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryActor) GetID() int64 {\n\tif r == nil || r.ID == nil {\n\t\treturn 0\n\t}\n\treturn *r.ID\n}\n\n// GetLogin returns the Login field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryActor) GetLogin() string {\n\tif r == nil || r.Login == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Login\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryActor) GetNodeID() string {\n\tif r == nil || r.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.NodeID\n}\n\n// GetOrganizationsURL returns the OrganizationsURL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryActor) GetOrganizationsURL() string {\n\tif r == nil || r.OrganizationsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.OrganizationsURL\n}\n\n// GetReceivedEventsURL returns the ReceivedEventsURL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryActor) GetReceivedEventsURL() string {\n\tif r == nil || r.ReceivedEventsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.ReceivedEventsURL\n}\n\n// GetReposURL returns the ReposURL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryActor) GetReposURL() string {\n\tif r == nil || r.ReposURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.ReposURL\n}\n\n// GetSiteAdmin returns the SiteAdmin field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryActor) GetSiteAdmin() bool {\n\tif r == nil || r.SiteAdmin == nil {\n\t\treturn false\n\t}\n\treturn *r.SiteAdmin\n}\n\n// GetStarredURL returns the StarredURL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryActor) GetStarredURL() string {\n\tif r == nil || r.StarredURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.StarredURL\n}\n\n// GetSubscriptionsURL returns the SubscriptionsURL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryActor) GetSubscriptionsURL() string {\n\tif r == nil || r.SubscriptionsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.SubscriptionsURL\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryActor) GetType() string {\n\tif r == nil || r.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Type\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryActor) GetURL() string {\n\tif r == nil || r.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.URL\n}\n\n// GetUserViewType returns the UserViewType field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryActor) GetUserViewType() string {\n\tif r == nil || r.UserViewType == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.UserViewType\n}\n\n// GetPermission returns the Permission field.\nfunc (r *RepositoryAddCollaboratorOptions) GetPermission() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Permission\n}\n\n// GetRepository returns the Repository field.\nfunc (r *RepositoryAttachment) GetRepository() *Repository {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Repository\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryAttachment) GetStatus() string {\n\tif r == nil || r.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Status\n}\n\n// GetConfiguration returns the Configuration field.\nfunc (r *RepositoryCodeSecurityConfiguration) GetConfiguration() *CodeSecurityConfiguration {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Configuration\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryCodeSecurityConfiguration) GetState() string {\n\tif r == nil || r.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.State\n}\n\n// GetBody returns the Body field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryComment) GetBody() string {\n\tif r == nil || r.Body == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Body\n}\n\n// GetCommitID returns the CommitID field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryComment) GetCommitID() string {\n\tif r == nil || r.CommitID == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.CommitID\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryComment) GetCreatedAt() Timestamp {\n\tif r == nil || r.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *r.CreatedAt\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryComment) GetHTMLURL() string {\n\tif r == nil || r.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryComment) GetID() int64 {\n\tif r == nil || r.ID == nil {\n\t\treturn 0\n\t}\n\treturn *r.ID\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryComment) GetNodeID() string {\n\tif r == nil || r.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.NodeID\n}\n\n// GetPath returns the Path field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryComment) GetPath() string {\n\tif r == nil || r.Path == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Path\n}\n\n// GetPosition returns the Position field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryComment) GetPosition() int {\n\tif r == nil || r.Position == nil {\n\t\treturn 0\n\t}\n\treturn *r.Position\n}\n\n// GetReactions returns the Reactions field.\nfunc (r *RepositoryComment) GetReactions() *Reactions {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Reactions\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryComment) GetUpdatedAt() Timestamp {\n\tif r == nil || r.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *r.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryComment) GetURL() string {\n\tif r == nil || r.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.URL\n}\n\n// GetUser returns the User field.\nfunc (r *RepositoryComment) GetUser() *User {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.User\n}\n\n// GetAuthor returns the Author field.\nfunc (r *RepositoryCommit) GetAuthor() *User {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Author\n}\n\n// GetCommentsURL returns the CommentsURL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryCommit) GetCommentsURL() string {\n\tif r == nil || r.CommentsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.CommentsURL\n}\n\n// GetCommit returns the Commit field.\nfunc (r *RepositoryCommit) GetCommit() *Commit {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Commit\n}\n\n// GetCommitter returns the Committer field.\nfunc (r *RepositoryCommit) GetCommitter() *User {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Committer\n}\n\n// GetFiles returns the Files slice if it's non-nil, nil otherwise.\nfunc (r *RepositoryCommit) GetFiles() []*CommitFile {\n\tif r == nil || r.Files == nil {\n\t\treturn nil\n\t}\n\treturn r.Files\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryCommit) GetHTMLURL() string {\n\tif r == nil || r.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.HTMLURL\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryCommit) GetNodeID() string {\n\tif r == nil || r.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.NodeID\n}\n\n// GetParents returns the Parents slice if it's non-nil, nil otherwise.\nfunc (r *RepositoryCommit) GetParents() []*Commit {\n\tif r == nil || r.Parents == nil {\n\t\treturn nil\n\t}\n\treturn r.Parents\n}\n\n// GetSHA returns the SHA field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryCommit) GetSHA() string {\n\tif r == nil || r.SHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.SHA\n}\n\n// GetStats returns the Stats field.\nfunc (r *RepositoryCommit) GetStats() *CommitStats {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Stats\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryCommit) GetURL() string {\n\tif r == nil || r.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.URL\n}\n\n// GetDownloadURL returns the DownloadURL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryContent) GetDownloadURL() string {\n\tif r == nil || r.DownloadURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.DownloadURL\n}\n\n// GetEncoding returns the Encoding field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryContent) GetEncoding() string {\n\tif r == nil || r.Encoding == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Encoding\n}\n\n// GetGitURL returns the GitURL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryContent) GetGitURL() string {\n\tif r == nil || r.GitURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.GitURL\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryContent) GetHTMLURL() string {\n\tif r == nil || r.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.HTMLURL\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryContent) GetName() string {\n\tif r == nil || r.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Name\n}\n\n// GetPath returns the Path field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryContent) GetPath() string {\n\tif r == nil || r.Path == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Path\n}\n\n// GetSHA returns the SHA field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryContent) GetSHA() string {\n\tif r == nil || r.SHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.SHA\n}\n\n// GetSize returns the Size field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryContent) GetSize() int {\n\tif r == nil || r.Size == nil {\n\t\treturn 0\n\t}\n\treturn *r.Size\n}\n\n// GetSubmoduleGitURL returns the SubmoduleGitURL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryContent) GetSubmoduleGitURL() string {\n\tif r == nil || r.SubmoduleGitURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.SubmoduleGitURL\n}\n\n// GetTarget returns the Target field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryContent) GetTarget() string {\n\tif r == nil || r.Target == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Target\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryContent) GetType() string {\n\tif r == nil || r.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Type\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryContent) GetURL() string {\n\tif r == nil || r.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.URL\n}\n\n// GetAuthor returns the Author field.\nfunc (r *RepositoryContentFileOptions) GetAuthor() *CommitAuthor {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Author\n}\n\n// GetBranch returns the Branch field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryContentFileOptions) GetBranch() string {\n\tif r == nil || r.Branch == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Branch\n}\n\n// GetCommitter returns the Committer field.\nfunc (r *RepositoryContentFileOptions) GetCommitter() *CommitAuthor {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Committer\n}\n\n// GetContent returns the Content slice if it's non-nil, nil otherwise.\nfunc (r *RepositoryContentFileOptions) GetContent() []byte {\n\tif r == nil || r.Content == nil {\n\t\treturn nil\n\t}\n\treturn r.Content\n}\n\n// GetMessage returns the Message field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryContentFileOptions) GetMessage() string {\n\tif r == nil || r.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Message\n}\n\n// GetSHA returns the SHA field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryContentFileOptions) GetSHA() string {\n\tif r == nil || r.SHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.SHA\n}\n\n// GetRef returns the Ref field.\nfunc (r *RepositoryContentGetOptions) GetRef() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Ref\n}\n\n// GetContent returns the Content field.\nfunc (r *RepositoryContentResponse) GetContent() *RepositoryContent {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Content\n}\n\n// GetDefaultBranchOnly returns the DefaultBranchOnly field.\nfunc (r *RepositoryCreateForkOptions) GetDefaultBranchOnly() bool {\n\tif r == nil {\n\t\treturn false\n\t}\n\treturn r.DefaultBranchOnly\n}\n\n// GetName returns the Name field.\nfunc (r *RepositoryCreateForkOptions) GetName() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Name\n}\n\n// GetOrganization returns the Organization field.\nfunc (r *RepositoryCreateForkOptions) GetOrganization() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Organization\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryDispatchEvent) GetAction() string {\n\tif r == nil || r.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Action\n}\n\n// GetBranch returns the Branch field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryDispatchEvent) GetBranch() string {\n\tif r == nil || r.Branch == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Branch\n}\n\n// GetClientPayload returns the ClientPayload field.\nfunc (r *RepositoryDispatchEvent) GetClientPayload() json.RawMessage {\n\tif r == nil {\n\t\treturn json.RawMessage{}\n\t}\n\treturn r.ClientPayload\n}\n\n// GetInstallation returns the Installation field.\nfunc (r *RepositoryDispatchEvent) GetInstallation() *Installation {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (r *RepositoryDispatchEvent) GetOrg() *Organization {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Org\n}\n\n// GetRepo returns the Repo field.\nfunc (r *RepositoryDispatchEvent) GetRepo() *Repository {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (r *RepositoryDispatchEvent) GetSender() *User {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Sender\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryEvent) GetAction() string {\n\tif r == nil || r.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Action\n}\n\n// GetChanges returns the Changes field.\nfunc (r *RepositoryEvent) GetChanges() *EditChange {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Changes\n}\n\n// GetInstallation returns the Installation field.\nfunc (r *RepositoryEvent) GetInstallation() *Installation {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (r *RepositoryEvent) GetOrg() *Organization {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Org\n}\n\n// GetRepo returns the Repo field.\nfunc (r *RepositoryEvent) GetRepo() *Repository {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (r *RepositoryEvent) GetSender() *User {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Sender\n}\n\n// GetOrg returns the Org field.\nfunc (r *RepositoryImportEvent) GetOrg() *Organization {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Org\n}\n\n// GetRepo returns the Repo field.\nfunc (r *RepositoryImportEvent) GetRepo() *Repository {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (r *RepositoryImportEvent) GetSender() *User {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Sender\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryImportEvent) GetStatus() string {\n\tif r == nil || r.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Status\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryInvitation) GetCreatedAt() Timestamp {\n\tif r == nil || r.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *r.CreatedAt\n}\n\n// GetExpired returns the Expired field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryInvitation) GetExpired() bool {\n\tif r == nil || r.Expired == nil {\n\t\treturn false\n\t}\n\treturn *r.Expired\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryInvitation) GetHTMLURL() string {\n\tif r == nil || r.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryInvitation) GetID() int64 {\n\tif r == nil || r.ID == nil {\n\t\treturn 0\n\t}\n\treturn *r.ID\n}\n\n// GetInvitee returns the Invitee field.\nfunc (r *RepositoryInvitation) GetInvitee() *User {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Invitee\n}\n\n// GetInviter returns the Inviter field.\nfunc (r *RepositoryInvitation) GetInviter() *User {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Inviter\n}\n\n// GetPermissions returns the Permissions field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryInvitation) GetPermissions() string {\n\tif r == nil || r.Permissions == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Permissions\n}\n\n// GetRepo returns the Repo field.\nfunc (r *RepositoryInvitation) GetRepo() *Repository {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Repo\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryInvitation) GetURL() string {\n\tif r == nil || r.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.URL\n}\n\n// GetContent returns the Content field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryLicense) GetContent() string {\n\tif r == nil || r.Content == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Content\n}\n\n// GetDownloadURL returns the DownloadURL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryLicense) GetDownloadURL() string {\n\tif r == nil || r.DownloadURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.DownloadURL\n}\n\n// GetEncoding returns the Encoding field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryLicense) GetEncoding() string {\n\tif r == nil || r.Encoding == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Encoding\n}\n\n// GetGitURL returns the GitURL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryLicense) GetGitURL() string {\n\tif r == nil || r.GitURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.GitURL\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryLicense) GetHTMLURL() string {\n\tif r == nil || r.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.HTMLURL\n}\n\n// GetLicense returns the License field.\nfunc (r *RepositoryLicense) GetLicense() *License {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.License\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryLicense) GetName() string {\n\tif r == nil || r.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Name\n}\n\n// GetPath returns the Path field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryLicense) GetPath() string {\n\tif r == nil || r.Path == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Path\n}\n\n// GetSHA returns the SHA field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryLicense) GetSHA() string {\n\tif r == nil || r.SHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.SHA\n}\n\n// GetSize returns the Size field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryLicense) GetSize() int {\n\tif r == nil || r.Size == nil {\n\t\treturn 0\n\t}\n\treturn *r.Size\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryLicense) GetType() string {\n\tif r == nil || r.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Type\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryLicense) GetURL() string {\n\tif r == nil || r.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.URL\n}\n\n// GetSince returns the Since field.\nfunc (r *RepositoryListAllOptions) GetSince() int64 {\n\tif r == nil {\n\t\treturn 0\n\t}\n\treturn r.Since\n}\n\n// GetAffiliation returns the Affiliation field.\nfunc (r *RepositoryListByAuthenticatedUserOptions) GetAffiliation() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Affiliation\n}\n\n// GetDirection returns the Direction field.\nfunc (r *RepositoryListByAuthenticatedUserOptions) GetDirection() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Direction\n}\n\n// GetSort returns the Sort field.\nfunc (r *RepositoryListByAuthenticatedUserOptions) GetSort() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Sort\n}\n\n// GetType returns the Type field.\nfunc (r *RepositoryListByAuthenticatedUserOptions) GetType() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Type\n}\n\n// GetVisibility returns the Visibility field.\nfunc (r *RepositoryListByAuthenticatedUserOptions) GetVisibility() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Visibility\n}\n\n// GetDirection returns the Direction field.\nfunc (r *RepositoryListByOrgOptions) GetDirection() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Direction\n}\n\n// GetSort returns the Sort field.\nfunc (r *RepositoryListByOrgOptions) GetSort() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Sort\n}\n\n// GetType returns the Type field.\nfunc (r *RepositoryListByOrgOptions) GetType() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Type\n}\n\n// GetDirection returns the Direction field.\nfunc (r *RepositoryListByUserOptions) GetDirection() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Direction\n}\n\n// GetSort returns the Sort field.\nfunc (r *RepositoryListByUserOptions) GetSort() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Sort\n}\n\n// GetType returns the Type field.\nfunc (r *RepositoryListByUserOptions) GetType() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Type\n}\n\n// GetSort returns the Sort field.\nfunc (r *RepositoryListForksOptions) GetSort() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Sort\n}\n\n// GetAffiliation returns the Affiliation field.\nfunc (r *RepositoryListOptions) GetAffiliation() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Affiliation\n}\n\n// GetDirection returns the Direction field.\nfunc (r *RepositoryListOptions) GetDirection() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Direction\n}\n\n// GetSort returns the Sort field.\nfunc (r *RepositoryListOptions) GetSort() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Sort\n}\n\n// GetType returns the Type field.\nfunc (r *RepositoryListOptions) GetType() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Type\n}\n\n// GetVisibility returns the Visibility field.\nfunc (r *RepositoryListOptions) GetVisibility() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Visibility\n}\n\n// GetIncludesParents returns the IncludesParents field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryListRulesetsOptions) GetIncludesParents() bool {\n\tif r == nil || r.IncludesParents == nil {\n\t\treturn false\n\t}\n\treturn *r.IncludesParents\n}\n\n// GetBase returns the Base field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryMergeRequest) GetBase() string {\n\tif r == nil || r.Base == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Base\n}\n\n// GetCommitMessage returns the CommitMessage field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryMergeRequest) GetCommitMessage() string {\n\tif r == nil || r.CommitMessage == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.CommitMessage\n}\n\n// GetHead returns the Head field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryMergeRequest) GetHead() string {\n\tif r == nil || r.Head == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Head\n}\n\n// GetAll returns the All slice if it's non-nil, nil otherwise.\nfunc (r *RepositoryParticipation) GetAll() []int {\n\tif r == nil || r.All == nil {\n\t\treturn nil\n\t}\n\treturn r.All\n}\n\n// GetOwner returns the Owner slice if it's non-nil, nil otherwise.\nfunc (r *RepositoryParticipation) GetOwner() []int {\n\tif r == nil || r.Owner == nil {\n\t\treturn nil\n\t}\n\treturn r.Owner\n}\n\n// GetPermission returns the Permission field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryPermissionLevel) GetPermission() string {\n\tif r == nil || r.Permission == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Permission\n}\n\n// GetRoleName returns the RoleName field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryPermissionLevel) GetRoleName() string {\n\tif r == nil || r.RoleName == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.RoleName\n}\n\n// GetUser returns the User field.\nfunc (r *RepositoryPermissionLevel) GetUser() *User {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.User\n}\n\n// GetAdmin returns the Admin field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryPermissions) GetAdmin() bool {\n\tif r == nil || r.Admin == nil {\n\t\treturn false\n\t}\n\treturn *r.Admin\n}\n\n// GetMaintain returns the Maintain field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryPermissions) GetMaintain() bool {\n\tif r == nil || r.Maintain == nil {\n\t\treturn false\n\t}\n\treturn *r.Maintain\n}\n\n// GetPull returns the Pull field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryPermissions) GetPull() bool {\n\tif r == nil || r.Pull == nil {\n\t\treturn false\n\t}\n\treturn *r.Pull\n}\n\n// GetPush returns the Push field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryPermissions) GetPush() bool {\n\tif r == nil || r.Push == nil {\n\t\treturn false\n\t}\n\treturn *r.Push\n}\n\n// GetTriage returns the Triage field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryPermissions) GetTriage() bool {\n\tif r == nil || r.Triage == nil {\n\t\treturn false\n\t}\n\treturn *r.Triage\n}\n\n// GetAssets returns the Assets slice if it's non-nil, nil otherwise.\nfunc (r *RepositoryRelease) GetAssets() []*ReleaseAsset {\n\tif r == nil || r.Assets == nil {\n\t\treturn nil\n\t}\n\treturn r.Assets\n}\n\n// GetAssetsURL returns the AssetsURL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryRelease) GetAssetsURL() string {\n\tif r == nil || r.AssetsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.AssetsURL\n}\n\n// GetAuthor returns the Author field.\nfunc (r *RepositoryRelease) GetAuthor() *User {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Author\n}\n\n// GetBody returns the Body field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryRelease) GetBody() string {\n\tif r == nil || r.Body == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Body\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryRelease) GetCreatedAt() Timestamp {\n\tif r == nil || r.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *r.CreatedAt\n}\n\n// GetDiscussionCategoryName returns the DiscussionCategoryName field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryRelease) GetDiscussionCategoryName() string {\n\tif r == nil || r.DiscussionCategoryName == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.DiscussionCategoryName\n}\n\n// GetDraft returns the Draft field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryRelease) GetDraft() bool {\n\tif r == nil || r.Draft == nil {\n\t\treturn false\n\t}\n\treturn *r.Draft\n}\n\n// GetGenerateReleaseNotes returns the GenerateReleaseNotes field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryRelease) GetGenerateReleaseNotes() bool {\n\tif r == nil || r.GenerateReleaseNotes == nil {\n\t\treturn false\n\t}\n\treturn *r.GenerateReleaseNotes\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryRelease) GetHTMLURL() string {\n\tif r == nil || r.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryRelease) GetID() int64 {\n\tif r == nil || r.ID == nil {\n\t\treturn 0\n\t}\n\treturn *r.ID\n}\n\n// GetImmutable returns the Immutable field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryRelease) GetImmutable() bool {\n\tif r == nil || r.Immutable == nil {\n\t\treturn false\n\t}\n\treturn *r.Immutable\n}\n\n// GetMakeLatest returns the MakeLatest field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryRelease) GetMakeLatest() string {\n\tif r == nil || r.MakeLatest == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.MakeLatest\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryRelease) GetName() string {\n\tif r == nil || r.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Name\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryRelease) GetNodeID() string {\n\tif r == nil || r.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.NodeID\n}\n\n// GetPrerelease returns the Prerelease field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryRelease) GetPrerelease() bool {\n\tif r == nil || r.Prerelease == nil {\n\t\treturn false\n\t}\n\treturn *r.Prerelease\n}\n\n// GetPublishedAt returns the PublishedAt field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryRelease) GetPublishedAt() Timestamp {\n\tif r == nil || r.PublishedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *r.PublishedAt\n}\n\n// GetTagName returns the TagName field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryRelease) GetTagName() string {\n\tif r == nil || r.TagName == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.TagName\n}\n\n// GetTarballURL returns the TarballURL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryRelease) GetTarballURL() string {\n\tif r == nil || r.TarballURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.TarballURL\n}\n\n// GetTargetCommitish returns the TargetCommitish field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryRelease) GetTargetCommitish() string {\n\tif r == nil || r.TargetCommitish == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.TargetCommitish\n}\n\n// GetUploadURL returns the UploadURL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryRelease) GetUploadURL() string {\n\tif r == nil || r.UploadURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.UploadURL\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryRelease) GetURL() string {\n\tif r == nil || r.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.URL\n}\n\n// GetZipballURL returns the ZipballURL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryRelease) GetZipballURL() string {\n\tif r == nil || r.ZipballURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.ZipballURL\n}\n\n// GetBody returns the Body field.\nfunc (r *RepositoryReleaseNotes) GetBody() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Body\n}\n\n// GetName returns the Name field.\nfunc (r *RepositoryReleaseNotes) GetName() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Name\n}\n\n// GetParameters returns the Parameters field.\nfunc (r *RepositoryRule) GetParameters() any {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Parameters\n}\n\n// GetType returns the Type field.\nfunc (r *RepositoryRule) GetType() RepositoryRuleType {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Type\n}\n\n// GetBypassActors returns the BypassActors slice if it's non-nil, nil otherwise.\nfunc (r *RepositoryRuleset) GetBypassActors() []*BypassActor {\n\tif r == nil || r.BypassActors == nil {\n\t\treturn nil\n\t}\n\treturn r.BypassActors\n}\n\n// GetConditions returns the Conditions field.\nfunc (r *RepositoryRuleset) GetConditions() *RepositoryRulesetConditions {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Conditions\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryRuleset) GetCreatedAt() Timestamp {\n\tif r == nil || r.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *r.CreatedAt\n}\n\n// GetCurrentUserCanBypass returns the CurrentUserCanBypass field.\nfunc (r *RepositoryRuleset) GetCurrentUserCanBypass() *BypassMode {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.CurrentUserCanBypass\n}\n\n// GetEnforcement returns the Enforcement field.\nfunc (r *RepositoryRuleset) GetEnforcement() RulesetEnforcement {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Enforcement\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryRuleset) GetID() int64 {\n\tif r == nil || r.ID == nil {\n\t\treturn 0\n\t}\n\treturn *r.ID\n}\n\n// GetLinks returns the Links field.\nfunc (r *RepositoryRuleset) GetLinks() *RepositoryRulesetLinks {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Links\n}\n\n// GetName returns the Name field.\nfunc (r *RepositoryRuleset) GetName() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Name\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryRuleset) GetNodeID() string {\n\tif r == nil || r.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.NodeID\n}\n\n// GetRules returns the Rules field.\nfunc (r *RepositoryRuleset) GetRules() *RepositoryRulesetRules {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Rules\n}\n\n// GetSource returns the Source field.\nfunc (r *RepositoryRuleset) GetSource() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Source\n}\n\n// GetSourceType returns the SourceType field.\nfunc (r *RepositoryRuleset) GetSourceType() *RulesetSourceType {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.SourceType\n}\n\n// GetTarget returns the Target field.\nfunc (r *RepositoryRuleset) GetTarget() *RulesetTarget {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Target\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryRuleset) GetUpdatedAt() Timestamp {\n\tif r == nil || r.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *r.UpdatedAt\n}\n\n// GetAdded returns the Added slice if it's non-nil, nil otherwise.\nfunc (r *RepositoryRulesetChangedConditions) GetAdded() []*RepositoryRulesetConditions {\n\tif r == nil || r.Added == nil {\n\t\treturn nil\n\t}\n\treturn r.Added\n}\n\n// GetDeleted returns the Deleted slice if it's non-nil, nil otherwise.\nfunc (r *RepositoryRulesetChangedConditions) GetDeleted() []*RepositoryRulesetConditions {\n\tif r == nil || r.Deleted == nil {\n\t\treturn nil\n\t}\n\treturn r.Deleted\n}\n\n// GetUpdated returns the Updated slice if it's non-nil, nil otherwise.\nfunc (r *RepositoryRulesetChangedConditions) GetUpdated() []*RepositoryRulesetUpdatedConditions {\n\tif r == nil || r.Updated == nil {\n\t\treturn nil\n\t}\n\treturn r.Updated\n}\n\n// GetConfiguration returns the Configuration field.\nfunc (r *RepositoryRulesetChangedRule) GetConfiguration() *RepositoryRulesetChangeSource {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Configuration\n}\n\n// GetPattern returns the Pattern field.\nfunc (r *RepositoryRulesetChangedRule) GetPattern() *RepositoryRulesetChangeSource {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Pattern\n}\n\n// GetRuleType returns the RuleType field.\nfunc (r *RepositoryRulesetChangedRule) GetRuleType() *RepositoryRulesetChangeSource {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.RuleType\n}\n\n// GetAdded returns the Added slice if it's non-nil, nil otherwise.\nfunc (r *RepositoryRulesetChangedRules) GetAdded() []*RepositoryRule {\n\tif r == nil || r.Added == nil {\n\t\treturn nil\n\t}\n\treturn r.Added\n}\n\n// GetDeleted returns the Deleted slice if it's non-nil, nil otherwise.\nfunc (r *RepositoryRulesetChangedRules) GetDeleted() []*RepositoryRule {\n\tif r == nil || r.Deleted == nil {\n\t\treturn nil\n\t}\n\treturn r.Deleted\n}\n\n// GetUpdated returns the Updated slice if it's non-nil, nil otherwise.\nfunc (r *RepositoryRulesetChangedRules) GetUpdated() []*RepositoryRulesetUpdatedRules {\n\tif r == nil || r.Updated == nil {\n\t\treturn nil\n\t}\n\treturn r.Updated\n}\n\n// GetConditions returns the Conditions field.\nfunc (r *RepositoryRulesetChanges) GetConditions() *RepositoryRulesetChangedConditions {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Conditions\n}\n\n// GetEnforcement returns the Enforcement field.\nfunc (r *RepositoryRulesetChanges) GetEnforcement() *RepositoryRulesetChangeSource {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Enforcement\n}\n\n// GetName returns the Name field.\nfunc (r *RepositoryRulesetChanges) GetName() *RepositoryRulesetChangeSource {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Name\n}\n\n// GetRules returns the Rules field.\nfunc (r *RepositoryRulesetChanges) GetRules() *RepositoryRulesetChangedRules {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Rules\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryRulesetChangeSource) GetFrom() string {\n\tif r == nil || r.From == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.From\n}\n\n// GetFrom returns the From slice if it's non-nil, nil otherwise.\nfunc (r *RepositoryRulesetChangeSources) GetFrom() []string {\n\tif r == nil || r.From == nil {\n\t\treturn nil\n\t}\n\treturn r.From\n}\n\n// GetOrganizationID returns the OrganizationID field.\nfunc (r *RepositoryRulesetConditions) GetOrganizationID() *RepositoryRulesetOrganizationIDsConditionParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.OrganizationID\n}\n\n// GetOrganizationName returns the OrganizationName field.\nfunc (r *RepositoryRulesetConditions) GetOrganizationName() *RepositoryRulesetOrganizationNamesConditionParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.OrganizationName\n}\n\n// GetOrganizationProperty returns the OrganizationProperty field.\nfunc (r *RepositoryRulesetConditions) GetOrganizationProperty() *RepositoryRulesetOrganizationPropertyConditionParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.OrganizationProperty\n}\n\n// GetRefName returns the RefName field.\nfunc (r *RepositoryRulesetConditions) GetRefName() *RepositoryRulesetRefConditionParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.RefName\n}\n\n// GetRepositoryID returns the RepositoryID field.\nfunc (r *RepositoryRulesetConditions) GetRepositoryID() *RepositoryRulesetRepositoryIDsConditionParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.RepositoryID\n}\n\n// GetRepositoryName returns the RepositoryName field.\nfunc (r *RepositoryRulesetConditions) GetRepositoryName() *RepositoryRulesetRepositoryNamesConditionParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.RepositoryName\n}\n\n// GetRepositoryProperty returns the RepositoryProperty field.\nfunc (r *RepositoryRulesetConditions) GetRepositoryProperty() *RepositoryRulesetRepositoryPropertyConditionParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.RepositoryProperty\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryRulesetEvent) GetAction() string {\n\tif r == nil || r.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Action\n}\n\n// GetChanges returns the Changes field.\nfunc (r *RepositoryRulesetEvent) GetChanges() *RepositoryRulesetChanges {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Changes\n}\n\n// GetEnterprise returns the Enterprise field.\nfunc (r *RepositoryRulesetEvent) GetEnterprise() *Enterprise {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Enterprise\n}\n\n// GetInstallation returns the Installation field.\nfunc (r *RepositoryRulesetEvent) GetInstallation() *Installation {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Installation\n}\n\n// GetOrganization returns the Organization field.\nfunc (r *RepositoryRulesetEvent) GetOrganization() *Organization {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Organization\n}\n\n// GetRepository returns the Repository field.\nfunc (r *RepositoryRulesetEvent) GetRepository() *Repository {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Repository\n}\n\n// GetRepositoryRuleset returns the RepositoryRuleset field.\nfunc (r *RepositoryRulesetEvent) GetRepositoryRuleset() *RepositoryRuleset {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.RepositoryRuleset\n}\n\n// GetSender returns the Sender field.\nfunc (r *RepositoryRulesetEvent) GetSender() *User {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Sender\n}\n\n// GetHRef returns the HRef field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryRulesetLink) GetHRef() string {\n\tif r == nil || r.HRef == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.HRef\n}\n\n// GetHTML returns the HTML field.\nfunc (r *RepositoryRulesetLinks) GetHTML() *RepositoryRulesetLink {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.HTML\n}\n\n// GetSelf returns the Self field.\nfunc (r *RepositoryRulesetLinks) GetSelf() *RepositoryRulesetLink {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Self\n}\n\n// GetOrganizationIDs returns the OrganizationIDs slice if it's non-nil, nil otherwise.\nfunc (r *RepositoryRulesetOrganizationIDsConditionParameters) GetOrganizationIDs() []int64 {\n\tif r == nil || r.OrganizationIDs == nil {\n\t\treturn nil\n\t}\n\treturn r.OrganizationIDs\n}\n\n// GetExclude returns the Exclude slice if it's non-nil, nil otherwise.\nfunc (r *RepositoryRulesetOrganizationNamesConditionParameters) GetExclude() []string {\n\tif r == nil || r.Exclude == nil {\n\t\treturn nil\n\t}\n\treturn r.Exclude\n}\n\n// GetInclude returns the Include slice if it's non-nil, nil otherwise.\nfunc (r *RepositoryRulesetOrganizationNamesConditionParameters) GetInclude() []string {\n\tif r == nil || r.Include == nil {\n\t\treturn nil\n\t}\n\treturn r.Include\n}\n\n// GetExclude returns the Exclude slice if it's non-nil, nil otherwise.\nfunc (r *RepositoryRulesetOrganizationPropertyConditionParameters) GetExclude() []*RepositoryRulesetRepositoryPropertyTargetParameters {\n\tif r == nil || r.Exclude == nil {\n\t\treturn nil\n\t}\n\treturn r.Exclude\n}\n\n// GetInclude returns the Include slice if it's non-nil, nil otherwise.\nfunc (r *RepositoryRulesetOrganizationPropertyConditionParameters) GetInclude() []*RepositoryRulesetRepositoryPropertyTargetParameters {\n\tif r == nil || r.Include == nil {\n\t\treturn nil\n\t}\n\treturn r.Include\n}\n\n// GetExclude returns the Exclude slice if it's non-nil, nil otherwise.\nfunc (r *RepositoryRulesetRefConditionParameters) GetExclude() []string {\n\tif r == nil || r.Exclude == nil {\n\t\treturn nil\n\t}\n\treturn r.Exclude\n}\n\n// GetInclude returns the Include slice if it's non-nil, nil otherwise.\nfunc (r *RepositoryRulesetRefConditionParameters) GetInclude() []string {\n\tif r == nil || r.Include == nil {\n\t\treturn nil\n\t}\n\treturn r.Include\n}\n\n// GetRepositoryIDs returns the RepositoryIDs slice if it's non-nil, nil otherwise.\nfunc (r *RepositoryRulesetRepositoryIDsConditionParameters) GetRepositoryIDs() []int64 {\n\tif r == nil || r.RepositoryIDs == nil {\n\t\treturn nil\n\t}\n\treturn r.RepositoryIDs\n}\n\n// GetExclude returns the Exclude slice if it's non-nil, nil otherwise.\nfunc (r *RepositoryRulesetRepositoryNamesConditionParameters) GetExclude() []string {\n\tif r == nil || r.Exclude == nil {\n\t\treturn nil\n\t}\n\treturn r.Exclude\n}\n\n// GetInclude returns the Include slice if it's non-nil, nil otherwise.\nfunc (r *RepositoryRulesetRepositoryNamesConditionParameters) GetInclude() []string {\n\tif r == nil || r.Include == nil {\n\t\treturn nil\n\t}\n\treturn r.Include\n}\n\n// GetProtected returns the Protected field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryRulesetRepositoryNamesConditionParameters) GetProtected() bool {\n\tif r == nil || r.Protected == nil {\n\t\treturn false\n\t}\n\treturn *r.Protected\n}\n\n// GetExclude returns the Exclude slice if it's non-nil, nil otherwise.\nfunc (r *RepositoryRulesetRepositoryPropertyConditionParameters) GetExclude() []*RepositoryRulesetRepositoryPropertyTargetParameters {\n\tif r == nil || r.Exclude == nil {\n\t\treturn nil\n\t}\n\treturn r.Exclude\n}\n\n// GetInclude returns the Include slice if it's non-nil, nil otherwise.\nfunc (r *RepositoryRulesetRepositoryPropertyConditionParameters) GetInclude() []*RepositoryRulesetRepositoryPropertyTargetParameters {\n\tif r == nil || r.Include == nil {\n\t\treturn nil\n\t}\n\treturn r.Include\n}\n\n// GetName returns the Name field.\nfunc (r *RepositoryRulesetRepositoryPropertyTargetParameters) GetName() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Name\n}\n\n// GetPropertyValues returns the PropertyValues slice if it's non-nil, nil otherwise.\nfunc (r *RepositoryRulesetRepositoryPropertyTargetParameters) GetPropertyValues() []string {\n\tif r == nil || r.PropertyValues == nil {\n\t\treturn nil\n\t}\n\treturn r.PropertyValues\n}\n\n// GetSource returns the Source field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryRulesetRepositoryPropertyTargetParameters) GetSource() string {\n\tif r == nil || r.Source == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Source\n}\n\n// GetBranchNamePattern returns the BranchNamePattern field.\nfunc (r *RepositoryRulesetRules) GetBranchNamePattern() *PatternRuleParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.BranchNamePattern\n}\n\n// GetCodeScanning returns the CodeScanning field.\nfunc (r *RepositoryRulesetRules) GetCodeScanning() *CodeScanningRuleParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.CodeScanning\n}\n\n// GetCommitAuthorEmailPattern returns the CommitAuthorEmailPattern field.\nfunc (r *RepositoryRulesetRules) GetCommitAuthorEmailPattern() *PatternRuleParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.CommitAuthorEmailPattern\n}\n\n// GetCommitMessagePattern returns the CommitMessagePattern field.\nfunc (r *RepositoryRulesetRules) GetCommitMessagePattern() *PatternRuleParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.CommitMessagePattern\n}\n\n// GetCommitterEmailPattern returns the CommitterEmailPattern field.\nfunc (r *RepositoryRulesetRules) GetCommitterEmailPattern() *PatternRuleParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.CommitterEmailPattern\n}\n\n// GetCopilotCodeReview returns the CopilotCodeReview field.\nfunc (r *RepositoryRulesetRules) GetCopilotCodeReview() *CopilotCodeReviewRuleParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.CopilotCodeReview\n}\n\n// GetCreation returns the Creation field.\nfunc (r *RepositoryRulesetRules) GetCreation() *EmptyRuleParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Creation\n}\n\n// GetDeletion returns the Deletion field.\nfunc (r *RepositoryRulesetRules) GetDeletion() *EmptyRuleParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Deletion\n}\n\n// GetFileExtensionRestriction returns the FileExtensionRestriction field.\nfunc (r *RepositoryRulesetRules) GetFileExtensionRestriction() *FileExtensionRestrictionRuleParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.FileExtensionRestriction\n}\n\n// GetFilePathRestriction returns the FilePathRestriction field.\nfunc (r *RepositoryRulesetRules) GetFilePathRestriction() *FilePathRestrictionRuleParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.FilePathRestriction\n}\n\n// GetMaxFilePathLength returns the MaxFilePathLength field.\nfunc (r *RepositoryRulesetRules) GetMaxFilePathLength() *MaxFilePathLengthRuleParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.MaxFilePathLength\n}\n\n// GetMaxFileSize returns the MaxFileSize field.\nfunc (r *RepositoryRulesetRules) GetMaxFileSize() *MaxFileSizeRuleParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.MaxFileSize\n}\n\n// GetMergeQueue returns the MergeQueue field.\nfunc (r *RepositoryRulesetRules) GetMergeQueue() *MergeQueueRuleParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.MergeQueue\n}\n\n// GetNonFastForward returns the NonFastForward field.\nfunc (r *RepositoryRulesetRules) GetNonFastForward() *EmptyRuleParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.NonFastForward\n}\n\n// GetPullRequest returns the PullRequest field.\nfunc (r *RepositoryRulesetRules) GetPullRequest() *PullRequestRuleParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.PullRequest\n}\n\n// GetRepositoryCreate returns the RepositoryCreate field.\nfunc (r *RepositoryRulesetRules) GetRepositoryCreate() *EmptyRuleParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.RepositoryCreate\n}\n\n// GetRepositoryDelete returns the RepositoryDelete field.\nfunc (r *RepositoryRulesetRules) GetRepositoryDelete() *EmptyRuleParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.RepositoryDelete\n}\n\n// GetRepositoryName returns the RepositoryName field.\nfunc (r *RepositoryRulesetRules) GetRepositoryName() *SimplePatternRuleParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.RepositoryName\n}\n\n// GetRepositoryTransfer returns the RepositoryTransfer field.\nfunc (r *RepositoryRulesetRules) GetRepositoryTransfer() *EmptyRuleParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.RepositoryTransfer\n}\n\n// GetRepositoryVisibility returns the RepositoryVisibility field.\nfunc (r *RepositoryRulesetRules) GetRepositoryVisibility() *RepositoryVisibilityRuleParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.RepositoryVisibility\n}\n\n// GetRequiredDeployments returns the RequiredDeployments field.\nfunc (r *RepositoryRulesetRules) GetRequiredDeployments() *RequiredDeploymentsRuleParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.RequiredDeployments\n}\n\n// GetRequiredLinearHistory returns the RequiredLinearHistory field.\nfunc (r *RepositoryRulesetRules) GetRequiredLinearHistory() *EmptyRuleParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.RequiredLinearHistory\n}\n\n// GetRequiredSignatures returns the RequiredSignatures field.\nfunc (r *RepositoryRulesetRules) GetRequiredSignatures() *EmptyRuleParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.RequiredSignatures\n}\n\n// GetRequiredStatusChecks returns the RequiredStatusChecks field.\nfunc (r *RepositoryRulesetRules) GetRequiredStatusChecks() *RequiredStatusChecksRuleParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.RequiredStatusChecks\n}\n\n// GetTagNamePattern returns the TagNamePattern field.\nfunc (r *RepositoryRulesetRules) GetTagNamePattern() *PatternRuleParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.TagNamePattern\n}\n\n// GetUpdate returns the Update field.\nfunc (r *RepositoryRulesetRules) GetUpdate() *UpdateRuleParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Update\n}\n\n// GetWorkflows returns the Workflows field.\nfunc (r *RepositoryRulesetRules) GetWorkflows() *WorkflowsRuleParameters {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Workflows\n}\n\n// GetConditionType returns the ConditionType field.\nfunc (r *RepositoryRulesetUpdatedCondition) GetConditionType() *RepositoryRulesetChangeSource {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.ConditionType\n}\n\n// GetExclude returns the Exclude field.\nfunc (r *RepositoryRulesetUpdatedCondition) GetExclude() *RepositoryRulesetChangeSources {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Exclude\n}\n\n// GetInclude returns the Include field.\nfunc (r *RepositoryRulesetUpdatedCondition) GetInclude() *RepositoryRulesetChangeSources {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Include\n}\n\n// GetTarget returns the Target field.\nfunc (r *RepositoryRulesetUpdatedCondition) GetTarget() *RepositoryRulesetChangeSource {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Target\n}\n\n// GetChanges returns the Changes field.\nfunc (r *RepositoryRulesetUpdatedConditions) GetChanges() *RepositoryRulesetUpdatedCondition {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Changes\n}\n\n// GetCondition returns the Condition field.\nfunc (r *RepositoryRulesetUpdatedConditions) GetCondition() *RepositoryRulesetConditions {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Condition\n}\n\n// GetChanges returns the Changes field.\nfunc (r *RepositoryRulesetUpdatedRules) GetChanges() *RepositoryRulesetChangedRule {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Changes\n}\n\n// GetRule returns the Rule field.\nfunc (r *RepositoryRulesetUpdatedRules) GetRule() *RepositoryRule {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Rule\n}\n\n// GetCommit returns the Commit field.\nfunc (r *RepositoryTag) GetCommit() *Commit {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Commit\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryTag) GetName() string {\n\tif r == nil || r.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Name\n}\n\n// GetTarballURL returns the TarballURL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryTag) GetTarballURL() string {\n\tif r == nil || r.TarballURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.TarballURL\n}\n\n// GetZipballURL returns the ZipballURL field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryTag) GetZipballURL() string {\n\tif r == nil || r.ZipballURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.ZipballURL\n}\n\n// GetInternal returns the Internal field.\nfunc (r *RepositoryVisibilityRuleParameters) GetInternal() bool {\n\tif r == nil {\n\t\treturn false\n\t}\n\treturn r.Internal\n}\n\n// GetPrivate returns the Private field.\nfunc (r *RepositoryVisibilityRuleParameters) GetPrivate() bool {\n\tif r == nil {\n\t\treturn false\n\t}\n\treturn r.Private\n}\n\n// GetAffectedPackageName returns the AffectedPackageName field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryVulnerabilityAlert) GetAffectedPackageName() string {\n\tif r == nil || r.AffectedPackageName == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.AffectedPackageName\n}\n\n// GetAffectedRange returns the AffectedRange field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryVulnerabilityAlert) GetAffectedRange() string {\n\tif r == nil || r.AffectedRange == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.AffectedRange\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryVulnerabilityAlert) GetCreatedAt() Timestamp {\n\tif r == nil || r.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *r.CreatedAt\n}\n\n// GetDismissedAt returns the DismissedAt field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryVulnerabilityAlert) GetDismissedAt() Timestamp {\n\tif r == nil || r.DismissedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *r.DismissedAt\n}\n\n// GetDismisser returns the Dismisser field.\nfunc (r *RepositoryVulnerabilityAlert) GetDismisser() *User {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Dismisser\n}\n\n// GetDismissReason returns the DismissReason field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryVulnerabilityAlert) GetDismissReason() string {\n\tif r == nil || r.DismissReason == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.DismissReason\n}\n\n// GetExternalIdentifier returns the ExternalIdentifier field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryVulnerabilityAlert) GetExternalIdentifier() string {\n\tif r == nil || r.ExternalIdentifier == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.ExternalIdentifier\n}\n\n// GetExternalReference returns the ExternalReference field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryVulnerabilityAlert) GetExternalReference() string {\n\tif r == nil || r.ExternalReference == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.ExternalReference\n}\n\n// GetFixedIn returns the FixedIn field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryVulnerabilityAlert) GetFixedIn() string {\n\tif r == nil || r.FixedIn == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.FixedIn\n}\n\n// GetGitHubSecurityAdvisoryID returns the GitHubSecurityAdvisoryID field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryVulnerabilityAlert) GetGitHubSecurityAdvisoryID() string {\n\tif r == nil || r.GitHubSecurityAdvisoryID == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.GitHubSecurityAdvisoryID\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryVulnerabilityAlert) GetID() int64 {\n\tif r == nil || r.ID == nil {\n\t\treturn 0\n\t}\n\treturn *r.ID\n}\n\n// GetSeverity returns the Severity field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryVulnerabilityAlert) GetSeverity() string {\n\tif r == nil || r.Severity == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Severity\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (r *RepositoryVulnerabilityAlertEvent) GetAction() string {\n\tif r == nil || r.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Action\n}\n\n// GetAlert returns the Alert field.\nfunc (r *RepositoryVulnerabilityAlertEvent) GetAlert() *RepositoryVulnerabilityAlert {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Alert\n}\n\n// GetInstallation returns the Installation field.\nfunc (r *RepositoryVulnerabilityAlertEvent) GetInstallation() *Installation {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (r *RepositoryVulnerabilityAlertEvent) GetOrg() *Organization {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Org\n}\n\n// GetRepository returns the Repository field.\nfunc (r *RepositoryVulnerabilityAlertEvent) GetRepository() *Repository {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Repository\n}\n\n// GetSender returns the Sender field.\nfunc (r *RepositoryVulnerabilityAlertEvent) GetSender() *User {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Sender\n}\n\n// GetForkRepos returns the ForkRepos field if it's non-nil, zero value otherwise.\nfunc (r *RepoStats) GetForkRepos() int {\n\tif r == nil || r.ForkRepos == nil {\n\t\treturn 0\n\t}\n\treturn *r.ForkRepos\n}\n\n// GetOrgRepos returns the OrgRepos field if it's non-nil, zero value otherwise.\nfunc (r *RepoStats) GetOrgRepos() int {\n\tif r == nil || r.OrgRepos == nil {\n\t\treturn 0\n\t}\n\treturn *r.OrgRepos\n}\n\n// GetRootRepos returns the RootRepos field if it's non-nil, zero value otherwise.\nfunc (r *RepoStats) GetRootRepos() int {\n\tif r == nil || r.RootRepos == nil {\n\t\treturn 0\n\t}\n\treturn *r.RootRepos\n}\n\n// GetTotalPushes returns the TotalPushes field if it's non-nil, zero value otherwise.\nfunc (r *RepoStats) GetTotalPushes() int {\n\tif r == nil || r.TotalPushes == nil {\n\t\treturn 0\n\t}\n\treturn *r.TotalPushes\n}\n\n// GetTotalRepos returns the TotalRepos field if it's non-nil, zero value otherwise.\nfunc (r *RepoStats) GetTotalRepos() int {\n\tif r == nil || r.TotalRepos == nil {\n\t\treturn 0\n\t}\n\treturn *r.TotalRepos\n}\n\n// GetTotalWikis returns the TotalWikis field if it's non-nil, zero value otherwise.\nfunc (r *RepoStats) GetTotalWikis() int {\n\tif r == nil || r.TotalWikis == nil {\n\t\treturn 0\n\t}\n\treturn *r.TotalWikis\n}\n\n// GetAvatarURL returns the AvatarURL field if it's non-nil, zero value otherwise.\nfunc (r *RepoStatus) GetAvatarURL() string {\n\tif r == nil || r.AvatarURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.AvatarURL\n}\n\n// GetContext returns the Context field if it's non-nil, zero value otherwise.\nfunc (r *RepoStatus) GetContext() string {\n\tif r == nil || r.Context == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Context\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (r *RepoStatus) GetCreatedAt() Timestamp {\n\tif r == nil || r.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *r.CreatedAt\n}\n\n// GetCreator returns the Creator field.\nfunc (r *RepoStatus) GetCreator() *User {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Creator\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (r *RepoStatus) GetDescription() string {\n\tif r == nil || r.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Description\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (r *RepoStatus) GetID() int64 {\n\tif r == nil || r.ID == nil {\n\t\treturn 0\n\t}\n\treturn *r.ID\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (r *RepoStatus) GetNodeID() string {\n\tif r == nil || r.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.NodeID\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (r *RepoStatus) GetState() string {\n\tif r == nil || r.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.State\n}\n\n// GetTargetURL returns the TargetURL field if it's non-nil, zero value otherwise.\nfunc (r *RepoStatus) GetTargetURL() string {\n\tif r == nil || r.TargetURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.TargetURL\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (r *RepoStatus) GetUpdatedAt() Timestamp {\n\tif r == nil || r.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *r.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (r *RepoStatus) GetURL() string {\n\tif r == nil || r.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.URL\n}\n\n// GetIdentifier returns the Identifier field.\nfunc (r *RequestedAction) GetIdentifier() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Identifier\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (r *RequireCodeOwnerReviewChanges) GetFrom() bool {\n\tif r == nil || r.From == nil {\n\t\treturn false\n\t}\n\treturn *r.From\n}\n\n// GetEnabled returns the Enabled field.\nfunc (r *RequiredConversationResolution) GetEnabled() bool {\n\tif r == nil {\n\t\treturn false\n\t}\n\treturn r.Enabled\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (r *RequiredConversationResolutionLevelChanges) GetFrom() string {\n\tif r == nil || r.From == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.From\n}\n\n// GetParameters returns the Parameters field.\nfunc (r *RequiredDeploymentsBranchRule) GetParameters() RequiredDeploymentsRuleParameters {\n\tif r == nil {\n\t\treturn RequiredDeploymentsRuleParameters{}\n\t}\n\treturn r.Parameters\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (r *RequiredDeploymentsEnforcementLevelChanges) GetFrom() string {\n\tif r == nil || r.From == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.From\n}\n\n// GetRequiredDeploymentEnvironments returns the RequiredDeploymentEnvironments slice if it's non-nil, nil otherwise.\nfunc (r *RequiredDeploymentsRuleParameters) GetRequiredDeploymentEnvironments() []string {\n\tif r == nil || r.RequiredDeploymentEnvironments == nil {\n\t\treturn nil\n\t}\n\treturn r.RequiredDeploymentEnvironments\n}\n\n// GetReviewer returns the Reviewer field.\nfunc (r *RequiredReviewer) GetReviewer() any {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Reviewer\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (r *RequiredReviewer) GetType() string {\n\tif r == nil || r.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Type\n}\n\n// GetAppID returns the AppID field if it's non-nil, zero value otherwise.\nfunc (r *RequiredStatusCheck) GetAppID() int64 {\n\tif r == nil || r.AppID == nil {\n\t\treturn 0\n\t}\n\treturn *r.AppID\n}\n\n// GetContext returns the Context field.\nfunc (r *RequiredStatusCheck) GetContext() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Context\n}\n\n// GetChecks returns the Checks field if it's non-nil, zero value otherwise.\nfunc (r *RequiredStatusChecks) GetChecks() []*RequiredStatusCheck {\n\tif r == nil || r.Checks == nil {\n\t\treturn nil\n\t}\n\treturn *r.Checks\n}\n\n// GetContexts returns the Contexts field if it's non-nil, zero value otherwise.\nfunc (r *RequiredStatusChecks) GetContexts() []string {\n\tif r == nil || r.Contexts == nil {\n\t\treturn nil\n\t}\n\treturn *r.Contexts\n}\n\n// GetContextsURL returns the ContextsURL field if it's non-nil, zero value otherwise.\nfunc (r *RequiredStatusChecks) GetContextsURL() string {\n\tif r == nil || r.ContextsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.ContextsURL\n}\n\n// GetStrict returns the Strict field.\nfunc (r *RequiredStatusChecks) GetStrict() bool {\n\tif r == nil {\n\t\treturn false\n\t}\n\treturn r.Strict\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (r *RequiredStatusChecks) GetURL() string {\n\tif r == nil || r.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.URL\n}\n\n// GetParameters returns the Parameters field.\nfunc (r *RequiredStatusChecksBranchRule) GetParameters() RequiredStatusChecksRuleParameters {\n\tif r == nil {\n\t\treturn RequiredStatusChecksRuleParameters{}\n\t}\n\treturn r.Parameters\n}\n\n// GetFrom returns the From slice if it's non-nil, nil otherwise.\nfunc (r *RequiredStatusChecksChanges) GetFrom() []string {\n\tif r == nil || r.From == nil {\n\t\treturn nil\n\t}\n\treturn r.From\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (r *RequiredStatusChecksEnforcementLevelChanges) GetFrom() string {\n\tif r == nil || r.From == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.From\n}\n\n// GetChecks returns the Checks slice if it's non-nil, nil otherwise.\nfunc (r *RequiredStatusChecksRequest) GetChecks() []*RequiredStatusCheck {\n\tif r == nil || r.Checks == nil {\n\t\treturn nil\n\t}\n\treturn r.Checks\n}\n\n// GetContexts returns the Contexts slice if it's non-nil, nil otherwise.\nfunc (r *RequiredStatusChecksRequest) GetContexts() []string {\n\tif r == nil || r.Contexts == nil {\n\t\treturn nil\n\t}\n\treturn r.Contexts\n}\n\n// GetStrict returns the Strict field if it's non-nil, zero value otherwise.\nfunc (r *RequiredStatusChecksRequest) GetStrict() bool {\n\tif r == nil || r.Strict == nil {\n\t\treturn false\n\t}\n\treturn *r.Strict\n}\n\n// GetDoNotEnforceOnCreate returns the DoNotEnforceOnCreate field if it's non-nil, zero value otherwise.\nfunc (r *RequiredStatusChecksRuleParameters) GetDoNotEnforceOnCreate() bool {\n\tif r == nil || r.DoNotEnforceOnCreate == nil {\n\t\treturn false\n\t}\n\treturn *r.DoNotEnforceOnCreate\n}\n\n// GetRequiredStatusChecks returns the RequiredStatusChecks slice if it's non-nil, nil otherwise.\nfunc (r *RequiredStatusChecksRuleParameters) GetRequiredStatusChecks() []*RuleStatusCheck {\n\tif r == nil || r.RequiredStatusChecks == nil {\n\t\treturn nil\n\t}\n\treturn r.RequiredStatusChecks\n}\n\n// GetStrictRequiredStatusChecksPolicy returns the StrictRequiredStatusChecksPolicy field.\nfunc (r *RequiredStatusChecksRuleParameters) GetStrictRequiredStatusChecksPolicy() bool {\n\tif r == nil {\n\t\treturn false\n\t}\n\treturn r.StrictRequiredStatusChecksPolicy\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (r *RequireLastPushApprovalChanges) GetFrom() bool {\n\tif r == nil || r.From == nil {\n\t\treturn false\n\t}\n\treturn *r.From\n}\n\n// GetEnabled returns the Enabled field.\nfunc (r *RequireLinearHistory) GetEnabled() bool {\n\tif r == nil {\n\t\treturn false\n\t}\n\treturn r.Enabled\n}\n\n// GetAfter returns the After field.\nfunc (r *Response) GetAfter() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.After\n}\n\n// GetBefore returns the Before field.\nfunc (r *Response) GetBefore() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Before\n}\n\n// GetCursor returns the Cursor field.\nfunc (r *Response) GetCursor() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Cursor\n}\n\n// GetFirstPage returns the FirstPage field.\nfunc (r *Response) GetFirstPage() int {\n\tif r == nil {\n\t\treturn 0\n\t}\n\treturn r.FirstPage\n}\n\n// GetLastPage returns the LastPage field.\nfunc (r *Response) GetLastPage() int {\n\tif r == nil {\n\t\treturn 0\n\t}\n\treturn r.LastPage\n}\n\n// GetNextPage returns the NextPage field.\nfunc (r *Response) GetNextPage() int {\n\tif r == nil {\n\t\treturn 0\n\t}\n\treturn r.NextPage\n}\n\n// GetNextPageToken returns the NextPageToken field.\nfunc (r *Response) GetNextPageToken() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.NextPageToken\n}\n\n// GetPrevPage returns the PrevPage field.\nfunc (r *Response) GetPrevPage() int {\n\tif r == nil {\n\t\treturn 0\n\t}\n\treturn r.PrevPage\n}\n\n// GetRate returns the Rate field.\nfunc (r *Response) GetRate() Rate {\n\tif r == nil {\n\t\treturn Rate{}\n\t}\n\treturn r.Rate\n}\n\n// GetTokenExpiration returns the TokenExpiration field.\nfunc (r *Response) GetTokenExpiration() Timestamp {\n\tif r == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn r.TokenExpiration\n}\n\n// GetComment returns the Comment field.\nfunc (r *ReviewCustomDeploymentProtectionRuleRequest) GetComment() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Comment\n}\n\n// GetEnvironmentName returns the EnvironmentName field.\nfunc (r *ReviewCustomDeploymentProtectionRuleRequest) GetEnvironmentName() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.EnvironmentName\n}\n\n// GetState returns the State field.\nfunc (r *ReviewCustomDeploymentProtectionRuleRequest) GetState() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.State\n}\n\n// GetTeams returns the Teams slice if it's non-nil, nil otherwise.\nfunc (r *Reviewers) GetTeams() []*Team {\n\tif r == nil || r.Teams == nil {\n\t\treturn nil\n\t}\n\treturn r.Teams\n}\n\n// GetUsers returns the Users slice if it's non-nil, nil otherwise.\nfunc (r *Reviewers) GetUsers() []*User {\n\tif r == nil || r.Users == nil {\n\t\treturn nil\n\t}\n\treturn r.Users\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (r *ReviewersRequest) GetNodeID() string {\n\tif r == nil || r.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.NodeID\n}\n\n// GetReviewers returns the Reviewers slice if it's non-nil, nil otherwise.\nfunc (r *ReviewersRequest) GetReviewers() []string {\n\tif r == nil || r.Reviewers == nil {\n\t\treturn nil\n\t}\n\treturn r.Reviewers\n}\n\n// GetTeamReviewers returns the TeamReviewers slice if it's non-nil, nil otherwise.\nfunc (r *ReviewersRequest) GetTeamReviewers() []string {\n\tif r == nil || r.TeamReviewers == nil {\n\t\treturn nil\n\t}\n\treturn r.TeamReviewers\n}\n\n// GetAction returns the Action field.\nfunc (r *ReviewPersonalAccessTokenRequestOptions) GetAction() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Action\n}\n\n// GetReason returns the Reason field if it's non-nil, zero value otherwise.\nfunc (r *ReviewPersonalAccessTokenRequestOptions) GetReason() string {\n\tif r == nil || r.Reason == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Reason\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (r *Rule) GetDescription() string {\n\tif r == nil || r.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Description\n}\n\n// GetFullDescription returns the FullDescription field if it's non-nil, zero value otherwise.\nfunc (r *Rule) GetFullDescription() string {\n\tif r == nil || r.FullDescription == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.FullDescription\n}\n\n// GetHelp returns the Help field if it's non-nil, zero value otherwise.\nfunc (r *Rule) GetHelp() string {\n\tif r == nil || r.Help == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Help\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (r *Rule) GetID() string {\n\tif r == nil || r.ID == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.ID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (r *Rule) GetName() string {\n\tif r == nil || r.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Name\n}\n\n// GetSecuritySeverityLevel returns the SecuritySeverityLevel field if it's non-nil, zero value otherwise.\nfunc (r *Rule) GetSecuritySeverityLevel() string {\n\tif r == nil || r.SecuritySeverityLevel == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.SecuritySeverityLevel\n}\n\n// GetSeverity returns the Severity field if it's non-nil, zero value otherwise.\nfunc (r *Rule) GetSeverity() string {\n\tif r == nil || r.Severity == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Severity\n}\n\n// GetTags returns the Tags slice if it's non-nil, nil otherwise.\nfunc (r *Rule) GetTags() []string {\n\tif r == nil || r.Tags == nil {\n\t\treturn nil\n\t}\n\treturn r.Tags\n}\n\n// GetAlertsThreshold returns the AlertsThreshold field.\nfunc (r *RuleCodeScanningTool) GetAlertsThreshold() CodeScanningAlertsThreshold {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.AlertsThreshold\n}\n\n// GetSecurityAlertsThreshold returns the SecurityAlertsThreshold field.\nfunc (r *RuleCodeScanningTool) GetSecurityAlertsThreshold() CodeScanningSecurityAlertsThreshold {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.SecurityAlertsThreshold\n}\n\n// GetTool returns the Tool field.\nfunc (r *RuleCodeScanningTool) GetTool() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Tool\n}\n\n// GetFilePatterns returns the FilePatterns slice if it's non-nil, nil otherwise.\nfunc (r *RulesetRequiredReviewer) GetFilePatterns() []string {\n\tif r == nil || r.FilePatterns == nil {\n\t\treturn nil\n\t}\n\treturn r.FilePatterns\n}\n\n// GetMinimumApprovals returns the MinimumApprovals field if it's non-nil, zero value otherwise.\nfunc (r *RulesetRequiredReviewer) GetMinimumApprovals() int {\n\tif r == nil || r.MinimumApprovals == nil {\n\t\treturn 0\n\t}\n\treturn *r.MinimumApprovals\n}\n\n// GetReviewer returns the Reviewer field.\nfunc (r *RulesetRequiredReviewer) GetReviewer() *RulesetReviewer {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Reviewer\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (r *RulesetReviewer) GetID() int64 {\n\tif r == nil || r.ID == nil {\n\t\treturn 0\n\t}\n\treturn *r.ID\n}\n\n// GetType returns the Type field.\nfunc (r *RulesetReviewer) GetType() *RulesetReviewerType {\n\tif r == nil {\n\t\treturn nil\n\t}\n\treturn r.Type\n}\n\n// GetContext returns the Context field.\nfunc (r *RuleStatusCheck) GetContext() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Context\n}\n\n// GetIntegrationID returns the IntegrationID field if it's non-nil, zero value otherwise.\nfunc (r *RuleStatusCheck) GetIntegrationID() int64 {\n\tif r == nil || r.IntegrationID == nil {\n\t\treturn 0\n\t}\n\treturn *r.IntegrationID\n}\n\n// GetPath returns the Path field.\nfunc (r *RuleWorkflow) GetPath() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.Path\n}\n\n// GetRef returns the Ref field if it's non-nil, zero value otherwise.\nfunc (r *RuleWorkflow) GetRef() string {\n\tif r == nil || r.Ref == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Ref\n}\n\n// GetRepositoryID returns the RepositoryID field if it's non-nil, zero value otherwise.\nfunc (r *RuleWorkflow) GetRepositoryID() int64 {\n\tif r == nil || r.RepositoryID == nil {\n\t\treturn 0\n\t}\n\treturn *r.RepositoryID\n}\n\n// GetSHA returns the SHA field if it's non-nil, zero value otherwise.\nfunc (r *RuleWorkflow) GetSHA() string {\n\tif r == nil || r.SHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.SHA\n}\n\n// GetBusy returns the Busy field if it's non-nil, zero value otherwise.\nfunc (r *Runner) GetBusy() bool {\n\tif r == nil || r.Busy == nil {\n\t\treturn false\n\t}\n\treturn *r.Busy\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (r *Runner) GetID() int64 {\n\tif r == nil || r.ID == nil {\n\t\treturn 0\n\t}\n\treturn *r.ID\n}\n\n// GetLabels returns the Labels slice if it's non-nil, nil otherwise.\nfunc (r *Runner) GetLabels() []*RunnerLabels {\n\tif r == nil || r.Labels == nil {\n\t\treturn nil\n\t}\n\treturn r.Labels\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (r *Runner) GetName() string {\n\tif r == nil || r.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Name\n}\n\n// GetOS returns the OS field if it's non-nil, zero value otherwise.\nfunc (r *Runner) GetOS() string {\n\tif r == nil || r.OS == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.OS\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (r *Runner) GetStatus() string {\n\tif r == nil || r.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Status\n}\n\n// GetArchitecture returns the Architecture field if it's non-nil, zero value otherwise.\nfunc (r *RunnerApplicationDownload) GetArchitecture() string {\n\tif r == nil || r.Architecture == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Architecture\n}\n\n// GetDownloadURL returns the DownloadURL field if it's non-nil, zero value otherwise.\nfunc (r *RunnerApplicationDownload) GetDownloadURL() string {\n\tif r == nil || r.DownloadURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.DownloadURL\n}\n\n// GetFilename returns the Filename field if it's non-nil, zero value otherwise.\nfunc (r *RunnerApplicationDownload) GetFilename() string {\n\tif r == nil || r.Filename == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Filename\n}\n\n// GetOS returns the OS field if it's non-nil, zero value otherwise.\nfunc (r *RunnerApplicationDownload) GetOS() string {\n\tif r == nil || r.OS == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.OS\n}\n\n// GetSHA256Checksum returns the SHA256Checksum field if it's non-nil, zero value otherwise.\nfunc (r *RunnerApplicationDownload) GetSHA256Checksum() string {\n\tif r == nil || r.SHA256Checksum == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.SHA256Checksum\n}\n\n// GetTempDownloadToken returns the TempDownloadToken field if it's non-nil, zero value otherwise.\nfunc (r *RunnerApplicationDownload) GetTempDownloadToken() string {\n\tif r == nil || r.TempDownloadToken == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.TempDownloadToken\n}\n\n// GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise.\nfunc (r *RunnerGroup) GetAllowsPublicRepositories() bool {\n\tif r == nil || r.AllowsPublicRepositories == nil {\n\t\treturn false\n\t}\n\treturn *r.AllowsPublicRepositories\n}\n\n// GetDefault returns the Default field if it's non-nil, zero value otherwise.\nfunc (r *RunnerGroup) GetDefault() bool {\n\tif r == nil || r.Default == nil {\n\t\treturn false\n\t}\n\treturn *r.Default\n}\n\n// GetHostedRunnersURL returns the HostedRunnersURL field if it's non-nil, zero value otherwise.\nfunc (r *RunnerGroup) GetHostedRunnersURL() string {\n\tif r == nil || r.HostedRunnersURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.HostedRunnersURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (r *RunnerGroup) GetID() int64 {\n\tif r == nil || r.ID == nil {\n\t\treturn 0\n\t}\n\treturn *r.ID\n}\n\n// GetInherited returns the Inherited field if it's non-nil, zero value otherwise.\nfunc (r *RunnerGroup) GetInherited() bool {\n\tif r == nil || r.Inherited == nil {\n\t\treturn false\n\t}\n\treturn *r.Inherited\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (r *RunnerGroup) GetName() string {\n\tif r == nil || r.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Name\n}\n\n// GetNetworkConfigurationID returns the NetworkConfigurationID field if it's non-nil, zero value otherwise.\nfunc (r *RunnerGroup) GetNetworkConfigurationID() string {\n\tif r == nil || r.NetworkConfigurationID == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.NetworkConfigurationID\n}\n\n// GetRestrictedToWorkflows returns the RestrictedToWorkflows field if it's non-nil, zero value otherwise.\nfunc (r *RunnerGroup) GetRestrictedToWorkflows() bool {\n\tif r == nil || r.RestrictedToWorkflows == nil {\n\t\treturn false\n\t}\n\treturn *r.RestrictedToWorkflows\n}\n\n// GetRunnersURL returns the RunnersURL field if it's non-nil, zero value otherwise.\nfunc (r *RunnerGroup) GetRunnersURL() string {\n\tif r == nil || r.RunnersURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.RunnersURL\n}\n\n// GetSelectedRepositoriesURL returns the SelectedRepositoriesURL field if it's non-nil, zero value otherwise.\nfunc (r *RunnerGroup) GetSelectedRepositoriesURL() string {\n\tif r == nil || r.SelectedRepositoriesURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.SelectedRepositoriesURL\n}\n\n// GetSelectedWorkflows returns the SelectedWorkflows slice if it's non-nil, nil otherwise.\nfunc (r *RunnerGroup) GetSelectedWorkflows() []string {\n\tif r == nil || r.SelectedWorkflows == nil {\n\t\treturn nil\n\t}\n\treturn r.SelectedWorkflows\n}\n\n// GetVisibility returns the Visibility field if it's non-nil, zero value otherwise.\nfunc (r *RunnerGroup) GetVisibility() string {\n\tif r == nil || r.Visibility == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Visibility\n}\n\n// GetWorkflowRestrictionsReadOnly returns the WorkflowRestrictionsReadOnly field if it's non-nil, zero value otherwise.\nfunc (r *RunnerGroup) GetWorkflowRestrictionsReadOnly() bool {\n\tif r == nil || r.WorkflowRestrictionsReadOnly == nil {\n\t\treturn false\n\t}\n\treturn *r.WorkflowRestrictionsReadOnly\n}\n\n// GetRunnerGroups returns the RunnerGroups slice if it's non-nil, nil otherwise.\nfunc (r *RunnerGroups) GetRunnerGroups() []*RunnerGroup {\n\tif r == nil || r.RunnerGroups == nil {\n\t\treturn nil\n\t}\n\treturn r.RunnerGroups\n}\n\n// GetTotalCount returns the TotalCount field.\nfunc (r *RunnerGroups) GetTotalCount() int {\n\tif r == nil {\n\t\treturn 0\n\t}\n\treturn r.TotalCount\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (r *RunnerLabels) GetID() int64 {\n\tif r == nil || r.ID == nil {\n\t\treturn 0\n\t}\n\treturn *r.ID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (r *RunnerLabels) GetName() string {\n\tif r == nil || r.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Name\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (r *RunnerLabels) GetType() string {\n\tif r == nil || r.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *r.Type\n}\n\n// GetRunners returns the Runners slice if it's non-nil, nil otherwise.\nfunc (r *Runners) GetRunners() []*Runner {\n\tif r == nil || r.Runners == nil {\n\t\treturn nil\n\t}\n\treturn r.Runners\n}\n\n// GetTotalCount returns the TotalCount field.\nfunc (r *Runners) GetTotalCount() int {\n\tif r == nil {\n\t\treturn 0\n\t}\n\treturn r.TotalCount\n}\n\n// GetCheckoutURI returns the CheckoutURI field if it's non-nil, zero value otherwise.\nfunc (s *SarifAnalysis) GetCheckoutURI() string {\n\tif s == nil || s.CheckoutURI == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.CheckoutURI\n}\n\n// GetCommitSHA returns the CommitSHA field if it's non-nil, zero value otherwise.\nfunc (s *SarifAnalysis) GetCommitSHA() string {\n\tif s == nil || s.CommitSHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.CommitSHA\n}\n\n// GetRef returns the Ref field if it's non-nil, zero value otherwise.\nfunc (s *SarifAnalysis) GetRef() string {\n\tif s == nil || s.Ref == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Ref\n}\n\n// GetSarif returns the Sarif field if it's non-nil, zero value otherwise.\nfunc (s *SarifAnalysis) GetSarif() string {\n\tif s == nil || s.Sarif == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Sarif\n}\n\n// GetStartedAt returns the StartedAt field if it's non-nil, zero value otherwise.\nfunc (s *SarifAnalysis) GetStartedAt() Timestamp {\n\tif s == nil || s.StartedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *s.StartedAt\n}\n\n// GetToolName returns the ToolName field if it's non-nil, zero value otherwise.\nfunc (s *SarifAnalysis) GetToolName() string {\n\tif s == nil || s.ToolName == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.ToolName\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (s *SarifID) GetID() string {\n\tif s == nil || s.ID == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.ID\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (s *SarifID) GetURL() string {\n\tif s == nil || s.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.URL\n}\n\n// GetAnalysesURL returns the AnalysesURL field if it's non-nil, zero value otherwise.\nfunc (s *SARIFUpload) GetAnalysesURL() string {\n\tif s == nil || s.AnalysesURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.AnalysesURL\n}\n\n// GetProcessingStatus returns the ProcessingStatus field if it's non-nil, zero value otherwise.\nfunc (s *SARIFUpload) GetProcessingStatus() string {\n\tif s == nil || s.ProcessingStatus == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.ProcessingStatus\n}\n\n// GetSBOM returns the SBOM field.\nfunc (s *SBOM) GetSBOM() *SBOMInfo {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.SBOM\n}\n\n// GetCreationInfo returns the CreationInfo field.\nfunc (s *SBOMInfo) GetCreationInfo() *CreationInfo {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.CreationInfo\n}\n\n// GetDataLicense returns the DataLicense field if it's non-nil, zero value otherwise.\nfunc (s *SBOMInfo) GetDataLicense() string {\n\tif s == nil || s.DataLicense == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.DataLicense\n}\n\n// GetDocumentDescribes returns the DocumentDescribes slice if it's non-nil, nil otherwise.\nfunc (s *SBOMInfo) GetDocumentDescribes() []string {\n\tif s == nil || s.DocumentDescribes == nil {\n\t\treturn nil\n\t}\n\treturn s.DocumentDescribes\n}\n\n// GetDocumentNamespace returns the DocumentNamespace field if it's non-nil, zero value otherwise.\nfunc (s *SBOMInfo) GetDocumentNamespace() string {\n\tif s == nil || s.DocumentNamespace == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.DocumentNamespace\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (s *SBOMInfo) GetName() string {\n\tif s == nil || s.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Name\n}\n\n// GetPackages returns the Packages slice if it's non-nil, nil otherwise.\nfunc (s *SBOMInfo) GetPackages() []*RepoDependencies {\n\tif s == nil || s.Packages == nil {\n\t\treturn nil\n\t}\n\treturn s.Packages\n}\n\n// GetRelationships returns the Relationships slice if it's non-nil, nil otherwise.\nfunc (s *SBOMInfo) GetRelationships() []*SBOMRelationship {\n\tif s == nil || s.Relationships == nil {\n\t\treturn nil\n\t}\n\treturn s.Relationships\n}\n\n// GetSPDXID returns the SPDXID field if it's non-nil, zero value otherwise.\nfunc (s *SBOMInfo) GetSPDXID() string {\n\tif s == nil || s.SPDXID == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.SPDXID\n}\n\n// GetSPDXVersion returns the SPDXVersion field if it's non-nil, zero value otherwise.\nfunc (s *SBOMInfo) GetSPDXVersion() string {\n\tif s == nil || s.SPDXVersion == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.SPDXVersion\n}\n\n// GetRelatedSPDXElement returns the RelatedSPDXElement field.\nfunc (s *SBOMRelationship) GetRelatedSPDXElement() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.RelatedSPDXElement\n}\n\n// GetRelationshipType returns the RelationshipType field.\nfunc (s *SBOMRelationship) GetRelationshipType() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.RelationshipType\n}\n\n// GetSPDXElementID returns the SPDXElementID field.\nfunc (s *SBOMRelationship) GetSPDXElementID() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.SPDXElementID\n}\n\n// GetAnalysisKey returns the AnalysisKey field if it's non-nil, zero value otherwise.\nfunc (s *ScanningAnalysis) GetAnalysisKey() string {\n\tif s == nil || s.AnalysisKey == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.AnalysisKey\n}\n\n// GetCategory returns the Category field if it's non-nil, zero value otherwise.\nfunc (s *ScanningAnalysis) GetCategory() string {\n\tif s == nil || s.Category == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Category\n}\n\n// GetCommitSHA returns the CommitSHA field if it's non-nil, zero value otherwise.\nfunc (s *ScanningAnalysis) GetCommitSHA() string {\n\tif s == nil || s.CommitSHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.CommitSHA\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (s *ScanningAnalysis) GetCreatedAt() Timestamp {\n\tif s == nil || s.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *s.CreatedAt\n}\n\n// GetDeletable returns the Deletable field if it's non-nil, zero value otherwise.\nfunc (s *ScanningAnalysis) GetDeletable() bool {\n\tif s == nil || s.Deletable == nil {\n\t\treturn false\n\t}\n\treturn *s.Deletable\n}\n\n// GetEnvironment returns the Environment field if it's non-nil, zero value otherwise.\nfunc (s *ScanningAnalysis) GetEnvironment() string {\n\tif s == nil || s.Environment == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Environment\n}\n\n// GetError returns the Error field if it's non-nil, zero value otherwise.\nfunc (s *ScanningAnalysis) GetError() string {\n\tif s == nil || s.Error == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Error\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (s *ScanningAnalysis) GetID() int64 {\n\tif s == nil || s.ID == nil {\n\t\treturn 0\n\t}\n\treturn *s.ID\n}\n\n// GetRef returns the Ref field if it's non-nil, zero value otherwise.\nfunc (s *ScanningAnalysis) GetRef() string {\n\tif s == nil || s.Ref == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Ref\n}\n\n// GetResultsCount returns the ResultsCount field if it's non-nil, zero value otherwise.\nfunc (s *ScanningAnalysis) GetResultsCount() int {\n\tif s == nil || s.ResultsCount == nil {\n\t\treturn 0\n\t}\n\treturn *s.ResultsCount\n}\n\n// GetRulesCount returns the RulesCount field if it's non-nil, zero value otherwise.\nfunc (s *ScanningAnalysis) GetRulesCount() int {\n\tif s == nil || s.RulesCount == nil {\n\t\treturn 0\n\t}\n\treturn *s.RulesCount\n}\n\n// GetSarifID returns the SarifID field if it's non-nil, zero value otherwise.\nfunc (s *ScanningAnalysis) GetSarifID() string {\n\tif s == nil || s.SarifID == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.SarifID\n}\n\n// GetTool returns the Tool field.\nfunc (s *ScanningAnalysis) GetTool() *Tool {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Tool\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (s *ScanningAnalysis) GetURL() string {\n\tif s == nil || s.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.URL\n}\n\n// GetWarning returns the Warning field if it's non-nil, zero value otherwise.\nfunc (s *ScanningAnalysis) GetWarning() string {\n\tif s == nil || s.Warning == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Warning\n}\n\n// GetOperations returns the Operations slice if it's non-nil, nil otherwise.\nfunc (s *SCIMEnterpriseAttribute) GetOperations() []*SCIMEnterpriseAttributeOperation {\n\tif s == nil || s.Operations == nil {\n\t\treturn nil\n\t}\n\treturn s.Operations\n}\n\n// GetSchemas returns the Schemas slice if it's non-nil, nil otherwise.\nfunc (s *SCIMEnterpriseAttribute) GetSchemas() []string {\n\tif s == nil || s.Schemas == nil {\n\t\treturn nil\n\t}\n\treturn s.Schemas\n}\n\n// GetOp returns the Op field.\nfunc (s *SCIMEnterpriseAttributeOperation) GetOp() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.Op\n}\n\n// GetPath returns the Path field if it's non-nil, zero value otherwise.\nfunc (s *SCIMEnterpriseAttributeOperation) GetPath() string {\n\tif s == nil || s.Path == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Path\n}\n\n// GetValue returns the Value field.\nfunc (s *SCIMEnterpriseAttributeOperation) GetValue() any {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Value\n}\n\n// GetDisplay returns the Display field if it's non-nil, zero value otherwise.\nfunc (s *SCIMEnterpriseDisplayReference) GetDisplay() string {\n\tif s == nil || s.Display == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Display\n}\n\n// GetRef returns the Ref field if it's non-nil, zero value otherwise.\nfunc (s *SCIMEnterpriseDisplayReference) GetRef() string {\n\tif s == nil || s.Ref == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Ref\n}\n\n// GetValue returns the Value field.\nfunc (s *SCIMEnterpriseDisplayReference) GetValue() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.Value\n}\n\n// GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise.\nfunc (s *SCIMEnterpriseGroupAttributes) GetDisplayName() string {\n\tif s == nil || s.DisplayName == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.DisplayName\n}\n\n// GetExternalID returns the ExternalID field if it's non-nil, zero value otherwise.\nfunc (s *SCIMEnterpriseGroupAttributes) GetExternalID() string {\n\tif s == nil || s.ExternalID == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.ExternalID\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (s *SCIMEnterpriseGroupAttributes) GetID() string {\n\tif s == nil || s.ID == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.ID\n}\n\n// GetMembers returns the Members slice if it's non-nil, nil otherwise.\nfunc (s *SCIMEnterpriseGroupAttributes) GetMembers() []*SCIMEnterpriseDisplayReference {\n\tif s == nil || s.Members == nil {\n\t\treturn nil\n\t}\n\treturn s.Members\n}\n\n// GetMeta returns the Meta field.\nfunc (s *SCIMEnterpriseGroupAttributes) GetMeta() *SCIMEnterpriseMeta {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Meta\n}\n\n// GetSchemas returns the Schemas slice if it's non-nil, nil otherwise.\nfunc (s *SCIMEnterpriseGroupAttributes) GetSchemas() []string {\n\tif s == nil || s.Schemas == nil {\n\t\treturn nil\n\t}\n\treturn s.Schemas\n}\n\n// GetItemsPerPage returns the ItemsPerPage field if it's non-nil, zero value otherwise.\nfunc (s *SCIMEnterpriseGroups) GetItemsPerPage() int {\n\tif s == nil || s.ItemsPerPage == nil {\n\t\treturn 0\n\t}\n\treturn *s.ItemsPerPage\n}\n\n// GetResources returns the Resources slice if it's non-nil, nil otherwise.\nfunc (s *SCIMEnterpriseGroups) GetResources() []*SCIMEnterpriseGroupAttributes {\n\tif s == nil || s.Resources == nil {\n\t\treturn nil\n\t}\n\treturn s.Resources\n}\n\n// GetSchemas returns the Schemas slice if it's non-nil, nil otherwise.\nfunc (s *SCIMEnterpriseGroups) GetSchemas() []string {\n\tif s == nil || s.Schemas == nil {\n\t\treturn nil\n\t}\n\treturn s.Schemas\n}\n\n// GetStartIndex returns the StartIndex field if it's non-nil, zero value otherwise.\nfunc (s *SCIMEnterpriseGroups) GetStartIndex() int {\n\tif s == nil || s.StartIndex == nil {\n\t\treturn 0\n\t}\n\treturn *s.StartIndex\n}\n\n// GetTotalResults returns the TotalResults field if it's non-nil, zero value otherwise.\nfunc (s *SCIMEnterpriseGroups) GetTotalResults() int {\n\tif s == nil || s.TotalResults == nil {\n\t\treturn 0\n\t}\n\treturn *s.TotalResults\n}\n\n// GetCreated returns the Created field if it's non-nil, zero value otherwise.\nfunc (s *SCIMEnterpriseMeta) GetCreated() Timestamp {\n\tif s == nil || s.Created == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *s.Created\n}\n\n// GetLastModified returns the LastModified field if it's non-nil, zero value otherwise.\nfunc (s *SCIMEnterpriseMeta) GetLastModified() Timestamp {\n\tif s == nil || s.LastModified == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *s.LastModified\n}\n\n// GetLocation returns the Location field if it's non-nil, zero value otherwise.\nfunc (s *SCIMEnterpriseMeta) GetLocation() string {\n\tif s == nil || s.Location == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Location\n}\n\n// GetResourceType returns the ResourceType field.\nfunc (s *SCIMEnterpriseMeta) GetResourceType() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.ResourceType\n}\n\n// GetActive returns the Active field.\nfunc (s *SCIMEnterpriseUserAttributes) GetActive() bool {\n\tif s == nil {\n\t\treturn false\n\t}\n\treturn s.Active\n}\n\n// GetDisplayName returns the DisplayName field.\nfunc (s *SCIMEnterpriseUserAttributes) GetDisplayName() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.DisplayName\n}\n\n// GetEmails returns the Emails slice if it's non-nil, nil otherwise.\nfunc (s *SCIMEnterpriseUserAttributes) GetEmails() []*SCIMEnterpriseUserEmail {\n\tif s == nil || s.Emails == nil {\n\t\treturn nil\n\t}\n\treturn s.Emails\n}\n\n// GetExternalID returns the ExternalID field.\nfunc (s *SCIMEnterpriseUserAttributes) GetExternalID() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.ExternalID\n}\n\n// GetGroups returns the Groups slice if it's non-nil, nil otherwise.\nfunc (s *SCIMEnterpriseUserAttributes) GetGroups() []*SCIMEnterpriseDisplayReference {\n\tif s == nil || s.Groups == nil {\n\t\treturn nil\n\t}\n\treturn s.Groups\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (s *SCIMEnterpriseUserAttributes) GetID() string {\n\tif s == nil || s.ID == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.ID\n}\n\n// GetMeta returns the Meta field.\nfunc (s *SCIMEnterpriseUserAttributes) GetMeta() *SCIMEnterpriseMeta {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Meta\n}\n\n// GetName returns the Name field.\nfunc (s *SCIMEnterpriseUserAttributes) GetName() *SCIMEnterpriseUserName {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Name\n}\n\n// GetRoles returns the Roles slice if it's non-nil, nil otherwise.\nfunc (s *SCIMEnterpriseUserAttributes) GetRoles() []*SCIMEnterpriseUserRole {\n\tif s == nil || s.Roles == nil {\n\t\treturn nil\n\t}\n\treturn s.Roles\n}\n\n// GetSchemas returns the Schemas slice if it's non-nil, nil otherwise.\nfunc (s *SCIMEnterpriseUserAttributes) GetSchemas() []string {\n\tif s == nil || s.Schemas == nil {\n\t\treturn nil\n\t}\n\treturn s.Schemas\n}\n\n// GetUserName returns the UserName field.\nfunc (s *SCIMEnterpriseUserAttributes) GetUserName() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.UserName\n}\n\n// GetPrimary returns the Primary field.\nfunc (s *SCIMEnterpriseUserEmail) GetPrimary() bool {\n\tif s == nil {\n\t\treturn false\n\t}\n\treturn s.Primary\n}\n\n// GetType returns the Type field.\nfunc (s *SCIMEnterpriseUserEmail) GetType() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.Type\n}\n\n// GetValue returns the Value field.\nfunc (s *SCIMEnterpriseUserEmail) GetValue() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.Value\n}\n\n// GetFamilyName returns the FamilyName field.\nfunc (s *SCIMEnterpriseUserName) GetFamilyName() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.FamilyName\n}\n\n// GetFormatted returns the Formatted field if it's non-nil, zero value otherwise.\nfunc (s *SCIMEnterpriseUserName) GetFormatted() string {\n\tif s == nil || s.Formatted == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Formatted\n}\n\n// GetGivenName returns the GivenName field.\nfunc (s *SCIMEnterpriseUserName) GetGivenName() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.GivenName\n}\n\n// GetMiddleName returns the MiddleName field if it's non-nil, zero value otherwise.\nfunc (s *SCIMEnterpriseUserName) GetMiddleName() string {\n\tif s == nil || s.MiddleName == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.MiddleName\n}\n\n// GetDisplay returns the Display field if it's non-nil, zero value otherwise.\nfunc (s *SCIMEnterpriseUserRole) GetDisplay() string {\n\tif s == nil || s.Display == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Display\n}\n\n// GetPrimary returns the Primary field if it's non-nil, zero value otherwise.\nfunc (s *SCIMEnterpriseUserRole) GetPrimary() bool {\n\tif s == nil || s.Primary == nil {\n\t\treturn false\n\t}\n\treturn *s.Primary\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (s *SCIMEnterpriseUserRole) GetType() string {\n\tif s == nil || s.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Type\n}\n\n// GetValue returns the Value field.\nfunc (s *SCIMEnterpriseUserRole) GetValue() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.Value\n}\n\n// GetItemsPerPage returns the ItemsPerPage field if it's non-nil, zero value otherwise.\nfunc (s *SCIMEnterpriseUsers) GetItemsPerPage() int {\n\tif s == nil || s.ItemsPerPage == nil {\n\t\treturn 0\n\t}\n\treturn *s.ItemsPerPage\n}\n\n// GetResources returns the Resources slice if it's non-nil, nil otherwise.\nfunc (s *SCIMEnterpriseUsers) GetResources() []*SCIMEnterpriseUserAttributes {\n\tif s == nil || s.Resources == nil {\n\t\treturn nil\n\t}\n\treturn s.Resources\n}\n\n// GetSchemas returns the Schemas slice if it's non-nil, nil otherwise.\nfunc (s *SCIMEnterpriseUsers) GetSchemas() []string {\n\tif s == nil || s.Schemas == nil {\n\t\treturn nil\n\t}\n\treturn s.Schemas\n}\n\n// GetStartIndex returns the StartIndex field if it's non-nil, zero value otherwise.\nfunc (s *SCIMEnterpriseUsers) GetStartIndex() int {\n\tif s == nil || s.StartIndex == nil {\n\t\treturn 0\n\t}\n\treturn *s.StartIndex\n}\n\n// GetTotalResults returns the TotalResults field if it's non-nil, zero value otherwise.\nfunc (s *SCIMEnterpriseUsers) GetTotalResults() int {\n\tif s == nil || s.TotalResults == nil {\n\t\treturn 0\n\t}\n\treturn *s.TotalResults\n}\n\n// GetCreated returns the Created field if it's non-nil, zero value otherwise.\nfunc (s *SCIMMeta) GetCreated() Timestamp {\n\tif s == nil || s.Created == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *s.Created\n}\n\n// GetLastModified returns the LastModified field if it's non-nil, zero value otherwise.\nfunc (s *SCIMMeta) GetLastModified() Timestamp {\n\tif s == nil || s.LastModified == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *s.LastModified\n}\n\n// GetLocation returns the Location field if it's non-nil, zero value otherwise.\nfunc (s *SCIMMeta) GetLocation() string {\n\tif s == nil || s.Location == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Location\n}\n\n// GetResourceType returns the ResourceType field if it's non-nil, zero value otherwise.\nfunc (s *SCIMMeta) GetResourceType() string {\n\tif s == nil || s.ResourceType == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.ResourceType\n}\n\n// GetItemsPerPage returns the ItemsPerPage field if it's non-nil, zero value otherwise.\nfunc (s *SCIMProvisionedIdentities) GetItemsPerPage() int {\n\tif s == nil || s.ItemsPerPage == nil {\n\t\treturn 0\n\t}\n\treturn *s.ItemsPerPage\n}\n\n// GetResources returns the Resources slice if it's non-nil, nil otherwise.\nfunc (s *SCIMProvisionedIdentities) GetResources() []*SCIMUserAttributes {\n\tif s == nil || s.Resources == nil {\n\t\treturn nil\n\t}\n\treturn s.Resources\n}\n\n// GetSchemas returns the Schemas slice if it's non-nil, nil otherwise.\nfunc (s *SCIMProvisionedIdentities) GetSchemas() []string {\n\tif s == nil || s.Schemas == nil {\n\t\treturn nil\n\t}\n\treturn s.Schemas\n}\n\n// GetStartIndex returns the StartIndex field if it's non-nil, zero value otherwise.\nfunc (s *SCIMProvisionedIdentities) GetStartIndex() int {\n\tif s == nil || s.StartIndex == nil {\n\t\treturn 0\n\t}\n\treturn *s.StartIndex\n}\n\n// GetTotalResults returns the TotalResults field if it's non-nil, zero value otherwise.\nfunc (s *SCIMProvisionedIdentities) GetTotalResults() int {\n\tif s == nil || s.TotalResults == nil {\n\t\treturn 0\n\t}\n\treturn *s.TotalResults\n}\n\n// GetActive returns the Active field if it's non-nil, zero value otherwise.\nfunc (s *SCIMUserAttributes) GetActive() bool {\n\tif s == nil || s.Active == nil {\n\t\treturn false\n\t}\n\treturn *s.Active\n}\n\n// GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise.\nfunc (s *SCIMUserAttributes) GetDisplayName() string {\n\tif s == nil || s.DisplayName == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.DisplayName\n}\n\n// GetEmails returns the Emails slice if it's non-nil, nil otherwise.\nfunc (s *SCIMUserAttributes) GetEmails() []*SCIMUserEmail {\n\tif s == nil || s.Emails == nil {\n\t\treturn nil\n\t}\n\treturn s.Emails\n}\n\n// GetExternalID returns the ExternalID field if it's non-nil, zero value otherwise.\nfunc (s *SCIMUserAttributes) GetExternalID() string {\n\tif s == nil || s.ExternalID == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.ExternalID\n}\n\n// GetGroups returns the Groups slice if it's non-nil, nil otherwise.\nfunc (s *SCIMUserAttributes) GetGroups() []string {\n\tif s == nil || s.Groups == nil {\n\t\treturn nil\n\t}\n\treturn s.Groups\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (s *SCIMUserAttributes) GetID() string {\n\tif s == nil || s.ID == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.ID\n}\n\n// GetMeta returns the Meta field.\nfunc (s *SCIMUserAttributes) GetMeta() *SCIMMeta {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Meta\n}\n\n// GetName returns the Name field.\nfunc (s *SCIMUserAttributes) GetName() SCIMUserName {\n\tif s == nil {\n\t\treturn SCIMUserName{}\n\t}\n\treturn s.Name\n}\n\n// GetRoles returns the Roles slice if it's non-nil, nil otherwise.\nfunc (s *SCIMUserAttributes) GetRoles() []*SCIMUserRole {\n\tif s == nil || s.Roles == nil {\n\t\treturn nil\n\t}\n\treturn s.Roles\n}\n\n// GetSchemas returns the Schemas slice if it's non-nil, nil otherwise.\nfunc (s *SCIMUserAttributes) GetSchemas() []string {\n\tif s == nil || s.Schemas == nil {\n\t\treturn nil\n\t}\n\treturn s.Schemas\n}\n\n// GetUserName returns the UserName field.\nfunc (s *SCIMUserAttributes) GetUserName() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.UserName\n}\n\n// GetPrimary returns the Primary field if it's non-nil, zero value otherwise.\nfunc (s *SCIMUserEmail) GetPrimary() bool {\n\tif s == nil || s.Primary == nil {\n\t\treturn false\n\t}\n\treturn *s.Primary\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (s *SCIMUserEmail) GetType() string {\n\tif s == nil || s.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Type\n}\n\n// GetValue returns the Value field.\nfunc (s *SCIMUserEmail) GetValue() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.Value\n}\n\n// GetFamilyName returns the FamilyName field.\nfunc (s *SCIMUserName) GetFamilyName() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.FamilyName\n}\n\n// GetFormatted returns the Formatted field if it's non-nil, zero value otherwise.\nfunc (s *SCIMUserName) GetFormatted() string {\n\tif s == nil || s.Formatted == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Formatted\n}\n\n// GetGivenName returns the GivenName field.\nfunc (s *SCIMUserName) GetGivenName() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.GivenName\n}\n\n// GetDisplay returns the Display field if it's non-nil, zero value otherwise.\nfunc (s *SCIMUserRole) GetDisplay() string {\n\tif s == nil || s.Display == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Display\n}\n\n// GetPrimary returns the Primary field if it's non-nil, zero value otherwise.\nfunc (s *SCIMUserRole) GetPrimary() bool {\n\tif s == nil || s.Primary == nil {\n\t\treturn false\n\t}\n\treturn *s.Primary\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (s *SCIMUserRole) GetType() string {\n\tif s == nil || s.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Type\n}\n\n// GetValue returns the Value field.\nfunc (s *SCIMUserRole) GetValue() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.Value\n}\n\n// GetAdvancedSearch returns the AdvancedSearch field if it's non-nil, zero value otherwise.\nfunc (s *SearchOptions) GetAdvancedSearch() bool {\n\tif s == nil || s.AdvancedSearch == nil {\n\t\treturn false\n\t}\n\treturn *s.AdvancedSearch\n}\n\n// GetOrder returns the Order field.\nfunc (s *SearchOptions) GetOrder() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.Order\n}\n\n// GetSort returns the Sort field.\nfunc (s *SearchOptions) GetSort() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.Sort\n}\n\n// GetTextMatch returns the TextMatch field.\nfunc (s *SearchOptions) GetTextMatch() bool {\n\tif s == nil {\n\t\treturn false\n\t}\n\treturn s.TextMatch\n}\n\n// GetSeatsCreated returns the SeatsCreated field.\nfunc (s *SeatAssignments) GetSeatsCreated() int {\n\tif s == nil {\n\t\treturn 0\n\t}\n\treturn s.SeatsCreated\n}\n\n// GetSeatsCancelled returns the SeatsCancelled field.\nfunc (s *SeatCancellations) GetSeatsCancelled() int {\n\tif s == nil {\n\t\treturn 0\n\t}\n\treturn s.SeatsCancelled\n}\n\n// GetCreatedAt returns the CreatedAt field.\nfunc (s *Secret) GetCreatedAt() Timestamp {\n\tif s == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn s.CreatedAt\n}\n\n// GetName returns the Name field.\nfunc (s *Secret) GetName() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.Name\n}\n\n// GetSelectedRepositoriesURL returns the SelectedRepositoriesURL field.\nfunc (s *Secret) GetSelectedRepositoriesURL() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.SelectedRepositoriesURL\n}\n\n// GetUpdatedAt returns the UpdatedAt field.\nfunc (s *Secret) GetUpdatedAt() Timestamp {\n\tif s == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn s.UpdatedAt\n}\n\n// GetVisibility returns the Visibility field.\nfunc (s *Secret) GetVisibility() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.Visibility\n}\n\n// GetSecrets returns the Secrets slice if it's non-nil, nil otherwise.\nfunc (s *Secrets) GetSecrets() []*Secret {\n\tif s == nil || s.Secrets == nil {\n\t\treturn nil\n\t}\n\treturn s.Secrets\n}\n\n// GetTotalCount returns the TotalCount field.\nfunc (s *Secrets) GetTotalCount() int {\n\tif s == nil {\n\t\treturn 0\n\t}\n\treturn s.TotalCount\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanning) GetStatus() string {\n\tif s == nil || s.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Status\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlert) GetCreatedAt() Timestamp {\n\tif s == nil || s.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *s.CreatedAt\n}\n\n// GetFirstLocationDetected returns the FirstLocationDetected field.\nfunc (s *SecretScanningAlert) GetFirstLocationDetected() *SecretScanningAlertLocationDetails {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.FirstLocationDetected\n}\n\n// GetHasMoreLocations returns the HasMoreLocations field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlert) GetHasMoreLocations() bool {\n\tif s == nil || s.HasMoreLocations == nil {\n\t\treturn false\n\t}\n\treturn *s.HasMoreLocations\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlert) GetHTMLURL() string {\n\tif s == nil || s.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.HTMLURL\n}\n\n// GetIsBase64Encoded returns the IsBase64Encoded field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlert) GetIsBase64Encoded() bool {\n\tif s == nil || s.IsBase64Encoded == nil {\n\t\treturn false\n\t}\n\treturn *s.IsBase64Encoded\n}\n\n// GetLocationsURL returns the LocationsURL field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlert) GetLocationsURL() string {\n\tif s == nil || s.LocationsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.LocationsURL\n}\n\n// GetMultiRepo returns the MultiRepo field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlert) GetMultiRepo() bool {\n\tif s == nil || s.MultiRepo == nil {\n\t\treturn false\n\t}\n\treturn *s.MultiRepo\n}\n\n// GetNumber returns the Number field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlert) GetNumber() int {\n\tif s == nil || s.Number == nil {\n\t\treturn 0\n\t}\n\treturn *s.Number\n}\n\n// GetPubliclyLeaked returns the PubliclyLeaked field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlert) GetPubliclyLeaked() bool {\n\tif s == nil || s.PubliclyLeaked == nil {\n\t\treturn false\n\t}\n\treturn *s.PubliclyLeaked\n}\n\n// GetPushProtectionBypassed returns the PushProtectionBypassed field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlert) GetPushProtectionBypassed() bool {\n\tif s == nil || s.PushProtectionBypassed == nil {\n\t\treturn false\n\t}\n\treturn *s.PushProtectionBypassed\n}\n\n// GetPushProtectionBypassedAt returns the PushProtectionBypassedAt field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlert) GetPushProtectionBypassedAt() Timestamp {\n\tif s == nil || s.PushProtectionBypassedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *s.PushProtectionBypassedAt\n}\n\n// GetPushProtectionBypassedBy returns the PushProtectionBypassedBy field.\nfunc (s *SecretScanningAlert) GetPushProtectionBypassedBy() *User {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.PushProtectionBypassedBy\n}\n\n// GetPushProtectionBypassRequestComment returns the PushProtectionBypassRequestComment field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlert) GetPushProtectionBypassRequestComment() string {\n\tif s == nil || s.PushProtectionBypassRequestComment == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.PushProtectionBypassRequestComment\n}\n\n// GetPushProtectionBypassRequestHTMLURL returns the PushProtectionBypassRequestHTMLURL field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlert) GetPushProtectionBypassRequestHTMLURL() string {\n\tif s == nil || s.PushProtectionBypassRequestHTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.PushProtectionBypassRequestHTMLURL\n}\n\n// GetPushProtectionBypassRequestReviewer returns the PushProtectionBypassRequestReviewer field.\nfunc (s *SecretScanningAlert) GetPushProtectionBypassRequestReviewer() *User {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.PushProtectionBypassRequestReviewer\n}\n\n// GetPushProtectionBypassRequestReviewerComment returns the PushProtectionBypassRequestReviewerComment field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlert) GetPushProtectionBypassRequestReviewerComment() string {\n\tif s == nil || s.PushProtectionBypassRequestReviewerComment == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.PushProtectionBypassRequestReviewerComment\n}\n\n// GetRepository returns the Repository field.\nfunc (s *SecretScanningAlert) GetRepository() *Repository {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Repository\n}\n\n// GetResolution returns the Resolution field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlert) GetResolution() string {\n\tif s == nil || s.Resolution == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Resolution\n}\n\n// GetResolutionComment returns the ResolutionComment field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlert) GetResolutionComment() string {\n\tif s == nil || s.ResolutionComment == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.ResolutionComment\n}\n\n// GetResolvedAt returns the ResolvedAt field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlert) GetResolvedAt() Timestamp {\n\tif s == nil || s.ResolvedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *s.ResolvedAt\n}\n\n// GetResolvedBy returns the ResolvedBy field.\nfunc (s *SecretScanningAlert) GetResolvedBy() *User {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.ResolvedBy\n}\n\n// GetSecret returns the Secret field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlert) GetSecret() string {\n\tif s == nil || s.Secret == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Secret\n}\n\n// GetSecretType returns the SecretType field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlert) GetSecretType() string {\n\tif s == nil || s.SecretType == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.SecretType\n}\n\n// GetSecretTypeDisplayName returns the SecretTypeDisplayName field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlert) GetSecretTypeDisplayName() string {\n\tif s == nil || s.SecretTypeDisplayName == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.SecretTypeDisplayName\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlert) GetState() string {\n\tif s == nil || s.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.State\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlert) GetUpdatedAt() Timestamp {\n\tif s == nil || s.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *s.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlert) GetURL() string {\n\tif s == nil || s.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.URL\n}\n\n// GetValidity returns the Validity field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlert) GetValidity() string {\n\tif s == nil || s.Validity == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Validity\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlertEvent) GetAction() string {\n\tif s == nil || s.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Action\n}\n\n// GetAlert returns the Alert field.\nfunc (s *SecretScanningAlertEvent) GetAlert() *SecretScanningAlert {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Alert\n}\n\n// GetEnterprise returns the Enterprise field.\nfunc (s *SecretScanningAlertEvent) GetEnterprise() *Enterprise {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Enterprise\n}\n\n// GetInstallation returns the Installation field.\nfunc (s *SecretScanningAlertEvent) GetInstallation() *Installation {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Installation\n}\n\n// GetOrganization returns the Organization field.\nfunc (s *SecretScanningAlertEvent) GetOrganization() *Organization {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Organization\n}\n\n// GetRepo returns the Repo field.\nfunc (s *SecretScanningAlertEvent) GetRepo() *Repository {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (s *SecretScanningAlertEvent) GetSender() *User {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Sender\n}\n\n// GetDirection returns the Direction field.\nfunc (s *SecretScanningAlertListOptions) GetDirection() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.Direction\n}\n\n// GetIsMultiRepo returns the IsMultiRepo field.\nfunc (s *SecretScanningAlertListOptions) GetIsMultiRepo() bool {\n\tif s == nil {\n\t\treturn false\n\t}\n\treturn s.IsMultiRepo\n}\n\n// GetIsPubliclyLeaked returns the IsPubliclyLeaked field.\nfunc (s *SecretScanningAlertListOptions) GetIsPubliclyLeaked() bool {\n\tif s == nil {\n\t\treturn false\n\t}\n\treturn s.IsPubliclyLeaked\n}\n\n// GetResolution returns the Resolution field.\nfunc (s *SecretScanningAlertListOptions) GetResolution() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.Resolution\n}\n\n// GetSecretType returns the SecretType field.\nfunc (s *SecretScanningAlertListOptions) GetSecretType() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.SecretType\n}\n\n// GetSort returns the Sort field.\nfunc (s *SecretScanningAlertListOptions) GetSort() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.Sort\n}\n\n// GetState returns the State field.\nfunc (s *SecretScanningAlertListOptions) GetState() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.State\n}\n\n// GetValidity returns the Validity field.\nfunc (s *SecretScanningAlertListOptions) GetValidity() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.Validity\n}\n\n// GetDetails returns the Details field.\nfunc (s *SecretScanningAlertLocation) GetDetails() *SecretScanningAlertLocationDetails {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Details\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlertLocation) GetType() string {\n\tif s == nil || s.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Type\n}\n\n// GetBlobSHA returns the BlobSHA field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlertLocationDetails) GetBlobSHA() string {\n\tif s == nil || s.BlobSHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.BlobSHA\n}\n\n// GetBlobURL returns the BlobURL field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlertLocationDetails) GetBlobURL() string {\n\tif s == nil || s.BlobURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.BlobURL\n}\n\n// GetCommitSHA returns the CommitSHA field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlertLocationDetails) GetCommitSHA() string {\n\tif s == nil || s.CommitSHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.CommitSHA\n}\n\n// GetCommitURL returns the CommitURL field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlertLocationDetails) GetCommitURL() string {\n\tif s == nil || s.CommitURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.CommitURL\n}\n\n// GetEndColumn returns the EndColumn field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlertLocationDetails) GetEndColumn() int {\n\tif s == nil || s.EndColumn == nil {\n\t\treturn 0\n\t}\n\treturn *s.EndColumn\n}\n\n// GetEndLine returns the EndLine field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlertLocationDetails) GetEndLine() int {\n\tif s == nil || s.EndLine == nil {\n\t\treturn 0\n\t}\n\treturn *s.EndLine\n}\n\n// GetPath returns the Path field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlertLocationDetails) GetPath() string {\n\tif s == nil || s.Path == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Path\n}\n\n// GetPullRequestCommentURL returns the PullRequestCommentURL field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlertLocationDetails) GetPullRequestCommentURL() string {\n\tif s == nil || s.PullRequestCommentURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.PullRequestCommentURL\n}\n\n// GetStartColumn returns the StartColumn field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlertLocationDetails) GetStartColumn() int {\n\tif s == nil || s.StartColumn == nil {\n\t\treturn 0\n\t}\n\treturn *s.StartColumn\n}\n\n// GetStartline returns the Startline field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlertLocationDetails) GetStartline() int {\n\tif s == nil || s.Startline == nil {\n\t\treturn 0\n\t}\n\treturn *s.Startline\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlertLocationEvent) GetAction() string {\n\tif s == nil || s.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Action\n}\n\n// GetAlert returns the Alert field.\nfunc (s *SecretScanningAlertLocationEvent) GetAlert() *SecretScanningAlert {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Alert\n}\n\n// GetInstallation returns the Installation field.\nfunc (s *SecretScanningAlertLocationEvent) GetInstallation() *Installation {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Installation\n}\n\n// GetLocation returns the Location field.\nfunc (s *SecretScanningAlertLocationEvent) GetLocation() *SecretScanningAlertLocation {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Location\n}\n\n// GetOrganization returns the Organization field.\nfunc (s *SecretScanningAlertLocationEvent) GetOrganization() *Organization {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Organization\n}\n\n// GetRepo returns the Repo field.\nfunc (s *SecretScanningAlertLocationEvent) GetRepo() *Repository {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (s *SecretScanningAlertLocationEvent) GetSender() *User {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Sender\n}\n\n// GetResolution returns the Resolution field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlertUpdateOptions) GetResolution() string {\n\tif s == nil || s.Resolution == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Resolution\n}\n\n// GetResolutionComment returns the ResolutionComment field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningAlertUpdateOptions) GetResolutionComment() string {\n\tif s == nil || s.ResolutionComment == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.ResolutionComment\n}\n\n// GetState returns the State field.\nfunc (s *SecretScanningAlertUpdateOptions) GetState() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.State\n}\n\n// GetCustomPatternVersion returns the CustomPatternVersion field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningCustomPatternSetting) GetCustomPatternVersion() string {\n\tif s == nil || s.CustomPatternVersion == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.CustomPatternVersion\n}\n\n// GetPushProtectionSetting returns the PushProtectionSetting field.\nfunc (s *SecretScanningCustomPatternSetting) GetPushProtectionSetting() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.PushProtectionSetting\n}\n\n// GetTokenType returns the TokenType field.\nfunc (s *SecretScanningCustomPatternSetting) GetTokenType() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.TokenType\n}\n\n// GetReviewers returns the Reviewers slice if it's non-nil, nil otherwise.\nfunc (s *SecretScanningDelegatedBypassOptions) GetReviewers() []*BypassReviewer {\n\tif s == nil || s.Reviewers == nil {\n\t\treturn nil\n\t}\n\treturn s.Reviewers\n}\n\n// GetCustomPatternOverrides returns the CustomPatternOverrides slice if it's non-nil, nil otherwise.\nfunc (s *SecretScanningPatternConfigs) GetCustomPatternOverrides() []*SecretScanningPatternOverride {\n\tif s == nil || s.CustomPatternOverrides == nil {\n\t\treturn nil\n\t}\n\treturn s.CustomPatternOverrides\n}\n\n// GetPatternConfigVersion returns the PatternConfigVersion field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningPatternConfigs) GetPatternConfigVersion() string {\n\tif s == nil || s.PatternConfigVersion == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.PatternConfigVersion\n}\n\n// GetProviderPatternOverrides returns the ProviderPatternOverrides slice if it's non-nil, nil otherwise.\nfunc (s *SecretScanningPatternConfigs) GetProviderPatternOverrides() []*SecretScanningPatternOverride {\n\tif s == nil || s.ProviderPatternOverrides == nil {\n\t\treturn nil\n\t}\n\treturn s.ProviderPatternOverrides\n}\n\n// GetPatternConfigVersion returns the PatternConfigVersion field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningPatternConfigsUpdate) GetPatternConfigVersion() string {\n\tif s == nil || s.PatternConfigVersion == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.PatternConfigVersion\n}\n\n// GetCustomPatternSettings returns the CustomPatternSettings slice if it's non-nil, nil otherwise.\nfunc (s *SecretScanningPatternConfigsUpdateOptions) GetCustomPatternSettings() []*SecretScanningCustomPatternSetting {\n\tif s == nil || s.CustomPatternSettings == nil {\n\t\treturn nil\n\t}\n\treturn s.CustomPatternSettings\n}\n\n// GetPatternConfigVersion returns the PatternConfigVersion field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningPatternConfigsUpdateOptions) GetPatternConfigVersion() string {\n\tif s == nil || s.PatternConfigVersion == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.PatternConfigVersion\n}\n\n// GetProviderPatternSettings returns the ProviderPatternSettings slice if it's non-nil, nil otherwise.\nfunc (s *SecretScanningPatternConfigsUpdateOptions) GetProviderPatternSettings() []*SecretScanningProviderPatternSetting {\n\tif s == nil || s.ProviderPatternSettings == nil {\n\t\treturn nil\n\t}\n\treturn s.ProviderPatternSettings\n}\n\n// GetAlertTotal returns the AlertTotal field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningPatternOverride) GetAlertTotal() int {\n\tif s == nil || s.AlertTotal == nil {\n\t\treturn 0\n\t}\n\treturn *s.AlertTotal\n}\n\n// GetAlertTotalPercentage returns the AlertTotalPercentage field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningPatternOverride) GetAlertTotalPercentage() int {\n\tif s == nil || s.AlertTotalPercentage == nil {\n\t\treturn 0\n\t}\n\treturn *s.AlertTotalPercentage\n}\n\n// GetBypassrate returns the Bypassrate field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningPatternOverride) GetBypassrate() int {\n\tif s == nil || s.Bypassrate == nil {\n\t\treturn 0\n\t}\n\treturn *s.Bypassrate\n}\n\n// GetCustomPatternVersion returns the CustomPatternVersion field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningPatternOverride) GetCustomPatternVersion() string {\n\tif s == nil || s.CustomPatternVersion == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.CustomPatternVersion\n}\n\n// GetDefaultSetting returns the DefaultSetting field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningPatternOverride) GetDefaultSetting() string {\n\tif s == nil || s.DefaultSetting == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.DefaultSetting\n}\n\n// GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningPatternOverride) GetDisplayName() string {\n\tif s == nil || s.DisplayName == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.DisplayName\n}\n\n// GetEnterpriseSetting returns the EnterpriseSetting field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningPatternOverride) GetEnterpriseSetting() string {\n\tif s == nil || s.EnterpriseSetting == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.EnterpriseSetting\n}\n\n// GetFalsePositiveRate returns the FalsePositiveRate field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningPatternOverride) GetFalsePositiveRate() int {\n\tif s == nil || s.FalsePositiveRate == nil {\n\t\treturn 0\n\t}\n\treturn *s.FalsePositiveRate\n}\n\n// GetFalsePositives returns the FalsePositives field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningPatternOverride) GetFalsePositives() int {\n\tif s == nil || s.FalsePositives == nil {\n\t\treturn 0\n\t}\n\treturn *s.FalsePositives\n}\n\n// GetSetting returns the Setting field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningPatternOverride) GetSetting() string {\n\tif s == nil || s.Setting == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Setting\n}\n\n// GetSlug returns the Slug field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningPatternOverride) GetSlug() string {\n\tif s == nil || s.Slug == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Slug\n}\n\n// GetTokenType returns the TokenType field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningPatternOverride) GetTokenType() string {\n\tif s == nil || s.TokenType == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.TokenType\n}\n\n// GetPushProtectionSetting returns the PushProtectionSetting field.\nfunc (s *SecretScanningProviderPatternSetting) GetPushProtectionSetting() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.PushProtectionSetting\n}\n\n// GetTokenType returns the TokenType field.\nfunc (s *SecretScanningProviderPatternSetting) GetTokenType() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.TokenType\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningPushProtection) GetStatus() string {\n\tif s == nil || s.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Status\n}\n\n// GetBackfillScans returns the BackfillScans slice if it's non-nil, nil otherwise.\nfunc (s *SecretScanningScanHistory) GetBackfillScans() []*SecretsScan {\n\tif s == nil || s.BackfillScans == nil {\n\t\treturn nil\n\t}\n\treturn s.BackfillScans\n}\n\n// GetCustomPatternBackfillScans returns the CustomPatternBackfillScans slice if it's non-nil, nil otherwise.\nfunc (s *SecretScanningScanHistory) GetCustomPatternBackfillScans() []*CustomPatternBackfillScan {\n\tif s == nil || s.CustomPatternBackfillScans == nil {\n\t\treturn nil\n\t}\n\treturn s.CustomPatternBackfillScans\n}\n\n// GetIncrementalScans returns the IncrementalScans slice if it's non-nil, nil otherwise.\nfunc (s *SecretScanningScanHistory) GetIncrementalScans() []*SecretsScan {\n\tif s == nil || s.IncrementalScans == nil {\n\t\treturn nil\n\t}\n\treturn s.IncrementalScans\n}\n\n// GetPatternUpdateScans returns the PatternUpdateScans slice if it's non-nil, nil otherwise.\nfunc (s *SecretScanningScanHistory) GetPatternUpdateScans() []*SecretsScan {\n\tif s == nil || s.PatternUpdateScans == nil {\n\t\treturn nil\n\t}\n\treturn s.PatternUpdateScans\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (s *SecretScanningValidityChecks) GetStatus() string {\n\tif s == nil || s.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Status\n}\n\n// GetCompletedAt returns the CompletedAt field if it's non-nil, zero value otherwise.\nfunc (s *SecretsScan) GetCompletedAt() Timestamp {\n\tif s == nil || s.CompletedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *s.CompletedAt\n}\n\n// GetStartedAt returns the StartedAt field if it's non-nil, zero value otherwise.\nfunc (s *SecretsScan) GetStartedAt() Timestamp {\n\tif s == nil || s.StartedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *s.StartedAt\n}\n\n// GetStatus returns the Status field.\nfunc (s *SecretsScan) GetStatus() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.Status\n}\n\n// GetType returns the Type field.\nfunc (s *SecretsScan) GetType() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.Type\n}\n\n// GetAuthor returns the Author field.\nfunc (s *SecurityAdvisory) GetAuthor() *User {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Author\n}\n\n// GetClosedAt returns the ClosedAt field if it's non-nil, zero value otherwise.\nfunc (s *SecurityAdvisory) GetClosedAt() Timestamp {\n\tif s == nil || s.ClosedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *s.ClosedAt\n}\n\n// GetCollaboratingTeams returns the CollaboratingTeams slice if it's non-nil, nil otherwise.\nfunc (s *SecurityAdvisory) GetCollaboratingTeams() []*Team {\n\tif s == nil || s.CollaboratingTeams == nil {\n\t\treturn nil\n\t}\n\treturn s.CollaboratingTeams\n}\n\n// GetCollaboratingUsers returns the CollaboratingUsers slice if it's non-nil, nil otherwise.\nfunc (s *SecurityAdvisory) GetCollaboratingUsers() []*User {\n\tif s == nil || s.CollaboratingUsers == nil {\n\t\treturn nil\n\t}\n\treturn s.CollaboratingUsers\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (s *SecurityAdvisory) GetCreatedAt() Timestamp {\n\tif s == nil || s.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *s.CreatedAt\n}\n\n// GetCredits returns the Credits slice if it's non-nil, nil otherwise.\nfunc (s *SecurityAdvisory) GetCredits() []*RepoAdvisoryCredit {\n\tif s == nil || s.Credits == nil {\n\t\treturn nil\n\t}\n\treturn s.Credits\n}\n\n// GetCreditsDetailed returns the CreditsDetailed slice if it's non-nil, nil otherwise.\nfunc (s *SecurityAdvisory) GetCreditsDetailed() []*RepoAdvisoryCreditDetailed {\n\tif s == nil || s.CreditsDetailed == nil {\n\t\treturn nil\n\t}\n\treturn s.CreditsDetailed\n}\n\n// GetCVEID returns the CVEID field if it's non-nil, zero value otherwise.\nfunc (s *SecurityAdvisory) GetCVEID() string {\n\tif s == nil || s.CVEID == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.CVEID\n}\n\n// GetCVSS returns the CVSS field.\nfunc (s *SecurityAdvisory) GetCVSS() *AdvisoryCVSS {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.CVSS\n}\n\n// GetCWEIDs returns the CWEIDs slice if it's non-nil, nil otherwise.\nfunc (s *SecurityAdvisory) GetCWEIDs() []string {\n\tif s == nil || s.CWEIDs == nil {\n\t\treturn nil\n\t}\n\treturn s.CWEIDs\n}\n\n// GetCWEs returns the CWEs slice if it's non-nil, nil otherwise.\nfunc (s *SecurityAdvisory) GetCWEs() []*AdvisoryCWEs {\n\tif s == nil || s.CWEs == nil {\n\t\treturn nil\n\t}\n\treturn s.CWEs\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (s *SecurityAdvisory) GetDescription() string {\n\tif s == nil || s.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Description\n}\n\n// GetGHSAID returns the GHSAID field if it's non-nil, zero value otherwise.\nfunc (s *SecurityAdvisory) GetGHSAID() string {\n\tif s == nil || s.GHSAID == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.GHSAID\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (s *SecurityAdvisory) GetHTMLURL() string {\n\tif s == nil || s.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.HTMLURL\n}\n\n// GetIdentifiers returns the Identifiers slice if it's non-nil, nil otherwise.\nfunc (s *SecurityAdvisory) GetIdentifiers() []*AdvisoryIdentifier {\n\tif s == nil || s.Identifiers == nil {\n\t\treturn nil\n\t}\n\treturn s.Identifiers\n}\n\n// GetPrivateFork returns the PrivateFork field.\nfunc (s *SecurityAdvisory) GetPrivateFork() *Repository {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.PrivateFork\n}\n\n// GetPublishedAt returns the PublishedAt field if it's non-nil, zero value otherwise.\nfunc (s *SecurityAdvisory) GetPublishedAt() Timestamp {\n\tif s == nil || s.PublishedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *s.PublishedAt\n}\n\n// GetPublisher returns the Publisher field.\nfunc (s *SecurityAdvisory) GetPublisher() *User {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Publisher\n}\n\n// GetReferences returns the References slice if it's non-nil, nil otherwise.\nfunc (s *SecurityAdvisory) GetReferences() []*AdvisoryReference {\n\tif s == nil || s.References == nil {\n\t\treturn nil\n\t}\n\treturn s.References\n}\n\n// GetSeverity returns the Severity field if it's non-nil, zero value otherwise.\nfunc (s *SecurityAdvisory) GetSeverity() string {\n\tif s == nil || s.Severity == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Severity\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (s *SecurityAdvisory) GetState() string {\n\tif s == nil || s.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.State\n}\n\n// GetSubmission returns the Submission field.\nfunc (s *SecurityAdvisory) GetSubmission() *SecurityAdvisorySubmission {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Submission\n}\n\n// GetSummary returns the Summary field if it's non-nil, zero value otherwise.\nfunc (s *SecurityAdvisory) GetSummary() string {\n\tif s == nil || s.Summary == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Summary\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (s *SecurityAdvisory) GetUpdatedAt() Timestamp {\n\tif s == nil || s.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *s.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (s *SecurityAdvisory) GetURL() string {\n\tif s == nil || s.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.URL\n}\n\n// GetVulnerabilities returns the Vulnerabilities slice if it's non-nil, nil otherwise.\nfunc (s *SecurityAdvisory) GetVulnerabilities() []*AdvisoryVulnerability {\n\tif s == nil || s.Vulnerabilities == nil {\n\t\treturn nil\n\t}\n\treturn s.Vulnerabilities\n}\n\n// GetWithdrawnAt returns the WithdrawnAt field if it's non-nil, zero value otherwise.\nfunc (s *SecurityAdvisory) GetWithdrawnAt() Timestamp {\n\tif s == nil || s.WithdrawnAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *s.WithdrawnAt\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (s *SecurityAdvisoryEvent) GetAction() string {\n\tif s == nil || s.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Action\n}\n\n// GetEnterprise returns the Enterprise field.\nfunc (s *SecurityAdvisoryEvent) GetEnterprise() *Enterprise {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Enterprise\n}\n\n// GetInstallation returns the Installation field.\nfunc (s *SecurityAdvisoryEvent) GetInstallation() *Installation {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Installation\n}\n\n// GetOrganization returns the Organization field.\nfunc (s *SecurityAdvisoryEvent) GetOrganization() *Organization {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Organization\n}\n\n// GetRepository returns the Repository field.\nfunc (s *SecurityAdvisoryEvent) GetRepository() *Repository {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Repository\n}\n\n// GetSecurityAdvisory returns the SecurityAdvisory field.\nfunc (s *SecurityAdvisoryEvent) GetSecurityAdvisory() *SecurityAdvisory {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.SecurityAdvisory\n}\n\n// GetSender returns the Sender field.\nfunc (s *SecurityAdvisoryEvent) GetSender() *User {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Sender\n}\n\n// GetAccepted returns the Accepted field if it's non-nil, zero value otherwise.\nfunc (s *SecurityAdvisorySubmission) GetAccepted() bool {\n\tif s == nil || s.Accepted == nil {\n\t\treturn false\n\t}\n\treturn *s.Accepted\n}\n\n// GetAdvancedSecurity returns the AdvancedSecurity field.\nfunc (s *SecurityAndAnalysis) GetAdvancedSecurity() *AdvancedSecurity {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.AdvancedSecurity\n}\n\n// GetDependabotSecurityUpdates returns the DependabotSecurityUpdates field.\nfunc (s *SecurityAndAnalysis) GetDependabotSecurityUpdates() *DependabotSecurityUpdates {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.DependabotSecurityUpdates\n}\n\n// GetSecretScanning returns the SecretScanning field.\nfunc (s *SecurityAndAnalysis) GetSecretScanning() *SecretScanning {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.SecretScanning\n}\n\n// GetSecretScanningPushProtection returns the SecretScanningPushProtection field.\nfunc (s *SecurityAndAnalysis) GetSecretScanningPushProtection() *SecretScanningPushProtection {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.SecretScanningPushProtection\n}\n\n// GetSecretScanningValidityChecks returns the SecretScanningValidityChecks field.\nfunc (s *SecurityAndAnalysis) GetSecretScanningValidityChecks() *SecretScanningValidityChecks {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.SecretScanningValidityChecks\n}\n\n// GetFrom returns the From field.\nfunc (s *SecurityAndAnalysisChange) GetFrom() *SecurityAndAnalysisChangeFrom {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.From\n}\n\n// GetSecurityAndAnalysis returns the SecurityAndAnalysis field.\nfunc (s *SecurityAndAnalysisChangeFrom) GetSecurityAndAnalysis() *SecurityAndAnalysis {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.SecurityAndAnalysis\n}\n\n// GetChanges returns the Changes field.\nfunc (s *SecurityAndAnalysisEvent) GetChanges() *SecurityAndAnalysisChange {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Changes\n}\n\n// GetEnterprise returns the Enterprise field.\nfunc (s *SecurityAndAnalysisEvent) GetEnterprise() *Enterprise {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Enterprise\n}\n\n// GetInstallation returns the Installation field.\nfunc (s *SecurityAndAnalysisEvent) GetInstallation() *Installation {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Installation\n}\n\n// GetOrganization returns the Organization field.\nfunc (s *SecurityAndAnalysisEvent) GetOrganization() *Organization {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Organization\n}\n\n// GetRepository returns the Repository field.\nfunc (s *SecurityAndAnalysisEvent) GetRepository() *Repository {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Repository\n}\n\n// GetSender returns the Sender field.\nfunc (s *SecurityAndAnalysisEvent) GetSender() *User {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Sender\n}\n\n// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise.\nfunc (s *SelectedReposList) GetRepositories() []*Repository {\n\tif s == nil || s.Repositories == nil {\n\t\treturn nil\n\t}\n\treturn s.Repositories\n}\n\n// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.\nfunc (s *SelectedReposList) GetTotalCount() int {\n\tif s == nil || s.TotalCount == nil {\n\t\treturn 0\n\t}\n\treturn *s.TotalCount\n}\n\n// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise.\nfunc (s *SelfHostedRunnersAllowedRepos) GetRepositories() []*Repository {\n\tif s == nil || s.Repositories == nil {\n\t\treturn nil\n\t}\n\treturn s.Repositories\n}\n\n// GetTotalCount returns the TotalCount field.\nfunc (s *SelfHostedRunnersAllowedRepos) GetTotalCount() int {\n\tif s == nil {\n\t\treturn 0\n\t}\n\treturn s.TotalCount\n}\n\n// GetEnabledRepositories returns the EnabledRepositories field if it's non-nil, zero value otherwise.\nfunc (s *SelfHostedRunnersSettingsOrganization) GetEnabledRepositories() string {\n\tif s == nil || s.EnabledRepositories == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.EnabledRepositories\n}\n\n// GetSelectedRepositoriesURL returns the SelectedRepositoriesURL field if it's non-nil, zero value otherwise.\nfunc (s *SelfHostedRunnersSettingsOrganization) GetSelectedRepositoriesURL() string {\n\tif s == nil || s.SelectedRepositoriesURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.SelectedRepositoriesURL\n}\n\n// GetEnabledRepositories returns the EnabledRepositories field if it's non-nil, zero value otherwise.\nfunc (s *SelfHostedRunnersSettingsOrganizationOpt) GetEnabledRepositories() string {\n\tif s == nil || s.EnabledRepositories == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.EnabledRepositories\n}\n\n// GetDisableSelfHostedRunnersForAllOrgs returns the DisableSelfHostedRunnersForAllOrgs field if it's non-nil, zero value otherwise.\nfunc (s *SelfHostRunnerPermissionsEnterprise) GetDisableSelfHostedRunnersForAllOrgs() bool {\n\tif s == nil || s.DisableSelfHostedRunnersForAllOrgs == nil {\n\t\treturn false\n\t}\n\treturn *s.DisableSelfHostedRunnersForAllOrgs\n}\n\n// GetServerInstances returns the ServerInstances field.\nfunc (s *ServerInstanceProperties) GetServerInstances() *ServerInstances {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.ServerInstances\n}\n\n// GetItems returns the Items field.\nfunc (s *ServerInstances) GetItems() *ServiceInstanceItems {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Items\n}\n\n// GetType returns the Type field.\nfunc (s *ServerInstances) GetType() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.Type\n}\n\n// GetHostname returns the Hostname field.\nfunc (s *ServerItemProperties) GetHostname() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.Hostname\n}\n\n// GetLastSync returns the LastSync field.\nfunc (s *ServerItemProperties) GetLastSync() *LastLicenseSync {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.LastSync\n}\n\n// GetServerID returns the ServerID field.\nfunc (s *ServerItemProperties) GetServerID() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.ServerID\n}\n\n// GetProperties returns the Properties field.\nfunc (s *ServiceInstanceItems) GetProperties() *ServerItemProperties {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Properties\n}\n\n// GetType returns the Type field.\nfunc (s *ServiceInstanceItems) GetType() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.Type\n}\n\n// GetSelectedOrganizationIDs returns the SelectedOrganizationIDs slice if it's non-nil, nil otherwise.\nfunc (s *SetOrgAccessRunnerGroupRequest) GetSelectedOrganizationIDs() []int64 {\n\tif s == nil || s.SelectedOrganizationIDs == nil {\n\t\treturn nil\n\t}\n\treturn s.SelectedOrganizationIDs\n}\n\n// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs slice if it's non-nil, nil otherwise.\nfunc (s *SetRepoAccessRunnerGroupRequest) GetSelectedRepositoryIDs() []int64 {\n\tif s == nil || s.SelectedRepositoryIDs == nil {\n\t\treturn nil\n\t}\n\treturn s.SelectedRepositoryIDs\n}\n\n// GetRunners returns the Runners slice if it's non-nil, nil otherwise.\nfunc (s *SetRunnerGroupRunnersRequest) GetRunners() []int64 {\n\tif s == nil || s.Runners == nil {\n\t\treturn nil\n\t}\n\treturn s.Runners\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (s *SignatureRequirementEnforcementLevelChanges) GetFrom() string {\n\tif s == nil || s.From == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.From\n}\n\n// GetEnabled returns the Enabled field if it's non-nil, zero value otherwise.\nfunc (s *SignaturesProtectedBranch) GetEnabled() bool {\n\tif s == nil || s.Enabled == nil {\n\t\treturn false\n\t}\n\treturn *s.Enabled\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (s *SignaturesProtectedBranch) GetURL() string {\n\tif s == nil || s.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.URL\n}\n\n// GetPayload returns the Payload field if it's non-nil, zero value otherwise.\nfunc (s *SignatureVerification) GetPayload() string {\n\tif s == nil || s.Payload == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Payload\n}\n\n// GetReason returns the Reason field if it's non-nil, zero value otherwise.\nfunc (s *SignatureVerification) GetReason() string {\n\tif s == nil || s.Reason == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Reason\n}\n\n// GetSignature returns the Signature field if it's non-nil, zero value otherwise.\nfunc (s *SignatureVerification) GetSignature() string {\n\tif s == nil || s.Signature == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Signature\n}\n\n// GetVerified returns the Verified field if it's non-nil, zero value otherwise.\nfunc (s *SignatureVerification) GetVerified() bool {\n\tif s == nil || s.Verified == nil {\n\t\treturn false\n\t}\n\treturn *s.Verified\n}\n\n// GetNegate returns the Negate field.\nfunc (s *SimplePatternRuleParameters) GetNegate() bool {\n\tif s == nil {\n\t\treturn false\n\t}\n\treturn s.Negate\n}\n\n// GetPattern returns the Pattern field.\nfunc (s *SimplePatternRuleParameters) GetPattern() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.Pattern\n}\n\n// GetProvider returns the Provider field if it's non-nil, zero value otherwise.\nfunc (s *SocialAccount) GetProvider() string {\n\tif s == nil || s.Provider == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Provider\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (s *SocialAccount) GetURL() string {\n\tif s == nil || s.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.URL\n}\n\n// GetActor returns the Actor field.\nfunc (s *Source) GetActor() *User {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Actor\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (s *Source) GetID() int64 {\n\tif s == nil || s.ID == nil {\n\t\treturn 0\n\t}\n\treturn *s.ID\n}\n\n// GetIssue returns the Issue field.\nfunc (s *Source) GetIssue() *Issue {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Issue\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (s *Source) GetType() string {\n\tif s == nil || s.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Type\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (s *Source) GetURL() string {\n\tif s == nil || s.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.URL\n}\n\n// GetEmail returns the Email field if it's non-nil, zero value otherwise.\nfunc (s *SourceImportAuthor) GetEmail() string {\n\tif s == nil || s.Email == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Email\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (s *SourceImportAuthor) GetID() int64 {\n\tif s == nil || s.ID == nil {\n\t\treturn 0\n\t}\n\treturn *s.ID\n}\n\n// GetImportURL returns the ImportURL field if it's non-nil, zero value otherwise.\nfunc (s *SourceImportAuthor) GetImportURL() string {\n\tif s == nil || s.ImportURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.ImportURL\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (s *SourceImportAuthor) GetName() string {\n\tif s == nil || s.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Name\n}\n\n// GetRemoteID returns the RemoteID field if it's non-nil, zero value otherwise.\nfunc (s *SourceImportAuthor) GetRemoteID() string {\n\tif s == nil || s.RemoteID == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.RemoteID\n}\n\n// GetRemoteName returns the RemoteName field if it's non-nil, zero value otherwise.\nfunc (s *SourceImportAuthor) GetRemoteName() string {\n\tif s == nil || s.RemoteName == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.RemoteName\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (s *SourceImportAuthor) GetURL() string {\n\tif s == nil || s.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.URL\n}\n\n// GetDomain returns the Domain field.\nfunc (s *SplunkConfig) GetDomain() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.Domain\n}\n\n// GetEncryptedToken returns the EncryptedToken field.\nfunc (s *SplunkConfig) GetEncryptedToken() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.EncryptedToken\n}\n\n// GetKeyID returns the KeyID field.\nfunc (s *SplunkConfig) GetKeyID() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.KeyID\n}\n\n// GetPort returns the Port field.\nfunc (s *SplunkConfig) GetPort() uint16 {\n\tif s == nil {\n\t\treturn 0\n\t}\n\treturn s.Port\n}\n\n// GetSSLVerify returns the SSLVerify field.\nfunc (s *SplunkConfig) GetSSLVerify() bool {\n\tif s == nil {\n\t\treturn false\n\t}\n\treturn s.SSLVerify\n}\n\n// GetPrivacyLevel returns the PrivacyLevel field if it's non-nil, zero value otherwise.\nfunc (s *SponsorshipChanges) GetPrivacyLevel() string {\n\tif s == nil || s.PrivacyLevel == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.PrivacyLevel\n}\n\n// GetTier returns the Tier field.\nfunc (s *SponsorshipChanges) GetTier() *SponsorshipTier {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Tier\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (s *SponsorshipEvent) GetAction() string {\n\tif s == nil || s.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Action\n}\n\n// GetChanges returns the Changes field.\nfunc (s *SponsorshipEvent) GetChanges() *SponsorshipChanges {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Changes\n}\n\n// GetEffectiveDate returns the EffectiveDate field if it's non-nil, zero value otherwise.\nfunc (s *SponsorshipEvent) GetEffectiveDate() string {\n\tif s == nil || s.EffectiveDate == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.EffectiveDate\n}\n\n// GetInstallation returns the Installation field.\nfunc (s *SponsorshipEvent) GetInstallation() *Installation {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Installation\n}\n\n// GetOrganization returns the Organization field.\nfunc (s *SponsorshipEvent) GetOrganization() *Organization {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Organization\n}\n\n// GetRepository returns the Repository field.\nfunc (s *SponsorshipEvent) GetRepository() *Repository {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Repository\n}\n\n// GetSender returns the Sender field.\nfunc (s *SponsorshipEvent) GetSender() *User {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Sender\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (s *SponsorshipTier) GetFrom() string {\n\tif s == nil || s.From == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.From\n}\n\n// GetKey returns the Key field.\nfunc (s *SSHKeyOptions) GetKey() string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn s.Key\n}\n\n// GetHostname returns the Hostname field if it's non-nil, zero value otherwise.\nfunc (s *SSHKeyStatus) GetHostname() string {\n\tif s == nil || s.Hostname == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Hostname\n}\n\n// GetMessage returns the Message field if it's non-nil, zero value otherwise.\nfunc (s *SSHKeyStatus) GetMessage() string {\n\tif s == nil || s.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Message\n}\n\n// GetModified returns the Modified field if it's non-nil, zero value otherwise.\nfunc (s *SSHKeyStatus) GetModified() bool {\n\tif s == nil || s.Modified == nil {\n\t\treturn false\n\t}\n\treturn *s.Modified\n}\n\n// GetUUID returns the UUID field if it's non-nil, zero value otherwise.\nfunc (s *SSHKeyStatus) GetUUID() string {\n\tif s == nil || s.UUID == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.UUID\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (s *SSHSigningKey) GetCreatedAt() Timestamp {\n\tif s == nil || s.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *s.CreatedAt\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (s *SSHSigningKey) GetID() int64 {\n\tif s == nil || s.ID == nil {\n\t\treturn 0\n\t}\n\treturn *s.ID\n}\n\n// GetKey returns the Key field if it's non-nil, zero value otherwise.\nfunc (s *SSHSigningKey) GetKey() string {\n\tif s == nil || s.Key == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Key\n}\n\n// GetTitle returns the Title field if it's non-nil, zero value otherwise.\nfunc (s *SSHSigningKey) GetTitle() string {\n\tif s == nil || s.Title == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Title\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (s *StarEvent) GetAction() string {\n\tif s == nil || s.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Action\n}\n\n// GetInstallation returns the Installation field.\nfunc (s *StarEvent) GetInstallation() *Installation {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (s *StarEvent) GetOrg() *Organization {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Org\n}\n\n// GetRepo returns the Repo field.\nfunc (s *StarEvent) GetRepo() *Repository {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (s *StarEvent) GetSender() *User {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Sender\n}\n\n// GetStarredAt returns the StarredAt field if it's non-nil, zero value otherwise.\nfunc (s *StarEvent) GetStarredAt() Timestamp {\n\tif s == nil || s.StarredAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *s.StarredAt\n}\n\n// GetStarredAt returns the StarredAt field if it's non-nil, zero value otherwise.\nfunc (s *Stargazer) GetStarredAt() Timestamp {\n\tif s == nil || s.StarredAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *s.StarredAt\n}\n\n// GetUser returns the User field.\nfunc (s *Stargazer) GetUser() *User {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.User\n}\n\n// GetRepository returns the Repository field.\nfunc (s *StarredRepository) GetRepository() *Repository {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Repository\n}\n\n// GetStarredAt returns the StarredAt field if it's non-nil, zero value otherwise.\nfunc (s *StarredRepository) GetStarredAt() Timestamp {\n\tif s == nil || s.StarredAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *s.StarredAt\n}\n\n// GetBranches returns the Branches slice if it's non-nil, nil otherwise.\nfunc (s *StatusEvent) GetBranches() []*Branch {\n\tif s == nil || s.Branches == nil {\n\t\treturn nil\n\t}\n\treturn s.Branches\n}\n\n// GetCommit returns the Commit field.\nfunc (s *StatusEvent) GetCommit() *RepositoryCommit {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Commit\n}\n\n// GetContext returns the Context field if it's non-nil, zero value otherwise.\nfunc (s *StatusEvent) GetContext() string {\n\tif s == nil || s.Context == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Context\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (s *StatusEvent) GetCreatedAt() Timestamp {\n\tif s == nil || s.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *s.CreatedAt\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (s *StatusEvent) GetDescription() string {\n\tif s == nil || s.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Description\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (s *StatusEvent) GetID() int64 {\n\tif s == nil || s.ID == nil {\n\t\treturn 0\n\t}\n\treturn *s.ID\n}\n\n// GetInstallation returns the Installation field.\nfunc (s *StatusEvent) GetInstallation() *Installation {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Installation\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (s *StatusEvent) GetName() string {\n\tif s == nil || s.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Name\n}\n\n// GetOrg returns the Org field.\nfunc (s *StatusEvent) GetOrg() *Organization {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Org\n}\n\n// GetRepo returns the Repo field.\nfunc (s *StatusEvent) GetRepo() *Repository {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (s *StatusEvent) GetSender() *User {\n\tif s == nil {\n\t\treturn nil\n\t}\n\treturn s.Sender\n}\n\n// GetSHA returns the SHA field if it's non-nil, zero value otherwise.\nfunc (s *StatusEvent) GetSHA() string {\n\tif s == nil || s.SHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.SHA\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (s *StatusEvent) GetState() string {\n\tif s == nil || s.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.State\n}\n\n// GetTargetURL returns the TargetURL field if it's non-nil, zero value otherwise.\nfunc (s *StatusEvent) GetTargetURL() string {\n\tif s == nil || s.TargetURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.TargetURL\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (s *StatusEvent) GetUpdatedAt() Timestamp {\n\tif s == nil || s.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *s.UpdatedAt\n}\n\n// GetDaysLeftInBillingCycle returns the DaysLeftInBillingCycle field.\nfunc (s *StorageBilling) GetDaysLeftInBillingCycle() int {\n\tif s == nil {\n\t\treturn 0\n\t}\n\treturn s.DaysLeftInBillingCycle\n}\n\n// GetEstimatedPaidStorageForMonth returns the EstimatedPaidStorageForMonth field.\nfunc (s *StorageBilling) GetEstimatedPaidStorageForMonth() int {\n\tif s == nil {\n\t\treturn 0\n\t}\n\treturn s.EstimatedPaidStorageForMonth\n}\n\n// GetEstimatedStorageForMonth returns the EstimatedStorageForMonth field.\nfunc (s *StorageBilling) GetEstimatedStorageForMonth() int {\n\tif s == nil {\n\t\treturn 0\n\t}\n\treturn s.EstimatedStorageForMonth\n}\n\n// GetAfterID returns the AfterID field if it's non-nil, zero value otherwise.\nfunc (s *SubIssueRequest) GetAfterID() int64 {\n\tif s == nil || s.AfterID == nil {\n\t\treturn 0\n\t}\n\treturn *s.AfterID\n}\n\n// GetBeforeID returns the BeforeID field if it's non-nil, zero value otherwise.\nfunc (s *SubIssueRequest) GetBeforeID() int64 {\n\tif s == nil || s.BeforeID == nil {\n\t\treturn 0\n\t}\n\treturn *s.BeforeID\n}\n\n// GetReplaceParent returns the ReplaceParent field if it's non-nil, zero value otherwise.\nfunc (s *SubIssueRequest) GetReplaceParent() bool {\n\tif s == nil || s.ReplaceParent == nil {\n\t\treturn false\n\t}\n\treturn *s.ReplaceParent\n}\n\n// GetSubIssueID returns the SubIssueID field.\nfunc (s *SubIssueRequest) GetSubIssueID() int64 {\n\tif s == nil {\n\t\treturn 0\n\t}\n\treturn s.SubIssueID\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (s *Subscription) GetCreatedAt() Timestamp {\n\tif s == nil || s.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *s.CreatedAt\n}\n\n// GetIgnored returns the Ignored field if it's non-nil, zero value otherwise.\nfunc (s *Subscription) GetIgnored() bool {\n\tif s == nil || s.Ignored == nil {\n\t\treturn false\n\t}\n\treturn *s.Ignored\n}\n\n// GetReason returns the Reason field if it's non-nil, zero value otherwise.\nfunc (s *Subscription) GetReason() string {\n\tif s == nil || s.Reason == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Reason\n}\n\n// GetRepositoryURL returns the RepositoryURL field if it's non-nil, zero value otherwise.\nfunc (s *Subscription) GetRepositoryURL() string {\n\tif s == nil || s.RepositoryURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.RepositoryURL\n}\n\n// GetSubscribed returns the Subscribed field if it's non-nil, zero value otherwise.\nfunc (s *Subscription) GetSubscribed() bool {\n\tif s == nil || s.Subscribed == nil {\n\t\treturn false\n\t}\n\treturn *s.Subscribed\n}\n\n// GetThreadURL returns the ThreadURL field if it's non-nil, zero value otherwise.\nfunc (s *Subscription) GetThreadURL() string {\n\tif s == nil || s.ThreadURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.ThreadURL\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (s *Subscription) GetURL() string {\n\tif s == nil || s.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.URL\n}\n\n// GetNodes returns the Nodes slice if it's non-nil, nil otherwise.\nfunc (s *SystemRequirements) GetNodes() []*SystemRequirementsNode {\n\tif s == nil || s.Nodes == nil {\n\t\treturn nil\n\t}\n\treturn s.Nodes\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (s *SystemRequirements) GetStatus() string {\n\tif s == nil || s.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Status\n}\n\n// GetHostname returns the Hostname field if it's non-nil, zero value otherwise.\nfunc (s *SystemRequirementsNode) GetHostname() string {\n\tif s == nil || s.Hostname == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Hostname\n}\n\n// GetRolesStatus returns the RolesStatus slice if it's non-nil, nil otherwise.\nfunc (s *SystemRequirementsNode) GetRolesStatus() []*SystemRequirementsNodeRoleStatus {\n\tif s == nil || s.RolesStatus == nil {\n\t\treturn nil\n\t}\n\treturn s.RolesStatus\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (s *SystemRequirementsNode) GetStatus() string {\n\tif s == nil || s.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Status\n}\n\n// GetRole returns the Role field if it's non-nil, zero value otherwise.\nfunc (s *SystemRequirementsNodeRoleStatus) GetRole() string {\n\tif s == nil || s.Role == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Role\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (s *SystemRequirementsNodeRoleStatus) GetStatus() string {\n\tif s == nil || s.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *s.Status\n}\n\n// GetMessage returns the Message field if it's non-nil, zero value otherwise.\nfunc (t *Tag) GetMessage() string {\n\tif t == nil || t.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Message\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (t *Tag) GetNodeID() string {\n\tif t == nil || t.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.NodeID\n}\n\n// GetObject returns the Object field.\nfunc (t *Tag) GetObject() *GitObject {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Object\n}\n\n// GetSHA returns the SHA field if it's non-nil, zero value otherwise.\nfunc (t *Tag) GetSHA() string {\n\tif t == nil || t.SHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.SHA\n}\n\n// GetTag returns the Tag field if it's non-nil, zero value otherwise.\nfunc (t *Tag) GetTag() string {\n\tif t == nil || t.Tag == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Tag\n}\n\n// GetTagger returns the Tagger field.\nfunc (t *Tag) GetTagger() *CommitAuthor {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Tagger\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (t *Tag) GetURL() string {\n\tif t == nil || t.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.URL\n}\n\n// GetVerification returns the Verification field.\nfunc (t *Tag) GetVerification() *SignatureVerification {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Verification\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (t *TagProtection) GetID() int64 {\n\tif t == nil || t.ID == nil {\n\t\treturn 0\n\t}\n\treturn *t.ID\n}\n\n// GetPattern returns the Pattern field if it's non-nil, zero value otherwise.\nfunc (t *TagProtection) GetPattern() string {\n\tif t == nil || t.Pattern == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Pattern\n}\n\n// GetCompletedAt returns the CompletedAt field if it's non-nil, zero value otherwise.\nfunc (t *TaskStep) GetCompletedAt() Timestamp {\n\tif t == nil || t.CompletedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *t.CompletedAt\n}\n\n// GetConclusion returns the Conclusion field if it's non-nil, zero value otherwise.\nfunc (t *TaskStep) GetConclusion() string {\n\tif t == nil || t.Conclusion == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Conclusion\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (t *TaskStep) GetName() string {\n\tif t == nil || t.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Name\n}\n\n// GetNumber returns the Number field if it's non-nil, zero value otherwise.\nfunc (t *TaskStep) GetNumber() int64 {\n\tif t == nil || t.Number == nil {\n\t\treturn 0\n\t}\n\treturn *t.Number\n}\n\n// GetStartedAt returns the StartedAt field if it's non-nil, zero value otherwise.\nfunc (t *TaskStep) GetStartedAt() Timestamp {\n\tif t == nil || t.StartedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *t.StartedAt\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (t *TaskStep) GetStatus() string {\n\tif t == nil || t.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Status\n}\n\n// GetAssignment returns the Assignment field if it's non-nil, zero value otherwise.\nfunc (t *Team) GetAssignment() string {\n\tif t == nil || t.Assignment == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Assignment\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (t *Team) GetDescription() string {\n\tif t == nil || t.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Description\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (t *Team) GetHTMLURL() string {\n\tif t == nil || t.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (t *Team) GetID() int64 {\n\tif t == nil || t.ID == nil {\n\t\treturn 0\n\t}\n\treturn *t.ID\n}\n\n// GetLDAPDN returns the LDAPDN field if it's non-nil, zero value otherwise.\nfunc (t *Team) GetLDAPDN() string {\n\tif t == nil || t.LDAPDN == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.LDAPDN\n}\n\n// GetMembersCount returns the MembersCount field if it's non-nil, zero value otherwise.\nfunc (t *Team) GetMembersCount() int {\n\tif t == nil || t.MembersCount == nil {\n\t\treturn 0\n\t}\n\treturn *t.MembersCount\n}\n\n// GetMembersURL returns the MembersURL field if it's non-nil, zero value otherwise.\nfunc (t *Team) GetMembersURL() string {\n\tif t == nil || t.MembersURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.MembersURL\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (t *Team) GetName() string {\n\tif t == nil || t.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Name\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (t *Team) GetNodeID() string {\n\tif t == nil || t.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.NodeID\n}\n\n// GetNotificationSetting returns the NotificationSetting field if it's non-nil, zero value otherwise.\nfunc (t *Team) GetNotificationSetting() string {\n\tif t == nil || t.NotificationSetting == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.NotificationSetting\n}\n\n// GetOrganization returns the Organization field.\nfunc (t *Team) GetOrganization() *Organization {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Organization\n}\n\n// GetParent returns the Parent field.\nfunc (t *Team) GetParent() *Team {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Parent\n}\n\n// GetPermission returns the Permission field if it's non-nil, zero value otherwise.\nfunc (t *Team) GetPermission() string {\n\tif t == nil || t.Permission == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Permission\n}\n\n// GetPermissions returns the Permissions map if it's non-nil, an empty map otherwise.\nfunc (t *Team) GetPermissions() map[string]bool {\n\tif t == nil || t.Permissions == nil {\n\t\treturn map[string]bool{}\n\t}\n\treturn t.Permissions\n}\n\n// GetPrivacy returns the Privacy field if it's non-nil, zero value otherwise.\nfunc (t *Team) GetPrivacy() string {\n\tif t == nil || t.Privacy == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Privacy\n}\n\n// GetReposCount returns the ReposCount field if it's non-nil, zero value otherwise.\nfunc (t *Team) GetReposCount() int {\n\tif t == nil || t.ReposCount == nil {\n\t\treturn 0\n\t}\n\treturn *t.ReposCount\n}\n\n// GetRepositoriesURL returns the RepositoriesURL field if it's non-nil, zero value otherwise.\nfunc (t *Team) GetRepositoriesURL() string {\n\tif t == nil || t.RepositoriesURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.RepositoriesURL\n}\n\n// GetSlug returns the Slug field if it's non-nil, zero value otherwise.\nfunc (t *Team) GetSlug() string {\n\tif t == nil || t.Slug == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Slug\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (t *Team) GetType() string {\n\tif t == nil || t.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Type\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (t *Team) GetURL() string {\n\tif t == nil || t.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.URL\n}\n\n// GetInstallation returns the Installation field.\nfunc (t *TeamAddEvent) GetInstallation() *Installation {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (t *TeamAddEvent) GetOrg() *Organization {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Org\n}\n\n// GetRepo returns the Repo field.\nfunc (t *TeamAddEvent) GetRepo() *Repository {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (t *TeamAddEvent) GetSender() *User {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Sender\n}\n\n// GetTeam returns the Team field.\nfunc (t *TeamAddEvent) GetTeam() *Team {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Team\n}\n\n// GetRole returns the Role field.\nfunc (t *TeamAddTeamMembershipOptions) GetRole() string {\n\tif t == nil {\n\t\treturn \"\"\n\t}\n\treturn t.Role\n}\n\n// GetPermission returns the Permission field.\nfunc (t *TeamAddTeamRepoOptions) GetPermission() string {\n\tif t == nil {\n\t\treturn \"\"\n\t}\n\treturn t.Permission\n}\n\n// GetDescription returns the Description field.\nfunc (t *TeamChange) GetDescription() *TeamDescription {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Description\n}\n\n// GetName returns the Name field.\nfunc (t *TeamChange) GetName() *TeamName {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Name\n}\n\n// GetPrivacy returns the Privacy field.\nfunc (t *TeamChange) GetPrivacy() *TeamPrivacy {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Privacy\n}\n\n// GetRepository returns the Repository field.\nfunc (t *TeamChange) GetRepository() *TeamRepository {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Repository\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (t *TeamDescription) GetFrom() string {\n\tif t == nil || t.From == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.From\n}\n\n// GetAuthor returns the Author field.\nfunc (t *TeamDiscussion) GetAuthor() *User {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Author\n}\n\n// GetBody returns the Body field if it's non-nil, zero value otherwise.\nfunc (t *TeamDiscussion) GetBody() string {\n\tif t == nil || t.Body == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Body\n}\n\n// GetBodyHTML returns the BodyHTML field if it's non-nil, zero value otherwise.\nfunc (t *TeamDiscussion) GetBodyHTML() string {\n\tif t == nil || t.BodyHTML == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.BodyHTML\n}\n\n// GetBodyVersion returns the BodyVersion field if it's non-nil, zero value otherwise.\nfunc (t *TeamDiscussion) GetBodyVersion() string {\n\tif t == nil || t.BodyVersion == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.BodyVersion\n}\n\n// GetCommentsCount returns the CommentsCount field if it's non-nil, zero value otherwise.\nfunc (t *TeamDiscussion) GetCommentsCount() int {\n\tif t == nil || t.CommentsCount == nil {\n\t\treturn 0\n\t}\n\treturn *t.CommentsCount\n}\n\n// GetCommentsURL returns the CommentsURL field if it's non-nil, zero value otherwise.\nfunc (t *TeamDiscussion) GetCommentsURL() string {\n\tif t == nil || t.CommentsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.CommentsURL\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (t *TeamDiscussion) GetCreatedAt() Timestamp {\n\tif t == nil || t.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *t.CreatedAt\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (t *TeamDiscussion) GetHTMLURL() string {\n\tif t == nil || t.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.HTMLURL\n}\n\n// GetLastEditedAt returns the LastEditedAt field if it's non-nil, zero value otherwise.\nfunc (t *TeamDiscussion) GetLastEditedAt() Timestamp {\n\tif t == nil || t.LastEditedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *t.LastEditedAt\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (t *TeamDiscussion) GetNodeID() string {\n\tif t == nil || t.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.NodeID\n}\n\n// GetNumber returns the Number field if it's non-nil, zero value otherwise.\nfunc (t *TeamDiscussion) GetNumber() int {\n\tif t == nil || t.Number == nil {\n\t\treturn 0\n\t}\n\treturn *t.Number\n}\n\n// GetPinned returns the Pinned field if it's non-nil, zero value otherwise.\nfunc (t *TeamDiscussion) GetPinned() bool {\n\tif t == nil || t.Pinned == nil {\n\t\treturn false\n\t}\n\treturn *t.Pinned\n}\n\n// GetPrivate returns the Private field if it's non-nil, zero value otherwise.\nfunc (t *TeamDiscussion) GetPrivate() bool {\n\tif t == nil || t.Private == nil {\n\t\treturn false\n\t}\n\treturn *t.Private\n}\n\n// GetReactions returns the Reactions field.\nfunc (t *TeamDiscussion) GetReactions() *Reactions {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Reactions\n}\n\n// GetTeamURL returns the TeamURL field if it's non-nil, zero value otherwise.\nfunc (t *TeamDiscussion) GetTeamURL() string {\n\tif t == nil || t.TeamURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.TeamURL\n}\n\n// GetTitle returns the Title field if it's non-nil, zero value otherwise.\nfunc (t *TeamDiscussion) GetTitle() string {\n\tif t == nil || t.Title == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Title\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (t *TeamDiscussion) GetUpdatedAt() Timestamp {\n\tif t == nil || t.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *t.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (t *TeamDiscussion) GetURL() string {\n\tif t == nil || t.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.URL\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (t *TeamEvent) GetAction() string {\n\tif t == nil || t.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Action\n}\n\n// GetChanges returns the Changes field.\nfunc (t *TeamEvent) GetChanges() *TeamChange {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Changes\n}\n\n// GetInstallation returns the Installation field.\nfunc (t *TeamEvent) GetInstallation() *Installation {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (t *TeamEvent) GetOrg() *Organization {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Org\n}\n\n// GetRepo returns the Repo field.\nfunc (t *TeamEvent) GetRepo() *Repository {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (t *TeamEvent) GetSender() *User {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Sender\n}\n\n// GetTeam returns the Team field.\nfunc (t *TeamEvent) GetTeam() *Team {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Team\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (t *TeamLDAPMapping) GetDescription() string {\n\tif t == nil || t.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Description\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (t *TeamLDAPMapping) GetID() int64 {\n\tif t == nil || t.ID == nil {\n\t\treturn 0\n\t}\n\treturn *t.ID\n}\n\n// GetLDAPDN returns the LDAPDN field if it's non-nil, zero value otherwise.\nfunc (t *TeamLDAPMapping) GetLDAPDN() string {\n\tif t == nil || t.LDAPDN == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.LDAPDN\n}\n\n// GetMembersURL returns the MembersURL field if it's non-nil, zero value otherwise.\nfunc (t *TeamLDAPMapping) GetMembersURL() string {\n\tif t == nil || t.MembersURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.MembersURL\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (t *TeamLDAPMapping) GetName() string {\n\tif t == nil || t.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Name\n}\n\n// GetPermission returns the Permission field if it's non-nil, zero value otherwise.\nfunc (t *TeamLDAPMapping) GetPermission() string {\n\tif t == nil || t.Permission == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Permission\n}\n\n// GetPrivacy returns the Privacy field if it's non-nil, zero value otherwise.\nfunc (t *TeamLDAPMapping) GetPrivacy() string {\n\tif t == nil || t.Privacy == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Privacy\n}\n\n// GetRepositoriesURL returns the RepositoriesURL field if it's non-nil, zero value otherwise.\nfunc (t *TeamLDAPMapping) GetRepositoriesURL() string {\n\tif t == nil || t.RepositoriesURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.RepositoriesURL\n}\n\n// GetSlug returns the Slug field if it's non-nil, zero value otherwise.\nfunc (t *TeamLDAPMapping) GetSlug() string {\n\tif t == nil || t.Slug == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Slug\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (t *TeamLDAPMapping) GetURL() string {\n\tif t == nil || t.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.URL\n}\n\n// GetRole returns the Role field.\nfunc (t *TeamListTeamMembersOptions) GetRole() string {\n\tif t == nil {\n\t\treturn \"\"\n\t}\n\treturn t.Role\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (t *TeamName) GetFrom() string {\n\tif t == nil || t.From == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.From\n}\n\n// GetFrom returns the From field.\nfunc (t *TeamPermissions) GetFrom() *TeamPermissionsFrom {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.From\n}\n\n// GetAdmin returns the Admin field if it's non-nil, zero value otherwise.\nfunc (t *TeamPermissionsFrom) GetAdmin() bool {\n\tif t == nil || t.Admin == nil {\n\t\treturn false\n\t}\n\treturn *t.Admin\n}\n\n// GetPull returns the Pull field if it's non-nil, zero value otherwise.\nfunc (t *TeamPermissionsFrom) GetPull() bool {\n\tif t == nil || t.Pull == nil {\n\t\treturn false\n\t}\n\treturn *t.Pull\n}\n\n// GetPush returns the Push field if it's non-nil, zero value otherwise.\nfunc (t *TeamPermissionsFrom) GetPush() bool {\n\tif t == nil || t.Push == nil {\n\t\treturn false\n\t}\n\treturn *t.Push\n}\n\n// GetFrom returns the From field if it's non-nil, zero value otherwise.\nfunc (t *TeamPrivacy) GetFrom() string {\n\tif t == nil || t.From == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.From\n}\n\n// GetPermission returns the Permission field if it's non-nil, zero value otherwise.\nfunc (t *TeamProjectOptions) GetPermission() string {\n\tif t == nil || t.Permission == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Permission\n}\n\n// GetPermissions returns the Permissions field.\nfunc (t *TeamRepository) GetPermissions() *TeamPermissions {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Permissions\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (t *TemplateRepoRequest) GetDescription() string {\n\tif t == nil || t.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Description\n}\n\n// GetIncludeAllBranches returns the IncludeAllBranches field if it's non-nil, zero value otherwise.\nfunc (t *TemplateRepoRequest) GetIncludeAllBranches() bool {\n\tif t == nil || t.IncludeAllBranches == nil {\n\t\treturn false\n\t}\n\treturn *t.IncludeAllBranches\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (t *TemplateRepoRequest) GetName() string {\n\tif t == nil || t.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Name\n}\n\n// GetOwner returns the Owner field if it's non-nil, zero value otherwise.\nfunc (t *TemplateRepoRequest) GetOwner() string {\n\tif t == nil || t.Owner == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Owner\n}\n\n// GetPrivate returns the Private field if it's non-nil, zero value otherwise.\nfunc (t *TemplateRepoRequest) GetPrivate() bool {\n\tif t == nil || t.Private == nil {\n\t\treturn false\n\t}\n\treturn *t.Private\n}\n\n// GetFragment returns the Fragment field if it's non-nil, zero value otherwise.\nfunc (t *TextMatch) GetFragment() string {\n\tif t == nil || t.Fragment == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Fragment\n}\n\n// GetMatches returns the Matches slice if it's non-nil, nil otherwise.\nfunc (t *TextMatch) GetMatches() []*Match {\n\tif t == nil || t.Matches == nil {\n\t\treturn nil\n\t}\n\treturn t.Matches\n}\n\n// GetObjectType returns the ObjectType field if it's non-nil, zero value otherwise.\nfunc (t *TextMatch) GetObjectType() string {\n\tif t == nil || t.ObjectType == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.ObjectType\n}\n\n// GetObjectURL returns the ObjectURL field if it's non-nil, zero value otherwise.\nfunc (t *TextMatch) GetObjectURL() string {\n\tif t == nil || t.ObjectURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.ObjectURL\n}\n\n// GetProperty returns the Property field if it's non-nil, zero value otherwise.\nfunc (t *TextMatch) GetProperty() string {\n\tif t == nil || t.Property == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Property\n}\n\n// GetActor returns the Actor field.\nfunc (t *Timeline) GetActor() *User {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Actor\n}\n\n// GetAssignee returns the Assignee field.\nfunc (t *Timeline) GetAssignee() *User {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Assignee\n}\n\n// GetAssigner returns the Assigner field.\nfunc (t *Timeline) GetAssigner() *User {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Assigner\n}\n\n// GetAuthor returns the Author field.\nfunc (t *Timeline) GetAuthor() *CommitAuthor {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Author\n}\n\n// GetBody returns the Body field if it's non-nil, zero value otherwise.\nfunc (t *Timeline) GetBody() string {\n\tif t == nil || t.Body == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Body\n}\n\n// GetCommitID returns the CommitID field if it's non-nil, zero value otherwise.\nfunc (t *Timeline) GetCommitID() string {\n\tif t == nil || t.CommitID == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.CommitID\n}\n\n// GetCommitter returns the Committer field.\nfunc (t *Timeline) GetCommitter() *CommitAuthor {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Committer\n}\n\n// GetCommitURL returns the CommitURL field if it's non-nil, zero value otherwise.\nfunc (t *Timeline) GetCommitURL() string {\n\tif t == nil || t.CommitURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.CommitURL\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (t *Timeline) GetCreatedAt() Timestamp {\n\tif t == nil || t.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *t.CreatedAt\n}\n\n// GetEvent returns the Event field if it's non-nil, zero value otherwise.\nfunc (t *Timeline) GetEvent() string {\n\tif t == nil || t.Event == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Event\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (t *Timeline) GetID() int64 {\n\tif t == nil || t.ID == nil {\n\t\treturn 0\n\t}\n\treturn *t.ID\n}\n\n// GetLabel returns the Label field.\nfunc (t *Timeline) GetLabel() *Label {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Label\n}\n\n// GetMessage returns the Message field if it's non-nil, zero value otherwise.\nfunc (t *Timeline) GetMessage() string {\n\tif t == nil || t.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Message\n}\n\n// GetMilestone returns the Milestone field.\nfunc (t *Timeline) GetMilestone() *Milestone {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Milestone\n}\n\n// GetParents returns the Parents slice if it's non-nil, nil otherwise.\nfunc (t *Timeline) GetParents() []*Commit {\n\tif t == nil || t.Parents == nil {\n\t\treturn nil\n\t}\n\treturn t.Parents\n}\n\n// GetPerformedViaGithubApp returns the PerformedViaGithubApp field.\nfunc (t *Timeline) GetPerformedViaGithubApp() *App {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.PerformedViaGithubApp\n}\n\n// GetRename returns the Rename field.\nfunc (t *Timeline) GetRename() *Rename {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Rename\n}\n\n// GetRequestedTeam returns the RequestedTeam field.\nfunc (t *Timeline) GetRequestedTeam() *Team {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.RequestedTeam\n}\n\n// GetRequester returns the Requester field.\nfunc (t *Timeline) GetRequester() *User {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Requester\n}\n\n// GetReviewer returns the Reviewer field.\nfunc (t *Timeline) GetReviewer() *User {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Reviewer\n}\n\n// GetSHA returns the SHA field if it's non-nil, zero value otherwise.\nfunc (t *Timeline) GetSHA() string {\n\tif t == nil || t.SHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.SHA\n}\n\n// GetSource returns the Source field.\nfunc (t *Timeline) GetSource() *Source {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.Source\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (t *Timeline) GetState() string {\n\tif t == nil || t.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.State\n}\n\n// GetSubmittedAt returns the SubmittedAt field if it's non-nil, zero value otherwise.\nfunc (t *Timeline) GetSubmittedAt() Timestamp {\n\tif t == nil || t.SubmittedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *t.SubmittedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (t *Timeline) GetURL() string {\n\tif t == nil || t.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.URL\n}\n\n// GetUser returns the User field.\nfunc (t *Timeline) GetUser() *User {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn t.User\n}\n\n// GetGUID returns the GUID field if it's non-nil, zero value otherwise.\nfunc (t *Tool) GetGUID() string {\n\tif t == nil || t.GUID == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.GUID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (t *Tool) GetName() string {\n\tif t == nil || t.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Name\n}\n\n// GetVersion returns the Version field if it's non-nil, zero value otherwise.\nfunc (t *Tool) GetVersion() string {\n\tif t == nil || t.Version == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Version\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (t *TopicResult) GetCreatedAt() Timestamp {\n\tif t == nil || t.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *t.CreatedAt\n}\n\n// GetCreatedBy returns the CreatedBy field if it's non-nil, zero value otherwise.\nfunc (t *TopicResult) GetCreatedBy() string {\n\tif t == nil || t.CreatedBy == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.CreatedBy\n}\n\n// GetCurated returns the Curated field if it's non-nil, zero value otherwise.\nfunc (t *TopicResult) GetCurated() bool {\n\tif t == nil || t.Curated == nil {\n\t\treturn false\n\t}\n\treturn *t.Curated\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (t *TopicResult) GetDescription() string {\n\tif t == nil || t.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Description\n}\n\n// GetDisplayName returns the DisplayName field if it's non-nil, zero value otherwise.\nfunc (t *TopicResult) GetDisplayName() string {\n\tif t == nil || t.DisplayName == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.DisplayName\n}\n\n// GetFeatured returns the Featured field if it's non-nil, zero value otherwise.\nfunc (t *TopicResult) GetFeatured() bool {\n\tif t == nil || t.Featured == nil {\n\t\treturn false\n\t}\n\treturn *t.Featured\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (t *TopicResult) GetName() string {\n\tif t == nil || t.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Name\n}\n\n// GetScore returns the Score field if it's non-nil, zero value otherwise.\nfunc (t *TopicResult) GetScore() float64 {\n\tif t == nil || t.Score == nil {\n\t\treturn 0\n\t}\n\treturn *t.Score\n}\n\n// GetShortDescription returns the ShortDescription field if it's non-nil, zero value otherwise.\nfunc (t *TopicResult) GetShortDescription() string {\n\tif t == nil || t.ShortDescription == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.ShortDescription\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (t *TopicResult) GetUpdatedAt() string {\n\tif t == nil || t.UpdatedAt == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.UpdatedAt\n}\n\n// GetIncompleteResults returns the IncompleteResults field if it's non-nil, zero value otherwise.\nfunc (t *TopicsSearchResult) GetIncompleteResults() bool {\n\tif t == nil || t.IncompleteResults == nil {\n\t\treturn false\n\t}\n\treturn *t.IncompleteResults\n}\n\n// GetTopics returns the Topics slice if it's non-nil, nil otherwise.\nfunc (t *TopicsSearchResult) GetTopics() []*TopicResult {\n\tif t == nil || t.Topics == nil {\n\t\treturn nil\n\t}\n\treturn t.Topics\n}\n\n// GetTotal returns the Total field if it's non-nil, zero value otherwise.\nfunc (t *TopicsSearchResult) GetTotal() int {\n\tif t == nil || t.Total == nil {\n\t\treturn 0\n\t}\n\treturn *t.Total\n}\n\n// GetTotalActiveCachesCount returns the TotalActiveCachesCount field.\nfunc (t *TotalCacheUsage) GetTotalActiveCachesCount() int {\n\tif t == nil {\n\t\treturn 0\n\t}\n\treturn t.TotalActiveCachesCount\n}\n\n// GetTotalActiveCachesUsageSizeInBytes returns the TotalActiveCachesUsageSizeInBytes field.\nfunc (t *TotalCacheUsage) GetTotalActiveCachesUsageSizeInBytes() int64 {\n\tif t == nil {\n\t\treturn 0\n\t}\n\treturn t.TotalActiveCachesUsageSizeInBytes\n}\n\n// GetPer returns the Per field.\nfunc (t *TrafficBreakdownOptions) GetPer() string {\n\tif t == nil {\n\t\treturn \"\"\n\t}\n\treturn t.Per\n}\n\n// GetClones returns the Clones slice if it's non-nil, nil otherwise.\nfunc (t *TrafficClones) GetClones() []*TrafficData {\n\tif t == nil || t.Clones == nil {\n\t\treturn nil\n\t}\n\treturn t.Clones\n}\n\n// GetCount returns the Count field if it's non-nil, zero value otherwise.\nfunc (t *TrafficClones) GetCount() int {\n\tif t == nil || t.Count == nil {\n\t\treturn 0\n\t}\n\treturn *t.Count\n}\n\n// GetUniques returns the Uniques field if it's non-nil, zero value otherwise.\nfunc (t *TrafficClones) GetUniques() int {\n\tif t == nil || t.Uniques == nil {\n\t\treturn 0\n\t}\n\treturn *t.Uniques\n}\n\n// GetCount returns the Count field if it's non-nil, zero value otherwise.\nfunc (t *TrafficData) GetCount() int {\n\tif t == nil || t.Count == nil {\n\t\treturn 0\n\t}\n\treturn *t.Count\n}\n\n// GetTimestamp returns the Timestamp field if it's non-nil, zero value otherwise.\nfunc (t *TrafficData) GetTimestamp() Timestamp {\n\tif t == nil || t.Timestamp == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *t.Timestamp\n}\n\n// GetUniques returns the Uniques field if it's non-nil, zero value otherwise.\nfunc (t *TrafficData) GetUniques() int {\n\tif t == nil || t.Uniques == nil {\n\t\treturn 0\n\t}\n\treturn *t.Uniques\n}\n\n// GetCount returns the Count field if it's non-nil, zero value otherwise.\nfunc (t *TrafficPath) GetCount() int {\n\tif t == nil || t.Count == nil {\n\t\treturn 0\n\t}\n\treturn *t.Count\n}\n\n// GetPath returns the Path field if it's non-nil, zero value otherwise.\nfunc (t *TrafficPath) GetPath() string {\n\tif t == nil || t.Path == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Path\n}\n\n// GetTitle returns the Title field if it's non-nil, zero value otherwise.\nfunc (t *TrafficPath) GetTitle() string {\n\tif t == nil || t.Title == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Title\n}\n\n// GetUniques returns the Uniques field if it's non-nil, zero value otherwise.\nfunc (t *TrafficPath) GetUniques() int {\n\tif t == nil || t.Uniques == nil {\n\t\treturn 0\n\t}\n\treturn *t.Uniques\n}\n\n// GetCount returns the Count field if it's non-nil, zero value otherwise.\nfunc (t *TrafficReferrer) GetCount() int {\n\tif t == nil || t.Count == nil {\n\t\treturn 0\n\t}\n\treturn *t.Count\n}\n\n// GetReferrer returns the Referrer field if it's non-nil, zero value otherwise.\nfunc (t *TrafficReferrer) GetReferrer() string {\n\tif t == nil || t.Referrer == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Referrer\n}\n\n// GetUniques returns the Uniques field if it's non-nil, zero value otherwise.\nfunc (t *TrafficReferrer) GetUniques() int {\n\tif t == nil || t.Uniques == nil {\n\t\treturn 0\n\t}\n\treturn *t.Uniques\n}\n\n// GetCount returns the Count field if it's non-nil, zero value otherwise.\nfunc (t *TrafficViews) GetCount() int {\n\tif t == nil || t.Count == nil {\n\t\treturn 0\n\t}\n\treturn *t.Count\n}\n\n// GetUniques returns the Uniques field if it's non-nil, zero value otherwise.\nfunc (t *TrafficViews) GetUniques() int {\n\tif t == nil || t.Uniques == nil {\n\t\treturn 0\n\t}\n\treturn *t.Uniques\n}\n\n// GetViews returns the Views slice if it's non-nil, nil otherwise.\nfunc (t *TrafficViews) GetViews() []*TrafficData {\n\tif t == nil || t.Views == nil {\n\t\treturn nil\n\t}\n\treturn t.Views\n}\n\n// GetNewName returns the NewName field if it's non-nil, zero value otherwise.\nfunc (t *TransferRequest) GetNewName() string {\n\tif t == nil || t.NewName == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.NewName\n}\n\n// GetNewOwner returns the NewOwner field.\nfunc (t *TransferRequest) GetNewOwner() string {\n\tif t == nil {\n\t\treturn \"\"\n\t}\n\treturn t.NewOwner\n}\n\n// GetTeamID returns the TeamID slice if it's non-nil, nil otherwise.\nfunc (t *TransferRequest) GetTeamID() []int64 {\n\tif t == nil || t.TeamID == nil {\n\t\treturn nil\n\t}\n\treturn t.TeamID\n}\n\n// GetEntries returns the Entries slice if it's non-nil, nil otherwise.\nfunc (t *Tree) GetEntries() []*TreeEntry {\n\tif t == nil || t.Entries == nil {\n\t\treturn nil\n\t}\n\treturn t.Entries\n}\n\n// GetSHA returns the SHA field if it's non-nil, zero value otherwise.\nfunc (t *Tree) GetSHA() string {\n\tif t == nil || t.SHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.SHA\n}\n\n// GetTruncated returns the Truncated field if it's non-nil, zero value otherwise.\nfunc (t *Tree) GetTruncated() bool {\n\tif t == nil || t.Truncated == nil {\n\t\treturn false\n\t}\n\treturn *t.Truncated\n}\n\n// GetContent returns the Content field if it's non-nil, zero value otherwise.\nfunc (t *TreeEntry) GetContent() string {\n\tif t == nil || t.Content == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Content\n}\n\n// GetMode returns the Mode field if it's non-nil, zero value otherwise.\nfunc (t *TreeEntry) GetMode() string {\n\tif t == nil || t.Mode == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Mode\n}\n\n// GetPath returns the Path field if it's non-nil, zero value otherwise.\nfunc (t *TreeEntry) GetPath() string {\n\tif t == nil || t.Path == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Path\n}\n\n// GetSHA returns the SHA field if it's non-nil, zero value otherwise.\nfunc (t *TreeEntry) GetSHA() string {\n\tif t == nil || t.SHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.SHA\n}\n\n// GetSize returns the Size field if it's non-nil, zero value otherwise.\nfunc (t *TreeEntry) GetSize() int {\n\tif t == nil || t.Size == nil {\n\t\treturn 0\n\t}\n\treturn *t.Size\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (t *TreeEntry) GetType() string {\n\tif t == nil || t.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.Type\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (t *TreeEntry) GetURL() string {\n\tif t == nil || t.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *t.URL\n}\n\n// GetClientID returns the ClientID field.\nfunc (u *UnauthenticatedRateLimitedTransport) GetClientID() string {\n\tif u == nil {\n\t\treturn \"\"\n\t}\n\treturn u.ClientID\n}\n\n// GetClientSecret returns the ClientSecret field.\nfunc (u *UnauthenticatedRateLimitedTransport) GetClientSecret() string {\n\tif u == nil {\n\t\treturn \"\"\n\t}\n\treturn u.ClientSecret\n}\n\n// GetRepositorySelection returns the RepositorySelection field if it's non-nil, zero value otherwise.\nfunc (u *UpdateAppInstallationRepositoriesOptions) GetRepositorySelection() string {\n\tif u == nil || u.RepositorySelection == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.RepositorySelection\n}\n\n// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs slice if it's non-nil, nil otherwise.\nfunc (u *UpdateAppInstallationRepositoriesOptions) GetSelectedRepositoryIDs() []int64 {\n\tif u == nil || u.SelectedRepositoryIDs == nil {\n\t\treturn nil\n\t}\n\treturn u.SelectedRepositoryIDs\n}\n\n// GetOp returns the Op field.\nfunc (u *UpdateAttributeForSCIMUserOperations) GetOp() string {\n\tif u == nil {\n\t\treturn \"\"\n\t}\n\treturn u.Op\n}\n\n// GetPath returns the Path field if it's non-nil, zero value otherwise.\nfunc (u *UpdateAttributeForSCIMUserOperations) GetPath() string {\n\tif u == nil || u.Path == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Path\n}\n\n// GetValue returns the Value field.\nfunc (u *UpdateAttributeForSCIMUserOperations) GetValue() json.RawMessage {\n\tif u == nil {\n\t\treturn json.RawMessage{}\n\t}\n\treturn u.Value\n}\n\n// GetOperations returns the Operations field.\nfunc (u *UpdateAttributeForSCIMUserOptions) GetOperations() UpdateAttributeForSCIMUserOperations {\n\tif u == nil {\n\t\treturn UpdateAttributeForSCIMUserOperations{}\n\t}\n\treturn u.Operations\n}\n\n// GetSchemas returns the Schemas slice if it's non-nil, nil otherwise.\nfunc (u *UpdateAttributeForSCIMUserOptions) GetSchemas() []string {\n\tif u == nil || u.Schemas == nil {\n\t\treturn nil\n\t}\n\treturn u.Schemas\n}\n\n// GetParameters returns the Parameters field.\nfunc (u *UpdateBranchRule) GetParameters() UpdateRuleParameters {\n\tif u == nil {\n\t\treturn UpdateRuleParameters{}\n\t}\n\treturn u.Parameters\n}\n\n// GetActions returns the Actions slice if it's non-nil, nil otherwise.\nfunc (u *UpdateCheckRunOptions) GetActions() []*CheckRunAction {\n\tif u == nil || u.Actions == nil {\n\t\treturn nil\n\t}\n\treturn u.Actions\n}\n\n// GetCompletedAt returns the CompletedAt field if it's non-nil, zero value otherwise.\nfunc (u *UpdateCheckRunOptions) GetCompletedAt() Timestamp {\n\tif u == nil || u.CompletedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *u.CompletedAt\n}\n\n// GetConclusion returns the Conclusion field if it's non-nil, zero value otherwise.\nfunc (u *UpdateCheckRunOptions) GetConclusion() string {\n\tif u == nil || u.Conclusion == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Conclusion\n}\n\n// GetDetailsURL returns the DetailsURL field if it's non-nil, zero value otherwise.\nfunc (u *UpdateCheckRunOptions) GetDetailsURL() string {\n\tif u == nil || u.DetailsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.DetailsURL\n}\n\n// GetExternalID returns the ExternalID field if it's non-nil, zero value otherwise.\nfunc (u *UpdateCheckRunOptions) GetExternalID() string {\n\tif u == nil || u.ExternalID == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.ExternalID\n}\n\n// GetName returns the Name field.\nfunc (u *UpdateCheckRunOptions) GetName() string {\n\tif u == nil {\n\t\treturn \"\"\n\t}\n\treturn u.Name\n}\n\n// GetOutput returns the Output field.\nfunc (u *UpdateCheckRunOptions) GetOutput() *CheckRunOutput {\n\tif u == nil {\n\t\treturn nil\n\t}\n\treturn u.Output\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (u *UpdateCheckRunOptions) GetStatus() string {\n\tif u == nil || u.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Status\n}\n\n// GetMachine returns the Machine field if it's non-nil, zero value otherwise.\nfunc (u *UpdateCodespaceOptions) GetMachine() string {\n\tif u == nil || u.Machine == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Machine\n}\n\n// GetRecentFolders returns the RecentFolders slice if it's non-nil, nil otherwise.\nfunc (u *UpdateCodespaceOptions) GetRecentFolders() []string {\n\tif u == nil || u.RecentFolders == nil {\n\t\treturn nil\n\t}\n\treturn u.RecentFolders\n}\n\n// GetBaseRole returns the BaseRole field if it's non-nil, zero value otherwise.\nfunc (u *UpdateCustomOrgRoleRequest) GetBaseRole() string {\n\tif u == nil || u.BaseRole == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.BaseRole\n}\n\n// GetDescription returns the Description field if it's non-nil, zero value otherwise.\nfunc (u *UpdateCustomOrgRoleRequest) GetDescription() string {\n\tif u == nil || u.Description == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Description\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (u *UpdateCustomOrgRoleRequest) GetName() string {\n\tif u == nil || u.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Name\n}\n\n// GetPermissions returns the Permissions slice if it's non-nil, nil otherwise.\nfunc (u *UpdateCustomOrgRoleRequest) GetPermissions() []string {\n\tif u == nil || u.Permissions == nil {\n\t\treturn nil\n\t}\n\treturn u.Permissions\n}\n\n// GetLanguages returns the Languages slice if it's non-nil, nil otherwise.\nfunc (u *UpdateDefaultSetupConfigurationOptions) GetLanguages() []string {\n\tif u == nil || u.Languages == nil {\n\t\treturn nil\n\t}\n\treturn u.Languages\n}\n\n// GetQuerySuite returns the QuerySuite field if it's non-nil, zero value otherwise.\nfunc (u *UpdateDefaultSetupConfigurationOptions) GetQuerySuite() string {\n\tif u == nil || u.QuerySuite == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.QuerySuite\n}\n\n// GetState returns the State field.\nfunc (u *UpdateDefaultSetupConfigurationOptions) GetState() string {\n\tif u == nil {\n\t\treturn \"\"\n\t}\n\treturn u.State\n}\n\n// GetRunID returns the RunID field if it's non-nil, zero value otherwise.\nfunc (u *UpdateDefaultSetupConfigurationResponse) GetRunID() int64 {\n\tif u == nil || u.RunID == nil {\n\t\treturn 0\n\t}\n\treturn *u.RunID\n}\n\n// GetRunURL returns the RunURL field if it's non-nil, zero value otherwise.\nfunc (u *UpdateDefaultSetupConfigurationResponse) GetRunURL() string {\n\tif u == nil || u.RunURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.RunURL\n}\n\n// GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise.\nfunc (u *UpdateEnterpriseRunnerGroupRequest) GetAllowsPublicRepositories() bool {\n\tif u == nil || u.AllowsPublicRepositories == nil {\n\t\treturn false\n\t}\n\treturn *u.AllowsPublicRepositories\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (u *UpdateEnterpriseRunnerGroupRequest) GetName() string {\n\tif u == nil || u.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Name\n}\n\n// GetNetworkConfigurationID returns the NetworkConfigurationID field if it's non-nil, zero value otherwise.\nfunc (u *UpdateEnterpriseRunnerGroupRequest) GetNetworkConfigurationID() string {\n\tif u == nil || u.NetworkConfigurationID == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.NetworkConfigurationID\n}\n\n// GetRestrictedToWorkflows returns the RestrictedToWorkflows field if it's non-nil, zero value otherwise.\nfunc (u *UpdateEnterpriseRunnerGroupRequest) GetRestrictedToWorkflows() bool {\n\tif u == nil || u.RestrictedToWorkflows == nil {\n\t\treturn false\n\t}\n\treturn *u.RestrictedToWorkflows\n}\n\n// GetSelectedWorkflows returns the SelectedWorkflows slice if it's non-nil, nil otherwise.\nfunc (u *UpdateEnterpriseRunnerGroupRequest) GetSelectedWorkflows() []string {\n\tif u == nil || u.SelectedWorkflows == nil {\n\t\treturn nil\n\t}\n\treturn u.SelectedWorkflows\n}\n\n// GetVisibility returns the Visibility field if it's non-nil, zero value otherwise.\nfunc (u *UpdateEnterpriseRunnerGroupRequest) GetVisibility() string {\n\tif u == nil || u.Visibility == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Visibility\n}\n\n// GetEnableStaticIP returns the EnableStaticIP field if it's non-nil, zero value otherwise.\nfunc (u *UpdateHostedRunnerRequest) GetEnableStaticIP() bool {\n\tif u == nil || u.EnableStaticIP == nil {\n\t\treturn false\n\t}\n\treturn *u.EnableStaticIP\n}\n\n// GetImageID returns the ImageID field if it's non-nil, zero value otherwise.\nfunc (u *UpdateHostedRunnerRequest) GetImageID() string {\n\tif u == nil || u.ImageID == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.ImageID\n}\n\n// GetImageVersion returns the ImageVersion field if it's non-nil, zero value otherwise.\nfunc (u *UpdateHostedRunnerRequest) GetImageVersion() string {\n\tif u == nil || u.ImageVersion == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.ImageVersion\n}\n\n// GetMaximumRunners returns the MaximumRunners field if it's non-nil, zero value otherwise.\nfunc (u *UpdateHostedRunnerRequest) GetMaximumRunners() int64 {\n\tif u == nil || u.MaximumRunners == nil {\n\t\treturn 0\n\t}\n\treturn *u.MaximumRunners\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (u *UpdateHostedRunnerRequest) GetName() string {\n\tif u == nil || u.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Name\n}\n\n// GetRunnerGroupID returns the RunnerGroupID field if it's non-nil, zero value otherwise.\nfunc (u *UpdateHostedRunnerRequest) GetRunnerGroupID() int64 {\n\tif u == nil || u.RunnerGroupID == nil {\n\t\treturn 0\n\t}\n\treturn *u.RunnerGroupID\n}\n\n// GetSize returns the Size field if it's non-nil, zero value otherwise.\nfunc (u *UpdateHostedRunnerRequest) GetSize() string {\n\tif u == nil || u.Size == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Size\n}\n\n// GetEncryptedValue returns the EncryptedValue field if it's non-nil, zero value otherwise.\nfunc (u *UpdateOrganizationPrivateRegistry) GetEncryptedValue() string {\n\tif u == nil || u.EncryptedValue == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.EncryptedValue\n}\n\n// GetKeyID returns the KeyID field if it's non-nil, zero value otherwise.\nfunc (u *UpdateOrganizationPrivateRegistry) GetKeyID() string {\n\tif u == nil || u.KeyID == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.KeyID\n}\n\n// GetRegistryType returns the RegistryType field if it's non-nil, zero value otherwise.\nfunc (u *UpdateOrganizationPrivateRegistry) GetRegistryType() string {\n\tif u == nil || u.RegistryType == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.RegistryType\n}\n\n// GetSelectedRepositoryIDs returns the SelectedRepositoryIDs slice if it's non-nil, nil otherwise.\nfunc (u *UpdateOrganizationPrivateRegistry) GetSelectedRepositoryIDs() []int64 {\n\tif u == nil || u.SelectedRepositoryIDs == nil {\n\t\treturn nil\n\t}\n\treturn u.SelectedRepositoryIDs\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (u *UpdateOrganizationPrivateRegistry) GetURL() string {\n\tif u == nil || u.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.URL\n}\n\n// GetUsername returns the Username field if it's non-nil, zero value otherwise.\nfunc (u *UpdateOrganizationPrivateRegistry) GetUsername() string {\n\tif u == nil || u.Username == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Username\n}\n\n// GetVisibility returns the Visibility field.\nfunc (u *UpdateOrganizationPrivateRegistry) GetVisibility() *PrivateRegistryVisibility {\n\tif u == nil {\n\t\treturn nil\n\t}\n\treturn u.Visibility\n}\n\n// GetArchived returns the Archived field if it's non-nil, zero value otherwise.\nfunc (u *UpdateProjectItemOptions) GetArchived() bool {\n\tif u == nil || u.Archived == nil {\n\t\treturn false\n\t}\n\treturn *u.Archived\n}\n\n// GetFields returns the Fields slice if it's non-nil, nil otherwise.\nfunc (u *UpdateProjectItemOptions) GetFields() []*UpdateProjectV2Field {\n\tif u == nil || u.Fields == nil {\n\t\treturn nil\n\t}\n\treturn u.Fields\n}\n\n// GetID returns the ID field.\nfunc (u *UpdateProjectV2Field) GetID() int64 {\n\tif u == nil {\n\t\treturn 0\n\t}\n\treturn u.ID\n}\n\n// GetValue returns the Value field.\nfunc (u *UpdateProjectV2Field) GetValue() any {\n\tif u == nil {\n\t\treturn nil\n\t}\n\treturn u.Value\n}\n\n// GetForce returns the Force field if it's non-nil, zero value otherwise.\nfunc (u *UpdateRef) GetForce() bool {\n\tif u == nil || u.Force == nil {\n\t\treturn false\n\t}\n\treturn *u.Force\n}\n\n// GetSHA returns the SHA field.\nfunc (u *UpdateRef) GetSHA() string {\n\tif u == nil {\n\t\treturn \"\"\n\t}\n\treturn u.SHA\n}\n\n// GetUpdateAllowsFetchAndMerge returns the UpdateAllowsFetchAndMerge field.\nfunc (u *UpdateRuleParameters) GetUpdateAllowsFetchAndMerge() bool {\n\tif u == nil {\n\t\treturn false\n\t}\n\treturn u.UpdateAllowsFetchAndMerge\n}\n\n// GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise.\nfunc (u *UpdateRunnerGroupRequest) GetAllowsPublicRepositories() bool {\n\tif u == nil || u.AllowsPublicRepositories == nil {\n\t\treturn false\n\t}\n\treturn *u.AllowsPublicRepositories\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (u *UpdateRunnerGroupRequest) GetName() string {\n\tif u == nil || u.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Name\n}\n\n// GetNetworkConfigurationID returns the NetworkConfigurationID field if it's non-nil, zero value otherwise.\nfunc (u *UpdateRunnerGroupRequest) GetNetworkConfigurationID() string {\n\tif u == nil || u.NetworkConfigurationID == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.NetworkConfigurationID\n}\n\n// GetRestrictedToWorkflows returns the RestrictedToWorkflows field if it's non-nil, zero value otherwise.\nfunc (u *UpdateRunnerGroupRequest) GetRestrictedToWorkflows() bool {\n\tif u == nil || u.RestrictedToWorkflows == nil {\n\t\treturn false\n\t}\n\treturn *u.RestrictedToWorkflows\n}\n\n// GetSelectedWorkflows returns the SelectedWorkflows slice if it's non-nil, nil otherwise.\nfunc (u *UpdateRunnerGroupRequest) GetSelectedWorkflows() []string {\n\tif u == nil || u.SelectedWorkflows == nil {\n\t\treturn nil\n\t}\n\treturn u.SelectedWorkflows\n}\n\n// GetVisibility returns the Visibility field if it's non-nil, zero value otherwise.\nfunc (u *UpdateRunnerGroupRequest) GetVisibility() string {\n\tif u == nil || u.Visibility == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Visibility\n}\n\n// GetLicense returns the License field.\nfunc (u *UploadLicenseOptions) GetLicense() string {\n\tif u == nil {\n\t\treturn \"\"\n\t}\n\treturn u.License\n}\n\n// GetLabel returns the Label field.\nfunc (u *UploadOptions) GetLabel() string {\n\tif u == nil {\n\t\treturn \"\"\n\t}\n\treturn u.Label\n}\n\n// GetMediaType returns the MediaType field.\nfunc (u *UploadOptions) GetMediaType() string {\n\tif u == nil {\n\t\treturn \"\"\n\t}\n\treturn u.MediaType\n}\n\n// GetName returns the Name field.\nfunc (u *UploadOptions) GetName() string {\n\tif u == nil {\n\t\treturn \"\"\n\t}\n\treturn u.Name\n}\n\n// GetDate returns the Date field.\nfunc (u *UsageItem) GetDate() string {\n\tif u == nil {\n\t\treturn \"\"\n\t}\n\treturn u.Date\n}\n\n// GetDiscountAmount returns the DiscountAmount field.\nfunc (u *UsageItem) GetDiscountAmount() float64 {\n\tif u == nil {\n\t\treturn 0\n\t}\n\treturn u.DiscountAmount\n}\n\n// GetGrossAmount returns the GrossAmount field.\nfunc (u *UsageItem) GetGrossAmount() float64 {\n\tif u == nil {\n\t\treturn 0\n\t}\n\treturn u.GrossAmount\n}\n\n// GetNetAmount returns the NetAmount field.\nfunc (u *UsageItem) GetNetAmount() float64 {\n\tif u == nil {\n\t\treturn 0\n\t}\n\treturn u.NetAmount\n}\n\n// GetOrganizationName returns the OrganizationName field if it's non-nil, zero value otherwise.\nfunc (u *UsageItem) GetOrganizationName() string {\n\tif u == nil || u.OrganizationName == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.OrganizationName\n}\n\n// GetPricePerUnit returns the PricePerUnit field.\nfunc (u *UsageItem) GetPricePerUnit() float64 {\n\tif u == nil {\n\t\treturn 0\n\t}\n\treturn u.PricePerUnit\n}\n\n// GetProduct returns the Product field.\nfunc (u *UsageItem) GetProduct() string {\n\tif u == nil {\n\t\treturn \"\"\n\t}\n\treturn u.Product\n}\n\n// GetQuantity returns the Quantity field.\nfunc (u *UsageItem) GetQuantity() float64 {\n\tif u == nil {\n\t\treturn 0\n\t}\n\treturn u.Quantity\n}\n\n// GetRepositoryName returns the RepositoryName field if it's non-nil, zero value otherwise.\nfunc (u *UsageItem) GetRepositoryName() string {\n\tif u == nil || u.RepositoryName == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.RepositoryName\n}\n\n// GetSKU returns the SKU field.\nfunc (u *UsageItem) GetSKU() string {\n\tif u == nil {\n\t\treturn \"\"\n\t}\n\treturn u.SKU\n}\n\n// GetUnitType returns the UnitType field.\nfunc (u *UsageItem) GetUnitType() string {\n\tif u == nil {\n\t\treturn \"\"\n\t}\n\treturn u.UnitType\n}\n\n// GetUsageItems returns the UsageItems slice if it's non-nil, nil otherwise.\nfunc (u *UsageReport) GetUsageItems() []*UsageItem {\n\tif u == nil || u.UsageItems == nil {\n\t\treturn nil\n\t}\n\treturn u.UsageItems\n}\n\n// GetDay returns the Day field if it's non-nil, zero value otherwise.\nfunc (u *UsageReportOptions) GetDay() int {\n\tif u == nil || u.Day == nil {\n\t\treturn 0\n\t}\n\treturn *u.Day\n}\n\n// GetHour returns the Hour field if it's non-nil, zero value otherwise.\nfunc (u *UsageReportOptions) GetHour() int {\n\tif u == nil || u.Hour == nil {\n\t\treturn 0\n\t}\n\treturn *u.Hour\n}\n\n// GetMonth returns the Month field if it's non-nil, zero value otherwise.\nfunc (u *UsageReportOptions) GetMonth() int {\n\tif u == nil || u.Month == nil {\n\t\treturn 0\n\t}\n\treturn *u.Month\n}\n\n// GetYear returns the Year field if it's non-nil, zero value otherwise.\nfunc (u *UsageReportOptions) GetYear() int {\n\tif u == nil || u.Year == nil {\n\t\treturn 0\n\t}\n\treturn *u.Year\n}\n\n// GetAssignment returns the Assignment field if it's non-nil, zero value otherwise.\nfunc (u *User) GetAssignment() string {\n\tif u == nil || u.Assignment == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Assignment\n}\n\n// GetAvatarURL returns the AvatarURL field if it's non-nil, zero value otherwise.\nfunc (u *User) GetAvatarURL() string {\n\tif u == nil || u.AvatarURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.AvatarURL\n}\n\n// GetBio returns the Bio field if it's non-nil, zero value otherwise.\nfunc (u *User) GetBio() string {\n\tif u == nil || u.Bio == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Bio\n}\n\n// GetBlog returns the Blog field if it's non-nil, zero value otherwise.\nfunc (u *User) GetBlog() string {\n\tif u == nil || u.Blog == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Blog\n}\n\n// GetCollaborators returns the Collaborators field if it's non-nil, zero value otherwise.\nfunc (u *User) GetCollaborators() int {\n\tif u == nil || u.Collaborators == nil {\n\t\treturn 0\n\t}\n\treturn *u.Collaborators\n}\n\n// GetCompany returns the Company field if it's non-nil, zero value otherwise.\nfunc (u *User) GetCompany() string {\n\tif u == nil || u.Company == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Company\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (u *User) GetCreatedAt() Timestamp {\n\tif u == nil || u.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *u.CreatedAt\n}\n\n// GetDiskUsage returns the DiskUsage field if it's non-nil, zero value otherwise.\nfunc (u *User) GetDiskUsage() int {\n\tif u == nil || u.DiskUsage == nil {\n\t\treturn 0\n\t}\n\treturn *u.DiskUsage\n}\n\n// GetEmail returns the Email field if it's non-nil, zero value otherwise.\nfunc (u *User) GetEmail() string {\n\tif u == nil || u.Email == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Email\n}\n\n// GetEventsURL returns the EventsURL field if it's non-nil, zero value otherwise.\nfunc (u *User) GetEventsURL() string {\n\tif u == nil || u.EventsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.EventsURL\n}\n\n// GetFollowers returns the Followers field if it's non-nil, zero value otherwise.\nfunc (u *User) GetFollowers() int {\n\tif u == nil || u.Followers == nil {\n\t\treturn 0\n\t}\n\treturn *u.Followers\n}\n\n// GetFollowersURL returns the FollowersURL field if it's non-nil, zero value otherwise.\nfunc (u *User) GetFollowersURL() string {\n\tif u == nil || u.FollowersURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.FollowersURL\n}\n\n// GetFollowing returns the Following field if it's non-nil, zero value otherwise.\nfunc (u *User) GetFollowing() int {\n\tif u == nil || u.Following == nil {\n\t\treturn 0\n\t}\n\treturn *u.Following\n}\n\n// GetFollowingURL returns the FollowingURL field if it's non-nil, zero value otherwise.\nfunc (u *User) GetFollowingURL() string {\n\tif u == nil || u.FollowingURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.FollowingURL\n}\n\n// GetGistsURL returns the GistsURL field if it's non-nil, zero value otherwise.\nfunc (u *User) GetGistsURL() string {\n\tif u == nil || u.GistsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.GistsURL\n}\n\n// GetGravatarID returns the GravatarID field if it's non-nil, zero value otherwise.\nfunc (u *User) GetGravatarID() string {\n\tif u == nil || u.GravatarID == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.GravatarID\n}\n\n// GetHireable returns the Hireable field if it's non-nil, zero value otherwise.\nfunc (u *User) GetHireable() bool {\n\tif u == nil || u.Hireable == nil {\n\t\treturn false\n\t}\n\treturn *u.Hireable\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (u *User) GetHTMLURL() string {\n\tif u == nil || u.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (u *User) GetID() int64 {\n\tif u == nil || u.ID == nil {\n\t\treturn 0\n\t}\n\treturn *u.ID\n}\n\n// GetInheritedFrom returns the InheritedFrom slice if it's non-nil, nil otherwise.\nfunc (u *User) GetInheritedFrom() []*Team {\n\tif u == nil || u.InheritedFrom == nil {\n\t\treturn nil\n\t}\n\treturn u.InheritedFrom\n}\n\n// GetLdapDn returns the LdapDn field if it's non-nil, zero value otherwise.\nfunc (u *User) GetLdapDn() string {\n\tif u == nil || u.LdapDn == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.LdapDn\n}\n\n// GetLocation returns the Location field if it's non-nil, zero value otherwise.\nfunc (u *User) GetLocation() string {\n\tif u == nil || u.Location == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Location\n}\n\n// GetLogin returns the Login field if it's non-nil, zero value otherwise.\nfunc (u *User) GetLogin() string {\n\tif u == nil || u.Login == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Login\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (u *User) GetName() string {\n\tif u == nil || u.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Name\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (u *User) GetNodeID() string {\n\tif u == nil || u.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.NodeID\n}\n\n// GetOrganizationsURL returns the OrganizationsURL field if it's non-nil, zero value otherwise.\nfunc (u *User) GetOrganizationsURL() string {\n\tif u == nil || u.OrganizationsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.OrganizationsURL\n}\n\n// GetOwnedPrivateRepos returns the OwnedPrivateRepos field if it's non-nil, zero value otherwise.\nfunc (u *User) GetOwnedPrivateRepos() int64 {\n\tif u == nil || u.OwnedPrivateRepos == nil {\n\t\treturn 0\n\t}\n\treturn *u.OwnedPrivateRepos\n}\n\n// GetPermissions returns the Permissions field.\nfunc (u *User) GetPermissions() *RepositoryPermissions {\n\tif u == nil {\n\t\treturn nil\n\t}\n\treturn u.Permissions\n}\n\n// GetPlan returns the Plan field.\nfunc (u *User) GetPlan() *Plan {\n\tif u == nil {\n\t\treturn nil\n\t}\n\treturn u.Plan\n}\n\n// GetPrivateGists returns the PrivateGists field if it's non-nil, zero value otherwise.\nfunc (u *User) GetPrivateGists() int {\n\tif u == nil || u.PrivateGists == nil {\n\t\treturn 0\n\t}\n\treturn *u.PrivateGists\n}\n\n// GetPublicGists returns the PublicGists field if it's non-nil, zero value otherwise.\nfunc (u *User) GetPublicGists() int {\n\tif u == nil || u.PublicGists == nil {\n\t\treturn 0\n\t}\n\treturn *u.PublicGists\n}\n\n// GetPublicRepos returns the PublicRepos field if it's non-nil, zero value otherwise.\nfunc (u *User) GetPublicRepos() int {\n\tif u == nil || u.PublicRepos == nil {\n\t\treturn 0\n\t}\n\treturn *u.PublicRepos\n}\n\n// GetReceivedEventsURL returns the ReceivedEventsURL field if it's non-nil, zero value otherwise.\nfunc (u *User) GetReceivedEventsURL() string {\n\tif u == nil || u.ReceivedEventsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.ReceivedEventsURL\n}\n\n// GetReposURL returns the ReposURL field if it's non-nil, zero value otherwise.\nfunc (u *User) GetReposURL() string {\n\tif u == nil || u.ReposURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.ReposURL\n}\n\n// GetRoleName returns the RoleName field if it's non-nil, zero value otherwise.\nfunc (u *User) GetRoleName() string {\n\tif u == nil || u.RoleName == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.RoleName\n}\n\n// GetSiteAdmin returns the SiteAdmin field if it's non-nil, zero value otherwise.\nfunc (u *User) GetSiteAdmin() bool {\n\tif u == nil || u.SiteAdmin == nil {\n\t\treturn false\n\t}\n\treturn *u.SiteAdmin\n}\n\n// GetStarredURL returns the StarredURL field if it's non-nil, zero value otherwise.\nfunc (u *User) GetStarredURL() string {\n\tif u == nil || u.StarredURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.StarredURL\n}\n\n// GetSubscriptionsURL returns the SubscriptionsURL field if it's non-nil, zero value otherwise.\nfunc (u *User) GetSubscriptionsURL() string {\n\tif u == nil || u.SubscriptionsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.SubscriptionsURL\n}\n\n// GetSuspendedAt returns the SuspendedAt field if it's non-nil, zero value otherwise.\nfunc (u *User) GetSuspendedAt() Timestamp {\n\tif u == nil || u.SuspendedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *u.SuspendedAt\n}\n\n// GetTextMatches returns the TextMatches slice if it's non-nil, nil otherwise.\nfunc (u *User) GetTextMatches() []*TextMatch {\n\tif u == nil || u.TextMatches == nil {\n\t\treturn nil\n\t}\n\treturn u.TextMatches\n}\n\n// GetTotalPrivateRepos returns the TotalPrivateRepos field if it's non-nil, zero value otherwise.\nfunc (u *User) GetTotalPrivateRepos() int64 {\n\tif u == nil || u.TotalPrivateRepos == nil {\n\t\treturn 0\n\t}\n\treturn *u.TotalPrivateRepos\n}\n\n// GetTwitterUsername returns the TwitterUsername field if it's non-nil, zero value otherwise.\nfunc (u *User) GetTwitterUsername() string {\n\tif u == nil || u.TwitterUsername == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.TwitterUsername\n}\n\n// GetTwoFactorAuthentication returns the TwoFactorAuthentication field if it's non-nil, zero value otherwise.\nfunc (u *User) GetTwoFactorAuthentication() bool {\n\tif u == nil || u.TwoFactorAuthentication == nil {\n\t\treturn false\n\t}\n\treturn *u.TwoFactorAuthentication\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (u *User) GetType() string {\n\tif u == nil || u.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Type\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (u *User) GetUpdatedAt() Timestamp {\n\tif u == nil || u.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *u.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (u *User) GetURL() string {\n\tif u == nil || u.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.URL\n}\n\n// GetApp returns the App field.\nfunc (u *UserAuthorization) GetApp() *OAuthAPP {\n\tif u == nil {\n\t\treturn nil\n\t}\n\treturn u.App\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (u *UserAuthorization) GetCreatedAt() Timestamp {\n\tif u == nil || u.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *u.CreatedAt\n}\n\n// GetFingerprint returns the Fingerprint field if it's non-nil, zero value otherwise.\nfunc (u *UserAuthorization) GetFingerprint() string {\n\tif u == nil || u.Fingerprint == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Fingerprint\n}\n\n// GetHashedToken returns the HashedToken field if it's non-nil, zero value otherwise.\nfunc (u *UserAuthorization) GetHashedToken() string {\n\tif u == nil || u.HashedToken == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.HashedToken\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (u *UserAuthorization) GetID() int64 {\n\tif u == nil || u.ID == nil {\n\t\treturn 0\n\t}\n\treturn *u.ID\n}\n\n// GetNote returns the Note field if it's non-nil, zero value otherwise.\nfunc (u *UserAuthorization) GetNote() string {\n\tif u == nil || u.Note == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Note\n}\n\n// GetNoteURL returns the NoteURL field if it's non-nil, zero value otherwise.\nfunc (u *UserAuthorization) GetNoteURL() string {\n\tif u == nil || u.NoteURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.NoteURL\n}\n\n// GetScopes returns the Scopes slice if it's non-nil, nil otherwise.\nfunc (u *UserAuthorization) GetScopes() []string {\n\tif u == nil || u.Scopes == nil {\n\t\treturn nil\n\t}\n\treturn u.Scopes\n}\n\n// GetToken returns the Token field if it's non-nil, zero value otherwise.\nfunc (u *UserAuthorization) GetToken() string {\n\tif u == nil || u.Token == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Token\n}\n\n// GetTokenLastEight returns the TokenLastEight field if it's non-nil, zero value otherwise.\nfunc (u *UserAuthorization) GetTokenLastEight() string {\n\tif u == nil || u.TokenLastEight == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.TokenLastEight\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (u *UserAuthorization) GetUpdatedAt() Timestamp {\n\tif u == nil || u.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *u.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (u *UserAuthorization) GetURL() string {\n\tif u == nil || u.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.URL\n}\n\n// GetMessage returns the Message field if it's non-nil, zero value otherwise.\nfunc (u *UserContext) GetMessage() string {\n\tif u == nil || u.Message == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Message\n}\n\n// GetOcticon returns the Octicon field if it's non-nil, zero value otherwise.\nfunc (u *UserContext) GetOcticon() string {\n\tif u == nil || u.Octicon == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Octicon\n}\n\n// GetEmail returns the Email field if it's non-nil, zero value otherwise.\nfunc (u *UserEmail) GetEmail() string {\n\tif u == nil || u.Email == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Email\n}\n\n// GetPrimary returns the Primary field if it's non-nil, zero value otherwise.\nfunc (u *UserEmail) GetPrimary() bool {\n\tif u == nil || u.Primary == nil {\n\t\treturn false\n\t}\n\treturn *u.Primary\n}\n\n// GetVerified returns the Verified field if it's non-nil, zero value otherwise.\nfunc (u *UserEmail) GetVerified() bool {\n\tif u == nil || u.Verified == nil {\n\t\treturn false\n\t}\n\treturn *u.Verified\n}\n\n// GetVisibility returns the Visibility field if it's non-nil, zero value otherwise.\nfunc (u *UserEmail) GetVisibility() string {\n\tif u == nil || u.Visibility == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Visibility\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (u *UserEvent) GetAction() string {\n\tif u == nil || u.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Action\n}\n\n// GetEnterprise returns the Enterprise field.\nfunc (u *UserEvent) GetEnterprise() *Enterprise {\n\tif u == nil {\n\t\treturn nil\n\t}\n\treturn u.Enterprise\n}\n\n// GetInstallation returns the Installation field.\nfunc (u *UserEvent) GetInstallation() *Installation {\n\tif u == nil {\n\t\treturn nil\n\t}\n\treturn u.Installation\n}\n\n// GetSender returns the Sender field.\nfunc (u *UserEvent) GetSender() *User {\n\tif u == nil {\n\t\treturn nil\n\t}\n\treturn u.Sender\n}\n\n// GetUser returns the User field.\nfunc (u *UserEvent) GetUser() *User {\n\tif u == nil {\n\t\treturn nil\n\t}\n\treturn u.User\n}\n\n// GetAvatarURL returns the AvatarURL field if it's non-nil, zero value otherwise.\nfunc (u *UserLDAPMapping) GetAvatarURL() string {\n\tif u == nil || u.AvatarURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.AvatarURL\n}\n\n// GetEventsURL returns the EventsURL field if it's non-nil, zero value otherwise.\nfunc (u *UserLDAPMapping) GetEventsURL() string {\n\tif u == nil || u.EventsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.EventsURL\n}\n\n// GetFollowersURL returns the FollowersURL field if it's non-nil, zero value otherwise.\nfunc (u *UserLDAPMapping) GetFollowersURL() string {\n\tif u == nil || u.FollowersURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.FollowersURL\n}\n\n// GetFollowingURL returns the FollowingURL field if it's non-nil, zero value otherwise.\nfunc (u *UserLDAPMapping) GetFollowingURL() string {\n\tif u == nil || u.FollowingURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.FollowingURL\n}\n\n// GetGistsURL returns the GistsURL field if it's non-nil, zero value otherwise.\nfunc (u *UserLDAPMapping) GetGistsURL() string {\n\tif u == nil || u.GistsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.GistsURL\n}\n\n// GetGravatarID returns the GravatarID field if it's non-nil, zero value otherwise.\nfunc (u *UserLDAPMapping) GetGravatarID() string {\n\tif u == nil || u.GravatarID == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.GravatarID\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (u *UserLDAPMapping) GetID() int64 {\n\tif u == nil || u.ID == nil {\n\t\treturn 0\n\t}\n\treturn *u.ID\n}\n\n// GetLDAPDN returns the LDAPDN field if it's non-nil, zero value otherwise.\nfunc (u *UserLDAPMapping) GetLDAPDN() string {\n\tif u == nil || u.LDAPDN == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.LDAPDN\n}\n\n// GetLogin returns the Login field if it's non-nil, zero value otherwise.\nfunc (u *UserLDAPMapping) GetLogin() string {\n\tif u == nil || u.Login == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Login\n}\n\n// GetOrganizationsURL returns the OrganizationsURL field if it's non-nil, zero value otherwise.\nfunc (u *UserLDAPMapping) GetOrganizationsURL() string {\n\tif u == nil || u.OrganizationsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.OrganizationsURL\n}\n\n// GetReceivedEventsURL returns the ReceivedEventsURL field if it's non-nil, zero value otherwise.\nfunc (u *UserLDAPMapping) GetReceivedEventsURL() string {\n\tif u == nil || u.ReceivedEventsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.ReceivedEventsURL\n}\n\n// GetReposURL returns the ReposURL field if it's non-nil, zero value otherwise.\nfunc (u *UserLDAPMapping) GetReposURL() string {\n\tif u == nil || u.ReposURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.ReposURL\n}\n\n// GetSiteAdmin returns the SiteAdmin field if it's non-nil, zero value otherwise.\nfunc (u *UserLDAPMapping) GetSiteAdmin() bool {\n\tif u == nil || u.SiteAdmin == nil {\n\t\treturn false\n\t}\n\treturn *u.SiteAdmin\n}\n\n// GetStarredURL returns the StarredURL field if it's non-nil, zero value otherwise.\nfunc (u *UserLDAPMapping) GetStarredURL() string {\n\tif u == nil || u.StarredURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.StarredURL\n}\n\n// GetSubscriptionsURL returns the SubscriptionsURL field if it's non-nil, zero value otherwise.\nfunc (u *UserLDAPMapping) GetSubscriptionsURL() string {\n\tif u == nil || u.SubscriptionsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.SubscriptionsURL\n}\n\n// GetType returns the Type field if it's non-nil, zero value otherwise.\nfunc (u *UserLDAPMapping) GetType() string {\n\tif u == nil || u.Type == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Type\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (u *UserLDAPMapping) GetURL() string {\n\tif u == nil || u.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.URL\n}\n\n// GetPerPage returns the PerPage field.\nfunc (u *UserListOptions) GetPerPage() int {\n\tif u == nil {\n\t\treturn 0\n\t}\n\treturn u.PerPage\n}\n\n// GetSince returns the Since field.\nfunc (u *UserListOptions) GetSince() int64 {\n\tif u == nil {\n\t\treturn 0\n\t}\n\treturn u.Since\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (u *UserMigration) GetCreatedAt() string {\n\tif u == nil || u.CreatedAt == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.CreatedAt\n}\n\n// GetExcludeAttachments returns the ExcludeAttachments field if it's non-nil, zero value otherwise.\nfunc (u *UserMigration) GetExcludeAttachments() bool {\n\tif u == nil || u.ExcludeAttachments == nil {\n\t\treturn false\n\t}\n\treturn *u.ExcludeAttachments\n}\n\n// GetGUID returns the GUID field if it's non-nil, zero value otherwise.\nfunc (u *UserMigration) GetGUID() string {\n\tif u == nil || u.GUID == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.GUID\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (u *UserMigration) GetID() int64 {\n\tif u == nil || u.ID == nil {\n\t\treturn 0\n\t}\n\treturn *u.ID\n}\n\n// GetLockRepositories returns the LockRepositories field if it's non-nil, zero value otherwise.\nfunc (u *UserMigration) GetLockRepositories() bool {\n\tif u == nil || u.LockRepositories == nil {\n\t\treturn false\n\t}\n\treturn *u.LockRepositories\n}\n\n// GetRepositories returns the Repositories slice if it's non-nil, nil otherwise.\nfunc (u *UserMigration) GetRepositories() []*Repository {\n\tif u == nil || u.Repositories == nil {\n\t\treturn nil\n\t}\n\treturn u.Repositories\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (u *UserMigration) GetState() string {\n\tif u == nil || u.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.State\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (u *UserMigration) GetUpdatedAt() string {\n\tif u == nil || u.UpdatedAt == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (u *UserMigration) GetURL() string {\n\tif u == nil || u.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.URL\n}\n\n// GetExcludeAttachments returns the ExcludeAttachments field.\nfunc (u *UserMigrationOptions) GetExcludeAttachments() bool {\n\tif u == nil {\n\t\treturn false\n\t}\n\treturn u.ExcludeAttachments\n}\n\n// GetLockRepositories returns the LockRepositories field.\nfunc (u *UserMigrationOptions) GetLockRepositories() bool {\n\tif u == nil {\n\t\treturn false\n\t}\n\treturn u.LockRepositories\n}\n\n// GetIncompleteResults returns the IncompleteResults field if it's non-nil, zero value otherwise.\nfunc (u *UsersSearchResult) GetIncompleteResults() bool {\n\tif u == nil || u.IncompleteResults == nil {\n\t\treturn false\n\t}\n\treturn *u.IncompleteResults\n}\n\n// GetTotal returns the Total field if it's non-nil, zero value otherwise.\nfunc (u *UsersSearchResult) GetTotal() int {\n\tif u == nil || u.Total == nil {\n\t\treturn 0\n\t}\n\treturn *u.Total\n}\n\n// GetUsers returns the Users slice if it's non-nil, nil otherwise.\nfunc (u *UsersSearchResult) GetUsers() []*User {\n\tif u == nil || u.Users == nil {\n\t\treturn nil\n\t}\n\treturn u.Users\n}\n\n// GetAdminUsers returns the AdminUsers field if it's non-nil, zero value otherwise.\nfunc (u *UserStats) GetAdminUsers() int {\n\tif u == nil || u.AdminUsers == nil {\n\t\treturn 0\n\t}\n\treturn *u.AdminUsers\n}\n\n// GetSuspendedUsers returns the SuspendedUsers field if it's non-nil, zero value otherwise.\nfunc (u *UserStats) GetSuspendedUsers() int {\n\tif u == nil || u.SuspendedUsers == nil {\n\t\treturn 0\n\t}\n\treturn *u.SuspendedUsers\n}\n\n// GetTotalUsers returns the TotalUsers field if it's non-nil, zero value otherwise.\nfunc (u *UserStats) GetTotalUsers() int {\n\tif u == nil || u.TotalUsers == nil {\n\t\treturn 0\n\t}\n\treturn *u.TotalUsers\n}\n\n// GetReason returns the Reason field if it's non-nil, zero value otherwise.\nfunc (u *UserSuspendOptions) GetReason() string {\n\tif u == nil || u.Reason == nil {\n\t\treturn \"\"\n\t}\n\treturn *u.Reason\n}\n\n// GetEcosystem returns the Ecosystem field if it's non-nil, zero value otherwise.\nfunc (v *VulnerabilityPackage) GetEcosystem() string {\n\tif v == nil || v.Ecosystem == nil {\n\t\treturn \"\"\n\t}\n\treturn *v.Ecosystem\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (v *VulnerabilityPackage) GetName() string {\n\tif v == nil || v.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *v.Name\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (w *WatchEvent) GetAction() string {\n\tif w == nil || w.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.Action\n}\n\n// GetInstallation returns the Installation field.\nfunc (w *WatchEvent) GetInstallation() *Installation {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (w *WatchEvent) GetOrg() *Organization {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.Org\n}\n\n// GetRepo returns the Repo field.\nfunc (w *WatchEvent) GetRepo() *Repository {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (w *WatchEvent) GetSender() *User {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.Sender\n}\n\n// GetDays returns the Days slice if it's non-nil, nil otherwise.\nfunc (w *WeeklyCommitActivity) GetDays() []int {\n\tif w == nil || w.Days == nil {\n\t\treturn nil\n\t}\n\treturn w.Days\n}\n\n// GetTotal returns the Total field if it's non-nil, zero value otherwise.\nfunc (w *WeeklyCommitActivity) GetTotal() int {\n\tif w == nil || w.Total == nil {\n\t\treturn 0\n\t}\n\treturn *w.Total\n}\n\n// GetWeek returns the Week field if it's non-nil, zero value otherwise.\nfunc (w *WeeklyCommitActivity) GetWeek() Timestamp {\n\tif w == nil || w.Week == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *w.Week\n}\n\n// GetAdditions returns the Additions field if it's non-nil, zero value otherwise.\nfunc (w *WeeklyStats) GetAdditions() int {\n\tif w == nil || w.Additions == nil {\n\t\treturn 0\n\t}\n\treturn *w.Additions\n}\n\n// GetCommits returns the Commits field if it's non-nil, zero value otherwise.\nfunc (w *WeeklyStats) GetCommits() int {\n\tif w == nil || w.Commits == nil {\n\t\treturn 0\n\t}\n\treturn *w.Commits\n}\n\n// GetDeletions returns the Deletions field if it's non-nil, zero value otherwise.\nfunc (w *WeeklyStats) GetDeletions() int {\n\tif w == nil || w.Deletions == nil {\n\t\treturn 0\n\t}\n\treturn *w.Deletions\n}\n\n// GetWeek returns the Week field if it's non-nil, zero value otherwise.\nfunc (w *WeeklyStats) GetWeek() Timestamp {\n\tif w == nil || w.Week == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *w.Week\n}\n\n// GetBadgeURL returns the BadgeURL field if it's non-nil, zero value otherwise.\nfunc (w *Workflow) GetBadgeURL() string {\n\tif w == nil || w.BadgeURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.BadgeURL\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (w *Workflow) GetCreatedAt() Timestamp {\n\tif w == nil || w.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *w.CreatedAt\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (w *Workflow) GetHTMLURL() string {\n\tif w == nil || w.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (w *Workflow) GetID() int64 {\n\tif w == nil || w.ID == nil {\n\t\treturn 0\n\t}\n\treturn *w.ID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (w *Workflow) GetName() string {\n\tif w == nil || w.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.Name\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (w *Workflow) GetNodeID() string {\n\tif w == nil || w.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.NodeID\n}\n\n// GetPath returns the Path field if it's non-nil, zero value otherwise.\nfunc (w *Workflow) GetPath() string {\n\tif w == nil || w.Path == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.Path\n}\n\n// GetState returns the State field if it's non-nil, zero value otherwise.\nfunc (w *Workflow) GetState() string {\n\tif w == nil || w.State == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.State\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (w *Workflow) GetUpdatedAt() Timestamp {\n\tif w == nil || w.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *w.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (w *Workflow) GetURL() string {\n\tif w == nil || w.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.URL\n}\n\n// GetTotalMS returns the TotalMS field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowBill) GetTotalMS() int64 {\n\tif w == nil || w.TotalMS == nil {\n\t\treturn 0\n\t}\n\treturn *w.TotalMS\n}\n\n// GetInputs returns the Inputs field.\nfunc (w *WorkflowDispatchEvent) GetInputs() json.RawMessage {\n\tif w == nil {\n\t\treturn json.RawMessage{}\n\t}\n\treturn w.Inputs\n}\n\n// GetInstallation returns the Installation field.\nfunc (w *WorkflowDispatchEvent) GetInstallation() *Installation {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (w *WorkflowDispatchEvent) GetOrg() *Organization {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.Org\n}\n\n// GetRef returns the Ref field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowDispatchEvent) GetRef() string {\n\tif w == nil || w.Ref == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.Ref\n}\n\n// GetRepo returns the Repo field.\nfunc (w *WorkflowDispatchEvent) GetRepo() *Repository {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (w *WorkflowDispatchEvent) GetSender() *User {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.Sender\n}\n\n// GetWorkflow returns the Workflow field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowDispatchEvent) GetWorkflow() string {\n\tif w == nil || w.Workflow == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.Workflow\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowDispatchRunDetails) GetHTMLURL() string {\n\tif w == nil || w.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.HTMLURL\n}\n\n// GetRunURL returns the RunURL field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowDispatchRunDetails) GetRunURL() string {\n\tif w == nil || w.RunURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.RunURL\n}\n\n// GetWorkflowRunID returns the WorkflowRunID field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowDispatchRunDetails) GetWorkflowRunID() int64 {\n\tif w == nil || w.WorkflowRunID == nil {\n\t\treturn 0\n\t}\n\treturn *w.WorkflowRunID\n}\n\n// GetCheckRunURL returns the CheckRunURL field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJob) GetCheckRunURL() string {\n\tif w == nil || w.CheckRunURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.CheckRunURL\n}\n\n// GetCompletedAt returns the CompletedAt field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJob) GetCompletedAt() Timestamp {\n\tif w == nil || w.CompletedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *w.CompletedAt\n}\n\n// GetConclusion returns the Conclusion field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJob) GetConclusion() string {\n\tif w == nil || w.Conclusion == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.Conclusion\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJob) GetCreatedAt() Timestamp {\n\tif w == nil || w.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *w.CreatedAt\n}\n\n// GetHeadBranch returns the HeadBranch field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJob) GetHeadBranch() string {\n\tif w == nil || w.HeadBranch == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.HeadBranch\n}\n\n// GetHeadSHA returns the HeadSHA field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJob) GetHeadSHA() string {\n\tif w == nil || w.HeadSHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.HeadSHA\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJob) GetHTMLURL() string {\n\tif w == nil || w.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJob) GetID() int64 {\n\tif w == nil || w.ID == nil {\n\t\treturn 0\n\t}\n\treturn *w.ID\n}\n\n// GetLabels returns the Labels slice if it's non-nil, nil otherwise.\nfunc (w *WorkflowJob) GetLabels() []string {\n\tif w == nil || w.Labels == nil {\n\t\treturn nil\n\t}\n\treturn w.Labels\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJob) GetName() string {\n\tif w == nil || w.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.Name\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJob) GetNodeID() string {\n\tif w == nil || w.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.NodeID\n}\n\n// GetRunAttempt returns the RunAttempt field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJob) GetRunAttempt() int64 {\n\tif w == nil || w.RunAttempt == nil {\n\t\treturn 0\n\t}\n\treturn *w.RunAttempt\n}\n\n// GetRunID returns the RunID field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJob) GetRunID() int64 {\n\tif w == nil || w.RunID == nil {\n\t\treturn 0\n\t}\n\treturn *w.RunID\n}\n\n// GetRunnerGroupID returns the RunnerGroupID field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJob) GetRunnerGroupID() int64 {\n\tif w == nil || w.RunnerGroupID == nil {\n\t\treturn 0\n\t}\n\treturn *w.RunnerGroupID\n}\n\n// GetRunnerGroupName returns the RunnerGroupName field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJob) GetRunnerGroupName() string {\n\tif w == nil || w.RunnerGroupName == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.RunnerGroupName\n}\n\n// GetRunnerID returns the RunnerID field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJob) GetRunnerID() int64 {\n\tif w == nil || w.RunnerID == nil {\n\t\treturn 0\n\t}\n\treturn *w.RunnerID\n}\n\n// GetRunnerName returns the RunnerName field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJob) GetRunnerName() string {\n\tif w == nil || w.RunnerName == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.RunnerName\n}\n\n// GetRunURL returns the RunURL field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJob) GetRunURL() string {\n\tif w == nil || w.RunURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.RunURL\n}\n\n// GetStartedAt returns the StartedAt field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJob) GetStartedAt() Timestamp {\n\tif w == nil || w.StartedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *w.StartedAt\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJob) GetStatus() string {\n\tif w == nil || w.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.Status\n}\n\n// GetSteps returns the Steps slice if it's non-nil, nil otherwise.\nfunc (w *WorkflowJob) GetSteps() []*TaskStep {\n\tif w == nil || w.Steps == nil {\n\t\treturn nil\n\t}\n\treturn w.Steps\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJob) GetURL() string {\n\tif w == nil || w.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.URL\n}\n\n// GetWorkflowName returns the WorkflowName field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJob) GetWorkflowName() string {\n\tif w == nil || w.WorkflowName == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.WorkflowName\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJobEvent) GetAction() string {\n\tif w == nil || w.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.Action\n}\n\n// GetDeployment returns the Deployment field.\nfunc (w *WorkflowJobEvent) GetDeployment() *Deployment {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.Deployment\n}\n\n// GetInstallation returns the Installation field.\nfunc (w *WorkflowJobEvent) GetInstallation() *Installation {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (w *WorkflowJobEvent) GetOrg() *Organization {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.Org\n}\n\n// GetRepo returns the Repo field.\nfunc (w *WorkflowJobEvent) GetRepo() *Repository {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (w *WorkflowJobEvent) GetSender() *User {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.Sender\n}\n\n// GetWorkflowJob returns the WorkflowJob field.\nfunc (w *WorkflowJobEvent) GetWorkflowJob() *WorkflowJob {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.WorkflowJob\n}\n\n// GetConclusion returns the Conclusion field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJobRun) GetConclusion() string {\n\tif w == nil || w.Conclusion == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.Conclusion\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJobRun) GetCreatedAt() Timestamp {\n\tif w == nil || w.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *w.CreatedAt\n}\n\n// GetEnvironment returns the Environment field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJobRun) GetEnvironment() string {\n\tif w == nil || w.Environment == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.Environment\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJobRun) GetHTMLURL() string {\n\tif w == nil || w.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJobRun) GetID() int64 {\n\tif w == nil || w.ID == nil {\n\t\treturn 0\n\t}\n\treturn *w.ID\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJobRun) GetName() string {\n\tif w == nil || w.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.Name\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJobRun) GetStatus() string {\n\tif w == nil || w.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.Status\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowJobRun) GetUpdatedAt() Timestamp {\n\tif w == nil || w.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *w.UpdatedAt\n}\n\n// GetActor returns the Actor field.\nfunc (w *WorkflowRun) GetActor() *User {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.Actor\n}\n\n// GetArtifactsURL returns the ArtifactsURL field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRun) GetArtifactsURL() string {\n\tif w == nil || w.ArtifactsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.ArtifactsURL\n}\n\n// GetCancelURL returns the CancelURL field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRun) GetCancelURL() string {\n\tif w == nil || w.CancelURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.CancelURL\n}\n\n// GetCheckSuiteID returns the CheckSuiteID field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRun) GetCheckSuiteID() int64 {\n\tif w == nil || w.CheckSuiteID == nil {\n\t\treturn 0\n\t}\n\treturn *w.CheckSuiteID\n}\n\n// GetCheckSuiteNodeID returns the CheckSuiteNodeID field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRun) GetCheckSuiteNodeID() string {\n\tif w == nil || w.CheckSuiteNodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.CheckSuiteNodeID\n}\n\n// GetCheckSuiteURL returns the CheckSuiteURL field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRun) GetCheckSuiteURL() string {\n\tif w == nil || w.CheckSuiteURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.CheckSuiteURL\n}\n\n// GetConclusion returns the Conclusion field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRun) GetConclusion() string {\n\tif w == nil || w.Conclusion == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.Conclusion\n}\n\n// GetCreatedAt returns the CreatedAt field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRun) GetCreatedAt() Timestamp {\n\tif w == nil || w.CreatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *w.CreatedAt\n}\n\n// GetDisplayTitle returns the DisplayTitle field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRun) GetDisplayTitle() string {\n\tif w == nil || w.DisplayTitle == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.DisplayTitle\n}\n\n// GetEvent returns the Event field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRun) GetEvent() string {\n\tif w == nil || w.Event == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.Event\n}\n\n// GetHeadBranch returns the HeadBranch field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRun) GetHeadBranch() string {\n\tif w == nil || w.HeadBranch == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.HeadBranch\n}\n\n// GetHeadCommit returns the HeadCommit field.\nfunc (w *WorkflowRun) GetHeadCommit() *HeadCommit {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.HeadCommit\n}\n\n// GetHeadRepository returns the HeadRepository field.\nfunc (w *WorkflowRun) GetHeadRepository() *Repository {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.HeadRepository\n}\n\n// GetHeadSHA returns the HeadSHA field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRun) GetHeadSHA() string {\n\tif w == nil || w.HeadSHA == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.HeadSHA\n}\n\n// GetHTMLURL returns the HTMLURL field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRun) GetHTMLURL() string {\n\tif w == nil || w.HTMLURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.HTMLURL\n}\n\n// GetID returns the ID field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRun) GetID() int64 {\n\tif w == nil || w.ID == nil {\n\t\treturn 0\n\t}\n\treturn *w.ID\n}\n\n// GetJobsURL returns the JobsURL field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRun) GetJobsURL() string {\n\tif w == nil || w.JobsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.JobsURL\n}\n\n// GetLogsURL returns the LogsURL field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRun) GetLogsURL() string {\n\tif w == nil || w.LogsURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.LogsURL\n}\n\n// GetName returns the Name field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRun) GetName() string {\n\tif w == nil || w.Name == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.Name\n}\n\n// GetNodeID returns the NodeID field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRun) GetNodeID() string {\n\tif w == nil || w.NodeID == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.NodeID\n}\n\n// GetPath returns the Path field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRun) GetPath() string {\n\tif w == nil || w.Path == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.Path\n}\n\n// GetPreviousAttemptURL returns the PreviousAttemptURL field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRun) GetPreviousAttemptURL() string {\n\tif w == nil || w.PreviousAttemptURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.PreviousAttemptURL\n}\n\n// GetPullRequests returns the PullRequests slice if it's non-nil, nil otherwise.\nfunc (w *WorkflowRun) GetPullRequests() []*PullRequest {\n\tif w == nil || w.PullRequests == nil {\n\t\treturn nil\n\t}\n\treturn w.PullRequests\n}\n\n// GetReferencedWorkflows returns the ReferencedWorkflows slice if it's non-nil, nil otherwise.\nfunc (w *WorkflowRun) GetReferencedWorkflows() []*ReferencedWorkflow {\n\tif w == nil || w.ReferencedWorkflows == nil {\n\t\treturn nil\n\t}\n\treturn w.ReferencedWorkflows\n}\n\n// GetRepository returns the Repository field.\nfunc (w *WorkflowRun) GetRepository() *Repository {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.Repository\n}\n\n// GetRerunURL returns the RerunURL field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRun) GetRerunURL() string {\n\tif w == nil || w.RerunURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.RerunURL\n}\n\n// GetRunAttempt returns the RunAttempt field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRun) GetRunAttempt() int {\n\tif w == nil || w.RunAttempt == nil {\n\t\treturn 0\n\t}\n\treturn *w.RunAttempt\n}\n\n// GetRunNumber returns the RunNumber field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRun) GetRunNumber() int {\n\tif w == nil || w.RunNumber == nil {\n\t\treturn 0\n\t}\n\treturn *w.RunNumber\n}\n\n// GetRunStartedAt returns the RunStartedAt field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRun) GetRunStartedAt() Timestamp {\n\tif w == nil || w.RunStartedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *w.RunStartedAt\n}\n\n// GetStatus returns the Status field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRun) GetStatus() string {\n\tif w == nil || w.Status == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.Status\n}\n\n// GetTriggeringActor returns the TriggeringActor field.\nfunc (w *WorkflowRun) GetTriggeringActor() *User {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.TriggeringActor\n}\n\n// GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRun) GetUpdatedAt() Timestamp {\n\tif w == nil || w.UpdatedAt == nil {\n\t\treturn Timestamp{}\n\t}\n\treturn *w.UpdatedAt\n}\n\n// GetURL returns the URL field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRun) GetURL() string {\n\tif w == nil || w.URL == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.URL\n}\n\n// GetWorkflowID returns the WorkflowID field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRun) GetWorkflowID() int64 {\n\tif w == nil || w.WorkflowID == nil {\n\t\treturn 0\n\t}\n\treturn *w.WorkflowID\n}\n\n// GetWorkflowURL returns the WorkflowURL field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRun) GetWorkflowURL() string {\n\tif w == nil || w.WorkflowURL == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.WorkflowURL\n}\n\n// GetExcludePullRequests returns the ExcludePullRequests field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRunAttemptOptions) GetExcludePullRequests() bool {\n\tif w == nil || w.ExcludePullRequests == nil {\n\t\treturn false\n\t}\n\treturn *w.ExcludePullRequests\n}\n\n// GetJobRuns returns the JobRuns slice if it's non-nil, nil otherwise.\nfunc (w *WorkflowRunBill) GetJobRuns() []*WorkflowRunJobRun {\n\tif w == nil || w.JobRuns == nil {\n\t\treturn nil\n\t}\n\treturn w.JobRuns\n}\n\n// GetJobs returns the Jobs field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRunBill) GetJobs() int {\n\tif w == nil || w.Jobs == nil {\n\t\treturn 0\n\t}\n\treturn *w.Jobs\n}\n\n// GetTotalMS returns the TotalMS field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRunBill) GetTotalMS() int64 {\n\tif w == nil || w.TotalMS == nil {\n\t\treturn 0\n\t}\n\treturn *w.TotalMS\n}\n\n// GetAction returns the Action field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRunEvent) GetAction() string {\n\tif w == nil || w.Action == nil {\n\t\treturn \"\"\n\t}\n\treturn *w.Action\n}\n\n// GetInstallation returns the Installation field.\nfunc (w *WorkflowRunEvent) GetInstallation() *Installation {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.Installation\n}\n\n// GetOrg returns the Org field.\nfunc (w *WorkflowRunEvent) GetOrg() *Organization {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.Org\n}\n\n// GetRepo returns the Repo field.\nfunc (w *WorkflowRunEvent) GetRepo() *Repository {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.Repo\n}\n\n// GetSender returns the Sender field.\nfunc (w *WorkflowRunEvent) GetSender() *User {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.Sender\n}\n\n// GetWorkflow returns the Workflow field.\nfunc (w *WorkflowRunEvent) GetWorkflow() *Workflow {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.Workflow\n}\n\n// GetWorkflowRun returns the WorkflowRun field.\nfunc (w *WorkflowRunEvent) GetWorkflowRun() *WorkflowRun {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.WorkflowRun\n}\n\n// GetDurationMS returns the DurationMS field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRunJobRun) GetDurationMS() int64 {\n\tif w == nil || w.DurationMS == nil {\n\t\treturn 0\n\t}\n\treturn *w.DurationMS\n}\n\n// GetJobID returns the JobID field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRunJobRun) GetJobID() int {\n\tif w == nil || w.JobID == nil {\n\t\treturn 0\n\t}\n\treturn *w.JobID\n}\n\n// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRuns) GetTotalCount() int {\n\tif w == nil || w.TotalCount == nil {\n\t\treturn 0\n\t}\n\treturn *w.TotalCount\n}\n\n// GetWorkflowRuns returns the WorkflowRuns slice if it's non-nil, nil otherwise.\nfunc (w *WorkflowRuns) GetWorkflowRuns() []*WorkflowRun {\n\tif w == nil || w.WorkflowRuns == nil {\n\t\treturn nil\n\t}\n\treturn w.WorkflowRuns\n}\n\n// GetBillable returns the Billable field.\nfunc (w *WorkflowRunUsage) GetBillable() *WorkflowRunBillMap {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.Billable\n}\n\n// GetRunDurationMS returns the RunDurationMS field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowRunUsage) GetRunDurationMS() int64 {\n\tif w == nil || w.RunDurationMS == nil {\n\t\treturn 0\n\t}\n\treturn *w.RunDurationMS\n}\n\n// GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise.\nfunc (w *Workflows) GetTotalCount() int {\n\tif w == nil || w.TotalCount == nil {\n\t\treturn 0\n\t}\n\treturn *w.TotalCount\n}\n\n// GetWorkflows returns the Workflows slice if it's non-nil, nil otherwise.\nfunc (w *Workflows) GetWorkflows() []*Workflow {\n\tif w == nil || w.Workflows == nil {\n\t\treturn nil\n\t}\n\treturn w.Workflows\n}\n\n// GetParameters returns the Parameters field.\nfunc (w *WorkflowsBranchRule) GetParameters() WorkflowsRuleParameters {\n\tif w == nil {\n\t\treturn WorkflowsRuleParameters{}\n\t}\n\treturn w.Parameters\n}\n\n// GetRequireApprovalForForkPRWorkflows returns the RequireApprovalForForkPRWorkflows field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowsPermissions) GetRequireApprovalForForkPRWorkflows() bool {\n\tif w == nil || w.RequireApprovalForForkPRWorkflows == nil {\n\t\treturn false\n\t}\n\treturn *w.RequireApprovalForForkPRWorkflows\n}\n\n// GetRunWorkflowsFromForkPullRequests returns the RunWorkflowsFromForkPullRequests field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowsPermissions) GetRunWorkflowsFromForkPullRequests() bool {\n\tif w == nil || w.RunWorkflowsFromForkPullRequests == nil {\n\t\treturn false\n\t}\n\treturn *w.RunWorkflowsFromForkPullRequests\n}\n\n// GetSendSecretsAndVariables returns the SendSecretsAndVariables field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowsPermissions) GetSendSecretsAndVariables() bool {\n\tif w == nil || w.SendSecretsAndVariables == nil {\n\t\treturn false\n\t}\n\treturn *w.SendSecretsAndVariables\n}\n\n// GetSendWriteTokensToWorkflows returns the SendWriteTokensToWorkflows field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowsPermissions) GetSendWriteTokensToWorkflows() bool {\n\tif w == nil || w.SendWriteTokensToWorkflows == nil {\n\t\treturn false\n\t}\n\treturn *w.SendWriteTokensToWorkflows\n}\n\n// GetRequireApprovalForForkPRWorkflows returns the RequireApprovalForForkPRWorkflows field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowsPermissionsOpt) GetRequireApprovalForForkPRWorkflows() bool {\n\tif w == nil || w.RequireApprovalForForkPRWorkflows == nil {\n\t\treturn false\n\t}\n\treturn *w.RequireApprovalForForkPRWorkflows\n}\n\n// GetRunWorkflowsFromForkPullRequests returns the RunWorkflowsFromForkPullRequests field.\nfunc (w *WorkflowsPermissionsOpt) GetRunWorkflowsFromForkPullRequests() bool {\n\tif w == nil {\n\t\treturn false\n\t}\n\treturn w.RunWorkflowsFromForkPullRequests\n}\n\n// GetSendSecretsAndVariables returns the SendSecretsAndVariables field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowsPermissionsOpt) GetSendSecretsAndVariables() bool {\n\tif w == nil || w.SendSecretsAndVariables == nil {\n\t\treturn false\n\t}\n\treturn *w.SendSecretsAndVariables\n}\n\n// GetSendWriteTokensToWorkflows returns the SendWriteTokensToWorkflows field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowsPermissionsOpt) GetSendWriteTokensToWorkflows() bool {\n\tif w == nil || w.SendWriteTokensToWorkflows == nil {\n\t\treturn false\n\t}\n\treturn *w.SendWriteTokensToWorkflows\n}\n\n// GetDoNotEnforceOnCreate returns the DoNotEnforceOnCreate field if it's non-nil, zero value otherwise.\nfunc (w *WorkflowsRuleParameters) GetDoNotEnforceOnCreate() bool {\n\tif w == nil || w.DoNotEnforceOnCreate == nil {\n\t\treturn false\n\t}\n\treturn *w.DoNotEnforceOnCreate\n}\n\n// GetWorkflows returns the Workflows slice if it's non-nil, nil otherwise.\nfunc (w *WorkflowsRuleParameters) GetWorkflows() []*RuleWorkflow {\n\tif w == nil || w.Workflows == nil {\n\t\treturn nil\n\t}\n\treturn w.Workflows\n}\n\n// GetBillable returns the Billable field.\nfunc (w *WorkflowUsage) GetBillable() *WorkflowBillMap {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.Billable\n}\n"
  },
  {
    "path": "github/github-accessors_test.go",
    "content": "// Code generated by gen-accessors; DO NOT EDIT.\n// Instead, please run \"go generate ./...\" as described here:\n// https://github.com/google/go-github/blob/master/CONTRIBUTING.md#submitting-a-patch\n\n// Copyright 2017 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestAbuseRateLimitError_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AbuseRateLimitError{}\n\ta.GetMessage()\n\ta = nil\n\ta.GetMessage()\n}\n\nfunc TestAbuseRateLimitError_GetRetryAfter(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue time.Duration\n\ta := &AbuseRateLimitError{RetryAfter: &zeroValue}\n\ta.GetRetryAfter()\n\ta = &AbuseRateLimitError{}\n\ta.GetRetryAfter()\n\ta = nil\n\ta.GetRetryAfter()\n}\n\nfunc TestAcceptedAssignment_GetAssignment(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AcceptedAssignment{}\n\ta.GetAssignment()\n\ta = nil\n\ta.GetAssignment()\n}\n\nfunc TestAcceptedAssignment_GetCommitCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ta := &AcceptedAssignment{CommitCount: &zeroValue}\n\ta.GetCommitCount()\n\ta = &AcceptedAssignment{}\n\ta.GetCommitCount()\n\ta = nil\n\ta.GetCommitCount()\n}\n\nfunc TestAcceptedAssignment_GetGrade(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AcceptedAssignment{Grade: &zeroValue}\n\ta.GetGrade()\n\ta = &AcceptedAssignment{}\n\ta.GetGrade()\n\ta = nil\n\ta.GetGrade()\n}\n\nfunc TestAcceptedAssignment_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ta := &AcceptedAssignment{ID: &zeroValue}\n\ta.GetID()\n\ta = &AcceptedAssignment{}\n\ta.GetID()\n\ta = nil\n\ta.GetID()\n}\n\nfunc TestAcceptedAssignment_GetPassing(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ta := &AcceptedAssignment{Passing: &zeroValue}\n\ta.GetPassing()\n\ta = &AcceptedAssignment{}\n\ta.GetPassing()\n\ta = nil\n\ta.GetPassing()\n}\n\nfunc TestAcceptedAssignment_GetRepository(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AcceptedAssignment{}\n\ta.GetRepository()\n\ta = nil\n\ta.GetRepository()\n}\n\nfunc TestAcceptedAssignment_GetStudents(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*ClassroomUser{}\n\ta := &AcceptedAssignment{Students: zeroValue}\n\ta.GetStudents()\n\ta = &AcceptedAssignment{}\n\ta.GetStudents()\n\ta = nil\n\ta.GetStudents()\n}\n\nfunc TestAcceptedAssignment_GetSubmitted(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ta := &AcceptedAssignment{Submitted: &zeroValue}\n\ta.GetSubmitted()\n\ta = &AcceptedAssignment{}\n\ta.GetSubmitted()\n\ta = nil\n\ta.GetSubmitted()\n}\n\nfunc TestAcceptedError_GetRaw(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []byte{}\n\ta := &AcceptedError{Raw: zeroValue}\n\ta.GetRaw()\n\ta = &AcceptedError{}\n\ta.GetRaw()\n\ta = nil\n\ta.GetRaw()\n}\n\nfunc TestAccessibleRepository_GetFullName(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AccessibleRepository{}\n\ta.GetFullName()\n\ta = nil\n\ta.GetFullName()\n}\n\nfunc TestAccessibleRepository_GetID(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AccessibleRepository{}\n\ta.GetID()\n\ta = nil\n\ta.GetID()\n}\n\nfunc TestAccessibleRepository_GetName(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AccessibleRepository{}\n\ta.GetName()\n\ta = nil\n\ta.GetName()\n}\n\nfunc TestActionsAllowed_GetGithubOwnedAllowed(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ta := &ActionsAllowed{GithubOwnedAllowed: &zeroValue}\n\ta.GetGithubOwnedAllowed()\n\ta = &ActionsAllowed{}\n\ta.GetGithubOwnedAllowed()\n\ta = nil\n\ta.GetGithubOwnedAllowed()\n}\n\nfunc TestActionsAllowed_GetPatternsAllowed(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ta := &ActionsAllowed{PatternsAllowed: zeroValue}\n\ta.GetPatternsAllowed()\n\ta = &ActionsAllowed{}\n\ta.GetPatternsAllowed()\n\ta = nil\n\ta.GetPatternsAllowed()\n}\n\nfunc TestActionsAllowed_GetVerifiedAllowed(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ta := &ActionsAllowed{VerifiedAllowed: &zeroValue}\n\ta.GetVerifiedAllowed()\n\ta = &ActionsAllowed{}\n\ta.GetVerifiedAllowed()\n\ta = nil\n\ta.GetVerifiedAllowed()\n}\n\nfunc TestActionsCache_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ta := &ActionsCache{CreatedAt: &zeroValue}\n\ta.GetCreatedAt()\n\ta = &ActionsCache{}\n\ta.GetCreatedAt()\n\ta = nil\n\ta.GetCreatedAt()\n}\n\nfunc TestActionsCache_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ta := &ActionsCache{ID: &zeroValue}\n\ta.GetID()\n\ta = &ActionsCache{}\n\ta.GetID()\n\ta = nil\n\ta.GetID()\n}\n\nfunc TestActionsCache_GetKey(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ActionsCache{Key: &zeroValue}\n\ta.GetKey()\n\ta = &ActionsCache{}\n\ta.GetKey()\n\ta = nil\n\ta.GetKey()\n}\n\nfunc TestActionsCache_GetLastAccessedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ta := &ActionsCache{LastAccessedAt: &zeroValue}\n\ta.GetLastAccessedAt()\n\ta = &ActionsCache{}\n\ta.GetLastAccessedAt()\n\ta = nil\n\ta.GetLastAccessedAt()\n}\n\nfunc TestActionsCache_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ActionsCache{Ref: &zeroValue}\n\ta.GetRef()\n\ta = &ActionsCache{}\n\ta.GetRef()\n\ta = nil\n\ta.GetRef()\n}\n\nfunc TestActionsCache_GetSizeInBytes(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ta := &ActionsCache{SizeInBytes: &zeroValue}\n\ta.GetSizeInBytes()\n\ta = &ActionsCache{}\n\ta.GetSizeInBytes()\n\ta = nil\n\ta.GetSizeInBytes()\n}\n\nfunc TestActionsCache_GetVersion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ActionsCache{Version: &zeroValue}\n\ta.GetVersion()\n\ta = &ActionsCache{}\n\ta.GetVersion()\n\ta = nil\n\ta.GetVersion()\n}\n\nfunc TestActionsCacheList_GetActionsCaches(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*ActionsCache{}\n\ta := &ActionsCacheList{ActionsCaches: zeroValue}\n\ta.GetActionsCaches()\n\ta = &ActionsCacheList{}\n\ta.GetActionsCaches()\n\ta = nil\n\ta.GetActionsCaches()\n}\n\nfunc TestActionsCacheList_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\ta := &ActionsCacheList{}\n\ta.GetTotalCount()\n\ta = nil\n\ta.GetTotalCount()\n}\n\nfunc TestActionsCacheListOptions_GetDirection(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ActionsCacheListOptions{Direction: &zeroValue}\n\ta.GetDirection()\n\ta = &ActionsCacheListOptions{}\n\ta.GetDirection()\n\ta = nil\n\ta.GetDirection()\n}\n\nfunc TestActionsCacheListOptions_GetKey(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ActionsCacheListOptions{Key: &zeroValue}\n\ta.GetKey()\n\ta = &ActionsCacheListOptions{}\n\ta.GetKey()\n\ta = nil\n\ta.GetKey()\n}\n\nfunc TestActionsCacheListOptions_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ActionsCacheListOptions{Ref: &zeroValue}\n\ta.GetRef()\n\ta = &ActionsCacheListOptions{}\n\ta.GetRef()\n\ta = nil\n\ta.GetRef()\n}\n\nfunc TestActionsCacheListOptions_GetSort(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ActionsCacheListOptions{Sort: &zeroValue}\n\ta.GetSort()\n\ta = &ActionsCacheListOptions{}\n\ta.GetSort()\n\ta = nil\n\ta.GetSort()\n}\n\nfunc TestActionsCacheUsage_GetActiveCachesCount(tt *testing.T) {\n\ttt.Parallel()\n\ta := &ActionsCacheUsage{}\n\ta.GetActiveCachesCount()\n\ta = nil\n\ta.GetActiveCachesCount()\n}\n\nfunc TestActionsCacheUsage_GetActiveCachesSizeInBytes(tt *testing.T) {\n\ttt.Parallel()\n\ta := &ActionsCacheUsage{}\n\ta.GetActiveCachesSizeInBytes()\n\ta = nil\n\ta.GetActiveCachesSizeInBytes()\n}\n\nfunc TestActionsCacheUsage_GetFullName(tt *testing.T) {\n\ttt.Parallel()\n\ta := &ActionsCacheUsage{}\n\ta.GetFullName()\n\ta = nil\n\ta.GetFullName()\n}\n\nfunc TestActionsCacheUsageList_GetRepoCacheUsage(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*ActionsCacheUsage{}\n\ta := &ActionsCacheUsageList{RepoCacheUsage: zeroValue}\n\ta.GetRepoCacheUsage()\n\ta = &ActionsCacheUsageList{}\n\ta.GetRepoCacheUsage()\n\ta = nil\n\ta.GetRepoCacheUsage()\n}\n\nfunc TestActionsCacheUsageList_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\ta := &ActionsCacheUsageList{}\n\ta.GetTotalCount()\n\ta = nil\n\ta.GetTotalCount()\n}\n\nfunc TestActionsEnabledOnEnterpriseRepos_GetOrganizations(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Organization{}\n\ta := &ActionsEnabledOnEnterpriseRepos{Organizations: zeroValue}\n\ta.GetOrganizations()\n\ta = &ActionsEnabledOnEnterpriseRepos{}\n\ta.GetOrganizations()\n\ta = nil\n\ta.GetOrganizations()\n}\n\nfunc TestActionsEnabledOnEnterpriseRepos_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\ta := &ActionsEnabledOnEnterpriseRepos{}\n\ta.GetTotalCount()\n\ta = nil\n\ta.GetTotalCount()\n}\n\nfunc TestActionsEnabledOnOrgRepos_GetRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Repository{}\n\ta := &ActionsEnabledOnOrgRepos{Repositories: zeroValue}\n\ta.GetRepositories()\n\ta = &ActionsEnabledOnOrgRepos{}\n\ta.GetRepositories()\n\ta = nil\n\ta.GetRepositories()\n}\n\nfunc TestActionsEnabledOnOrgRepos_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\ta := &ActionsEnabledOnOrgRepos{}\n\ta.GetTotalCount()\n\ta = nil\n\ta.GetTotalCount()\n}\n\nfunc TestActionsInboundDomains_GetFullDomains(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ta := &ActionsInboundDomains{FullDomains: zeroValue}\n\ta.GetFullDomains()\n\ta = &ActionsInboundDomains{}\n\ta.GetFullDomains()\n\ta = nil\n\ta.GetFullDomains()\n}\n\nfunc TestActionsInboundDomains_GetWildcardDomains(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ta := &ActionsInboundDomains{WildcardDomains: zeroValue}\n\ta.GetWildcardDomains()\n\ta = &ActionsInboundDomains{}\n\ta.GetWildcardDomains()\n\ta = nil\n\ta.GetWildcardDomains()\n}\n\nfunc TestActionsPermissions_GetAllowedActions(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ActionsPermissions{AllowedActions: &zeroValue}\n\ta.GetAllowedActions()\n\ta = &ActionsPermissions{}\n\ta.GetAllowedActions()\n\ta = nil\n\ta.GetAllowedActions()\n}\n\nfunc TestActionsPermissions_GetEnabledRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ActionsPermissions{EnabledRepositories: &zeroValue}\n\ta.GetEnabledRepositories()\n\ta = &ActionsPermissions{}\n\ta.GetEnabledRepositories()\n\ta = nil\n\ta.GetEnabledRepositories()\n}\n\nfunc TestActionsPermissions_GetSelectedActionsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ActionsPermissions{SelectedActionsURL: &zeroValue}\n\ta.GetSelectedActionsURL()\n\ta = &ActionsPermissions{}\n\ta.GetSelectedActionsURL()\n\ta = nil\n\ta.GetSelectedActionsURL()\n}\n\nfunc TestActionsPermissions_GetSHAPinningRequired(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ta := &ActionsPermissions{SHAPinningRequired: &zeroValue}\n\ta.GetSHAPinningRequired()\n\ta = &ActionsPermissions{}\n\ta.GetSHAPinningRequired()\n\ta = nil\n\ta.GetSHAPinningRequired()\n}\n\nfunc TestActionsPermissionsEnterprise_GetAllowedActions(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ActionsPermissionsEnterprise{AllowedActions: &zeroValue}\n\ta.GetAllowedActions()\n\ta = &ActionsPermissionsEnterprise{}\n\ta.GetAllowedActions()\n\ta = nil\n\ta.GetAllowedActions()\n}\n\nfunc TestActionsPermissionsEnterprise_GetEnabledOrganizations(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ActionsPermissionsEnterprise{EnabledOrganizations: &zeroValue}\n\ta.GetEnabledOrganizations()\n\ta = &ActionsPermissionsEnterprise{}\n\ta.GetEnabledOrganizations()\n\ta = nil\n\ta.GetEnabledOrganizations()\n}\n\nfunc TestActionsPermissionsEnterprise_GetSelectedActionsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ActionsPermissionsEnterprise{SelectedActionsURL: &zeroValue}\n\ta.GetSelectedActionsURL()\n\ta = &ActionsPermissionsEnterprise{}\n\ta.GetSelectedActionsURL()\n\ta = nil\n\ta.GetSelectedActionsURL()\n}\n\nfunc TestActionsPermissionsRepository_GetAllowedActions(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ActionsPermissionsRepository{AllowedActions: &zeroValue}\n\ta.GetAllowedActions()\n\ta = &ActionsPermissionsRepository{}\n\ta.GetAllowedActions()\n\ta = nil\n\ta.GetAllowedActions()\n}\n\nfunc TestActionsPermissionsRepository_GetEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ta := &ActionsPermissionsRepository{Enabled: &zeroValue}\n\ta.GetEnabled()\n\ta = &ActionsPermissionsRepository{}\n\ta.GetEnabled()\n\ta = nil\n\ta.GetEnabled()\n}\n\nfunc TestActionsPermissionsRepository_GetSelectedActionsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ActionsPermissionsRepository{SelectedActionsURL: &zeroValue}\n\ta.GetSelectedActionsURL()\n\ta = &ActionsPermissionsRepository{}\n\ta.GetSelectedActionsURL()\n\ta = nil\n\ta.GetSelectedActionsURL()\n}\n\nfunc TestActionsPermissionsRepository_GetSHAPinningRequired(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ta := &ActionsPermissionsRepository{SHAPinningRequired: &zeroValue}\n\ta.GetSHAPinningRequired()\n\ta = &ActionsPermissionsRepository{}\n\ta.GetSHAPinningRequired()\n\ta = nil\n\ta.GetSHAPinningRequired()\n}\n\nfunc TestActionsVariable_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ta := &ActionsVariable{CreatedAt: &zeroValue}\n\ta.GetCreatedAt()\n\ta = &ActionsVariable{}\n\ta.GetCreatedAt()\n\ta = nil\n\ta.GetCreatedAt()\n}\n\nfunc TestActionsVariable_GetName(tt *testing.T) {\n\ttt.Parallel()\n\ta := &ActionsVariable{}\n\ta.GetName()\n\ta = nil\n\ta.GetName()\n}\n\nfunc TestActionsVariable_GetSelectedRepositoriesURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ActionsVariable{SelectedRepositoriesURL: &zeroValue}\n\ta.GetSelectedRepositoriesURL()\n\ta = &ActionsVariable{}\n\ta.GetSelectedRepositoriesURL()\n\ta = nil\n\ta.GetSelectedRepositoriesURL()\n}\n\nfunc TestActionsVariable_GetSelectedRepositoryIDs(tt *testing.T) {\n\ttt.Parallel()\n\ta := &ActionsVariable{}\n\ta.GetSelectedRepositoryIDs()\n\ta = nil\n\ta.GetSelectedRepositoryIDs()\n}\n\nfunc TestActionsVariable_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ta := &ActionsVariable{UpdatedAt: &zeroValue}\n\ta.GetUpdatedAt()\n\ta = &ActionsVariable{}\n\ta.GetUpdatedAt()\n\ta = nil\n\ta.GetUpdatedAt()\n}\n\nfunc TestActionsVariable_GetValue(tt *testing.T) {\n\ttt.Parallel()\n\ta := &ActionsVariable{}\n\ta.GetValue()\n\ta = nil\n\ta.GetValue()\n}\n\nfunc TestActionsVariable_GetVisibility(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ActionsVariable{Visibility: &zeroValue}\n\ta.GetVisibility()\n\ta = &ActionsVariable{}\n\ta.GetVisibility()\n\ta = nil\n\ta.GetVisibility()\n}\n\nfunc TestActionsVariables_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\ta := &ActionsVariables{}\n\ta.GetTotalCount()\n\ta = nil\n\ta.GetTotalCount()\n}\n\nfunc TestActionsVariables_GetVariables(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*ActionsVariable{}\n\ta := &ActionsVariables{Variables: zeroValue}\n\ta.GetVariables()\n\ta = &ActionsVariables{}\n\ta.GetVariables()\n\ta = nil\n\ta.GetVariables()\n}\n\nfunc TestActiveCommitters_GetMaximumAdvancedSecurityCommitters(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ta := &ActiveCommitters{MaximumAdvancedSecurityCommitters: &zeroValue}\n\ta.GetMaximumAdvancedSecurityCommitters()\n\ta = &ActiveCommitters{}\n\ta.GetMaximumAdvancedSecurityCommitters()\n\ta = nil\n\ta.GetMaximumAdvancedSecurityCommitters()\n}\n\nfunc TestActiveCommitters_GetPurchasedAdvancedSecurityCommitters(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ta := &ActiveCommitters{PurchasedAdvancedSecurityCommitters: &zeroValue}\n\ta.GetPurchasedAdvancedSecurityCommitters()\n\ta = &ActiveCommitters{}\n\ta.GetPurchasedAdvancedSecurityCommitters()\n\ta = nil\n\ta.GetPurchasedAdvancedSecurityCommitters()\n}\n\nfunc TestActiveCommitters_GetRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*RepositoryActiveCommitters{}\n\ta := &ActiveCommitters{Repositories: zeroValue}\n\ta.GetRepositories()\n\ta = &ActiveCommitters{}\n\ta.GetRepositories()\n\ta = nil\n\ta.GetRepositories()\n}\n\nfunc TestActiveCommitters_GetTotalAdvancedSecurityCommitters(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ta := &ActiveCommitters{TotalAdvancedSecurityCommitters: &zeroValue}\n\ta.GetTotalAdvancedSecurityCommitters()\n\ta = &ActiveCommitters{}\n\ta.GetTotalAdvancedSecurityCommitters()\n\ta = nil\n\ta.GetTotalAdvancedSecurityCommitters()\n}\n\nfunc TestActiveCommitters_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ta := &ActiveCommitters{TotalCount: &zeroValue}\n\ta.GetTotalCount()\n\ta = &ActiveCommitters{}\n\ta.GetTotalCount()\n\ta = nil\n\ta.GetTotalCount()\n}\n\nfunc TestActiveCommittersListOptions_GetAdvancedSecurityProduct(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ActiveCommittersListOptions{AdvancedSecurityProduct: &zeroValue}\n\ta.GetAdvancedSecurityProduct()\n\ta = &ActiveCommittersListOptions{}\n\ta.GetAdvancedSecurityProduct()\n\ta = nil\n\ta.GetAdvancedSecurityProduct()\n}\n\nfunc TestActivityListStarredOptions_GetDirection(tt *testing.T) {\n\ttt.Parallel()\n\ta := &ActivityListStarredOptions{}\n\ta.GetDirection()\n\ta = nil\n\ta.GetDirection()\n}\n\nfunc TestActivityListStarredOptions_GetSort(tt *testing.T) {\n\ttt.Parallel()\n\ta := &ActivityListStarredOptions{}\n\ta.GetSort()\n\ta = nil\n\ta.GetSort()\n}\n\nfunc TestActorLocation_GetCountryCode(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ActorLocation{CountryCode: &zeroValue}\n\ta.GetCountryCode()\n\ta = &ActorLocation{}\n\ta.GetCountryCode()\n\ta = nil\n\ta.GetCountryCode()\n}\n\nfunc TestAddProjectItemOptions_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ta := &AddProjectItemOptions{ID: &zeroValue}\n\ta.GetID()\n\ta = &AddProjectItemOptions{}\n\ta.GetID()\n\ta = nil\n\ta.GetID()\n}\n\nfunc TestAddProjectItemOptions_GetType(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AddProjectItemOptions{}\n\ta.GetType()\n\ta = nil\n\ta.GetType()\n}\n\nfunc TestAddResourcesToCostCenterResponse_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AddResourcesToCostCenterResponse{Message: &zeroValue}\n\ta.GetMessage()\n\ta = &AddResourcesToCostCenterResponse{}\n\ta.GetMessage()\n\ta = nil\n\ta.GetMessage()\n}\n\nfunc TestAddResourcesToCostCenterResponse_GetReassignedResources(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*ReassignedResource{}\n\ta := &AddResourcesToCostCenterResponse{ReassignedResources: zeroValue}\n\ta.GetReassignedResources()\n\ta = &AddResourcesToCostCenterResponse{}\n\ta.GetReassignedResources()\n\ta = nil\n\ta.GetReassignedResources()\n}\n\nfunc TestAdminEnforcedChanges_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ta := &AdminEnforcedChanges{From: &zeroValue}\n\ta.GetFrom()\n\ta = &AdminEnforcedChanges{}\n\ta.GetFrom()\n\ta = nil\n\ta.GetFrom()\n}\n\nfunc TestAdminEnforcement_GetEnabled(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AdminEnforcement{}\n\ta.GetEnabled()\n\ta = nil\n\ta.GetEnabled()\n}\n\nfunc TestAdminEnforcement_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AdminEnforcement{URL: &zeroValue}\n\ta.GetURL()\n\ta = &AdminEnforcement{}\n\ta.GetURL()\n\ta = nil\n\ta.GetURL()\n}\n\nfunc TestAdminStats_GetComments(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AdminStats{}\n\ta.GetComments()\n\ta = nil\n\ta.GetComments()\n}\n\nfunc TestAdminStats_GetGists(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AdminStats{}\n\ta.GetGists()\n\ta = nil\n\ta.GetGists()\n}\n\nfunc TestAdminStats_GetHooks(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AdminStats{}\n\ta.GetHooks()\n\ta = nil\n\ta.GetHooks()\n}\n\nfunc TestAdminStats_GetIssues(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AdminStats{}\n\ta.GetIssues()\n\ta = nil\n\ta.GetIssues()\n}\n\nfunc TestAdminStats_GetMilestones(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AdminStats{}\n\ta.GetMilestones()\n\ta = nil\n\ta.GetMilestones()\n}\n\nfunc TestAdminStats_GetOrgs(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AdminStats{}\n\ta.GetOrgs()\n\ta = nil\n\ta.GetOrgs()\n}\n\nfunc TestAdminStats_GetPages(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AdminStats{}\n\ta.GetPages()\n\ta = nil\n\ta.GetPages()\n}\n\nfunc TestAdminStats_GetPulls(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AdminStats{}\n\ta.GetPulls()\n\ta = nil\n\ta.GetPulls()\n}\n\nfunc TestAdminStats_GetRepos(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AdminStats{}\n\ta.GetRepos()\n\ta = nil\n\ta.GetRepos()\n}\n\nfunc TestAdminStats_GetUsers(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AdminStats{}\n\ta.GetUsers()\n\ta = nil\n\ta.GetUsers()\n}\n\nfunc TestAdvancedSecurity_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AdvancedSecurity{Status: &zeroValue}\n\ta.GetStatus()\n\ta = &AdvancedSecurity{}\n\ta.GetStatus()\n\ta = nil\n\ta.GetStatus()\n}\n\nfunc TestAdvancedSecurityCommittersBreakdown_GetLastPushedDate(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AdvancedSecurityCommittersBreakdown{}\n\ta.GetLastPushedDate()\n\ta = nil\n\ta.GetLastPushedDate()\n}\n\nfunc TestAdvancedSecurityCommittersBreakdown_GetLastPushedEmail(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AdvancedSecurityCommittersBreakdown{}\n\ta.GetLastPushedEmail()\n\ta = nil\n\ta.GetLastPushedEmail()\n}\n\nfunc TestAdvancedSecurityCommittersBreakdown_GetUserLogin(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AdvancedSecurityCommittersBreakdown{}\n\ta.GetUserLogin()\n\ta = nil\n\ta.GetUserLogin()\n}\n\nfunc TestAdvisoryCVSS_GetScore(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue float64\n\ta := &AdvisoryCVSS{Score: &zeroValue}\n\ta.GetScore()\n\ta = &AdvisoryCVSS{}\n\ta.GetScore()\n\ta = nil\n\ta.GetScore()\n}\n\nfunc TestAdvisoryCVSS_GetVectorString(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AdvisoryCVSS{VectorString: &zeroValue}\n\ta.GetVectorString()\n\ta = &AdvisoryCVSS{}\n\ta.GetVectorString()\n\ta = nil\n\ta.GetVectorString()\n}\n\nfunc TestAdvisoryCWEs_GetCWEID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AdvisoryCWEs{CWEID: &zeroValue}\n\ta.GetCWEID()\n\ta = &AdvisoryCWEs{}\n\ta.GetCWEID()\n\ta = nil\n\ta.GetCWEID()\n}\n\nfunc TestAdvisoryCWEs_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AdvisoryCWEs{Name: &zeroValue}\n\ta.GetName()\n\ta = &AdvisoryCWEs{}\n\ta.GetName()\n\ta = nil\n\ta.GetName()\n}\n\nfunc TestAdvisoryEPSS_GetPercentage(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AdvisoryEPSS{}\n\ta.GetPercentage()\n\ta = nil\n\ta.GetPercentage()\n}\n\nfunc TestAdvisoryEPSS_GetPercentile(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AdvisoryEPSS{}\n\ta.GetPercentile()\n\ta = nil\n\ta.GetPercentile()\n}\n\nfunc TestAdvisoryIdentifier_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AdvisoryIdentifier{Type: &zeroValue}\n\ta.GetType()\n\ta = &AdvisoryIdentifier{}\n\ta.GetType()\n\ta = nil\n\ta.GetType()\n}\n\nfunc TestAdvisoryIdentifier_GetValue(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AdvisoryIdentifier{Value: &zeroValue}\n\ta.GetValue()\n\ta = &AdvisoryIdentifier{}\n\ta.GetValue()\n\ta = nil\n\ta.GetValue()\n}\n\nfunc TestAdvisoryReference_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AdvisoryReference{URL: &zeroValue}\n\ta.GetURL()\n\ta = &AdvisoryReference{}\n\ta.GetURL()\n\ta = nil\n\ta.GetURL()\n}\n\nfunc TestAdvisoryVulnerability_GetFirstPatchedVersion(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AdvisoryVulnerability{}\n\ta.GetFirstPatchedVersion()\n\ta = nil\n\ta.GetFirstPatchedVersion()\n}\n\nfunc TestAdvisoryVulnerability_GetPackage(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AdvisoryVulnerability{}\n\ta.GetPackage()\n\ta = nil\n\ta.GetPackage()\n}\n\nfunc TestAdvisoryVulnerability_GetPatchedVersions(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AdvisoryVulnerability{PatchedVersions: &zeroValue}\n\ta.GetPatchedVersions()\n\ta = &AdvisoryVulnerability{}\n\ta.GetPatchedVersions()\n\ta = nil\n\ta.GetPatchedVersions()\n}\n\nfunc TestAdvisoryVulnerability_GetSeverity(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AdvisoryVulnerability{Severity: &zeroValue}\n\ta.GetSeverity()\n\ta = &AdvisoryVulnerability{}\n\ta.GetSeverity()\n\ta = nil\n\ta.GetSeverity()\n}\n\nfunc TestAdvisoryVulnerability_GetVulnerableFunctions(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ta := &AdvisoryVulnerability{VulnerableFunctions: zeroValue}\n\ta.GetVulnerableFunctions()\n\ta = &AdvisoryVulnerability{}\n\ta.GetVulnerableFunctions()\n\ta = nil\n\ta.GetVulnerableFunctions()\n}\n\nfunc TestAdvisoryVulnerability_GetVulnerableVersionRange(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AdvisoryVulnerability{VulnerableVersionRange: &zeroValue}\n\ta.GetVulnerableVersionRange()\n\ta = &AdvisoryVulnerability{}\n\ta.GetVulnerableVersionRange()\n\ta = nil\n\ta.GetVulnerableVersionRange()\n}\n\nfunc TestAlert_GetClosedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ta := &Alert{ClosedAt: &zeroValue}\n\ta.GetClosedAt()\n\ta = &Alert{}\n\ta.GetClosedAt()\n\ta = nil\n\ta.GetClosedAt()\n}\n\nfunc TestAlert_GetClosedBy(tt *testing.T) {\n\ttt.Parallel()\n\ta := &Alert{}\n\ta.GetClosedBy()\n\ta = nil\n\ta.GetClosedBy()\n}\n\nfunc TestAlert_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ta := &Alert{CreatedAt: &zeroValue}\n\ta.GetCreatedAt()\n\ta = &Alert{}\n\ta.GetCreatedAt()\n\ta = nil\n\ta.GetCreatedAt()\n}\n\nfunc TestAlert_GetDismissedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ta := &Alert{DismissedAt: &zeroValue}\n\ta.GetDismissedAt()\n\ta = &Alert{}\n\ta.GetDismissedAt()\n\ta = nil\n\ta.GetDismissedAt()\n}\n\nfunc TestAlert_GetDismissedBy(tt *testing.T) {\n\ttt.Parallel()\n\ta := &Alert{}\n\ta.GetDismissedBy()\n\ta = nil\n\ta.GetDismissedBy()\n}\n\nfunc TestAlert_GetDismissedComment(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &Alert{DismissedComment: &zeroValue}\n\ta.GetDismissedComment()\n\ta = &Alert{}\n\ta.GetDismissedComment()\n\ta = nil\n\ta.GetDismissedComment()\n}\n\nfunc TestAlert_GetDismissedReason(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &Alert{DismissedReason: &zeroValue}\n\ta.GetDismissedReason()\n\ta = &Alert{}\n\ta.GetDismissedReason()\n\ta = nil\n\ta.GetDismissedReason()\n}\n\nfunc TestAlert_GetFixedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ta := &Alert{FixedAt: &zeroValue}\n\ta.GetFixedAt()\n\ta = &Alert{}\n\ta.GetFixedAt()\n\ta = nil\n\ta.GetFixedAt()\n}\n\nfunc TestAlert_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &Alert{HTMLURL: &zeroValue}\n\ta.GetHTMLURL()\n\ta = &Alert{}\n\ta.GetHTMLURL()\n\ta = nil\n\ta.GetHTMLURL()\n}\n\nfunc TestAlert_GetInstances(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*MostRecentInstance{}\n\ta := &Alert{Instances: zeroValue}\n\ta.GetInstances()\n\ta = &Alert{}\n\ta.GetInstances()\n\ta = nil\n\ta.GetInstances()\n}\n\nfunc TestAlert_GetInstancesURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &Alert{InstancesURL: &zeroValue}\n\ta.GetInstancesURL()\n\ta = &Alert{}\n\ta.GetInstancesURL()\n\ta = nil\n\ta.GetInstancesURL()\n}\n\nfunc TestAlert_GetMostRecentInstance(tt *testing.T) {\n\ttt.Parallel()\n\ta := &Alert{}\n\ta.GetMostRecentInstance()\n\ta = nil\n\ta.GetMostRecentInstance()\n}\n\nfunc TestAlert_GetNumber(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ta := &Alert{Number: &zeroValue}\n\ta.GetNumber()\n\ta = &Alert{}\n\ta.GetNumber()\n\ta = nil\n\ta.GetNumber()\n}\n\nfunc TestAlert_GetRepository(tt *testing.T) {\n\ttt.Parallel()\n\ta := &Alert{}\n\ta.GetRepository()\n\ta = nil\n\ta.GetRepository()\n}\n\nfunc TestAlert_GetRule(tt *testing.T) {\n\ttt.Parallel()\n\ta := &Alert{}\n\ta.GetRule()\n\ta = nil\n\ta.GetRule()\n}\n\nfunc TestAlert_GetRuleDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &Alert{RuleDescription: &zeroValue}\n\ta.GetRuleDescription()\n\ta = &Alert{}\n\ta.GetRuleDescription()\n\ta = nil\n\ta.GetRuleDescription()\n}\n\nfunc TestAlert_GetRuleID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &Alert{RuleID: &zeroValue}\n\ta.GetRuleID()\n\ta = &Alert{}\n\ta.GetRuleID()\n\ta = nil\n\ta.GetRuleID()\n}\n\nfunc TestAlert_GetRuleSeverity(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &Alert{RuleSeverity: &zeroValue}\n\ta.GetRuleSeverity()\n\ta = &Alert{}\n\ta.GetRuleSeverity()\n\ta = nil\n\ta.GetRuleSeverity()\n}\n\nfunc TestAlert_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &Alert{State: &zeroValue}\n\ta.GetState()\n\ta = &Alert{}\n\ta.GetState()\n\ta = nil\n\ta.GetState()\n}\n\nfunc TestAlert_GetTool(tt *testing.T) {\n\ttt.Parallel()\n\ta := &Alert{}\n\ta.GetTool()\n\ta = nil\n\ta.GetTool()\n}\n\nfunc TestAlert_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ta := &Alert{UpdatedAt: &zeroValue}\n\ta.GetUpdatedAt()\n\ta = &Alert{}\n\ta.GetUpdatedAt()\n\ta = nil\n\ta.GetUpdatedAt()\n}\n\nfunc TestAlert_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &Alert{URL: &zeroValue}\n\ta.GetURL()\n\ta = &Alert{}\n\ta.GetURL()\n\ta = nil\n\ta.GetURL()\n}\n\nfunc TestAlertInstancesListOptions_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AlertInstancesListOptions{}\n\ta.GetRef()\n\ta = nil\n\ta.GetRef()\n}\n\nfunc TestAlertListOptions_GetDirection(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AlertListOptions{}\n\ta.GetDirection()\n\ta = nil\n\ta.GetDirection()\n}\n\nfunc TestAlertListOptions_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AlertListOptions{}\n\ta.GetRef()\n\ta = nil\n\ta.GetRef()\n}\n\nfunc TestAlertListOptions_GetSeverity(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AlertListOptions{}\n\ta.GetSeverity()\n\ta = nil\n\ta.GetSeverity()\n}\n\nfunc TestAlertListOptions_GetSort(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AlertListOptions{}\n\ta.GetSort()\n\ta = nil\n\ta.GetSort()\n}\n\nfunc TestAlertListOptions_GetState(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AlertListOptions{}\n\ta.GetState()\n\ta = nil\n\ta.GetState()\n}\n\nfunc TestAlertListOptions_GetToolGUID(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AlertListOptions{}\n\ta.GetToolGUID()\n\ta = nil\n\ta.GetToolGUID()\n}\n\nfunc TestAlertListOptions_GetToolName(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AlertListOptions{}\n\ta.GetToolName()\n\ta = nil\n\ta.GetToolName()\n}\n\nfunc TestAllowDeletions_GetEnabled(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AllowDeletions{}\n\ta.GetEnabled()\n\ta = nil\n\ta.GetEnabled()\n}\n\nfunc TestAllowDeletionsEnforcementLevelChanges_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AllowDeletionsEnforcementLevelChanges{From: &zeroValue}\n\ta.GetFrom()\n\ta = &AllowDeletionsEnforcementLevelChanges{}\n\ta.GetFrom()\n\ta = nil\n\ta.GetFrom()\n}\n\nfunc TestAllowForcePushes_GetEnabled(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AllowForcePushes{}\n\ta.GetEnabled()\n\ta = nil\n\ta.GetEnabled()\n}\n\nfunc TestAllowForkSyncing_GetEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ta := &AllowForkSyncing{Enabled: &zeroValue}\n\ta.GetEnabled()\n\ta = &AllowForkSyncing{}\n\ta.GetEnabled()\n\ta = nil\n\ta.GetEnabled()\n}\n\nfunc TestAmazonS3AccessKeysConfig_GetAuthenticationType(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AmazonS3AccessKeysConfig{}\n\ta.GetAuthenticationType()\n\ta = nil\n\ta.GetAuthenticationType()\n}\n\nfunc TestAmazonS3AccessKeysConfig_GetBucket(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AmazonS3AccessKeysConfig{}\n\ta.GetBucket()\n\ta = nil\n\ta.GetBucket()\n}\n\nfunc TestAmazonS3AccessKeysConfig_GetEncryptedAccessKeyID(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AmazonS3AccessKeysConfig{}\n\ta.GetEncryptedAccessKeyID()\n\ta = nil\n\ta.GetEncryptedAccessKeyID()\n}\n\nfunc TestAmazonS3AccessKeysConfig_GetEncryptedSecretKey(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AmazonS3AccessKeysConfig{}\n\ta.GetEncryptedSecretKey()\n\ta = nil\n\ta.GetEncryptedSecretKey()\n}\n\nfunc TestAmazonS3AccessKeysConfig_GetKeyID(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AmazonS3AccessKeysConfig{}\n\ta.GetKeyID()\n\ta = nil\n\ta.GetKeyID()\n}\n\nfunc TestAmazonS3AccessKeysConfig_GetRegion(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AmazonS3AccessKeysConfig{}\n\ta.GetRegion()\n\ta = nil\n\ta.GetRegion()\n}\n\nfunc TestAmazonS3OIDCConfig_GetArnRole(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AmazonS3OIDCConfig{}\n\ta.GetArnRole()\n\ta = nil\n\ta.GetArnRole()\n}\n\nfunc TestAmazonS3OIDCConfig_GetAuthenticationType(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AmazonS3OIDCConfig{}\n\ta.GetAuthenticationType()\n\ta = nil\n\ta.GetAuthenticationType()\n}\n\nfunc TestAmazonS3OIDCConfig_GetBucket(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AmazonS3OIDCConfig{}\n\ta.GetBucket()\n\ta = nil\n\ta.GetBucket()\n}\n\nfunc TestAmazonS3OIDCConfig_GetKeyID(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AmazonS3OIDCConfig{}\n\ta.GetKeyID()\n\ta = nil\n\ta.GetKeyID()\n}\n\nfunc TestAmazonS3OIDCConfig_GetRegion(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AmazonS3OIDCConfig{}\n\ta.GetRegion()\n\ta = nil\n\ta.GetRegion()\n}\n\nfunc TestAnalysesListOptions_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AnalysesListOptions{Ref: &zeroValue}\n\ta.GetRef()\n\ta = &AnalysesListOptions{}\n\ta.GetRef()\n\ta = nil\n\ta.GetRef()\n}\n\nfunc TestAnalysesListOptions_GetSarifID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AnalysesListOptions{SarifID: &zeroValue}\n\ta.GetSarifID()\n\ta = &AnalysesListOptions{}\n\ta.GetSarifID()\n\ta = nil\n\ta.GetSarifID()\n}\n\nfunc TestAPIMeta_GetActions(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ta := &APIMeta{Actions: zeroValue}\n\ta.GetActions()\n\ta = &APIMeta{}\n\ta.GetActions()\n\ta = nil\n\ta.GetActions()\n}\n\nfunc TestAPIMeta_GetActionsMacos(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ta := &APIMeta{ActionsMacos: zeroValue}\n\ta.GetActionsMacos()\n\ta = &APIMeta{}\n\ta.GetActionsMacos()\n\ta = nil\n\ta.GetActionsMacos()\n}\n\nfunc TestAPIMeta_GetAPI(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ta := &APIMeta{API: zeroValue}\n\ta.GetAPI()\n\ta = &APIMeta{}\n\ta.GetAPI()\n\ta = nil\n\ta.GetAPI()\n}\n\nfunc TestAPIMeta_GetCodespaces(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ta := &APIMeta{Codespaces: zeroValue}\n\ta.GetCodespaces()\n\ta = &APIMeta{}\n\ta.GetCodespaces()\n\ta = nil\n\ta.GetCodespaces()\n}\n\nfunc TestAPIMeta_GetCopilot(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ta := &APIMeta{Copilot: zeroValue}\n\ta.GetCopilot()\n\ta = &APIMeta{}\n\ta.GetCopilot()\n\ta = nil\n\ta.GetCopilot()\n}\n\nfunc TestAPIMeta_GetDependabot(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ta := &APIMeta{Dependabot: zeroValue}\n\ta.GetDependabot()\n\ta = &APIMeta{}\n\ta.GetDependabot()\n\ta = nil\n\ta.GetDependabot()\n}\n\nfunc TestAPIMeta_GetDomains(tt *testing.T) {\n\ttt.Parallel()\n\ta := &APIMeta{}\n\ta.GetDomains()\n\ta = nil\n\ta.GetDomains()\n}\n\nfunc TestAPIMeta_GetGit(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ta := &APIMeta{Git: zeroValue}\n\ta.GetGit()\n\ta = &APIMeta{}\n\ta.GetGit()\n\ta = nil\n\ta.GetGit()\n}\n\nfunc TestAPIMeta_GetGithubEnterpriseImporter(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ta := &APIMeta{GithubEnterpriseImporter: zeroValue}\n\ta.GetGithubEnterpriseImporter()\n\ta = &APIMeta{}\n\ta.GetGithubEnterpriseImporter()\n\ta = nil\n\ta.GetGithubEnterpriseImporter()\n}\n\nfunc TestAPIMeta_GetHooks(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ta := &APIMeta{Hooks: zeroValue}\n\ta.GetHooks()\n\ta = &APIMeta{}\n\ta.GetHooks()\n\ta = nil\n\ta.GetHooks()\n}\n\nfunc TestAPIMeta_GetImporter(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ta := &APIMeta{Importer: zeroValue}\n\ta.GetImporter()\n\ta = &APIMeta{}\n\ta.GetImporter()\n\ta = nil\n\ta.GetImporter()\n}\n\nfunc TestAPIMeta_GetPackages(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ta := &APIMeta{Packages: zeroValue}\n\ta.GetPackages()\n\ta = &APIMeta{}\n\ta.GetPackages()\n\ta = nil\n\ta.GetPackages()\n}\n\nfunc TestAPIMeta_GetPages(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ta := &APIMeta{Pages: zeroValue}\n\ta.GetPages()\n\ta = &APIMeta{}\n\ta.GetPages()\n\ta = nil\n\ta.GetPages()\n}\n\nfunc TestAPIMeta_GetSSHKeyFingerprints(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]string{}\n\ta := &APIMeta{SSHKeyFingerprints: zeroValue}\n\ta.GetSSHKeyFingerprints()\n\ta = &APIMeta{}\n\ta.GetSSHKeyFingerprints()\n\ta = nil\n\ta.GetSSHKeyFingerprints()\n}\n\nfunc TestAPIMeta_GetSSHKeys(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ta := &APIMeta{SSHKeys: zeroValue}\n\ta.GetSSHKeys()\n\ta = &APIMeta{}\n\ta.GetSSHKeys()\n\ta = nil\n\ta.GetSSHKeys()\n}\n\nfunc TestAPIMeta_GetVerifiablePasswordAuthentication(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ta := &APIMeta{VerifiablePasswordAuthentication: &zeroValue}\n\ta.GetVerifiablePasswordAuthentication()\n\ta = &APIMeta{}\n\ta.GetVerifiablePasswordAuthentication()\n\ta = nil\n\ta.GetVerifiablePasswordAuthentication()\n}\n\nfunc TestAPIMeta_GetWeb(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ta := &APIMeta{Web: zeroValue}\n\ta.GetWeb()\n\ta = &APIMeta{}\n\ta.GetWeb()\n\ta = nil\n\ta.GetWeb()\n}\n\nfunc TestAPIMetaArtifactAttestations_GetServices(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ta := &APIMetaArtifactAttestations{Services: zeroValue}\n\ta.GetServices()\n\ta = &APIMetaArtifactAttestations{}\n\ta.GetServices()\n\ta = nil\n\ta.GetServices()\n}\n\nfunc TestAPIMetaArtifactAttestations_GetTrustDomain(tt *testing.T) {\n\ttt.Parallel()\n\ta := &APIMetaArtifactAttestations{}\n\ta.GetTrustDomain()\n\ta = nil\n\ta.GetTrustDomain()\n}\n\nfunc TestAPIMetaDomains_GetActions(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ta := &APIMetaDomains{Actions: zeroValue}\n\ta.GetActions()\n\ta = &APIMetaDomains{}\n\ta.GetActions()\n\ta = nil\n\ta.GetActions()\n}\n\nfunc TestAPIMetaDomains_GetActionsInbound(tt *testing.T) {\n\ttt.Parallel()\n\ta := &APIMetaDomains{}\n\ta.GetActionsInbound()\n\ta = nil\n\ta.GetActionsInbound()\n}\n\nfunc TestAPIMetaDomains_GetArtifactAttestations(tt *testing.T) {\n\ttt.Parallel()\n\ta := &APIMetaDomains{}\n\ta.GetArtifactAttestations()\n\ta = nil\n\ta.GetArtifactAttestations()\n}\n\nfunc TestAPIMetaDomains_GetCodespaces(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ta := &APIMetaDomains{Codespaces: zeroValue}\n\ta.GetCodespaces()\n\ta = &APIMetaDomains{}\n\ta.GetCodespaces()\n\ta = nil\n\ta.GetCodespaces()\n}\n\nfunc TestAPIMetaDomains_GetCopilot(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ta := &APIMetaDomains{Copilot: zeroValue}\n\ta.GetCopilot()\n\ta = &APIMetaDomains{}\n\ta.GetCopilot()\n\ta = nil\n\ta.GetCopilot()\n}\n\nfunc TestAPIMetaDomains_GetPackages(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ta := &APIMetaDomains{Packages: zeroValue}\n\ta.GetPackages()\n\ta = &APIMetaDomains{}\n\ta.GetPackages()\n\ta = nil\n\ta.GetPackages()\n}\n\nfunc TestAPIMetaDomains_GetWebsite(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ta := &APIMetaDomains{Website: zeroValue}\n\ta.GetWebsite()\n\ta = &APIMetaDomains{}\n\ta.GetWebsite()\n\ta = nil\n\ta.GetWebsite()\n}\n\nfunc TestApp_GetClientID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &App{ClientID: &zeroValue}\n\ta.GetClientID()\n\ta = &App{}\n\ta.GetClientID()\n\ta = nil\n\ta.GetClientID()\n}\n\nfunc TestApp_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ta := &App{CreatedAt: &zeroValue}\n\ta.GetCreatedAt()\n\ta = &App{}\n\ta.GetCreatedAt()\n\ta = nil\n\ta.GetCreatedAt()\n}\n\nfunc TestApp_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &App{Description: &zeroValue}\n\ta.GetDescription()\n\ta = &App{}\n\ta.GetDescription()\n\ta = nil\n\ta.GetDescription()\n}\n\nfunc TestApp_GetEvents(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ta := &App{Events: zeroValue}\n\ta.GetEvents()\n\ta = &App{}\n\ta.GetEvents()\n\ta = nil\n\ta.GetEvents()\n}\n\nfunc TestApp_GetExternalURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &App{ExternalURL: &zeroValue}\n\ta.GetExternalURL()\n\ta = &App{}\n\ta.GetExternalURL()\n\ta = nil\n\ta.GetExternalURL()\n}\n\nfunc TestApp_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &App{HTMLURL: &zeroValue}\n\ta.GetHTMLURL()\n\ta = &App{}\n\ta.GetHTMLURL()\n\ta = nil\n\ta.GetHTMLURL()\n}\n\nfunc TestApp_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ta := &App{ID: &zeroValue}\n\ta.GetID()\n\ta = &App{}\n\ta.GetID()\n\ta = nil\n\ta.GetID()\n}\n\nfunc TestApp_GetInstallationsCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ta := &App{InstallationsCount: &zeroValue}\n\ta.GetInstallationsCount()\n\ta = &App{}\n\ta.GetInstallationsCount()\n\ta = nil\n\ta.GetInstallationsCount()\n}\n\nfunc TestApp_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &App{Name: &zeroValue}\n\ta.GetName()\n\ta = &App{}\n\ta.GetName()\n\ta = nil\n\ta.GetName()\n}\n\nfunc TestApp_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &App{NodeID: &zeroValue}\n\ta.GetNodeID()\n\ta = &App{}\n\ta.GetNodeID()\n\ta = nil\n\ta.GetNodeID()\n}\n\nfunc TestApp_GetOwner(tt *testing.T) {\n\ttt.Parallel()\n\ta := &App{}\n\ta.GetOwner()\n\ta = nil\n\ta.GetOwner()\n}\n\nfunc TestApp_GetPermissions(tt *testing.T) {\n\ttt.Parallel()\n\ta := &App{}\n\ta.GetPermissions()\n\ta = nil\n\ta.GetPermissions()\n}\n\nfunc TestApp_GetSlug(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &App{Slug: &zeroValue}\n\ta.GetSlug()\n\ta = &App{}\n\ta.GetSlug()\n\ta = nil\n\ta.GetSlug()\n}\n\nfunc TestApp_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ta := &App{UpdatedAt: &zeroValue}\n\ta.GetUpdatedAt()\n\ta = &App{}\n\ta.GetUpdatedAt()\n\ta = nil\n\ta.GetUpdatedAt()\n}\n\nfunc TestAppConfig_GetClientID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AppConfig{ClientID: &zeroValue}\n\ta.GetClientID()\n\ta = &AppConfig{}\n\ta.GetClientID()\n\ta = nil\n\ta.GetClientID()\n}\n\nfunc TestAppConfig_GetClientSecret(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AppConfig{ClientSecret: &zeroValue}\n\ta.GetClientSecret()\n\ta = &AppConfig{}\n\ta.GetClientSecret()\n\ta = nil\n\ta.GetClientSecret()\n}\n\nfunc TestAppConfig_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ta := &AppConfig{CreatedAt: &zeroValue}\n\ta.GetCreatedAt()\n\ta = &AppConfig{}\n\ta.GetCreatedAt()\n\ta = nil\n\ta.GetCreatedAt()\n}\n\nfunc TestAppConfig_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AppConfig{Description: &zeroValue}\n\ta.GetDescription()\n\ta = &AppConfig{}\n\ta.GetDescription()\n\ta = nil\n\ta.GetDescription()\n}\n\nfunc TestAppConfig_GetExternalURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AppConfig{ExternalURL: &zeroValue}\n\ta.GetExternalURL()\n\ta = &AppConfig{}\n\ta.GetExternalURL()\n\ta = nil\n\ta.GetExternalURL()\n}\n\nfunc TestAppConfig_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AppConfig{HTMLURL: &zeroValue}\n\ta.GetHTMLURL()\n\ta = &AppConfig{}\n\ta.GetHTMLURL()\n\ta = nil\n\ta.GetHTMLURL()\n}\n\nfunc TestAppConfig_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ta := &AppConfig{ID: &zeroValue}\n\ta.GetID()\n\ta = &AppConfig{}\n\ta.GetID()\n\ta = nil\n\ta.GetID()\n}\n\nfunc TestAppConfig_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AppConfig{Name: &zeroValue}\n\ta.GetName()\n\ta = &AppConfig{}\n\ta.GetName()\n\ta = nil\n\ta.GetName()\n}\n\nfunc TestAppConfig_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AppConfig{NodeID: &zeroValue}\n\ta.GetNodeID()\n\ta = &AppConfig{}\n\ta.GetNodeID()\n\ta = nil\n\ta.GetNodeID()\n}\n\nfunc TestAppConfig_GetOwner(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AppConfig{}\n\ta.GetOwner()\n\ta = nil\n\ta.GetOwner()\n}\n\nfunc TestAppConfig_GetPEM(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AppConfig{PEM: &zeroValue}\n\ta.GetPEM()\n\ta = &AppConfig{}\n\ta.GetPEM()\n\ta = nil\n\ta.GetPEM()\n}\n\nfunc TestAppConfig_GetSlug(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AppConfig{Slug: &zeroValue}\n\ta.GetSlug()\n\ta = &AppConfig{}\n\ta.GetSlug()\n\ta = nil\n\ta.GetSlug()\n}\n\nfunc TestAppConfig_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ta := &AppConfig{UpdatedAt: &zeroValue}\n\ta.GetUpdatedAt()\n\ta = &AppConfig{}\n\ta.GetUpdatedAt()\n\ta = nil\n\ta.GetUpdatedAt()\n}\n\nfunc TestAppConfig_GetWebhookSecret(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AppConfig{WebhookSecret: &zeroValue}\n\ta.GetWebhookSecret()\n\ta = &AppConfig{}\n\ta.GetWebhookSecret()\n\ta = nil\n\ta.GetWebhookSecret()\n}\n\nfunc TestAppInstallationRepositoriesOptions_GetSelectedRepositoryIDs(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []int64{}\n\ta := &AppInstallationRepositoriesOptions{SelectedRepositoryIDs: zeroValue}\n\ta.GetSelectedRepositoryIDs()\n\ta = &AppInstallationRepositoriesOptions{}\n\ta.GetSelectedRepositoryIDs()\n\ta = nil\n\ta.GetSelectedRepositoryIDs()\n}\n\nfunc TestArchivedAt_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ta := &ArchivedAt{From: &zeroValue}\n\ta.GetFrom()\n\ta = &ArchivedAt{}\n\ta.GetFrom()\n\ta = nil\n\ta.GetFrom()\n}\n\nfunc TestArchivedAt_GetTo(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ta := &ArchivedAt{To: &zeroValue}\n\ta.GetTo()\n\ta = &ArchivedAt{}\n\ta.GetTo()\n\ta = nil\n\ta.GetTo()\n}\n\nfunc TestArtifact_GetArchiveDownloadURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &Artifact{ArchiveDownloadURL: &zeroValue}\n\ta.GetArchiveDownloadURL()\n\ta = &Artifact{}\n\ta.GetArchiveDownloadURL()\n\ta = nil\n\ta.GetArchiveDownloadURL()\n}\n\nfunc TestArtifact_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ta := &Artifact{CreatedAt: &zeroValue}\n\ta.GetCreatedAt()\n\ta = &Artifact{}\n\ta.GetCreatedAt()\n\ta = nil\n\ta.GetCreatedAt()\n}\n\nfunc TestArtifact_GetDigest(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &Artifact{Digest: &zeroValue}\n\ta.GetDigest()\n\ta = &Artifact{}\n\ta.GetDigest()\n\ta = nil\n\ta.GetDigest()\n}\n\nfunc TestArtifact_GetExpired(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ta := &Artifact{Expired: &zeroValue}\n\ta.GetExpired()\n\ta = &Artifact{}\n\ta.GetExpired()\n\ta = nil\n\ta.GetExpired()\n}\n\nfunc TestArtifact_GetExpiresAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ta := &Artifact{ExpiresAt: &zeroValue}\n\ta.GetExpiresAt()\n\ta = &Artifact{}\n\ta.GetExpiresAt()\n\ta = nil\n\ta.GetExpiresAt()\n}\n\nfunc TestArtifact_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ta := &Artifact{ID: &zeroValue}\n\ta.GetID()\n\ta = &Artifact{}\n\ta.GetID()\n\ta = nil\n\ta.GetID()\n}\n\nfunc TestArtifact_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &Artifact{Name: &zeroValue}\n\ta.GetName()\n\ta = &Artifact{}\n\ta.GetName()\n\ta = nil\n\ta.GetName()\n}\n\nfunc TestArtifact_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &Artifact{NodeID: &zeroValue}\n\ta.GetNodeID()\n\ta = &Artifact{}\n\ta.GetNodeID()\n\ta = nil\n\ta.GetNodeID()\n}\n\nfunc TestArtifact_GetSizeInBytes(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ta := &Artifact{SizeInBytes: &zeroValue}\n\ta.GetSizeInBytes()\n\ta = &Artifact{}\n\ta.GetSizeInBytes()\n\ta = nil\n\ta.GetSizeInBytes()\n}\n\nfunc TestArtifact_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ta := &Artifact{UpdatedAt: &zeroValue}\n\ta.GetUpdatedAt()\n\ta = &Artifact{}\n\ta.GetUpdatedAt()\n\ta = nil\n\ta.GetUpdatedAt()\n}\n\nfunc TestArtifact_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &Artifact{URL: &zeroValue}\n\ta.GetURL()\n\ta = &Artifact{}\n\ta.GetURL()\n\ta = nil\n\ta.GetURL()\n}\n\nfunc TestArtifact_GetWorkflowRun(tt *testing.T) {\n\ttt.Parallel()\n\ta := &Artifact{}\n\ta.GetWorkflowRun()\n\ta = nil\n\ta.GetWorkflowRun()\n}\n\nfunc TestArtifactDeploymentRecord_GetAttestationID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ta := &ArtifactDeploymentRecord{AttestationID: &zeroValue}\n\ta.GetAttestationID()\n\ta = &ArtifactDeploymentRecord{}\n\ta.GetAttestationID()\n\ta = nil\n\ta.GetAttestationID()\n}\n\nfunc TestArtifactDeploymentRecord_GetCluster(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ArtifactDeploymentRecord{Cluster: &zeroValue}\n\ta.GetCluster()\n\ta = &ArtifactDeploymentRecord{}\n\ta.GetCluster()\n\ta = nil\n\ta.GetCluster()\n}\n\nfunc TestArtifactDeploymentRecord_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ta := &ArtifactDeploymentRecord{CreatedAt: &zeroValue}\n\ta.GetCreatedAt()\n\ta = &ArtifactDeploymentRecord{}\n\ta.GetCreatedAt()\n\ta = nil\n\ta.GetCreatedAt()\n}\n\nfunc TestArtifactDeploymentRecord_GetDeploymentName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ArtifactDeploymentRecord{DeploymentName: &zeroValue}\n\ta.GetDeploymentName()\n\ta = &ArtifactDeploymentRecord{}\n\ta.GetDeploymentName()\n\ta = nil\n\ta.GetDeploymentName()\n}\n\nfunc TestArtifactDeploymentRecord_GetDigest(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ArtifactDeploymentRecord{Digest: &zeroValue}\n\ta.GetDigest()\n\ta = &ArtifactDeploymentRecord{}\n\ta.GetDigest()\n\ta = nil\n\ta.GetDigest()\n}\n\nfunc TestArtifactDeploymentRecord_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ta := &ArtifactDeploymentRecord{ID: &zeroValue}\n\ta.GetID()\n\ta = &ArtifactDeploymentRecord{}\n\ta.GetID()\n\ta = nil\n\ta.GetID()\n}\n\nfunc TestArtifactDeploymentRecord_GetLogicalEnvironment(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ArtifactDeploymentRecord{LogicalEnvironment: &zeroValue}\n\ta.GetLogicalEnvironment()\n\ta = &ArtifactDeploymentRecord{}\n\ta.GetLogicalEnvironment()\n\ta = nil\n\ta.GetLogicalEnvironment()\n}\n\nfunc TestArtifactDeploymentRecord_GetPhysicalEnvironment(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ArtifactDeploymentRecord{PhysicalEnvironment: &zeroValue}\n\ta.GetPhysicalEnvironment()\n\ta = &ArtifactDeploymentRecord{}\n\ta.GetPhysicalEnvironment()\n\ta = nil\n\ta.GetPhysicalEnvironment()\n}\n\nfunc TestArtifactDeploymentRecord_GetRuntimeRisks(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []DeploymentRuntimeRisk{}\n\ta := &ArtifactDeploymentRecord{RuntimeRisks: zeroValue}\n\ta.GetRuntimeRisks()\n\ta = &ArtifactDeploymentRecord{}\n\ta.GetRuntimeRisks()\n\ta = nil\n\ta.GetRuntimeRisks()\n}\n\nfunc TestArtifactDeploymentRecord_GetTags(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]string{}\n\ta := &ArtifactDeploymentRecord{Tags: zeroValue}\n\ta.GetTags()\n\ta = &ArtifactDeploymentRecord{}\n\ta.GetTags()\n\ta = nil\n\ta.GetTags()\n}\n\nfunc TestArtifactDeploymentRecord_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ta := &ArtifactDeploymentRecord{UpdatedAt: &zeroValue}\n\ta.GetUpdatedAt()\n\ta = &ArtifactDeploymentRecord{}\n\ta.GetUpdatedAt()\n\ta = nil\n\ta.GetUpdatedAt()\n}\n\nfunc TestArtifactDeploymentResponse_GetDeploymentRecords(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*ArtifactDeploymentRecord{}\n\ta := &ArtifactDeploymentResponse{DeploymentRecords: zeroValue}\n\ta.GetDeploymentRecords()\n\ta = &ArtifactDeploymentResponse{}\n\ta.GetDeploymentRecords()\n\ta = nil\n\ta.GetDeploymentRecords()\n}\n\nfunc TestArtifactDeploymentResponse_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ta := &ArtifactDeploymentResponse{TotalCount: &zeroValue}\n\ta.GetTotalCount()\n\ta = &ArtifactDeploymentResponse{}\n\ta.GetTotalCount()\n\ta = nil\n\ta.GetTotalCount()\n}\n\nfunc TestArtifactList_GetArtifacts(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Artifact{}\n\ta := &ArtifactList{Artifacts: zeroValue}\n\ta.GetArtifacts()\n\ta = &ArtifactList{}\n\ta.GetArtifacts()\n\ta = nil\n\ta.GetArtifacts()\n}\n\nfunc TestArtifactList_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ta := &ArtifactList{TotalCount: &zeroValue}\n\ta.GetTotalCount()\n\ta = &ArtifactList{}\n\ta.GetTotalCount()\n\ta = nil\n\ta.GetTotalCount()\n}\n\nfunc TestArtifactPeriod_GetDays(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ta := &ArtifactPeriod{Days: &zeroValue}\n\ta.GetDays()\n\ta = &ArtifactPeriod{}\n\ta.GetDays()\n\ta = nil\n\ta.GetDays()\n}\n\nfunc TestArtifactPeriod_GetMaximumAllowedDays(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ta := &ArtifactPeriod{MaximumAllowedDays: &zeroValue}\n\ta.GetMaximumAllowedDays()\n\ta = &ArtifactPeriod{}\n\ta.GetMaximumAllowedDays()\n\ta = nil\n\ta.GetMaximumAllowedDays()\n}\n\nfunc TestArtifactPeriodOpt_GetDays(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ta := &ArtifactPeriodOpt{Days: &zeroValue}\n\ta.GetDays()\n\ta = &ArtifactPeriodOpt{}\n\ta.GetDays()\n\ta = nil\n\ta.GetDays()\n}\n\nfunc TestArtifactStorageRecord_GetArtifactURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ArtifactStorageRecord{ArtifactURL: &zeroValue}\n\ta.GetArtifactURL()\n\ta = &ArtifactStorageRecord{}\n\ta.GetArtifactURL()\n\ta = nil\n\ta.GetArtifactURL()\n}\n\nfunc TestArtifactStorageRecord_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ta := &ArtifactStorageRecord{CreatedAt: &zeroValue}\n\ta.GetCreatedAt()\n\ta = &ArtifactStorageRecord{}\n\ta.GetCreatedAt()\n\ta = nil\n\ta.GetCreatedAt()\n}\n\nfunc TestArtifactStorageRecord_GetDigest(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ArtifactStorageRecord{Digest: &zeroValue}\n\ta.GetDigest()\n\ta = &ArtifactStorageRecord{}\n\ta.GetDigest()\n\ta = nil\n\ta.GetDigest()\n}\n\nfunc TestArtifactStorageRecord_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ta := &ArtifactStorageRecord{ID: &zeroValue}\n\ta.GetID()\n\ta = &ArtifactStorageRecord{}\n\ta.GetID()\n\ta = nil\n\ta.GetID()\n}\n\nfunc TestArtifactStorageRecord_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ArtifactStorageRecord{Name: &zeroValue}\n\ta.GetName()\n\ta = &ArtifactStorageRecord{}\n\ta.GetName()\n\ta = nil\n\ta.GetName()\n}\n\nfunc TestArtifactStorageRecord_GetRegistryURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ArtifactStorageRecord{RegistryURL: &zeroValue}\n\ta.GetRegistryURL()\n\ta = &ArtifactStorageRecord{}\n\ta.GetRegistryURL()\n\ta = nil\n\ta.GetRegistryURL()\n}\n\nfunc TestArtifactStorageRecord_GetRepository(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ArtifactStorageRecord{Repository: &zeroValue}\n\ta.GetRepository()\n\ta = &ArtifactStorageRecord{}\n\ta.GetRepository()\n\ta = nil\n\ta.GetRepository()\n}\n\nfunc TestArtifactStorageRecord_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ArtifactStorageRecord{Status: &zeroValue}\n\ta.GetStatus()\n\ta = &ArtifactStorageRecord{}\n\ta.GetStatus()\n\ta = nil\n\ta.GetStatus()\n}\n\nfunc TestArtifactStorageRecord_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ta := &ArtifactStorageRecord{UpdatedAt: &zeroValue}\n\ta.GetUpdatedAt()\n\ta = &ArtifactStorageRecord{}\n\ta.GetUpdatedAt()\n\ta = nil\n\ta.GetUpdatedAt()\n}\n\nfunc TestArtifactStorageResponse_GetStorageRecords(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*ArtifactStorageRecord{}\n\ta := &ArtifactStorageResponse{StorageRecords: zeroValue}\n\ta.GetStorageRecords()\n\ta = &ArtifactStorageResponse{}\n\ta.GetStorageRecords()\n\ta = nil\n\ta.GetStorageRecords()\n}\n\nfunc TestArtifactStorageResponse_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ta := &ArtifactStorageResponse{TotalCount: &zeroValue}\n\ta.GetTotalCount()\n\ta = &ArtifactStorageResponse{}\n\ta.GetTotalCount()\n\ta = nil\n\ta.GetTotalCount()\n}\n\nfunc TestArtifactWorkflowRun_GetHeadBranch(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ArtifactWorkflowRun{HeadBranch: &zeroValue}\n\ta.GetHeadBranch()\n\ta = &ArtifactWorkflowRun{}\n\ta.GetHeadBranch()\n\ta = nil\n\ta.GetHeadBranch()\n}\n\nfunc TestArtifactWorkflowRun_GetHeadRepositoryID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ta := &ArtifactWorkflowRun{HeadRepositoryID: &zeroValue}\n\ta.GetHeadRepositoryID()\n\ta = &ArtifactWorkflowRun{}\n\ta.GetHeadRepositoryID()\n\ta = nil\n\ta.GetHeadRepositoryID()\n}\n\nfunc TestArtifactWorkflowRun_GetHeadSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &ArtifactWorkflowRun{HeadSHA: &zeroValue}\n\ta.GetHeadSHA()\n\ta = &ArtifactWorkflowRun{}\n\ta.GetHeadSHA()\n\ta = nil\n\ta.GetHeadSHA()\n}\n\nfunc TestArtifactWorkflowRun_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ta := &ArtifactWorkflowRun{ID: &zeroValue}\n\ta.GetID()\n\ta = &ArtifactWorkflowRun{}\n\ta.GetID()\n\ta = nil\n\ta.GetID()\n}\n\nfunc TestArtifactWorkflowRun_GetRepositoryID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ta := &ArtifactWorkflowRun{RepositoryID: &zeroValue}\n\ta.GetRepositoryID()\n\ta = &ArtifactWorkflowRun{}\n\ta.GetRepositoryID()\n\ta = nil\n\ta.GetRepositoryID()\n}\n\nfunc TestAssignmentGrade_GetAssignmentName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AssignmentGrade{AssignmentName: &zeroValue}\n\ta.GetAssignmentName()\n\ta = &AssignmentGrade{}\n\ta.GetAssignmentName()\n\ta = nil\n\ta.GetAssignmentName()\n}\n\nfunc TestAssignmentGrade_GetAssignmentURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AssignmentGrade{AssignmentURL: &zeroValue}\n\ta.GetAssignmentURL()\n\ta = &AssignmentGrade{}\n\ta.GetAssignmentURL()\n\ta = nil\n\ta.GetAssignmentURL()\n}\n\nfunc TestAssignmentGrade_GetGithubUsername(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AssignmentGrade{GithubUsername: &zeroValue}\n\ta.GetGithubUsername()\n\ta = &AssignmentGrade{}\n\ta.GetGithubUsername()\n\ta = nil\n\ta.GetGithubUsername()\n}\n\nfunc TestAssignmentGrade_GetGroupName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AssignmentGrade{GroupName: &zeroValue}\n\ta.GetGroupName()\n\ta = &AssignmentGrade{}\n\ta.GetGroupName()\n\ta = nil\n\ta.GetGroupName()\n}\n\nfunc TestAssignmentGrade_GetPointsAvailable(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ta := &AssignmentGrade{PointsAvailable: &zeroValue}\n\ta.GetPointsAvailable()\n\ta = &AssignmentGrade{}\n\ta.GetPointsAvailable()\n\ta = nil\n\ta.GetPointsAvailable()\n}\n\nfunc TestAssignmentGrade_GetPointsAwarded(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ta := &AssignmentGrade{PointsAwarded: &zeroValue}\n\ta.GetPointsAwarded()\n\ta = &AssignmentGrade{}\n\ta.GetPointsAwarded()\n\ta = nil\n\ta.GetPointsAwarded()\n}\n\nfunc TestAssignmentGrade_GetRosterIdentifier(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AssignmentGrade{RosterIdentifier: &zeroValue}\n\ta.GetRosterIdentifier()\n\ta = &AssignmentGrade{}\n\ta.GetRosterIdentifier()\n\ta = nil\n\ta.GetRosterIdentifier()\n}\n\nfunc TestAssignmentGrade_GetStarterCodeURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AssignmentGrade{StarterCodeURL: &zeroValue}\n\ta.GetStarterCodeURL()\n\ta = &AssignmentGrade{}\n\ta.GetStarterCodeURL()\n\ta = nil\n\ta.GetStarterCodeURL()\n}\n\nfunc TestAssignmentGrade_GetStudentRepositoryName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AssignmentGrade{StudentRepositoryName: &zeroValue}\n\ta.GetStudentRepositoryName()\n\ta = &AssignmentGrade{}\n\ta.GetStudentRepositoryName()\n\ta = nil\n\ta.GetStudentRepositoryName()\n}\n\nfunc TestAssignmentGrade_GetStudentRepositoryURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AssignmentGrade{StudentRepositoryURL: &zeroValue}\n\ta.GetStudentRepositoryURL()\n\ta = &AssignmentGrade{}\n\ta.GetStudentRepositoryURL()\n\ta = nil\n\ta.GetStudentRepositoryURL()\n}\n\nfunc TestAssignmentGrade_GetSubmissionTimestamp(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ta := &AssignmentGrade{SubmissionTimestamp: &zeroValue}\n\ta.GetSubmissionTimestamp()\n\ta = &AssignmentGrade{}\n\ta.GetSubmissionTimestamp()\n\ta = nil\n\ta.GetSubmissionTimestamp()\n}\n\nfunc TestAttachment_GetBody(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &Attachment{Body: &zeroValue}\n\ta.GetBody()\n\ta = &Attachment{}\n\ta.GetBody()\n\ta = nil\n\ta.GetBody()\n}\n\nfunc TestAttachment_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ta := &Attachment{ID: &zeroValue}\n\ta.GetID()\n\ta = &Attachment{}\n\ta.GetID()\n\ta = nil\n\ta.GetID()\n}\n\nfunc TestAttachment_GetTitle(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &Attachment{Title: &zeroValue}\n\ta.GetTitle()\n\ta = &Attachment{}\n\ta.GetTitle()\n\ta = nil\n\ta.GetTitle()\n}\n\nfunc TestAttestation_GetBundle(tt *testing.T) {\n\ttt.Parallel()\n\ta := &Attestation{}\n\ta.GetBundle()\n\ta = nil\n\ta.GetBundle()\n}\n\nfunc TestAttestation_GetRepositoryID(tt *testing.T) {\n\ttt.Parallel()\n\ta := &Attestation{}\n\ta.GetRepositoryID()\n\ta = nil\n\ta.GetRepositoryID()\n}\n\nfunc TestAttestationsResponse_GetAttestations(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Attestation{}\n\ta := &AttestationsResponse{Attestations: zeroValue}\n\ta.GetAttestations()\n\ta = &AttestationsResponse{}\n\ta.GetAttestations()\n\ta = nil\n\ta.GetAttestations()\n}\n\nfunc TestAuditEntry_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AuditEntry{Action: &zeroValue}\n\ta.GetAction()\n\ta = &AuditEntry{}\n\ta.GetAction()\n\ta = nil\n\ta.GetAction()\n}\n\nfunc TestAuditEntry_GetActor(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AuditEntry{Actor: &zeroValue}\n\ta.GetActor()\n\ta = &AuditEntry{}\n\ta.GetActor()\n\ta = nil\n\ta.GetActor()\n}\n\nfunc TestAuditEntry_GetActorID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ta := &AuditEntry{ActorID: &zeroValue}\n\ta.GetActorID()\n\ta = &AuditEntry{}\n\ta.GetActorID()\n\ta = nil\n\ta.GetActorID()\n}\n\nfunc TestAuditEntry_GetActorLocation(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AuditEntry{}\n\ta.GetActorLocation()\n\ta = nil\n\ta.GetActorLocation()\n}\n\nfunc TestAuditEntry_GetAdditionalFields(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]any{}\n\ta := &AuditEntry{AdditionalFields: zeroValue}\n\ta.GetAdditionalFields()\n\ta = &AuditEntry{}\n\ta.GetAdditionalFields()\n\ta = nil\n\ta.GetAdditionalFields()\n}\n\nfunc TestAuditEntry_GetBusiness(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AuditEntry{Business: &zeroValue}\n\ta.GetBusiness()\n\ta = &AuditEntry{}\n\ta.GetBusiness()\n\ta = nil\n\ta.GetBusiness()\n}\n\nfunc TestAuditEntry_GetBusinessID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ta := &AuditEntry{BusinessID: &zeroValue}\n\ta.GetBusinessID()\n\ta = &AuditEntry{}\n\ta.GetBusinessID()\n\ta = nil\n\ta.GetBusinessID()\n}\n\nfunc TestAuditEntry_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ta := &AuditEntry{CreatedAt: &zeroValue}\n\ta.GetCreatedAt()\n\ta = &AuditEntry{}\n\ta.GetCreatedAt()\n\ta = nil\n\ta.GetCreatedAt()\n}\n\nfunc TestAuditEntry_GetData(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]any{}\n\ta := &AuditEntry{Data: zeroValue}\n\ta.GetData()\n\ta = &AuditEntry{}\n\ta.GetData()\n\ta = nil\n\ta.GetData()\n}\n\nfunc TestAuditEntry_GetDocumentID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AuditEntry{DocumentID: &zeroValue}\n\ta.GetDocumentID()\n\ta = &AuditEntry{}\n\ta.GetDocumentID()\n\ta = nil\n\ta.GetDocumentID()\n}\n\nfunc TestAuditEntry_GetExternalIdentityNameID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AuditEntry{ExternalIdentityNameID: &zeroValue}\n\ta.GetExternalIdentityNameID()\n\ta = &AuditEntry{}\n\ta.GetExternalIdentityNameID()\n\ta = nil\n\ta.GetExternalIdentityNameID()\n}\n\nfunc TestAuditEntry_GetExternalIdentityUsername(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AuditEntry{ExternalIdentityUsername: &zeroValue}\n\ta.GetExternalIdentityUsername()\n\ta = &AuditEntry{}\n\ta.GetExternalIdentityUsername()\n\ta = nil\n\ta.GetExternalIdentityUsername()\n}\n\nfunc TestAuditEntry_GetHashedToken(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AuditEntry{HashedToken: &zeroValue}\n\ta.GetHashedToken()\n\ta = &AuditEntry{}\n\ta.GetHashedToken()\n\ta = nil\n\ta.GetHashedToken()\n}\n\nfunc TestAuditEntry_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AuditEntry{Org: &zeroValue}\n\ta.GetOrg()\n\ta = &AuditEntry{}\n\ta.GetOrg()\n\ta = nil\n\ta.GetOrg()\n}\n\nfunc TestAuditEntry_GetOrgID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ta := &AuditEntry{OrgID: &zeroValue}\n\ta.GetOrgID()\n\ta = &AuditEntry{}\n\ta.GetOrgID()\n\ta = nil\n\ta.GetOrgID()\n}\n\nfunc TestAuditEntry_GetTimestamp(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ta := &AuditEntry{Timestamp: &zeroValue}\n\ta.GetTimestamp()\n\ta = &AuditEntry{}\n\ta.GetTimestamp()\n\ta = nil\n\ta.GetTimestamp()\n}\n\nfunc TestAuditEntry_GetTokenID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ta := &AuditEntry{TokenID: &zeroValue}\n\ta.GetTokenID()\n\ta = &AuditEntry{}\n\ta.GetTokenID()\n\ta = nil\n\ta.GetTokenID()\n}\n\nfunc TestAuditEntry_GetTokenScopes(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AuditEntry{TokenScopes: &zeroValue}\n\ta.GetTokenScopes()\n\ta = &AuditEntry{}\n\ta.GetTokenScopes()\n\ta = nil\n\ta.GetTokenScopes()\n}\n\nfunc TestAuditEntry_GetUser(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AuditEntry{User: &zeroValue}\n\ta.GetUser()\n\ta = &AuditEntry{}\n\ta.GetUser()\n\ta = nil\n\ta.GetUser()\n}\n\nfunc TestAuditEntry_GetUserID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ta := &AuditEntry{UserID: &zeroValue}\n\ta.GetUserID()\n\ta = &AuditEntry{}\n\ta.GetUserID()\n\ta = nil\n\ta.GetUserID()\n}\n\nfunc TestAuditLogStream_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AuditLogStream{}\n\ta.GetCreatedAt()\n\ta = nil\n\ta.GetCreatedAt()\n}\n\nfunc TestAuditLogStream_GetEnabled(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AuditLogStream{}\n\ta.GetEnabled()\n\ta = nil\n\ta.GetEnabled()\n}\n\nfunc TestAuditLogStream_GetID(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AuditLogStream{}\n\ta.GetID()\n\ta = nil\n\ta.GetID()\n}\n\nfunc TestAuditLogStream_GetPausedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ta := &AuditLogStream{PausedAt: &zeroValue}\n\ta.GetPausedAt()\n\ta = &AuditLogStream{}\n\ta.GetPausedAt()\n\ta = nil\n\ta.GetPausedAt()\n}\n\nfunc TestAuditLogStream_GetStreamDetails(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AuditLogStream{}\n\ta.GetStreamDetails()\n\ta = nil\n\ta.GetStreamDetails()\n}\n\nfunc TestAuditLogStream_GetStreamType(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AuditLogStream{}\n\ta.GetStreamType()\n\ta = nil\n\ta.GetStreamType()\n}\n\nfunc TestAuditLogStream_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AuditLogStream{}\n\ta.GetUpdatedAt()\n\ta = nil\n\ta.GetUpdatedAt()\n}\n\nfunc TestAuditLogStreamConfig_GetEnabled(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AuditLogStreamConfig{}\n\ta.GetEnabled()\n\ta = nil\n\ta.GetEnabled()\n}\n\nfunc TestAuditLogStreamConfig_GetStreamType(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AuditLogStreamConfig{}\n\ta.GetStreamType()\n\ta = nil\n\ta.GetStreamType()\n}\n\nfunc TestAuditLogStreamConfig_GetVendorSpecific(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AuditLogStreamConfig{}\n\ta.GetVendorSpecific()\n\ta = nil\n\ta.GetVendorSpecific()\n}\n\nfunc TestAuditLogStreamKey_GetKey(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AuditLogStreamKey{}\n\ta.GetKey()\n\ta = nil\n\ta.GetKey()\n}\n\nfunc TestAuditLogStreamKey_GetKeyID(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AuditLogStreamKey{}\n\ta.GetKeyID()\n\ta = nil\n\ta.GetKeyID()\n}\n\nfunc TestAuthorization_GetApp(tt *testing.T) {\n\ttt.Parallel()\n\ta := &Authorization{}\n\ta.GetApp()\n\ta = nil\n\ta.GetApp()\n}\n\nfunc TestAuthorization_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ta := &Authorization{CreatedAt: &zeroValue}\n\ta.GetCreatedAt()\n\ta = &Authorization{}\n\ta.GetCreatedAt()\n\ta = nil\n\ta.GetCreatedAt()\n}\n\nfunc TestAuthorization_GetFingerprint(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &Authorization{Fingerprint: &zeroValue}\n\ta.GetFingerprint()\n\ta = &Authorization{}\n\ta.GetFingerprint()\n\ta = nil\n\ta.GetFingerprint()\n}\n\nfunc TestAuthorization_GetHashedToken(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &Authorization{HashedToken: &zeroValue}\n\ta.GetHashedToken()\n\ta = &Authorization{}\n\ta.GetHashedToken()\n\ta = nil\n\ta.GetHashedToken()\n}\n\nfunc TestAuthorization_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ta := &Authorization{ID: &zeroValue}\n\ta.GetID()\n\ta = &Authorization{}\n\ta.GetID()\n\ta = nil\n\ta.GetID()\n}\n\nfunc TestAuthorization_GetNote(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &Authorization{Note: &zeroValue}\n\ta.GetNote()\n\ta = &Authorization{}\n\ta.GetNote()\n\ta = nil\n\ta.GetNote()\n}\n\nfunc TestAuthorization_GetNoteURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &Authorization{NoteURL: &zeroValue}\n\ta.GetNoteURL()\n\ta = &Authorization{}\n\ta.GetNoteURL()\n\ta = nil\n\ta.GetNoteURL()\n}\n\nfunc TestAuthorization_GetScopes(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []Scope{}\n\ta := &Authorization{Scopes: zeroValue}\n\ta.GetScopes()\n\ta = &Authorization{}\n\ta.GetScopes()\n\ta = nil\n\ta.GetScopes()\n}\n\nfunc TestAuthorization_GetToken(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &Authorization{Token: &zeroValue}\n\ta.GetToken()\n\ta = &Authorization{}\n\ta.GetToken()\n\ta = nil\n\ta.GetToken()\n}\n\nfunc TestAuthorization_GetTokenLastEight(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &Authorization{TokenLastEight: &zeroValue}\n\ta.GetTokenLastEight()\n\ta = &Authorization{}\n\ta.GetTokenLastEight()\n\ta = nil\n\ta.GetTokenLastEight()\n}\n\nfunc TestAuthorization_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ta := &Authorization{UpdatedAt: &zeroValue}\n\ta.GetUpdatedAt()\n\ta = &Authorization{}\n\ta.GetUpdatedAt()\n\ta = nil\n\ta.GetUpdatedAt()\n}\n\nfunc TestAuthorization_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &Authorization{URL: &zeroValue}\n\ta.GetURL()\n\ta = &Authorization{}\n\ta.GetURL()\n\ta = nil\n\ta.GetURL()\n}\n\nfunc TestAuthorization_GetUser(tt *testing.T) {\n\ttt.Parallel()\n\ta := &Authorization{}\n\ta.GetUser()\n\ta = nil\n\ta.GetUser()\n}\n\nfunc TestAuthorizationApp_GetClientID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AuthorizationApp{ClientID: &zeroValue}\n\ta.GetClientID()\n\ta = &AuthorizationApp{}\n\ta.GetClientID()\n\ta = nil\n\ta.GetClientID()\n}\n\nfunc TestAuthorizationApp_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AuthorizationApp{Name: &zeroValue}\n\ta.GetName()\n\ta = &AuthorizationApp{}\n\ta.GetName()\n\ta = nil\n\ta.GetName()\n}\n\nfunc TestAuthorizationApp_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AuthorizationApp{URL: &zeroValue}\n\ta.GetURL()\n\ta = &AuthorizationApp{}\n\ta.GetURL()\n\ta = nil\n\ta.GetURL()\n}\n\nfunc TestAuthorizationRequest_GetClientID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AuthorizationRequest{ClientID: &zeroValue}\n\ta.GetClientID()\n\ta = &AuthorizationRequest{}\n\ta.GetClientID()\n\ta = nil\n\ta.GetClientID()\n}\n\nfunc TestAuthorizationRequest_GetClientSecret(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AuthorizationRequest{ClientSecret: &zeroValue}\n\ta.GetClientSecret()\n\ta = &AuthorizationRequest{}\n\ta.GetClientSecret()\n\ta = nil\n\ta.GetClientSecret()\n}\n\nfunc TestAuthorizationRequest_GetFingerprint(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AuthorizationRequest{Fingerprint: &zeroValue}\n\ta.GetFingerprint()\n\ta = &AuthorizationRequest{}\n\ta.GetFingerprint()\n\ta = nil\n\ta.GetFingerprint()\n}\n\nfunc TestAuthorizationRequest_GetNote(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AuthorizationRequest{Note: &zeroValue}\n\ta.GetNote()\n\ta = &AuthorizationRequest{}\n\ta.GetNote()\n\ta = nil\n\ta.GetNote()\n}\n\nfunc TestAuthorizationRequest_GetNoteURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AuthorizationRequest{NoteURL: &zeroValue}\n\ta.GetNoteURL()\n\ta = &AuthorizationRequest{}\n\ta.GetNoteURL()\n\ta = nil\n\ta.GetNoteURL()\n}\n\nfunc TestAuthorizationRequest_GetScopes(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []Scope{}\n\ta := &AuthorizationRequest{Scopes: zeroValue}\n\ta.GetScopes()\n\ta = &AuthorizationRequest{}\n\ta.GetScopes()\n\ta = nil\n\ta.GetScopes()\n}\n\nfunc TestAuthorizationUpdateRequest_GetAddScopes(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ta := &AuthorizationUpdateRequest{AddScopes: zeroValue}\n\ta.GetAddScopes()\n\ta = &AuthorizationUpdateRequest{}\n\ta.GetAddScopes()\n\ta = nil\n\ta.GetAddScopes()\n}\n\nfunc TestAuthorizationUpdateRequest_GetFingerprint(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AuthorizationUpdateRequest{Fingerprint: &zeroValue}\n\ta.GetFingerprint()\n\ta = &AuthorizationUpdateRequest{}\n\ta.GetFingerprint()\n\ta = nil\n\ta.GetFingerprint()\n}\n\nfunc TestAuthorizationUpdateRequest_GetNote(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AuthorizationUpdateRequest{Note: &zeroValue}\n\ta.GetNote()\n\ta = &AuthorizationUpdateRequest{}\n\ta.GetNote()\n\ta = nil\n\ta.GetNote()\n}\n\nfunc TestAuthorizationUpdateRequest_GetNoteURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AuthorizationUpdateRequest{NoteURL: &zeroValue}\n\ta.GetNoteURL()\n\ta = &AuthorizationUpdateRequest{}\n\ta.GetNoteURL()\n\ta = nil\n\ta.GetNoteURL()\n}\n\nfunc TestAuthorizationUpdateRequest_GetRemoveScopes(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ta := &AuthorizationUpdateRequest{RemoveScopes: zeroValue}\n\ta.GetRemoveScopes()\n\ta = &AuthorizationUpdateRequest{}\n\ta.GetRemoveScopes()\n\ta = nil\n\ta.GetRemoveScopes()\n}\n\nfunc TestAuthorizationUpdateRequest_GetScopes(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ta := &AuthorizationUpdateRequest{Scopes: zeroValue}\n\ta.GetScopes()\n\ta = &AuthorizationUpdateRequest{}\n\ta.GetScopes()\n\ta = nil\n\ta.GetScopes()\n}\n\nfunc TestAuthorizedActorNames_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ta := &AuthorizedActorNames{From: zeroValue}\n\ta.GetFrom()\n\ta = &AuthorizedActorNames{}\n\ta.GetFrom()\n\ta = nil\n\ta.GetFrom()\n}\n\nfunc TestAuthorizedActorsOnly_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ta := &AuthorizedActorsOnly{From: &zeroValue}\n\ta.GetFrom()\n\ta = &AuthorizedActorsOnly{}\n\ta.GetFrom()\n\ta = nil\n\ta.GetFrom()\n}\n\nfunc TestAuthorizedDismissalActorsOnlyChanges_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ta := &AuthorizedDismissalActorsOnlyChanges{From: &zeroValue}\n\ta.GetFrom()\n\ta = &AuthorizedDismissalActorsOnlyChanges{}\n\ta.GetFrom()\n\ta = nil\n\ta.GetFrom()\n}\n\nfunc TestAutolink_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ta := &Autolink{ID: &zeroValue}\n\ta.GetID()\n\ta = &Autolink{}\n\ta.GetID()\n\ta = nil\n\ta.GetID()\n}\n\nfunc TestAutolink_GetIsAlphanumeric(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ta := &Autolink{IsAlphanumeric: &zeroValue}\n\ta.GetIsAlphanumeric()\n\ta = &Autolink{}\n\ta.GetIsAlphanumeric()\n\ta = nil\n\ta.GetIsAlphanumeric()\n}\n\nfunc TestAutolink_GetKeyPrefix(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &Autolink{KeyPrefix: &zeroValue}\n\ta.GetKeyPrefix()\n\ta = &Autolink{}\n\ta.GetKeyPrefix()\n\ta = nil\n\ta.GetKeyPrefix()\n}\n\nfunc TestAutolink_GetURLTemplate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &Autolink{URLTemplate: &zeroValue}\n\ta.GetURLTemplate()\n\ta = &Autolink{}\n\ta.GetURLTemplate()\n\ta = nil\n\ta.GetURLTemplate()\n}\n\nfunc TestAutolinkOptions_GetIsAlphanumeric(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ta := &AutolinkOptions{IsAlphanumeric: &zeroValue}\n\ta.GetIsAlphanumeric()\n\ta = &AutolinkOptions{}\n\ta.GetIsAlphanumeric()\n\ta = nil\n\ta.GetIsAlphanumeric()\n}\n\nfunc TestAutolinkOptions_GetKeyPrefix(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AutolinkOptions{KeyPrefix: &zeroValue}\n\ta.GetKeyPrefix()\n\ta = &AutolinkOptions{}\n\ta.GetKeyPrefix()\n\ta = nil\n\ta.GetKeyPrefix()\n}\n\nfunc TestAutolinkOptions_GetURLTemplate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ta := &AutolinkOptions{URLTemplate: &zeroValue}\n\ta.GetURLTemplate()\n\ta = &AutolinkOptions{}\n\ta.GetURLTemplate()\n\ta = nil\n\ta.GetURLTemplate()\n}\n\nfunc TestAutomatedSecurityFixes_GetEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ta := &AutomatedSecurityFixes{Enabled: &zeroValue}\n\ta.GetEnabled()\n\ta = &AutomatedSecurityFixes{}\n\ta.GetEnabled()\n\ta = nil\n\ta.GetEnabled()\n}\n\nfunc TestAutomatedSecurityFixes_GetPaused(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ta := &AutomatedSecurityFixes{Paused: &zeroValue}\n\ta.GetPaused()\n\ta = &AutomatedSecurityFixes{}\n\ta.GetPaused()\n\ta = nil\n\ta.GetPaused()\n}\n\nfunc TestAutoTriggerCheck_GetAppID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ta := &AutoTriggerCheck{AppID: &zeroValue}\n\ta.GetAppID()\n\ta = &AutoTriggerCheck{}\n\ta.GetAppID()\n\ta = nil\n\ta.GetAppID()\n}\n\nfunc TestAutoTriggerCheck_GetSetting(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ta := &AutoTriggerCheck{Setting: &zeroValue}\n\ta.GetSetting()\n\ta = &AutoTriggerCheck{}\n\ta.GetSetting()\n\ta = nil\n\ta.GetSetting()\n}\n\nfunc TestAzureBlobConfig_GetContainer(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AzureBlobConfig{}\n\ta.GetContainer()\n\ta = nil\n\ta.GetContainer()\n}\n\nfunc TestAzureBlobConfig_GetEncryptedSASURL(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AzureBlobConfig{}\n\ta.GetEncryptedSASURL()\n\ta = nil\n\ta.GetEncryptedSASURL()\n}\n\nfunc TestAzureBlobConfig_GetKeyID(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AzureBlobConfig{}\n\ta.GetKeyID()\n\ta = nil\n\ta.GetKeyID()\n}\n\nfunc TestAzureHubConfig_GetEncryptedConnstring(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AzureHubConfig{}\n\ta.GetEncryptedConnstring()\n\ta = nil\n\ta.GetEncryptedConnstring()\n}\n\nfunc TestAzureHubConfig_GetKeyID(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AzureHubConfig{}\n\ta.GetKeyID()\n\ta = nil\n\ta.GetKeyID()\n}\n\nfunc TestAzureHubConfig_GetName(tt *testing.T) {\n\ttt.Parallel()\n\ta := &AzureHubConfig{}\n\ta.GetName()\n\ta = nil\n\ta.GetName()\n}\n\nfunc TestBasicAuthTransport_GetOTP(tt *testing.T) {\n\ttt.Parallel()\n\tb := &BasicAuthTransport{}\n\tb.GetOTP()\n\tb = nil\n\tb.GetOTP()\n}\n\nfunc TestBasicAuthTransport_GetPassword(tt *testing.T) {\n\ttt.Parallel()\n\tb := &BasicAuthTransport{}\n\tb.GetPassword()\n\tb = nil\n\tb.GetPassword()\n}\n\nfunc TestBasicAuthTransport_GetUsername(tt *testing.T) {\n\ttt.Parallel()\n\tb := &BasicAuthTransport{}\n\tb.GetUsername()\n\tb = nil\n\tb.GetUsername()\n}\n\nfunc TestBlob_GetContent(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tb := &Blob{Content: &zeroValue}\n\tb.GetContent()\n\tb = &Blob{}\n\tb.GetContent()\n\tb = nil\n\tb.GetContent()\n}\n\nfunc TestBlob_GetEncoding(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tb := &Blob{Encoding: &zeroValue}\n\tb.GetEncoding()\n\tb = &Blob{}\n\tb.GetEncoding()\n\tb = nil\n\tb.GetEncoding()\n}\n\nfunc TestBlob_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tb := &Blob{NodeID: &zeroValue}\n\tb.GetNodeID()\n\tb = &Blob{}\n\tb.GetNodeID()\n\tb = nil\n\tb.GetNodeID()\n}\n\nfunc TestBlob_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tb := &Blob{SHA: &zeroValue}\n\tb.GetSHA()\n\tb = &Blob{}\n\tb.GetSHA()\n\tb = nil\n\tb.GetSHA()\n}\n\nfunc TestBlob_GetSize(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tb := &Blob{Size: &zeroValue}\n\tb.GetSize()\n\tb = &Blob{}\n\tb.GetSize()\n\tb = nil\n\tb.GetSize()\n}\n\nfunc TestBlob_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tb := &Blob{URL: &zeroValue}\n\tb.GetURL()\n\tb = &Blob{}\n\tb.GetURL()\n\tb = nil\n\tb.GetURL()\n}\n\nfunc TestBlockCreations_GetEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tb := &BlockCreations{Enabled: &zeroValue}\n\tb.GetEnabled()\n\tb = &BlockCreations{}\n\tb.GetEnabled()\n\tb = nil\n\tb.GetEnabled()\n}\n\nfunc TestBranch_GetCommit(tt *testing.T) {\n\ttt.Parallel()\n\tb := &Branch{}\n\tb.GetCommit()\n\tb = nil\n\tb.GetCommit()\n}\n\nfunc TestBranch_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tb := &Branch{Name: &zeroValue}\n\tb.GetName()\n\tb = &Branch{}\n\tb.GetName()\n\tb = nil\n\tb.GetName()\n}\n\nfunc TestBranch_GetProtected(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tb := &Branch{Protected: &zeroValue}\n\tb.GetProtected()\n\tb = &Branch{}\n\tb.GetProtected()\n\tb = nil\n\tb.GetProtected()\n}\n\nfunc TestBranch_GetProtection(tt *testing.T) {\n\ttt.Parallel()\n\tb := &Branch{}\n\tb.GetProtection()\n\tb = nil\n\tb.GetProtection()\n}\n\nfunc TestBranch_GetProtectionURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tb := &Branch{ProtectionURL: &zeroValue}\n\tb.GetProtectionURL()\n\tb = &Branch{}\n\tb.GetProtectionURL()\n\tb = nil\n\tb.GetProtectionURL()\n}\n\nfunc TestBranchCommit_GetCommit(tt *testing.T) {\n\ttt.Parallel()\n\tb := &BranchCommit{}\n\tb.GetCommit()\n\tb = nil\n\tb.GetCommit()\n}\n\nfunc TestBranchCommit_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tb := &BranchCommit{Name: &zeroValue}\n\tb.GetName()\n\tb = &BranchCommit{}\n\tb.GetName()\n\tb = nil\n\tb.GetName()\n}\n\nfunc TestBranchCommit_GetProtected(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tb := &BranchCommit{Protected: &zeroValue}\n\tb.GetProtected()\n\tb = &BranchCommit{}\n\tb.GetProtected()\n\tb = nil\n\tb.GetProtected()\n}\n\nfunc TestBranchListOptions_GetProtected(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tb := &BranchListOptions{Protected: &zeroValue}\n\tb.GetProtected()\n\tb = &BranchListOptions{}\n\tb.GetProtected()\n\tb = nil\n\tb.GetProtected()\n}\n\nfunc TestBranchPolicy_GetCustomBranchPolicies(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tb := &BranchPolicy{CustomBranchPolicies: &zeroValue}\n\tb.GetCustomBranchPolicies()\n\tb = &BranchPolicy{}\n\tb.GetCustomBranchPolicies()\n\tb = nil\n\tb.GetCustomBranchPolicies()\n}\n\nfunc TestBranchPolicy_GetProtectedBranches(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tb := &BranchPolicy{ProtectedBranches: &zeroValue}\n\tb.GetProtectedBranches()\n\tb = &BranchPolicy{}\n\tb.GetProtectedBranches()\n\tb = nil\n\tb.GetProtectedBranches()\n}\n\nfunc TestBranchProtectionConfigurationEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tb := &BranchProtectionConfigurationEvent{Action: &zeroValue}\n\tb.GetAction()\n\tb = &BranchProtectionConfigurationEvent{}\n\tb.GetAction()\n\tb = nil\n\tb.GetAction()\n}\n\nfunc TestBranchProtectionConfigurationEvent_GetEnterprise(tt *testing.T) {\n\ttt.Parallel()\n\tb := &BranchProtectionConfigurationEvent{}\n\tb.GetEnterprise()\n\tb = nil\n\tb.GetEnterprise()\n}\n\nfunc TestBranchProtectionConfigurationEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tb := &BranchProtectionConfigurationEvent{}\n\tb.GetInstallation()\n\tb = nil\n\tb.GetInstallation()\n}\n\nfunc TestBranchProtectionConfigurationEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tb := &BranchProtectionConfigurationEvent{}\n\tb.GetOrg()\n\tb = nil\n\tb.GetOrg()\n}\n\nfunc TestBranchProtectionConfigurationEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tb := &BranchProtectionConfigurationEvent{}\n\tb.GetRepo()\n\tb = nil\n\tb.GetRepo()\n}\n\nfunc TestBranchProtectionConfigurationEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tb := &BranchProtectionConfigurationEvent{}\n\tb.GetSender()\n\tb = nil\n\tb.GetSender()\n}\n\nfunc TestBranchProtectionRule_GetAdminEnforced(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tb := &BranchProtectionRule{AdminEnforced: &zeroValue}\n\tb.GetAdminEnforced()\n\tb = &BranchProtectionRule{}\n\tb.GetAdminEnforced()\n\tb = nil\n\tb.GetAdminEnforced()\n}\n\nfunc TestBranchProtectionRule_GetAllowDeletionsEnforcementLevel(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tb := &BranchProtectionRule{AllowDeletionsEnforcementLevel: &zeroValue}\n\tb.GetAllowDeletionsEnforcementLevel()\n\tb = &BranchProtectionRule{}\n\tb.GetAllowDeletionsEnforcementLevel()\n\tb = nil\n\tb.GetAllowDeletionsEnforcementLevel()\n}\n\nfunc TestBranchProtectionRule_GetAllowForcePushesEnforcementLevel(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tb := &BranchProtectionRule{AllowForcePushesEnforcementLevel: &zeroValue}\n\tb.GetAllowForcePushesEnforcementLevel()\n\tb = &BranchProtectionRule{}\n\tb.GetAllowForcePushesEnforcementLevel()\n\tb = nil\n\tb.GetAllowForcePushesEnforcementLevel()\n}\n\nfunc TestBranchProtectionRule_GetAuthorizedActorNames(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tb := &BranchProtectionRule{AuthorizedActorNames: zeroValue}\n\tb.GetAuthorizedActorNames()\n\tb = &BranchProtectionRule{}\n\tb.GetAuthorizedActorNames()\n\tb = nil\n\tb.GetAuthorizedActorNames()\n}\n\nfunc TestBranchProtectionRule_GetAuthorizedActorsOnly(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tb := &BranchProtectionRule{AuthorizedActorsOnly: &zeroValue}\n\tb.GetAuthorizedActorsOnly()\n\tb = &BranchProtectionRule{}\n\tb.GetAuthorizedActorsOnly()\n\tb = nil\n\tb.GetAuthorizedActorsOnly()\n}\n\nfunc TestBranchProtectionRule_GetAuthorizedDismissalActorsOnly(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tb := &BranchProtectionRule{AuthorizedDismissalActorsOnly: &zeroValue}\n\tb.GetAuthorizedDismissalActorsOnly()\n\tb = &BranchProtectionRule{}\n\tb.GetAuthorizedDismissalActorsOnly()\n\tb = nil\n\tb.GetAuthorizedDismissalActorsOnly()\n}\n\nfunc TestBranchProtectionRule_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tb := &BranchProtectionRule{CreatedAt: &zeroValue}\n\tb.GetCreatedAt()\n\tb = &BranchProtectionRule{}\n\tb.GetCreatedAt()\n\tb = nil\n\tb.GetCreatedAt()\n}\n\nfunc TestBranchProtectionRule_GetDismissStaleReviewsOnPush(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tb := &BranchProtectionRule{DismissStaleReviewsOnPush: &zeroValue}\n\tb.GetDismissStaleReviewsOnPush()\n\tb = &BranchProtectionRule{}\n\tb.GetDismissStaleReviewsOnPush()\n\tb = nil\n\tb.GetDismissStaleReviewsOnPush()\n}\n\nfunc TestBranchProtectionRule_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tb := &BranchProtectionRule{ID: &zeroValue}\n\tb.GetID()\n\tb = &BranchProtectionRule{}\n\tb.GetID()\n\tb = nil\n\tb.GetID()\n}\n\nfunc TestBranchProtectionRule_GetIgnoreApprovalsFromContributors(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tb := &BranchProtectionRule{IgnoreApprovalsFromContributors: &zeroValue}\n\tb.GetIgnoreApprovalsFromContributors()\n\tb = &BranchProtectionRule{}\n\tb.GetIgnoreApprovalsFromContributors()\n\tb = nil\n\tb.GetIgnoreApprovalsFromContributors()\n}\n\nfunc TestBranchProtectionRule_GetLinearHistoryRequirementEnforcementLevel(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tb := &BranchProtectionRule{LinearHistoryRequirementEnforcementLevel: &zeroValue}\n\tb.GetLinearHistoryRequirementEnforcementLevel()\n\tb = &BranchProtectionRule{}\n\tb.GetLinearHistoryRequirementEnforcementLevel()\n\tb = nil\n\tb.GetLinearHistoryRequirementEnforcementLevel()\n}\n\nfunc TestBranchProtectionRule_GetMergeQueueEnforcementLevel(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tb := &BranchProtectionRule{MergeQueueEnforcementLevel: &zeroValue}\n\tb.GetMergeQueueEnforcementLevel()\n\tb = &BranchProtectionRule{}\n\tb.GetMergeQueueEnforcementLevel()\n\tb = nil\n\tb.GetMergeQueueEnforcementLevel()\n}\n\nfunc TestBranchProtectionRule_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tb := &BranchProtectionRule{Name: &zeroValue}\n\tb.GetName()\n\tb = &BranchProtectionRule{}\n\tb.GetName()\n\tb = nil\n\tb.GetName()\n}\n\nfunc TestBranchProtectionRule_GetPullRequestReviewsEnforcementLevel(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tb := &BranchProtectionRule{PullRequestReviewsEnforcementLevel: &zeroValue}\n\tb.GetPullRequestReviewsEnforcementLevel()\n\tb = &BranchProtectionRule{}\n\tb.GetPullRequestReviewsEnforcementLevel()\n\tb = nil\n\tb.GetPullRequestReviewsEnforcementLevel()\n}\n\nfunc TestBranchProtectionRule_GetRepositoryID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tb := &BranchProtectionRule{RepositoryID: &zeroValue}\n\tb.GetRepositoryID()\n\tb = &BranchProtectionRule{}\n\tb.GetRepositoryID()\n\tb = nil\n\tb.GetRepositoryID()\n}\n\nfunc TestBranchProtectionRule_GetRequireCodeOwnerReview(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tb := &BranchProtectionRule{RequireCodeOwnerReview: &zeroValue}\n\tb.GetRequireCodeOwnerReview()\n\tb = &BranchProtectionRule{}\n\tb.GetRequireCodeOwnerReview()\n\tb = nil\n\tb.GetRequireCodeOwnerReview()\n}\n\nfunc TestBranchProtectionRule_GetRequiredApprovingReviewCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tb := &BranchProtectionRule{RequiredApprovingReviewCount: &zeroValue}\n\tb.GetRequiredApprovingReviewCount()\n\tb = &BranchProtectionRule{}\n\tb.GetRequiredApprovingReviewCount()\n\tb = nil\n\tb.GetRequiredApprovingReviewCount()\n}\n\nfunc TestBranchProtectionRule_GetRequiredConversationResolutionLevel(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tb := &BranchProtectionRule{RequiredConversationResolutionLevel: &zeroValue}\n\tb.GetRequiredConversationResolutionLevel()\n\tb = &BranchProtectionRule{}\n\tb.GetRequiredConversationResolutionLevel()\n\tb = nil\n\tb.GetRequiredConversationResolutionLevel()\n}\n\nfunc TestBranchProtectionRule_GetRequiredDeploymentsEnforcementLevel(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tb := &BranchProtectionRule{RequiredDeploymentsEnforcementLevel: &zeroValue}\n\tb.GetRequiredDeploymentsEnforcementLevel()\n\tb = &BranchProtectionRule{}\n\tb.GetRequiredDeploymentsEnforcementLevel()\n\tb = nil\n\tb.GetRequiredDeploymentsEnforcementLevel()\n}\n\nfunc TestBranchProtectionRule_GetRequiredStatusChecks(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tb := &BranchProtectionRule{RequiredStatusChecks: zeroValue}\n\tb.GetRequiredStatusChecks()\n\tb = &BranchProtectionRule{}\n\tb.GetRequiredStatusChecks()\n\tb = nil\n\tb.GetRequiredStatusChecks()\n}\n\nfunc TestBranchProtectionRule_GetRequiredStatusChecksEnforcementLevel(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tb := &BranchProtectionRule{RequiredStatusChecksEnforcementLevel: &zeroValue}\n\tb.GetRequiredStatusChecksEnforcementLevel()\n\tb = &BranchProtectionRule{}\n\tb.GetRequiredStatusChecksEnforcementLevel()\n\tb = nil\n\tb.GetRequiredStatusChecksEnforcementLevel()\n}\n\nfunc TestBranchProtectionRule_GetRequireLastPushApproval(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tb := &BranchProtectionRule{RequireLastPushApproval: &zeroValue}\n\tb.GetRequireLastPushApproval()\n\tb = &BranchProtectionRule{}\n\tb.GetRequireLastPushApproval()\n\tb = nil\n\tb.GetRequireLastPushApproval()\n}\n\nfunc TestBranchProtectionRule_GetSignatureRequirementEnforcementLevel(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tb := &BranchProtectionRule{SignatureRequirementEnforcementLevel: &zeroValue}\n\tb.GetSignatureRequirementEnforcementLevel()\n\tb = &BranchProtectionRule{}\n\tb.GetSignatureRequirementEnforcementLevel()\n\tb = nil\n\tb.GetSignatureRequirementEnforcementLevel()\n}\n\nfunc TestBranchProtectionRule_GetStrictRequiredStatusChecksPolicy(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tb := &BranchProtectionRule{StrictRequiredStatusChecksPolicy: &zeroValue}\n\tb.GetStrictRequiredStatusChecksPolicy()\n\tb = &BranchProtectionRule{}\n\tb.GetStrictRequiredStatusChecksPolicy()\n\tb = nil\n\tb.GetStrictRequiredStatusChecksPolicy()\n}\n\nfunc TestBranchProtectionRule_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tb := &BranchProtectionRule{UpdatedAt: &zeroValue}\n\tb.GetUpdatedAt()\n\tb = &BranchProtectionRule{}\n\tb.GetUpdatedAt()\n\tb = nil\n\tb.GetUpdatedAt()\n}\n\nfunc TestBranchProtectionRuleEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tb := &BranchProtectionRuleEvent{Action: &zeroValue}\n\tb.GetAction()\n\tb = &BranchProtectionRuleEvent{}\n\tb.GetAction()\n\tb = nil\n\tb.GetAction()\n}\n\nfunc TestBranchProtectionRuleEvent_GetChanges(tt *testing.T) {\n\ttt.Parallel()\n\tb := &BranchProtectionRuleEvent{}\n\tb.GetChanges()\n\tb = nil\n\tb.GetChanges()\n}\n\nfunc TestBranchProtectionRuleEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tb := &BranchProtectionRuleEvent{}\n\tb.GetInstallation()\n\tb = nil\n\tb.GetInstallation()\n}\n\nfunc TestBranchProtectionRuleEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tb := &BranchProtectionRuleEvent{}\n\tb.GetOrg()\n\tb = nil\n\tb.GetOrg()\n}\n\nfunc TestBranchProtectionRuleEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tb := &BranchProtectionRuleEvent{}\n\tb.GetRepo()\n\tb = nil\n\tb.GetRepo()\n}\n\nfunc TestBranchProtectionRuleEvent_GetRule(tt *testing.T) {\n\ttt.Parallel()\n\tb := &BranchProtectionRuleEvent{}\n\tb.GetRule()\n\tb = nil\n\tb.GetRule()\n}\n\nfunc TestBranchProtectionRuleEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tb := &BranchProtectionRuleEvent{}\n\tb.GetSender()\n\tb = nil\n\tb.GetSender()\n}\n\nfunc TestBranchRestrictions_GetApps(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*App{}\n\tb := &BranchRestrictions{Apps: zeroValue}\n\tb.GetApps()\n\tb = &BranchRestrictions{}\n\tb.GetApps()\n\tb = nil\n\tb.GetApps()\n}\n\nfunc TestBranchRestrictions_GetTeams(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Team{}\n\tb := &BranchRestrictions{Teams: zeroValue}\n\tb.GetTeams()\n\tb = &BranchRestrictions{}\n\tb.GetTeams()\n\tb = nil\n\tb.GetTeams()\n}\n\nfunc TestBranchRestrictions_GetUsers(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*User{}\n\tb := &BranchRestrictions{Users: zeroValue}\n\tb.GetUsers()\n\tb = &BranchRestrictions{}\n\tb.GetUsers()\n\tb = nil\n\tb.GetUsers()\n}\n\nfunc TestBranchRestrictionsRequest_GetApps(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tb := &BranchRestrictionsRequest{Apps: zeroValue}\n\tb.GetApps()\n\tb = &BranchRestrictionsRequest{}\n\tb.GetApps()\n\tb = nil\n\tb.GetApps()\n}\n\nfunc TestBranchRestrictionsRequest_GetTeams(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tb := &BranchRestrictionsRequest{Teams: zeroValue}\n\tb.GetTeams()\n\tb = &BranchRestrictionsRequest{}\n\tb.GetTeams()\n\tb = nil\n\tb.GetTeams()\n}\n\nfunc TestBranchRestrictionsRequest_GetUsers(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tb := &BranchRestrictionsRequest{Users: zeroValue}\n\tb.GetUsers()\n\tb = &BranchRestrictionsRequest{}\n\tb.GetUsers()\n\tb = nil\n\tb.GetUsers()\n}\n\nfunc TestBranchRuleMetadata_GetRulesetID(tt *testing.T) {\n\ttt.Parallel()\n\tb := &BranchRuleMetadata{}\n\tb.GetRulesetID()\n\tb = nil\n\tb.GetRulesetID()\n}\n\nfunc TestBranchRuleMetadata_GetRulesetSource(tt *testing.T) {\n\ttt.Parallel()\n\tb := &BranchRuleMetadata{}\n\tb.GetRulesetSource()\n\tb = nil\n\tb.GetRulesetSource()\n}\n\nfunc TestBranchRuleMetadata_GetRulesetSourceType(tt *testing.T) {\n\ttt.Parallel()\n\tb := &BranchRuleMetadata{}\n\tb.GetRulesetSourceType()\n\tb = nil\n\tb.GetRulesetSourceType()\n}\n\nfunc TestBranchRules_GetBranchNamePattern(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*PatternBranchRule{}\n\tb := &BranchRules{BranchNamePattern: zeroValue}\n\tb.GetBranchNamePattern()\n\tb = &BranchRules{}\n\tb.GetBranchNamePattern()\n\tb = nil\n\tb.GetBranchNamePattern()\n}\n\nfunc TestBranchRules_GetCodeScanning(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CodeScanningBranchRule{}\n\tb := &BranchRules{CodeScanning: zeroValue}\n\tb.GetCodeScanning()\n\tb = &BranchRules{}\n\tb.GetCodeScanning()\n\tb = nil\n\tb.GetCodeScanning()\n}\n\nfunc TestBranchRules_GetCommitAuthorEmailPattern(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*PatternBranchRule{}\n\tb := &BranchRules{CommitAuthorEmailPattern: zeroValue}\n\tb.GetCommitAuthorEmailPattern()\n\tb = &BranchRules{}\n\tb.GetCommitAuthorEmailPattern()\n\tb = nil\n\tb.GetCommitAuthorEmailPattern()\n}\n\nfunc TestBranchRules_GetCommitMessagePattern(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*PatternBranchRule{}\n\tb := &BranchRules{CommitMessagePattern: zeroValue}\n\tb.GetCommitMessagePattern()\n\tb = &BranchRules{}\n\tb.GetCommitMessagePattern()\n\tb = nil\n\tb.GetCommitMessagePattern()\n}\n\nfunc TestBranchRules_GetCommitterEmailPattern(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*PatternBranchRule{}\n\tb := &BranchRules{CommitterEmailPattern: zeroValue}\n\tb.GetCommitterEmailPattern()\n\tb = &BranchRules{}\n\tb.GetCommitterEmailPattern()\n\tb = nil\n\tb.GetCommitterEmailPattern()\n}\n\nfunc TestBranchRules_GetCopilotCodeReview(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CopilotCodeReviewBranchRule{}\n\tb := &BranchRules{CopilotCodeReview: zeroValue}\n\tb.GetCopilotCodeReview()\n\tb = &BranchRules{}\n\tb.GetCopilotCodeReview()\n\tb = nil\n\tb.GetCopilotCodeReview()\n}\n\nfunc TestBranchRules_GetCreation(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*BranchRuleMetadata{}\n\tb := &BranchRules{Creation: zeroValue}\n\tb.GetCreation()\n\tb = &BranchRules{}\n\tb.GetCreation()\n\tb = nil\n\tb.GetCreation()\n}\n\nfunc TestBranchRules_GetDeletion(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*BranchRuleMetadata{}\n\tb := &BranchRules{Deletion: zeroValue}\n\tb.GetDeletion()\n\tb = &BranchRules{}\n\tb.GetDeletion()\n\tb = nil\n\tb.GetDeletion()\n}\n\nfunc TestBranchRules_GetFileExtensionRestriction(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*FileExtensionRestrictionBranchRule{}\n\tb := &BranchRules{FileExtensionRestriction: zeroValue}\n\tb.GetFileExtensionRestriction()\n\tb = &BranchRules{}\n\tb.GetFileExtensionRestriction()\n\tb = nil\n\tb.GetFileExtensionRestriction()\n}\n\nfunc TestBranchRules_GetFilePathRestriction(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*FilePathRestrictionBranchRule{}\n\tb := &BranchRules{FilePathRestriction: zeroValue}\n\tb.GetFilePathRestriction()\n\tb = &BranchRules{}\n\tb.GetFilePathRestriction()\n\tb = nil\n\tb.GetFilePathRestriction()\n}\n\nfunc TestBranchRules_GetMaxFilePathLength(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*MaxFilePathLengthBranchRule{}\n\tb := &BranchRules{MaxFilePathLength: zeroValue}\n\tb.GetMaxFilePathLength()\n\tb = &BranchRules{}\n\tb.GetMaxFilePathLength()\n\tb = nil\n\tb.GetMaxFilePathLength()\n}\n\nfunc TestBranchRules_GetMaxFileSize(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*MaxFileSizeBranchRule{}\n\tb := &BranchRules{MaxFileSize: zeroValue}\n\tb.GetMaxFileSize()\n\tb = &BranchRules{}\n\tb.GetMaxFileSize()\n\tb = nil\n\tb.GetMaxFileSize()\n}\n\nfunc TestBranchRules_GetMergeQueue(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*MergeQueueBranchRule{}\n\tb := &BranchRules{MergeQueue: zeroValue}\n\tb.GetMergeQueue()\n\tb = &BranchRules{}\n\tb.GetMergeQueue()\n\tb = nil\n\tb.GetMergeQueue()\n}\n\nfunc TestBranchRules_GetNonFastForward(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*BranchRuleMetadata{}\n\tb := &BranchRules{NonFastForward: zeroValue}\n\tb.GetNonFastForward()\n\tb = &BranchRules{}\n\tb.GetNonFastForward()\n\tb = nil\n\tb.GetNonFastForward()\n}\n\nfunc TestBranchRules_GetPullRequest(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*PullRequestBranchRule{}\n\tb := &BranchRules{PullRequest: zeroValue}\n\tb.GetPullRequest()\n\tb = &BranchRules{}\n\tb.GetPullRequest()\n\tb = nil\n\tb.GetPullRequest()\n}\n\nfunc TestBranchRules_GetRequiredDeployments(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*RequiredDeploymentsBranchRule{}\n\tb := &BranchRules{RequiredDeployments: zeroValue}\n\tb.GetRequiredDeployments()\n\tb = &BranchRules{}\n\tb.GetRequiredDeployments()\n\tb = nil\n\tb.GetRequiredDeployments()\n}\n\nfunc TestBranchRules_GetRequiredLinearHistory(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*BranchRuleMetadata{}\n\tb := &BranchRules{RequiredLinearHistory: zeroValue}\n\tb.GetRequiredLinearHistory()\n\tb = &BranchRules{}\n\tb.GetRequiredLinearHistory()\n\tb = nil\n\tb.GetRequiredLinearHistory()\n}\n\nfunc TestBranchRules_GetRequiredSignatures(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*BranchRuleMetadata{}\n\tb := &BranchRules{RequiredSignatures: zeroValue}\n\tb.GetRequiredSignatures()\n\tb = &BranchRules{}\n\tb.GetRequiredSignatures()\n\tb = nil\n\tb.GetRequiredSignatures()\n}\n\nfunc TestBranchRules_GetRequiredStatusChecks(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*RequiredStatusChecksBranchRule{}\n\tb := &BranchRules{RequiredStatusChecks: zeroValue}\n\tb.GetRequiredStatusChecks()\n\tb = &BranchRules{}\n\tb.GetRequiredStatusChecks()\n\tb = nil\n\tb.GetRequiredStatusChecks()\n}\n\nfunc TestBranchRules_GetTagNamePattern(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*PatternBranchRule{}\n\tb := &BranchRules{TagNamePattern: zeroValue}\n\tb.GetTagNamePattern()\n\tb = &BranchRules{}\n\tb.GetTagNamePattern()\n\tb = nil\n\tb.GetTagNamePattern()\n}\n\nfunc TestBranchRules_GetUpdate(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*UpdateBranchRule{}\n\tb := &BranchRules{Update: zeroValue}\n\tb.GetUpdate()\n\tb = &BranchRules{}\n\tb.GetUpdate()\n\tb = nil\n\tb.GetUpdate()\n}\n\nfunc TestBranchRules_GetWorkflows(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*WorkflowsBranchRule{}\n\tb := &BranchRules{Workflows: zeroValue}\n\tb.GetWorkflows()\n\tb = &BranchRules{}\n\tb.GetWorkflows()\n\tb = nil\n\tb.GetWorkflows()\n}\n\nfunc TestBypassActor_GetActorID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tb := &BypassActor{ActorID: &zeroValue}\n\tb.GetActorID()\n\tb = &BypassActor{}\n\tb.GetActorID()\n\tb = nil\n\tb.GetActorID()\n}\n\nfunc TestBypassActor_GetActorType(tt *testing.T) {\n\ttt.Parallel()\n\tb := &BypassActor{}\n\tb.GetActorType()\n\tb = nil\n\tb.GetActorType()\n}\n\nfunc TestBypassActor_GetBypassMode(tt *testing.T) {\n\ttt.Parallel()\n\tb := &BypassActor{}\n\tb.GetBypassMode()\n\tb = nil\n\tb.GetBypassMode()\n}\n\nfunc TestBypassPullRequestAllowances_GetApps(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*App{}\n\tb := &BypassPullRequestAllowances{Apps: zeroValue}\n\tb.GetApps()\n\tb = &BypassPullRequestAllowances{}\n\tb.GetApps()\n\tb = nil\n\tb.GetApps()\n}\n\nfunc TestBypassPullRequestAllowances_GetTeams(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Team{}\n\tb := &BypassPullRequestAllowances{Teams: zeroValue}\n\tb.GetTeams()\n\tb = &BypassPullRequestAllowances{}\n\tb.GetTeams()\n\tb = nil\n\tb.GetTeams()\n}\n\nfunc TestBypassPullRequestAllowances_GetUsers(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*User{}\n\tb := &BypassPullRequestAllowances{Users: zeroValue}\n\tb.GetUsers()\n\tb = &BypassPullRequestAllowances{}\n\tb.GetUsers()\n\tb = nil\n\tb.GetUsers()\n}\n\nfunc TestBypassPullRequestAllowancesRequest_GetApps(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tb := &BypassPullRequestAllowancesRequest{Apps: zeroValue}\n\tb.GetApps()\n\tb = &BypassPullRequestAllowancesRequest{}\n\tb.GetApps()\n\tb = nil\n\tb.GetApps()\n}\n\nfunc TestBypassPullRequestAllowancesRequest_GetTeams(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tb := &BypassPullRequestAllowancesRequest{Teams: zeroValue}\n\tb.GetTeams()\n\tb = &BypassPullRequestAllowancesRequest{}\n\tb.GetTeams()\n\tb = nil\n\tb.GetTeams()\n}\n\nfunc TestBypassPullRequestAllowancesRequest_GetUsers(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tb := &BypassPullRequestAllowancesRequest{Users: zeroValue}\n\tb.GetUsers()\n\tb = &BypassPullRequestAllowancesRequest{}\n\tb.GetUsers()\n\tb = nil\n\tb.GetUsers()\n}\n\nfunc TestBypassReviewer_GetReviewerID(tt *testing.T) {\n\ttt.Parallel()\n\tb := &BypassReviewer{}\n\tb.GetReviewerID()\n\tb = nil\n\tb.GetReviewerID()\n}\n\nfunc TestBypassReviewer_GetReviewerType(tt *testing.T) {\n\ttt.Parallel()\n\tb := &BypassReviewer{}\n\tb.GetReviewerType()\n\tb = nil\n\tb.GetReviewerType()\n}\n\nfunc TestBypassReviewer_GetSecurityConfigurationID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tb := &BypassReviewer{SecurityConfigurationID: &zeroValue}\n\tb.GetSecurityConfigurationID()\n\tb = &BypassReviewer{}\n\tb.GetSecurityConfigurationID()\n\tb = nil\n\tb.GetSecurityConfigurationID()\n}\n\nfunc TestCheckRun_GetApp(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CheckRun{}\n\tc.GetApp()\n\tc = nil\n\tc.GetApp()\n}\n\nfunc TestCheckRun_GetCheckSuite(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CheckRun{}\n\tc.GetCheckSuite()\n\tc = nil\n\tc.GetCheckSuite()\n}\n\nfunc TestCheckRun_GetCompletedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &CheckRun{CompletedAt: &zeroValue}\n\tc.GetCompletedAt()\n\tc = &CheckRun{}\n\tc.GetCompletedAt()\n\tc = nil\n\tc.GetCompletedAt()\n}\n\nfunc TestCheckRun_GetConclusion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckRun{Conclusion: &zeroValue}\n\tc.GetConclusion()\n\tc = &CheckRun{}\n\tc.GetConclusion()\n\tc = nil\n\tc.GetConclusion()\n}\n\nfunc TestCheckRun_GetDetailsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckRun{DetailsURL: &zeroValue}\n\tc.GetDetailsURL()\n\tc = &CheckRun{}\n\tc.GetDetailsURL()\n\tc = nil\n\tc.GetDetailsURL()\n}\n\nfunc TestCheckRun_GetExternalID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckRun{ExternalID: &zeroValue}\n\tc.GetExternalID()\n\tc = &CheckRun{}\n\tc.GetExternalID()\n\tc = nil\n\tc.GetExternalID()\n}\n\nfunc TestCheckRun_GetHeadSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckRun{HeadSHA: &zeroValue}\n\tc.GetHeadSHA()\n\tc = &CheckRun{}\n\tc.GetHeadSHA()\n\tc = nil\n\tc.GetHeadSHA()\n}\n\nfunc TestCheckRun_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckRun{HTMLURL: &zeroValue}\n\tc.GetHTMLURL()\n\tc = &CheckRun{}\n\tc.GetHTMLURL()\n\tc = nil\n\tc.GetHTMLURL()\n}\n\nfunc TestCheckRun_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tc := &CheckRun{ID: &zeroValue}\n\tc.GetID()\n\tc = &CheckRun{}\n\tc.GetID()\n\tc = nil\n\tc.GetID()\n}\n\nfunc TestCheckRun_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckRun{Name: &zeroValue}\n\tc.GetName()\n\tc = &CheckRun{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCheckRun_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckRun{NodeID: &zeroValue}\n\tc.GetNodeID()\n\tc = &CheckRun{}\n\tc.GetNodeID()\n\tc = nil\n\tc.GetNodeID()\n}\n\nfunc TestCheckRun_GetOutput(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CheckRun{}\n\tc.GetOutput()\n\tc = nil\n\tc.GetOutput()\n}\n\nfunc TestCheckRun_GetPullRequests(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*PullRequest{}\n\tc := &CheckRun{PullRequests: zeroValue}\n\tc.GetPullRequests()\n\tc = &CheckRun{}\n\tc.GetPullRequests()\n\tc = nil\n\tc.GetPullRequests()\n}\n\nfunc TestCheckRun_GetStartedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &CheckRun{StartedAt: &zeroValue}\n\tc.GetStartedAt()\n\tc = &CheckRun{}\n\tc.GetStartedAt()\n\tc = nil\n\tc.GetStartedAt()\n}\n\nfunc TestCheckRun_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckRun{Status: &zeroValue}\n\tc.GetStatus()\n\tc = &CheckRun{}\n\tc.GetStatus()\n\tc = nil\n\tc.GetStatus()\n}\n\nfunc TestCheckRun_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckRun{URL: &zeroValue}\n\tc.GetURL()\n\tc = &CheckRun{}\n\tc.GetURL()\n\tc = nil\n\tc.GetURL()\n}\n\nfunc TestCheckRunAction_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CheckRunAction{}\n\tc.GetDescription()\n\tc = nil\n\tc.GetDescription()\n}\n\nfunc TestCheckRunAction_GetIdentifier(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CheckRunAction{}\n\tc.GetIdentifier()\n\tc = nil\n\tc.GetIdentifier()\n}\n\nfunc TestCheckRunAction_GetLabel(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CheckRunAction{}\n\tc.GetLabel()\n\tc = nil\n\tc.GetLabel()\n}\n\nfunc TestCheckRunAnnotation_GetAnnotationLevel(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckRunAnnotation{AnnotationLevel: &zeroValue}\n\tc.GetAnnotationLevel()\n\tc = &CheckRunAnnotation{}\n\tc.GetAnnotationLevel()\n\tc = nil\n\tc.GetAnnotationLevel()\n}\n\nfunc TestCheckRunAnnotation_GetEndColumn(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CheckRunAnnotation{EndColumn: &zeroValue}\n\tc.GetEndColumn()\n\tc = &CheckRunAnnotation{}\n\tc.GetEndColumn()\n\tc = nil\n\tc.GetEndColumn()\n}\n\nfunc TestCheckRunAnnotation_GetEndLine(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CheckRunAnnotation{EndLine: &zeroValue}\n\tc.GetEndLine()\n\tc = &CheckRunAnnotation{}\n\tc.GetEndLine()\n\tc = nil\n\tc.GetEndLine()\n}\n\nfunc TestCheckRunAnnotation_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckRunAnnotation{Message: &zeroValue}\n\tc.GetMessage()\n\tc = &CheckRunAnnotation{}\n\tc.GetMessage()\n\tc = nil\n\tc.GetMessage()\n}\n\nfunc TestCheckRunAnnotation_GetPath(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckRunAnnotation{Path: &zeroValue}\n\tc.GetPath()\n\tc = &CheckRunAnnotation{}\n\tc.GetPath()\n\tc = nil\n\tc.GetPath()\n}\n\nfunc TestCheckRunAnnotation_GetRawDetails(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckRunAnnotation{RawDetails: &zeroValue}\n\tc.GetRawDetails()\n\tc = &CheckRunAnnotation{}\n\tc.GetRawDetails()\n\tc = nil\n\tc.GetRawDetails()\n}\n\nfunc TestCheckRunAnnotation_GetStartColumn(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CheckRunAnnotation{StartColumn: &zeroValue}\n\tc.GetStartColumn()\n\tc = &CheckRunAnnotation{}\n\tc.GetStartColumn()\n\tc = nil\n\tc.GetStartColumn()\n}\n\nfunc TestCheckRunAnnotation_GetStartLine(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CheckRunAnnotation{StartLine: &zeroValue}\n\tc.GetStartLine()\n\tc = &CheckRunAnnotation{}\n\tc.GetStartLine()\n\tc = nil\n\tc.GetStartLine()\n}\n\nfunc TestCheckRunAnnotation_GetTitle(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckRunAnnotation{Title: &zeroValue}\n\tc.GetTitle()\n\tc = &CheckRunAnnotation{}\n\tc.GetTitle()\n\tc = nil\n\tc.GetTitle()\n}\n\nfunc TestCheckRunEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckRunEvent{Action: &zeroValue}\n\tc.GetAction()\n\tc = &CheckRunEvent{}\n\tc.GetAction()\n\tc = nil\n\tc.GetAction()\n}\n\nfunc TestCheckRunEvent_GetCheckRun(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CheckRunEvent{}\n\tc.GetCheckRun()\n\tc = nil\n\tc.GetCheckRun()\n}\n\nfunc TestCheckRunEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CheckRunEvent{}\n\tc.GetInstallation()\n\tc = nil\n\tc.GetInstallation()\n}\n\nfunc TestCheckRunEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CheckRunEvent{}\n\tc.GetOrg()\n\tc = nil\n\tc.GetOrg()\n}\n\nfunc TestCheckRunEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CheckRunEvent{}\n\tc.GetRepo()\n\tc = nil\n\tc.GetRepo()\n}\n\nfunc TestCheckRunEvent_GetRequestedAction(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CheckRunEvent{}\n\tc.GetRequestedAction()\n\tc = nil\n\tc.GetRequestedAction()\n}\n\nfunc TestCheckRunEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CheckRunEvent{}\n\tc.GetSender()\n\tc = nil\n\tc.GetSender()\n}\n\nfunc TestCheckRunImage_GetAlt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckRunImage{Alt: &zeroValue}\n\tc.GetAlt()\n\tc = &CheckRunImage{}\n\tc.GetAlt()\n\tc = nil\n\tc.GetAlt()\n}\n\nfunc TestCheckRunImage_GetCaption(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckRunImage{Caption: &zeroValue}\n\tc.GetCaption()\n\tc = &CheckRunImage{}\n\tc.GetCaption()\n\tc = nil\n\tc.GetCaption()\n}\n\nfunc TestCheckRunImage_GetImageURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckRunImage{ImageURL: &zeroValue}\n\tc.GetImageURL()\n\tc = &CheckRunImage{}\n\tc.GetImageURL()\n\tc = nil\n\tc.GetImageURL()\n}\n\nfunc TestCheckRunOutput_GetAnnotations(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CheckRunAnnotation{}\n\tc := &CheckRunOutput{Annotations: zeroValue}\n\tc.GetAnnotations()\n\tc = &CheckRunOutput{}\n\tc.GetAnnotations()\n\tc = nil\n\tc.GetAnnotations()\n}\n\nfunc TestCheckRunOutput_GetAnnotationsCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CheckRunOutput{AnnotationsCount: &zeroValue}\n\tc.GetAnnotationsCount()\n\tc = &CheckRunOutput{}\n\tc.GetAnnotationsCount()\n\tc = nil\n\tc.GetAnnotationsCount()\n}\n\nfunc TestCheckRunOutput_GetAnnotationsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckRunOutput{AnnotationsURL: &zeroValue}\n\tc.GetAnnotationsURL()\n\tc = &CheckRunOutput{}\n\tc.GetAnnotationsURL()\n\tc = nil\n\tc.GetAnnotationsURL()\n}\n\nfunc TestCheckRunOutput_GetImages(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CheckRunImage{}\n\tc := &CheckRunOutput{Images: zeroValue}\n\tc.GetImages()\n\tc = &CheckRunOutput{}\n\tc.GetImages()\n\tc = nil\n\tc.GetImages()\n}\n\nfunc TestCheckRunOutput_GetSummary(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckRunOutput{Summary: &zeroValue}\n\tc.GetSummary()\n\tc = &CheckRunOutput{}\n\tc.GetSummary()\n\tc = nil\n\tc.GetSummary()\n}\n\nfunc TestCheckRunOutput_GetText(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckRunOutput{Text: &zeroValue}\n\tc.GetText()\n\tc = &CheckRunOutput{}\n\tc.GetText()\n\tc = nil\n\tc.GetText()\n}\n\nfunc TestCheckRunOutput_GetTitle(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckRunOutput{Title: &zeroValue}\n\tc.GetTitle()\n\tc = &CheckRunOutput{}\n\tc.GetTitle()\n\tc = nil\n\tc.GetTitle()\n}\n\nfunc TestCheckSuite_GetAfterSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckSuite{AfterSHA: &zeroValue}\n\tc.GetAfterSHA()\n\tc = &CheckSuite{}\n\tc.GetAfterSHA()\n\tc = nil\n\tc.GetAfterSHA()\n}\n\nfunc TestCheckSuite_GetApp(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CheckSuite{}\n\tc.GetApp()\n\tc = nil\n\tc.GetApp()\n}\n\nfunc TestCheckSuite_GetBeforeSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckSuite{BeforeSHA: &zeroValue}\n\tc.GetBeforeSHA()\n\tc = &CheckSuite{}\n\tc.GetBeforeSHA()\n\tc = nil\n\tc.GetBeforeSHA()\n}\n\nfunc TestCheckSuite_GetConclusion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckSuite{Conclusion: &zeroValue}\n\tc.GetConclusion()\n\tc = &CheckSuite{}\n\tc.GetConclusion()\n\tc = nil\n\tc.GetConclusion()\n}\n\nfunc TestCheckSuite_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &CheckSuite{CreatedAt: &zeroValue}\n\tc.GetCreatedAt()\n\tc = &CheckSuite{}\n\tc.GetCreatedAt()\n\tc = nil\n\tc.GetCreatedAt()\n}\n\nfunc TestCheckSuite_GetHeadBranch(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckSuite{HeadBranch: &zeroValue}\n\tc.GetHeadBranch()\n\tc = &CheckSuite{}\n\tc.GetHeadBranch()\n\tc = nil\n\tc.GetHeadBranch()\n}\n\nfunc TestCheckSuite_GetHeadCommit(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CheckSuite{}\n\tc.GetHeadCommit()\n\tc = nil\n\tc.GetHeadCommit()\n}\n\nfunc TestCheckSuite_GetHeadSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckSuite{HeadSHA: &zeroValue}\n\tc.GetHeadSHA()\n\tc = &CheckSuite{}\n\tc.GetHeadSHA()\n\tc = nil\n\tc.GetHeadSHA()\n}\n\nfunc TestCheckSuite_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tc := &CheckSuite{ID: &zeroValue}\n\tc.GetID()\n\tc = &CheckSuite{}\n\tc.GetID()\n\tc = nil\n\tc.GetID()\n}\n\nfunc TestCheckSuite_GetLatestCheckRunsCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tc := &CheckSuite{LatestCheckRunsCount: &zeroValue}\n\tc.GetLatestCheckRunsCount()\n\tc = &CheckSuite{}\n\tc.GetLatestCheckRunsCount()\n\tc = nil\n\tc.GetLatestCheckRunsCount()\n}\n\nfunc TestCheckSuite_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckSuite{NodeID: &zeroValue}\n\tc.GetNodeID()\n\tc = &CheckSuite{}\n\tc.GetNodeID()\n\tc = nil\n\tc.GetNodeID()\n}\n\nfunc TestCheckSuite_GetPullRequests(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*PullRequest{}\n\tc := &CheckSuite{PullRequests: zeroValue}\n\tc.GetPullRequests()\n\tc = &CheckSuite{}\n\tc.GetPullRequests()\n\tc = nil\n\tc.GetPullRequests()\n}\n\nfunc TestCheckSuite_GetRepository(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CheckSuite{}\n\tc.GetRepository()\n\tc = nil\n\tc.GetRepository()\n}\n\nfunc TestCheckSuite_GetRerequestable(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &CheckSuite{Rerequestable: &zeroValue}\n\tc.GetRerequestable()\n\tc = &CheckSuite{}\n\tc.GetRerequestable()\n\tc = nil\n\tc.GetRerequestable()\n}\n\nfunc TestCheckSuite_GetRunsRerequestable(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &CheckSuite{RunsRerequestable: &zeroValue}\n\tc.GetRunsRerequestable()\n\tc = &CheckSuite{}\n\tc.GetRunsRerequestable()\n\tc = nil\n\tc.GetRunsRerequestable()\n}\n\nfunc TestCheckSuite_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckSuite{Status: &zeroValue}\n\tc.GetStatus()\n\tc = &CheckSuite{}\n\tc.GetStatus()\n\tc = nil\n\tc.GetStatus()\n}\n\nfunc TestCheckSuite_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &CheckSuite{UpdatedAt: &zeroValue}\n\tc.GetUpdatedAt()\n\tc = &CheckSuite{}\n\tc.GetUpdatedAt()\n\tc = nil\n\tc.GetUpdatedAt()\n}\n\nfunc TestCheckSuite_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckSuite{URL: &zeroValue}\n\tc.GetURL()\n\tc = &CheckSuite{}\n\tc.GetURL()\n\tc = nil\n\tc.GetURL()\n}\n\nfunc TestCheckSuiteEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CheckSuiteEvent{Action: &zeroValue}\n\tc.GetAction()\n\tc = &CheckSuiteEvent{}\n\tc.GetAction()\n\tc = nil\n\tc.GetAction()\n}\n\nfunc TestCheckSuiteEvent_GetCheckSuite(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CheckSuiteEvent{}\n\tc.GetCheckSuite()\n\tc = nil\n\tc.GetCheckSuite()\n}\n\nfunc TestCheckSuiteEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CheckSuiteEvent{}\n\tc.GetInstallation()\n\tc = nil\n\tc.GetInstallation()\n}\n\nfunc TestCheckSuiteEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CheckSuiteEvent{}\n\tc.GetOrg()\n\tc = nil\n\tc.GetOrg()\n}\n\nfunc TestCheckSuiteEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CheckSuiteEvent{}\n\tc.GetRepo()\n\tc = nil\n\tc.GetRepo()\n}\n\nfunc TestCheckSuiteEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CheckSuiteEvent{}\n\tc.GetSender()\n\tc = nil\n\tc.GetSender()\n}\n\nfunc TestCheckSuitePreferenceOptions_GetAutoTriggerChecks(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*AutoTriggerCheck{}\n\tc := &CheckSuitePreferenceOptions{AutoTriggerChecks: zeroValue}\n\tc.GetAutoTriggerChecks()\n\tc = &CheckSuitePreferenceOptions{}\n\tc.GetAutoTriggerChecks()\n\tc = nil\n\tc.GetAutoTriggerChecks()\n}\n\nfunc TestCheckSuitePreferenceResults_GetPreferences(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CheckSuitePreferenceResults{}\n\tc.GetPreferences()\n\tc = nil\n\tc.GetPreferences()\n}\n\nfunc TestCheckSuitePreferenceResults_GetRepository(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CheckSuitePreferenceResults{}\n\tc.GetRepository()\n\tc = nil\n\tc.GetRepository()\n}\n\nfunc TestClassroom_GetArchived(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &Classroom{Archived: &zeroValue}\n\tc.GetArchived()\n\tc = &Classroom{}\n\tc.GetArchived()\n\tc = nil\n\tc.GetArchived()\n}\n\nfunc TestClassroom_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tc := &Classroom{ID: &zeroValue}\n\tc.GetID()\n\tc = &Classroom{}\n\tc.GetID()\n\tc = nil\n\tc.GetID()\n}\n\nfunc TestClassroom_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Classroom{Name: &zeroValue}\n\tc.GetName()\n\tc = &Classroom{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestClassroom_GetOrganization(tt *testing.T) {\n\ttt.Parallel()\n\tc := &Classroom{}\n\tc.GetOrganization()\n\tc = nil\n\tc.GetOrganization()\n}\n\nfunc TestClassroom_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Classroom{URL: &zeroValue}\n\tc.GetURL()\n\tc = &Classroom{}\n\tc.GetURL()\n\tc = nil\n\tc.GetURL()\n}\n\nfunc TestClassroomAssignment_GetAccepted(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &ClassroomAssignment{Accepted: &zeroValue}\n\tc.GetAccepted()\n\tc = &ClassroomAssignment{}\n\tc.GetAccepted()\n\tc = nil\n\tc.GetAccepted()\n}\n\nfunc TestClassroomAssignment_GetClassroom(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ClassroomAssignment{}\n\tc.GetClassroom()\n\tc = nil\n\tc.GetClassroom()\n}\n\nfunc TestClassroomAssignment_GetDeadline(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &ClassroomAssignment{Deadline: &zeroValue}\n\tc.GetDeadline()\n\tc = &ClassroomAssignment{}\n\tc.GetDeadline()\n\tc = nil\n\tc.GetDeadline()\n}\n\nfunc TestClassroomAssignment_GetEditor(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ClassroomAssignment{Editor: &zeroValue}\n\tc.GetEditor()\n\tc = &ClassroomAssignment{}\n\tc.GetEditor()\n\tc = nil\n\tc.GetEditor()\n}\n\nfunc TestClassroomAssignment_GetFeedbackPullRequestsEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ClassroomAssignment{FeedbackPullRequestsEnabled: &zeroValue}\n\tc.GetFeedbackPullRequestsEnabled()\n\tc = &ClassroomAssignment{}\n\tc.GetFeedbackPullRequestsEnabled()\n\tc = nil\n\tc.GetFeedbackPullRequestsEnabled()\n}\n\nfunc TestClassroomAssignment_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tc := &ClassroomAssignment{ID: &zeroValue}\n\tc.GetID()\n\tc = &ClassroomAssignment{}\n\tc.GetID()\n\tc = nil\n\tc.GetID()\n}\n\nfunc TestClassroomAssignment_GetInvitationsEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ClassroomAssignment{InvitationsEnabled: &zeroValue}\n\tc.GetInvitationsEnabled()\n\tc = &ClassroomAssignment{}\n\tc.GetInvitationsEnabled()\n\tc = nil\n\tc.GetInvitationsEnabled()\n}\n\nfunc TestClassroomAssignment_GetInviteLink(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ClassroomAssignment{InviteLink: &zeroValue}\n\tc.GetInviteLink()\n\tc = &ClassroomAssignment{}\n\tc.GetInviteLink()\n\tc = nil\n\tc.GetInviteLink()\n}\n\nfunc TestClassroomAssignment_GetLanguage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ClassroomAssignment{Language: &zeroValue}\n\tc.GetLanguage()\n\tc = &ClassroomAssignment{}\n\tc.GetLanguage()\n\tc = nil\n\tc.GetLanguage()\n}\n\nfunc TestClassroomAssignment_GetMaxMembers(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &ClassroomAssignment{MaxMembers: &zeroValue}\n\tc.GetMaxMembers()\n\tc = &ClassroomAssignment{}\n\tc.GetMaxMembers()\n\tc = nil\n\tc.GetMaxMembers()\n}\n\nfunc TestClassroomAssignment_GetMaxTeams(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &ClassroomAssignment{MaxTeams: &zeroValue}\n\tc.GetMaxTeams()\n\tc = &ClassroomAssignment{}\n\tc.GetMaxTeams()\n\tc = nil\n\tc.GetMaxTeams()\n}\n\nfunc TestClassroomAssignment_GetPassing(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &ClassroomAssignment{Passing: &zeroValue}\n\tc.GetPassing()\n\tc = &ClassroomAssignment{}\n\tc.GetPassing()\n\tc = nil\n\tc.GetPassing()\n}\n\nfunc TestClassroomAssignment_GetPublicRepo(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ClassroomAssignment{PublicRepo: &zeroValue}\n\tc.GetPublicRepo()\n\tc = &ClassroomAssignment{}\n\tc.GetPublicRepo()\n\tc = nil\n\tc.GetPublicRepo()\n}\n\nfunc TestClassroomAssignment_GetSlug(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ClassroomAssignment{Slug: &zeroValue}\n\tc.GetSlug()\n\tc = &ClassroomAssignment{}\n\tc.GetSlug()\n\tc = nil\n\tc.GetSlug()\n}\n\nfunc TestClassroomAssignment_GetStarterCodeRepository(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ClassroomAssignment{}\n\tc.GetStarterCodeRepository()\n\tc = nil\n\tc.GetStarterCodeRepository()\n}\n\nfunc TestClassroomAssignment_GetStudentsAreRepoAdmins(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ClassroomAssignment{StudentsAreRepoAdmins: &zeroValue}\n\tc.GetStudentsAreRepoAdmins()\n\tc = &ClassroomAssignment{}\n\tc.GetStudentsAreRepoAdmins()\n\tc = nil\n\tc.GetStudentsAreRepoAdmins()\n}\n\nfunc TestClassroomAssignment_GetSubmitted(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &ClassroomAssignment{Submitted: &zeroValue}\n\tc.GetSubmitted()\n\tc = &ClassroomAssignment{}\n\tc.GetSubmitted()\n\tc = nil\n\tc.GetSubmitted()\n}\n\nfunc TestClassroomAssignment_GetTitle(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ClassroomAssignment{Title: &zeroValue}\n\tc.GetTitle()\n\tc = &ClassroomAssignment{}\n\tc.GetTitle()\n\tc = nil\n\tc.GetTitle()\n}\n\nfunc TestClassroomAssignment_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ClassroomAssignment{Type: &zeroValue}\n\tc.GetType()\n\tc = &ClassroomAssignment{}\n\tc.GetType()\n\tc = nil\n\tc.GetType()\n}\n\nfunc TestClassroomUser_GetAvatarURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ClassroomUser{AvatarURL: &zeroValue}\n\tc.GetAvatarURL()\n\tc = &ClassroomUser{}\n\tc.GetAvatarURL()\n\tc = nil\n\tc.GetAvatarURL()\n}\n\nfunc TestClassroomUser_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ClassroomUser{HTMLURL: &zeroValue}\n\tc.GetHTMLURL()\n\tc = &ClassroomUser{}\n\tc.GetHTMLURL()\n\tc = nil\n\tc.GetHTMLURL()\n}\n\nfunc TestClassroomUser_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tc := &ClassroomUser{ID: &zeroValue}\n\tc.GetID()\n\tc = &ClassroomUser{}\n\tc.GetID()\n\tc = nil\n\tc.GetID()\n}\n\nfunc TestClassroomUser_GetLogin(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ClassroomUser{Login: &zeroValue}\n\tc.GetLogin()\n\tc = &ClassroomUser{}\n\tc.GetLogin()\n\tc = nil\n\tc.GetLogin()\n}\n\nfunc TestClusterArtifactDeployment_GetDeploymentName(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ClusterArtifactDeployment{}\n\tc.GetDeploymentName()\n\tc = nil\n\tc.GetDeploymentName()\n}\n\nfunc TestClusterArtifactDeployment_GetDigest(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ClusterArtifactDeployment{}\n\tc.GetDigest()\n\tc = nil\n\tc.GetDigest()\n}\n\nfunc TestClusterArtifactDeployment_GetGithubRepository(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ClusterArtifactDeployment{GithubRepository: &zeroValue}\n\tc.GetGithubRepository()\n\tc = &ClusterArtifactDeployment{}\n\tc.GetGithubRepository()\n\tc = nil\n\tc.GetGithubRepository()\n}\n\nfunc TestClusterArtifactDeployment_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ClusterArtifactDeployment{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestClusterArtifactDeployment_GetRuntimeRisks(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []DeploymentRuntimeRisk{}\n\tc := &ClusterArtifactDeployment{RuntimeRisks: zeroValue}\n\tc.GetRuntimeRisks()\n\tc = &ClusterArtifactDeployment{}\n\tc.GetRuntimeRisks()\n\tc = nil\n\tc.GetRuntimeRisks()\n}\n\nfunc TestClusterArtifactDeployment_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ClusterArtifactDeployment{}\n\tc.GetStatus()\n\tc = nil\n\tc.GetStatus()\n}\n\nfunc TestClusterArtifactDeployment_GetTags(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]string{}\n\tc := &ClusterArtifactDeployment{Tags: zeroValue}\n\tc.GetTags()\n\tc = &ClusterArtifactDeployment{}\n\tc.GetTags()\n\tc = nil\n\tc.GetTags()\n}\n\nfunc TestClusterArtifactDeployment_GetVersion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ClusterArtifactDeployment{Version: &zeroValue}\n\tc.GetVersion()\n\tc = &ClusterArtifactDeployment{}\n\tc.GetVersion()\n\tc = nil\n\tc.GetVersion()\n}\n\nfunc TestClusterDeploymentRecordsRequest_GetDeployments(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*ClusterArtifactDeployment{}\n\tc := &ClusterDeploymentRecordsRequest{Deployments: zeroValue}\n\tc.GetDeployments()\n\tc = &ClusterDeploymentRecordsRequest{}\n\tc.GetDeployments()\n\tc = nil\n\tc.GetDeployments()\n}\n\nfunc TestClusterDeploymentRecordsRequest_GetLogicalEnvironment(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ClusterDeploymentRecordsRequest{}\n\tc.GetLogicalEnvironment()\n\tc = nil\n\tc.GetLogicalEnvironment()\n}\n\nfunc TestClusterDeploymentRecordsRequest_GetPhysicalEnvironment(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ClusterDeploymentRecordsRequest{PhysicalEnvironment: &zeroValue}\n\tc.GetPhysicalEnvironment()\n\tc = &ClusterDeploymentRecordsRequest{}\n\tc.GetPhysicalEnvironment()\n\tc = nil\n\tc.GetPhysicalEnvironment()\n}\n\nfunc TestClusterSSHKey_GetFingerprint(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ClusterSSHKey{Fingerprint: &zeroValue}\n\tc.GetFingerprint()\n\tc = &ClusterSSHKey{}\n\tc.GetFingerprint()\n\tc = nil\n\tc.GetFingerprint()\n}\n\nfunc TestClusterSSHKey_GetKey(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ClusterSSHKey{Key: &zeroValue}\n\tc.GetKey()\n\tc = &ClusterSSHKey{}\n\tc.GetKey()\n\tc = nil\n\tc.GetKey()\n}\n\nfunc TestClusterStatus_GetNodes(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*ClusterStatusNode{}\n\tc := &ClusterStatus{Nodes: zeroValue}\n\tc.GetNodes()\n\tc = &ClusterStatus{}\n\tc.GetNodes()\n\tc = nil\n\tc.GetNodes()\n}\n\nfunc TestClusterStatus_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ClusterStatus{Status: &zeroValue}\n\tc.GetStatus()\n\tc = &ClusterStatus{}\n\tc.GetStatus()\n\tc = nil\n\tc.GetStatus()\n}\n\nfunc TestClusterStatusNode_GetHostname(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ClusterStatusNode{Hostname: &zeroValue}\n\tc.GetHostname()\n\tc = &ClusterStatusNode{}\n\tc.GetHostname()\n\tc = nil\n\tc.GetHostname()\n}\n\nfunc TestClusterStatusNode_GetServices(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*ClusterStatusNodeServiceItem{}\n\tc := &ClusterStatusNode{Services: zeroValue}\n\tc.GetServices()\n\tc = &ClusterStatusNode{}\n\tc.GetServices()\n\tc = nil\n\tc.GetServices()\n}\n\nfunc TestClusterStatusNode_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ClusterStatusNode{Status: &zeroValue}\n\tc.GetStatus()\n\tc = &ClusterStatusNode{}\n\tc.GetStatus()\n\tc = nil\n\tc.GetStatus()\n}\n\nfunc TestClusterStatusNodeServiceItem_GetDetails(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ClusterStatusNodeServiceItem{Details: &zeroValue}\n\tc.GetDetails()\n\tc = &ClusterStatusNodeServiceItem{}\n\tc.GetDetails()\n\tc = nil\n\tc.GetDetails()\n}\n\nfunc TestClusterStatusNodeServiceItem_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ClusterStatusNodeServiceItem{Name: &zeroValue}\n\tc.GetName()\n\tc = &ClusterStatusNodeServiceItem{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestClusterStatusNodeServiceItem_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ClusterStatusNodeServiceItem{Status: &zeroValue}\n\tc.GetStatus()\n\tc = &ClusterStatusNodeServiceItem{}\n\tc.GetStatus()\n\tc = nil\n\tc.GetStatus()\n}\n\nfunc TestCodeOfConduct_GetBody(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeOfConduct{Body: &zeroValue}\n\tc.GetBody()\n\tc = &CodeOfConduct{}\n\tc.GetBody()\n\tc = nil\n\tc.GetBody()\n}\n\nfunc TestCodeOfConduct_GetKey(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeOfConduct{Key: &zeroValue}\n\tc.GetKey()\n\tc = &CodeOfConduct{}\n\tc.GetKey()\n\tc = nil\n\tc.GetKey()\n}\n\nfunc TestCodeOfConduct_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeOfConduct{Name: &zeroValue}\n\tc.GetName()\n\tc = &CodeOfConduct{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCodeOfConduct_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeOfConduct{URL: &zeroValue}\n\tc.GetURL()\n\tc = &CodeOfConduct{}\n\tc.GetURL()\n\tc = nil\n\tc.GetURL()\n}\n\nfunc TestCodeownersError_GetColumn(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodeownersError{}\n\tc.GetColumn()\n\tc = nil\n\tc.GetColumn()\n}\n\nfunc TestCodeownersError_GetKind(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodeownersError{}\n\tc.GetKind()\n\tc = nil\n\tc.GetKind()\n}\n\nfunc TestCodeownersError_GetLine(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodeownersError{}\n\tc.GetLine()\n\tc = nil\n\tc.GetLine()\n}\n\nfunc TestCodeownersError_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodeownersError{}\n\tc.GetMessage()\n\tc = nil\n\tc.GetMessage()\n}\n\nfunc TestCodeownersError_GetPath(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodeownersError{}\n\tc.GetPath()\n\tc = nil\n\tc.GetPath()\n}\n\nfunc TestCodeownersError_GetSource(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodeownersError{}\n\tc.GetSource()\n\tc = nil\n\tc.GetSource()\n}\n\nfunc TestCodeownersError_GetSuggestion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeownersError{Suggestion: &zeroValue}\n\tc.GetSuggestion()\n\tc = &CodeownersError{}\n\tc.GetSuggestion()\n\tc = nil\n\tc.GetSuggestion()\n}\n\nfunc TestCodeownersErrors_GetErrors(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CodeownersError{}\n\tc := &CodeownersErrors{Errors: zeroValue}\n\tc.GetErrors()\n\tc = &CodeownersErrors{}\n\tc.GetErrors()\n\tc = nil\n\tc.GetErrors()\n}\n\nfunc TestCodeQLDatabase_GetContentType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeQLDatabase{ContentType: &zeroValue}\n\tc.GetContentType()\n\tc = &CodeQLDatabase{}\n\tc.GetContentType()\n\tc = nil\n\tc.GetContentType()\n}\n\nfunc TestCodeQLDatabase_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &CodeQLDatabase{CreatedAt: &zeroValue}\n\tc.GetCreatedAt()\n\tc = &CodeQLDatabase{}\n\tc.GetCreatedAt()\n\tc = nil\n\tc.GetCreatedAt()\n}\n\nfunc TestCodeQLDatabase_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tc := &CodeQLDatabase{ID: &zeroValue}\n\tc.GetID()\n\tc = &CodeQLDatabase{}\n\tc.GetID()\n\tc = nil\n\tc.GetID()\n}\n\nfunc TestCodeQLDatabase_GetLanguage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeQLDatabase{Language: &zeroValue}\n\tc.GetLanguage()\n\tc = &CodeQLDatabase{}\n\tc.GetLanguage()\n\tc = nil\n\tc.GetLanguage()\n}\n\nfunc TestCodeQLDatabase_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeQLDatabase{Name: &zeroValue}\n\tc.GetName()\n\tc = &CodeQLDatabase{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCodeQLDatabase_GetSize(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tc := &CodeQLDatabase{Size: &zeroValue}\n\tc.GetSize()\n\tc = &CodeQLDatabase{}\n\tc.GetSize()\n\tc = nil\n\tc.GetSize()\n}\n\nfunc TestCodeQLDatabase_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &CodeQLDatabase{UpdatedAt: &zeroValue}\n\tc.GetUpdatedAt()\n\tc = &CodeQLDatabase{}\n\tc.GetUpdatedAt()\n\tc = nil\n\tc.GetUpdatedAt()\n}\n\nfunc TestCodeQLDatabase_GetUploader(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodeQLDatabase{}\n\tc.GetUploader()\n\tc = nil\n\tc.GetUploader()\n}\n\nfunc TestCodeQLDatabase_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeQLDatabase{URL: &zeroValue}\n\tc.GetURL()\n\tc = &CodeQLDatabase{}\n\tc.GetURL()\n\tc = nil\n\tc.GetURL()\n}\n\nfunc TestCodeResult_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeResult{HTMLURL: &zeroValue}\n\tc.GetHTMLURL()\n\tc = &CodeResult{}\n\tc.GetHTMLURL()\n\tc = nil\n\tc.GetHTMLURL()\n}\n\nfunc TestCodeResult_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeResult{Name: &zeroValue}\n\tc.GetName()\n\tc = &CodeResult{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCodeResult_GetPath(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeResult{Path: &zeroValue}\n\tc.GetPath()\n\tc = &CodeResult{}\n\tc.GetPath()\n\tc = nil\n\tc.GetPath()\n}\n\nfunc TestCodeResult_GetRepository(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodeResult{}\n\tc.GetRepository()\n\tc = nil\n\tc.GetRepository()\n}\n\nfunc TestCodeResult_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeResult{SHA: &zeroValue}\n\tc.GetSHA()\n\tc = &CodeResult{}\n\tc.GetSHA()\n\tc = nil\n\tc.GetSHA()\n}\n\nfunc TestCodeResult_GetTextMatches(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*TextMatch{}\n\tc := &CodeResult{TextMatches: zeroValue}\n\tc.GetTextMatches()\n\tc = &CodeResult{}\n\tc.GetTextMatches()\n\tc = nil\n\tc.GetTextMatches()\n}\n\nfunc TestCodeScanningAlertEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeScanningAlertEvent{Action: &zeroValue}\n\tc.GetAction()\n\tc = &CodeScanningAlertEvent{}\n\tc.GetAction()\n\tc = nil\n\tc.GetAction()\n}\n\nfunc TestCodeScanningAlertEvent_GetAlert(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodeScanningAlertEvent{}\n\tc.GetAlert()\n\tc = nil\n\tc.GetAlert()\n}\n\nfunc TestCodeScanningAlertEvent_GetCommitOID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeScanningAlertEvent{CommitOID: &zeroValue}\n\tc.GetCommitOID()\n\tc = &CodeScanningAlertEvent{}\n\tc.GetCommitOID()\n\tc = nil\n\tc.GetCommitOID()\n}\n\nfunc TestCodeScanningAlertEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodeScanningAlertEvent{}\n\tc.GetInstallation()\n\tc = nil\n\tc.GetInstallation()\n}\n\nfunc TestCodeScanningAlertEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodeScanningAlertEvent{}\n\tc.GetOrg()\n\tc = nil\n\tc.GetOrg()\n}\n\nfunc TestCodeScanningAlertEvent_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeScanningAlertEvent{Ref: &zeroValue}\n\tc.GetRef()\n\tc = &CodeScanningAlertEvent{}\n\tc.GetRef()\n\tc = nil\n\tc.GetRef()\n}\n\nfunc TestCodeScanningAlertEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodeScanningAlertEvent{}\n\tc.GetRepo()\n\tc = nil\n\tc.GetRepo()\n}\n\nfunc TestCodeScanningAlertEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodeScanningAlertEvent{}\n\tc.GetSender()\n\tc = nil\n\tc.GetSender()\n}\n\nfunc TestCodeScanningAlertState_GetDismissedComment(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeScanningAlertState{DismissedComment: &zeroValue}\n\tc.GetDismissedComment()\n\tc = &CodeScanningAlertState{}\n\tc.GetDismissedComment()\n\tc = nil\n\tc.GetDismissedComment()\n}\n\nfunc TestCodeScanningAlertState_GetDismissedReason(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeScanningAlertState{DismissedReason: &zeroValue}\n\tc.GetDismissedReason()\n\tc = &CodeScanningAlertState{}\n\tc.GetDismissedReason()\n\tc = nil\n\tc.GetDismissedReason()\n}\n\nfunc TestCodeScanningAlertState_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodeScanningAlertState{}\n\tc.GetState()\n\tc = nil\n\tc.GetState()\n}\n\nfunc TestCodeScanningBranchRule_GetParameters(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodeScanningBranchRule{}\n\tc.GetParameters()\n\tc = nil\n\tc.GetParameters()\n}\n\nfunc TestCodeScanningDefaultSetupOptions_GetRunnerLabel(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeScanningDefaultSetupOptions{RunnerLabel: &zeroValue}\n\tc.GetRunnerLabel()\n\tc = &CodeScanningDefaultSetupOptions{}\n\tc.GetRunnerLabel()\n\tc = nil\n\tc.GetRunnerLabel()\n}\n\nfunc TestCodeScanningDefaultSetupOptions_GetRunnerType(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodeScanningDefaultSetupOptions{}\n\tc.GetRunnerType()\n\tc = nil\n\tc.GetRunnerType()\n}\n\nfunc TestCodeScanningOptions_GetAllowAdvanced(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &CodeScanningOptions{AllowAdvanced: &zeroValue}\n\tc.GetAllowAdvanced()\n\tc = &CodeScanningOptions{}\n\tc.GetAllowAdvanced()\n\tc = nil\n\tc.GetAllowAdvanced()\n}\n\nfunc TestCodeScanningRuleParameters_GetCodeScanningTools(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*RuleCodeScanningTool{}\n\tc := &CodeScanningRuleParameters{CodeScanningTools: zeroValue}\n\tc.GetCodeScanningTools()\n\tc = &CodeScanningRuleParameters{}\n\tc.GetCodeScanningTools()\n\tc = nil\n\tc.GetCodeScanningTools()\n}\n\nfunc TestCodeSearchResult_GetCodeResults(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CodeResult{}\n\tc := &CodeSearchResult{CodeResults: zeroValue}\n\tc.GetCodeResults()\n\tc = &CodeSearchResult{}\n\tc.GetCodeResults()\n\tc = nil\n\tc.GetCodeResults()\n}\n\nfunc TestCodeSearchResult_GetIncompleteResults(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &CodeSearchResult{IncompleteResults: &zeroValue}\n\tc.GetIncompleteResults()\n\tc = &CodeSearchResult{}\n\tc.GetIncompleteResults()\n\tc = nil\n\tc.GetIncompleteResults()\n}\n\nfunc TestCodeSearchResult_GetTotal(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CodeSearchResult{Total: &zeroValue}\n\tc.GetTotal()\n\tc = &CodeSearchResult{}\n\tc.GetTotal()\n\tc = nil\n\tc.GetTotal()\n}\n\nfunc TestCodeSecurityConfiguration_GetAdvancedSecurity(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeSecurityConfiguration{AdvancedSecurity: &zeroValue}\n\tc.GetAdvancedSecurity()\n\tc = &CodeSecurityConfiguration{}\n\tc.GetAdvancedSecurity()\n\tc = nil\n\tc.GetAdvancedSecurity()\n}\n\nfunc TestCodeSecurityConfiguration_GetCodeScanningDefaultSetup(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeSecurityConfiguration{CodeScanningDefaultSetup: &zeroValue}\n\tc.GetCodeScanningDefaultSetup()\n\tc = &CodeSecurityConfiguration{}\n\tc.GetCodeScanningDefaultSetup()\n\tc = nil\n\tc.GetCodeScanningDefaultSetup()\n}\n\nfunc TestCodeSecurityConfiguration_GetCodeScanningDefaultSetupOptions(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodeSecurityConfiguration{}\n\tc.GetCodeScanningDefaultSetupOptions()\n\tc = nil\n\tc.GetCodeScanningDefaultSetupOptions()\n}\n\nfunc TestCodeSecurityConfiguration_GetCodeScanningDelegatedAlertDismissal(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeSecurityConfiguration{CodeScanningDelegatedAlertDismissal: &zeroValue}\n\tc.GetCodeScanningDelegatedAlertDismissal()\n\tc = &CodeSecurityConfiguration{}\n\tc.GetCodeScanningDelegatedAlertDismissal()\n\tc = nil\n\tc.GetCodeScanningDelegatedAlertDismissal()\n}\n\nfunc TestCodeSecurityConfiguration_GetCodeScanningOptions(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodeSecurityConfiguration{}\n\tc.GetCodeScanningOptions()\n\tc = nil\n\tc.GetCodeScanningOptions()\n}\n\nfunc TestCodeSecurityConfiguration_GetCodeSecurity(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeSecurityConfiguration{CodeSecurity: &zeroValue}\n\tc.GetCodeSecurity()\n\tc = &CodeSecurityConfiguration{}\n\tc.GetCodeSecurity()\n\tc = nil\n\tc.GetCodeSecurity()\n}\n\nfunc TestCodeSecurityConfiguration_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &CodeSecurityConfiguration{CreatedAt: &zeroValue}\n\tc.GetCreatedAt()\n\tc = &CodeSecurityConfiguration{}\n\tc.GetCreatedAt()\n\tc = nil\n\tc.GetCreatedAt()\n}\n\nfunc TestCodeSecurityConfiguration_GetDependabotAlerts(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeSecurityConfiguration{DependabotAlerts: &zeroValue}\n\tc.GetDependabotAlerts()\n\tc = &CodeSecurityConfiguration{}\n\tc.GetDependabotAlerts()\n\tc = nil\n\tc.GetDependabotAlerts()\n}\n\nfunc TestCodeSecurityConfiguration_GetDependabotSecurityUpdates(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeSecurityConfiguration{DependabotSecurityUpdates: &zeroValue}\n\tc.GetDependabotSecurityUpdates()\n\tc = &CodeSecurityConfiguration{}\n\tc.GetDependabotSecurityUpdates()\n\tc = nil\n\tc.GetDependabotSecurityUpdates()\n}\n\nfunc TestCodeSecurityConfiguration_GetDependencyGraph(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeSecurityConfiguration{DependencyGraph: &zeroValue}\n\tc.GetDependencyGraph()\n\tc = &CodeSecurityConfiguration{}\n\tc.GetDependencyGraph()\n\tc = nil\n\tc.GetDependencyGraph()\n}\n\nfunc TestCodeSecurityConfiguration_GetDependencyGraphAutosubmitAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeSecurityConfiguration{DependencyGraphAutosubmitAction: &zeroValue}\n\tc.GetDependencyGraphAutosubmitAction()\n\tc = &CodeSecurityConfiguration{}\n\tc.GetDependencyGraphAutosubmitAction()\n\tc = nil\n\tc.GetDependencyGraphAutosubmitAction()\n}\n\nfunc TestCodeSecurityConfiguration_GetDependencyGraphAutosubmitActionOptions(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodeSecurityConfiguration{}\n\tc.GetDependencyGraphAutosubmitActionOptions()\n\tc = nil\n\tc.GetDependencyGraphAutosubmitActionOptions()\n}\n\nfunc TestCodeSecurityConfiguration_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodeSecurityConfiguration{}\n\tc.GetDescription()\n\tc = nil\n\tc.GetDescription()\n}\n\nfunc TestCodeSecurityConfiguration_GetEnforcement(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeSecurityConfiguration{Enforcement: &zeroValue}\n\tc.GetEnforcement()\n\tc = &CodeSecurityConfiguration{}\n\tc.GetEnforcement()\n\tc = nil\n\tc.GetEnforcement()\n}\n\nfunc TestCodeSecurityConfiguration_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeSecurityConfiguration{HTMLURL: &zeroValue}\n\tc.GetHTMLURL()\n\tc = &CodeSecurityConfiguration{}\n\tc.GetHTMLURL()\n\tc = nil\n\tc.GetHTMLURL()\n}\n\nfunc TestCodeSecurityConfiguration_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tc := &CodeSecurityConfiguration{ID: &zeroValue}\n\tc.GetID()\n\tc = &CodeSecurityConfiguration{}\n\tc.GetID()\n\tc = nil\n\tc.GetID()\n}\n\nfunc TestCodeSecurityConfiguration_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodeSecurityConfiguration{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCodeSecurityConfiguration_GetPrivateVulnerabilityReporting(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeSecurityConfiguration{PrivateVulnerabilityReporting: &zeroValue}\n\tc.GetPrivateVulnerabilityReporting()\n\tc = &CodeSecurityConfiguration{}\n\tc.GetPrivateVulnerabilityReporting()\n\tc = nil\n\tc.GetPrivateVulnerabilityReporting()\n}\n\nfunc TestCodeSecurityConfiguration_GetSecretProtection(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeSecurityConfiguration{SecretProtection: &zeroValue}\n\tc.GetSecretProtection()\n\tc = &CodeSecurityConfiguration{}\n\tc.GetSecretProtection()\n\tc = nil\n\tc.GetSecretProtection()\n}\n\nfunc TestCodeSecurityConfiguration_GetSecretScanning(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeSecurityConfiguration{SecretScanning: &zeroValue}\n\tc.GetSecretScanning()\n\tc = &CodeSecurityConfiguration{}\n\tc.GetSecretScanning()\n\tc = nil\n\tc.GetSecretScanning()\n}\n\nfunc TestCodeSecurityConfiguration_GetSecretScanningDelegatedAlertDismissal(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeSecurityConfiguration{SecretScanningDelegatedAlertDismissal: &zeroValue}\n\tc.GetSecretScanningDelegatedAlertDismissal()\n\tc = &CodeSecurityConfiguration{}\n\tc.GetSecretScanningDelegatedAlertDismissal()\n\tc = nil\n\tc.GetSecretScanningDelegatedAlertDismissal()\n}\n\nfunc TestCodeSecurityConfiguration_GetSecretScanningDelegatedBypass(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeSecurityConfiguration{SecretScanningDelegatedBypass: &zeroValue}\n\tc.GetSecretScanningDelegatedBypass()\n\tc = &CodeSecurityConfiguration{}\n\tc.GetSecretScanningDelegatedBypass()\n\tc = nil\n\tc.GetSecretScanningDelegatedBypass()\n}\n\nfunc TestCodeSecurityConfiguration_GetSecretScanningDelegatedBypassOptions(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodeSecurityConfiguration{}\n\tc.GetSecretScanningDelegatedBypassOptions()\n\tc = nil\n\tc.GetSecretScanningDelegatedBypassOptions()\n}\n\nfunc TestCodeSecurityConfiguration_GetSecretScanningGenericSecrets(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeSecurityConfiguration{SecretScanningGenericSecrets: &zeroValue}\n\tc.GetSecretScanningGenericSecrets()\n\tc = &CodeSecurityConfiguration{}\n\tc.GetSecretScanningGenericSecrets()\n\tc = nil\n\tc.GetSecretScanningGenericSecrets()\n}\n\nfunc TestCodeSecurityConfiguration_GetSecretScanningNonProviderPatterns(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeSecurityConfiguration{SecretScanningNonProviderPatterns: &zeroValue}\n\tc.GetSecretScanningNonProviderPatterns()\n\tc = &CodeSecurityConfiguration{}\n\tc.GetSecretScanningNonProviderPatterns()\n\tc = nil\n\tc.GetSecretScanningNonProviderPatterns()\n}\n\nfunc TestCodeSecurityConfiguration_GetSecretScanningPushProtection(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeSecurityConfiguration{SecretScanningPushProtection: &zeroValue}\n\tc.GetSecretScanningPushProtection()\n\tc = &CodeSecurityConfiguration{}\n\tc.GetSecretScanningPushProtection()\n\tc = nil\n\tc.GetSecretScanningPushProtection()\n}\n\nfunc TestCodeSecurityConfiguration_GetSecretScanningValidityChecks(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeSecurityConfiguration{SecretScanningValidityChecks: &zeroValue}\n\tc.GetSecretScanningValidityChecks()\n\tc = &CodeSecurityConfiguration{}\n\tc.GetSecretScanningValidityChecks()\n\tc = nil\n\tc.GetSecretScanningValidityChecks()\n}\n\nfunc TestCodeSecurityConfiguration_GetTargetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeSecurityConfiguration{TargetType: &zeroValue}\n\tc.GetTargetType()\n\tc = &CodeSecurityConfiguration{}\n\tc.GetTargetType()\n\tc = nil\n\tc.GetTargetType()\n}\n\nfunc TestCodeSecurityConfiguration_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &CodeSecurityConfiguration{UpdatedAt: &zeroValue}\n\tc.GetUpdatedAt()\n\tc = &CodeSecurityConfiguration{}\n\tc.GetUpdatedAt()\n\tc = nil\n\tc.GetUpdatedAt()\n}\n\nfunc TestCodeSecurityConfiguration_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeSecurityConfiguration{URL: &zeroValue}\n\tc.GetURL()\n\tc = &CodeSecurityConfiguration{}\n\tc.GetURL()\n\tc = nil\n\tc.GetURL()\n}\n\nfunc TestCodeSecurityConfigurationWithDefaultForNewRepos_GetConfiguration(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodeSecurityConfigurationWithDefaultForNewRepos{}\n\tc.GetConfiguration()\n\tc = nil\n\tc.GetConfiguration()\n}\n\nfunc TestCodeSecurityConfigurationWithDefaultForNewRepos_GetDefaultForNewRepos(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodeSecurityConfigurationWithDefaultForNewRepos{DefaultForNewRepos: &zeroValue}\n\tc.GetDefaultForNewRepos()\n\tc = &CodeSecurityConfigurationWithDefaultForNewRepos{}\n\tc.GetDefaultForNewRepos()\n\tc = nil\n\tc.GetDefaultForNewRepos()\n}\n\nfunc TestCodespace_GetBillableOwner(tt *testing.T) {\n\ttt.Parallel()\n\tc := &Codespace{}\n\tc.GetBillableOwner()\n\tc = nil\n\tc.GetBillableOwner()\n}\n\nfunc TestCodespace_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &Codespace{CreatedAt: &zeroValue}\n\tc.GetCreatedAt()\n\tc = &Codespace{}\n\tc.GetCreatedAt()\n\tc = nil\n\tc.GetCreatedAt()\n}\n\nfunc TestCodespace_GetDevcontainerPath(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Codespace{DevcontainerPath: &zeroValue}\n\tc.GetDevcontainerPath()\n\tc = &Codespace{}\n\tc.GetDevcontainerPath()\n\tc = nil\n\tc.GetDevcontainerPath()\n}\n\nfunc TestCodespace_GetDisplayName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Codespace{DisplayName: &zeroValue}\n\tc.GetDisplayName()\n\tc = &Codespace{}\n\tc.GetDisplayName()\n\tc = nil\n\tc.GetDisplayName()\n}\n\nfunc TestCodespace_GetEnvironmentID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Codespace{EnvironmentID: &zeroValue}\n\tc.GetEnvironmentID()\n\tc = &Codespace{}\n\tc.GetEnvironmentID()\n\tc = nil\n\tc.GetEnvironmentID()\n}\n\nfunc TestCodespace_GetGitStatus(tt *testing.T) {\n\ttt.Parallel()\n\tc := &Codespace{}\n\tc.GetGitStatus()\n\tc = nil\n\tc.GetGitStatus()\n}\n\nfunc TestCodespace_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tc := &Codespace{ID: &zeroValue}\n\tc.GetID()\n\tc = &Codespace{}\n\tc.GetID()\n\tc = nil\n\tc.GetID()\n}\n\nfunc TestCodespace_GetIdleTimeoutMinutes(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &Codespace{IdleTimeoutMinutes: &zeroValue}\n\tc.GetIdleTimeoutMinutes()\n\tc = &Codespace{}\n\tc.GetIdleTimeoutMinutes()\n\tc = nil\n\tc.GetIdleTimeoutMinutes()\n}\n\nfunc TestCodespace_GetIdleTimeoutNotice(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Codespace{IdleTimeoutNotice: &zeroValue}\n\tc.GetIdleTimeoutNotice()\n\tc = &Codespace{}\n\tc.GetIdleTimeoutNotice()\n\tc = nil\n\tc.GetIdleTimeoutNotice()\n}\n\nfunc TestCodespace_GetLastKnownStopNotice(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Codespace{LastKnownStopNotice: &zeroValue}\n\tc.GetLastKnownStopNotice()\n\tc = &Codespace{}\n\tc.GetLastKnownStopNotice()\n\tc = nil\n\tc.GetLastKnownStopNotice()\n}\n\nfunc TestCodespace_GetLastUsedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &Codespace{LastUsedAt: &zeroValue}\n\tc.GetLastUsedAt()\n\tc = &Codespace{}\n\tc.GetLastUsedAt()\n\tc = nil\n\tc.GetLastUsedAt()\n}\n\nfunc TestCodespace_GetLocation(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Codespace{Location: &zeroValue}\n\tc.GetLocation()\n\tc = &Codespace{}\n\tc.GetLocation()\n\tc = nil\n\tc.GetLocation()\n}\n\nfunc TestCodespace_GetMachine(tt *testing.T) {\n\ttt.Parallel()\n\tc := &Codespace{}\n\tc.GetMachine()\n\tc = nil\n\tc.GetMachine()\n}\n\nfunc TestCodespace_GetMachinesURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Codespace{MachinesURL: &zeroValue}\n\tc.GetMachinesURL()\n\tc = &Codespace{}\n\tc.GetMachinesURL()\n\tc = nil\n\tc.GetMachinesURL()\n}\n\nfunc TestCodespace_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Codespace{Name: &zeroValue}\n\tc.GetName()\n\tc = &Codespace{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCodespace_GetOwner(tt *testing.T) {\n\ttt.Parallel()\n\tc := &Codespace{}\n\tc.GetOwner()\n\tc = nil\n\tc.GetOwner()\n}\n\nfunc TestCodespace_GetPendingOperation(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &Codespace{PendingOperation: &zeroValue}\n\tc.GetPendingOperation()\n\tc = &Codespace{}\n\tc.GetPendingOperation()\n\tc = nil\n\tc.GetPendingOperation()\n}\n\nfunc TestCodespace_GetPendingOperationDisabledReason(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Codespace{PendingOperationDisabledReason: &zeroValue}\n\tc.GetPendingOperationDisabledReason()\n\tc = &Codespace{}\n\tc.GetPendingOperationDisabledReason()\n\tc = nil\n\tc.GetPendingOperationDisabledReason()\n}\n\nfunc TestCodespace_GetPrebuild(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &Codespace{Prebuild: &zeroValue}\n\tc.GetPrebuild()\n\tc = &Codespace{}\n\tc.GetPrebuild()\n\tc = nil\n\tc.GetPrebuild()\n}\n\nfunc TestCodespace_GetPullsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Codespace{PullsURL: &zeroValue}\n\tc.GetPullsURL()\n\tc = &Codespace{}\n\tc.GetPullsURL()\n\tc = nil\n\tc.GetPullsURL()\n}\n\nfunc TestCodespace_GetRecentFolders(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tc := &Codespace{RecentFolders: zeroValue}\n\tc.GetRecentFolders()\n\tc = &Codespace{}\n\tc.GetRecentFolders()\n\tc = nil\n\tc.GetRecentFolders()\n}\n\nfunc TestCodespace_GetRepository(tt *testing.T) {\n\ttt.Parallel()\n\tc := &Codespace{}\n\tc.GetRepository()\n\tc = nil\n\tc.GetRepository()\n}\n\nfunc TestCodespace_GetRetentionExpiresAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &Codespace{RetentionExpiresAt: &zeroValue}\n\tc.GetRetentionExpiresAt()\n\tc = &Codespace{}\n\tc.GetRetentionExpiresAt()\n\tc = nil\n\tc.GetRetentionExpiresAt()\n}\n\nfunc TestCodespace_GetRetentionPeriodMinutes(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &Codespace{RetentionPeriodMinutes: &zeroValue}\n\tc.GetRetentionPeriodMinutes()\n\tc = &Codespace{}\n\tc.GetRetentionPeriodMinutes()\n\tc = nil\n\tc.GetRetentionPeriodMinutes()\n}\n\nfunc TestCodespace_GetRuntimeConstraints(tt *testing.T) {\n\ttt.Parallel()\n\tc := &Codespace{}\n\tc.GetRuntimeConstraints()\n\tc = nil\n\tc.GetRuntimeConstraints()\n}\n\nfunc TestCodespace_GetStartURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Codespace{StartURL: &zeroValue}\n\tc.GetStartURL()\n\tc = &Codespace{}\n\tc.GetStartURL()\n\tc = nil\n\tc.GetStartURL()\n}\n\nfunc TestCodespace_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Codespace{State: &zeroValue}\n\tc.GetState()\n\tc = &Codespace{}\n\tc.GetState()\n\tc = nil\n\tc.GetState()\n}\n\nfunc TestCodespace_GetStopURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Codespace{StopURL: &zeroValue}\n\tc.GetStopURL()\n\tc = &Codespace{}\n\tc.GetStopURL()\n\tc = nil\n\tc.GetStopURL()\n}\n\nfunc TestCodespace_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &Codespace{UpdatedAt: &zeroValue}\n\tc.GetUpdatedAt()\n\tc = &Codespace{}\n\tc.GetUpdatedAt()\n\tc = nil\n\tc.GetUpdatedAt()\n}\n\nfunc TestCodespace_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Codespace{URL: &zeroValue}\n\tc.GetURL()\n\tc = &Codespace{}\n\tc.GetURL()\n\tc = nil\n\tc.GetURL()\n}\n\nfunc TestCodespace_GetWebURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Codespace{WebURL: &zeroValue}\n\tc.GetWebURL()\n\tc = &Codespace{}\n\tc.GetWebURL()\n\tc = nil\n\tc.GetWebURL()\n}\n\nfunc TestCodespaceCreateForUserOptions_GetClientIP(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodespaceCreateForUserOptions{ClientIP: &zeroValue}\n\tc.GetClientIP()\n\tc = &CodespaceCreateForUserOptions{}\n\tc.GetClientIP()\n\tc = nil\n\tc.GetClientIP()\n}\n\nfunc TestCodespaceCreateForUserOptions_GetDevcontainerPath(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodespaceCreateForUserOptions{DevcontainerPath: &zeroValue}\n\tc.GetDevcontainerPath()\n\tc = &CodespaceCreateForUserOptions{}\n\tc.GetDevcontainerPath()\n\tc = nil\n\tc.GetDevcontainerPath()\n}\n\nfunc TestCodespaceCreateForUserOptions_GetDisplayName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodespaceCreateForUserOptions{DisplayName: &zeroValue}\n\tc.GetDisplayName()\n\tc = &CodespaceCreateForUserOptions{}\n\tc.GetDisplayName()\n\tc = nil\n\tc.GetDisplayName()\n}\n\nfunc TestCodespaceCreateForUserOptions_GetGeo(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodespaceCreateForUserOptions{Geo: &zeroValue}\n\tc.GetGeo()\n\tc = &CodespaceCreateForUserOptions{}\n\tc.GetGeo()\n\tc = nil\n\tc.GetGeo()\n}\n\nfunc TestCodespaceCreateForUserOptions_GetIdleTimeoutMinutes(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CodespaceCreateForUserOptions{IdleTimeoutMinutes: &zeroValue}\n\tc.GetIdleTimeoutMinutes()\n\tc = &CodespaceCreateForUserOptions{}\n\tc.GetIdleTimeoutMinutes()\n\tc = nil\n\tc.GetIdleTimeoutMinutes()\n}\n\nfunc TestCodespaceCreateForUserOptions_GetLocation(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodespaceCreateForUserOptions{Location: &zeroValue}\n\tc.GetLocation()\n\tc = &CodespaceCreateForUserOptions{}\n\tc.GetLocation()\n\tc = nil\n\tc.GetLocation()\n}\n\nfunc TestCodespaceCreateForUserOptions_GetMachine(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodespaceCreateForUserOptions{Machine: &zeroValue}\n\tc.GetMachine()\n\tc = &CodespaceCreateForUserOptions{}\n\tc.GetMachine()\n\tc = nil\n\tc.GetMachine()\n}\n\nfunc TestCodespaceCreateForUserOptions_GetMultiRepoPermissionsOptOut(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &CodespaceCreateForUserOptions{MultiRepoPermissionsOptOut: &zeroValue}\n\tc.GetMultiRepoPermissionsOptOut()\n\tc = &CodespaceCreateForUserOptions{}\n\tc.GetMultiRepoPermissionsOptOut()\n\tc = nil\n\tc.GetMultiRepoPermissionsOptOut()\n}\n\nfunc TestCodespaceCreateForUserOptions_GetPullRequest(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodespaceCreateForUserOptions{}\n\tc.GetPullRequest()\n\tc = nil\n\tc.GetPullRequest()\n}\n\nfunc TestCodespaceCreateForUserOptions_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodespaceCreateForUserOptions{Ref: &zeroValue}\n\tc.GetRef()\n\tc = &CodespaceCreateForUserOptions{}\n\tc.GetRef()\n\tc = nil\n\tc.GetRef()\n}\n\nfunc TestCodespaceCreateForUserOptions_GetRepositoryID(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodespaceCreateForUserOptions{}\n\tc.GetRepositoryID()\n\tc = nil\n\tc.GetRepositoryID()\n}\n\nfunc TestCodespaceCreateForUserOptions_GetRetentionPeriodMinutes(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CodespaceCreateForUserOptions{RetentionPeriodMinutes: &zeroValue}\n\tc.GetRetentionPeriodMinutes()\n\tc = &CodespaceCreateForUserOptions{}\n\tc.GetRetentionPeriodMinutes()\n\tc = nil\n\tc.GetRetentionPeriodMinutes()\n}\n\nfunc TestCodespaceCreateForUserOptions_GetWorkingDirectory(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodespaceCreateForUserOptions{WorkingDirectory: &zeroValue}\n\tc.GetWorkingDirectory()\n\tc = &CodespaceCreateForUserOptions{}\n\tc.GetWorkingDirectory()\n\tc = nil\n\tc.GetWorkingDirectory()\n}\n\nfunc TestCodespaceDefaultAttributes_GetBillableOwner(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodespaceDefaultAttributes{}\n\tc.GetBillableOwner()\n\tc = nil\n\tc.GetBillableOwner()\n}\n\nfunc TestCodespaceDefaultAttributes_GetDefaults(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodespaceDefaultAttributes{}\n\tc.GetDefaults()\n\tc = nil\n\tc.GetDefaults()\n}\n\nfunc TestCodespaceDefaults_GetDevcontainerPath(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodespaceDefaults{DevcontainerPath: &zeroValue}\n\tc.GetDevcontainerPath()\n\tc = &CodespaceDefaults{}\n\tc.GetDevcontainerPath()\n\tc = nil\n\tc.GetDevcontainerPath()\n}\n\nfunc TestCodespaceDefaults_GetLocation(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodespaceDefaults{}\n\tc.GetLocation()\n\tc = nil\n\tc.GetLocation()\n}\n\nfunc TestCodespaceExport_GetBranch(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodespaceExport{Branch: &zeroValue}\n\tc.GetBranch()\n\tc = &CodespaceExport{}\n\tc.GetBranch()\n\tc = nil\n\tc.GetBranch()\n}\n\nfunc TestCodespaceExport_GetCompletedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &CodespaceExport{CompletedAt: &zeroValue}\n\tc.GetCompletedAt()\n\tc = &CodespaceExport{}\n\tc.GetCompletedAt()\n\tc = nil\n\tc.GetCompletedAt()\n}\n\nfunc TestCodespaceExport_GetExportURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodespaceExport{ExportURL: &zeroValue}\n\tc.GetExportURL()\n\tc = &CodespaceExport{}\n\tc.GetExportURL()\n\tc = nil\n\tc.GetExportURL()\n}\n\nfunc TestCodespaceExport_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodespaceExport{HTMLURL: &zeroValue}\n\tc.GetHTMLURL()\n\tc = &CodespaceExport{}\n\tc.GetHTMLURL()\n\tc = nil\n\tc.GetHTMLURL()\n}\n\nfunc TestCodespaceExport_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodespaceExport{ID: &zeroValue}\n\tc.GetID()\n\tc = &CodespaceExport{}\n\tc.GetID()\n\tc = nil\n\tc.GetID()\n}\n\nfunc TestCodespaceExport_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodespaceExport{SHA: &zeroValue}\n\tc.GetSHA()\n\tc = &CodespaceExport{}\n\tc.GetSHA()\n\tc = nil\n\tc.GetSHA()\n}\n\nfunc TestCodespaceExport_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodespaceExport{State: &zeroValue}\n\tc.GetState()\n\tc = &CodespaceExport{}\n\tc.GetState()\n\tc = nil\n\tc.GetState()\n}\n\nfunc TestCodespaceGetDefaultAttributesOptions_GetClientIP(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodespaceGetDefaultAttributesOptions{ClientIP: &zeroValue}\n\tc.GetClientIP()\n\tc = &CodespaceGetDefaultAttributesOptions{}\n\tc.GetClientIP()\n\tc = nil\n\tc.GetClientIP()\n}\n\nfunc TestCodespaceGetDefaultAttributesOptions_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodespaceGetDefaultAttributesOptions{Ref: &zeroValue}\n\tc.GetRef()\n\tc = &CodespaceGetDefaultAttributesOptions{}\n\tc.GetRef()\n\tc = nil\n\tc.GetRef()\n}\n\nfunc TestCodespacePermissions_GetAccepted(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodespacePermissions{}\n\tc.GetAccepted()\n\tc = nil\n\tc.GetAccepted()\n}\n\nfunc TestCodespacePullRequestOptions_GetPullRequestNumber(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodespacePullRequestOptions{}\n\tc.GetPullRequestNumber()\n\tc = nil\n\tc.GetPullRequestNumber()\n}\n\nfunc TestCodespacePullRequestOptions_GetRepositoryID(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodespacePullRequestOptions{}\n\tc.GetRepositoryID()\n\tc = nil\n\tc.GetRepositoryID()\n}\n\nfunc TestCodespacesGitStatus_GetAhead(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CodespacesGitStatus{Ahead: &zeroValue}\n\tc.GetAhead()\n\tc = &CodespacesGitStatus{}\n\tc.GetAhead()\n\tc = nil\n\tc.GetAhead()\n}\n\nfunc TestCodespacesGitStatus_GetBehind(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CodespacesGitStatus{Behind: &zeroValue}\n\tc.GetBehind()\n\tc = &CodespacesGitStatus{}\n\tc.GetBehind()\n\tc = nil\n\tc.GetBehind()\n}\n\nfunc TestCodespacesGitStatus_GetHasUncommittedChanges(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &CodespacesGitStatus{HasUncommittedChanges: &zeroValue}\n\tc.GetHasUncommittedChanges()\n\tc = &CodespacesGitStatus{}\n\tc.GetHasUncommittedChanges()\n\tc = nil\n\tc.GetHasUncommittedChanges()\n}\n\nfunc TestCodespacesGitStatus_GetHasUnpushedChanges(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &CodespacesGitStatus{HasUnpushedChanges: &zeroValue}\n\tc.GetHasUnpushedChanges()\n\tc = &CodespacesGitStatus{}\n\tc.GetHasUnpushedChanges()\n\tc = nil\n\tc.GetHasUnpushedChanges()\n}\n\nfunc TestCodespacesGitStatus_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodespacesGitStatus{Ref: &zeroValue}\n\tc.GetRef()\n\tc = &CodespacesGitStatus{}\n\tc.GetRef()\n\tc = nil\n\tc.GetRef()\n}\n\nfunc TestCodespacesMachine_GetCPUs(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CodespacesMachine{CPUs: &zeroValue}\n\tc.GetCPUs()\n\tc = &CodespacesMachine{}\n\tc.GetCPUs()\n\tc = nil\n\tc.GetCPUs()\n}\n\nfunc TestCodespacesMachine_GetDisplayName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodespacesMachine{DisplayName: &zeroValue}\n\tc.GetDisplayName()\n\tc = &CodespacesMachine{}\n\tc.GetDisplayName()\n\tc = nil\n\tc.GetDisplayName()\n}\n\nfunc TestCodespacesMachine_GetMemoryInBytes(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tc := &CodespacesMachine{MemoryInBytes: &zeroValue}\n\tc.GetMemoryInBytes()\n\tc = &CodespacesMachine{}\n\tc.GetMemoryInBytes()\n\tc = nil\n\tc.GetMemoryInBytes()\n}\n\nfunc TestCodespacesMachine_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodespacesMachine{Name: &zeroValue}\n\tc.GetName()\n\tc = &CodespacesMachine{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCodespacesMachine_GetOperatingSystem(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodespacesMachine{OperatingSystem: &zeroValue}\n\tc.GetOperatingSystem()\n\tc = &CodespacesMachine{}\n\tc.GetOperatingSystem()\n\tc = nil\n\tc.GetOperatingSystem()\n}\n\nfunc TestCodespacesMachine_GetPrebuildAvailability(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CodespacesMachine{PrebuildAvailability: &zeroValue}\n\tc.GetPrebuildAvailability()\n\tc = &CodespacesMachine{}\n\tc.GetPrebuildAvailability()\n\tc = nil\n\tc.GetPrebuildAvailability()\n}\n\nfunc TestCodespacesMachine_GetStorageInBytes(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tc := &CodespacesMachine{StorageInBytes: &zeroValue}\n\tc.GetStorageInBytes()\n\tc = &CodespacesMachine{}\n\tc.GetStorageInBytes()\n\tc = nil\n\tc.GetStorageInBytes()\n}\n\nfunc TestCodespacesMachines_GetMachines(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CodespacesMachine{}\n\tc := &CodespacesMachines{Machines: zeroValue}\n\tc.GetMachines()\n\tc = &CodespacesMachines{}\n\tc.GetMachines()\n\tc = nil\n\tc.GetMachines()\n}\n\nfunc TestCodespacesMachines_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodespacesMachines{}\n\tc.GetTotalCount()\n\tc = nil\n\tc.GetTotalCount()\n}\n\nfunc TestCodespacesOrgAccessControlRequest_GetSelectedUsernames(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tc := &CodespacesOrgAccessControlRequest{SelectedUsernames: zeroValue}\n\tc.GetSelectedUsernames()\n\tc = &CodespacesOrgAccessControlRequest{}\n\tc.GetSelectedUsernames()\n\tc = nil\n\tc.GetSelectedUsernames()\n}\n\nfunc TestCodespacesOrgAccessControlRequest_GetVisibility(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CodespacesOrgAccessControlRequest{}\n\tc.GetVisibility()\n\tc = nil\n\tc.GetVisibility()\n}\n\nfunc TestCodespacesRuntimeConstraints_GetAllowedPortPrivacySettings(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tc := &CodespacesRuntimeConstraints{AllowedPortPrivacySettings: zeroValue}\n\tc.GetAllowedPortPrivacySettings()\n\tc = &CodespacesRuntimeConstraints{}\n\tc.GetAllowedPortPrivacySettings()\n\tc = nil\n\tc.GetAllowedPortPrivacySettings()\n}\n\nfunc TestCollaboratorInvitation_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &CollaboratorInvitation{CreatedAt: &zeroValue}\n\tc.GetCreatedAt()\n\tc = &CollaboratorInvitation{}\n\tc.GetCreatedAt()\n\tc = nil\n\tc.GetCreatedAt()\n}\n\nfunc TestCollaboratorInvitation_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CollaboratorInvitation{HTMLURL: &zeroValue}\n\tc.GetHTMLURL()\n\tc = &CollaboratorInvitation{}\n\tc.GetHTMLURL()\n\tc = nil\n\tc.GetHTMLURL()\n}\n\nfunc TestCollaboratorInvitation_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tc := &CollaboratorInvitation{ID: &zeroValue}\n\tc.GetID()\n\tc = &CollaboratorInvitation{}\n\tc.GetID()\n\tc = nil\n\tc.GetID()\n}\n\nfunc TestCollaboratorInvitation_GetInvitee(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CollaboratorInvitation{}\n\tc.GetInvitee()\n\tc = nil\n\tc.GetInvitee()\n}\n\nfunc TestCollaboratorInvitation_GetInviter(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CollaboratorInvitation{}\n\tc.GetInviter()\n\tc = nil\n\tc.GetInviter()\n}\n\nfunc TestCollaboratorInvitation_GetPermissions(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CollaboratorInvitation{Permissions: &zeroValue}\n\tc.GetPermissions()\n\tc = &CollaboratorInvitation{}\n\tc.GetPermissions()\n\tc = nil\n\tc.GetPermissions()\n}\n\nfunc TestCollaboratorInvitation_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CollaboratorInvitation{}\n\tc.GetRepo()\n\tc = nil\n\tc.GetRepo()\n}\n\nfunc TestCollaboratorInvitation_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CollaboratorInvitation{URL: &zeroValue}\n\tc.GetURL()\n\tc = &CollaboratorInvitation{}\n\tc.GetURL()\n\tc = nil\n\tc.GetURL()\n}\n\nfunc TestCombinedStatus_GetCommitURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CombinedStatus{CommitURL: &zeroValue}\n\tc.GetCommitURL()\n\tc = &CombinedStatus{}\n\tc.GetCommitURL()\n\tc = nil\n\tc.GetCommitURL()\n}\n\nfunc TestCombinedStatus_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CombinedStatus{Name: &zeroValue}\n\tc.GetName()\n\tc = &CombinedStatus{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCombinedStatus_GetRepositoryURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CombinedStatus{RepositoryURL: &zeroValue}\n\tc.GetRepositoryURL()\n\tc = &CombinedStatus{}\n\tc.GetRepositoryURL()\n\tc = nil\n\tc.GetRepositoryURL()\n}\n\nfunc TestCombinedStatus_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CombinedStatus{SHA: &zeroValue}\n\tc.GetSHA()\n\tc = &CombinedStatus{}\n\tc.GetSHA()\n\tc = nil\n\tc.GetSHA()\n}\n\nfunc TestCombinedStatus_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CombinedStatus{State: &zeroValue}\n\tc.GetState()\n\tc = &CombinedStatus{}\n\tc.GetState()\n\tc = nil\n\tc.GetState()\n}\n\nfunc TestCombinedStatus_GetStatuses(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*RepoStatus{}\n\tc := &CombinedStatus{Statuses: zeroValue}\n\tc.GetStatuses()\n\tc = &CombinedStatus{}\n\tc.GetStatuses()\n\tc = nil\n\tc.GetStatuses()\n}\n\nfunc TestCombinedStatus_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CombinedStatus{TotalCount: &zeroValue}\n\tc.GetTotalCount()\n\tc = &CombinedStatus{}\n\tc.GetTotalCount()\n\tc = nil\n\tc.GetTotalCount()\n}\n\nfunc TestComment_GetBody(tt *testing.T) {\n\ttt.Parallel()\n\tc := &Comment{}\n\tc.GetBody()\n\tc = nil\n\tc.GetBody()\n}\n\nfunc TestComment_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &Comment{CreatedAt: &zeroValue}\n\tc.GetCreatedAt()\n\tc = &Comment{}\n\tc.GetCreatedAt()\n\tc = nil\n\tc.GetCreatedAt()\n}\n\nfunc TestCommentDiscussion_GetAuthorAssociation(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CommentDiscussion{AuthorAssociation: &zeroValue}\n\tc.GetAuthorAssociation()\n\tc = &CommentDiscussion{}\n\tc.GetAuthorAssociation()\n\tc = nil\n\tc.GetAuthorAssociation()\n}\n\nfunc TestCommentDiscussion_GetBody(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CommentDiscussion{Body: &zeroValue}\n\tc.GetBody()\n\tc = &CommentDiscussion{}\n\tc.GetBody()\n\tc = nil\n\tc.GetBody()\n}\n\nfunc TestCommentDiscussion_GetChildCommentCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CommentDiscussion{ChildCommentCount: &zeroValue}\n\tc.GetChildCommentCount()\n\tc = &CommentDiscussion{}\n\tc.GetChildCommentCount()\n\tc = nil\n\tc.GetChildCommentCount()\n}\n\nfunc TestCommentDiscussion_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &CommentDiscussion{CreatedAt: &zeroValue}\n\tc.GetCreatedAt()\n\tc = &CommentDiscussion{}\n\tc.GetCreatedAt()\n\tc = nil\n\tc.GetCreatedAt()\n}\n\nfunc TestCommentDiscussion_GetDiscussionID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tc := &CommentDiscussion{DiscussionID: &zeroValue}\n\tc.GetDiscussionID()\n\tc = &CommentDiscussion{}\n\tc.GetDiscussionID()\n\tc = nil\n\tc.GetDiscussionID()\n}\n\nfunc TestCommentDiscussion_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CommentDiscussion{HTMLURL: &zeroValue}\n\tc.GetHTMLURL()\n\tc = &CommentDiscussion{}\n\tc.GetHTMLURL()\n\tc = nil\n\tc.GetHTMLURL()\n}\n\nfunc TestCommentDiscussion_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tc := &CommentDiscussion{ID: &zeroValue}\n\tc.GetID()\n\tc = &CommentDiscussion{}\n\tc.GetID()\n\tc = nil\n\tc.GetID()\n}\n\nfunc TestCommentDiscussion_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CommentDiscussion{NodeID: &zeroValue}\n\tc.GetNodeID()\n\tc = &CommentDiscussion{}\n\tc.GetNodeID()\n\tc = nil\n\tc.GetNodeID()\n}\n\nfunc TestCommentDiscussion_GetParentID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tc := &CommentDiscussion{ParentID: &zeroValue}\n\tc.GetParentID()\n\tc = &CommentDiscussion{}\n\tc.GetParentID()\n\tc = nil\n\tc.GetParentID()\n}\n\nfunc TestCommentDiscussion_GetReactions(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CommentDiscussion{}\n\tc.GetReactions()\n\tc = nil\n\tc.GetReactions()\n}\n\nfunc TestCommentDiscussion_GetRepositoryURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CommentDiscussion{RepositoryURL: &zeroValue}\n\tc.GetRepositoryURL()\n\tc = &CommentDiscussion{}\n\tc.GetRepositoryURL()\n\tc = nil\n\tc.GetRepositoryURL()\n}\n\nfunc TestCommentDiscussion_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &CommentDiscussion{UpdatedAt: &zeroValue}\n\tc.GetUpdatedAt()\n\tc = &CommentDiscussion{}\n\tc.GetUpdatedAt()\n\tc = nil\n\tc.GetUpdatedAt()\n}\n\nfunc TestCommentDiscussion_GetUser(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CommentDiscussion{}\n\tc.GetUser()\n\tc = nil\n\tc.GetUser()\n}\n\nfunc TestCommentStats_GetTotalCommitComments(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CommentStats{TotalCommitComments: &zeroValue}\n\tc.GetTotalCommitComments()\n\tc = &CommentStats{}\n\tc.GetTotalCommitComments()\n\tc = nil\n\tc.GetTotalCommitComments()\n}\n\nfunc TestCommentStats_GetTotalGistComments(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CommentStats{TotalGistComments: &zeroValue}\n\tc.GetTotalGistComments()\n\tc = &CommentStats{}\n\tc.GetTotalGistComments()\n\tc = nil\n\tc.GetTotalGistComments()\n}\n\nfunc TestCommentStats_GetTotalIssueComments(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CommentStats{TotalIssueComments: &zeroValue}\n\tc.GetTotalIssueComments()\n\tc = &CommentStats{}\n\tc.GetTotalIssueComments()\n\tc = nil\n\tc.GetTotalIssueComments()\n}\n\nfunc TestCommentStats_GetTotalPullRequestComments(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CommentStats{TotalPullRequestComments: &zeroValue}\n\tc.GetTotalPullRequestComments()\n\tc = &CommentStats{}\n\tc.GetTotalPullRequestComments()\n\tc = nil\n\tc.GetTotalPullRequestComments()\n}\n\nfunc TestCommit_GetAuthor(tt *testing.T) {\n\ttt.Parallel()\n\tc := &Commit{}\n\tc.GetAuthor()\n\tc = nil\n\tc.GetAuthor()\n}\n\nfunc TestCommit_GetCommentCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &Commit{CommentCount: &zeroValue}\n\tc.GetCommentCount()\n\tc = &Commit{}\n\tc.GetCommentCount()\n\tc = nil\n\tc.GetCommentCount()\n}\n\nfunc TestCommit_GetCommitter(tt *testing.T) {\n\ttt.Parallel()\n\tc := &Commit{}\n\tc.GetCommitter()\n\tc = nil\n\tc.GetCommitter()\n}\n\nfunc TestCommit_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Commit{HTMLURL: &zeroValue}\n\tc.GetHTMLURL()\n\tc = &Commit{}\n\tc.GetHTMLURL()\n\tc = nil\n\tc.GetHTMLURL()\n}\n\nfunc TestCommit_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Commit{Message: &zeroValue}\n\tc.GetMessage()\n\tc = &Commit{}\n\tc.GetMessage()\n\tc = nil\n\tc.GetMessage()\n}\n\nfunc TestCommit_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Commit{NodeID: &zeroValue}\n\tc.GetNodeID()\n\tc = &Commit{}\n\tc.GetNodeID()\n\tc = nil\n\tc.GetNodeID()\n}\n\nfunc TestCommit_GetParents(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Commit{}\n\tc := &Commit{Parents: zeroValue}\n\tc.GetParents()\n\tc = &Commit{}\n\tc.GetParents()\n\tc = nil\n\tc.GetParents()\n}\n\nfunc TestCommit_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Commit{SHA: &zeroValue}\n\tc.GetSHA()\n\tc = &Commit{}\n\tc.GetSHA()\n\tc = nil\n\tc.GetSHA()\n}\n\nfunc TestCommit_GetTree(tt *testing.T) {\n\ttt.Parallel()\n\tc := &Commit{}\n\tc.GetTree()\n\tc = nil\n\tc.GetTree()\n}\n\nfunc TestCommit_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Commit{URL: &zeroValue}\n\tc.GetURL()\n\tc = &Commit{}\n\tc.GetURL()\n\tc = nil\n\tc.GetURL()\n}\n\nfunc TestCommit_GetVerification(tt *testing.T) {\n\ttt.Parallel()\n\tc := &Commit{}\n\tc.GetVerification()\n\tc = nil\n\tc.GetVerification()\n}\n\nfunc TestCommitAuthor_GetDate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &CommitAuthor{Date: &zeroValue}\n\tc.GetDate()\n\tc = &CommitAuthor{}\n\tc.GetDate()\n\tc = nil\n\tc.GetDate()\n}\n\nfunc TestCommitAuthor_GetEmail(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CommitAuthor{Email: &zeroValue}\n\tc.GetEmail()\n\tc = &CommitAuthor{}\n\tc.GetEmail()\n\tc = nil\n\tc.GetEmail()\n}\n\nfunc TestCommitAuthor_GetLogin(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CommitAuthor{Login: &zeroValue}\n\tc.GetLogin()\n\tc = &CommitAuthor{}\n\tc.GetLogin()\n\tc = nil\n\tc.GetLogin()\n}\n\nfunc TestCommitAuthor_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CommitAuthor{Name: &zeroValue}\n\tc.GetName()\n\tc = &CommitAuthor{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCommitCommentEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CommitCommentEvent{Action: &zeroValue}\n\tc.GetAction()\n\tc = &CommitCommentEvent{}\n\tc.GetAction()\n\tc = nil\n\tc.GetAction()\n}\n\nfunc TestCommitCommentEvent_GetComment(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CommitCommentEvent{}\n\tc.GetComment()\n\tc = nil\n\tc.GetComment()\n}\n\nfunc TestCommitCommentEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CommitCommentEvent{}\n\tc.GetInstallation()\n\tc = nil\n\tc.GetInstallation()\n}\n\nfunc TestCommitCommentEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CommitCommentEvent{}\n\tc.GetOrg()\n\tc = nil\n\tc.GetOrg()\n}\n\nfunc TestCommitCommentEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CommitCommentEvent{}\n\tc.GetRepo()\n\tc = nil\n\tc.GetRepo()\n}\n\nfunc TestCommitCommentEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CommitCommentEvent{}\n\tc.GetSender()\n\tc = nil\n\tc.GetSender()\n}\n\nfunc TestCommitFile_GetAdditions(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CommitFile{Additions: &zeroValue}\n\tc.GetAdditions()\n\tc = &CommitFile{}\n\tc.GetAdditions()\n\tc = nil\n\tc.GetAdditions()\n}\n\nfunc TestCommitFile_GetBlobURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CommitFile{BlobURL: &zeroValue}\n\tc.GetBlobURL()\n\tc = &CommitFile{}\n\tc.GetBlobURL()\n\tc = nil\n\tc.GetBlobURL()\n}\n\nfunc TestCommitFile_GetChanges(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CommitFile{Changes: &zeroValue}\n\tc.GetChanges()\n\tc = &CommitFile{}\n\tc.GetChanges()\n\tc = nil\n\tc.GetChanges()\n}\n\nfunc TestCommitFile_GetContentsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CommitFile{ContentsURL: &zeroValue}\n\tc.GetContentsURL()\n\tc = &CommitFile{}\n\tc.GetContentsURL()\n\tc = nil\n\tc.GetContentsURL()\n}\n\nfunc TestCommitFile_GetDeletions(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CommitFile{Deletions: &zeroValue}\n\tc.GetDeletions()\n\tc = &CommitFile{}\n\tc.GetDeletions()\n\tc = nil\n\tc.GetDeletions()\n}\n\nfunc TestCommitFile_GetFilename(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CommitFile{Filename: &zeroValue}\n\tc.GetFilename()\n\tc = &CommitFile{}\n\tc.GetFilename()\n\tc = nil\n\tc.GetFilename()\n}\n\nfunc TestCommitFile_GetPatch(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CommitFile{Patch: &zeroValue}\n\tc.GetPatch()\n\tc = &CommitFile{}\n\tc.GetPatch()\n\tc = nil\n\tc.GetPatch()\n}\n\nfunc TestCommitFile_GetPreviousFilename(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CommitFile{PreviousFilename: &zeroValue}\n\tc.GetPreviousFilename()\n\tc = &CommitFile{}\n\tc.GetPreviousFilename()\n\tc = nil\n\tc.GetPreviousFilename()\n}\n\nfunc TestCommitFile_GetRawURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CommitFile{RawURL: &zeroValue}\n\tc.GetRawURL()\n\tc = &CommitFile{}\n\tc.GetRawURL()\n\tc = nil\n\tc.GetRawURL()\n}\n\nfunc TestCommitFile_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CommitFile{SHA: &zeroValue}\n\tc.GetSHA()\n\tc = &CommitFile{}\n\tc.GetSHA()\n\tc = nil\n\tc.GetSHA()\n}\n\nfunc TestCommitFile_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CommitFile{Status: &zeroValue}\n\tc.GetStatus()\n\tc = &CommitFile{}\n\tc.GetStatus()\n\tc = nil\n\tc.GetStatus()\n}\n\nfunc TestCommitResult_GetAuthor(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CommitResult{}\n\tc.GetAuthor()\n\tc = nil\n\tc.GetAuthor()\n}\n\nfunc TestCommitResult_GetCommentsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CommitResult{CommentsURL: &zeroValue}\n\tc.GetCommentsURL()\n\tc = &CommitResult{}\n\tc.GetCommentsURL()\n\tc = nil\n\tc.GetCommentsURL()\n}\n\nfunc TestCommitResult_GetCommit(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CommitResult{}\n\tc.GetCommit()\n\tc = nil\n\tc.GetCommit()\n}\n\nfunc TestCommitResult_GetCommitter(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CommitResult{}\n\tc.GetCommitter()\n\tc = nil\n\tc.GetCommitter()\n}\n\nfunc TestCommitResult_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CommitResult{HTMLURL: &zeroValue}\n\tc.GetHTMLURL()\n\tc = &CommitResult{}\n\tc.GetHTMLURL()\n\tc = nil\n\tc.GetHTMLURL()\n}\n\nfunc TestCommitResult_GetParents(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Commit{}\n\tc := &CommitResult{Parents: zeroValue}\n\tc.GetParents()\n\tc = &CommitResult{}\n\tc.GetParents()\n\tc = nil\n\tc.GetParents()\n}\n\nfunc TestCommitResult_GetRepository(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CommitResult{}\n\tc.GetRepository()\n\tc = nil\n\tc.GetRepository()\n}\n\nfunc TestCommitResult_GetScore(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue float64\n\tc := &CommitResult{Score: &zeroValue}\n\tc.GetScore()\n\tc = &CommitResult{}\n\tc.GetScore()\n\tc = nil\n\tc.GetScore()\n}\n\nfunc TestCommitResult_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CommitResult{SHA: &zeroValue}\n\tc.GetSHA()\n\tc = &CommitResult{}\n\tc.GetSHA()\n\tc = nil\n\tc.GetSHA()\n}\n\nfunc TestCommitResult_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CommitResult{URL: &zeroValue}\n\tc.GetURL()\n\tc = &CommitResult{}\n\tc.GetURL()\n\tc = nil\n\tc.GetURL()\n}\n\nfunc TestCommitsComparison_GetAheadBy(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CommitsComparison{AheadBy: &zeroValue}\n\tc.GetAheadBy()\n\tc = &CommitsComparison{}\n\tc.GetAheadBy()\n\tc = nil\n\tc.GetAheadBy()\n}\n\nfunc TestCommitsComparison_GetBaseCommit(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CommitsComparison{}\n\tc.GetBaseCommit()\n\tc = nil\n\tc.GetBaseCommit()\n}\n\nfunc TestCommitsComparison_GetBehindBy(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CommitsComparison{BehindBy: &zeroValue}\n\tc.GetBehindBy()\n\tc = &CommitsComparison{}\n\tc.GetBehindBy()\n\tc = nil\n\tc.GetBehindBy()\n}\n\nfunc TestCommitsComparison_GetCommits(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*RepositoryCommit{}\n\tc := &CommitsComparison{Commits: zeroValue}\n\tc.GetCommits()\n\tc = &CommitsComparison{}\n\tc.GetCommits()\n\tc = nil\n\tc.GetCommits()\n}\n\nfunc TestCommitsComparison_GetDiffURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CommitsComparison{DiffURL: &zeroValue}\n\tc.GetDiffURL()\n\tc = &CommitsComparison{}\n\tc.GetDiffURL()\n\tc = nil\n\tc.GetDiffURL()\n}\n\nfunc TestCommitsComparison_GetFiles(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CommitFile{}\n\tc := &CommitsComparison{Files: zeroValue}\n\tc.GetFiles()\n\tc = &CommitsComparison{}\n\tc.GetFiles()\n\tc = nil\n\tc.GetFiles()\n}\n\nfunc TestCommitsComparison_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CommitsComparison{HTMLURL: &zeroValue}\n\tc.GetHTMLURL()\n\tc = &CommitsComparison{}\n\tc.GetHTMLURL()\n\tc = nil\n\tc.GetHTMLURL()\n}\n\nfunc TestCommitsComparison_GetMergeBaseCommit(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CommitsComparison{}\n\tc.GetMergeBaseCommit()\n\tc = nil\n\tc.GetMergeBaseCommit()\n}\n\nfunc TestCommitsComparison_GetPatchURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CommitsComparison{PatchURL: &zeroValue}\n\tc.GetPatchURL()\n\tc = &CommitsComparison{}\n\tc.GetPatchURL()\n\tc = nil\n\tc.GetPatchURL()\n}\n\nfunc TestCommitsComparison_GetPermalinkURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CommitsComparison{PermalinkURL: &zeroValue}\n\tc.GetPermalinkURL()\n\tc = &CommitsComparison{}\n\tc.GetPermalinkURL()\n\tc = nil\n\tc.GetPermalinkURL()\n}\n\nfunc TestCommitsComparison_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CommitsComparison{Status: &zeroValue}\n\tc.GetStatus()\n\tc = &CommitsComparison{}\n\tc.GetStatus()\n\tc = nil\n\tc.GetStatus()\n}\n\nfunc TestCommitsComparison_GetTotalCommits(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CommitsComparison{TotalCommits: &zeroValue}\n\tc.GetTotalCommits()\n\tc = &CommitsComparison{}\n\tc.GetTotalCommits()\n\tc = nil\n\tc.GetTotalCommits()\n}\n\nfunc TestCommitsComparison_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CommitsComparison{URL: &zeroValue}\n\tc.GetURL()\n\tc = &CommitsComparison{}\n\tc.GetURL()\n\tc = nil\n\tc.GetURL()\n}\n\nfunc TestCommitsListOptions_GetAuthor(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CommitsListOptions{}\n\tc.GetAuthor()\n\tc = nil\n\tc.GetAuthor()\n}\n\nfunc TestCommitsListOptions_GetPath(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CommitsListOptions{}\n\tc.GetPath()\n\tc = nil\n\tc.GetPath()\n}\n\nfunc TestCommitsListOptions_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CommitsListOptions{}\n\tc.GetSHA()\n\tc = nil\n\tc.GetSHA()\n}\n\nfunc TestCommitsListOptions_GetSince(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CommitsListOptions{}\n\tc.GetSince()\n\tc = nil\n\tc.GetSince()\n}\n\nfunc TestCommitsListOptions_GetUntil(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CommitsListOptions{}\n\tc.GetUntil()\n\tc = nil\n\tc.GetUntil()\n}\n\nfunc TestCommitsSearchResult_GetCommits(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CommitResult{}\n\tc := &CommitsSearchResult{Commits: zeroValue}\n\tc.GetCommits()\n\tc = &CommitsSearchResult{}\n\tc.GetCommits()\n\tc = nil\n\tc.GetCommits()\n}\n\nfunc TestCommitsSearchResult_GetIncompleteResults(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &CommitsSearchResult{IncompleteResults: &zeroValue}\n\tc.GetIncompleteResults()\n\tc = &CommitsSearchResult{}\n\tc.GetIncompleteResults()\n\tc = nil\n\tc.GetIncompleteResults()\n}\n\nfunc TestCommitsSearchResult_GetTotal(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CommitsSearchResult{Total: &zeroValue}\n\tc.GetTotal()\n\tc = &CommitsSearchResult{}\n\tc.GetTotal()\n\tc = nil\n\tc.GetTotal()\n}\n\nfunc TestCommitStats_GetAdditions(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CommitStats{Additions: &zeroValue}\n\tc.GetAdditions()\n\tc = &CommitStats{}\n\tc.GetAdditions()\n\tc = nil\n\tc.GetAdditions()\n}\n\nfunc TestCommitStats_GetDeletions(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CommitStats{Deletions: &zeroValue}\n\tc.GetDeletions()\n\tc = &CommitStats{}\n\tc.GetDeletions()\n\tc = nil\n\tc.GetDeletions()\n}\n\nfunc TestCommitStats_GetTotal(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CommitStats{Total: &zeroValue}\n\tc.GetTotal()\n\tc = &CommitStats{}\n\tc.GetTotal()\n\tc = nil\n\tc.GetTotal()\n}\n\nfunc TestCommunityHealthFiles_GetCodeOfConduct(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CommunityHealthFiles{}\n\tc.GetCodeOfConduct()\n\tc = nil\n\tc.GetCodeOfConduct()\n}\n\nfunc TestCommunityHealthFiles_GetCodeOfConductFile(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CommunityHealthFiles{}\n\tc.GetCodeOfConductFile()\n\tc = nil\n\tc.GetCodeOfConductFile()\n}\n\nfunc TestCommunityHealthFiles_GetContributing(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CommunityHealthFiles{}\n\tc.GetContributing()\n\tc = nil\n\tc.GetContributing()\n}\n\nfunc TestCommunityHealthFiles_GetIssueTemplate(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CommunityHealthFiles{}\n\tc.GetIssueTemplate()\n\tc = nil\n\tc.GetIssueTemplate()\n}\n\nfunc TestCommunityHealthFiles_GetLicense(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CommunityHealthFiles{}\n\tc.GetLicense()\n\tc = nil\n\tc.GetLicense()\n}\n\nfunc TestCommunityHealthFiles_GetPullRequestTemplate(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CommunityHealthFiles{}\n\tc.GetPullRequestTemplate()\n\tc = nil\n\tc.GetPullRequestTemplate()\n}\n\nfunc TestCommunityHealthFiles_GetReadme(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CommunityHealthFiles{}\n\tc.GetReadme()\n\tc = nil\n\tc.GetReadme()\n}\n\nfunc TestCommunityHealthMetrics_GetContentReportsEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &CommunityHealthMetrics{ContentReportsEnabled: &zeroValue}\n\tc.GetContentReportsEnabled()\n\tc = &CommunityHealthMetrics{}\n\tc.GetContentReportsEnabled()\n\tc = nil\n\tc.GetContentReportsEnabled()\n}\n\nfunc TestCommunityHealthMetrics_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CommunityHealthMetrics{Description: &zeroValue}\n\tc.GetDescription()\n\tc = &CommunityHealthMetrics{}\n\tc.GetDescription()\n\tc = nil\n\tc.GetDescription()\n}\n\nfunc TestCommunityHealthMetrics_GetDocumentation(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CommunityHealthMetrics{Documentation: &zeroValue}\n\tc.GetDocumentation()\n\tc = &CommunityHealthMetrics{}\n\tc.GetDocumentation()\n\tc = nil\n\tc.GetDocumentation()\n}\n\nfunc TestCommunityHealthMetrics_GetFiles(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CommunityHealthMetrics{}\n\tc.GetFiles()\n\tc = nil\n\tc.GetFiles()\n}\n\nfunc TestCommunityHealthMetrics_GetHealthPercentage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CommunityHealthMetrics{HealthPercentage: &zeroValue}\n\tc.GetHealthPercentage()\n\tc = &CommunityHealthMetrics{}\n\tc.GetHealthPercentage()\n\tc = nil\n\tc.GetHealthPercentage()\n}\n\nfunc TestCommunityHealthMetrics_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &CommunityHealthMetrics{UpdatedAt: &zeroValue}\n\tc.GetUpdatedAt()\n\tc = &CommunityHealthMetrics{}\n\tc.GetUpdatedAt()\n\tc = nil\n\tc.GetUpdatedAt()\n}\n\nfunc TestConfigApplyEvents_GetNodes(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*ConfigApplyEventsNode{}\n\tc := &ConfigApplyEvents{Nodes: zeroValue}\n\tc.GetNodes()\n\tc = &ConfigApplyEvents{}\n\tc.GetNodes()\n\tc = nil\n\tc.GetNodes()\n}\n\nfunc TestConfigApplyEventsNode_GetEvents(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*ConfigApplyEventsNodeEvent{}\n\tc := &ConfigApplyEventsNode{Events: zeroValue}\n\tc.GetEvents()\n\tc = &ConfigApplyEventsNode{}\n\tc.GetEvents()\n\tc = nil\n\tc.GetEvents()\n}\n\nfunc TestConfigApplyEventsNode_GetLastRequestID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigApplyEventsNode{LastRequestID: &zeroValue}\n\tc.GetLastRequestID()\n\tc = &ConfigApplyEventsNode{}\n\tc.GetLastRequestID()\n\tc = nil\n\tc.GetLastRequestID()\n}\n\nfunc TestConfigApplyEventsNode_GetNode(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigApplyEventsNode{Node: &zeroValue}\n\tc.GetNode()\n\tc = &ConfigApplyEventsNode{}\n\tc.GetNode()\n\tc = nil\n\tc.GetNode()\n}\n\nfunc TestConfigApplyEventsNodeEvent_GetBody(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigApplyEventsNodeEvent{Body: &zeroValue}\n\tc.GetBody()\n\tc = &ConfigApplyEventsNodeEvent{}\n\tc.GetBody()\n\tc = nil\n\tc.GetBody()\n}\n\nfunc TestConfigApplyEventsNodeEvent_GetConfigRunID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigApplyEventsNodeEvent{ConfigRunID: &zeroValue}\n\tc.GetConfigRunID()\n\tc = &ConfigApplyEventsNodeEvent{}\n\tc.GetConfigRunID()\n\tc = nil\n\tc.GetConfigRunID()\n}\n\nfunc TestConfigApplyEventsNodeEvent_GetEventName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigApplyEventsNodeEvent{EventName: &zeroValue}\n\tc.GetEventName()\n\tc = &ConfigApplyEventsNodeEvent{}\n\tc.GetEventName()\n\tc = nil\n\tc.GetEventName()\n}\n\nfunc TestConfigApplyEventsNodeEvent_GetHostname(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigApplyEventsNodeEvent{Hostname: &zeroValue}\n\tc.GetHostname()\n\tc = &ConfigApplyEventsNodeEvent{}\n\tc.GetHostname()\n\tc = nil\n\tc.GetHostname()\n}\n\nfunc TestConfigApplyEventsNodeEvent_GetSeverityText(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigApplyEventsNodeEvent{SeverityText: &zeroValue}\n\tc.GetSeverityText()\n\tc = &ConfigApplyEventsNodeEvent{}\n\tc.GetSeverityText()\n\tc = nil\n\tc.GetSeverityText()\n}\n\nfunc TestConfigApplyEventsNodeEvent_GetSpanDepth(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &ConfigApplyEventsNodeEvent{SpanDepth: &zeroValue}\n\tc.GetSpanDepth()\n\tc = &ConfigApplyEventsNodeEvent{}\n\tc.GetSpanDepth()\n\tc = nil\n\tc.GetSpanDepth()\n}\n\nfunc TestConfigApplyEventsNodeEvent_GetSpanID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigApplyEventsNodeEvent{SpanID: &zeroValue}\n\tc.GetSpanID()\n\tc = &ConfigApplyEventsNodeEvent{}\n\tc.GetSpanID()\n\tc = nil\n\tc.GetSpanID()\n}\n\nfunc TestConfigApplyEventsNodeEvent_GetSpanParentID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tc := &ConfigApplyEventsNodeEvent{SpanParentID: &zeroValue}\n\tc.GetSpanParentID()\n\tc = &ConfigApplyEventsNodeEvent{}\n\tc.GetSpanParentID()\n\tc = nil\n\tc.GetSpanParentID()\n}\n\nfunc TestConfigApplyEventsNodeEvent_GetTimestamp(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &ConfigApplyEventsNodeEvent{Timestamp: &zeroValue}\n\tc.GetTimestamp()\n\tc = &ConfigApplyEventsNodeEvent{}\n\tc.GetTimestamp()\n\tc = nil\n\tc.GetTimestamp()\n}\n\nfunc TestConfigApplyEventsNodeEvent_GetTopology(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigApplyEventsNodeEvent{Topology: &zeroValue}\n\tc.GetTopology()\n\tc = &ConfigApplyEventsNodeEvent{}\n\tc.GetTopology()\n\tc = nil\n\tc.GetTopology()\n}\n\nfunc TestConfigApplyEventsNodeEvent_GetTraceID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigApplyEventsNodeEvent{TraceID: &zeroValue}\n\tc.GetTraceID()\n\tc = &ConfigApplyEventsNodeEvent{}\n\tc.GetTraceID()\n\tc = nil\n\tc.GetTraceID()\n}\n\nfunc TestConfigApplyEventsOptions_GetLastRequestID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigApplyEventsOptions{LastRequestID: &zeroValue}\n\tc.GetLastRequestID()\n\tc = &ConfigApplyEventsOptions{}\n\tc.GetLastRequestID()\n\tc = nil\n\tc.GetLastRequestID()\n}\n\nfunc TestConfigApplyOptions_GetRunID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigApplyOptions{RunID: &zeroValue}\n\tc.GetRunID()\n\tc = &ConfigApplyOptions{}\n\tc.GetRunID()\n\tc = nil\n\tc.GetRunID()\n}\n\nfunc TestConfigApplyStatus_GetNodes(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*ConfigApplyStatusNode{}\n\tc := &ConfigApplyStatus{Nodes: zeroValue}\n\tc.GetNodes()\n\tc = &ConfigApplyStatus{}\n\tc.GetNodes()\n\tc = nil\n\tc.GetNodes()\n}\n\nfunc TestConfigApplyStatus_GetRunning(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigApplyStatus{Running: &zeroValue}\n\tc.GetRunning()\n\tc = &ConfigApplyStatus{}\n\tc.GetRunning()\n\tc = nil\n\tc.GetRunning()\n}\n\nfunc TestConfigApplyStatus_GetSuccessful(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigApplyStatus{Successful: &zeroValue}\n\tc.GetSuccessful()\n\tc = &ConfigApplyStatus{}\n\tc.GetSuccessful()\n\tc = nil\n\tc.GetSuccessful()\n}\n\nfunc TestConfigApplyStatusNode_GetHostname(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigApplyStatusNode{Hostname: &zeroValue}\n\tc.GetHostname()\n\tc = &ConfigApplyStatusNode{}\n\tc.GetHostname()\n\tc = nil\n\tc.GetHostname()\n}\n\nfunc TestConfigApplyStatusNode_GetRunID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigApplyStatusNode{RunID: &zeroValue}\n\tc.GetRunID()\n\tc = &ConfigApplyStatusNode{}\n\tc.GetRunID()\n\tc = nil\n\tc.GetRunID()\n}\n\nfunc TestConfigApplyStatusNode_GetRunning(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigApplyStatusNode{Running: &zeroValue}\n\tc.GetRunning()\n\tc = &ConfigApplyStatusNode{}\n\tc.GetRunning()\n\tc = nil\n\tc.GetRunning()\n}\n\nfunc TestConfigApplyStatusNode_GetSuccessful(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigApplyStatusNode{Successful: &zeroValue}\n\tc.GetSuccessful()\n\tc = &ConfigApplyStatusNode{}\n\tc.GetSuccessful()\n\tc = nil\n\tc.GetSuccessful()\n}\n\nfunc TestConfigSettings_GetAdminPassword(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettings{AdminPassword: &zeroValue}\n\tc.GetAdminPassword()\n\tc = &ConfigSettings{}\n\tc.GetAdminPassword()\n\tc = nil\n\tc.GetAdminPassword()\n}\n\nfunc TestConfigSettings_GetAssets(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettings{Assets: &zeroValue}\n\tc.GetAssets()\n\tc = &ConfigSettings{}\n\tc.GetAssets()\n\tc = nil\n\tc.GetAssets()\n}\n\nfunc TestConfigSettings_GetAuthMode(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettings{AuthMode: &zeroValue}\n\tc.GetAuthMode()\n\tc = &ConfigSettings{}\n\tc.GetAuthMode()\n\tc = nil\n\tc.GetAuthMode()\n}\n\nfunc TestConfigSettings_GetAvatar(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ConfigSettings{}\n\tc.GetAvatar()\n\tc = nil\n\tc.GetAvatar()\n}\n\nfunc TestConfigSettings_GetCAS(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ConfigSettings{}\n\tc.GetCAS()\n\tc = nil\n\tc.GetCAS()\n}\n\nfunc TestConfigSettings_GetCollectd(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ConfigSettings{}\n\tc.GetCollectd()\n\tc = nil\n\tc.GetCollectd()\n}\n\nfunc TestConfigSettings_GetConfigurationID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tc := &ConfigSettings{ConfigurationID: &zeroValue}\n\tc.GetConfigurationID()\n\tc = &ConfigSettings{}\n\tc.GetConfigurationID()\n\tc = nil\n\tc.GetConfigurationID()\n}\n\nfunc TestConfigSettings_GetConfigurationRunCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &ConfigSettings{ConfigurationRunCount: &zeroValue}\n\tc.GetConfigurationRunCount()\n\tc = &ConfigSettings{}\n\tc.GetConfigurationRunCount()\n\tc = nil\n\tc.GetConfigurationRunCount()\n}\n\nfunc TestConfigSettings_GetCustomer(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ConfigSettings{}\n\tc.GetCustomer()\n\tc = nil\n\tc.GetCustomer()\n}\n\nfunc TestConfigSettings_GetExpireSessions(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigSettings{ExpireSessions: &zeroValue}\n\tc.GetExpireSessions()\n\tc = &ConfigSettings{}\n\tc.GetExpireSessions()\n\tc = nil\n\tc.GetExpireSessions()\n}\n\nfunc TestConfigSettings_GetGithubHostname(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettings{GithubHostname: &zeroValue}\n\tc.GetGithubHostname()\n\tc = &ConfigSettings{}\n\tc.GetGithubHostname()\n\tc = nil\n\tc.GetGithubHostname()\n}\n\nfunc TestConfigSettings_GetGithubOAuth(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ConfigSettings{}\n\tc.GetGithubOAuth()\n\tc = nil\n\tc.GetGithubOAuth()\n}\n\nfunc TestConfigSettings_GetGithubSSL(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ConfigSettings{}\n\tc.GetGithubSSL()\n\tc = nil\n\tc.GetGithubSSL()\n}\n\nfunc TestConfigSettings_GetHTTPProxy(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettings{HTTPProxy: &zeroValue}\n\tc.GetHTTPProxy()\n\tc = &ConfigSettings{}\n\tc.GetHTTPProxy()\n\tc = nil\n\tc.GetHTTPProxy()\n}\n\nfunc TestConfigSettings_GetIdenticonsHost(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettings{IdenticonsHost: &zeroValue}\n\tc.GetIdenticonsHost()\n\tc = &ConfigSettings{}\n\tc.GetIdenticonsHost()\n\tc = nil\n\tc.GetIdenticonsHost()\n}\n\nfunc TestConfigSettings_GetLDAP(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ConfigSettings{}\n\tc.GetLDAP()\n\tc = nil\n\tc.GetLDAP()\n}\n\nfunc TestConfigSettings_GetLicense(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ConfigSettings{}\n\tc.GetLicense()\n\tc = nil\n\tc.GetLicense()\n}\n\nfunc TestConfigSettings_GetLoadBalancer(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettings{LoadBalancer: &zeroValue}\n\tc.GetLoadBalancer()\n\tc = &ConfigSettings{}\n\tc.GetLoadBalancer()\n\tc = nil\n\tc.GetLoadBalancer()\n}\n\nfunc TestConfigSettings_GetMapping(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ConfigSettings{}\n\tc.GetMapping()\n\tc = nil\n\tc.GetMapping()\n}\n\nfunc TestConfigSettings_GetNTP(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ConfigSettings{}\n\tc.GetNTP()\n\tc = nil\n\tc.GetNTP()\n}\n\nfunc TestConfigSettings_GetPages(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ConfigSettings{}\n\tc.GetPages()\n\tc = nil\n\tc.GetPages()\n}\n\nfunc TestConfigSettings_GetPrivateMode(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigSettings{PrivateMode: &zeroValue}\n\tc.GetPrivateMode()\n\tc = &ConfigSettings{}\n\tc.GetPrivateMode()\n\tc = nil\n\tc.GetPrivateMode()\n}\n\nfunc TestConfigSettings_GetPublicPages(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigSettings{PublicPages: &zeroValue}\n\tc.GetPublicPages()\n\tc = &ConfigSettings{}\n\tc.GetPublicPages()\n\tc = nil\n\tc.GetPublicPages()\n}\n\nfunc TestConfigSettings_GetSAML(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ConfigSettings{}\n\tc.GetSAML()\n\tc = nil\n\tc.GetSAML()\n}\n\nfunc TestConfigSettings_GetSignupEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigSettings{SignupEnabled: &zeroValue}\n\tc.GetSignupEnabled()\n\tc = &ConfigSettings{}\n\tc.GetSignupEnabled()\n\tc = nil\n\tc.GetSignupEnabled()\n}\n\nfunc TestConfigSettings_GetSMTP(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ConfigSettings{}\n\tc.GetSMTP()\n\tc = nil\n\tc.GetSMTP()\n}\n\nfunc TestConfigSettings_GetSNMP(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ConfigSettings{}\n\tc.GetSNMP()\n\tc = nil\n\tc.GetSNMP()\n}\n\nfunc TestConfigSettings_GetSubdomainIsolation(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigSettings{SubdomainIsolation: &zeroValue}\n\tc.GetSubdomainIsolation()\n\tc = &ConfigSettings{}\n\tc.GetSubdomainIsolation()\n\tc = nil\n\tc.GetSubdomainIsolation()\n}\n\nfunc TestConfigSettings_GetSyslog(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ConfigSettings{}\n\tc.GetSyslog()\n\tc = nil\n\tc.GetSyslog()\n}\n\nfunc TestConfigSettings_GetTimezone(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettings{Timezone: &zeroValue}\n\tc.GetTimezone()\n\tc = &ConfigSettings{}\n\tc.GetTimezone()\n\tc = nil\n\tc.GetTimezone()\n}\n\nfunc TestConfigSettingsAvatar_GetEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigSettingsAvatar{Enabled: &zeroValue}\n\tc.GetEnabled()\n\tc = &ConfigSettingsAvatar{}\n\tc.GetEnabled()\n\tc = nil\n\tc.GetEnabled()\n}\n\nfunc TestConfigSettingsAvatar_GetURI(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsAvatar{URI: &zeroValue}\n\tc.GetURI()\n\tc = &ConfigSettingsAvatar{}\n\tc.GetURI()\n\tc = nil\n\tc.GetURI()\n}\n\nfunc TestConfigSettingsCAS_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsCAS{URL: &zeroValue}\n\tc.GetURL()\n\tc = &ConfigSettingsCAS{}\n\tc.GetURL()\n\tc = nil\n\tc.GetURL()\n}\n\nfunc TestConfigSettingsCollectd_GetEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigSettingsCollectd{Enabled: &zeroValue}\n\tc.GetEnabled()\n\tc = &ConfigSettingsCollectd{}\n\tc.GetEnabled()\n\tc = nil\n\tc.GetEnabled()\n}\n\nfunc TestConfigSettingsCollectd_GetEncryption(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsCollectd{Encryption: &zeroValue}\n\tc.GetEncryption()\n\tc = &ConfigSettingsCollectd{}\n\tc.GetEncryption()\n\tc = nil\n\tc.GetEncryption()\n}\n\nfunc TestConfigSettingsCollectd_GetPassword(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsCollectd{Password: &zeroValue}\n\tc.GetPassword()\n\tc = &ConfigSettingsCollectd{}\n\tc.GetPassword()\n\tc = nil\n\tc.GetPassword()\n}\n\nfunc TestConfigSettingsCollectd_GetPort(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &ConfigSettingsCollectd{Port: &zeroValue}\n\tc.GetPort()\n\tc = &ConfigSettingsCollectd{}\n\tc.GetPort()\n\tc = nil\n\tc.GetPort()\n}\n\nfunc TestConfigSettingsCollectd_GetServer(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsCollectd{Server: &zeroValue}\n\tc.GetServer()\n\tc = &ConfigSettingsCollectd{}\n\tc.GetServer()\n\tc = nil\n\tc.GetServer()\n}\n\nfunc TestConfigSettingsCollectd_GetUsername(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsCollectd{Username: &zeroValue}\n\tc.GetUsername()\n\tc = &ConfigSettingsCollectd{}\n\tc.GetUsername()\n\tc = nil\n\tc.GetUsername()\n}\n\nfunc TestConfigSettingsCustomer_GetEmail(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsCustomer{Email: &zeroValue}\n\tc.GetEmail()\n\tc = &ConfigSettingsCustomer{}\n\tc.GetEmail()\n\tc = nil\n\tc.GetEmail()\n}\n\nfunc TestConfigSettingsCustomer_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsCustomer{Name: &zeroValue}\n\tc.GetName()\n\tc = &ConfigSettingsCustomer{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestConfigSettingsCustomer_GetPublicKeyData(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsCustomer{PublicKeyData: &zeroValue}\n\tc.GetPublicKeyData()\n\tc = &ConfigSettingsCustomer{}\n\tc.GetPublicKeyData()\n\tc = nil\n\tc.GetPublicKeyData()\n}\n\nfunc TestConfigSettingsCustomer_GetSecret(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsCustomer{Secret: &zeroValue}\n\tc.GetSecret()\n\tc = &ConfigSettingsCustomer{}\n\tc.GetSecret()\n\tc = nil\n\tc.GetSecret()\n}\n\nfunc TestConfigSettingsCustomer_GetUUID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsCustomer{UUID: &zeroValue}\n\tc.GetUUID()\n\tc = &ConfigSettingsCustomer{}\n\tc.GetUUID()\n\tc = nil\n\tc.GetUUID()\n}\n\nfunc TestConfigSettingsGithubOAuth_GetClientID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsGithubOAuth{ClientID: &zeroValue}\n\tc.GetClientID()\n\tc = &ConfigSettingsGithubOAuth{}\n\tc.GetClientID()\n\tc = nil\n\tc.GetClientID()\n}\n\nfunc TestConfigSettingsGithubOAuth_GetClientSecret(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsGithubOAuth{ClientSecret: &zeroValue}\n\tc.GetClientSecret()\n\tc = &ConfigSettingsGithubOAuth{}\n\tc.GetClientSecret()\n\tc = nil\n\tc.GetClientSecret()\n}\n\nfunc TestConfigSettingsGithubOAuth_GetOrganizationName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsGithubOAuth{OrganizationName: &zeroValue}\n\tc.GetOrganizationName()\n\tc = &ConfigSettingsGithubOAuth{}\n\tc.GetOrganizationName()\n\tc = nil\n\tc.GetOrganizationName()\n}\n\nfunc TestConfigSettingsGithubOAuth_GetOrganizationTeam(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsGithubOAuth{OrganizationTeam: &zeroValue}\n\tc.GetOrganizationTeam()\n\tc = &ConfigSettingsGithubOAuth{}\n\tc.GetOrganizationTeam()\n\tc = nil\n\tc.GetOrganizationTeam()\n}\n\nfunc TestConfigSettingsGithubSSL_GetCert(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsGithubSSL{Cert: &zeroValue}\n\tc.GetCert()\n\tc = &ConfigSettingsGithubSSL{}\n\tc.GetCert()\n\tc = nil\n\tc.GetCert()\n}\n\nfunc TestConfigSettingsGithubSSL_GetEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigSettingsGithubSSL{Enabled: &zeroValue}\n\tc.GetEnabled()\n\tc = &ConfigSettingsGithubSSL{}\n\tc.GetEnabled()\n\tc = nil\n\tc.GetEnabled()\n}\n\nfunc TestConfigSettingsGithubSSL_GetKey(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsGithubSSL{Key: &zeroValue}\n\tc.GetKey()\n\tc = &ConfigSettingsGithubSSL{}\n\tc.GetKey()\n\tc = nil\n\tc.GetKey()\n}\n\nfunc TestConfigSettingsLDAP_GetAdminGroup(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsLDAP{AdminGroup: &zeroValue}\n\tc.GetAdminGroup()\n\tc = &ConfigSettingsLDAP{}\n\tc.GetAdminGroup()\n\tc = nil\n\tc.GetAdminGroup()\n}\n\nfunc TestConfigSettingsLDAP_GetBase(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tc := &ConfigSettingsLDAP{Base: zeroValue}\n\tc.GetBase()\n\tc = &ConfigSettingsLDAP{}\n\tc.GetBase()\n\tc = nil\n\tc.GetBase()\n}\n\nfunc TestConfigSettingsLDAP_GetBindDN(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsLDAP{BindDN: &zeroValue}\n\tc.GetBindDN()\n\tc = &ConfigSettingsLDAP{}\n\tc.GetBindDN()\n\tc = nil\n\tc.GetBindDN()\n}\n\nfunc TestConfigSettingsLDAP_GetHost(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsLDAP{Host: &zeroValue}\n\tc.GetHost()\n\tc = &ConfigSettingsLDAP{}\n\tc.GetHost()\n\tc = nil\n\tc.GetHost()\n}\n\nfunc TestConfigSettingsLDAP_GetMethod(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsLDAP{Method: &zeroValue}\n\tc.GetMethod()\n\tc = &ConfigSettingsLDAP{}\n\tc.GetMethod()\n\tc = nil\n\tc.GetMethod()\n}\n\nfunc TestConfigSettingsLDAP_GetPassword(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsLDAP{Password: &zeroValue}\n\tc.GetPassword()\n\tc = &ConfigSettingsLDAP{}\n\tc.GetPassword()\n\tc = nil\n\tc.GetPassword()\n}\n\nfunc TestConfigSettingsLDAP_GetPort(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &ConfigSettingsLDAP{Port: &zeroValue}\n\tc.GetPort()\n\tc = &ConfigSettingsLDAP{}\n\tc.GetPort()\n\tc = nil\n\tc.GetPort()\n}\n\nfunc TestConfigSettingsLDAP_GetPosixSupport(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigSettingsLDAP{PosixSupport: &zeroValue}\n\tc.GetPosixSupport()\n\tc = &ConfigSettingsLDAP{}\n\tc.GetPosixSupport()\n\tc = nil\n\tc.GetPosixSupport()\n}\n\nfunc TestConfigSettingsLDAP_GetProfile(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ConfigSettingsLDAP{}\n\tc.GetProfile()\n\tc = nil\n\tc.GetProfile()\n}\n\nfunc TestConfigSettingsLDAP_GetReconciliation(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ConfigSettingsLDAP{}\n\tc.GetReconciliation()\n\tc = nil\n\tc.GetReconciliation()\n}\n\nfunc TestConfigSettingsLDAP_GetRecursiveGroupSearch(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigSettingsLDAP{RecursiveGroupSearch: &zeroValue}\n\tc.GetRecursiveGroupSearch()\n\tc = &ConfigSettingsLDAP{}\n\tc.GetRecursiveGroupSearch()\n\tc = nil\n\tc.GetRecursiveGroupSearch()\n}\n\nfunc TestConfigSettingsLDAP_GetSearchStrategy(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsLDAP{SearchStrategy: &zeroValue}\n\tc.GetSearchStrategy()\n\tc = &ConfigSettingsLDAP{}\n\tc.GetSearchStrategy()\n\tc = nil\n\tc.GetSearchStrategy()\n}\n\nfunc TestConfigSettingsLDAP_GetSyncEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigSettingsLDAP{SyncEnabled: &zeroValue}\n\tc.GetSyncEnabled()\n\tc = &ConfigSettingsLDAP{}\n\tc.GetSyncEnabled()\n\tc = nil\n\tc.GetSyncEnabled()\n}\n\nfunc TestConfigSettingsLDAP_GetTeamSyncInterval(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &ConfigSettingsLDAP{TeamSyncInterval: &zeroValue}\n\tc.GetTeamSyncInterval()\n\tc = &ConfigSettingsLDAP{}\n\tc.GetTeamSyncInterval()\n\tc = nil\n\tc.GetTeamSyncInterval()\n}\n\nfunc TestConfigSettingsLDAP_GetUID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsLDAP{UID: &zeroValue}\n\tc.GetUID()\n\tc = &ConfigSettingsLDAP{}\n\tc.GetUID()\n\tc = nil\n\tc.GetUID()\n}\n\nfunc TestConfigSettingsLDAP_GetUserGroups(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tc := &ConfigSettingsLDAP{UserGroups: zeroValue}\n\tc.GetUserGroups()\n\tc = &ConfigSettingsLDAP{}\n\tc.GetUserGroups()\n\tc = nil\n\tc.GetUserGroups()\n}\n\nfunc TestConfigSettingsLDAP_GetUserSyncEmails(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigSettingsLDAP{UserSyncEmails: &zeroValue}\n\tc.GetUserSyncEmails()\n\tc = &ConfigSettingsLDAP{}\n\tc.GetUserSyncEmails()\n\tc = nil\n\tc.GetUserSyncEmails()\n}\n\nfunc TestConfigSettingsLDAP_GetUserSyncInterval(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &ConfigSettingsLDAP{UserSyncInterval: &zeroValue}\n\tc.GetUserSyncInterval()\n\tc = &ConfigSettingsLDAP{}\n\tc.GetUserSyncInterval()\n\tc = nil\n\tc.GetUserSyncInterval()\n}\n\nfunc TestConfigSettingsLDAP_GetUserSyncKeys(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigSettingsLDAP{UserSyncKeys: &zeroValue}\n\tc.GetUserSyncKeys()\n\tc = &ConfigSettingsLDAP{}\n\tc.GetUserSyncKeys()\n\tc = nil\n\tc.GetUserSyncKeys()\n}\n\nfunc TestConfigSettingsLDAP_GetVirtualAttributeEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigSettingsLDAP{VirtualAttributeEnabled: &zeroValue}\n\tc.GetVirtualAttributeEnabled()\n\tc = &ConfigSettingsLDAP{}\n\tc.GetVirtualAttributeEnabled()\n\tc = nil\n\tc.GetVirtualAttributeEnabled()\n}\n\nfunc TestConfigSettingsLDAPProfile_GetKey(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsLDAPProfile{Key: &zeroValue}\n\tc.GetKey()\n\tc = &ConfigSettingsLDAPProfile{}\n\tc.GetKey()\n\tc = nil\n\tc.GetKey()\n}\n\nfunc TestConfigSettingsLDAPProfile_GetMail(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsLDAPProfile{Mail: &zeroValue}\n\tc.GetMail()\n\tc = &ConfigSettingsLDAPProfile{}\n\tc.GetMail()\n\tc = nil\n\tc.GetMail()\n}\n\nfunc TestConfigSettingsLDAPProfile_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsLDAPProfile{Name: &zeroValue}\n\tc.GetName()\n\tc = &ConfigSettingsLDAPProfile{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestConfigSettingsLDAPProfile_GetUID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsLDAPProfile{UID: &zeroValue}\n\tc.GetUID()\n\tc = &ConfigSettingsLDAPProfile{}\n\tc.GetUID()\n\tc = nil\n\tc.GetUID()\n}\n\nfunc TestConfigSettingsLDAPReconciliation_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsLDAPReconciliation{Org: &zeroValue}\n\tc.GetOrg()\n\tc = &ConfigSettingsLDAPReconciliation{}\n\tc.GetOrg()\n\tc = nil\n\tc.GetOrg()\n}\n\nfunc TestConfigSettingsLDAPReconciliation_GetUser(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsLDAPReconciliation{User: &zeroValue}\n\tc.GetUser()\n\tc = &ConfigSettingsLDAPReconciliation{}\n\tc.GetUser()\n\tc = nil\n\tc.GetUser()\n}\n\nfunc TestConfigSettingsLicenseSettings_GetClusterSupport(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigSettingsLicenseSettings{ClusterSupport: &zeroValue}\n\tc.GetClusterSupport()\n\tc = &ConfigSettingsLicenseSettings{}\n\tc.GetClusterSupport()\n\tc = nil\n\tc.GetClusterSupport()\n}\n\nfunc TestConfigSettingsLicenseSettings_GetEvaluation(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigSettingsLicenseSettings{Evaluation: &zeroValue}\n\tc.GetEvaluation()\n\tc = &ConfigSettingsLicenseSettings{}\n\tc.GetEvaluation()\n\tc = nil\n\tc.GetEvaluation()\n}\n\nfunc TestConfigSettingsLicenseSettings_GetExpireAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &ConfigSettingsLicenseSettings{ExpireAt: &zeroValue}\n\tc.GetExpireAt()\n\tc = &ConfigSettingsLicenseSettings{}\n\tc.GetExpireAt()\n\tc = nil\n\tc.GetExpireAt()\n}\n\nfunc TestConfigSettingsLicenseSettings_GetPerpetual(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigSettingsLicenseSettings{Perpetual: &zeroValue}\n\tc.GetPerpetual()\n\tc = &ConfigSettingsLicenseSettings{}\n\tc.GetPerpetual()\n\tc = nil\n\tc.GetPerpetual()\n}\n\nfunc TestConfigSettingsLicenseSettings_GetSeats(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &ConfigSettingsLicenseSettings{Seats: &zeroValue}\n\tc.GetSeats()\n\tc = &ConfigSettingsLicenseSettings{}\n\tc.GetSeats()\n\tc = nil\n\tc.GetSeats()\n}\n\nfunc TestConfigSettingsLicenseSettings_GetSSHAllowed(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigSettingsLicenseSettings{SSHAllowed: &zeroValue}\n\tc.GetSSHAllowed()\n\tc = &ConfigSettingsLicenseSettings{}\n\tc.GetSSHAllowed()\n\tc = nil\n\tc.GetSSHAllowed()\n}\n\nfunc TestConfigSettingsLicenseSettings_GetSupportKey(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsLicenseSettings{SupportKey: &zeroValue}\n\tc.GetSupportKey()\n\tc = &ConfigSettingsLicenseSettings{}\n\tc.GetSupportKey()\n\tc = nil\n\tc.GetSupportKey()\n}\n\nfunc TestConfigSettingsLicenseSettings_GetUnlimitedSeating(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigSettingsLicenseSettings{UnlimitedSeating: &zeroValue}\n\tc.GetUnlimitedSeating()\n\tc = &ConfigSettingsLicenseSettings{}\n\tc.GetUnlimitedSeating()\n\tc = nil\n\tc.GetUnlimitedSeating()\n}\n\nfunc TestConfigSettingsMapping_GetBasemap(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsMapping{Basemap: &zeroValue}\n\tc.GetBasemap()\n\tc = &ConfigSettingsMapping{}\n\tc.GetBasemap()\n\tc = nil\n\tc.GetBasemap()\n}\n\nfunc TestConfigSettingsMapping_GetEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigSettingsMapping{Enabled: &zeroValue}\n\tc.GetEnabled()\n\tc = &ConfigSettingsMapping{}\n\tc.GetEnabled()\n\tc = nil\n\tc.GetEnabled()\n}\n\nfunc TestConfigSettingsMapping_GetTileserver(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsMapping{Tileserver: &zeroValue}\n\tc.GetTileserver()\n\tc = &ConfigSettingsMapping{}\n\tc.GetTileserver()\n\tc = nil\n\tc.GetTileserver()\n}\n\nfunc TestConfigSettingsMapping_GetToken(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsMapping{Token: &zeroValue}\n\tc.GetToken()\n\tc = &ConfigSettingsMapping{}\n\tc.GetToken()\n\tc = nil\n\tc.GetToken()\n}\n\nfunc TestConfigSettingsNTP_GetPrimaryServer(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsNTP{PrimaryServer: &zeroValue}\n\tc.GetPrimaryServer()\n\tc = &ConfigSettingsNTP{}\n\tc.GetPrimaryServer()\n\tc = nil\n\tc.GetPrimaryServer()\n}\n\nfunc TestConfigSettingsNTP_GetSecondaryServer(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsNTP{SecondaryServer: &zeroValue}\n\tc.GetSecondaryServer()\n\tc = &ConfigSettingsNTP{}\n\tc.GetSecondaryServer()\n\tc = nil\n\tc.GetSecondaryServer()\n}\n\nfunc TestConfigSettingsPagesSettings_GetEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigSettingsPagesSettings{Enabled: &zeroValue}\n\tc.GetEnabled()\n\tc = &ConfigSettingsPagesSettings{}\n\tc.GetEnabled()\n\tc = nil\n\tc.GetEnabled()\n}\n\nfunc TestConfigSettingsSAML_GetCertificate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsSAML{Certificate: &zeroValue}\n\tc.GetCertificate()\n\tc = &ConfigSettingsSAML{}\n\tc.GetCertificate()\n\tc = nil\n\tc.GetCertificate()\n}\n\nfunc TestConfigSettingsSAML_GetCertificatePath(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsSAML{CertificatePath: &zeroValue}\n\tc.GetCertificatePath()\n\tc = &ConfigSettingsSAML{}\n\tc.GetCertificatePath()\n\tc = nil\n\tc.GetCertificatePath()\n}\n\nfunc TestConfigSettingsSAML_GetDisableAdminDemote(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigSettingsSAML{DisableAdminDemote: &zeroValue}\n\tc.GetDisableAdminDemote()\n\tc = &ConfigSettingsSAML{}\n\tc.GetDisableAdminDemote()\n\tc = nil\n\tc.GetDisableAdminDemote()\n}\n\nfunc TestConfigSettingsSAML_GetIDPInitiatedSSO(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigSettingsSAML{IDPInitiatedSSO: &zeroValue}\n\tc.GetIDPInitiatedSSO()\n\tc = &ConfigSettingsSAML{}\n\tc.GetIDPInitiatedSSO()\n\tc = nil\n\tc.GetIDPInitiatedSSO()\n}\n\nfunc TestConfigSettingsSAML_GetIssuer(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsSAML{Issuer: &zeroValue}\n\tc.GetIssuer()\n\tc = &ConfigSettingsSAML{}\n\tc.GetIssuer()\n\tc = nil\n\tc.GetIssuer()\n}\n\nfunc TestConfigSettingsSAML_GetSSOURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsSAML{SSOURL: &zeroValue}\n\tc.GetSSOURL()\n\tc = &ConfigSettingsSAML{}\n\tc.GetSSOURL()\n\tc = nil\n\tc.GetSSOURL()\n}\n\nfunc TestConfigSettingsSMTP_GetAddress(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsSMTP{Address: &zeroValue}\n\tc.GetAddress()\n\tc = &ConfigSettingsSMTP{}\n\tc.GetAddress()\n\tc = nil\n\tc.GetAddress()\n}\n\nfunc TestConfigSettingsSMTP_GetAuthentication(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsSMTP{Authentication: &zeroValue}\n\tc.GetAuthentication()\n\tc = &ConfigSettingsSMTP{}\n\tc.GetAuthentication()\n\tc = nil\n\tc.GetAuthentication()\n}\n\nfunc TestConfigSettingsSMTP_GetDiscardToNoreplyAddress(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigSettingsSMTP{DiscardToNoreplyAddress: &zeroValue}\n\tc.GetDiscardToNoreplyAddress()\n\tc = &ConfigSettingsSMTP{}\n\tc.GetDiscardToNoreplyAddress()\n\tc = nil\n\tc.GetDiscardToNoreplyAddress()\n}\n\nfunc TestConfigSettingsSMTP_GetDomain(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsSMTP{Domain: &zeroValue}\n\tc.GetDomain()\n\tc = &ConfigSettingsSMTP{}\n\tc.GetDomain()\n\tc = nil\n\tc.GetDomain()\n}\n\nfunc TestConfigSettingsSMTP_GetEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigSettingsSMTP{Enabled: &zeroValue}\n\tc.GetEnabled()\n\tc = &ConfigSettingsSMTP{}\n\tc.GetEnabled()\n\tc = nil\n\tc.GetEnabled()\n}\n\nfunc TestConfigSettingsSMTP_GetEnableStarttlsAuto(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigSettingsSMTP{EnableStarttlsAuto: &zeroValue}\n\tc.GetEnableStarttlsAuto()\n\tc = &ConfigSettingsSMTP{}\n\tc.GetEnableStarttlsAuto()\n\tc = nil\n\tc.GetEnableStarttlsAuto()\n}\n\nfunc TestConfigSettingsSMTP_GetNoreplyAddress(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsSMTP{NoreplyAddress: &zeroValue}\n\tc.GetNoreplyAddress()\n\tc = &ConfigSettingsSMTP{}\n\tc.GetNoreplyAddress()\n\tc = nil\n\tc.GetNoreplyAddress()\n}\n\nfunc TestConfigSettingsSMTP_GetPassword(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsSMTP{Password: &zeroValue}\n\tc.GetPassword()\n\tc = &ConfigSettingsSMTP{}\n\tc.GetPassword()\n\tc = nil\n\tc.GetPassword()\n}\n\nfunc TestConfigSettingsSMTP_GetPort(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsSMTP{Port: &zeroValue}\n\tc.GetPort()\n\tc = &ConfigSettingsSMTP{}\n\tc.GetPort()\n\tc = nil\n\tc.GetPort()\n}\n\nfunc TestConfigSettingsSMTP_GetSupportAddress(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsSMTP{SupportAddress: &zeroValue}\n\tc.GetSupportAddress()\n\tc = &ConfigSettingsSMTP{}\n\tc.GetSupportAddress()\n\tc = nil\n\tc.GetSupportAddress()\n}\n\nfunc TestConfigSettingsSMTP_GetSupportAddressType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsSMTP{SupportAddressType: &zeroValue}\n\tc.GetSupportAddressType()\n\tc = &ConfigSettingsSMTP{}\n\tc.GetSupportAddressType()\n\tc = nil\n\tc.GetSupportAddressType()\n}\n\nfunc TestConfigSettingsSMTP_GetUsername(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsSMTP{Username: &zeroValue}\n\tc.GetUsername()\n\tc = &ConfigSettingsSMTP{}\n\tc.GetUsername()\n\tc = nil\n\tc.GetUsername()\n}\n\nfunc TestConfigSettingsSMTP_GetUserName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsSMTP{UserName: &zeroValue}\n\tc.GetUserName()\n\tc = &ConfigSettingsSMTP{}\n\tc.GetUserName()\n\tc = nil\n\tc.GetUserName()\n}\n\nfunc TestConfigSettingsSNMP_GetCommunity(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsSNMP{Community: &zeroValue}\n\tc.GetCommunity()\n\tc = &ConfigSettingsSNMP{}\n\tc.GetCommunity()\n\tc = nil\n\tc.GetCommunity()\n}\n\nfunc TestConfigSettingsSNMP_GetEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigSettingsSNMP{Enabled: &zeroValue}\n\tc.GetEnabled()\n\tc = &ConfigSettingsSNMP{}\n\tc.GetEnabled()\n\tc = nil\n\tc.GetEnabled()\n}\n\nfunc TestConfigSettingsSyslog_GetEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &ConfigSettingsSyslog{Enabled: &zeroValue}\n\tc.GetEnabled()\n\tc = &ConfigSettingsSyslog{}\n\tc.GetEnabled()\n\tc = nil\n\tc.GetEnabled()\n}\n\nfunc TestConfigSettingsSyslog_GetProtocolName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsSyslog{ProtocolName: &zeroValue}\n\tc.GetProtocolName()\n\tc = &ConfigSettingsSyslog{}\n\tc.GetProtocolName()\n\tc = nil\n\tc.GetProtocolName()\n}\n\nfunc TestConfigSettingsSyslog_GetServer(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConfigSettingsSyslog{Server: &zeroValue}\n\tc.GetServer()\n\tc = &ConfigSettingsSyslog{}\n\tc.GetServer()\n\tc = nil\n\tc.GetServer()\n}\n\nfunc TestConnectionServiceItem_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ConnectionServiceItem{Name: &zeroValue}\n\tc.GetName()\n\tc = &ConnectionServiceItem{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestConnectionServiceItem_GetNumber(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &ConnectionServiceItem{Number: &zeroValue}\n\tc.GetNumber()\n\tc = &ConnectionServiceItem{}\n\tc.GetNumber()\n\tc = nil\n\tc.GetNumber()\n}\n\nfunc TestContentReference_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tc := &ContentReference{ID: &zeroValue}\n\tc.GetID()\n\tc = &ContentReference{}\n\tc.GetID()\n\tc = nil\n\tc.GetID()\n}\n\nfunc TestContentReference_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ContentReference{NodeID: &zeroValue}\n\tc.GetNodeID()\n\tc = &ContentReference{}\n\tc.GetNodeID()\n\tc = nil\n\tc.GetNodeID()\n}\n\nfunc TestContentReference_GetReference(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ContentReference{Reference: &zeroValue}\n\tc.GetReference()\n\tc = &ContentReference{}\n\tc.GetReference()\n\tc = nil\n\tc.GetReference()\n}\n\nfunc TestContentReferenceEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &ContentReferenceEvent{Action: &zeroValue}\n\tc.GetAction()\n\tc = &ContentReferenceEvent{}\n\tc.GetAction()\n\tc = nil\n\tc.GetAction()\n}\n\nfunc TestContentReferenceEvent_GetContentReference(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ContentReferenceEvent{}\n\tc.GetContentReference()\n\tc = nil\n\tc.GetContentReference()\n}\n\nfunc TestContentReferenceEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ContentReferenceEvent{}\n\tc.GetInstallation()\n\tc = nil\n\tc.GetInstallation()\n}\n\nfunc TestContentReferenceEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ContentReferenceEvent{}\n\tc.GetRepo()\n\tc = nil\n\tc.GetRepo()\n}\n\nfunc TestContentReferenceEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ContentReferenceEvent{}\n\tc.GetSender()\n\tc = nil\n\tc.GetSender()\n}\n\nfunc TestContributor_GetAvatarURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Contributor{AvatarURL: &zeroValue}\n\tc.GetAvatarURL()\n\tc = &Contributor{}\n\tc.GetAvatarURL()\n\tc = nil\n\tc.GetAvatarURL()\n}\n\nfunc TestContributor_GetContributions(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &Contributor{Contributions: &zeroValue}\n\tc.GetContributions()\n\tc = &Contributor{}\n\tc.GetContributions()\n\tc = nil\n\tc.GetContributions()\n}\n\nfunc TestContributor_GetEmail(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Contributor{Email: &zeroValue}\n\tc.GetEmail()\n\tc = &Contributor{}\n\tc.GetEmail()\n\tc = nil\n\tc.GetEmail()\n}\n\nfunc TestContributor_GetEventsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Contributor{EventsURL: &zeroValue}\n\tc.GetEventsURL()\n\tc = &Contributor{}\n\tc.GetEventsURL()\n\tc = nil\n\tc.GetEventsURL()\n}\n\nfunc TestContributor_GetFollowersURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Contributor{FollowersURL: &zeroValue}\n\tc.GetFollowersURL()\n\tc = &Contributor{}\n\tc.GetFollowersURL()\n\tc = nil\n\tc.GetFollowersURL()\n}\n\nfunc TestContributor_GetFollowingURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Contributor{FollowingURL: &zeroValue}\n\tc.GetFollowingURL()\n\tc = &Contributor{}\n\tc.GetFollowingURL()\n\tc = nil\n\tc.GetFollowingURL()\n}\n\nfunc TestContributor_GetGistsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Contributor{GistsURL: &zeroValue}\n\tc.GetGistsURL()\n\tc = &Contributor{}\n\tc.GetGistsURL()\n\tc = nil\n\tc.GetGistsURL()\n}\n\nfunc TestContributor_GetGravatarID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Contributor{GravatarID: &zeroValue}\n\tc.GetGravatarID()\n\tc = &Contributor{}\n\tc.GetGravatarID()\n\tc = nil\n\tc.GetGravatarID()\n}\n\nfunc TestContributor_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Contributor{HTMLURL: &zeroValue}\n\tc.GetHTMLURL()\n\tc = &Contributor{}\n\tc.GetHTMLURL()\n\tc = nil\n\tc.GetHTMLURL()\n}\n\nfunc TestContributor_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tc := &Contributor{ID: &zeroValue}\n\tc.GetID()\n\tc = &Contributor{}\n\tc.GetID()\n\tc = nil\n\tc.GetID()\n}\n\nfunc TestContributor_GetLogin(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Contributor{Login: &zeroValue}\n\tc.GetLogin()\n\tc = &Contributor{}\n\tc.GetLogin()\n\tc = nil\n\tc.GetLogin()\n}\n\nfunc TestContributor_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Contributor{Name: &zeroValue}\n\tc.GetName()\n\tc = &Contributor{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestContributor_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Contributor{NodeID: &zeroValue}\n\tc.GetNodeID()\n\tc = &Contributor{}\n\tc.GetNodeID()\n\tc = nil\n\tc.GetNodeID()\n}\n\nfunc TestContributor_GetOrganizationsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Contributor{OrganizationsURL: &zeroValue}\n\tc.GetOrganizationsURL()\n\tc = &Contributor{}\n\tc.GetOrganizationsURL()\n\tc = nil\n\tc.GetOrganizationsURL()\n}\n\nfunc TestContributor_GetReceivedEventsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Contributor{ReceivedEventsURL: &zeroValue}\n\tc.GetReceivedEventsURL()\n\tc = &Contributor{}\n\tc.GetReceivedEventsURL()\n\tc = nil\n\tc.GetReceivedEventsURL()\n}\n\nfunc TestContributor_GetReposURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Contributor{ReposURL: &zeroValue}\n\tc.GetReposURL()\n\tc = &Contributor{}\n\tc.GetReposURL()\n\tc = nil\n\tc.GetReposURL()\n}\n\nfunc TestContributor_GetSiteAdmin(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &Contributor{SiteAdmin: &zeroValue}\n\tc.GetSiteAdmin()\n\tc = &Contributor{}\n\tc.GetSiteAdmin()\n\tc = nil\n\tc.GetSiteAdmin()\n}\n\nfunc TestContributor_GetStarredURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Contributor{StarredURL: &zeroValue}\n\tc.GetStarredURL()\n\tc = &Contributor{}\n\tc.GetStarredURL()\n\tc = nil\n\tc.GetStarredURL()\n}\n\nfunc TestContributor_GetSubscriptionsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Contributor{SubscriptionsURL: &zeroValue}\n\tc.GetSubscriptionsURL()\n\tc = &Contributor{}\n\tc.GetSubscriptionsURL()\n\tc = nil\n\tc.GetSubscriptionsURL()\n}\n\nfunc TestContributor_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Contributor{Type: &zeroValue}\n\tc.GetType()\n\tc = &Contributor{}\n\tc.GetType()\n\tc = nil\n\tc.GetType()\n}\n\nfunc TestContributor_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Contributor{URL: &zeroValue}\n\tc.GetURL()\n\tc = &Contributor{}\n\tc.GetURL()\n\tc = nil\n\tc.GetURL()\n}\n\nfunc TestContributorApprovalPermissions_GetApprovalPolicy(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ContributorApprovalPermissions{}\n\tc.GetApprovalPolicy()\n\tc = nil\n\tc.GetApprovalPolicy()\n}\n\nfunc TestContributorStats_GetAuthor(tt *testing.T) {\n\ttt.Parallel()\n\tc := &ContributorStats{}\n\tc.GetAuthor()\n\tc = nil\n\tc.GetAuthor()\n}\n\nfunc TestContributorStats_GetTotal(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &ContributorStats{Total: &zeroValue}\n\tc.GetTotal()\n\tc = &ContributorStats{}\n\tc.GetTotal()\n\tc = nil\n\tc.GetTotal()\n}\n\nfunc TestContributorStats_GetWeeks(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*WeeklyStats{}\n\tc := &ContributorStats{Weeks: zeroValue}\n\tc.GetWeeks()\n\tc = &ContributorStats{}\n\tc.GetWeeks()\n\tc = nil\n\tc.GetWeeks()\n}\n\nfunc TestCopilotCodeReviewBranchRule_GetParameters(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotCodeReviewBranchRule{}\n\tc.GetParameters()\n\tc = nil\n\tc.GetParameters()\n}\n\nfunc TestCopilotCodeReviewRuleParameters_GetReviewDraftPullRequests(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotCodeReviewRuleParameters{}\n\tc.GetReviewDraftPullRequests()\n\tc = nil\n\tc.GetReviewDraftPullRequests()\n}\n\nfunc TestCopilotCodeReviewRuleParameters_GetReviewOnPush(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotCodeReviewRuleParameters{}\n\tc.GetReviewOnPush()\n\tc = nil\n\tc.GetReviewOnPush()\n}\n\nfunc TestCopilotDailyMetricsReport_GetDownloadLinks(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tc := &CopilotDailyMetricsReport{DownloadLinks: zeroValue}\n\tc.GetDownloadLinks()\n\tc = &CopilotDailyMetricsReport{}\n\tc.GetDownloadLinks()\n\tc = nil\n\tc.GetDownloadLinks()\n}\n\nfunc TestCopilotDailyMetricsReport_GetReportDay(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotDailyMetricsReport{}\n\tc.GetReportDay()\n\tc = nil\n\tc.GetReportDay()\n}\n\nfunc TestCopilotDotcomChat_GetModels(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CopilotDotcomChatModel{}\n\tc := &CopilotDotcomChat{Models: zeroValue}\n\tc.GetModels()\n\tc = &CopilotDotcomChat{}\n\tc.GetModels()\n\tc = nil\n\tc.GetModels()\n}\n\nfunc TestCopilotDotcomChat_GetTotalEngagedUsers(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotDotcomChat{}\n\tc.GetTotalEngagedUsers()\n\tc = nil\n\tc.GetTotalEngagedUsers()\n}\n\nfunc TestCopilotDotcomChatModel_GetCustomModelTrainingDate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CopilotDotcomChatModel{CustomModelTrainingDate: &zeroValue}\n\tc.GetCustomModelTrainingDate()\n\tc = &CopilotDotcomChatModel{}\n\tc.GetCustomModelTrainingDate()\n\tc = nil\n\tc.GetCustomModelTrainingDate()\n}\n\nfunc TestCopilotDotcomChatModel_GetIsCustomModel(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotDotcomChatModel{}\n\tc.GetIsCustomModel()\n\tc = nil\n\tc.GetIsCustomModel()\n}\n\nfunc TestCopilotDotcomChatModel_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotDotcomChatModel{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCopilotDotcomChatModel_GetTotalChats(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotDotcomChatModel{}\n\tc.GetTotalChats()\n\tc = nil\n\tc.GetTotalChats()\n}\n\nfunc TestCopilotDotcomChatModel_GetTotalEngagedUsers(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotDotcomChatModel{}\n\tc.GetTotalEngagedUsers()\n\tc = nil\n\tc.GetTotalEngagedUsers()\n}\n\nfunc TestCopilotDotcomPullRequests_GetRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CopilotDotcomPullRequestsRepository{}\n\tc := &CopilotDotcomPullRequests{Repositories: zeroValue}\n\tc.GetRepositories()\n\tc = &CopilotDotcomPullRequests{}\n\tc.GetRepositories()\n\tc = nil\n\tc.GetRepositories()\n}\n\nfunc TestCopilotDotcomPullRequests_GetTotalEngagedUsers(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotDotcomPullRequests{}\n\tc.GetTotalEngagedUsers()\n\tc = nil\n\tc.GetTotalEngagedUsers()\n}\n\nfunc TestCopilotDotcomPullRequestsModel_GetCustomModelTrainingDate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CopilotDotcomPullRequestsModel{CustomModelTrainingDate: &zeroValue}\n\tc.GetCustomModelTrainingDate()\n\tc = &CopilotDotcomPullRequestsModel{}\n\tc.GetCustomModelTrainingDate()\n\tc = nil\n\tc.GetCustomModelTrainingDate()\n}\n\nfunc TestCopilotDotcomPullRequestsModel_GetIsCustomModel(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotDotcomPullRequestsModel{}\n\tc.GetIsCustomModel()\n\tc = nil\n\tc.GetIsCustomModel()\n}\n\nfunc TestCopilotDotcomPullRequestsModel_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotDotcomPullRequestsModel{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCopilotDotcomPullRequestsModel_GetTotalEngagedUsers(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotDotcomPullRequestsModel{}\n\tc.GetTotalEngagedUsers()\n\tc = nil\n\tc.GetTotalEngagedUsers()\n}\n\nfunc TestCopilotDotcomPullRequestsModel_GetTotalPRSummariesCreated(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotDotcomPullRequestsModel{}\n\tc.GetTotalPRSummariesCreated()\n\tc = nil\n\tc.GetTotalPRSummariesCreated()\n}\n\nfunc TestCopilotDotcomPullRequestsRepository_GetModels(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CopilotDotcomPullRequestsModel{}\n\tc := &CopilotDotcomPullRequestsRepository{Models: zeroValue}\n\tc.GetModels()\n\tc = &CopilotDotcomPullRequestsRepository{}\n\tc.GetModels()\n\tc = nil\n\tc.GetModels()\n}\n\nfunc TestCopilotDotcomPullRequestsRepository_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotDotcomPullRequestsRepository{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCopilotDotcomPullRequestsRepository_GetTotalEngagedUsers(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotDotcomPullRequestsRepository{}\n\tc.GetTotalEngagedUsers()\n\tc = nil\n\tc.GetTotalEngagedUsers()\n}\n\nfunc TestCopilotIDEChat_GetEditors(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CopilotIDEChatEditor{}\n\tc := &CopilotIDEChat{Editors: zeroValue}\n\tc.GetEditors()\n\tc = &CopilotIDEChat{}\n\tc.GetEditors()\n\tc = nil\n\tc.GetEditors()\n}\n\nfunc TestCopilotIDEChat_GetTotalEngagedUsers(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotIDEChat{}\n\tc.GetTotalEngagedUsers()\n\tc = nil\n\tc.GetTotalEngagedUsers()\n}\n\nfunc TestCopilotIDEChatEditor_GetModels(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CopilotIDEChatModel{}\n\tc := &CopilotIDEChatEditor{Models: zeroValue}\n\tc.GetModels()\n\tc = &CopilotIDEChatEditor{}\n\tc.GetModels()\n\tc = nil\n\tc.GetModels()\n}\n\nfunc TestCopilotIDEChatEditor_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotIDEChatEditor{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCopilotIDEChatEditor_GetTotalEngagedUsers(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotIDEChatEditor{}\n\tc.GetTotalEngagedUsers()\n\tc = nil\n\tc.GetTotalEngagedUsers()\n}\n\nfunc TestCopilotIDEChatModel_GetCustomModelTrainingDate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CopilotIDEChatModel{CustomModelTrainingDate: &zeroValue}\n\tc.GetCustomModelTrainingDate()\n\tc = &CopilotIDEChatModel{}\n\tc.GetCustomModelTrainingDate()\n\tc = nil\n\tc.GetCustomModelTrainingDate()\n}\n\nfunc TestCopilotIDEChatModel_GetIsCustomModel(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotIDEChatModel{}\n\tc.GetIsCustomModel()\n\tc = nil\n\tc.GetIsCustomModel()\n}\n\nfunc TestCopilotIDEChatModel_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotIDEChatModel{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCopilotIDEChatModel_GetTotalChatCopyEvents(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotIDEChatModel{}\n\tc.GetTotalChatCopyEvents()\n\tc = nil\n\tc.GetTotalChatCopyEvents()\n}\n\nfunc TestCopilotIDEChatModel_GetTotalChatInsertionEvents(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotIDEChatModel{}\n\tc.GetTotalChatInsertionEvents()\n\tc = nil\n\tc.GetTotalChatInsertionEvents()\n}\n\nfunc TestCopilotIDEChatModel_GetTotalChats(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotIDEChatModel{}\n\tc.GetTotalChats()\n\tc = nil\n\tc.GetTotalChats()\n}\n\nfunc TestCopilotIDEChatModel_GetTotalEngagedUsers(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotIDEChatModel{}\n\tc.GetTotalEngagedUsers()\n\tc = nil\n\tc.GetTotalEngagedUsers()\n}\n\nfunc TestCopilotIDECodeCompletions_GetEditors(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CopilotIDECodeCompletionsEditor{}\n\tc := &CopilotIDECodeCompletions{Editors: zeroValue}\n\tc.GetEditors()\n\tc = &CopilotIDECodeCompletions{}\n\tc.GetEditors()\n\tc = nil\n\tc.GetEditors()\n}\n\nfunc TestCopilotIDECodeCompletions_GetLanguages(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CopilotIDECodeCompletionsLanguage{}\n\tc := &CopilotIDECodeCompletions{Languages: zeroValue}\n\tc.GetLanguages()\n\tc = &CopilotIDECodeCompletions{}\n\tc.GetLanguages()\n\tc = nil\n\tc.GetLanguages()\n}\n\nfunc TestCopilotIDECodeCompletions_GetTotalEngagedUsers(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotIDECodeCompletions{}\n\tc.GetTotalEngagedUsers()\n\tc = nil\n\tc.GetTotalEngagedUsers()\n}\n\nfunc TestCopilotIDECodeCompletionsEditor_GetModels(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CopilotIDECodeCompletionsModel{}\n\tc := &CopilotIDECodeCompletionsEditor{Models: zeroValue}\n\tc.GetModels()\n\tc = &CopilotIDECodeCompletionsEditor{}\n\tc.GetModels()\n\tc = nil\n\tc.GetModels()\n}\n\nfunc TestCopilotIDECodeCompletionsEditor_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotIDECodeCompletionsEditor{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCopilotIDECodeCompletionsEditor_GetTotalEngagedUsers(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotIDECodeCompletionsEditor{}\n\tc.GetTotalEngagedUsers()\n\tc = nil\n\tc.GetTotalEngagedUsers()\n}\n\nfunc TestCopilotIDECodeCompletionsLanguage_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotIDECodeCompletionsLanguage{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCopilotIDECodeCompletionsLanguage_GetTotalEngagedUsers(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotIDECodeCompletionsLanguage{}\n\tc.GetTotalEngagedUsers()\n\tc = nil\n\tc.GetTotalEngagedUsers()\n}\n\nfunc TestCopilotIDECodeCompletionsModel_GetCustomModelTrainingDate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CopilotIDECodeCompletionsModel{CustomModelTrainingDate: &zeroValue}\n\tc.GetCustomModelTrainingDate()\n\tc = &CopilotIDECodeCompletionsModel{}\n\tc.GetCustomModelTrainingDate()\n\tc = nil\n\tc.GetCustomModelTrainingDate()\n}\n\nfunc TestCopilotIDECodeCompletionsModel_GetIsCustomModel(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotIDECodeCompletionsModel{}\n\tc.GetIsCustomModel()\n\tc = nil\n\tc.GetIsCustomModel()\n}\n\nfunc TestCopilotIDECodeCompletionsModel_GetLanguages(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CopilotIDECodeCompletionsModelLanguage{}\n\tc := &CopilotIDECodeCompletionsModel{Languages: zeroValue}\n\tc.GetLanguages()\n\tc = &CopilotIDECodeCompletionsModel{}\n\tc.GetLanguages()\n\tc = nil\n\tc.GetLanguages()\n}\n\nfunc TestCopilotIDECodeCompletionsModel_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotIDECodeCompletionsModel{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCopilotIDECodeCompletionsModel_GetTotalEngagedUsers(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotIDECodeCompletionsModel{}\n\tc.GetTotalEngagedUsers()\n\tc = nil\n\tc.GetTotalEngagedUsers()\n}\n\nfunc TestCopilotIDECodeCompletionsModelLanguage_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotIDECodeCompletionsModelLanguage{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCopilotIDECodeCompletionsModelLanguage_GetTotalCodeAcceptances(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotIDECodeCompletionsModelLanguage{}\n\tc.GetTotalCodeAcceptances()\n\tc = nil\n\tc.GetTotalCodeAcceptances()\n}\n\nfunc TestCopilotIDECodeCompletionsModelLanguage_GetTotalCodeLinesAccepted(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotIDECodeCompletionsModelLanguage{}\n\tc.GetTotalCodeLinesAccepted()\n\tc = nil\n\tc.GetTotalCodeLinesAccepted()\n}\n\nfunc TestCopilotIDECodeCompletionsModelLanguage_GetTotalCodeLinesSuggested(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotIDECodeCompletionsModelLanguage{}\n\tc.GetTotalCodeLinesSuggested()\n\tc = nil\n\tc.GetTotalCodeLinesSuggested()\n}\n\nfunc TestCopilotIDECodeCompletionsModelLanguage_GetTotalCodeSuggestions(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotIDECodeCompletionsModelLanguage{}\n\tc.GetTotalCodeSuggestions()\n\tc = nil\n\tc.GetTotalCodeSuggestions()\n}\n\nfunc TestCopilotIDECodeCompletionsModelLanguage_GetTotalEngagedUsers(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotIDECodeCompletionsModelLanguage{}\n\tc.GetTotalEngagedUsers()\n\tc = nil\n\tc.GetTotalEngagedUsers()\n}\n\nfunc TestCopilotMetrics_GetCopilotDotcomChat(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotMetrics{}\n\tc.GetCopilotDotcomChat()\n\tc = nil\n\tc.GetCopilotDotcomChat()\n}\n\nfunc TestCopilotMetrics_GetCopilotDotcomPullRequests(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotMetrics{}\n\tc.GetCopilotDotcomPullRequests()\n\tc = nil\n\tc.GetCopilotDotcomPullRequests()\n}\n\nfunc TestCopilotMetrics_GetCopilotIDEChat(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotMetrics{}\n\tc.GetCopilotIDEChat()\n\tc = nil\n\tc.GetCopilotIDEChat()\n}\n\nfunc TestCopilotMetrics_GetCopilotIDECodeCompletions(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotMetrics{}\n\tc.GetCopilotIDECodeCompletions()\n\tc = nil\n\tc.GetCopilotIDECodeCompletions()\n}\n\nfunc TestCopilotMetrics_GetDate(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotMetrics{}\n\tc.GetDate()\n\tc = nil\n\tc.GetDate()\n}\n\nfunc TestCopilotMetrics_GetTotalActiveUsers(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CopilotMetrics{TotalActiveUsers: &zeroValue}\n\tc.GetTotalActiveUsers()\n\tc = &CopilotMetrics{}\n\tc.GetTotalActiveUsers()\n\tc = nil\n\tc.GetTotalActiveUsers()\n}\n\nfunc TestCopilotMetrics_GetTotalEngagedUsers(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CopilotMetrics{TotalEngagedUsers: &zeroValue}\n\tc.GetTotalEngagedUsers()\n\tc = &CopilotMetrics{}\n\tc.GetTotalEngagedUsers()\n\tc = nil\n\tc.GetTotalEngagedUsers()\n}\n\nfunc TestCopilotMetricsListOptions_GetSince(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue time.Time\n\tc := &CopilotMetricsListOptions{Since: &zeroValue}\n\tc.GetSince()\n\tc = &CopilotMetricsListOptions{}\n\tc.GetSince()\n\tc = nil\n\tc.GetSince()\n}\n\nfunc TestCopilotMetricsListOptions_GetUntil(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue time.Time\n\tc := &CopilotMetricsListOptions{Until: &zeroValue}\n\tc.GetUntil()\n\tc = &CopilotMetricsListOptions{}\n\tc.GetUntil()\n\tc = nil\n\tc.GetUntil()\n}\n\nfunc TestCopilotMetricsReport_GetDownloadLinks(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tc := &CopilotMetricsReport{DownloadLinks: zeroValue}\n\tc.GetDownloadLinks()\n\tc = &CopilotMetricsReport{}\n\tc.GetDownloadLinks()\n\tc = nil\n\tc.GetDownloadLinks()\n}\n\nfunc TestCopilotMetricsReport_GetReportEndDay(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotMetricsReport{}\n\tc.GetReportEndDay()\n\tc = nil\n\tc.GetReportEndDay()\n}\n\nfunc TestCopilotMetricsReport_GetReportStartDay(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotMetricsReport{}\n\tc.GetReportStartDay()\n\tc = nil\n\tc.GetReportStartDay()\n}\n\nfunc TestCopilotMetricsReportOptions_GetDay(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotMetricsReportOptions{}\n\tc.GetDay()\n\tc = nil\n\tc.GetDay()\n}\n\nfunc TestCopilotOrganizationDetails_GetCopilotChat(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotOrganizationDetails{}\n\tc.GetCopilotChat()\n\tc = nil\n\tc.GetCopilotChat()\n}\n\nfunc TestCopilotOrganizationDetails_GetPublicCodeSuggestions(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotOrganizationDetails{}\n\tc.GetPublicCodeSuggestions()\n\tc = nil\n\tc.GetPublicCodeSuggestions()\n}\n\nfunc TestCopilotOrganizationDetails_GetSeatBreakdown(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotOrganizationDetails{}\n\tc.GetSeatBreakdown()\n\tc = nil\n\tc.GetSeatBreakdown()\n}\n\nfunc TestCopilotOrganizationDetails_GetSeatManagementSetting(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotOrganizationDetails{}\n\tc.GetSeatManagementSetting()\n\tc = nil\n\tc.GetSeatManagementSetting()\n}\n\nfunc TestCopilotSeatBreakdown_GetActiveThisCycle(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotSeatBreakdown{}\n\tc.GetActiveThisCycle()\n\tc = nil\n\tc.GetActiveThisCycle()\n}\n\nfunc TestCopilotSeatBreakdown_GetAddedThisCycle(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotSeatBreakdown{}\n\tc.GetAddedThisCycle()\n\tc = nil\n\tc.GetAddedThisCycle()\n}\n\nfunc TestCopilotSeatBreakdown_GetInactiveThisCycle(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotSeatBreakdown{}\n\tc.GetInactiveThisCycle()\n\tc = nil\n\tc.GetInactiveThisCycle()\n}\n\nfunc TestCopilotSeatBreakdown_GetPendingCancellation(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotSeatBreakdown{}\n\tc.GetPendingCancellation()\n\tc = nil\n\tc.GetPendingCancellation()\n}\n\nfunc TestCopilotSeatBreakdown_GetPendingInvitation(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotSeatBreakdown{}\n\tc.GetPendingInvitation()\n\tc = nil\n\tc.GetPendingInvitation()\n}\n\nfunc TestCopilotSeatBreakdown_GetTotal(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotSeatBreakdown{}\n\tc.GetTotal()\n\tc = nil\n\tc.GetTotal()\n}\n\nfunc TestCopilotSeatDetails_GetAssignee(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotSeatDetails{}\n\tc.GetAssignee()\n\tc = nil\n\tc.GetAssignee()\n}\n\nfunc TestCopilotSeatDetails_GetAssigningTeam(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CopilotSeatDetails{}\n\tc.GetAssigningTeam()\n\tc = nil\n\tc.GetAssigningTeam()\n}\n\nfunc TestCopilotSeatDetails_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &CopilotSeatDetails{CreatedAt: &zeroValue}\n\tc.GetCreatedAt()\n\tc = &CopilotSeatDetails{}\n\tc.GetCreatedAt()\n\tc = nil\n\tc.GetCreatedAt()\n}\n\nfunc TestCopilotSeatDetails_GetLastActivityAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &CopilotSeatDetails{LastActivityAt: &zeroValue}\n\tc.GetLastActivityAt()\n\tc = &CopilotSeatDetails{}\n\tc.GetLastActivityAt()\n\tc = nil\n\tc.GetLastActivityAt()\n}\n\nfunc TestCopilotSeatDetails_GetLastActivityEditor(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CopilotSeatDetails{LastActivityEditor: &zeroValue}\n\tc.GetLastActivityEditor()\n\tc = &CopilotSeatDetails{}\n\tc.GetLastActivityEditor()\n\tc = nil\n\tc.GetLastActivityEditor()\n}\n\nfunc TestCopilotSeatDetails_GetPendingCancellationDate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CopilotSeatDetails{PendingCancellationDate: &zeroValue}\n\tc.GetPendingCancellationDate()\n\tc = &CopilotSeatDetails{}\n\tc.GetPendingCancellationDate()\n\tc = nil\n\tc.GetPendingCancellationDate()\n}\n\nfunc TestCopilotSeatDetails_GetPlanType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CopilotSeatDetails{PlanType: &zeroValue}\n\tc.GetPlanType()\n\tc = &CopilotSeatDetails{}\n\tc.GetPlanType()\n\tc = nil\n\tc.GetPlanType()\n}\n\nfunc TestCopilotSeatDetails_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &CopilotSeatDetails{UpdatedAt: &zeroValue}\n\tc.GetUpdatedAt()\n\tc = &CopilotSeatDetails{}\n\tc.GetUpdatedAt()\n\tc = nil\n\tc.GetUpdatedAt()\n}\n\nfunc TestCostCenter_GetAzureSubscription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CostCenter{AzureSubscription: &zeroValue}\n\tc.GetAzureSubscription()\n\tc = &CostCenter{}\n\tc.GetAzureSubscription()\n\tc = nil\n\tc.GetAzureSubscription()\n}\n\nfunc TestCostCenter_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CostCenter{}\n\tc.GetID()\n\tc = nil\n\tc.GetID()\n}\n\nfunc TestCostCenter_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CostCenter{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCostCenter_GetResources(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CostCenterResource{}\n\tc := &CostCenter{Resources: zeroValue}\n\tc.GetResources()\n\tc = &CostCenter{}\n\tc.GetResources()\n\tc = nil\n\tc.GetResources()\n}\n\nfunc TestCostCenter_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CostCenter{State: &zeroValue}\n\tc.GetState()\n\tc = &CostCenter{}\n\tc.GetState()\n\tc = nil\n\tc.GetState()\n}\n\nfunc TestCostCenterRequest_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CostCenterRequest{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCostCenterResource_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CostCenterResource{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCostCenterResource_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CostCenterResource{}\n\tc.GetType()\n\tc = nil\n\tc.GetType()\n}\n\nfunc TestCostCenterResourceRequest_GetOrganizations(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tc := &CostCenterResourceRequest{Organizations: zeroValue}\n\tc.GetOrganizations()\n\tc = &CostCenterResourceRequest{}\n\tc.GetOrganizations()\n\tc = nil\n\tc.GetOrganizations()\n}\n\nfunc TestCostCenterResourceRequest_GetRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tc := &CostCenterResourceRequest{Repositories: zeroValue}\n\tc.GetRepositories()\n\tc = &CostCenterResourceRequest{}\n\tc.GetRepositories()\n\tc = nil\n\tc.GetRepositories()\n}\n\nfunc TestCostCenterResourceRequest_GetUsers(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tc := &CostCenterResourceRequest{Users: zeroValue}\n\tc.GetUsers()\n\tc = &CostCenterResourceRequest{}\n\tc.GetUsers()\n\tc = nil\n\tc.GetUsers()\n}\n\nfunc TestCostCenters_GetCostCenters(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CostCenter{}\n\tc := &CostCenters{CostCenters: zeroValue}\n\tc.GetCostCenters()\n\tc = &CostCenters{}\n\tc.GetCostCenters()\n\tc = nil\n\tc.GetCostCenters()\n}\n\nfunc TestCreateArtifactDeploymentRequest_GetCluster(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateArtifactDeploymentRequest{Cluster: &zeroValue}\n\tc.GetCluster()\n\tc = &CreateArtifactDeploymentRequest{}\n\tc.GetCluster()\n\tc = nil\n\tc.GetCluster()\n}\n\nfunc TestCreateArtifactDeploymentRequest_GetDeploymentName(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateArtifactDeploymentRequest{}\n\tc.GetDeploymentName()\n\tc = nil\n\tc.GetDeploymentName()\n}\n\nfunc TestCreateArtifactDeploymentRequest_GetDigest(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateArtifactDeploymentRequest{}\n\tc.GetDigest()\n\tc = nil\n\tc.GetDigest()\n}\n\nfunc TestCreateArtifactDeploymentRequest_GetGithubRepository(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateArtifactDeploymentRequest{GithubRepository: &zeroValue}\n\tc.GetGithubRepository()\n\tc = &CreateArtifactDeploymentRequest{}\n\tc.GetGithubRepository()\n\tc = nil\n\tc.GetGithubRepository()\n}\n\nfunc TestCreateArtifactDeploymentRequest_GetLogicalEnvironment(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateArtifactDeploymentRequest{}\n\tc.GetLogicalEnvironment()\n\tc = nil\n\tc.GetLogicalEnvironment()\n}\n\nfunc TestCreateArtifactDeploymentRequest_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateArtifactDeploymentRequest{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCreateArtifactDeploymentRequest_GetPhysicalEnvironment(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateArtifactDeploymentRequest{PhysicalEnvironment: &zeroValue}\n\tc.GetPhysicalEnvironment()\n\tc = &CreateArtifactDeploymentRequest{}\n\tc.GetPhysicalEnvironment()\n\tc = nil\n\tc.GetPhysicalEnvironment()\n}\n\nfunc TestCreateArtifactDeploymentRequest_GetRuntimeRisks(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []DeploymentRuntimeRisk{}\n\tc := &CreateArtifactDeploymentRequest{RuntimeRisks: zeroValue}\n\tc.GetRuntimeRisks()\n\tc = &CreateArtifactDeploymentRequest{}\n\tc.GetRuntimeRisks()\n\tc = nil\n\tc.GetRuntimeRisks()\n}\n\nfunc TestCreateArtifactDeploymentRequest_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateArtifactDeploymentRequest{}\n\tc.GetStatus()\n\tc = nil\n\tc.GetStatus()\n}\n\nfunc TestCreateArtifactDeploymentRequest_GetTags(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]string{}\n\tc := &CreateArtifactDeploymentRequest{Tags: zeroValue}\n\tc.GetTags()\n\tc = &CreateArtifactDeploymentRequest{}\n\tc.GetTags()\n\tc = nil\n\tc.GetTags()\n}\n\nfunc TestCreateArtifactDeploymentRequest_GetVersion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateArtifactDeploymentRequest{Version: &zeroValue}\n\tc.GetVersion()\n\tc = &CreateArtifactDeploymentRequest{}\n\tc.GetVersion()\n\tc = nil\n\tc.GetVersion()\n}\n\nfunc TestCreateArtifactStorageRequest_GetArtifactURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateArtifactStorageRequest{ArtifactURL: &zeroValue}\n\tc.GetArtifactURL()\n\tc = &CreateArtifactStorageRequest{}\n\tc.GetArtifactURL()\n\tc = nil\n\tc.GetArtifactURL()\n}\n\nfunc TestCreateArtifactStorageRequest_GetDigest(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateArtifactStorageRequest{}\n\tc.GetDigest()\n\tc = nil\n\tc.GetDigest()\n}\n\nfunc TestCreateArtifactStorageRequest_GetGithubRepository(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateArtifactStorageRequest{GithubRepository: &zeroValue}\n\tc.GetGithubRepository()\n\tc = &CreateArtifactStorageRequest{}\n\tc.GetGithubRepository()\n\tc = nil\n\tc.GetGithubRepository()\n}\n\nfunc TestCreateArtifactStorageRequest_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateArtifactStorageRequest{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCreateArtifactStorageRequest_GetPath(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateArtifactStorageRequest{Path: &zeroValue}\n\tc.GetPath()\n\tc = &CreateArtifactStorageRequest{}\n\tc.GetPath()\n\tc = nil\n\tc.GetPath()\n}\n\nfunc TestCreateArtifactStorageRequest_GetRegistryURL(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateArtifactStorageRequest{}\n\tc.GetRegistryURL()\n\tc = nil\n\tc.GetRegistryURL()\n}\n\nfunc TestCreateArtifactStorageRequest_GetRepository(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateArtifactStorageRequest{Repository: &zeroValue}\n\tc.GetRepository()\n\tc = &CreateArtifactStorageRequest{}\n\tc.GetRepository()\n\tc = nil\n\tc.GetRepository()\n}\n\nfunc TestCreateArtifactStorageRequest_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateArtifactStorageRequest{Status: &zeroValue}\n\tc.GetStatus()\n\tc = &CreateArtifactStorageRequest{}\n\tc.GetStatus()\n\tc = nil\n\tc.GetStatus()\n}\n\nfunc TestCreateArtifactStorageRequest_GetVersion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateArtifactStorageRequest{Version: &zeroValue}\n\tc.GetVersion()\n\tc = &CreateArtifactStorageRequest{}\n\tc.GetVersion()\n\tc = nil\n\tc.GetVersion()\n}\n\nfunc TestCreateCheckRunOptions_GetActions(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CheckRunAction{}\n\tc := &CreateCheckRunOptions{Actions: zeroValue}\n\tc.GetActions()\n\tc = &CreateCheckRunOptions{}\n\tc.GetActions()\n\tc = nil\n\tc.GetActions()\n}\n\nfunc TestCreateCheckRunOptions_GetCompletedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &CreateCheckRunOptions{CompletedAt: &zeroValue}\n\tc.GetCompletedAt()\n\tc = &CreateCheckRunOptions{}\n\tc.GetCompletedAt()\n\tc = nil\n\tc.GetCompletedAt()\n}\n\nfunc TestCreateCheckRunOptions_GetConclusion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateCheckRunOptions{Conclusion: &zeroValue}\n\tc.GetConclusion()\n\tc = &CreateCheckRunOptions{}\n\tc.GetConclusion()\n\tc = nil\n\tc.GetConclusion()\n}\n\nfunc TestCreateCheckRunOptions_GetDetailsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateCheckRunOptions{DetailsURL: &zeroValue}\n\tc.GetDetailsURL()\n\tc = &CreateCheckRunOptions{}\n\tc.GetDetailsURL()\n\tc = nil\n\tc.GetDetailsURL()\n}\n\nfunc TestCreateCheckRunOptions_GetExternalID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateCheckRunOptions{ExternalID: &zeroValue}\n\tc.GetExternalID()\n\tc = &CreateCheckRunOptions{}\n\tc.GetExternalID()\n\tc = nil\n\tc.GetExternalID()\n}\n\nfunc TestCreateCheckRunOptions_GetHeadSHA(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateCheckRunOptions{}\n\tc.GetHeadSHA()\n\tc = nil\n\tc.GetHeadSHA()\n}\n\nfunc TestCreateCheckRunOptions_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateCheckRunOptions{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCreateCheckRunOptions_GetOutput(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateCheckRunOptions{}\n\tc.GetOutput()\n\tc = nil\n\tc.GetOutput()\n}\n\nfunc TestCreateCheckRunOptions_GetStartedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &CreateCheckRunOptions{StartedAt: &zeroValue}\n\tc.GetStartedAt()\n\tc = &CreateCheckRunOptions{}\n\tc.GetStartedAt()\n\tc = nil\n\tc.GetStartedAt()\n}\n\nfunc TestCreateCheckRunOptions_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateCheckRunOptions{Status: &zeroValue}\n\tc.GetStatus()\n\tc = &CreateCheckRunOptions{}\n\tc.GetStatus()\n\tc = nil\n\tc.GetStatus()\n}\n\nfunc TestCreateCheckSuiteOptions_GetHeadBranch(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateCheckSuiteOptions{HeadBranch: &zeroValue}\n\tc.GetHeadBranch()\n\tc = &CreateCheckSuiteOptions{}\n\tc.GetHeadBranch()\n\tc = nil\n\tc.GetHeadBranch()\n}\n\nfunc TestCreateCheckSuiteOptions_GetHeadSHA(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateCheckSuiteOptions{}\n\tc.GetHeadSHA()\n\tc = nil\n\tc.GetHeadSHA()\n}\n\nfunc TestCreateCodespaceOptions_GetClientIP(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateCodespaceOptions{ClientIP: &zeroValue}\n\tc.GetClientIP()\n\tc = &CreateCodespaceOptions{}\n\tc.GetClientIP()\n\tc = nil\n\tc.GetClientIP()\n}\n\nfunc TestCreateCodespaceOptions_GetDevcontainerPath(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateCodespaceOptions{DevcontainerPath: &zeroValue}\n\tc.GetDevcontainerPath()\n\tc = &CreateCodespaceOptions{}\n\tc.GetDevcontainerPath()\n\tc = nil\n\tc.GetDevcontainerPath()\n}\n\nfunc TestCreateCodespaceOptions_GetDisplayName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateCodespaceOptions{DisplayName: &zeroValue}\n\tc.GetDisplayName()\n\tc = &CreateCodespaceOptions{}\n\tc.GetDisplayName()\n\tc = nil\n\tc.GetDisplayName()\n}\n\nfunc TestCreateCodespaceOptions_GetGeo(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateCodespaceOptions{Geo: &zeroValue}\n\tc.GetGeo()\n\tc = &CreateCodespaceOptions{}\n\tc.GetGeo()\n\tc = nil\n\tc.GetGeo()\n}\n\nfunc TestCreateCodespaceOptions_GetIdleTimeoutMinutes(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CreateCodespaceOptions{IdleTimeoutMinutes: &zeroValue}\n\tc.GetIdleTimeoutMinutes()\n\tc = &CreateCodespaceOptions{}\n\tc.GetIdleTimeoutMinutes()\n\tc = nil\n\tc.GetIdleTimeoutMinutes()\n}\n\nfunc TestCreateCodespaceOptions_GetLocation(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateCodespaceOptions{Location: &zeroValue}\n\tc.GetLocation()\n\tc = &CreateCodespaceOptions{}\n\tc.GetLocation()\n\tc = nil\n\tc.GetLocation()\n}\n\nfunc TestCreateCodespaceOptions_GetMachine(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateCodespaceOptions{Machine: &zeroValue}\n\tc.GetMachine()\n\tc = &CreateCodespaceOptions{}\n\tc.GetMachine()\n\tc = nil\n\tc.GetMachine()\n}\n\nfunc TestCreateCodespaceOptions_GetMultiRepoPermissionsOptOut(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &CreateCodespaceOptions{MultiRepoPermissionsOptOut: &zeroValue}\n\tc.GetMultiRepoPermissionsOptOut()\n\tc = &CreateCodespaceOptions{}\n\tc.GetMultiRepoPermissionsOptOut()\n\tc = nil\n\tc.GetMultiRepoPermissionsOptOut()\n}\n\nfunc TestCreateCodespaceOptions_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateCodespaceOptions{Ref: &zeroValue}\n\tc.GetRef()\n\tc = &CreateCodespaceOptions{}\n\tc.GetRef()\n\tc = nil\n\tc.GetRef()\n}\n\nfunc TestCreateCodespaceOptions_GetRetentionPeriodMinutes(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CreateCodespaceOptions{RetentionPeriodMinutes: &zeroValue}\n\tc.GetRetentionPeriodMinutes()\n\tc = &CreateCodespaceOptions{}\n\tc.GetRetentionPeriodMinutes()\n\tc = nil\n\tc.GetRetentionPeriodMinutes()\n}\n\nfunc TestCreateCodespaceOptions_GetWorkingDirectory(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateCodespaceOptions{WorkingDirectory: &zeroValue}\n\tc.GetWorkingDirectory()\n\tc = &CreateCodespaceOptions{}\n\tc.GetWorkingDirectory()\n\tc = nil\n\tc.GetWorkingDirectory()\n}\n\nfunc TestCreateCommitOptions_GetSigner(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateCommitOptions{}\n\tc.GetSigner()\n\tc = nil\n\tc.GetSigner()\n}\n\nfunc TestCreateCustomOrgRoleRequest_GetBaseRole(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateCustomOrgRoleRequest{BaseRole: &zeroValue}\n\tc.GetBaseRole()\n\tc = &CreateCustomOrgRoleRequest{}\n\tc.GetBaseRole()\n\tc = nil\n\tc.GetBaseRole()\n}\n\nfunc TestCreateCustomOrgRoleRequest_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateCustomOrgRoleRequest{Description: &zeroValue}\n\tc.GetDescription()\n\tc = &CreateCustomOrgRoleRequest{}\n\tc.GetDescription()\n\tc = nil\n\tc.GetDescription()\n}\n\nfunc TestCreateCustomOrgRoleRequest_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateCustomOrgRoleRequest{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCreateCustomOrgRoleRequest_GetPermissions(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tc := &CreateCustomOrgRoleRequest{Permissions: zeroValue}\n\tc.GetPermissions()\n\tc = &CreateCustomOrgRoleRequest{}\n\tc.GetPermissions()\n\tc = nil\n\tc.GetPermissions()\n}\n\nfunc TestCreateEnterpriseRunnerGroupRequest_GetAllowsPublicRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &CreateEnterpriseRunnerGroupRequest{AllowsPublicRepositories: &zeroValue}\n\tc.GetAllowsPublicRepositories()\n\tc = &CreateEnterpriseRunnerGroupRequest{}\n\tc.GetAllowsPublicRepositories()\n\tc = nil\n\tc.GetAllowsPublicRepositories()\n}\n\nfunc TestCreateEnterpriseRunnerGroupRequest_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateEnterpriseRunnerGroupRequest{Name: &zeroValue}\n\tc.GetName()\n\tc = &CreateEnterpriseRunnerGroupRequest{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCreateEnterpriseRunnerGroupRequest_GetNetworkConfigurationID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateEnterpriseRunnerGroupRequest{NetworkConfigurationID: &zeroValue}\n\tc.GetNetworkConfigurationID()\n\tc = &CreateEnterpriseRunnerGroupRequest{}\n\tc.GetNetworkConfigurationID()\n\tc = nil\n\tc.GetNetworkConfigurationID()\n}\n\nfunc TestCreateEnterpriseRunnerGroupRequest_GetRestrictedToWorkflows(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &CreateEnterpriseRunnerGroupRequest{RestrictedToWorkflows: &zeroValue}\n\tc.GetRestrictedToWorkflows()\n\tc = &CreateEnterpriseRunnerGroupRequest{}\n\tc.GetRestrictedToWorkflows()\n\tc = nil\n\tc.GetRestrictedToWorkflows()\n}\n\nfunc TestCreateEnterpriseRunnerGroupRequest_GetRunners(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []int64{}\n\tc := &CreateEnterpriseRunnerGroupRequest{Runners: zeroValue}\n\tc.GetRunners()\n\tc = &CreateEnterpriseRunnerGroupRequest{}\n\tc.GetRunners()\n\tc = nil\n\tc.GetRunners()\n}\n\nfunc TestCreateEnterpriseRunnerGroupRequest_GetSelectedOrganizationIDs(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []int64{}\n\tc := &CreateEnterpriseRunnerGroupRequest{SelectedOrganizationIDs: zeroValue}\n\tc.GetSelectedOrganizationIDs()\n\tc = &CreateEnterpriseRunnerGroupRequest{}\n\tc.GetSelectedOrganizationIDs()\n\tc = nil\n\tc.GetSelectedOrganizationIDs()\n}\n\nfunc TestCreateEnterpriseRunnerGroupRequest_GetSelectedWorkflows(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tc := &CreateEnterpriseRunnerGroupRequest{SelectedWorkflows: zeroValue}\n\tc.GetSelectedWorkflows()\n\tc = &CreateEnterpriseRunnerGroupRequest{}\n\tc.GetSelectedWorkflows()\n\tc = nil\n\tc.GetSelectedWorkflows()\n}\n\nfunc TestCreateEnterpriseRunnerGroupRequest_GetVisibility(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateEnterpriseRunnerGroupRequest{Visibility: &zeroValue}\n\tc.GetVisibility()\n\tc = &CreateEnterpriseRunnerGroupRequest{}\n\tc.GetVisibility()\n\tc = nil\n\tc.GetVisibility()\n}\n\nfunc TestCreateEvent_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateEvent{Description: &zeroValue}\n\tc.GetDescription()\n\tc = &CreateEvent{}\n\tc.GetDescription()\n\tc = nil\n\tc.GetDescription()\n}\n\nfunc TestCreateEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateEvent{}\n\tc.GetInstallation()\n\tc = nil\n\tc.GetInstallation()\n}\n\nfunc TestCreateEvent_GetMasterBranch(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateEvent{MasterBranch: &zeroValue}\n\tc.GetMasterBranch()\n\tc = &CreateEvent{}\n\tc.GetMasterBranch()\n\tc = nil\n\tc.GetMasterBranch()\n}\n\nfunc TestCreateEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateEvent{}\n\tc.GetOrg()\n\tc = nil\n\tc.GetOrg()\n}\n\nfunc TestCreateEvent_GetPusherType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateEvent{PusherType: &zeroValue}\n\tc.GetPusherType()\n\tc = &CreateEvent{}\n\tc.GetPusherType()\n\tc = nil\n\tc.GetPusherType()\n}\n\nfunc TestCreateEvent_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateEvent{Ref: &zeroValue}\n\tc.GetRef()\n\tc = &CreateEvent{}\n\tc.GetRef()\n\tc = nil\n\tc.GetRef()\n}\n\nfunc TestCreateEvent_GetRefType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateEvent{RefType: &zeroValue}\n\tc.GetRefType()\n\tc = &CreateEvent{}\n\tc.GetRefType()\n\tc = nil\n\tc.GetRefType()\n}\n\nfunc TestCreateEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateEvent{}\n\tc.GetRepo()\n\tc = nil\n\tc.GetRepo()\n}\n\nfunc TestCreateEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateEvent{}\n\tc.GetSender()\n\tc = nil\n\tc.GetSender()\n}\n\nfunc TestCreateHostedRunnerRequest_GetEnableStaticIP(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &CreateHostedRunnerRequest{EnableStaticIP: &zeroValue}\n\tc.GetEnableStaticIP()\n\tc = &CreateHostedRunnerRequest{}\n\tc.GetEnableStaticIP()\n\tc = nil\n\tc.GetEnableStaticIP()\n}\n\nfunc TestCreateHostedRunnerRequest_GetImage(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateHostedRunnerRequest{}\n\tc.GetImage()\n\tc = nil\n\tc.GetImage()\n}\n\nfunc TestCreateHostedRunnerRequest_GetImageGen(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &CreateHostedRunnerRequest{ImageGen: &zeroValue}\n\tc.GetImageGen()\n\tc = &CreateHostedRunnerRequest{}\n\tc.GetImageGen()\n\tc = nil\n\tc.GetImageGen()\n}\n\nfunc TestCreateHostedRunnerRequest_GetMaximumRunners(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tc := &CreateHostedRunnerRequest{MaximumRunners: &zeroValue}\n\tc.GetMaximumRunners()\n\tc = &CreateHostedRunnerRequest{}\n\tc.GetMaximumRunners()\n\tc = nil\n\tc.GetMaximumRunners()\n}\n\nfunc TestCreateHostedRunnerRequest_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateHostedRunnerRequest{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCreateHostedRunnerRequest_GetRunnerGroupID(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateHostedRunnerRequest{}\n\tc.GetRunnerGroupID()\n\tc = nil\n\tc.GetRunnerGroupID()\n}\n\nfunc TestCreateHostedRunnerRequest_GetSize(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateHostedRunnerRequest{}\n\tc.GetSize()\n\tc = nil\n\tc.GetSize()\n}\n\nfunc TestCreateOrganizationPrivateRegistry_GetEncryptedValue(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateOrganizationPrivateRegistry{}\n\tc.GetEncryptedValue()\n\tc = nil\n\tc.GetEncryptedValue()\n}\n\nfunc TestCreateOrganizationPrivateRegistry_GetKeyID(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateOrganizationPrivateRegistry{}\n\tc.GetKeyID()\n\tc = nil\n\tc.GetKeyID()\n}\n\nfunc TestCreateOrganizationPrivateRegistry_GetRegistryType(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateOrganizationPrivateRegistry{}\n\tc.GetRegistryType()\n\tc = nil\n\tc.GetRegistryType()\n}\n\nfunc TestCreateOrganizationPrivateRegistry_GetSelectedRepositoryIDs(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []int64{}\n\tc := &CreateOrganizationPrivateRegistry{SelectedRepositoryIDs: zeroValue}\n\tc.GetSelectedRepositoryIDs()\n\tc = &CreateOrganizationPrivateRegistry{}\n\tc.GetSelectedRepositoryIDs()\n\tc = nil\n\tc.GetSelectedRepositoryIDs()\n}\n\nfunc TestCreateOrganizationPrivateRegistry_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateOrganizationPrivateRegistry{}\n\tc.GetURL()\n\tc = nil\n\tc.GetURL()\n}\n\nfunc TestCreateOrganizationPrivateRegistry_GetUsername(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateOrganizationPrivateRegistry{Username: &zeroValue}\n\tc.GetUsername()\n\tc = &CreateOrganizationPrivateRegistry{}\n\tc.GetUsername()\n\tc = nil\n\tc.GetUsername()\n}\n\nfunc TestCreateOrganizationPrivateRegistry_GetVisibility(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateOrganizationPrivateRegistry{}\n\tc.GetVisibility()\n\tc = nil\n\tc.GetVisibility()\n}\n\nfunc TestCreateOrgInvitationOptions_GetEmail(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateOrgInvitationOptions{Email: &zeroValue}\n\tc.GetEmail()\n\tc = &CreateOrgInvitationOptions{}\n\tc.GetEmail()\n\tc = nil\n\tc.GetEmail()\n}\n\nfunc TestCreateOrgInvitationOptions_GetInviteeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tc := &CreateOrgInvitationOptions{InviteeID: &zeroValue}\n\tc.GetInviteeID()\n\tc = &CreateOrgInvitationOptions{}\n\tc.GetInviteeID()\n\tc = nil\n\tc.GetInviteeID()\n}\n\nfunc TestCreateOrgInvitationOptions_GetRole(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateOrgInvitationOptions{Role: &zeroValue}\n\tc.GetRole()\n\tc = &CreateOrgInvitationOptions{}\n\tc.GetRole()\n\tc = nil\n\tc.GetRole()\n}\n\nfunc TestCreateOrgInvitationOptions_GetTeamID(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []int64{}\n\tc := &CreateOrgInvitationOptions{TeamID: zeroValue}\n\tc.GetTeamID()\n\tc = &CreateOrgInvitationOptions{}\n\tc.GetTeamID()\n\tc = nil\n\tc.GetTeamID()\n}\n\nfunc TestCreateOrUpdateCustomRepoRoleOptions_GetBaseRole(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateOrUpdateCustomRepoRoleOptions{BaseRole: &zeroValue}\n\tc.GetBaseRole()\n\tc = &CreateOrUpdateCustomRepoRoleOptions{}\n\tc.GetBaseRole()\n\tc = nil\n\tc.GetBaseRole()\n}\n\nfunc TestCreateOrUpdateCustomRepoRoleOptions_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateOrUpdateCustomRepoRoleOptions{Description: &zeroValue}\n\tc.GetDescription()\n\tc = &CreateOrUpdateCustomRepoRoleOptions{}\n\tc.GetDescription()\n\tc = nil\n\tc.GetDescription()\n}\n\nfunc TestCreateOrUpdateCustomRepoRoleOptions_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateOrUpdateCustomRepoRoleOptions{Name: &zeroValue}\n\tc.GetName()\n\tc = &CreateOrUpdateCustomRepoRoleOptions{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCreateOrUpdateCustomRepoRoleOptions_GetPermissions(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tc := &CreateOrUpdateCustomRepoRoleOptions{Permissions: zeroValue}\n\tc.GetPermissions()\n\tc = &CreateOrUpdateCustomRepoRoleOptions{}\n\tc.GetPermissions()\n\tc = nil\n\tc.GetPermissions()\n}\n\nfunc TestCreateOrUpdateIssueTypesOptions_GetColor(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateOrUpdateIssueTypesOptions{Color: &zeroValue}\n\tc.GetColor()\n\tc = &CreateOrUpdateIssueTypesOptions{}\n\tc.GetColor()\n\tc = nil\n\tc.GetColor()\n}\n\nfunc TestCreateOrUpdateIssueTypesOptions_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateOrUpdateIssueTypesOptions{Description: &zeroValue}\n\tc.GetDescription()\n\tc = &CreateOrUpdateIssueTypesOptions{}\n\tc.GetDescription()\n\tc = nil\n\tc.GetDescription()\n}\n\nfunc TestCreateOrUpdateIssueTypesOptions_GetIsEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateOrUpdateIssueTypesOptions{}\n\tc.GetIsEnabled()\n\tc = nil\n\tc.GetIsEnabled()\n}\n\nfunc TestCreateOrUpdateIssueTypesOptions_GetIsPrivate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &CreateOrUpdateIssueTypesOptions{IsPrivate: &zeroValue}\n\tc.GetIsPrivate()\n\tc = &CreateOrUpdateIssueTypesOptions{}\n\tc.GetIsPrivate()\n\tc = nil\n\tc.GetIsPrivate()\n}\n\nfunc TestCreateOrUpdateIssueTypesOptions_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateOrUpdateIssueTypesOptions{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCreateProtectedChanges_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &CreateProtectedChanges{From: &zeroValue}\n\tc.GetFrom()\n\tc = &CreateProtectedChanges{}\n\tc.GetFrom()\n\tc = nil\n\tc.GetFrom()\n}\n\nfunc TestCreateRef_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateRef{}\n\tc.GetRef()\n\tc = nil\n\tc.GetRef()\n}\n\nfunc TestCreateRef_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateRef{}\n\tc.GetSHA()\n\tc = nil\n\tc.GetSHA()\n}\n\nfunc TestCreateRunnerGroupRequest_GetAllowsPublicRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &CreateRunnerGroupRequest{AllowsPublicRepositories: &zeroValue}\n\tc.GetAllowsPublicRepositories()\n\tc = &CreateRunnerGroupRequest{}\n\tc.GetAllowsPublicRepositories()\n\tc = nil\n\tc.GetAllowsPublicRepositories()\n}\n\nfunc TestCreateRunnerGroupRequest_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateRunnerGroupRequest{Name: &zeroValue}\n\tc.GetName()\n\tc = &CreateRunnerGroupRequest{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCreateRunnerGroupRequest_GetNetworkConfigurationID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateRunnerGroupRequest{NetworkConfigurationID: &zeroValue}\n\tc.GetNetworkConfigurationID()\n\tc = &CreateRunnerGroupRequest{}\n\tc.GetNetworkConfigurationID()\n\tc = nil\n\tc.GetNetworkConfigurationID()\n}\n\nfunc TestCreateRunnerGroupRequest_GetRestrictedToWorkflows(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &CreateRunnerGroupRequest{RestrictedToWorkflows: &zeroValue}\n\tc.GetRestrictedToWorkflows()\n\tc = &CreateRunnerGroupRequest{}\n\tc.GetRestrictedToWorkflows()\n\tc = nil\n\tc.GetRestrictedToWorkflows()\n}\n\nfunc TestCreateRunnerGroupRequest_GetRunners(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []int64{}\n\tc := &CreateRunnerGroupRequest{Runners: zeroValue}\n\tc.GetRunners()\n\tc = &CreateRunnerGroupRequest{}\n\tc.GetRunners()\n\tc = nil\n\tc.GetRunners()\n}\n\nfunc TestCreateRunnerGroupRequest_GetSelectedRepositoryIDs(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []int64{}\n\tc := &CreateRunnerGroupRequest{SelectedRepositoryIDs: zeroValue}\n\tc.GetSelectedRepositoryIDs()\n\tc = &CreateRunnerGroupRequest{}\n\tc.GetSelectedRepositoryIDs()\n\tc = nil\n\tc.GetSelectedRepositoryIDs()\n}\n\nfunc TestCreateRunnerGroupRequest_GetSelectedWorkflows(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tc := &CreateRunnerGroupRequest{SelectedWorkflows: zeroValue}\n\tc.GetSelectedWorkflows()\n\tc = &CreateRunnerGroupRequest{}\n\tc.GetSelectedWorkflows()\n\tc = nil\n\tc.GetSelectedWorkflows()\n}\n\nfunc TestCreateRunnerGroupRequest_GetVisibility(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateRunnerGroupRequest{Visibility: &zeroValue}\n\tc.GetVisibility()\n\tc = &CreateRunnerGroupRequest{}\n\tc.GetVisibility()\n\tc = nil\n\tc.GetVisibility()\n}\n\nfunc TestCreateTag_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateTag{}\n\tc.GetMessage()\n\tc = nil\n\tc.GetMessage()\n}\n\nfunc TestCreateTag_GetObject(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateTag{}\n\tc.GetObject()\n\tc = nil\n\tc.GetObject()\n}\n\nfunc TestCreateTag_GetTag(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateTag{}\n\tc.GetTag()\n\tc = nil\n\tc.GetTag()\n}\n\nfunc TestCreateTag_GetTagger(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateTag{}\n\tc.GetTagger()\n\tc = nil\n\tc.GetTagger()\n}\n\nfunc TestCreateTag_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateTag{}\n\tc.GetType()\n\tc = nil\n\tc.GetType()\n}\n\nfunc TestCreateUpdateEnvironment_GetCanAdminsBypass(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &CreateUpdateEnvironment{CanAdminsBypass: &zeroValue}\n\tc.GetCanAdminsBypass()\n\tc = &CreateUpdateEnvironment{}\n\tc.GetCanAdminsBypass()\n\tc = nil\n\tc.GetCanAdminsBypass()\n}\n\nfunc TestCreateUpdateEnvironment_GetDeploymentBranchPolicy(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateUpdateEnvironment{}\n\tc.GetDeploymentBranchPolicy()\n\tc = nil\n\tc.GetDeploymentBranchPolicy()\n}\n\nfunc TestCreateUpdateEnvironment_GetPreventSelfReview(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &CreateUpdateEnvironment{PreventSelfReview: &zeroValue}\n\tc.GetPreventSelfReview()\n\tc = &CreateUpdateEnvironment{}\n\tc.GetPreventSelfReview()\n\tc = nil\n\tc.GetPreventSelfReview()\n}\n\nfunc TestCreateUpdateEnvironment_GetReviewers(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*EnvReviewers{}\n\tc := &CreateUpdateEnvironment{Reviewers: zeroValue}\n\tc.GetReviewers()\n\tc = &CreateUpdateEnvironment{}\n\tc.GetReviewers()\n\tc = nil\n\tc.GetReviewers()\n}\n\nfunc TestCreateUpdateEnvironment_GetWaitTimer(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tc := &CreateUpdateEnvironment{WaitTimer: &zeroValue}\n\tc.GetWaitTimer()\n\tc = &CreateUpdateEnvironment{}\n\tc.GetWaitTimer()\n\tc = nil\n\tc.GetWaitTimer()\n}\n\nfunc TestCreateUserRequest_GetEmail(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CreateUserRequest{Email: &zeroValue}\n\tc.GetEmail()\n\tc = &CreateUserRequest{}\n\tc.GetEmail()\n\tc = nil\n\tc.GetEmail()\n}\n\nfunc TestCreateUserRequest_GetLogin(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateUserRequest{}\n\tc.GetLogin()\n\tc = nil\n\tc.GetLogin()\n}\n\nfunc TestCreateUserRequest_GetSuspended(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &CreateUserRequest{Suspended: &zeroValue}\n\tc.GetSuspended()\n\tc = &CreateUserRequest{}\n\tc.GetSuspended()\n\tc = nil\n\tc.GetSuspended()\n}\n\nfunc TestCreateWorkflowDispatchEventRequest_GetInputs(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]any{}\n\tc := &CreateWorkflowDispatchEventRequest{Inputs: zeroValue}\n\tc.GetInputs()\n\tc = &CreateWorkflowDispatchEventRequest{}\n\tc.GetInputs()\n\tc = nil\n\tc.GetInputs()\n}\n\nfunc TestCreateWorkflowDispatchEventRequest_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CreateWorkflowDispatchEventRequest{}\n\tc.GetRef()\n\tc = nil\n\tc.GetRef()\n}\n\nfunc TestCreateWorkflowDispatchEventRequest_GetReturnRunDetails(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &CreateWorkflowDispatchEventRequest{ReturnRunDetails: &zeroValue}\n\tc.GetReturnRunDetails()\n\tc = &CreateWorkflowDispatchEventRequest{}\n\tc.GetReturnRunDetails()\n\tc = nil\n\tc.GetReturnRunDetails()\n}\n\nfunc TestCreationInfo_GetCreated(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &CreationInfo{Created: &zeroValue}\n\tc.GetCreated()\n\tc = &CreationInfo{}\n\tc.GetCreated()\n\tc = nil\n\tc.GetCreated()\n}\n\nfunc TestCreationInfo_GetCreators(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tc := &CreationInfo{Creators: zeroValue}\n\tc.GetCreators()\n\tc = &CreationInfo{}\n\tc.GetCreators()\n\tc = nil\n\tc.GetCreators()\n}\n\nfunc TestCredentialAuthorization_GetAuthorizedCredentialExpiresAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &CredentialAuthorization{AuthorizedCredentialExpiresAt: &zeroValue}\n\tc.GetAuthorizedCredentialExpiresAt()\n\tc = &CredentialAuthorization{}\n\tc.GetAuthorizedCredentialExpiresAt()\n\tc = nil\n\tc.GetAuthorizedCredentialExpiresAt()\n}\n\nfunc TestCredentialAuthorization_GetAuthorizedCredentialID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tc := &CredentialAuthorization{AuthorizedCredentialID: &zeroValue}\n\tc.GetAuthorizedCredentialID()\n\tc = &CredentialAuthorization{}\n\tc.GetAuthorizedCredentialID()\n\tc = nil\n\tc.GetAuthorizedCredentialID()\n}\n\nfunc TestCredentialAuthorization_GetAuthorizedCredentialNote(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CredentialAuthorization{AuthorizedCredentialNote: &zeroValue}\n\tc.GetAuthorizedCredentialNote()\n\tc = &CredentialAuthorization{}\n\tc.GetAuthorizedCredentialNote()\n\tc = nil\n\tc.GetAuthorizedCredentialNote()\n}\n\nfunc TestCredentialAuthorization_GetAuthorizedCredentialTitle(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CredentialAuthorization{AuthorizedCredentialTitle: &zeroValue}\n\tc.GetAuthorizedCredentialTitle()\n\tc = &CredentialAuthorization{}\n\tc.GetAuthorizedCredentialTitle()\n\tc = nil\n\tc.GetAuthorizedCredentialTitle()\n}\n\nfunc TestCredentialAuthorization_GetCredentialAccessedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &CredentialAuthorization{CredentialAccessedAt: &zeroValue}\n\tc.GetCredentialAccessedAt()\n\tc = &CredentialAuthorization{}\n\tc.GetCredentialAccessedAt()\n\tc = nil\n\tc.GetCredentialAccessedAt()\n}\n\nfunc TestCredentialAuthorization_GetCredentialAuthorizedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &CredentialAuthorization{CredentialAuthorizedAt: &zeroValue}\n\tc.GetCredentialAuthorizedAt()\n\tc = &CredentialAuthorization{}\n\tc.GetCredentialAuthorizedAt()\n\tc = nil\n\tc.GetCredentialAuthorizedAt()\n}\n\nfunc TestCredentialAuthorization_GetCredentialID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tc := &CredentialAuthorization{CredentialID: &zeroValue}\n\tc.GetCredentialID()\n\tc = &CredentialAuthorization{}\n\tc.GetCredentialID()\n\tc = nil\n\tc.GetCredentialID()\n}\n\nfunc TestCredentialAuthorization_GetCredentialType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CredentialAuthorization{CredentialType: &zeroValue}\n\tc.GetCredentialType()\n\tc = &CredentialAuthorization{}\n\tc.GetCredentialType()\n\tc = nil\n\tc.GetCredentialType()\n}\n\nfunc TestCredentialAuthorization_GetFingerprint(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CredentialAuthorization{Fingerprint: &zeroValue}\n\tc.GetFingerprint()\n\tc = &CredentialAuthorization{}\n\tc.GetFingerprint()\n\tc = nil\n\tc.GetFingerprint()\n}\n\nfunc TestCredentialAuthorization_GetLogin(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CredentialAuthorization{Login: &zeroValue}\n\tc.GetLogin()\n\tc = &CredentialAuthorization{}\n\tc.GetLogin()\n\tc = nil\n\tc.GetLogin()\n}\n\nfunc TestCredentialAuthorization_GetScopes(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tc := &CredentialAuthorization{Scopes: zeroValue}\n\tc.GetScopes()\n\tc = &CredentialAuthorization{}\n\tc.GetScopes()\n\tc = nil\n\tc.GetScopes()\n}\n\nfunc TestCredentialAuthorization_GetTokenLastEight(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CredentialAuthorization{TokenLastEight: &zeroValue}\n\tc.GetTokenLastEight()\n\tc = &CredentialAuthorization{}\n\tc.GetTokenLastEight()\n\tc = nil\n\tc.GetTokenLastEight()\n}\n\nfunc TestCredentialAuthorizationsListOptions_GetLogin(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CredentialAuthorizationsListOptions{}\n\tc.GetLogin()\n\tc = nil\n\tc.GetLogin()\n}\n\nfunc TestCredit_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &Credit{Type: &zeroValue}\n\tc.GetType()\n\tc = &Credit{}\n\tc.GetType()\n\tc = nil\n\tc.GetType()\n}\n\nfunc TestCredit_GetUser(tt *testing.T) {\n\ttt.Parallel()\n\tc := &Credit{}\n\tc.GetUser()\n\tc = nil\n\tc.GetUser()\n}\n\nfunc TestCustomDeploymentProtectionRule_GetApp(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CustomDeploymentProtectionRule{}\n\tc.GetApp()\n\tc = nil\n\tc.GetApp()\n}\n\nfunc TestCustomDeploymentProtectionRule_GetEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &CustomDeploymentProtectionRule{Enabled: &zeroValue}\n\tc.GetEnabled()\n\tc = &CustomDeploymentProtectionRule{}\n\tc.GetEnabled()\n\tc = nil\n\tc.GetEnabled()\n}\n\nfunc TestCustomDeploymentProtectionRule_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tc := &CustomDeploymentProtectionRule{ID: &zeroValue}\n\tc.GetID()\n\tc = &CustomDeploymentProtectionRule{}\n\tc.GetID()\n\tc = nil\n\tc.GetID()\n}\n\nfunc TestCustomDeploymentProtectionRule_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CustomDeploymentProtectionRule{NodeID: &zeroValue}\n\tc.GetNodeID()\n\tc = &CustomDeploymentProtectionRule{}\n\tc.GetNodeID()\n\tc = nil\n\tc.GetNodeID()\n}\n\nfunc TestCustomDeploymentProtectionRuleApp_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tc := &CustomDeploymentProtectionRuleApp{ID: &zeroValue}\n\tc.GetID()\n\tc = &CustomDeploymentProtectionRuleApp{}\n\tc.GetID()\n\tc = nil\n\tc.GetID()\n}\n\nfunc TestCustomDeploymentProtectionRuleApp_GetIntegrationURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CustomDeploymentProtectionRuleApp{IntegrationURL: &zeroValue}\n\tc.GetIntegrationURL()\n\tc = &CustomDeploymentProtectionRuleApp{}\n\tc.GetIntegrationURL()\n\tc = nil\n\tc.GetIntegrationURL()\n}\n\nfunc TestCustomDeploymentProtectionRuleApp_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CustomDeploymentProtectionRuleApp{NodeID: &zeroValue}\n\tc.GetNodeID()\n\tc = &CustomDeploymentProtectionRuleApp{}\n\tc.GetNodeID()\n\tc = nil\n\tc.GetNodeID()\n}\n\nfunc TestCustomDeploymentProtectionRuleApp_GetSlug(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CustomDeploymentProtectionRuleApp{Slug: &zeroValue}\n\tc.GetSlug()\n\tc = &CustomDeploymentProtectionRuleApp{}\n\tc.GetSlug()\n\tc = nil\n\tc.GetSlug()\n}\n\nfunc TestCustomDeploymentProtectionRuleRequest_GetIntegrationID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tc := &CustomDeploymentProtectionRuleRequest{IntegrationID: &zeroValue}\n\tc.GetIntegrationID()\n\tc = &CustomDeploymentProtectionRuleRequest{}\n\tc.GetIntegrationID()\n\tc = nil\n\tc.GetIntegrationID()\n}\n\nfunc TestCustomOrgRole_GetBaseRole(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CustomOrgRole{BaseRole: &zeroValue}\n\tc.GetBaseRole()\n\tc = &CustomOrgRole{}\n\tc.GetBaseRole()\n\tc = nil\n\tc.GetBaseRole()\n}\n\nfunc TestCustomOrgRole_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &CustomOrgRole{CreatedAt: &zeroValue}\n\tc.GetCreatedAt()\n\tc = &CustomOrgRole{}\n\tc.GetCreatedAt()\n\tc = nil\n\tc.GetCreatedAt()\n}\n\nfunc TestCustomOrgRole_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CustomOrgRole{Description: &zeroValue}\n\tc.GetDescription()\n\tc = &CustomOrgRole{}\n\tc.GetDescription()\n\tc = nil\n\tc.GetDescription()\n}\n\nfunc TestCustomOrgRole_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tc := &CustomOrgRole{ID: &zeroValue}\n\tc.GetID()\n\tc = &CustomOrgRole{}\n\tc.GetID()\n\tc = nil\n\tc.GetID()\n}\n\nfunc TestCustomOrgRole_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CustomOrgRole{Name: &zeroValue}\n\tc.GetName()\n\tc = &CustomOrgRole{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCustomOrgRole_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CustomOrgRole{}\n\tc.GetOrg()\n\tc = nil\n\tc.GetOrg()\n}\n\nfunc TestCustomOrgRole_GetPermissions(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tc := &CustomOrgRole{Permissions: zeroValue}\n\tc.GetPermissions()\n\tc = &CustomOrgRole{}\n\tc.GetPermissions()\n\tc = nil\n\tc.GetPermissions()\n}\n\nfunc TestCustomOrgRole_GetSource(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CustomOrgRole{Source: &zeroValue}\n\tc.GetSource()\n\tc = &CustomOrgRole{}\n\tc.GetSource()\n\tc = nil\n\tc.GetSource()\n}\n\nfunc TestCustomOrgRole_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &CustomOrgRole{UpdatedAt: &zeroValue}\n\tc.GetUpdatedAt()\n\tc = &CustomOrgRole{}\n\tc.GetUpdatedAt()\n\tc = nil\n\tc.GetUpdatedAt()\n}\n\nfunc TestCustomPatternBackfillScan_GetPatternScope(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CustomPatternBackfillScan{PatternScope: &zeroValue}\n\tc.GetPatternScope()\n\tc = &CustomPatternBackfillScan{}\n\tc.GetPatternScope()\n\tc = nil\n\tc.GetPatternScope()\n}\n\nfunc TestCustomPatternBackfillScan_GetPatternSlug(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CustomPatternBackfillScan{PatternSlug: &zeroValue}\n\tc.GetPatternSlug()\n\tc = &CustomPatternBackfillScan{}\n\tc.GetPatternSlug()\n\tc = nil\n\tc.GetPatternSlug()\n}\n\nfunc TestCustomProperty_GetAllowedValues(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tc := &CustomProperty{AllowedValues: zeroValue}\n\tc.GetAllowedValues()\n\tc = &CustomProperty{}\n\tc.GetAllowedValues()\n\tc = nil\n\tc.GetAllowedValues()\n}\n\nfunc TestCustomProperty_GetDefaultValue(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CustomProperty{}\n\tc.GetDefaultValue()\n\tc = nil\n\tc.GetDefaultValue()\n}\n\nfunc TestCustomProperty_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CustomProperty{Description: &zeroValue}\n\tc.GetDescription()\n\tc = &CustomProperty{}\n\tc.GetDescription()\n\tc = nil\n\tc.GetDescription()\n}\n\nfunc TestCustomProperty_GetPropertyName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CustomProperty{PropertyName: &zeroValue}\n\tc.GetPropertyName()\n\tc = &CustomProperty{}\n\tc.GetPropertyName()\n\tc = nil\n\tc.GetPropertyName()\n}\n\nfunc TestCustomProperty_GetRequired(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tc := &CustomProperty{Required: &zeroValue}\n\tc.GetRequired()\n\tc = &CustomProperty{}\n\tc.GetRequired()\n\tc = nil\n\tc.GetRequired()\n}\n\nfunc TestCustomProperty_GetSourceType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CustomProperty{SourceType: &zeroValue}\n\tc.GetSourceType()\n\tc = &CustomProperty{}\n\tc.GetSourceType()\n\tc = nil\n\tc.GetSourceType()\n}\n\nfunc TestCustomProperty_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CustomProperty{URL: &zeroValue}\n\tc.GetURL()\n\tc = &CustomProperty{}\n\tc.GetURL()\n\tc = nil\n\tc.GetURL()\n}\n\nfunc TestCustomProperty_GetValuesEditableBy(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CustomProperty{ValuesEditableBy: &zeroValue}\n\tc.GetValuesEditableBy()\n\tc = &CustomProperty{}\n\tc.GetValuesEditableBy()\n\tc = nil\n\tc.GetValuesEditableBy()\n}\n\nfunc TestCustomProperty_GetValueType(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CustomProperty{}\n\tc.GetValueType()\n\tc = nil\n\tc.GetValueType()\n}\n\nfunc TestCustomPropertyEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CustomPropertyEvent{Action: &zeroValue}\n\tc.GetAction()\n\tc = &CustomPropertyEvent{}\n\tc.GetAction()\n\tc = nil\n\tc.GetAction()\n}\n\nfunc TestCustomPropertyEvent_GetDefinition(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CustomPropertyEvent{}\n\tc.GetDefinition()\n\tc = nil\n\tc.GetDefinition()\n}\n\nfunc TestCustomPropertyEvent_GetEnterprise(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CustomPropertyEvent{}\n\tc.GetEnterprise()\n\tc = nil\n\tc.GetEnterprise()\n}\n\nfunc TestCustomPropertyEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CustomPropertyEvent{}\n\tc.GetInstallation()\n\tc = nil\n\tc.GetInstallation()\n}\n\nfunc TestCustomPropertyEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CustomPropertyEvent{}\n\tc.GetOrg()\n\tc = nil\n\tc.GetOrg()\n}\n\nfunc TestCustomPropertyEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CustomPropertyEvent{}\n\tc.GetSender()\n\tc = nil\n\tc.GetSender()\n}\n\nfunc TestCustomPropertyValue_GetPropertyName(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CustomPropertyValue{}\n\tc.GetPropertyName()\n\tc = nil\n\tc.GetPropertyName()\n}\n\nfunc TestCustomPropertyValue_GetValue(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CustomPropertyValue{}\n\tc.GetValue()\n\tc = nil\n\tc.GetValue()\n}\n\nfunc TestCustomPropertyValuesEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CustomPropertyValuesEvent{Action: &zeroValue}\n\tc.GetAction()\n\tc = &CustomPropertyValuesEvent{}\n\tc.GetAction()\n\tc = nil\n\tc.GetAction()\n}\n\nfunc TestCustomPropertyValuesEvent_GetEnterprise(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CustomPropertyValuesEvent{}\n\tc.GetEnterprise()\n\tc = nil\n\tc.GetEnterprise()\n}\n\nfunc TestCustomPropertyValuesEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CustomPropertyValuesEvent{}\n\tc.GetInstallation()\n\tc = nil\n\tc.GetInstallation()\n}\n\nfunc TestCustomPropertyValuesEvent_GetNewPropertyValues(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CustomPropertyValue{}\n\tc := &CustomPropertyValuesEvent{NewPropertyValues: zeroValue}\n\tc.GetNewPropertyValues()\n\tc = &CustomPropertyValuesEvent{}\n\tc.GetNewPropertyValues()\n\tc = nil\n\tc.GetNewPropertyValues()\n}\n\nfunc TestCustomPropertyValuesEvent_GetOldPropertyValues(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CustomPropertyValue{}\n\tc := &CustomPropertyValuesEvent{OldPropertyValues: zeroValue}\n\tc.GetOldPropertyValues()\n\tc = &CustomPropertyValuesEvent{}\n\tc.GetOldPropertyValues()\n\tc = nil\n\tc.GetOldPropertyValues()\n}\n\nfunc TestCustomPropertyValuesEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CustomPropertyValuesEvent{}\n\tc.GetOrg()\n\tc = nil\n\tc.GetOrg()\n}\n\nfunc TestCustomPropertyValuesEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CustomPropertyValuesEvent{}\n\tc.GetRepo()\n\tc = nil\n\tc.GetRepo()\n}\n\nfunc TestCustomPropertyValuesEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CustomPropertyValuesEvent{}\n\tc.GetSender()\n\tc = nil\n\tc.GetSender()\n}\n\nfunc TestCustomRepoRoles_GetBaseRole(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CustomRepoRoles{BaseRole: &zeroValue}\n\tc.GetBaseRole()\n\tc = &CustomRepoRoles{}\n\tc.GetBaseRole()\n\tc = nil\n\tc.GetBaseRole()\n}\n\nfunc TestCustomRepoRoles_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &CustomRepoRoles{CreatedAt: &zeroValue}\n\tc.GetCreatedAt()\n\tc = &CustomRepoRoles{}\n\tc.GetCreatedAt()\n\tc = nil\n\tc.GetCreatedAt()\n}\n\nfunc TestCustomRepoRoles_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CustomRepoRoles{Description: &zeroValue}\n\tc.GetDescription()\n\tc = &CustomRepoRoles{}\n\tc.GetDescription()\n\tc = nil\n\tc.GetDescription()\n}\n\nfunc TestCustomRepoRoles_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tc := &CustomRepoRoles{ID: &zeroValue}\n\tc.GetID()\n\tc = &CustomRepoRoles{}\n\tc.GetID()\n\tc = nil\n\tc.GetID()\n}\n\nfunc TestCustomRepoRoles_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tc := &CustomRepoRoles{Name: &zeroValue}\n\tc.GetName()\n\tc = &CustomRepoRoles{}\n\tc.GetName()\n\tc = nil\n\tc.GetName()\n}\n\nfunc TestCustomRepoRoles_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tc := &CustomRepoRoles{}\n\tc.GetOrg()\n\tc = nil\n\tc.GetOrg()\n}\n\nfunc TestCustomRepoRoles_GetPermissions(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tc := &CustomRepoRoles{Permissions: zeroValue}\n\tc.GetPermissions()\n\tc = &CustomRepoRoles{}\n\tc.GetPermissions()\n\tc = nil\n\tc.GetPermissions()\n}\n\nfunc TestCustomRepoRoles_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tc := &CustomRepoRoles{UpdatedAt: &zeroValue}\n\tc.GetUpdatedAt()\n\tc = &CustomRepoRoles{}\n\tc.GetUpdatedAt()\n\tc = nil\n\tc.GetUpdatedAt()\n}\n\nfunc TestDatadogConfig_GetEncryptedToken(tt *testing.T) {\n\ttt.Parallel()\n\td := &DatadogConfig{}\n\td.GetEncryptedToken()\n\td = nil\n\td.GetEncryptedToken()\n}\n\nfunc TestDatadogConfig_GetKeyID(tt *testing.T) {\n\ttt.Parallel()\n\td := &DatadogConfig{}\n\td.GetKeyID()\n\td = nil\n\td.GetKeyID()\n}\n\nfunc TestDatadogConfig_GetSite(tt *testing.T) {\n\ttt.Parallel()\n\td := &DatadogConfig{}\n\td.GetSite()\n\td = nil\n\td.GetSite()\n}\n\nfunc TestDefaultSetupConfiguration_GetLanguages(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\td := &DefaultSetupConfiguration{Languages: zeroValue}\n\td.GetLanguages()\n\td = &DefaultSetupConfiguration{}\n\td.GetLanguages()\n\td = nil\n\td.GetLanguages()\n}\n\nfunc TestDefaultSetupConfiguration_GetQuerySuite(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DefaultSetupConfiguration{QuerySuite: &zeroValue}\n\td.GetQuerySuite()\n\td = &DefaultSetupConfiguration{}\n\td.GetQuerySuite()\n\td = nil\n\td.GetQuerySuite()\n}\n\nfunc TestDefaultSetupConfiguration_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DefaultSetupConfiguration{State: &zeroValue}\n\td.GetState()\n\td = &DefaultSetupConfiguration{}\n\td.GetState()\n\td = nil\n\td.GetState()\n}\n\nfunc TestDefaultSetupConfiguration_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\td := &DefaultSetupConfiguration{UpdatedAt: &zeroValue}\n\td.GetUpdatedAt()\n\td = &DefaultSetupConfiguration{}\n\td.GetUpdatedAt()\n\td = nil\n\td.GetUpdatedAt()\n}\n\nfunc TestDefaultWorkflowPermissionEnterprise_GetCanApprovePullRequestReviews(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\td := &DefaultWorkflowPermissionEnterprise{CanApprovePullRequestReviews: &zeroValue}\n\td.GetCanApprovePullRequestReviews()\n\td = &DefaultWorkflowPermissionEnterprise{}\n\td.GetCanApprovePullRequestReviews()\n\td = nil\n\td.GetCanApprovePullRequestReviews()\n}\n\nfunc TestDefaultWorkflowPermissionEnterprise_GetDefaultWorkflowPermissions(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DefaultWorkflowPermissionEnterprise{DefaultWorkflowPermissions: &zeroValue}\n\td.GetDefaultWorkflowPermissions()\n\td = &DefaultWorkflowPermissionEnterprise{}\n\td.GetDefaultWorkflowPermissions()\n\td = nil\n\td.GetDefaultWorkflowPermissions()\n}\n\nfunc TestDefaultWorkflowPermissionOrganization_GetCanApprovePullRequestReviews(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\td := &DefaultWorkflowPermissionOrganization{CanApprovePullRequestReviews: &zeroValue}\n\td.GetCanApprovePullRequestReviews()\n\td = &DefaultWorkflowPermissionOrganization{}\n\td.GetCanApprovePullRequestReviews()\n\td = nil\n\td.GetCanApprovePullRequestReviews()\n}\n\nfunc TestDefaultWorkflowPermissionOrganization_GetDefaultWorkflowPermissions(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DefaultWorkflowPermissionOrganization{DefaultWorkflowPermissions: &zeroValue}\n\td.GetDefaultWorkflowPermissions()\n\td = &DefaultWorkflowPermissionOrganization{}\n\td.GetDefaultWorkflowPermissions()\n\td = nil\n\td.GetDefaultWorkflowPermissions()\n}\n\nfunc TestDefaultWorkflowPermissionRepository_GetCanApprovePullRequestReviews(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\td := &DefaultWorkflowPermissionRepository{CanApprovePullRequestReviews: &zeroValue}\n\td.GetCanApprovePullRequestReviews()\n\td = &DefaultWorkflowPermissionRepository{}\n\td.GetCanApprovePullRequestReviews()\n\td = nil\n\td.GetCanApprovePullRequestReviews()\n}\n\nfunc TestDefaultWorkflowPermissionRepository_GetDefaultWorkflowPermissions(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DefaultWorkflowPermissionRepository{DefaultWorkflowPermissions: &zeroValue}\n\td.GetDefaultWorkflowPermissions()\n\td = &DefaultWorkflowPermissionRepository{}\n\td.GetDefaultWorkflowPermissions()\n\td = nil\n\td.GetDefaultWorkflowPermissions()\n}\n\nfunc TestDeleteAnalysis_GetConfirmDeleteURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeleteAnalysis{ConfirmDeleteURL: &zeroValue}\n\td.GetConfirmDeleteURL()\n\td = &DeleteAnalysis{}\n\td.GetConfirmDeleteURL()\n\td = nil\n\td.GetConfirmDeleteURL()\n}\n\nfunc TestDeleteAnalysis_GetNextAnalysisURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeleteAnalysis{NextAnalysisURL: &zeroValue}\n\td.GetNextAnalysisURL()\n\td = &DeleteAnalysis{}\n\td.GetNextAnalysisURL()\n\td = nil\n\td.GetNextAnalysisURL()\n}\n\nfunc TestDeleteCostCenterResponse_GetCostCenterState(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeleteCostCenterResponse{}\n\td.GetCostCenterState()\n\td = nil\n\td.GetCostCenterState()\n}\n\nfunc TestDeleteCostCenterResponse_GetID(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeleteCostCenterResponse{}\n\td.GetID()\n\td = nil\n\td.GetID()\n}\n\nfunc TestDeleteCostCenterResponse_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeleteCostCenterResponse{}\n\td.GetMessage()\n\td = nil\n\td.GetMessage()\n}\n\nfunc TestDeleteCostCenterResponse_GetName(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeleteCostCenterResponse{}\n\td.GetName()\n\td = nil\n\td.GetName()\n}\n\nfunc TestDeleteEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeleteEvent{}\n\td.GetInstallation()\n\td = nil\n\td.GetInstallation()\n}\n\nfunc TestDeleteEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeleteEvent{}\n\td.GetOrg()\n\td = nil\n\td.GetOrg()\n}\n\nfunc TestDeleteEvent_GetPusherType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeleteEvent{PusherType: &zeroValue}\n\td.GetPusherType()\n\td = &DeleteEvent{}\n\td.GetPusherType()\n\td = nil\n\td.GetPusherType()\n}\n\nfunc TestDeleteEvent_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeleteEvent{Ref: &zeroValue}\n\td.GetRef()\n\td = &DeleteEvent{}\n\td.GetRef()\n\td = nil\n\td.GetRef()\n}\n\nfunc TestDeleteEvent_GetRefType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeleteEvent{RefType: &zeroValue}\n\td.GetRefType()\n\td = &DeleteEvent{}\n\td.GetRefType()\n\td = nil\n\td.GetRefType()\n}\n\nfunc TestDeleteEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeleteEvent{}\n\td.GetRepo()\n\td = nil\n\td.GetRepo()\n}\n\nfunc TestDeleteEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeleteEvent{}\n\td.GetSender()\n\td = nil\n\td.GetSender()\n}\n\nfunc TestDependabotAlert_GetAutoDismissedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\td := &DependabotAlert{AutoDismissedAt: &zeroValue}\n\td.GetAutoDismissedAt()\n\td = &DependabotAlert{}\n\td.GetAutoDismissedAt()\n\td = nil\n\td.GetAutoDismissedAt()\n}\n\nfunc TestDependabotAlert_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\td := &DependabotAlert{CreatedAt: &zeroValue}\n\td.GetCreatedAt()\n\td = &DependabotAlert{}\n\td.GetCreatedAt()\n\td = nil\n\td.GetCreatedAt()\n}\n\nfunc TestDependabotAlert_GetDependency(tt *testing.T) {\n\ttt.Parallel()\n\td := &DependabotAlert{}\n\td.GetDependency()\n\td = nil\n\td.GetDependency()\n}\n\nfunc TestDependabotAlert_GetDismissedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\td := &DependabotAlert{DismissedAt: &zeroValue}\n\td.GetDismissedAt()\n\td = &DependabotAlert{}\n\td.GetDismissedAt()\n\td = nil\n\td.GetDismissedAt()\n}\n\nfunc TestDependabotAlert_GetDismissedBy(tt *testing.T) {\n\ttt.Parallel()\n\td := &DependabotAlert{}\n\td.GetDismissedBy()\n\td = nil\n\td.GetDismissedBy()\n}\n\nfunc TestDependabotAlert_GetDismissedComment(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DependabotAlert{DismissedComment: &zeroValue}\n\td.GetDismissedComment()\n\td = &DependabotAlert{}\n\td.GetDismissedComment()\n\td = nil\n\td.GetDismissedComment()\n}\n\nfunc TestDependabotAlert_GetDismissedReason(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DependabotAlert{DismissedReason: &zeroValue}\n\td.GetDismissedReason()\n\td = &DependabotAlert{}\n\td.GetDismissedReason()\n\td = nil\n\td.GetDismissedReason()\n}\n\nfunc TestDependabotAlert_GetFixedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\td := &DependabotAlert{FixedAt: &zeroValue}\n\td.GetFixedAt()\n\td = &DependabotAlert{}\n\td.GetFixedAt()\n\td = nil\n\td.GetFixedAt()\n}\n\nfunc TestDependabotAlert_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DependabotAlert{HTMLURL: &zeroValue}\n\td.GetHTMLURL()\n\td = &DependabotAlert{}\n\td.GetHTMLURL()\n\td = nil\n\td.GetHTMLURL()\n}\n\nfunc TestDependabotAlert_GetNumber(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\td := &DependabotAlert{Number: &zeroValue}\n\td.GetNumber()\n\td = &DependabotAlert{}\n\td.GetNumber()\n\td = nil\n\td.GetNumber()\n}\n\nfunc TestDependabotAlert_GetRepository(tt *testing.T) {\n\ttt.Parallel()\n\td := &DependabotAlert{}\n\td.GetRepository()\n\td = nil\n\td.GetRepository()\n}\n\nfunc TestDependabotAlert_GetSecurityAdvisory(tt *testing.T) {\n\ttt.Parallel()\n\td := &DependabotAlert{}\n\td.GetSecurityAdvisory()\n\td = nil\n\td.GetSecurityAdvisory()\n}\n\nfunc TestDependabotAlert_GetSecurityVulnerability(tt *testing.T) {\n\ttt.Parallel()\n\td := &DependabotAlert{}\n\td.GetSecurityVulnerability()\n\td = nil\n\td.GetSecurityVulnerability()\n}\n\nfunc TestDependabotAlert_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DependabotAlert{State: &zeroValue}\n\td.GetState()\n\td = &DependabotAlert{}\n\td.GetState()\n\td = nil\n\td.GetState()\n}\n\nfunc TestDependabotAlert_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\td := &DependabotAlert{UpdatedAt: &zeroValue}\n\td.GetUpdatedAt()\n\td = &DependabotAlert{}\n\td.GetUpdatedAt()\n\td = nil\n\td.GetUpdatedAt()\n}\n\nfunc TestDependabotAlert_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DependabotAlert{URL: &zeroValue}\n\td.GetURL()\n\td = &DependabotAlert{}\n\td.GetURL()\n\td = nil\n\td.GetURL()\n}\n\nfunc TestDependabotAlertEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DependabotAlertEvent{Action: &zeroValue}\n\td.GetAction()\n\td = &DependabotAlertEvent{}\n\td.GetAction()\n\td = nil\n\td.GetAction()\n}\n\nfunc TestDependabotAlertEvent_GetAlert(tt *testing.T) {\n\ttt.Parallel()\n\td := &DependabotAlertEvent{}\n\td.GetAlert()\n\td = nil\n\td.GetAlert()\n}\n\nfunc TestDependabotAlertEvent_GetEnterprise(tt *testing.T) {\n\ttt.Parallel()\n\td := &DependabotAlertEvent{}\n\td.GetEnterprise()\n\td = nil\n\td.GetEnterprise()\n}\n\nfunc TestDependabotAlertEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\td := &DependabotAlertEvent{}\n\td.GetInstallation()\n\td = nil\n\td.GetInstallation()\n}\n\nfunc TestDependabotAlertEvent_GetOrganization(tt *testing.T) {\n\ttt.Parallel()\n\td := &DependabotAlertEvent{}\n\td.GetOrganization()\n\td = nil\n\td.GetOrganization()\n}\n\nfunc TestDependabotAlertEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\td := &DependabotAlertEvent{}\n\td.GetRepo()\n\td = nil\n\td.GetRepo()\n}\n\nfunc TestDependabotAlertEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\td := &DependabotAlertEvent{}\n\td.GetSender()\n\td = nil\n\td.GetSender()\n}\n\nfunc TestDependabotAlertState_GetDismissedComment(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DependabotAlertState{DismissedComment: &zeroValue}\n\td.GetDismissedComment()\n\td = &DependabotAlertState{}\n\td.GetDismissedComment()\n\td = nil\n\td.GetDismissedComment()\n}\n\nfunc TestDependabotAlertState_GetDismissedReason(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DependabotAlertState{DismissedReason: &zeroValue}\n\td.GetDismissedReason()\n\td = &DependabotAlertState{}\n\td.GetDismissedReason()\n\td = nil\n\td.GetDismissedReason()\n}\n\nfunc TestDependabotAlertState_GetState(tt *testing.T) {\n\ttt.Parallel()\n\td := &DependabotAlertState{}\n\td.GetState()\n\td = nil\n\td.GetState()\n}\n\nfunc TestDependabotEncryptedSecret_GetEncryptedValue(tt *testing.T) {\n\ttt.Parallel()\n\td := &DependabotEncryptedSecret{}\n\td.GetEncryptedValue()\n\td = nil\n\td.GetEncryptedValue()\n}\n\nfunc TestDependabotEncryptedSecret_GetKeyID(tt *testing.T) {\n\ttt.Parallel()\n\td := &DependabotEncryptedSecret{}\n\td.GetKeyID()\n\td = nil\n\td.GetKeyID()\n}\n\nfunc TestDependabotEncryptedSecret_GetName(tt *testing.T) {\n\ttt.Parallel()\n\td := &DependabotEncryptedSecret{}\n\td.GetName()\n\td = nil\n\td.GetName()\n}\n\nfunc TestDependabotEncryptedSecret_GetSelectedRepositoryIDs(tt *testing.T) {\n\ttt.Parallel()\n\td := &DependabotEncryptedSecret{}\n\td.GetSelectedRepositoryIDs()\n\td = nil\n\td.GetSelectedRepositoryIDs()\n}\n\nfunc TestDependabotEncryptedSecret_GetVisibility(tt *testing.T) {\n\ttt.Parallel()\n\td := &DependabotEncryptedSecret{}\n\td.GetVisibility()\n\td = nil\n\td.GetVisibility()\n}\n\nfunc TestDependabotSecurityAdvisory_GetCVEID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DependabotSecurityAdvisory{CVEID: &zeroValue}\n\td.GetCVEID()\n\td = &DependabotSecurityAdvisory{}\n\td.GetCVEID()\n\td = nil\n\td.GetCVEID()\n}\n\nfunc TestDependabotSecurityAdvisory_GetCVSS(tt *testing.T) {\n\ttt.Parallel()\n\td := &DependabotSecurityAdvisory{}\n\td.GetCVSS()\n\td = nil\n\td.GetCVSS()\n}\n\nfunc TestDependabotSecurityAdvisory_GetCWEs(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*AdvisoryCWEs{}\n\td := &DependabotSecurityAdvisory{CWEs: zeroValue}\n\td.GetCWEs()\n\td = &DependabotSecurityAdvisory{}\n\td.GetCWEs()\n\td = nil\n\td.GetCWEs()\n}\n\nfunc TestDependabotSecurityAdvisory_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DependabotSecurityAdvisory{Description: &zeroValue}\n\td.GetDescription()\n\td = &DependabotSecurityAdvisory{}\n\td.GetDescription()\n\td = nil\n\td.GetDescription()\n}\n\nfunc TestDependabotSecurityAdvisory_GetEPSS(tt *testing.T) {\n\ttt.Parallel()\n\td := &DependabotSecurityAdvisory{}\n\td.GetEPSS()\n\td = nil\n\td.GetEPSS()\n}\n\nfunc TestDependabotSecurityAdvisory_GetGHSAID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DependabotSecurityAdvisory{GHSAID: &zeroValue}\n\td.GetGHSAID()\n\td = &DependabotSecurityAdvisory{}\n\td.GetGHSAID()\n\td = nil\n\td.GetGHSAID()\n}\n\nfunc TestDependabotSecurityAdvisory_GetIdentifiers(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*AdvisoryIdentifier{}\n\td := &DependabotSecurityAdvisory{Identifiers: zeroValue}\n\td.GetIdentifiers()\n\td = &DependabotSecurityAdvisory{}\n\td.GetIdentifiers()\n\td = nil\n\td.GetIdentifiers()\n}\n\nfunc TestDependabotSecurityAdvisory_GetPublishedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\td := &DependabotSecurityAdvisory{PublishedAt: &zeroValue}\n\td.GetPublishedAt()\n\td = &DependabotSecurityAdvisory{}\n\td.GetPublishedAt()\n\td = nil\n\td.GetPublishedAt()\n}\n\nfunc TestDependabotSecurityAdvisory_GetReferences(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*AdvisoryReference{}\n\td := &DependabotSecurityAdvisory{References: zeroValue}\n\td.GetReferences()\n\td = &DependabotSecurityAdvisory{}\n\td.GetReferences()\n\td = nil\n\td.GetReferences()\n}\n\nfunc TestDependabotSecurityAdvisory_GetSeverity(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DependabotSecurityAdvisory{Severity: &zeroValue}\n\td.GetSeverity()\n\td = &DependabotSecurityAdvisory{}\n\td.GetSeverity()\n\td = nil\n\td.GetSeverity()\n}\n\nfunc TestDependabotSecurityAdvisory_GetSummary(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DependabotSecurityAdvisory{Summary: &zeroValue}\n\td.GetSummary()\n\td = &DependabotSecurityAdvisory{}\n\td.GetSummary()\n\td = nil\n\td.GetSummary()\n}\n\nfunc TestDependabotSecurityAdvisory_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\td := &DependabotSecurityAdvisory{UpdatedAt: &zeroValue}\n\td.GetUpdatedAt()\n\td = &DependabotSecurityAdvisory{}\n\td.GetUpdatedAt()\n\td = nil\n\td.GetUpdatedAt()\n}\n\nfunc TestDependabotSecurityAdvisory_GetVulnerabilities(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*AdvisoryVulnerability{}\n\td := &DependabotSecurityAdvisory{Vulnerabilities: zeroValue}\n\td.GetVulnerabilities()\n\td = &DependabotSecurityAdvisory{}\n\td.GetVulnerabilities()\n\td = nil\n\td.GetVulnerabilities()\n}\n\nfunc TestDependabotSecurityAdvisory_GetWithdrawnAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\td := &DependabotSecurityAdvisory{WithdrawnAt: &zeroValue}\n\td.GetWithdrawnAt()\n\td = &DependabotSecurityAdvisory{}\n\td.GetWithdrawnAt()\n\td = nil\n\td.GetWithdrawnAt()\n}\n\nfunc TestDependabotSecurityUpdates_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DependabotSecurityUpdates{Status: &zeroValue}\n\td.GetStatus()\n\td = &DependabotSecurityUpdates{}\n\td.GetStatus()\n\td = nil\n\td.GetStatus()\n}\n\nfunc TestDependency_GetManifestPath(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &Dependency{ManifestPath: &zeroValue}\n\td.GetManifestPath()\n\td = &Dependency{}\n\td.GetManifestPath()\n\td = nil\n\td.GetManifestPath()\n}\n\nfunc TestDependency_GetPackage(tt *testing.T) {\n\ttt.Parallel()\n\td := &Dependency{}\n\td.GetPackage()\n\td = nil\n\td.GetPackage()\n}\n\nfunc TestDependency_GetScope(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &Dependency{Scope: &zeroValue}\n\td.GetScope()\n\td = &Dependency{}\n\td.GetScope()\n\td = nil\n\td.GetScope()\n}\n\nfunc TestDependencyGraphAutosubmitActionOptions_GetLabeledRunners(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\td := &DependencyGraphAutosubmitActionOptions{LabeledRunners: &zeroValue}\n\td.GetLabeledRunners()\n\td = &DependencyGraphAutosubmitActionOptions{}\n\td.GetLabeledRunners()\n\td = nil\n\td.GetLabeledRunners()\n}\n\nfunc TestDependencyGraphSnapshot_GetDetector(tt *testing.T) {\n\ttt.Parallel()\n\td := &DependencyGraphSnapshot{}\n\td.GetDetector()\n\td = nil\n\td.GetDetector()\n}\n\nfunc TestDependencyGraphSnapshot_GetJob(tt *testing.T) {\n\ttt.Parallel()\n\td := &DependencyGraphSnapshot{}\n\td.GetJob()\n\td = nil\n\td.GetJob()\n}\n\nfunc TestDependencyGraphSnapshot_GetMetadata(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]any{}\n\td := &DependencyGraphSnapshot{Metadata: zeroValue}\n\td.GetMetadata()\n\td = &DependencyGraphSnapshot{}\n\td.GetMetadata()\n\td = nil\n\td.GetMetadata()\n}\n\nfunc TestDependencyGraphSnapshot_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DependencyGraphSnapshot{Ref: &zeroValue}\n\td.GetRef()\n\td = &DependencyGraphSnapshot{}\n\td.GetRef()\n\td = nil\n\td.GetRef()\n}\n\nfunc TestDependencyGraphSnapshot_GetScanned(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\td := &DependencyGraphSnapshot{Scanned: &zeroValue}\n\td.GetScanned()\n\td = &DependencyGraphSnapshot{}\n\td.GetScanned()\n\td = nil\n\td.GetScanned()\n}\n\nfunc TestDependencyGraphSnapshot_GetSha(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DependencyGraphSnapshot{Sha: &zeroValue}\n\td.GetSha()\n\td = &DependencyGraphSnapshot{}\n\td.GetSha()\n\td = nil\n\td.GetSha()\n}\n\nfunc TestDependencyGraphSnapshot_GetVersion(tt *testing.T) {\n\ttt.Parallel()\n\td := &DependencyGraphSnapshot{}\n\td.GetVersion()\n\td = nil\n\td.GetVersion()\n}\n\nfunc TestDependencyGraphSnapshotCreationData_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\td := &DependencyGraphSnapshotCreationData{CreatedAt: &zeroValue}\n\td.GetCreatedAt()\n\td = &DependencyGraphSnapshotCreationData{}\n\td.GetCreatedAt()\n\td = nil\n\td.GetCreatedAt()\n}\n\nfunc TestDependencyGraphSnapshotCreationData_GetID(tt *testing.T) {\n\ttt.Parallel()\n\td := &DependencyGraphSnapshotCreationData{}\n\td.GetID()\n\td = nil\n\td.GetID()\n}\n\nfunc TestDependencyGraphSnapshotCreationData_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DependencyGraphSnapshotCreationData{Message: &zeroValue}\n\td.GetMessage()\n\td = &DependencyGraphSnapshotCreationData{}\n\td.GetMessage()\n\td = nil\n\td.GetMessage()\n}\n\nfunc TestDependencyGraphSnapshotCreationData_GetResult(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DependencyGraphSnapshotCreationData{Result: &zeroValue}\n\td.GetResult()\n\td = &DependencyGraphSnapshotCreationData{}\n\td.GetResult()\n\td = nil\n\td.GetResult()\n}\n\nfunc TestDependencyGraphSnapshotDetector_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DependencyGraphSnapshotDetector{Name: &zeroValue}\n\td.GetName()\n\td = &DependencyGraphSnapshotDetector{}\n\td.GetName()\n\td = nil\n\td.GetName()\n}\n\nfunc TestDependencyGraphSnapshotDetector_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DependencyGraphSnapshotDetector{URL: &zeroValue}\n\td.GetURL()\n\td = &DependencyGraphSnapshotDetector{}\n\td.GetURL()\n\td = nil\n\td.GetURL()\n}\n\nfunc TestDependencyGraphSnapshotDetector_GetVersion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DependencyGraphSnapshotDetector{Version: &zeroValue}\n\td.GetVersion()\n\td = &DependencyGraphSnapshotDetector{}\n\td.GetVersion()\n\td = nil\n\td.GetVersion()\n}\n\nfunc TestDependencyGraphSnapshotJob_GetCorrelator(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DependencyGraphSnapshotJob{Correlator: &zeroValue}\n\td.GetCorrelator()\n\td = &DependencyGraphSnapshotJob{}\n\td.GetCorrelator()\n\td = nil\n\td.GetCorrelator()\n}\n\nfunc TestDependencyGraphSnapshotJob_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DependencyGraphSnapshotJob{HTMLURL: &zeroValue}\n\td.GetHTMLURL()\n\td = &DependencyGraphSnapshotJob{}\n\td.GetHTMLURL()\n\td = nil\n\td.GetHTMLURL()\n}\n\nfunc TestDependencyGraphSnapshotJob_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DependencyGraphSnapshotJob{ID: &zeroValue}\n\td.GetID()\n\td = &DependencyGraphSnapshotJob{}\n\td.GetID()\n\td = nil\n\td.GetID()\n}\n\nfunc TestDependencyGraphSnapshotManifest_GetFile(tt *testing.T) {\n\ttt.Parallel()\n\td := &DependencyGraphSnapshotManifest{}\n\td.GetFile()\n\td = nil\n\td.GetFile()\n}\n\nfunc TestDependencyGraphSnapshotManifest_GetMetadata(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]any{}\n\td := &DependencyGraphSnapshotManifest{Metadata: zeroValue}\n\td.GetMetadata()\n\td = &DependencyGraphSnapshotManifest{}\n\td.GetMetadata()\n\td = nil\n\td.GetMetadata()\n}\n\nfunc TestDependencyGraphSnapshotManifest_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DependencyGraphSnapshotManifest{Name: &zeroValue}\n\td.GetName()\n\td = &DependencyGraphSnapshotManifest{}\n\td.GetName()\n\td = nil\n\td.GetName()\n}\n\nfunc TestDependencyGraphSnapshotManifestFile_GetSourceLocation(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DependencyGraphSnapshotManifestFile{SourceLocation: &zeroValue}\n\td.GetSourceLocation()\n\td = &DependencyGraphSnapshotManifestFile{}\n\td.GetSourceLocation()\n\td = nil\n\td.GetSourceLocation()\n}\n\nfunc TestDependencyGraphSnapshotResolvedDependency_GetDependencies(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\td := &DependencyGraphSnapshotResolvedDependency{Dependencies: zeroValue}\n\td.GetDependencies()\n\td = &DependencyGraphSnapshotResolvedDependency{}\n\td.GetDependencies()\n\td = nil\n\td.GetDependencies()\n}\n\nfunc TestDependencyGraphSnapshotResolvedDependency_GetMetadata(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]any{}\n\td := &DependencyGraphSnapshotResolvedDependency{Metadata: zeroValue}\n\td.GetMetadata()\n\td = &DependencyGraphSnapshotResolvedDependency{}\n\td.GetMetadata()\n\td = nil\n\td.GetMetadata()\n}\n\nfunc TestDependencyGraphSnapshotResolvedDependency_GetPackageURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DependencyGraphSnapshotResolvedDependency{PackageURL: &zeroValue}\n\td.GetPackageURL()\n\td = &DependencyGraphSnapshotResolvedDependency{}\n\td.GetPackageURL()\n\td = nil\n\td.GetPackageURL()\n}\n\nfunc TestDependencyGraphSnapshotResolvedDependency_GetRelationship(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DependencyGraphSnapshotResolvedDependency{Relationship: &zeroValue}\n\td.GetRelationship()\n\td = &DependencyGraphSnapshotResolvedDependency{}\n\td.GetRelationship()\n\td = nil\n\td.GetRelationship()\n}\n\nfunc TestDependencyGraphSnapshotResolvedDependency_GetScope(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DependencyGraphSnapshotResolvedDependency{Scope: &zeroValue}\n\td.GetScope()\n\td = &DependencyGraphSnapshotResolvedDependency{}\n\td.GetScope()\n\td = nil\n\td.GetScope()\n}\n\nfunc TestDeployKeyEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeployKeyEvent{Action: &zeroValue}\n\td.GetAction()\n\td = &DeployKeyEvent{}\n\td.GetAction()\n\td = nil\n\td.GetAction()\n}\n\nfunc TestDeployKeyEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeployKeyEvent{}\n\td.GetInstallation()\n\td = nil\n\td.GetInstallation()\n}\n\nfunc TestDeployKeyEvent_GetKey(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeployKeyEvent{}\n\td.GetKey()\n\td = nil\n\td.GetKey()\n}\n\nfunc TestDeployKeyEvent_GetOrganization(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeployKeyEvent{}\n\td.GetOrganization()\n\td = nil\n\td.GetOrganization()\n}\n\nfunc TestDeployKeyEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeployKeyEvent{}\n\td.GetRepo()\n\td = nil\n\td.GetRepo()\n}\n\nfunc TestDeployKeyEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeployKeyEvent{}\n\td.GetSender()\n\td = nil\n\td.GetSender()\n}\n\nfunc TestDeployment_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\td := &Deployment{CreatedAt: &zeroValue}\n\td.GetCreatedAt()\n\td = &Deployment{}\n\td.GetCreatedAt()\n\td = nil\n\td.GetCreatedAt()\n}\n\nfunc TestDeployment_GetCreator(tt *testing.T) {\n\ttt.Parallel()\n\td := &Deployment{}\n\td.GetCreator()\n\td = nil\n\td.GetCreator()\n}\n\nfunc TestDeployment_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &Deployment{Description: &zeroValue}\n\td.GetDescription()\n\td = &Deployment{}\n\td.GetDescription()\n\td = nil\n\td.GetDescription()\n}\n\nfunc TestDeployment_GetEnvironment(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &Deployment{Environment: &zeroValue}\n\td.GetEnvironment()\n\td = &Deployment{}\n\td.GetEnvironment()\n\td = nil\n\td.GetEnvironment()\n}\n\nfunc TestDeployment_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\td := &Deployment{ID: &zeroValue}\n\td.GetID()\n\td = &Deployment{}\n\td.GetID()\n\td = nil\n\td.GetID()\n}\n\nfunc TestDeployment_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &Deployment{NodeID: &zeroValue}\n\td.GetNodeID()\n\td = &Deployment{}\n\td.GetNodeID()\n\td = nil\n\td.GetNodeID()\n}\n\nfunc TestDeployment_GetPayload(tt *testing.T) {\n\ttt.Parallel()\n\td := &Deployment{}\n\td.GetPayload()\n\td = nil\n\td.GetPayload()\n}\n\nfunc TestDeployment_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &Deployment{Ref: &zeroValue}\n\td.GetRef()\n\td = &Deployment{}\n\td.GetRef()\n\td = nil\n\td.GetRef()\n}\n\nfunc TestDeployment_GetRepositoryURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &Deployment{RepositoryURL: &zeroValue}\n\td.GetRepositoryURL()\n\td = &Deployment{}\n\td.GetRepositoryURL()\n\td = nil\n\td.GetRepositoryURL()\n}\n\nfunc TestDeployment_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &Deployment{SHA: &zeroValue}\n\td.GetSHA()\n\td = &Deployment{}\n\td.GetSHA()\n\td = nil\n\td.GetSHA()\n}\n\nfunc TestDeployment_GetStatusesURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &Deployment{StatusesURL: &zeroValue}\n\td.GetStatusesURL()\n\td = &Deployment{}\n\td.GetStatusesURL()\n\td = nil\n\td.GetStatusesURL()\n}\n\nfunc TestDeployment_GetTask(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &Deployment{Task: &zeroValue}\n\td.GetTask()\n\td = &Deployment{}\n\td.GetTask()\n\td = nil\n\td.GetTask()\n}\n\nfunc TestDeployment_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\td := &Deployment{UpdatedAt: &zeroValue}\n\td.GetUpdatedAt()\n\td = &Deployment{}\n\td.GetUpdatedAt()\n\td = nil\n\td.GetUpdatedAt()\n}\n\nfunc TestDeployment_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &Deployment{URL: &zeroValue}\n\td.GetURL()\n\td = &Deployment{}\n\td.GetURL()\n\td = nil\n\td.GetURL()\n}\n\nfunc TestDeploymentBranchPolicy_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\td := &DeploymentBranchPolicy{ID: &zeroValue}\n\td.GetID()\n\td = &DeploymentBranchPolicy{}\n\td.GetID()\n\td = nil\n\td.GetID()\n}\n\nfunc TestDeploymentBranchPolicy_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentBranchPolicy{Name: &zeroValue}\n\td.GetName()\n\td = &DeploymentBranchPolicy{}\n\td.GetName()\n\td = nil\n\td.GetName()\n}\n\nfunc TestDeploymentBranchPolicy_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentBranchPolicy{NodeID: &zeroValue}\n\td.GetNodeID()\n\td = &DeploymentBranchPolicy{}\n\td.GetNodeID()\n\td = nil\n\td.GetNodeID()\n}\n\nfunc TestDeploymentBranchPolicy_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentBranchPolicy{Type: &zeroValue}\n\td.GetType()\n\td = &DeploymentBranchPolicy{}\n\td.GetType()\n\td = nil\n\td.GetType()\n}\n\nfunc TestDeploymentBranchPolicyRequest_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentBranchPolicyRequest{Name: &zeroValue}\n\td.GetName()\n\td = &DeploymentBranchPolicyRequest{}\n\td.GetName()\n\td = nil\n\td.GetName()\n}\n\nfunc TestDeploymentBranchPolicyRequest_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentBranchPolicyRequest{Type: &zeroValue}\n\td.GetType()\n\td = &DeploymentBranchPolicyRequest{}\n\td.GetType()\n\td = nil\n\td.GetType()\n}\n\nfunc TestDeploymentBranchPolicyResponse_GetBranchPolicies(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*DeploymentBranchPolicy{}\n\td := &DeploymentBranchPolicyResponse{BranchPolicies: zeroValue}\n\td.GetBranchPolicies()\n\td = &DeploymentBranchPolicyResponse{}\n\td.GetBranchPolicies()\n\td = nil\n\td.GetBranchPolicies()\n}\n\nfunc TestDeploymentBranchPolicyResponse_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\td := &DeploymentBranchPolicyResponse{TotalCount: &zeroValue}\n\td.GetTotalCount()\n\td = &DeploymentBranchPolicyResponse{}\n\td.GetTotalCount()\n\td = nil\n\td.GetTotalCount()\n}\n\nfunc TestDeploymentEvent_GetDeployment(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentEvent{}\n\td.GetDeployment()\n\td = nil\n\td.GetDeployment()\n}\n\nfunc TestDeploymentEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentEvent{}\n\td.GetInstallation()\n\td = nil\n\td.GetInstallation()\n}\n\nfunc TestDeploymentEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentEvent{}\n\td.GetOrg()\n\td = nil\n\td.GetOrg()\n}\n\nfunc TestDeploymentEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentEvent{}\n\td.GetRepo()\n\td = nil\n\td.GetRepo()\n}\n\nfunc TestDeploymentEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentEvent{}\n\td.GetSender()\n\td = nil\n\td.GetSender()\n}\n\nfunc TestDeploymentEvent_GetWorkflow(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentEvent{}\n\td.GetWorkflow()\n\td = nil\n\td.GetWorkflow()\n}\n\nfunc TestDeploymentEvent_GetWorkflowRun(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentEvent{}\n\td.GetWorkflowRun()\n\td = nil\n\td.GetWorkflowRun()\n}\n\nfunc TestDeploymentProtectionRuleEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentProtectionRuleEvent{Action: &zeroValue}\n\td.GetAction()\n\td = &DeploymentProtectionRuleEvent{}\n\td.GetAction()\n\td = nil\n\td.GetAction()\n}\n\nfunc TestDeploymentProtectionRuleEvent_GetDeployment(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentProtectionRuleEvent{}\n\td.GetDeployment()\n\td = nil\n\td.GetDeployment()\n}\n\nfunc TestDeploymentProtectionRuleEvent_GetDeploymentCallbackURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentProtectionRuleEvent{DeploymentCallbackURL: &zeroValue}\n\td.GetDeploymentCallbackURL()\n\td = &DeploymentProtectionRuleEvent{}\n\td.GetDeploymentCallbackURL()\n\td = nil\n\td.GetDeploymentCallbackURL()\n}\n\nfunc TestDeploymentProtectionRuleEvent_GetEnvironment(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentProtectionRuleEvent{Environment: &zeroValue}\n\td.GetEnvironment()\n\td = &DeploymentProtectionRuleEvent{}\n\td.GetEnvironment()\n\td = nil\n\td.GetEnvironment()\n}\n\nfunc TestDeploymentProtectionRuleEvent_GetEvent(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentProtectionRuleEvent{Event: &zeroValue}\n\td.GetEvent()\n\td = &DeploymentProtectionRuleEvent{}\n\td.GetEvent()\n\td = nil\n\td.GetEvent()\n}\n\nfunc TestDeploymentProtectionRuleEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentProtectionRuleEvent{}\n\td.GetInstallation()\n\td = nil\n\td.GetInstallation()\n}\n\nfunc TestDeploymentProtectionRuleEvent_GetOrganization(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentProtectionRuleEvent{}\n\td.GetOrganization()\n\td = nil\n\td.GetOrganization()\n}\n\nfunc TestDeploymentProtectionRuleEvent_GetPullRequests(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*PullRequest{}\n\td := &DeploymentProtectionRuleEvent{PullRequests: zeroValue}\n\td.GetPullRequests()\n\td = &DeploymentProtectionRuleEvent{}\n\td.GetPullRequests()\n\td = nil\n\td.GetPullRequests()\n}\n\nfunc TestDeploymentProtectionRuleEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentProtectionRuleEvent{}\n\td.GetRepo()\n\td = nil\n\td.GetRepo()\n}\n\nfunc TestDeploymentProtectionRuleEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentProtectionRuleEvent{}\n\td.GetSender()\n\td = nil\n\td.GetSender()\n}\n\nfunc TestDeploymentRequest_GetAutoMerge(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\td := &DeploymentRequest{AutoMerge: &zeroValue}\n\td.GetAutoMerge()\n\td = &DeploymentRequest{}\n\td.GetAutoMerge()\n\td = nil\n\td.GetAutoMerge()\n}\n\nfunc TestDeploymentRequest_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentRequest{Description: &zeroValue}\n\td.GetDescription()\n\td = &DeploymentRequest{}\n\td.GetDescription()\n\td = nil\n\td.GetDescription()\n}\n\nfunc TestDeploymentRequest_GetEnvironment(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentRequest{Environment: &zeroValue}\n\td.GetEnvironment()\n\td = &DeploymentRequest{}\n\td.GetEnvironment()\n\td = nil\n\td.GetEnvironment()\n}\n\nfunc TestDeploymentRequest_GetPayload(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentRequest{}\n\td.GetPayload()\n\td = nil\n\td.GetPayload()\n}\n\nfunc TestDeploymentRequest_GetProductionEnvironment(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\td := &DeploymentRequest{ProductionEnvironment: &zeroValue}\n\td.GetProductionEnvironment()\n\td = &DeploymentRequest{}\n\td.GetProductionEnvironment()\n\td = nil\n\td.GetProductionEnvironment()\n}\n\nfunc TestDeploymentRequest_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentRequest{Ref: &zeroValue}\n\td.GetRef()\n\td = &DeploymentRequest{}\n\td.GetRef()\n\td = nil\n\td.GetRef()\n}\n\nfunc TestDeploymentRequest_GetRequiredContexts(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue []string\n\td := &DeploymentRequest{RequiredContexts: &zeroValue}\n\td.GetRequiredContexts()\n\td = &DeploymentRequest{}\n\td.GetRequiredContexts()\n\td = nil\n\td.GetRequiredContexts()\n}\n\nfunc TestDeploymentRequest_GetTask(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentRequest{Task: &zeroValue}\n\td.GetTask()\n\td = &DeploymentRequest{}\n\td.GetTask()\n\td = nil\n\td.GetTask()\n}\n\nfunc TestDeploymentRequest_GetTransientEnvironment(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\td := &DeploymentRequest{TransientEnvironment: &zeroValue}\n\td.GetTransientEnvironment()\n\td = &DeploymentRequest{}\n\td.GetTransientEnvironment()\n\td = nil\n\td.GetTransientEnvironment()\n}\n\nfunc TestDeploymentReviewEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentReviewEvent{Action: &zeroValue}\n\td.GetAction()\n\td = &DeploymentReviewEvent{}\n\td.GetAction()\n\td = nil\n\td.GetAction()\n}\n\nfunc TestDeploymentReviewEvent_GetApprover(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentReviewEvent{}\n\td.GetApprover()\n\td = nil\n\td.GetApprover()\n}\n\nfunc TestDeploymentReviewEvent_GetComment(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentReviewEvent{Comment: &zeroValue}\n\td.GetComment()\n\td = &DeploymentReviewEvent{}\n\td.GetComment()\n\td = nil\n\td.GetComment()\n}\n\nfunc TestDeploymentReviewEvent_GetEnterprise(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentReviewEvent{}\n\td.GetEnterprise()\n\td = nil\n\td.GetEnterprise()\n}\n\nfunc TestDeploymentReviewEvent_GetEnvironment(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentReviewEvent{Environment: &zeroValue}\n\td.GetEnvironment()\n\td = &DeploymentReviewEvent{}\n\td.GetEnvironment()\n\td = nil\n\td.GetEnvironment()\n}\n\nfunc TestDeploymentReviewEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentReviewEvent{}\n\td.GetInstallation()\n\td = nil\n\td.GetInstallation()\n}\n\nfunc TestDeploymentReviewEvent_GetOrganization(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentReviewEvent{}\n\td.GetOrganization()\n\td = nil\n\td.GetOrganization()\n}\n\nfunc TestDeploymentReviewEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentReviewEvent{}\n\td.GetRepo()\n\td = nil\n\td.GetRepo()\n}\n\nfunc TestDeploymentReviewEvent_GetRequester(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentReviewEvent{}\n\td.GetRequester()\n\td = nil\n\td.GetRequester()\n}\n\nfunc TestDeploymentReviewEvent_GetReviewers(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*RequiredReviewer{}\n\td := &DeploymentReviewEvent{Reviewers: zeroValue}\n\td.GetReviewers()\n\td = &DeploymentReviewEvent{}\n\td.GetReviewers()\n\td = nil\n\td.GetReviewers()\n}\n\nfunc TestDeploymentReviewEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentReviewEvent{}\n\td.GetSender()\n\td = nil\n\td.GetSender()\n}\n\nfunc TestDeploymentReviewEvent_GetSince(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentReviewEvent{Since: &zeroValue}\n\td.GetSince()\n\td = &DeploymentReviewEvent{}\n\td.GetSince()\n\td = nil\n\td.GetSince()\n}\n\nfunc TestDeploymentReviewEvent_GetWorkflowJobRun(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentReviewEvent{}\n\td.GetWorkflowJobRun()\n\td = nil\n\td.GetWorkflowJobRun()\n}\n\nfunc TestDeploymentReviewEvent_GetWorkflowJobRuns(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*WorkflowJobRun{}\n\td := &DeploymentReviewEvent{WorkflowJobRuns: zeroValue}\n\td.GetWorkflowJobRuns()\n\td = &DeploymentReviewEvent{}\n\td.GetWorkflowJobRuns()\n\td = nil\n\td.GetWorkflowJobRuns()\n}\n\nfunc TestDeploymentReviewEvent_GetWorkflowRun(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentReviewEvent{}\n\td.GetWorkflowRun()\n\td = nil\n\td.GetWorkflowRun()\n}\n\nfunc TestDeploymentsListOptions_GetEnvironment(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentsListOptions{}\n\td.GetEnvironment()\n\td = nil\n\td.GetEnvironment()\n}\n\nfunc TestDeploymentsListOptions_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentsListOptions{}\n\td.GetRef()\n\td = nil\n\td.GetRef()\n}\n\nfunc TestDeploymentsListOptions_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentsListOptions{}\n\td.GetSHA()\n\td = nil\n\td.GetSHA()\n}\n\nfunc TestDeploymentsListOptions_GetTask(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentsListOptions{}\n\td.GetTask()\n\td = nil\n\td.GetTask()\n}\n\nfunc TestDeploymentStatus_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\td := &DeploymentStatus{CreatedAt: &zeroValue}\n\td.GetCreatedAt()\n\td = &DeploymentStatus{}\n\td.GetCreatedAt()\n\td = nil\n\td.GetCreatedAt()\n}\n\nfunc TestDeploymentStatus_GetCreator(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentStatus{}\n\td.GetCreator()\n\td = nil\n\td.GetCreator()\n}\n\nfunc TestDeploymentStatus_GetDeploymentURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentStatus{DeploymentURL: &zeroValue}\n\td.GetDeploymentURL()\n\td = &DeploymentStatus{}\n\td.GetDeploymentURL()\n\td = nil\n\td.GetDeploymentURL()\n}\n\nfunc TestDeploymentStatus_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentStatus{Description: &zeroValue}\n\td.GetDescription()\n\td = &DeploymentStatus{}\n\td.GetDescription()\n\td = nil\n\td.GetDescription()\n}\n\nfunc TestDeploymentStatus_GetEnvironment(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentStatus{Environment: &zeroValue}\n\td.GetEnvironment()\n\td = &DeploymentStatus{}\n\td.GetEnvironment()\n\td = nil\n\td.GetEnvironment()\n}\n\nfunc TestDeploymentStatus_GetEnvironmentURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentStatus{EnvironmentURL: &zeroValue}\n\td.GetEnvironmentURL()\n\td = &DeploymentStatus{}\n\td.GetEnvironmentURL()\n\td = nil\n\td.GetEnvironmentURL()\n}\n\nfunc TestDeploymentStatus_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\td := &DeploymentStatus{ID: &zeroValue}\n\td.GetID()\n\td = &DeploymentStatus{}\n\td.GetID()\n\td = nil\n\td.GetID()\n}\n\nfunc TestDeploymentStatus_GetLogURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentStatus{LogURL: &zeroValue}\n\td.GetLogURL()\n\td = &DeploymentStatus{}\n\td.GetLogURL()\n\td = nil\n\td.GetLogURL()\n}\n\nfunc TestDeploymentStatus_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentStatus{NodeID: &zeroValue}\n\td.GetNodeID()\n\td = &DeploymentStatus{}\n\td.GetNodeID()\n\td = nil\n\td.GetNodeID()\n}\n\nfunc TestDeploymentStatus_GetRepositoryURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentStatus{RepositoryURL: &zeroValue}\n\td.GetRepositoryURL()\n\td = &DeploymentStatus{}\n\td.GetRepositoryURL()\n\td = nil\n\td.GetRepositoryURL()\n}\n\nfunc TestDeploymentStatus_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentStatus{State: &zeroValue}\n\td.GetState()\n\td = &DeploymentStatus{}\n\td.GetState()\n\td = nil\n\td.GetState()\n}\n\nfunc TestDeploymentStatus_GetTargetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentStatus{TargetURL: &zeroValue}\n\td.GetTargetURL()\n\td = &DeploymentStatus{}\n\td.GetTargetURL()\n\td = nil\n\td.GetTargetURL()\n}\n\nfunc TestDeploymentStatus_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\td := &DeploymentStatus{UpdatedAt: &zeroValue}\n\td.GetUpdatedAt()\n\td = &DeploymentStatus{}\n\td.GetUpdatedAt()\n\td = nil\n\td.GetUpdatedAt()\n}\n\nfunc TestDeploymentStatus_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentStatus{URL: &zeroValue}\n\td.GetURL()\n\td = &DeploymentStatus{}\n\td.GetURL()\n\td = nil\n\td.GetURL()\n}\n\nfunc TestDeploymentStatusEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentStatusEvent{Action: &zeroValue}\n\td.GetAction()\n\td = &DeploymentStatusEvent{}\n\td.GetAction()\n\td = nil\n\td.GetAction()\n}\n\nfunc TestDeploymentStatusEvent_GetDeployment(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentStatusEvent{}\n\td.GetDeployment()\n\td = nil\n\td.GetDeployment()\n}\n\nfunc TestDeploymentStatusEvent_GetDeploymentStatus(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentStatusEvent{}\n\td.GetDeploymentStatus()\n\td = nil\n\td.GetDeploymentStatus()\n}\n\nfunc TestDeploymentStatusEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentStatusEvent{}\n\td.GetInstallation()\n\td = nil\n\td.GetInstallation()\n}\n\nfunc TestDeploymentStatusEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentStatusEvent{}\n\td.GetOrg()\n\td = nil\n\td.GetOrg()\n}\n\nfunc TestDeploymentStatusEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentStatusEvent{}\n\td.GetRepo()\n\td = nil\n\td.GetRepo()\n}\n\nfunc TestDeploymentStatusEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\td := &DeploymentStatusEvent{}\n\td.GetSender()\n\td = nil\n\td.GetSender()\n}\n\nfunc TestDeploymentStatusRequest_GetAutoInactive(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\td := &DeploymentStatusRequest{AutoInactive: &zeroValue}\n\td.GetAutoInactive()\n\td = &DeploymentStatusRequest{}\n\td.GetAutoInactive()\n\td = nil\n\td.GetAutoInactive()\n}\n\nfunc TestDeploymentStatusRequest_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentStatusRequest{Description: &zeroValue}\n\td.GetDescription()\n\td = &DeploymentStatusRequest{}\n\td.GetDescription()\n\td = nil\n\td.GetDescription()\n}\n\nfunc TestDeploymentStatusRequest_GetEnvironment(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentStatusRequest{Environment: &zeroValue}\n\td.GetEnvironment()\n\td = &DeploymentStatusRequest{}\n\td.GetEnvironment()\n\td = nil\n\td.GetEnvironment()\n}\n\nfunc TestDeploymentStatusRequest_GetEnvironmentURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentStatusRequest{EnvironmentURL: &zeroValue}\n\td.GetEnvironmentURL()\n\td = &DeploymentStatusRequest{}\n\td.GetEnvironmentURL()\n\td = nil\n\td.GetEnvironmentURL()\n}\n\nfunc TestDeploymentStatusRequest_GetLogURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentStatusRequest{LogURL: &zeroValue}\n\td.GetLogURL()\n\td = &DeploymentStatusRequest{}\n\td.GetLogURL()\n\td = nil\n\td.GetLogURL()\n}\n\nfunc TestDeploymentStatusRequest_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DeploymentStatusRequest{State: &zeroValue}\n\td.GetState()\n\td = &DeploymentStatusRequest{}\n\td.GetState()\n\td = nil\n\td.GetState()\n}\n\nfunc TestDevContainer_GetDisplayName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DevContainer{DisplayName: &zeroValue}\n\td.GetDisplayName()\n\td = &DevContainer{}\n\td.GetDisplayName()\n\td = nil\n\td.GetDisplayName()\n}\n\nfunc TestDevContainer_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DevContainer{Name: &zeroValue}\n\td.GetName()\n\td = &DevContainer{}\n\td.GetName()\n\td = nil\n\td.GetName()\n}\n\nfunc TestDevContainer_GetPath(tt *testing.T) {\n\ttt.Parallel()\n\td := &DevContainer{}\n\td.GetPath()\n\td = nil\n\td.GetPath()\n}\n\nfunc TestDevContainerConfigurations_GetDevcontainers(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*DevContainer{}\n\td := &DevContainerConfigurations{Devcontainers: zeroValue}\n\td.GetDevcontainers()\n\td = &DevContainerConfigurations{}\n\td.GetDevcontainers()\n\td = nil\n\td.GetDevcontainers()\n}\n\nfunc TestDevContainerConfigurations_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\td := &DevContainerConfigurations{}\n\td.GetTotalCount()\n\td = nil\n\td.GetTotalCount()\n}\n\nfunc TestDiscussion_GetActiveLockReason(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &Discussion{ActiveLockReason: &zeroValue}\n\td.GetActiveLockReason()\n\td = &Discussion{}\n\td.GetActiveLockReason()\n\td = nil\n\td.GetActiveLockReason()\n}\n\nfunc TestDiscussion_GetAnswerChosenAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\td := &Discussion{AnswerChosenAt: &zeroValue}\n\td.GetAnswerChosenAt()\n\td = &Discussion{}\n\td.GetAnswerChosenAt()\n\td = nil\n\td.GetAnswerChosenAt()\n}\n\nfunc TestDiscussion_GetAnswerChosenBy(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &Discussion{AnswerChosenBy: &zeroValue}\n\td.GetAnswerChosenBy()\n\td = &Discussion{}\n\td.GetAnswerChosenBy()\n\td = nil\n\td.GetAnswerChosenBy()\n}\n\nfunc TestDiscussion_GetAnswerHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &Discussion{AnswerHTMLURL: &zeroValue}\n\td.GetAnswerHTMLURL()\n\td = &Discussion{}\n\td.GetAnswerHTMLURL()\n\td = nil\n\td.GetAnswerHTMLURL()\n}\n\nfunc TestDiscussion_GetAuthorAssociation(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &Discussion{AuthorAssociation: &zeroValue}\n\td.GetAuthorAssociation()\n\td = &Discussion{}\n\td.GetAuthorAssociation()\n\td = nil\n\td.GetAuthorAssociation()\n}\n\nfunc TestDiscussion_GetBody(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &Discussion{Body: &zeroValue}\n\td.GetBody()\n\td = &Discussion{}\n\td.GetBody()\n\td = nil\n\td.GetBody()\n}\n\nfunc TestDiscussion_GetComments(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\td := &Discussion{Comments: &zeroValue}\n\td.GetComments()\n\td = &Discussion{}\n\td.GetComments()\n\td = nil\n\td.GetComments()\n}\n\nfunc TestDiscussion_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\td := &Discussion{CreatedAt: &zeroValue}\n\td.GetCreatedAt()\n\td = &Discussion{}\n\td.GetCreatedAt()\n\td = nil\n\td.GetCreatedAt()\n}\n\nfunc TestDiscussion_GetDiscussionCategory(tt *testing.T) {\n\ttt.Parallel()\n\td := &Discussion{}\n\td.GetDiscussionCategory()\n\td = nil\n\td.GetDiscussionCategory()\n}\n\nfunc TestDiscussion_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &Discussion{HTMLURL: &zeroValue}\n\td.GetHTMLURL()\n\td = &Discussion{}\n\td.GetHTMLURL()\n\td = nil\n\td.GetHTMLURL()\n}\n\nfunc TestDiscussion_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\td := &Discussion{ID: &zeroValue}\n\td.GetID()\n\td = &Discussion{}\n\td.GetID()\n\td = nil\n\td.GetID()\n}\n\nfunc TestDiscussion_GetLocked(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\td := &Discussion{Locked: &zeroValue}\n\td.GetLocked()\n\td = &Discussion{}\n\td.GetLocked()\n\td = nil\n\td.GetLocked()\n}\n\nfunc TestDiscussion_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &Discussion{NodeID: &zeroValue}\n\td.GetNodeID()\n\td = &Discussion{}\n\td.GetNodeID()\n\td = nil\n\td.GetNodeID()\n}\n\nfunc TestDiscussion_GetNumber(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\td := &Discussion{Number: &zeroValue}\n\td.GetNumber()\n\td = &Discussion{}\n\td.GetNumber()\n\td = nil\n\td.GetNumber()\n}\n\nfunc TestDiscussion_GetRepositoryURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &Discussion{RepositoryURL: &zeroValue}\n\td.GetRepositoryURL()\n\td = &Discussion{}\n\td.GetRepositoryURL()\n\td = nil\n\td.GetRepositoryURL()\n}\n\nfunc TestDiscussion_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &Discussion{State: &zeroValue}\n\td.GetState()\n\td = &Discussion{}\n\td.GetState()\n\td = nil\n\td.GetState()\n}\n\nfunc TestDiscussion_GetTitle(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &Discussion{Title: &zeroValue}\n\td.GetTitle()\n\td = &Discussion{}\n\td.GetTitle()\n\td = nil\n\td.GetTitle()\n}\n\nfunc TestDiscussion_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\td := &Discussion{UpdatedAt: &zeroValue}\n\td.GetUpdatedAt()\n\td = &Discussion{}\n\td.GetUpdatedAt()\n\td = nil\n\td.GetUpdatedAt()\n}\n\nfunc TestDiscussion_GetUser(tt *testing.T) {\n\ttt.Parallel()\n\td := &Discussion{}\n\td.GetUser()\n\td = nil\n\td.GetUser()\n}\n\nfunc TestDiscussionCategory_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\td := &DiscussionCategory{CreatedAt: &zeroValue}\n\td.GetCreatedAt()\n\td = &DiscussionCategory{}\n\td.GetCreatedAt()\n\td = nil\n\td.GetCreatedAt()\n}\n\nfunc TestDiscussionCategory_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DiscussionCategory{Description: &zeroValue}\n\td.GetDescription()\n\td = &DiscussionCategory{}\n\td.GetDescription()\n\td = nil\n\td.GetDescription()\n}\n\nfunc TestDiscussionCategory_GetEmoji(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DiscussionCategory{Emoji: &zeroValue}\n\td.GetEmoji()\n\td = &DiscussionCategory{}\n\td.GetEmoji()\n\td = nil\n\td.GetEmoji()\n}\n\nfunc TestDiscussionCategory_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\td := &DiscussionCategory{ID: &zeroValue}\n\td.GetID()\n\td = &DiscussionCategory{}\n\td.GetID()\n\td = nil\n\td.GetID()\n}\n\nfunc TestDiscussionCategory_GetIsAnswerable(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\td := &DiscussionCategory{IsAnswerable: &zeroValue}\n\td.GetIsAnswerable()\n\td = &DiscussionCategory{}\n\td.GetIsAnswerable()\n\td = nil\n\td.GetIsAnswerable()\n}\n\nfunc TestDiscussionCategory_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DiscussionCategory{Name: &zeroValue}\n\td.GetName()\n\td = &DiscussionCategory{}\n\td.GetName()\n\td = nil\n\td.GetName()\n}\n\nfunc TestDiscussionCategory_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DiscussionCategory{NodeID: &zeroValue}\n\td.GetNodeID()\n\td = &DiscussionCategory{}\n\td.GetNodeID()\n\td = nil\n\td.GetNodeID()\n}\n\nfunc TestDiscussionCategory_GetRepositoryID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\td := &DiscussionCategory{RepositoryID: &zeroValue}\n\td.GetRepositoryID()\n\td = &DiscussionCategory{}\n\td.GetRepositoryID()\n\td = nil\n\td.GetRepositoryID()\n}\n\nfunc TestDiscussionCategory_GetSlug(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DiscussionCategory{Slug: &zeroValue}\n\td.GetSlug()\n\td = &DiscussionCategory{}\n\td.GetSlug()\n\td = nil\n\td.GetSlug()\n}\n\nfunc TestDiscussionCategory_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\td := &DiscussionCategory{UpdatedAt: &zeroValue}\n\td.GetUpdatedAt()\n\td = &DiscussionCategory{}\n\td.GetUpdatedAt()\n\td = nil\n\td.GetUpdatedAt()\n}\n\nfunc TestDiscussionComment_GetAuthor(tt *testing.T) {\n\ttt.Parallel()\n\td := &DiscussionComment{}\n\td.GetAuthor()\n\td = nil\n\td.GetAuthor()\n}\n\nfunc TestDiscussionComment_GetBody(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DiscussionComment{Body: &zeroValue}\n\td.GetBody()\n\td = &DiscussionComment{}\n\td.GetBody()\n\td = nil\n\td.GetBody()\n}\n\nfunc TestDiscussionComment_GetBodyHTML(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DiscussionComment{BodyHTML: &zeroValue}\n\td.GetBodyHTML()\n\td = &DiscussionComment{}\n\td.GetBodyHTML()\n\td = nil\n\td.GetBodyHTML()\n}\n\nfunc TestDiscussionComment_GetBodyVersion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DiscussionComment{BodyVersion: &zeroValue}\n\td.GetBodyVersion()\n\td = &DiscussionComment{}\n\td.GetBodyVersion()\n\td = nil\n\td.GetBodyVersion()\n}\n\nfunc TestDiscussionComment_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\td := &DiscussionComment{CreatedAt: &zeroValue}\n\td.GetCreatedAt()\n\td = &DiscussionComment{}\n\td.GetCreatedAt()\n\td = nil\n\td.GetCreatedAt()\n}\n\nfunc TestDiscussionComment_GetDiscussionURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DiscussionComment{DiscussionURL: &zeroValue}\n\td.GetDiscussionURL()\n\td = &DiscussionComment{}\n\td.GetDiscussionURL()\n\td = nil\n\td.GetDiscussionURL()\n}\n\nfunc TestDiscussionComment_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DiscussionComment{HTMLURL: &zeroValue}\n\td.GetHTMLURL()\n\td = &DiscussionComment{}\n\td.GetHTMLURL()\n\td = nil\n\td.GetHTMLURL()\n}\n\nfunc TestDiscussionComment_GetLastEditedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\td := &DiscussionComment{LastEditedAt: &zeroValue}\n\td.GetLastEditedAt()\n\td = &DiscussionComment{}\n\td.GetLastEditedAt()\n\td = nil\n\td.GetLastEditedAt()\n}\n\nfunc TestDiscussionComment_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DiscussionComment{NodeID: &zeroValue}\n\td.GetNodeID()\n\td = &DiscussionComment{}\n\td.GetNodeID()\n\td = nil\n\td.GetNodeID()\n}\n\nfunc TestDiscussionComment_GetNumber(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\td := &DiscussionComment{Number: &zeroValue}\n\td.GetNumber()\n\td = &DiscussionComment{}\n\td.GetNumber()\n\td = nil\n\td.GetNumber()\n}\n\nfunc TestDiscussionComment_GetReactions(tt *testing.T) {\n\ttt.Parallel()\n\td := &DiscussionComment{}\n\td.GetReactions()\n\td = nil\n\td.GetReactions()\n}\n\nfunc TestDiscussionComment_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\td := &DiscussionComment{UpdatedAt: &zeroValue}\n\td.GetUpdatedAt()\n\td = &DiscussionComment{}\n\td.GetUpdatedAt()\n\td = nil\n\td.GetUpdatedAt()\n}\n\nfunc TestDiscussionComment_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DiscussionComment{URL: &zeroValue}\n\td.GetURL()\n\td = &DiscussionComment{}\n\td.GetURL()\n\td = nil\n\td.GetURL()\n}\n\nfunc TestDiscussionCommentEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DiscussionCommentEvent{Action: &zeroValue}\n\td.GetAction()\n\td = &DiscussionCommentEvent{}\n\td.GetAction()\n\td = nil\n\td.GetAction()\n}\n\nfunc TestDiscussionCommentEvent_GetComment(tt *testing.T) {\n\ttt.Parallel()\n\td := &DiscussionCommentEvent{}\n\td.GetComment()\n\td = nil\n\td.GetComment()\n}\n\nfunc TestDiscussionCommentEvent_GetDiscussion(tt *testing.T) {\n\ttt.Parallel()\n\td := &DiscussionCommentEvent{}\n\td.GetDiscussion()\n\td = nil\n\td.GetDiscussion()\n}\n\nfunc TestDiscussionCommentEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\td := &DiscussionCommentEvent{}\n\td.GetInstallation()\n\td = nil\n\td.GetInstallation()\n}\n\nfunc TestDiscussionCommentEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\td := &DiscussionCommentEvent{}\n\td.GetOrg()\n\td = nil\n\td.GetOrg()\n}\n\nfunc TestDiscussionCommentEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\td := &DiscussionCommentEvent{}\n\td.GetRepo()\n\td = nil\n\td.GetRepo()\n}\n\nfunc TestDiscussionCommentEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\td := &DiscussionCommentEvent{}\n\td.GetSender()\n\td = nil\n\td.GetSender()\n}\n\nfunc TestDiscussionCommentListOptions_GetDirection(tt *testing.T) {\n\ttt.Parallel()\n\td := &DiscussionCommentListOptions{}\n\td.GetDirection()\n\td = nil\n\td.GetDirection()\n}\n\nfunc TestDiscussionEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DiscussionEvent{Action: &zeroValue}\n\td.GetAction()\n\td = &DiscussionEvent{}\n\td.GetAction()\n\td = nil\n\td.GetAction()\n}\n\nfunc TestDiscussionEvent_GetDiscussion(tt *testing.T) {\n\ttt.Parallel()\n\td := &DiscussionEvent{}\n\td.GetDiscussion()\n\td = nil\n\td.GetDiscussion()\n}\n\nfunc TestDiscussionEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\td := &DiscussionEvent{}\n\td.GetInstallation()\n\td = nil\n\td.GetInstallation()\n}\n\nfunc TestDiscussionEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\td := &DiscussionEvent{}\n\td.GetOrg()\n\td = nil\n\td.GetOrg()\n}\n\nfunc TestDiscussionEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\td := &DiscussionEvent{}\n\td.GetRepo()\n\td = nil\n\td.GetRepo()\n}\n\nfunc TestDiscussionEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\td := &DiscussionEvent{}\n\td.GetSender()\n\td = nil\n\td.GetSender()\n}\n\nfunc TestDiscussionListOptions_GetDirection(tt *testing.T) {\n\ttt.Parallel()\n\td := &DiscussionListOptions{}\n\td.GetDirection()\n\td = nil\n\td.GetDirection()\n}\n\nfunc TestDismissalRestrictions_GetApps(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*App{}\n\td := &DismissalRestrictions{Apps: zeroValue}\n\td.GetApps()\n\td = &DismissalRestrictions{}\n\td.GetApps()\n\td = nil\n\td.GetApps()\n}\n\nfunc TestDismissalRestrictions_GetTeams(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Team{}\n\td := &DismissalRestrictions{Teams: zeroValue}\n\td.GetTeams()\n\td = &DismissalRestrictions{}\n\td.GetTeams()\n\td = nil\n\td.GetTeams()\n}\n\nfunc TestDismissalRestrictions_GetUsers(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*User{}\n\td := &DismissalRestrictions{Users: zeroValue}\n\td.GetUsers()\n\td = &DismissalRestrictions{}\n\td.GetUsers()\n\td = nil\n\td.GetUsers()\n}\n\nfunc TestDismissalRestrictionsRequest_GetApps(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue []string\n\td := &DismissalRestrictionsRequest{Apps: &zeroValue}\n\td.GetApps()\n\td = &DismissalRestrictionsRequest{}\n\td.GetApps()\n\td = nil\n\td.GetApps()\n}\n\nfunc TestDismissalRestrictionsRequest_GetTeams(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue []string\n\td := &DismissalRestrictionsRequest{Teams: &zeroValue}\n\td.GetTeams()\n\td = &DismissalRestrictionsRequest{}\n\td.GetTeams()\n\td = nil\n\td.GetTeams()\n}\n\nfunc TestDismissalRestrictionsRequest_GetUsers(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue []string\n\td := &DismissalRestrictionsRequest{Users: &zeroValue}\n\td.GetUsers()\n\td = &DismissalRestrictionsRequest{}\n\td.GetUsers()\n\td = nil\n\td.GetUsers()\n}\n\nfunc TestDismissedReview_GetDismissalCommitID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DismissedReview{DismissalCommitID: &zeroValue}\n\td.GetDismissalCommitID()\n\td = &DismissedReview{}\n\td.GetDismissalCommitID()\n\td = nil\n\td.GetDismissalCommitID()\n}\n\nfunc TestDismissedReview_GetDismissalMessage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DismissedReview{DismissalMessage: &zeroValue}\n\td.GetDismissalMessage()\n\td = &DismissedReview{}\n\td.GetDismissalMessage()\n\td = nil\n\td.GetDismissalMessage()\n}\n\nfunc TestDismissedReview_GetReviewID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\td := &DismissedReview{ReviewID: &zeroValue}\n\td.GetReviewID()\n\td = &DismissedReview{}\n\td.GetReviewID()\n\td = nil\n\td.GetReviewID()\n}\n\nfunc TestDismissedReview_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DismissedReview{State: &zeroValue}\n\td.GetState()\n\td = &DismissedReview{}\n\td.GetState()\n\td = nil\n\td.GetState()\n}\n\nfunc TestDismissStaleReviewsOnPushChanges_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\td := &DismissStaleReviewsOnPushChanges{From: &zeroValue}\n\td.GetFrom()\n\td = &DismissStaleReviewsOnPushChanges{}\n\td.GetFrom()\n\td = nil\n\td.GetFrom()\n}\n\nfunc TestDispatchRequestOptions_GetClientPayload(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue json.RawMessage\n\td := &DispatchRequestOptions{ClientPayload: &zeroValue}\n\td.GetClientPayload()\n\td = &DispatchRequestOptions{}\n\td.GetClientPayload()\n\td = nil\n\td.GetClientPayload()\n}\n\nfunc TestDispatchRequestOptions_GetEventType(tt *testing.T) {\n\ttt.Parallel()\n\td := &DispatchRequestOptions{}\n\td.GetEventType()\n\td = nil\n\td.GetEventType()\n}\n\nfunc TestDraftReviewComment_GetBody(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DraftReviewComment{Body: &zeroValue}\n\td.GetBody()\n\td = &DraftReviewComment{}\n\td.GetBody()\n\td = nil\n\td.GetBody()\n}\n\nfunc TestDraftReviewComment_GetLine(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\td := &DraftReviewComment{Line: &zeroValue}\n\td.GetLine()\n\td = &DraftReviewComment{}\n\td.GetLine()\n\td = nil\n\td.GetLine()\n}\n\nfunc TestDraftReviewComment_GetPath(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DraftReviewComment{Path: &zeroValue}\n\td.GetPath()\n\td = &DraftReviewComment{}\n\td.GetPath()\n\td = nil\n\td.GetPath()\n}\n\nfunc TestDraftReviewComment_GetPosition(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\td := &DraftReviewComment{Position: &zeroValue}\n\td.GetPosition()\n\td = &DraftReviewComment{}\n\td.GetPosition()\n\td = nil\n\td.GetPosition()\n}\n\nfunc TestDraftReviewComment_GetSide(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DraftReviewComment{Side: &zeroValue}\n\td.GetSide()\n\td = &DraftReviewComment{}\n\td.GetSide()\n\td = nil\n\td.GetSide()\n}\n\nfunc TestDraftReviewComment_GetStartLine(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\td := &DraftReviewComment{StartLine: &zeroValue}\n\td.GetStartLine()\n\td = &DraftReviewComment{}\n\td.GetStartLine()\n\td = nil\n\td.GetStartLine()\n}\n\nfunc TestDraftReviewComment_GetStartSide(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\td := &DraftReviewComment{StartSide: &zeroValue}\n\td.GetStartSide()\n\td = &DraftReviewComment{}\n\td.GetStartSide()\n\td = nil\n\td.GetStartSide()\n}\n\nfunc TestEditBase_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\te := &EditBase{}\n\te.GetRef()\n\te = nil\n\te.GetRef()\n}\n\nfunc TestEditBase_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\te := &EditBase{}\n\te.GetSHA()\n\te = nil\n\te.GetSHA()\n}\n\nfunc TestEditBody_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EditBody{From: &zeroValue}\n\te.GetFrom()\n\te = &EditBody{}\n\te.GetFrom()\n\te = nil\n\te.GetFrom()\n}\n\nfunc TestEditChange_GetBase(tt *testing.T) {\n\ttt.Parallel()\n\te := &EditChange{}\n\te.GetBase()\n\te = nil\n\te.GetBase()\n}\n\nfunc TestEditChange_GetBody(tt *testing.T) {\n\ttt.Parallel()\n\te := &EditChange{}\n\te.GetBody()\n\te = nil\n\te.GetBody()\n}\n\nfunc TestEditChange_GetDefaultBranch(tt *testing.T) {\n\ttt.Parallel()\n\te := &EditChange{}\n\te.GetDefaultBranch()\n\te = nil\n\te.GetDefaultBranch()\n}\n\nfunc TestEditChange_GetOwner(tt *testing.T) {\n\ttt.Parallel()\n\te := &EditChange{}\n\te.GetOwner()\n\te = nil\n\te.GetOwner()\n}\n\nfunc TestEditChange_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\te := &EditChange{}\n\te.GetRepo()\n\te = nil\n\te.GetRepo()\n}\n\nfunc TestEditChange_GetTitle(tt *testing.T) {\n\ttt.Parallel()\n\te := &EditChange{}\n\te.GetTitle()\n\te = nil\n\te.GetTitle()\n}\n\nfunc TestEditChange_GetTopics(tt *testing.T) {\n\ttt.Parallel()\n\te := &EditChange{}\n\te.GetTopics()\n\te = nil\n\te.GetTopics()\n}\n\nfunc TestEditDefaultBranch_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EditDefaultBranch{From: &zeroValue}\n\te.GetFrom()\n\te = &EditDefaultBranch{}\n\te.GetFrom()\n\te = nil\n\te.GetFrom()\n}\n\nfunc TestEditOwner_GetOwnerInfo(tt *testing.T) {\n\ttt.Parallel()\n\te := &EditOwner{}\n\te.GetOwnerInfo()\n\te = nil\n\te.GetOwnerInfo()\n}\n\nfunc TestEditRef_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EditRef{From: &zeroValue}\n\te.GetFrom()\n\te = &EditRef{}\n\te.GetFrom()\n\te = nil\n\te.GetFrom()\n}\n\nfunc TestEditRepo_GetName(tt *testing.T) {\n\ttt.Parallel()\n\te := &EditRepo{}\n\te.GetName()\n\te = nil\n\te.GetName()\n}\n\nfunc TestEditSHA_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EditSHA{From: &zeroValue}\n\te.GetFrom()\n\te = &EditSHA{}\n\te.GetFrom()\n\te = nil\n\te.GetFrom()\n}\n\nfunc TestEditTitle_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EditTitle{From: &zeroValue}\n\te.GetFrom()\n\te = &EditTitle{}\n\te.GetFrom()\n\te = nil\n\te.GetFrom()\n}\n\nfunc TestEditTopics_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\te := &EditTopics{From: zeroValue}\n\te.GetFrom()\n\te = &EditTopics{}\n\te.GetFrom()\n\te = nil\n\te.GetFrom()\n}\n\nfunc TestEncryptedSecret_GetEncryptedValue(tt *testing.T) {\n\ttt.Parallel()\n\te := &EncryptedSecret{}\n\te.GetEncryptedValue()\n\te = nil\n\te.GetEncryptedValue()\n}\n\nfunc TestEncryptedSecret_GetKeyID(tt *testing.T) {\n\ttt.Parallel()\n\te := &EncryptedSecret{}\n\te.GetKeyID()\n\te = nil\n\te.GetKeyID()\n}\n\nfunc TestEncryptedSecret_GetName(tt *testing.T) {\n\ttt.Parallel()\n\te := &EncryptedSecret{}\n\te.GetName()\n\te = nil\n\te.GetName()\n}\n\nfunc TestEncryptedSecret_GetSelectedRepositoryIDs(tt *testing.T) {\n\ttt.Parallel()\n\te := &EncryptedSecret{}\n\te.GetSelectedRepositoryIDs()\n\te = nil\n\te.GetSelectedRepositoryIDs()\n}\n\nfunc TestEncryptedSecret_GetVisibility(tt *testing.T) {\n\ttt.Parallel()\n\te := &EncryptedSecret{}\n\te.GetVisibility()\n\te = nil\n\te.GetVisibility()\n}\n\nfunc TestEnterprise_GetAvatarURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &Enterprise{AvatarURL: &zeroValue}\n\te.GetAvatarURL()\n\te = &Enterprise{}\n\te.GetAvatarURL()\n\te = nil\n\te.GetAvatarURL()\n}\n\nfunc TestEnterprise_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\te := &Enterprise{CreatedAt: &zeroValue}\n\te.GetCreatedAt()\n\te = &Enterprise{}\n\te.GetCreatedAt()\n\te = nil\n\te.GetCreatedAt()\n}\n\nfunc TestEnterprise_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &Enterprise{Description: &zeroValue}\n\te.GetDescription()\n\te = &Enterprise{}\n\te.GetDescription()\n\te = nil\n\te.GetDescription()\n}\n\nfunc TestEnterprise_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &Enterprise{HTMLURL: &zeroValue}\n\te.GetHTMLURL()\n\te = &Enterprise{}\n\te.GetHTMLURL()\n\te = nil\n\te.GetHTMLURL()\n}\n\nfunc TestEnterprise_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\te := &Enterprise{ID: &zeroValue}\n\te.GetID()\n\te = &Enterprise{}\n\te.GetID()\n\te = nil\n\te.GetID()\n}\n\nfunc TestEnterprise_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &Enterprise{Name: &zeroValue}\n\te.GetName()\n\te = &Enterprise{}\n\te.GetName()\n\te = nil\n\te.GetName()\n}\n\nfunc TestEnterprise_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &Enterprise{NodeID: &zeroValue}\n\te.GetNodeID()\n\te = &Enterprise{}\n\te.GetNodeID()\n\te = nil\n\te.GetNodeID()\n}\n\nfunc TestEnterprise_GetSlug(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &Enterprise{Slug: &zeroValue}\n\te.GetSlug()\n\te = &Enterprise{}\n\te.GetSlug()\n\te = nil\n\te.GetSlug()\n}\n\nfunc TestEnterprise_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\te := &Enterprise{UpdatedAt: &zeroValue}\n\te.GetUpdatedAt()\n\te = &Enterprise{}\n\te.GetUpdatedAt()\n\te = nil\n\te.GetUpdatedAt()\n}\n\nfunc TestEnterprise_GetWebsiteURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &Enterprise{WebsiteURL: &zeroValue}\n\te.GetWebsiteURL()\n\te = &Enterprise{}\n\te.GetWebsiteURL()\n\te = nil\n\te.GetWebsiteURL()\n}\n\nfunc TestEnterpriseBudget_GetBudgetAlerting(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseBudget{}\n\te.GetBudgetAlerting()\n\te = nil\n\te.GetBudgetAlerting()\n}\n\nfunc TestEnterpriseBudget_GetBudgetAmount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\te := &EnterpriseBudget{BudgetAmount: &zeroValue}\n\te.GetBudgetAmount()\n\te = &EnterpriseBudget{}\n\te.GetBudgetAmount()\n\te = nil\n\te.GetBudgetAmount()\n}\n\nfunc TestEnterpriseBudget_GetBudgetEntityName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnterpriseBudget{BudgetEntityName: &zeroValue}\n\te.GetBudgetEntityName()\n\te = &EnterpriseBudget{}\n\te.GetBudgetEntityName()\n\te = nil\n\te.GetBudgetEntityName()\n}\n\nfunc TestEnterpriseBudget_GetBudgetProductSKU(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnterpriseBudget{BudgetProductSKU: &zeroValue}\n\te.GetBudgetProductSKU()\n\te = &EnterpriseBudget{}\n\te.GetBudgetProductSKU()\n\te = nil\n\te.GetBudgetProductSKU()\n}\n\nfunc TestEnterpriseBudget_GetBudgetScope(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnterpriseBudget{BudgetScope: &zeroValue}\n\te.GetBudgetScope()\n\te = &EnterpriseBudget{}\n\te.GetBudgetScope()\n\te = nil\n\te.GetBudgetScope()\n}\n\nfunc TestEnterpriseBudget_GetBudgetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnterpriseBudget{BudgetType: &zeroValue}\n\te.GetBudgetType()\n\te = &EnterpriseBudget{}\n\te.GetBudgetType()\n\te = nil\n\te.GetBudgetType()\n}\n\nfunc TestEnterpriseBudget_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnterpriseBudget{ID: &zeroValue}\n\te.GetID()\n\te = &EnterpriseBudget{}\n\te.GetID()\n\te = nil\n\te.GetID()\n}\n\nfunc TestEnterpriseBudget_GetPreventFurtherUsage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\te := &EnterpriseBudget{PreventFurtherUsage: &zeroValue}\n\te.GetPreventFurtherUsage()\n\te = &EnterpriseBudget{}\n\te.GetPreventFurtherUsage()\n\te = nil\n\te.GetPreventFurtherUsage()\n}\n\nfunc TestEnterpriseBudgetAlerting_GetAlertRecipients(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\te := &EnterpriseBudgetAlerting{AlertRecipients: zeroValue}\n\te.GetAlertRecipients()\n\te = &EnterpriseBudgetAlerting{}\n\te.GetAlertRecipients()\n\te = nil\n\te.GetAlertRecipients()\n}\n\nfunc TestEnterpriseBudgetAlerting_GetWillAlert(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\te := &EnterpriseBudgetAlerting{WillAlert: &zeroValue}\n\te.GetWillAlert()\n\te = &EnterpriseBudgetAlerting{}\n\te.GetWillAlert()\n\te = nil\n\te.GetWillAlert()\n}\n\nfunc TestEnterpriseConsumedLicenses_GetTotalSeatsConsumed(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseConsumedLicenses{}\n\te.GetTotalSeatsConsumed()\n\te = nil\n\te.GetTotalSeatsConsumed()\n}\n\nfunc TestEnterpriseConsumedLicenses_GetTotalSeatsPurchased(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseConsumedLicenses{}\n\te.GetTotalSeatsPurchased()\n\te = nil\n\te.GetTotalSeatsPurchased()\n}\n\nfunc TestEnterpriseConsumedLicenses_GetUsers(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*EnterpriseLicensedUsers{}\n\te := &EnterpriseConsumedLicenses{Users: zeroValue}\n\te.GetUsers()\n\te = &EnterpriseConsumedLicenses{}\n\te.GetUsers()\n\te = nil\n\te.GetUsers()\n}\n\nfunc TestEnterpriseCreateBudget_GetBudgetAlerting(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseCreateBudget{}\n\te.GetBudgetAlerting()\n\te = nil\n\te.GetBudgetAlerting()\n}\n\nfunc TestEnterpriseCreateBudget_GetBudgetAmount(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseCreateBudget{}\n\te.GetBudgetAmount()\n\te = nil\n\te.GetBudgetAmount()\n}\n\nfunc TestEnterpriseCreateBudget_GetBudgetEntityName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnterpriseCreateBudget{BudgetEntityName: &zeroValue}\n\te.GetBudgetEntityName()\n\te = &EnterpriseCreateBudget{}\n\te.GetBudgetEntityName()\n\te = nil\n\te.GetBudgetEntityName()\n}\n\nfunc TestEnterpriseCreateBudget_GetBudgetProductSKU(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnterpriseCreateBudget{BudgetProductSKU: &zeroValue}\n\te.GetBudgetProductSKU()\n\te = &EnterpriseCreateBudget{}\n\te.GetBudgetProductSKU()\n\te = nil\n\te.GetBudgetProductSKU()\n}\n\nfunc TestEnterpriseCreateBudget_GetBudgetScope(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseCreateBudget{}\n\te.GetBudgetScope()\n\te = nil\n\te.GetBudgetScope()\n}\n\nfunc TestEnterpriseCreateBudget_GetBudgetType(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseCreateBudget{}\n\te.GetBudgetType()\n\te = nil\n\te.GetBudgetType()\n}\n\nfunc TestEnterpriseCreateBudget_GetPreventFurtherUsage(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseCreateBudget{}\n\te.GetPreventFurtherUsage()\n\te = nil\n\te.GetPreventFurtherUsage()\n}\n\nfunc TestEnterpriseCreateOrUpdateBudgetResponse_GetBudget(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseCreateOrUpdateBudgetResponse{}\n\te.GetBudget()\n\te = nil\n\te.GetBudget()\n}\n\nfunc TestEnterpriseCreateOrUpdateBudgetResponse_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseCreateOrUpdateBudgetResponse{}\n\te.GetMessage()\n\te = nil\n\te.GetMessage()\n}\n\nfunc TestEnterpriseCustomPropertiesValues_GetOrganizationID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\te := &EnterpriseCustomPropertiesValues{OrganizationID: &zeroValue}\n\te.GetOrganizationID()\n\te = &EnterpriseCustomPropertiesValues{}\n\te.GetOrganizationID()\n\te = nil\n\te.GetOrganizationID()\n}\n\nfunc TestEnterpriseCustomPropertiesValues_GetOrganizationLogin(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnterpriseCustomPropertiesValues{OrganizationLogin: &zeroValue}\n\te.GetOrganizationLogin()\n\te = &EnterpriseCustomPropertiesValues{}\n\te.GetOrganizationLogin()\n\te = nil\n\te.GetOrganizationLogin()\n}\n\nfunc TestEnterpriseCustomPropertiesValues_GetProperties(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CustomPropertyValue{}\n\te := &EnterpriseCustomPropertiesValues{Properties: zeroValue}\n\te.GetProperties()\n\te = &EnterpriseCustomPropertiesValues{}\n\te.GetProperties()\n\te = nil\n\te.GetProperties()\n}\n\nfunc TestEnterpriseCustomPropertySchema_GetProperties(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CustomProperty{}\n\te := &EnterpriseCustomPropertySchema{Properties: zeroValue}\n\te.GetProperties()\n\te = &EnterpriseCustomPropertySchema{}\n\te.GetProperties()\n\te = nil\n\te.GetProperties()\n}\n\nfunc TestEnterpriseCustomPropertyValuesRequest_GetOrganizationLogin(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\te := &EnterpriseCustomPropertyValuesRequest{OrganizationLogin: zeroValue}\n\te.GetOrganizationLogin()\n\te = &EnterpriseCustomPropertyValuesRequest{}\n\te.GetOrganizationLogin()\n\te = nil\n\te.GetOrganizationLogin()\n}\n\nfunc TestEnterpriseCustomPropertyValuesRequest_GetProperties(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CustomPropertyValue{}\n\te := &EnterpriseCustomPropertyValuesRequest{Properties: zeroValue}\n\te.GetProperties()\n\te = &EnterpriseCustomPropertyValuesRequest{}\n\te.GetProperties()\n\te = nil\n\te.GetProperties()\n}\n\nfunc TestEnterpriseDeleteBudgetResponse_GetID(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseDeleteBudgetResponse{}\n\te.GetID()\n\te = nil\n\te.GetID()\n}\n\nfunc TestEnterpriseDeleteBudgetResponse_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseDeleteBudgetResponse{}\n\te.GetMessage()\n\te = nil\n\te.GetMessage()\n}\n\nfunc TestEnterpriseLicensedUsers_GetEnterpriseServerEmails(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\te := &EnterpriseLicensedUsers{EnterpriseServerEmails: zeroValue}\n\te.GetEnterpriseServerEmails()\n\te = &EnterpriseLicensedUsers{}\n\te.GetEnterpriseServerEmails()\n\te = nil\n\te.GetEnterpriseServerEmails()\n}\n\nfunc TestEnterpriseLicensedUsers_GetEnterpriseServerUser(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\te := &EnterpriseLicensedUsers{EnterpriseServerUser: &zeroValue}\n\te.GetEnterpriseServerUser()\n\te = &EnterpriseLicensedUsers{}\n\te.GetEnterpriseServerUser()\n\te = nil\n\te.GetEnterpriseServerUser()\n}\n\nfunc TestEnterpriseLicensedUsers_GetEnterpriseServerUserIDs(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\te := &EnterpriseLicensedUsers{EnterpriseServerUserIDs: zeroValue}\n\te.GetEnterpriseServerUserIDs()\n\te = &EnterpriseLicensedUsers{}\n\te.GetEnterpriseServerUserIDs()\n\te = nil\n\te.GetEnterpriseServerUserIDs()\n}\n\nfunc TestEnterpriseLicensedUsers_GetGithubComEnterpriseRoles(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\te := &EnterpriseLicensedUsers{GithubComEnterpriseRoles: zeroValue}\n\te.GetGithubComEnterpriseRoles()\n\te = &EnterpriseLicensedUsers{}\n\te.GetGithubComEnterpriseRoles()\n\te = nil\n\te.GetGithubComEnterpriseRoles()\n}\n\nfunc TestEnterpriseLicensedUsers_GetGithubComLogin(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseLicensedUsers{}\n\te.GetGithubComLogin()\n\te = nil\n\te.GetGithubComLogin()\n}\n\nfunc TestEnterpriseLicensedUsers_GetGithubComMemberRoles(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\te := &EnterpriseLicensedUsers{GithubComMemberRoles: zeroValue}\n\te.GetGithubComMemberRoles()\n\te = &EnterpriseLicensedUsers{}\n\te.GetGithubComMemberRoles()\n\te = nil\n\te.GetGithubComMemberRoles()\n}\n\nfunc TestEnterpriseLicensedUsers_GetGithubComName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnterpriseLicensedUsers{GithubComName: &zeroValue}\n\te.GetGithubComName()\n\te = &EnterpriseLicensedUsers{}\n\te.GetGithubComName()\n\te = nil\n\te.GetGithubComName()\n}\n\nfunc TestEnterpriseLicensedUsers_GetGithubComOrgsWithPendingInvites(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\te := &EnterpriseLicensedUsers{GithubComOrgsWithPendingInvites: zeroValue}\n\te.GetGithubComOrgsWithPendingInvites()\n\te = &EnterpriseLicensedUsers{}\n\te.GetGithubComOrgsWithPendingInvites()\n\te = nil\n\te.GetGithubComOrgsWithPendingInvites()\n}\n\nfunc TestEnterpriseLicensedUsers_GetGithubComProfile(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnterpriseLicensedUsers{GithubComProfile: &zeroValue}\n\te.GetGithubComProfile()\n\te = &EnterpriseLicensedUsers{}\n\te.GetGithubComProfile()\n\te = nil\n\te.GetGithubComProfile()\n}\n\nfunc TestEnterpriseLicensedUsers_GetGithubComSamlNameID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnterpriseLicensedUsers{GithubComSamlNameID: &zeroValue}\n\te.GetGithubComSamlNameID()\n\te = &EnterpriseLicensedUsers{}\n\te.GetGithubComSamlNameID()\n\te = nil\n\te.GetGithubComSamlNameID()\n}\n\nfunc TestEnterpriseLicensedUsers_GetGithubComTwoFactorAuth(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\te := &EnterpriseLicensedUsers{GithubComTwoFactorAuth: &zeroValue}\n\te.GetGithubComTwoFactorAuth()\n\te = &EnterpriseLicensedUsers{}\n\te.GetGithubComTwoFactorAuth()\n\te = nil\n\te.GetGithubComTwoFactorAuth()\n}\n\nfunc TestEnterpriseLicensedUsers_GetGithubComUser(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseLicensedUsers{}\n\te.GetGithubComUser()\n\te = nil\n\te.GetGithubComUser()\n}\n\nfunc TestEnterpriseLicensedUsers_GetGithubComVerifiedDomainEmails(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\te := &EnterpriseLicensedUsers{GithubComVerifiedDomainEmails: zeroValue}\n\te.GetGithubComVerifiedDomainEmails()\n\te = &EnterpriseLicensedUsers{}\n\te.GetGithubComVerifiedDomainEmails()\n\te = nil\n\te.GetGithubComVerifiedDomainEmails()\n}\n\nfunc TestEnterpriseLicensedUsers_GetLicenseType(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseLicensedUsers{}\n\te.GetLicenseType()\n\te = nil\n\te.GetLicenseType()\n}\n\nfunc TestEnterpriseLicensedUsers_GetTotalUserAccounts(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseLicensedUsers{}\n\te.GetTotalUserAccounts()\n\te = nil\n\te.GetTotalUserAccounts()\n}\n\nfunc TestEnterpriseLicensedUsers_GetVisualStudioLicenseStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnterpriseLicensedUsers{VisualStudioLicenseStatus: &zeroValue}\n\te.GetVisualStudioLicenseStatus()\n\te = &EnterpriseLicensedUsers{}\n\te.GetVisualStudioLicenseStatus()\n\te = nil\n\te.GetVisualStudioLicenseStatus()\n}\n\nfunc TestEnterpriseLicensedUsers_GetVisualStudioSubscriptionEmail(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnterpriseLicensedUsers{VisualStudioSubscriptionEmail: &zeroValue}\n\te.GetVisualStudioSubscriptionEmail()\n\te = &EnterpriseLicensedUsers{}\n\te.GetVisualStudioSubscriptionEmail()\n\te = nil\n\te.GetVisualStudioSubscriptionEmail()\n}\n\nfunc TestEnterpriseLicensedUsers_GetVisualStudioSubscriptionUser(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseLicensedUsers{}\n\te.GetVisualStudioSubscriptionUser()\n\te = nil\n\te.GetVisualStudioSubscriptionUser()\n}\n\nfunc TestEnterpriseLicenseSyncStatus_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseLicenseSyncStatus{}\n\te.GetDescription()\n\te = nil\n\te.GetDescription()\n}\n\nfunc TestEnterpriseLicenseSyncStatus_GetProperties(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseLicenseSyncStatus{}\n\te.GetProperties()\n\te = nil\n\te.GetProperties()\n}\n\nfunc TestEnterpriseLicenseSyncStatus_GetTitle(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseLicenseSyncStatus{}\n\te.GetTitle()\n\te = nil\n\te.GetTitle()\n}\n\nfunc TestEnterpriseListBudgets_GetBudgets(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*EnterpriseBudget{}\n\te := &EnterpriseListBudgets{Budgets: zeroValue}\n\te.GetBudgets()\n\te = &EnterpriseListBudgets{}\n\te.GetBudgets()\n\te = nil\n\te.GetBudgets()\n}\n\nfunc TestEnterpriseListBudgets_GetHasNextPage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\te := &EnterpriseListBudgets{HasNextPage: &zeroValue}\n\te.GetHasNextPage()\n\te = &EnterpriseListBudgets{}\n\te.GetHasNextPage()\n\te = nil\n\te.GetHasNextPage()\n}\n\nfunc TestEnterpriseListBudgets_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\te := &EnterpriseListBudgets{TotalCount: &zeroValue}\n\te.GetTotalCount()\n\te = &EnterpriseListBudgets{}\n\te.GetTotalCount()\n\te = nil\n\te.GetTotalCount()\n}\n\nfunc TestEnterpriseRunnerGroup_GetAllowsPublicRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\te := &EnterpriseRunnerGroup{AllowsPublicRepositories: &zeroValue}\n\te.GetAllowsPublicRepositories()\n\te = &EnterpriseRunnerGroup{}\n\te.GetAllowsPublicRepositories()\n\te = nil\n\te.GetAllowsPublicRepositories()\n}\n\nfunc TestEnterpriseRunnerGroup_GetDefault(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\te := &EnterpriseRunnerGroup{Default: &zeroValue}\n\te.GetDefault()\n\te = &EnterpriseRunnerGroup{}\n\te.GetDefault()\n\te = nil\n\te.GetDefault()\n}\n\nfunc TestEnterpriseRunnerGroup_GetHostedRunnersURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnterpriseRunnerGroup{HostedRunnersURL: &zeroValue}\n\te.GetHostedRunnersURL()\n\te = &EnterpriseRunnerGroup{}\n\te.GetHostedRunnersURL()\n\te = nil\n\te.GetHostedRunnersURL()\n}\n\nfunc TestEnterpriseRunnerGroup_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\te := &EnterpriseRunnerGroup{ID: &zeroValue}\n\te.GetID()\n\te = &EnterpriseRunnerGroup{}\n\te.GetID()\n\te = nil\n\te.GetID()\n}\n\nfunc TestEnterpriseRunnerGroup_GetInherited(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\te := &EnterpriseRunnerGroup{Inherited: &zeroValue}\n\te.GetInherited()\n\te = &EnterpriseRunnerGroup{}\n\te.GetInherited()\n\te = nil\n\te.GetInherited()\n}\n\nfunc TestEnterpriseRunnerGroup_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnterpriseRunnerGroup{Name: &zeroValue}\n\te.GetName()\n\te = &EnterpriseRunnerGroup{}\n\te.GetName()\n\te = nil\n\te.GetName()\n}\n\nfunc TestEnterpriseRunnerGroup_GetNetworkConfigurationID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnterpriseRunnerGroup{NetworkConfigurationID: &zeroValue}\n\te.GetNetworkConfigurationID()\n\te = &EnterpriseRunnerGroup{}\n\te.GetNetworkConfigurationID()\n\te = nil\n\te.GetNetworkConfigurationID()\n}\n\nfunc TestEnterpriseRunnerGroup_GetRestrictedToWorkflows(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\te := &EnterpriseRunnerGroup{RestrictedToWorkflows: &zeroValue}\n\te.GetRestrictedToWorkflows()\n\te = &EnterpriseRunnerGroup{}\n\te.GetRestrictedToWorkflows()\n\te = nil\n\te.GetRestrictedToWorkflows()\n}\n\nfunc TestEnterpriseRunnerGroup_GetRunnersURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnterpriseRunnerGroup{RunnersURL: &zeroValue}\n\te.GetRunnersURL()\n\te = &EnterpriseRunnerGroup{}\n\te.GetRunnersURL()\n\te = nil\n\te.GetRunnersURL()\n}\n\nfunc TestEnterpriseRunnerGroup_GetSelectedOrganizationsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnterpriseRunnerGroup{SelectedOrganizationsURL: &zeroValue}\n\te.GetSelectedOrganizationsURL()\n\te = &EnterpriseRunnerGroup{}\n\te.GetSelectedOrganizationsURL()\n\te = nil\n\te.GetSelectedOrganizationsURL()\n}\n\nfunc TestEnterpriseRunnerGroup_GetSelectedWorkflows(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\te := &EnterpriseRunnerGroup{SelectedWorkflows: zeroValue}\n\te.GetSelectedWorkflows()\n\te = &EnterpriseRunnerGroup{}\n\te.GetSelectedWorkflows()\n\te = nil\n\te.GetSelectedWorkflows()\n}\n\nfunc TestEnterpriseRunnerGroup_GetVisibility(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnterpriseRunnerGroup{Visibility: &zeroValue}\n\te.GetVisibility()\n\te = &EnterpriseRunnerGroup{}\n\te.GetVisibility()\n\te = nil\n\te.GetVisibility()\n}\n\nfunc TestEnterpriseRunnerGroup_GetWorkflowRestrictionsReadOnly(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\te := &EnterpriseRunnerGroup{WorkflowRestrictionsReadOnly: &zeroValue}\n\te.GetWorkflowRestrictionsReadOnly()\n\te = &EnterpriseRunnerGroup{}\n\te.GetWorkflowRestrictionsReadOnly()\n\te = nil\n\te.GetWorkflowRestrictionsReadOnly()\n}\n\nfunc TestEnterpriseRunnerGroups_GetRunnerGroups(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*EnterpriseRunnerGroup{}\n\te := &EnterpriseRunnerGroups{RunnerGroups: zeroValue}\n\te.GetRunnerGroups()\n\te = &EnterpriseRunnerGroups{}\n\te.GetRunnerGroups()\n\te = nil\n\te.GetRunnerGroups()\n}\n\nfunc TestEnterpriseRunnerGroups_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\te := &EnterpriseRunnerGroups{TotalCount: &zeroValue}\n\te.GetTotalCount()\n\te = &EnterpriseRunnerGroups{}\n\te.GetTotalCount()\n\te = nil\n\te.GetTotalCount()\n}\n\nfunc TestEnterpriseSecurityAnalysisSettings_GetAdvancedSecurityEnabledForNewRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\te := &EnterpriseSecurityAnalysisSettings{AdvancedSecurityEnabledForNewRepositories: &zeroValue}\n\te.GetAdvancedSecurityEnabledForNewRepositories()\n\te = &EnterpriseSecurityAnalysisSettings{}\n\te.GetAdvancedSecurityEnabledForNewRepositories()\n\te = nil\n\te.GetAdvancedSecurityEnabledForNewRepositories()\n}\n\nfunc TestEnterpriseSecurityAnalysisSettings_GetSecretScanningEnabledForNewRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\te := &EnterpriseSecurityAnalysisSettings{SecretScanningEnabledForNewRepositories: &zeroValue}\n\te.GetSecretScanningEnabledForNewRepositories()\n\te = &EnterpriseSecurityAnalysisSettings{}\n\te.GetSecretScanningEnabledForNewRepositories()\n\te = nil\n\te.GetSecretScanningEnabledForNewRepositories()\n}\n\nfunc TestEnterpriseSecurityAnalysisSettings_GetSecretScanningPushProtectionCustomLink(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnterpriseSecurityAnalysisSettings{SecretScanningPushProtectionCustomLink: &zeroValue}\n\te.GetSecretScanningPushProtectionCustomLink()\n\te = &EnterpriseSecurityAnalysisSettings{}\n\te.GetSecretScanningPushProtectionCustomLink()\n\te = nil\n\te.GetSecretScanningPushProtectionCustomLink()\n}\n\nfunc TestEnterpriseSecurityAnalysisSettings_GetSecretScanningPushProtectionEnabledForNewRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\te := &EnterpriseSecurityAnalysisSettings{SecretScanningPushProtectionEnabledForNewRepositories: &zeroValue}\n\te.GetSecretScanningPushProtectionEnabledForNewRepositories()\n\te = &EnterpriseSecurityAnalysisSettings{}\n\te.GetSecretScanningPushProtectionEnabledForNewRepositories()\n\te = nil\n\te.GetSecretScanningPushProtectionEnabledForNewRepositories()\n}\n\nfunc TestEnterpriseSecurityAnalysisSettings_GetSecretScanningValidityChecksEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\te := &EnterpriseSecurityAnalysisSettings{SecretScanningValidityChecksEnabled: &zeroValue}\n\te.GetSecretScanningValidityChecksEnabled()\n\te = &EnterpriseSecurityAnalysisSettings{}\n\te.GetSecretScanningValidityChecksEnabled()\n\te = nil\n\te.GetSecretScanningValidityChecksEnabled()\n}\n\nfunc TestEnterpriseTeam_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseTeam{}\n\te.GetCreatedAt()\n\te = nil\n\te.GetCreatedAt()\n}\n\nfunc TestEnterpriseTeam_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnterpriseTeam{Description: &zeroValue}\n\te.GetDescription()\n\te = &EnterpriseTeam{}\n\te.GetDescription()\n\te = nil\n\te.GetDescription()\n}\n\nfunc TestEnterpriseTeam_GetGroupID(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseTeam{}\n\te.GetGroupID()\n\te = nil\n\te.GetGroupID()\n}\n\nfunc TestEnterpriseTeam_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseTeam{}\n\te.GetHTMLURL()\n\te = nil\n\te.GetHTMLURL()\n}\n\nfunc TestEnterpriseTeam_GetID(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseTeam{}\n\te.GetID()\n\te = nil\n\te.GetID()\n}\n\nfunc TestEnterpriseTeam_GetMemberURL(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseTeam{}\n\te.GetMemberURL()\n\te = nil\n\te.GetMemberURL()\n}\n\nfunc TestEnterpriseTeam_GetName(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseTeam{}\n\te.GetName()\n\te = nil\n\te.GetName()\n}\n\nfunc TestEnterpriseTeam_GetOrganizationSelectionType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnterpriseTeam{OrganizationSelectionType: &zeroValue}\n\te.GetOrganizationSelectionType()\n\te = &EnterpriseTeam{}\n\te.GetOrganizationSelectionType()\n\te = nil\n\te.GetOrganizationSelectionType()\n}\n\nfunc TestEnterpriseTeam_GetSlug(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseTeam{}\n\te.GetSlug()\n\te = nil\n\te.GetSlug()\n}\n\nfunc TestEnterpriseTeam_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseTeam{}\n\te.GetUpdatedAt()\n\te = nil\n\te.GetUpdatedAt()\n}\n\nfunc TestEnterpriseTeam_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseTeam{}\n\te.GetURL()\n\te = nil\n\te.GetURL()\n}\n\nfunc TestEnterpriseTeamCreateOrUpdateRequest_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnterpriseTeamCreateOrUpdateRequest{Description: &zeroValue}\n\te.GetDescription()\n\te = &EnterpriseTeamCreateOrUpdateRequest{}\n\te.GetDescription()\n\te = nil\n\te.GetDescription()\n}\n\nfunc TestEnterpriseTeamCreateOrUpdateRequest_GetGroupID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnterpriseTeamCreateOrUpdateRequest{GroupID: &zeroValue}\n\te.GetGroupID()\n\te = &EnterpriseTeamCreateOrUpdateRequest{}\n\te.GetGroupID()\n\te = nil\n\te.GetGroupID()\n}\n\nfunc TestEnterpriseTeamCreateOrUpdateRequest_GetName(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseTeamCreateOrUpdateRequest{}\n\te.GetName()\n\te = nil\n\te.GetName()\n}\n\nfunc TestEnterpriseTeamCreateOrUpdateRequest_GetOrganizationSelectionType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnterpriseTeamCreateOrUpdateRequest{OrganizationSelectionType: &zeroValue}\n\te.GetOrganizationSelectionType()\n\te = &EnterpriseTeamCreateOrUpdateRequest{}\n\te.GetOrganizationSelectionType()\n\te = nil\n\te.GetOrganizationSelectionType()\n}\n\nfunc TestEnterpriseUpdateBudget_GetBudgetAlerting(tt *testing.T) {\n\ttt.Parallel()\n\te := &EnterpriseUpdateBudget{}\n\te.GetBudgetAlerting()\n\te = nil\n\te.GetBudgetAlerting()\n}\n\nfunc TestEnterpriseUpdateBudget_GetBudgetAmount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\te := &EnterpriseUpdateBudget{BudgetAmount: &zeroValue}\n\te.GetBudgetAmount()\n\te = &EnterpriseUpdateBudget{}\n\te.GetBudgetAmount()\n\te = nil\n\te.GetBudgetAmount()\n}\n\nfunc TestEnterpriseUpdateBudget_GetBudgetEntityName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnterpriseUpdateBudget{BudgetEntityName: &zeroValue}\n\te.GetBudgetEntityName()\n\te = &EnterpriseUpdateBudget{}\n\te.GetBudgetEntityName()\n\te = nil\n\te.GetBudgetEntityName()\n}\n\nfunc TestEnterpriseUpdateBudget_GetBudgetProductSKU(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnterpriseUpdateBudget{BudgetProductSKU: &zeroValue}\n\te.GetBudgetProductSKU()\n\te = &EnterpriseUpdateBudget{}\n\te.GetBudgetProductSKU()\n\te = nil\n\te.GetBudgetProductSKU()\n}\n\nfunc TestEnterpriseUpdateBudget_GetBudgetScope(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnterpriseUpdateBudget{BudgetScope: &zeroValue}\n\te.GetBudgetScope()\n\te = &EnterpriseUpdateBudget{}\n\te.GetBudgetScope()\n\te = nil\n\te.GetBudgetScope()\n}\n\nfunc TestEnterpriseUpdateBudget_GetBudgetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnterpriseUpdateBudget{BudgetType: &zeroValue}\n\te.GetBudgetType()\n\te = &EnterpriseUpdateBudget{}\n\te.GetBudgetType()\n\te = nil\n\te.GetBudgetType()\n}\n\nfunc TestEnterpriseUpdateBudget_GetPreventFurtherUsage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\te := &EnterpriseUpdateBudget{PreventFurtherUsage: &zeroValue}\n\te.GetPreventFurtherUsage()\n\te = &EnterpriseUpdateBudget{}\n\te.GetPreventFurtherUsage()\n\te = nil\n\te.GetPreventFurtherUsage()\n}\n\nfunc TestEnvironment_GetCanAdminsBypass(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\te := &Environment{CanAdminsBypass: &zeroValue}\n\te.GetCanAdminsBypass()\n\te = &Environment{}\n\te.GetCanAdminsBypass()\n\te = nil\n\te.GetCanAdminsBypass()\n}\n\nfunc TestEnvironment_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\te := &Environment{CreatedAt: &zeroValue}\n\te.GetCreatedAt()\n\te = &Environment{}\n\te.GetCreatedAt()\n\te = nil\n\te.GetCreatedAt()\n}\n\nfunc TestEnvironment_GetDeploymentBranchPolicy(tt *testing.T) {\n\ttt.Parallel()\n\te := &Environment{}\n\te.GetDeploymentBranchPolicy()\n\te = nil\n\te.GetDeploymentBranchPolicy()\n}\n\nfunc TestEnvironment_GetEnvironmentName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &Environment{EnvironmentName: &zeroValue}\n\te.GetEnvironmentName()\n\te = &Environment{}\n\te.GetEnvironmentName()\n\te = nil\n\te.GetEnvironmentName()\n}\n\nfunc TestEnvironment_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &Environment{HTMLURL: &zeroValue}\n\te.GetHTMLURL()\n\te = &Environment{}\n\te.GetHTMLURL()\n\te = nil\n\te.GetHTMLURL()\n}\n\nfunc TestEnvironment_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\te := &Environment{ID: &zeroValue}\n\te.GetID()\n\te = &Environment{}\n\te.GetID()\n\te = nil\n\te.GetID()\n}\n\nfunc TestEnvironment_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &Environment{Name: &zeroValue}\n\te.GetName()\n\te = &Environment{}\n\te.GetName()\n\te = nil\n\te.GetName()\n}\n\nfunc TestEnvironment_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &Environment{NodeID: &zeroValue}\n\te.GetNodeID()\n\te = &Environment{}\n\te.GetNodeID()\n\te = nil\n\te.GetNodeID()\n}\n\nfunc TestEnvironment_GetOwner(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &Environment{Owner: &zeroValue}\n\te.GetOwner()\n\te = &Environment{}\n\te.GetOwner()\n\te = nil\n\te.GetOwner()\n}\n\nfunc TestEnvironment_GetProtectionRules(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*ProtectionRule{}\n\te := &Environment{ProtectionRules: zeroValue}\n\te.GetProtectionRules()\n\te = &Environment{}\n\te.GetProtectionRules()\n\te = nil\n\te.GetProtectionRules()\n}\n\nfunc TestEnvironment_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &Environment{Repo: &zeroValue}\n\te.GetRepo()\n\te = &Environment{}\n\te.GetRepo()\n\te = nil\n\te.GetRepo()\n}\n\nfunc TestEnvironment_GetReviewers(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*EnvReviewers{}\n\te := &Environment{Reviewers: zeroValue}\n\te.GetReviewers()\n\te = &Environment{}\n\te.GetReviewers()\n\te = nil\n\te.GetReviewers()\n}\n\nfunc TestEnvironment_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\te := &Environment{UpdatedAt: &zeroValue}\n\te.GetUpdatedAt()\n\te = &Environment{}\n\te.GetUpdatedAt()\n\te = nil\n\te.GetUpdatedAt()\n}\n\nfunc TestEnvironment_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &Environment{URL: &zeroValue}\n\te.GetURL()\n\te = &Environment{}\n\te.GetURL()\n\te = nil\n\te.GetURL()\n}\n\nfunc TestEnvironment_GetWaitTimer(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\te := &Environment{WaitTimer: &zeroValue}\n\te.GetWaitTimer()\n\te = &Environment{}\n\te.GetWaitTimer()\n\te = nil\n\te.GetWaitTimer()\n}\n\nfunc TestEnvResponse_GetEnvironments(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Environment{}\n\te := &EnvResponse{Environments: zeroValue}\n\te.GetEnvironments()\n\te = &EnvResponse{}\n\te.GetEnvironments()\n\te = nil\n\te.GetEnvironments()\n}\n\nfunc TestEnvResponse_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\te := &EnvResponse{TotalCount: &zeroValue}\n\te.GetTotalCount()\n\te = &EnvResponse{}\n\te.GetTotalCount()\n\te = nil\n\te.GetTotalCount()\n}\n\nfunc TestEnvReviewers_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\te := &EnvReviewers{ID: &zeroValue}\n\te.GetID()\n\te = &EnvReviewers{}\n\te.GetID()\n\te = nil\n\te.GetID()\n}\n\nfunc TestEnvReviewers_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &EnvReviewers{Type: &zeroValue}\n\te.GetType()\n\te = &EnvReviewers{}\n\te.GetType()\n\te = nil\n\te.GetType()\n}\n\nfunc TestError_GetCode(tt *testing.T) {\n\ttt.Parallel()\n\te := &Error{}\n\te.GetCode()\n\te = nil\n\te.GetCode()\n}\n\nfunc TestError_GetField(tt *testing.T) {\n\ttt.Parallel()\n\te := &Error{}\n\te.GetField()\n\te = nil\n\te.GetField()\n}\n\nfunc TestError_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\te := &Error{}\n\te.GetMessage()\n\te = nil\n\te.GetMessage()\n}\n\nfunc TestError_GetResource(tt *testing.T) {\n\ttt.Parallel()\n\te := &Error{}\n\te.GetResource()\n\te = nil\n\te.GetResource()\n}\n\nfunc TestErrorBlock_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\te := &ErrorBlock{CreatedAt: &zeroValue}\n\te.GetCreatedAt()\n\te = &ErrorBlock{}\n\te.GetCreatedAt()\n\te = nil\n\te.GetCreatedAt()\n}\n\nfunc TestErrorBlock_GetReason(tt *testing.T) {\n\ttt.Parallel()\n\te := &ErrorBlock{}\n\te.GetReason()\n\te = nil\n\te.GetReason()\n}\n\nfunc TestErrorResponse_GetBlock(tt *testing.T) {\n\ttt.Parallel()\n\te := &ErrorResponse{}\n\te.GetBlock()\n\te = nil\n\te.GetBlock()\n}\n\nfunc TestErrorResponse_GetDocumentationURL(tt *testing.T) {\n\ttt.Parallel()\n\te := &ErrorResponse{}\n\te.GetDocumentationURL()\n\te = nil\n\te.GetDocumentationURL()\n}\n\nfunc TestErrorResponse_GetErrors(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []Error{}\n\te := &ErrorResponse{Errors: zeroValue}\n\te.GetErrors()\n\te = &ErrorResponse{}\n\te.GetErrors()\n\te = nil\n\te.GetErrors()\n}\n\nfunc TestErrorResponse_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\te := &ErrorResponse{}\n\te.GetMessage()\n\te = nil\n\te.GetMessage()\n}\n\nfunc TestEvent_GetActor(tt *testing.T) {\n\ttt.Parallel()\n\te := &Event{}\n\te.GetActor()\n\te = nil\n\te.GetActor()\n}\n\nfunc TestEvent_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\te := &Event{CreatedAt: &zeroValue}\n\te.GetCreatedAt()\n\te = &Event{}\n\te.GetCreatedAt()\n\te = nil\n\te.GetCreatedAt()\n}\n\nfunc TestEvent_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &Event{ID: &zeroValue}\n\te.GetID()\n\te = &Event{}\n\te.GetID()\n\te = nil\n\te.GetID()\n}\n\nfunc TestEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\te := &Event{}\n\te.GetOrg()\n\te = nil\n\te.GetOrg()\n}\n\nfunc TestEvent_GetPublic(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\te := &Event{Public: &zeroValue}\n\te.GetPublic()\n\te = &Event{}\n\te.GetPublic()\n\te = nil\n\te.GetPublic()\n}\n\nfunc TestEvent_GetRawPayload(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue json.RawMessage\n\te := &Event{RawPayload: &zeroValue}\n\te.GetRawPayload()\n\te = &Event{}\n\te.GetRawPayload()\n\te = nil\n\te.GetRawPayload()\n}\n\nfunc TestEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\te := &Event{}\n\te.GetRepo()\n\te = nil\n\te.GetRepo()\n}\n\nfunc TestEvent_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &Event{Type: &zeroValue}\n\te.GetType()\n\te = &Event{}\n\te.GetType()\n\te = nil\n\te.GetType()\n}\n\nfunc TestExternalGroup_GetGroupID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\te := &ExternalGroup{GroupID: &zeroValue}\n\te.GetGroupID()\n\te = &ExternalGroup{}\n\te.GetGroupID()\n\te = nil\n\te.GetGroupID()\n}\n\nfunc TestExternalGroup_GetGroupName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &ExternalGroup{GroupName: &zeroValue}\n\te.GetGroupName()\n\te = &ExternalGroup{}\n\te.GetGroupName()\n\te = nil\n\te.GetGroupName()\n}\n\nfunc TestExternalGroup_GetMembers(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*ExternalGroupMember{}\n\te := &ExternalGroup{Members: zeroValue}\n\te.GetMembers()\n\te = &ExternalGroup{}\n\te.GetMembers()\n\te = nil\n\te.GetMembers()\n}\n\nfunc TestExternalGroup_GetTeams(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*ExternalGroupTeam{}\n\te := &ExternalGroup{Teams: zeroValue}\n\te.GetTeams()\n\te = &ExternalGroup{}\n\te.GetTeams()\n\te = nil\n\te.GetTeams()\n}\n\nfunc TestExternalGroup_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\te := &ExternalGroup{UpdatedAt: &zeroValue}\n\te.GetUpdatedAt()\n\te = &ExternalGroup{}\n\te.GetUpdatedAt()\n\te = nil\n\te.GetUpdatedAt()\n}\n\nfunc TestExternalGroupList_GetGroups(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*ExternalGroup{}\n\te := &ExternalGroupList{Groups: zeroValue}\n\te.GetGroups()\n\te = &ExternalGroupList{}\n\te.GetGroups()\n\te = nil\n\te.GetGroups()\n}\n\nfunc TestExternalGroupMember_GetMemberEmail(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &ExternalGroupMember{MemberEmail: &zeroValue}\n\te.GetMemberEmail()\n\te = &ExternalGroupMember{}\n\te.GetMemberEmail()\n\te = nil\n\te.GetMemberEmail()\n}\n\nfunc TestExternalGroupMember_GetMemberID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\te := &ExternalGroupMember{MemberID: &zeroValue}\n\te.GetMemberID()\n\te = &ExternalGroupMember{}\n\te.GetMemberID()\n\te = nil\n\te.GetMemberID()\n}\n\nfunc TestExternalGroupMember_GetMemberLogin(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &ExternalGroupMember{MemberLogin: &zeroValue}\n\te.GetMemberLogin()\n\te = &ExternalGroupMember{}\n\te.GetMemberLogin()\n\te = nil\n\te.GetMemberLogin()\n}\n\nfunc TestExternalGroupMember_GetMemberName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &ExternalGroupMember{MemberName: &zeroValue}\n\te.GetMemberName()\n\te = &ExternalGroupMember{}\n\te.GetMemberName()\n\te = nil\n\te.GetMemberName()\n}\n\nfunc TestExternalGroupTeam_GetTeamID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\te := &ExternalGroupTeam{TeamID: &zeroValue}\n\te.GetTeamID()\n\te = &ExternalGroupTeam{}\n\te.GetTeamID()\n\te = nil\n\te.GetTeamID()\n}\n\nfunc TestExternalGroupTeam_GetTeamName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\te := &ExternalGroupTeam{TeamName: &zeroValue}\n\te.GetTeamName()\n\te = &ExternalGroupTeam{}\n\te.GetTeamName()\n\te = nil\n\te.GetTeamName()\n}\n\nfunc TestFeedLink_GetHRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tf := &FeedLink{HRef: &zeroValue}\n\tf.GetHRef()\n\tf = &FeedLink{}\n\tf.GetHRef()\n\tf = nil\n\tf.GetHRef()\n}\n\nfunc TestFeedLink_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tf := &FeedLink{Type: &zeroValue}\n\tf.GetType()\n\tf = &FeedLink{}\n\tf.GetType()\n\tf = nil\n\tf.GetType()\n}\n\nfunc TestFeedLinks_GetCurrentUser(tt *testing.T) {\n\ttt.Parallel()\n\tf := &FeedLinks{}\n\tf.GetCurrentUser()\n\tf = nil\n\tf.GetCurrentUser()\n}\n\nfunc TestFeedLinks_GetCurrentUserActor(tt *testing.T) {\n\ttt.Parallel()\n\tf := &FeedLinks{}\n\tf.GetCurrentUserActor()\n\tf = nil\n\tf.GetCurrentUserActor()\n}\n\nfunc TestFeedLinks_GetCurrentUserOrganization(tt *testing.T) {\n\ttt.Parallel()\n\tf := &FeedLinks{}\n\tf.GetCurrentUserOrganization()\n\tf = nil\n\tf.GetCurrentUserOrganization()\n}\n\nfunc TestFeedLinks_GetCurrentUserOrganizations(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*FeedLink{}\n\tf := &FeedLinks{CurrentUserOrganizations: zeroValue}\n\tf.GetCurrentUserOrganizations()\n\tf = &FeedLinks{}\n\tf.GetCurrentUserOrganizations()\n\tf = nil\n\tf.GetCurrentUserOrganizations()\n}\n\nfunc TestFeedLinks_GetCurrentUserPublic(tt *testing.T) {\n\ttt.Parallel()\n\tf := &FeedLinks{}\n\tf.GetCurrentUserPublic()\n\tf = nil\n\tf.GetCurrentUserPublic()\n}\n\nfunc TestFeedLinks_GetTimeline(tt *testing.T) {\n\ttt.Parallel()\n\tf := &FeedLinks{}\n\tf.GetTimeline()\n\tf = nil\n\tf.GetTimeline()\n}\n\nfunc TestFeedLinks_GetUser(tt *testing.T) {\n\ttt.Parallel()\n\tf := &FeedLinks{}\n\tf.GetUser()\n\tf = nil\n\tf.GetUser()\n}\n\nfunc TestFeeds_GetCurrentUserActorURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tf := &Feeds{CurrentUserActorURL: &zeroValue}\n\tf.GetCurrentUserActorURL()\n\tf = &Feeds{}\n\tf.GetCurrentUserActorURL()\n\tf = nil\n\tf.GetCurrentUserActorURL()\n}\n\nfunc TestFeeds_GetCurrentUserOrganizationURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tf := &Feeds{CurrentUserOrganizationURL: &zeroValue}\n\tf.GetCurrentUserOrganizationURL()\n\tf = &Feeds{}\n\tf.GetCurrentUserOrganizationURL()\n\tf = nil\n\tf.GetCurrentUserOrganizationURL()\n}\n\nfunc TestFeeds_GetCurrentUserOrganizationURLs(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tf := &Feeds{CurrentUserOrganizationURLs: zeroValue}\n\tf.GetCurrentUserOrganizationURLs()\n\tf = &Feeds{}\n\tf.GetCurrentUserOrganizationURLs()\n\tf = nil\n\tf.GetCurrentUserOrganizationURLs()\n}\n\nfunc TestFeeds_GetCurrentUserPublicURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tf := &Feeds{CurrentUserPublicURL: &zeroValue}\n\tf.GetCurrentUserPublicURL()\n\tf = &Feeds{}\n\tf.GetCurrentUserPublicURL()\n\tf = nil\n\tf.GetCurrentUserPublicURL()\n}\n\nfunc TestFeeds_GetCurrentUserURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tf := &Feeds{CurrentUserURL: &zeroValue}\n\tf.GetCurrentUserURL()\n\tf = &Feeds{}\n\tf.GetCurrentUserURL()\n\tf = nil\n\tf.GetCurrentUserURL()\n}\n\nfunc TestFeeds_GetLinks(tt *testing.T) {\n\ttt.Parallel()\n\tf := &Feeds{}\n\tf.GetLinks()\n\tf = nil\n\tf.GetLinks()\n}\n\nfunc TestFeeds_GetTimelineURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tf := &Feeds{TimelineURL: &zeroValue}\n\tf.GetTimelineURL()\n\tf = &Feeds{}\n\tf.GetTimelineURL()\n\tf = nil\n\tf.GetTimelineURL()\n}\n\nfunc TestFeeds_GetUserURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tf := &Feeds{UserURL: &zeroValue}\n\tf.GetUserURL()\n\tf = &Feeds{}\n\tf.GetUserURL()\n\tf = nil\n\tf.GetUserURL()\n}\n\nfunc TestFieldValue_GetFieldName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tf := &FieldValue{FieldName: &zeroValue}\n\tf.GetFieldName()\n\tf = &FieldValue{}\n\tf.GetFieldName()\n\tf = nil\n\tf.GetFieldName()\n}\n\nfunc TestFieldValue_GetFieldNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tf := &FieldValue{FieldNodeID: &zeroValue}\n\tf.GetFieldNodeID()\n\tf = &FieldValue{}\n\tf.GetFieldNodeID()\n\tf = nil\n\tf.GetFieldNodeID()\n}\n\nfunc TestFieldValue_GetFieldType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tf := &FieldValue{FieldType: &zeroValue}\n\tf.GetFieldType()\n\tf = &FieldValue{}\n\tf.GetFieldType()\n\tf = nil\n\tf.GetFieldType()\n}\n\nfunc TestFieldValue_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tf := &FieldValue{}\n\tf.GetFrom()\n\tf = nil\n\tf.GetFrom()\n}\n\nfunc TestFieldValue_GetProjectNumber(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tf := &FieldValue{ProjectNumber: &zeroValue}\n\tf.GetProjectNumber()\n\tf = &FieldValue{}\n\tf.GetProjectNumber()\n\tf = nil\n\tf.GetProjectNumber()\n}\n\nfunc TestFieldValue_GetTo(tt *testing.T) {\n\ttt.Parallel()\n\tf := &FieldValue{}\n\tf.GetTo()\n\tf = nil\n\tf.GetTo()\n}\n\nfunc TestFileExtensionRestrictionBranchRule_GetParameters(tt *testing.T) {\n\ttt.Parallel()\n\tf := &FileExtensionRestrictionBranchRule{}\n\tf.GetParameters()\n\tf = nil\n\tf.GetParameters()\n}\n\nfunc TestFileExtensionRestrictionRuleParameters_GetRestrictedFileExtensions(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tf := &FileExtensionRestrictionRuleParameters{RestrictedFileExtensions: zeroValue}\n\tf.GetRestrictedFileExtensions()\n\tf = &FileExtensionRestrictionRuleParameters{}\n\tf.GetRestrictedFileExtensions()\n\tf = nil\n\tf.GetRestrictedFileExtensions()\n}\n\nfunc TestFilePathRestrictionBranchRule_GetParameters(tt *testing.T) {\n\ttt.Parallel()\n\tf := &FilePathRestrictionBranchRule{}\n\tf.GetParameters()\n\tf = nil\n\tf.GetParameters()\n}\n\nfunc TestFilePathRestrictionRuleParameters_GetRestrictedFilePaths(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tf := &FilePathRestrictionRuleParameters{RestrictedFilePaths: zeroValue}\n\tf.GetRestrictedFilePaths()\n\tf = &FilePathRestrictionRuleParameters{}\n\tf.GetRestrictedFilePaths()\n\tf = nil\n\tf.GetRestrictedFilePaths()\n}\n\nfunc TestFineGrainedPersonalAccessTokenRequest_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tf := &FineGrainedPersonalAccessTokenRequest{CreatedAt: &zeroValue}\n\tf.GetCreatedAt()\n\tf = &FineGrainedPersonalAccessTokenRequest{}\n\tf.GetCreatedAt()\n\tf = nil\n\tf.GetCreatedAt()\n}\n\nfunc TestFineGrainedPersonalAccessTokenRequest_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tf := &FineGrainedPersonalAccessTokenRequest{}\n\tf.GetID()\n\tf = nil\n\tf.GetID()\n}\n\nfunc TestFineGrainedPersonalAccessTokenRequest_GetOwner(tt *testing.T) {\n\ttt.Parallel()\n\tf := &FineGrainedPersonalAccessTokenRequest{}\n\tf.GetOwner()\n\tf = nil\n\tf.GetOwner()\n}\n\nfunc TestFineGrainedPersonalAccessTokenRequest_GetPermissions(tt *testing.T) {\n\ttt.Parallel()\n\tf := &FineGrainedPersonalAccessTokenRequest{}\n\tf.GetPermissions()\n\tf = nil\n\tf.GetPermissions()\n}\n\nfunc TestFineGrainedPersonalAccessTokenRequest_GetReason(tt *testing.T) {\n\ttt.Parallel()\n\tf := &FineGrainedPersonalAccessTokenRequest{}\n\tf.GetReason()\n\tf = nil\n\tf.GetReason()\n}\n\nfunc TestFineGrainedPersonalAccessTokenRequest_GetRepositoriesURL(tt *testing.T) {\n\ttt.Parallel()\n\tf := &FineGrainedPersonalAccessTokenRequest{}\n\tf.GetRepositoriesURL()\n\tf = nil\n\tf.GetRepositoriesURL()\n}\n\nfunc TestFineGrainedPersonalAccessTokenRequest_GetRepositorySelection(tt *testing.T) {\n\ttt.Parallel()\n\tf := &FineGrainedPersonalAccessTokenRequest{}\n\tf.GetRepositorySelection()\n\tf = nil\n\tf.GetRepositorySelection()\n}\n\nfunc TestFineGrainedPersonalAccessTokenRequest_GetTokenExpired(tt *testing.T) {\n\ttt.Parallel()\n\tf := &FineGrainedPersonalAccessTokenRequest{}\n\tf.GetTokenExpired()\n\tf = nil\n\tf.GetTokenExpired()\n}\n\nfunc TestFineGrainedPersonalAccessTokenRequest_GetTokenExpiresAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tf := &FineGrainedPersonalAccessTokenRequest{TokenExpiresAt: &zeroValue}\n\tf.GetTokenExpiresAt()\n\tf = &FineGrainedPersonalAccessTokenRequest{}\n\tf.GetTokenExpiresAt()\n\tf = nil\n\tf.GetTokenExpiresAt()\n}\n\nfunc TestFineGrainedPersonalAccessTokenRequest_GetTokenID(tt *testing.T) {\n\ttt.Parallel()\n\tf := &FineGrainedPersonalAccessTokenRequest{}\n\tf.GetTokenID()\n\tf = nil\n\tf.GetTokenID()\n}\n\nfunc TestFineGrainedPersonalAccessTokenRequest_GetTokenLastUsedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tf := &FineGrainedPersonalAccessTokenRequest{TokenLastUsedAt: &zeroValue}\n\tf.GetTokenLastUsedAt()\n\tf = &FineGrainedPersonalAccessTokenRequest{}\n\tf.GetTokenLastUsedAt()\n\tf = nil\n\tf.GetTokenLastUsedAt()\n}\n\nfunc TestFineGrainedPersonalAccessTokenRequest_GetTokenName(tt *testing.T) {\n\ttt.Parallel()\n\tf := &FineGrainedPersonalAccessTokenRequest{}\n\tf.GetTokenName()\n\tf = nil\n\tf.GetTokenName()\n}\n\nfunc TestFirstPatchedVersion_GetIdentifier(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tf := &FirstPatchedVersion{Identifier: &zeroValue}\n\tf.GetIdentifier()\n\tf = &FirstPatchedVersion{}\n\tf.GetIdentifier()\n\tf = nil\n\tf.GetIdentifier()\n}\n\nfunc TestForkEvent_GetForkee(tt *testing.T) {\n\ttt.Parallel()\n\tf := &ForkEvent{}\n\tf.GetForkee()\n\tf = nil\n\tf.GetForkee()\n}\n\nfunc TestForkEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tf := &ForkEvent{}\n\tf.GetInstallation()\n\tf = nil\n\tf.GetInstallation()\n}\n\nfunc TestForkEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tf := &ForkEvent{}\n\tf.GetRepo()\n\tf = nil\n\tf.GetRepo()\n}\n\nfunc TestForkEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tf := &ForkEvent{}\n\tf.GetSender()\n\tf = nil\n\tf.GetSender()\n}\n\nfunc TestGenerateJITConfigRequest_GetLabels(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tg := &GenerateJITConfigRequest{Labels: zeroValue}\n\tg.GetLabels()\n\tg = &GenerateJITConfigRequest{}\n\tg.GetLabels()\n\tg = nil\n\tg.GetLabels()\n}\n\nfunc TestGenerateJITConfigRequest_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tg := &GenerateJITConfigRequest{}\n\tg.GetName()\n\tg = nil\n\tg.GetName()\n}\n\nfunc TestGenerateJITConfigRequest_GetRunnerGroupID(tt *testing.T) {\n\ttt.Parallel()\n\tg := &GenerateJITConfigRequest{}\n\tg.GetRunnerGroupID()\n\tg = nil\n\tg.GetRunnerGroupID()\n}\n\nfunc TestGenerateJITConfigRequest_GetWorkFolder(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GenerateJITConfigRequest{WorkFolder: &zeroValue}\n\tg.GetWorkFolder()\n\tg = &GenerateJITConfigRequest{}\n\tg.GetWorkFolder()\n\tg = nil\n\tg.GetWorkFolder()\n}\n\nfunc TestGenerateNotesOptions_GetConfigurationFilePath(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GenerateNotesOptions{ConfigurationFilePath: &zeroValue}\n\tg.GetConfigurationFilePath()\n\tg = &GenerateNotesOptions{}\n\tg.GetConfigurationFilePath()\n\tg = nil\n\tg.GetConfigurationFilePath()\n}\n\nfunc TestGenerateNotesOptions_GetPreviousTagName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GenerateNotesOptions{PreviousTagName: &zeroValue}\n\tg.GetPreviousTagName()\n\tg = &GenerateNotesOptions{}\n\tg.GetPreviousTagName()\n\tg = nil\n\tg.GetPreviousTagName()\n}\n\nfunc TestGenerateNotesOptions_GetTagName(tt *testing.T) {\n\ttt.Parallel()\n\tg := &GenerateNotesOptions{}\n\tg.GetTagName()\n\tg = nil\n\tg.GetTagName()\n}\n\nfunc TestGenerateNotesOptions_GetTargetCommitish(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GenerateNotesOptions{TargetCommitish: &zeroValue}\n\tg.GetTargetCommitish()\n\tg = &GenerateNotesOptions{}\n\tg.GetTargetCommitish()\n\tg = nil\n\tg.GetTargetCommitish()\n}\n\nfunc TestGetAuditLogOptions_GetInclude(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GetAuditLogOptions{Include: &zeroValue}\n\tg.GetInclude()\n\tg = &GetAuditLogOptions{}\n\tg.GetInclude()\n\tg = nil\n\tg.GetInclude()\n}\n\nfunc TestGetAuditLogOptions_GetOrder(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GetAuditLogOptions{Order: &zeroValue}\n\tg.GetOrder()\n\tg = &GetAuditLogOptions{}\n\tg.GetOrder()\n\tg = nil\n\tg.GetOrder()\n}\n\nfunc TestGetAuditLogOptions_GetPhrase(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GetAuditLogOptions{Phrase: &zeroValue}\n\tg.GetPhrase()\n\tg = &GetAuditLogOptions{}\n\tg.GetPhrase()\n\tg = nil\n\tg.GetPhrase()\n}\n\nfunc TestGetCodeownersErrorsOptions_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tg := &GetCodeownersErrorsOptions{}\n\tg.GetRef()\n\tg = nil\n\tg.GetRef()\n}\n\nfunc TestGetProjectItemOptions_GetFields(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []int64{}\n\tg := &GetProjectItemOptions{Fields: zeroValue}\n\tg.GetFields()\n\tg = &GetProjectItemOptions{}\n\tg.GetFields()\n\tg = nil\n\tg.GetFields()\n}\n\nfunc TestGetProvisionedSCIMGroupEnterpriseOptions_GetExcludedAttributes(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GetProvisionedSCIMGroupEnterpriseOptions{ExcludedAttributes: &zeroValue}\n\tg.GetExcludedAttributes()\n\tg = &GetProvisionedSCIMGroupEnterpriseOptions{}\n\tg.GetExcludedAttributes()\n\tg = nil\n\tg.GetExcludedAttributes()\n}\n\nfunc TestGist_GetComments(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tg := &Gist{Comments: &zeroValue}\n\tg.GetComments()\n\tg = &Gist{}\n\tg.GetComments()\n\tg = nil\n\tg.GetComments()\n}\n\nfunc TestGist_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tg := &Gist{CreatedAt: &zeroValue}\n\tg.GetCreatedAt()\n\tg = &Gist{}\n\tg.GetCreatedAt()\n\tg = nil\n\tg.GetCreatedAt()\n}\n\nfunc TestGist_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &Gist{Description: &zeroValue}\n\tg.GetDescription()\n\tg = &Gist{}\n\tg.GetDescription()\n\tg = nil\n\tg.GetDescription()\n}\n\nfunc TestGist_GetFiles(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[GistFilename]GistFile{}\n\tg := &Gist{Files: zeroValue}\n\tg.GetFiles()\n\tg = &Gist{}\n\tg.GetFiles()\n\tg = nil\n\tg.GetFiles()\n}\n\nfunc TestGist_GetGitPullURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &Gist{GitPullURL: &zeroValue}\n\tg.GetGitPullURL()\n\tg = &Gist{}\n\tg.GetGitPullURL()\n\tg = nil\n\tg.GetGitPullURL()\n}\n\nfunc TestGist_GetGitPushURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &Gist{GitPushURL: &zeroValue}\n\tg.GetGitPushURL()\n\tg = &Gist{}\n\tg.GetGitPushURL()\n\tg = nil\n\tg.GetGitPushURL()\n}\n\nfunc TestGist_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &Gist{HTMLURL: &zeroValue}\n\tg.GetHTMLURL()\n\tg = &Gist{}\n\tg.GetHTMLURL()\n\tg = nil\n\tg.GetHTMLURL()\n}\n\nfunc TestGist_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &Gist{ID: &zeroValue}\n\tg.GetID()\n\tg = &Gist{}\n\tg.GetID()\n\tg = nil\n\tg.GetID()\n}\n\nfunc TestGist_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &Gist{NodeID: &zeroValue}\n\tg.GetNodeID()\n\tg = &Gist{}\n\tg.GetNodeID()\n\tg = nil\n\tg.GetNodeID()\n}\n\nfunc TestGist_GetOwner(tt *testing.T) {\n\ttt.Parallel()\n\tg := &Gist{}\n\tg.GetOwner()\n\tg = nil\n\tg.GetOwner()\n}\n\nfunc TestGist_GetPublic(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tg := &Gist{Public: &zeroValue}\n\tg.GetPublic()\n\tg = &Gist{}\n\tg.GetPublic()\n\tg = nil\n\tg.GetPublic()\n}\n\nfunc TestGist_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tg := &Gist{UpdatedAt: &zeroValue}\n\tg.GetUpdatedAt()\n\tg = &Gist{}\n\tg.GetUpdatedAt()\n\tg = nil\n\tg.GetUpdatedAt()\n}\n\nfunc TestGistComment_GetBody(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GistComment{Body: &zeroValue}\n\tg.GetBody()\n\tg = &GistComment{}\n\tg.GetBody()\n\tg = nil\n\tg.GetBody()\n}\n\nfunc TestGistComment_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tg := &GistComment{CreatedAt: &zeroValue}\n\tg.GetCreatedAt()\n\tg = &GistComment{}\n\tg.GetCreatedAt()\n\tg = nil\n\tg.GetCreatedAt()\n}\n\nfunc TestGistComment_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tg := &GistComment{ID: &zeroValue}\n\tg.GetID()\n\tg = &GistComment{}\n\tg.GetID()\n\tg = nil\n\tg.GetID()\n}\n\nfunc TestGistComment_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GistComment{URL: &zeroValue}\n\tg.GetURL()\n\tg = &GistComment{}\n\tg.GetURL()\n\tg = nil\n\tg.GetURL()\n}\n\nfunc TestGistComment_GetUser(tt *testing.T) {\n\ttt.Parallel()\n\tg := &GistComment{}\n\tg.GetUser()\n\tg = nil\n\tg.GetUser()\n}\n\nfunc TestGistCommit_GetChangeStatus(tt *testing.T) {\n\ttt.Parallel()\n\tg := &GistCommit{}\n\tg.GetChangeStatus()\n\tg = nil\n\tg.GetChangeStatus()\n}\n\nfunc TestGistCommit_GetCommittedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tg := &GistCommit{CommittedAt: &zeroValue}\n\tg.GetCommittedAt()\n\tg = &GistCommit{}\n\tg.GetCommittedAt()\n\tg = nil\n\tg.GetCommittedAt()\n}\n\nfunc TestGistCommit_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GistCommit{NodeID: &zeroValue}\n\tg.GetNodeID()\n\tg = &GistCommit{}\n\tg.GetNodeID()\n\tg = nil\n\tg.GetNodeID()\n}\n\nfunc TestGistCommit_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GistCommit{URL: &zeroValue}\n\tg.GetURL()\n\tg = &GistCommit{}\n\tg.GetURL()\n\tg = nil\n\tg.GetURL()\n}\n\nfunc TestGistCommit_GetUser(tt *testing.T) {\n\ttt.Parallel()\n\tg := &GistCommit{}\n\tg.GetUser()\n\tg = nil\n\tg.GetUser()\n}\n\nfunc TestGistCommit_GetVersion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GistCommit{Version: &zeroValue}\n\tg.GetVersion()\n\tg = &GistCommit{}\n\tg.GetVersion()\n\tg = nil\n\tg.GetVersion()\n}\n\nfunc TestGistFile_GetContent(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GistFile{Content: &zeroValue}\n\tg.GetContent()\n\tg = &GistFile{}\n\tg.GetContent()\n\tg = nil\n\tg.GetContent()\n}\n\nfunc TestGistFile_GetFilename(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GistFile{Filename: &zeroValue}\n\tg.GetFilename()\n\tg = &GistFile{}\n\tg.GetFilename()\n\tg = nil\n\tg.GetFilename()\n}\n\nfunc TestGistFile_GetLanguage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GistFile{Language: &zeroValue}\n\tg.GetLanguage()\n\tg = &GistFile{}\n\tg.GetLanguage()\n\tg = nil\n\tg.GetLanguage()\n}\n\nfunc TestGistFile_GetRawURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GistFile{RawURL: &zeroValue}\n\tg.GetRawURL()\n\tg = &GistFile{}\n\tg.GetRawURL()\n\tg = nil\n\tg.GetRawURL()\n}\n\nfunc TestGistFile_GetSize(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tg := &GistFile{Size: &zeroValue}\n\tg.GetSize()\n\tg = &GistFile{}\n\tg.GetSize()\n\tg = nil\n\tg.GetSize()\n}\n\nfunc TestGistFile_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GistFile{Type: &zeroValue}\n\tg.GetType()\n\tg = &GistFile{}\n\tg.GetType()\n\tg = nil\n\tg.GetType()\n}\n\nfunc TestGistFork_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tg := &GistFork{CreatedAt: &zeroValue}\n\tg.GetCreatedAt()\n\tg = &GistFork{}\n\tg.GetCreatedAt()\n\tg = nil\n\tg.GetCreatedAt()\n}\n\nfunc TestGistFork_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GistFork{ID: &zeroValue}\n\tg.GetID()\n\tg = &GistFork{}\n\tg.GetID()\n\tg = nil\n\tg.GetID()\n}\n\nfunc TestGistFork_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GistFork{NodeID: &zeroValue}\n\tg.GetNodeID()\n\tg = &GistFork{}\n\tg.GetNodeID()\n\tg = nil\n\tg.GetNodeID()\n}\n\nfunc TestGistFork_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tg := &GistFork{UpdatedAt: &zeroValue}\n\tg.GetUpdatedAt()\n\tg = &GistFork{}\n\tg.GetUpdatedAt()\n\tg = nil\n\tg.GetUpdatedAt()\n}\n\nfunc TestGistFork_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GistFork{URL: &zeroValue}\n\tg.GetURL()\n\tg = &GistFork{}\n\tg.GetURL()\n\tg = nil\n\tg.GetURL()\n}\n\nfunc TestGistFork_GetUser(tt *testing.T) {\n\ttt.Parallel()\n\tg := &GistFork{}\n\tg.GetUser()\n\tg = nil\n\tg.GetUser()\n}\n\nfunc TestGistListOptions_GetSince(tt *testing.T) {\n\ttt.Parallel()\n\tg := &GistListOptions{}\n\tg.GetSince()\n\tg = nil\n\tg.GetSince()\n}\n\nfunc TestGistStats_GetPrivateGists(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tg := &GistStats{PrivateGists: &zeroValue}\n\tg.GetPrivateGists()\n\tg = &GistStats{}\n\tg.GetPrivateGists()\n\tg = nil\n\tg.GetPrivateGists()\n}\n\nfunc TestGistStats_GetPublicGists(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tg := &GistStats{PublicGists: &zeroValue}\n\tg.GetPublicGists()\n\tg = &GistStats{}\n\tg.GetPublicGists()\n\tg = nil\n\tg.GetPublicGists()\n}\n\nfunc TestGistStats_GetTotalGists(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tg := &GistStats{TotalGists: &zeroValue}\n\tg.GetTotalGists()\n\tg = &GistStats{}\n\tg.GetTotalGists()\n\tg = nil\n\tg.GetTotalGists()\n}\n\nfunc TestGitHubAppAuthorizationEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GitHubAppAuthorizationEvent{Action: &zeroValue}\n\tg.GetAction()\n\tg = &GitHubAppAuthorizationEvent{}\n\tg.GetAction()\n\tg = nil\n\tg.GetAction()\n}\n\nfunc TestGitHubAppAuthorizationEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tg := &GitHubAppAuthorizationEvent{}\n\tg.GetInstallation()\n\tg = nil\n\tg.GetInstallation()\n}\n\nfunc TestGitHubAppAuthorizationEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tg := &GitHubAppAuthorizationEvent{}\n\tg.GetSender()\n\tg = nil\n\tg.GetSender()\n}\n\nfunc TestGitignore_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &Gitignore{Name: &zeroValue}\n\tg.GetName()\n\tg = &Gitignore{}\n\tg.GetName()\n\tg = nil\n\tg.GetName()\n}\n\nfunc TestGitignore_GetSource(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &Gitignore{Source: &zeroValue}\n\tg.GetSource()\n\tg = &Gitignore{}\n\tg.GetSource()\n\tg = nil\n\tg.GetSource()\n}\n\nfunc TestGitObject_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GitObject{SHA: &zeroValue}\n\tg.GetSHA()\n\tg = &GitObject{}\n\tg.GetSHA()\n\tg = nil\n\tg.GetSHA()\n}\n\nfunc TestGitObject_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GitObject{Type: &zeroValue}\n\tg.GetType()\n\tg = &GitObject{}\n\tg.GetType()\n\tg = nil\n\tg.GetType()\n}\n\nfunc TestGitObject_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GitObject{URL: &zeroValue}\n\tg.GetURL()\n\tg = &GitObject{}\n\tg.GetURL()\n\tg = nil\n\tg.GetURL()\n}\n\nfunc TestGlobalSecurityAdvisory_GetCredits(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Credit{}\n\tg := &GlobalSecurityAdvisory{Credits: zeroValue}\n\tg.GetCredits()\n\tg = &GlobalSecurityAdvisory{}\n\tg.GetCredits()\n\tg = nil\n\tg.GetCredits()\n}\n\nfunc TestGlobalSecurityAdvisory_GetGithubReviewedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tg := &GlobalSecurityAdvisory{GithubReviewedAt: &zeroValue}\n\tg.GetGithubReviewedAt()\n\tg = &GlobalSecurityAdvisory{}\n\tg.GetGithubReviewedAt()\n\tg = nil\n\tg.GetGithubReviewedAt()\n}\n\nfunc TestGlobalSecurityAdvisory_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tg := &GlobalSecurityAdvisory{ID: &zeroValue}\n\tg.GetID()\n\tg = &GlobalSecurityAdvisory{}\n\tg.GetID()\n\tg = nil\n\tg.GetID()\n}\n\nfunc TestGlobalSecurityAdvisory_GetNVDPublishedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tg := &GlobalSecurityAdvisory{NVDPublishedAt: &zeroValue}\n\tg.GetNVDPublishedAt()\n\tg = &GlobalSecurityAdvisory{}\n\tg.GetNVDPublishedAt()\n\tg = nil\n\tg.GetNVDPublishedAt()\n}\n\nfunc TestGlobalSecurityAdvisory_GetReferences(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tg := &GlobalSecurityAdvisory{References: zeroValue}\n\tg.GetReferences()\n\tg = &GlobalSecurityAdvisory{}\n\tg.GetReferences()\n\tg = nil\n\tg.GetReferences()\n}\n\nfunc TestGlobalSecurityAdvisory_GetRepositoryAdvisoryURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GlobalSecurityAdvisory{RepositoryAdvisoryURL: &zeroValue}\n\tg.GetRepositoryAdvisoryURL()\n\tg = &GlobalSecurityAdvisory{}\n\tg.GetRepositoryAdvisoryURL()\n\tg = nil\n\tg.GetRepositoryAdvisoryURL()\n}\n\nfunc TestGlobalSecurityAdvisory_GetSourceCodeLocation(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GlobalSecurityAdvisory{SourceCodeLocation: &zeroValue}\n\tg.GetSourceCodeLocation()\n\tg = &GlobalSecurityAdvisory{}\n\tg.GetSourceCodeLocation()\n\tg = nil\n\tg.GetSourceCodeLocation()\n}\n\nfunc TestGlobalSecurityAdvisory_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GlobalSecurityAdvisory{Type: &zeroValue}\n\tg.GetType()\n\tg = &GlobalSecurityAdvisory{}\n\tg.GetType()\n\tg = nil\n\tg.GetType()\n}\n\nfunc TestGlobalSecurityAdvisory_GetVulnerabilities(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*GlobalSecurityVulnerability{}\n\tg := &GlobalSecurityAdvisory{Vulnerabilities: zeroValue}\n\tg.GetVulnerabilities()\n\tg = &GlobalSecurityAdvisory{}\n\tg.GetVulnerabilities()\n\tg = nil\n\tg.GetVulnerabilities()\n}\n\nfunc TestGlobalSecurityVulnerability_GetFirstPatchedVersion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GlobalSecurityVulnerability{FirstPatchedVersion: &zeroValue}\n\tg.GetFirstPatchedVersion()\n\tg = &GlobalSecurityVulnerability{}\n\tg.GetFirstPatchedVersion()\n\tg = nil\n\tg.GetFirstPatchedVersion()\n}\n\nfunc TestGlobalSecurityVulnerability_GetPackage(tt *testing.T) {\n\ttt.Parallel()\n\tg := &GlobalSecurityVulnerability{}\n\tg.GetPackage()\n\tg = nil\n\tg.GetPackage()\n}\n\nfunc TestGlobalSecurityVulnerability_GetVulnerableFunctions(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tg := &GlobalSecurityVulnerability{VulnerableFunctions: zeroValue}\n\tg.GetVulnerableFunctions()\n\tg = &GlobalSecurityVulnerability{}\n\tg.GetVulnerableFunctions()\n\tg = nil\n\tg.GetVulnerableFunctions()\n}\n\nfunc TestGlobalSecurityVulnerability_GetVulnerableVersionRange(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GlobalSecurityVulnerability{VulnerableVersionRange: &zeroValue}\n\tg.GetVulnerableVersionRange()\n\tg = &GlobalSecurityVulnerability{}\n\tg.GetVulnerableVersionRange()\n\tg = nil\n\tg.GetVulnerableVersionRange()\n}\n\nfunc TestGollumEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tg := &GollumEvent{}\n\tg.GetInstallation()\n\tg = nil\n\tg.GetInstallation()\n}\n\nfunc TestGollumEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tg := &GollumEvent{}\n\tg.GetOrg()\n\tg = nil\n\tg.GetOrg()\n}\n\nfunc TestGollumEvent_GetPages(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Page{}\n\tg := &GollumEvent{Pages: zeroValue}\n\tg.GetPages()\n\tg = &GollumEvent{}\n\tg.GetPages()\n\tg = nil\n\tg.GetPages()\n}\n\nfunc TestGollumEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tg := &GollumEvent{}\n\tg.GetRepo()\n\tg = nil\n\tg.GetRepo()\n}\n\nfunc TestGollumEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tg := &GollumEvent{}\n\tg.GetSender()\n\tg = nil\n\tg.GetSender()\n}\n\nfunc TestGoogleCloudConfig_GetBucket(tt *testing.T) {\n\ttt.Parallel()\n\tg := &GoogleCloudConfig{}\n\tg.GetBucket()\n\tg = nil\n\tg.GetBucket()\n}\n\nfunc TestGoogleCloudConfig_GetEncryptedJSONCredentials(tt *testing.T) {\n\ttt.Parallel()\n\tg := &GoogleCloudConfig{}\n\tg.GetEncryptedJSONCredentials()\n\tg = nil\n\tg.GetEncryptedJSONCredentials()\n}\n\nfunc TestGoogleCloudConfig_GetKeyID(tt *testing.T) {\n\ttt.Parallel()\n\tg := &GoogleCloudConfig{}\n\tg.GetKeyID()\n\tg = nil\n\tg.GetKeyID()\n}\n\nfunc TestGPGEmail_GetEmail(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GPGEmail{Email: &zeroValue}\n\tg.GetEmail()\n\tg = &GPGEmail{}\n\tg.GetEmail()\n\tg = nil\n\tg.GetEmail()\n}\n\nfunc TestGPGEmail_GetVerified(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tg := &GPGEmail{Verified: &zeroValue}\n\tg.GetVerified()\n\tg = &GPGEmail{}\n\tg.GetVerified()\n\tg = nil\n\tg.GetVerified()\n}\n\nfunc TestGPGKey_GetCanCertify(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tg := &GPGKey{CanCertify: &zeroValue}\n\tg.GetCanCertify()\n\tg = &GPGKey{}\n\tg.GetCanCertify()\n\tg = nil\n\tg.GetCanCertify()\n}\n\nfunc TestGPGKey_GetCanEncryptComms(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tg := &GPGKey{CanEncryptComms: &zeroValue}\n\tg.GetCanEncryptComms()\n\tg = &GPGKey{}\n\tg.GetCanEncryptComms()\n\tg = nil\n\tg.GetCanEncryptComms()\n}\n\nfunc TestGPGKey_GetCanEncryptStorage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tg := &GPGKey{CanEncryptStorage: &zeroValue}\n\tg.GetCanEncryptStorage()\n\tg = &GPGKey{}\n\tg.GetCanEncryptStorage()\n\tg = nil\n\tg.GetCanEncryptStorage()\n}\n\nfunc TestGPGKey_GetCanSign(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tg := &GPGKey{CanSign: &zeroValue}\n\tg.GetCanSign()\n\tg = &GPGKey{}\n\tg.GetCanSign()\n\tg = nil\n\tg.GetCanSign()\n}\n\nfunc TestGPGKey_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tg := &GPGKey{CreatedAt: &zeroValue}\n\tg.GetCreatedAt()\n\tg = &GPGKey{}\n\tg.GetCreatedAt()\n\tg = nil\n\tg.GetCreatedAt()\n}\n\nfunc TestGPGKey_GetEmails(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*GPGEmail{}\n\tg := &GPGKey{Emails: zeroValue}\n\tg.GetEmails()\n\tg = &GPGKey{}\n\tg.GetEmails()\n\tg = nil\n\tg.GetEmails()\n}\n\nfunc TestGPGKey_GetExpiresAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tg := &GPGKey{ExpiresAt: &zeroValue}\n\tg.GetExpiresAt()\n\tg = &GPGKey{}\n\tg.GetExpiresAt()\n\tg = nil\n\tg.GetExpiresAt()\n}\n\nfunc TestGPGKey_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tg := &GPGKey{ID: &zeroValue}\n\tg.GetID()\n\tg = &GPGKey{}\n\tg.GetID()\n\tg = nil\n\tg.GetID()\n}\n\nfunc TestGPGKey_GetKeyID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GPGKey{KeyID: &zeroValue}\n\tg.GetKeyID()\n\tg = &GPGKey{}\n\tg.GetKeyID()\n\tg = nil\n\tg.GetKeyID()\n}\n\nfunc TestGPGKey_GetPrimaryKeyID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tg := &GPGKey{PrimaryKeyID: &zeroValue}\n\tg.GetPrimaryKeyID()\n\tg = &GPGKey{}\n\tg.GetPrimaryKeyID()\n\tg = nil\n\tg.GetPrimaryKeyID()\n}\n\nfunc TestGPGKey_GetPublicKey(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GPGKey{PublicKey: &zeroValue}\n\tg.GetPublicKey()\n\tg = &GPGKey{}\n\tg.GetPublicKey()\n\tg = nil\n\tg.GetPublicKey()\n}\n\nfunc TestGPGKey_GetRawKey(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &GPGKey{RawKey: &zeroValue}\n\tg.GetRawKey()\n\tg = &GPGKey{}\n\tg.GetRawKey()\n\tg = nil\n\tg.GetRawKey()\n}\n\nfunc TestGPGKey_GetSubkeys(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*GPGKey{}\n\tg := &GPGKey{Subkeys: zeroValue}\n\tg.GetSubkeys()\n\tg = &GPGKey{}\n\tg.GetSubkeys()\n\tg = nil\n\tg.GetSubkeys()\n}\n\nfunc TestGrant_GetApp(tt *testing.T) {\n\ttt.Parallel()\n\tg := &Grant{}\n\tg.GetApp()\n\tg = nil\n\tg.GetApp()\n}\n\nfunc TestGrant_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tg := &Grant{CreatedAt: &zeroValue}\n\tg.GetCreatedAt()\n\tg = &Grant{}\n\tg.GetCreatedAt()\n\tg = nil\n\tg.GetCreatedAt()\n}\n\nfunc TestGrant_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tg := &Grant{ID: &zeroValue}\n\tg.GetID()\n\tg = &Grant{}\n\tg.GetID()\n\tg = nil\n\tg.GetID()\n}\n\nfunc TestGrant_GetScopes(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tg := &Grant{Scopes: zeroValue}\n\tg.GetScopes()\n\tg = &Grant{}\n\tg.GetScopes()\n\tg = nil\n\tg.GetScopes()\n}\n\nfunc TestGrant_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tg := &Grant{UpdatedAt: &zeroValue}\n\tg.GetUpdatedAt()\n\tg = &Grant{}\n\tg.GetUpdatedAt()\n\tg = nil\n\tg.GetUpdatedAt()\n}\n\nfunc TestGrant_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tg := &Grant{URL: &zeroValue}\n\tg.GetURL()\n\tg = &Grant{}\n\tg.GetURL()\n\tg = nil\n\tg.GetURL()\n}\n\nfunc TestHeadCommit_GetAdded(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\th := &HeadCommit{Added: zeroValue}\n\th.GetAdded()\n\th = &HeadCommit{}\n\th.GetAdded()\n\th = nil\n\th.GetAdded()\n}\n\nfunc TestHeadCommit_GetAuthor(tt *testing.T) {\n\ttt.Parallel()\n\th := &HeadCommit{}\n\th.GetAuthor()\n\th = nil\n\th.GetAuthor()\n}\n\nfunc TestHeadCommit_GetCommitter(tt *testing.T) {\n\ttt.Parallel()\n\th := &HeadCommit{}\n\th.GetCommitter()\n\th = nil\n\th.GetCommitter()\n}\n\nfunc TestHeadCommit_GetDistinct(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\th := &HeadCommit{Distinct: &zeroValue}\n\th.GetDistinct()\n\th = &HeadCommit{}\n\th.GetDistinct()\n\th = nil\n\th.GetDistinct()\n}\n\nfunc TestHeadCommit_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\th := &HeadCommit{ID: &zeroValue}\n\th.GetID()\n\th = &HeadCommit{}\n\th.GetID()\n\th = nil\n\th.GetID()\n}\n\nfunc TestHeadCommit_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\th := &HeadCommit{Message: &zeroValue}\n\th.GetMessage()\n\th = &HeadCommit{}\n\th.GetMessage()\n\th = nil\n\th.GetMessage()\n}\n\nfunc TestHeadCommit_GetModified(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\th := &HeadCommit{Modified: zeroValue}\n\th.GetModified()\n\th = &HeadCommit{}\n\th.GetModified()\n\th = nil\n\th.GetModified()\n}\n\nfunc TestHeadCommit_GetRemoved(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\th := &HeadCommit{Removed: zeroValue}\n\th.GetRemoved()\n\th = &HeadCommit{}\n\th.GetRemoved()\n\th = nil\n\th.GetRemoved()\n}\n\nfunc TestHeadCommit_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\th := &HeadCommit{SHA: &zeroValue}\n\th.GetSHA()\n\th = &HeadCommit{}\n\th.GetSHA()\n\th = nil\n\th.GetSHA()\n}\n\nfunc TestHeadCommit_GetTimestamp(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\th := &HeadCommit{Timestamp: &zeroValue}\n\th.GetTimestamp()\n\th = &HeadCommit{}\n\th.GetTimestamp()\n\th = nil\n\th.GetTimestamp()\n}\n\nfunc TestHeadCommit_GetTreeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\th := &HeadCommit{TreeID: &zeroValue}\n\th.GetTreeID()\n\th = &HeadCommit{}\n\th.GetTreeID()\n\th = nil\n\th.GetTreeID()\n}\n\nfunc TestHeadCommit_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\th := &HeadCommit{URL: &zeroValue}\n\th.GetURL()\n\th = &HeadCommit{}\n\th.GetURL()\n\th = nil\n\th.GetURL()\n}\n\nfunc TestHecConfig_GetDomain(tt *testing.T) {\n\ttt.Parallel()\n\th := &HecConfig{}\n\th.GetDomain()\n\th = nil\n\th.GetDomain()\n}\n\nfunc TestHecConfig_GetEncryptedToken(tt *testing.T) {\n\ttt.Parallel()\n\th := &HecConfig{}\n\th.GetEncryptedToken()\n\th = nil\n\th.GetEncryptedToken()\n}\n\nfunc TestHecConfig_GetKeyID(tt *testing.T) {\n\ttt.Parallel()\n\th := &HecConfig{}\n\th.GetKeyID()\n\th = nil\n\th.GetKeyID()\n}\n\nfunc TestHecConfig_GetPath(tt *testing.T) {\n\ttt.Parallel()\n\th := &HecConfig{}\n\th.GetPath()\n\th = nil\n\th.GetPath()\n}\n\nfunc TestHecConfig_GetPort(tt *testing.T) {\n\ttt.Parallel()\n\th := &HecConfig{}\n\th.GetPort()\n\th = nil\n\th.GetPort()\n}\n\nfunc TestHecConfig_GetSSLVerify(tt *testing.T) {\n\ttt.Parallel()\n\th := &HecConfig{}\n\th.GetSSLVerify()\n\th = nil\n\th.GetSSLVerify()\n}\n\nfunc TestHook_GetActive(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\th := &Hook{Active: &zeroValue}\n\th.GetActive()\n\th = &Hook{}\n\th.GetActive()\n\th = nil\n\th.GetActive()\n}\n\nfunc TestHook_GetConfig(tt *testing.T) {\n\ttt.Parallel()\n\th := &Hook{}\n\th.GetConfig()\n\th = nil\n\th.GetConfig()\n}\n\nfunc TestHook_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\th := &Hook{CreatedAt: &zeroValue}\n\th.GetCreatedAt()\n\th = &Hook{}\n\th.GetCreatedAt()\n\th = nil\n\th.GetCreatedAt()\n}\n\nfunc TestHook_GetEvents(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\th := &Hook{Events: zeroValue}\n\th.GetEvents()\n\th = &Hook{}\n\th.GetEvents()\n\th = nil\n\th.GetEvents()\n}\n\nfunc TestHook_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\th := &Hook{ID: &zeroValue}\n\th.GetID()\n\th = &Hook{}\n\th.GetID()\n\th = nil\n\th.GetID()\n}\n\nfunc TestHook_GetLastResponse(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]any{}\n\th := &Hook{LastResponse: zeroValue}\n\th.GetLastResponse()\n\th = &Hook{}\n\th.GetLastResponse()\n\th = nil\n\th.GetLastResponse()\n}\n\nfunc TestHook_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\th := &Hook{Name: &zeroValue}\n\th.GetName()\n\th = &Hook{}\n\th.GetName()\n\th = nil\n\th.GetName()\n}\n\nfunc TestHook_GetPingURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\th := &Hook{PingURL: &zeroValue}\n\th.GetPingURL()\n\th = &Hook{}\n\th.GetPingURL()\n\th = nil\n\th.GetPingURL()\n}\n\nfunc TestHook_GetTestURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\th := &Hook{TestURL: &zeroValue}\n\th.GetTestURL()\n\th = &Hook{}\n\th.GetTestURL()\n\th = nil\n\th.GetTestURL()\n}\n\nfunc TestHook_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\th := &Hook{Type: &zeroValue}\n\th.GetType()\n\th = &Hook{}\n\th.GetType()\n\th = nil\n\th.GetType()\n}\n\nfunc TestHook_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\th := &Hook{UpdatedAt: &zeroValue}\n\th.GetUpdatedAt()\n\th = &Hook{}\n\th.GetUpdatedAt()\n\th = nil\n\th.GetUpdatedAt()\n}\n\nfunc TestHook_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\th := &Hook{URL: &zeroValue}\n\th.GetURL()\n\th = &Hook{}\n\th.GetURL()\n\th = nil\n\th.GetURL()\n}\n\nfunc TestHookConfig_GetContentType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\th := &HookConfig{ContentType: &zeroValue}\n\th.GetContentType()\n\th = &HookConfig{}\n\th.GetContentType()\n\th = nil\n\th.GetContentType()\n}\n\nfunc TestHookConfig_GetInsecureSSL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\th := &HookConfig{InsecureSSL: &zeroValue}\n\th.GetInsecureSSL()\n\th = &HookConfig{}\n\th.GetInsecureSSL()\n\th = nil\n\th.GetInsecureSSL()\n}\n\nfunc TestHookConfig_GetSecret(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\th := &HookConfig{Secret: &zeroValue}\n\th.GetSecret()\n\th = &HookConfig{}\n\th.GetSecret()\n\th = nil\n\th.GetSecret()\n}\n\nfunc TestHookConfig_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\th := &HookConfig{URL: &zeroValue}\n\th.GetURL()\n\th = &HookConfig{}\n\th.GetURL()\n\th = nil\n\th.GetURL()\n}\n\nfunc TestHookDelivery_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\th := &HookDelivery{Action: &zeroValue}\n\th.GetAction()\n\th = &HookDelivery{}\n\th.GetAction()\n\th = nil\n\th.GetAction()\n}\n\nfunc TestHookDelivery_GetDeliveredAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\th := &HookDelivery{DeliveredAt: &zeroValue}\n\th.GetDeliveredAt()\n\th = &HookDelivery{}\n\th.GetDeliveredAt()\n\th = nil\n\th.GetDeliveredAt()\n}\n\nfunc TestHookDelivery_GetDuration(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue float64\n\th := &HookDelivery{Duration: &zeroValue}\n\th.GetDuration()\n\th = &HookDelivery{}\n\th.GetDuration()\n\th = nil\n\th.GetDuration()\n}\n\nfunc TestHookDelivery_GetEvent(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\th := &HookDelivery{Event: &zeroValue}\n\th.GetEvent()\n\th = &HookDelivery{}\n\th.GetEvent()\n\th = nil\n\th.GetEvent()\n}\n\nfunc TestHookDelivery_GetGUID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\th := &HookDelivery{GUID: &zeroValue}\n\th.GetGUID()\n\th = &HookDelivery{}\n\th.GetGUID()\n\th = nil\n\th.GetGUID()\n}\n\nfunc TestHookDelivery_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\th := &HookDelivery{ID: &zeroValue}\n\th.GetID()\n\th = &HookDelivery{}\n\th.GetID()\n\th = nil\n\th.GetID()\n}\n\nfunc TestHookDelivery_GetInstallationID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\th := &HookDelivery{InstallationID: &zeroValue}\n\th.GetInstallationID()\n\th = &HookDelivery{}\n\th.GetInstallationID()\n\th = nil\n\th.GetInstallationID()\n}\n\nfunc TestHookDelivery_GetRedelivery(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\th := &HookDelivery{Redelivery: &zeroValue}\n\th.GetRedelivery()\n\th = &HookDelivery{}\n\th.GetRedelivery()\n\th = nil\n\th.GetRedelivery()\n}\n\nfunc TestHookDelivery_GetRepositoryID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\th := &HookDelivery{RepositoryID: &zeroValue}\n\th.GetRepositoryID()\n\th = &HookDelivery{}\n\th.GetRepositoryID()\n\th = nil\n\th.GetRepositoryID()\n}\n\nfunc TestHookDelivery_GetRequest(tt *testing.T) {\n\ttt.Parallel()\n\th := &HookDelivery{}\n\th.GetRequest()\n\th = nil\n\th.GetRequest()\n}\n\nfunc TestHookDelivery_GetResponse(tt *testing.T) {\n\ttt.Parallel()\n\th := &HookDelivery{}\n\th.GetResponse()\n\th = nil\n\th.GetResponse()\n}\n\nfunc TestHookDelivery_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\th := &HookDelivery{Status: &zeroValue}\n\th.GetStatus()\n\th = &HookDelivery{}\n\th.GetStatus()\n\th = nil\n\th.GetStatus()\n}\n\nfunc TestHookDelivery_GetStatusCode(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\th := &HookDelivery{StatusCode: &zeroValue}\n\th.GetStatusCode()\n\th = &HookDelivery{}\n\th.GetStatusCode()\n\th = nil\n\th.GetStatusCode()\n}\n\nfunc TestHookRequest_GetHeaders(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]string{}\n\th := &HookRequest{Headers: zeroValue}\n\th.GetHeaders()\n\th = &HookRequest{}\n\th.GetHeaders()\n\th = nil\n\th.GetHeaders()\n}\n\nfunc TestHookRequest_GetRawPayload(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue json.RawMessage\n\th := &HookRequest{RawPayload: &zeroValue}\n\th.GetRawPayload()\n\th = &HookRequest{}\n\th.GetRawPayload()\n\th = nil\n\th.GetRawPayload()\n}\n\nfunc TestHookResponse_GetHeaders(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]string{}\n\th := &HookResponse{Headers: zeroValue}\n\th.GetHeaders()\n\th = &HookResponse{}\n\th.GetHeaders()\n\th = nil\n\th.GetHeaders()\n}\n\nfunc TestHookResponse_GetRawPayload(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue json.RawMessage\n\th := &HookResponse{RawPayload: &zeroValue}\n\th.GetRawPayload()\n\th = &HookResponse{}\n\th.GetRawPayload()\n\th = nil\n\th.GetRawPayload()\n}\n\nfunc TestHookStats_GetActiveHooks(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\th := &HookStats{ActiveHooks: &zeroValue}\n\th.GetActiveHooks()\n\th = &HookStats{}\n\th.GetActiveHooks()\n\th = nil\n\th.GetActiveHooks()\n}\n\nfunc TestHookStats_GetInactiveHooks(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\th := &HookStats{InactiveHooks: &zeroValue}\n\th.GetInactiveHooks()\n\th = &HookStats{}\n\th.GetInactiveHooks()\n\th = nil\n\th.GetInactiveHooks()\n}\n\nfunc TestHookStats_GetTotalHooks(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\th := &HookStats{TotalHooks: &zeroValue}\n\th.GetTotalHooks()\n\th = &HookStats{}\n\th.GetTotalHooks()\n\th = nil\n\th.GetTotalHooks()\n}\n\nfunc TestHostedRunner_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\th := &HostedRunner{ID: &zeroValue}\n\th.GetID()\n\th = &HostedRunner{}\n\th.GetID()\n\th = nil\n\th.GetID()\n}\n\nfunc TestHostedRunner_GetImageDetails(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunner{}\n\th.GetImageDetails()\n\th = nil\n\th.GetImageDetails()\n}\n\nfunc TestHostedRunner_GetLastActiveOn(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\th := &HostedRunner{LastActiveOn: &zeroValue}\n\th.GetLastActiveOn()\n\th = &HostedRunner{}\n\th.GetLastActiveOn()\n\th = nil\n\th.GetLastActiveOn()\n}\n\nfunc TestHostedRunner_GetMachineSizeDetails(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunner{}\n\th.GetMachineSizeDetails()\n\th = nil\n\th.GetMachineSizeDetails()\n}\n\nfunc TestHostedRunner_GetMaximumRunners(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\th := &HostedRunner{MaximumRunners: &zeroValue}\n\th.GetMaximumRunners()\n\th = &HostedRunner{}\n\th.GetMaximumRunners()\n\th = nil\n\th.GetMaximumRunners()\n}\n\nfunc TestHostedRunner_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\th := &HostedRunner{Name: &zeroValue}\n\th.GetName()\n\th = &HostedRunner{}\n\th.GetName()\n\th = nil\n\th.GetName()\n}\n\nfunc TestHostedRunner_GetPlatform(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\th := &HostedRunner{Platform: &zeroValue}\n\th.GetPlatform()\n\th = &HostedRunner{}\n\th.GetPlatform()\n\th = nil\n\th.GetPlatform()\n}\n\nfunc TestHostedRunner_GetPublicIPEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\th := &HostedRunner{PublicIPEnabled: &zeroValue}\n\th.GetPublicIPEnabled()\n\th = &HostedRunner{}\n\th.GetPublicIPEnabled()\n\th = nil\n\th.GetPublicIPEnabled()\n}\n\nfunc TestHostedRunner_GetPublicIPs(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*HostedRunnerPublicIP{}\n\th := &HostedRunner{PublicIPs: zeroValue}\n\th.GetPublicIPs()\n\th = &HostedRunner{}\n\th.GetPublicIPs()\n\th = nil\n\th.GetPublicIPs()\n}\n\nfunc TestHostedRunner_GetRunnerGroupID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\th := &HostedRunner{RunnerGroupID: &zeroValue}\n\th.GetRunnerGroupID()\n\th = &HostedRunner{}\n\th.GetRunnerGroupID()\n\th = nil\n\th.GetRunnerGroupID()\n}\n\nfunc TestHostedRunner_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\th := &HostedRunner{Status: &zeroValue}\n\th.GetStatus()\n\th = &HostedRunner{}\n\th.GetStatus()\n\th = nil\n\th.GetStatus()\n}\n\nfunc TestHostedRunnerCustomImage_GetID(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerCustomImage{}\n\th.GetID()\n\th = nil\n\th.GetID()\n}\n\nfunc TestHostedRunnerCustomImage_GetLatestVersion(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerCustomImage{}\n\th.GetLatestVersion()\n\th = nil\n\th.GetLatestVersion()\n}\n\nfunc TestHostedRunnerCustomImage_GetName(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerCustomImage{}\n\th.GetName()\n\th = nil\n\th.GetName()\n}\n\nfunc TestHostedRunnerCustomImage_GetPlatform(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerCustomImage{}\n\th.GetPlatform()\n\th = nil\n\th.GetPlatform()\n}\n\nfunc TestHostedRunnerCustomImage_GetSource(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerCustomImage{}\n\th.GetSource()\n\th = nil\n\th.GetSource()\n}\n\nfunc TestHostedRunnerCustomImage_GetState(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerCustomImage{}\n\th.GetState()\n\th = nil\n\th.GetState()\n}\n\nfunc TestHostedRunnerCustomImage_GetTotalVersionsSize(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerCustomImage{}\n\th.GetTotalVersionsSize()\n\th = nil\n\th.GetTotalVersionsSize()\n}\n\nfunc TestHostedRunnerCustomImage_GetVersionsCount(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerCustomImage{}\n\th.GetVersionsCount()\n\th = nil\n\th.GetVersionsCount()\n}\n\nfunc TestHostedRunnerCustomImages_GetImages(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*HostedRunnerCustomImage{}\n\th := &HostedRunnerCustomImages{Images: zeroValue}\n\th.GetImages()\n\th = &HostedRunnerCustomImages{}\n\th.GetImages()\n\th = nil\n\th.GetImages()\n}\n\nfunc TestHostedRunnerCustomImages_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerCustomImages{}\n\th.GetTotalCount()\n\th = nil\n\th.GetTotalCount()\n}\n\nfunc TestHostedRunnerCustomImageVersion_GetCreatedOn(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerCustomImageVersion{}\n\th.GetCreatedOn()\n\th = nil\n\th.GetCreatedOn()\n}\n\nfunc TestHostedRunnerCustomImageVersion_GetSizeGB(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerCustomImageVersion{}\n\th.GetSizeGB()\n\th = nil\n\th.GetSizeGB()\n}\n\nfunc TestHostedRunnerCustomImageVersion_GetState(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerCustomImageVersion{}\n\th.GetState()\n\th = nil\n\th.GetState()\n}\n\nfunc TestHostedRunnerCustomImageVersion_GetStateDetails(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerCustomImageVersion{}\n\th.GetStateDetails()\n\th = nil\n\th.GetStateDetails()\n}\n\nfunc TestHostedRunnerCustomImageVersion_GetVersion(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerCustomImageVersion{}\n\th.GetVersion()\n\th = nil\n\th.GetVersion()\n}\n\nfunc TestHostedRunnerCustomImageVersions_GetImageVersions(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*HostedRunnerCustomImageVersion{}\n\th := &HostedRunnerCustomImageVersions{ImageVersions: zeroValue}\n\th.GetImageVersions()\n\th = &HostedRunnerCustomImageVersions{}\n\th.GetImageVersions()\n\th = nil\n\th.GetImageVersions()\n}\n\nfunc TestHostedRunnerCustomImageVersions_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerCustomImageVersions{}\n\th.GetTotalCount()\n\th = nil\n\th.GetTotalCount()\n}\n\nfunc TestHostedRunnerImage_GetID(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerImage{}\n\th.GetID()\n\th = nil\n\th.GetID()\n}\n\nfunc TestHostedRunnerImage_GetSource(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerImage{}\n\th.GetSource()\n\th = nil\n\th.GetSource()\n}\n\nfunc TestHostedRunnerImage_GetVersion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\th := &HostedRunnerImage{Version: &zeroValue}\n\th.GetVersion()\n\th = &HostedRunnerImage{}\n\th.GetVersion()\n\th = nil\n\th.GetVersion()\n}\n\nfunc TestHostedRunnerImageDetail_GetDisplayName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\th := &HostedRunnerImageDetail{DisplayName: &zeroValue}\n\th.GetDisplayName()\n\th = &HostedRunnerImageDetail{}\n\th.GetDisplayName()\n\th = nil\n\th.GetDisplayName()\n}\n\nfunc TestHostedRunnerImageDetail_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\th := &HostedRunnerImageDetail{ID: &zeroValue}\n\th.GetID()\n\th = &HostedRunnerImageDetail{}\n\th.GetID()\n\th = nil\n\th.GetID()\n}\n\nfunc TestHostedRunnerImageDetail_GetSizeGB(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\th := &HostedRunnerImageDetail{SizeGB: &zeroValue}\n\th.GetSizeGB()\n\th = &HostedRunnerImageDetail{}\n\th.GetSizeGB()\n\th = nil\n\th.GetSizeGB()\n}\n\nfunc TestHostedRunnerImageDetail_GetSource(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\th := &HostedRunnerImageDetail{Source: &zeroValue}\n\th.GetSource()\n\th = &HostedRunnerImageDetail{}\n\th.GetSource()\n\th = nil\n\th.GetSource()\n}\n\nfunc TestHostedRunnerImageDetail_GetVersion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\th := &HostedRunnerImageDetail{Version: &zeroValue}\n\th.GetVersion()\n\th = &HostedRunnerImageDetail{}\n\th.GetVersion()\n\th = nil\n\th.GetVersion()\n}\n\nfunc TestHostedRunnerImages_GetImages(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*HostedRunnerImageSpecs{}\n\th := &HostedRunnerImages{Images: zeroValue}\n\th.GetImages()\n\th = &HostedRunnerImages{}\n\th.GetImages()\n\th = nil\n\th.GetImages()\n}\n\nfunc TestHostedRunnerImages_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerImages{}\n\th.GetTotalCount()\n\th = nil\n\th.GetTotalCount()\n}\n\nfunc TestHostedRunnerImageSpecs_GetDisplayName(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerImageSpecs{}\n\th.GetDisplayName()\n\th = nil\n\th.GetDisplayName()\n}\n\nfunc TestHostedRunnerImageSpecs_GetID(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerImageSpecs{}\n\th.GetID()\n\th = nil\n\th.GetID()\n}\n\nfunc TestHostedRunnerImageSpecs_GetPlatform(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerImageSpecs{}\n\th.GetPlatform()\n\th = nil\n\th.GetPlatform()\n}\n\nfunc TestHostedRunnerImageSpecs_GetSizeGB(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerImageSpecs{}\n\th.GetSizeGB()\n\th = nil\n\th.GetSizeGB()\n}\n\nfunc TestHostedRunnerImageSpecs_GetSource(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerImageSpecs{}\n\th.GetSource()\n\th = nil\n\th.GetSource()\n}\n\nfunc TestHostedRunnerMachineSpec_GetCPUCores(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerMachineSpec{}\n\th.GetCPUCores()\n\th = nil\n\th.GetCPUCores()\n}\n\nfunc TestHostedRunnerMachineSpec_GetID(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerMachineSpec{}\n\th.GetID()\n\th = nil\n\th.GetID()\n}\n\nfunc TestHostedRunnerMachineSpec_GetMemoryGB(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerMachineSpec{}\n\th.GetMemoryGB()\n\th = nil\n\th.GetMemoryGB()\n}\n\nfunc TestHostedRunnerMachineSpec_GetStorageGB(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerMachineSpec{}\n\th.GetStorageGB()\n\th = nil\n\th.GetStorageGB()\n}\n\nfunc TestHostedRunnerMachineSpecs_GetMachineSpecs(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*HostedRunnerMachineSpec{}\n\th := &HostedRunnerMachineSpecs{MachineSpecs: zeroValue}\n\th.GetMachineSpecs()\n\th = &HostedRunnerMachineSpecs{}\n\th.GetMachineSpecs()\n\th = nil\n\th.GetMachineSpecs()\n}\n\nfunc TestHostedRunnerMachineSpecs_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerMachineSpecs{}\n\th.GetTotalCount()\n\th = nil\n\th.GetTotalCount()\n}\n\nfunc TestHostedRunnerPlatforms_GetPlatforms(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\th := &HostedRunnerPlatforms{Platforms: zeroValue}\n\th.GetPlatforms()\n\th = &HostedRunnerPlatforms{}\n\th.GetPlatforms()\n\th = nil\n\th.GetPlatforms()\n}\n\nfunc TestHostedRunnerPlatforms_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerPlatforms{}\n\th.GetTotalCount()\n\th = nil\n\th.GetTotalCount()\n}\n\nfunc TestHostedRunnerPublicIP_GetEnabled(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerPublicIP{}\n\th.GetEnabled()\n\th = nil\n\th.GetEnabled()\n}\n\nfunc TestHostedRunnerPublicIP_GetLength(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerPublicIP{}\n\th.GetLength()\n\th = nil\n\th.GetLength()\n}\n\nfunc TestHostedRunnerPublicIP_GetPrefix(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerPublicIP{}\n\th.GetPrefix()\n\th = nil\n\th.GetPrefix()\n}\n\nfunc TestHostedRunnerPublicIPLimits_GetPublicIPs(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunnerPublicIPLimits{}\n\th.GetPublicIPs()\n\th = nil\n\th.GetPublicIPs()\n}\n\nfunc TestHostedRunners_GetRunners(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*HostedRunner{}\n\th := &HostedRunners{Runners: zeroValue}\n\th.GetRunners()\n\th = &HostedRunners{}\n\th.GetRunners()\n\th = nil\n\th.GetRunners()\n}\n\nfunc TestHostedRunners_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\th := &HostedRunners{}\n\th.GetTotalCount()\n\th = nil\n\th.GetTotalCount()\n}\n\nfunc TestHovercard_GetContexts(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*UserContext{}\n\th := &Hovercard{Contexts: zeroValue}\n\th.GetContexts()\n\th = &Hovercard{}\n\th.GetContexts()\n\th = nil\n\th.GetContexts()\n}\n\nfunc TestHovercardOptions_GetSubjectID(tt *testing.T) {\n\ttt.Parallel()\n\th := &HovercardOptions{}\n\th.GetSubjectID()\n\th = nil\n\th.GetSubjectID()\n}\n\nfunc TestHovercardOptions_GetSubjectType(tt *testing.T) {\n\ttt.Parallel()\n\th := &HovercardOptions{}\n\th.GetSubjectType()\n\th = nil\n\th.GetSubjectType()\n}\n\nfunc TestIDPGroup_GetGroupDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IDPGroup{GroupDescription: &zeroValue}\n\ti.GetGroupDescription()\n\ti = &IDPGroup{}\n\ti.GetGroupDescription()\n\ti = nil\n\ti.GetGroupDescription()\n}\n\nfunc TestIDPGroup_GetGroupID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IDPGroup{GroupID: &zeroValue}\n\ti.GetGroupID()\n\ti = &IDPGroup{}\n\ti.GetGroupID()\n\ti = nil\n\ti.GetGroupID()\n}\n\nfunc TestIDPGroup_GetGroupName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IDPGroup{GroupName: &zeroValue}\n\ti.GetGroupName()\n\ti = &IDPGroup{}\n\ti.GetGroupName()\n\ti = nil\n\ti.GetGroupName()\n}\n\nfunc TestIDPGroupList_GetGroups(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*IDPGroup{}\n\ti := &IDPGroupList{Groups: zeroValue}\n\ti.GetGroups()\n\ti = &IDPGroupList{}\n\ti.GetGroups()\n\ti = nil\n\ti.GetGroups()\n}\n\nfunc TestImmutableReleasePolicy_GetEnforcedRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &ImmutableReleasePolicy{EnforcedRepositories: &zeroValue}\n\ti.GetEnforcedRepositories()\n\ti = &ImmutableReleasePolicy{}\n\ti.GetEnforcedRepositories()\n\ti = nil\n\ti.GetEnforcedRepositories()\n}\n\nfunc TestImmutableReleasePolicy_GetSelectedRepositoryIDs(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []int64{}\n\ti := &ImmutableReleasePolicy{SelectedRepositoryIDs: zeroValue}\n\ti.GetSelectedRepositoryIDs()\n\ti = &ImmutableReleasePolicy{}\n\ti.GetSelectedRepositoryIDs()\n\ti = nil\n\ti.GetSelectedRepositoryIDs()\n}\n\nfunc TestImmutableReleaseSettings_GetEnforcedRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &ImmutableReleaseSettings{EnforcedRepositories: &zeroValue}\n\ti.GetEnforcedRepositories()\n\ti = &ImmutableReleaseSettings{}\n\ti.GetEnforcedRepositories()\n\ti = nil\n\ti.GetEnforcedRepositories()\n}\n\nfunc TestImmutableReleaseSettings_GetSelectedRepositoriesURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &ImmutableReleaseSettings{SelectedRepositoriesURL: &zeroValue}\n\ti.GetSelectedRepositoriesURL()\n\ti = &ImmutableReleaseSettings{}\n\ti.GetSelectedRepositoriesURL()\n\ti = nil\n\ti.GetSelectedRepositoriesURL()\n}\n\nfunc TestImpersonateUserOptions_GetScopes(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ti := &ImpersonateUserOptions{Scopes: zeroValue}\n\ti.GetScopes()\n\ti = &ImpersonateUserOptions{}\n\ti.GetScopes()\n\ti = nil\n\ti.GetScopes()\n}\n\nfunc TestImport_GetAuthorsCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ti := &Import{AuthorsCount: &zeroValue}\n\ti.GetAuthorsCount()\n\ti = &Import{}\n\ti.GetAuthorsCount()\n\ti = nil\n\ti.GetAuthorsCount()\n}\n\nfunc TestImport_GetAuthorsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Import{AuthorsURL: &zeroValue}\n\ti.GetAuthorsURL()\n\ti = &Import{}\n\ti.GetAuthorsURL()\n\ti = nil\n\ti.GetAuthorsURL()\n}\n\nfunc TestImport_GetCommitCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ti := &Import{CommitCount: &zeroValue}\n\ti.GetCommitCount()\n\ti = &Import{}\n\ti.GetCommitCount()\n\ti = nil\n\ti.GetCommitCount()\n}\n\nfunc TestImport_GetFailedStep(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Import{FailedStep: &zeroValue}\n\ti.GetFailedStep()\n\ti = &Import{}\n\ti.GetFailedStep()\n\ti = nil\n\ti.GetFailedStep()\n}\n\nfunc TestImport_GetHasLargeFiles(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ti := &Import{HasLargeFiles: &zeroValue}\n\ti.GetHasLargeFiles()\n\ti = &Import{}\n\ti.GetHasLargeFiles()\n\ti = nil\n\ti.GetHasLargeFiles()\n}\n\nfunc TestImport_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Import{HTMLURL: &zeroValue}\n\ti.GetHTMLURL()\n\ti = &Import{}\n\ti.GetHTMLURL()\n\ti = nil\n\ti.GetHTMLURL()\n}\n\nfunc TestImport_GetHumanName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Import{HumanName: &zeroValue}\n\ti.GetHumanName()\n\ti = &Import{}\n\ti.GetHumanName()\n\ti = nil\n\ti.GetHumanName()\n}\n\nfunc TestImport_GetLargeFilesCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ti := &Import{LargeFilesCount: &zeroValue}\n\ti.GetLargeFilesCount()\n\ti = &Import{}\n\ti.GetLargeFilesCount()\n\ti = nil\n\ti.GetLargeFilesCount()\n}\n\nfunc TestImport_GetLargeFilesSize(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ti := &Import{LargeFilesSize: &zeroValue}\n\ti.GetLargeFilesSize()\n\ti = &Import{}\n\ti.GetLargeFilesSize()\n\ti = nil\n\ti.GetLargeFilesSize()\n}\n\nfunc TestImport_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Import{Message: &zeroValue}\n\ti.GetMessage()\n\ti = &Import{}\n\ti.GetMessage()\n\ti = nil\n\ti.GetMessage()\n}\n\nfunc TestImport_GetPercent(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ti := &Import{Percent: &zeroValue}\n\ti.GetPercent()\n\ti = &Import{}\n\ti.GetPercent()\n\ti = nil\n\ti.GetPercent()\n}\n\nfunc TestImport_GetProjectChoices(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Import{}\n\ti := &Import{ProjectChoices: zeroValue}\n\ti.GetProjectChoices()\n\ti = &Import{}\n\ti.GetProjectChoices()\n\ti = nil\n\ti.GetProjectChoices()\n}\n\nfunc TestImport_GetPushPercent(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ti := &Import{PushPercent: &zeroValue}\n\ti.GetPushPercent()\n\ti = &Import{}\n\ti.GetPushPercent()\n\ti = nil\n\ti.GetPushPercent()\n}\n\nfunc TestImport_GetRepositoryURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Import{RepositoryURL: &zeroValue}\n\ti.GetRepositoryURL()\n\ti = &Import{}\n\ti.GetRepositoryURL()\n\ti = nil\n\ti.GetRepositoryURL()\n}\n\nfunc TestImport_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Import{Status: &zeroValue}\n\ti.GetStatus()\n\ti = &Import{}\n\ti.GetStatus()\n\ti = nil\n\ti.GetStatus()\n}\n\nfunc TestImport_GetStatusText(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Import{StatusText: &zeroValue}\n\ti.GetStatusText()\n\ti = &Import{}\n\ti.GetStatusText()\n\ti = nil\n\ti.GetStatusText()\n}\n\nfunc TestImport_GetTFVCProject(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Import{TFVCProject: &zeroValue}\n\ti.GetTFVCProject()\n\ti = &Import{}\n\ti.GetTFVCProject()\n\ti = nil\n\ti.GetTFVCProject()\n}\n\nfunc TestImport_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Import{URL: &zeroValue}\n\ti.GetURL()\n\ti = &Import{}\n\ti.GetURL()\n\ti = nil\n\ti.GetURL()\n}\n\nfunc TestImport_GetUseLFS(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Import{UseLFS: &zeroValue}\n\ti.GetUseLFS()\n\ti = &Import{}\n\ti.GetUseLFS()\n\ti = nil\n\ti.GetUseLFS()\n}\n\nfunc TestImport_GetVCS(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Import{VCS: &zeroValue}\n\ti.GetVCS()\n\ti = &Import{}\n\ti.GetVCS()\n\ti = nil\n\ti.GetVCS()\n}\n\nfunc TestImport_GetVCSPassword(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Import{VCSPassword: &zeroValue}\n\ti.GetVCSPassword()\n\ti = &Import{}\n\ti.GetVCSPassword()\n\ti = nil\n\ti.GetVCSPassword()\n}\n\nfunc TestImport_GetVCSURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Import{VCSURL: &zeroValue}\n\ti.GetVCSURL()\n\ti = &Import{}\n\ti.GetVCSURL()\n\ti = nil\n\ti.GetVCSURL()\n}\n\nfunc TestImport_GetVCSUsername(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Import{VCSUsername: &zeroValue}\n\ti.GetVCSUsername()\n\ti = &Import{}\n\ti.GetVCSUsername()\n\ti = nil\n\ti.GetVCSUsername()\n}\n\nfunc TestInitialConfigOptions_GetLicense(tt *testing.T) {\n\ttt.Parallel()\n\ti := &InitialConfigOptions{}\n\ti.GetLicense()\n\ti = nil\n\ti.GetLicense()\n}\n\nfunc TestInitialConfigOptions_GetPassword(tt *testing.T) {\n\ttt.Parallel()\n\ti := &InitialConfigOptions{}\n\ti.GetPassword()\n\ti = nil\n\ti.GetPassword()\n}\n\nfunc TestInstallableOrganization_GetAccessibleRepositoriesURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallableOrganization{AccessibleRepositoriesURL: &zeroValue}\n\ti.GetAccessibleRepositoriesURL()\n\ti = &InstallableOrganization{}\n\ti.GetAccessibleRepositoriesURL()\n\ti = nil\n\ti.GetAccessibleRepositoriesURL()\n}\n\nfunc TestInstallableOrganization_GetID(tt *testing.T) {\n\ttt.Parallel()\n\ti := &InstallableOrganization{}\n\ti.GetID()\n\ti = nil\n\ti.GetID()\n}\n\nfunc TestInstallableOrganization_GetLogin(tt *testing.T) {\n\ttt.Parallel()\n\ti := &InstallableOrganization{}\n\ti.GetLogin()\n\ti = nil\n\ti.GetLogin()\n}\n\nfunc TestInstallAppRequest_GetClientID(tt *testing.T) {\n\ttt.Parallel()\n\ti := &InstallAppRequest{}\n\ti.GetClientID()\n\ti = nil\n\ti.GetClientID()\n}\n\nfunc TestInstallAppRequest_GetRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ti := &InstallAppRequest{Repositories: zeroValue}\n\ti.GetRepositories()\n\ti = &InstallAppRequest{}\n\ti.GetRepositories()\n\ti = nil\n\ti.GetRepositories()\n}\n\nfunc TestInstallAppRequest_GetRepositorySelection(tt *testing.T) {\n\ttt.Parallel()\n\ti := &InstallAppRequest{}\n\ti.GetRepositorySelection()\n\ti = nil\n\ti.GetRepositorySelection()\n}\n\nfunc TestInstallation_GetAccessTokensURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Installation{AccessTokensURL: &zeroValue}\n\ti.GetAccessTokensURL()\n\ti = &Installation{}\n\ti.GetAccessTokensURL()\n\ti = nil\n\ti.GetAccessTokensURL()\n}\n\nfunc TestInstallation_GetAccount(tt *testing.T) {\n\ttt.Parallel()\n\ti := &Installation{}\n\ti.GetAccount()\n\ti = nil\n\ti.GetAccount()\n}\n\nfunc TestInstallation_GetAppID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ti := &Installation{AppID: &zeroValue}\n\ti.GetAppID()\n\ti = &Installation{}\n\ti.GetAppID()\n\ti = nil\n\ti.GetAppID()\n}\n\nfunc TestInstallation_GetAppSlug(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Installation{AppSlug: &zeroValue}\n\ti.GetAppSlug()\n\ti = &Installation{}\n\ti.GetAppSlug()\n\ti = nil\n\ti.GetAppSlug()\n}\n\nfunc TestInstallation_GetClientID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Installation{ClientID: &zeroValue}\n\ti.GetClientID()\n\ti = &Installation{}\n\ti.GetClientID()\n\ti = nil\n\ti.GetClientID()\n}\n\nfunc TestInstallation_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ti := &Installation{CreatedAt: &zeroValue}\n\ti.GetCreatedAt()\n\ti = &Installation{}\n\ti.GetCreatedAt()\n\ti = nil\n\ti.GetCreatedAt()\n}\n\nfunc TestInstallation_GetEvents(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ti := &Installation{Events: zeroValue}\n\ti.GetEvents()\n\ti = &Installation{}\n\ti.GetEvents()\n\ti = nil\n\ti.GetEvents()\n}\n\nfunc TestInstallation_GetHasMultipleSingleFiles(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ti := &Installation{HasMultipleSingleFiles: &zeroValue}\n\ti.GetHasMultipleSingleFiles()\n\ti = &Installation{}\n\ti.GetHasMultipleSingleFiles()\n\ti = nil\n\ti.GetHasMultipleSingleFiles()\n}\n\nfunc TestInstallation_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Installation{HTMLURL: &zeroValue}\n\ti.GetHTMLURL()\n\ti = &Installation{}\n\ti.GetHTMLURL()\n\ti = nil\n\ti.GetHTMLURL()\n}\n\nfunc TestInstallation_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ti := &Installation{ID: &zeroValue}\n\ti.GetID()\n\ti = &Installation{}\n\ti.GetID()\n\ti = nil\n\ti.GetID()\n}\n\nfunc TestInstallation_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Installation{NodeID: &zeroValue}\n\ti.GetNodeID()\n\ti = &Installation{}\n\ti.GetNodeID()\n\ti = nil\n\ti.GetNodeID()\n}\n\nfunc TestInstallation_GetPermissions(tt *testing.T) {\n\ttt.Parallel()\n\ti := &Installation{}\n\ti.GetPermissions()\n\ti = nil\n\ti.GetPermissions()\n}\n\nfunc TestInstallation_GetRepositoriesURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Installation{RepositoriesURL: &zeroValue}\n\ti.GetRepositoriesURL()\n\ti = &Installation{}\n\ti.GetRepositoriesURL()\n\ti = nil\n\ti.GetRepositoriesURL()\n}\n\nfunc TestInstallation_GetRepositorySelection(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Installation{RepositorySelection: &zeroValue}\n\ti.GetRepositorySelection()\n\ti = &Installation{}\n\ti.GetRepositorySelection()\n\ti = nil\n\ti.GetRepositorySelection()\n}\n\nfunc TestInstallation_GetSingleFileName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Installation{SingleFileName: &zeroValue}\n\ti.GetSingleFileName()\n\ti = &Installation{}\n\ti.GetSingleFileName()\n\ti = nil\n\ti.GetSingleFileName()\n}\n\nfunc TestInstallation_GetSingleFilePaths(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ti := &Installation{SingleFilePaths: zeroValue}\n\ti.GetSingleFilePaths()\n\ti = &Installation{}\n\ti.GetSingleFilePaths()\n\ti = nil\n\ti.GetSingleFilePaths()\n}\n\nfunc TestInstallation_GetSuspendedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ti := &Installation{SuspendedAt: &zeroValue}\n\ti.GetSuspendedAt()\n\ti = &Installation{}\n\ti.GetSuspendedAt()\n\ti = nil\n\ti.GetSuspendedAt()\n}\n\nfunc TestInstallation_GetSuspendedBy(tt *testing.T) {\n\ttt.Parallel()\n\ti := &Installation{}\n\ti.GetSuspendedBy()\n\ti = nil\n\ti.GetSuspendedBy()\n}\n\nfunc TestInstallation_GetTargetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ti := &Installation{TargetID: &zeroValue}\n\ti.GetTargetID()\n\ti = &Installation{}\n\ti.GetTargetID()\n\ti = nil\n\ti.GetTargetID()\n}\n\nfunc TestInstallation_GetTargetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Installation{TargetType: &zeroValue}\n\ti.GetTargetType()\n\ti = &Installation{}\n\ti.GetTargetType()\n\ti = nil\n\ti.GetTargetType()\n}\n\nfunc TestInstallation_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ti := &Installation{UpdatedAt: &zeroValue}\n\ti.GetUpdatedAt()\n\ti = &Installation{}\n\ti.GetUpdatedAt()\n\ti = nil\n\ti.GetUpdatedAt()\n}\n\nfunc TestInstallationChanges_GetLogin(tt *testing.T) {\n\ttt.Parallel()\n\ti := &InstallationChanges{}\n\ti.GetLogin()\n\ti = nil\n\ti.GetLogin()\n}\n\nfunc TestInstallationChanges_GetSlug(tt *testing.T) {\n\ttt.Parallel()\n\ti := &InstallationChanges{}\n\ti.GetSlug()\n\ti = nil\n\ti.GetSlug()\n}\n\nfunc TestInstallationEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationEvent{Action: &zeroValue}\n\ti.GetAction()\n\ti = &InstallationEvent{}\n\ti.GetAction()\n\ti = nil\n\ti.GetAction()\n}\n\nfunc TestInstallationEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\ti := &InstallationEvent{}\n\ti.GetInstallation()\n\ti = nil\n\ti.GetInstallation()\n}\n\nfunc TestInstallationEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\ti := &InstallationEvent{}\n\ti.GetOrg()\n\ti = nil\n\ti.GetOrg()\n}\n\nfunc TestInstallationEvent_GetRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Repository{}\n\ti := &InstallationEvent{Repositories: zeroValue}\n\ti.GetRepositories()\n\ti = &InstallationEvent{}\n\ti.GetRepositories()\n\ti = nil\n\ti.GetRepositories()\n}\n\nfunc TestInstallationEvent_GetRequester(tt *testing.T) {\n\ttt.Parallel()\n\ti := &InstallationEvent{}\n\ti.GetRequester()\n\ti = nil\n\ti.GetRequester()\n}\n\nfunc TestInstallationEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\ti := &InstallationEvent{}\n\ti.GetSender()\n\ti = nil\n\ti.GetSender()\n}\n\nfunc TestInstallationLoginChange_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationLoginChange{From: &zeroValue}\n\ti.GetFrom()\n\ti = &InstallationLoginChange{}\n\ti.GetFrom()\n\ti = nil\n\ti.GetFrom()\n}\n\nfunc TestInstallationPermissions_GetActions(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{Actions: &zeroValue}\n\ti.GetActions()\n\ti = &InstallationPermissions{}\n\ti.GetActions()\n\ti = nil\n\ti.GetActions()\n}\n\nfunc TestInstallationPermissions_GetActionsVariables(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{ActionsVariables: &zeroValue}\n\ti.GetActionsVariables()\n\ti = &InstallationPermissions{}\n\ti.GetActionsVariables()\n\ti = nil\n\ti.GetActionsVariables()\n}\n\nfunc TestInstallationPermissions_GetAdministration(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{Administration: &zeroValue}\n\ti.GetAdministration()\n\ti = &InstallationPermissions{}\n\ti.GetAdministration()\n\ti = nil\n\ti.GetAdministration()\n}\n\nfunc TestInstallationPermissions_GetAttestations(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{Attestations: &zeroValue}\n\ti.GetAttestations()\n\ti = &InstallationPermissions{}\n\ti.GetAttestations()\n\ti = nil\n\ti.GetAttestations()\n}\n\nfunc TestInstallationPermissions_GetBlocking(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{Blocking: &zeroValue}\n\ti.GetBlocking()\n\ti = &InstallationPermissions{}\n\ti.GetBlocking()\n\ti = nil\n\ti.GetBlocking()\n}\n\nfunc TestInstallationPermissions_GetChecks(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{Checks: &zeroValue}\n\ti.GetChecks()\n\ti = &InstallationPermissions{}\n\ti.GetChecks()\n\ti = nil\n\ti.GetChecks()\n}\n\nfunc TestInstallationPermissions_GetCodespaces(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{Codespaces: &zeroValue}\n\ti.GetCodespaces()\n\ti = &InstallationPermissions{}\n\ti.GetCodespaces()\n\ti = nil\n\ti.GetCodespaces()\n}\n\nfunc TestInstallationPermissions_GetCodespacesLifecycleAdmin(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{CodespacesLifecycleAdmin: &zeroValue}\n\ti.GetCodespacesLifecycleAdmin()\n\ti = &InstallationPermissions{}\n\ti.GetCodespacesLifecycleAdmin()\n\ti = nil\n\ti.GetCodespacesLifecycleAdmin()\n}\n\nfunc TestInstallationPermissions_GetCodespacesMetadata(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{CodespacesMetadata: &zeroValue}\n\ti.GetCodespacesMetadata()\n\ti = &InstallationPermissions{}\n\ti.GetCodespacesMetadata()\n\ti = nil\n\ti.GetCodespacesMetadata()\n}\n\nfunc TestInstallationPermissions_GetCodespacesSecrets(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{CodespacesSecrets: &zeroValue}\n\ti.GetCodespacesSecrets()\n\ti = &InstallationPermissions{}\n\ti.GetCodespacesSecrets()\n\ti = nil\n\ti.GetCodespacesSecrets()\n}\n\nfunc TestInstallationPermissions_GetCodespacesUserSecrets(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{CodespacesUserSecrets: &zeroValue}\n\ti.GetCodespacesUserSecrets()\n\ti = &InstallationPermissions{}\n\ti.GetCodespacesUserSecrets()\n\ti = nil\n\ti.GetCodespacesUserSecrets()\n}\n\nfunc TestInstallationPermissions_GetContentReferences(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{ContentReferences: &zeroValue}\n\ti.GetContentReferences()\n\ti = &InstallationPermissions{}\n\ti.GetContentReferences()\n\ti = nil\n\ti.GetContentReferences()\n}\n\nfunc TestInstallationPermissions_GetContents(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{Contents: &zeroValue}\n\ti.GetContents()\n\ti = &InstallationPermissions{}\n\ti.GetContents()\n\ti = nil\n\ti.GetContents()\n}\n\nfunc TestInstallationPermissions_GetCopilotMessages(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{CopilotMessages: &zeroValue}\n\ti.GetCopilotMessages()\n\ti = &InstallationPermissions{}\n\ti.GetCopilotMessages()\n\ti = nil\n\ti.GetCopilotMessages()\n}\n\nfunc TestInstallationPermissions_GetDependabotSecrets(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{DependabotSecrets: &zeroValue}\n\ti.GetDependabotSecrets()\n\ti = &InstallationPermissions{}\n\ti.GetDependabotSecrets()\n\ti = nil\n\ti.GetDependabotSecrets()\n}\n\nfunc TestInstallationPermissions_GetDeployments(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{Deployments: &zeroValue}\n\ti.GetDeployments()\n\ti = &InstallationPermissions{}\n\ti.GetDeployments()\n\ti = nil\n\ti.GetDeployments()\n}\n\nfunc TestInstallationPermissions_GetDiscussions(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{Discussions: &zeroValue}\n\ti.GetDiscussions()\n\ti = &InstallationPermissions{}\n\ti.GetDiscussions()\n\ti = nil\n\ti.GetDiscussions()\n}\n\nfunc TestInstallationPermissions_GetEmails(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{Emails: &zeroValue}\n\ti.GetEmails()\n\ti = &InstallationPermissions{}\n\ti.GetEmails()\n\ti = nil\n\ti.GetEmails()\n}\n\nfunc TestInstallationPermissions_GetEnvironments(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{Environments: &zeroValue}\n\ti.GetEnvironments()\n\ti = &InstallationPermissions{}\n\ti.GetEnvironments()\n\ti = nil\n\ti.GetEnvironments()\n}\n\nfunc TestInstallationPermissions_GetFollowers(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{Followers: &zeroValue}\n\ti.GetFollowers()\n\ti = &InstallationPermissions{}\n\ti.GetFollowers()\n\ti = nil\n\ti.GetFollowers()\n}\n\nfunc TestInstallationPermissions_GetGists(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{Gists: &zeroValue}\n\ti.GetGists()\n\ti = &InstallationPermissions{}\n\ti.GetGists()\n\ti = nil\n\ti.GetGists()\n}\n\nfunc TestInstallationPermissions_GetGitSigningSSHPublicKeys(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{GitSigningSSHPublicKeys: &zeroValue}\n\ti.GetGitSigningSSHPublicKeys()\n\ti = &InstallationPermissions{}\n\ti.GetGitSigningSSHPublicKeys()\n\ti = nil\n\ti.GetGitSigningSSHPublicKeys()\n}\n\nfunc TestInstallationPermissions_GetGPGKeys(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{GPGKeys: &zeroValue}\n\ti.GetGPGKeys()\n\ti = &InstallationPermissions{}\n\ti.GetGPGKeys()\n\ti = nil\n\ti.GetGPGKeys()\n}\n\nfunc TestInstallationPermissions_GetInteractionLimits(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{InteractionLimits: &zeroValue}\n\ti.GetInteractionLimits()\n\ti = &InstallationPermissions{}\n\ti.GetInteractionLimits()\n\ti = nil\n\ti.GetInteractionLimits()\n}\n\nfunc TestInstallationPermissions_GetIssues(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{Issues: &zeroValue}\n\ti.GetIssues()\n\ti = &InstallationPermissions{}\n\ti.GetIssues()\n\ti = nil\n\ti.GetIssues()\n}\n\nfunc TestInstallationPermissions_GetKeys(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{Keys: &zeroValue}\n\ti.GetKeys()\n\ti = &InstallationPermissions{}\n\ti.GetKeys()\n\ti = nil\n\ti.GetKeys()\n}\n\nfunc TestInstallationPermissions_GetMembers(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{Members: &zeroValue}\n\ti.GetMembers()\n\ti = &InstallationPermissions{}\n\ti.GetMembers()\n\ti = nil\n\ti.GetMembers()\n}\n\nfunc TestInstallationPermissions_GetMergeQueues(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{MergeQueues: &zeroValue}\n\ti.GetMergeQueues()\n\ti = &InstallationPermissions{}\n\ti.GetMergeQueues()\n\ti = nil\n\ti.GetMergeQueues()\n}\n\nfunc TestInstallationPermissions_GetMetadata(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{Metadata: &zeroValue}\n\ti.GetMetadata()\n\ti = &InstallationPermissions{}\n\ti.GetMetadata()\n\ti = nil\n\ti.GetMetadata()\n}\n\nfunc TestInstallationPermissions_GetOrganizationActionsVariables(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{OrganizationActionsVariables: &zeroValue}\n\ti.GetOrganizationActionsVariables()\n\ti = &InstallationPermissions{}\n\ti.GetOrganizationActionsVariables()\n\ti = nil\n\ti.GetOrganizationActionsVariables()\n}\n\nfunc TestInstallationPermissions_GetOrganizationAdministration(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{OrganizationAdministration: &zeroValue}\n\ti.GetOrganizationAdministration()\n\ti = &InstallationPermissions{}\n\ti.GetOrganizationAdministration()\n\ti = nil\n\ti.GetOrganizationAdministration()\n}\n\nfunc TestInstallationPermissions_GetOrganizationAnnouncementBanners(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{OrganizationAnnouncementBanners: &zeroValue}\n\ti.GetOrganizationAnnouncementBanners()\n\ti = &InstallationPermissions{}\n\ti.GetOrganizationAnnouncementBanners()\n\ti = nil\n\ti.GetOrganizationAnnouncementBanners()\n}\n\nfunc TestInstallationPermissions_GetOrganizationAPIInsights(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{OrganizationAPIInsights: &zeroValue}\n\ti.GetOrganizationAPIInsights()\n\ti = &InstallationPermissions{}\n\ti.GetOrganizationAPIInsights()\n\ti = nil\n\ti.GetOrganizationAPIInsights()\n}\n\nfunc TestInstallationPermissions_GetOrganizationCodespaces(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{OrganizationCodespaces: &zeroValue}\n\ti.GetOrganizationCodespaces()\n\ti = &InstallationPermissions{}\n\ti.GetOrganizationCodespaces()\n\ti = nil\n\ti.GetOrganizationCodespaces()\n}\n\nfunc TestInstallationPermissions_GetOrganizationCodespacesSecrets(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{OrganizationCodespacesSecrets: &zeroValue}\n\ti.GetOrganizationCodespacesSecrets()\n\ti = &InstallationPermissions{}\n\ti.GetOrganizationCodespacesSecrets()\n\ti = nil\n\ti.GetOrganizationCodespacesSecrets()\n}\n\nfunc TestInstallationPermissions_GetOrganizationCodespacesSettings(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{OrganizationCodespacesSettings: &zeroValue}\n\ti.GetOrganizationCodespacesSettings()\n\ti = &InstallationPermissions{}\n\ti.GetOrganizationCodespacesSettings()\n\ti = nil\n\ti.GetOrganizationCodespacesSettings()\n}\n\nfunc TestInstallationPermissions_GetOrganizationCopilotMetrics(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{OrganizationCopilotMetrics: &zeroValue}\n\ti.GetOrganizationCopilotMetrics()\n\ti = &InstallationPermissions{}\n\ti.GetOrganizationCopilotMetrics()\n\ti = nil\n\ti.GetOrganizationCopilotMetrics()\n}\n\nfunc TestInstallationPermissions_GetOrganizationCopilotSeatManagement(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{OrganizationCopilotSeatManagement: &zeroValue}\n\ti.GetOrganizationCopilotSeatManagement()\n\ti = &InstallationPermissions{}\n\ti.GetOrganizationCopilotSeatManagement()\n\ti = nil\n\ti.GetOrganizationCopilotSeatManagement()\n}\n\nfunc TestInstallationPermissions_GetOrganizationCustomOrgRoles(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{OrganizationCustomOrgRoles: &zeroValue}\n\ti.GetOrganizationCustomOrgRoles()\n\ti = &InstallationPermissions{}\n\ti.GetOrganizationCustomOrgRoles()\n\ti = nil\n\ti.GetOrganizationCustomOrgRoles()\n}\n\nfunc TestInstallationPermissions_GetOrganizationCustomProperties(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{OrganizationCustomProperties: &zeroValue}\n\ti.GetOrganizationCustomProperties()\n\ti = &InstallationPermissions{}\n\ti.GetOrganizationCustomProperties()\n\ti = nil\n\ti.GetOrganizationCustomProperties()\n}\n\nfunc TestInstallationPermissions_GetOrganizationCustomRoles(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{OrganizationCustomRoles: &zeroValue}\n\ti.GetOrganizationCustomRoles()\n\ti = &InstallationPermissions{}\n\ti.GetOrganizationCustomRoles()\n\ti = nil\n\ti.GetOrganizationCustomRoles()\n}\n\nfunc TestInstallationPermissions_GetOrganizationDependabotSecrets(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{OrganizationDependabotSecrets: &zeroValue}\n\ti.GetOrganizationDependabotSecrets()\n\ti = &InstallationPermissions{}\n\ti.GetOrganizationDependabotSecrets()\n\ti = nil\n\ti.GetOrganizationDependabotSecrets()\n}\n\nfunc TestInstallationPermissions_GetOrganizationEvents(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{OrganizationEvents: &zeroValue}\n\ti.GetOrganizationEvents()\n\ti = &InstallationPermissions{}\n\ti.GetOrganizationEvents()\n\ti = nil\n\ti.GetOrganizationEvents()\n}\n\nfunc TestInstallationPermissions_GetOrganizationHooks(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{OrganizationHooks: &zeroValue}\n\ti.GetOrganizationHooks()\n\ti = &InstallationPermissions{}\n\ti.GetOrganizationHooks()\n\ti = nil\n\ti.GetOrganizationHooks()\n}\n\nfunc TestInstallationPermissions_GetOrganizationKnowledgeBases(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{OrganizationKnowledgeBases: &zeroValue}\n\ti.GetOrganizationKnowledgeBases()\n\ti = &InstallationPermissions{}\n\ti.GetOrganizationKnowledgeBases()\n\ti = nil\n\ti.GetOrganizationKnowledgeBases()\n}\n\nfunc TestInstallationPermissions_GetOrganizationPackages(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{OrganizationPackages: &zeroValue}\n\ti.GetOrganizationPackages()\n\ti = &InstallationPermissions{}\n\ti.GetOrganizationPackages()\n\ti = nil\n\ti.GetOrganizationPackages()\n}\n\nfunc TestInstallationPermissions_GetOrganizationPersonalAccessTokenRequests(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{OrganizationPersonalAccessTokenRequests: &zeroValue}\n\ti.GetOrganizationPersonalAccessTokenRequests()\n\ti = &InstallationPermissions{}\n\ti.GetOrganizationPersonalAccessTokenRequests()\n\ti = nil\n\ti.GetOrganizationPersonalAccessTokenRequests()\n}\n\nfunc TestInstallationPermissions_GetOrganizationPersonalAccessTokens(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{OrganizationPersonalAccessTokens: &zeroValue}\n\ti.GetOrganizationPersonalAccessTokens()\n\ti = &InstallationPermissions{}\n\ti.GetOrganizationPersonalAccessTokens()\n\ti = nil\n\ti.GetOrganizationPersonalAccessTokens()\n}\n\nfunc TestInstallationPermissions_GetOrganizationPlan(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{OrganizationPlan: &zeroValue}\n\ti.GetOrganizationPlan()\n\ti = &InstallationPermissions{}\n\ti.GetOrganizationPlan()\n\ti = nil\n\ti.GetOrganizationPlan()\n}\n\nfunc TestInstallationPermissions_GetOrganizationPreReceiveHooks(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{OrganizationPreReceiveHooks: &zeroValue}\n\ti.GetOrganizationPreReceiveHooks()\n\ti = &InstallationPermissions{}\n\ti.GetOrganizationPreReceiveHooks()\n\ti = nil\n\ti.GetOrganizationPreReceiveHooks()\n}\n\nfunc TestInstallationPermissions_GetOrganizationProjects(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{OrganizationProjects: &zeroValue}\n\ti.GetOrganizationProjects()\n\ti = &InstallationPermissions{}\n\ti.GetOrganizationProjects()\n\ti = nil\n\ti.GetOrganizationProjects()\n}\n\nfunc TestInstallationPermissions_GetOrganizationSecrets(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{OrganizationSecrets: &zeroValue}\n\ti.GetOrganizationSecrets()\n\ti = &InstallationPermissions{}\n\ti.GetOrganizationSecrets()\n\ti = nil\n\ti.GetOrganizationSecrets()\n}\n\nfunc TestInstallationPermissions_GetOrganizationSelfHostedRunners(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{OrganizationSelfHostedRunners: &zeroValue}\n\ti.GetOrganizationSelfHostedRunners()\n\ti = &InstallationPermissions{}\n\ti.GetOrganizationSelfHostedRunners()\n\ti = nil\n\ti.GetOrganizationSelfHostedRunners()\n}\n\nfunc TestInstallationPermissions_GetOrganizationUserBlocking(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{OrganizationUserBlocking: &zeroValue}\n\ti.GetOrganizationUserBlocking()\n\ti = &InstallationPermissions{}\n\ti.GetOrganizationUserBlocking()\n\ti = nil\n\ti.GetOrganizationUserBlocking()\n}\n\nfunc TestInstallationPermissions_GetPackages(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{Packages: &zeroValue}\n\ti.GetPackages()\n\ti = &InstallationPermissions{}\n\ti.GetPackages()\n\ti = nil\n\ti.GetPackages()\n}\n\nfunc TestInstallationPermissions_GetPages(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{Pages: &zeroValue}\n\ti.GetPages()\n\ti = &InstallationPermissions{}\n\ti.GetPages()\n\ti = nil\n\ti.GetPages()\n}\n\nfunc TestInstallationPermissions_GetPlan(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{Plan: &zeroValue}\n\ti.GetPlan()\n\ti = &InstallationPermissions{}\n\ti.GetPlan()\n\ti = nil\n\ti.GetPlan()\n}\n\nfunc TestInstallationPermissions_GetProfile(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{Profile: &zeroValue}\n\ti.GetProfile()\n\ti = &InstallationPermissions{}\n\ti.GetProfile()\n\ti = nil\n\ti.GetProfile()\n}\n\nfunc TestInstallationPermissions_GetPullRequests(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{PullRequests: &zeroValue}\n\ti.GetPullRequests()\n\ti = &InstallationPermissions{}\n\ti.GetPullRequests()\n\ti = nil\n\ti.GetPullRequests()\n}\n\nfunc TestInstallationPermissions_GetRepositoryAdvisories(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{RepositoryAdvisories: &zeroValue}\n\ti.GetRepositoryAdvisories()\n\ti = &InstallationPermissions{}\n\ti.GetRepositoryAdvisories()\n\ti = nil\n\ti.GetRepositoryAdvisories()\n}\n\nfunc TestInstallationPermissions_GetRepositoryCustomProperties(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{RepositoryCustomProperties: &zeroValue}\n\ti.GetRepositoryCustomProperties()\n\ti = &InstallationPermissions{}\n\ti.GetRepositoryCustomProperties()\n\ti = nil\n\ti.GetRepositoryCustomProperties()\n}\n\nfunc TestInstallationPermissions_GetRepositoryHooks(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{RepositoryHooks: &zeroValue}\n\ti.GetRepositoryHooks()\n\ti = &InstallationPermissions{}\n\ti.GetRepositoryHooks()\n\ti = nil\n\ti.GetRepositoryHooks()\n}\n\nfunc TestInstallationPermissions_GetRepositoryPreReceiveHooks(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{RepositoryPreReceiveHooks: &zeroValue}\n\ti.GetRepositoryPreReceiveHooks()\n\ti = &InstallationPermissions{}\n\ti.GetRepositoryPreReceiveHooks()\n\ti = nil\n\ti.GetRepositoryPreReceiveHooks()\n}\n\nfunc TestInstallationPermissions_GetRepositoryProjects(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{RepositoryProjects: &zeroValue}\n\ti.GetRepositoryProjects()\n\ti = &InstallationPermissions{}\n\ti.GetRepositoryProjects()\n\ti = nil\n\ti.GetRepositoryProjects()\n}\n\nfunc TestInstallationPermissions_GetSecrets(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{Secrets: &zeroValue}\n\ti.GetSecrets()\n\ti = &InstallationPermissions{}\n\ti.GetSecrets()\n\ti = nil\n\ti.GetSecrets()\n}\n\nfunc TestInstallationPermissions_GetSecretScanningAlerts(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{SecretScanningAlerts: &zeroValue}\n\ti.GetSecretScanningAlerts()\n\ti = &InstallationPermissions{}\n\ti.GetSecretScanningAlerts()\n\ti = nil\n\ti.GetSecretScanningAlerts()\n}\n\nfunc TestInstallationPermissions_GetSecurityEvents(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{SecurityEvents: &zeroValue}\n\ti.GetSecurityEvents()\n\ti = &InstallationPermissions{}\n\ti.GetSecurityEvents()\n\ti = nil\n\ti.GetSecurityEvents()\n}\n\nfunc TestInstallationPermissions_GetSingleFile(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{SingleFile: &zeroValue}\n\ti.GetSingleFile()\n\ti = &InstallationPermissions{}\n\ti.GetSingleFile()\n\ti = nil\n\ti.GetSingleFile()\n}\n\nfunc TestInstallationPermissions_GetStarring(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{Starring: &zeroValue}\n\ti.GetStarring()\n\ti = &InstallationPermissions{}\n\ti.GetStarring()\n\ti = nil\n\ti.GetStarring()\n}\n\nfunc TestInstallationPermissions_GetStatuses(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{Statuses: &zeroValue}\n\ti.GetStatuses()\n\ti = &InstallationPermissions{}\n\ti.GetStatuses()\n\ti = nil\n\ti.GetStatuses()\n}\n\nfunc TestInstallationPermissions_GetTeamDiscussions(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{TeamDiscussions: &zeroValue}\n\ti.GetTeamDiscussions()\n\ti = &InstallationPermissions{}\n\ti.GetTeamDiscussions()\n\ti = nil\n\ti.GetTeamDiscussions()\n}\n\nfunc TestInstallationPermissions_GetUserEvents(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{UserEvents: &zeroValue}\n\ti.GetUserEvents()\n\ti = &InstallationPermissions{}\n\ti.GetUserEvents()\n\ti = nil\n\ti.GetUserEvents()\n}\n\nfunc TestInstallationPermissions_GetVulnerabilityAlerts(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{VulnerabilityAlerts: &zeroValue}\n\ti.GetVulnerabilityAlerts()\n\ti = &InstallationPermissions{}\n\ti.GetVulnerabilityAlerts()\n\ti = nil\n\ti.GetVulnerabilityAlerts()\n}\n\nfunc TestInstallationPermissions_GetWatching(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{Watching: &zeroValue}\n\ti.GetWatching()\n\ti = &InstallationPermissions{}\n\ti.GetWatching()\n\ti = nil\n\ti.GetWatching()\n}\n\nfunc TestInstallationPermissions_GetWorkflows(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationPermissions{Workflows: &zeroValue}\n\ti.GetWorkflows()\n\ti = &InstallationPermissions{}\n\ti.GetWorkflows()\n\ti = nil\n\ti.GetWorkflows()\n}\n\nfunc TestInstallationRepositoriesEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationRepositoriesEvent{Action: &zeroValue}\n\ti.GetAction()\n\ti = &InstallationRepositoriesEvent{}\n\ti.GetAction()\n\ti = nil\n\ti.GetAction()\n}\n\nfunc TestInstallationRepositoriesEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\ti := &InstallationRepositoriesEvent{}\n\ti.GetInstallation()\n\ti = nil\n\ti.GetInstallation()\n}\n\nfunc TestInstallationRepositoriesEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\ti := &InstallationRepositoriesEvent{}\n\ti.GetOrg()\n\ti = nil\n\ti.GetOrg()\n}\n\nfunc TestInstallationRepositoriesEvent_GetRepositoriesAdded(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Repository{}\n\ti := &InstallationRepositoriesEvent{RepositoriesAdded: zeroValue}\n\ti.GetRepositoriesAdded()\n\ti = &InstallationRepositoriesEvent{}\n\ti.GetRepositoriesAdded()\n\ti = nil\n\ti.GetRepositoriesAdded()\n}\n\nfunc TestInstallationRepositoriesEvent_GetRepositoriesRemoved(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Repository{}\n\ti := &InstallationRepositoriesEvent{RepositoriesRemoved: zeroValue}\n\ti.GetRepositoriesRemoved()\n\ti = &InstallationRepositoriesEvent{}\n\ti.GetRepositoriesRemoved()\n\ti = nil\n\ti.GetRepositoriesRemoved()\n}\n\nfunc TestInstallationRepositoriesEvent_GetRepositorySelection(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationRepositoriesEvent{RepositorySelection: &zeroValue}\n\ti.GetRepositorySelection()\n\ti = &InstallationRepositoriesEvent{}\n\ti.GetRepositorySelection()\n\ti = nil\n\ti.GetRepositorySelection()\n}\n\nfunc TestInstallationRepositoriesEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\ti := &InstallationRepositoriesEvent{}\n\ti.GetSender()\n\ti = nil\n\ti.GetSender()\n}\n\nfunc TestInstallationRequest_GetAccount(tt *testing.T) {\n\ttt.Parallel()\n\ti := &InstallationRequest{}\n\ti.GetAccount()\n\ti = nil\n\ti.GetAccount()\n}\n\nfunc TestInstallationRequest_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ti := &InstallationRequest{CreatedAt: &zeroValue}\n\ti.GetCreatedAt()\n\ti = &InstallationRequest{}\n\ti.GetCreatedAt()\n\ti = nil\n\ti.GetCreatedAt()\n}\n\nfunc TestInstallationRequest_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ti := &InstallationRequest{ID: &zeroValue}\n\ti.GetID()\n\ti = &InstallationRequest{}\n\ti.GetID()\n\ti = nil\n\ti.GetID()\n}\n\nfunc TestInstallationRequest_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationRequest{NodeID: &zeroValue}\n\ti.GetNodeID()\n\ti = &InstallationRequest{}\n\ti.GetNodeID()\n\ti = nil\n\ti.GetNodeID()\n}\n\nfunc TestInstallationRequest_GetRequester(tt *testing.T) {\n\ttt.Parallel()\n\ti := &InstallationRequest{}\n\ti.GetRequester()\n\ti = nil\n\ti.GetRequester()\n}\n\nfunc TestInstallationSlugChange_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationSlugChange{From: &zeroValue}\n\ti.GetFrom()\n\ti = &InstallationSlugChange{}\n\ti.GetFrom()\n\ti = nil\n\ti.GetFrom()\n}\n\nfunc TestInstallationTargetEvent_GetAccount(tt *testing.T) {\n\ttt.Parallel()\n\ti := &InstallationTargetEvent{}\n\ti.GetAccount()\n\ti = nil\n\ti.GetAccount()\n}\n\nfunc TestInstallationTargetEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationTargetEvent{Action: &zeroValue}\n\ti.GetAction()\n\ti = &InstallationTargetEvent{}\n\ti.GetAction()\n\ti = nil\n\ti.GetAction()\n}\n\nfunc TestInstallationTargetEvent_GetChanges(tt *testing.T) {\n\ttt.Parallel()\n\ti := &InstallationTargetEvent{}\n\ti.GetChanges()\n\ti = nil\n\ti.GetChanges()\n}\n\nfunc TestInstallationTargetEvent_GetEnterprise(tt *testing.T) {\n\ttt.Parallel()\n\ti := &InstallationTargetEvent{}\n\ti.GetEnterprise()\n\ti = nil\n\ti.GetEnterprise()\n}\n\nfunc TestInstallationTargetEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\ti := &InstallationTargetEvent{}\n\ti.GetInstallation()\n\ti = nil\n\ti.GetInstallation()\n}\n\nfunc TestInstallationTargetEvent_GetOrganization(tt *testing.T) {\n\ttt.Parallel()\n\ti := &InstallationTargetEvent{}\n\ti.GetOrganization()\n\ti = nil\n\ti.GetOrganization()\n}\n\nfunc TestInstallationTargetEvent_GetRepository(tt *testing.T) {\n\ttt.Parallel()\n\ti := &InstallationTargetEvent{}\n\ti.GetRepository()\n\ti = nil\n\ti.GetRepository()\n}\n\nfunc TestInstallationTargetEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\ti := &InstallationTargetEvent{}\n\ti.GetSender()\n\ti = nil\n\ti.GetSender()\n}\n\nfunc TestInstallationTargetEvent_GetTargetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationTargetEvent{TargetType: &zeroValue}\n\ti.GetTargetType()\n\ti = &InstallationTargetEvent{}\n\ti.GetTargetType()\n\ti = nil\n\ti.GetTargetType()\n}\n\nfunc TestInstallationToken_GetExpiresAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ti := &InstallationToken{ExpiresAt: &zeroValue}\n\ti.GetExpiresAt()\n\ti = &InstallationToken{}\n\ti.GetExpiresAt()\n\ti = nil\n\ti.GetExpiresAt()\n}\n\nfunc TestInstallationToken_GetPermissions(tt *testing.T) {\n\ttt.Parallel()\n\ti := &InstallationToken{}\n\ti.GetPermissions()\n\ti = nil\n\ti.GetPermissions()\n}\n\nfunc TestInstallationToken_GetRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Repository{}\n\ti := &InstallationToken{Repositories: zeroValue}\n\ti.GetRepositories()\n\ti = &InstallationToken{}\n\ti.GetRepositories()\n\ti = nil\n\ti.GetRepositories()\n}\n\nfunc TestInstallationToken_GetToken(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InstallationToken{Token: &zeroValue}\n\ti.GetToken()\n\ti = &InstallationToken{}\n\ti.GetToken()\n\ti = nil\n\ti.GetToken()\n}\n\nfunc TestInstallationTokenListRepoOptions_GetPermissions(tt *testing.T) {\n\ttt.Parallel()\n\ti := &InstallationTokenListRepoOptions{}\n\ti.GetPermissions()\n\ti = nil\n\ti.GetPermissions()\n}\n\nfunc TestInstallationTokenListRepoOptions_GetRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ti := &InstallationTokenListRepoOptions{Repositories: zeroValue}\n\ti.GetRepositories()\n\ti = &InstallationTokenListRepoOptions{}\n\ti.GetRepositories()\n\ti = nil\n\ti.GetRepositories()\n}\n\nfunc TestInstallationTokenListRepoOptions_GetRepositoryIDs(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []int64{}\n\ti := &InstallationTokenListRepoOptions{RepositoryIDs: zeroValue}\n\ti.GetRepositoryIDs()\n\ti = &InstallationTokenListRepoOptions{}\n\ti.GetRepositoryIDs()\n\ti = nil\n\ti.GetRepositoryIDs()\n}\n\nfunc TestInstallationTokenOptions_GetPermissions(tt *testing.T) {\n\ttt.Parallel()\n\ti := &InstallationTokenOptions{}\n\ti.GetPermissions()\n\ti = nil\n\ti.GetPermissions()\n}\n\nfunc TestInstallationTokenOptions_GetRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ti := &InstallationTokenOptions{Repositories: zeroValue}\n\ti.GetRepositories()\n\ti = &InstallationTokenOptions{}\n\ti.GetRepositories()\n\ti = nil\n\ti.GetRepositories()\n}\n\nfunc TestInstallationTokenOptions_GetRepositoryIDs(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []int64{}\n\ti := &InstallationTokenOptions{RepositoryIDs: zeroValue}\n\ti.GetRepositoryIDs()\n\ti = &InstallationTokenOptions{}\n\ti.GetRepositoryIDs()\n\ti = nil\n\ti.GetRepositoryIDs()\n}\n\nfunc TestInteractionRestriction_GetExpiresAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ti := &InteractionRestriction{ExpiresAt: &zeroValue}\n\ti.GetExpiresAt()\n\ti = &InteractionRestriction{}\n\ti.GetExpiresAt()\n\ti = nil\n\ti.GetExpiresAt()\n}\n\nfunc TestInteractionRestriction_GetLimit(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InteractionRestriction{Limit: &zeroValue}\n\ti.GetLimit()\n\ti = &InteractionRestriction{}\n\ti.GetLimit()\n\ti = nil\n\ti.GetLimit()\n}\n\nfunc TestInteractionRestriction_GetOrigin(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &InteractionRestriction{Origin: &zeroValue}\n\ti.GetOrigin()\n\ti = &InteractionRestriction{}\n\ti.GetOrigin()\n\ti = nil\n\ti.GetOrigin()\n}\n\nfunc TestInvitation_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ti := &Invitation{CreatedAt: &zeroValue}\n\ti.GetCreatedAt()\n\ti = &Invitation{}\n\ti.GetCreatedAt()\n\ti = nil\n\ti.GetCreatedAt()\n}\n\nfunc TestInvitation_GetEmail(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Invitation{Email: &zeroValue}\n\ti.GetEmail()\n\ti = &Invitation{}\n\ti.GetEmail()\n\ti = nil\n\ti.GetEmail()\n}\n\nfunc TestInvitation_GetFailedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ti := &Invitation{FailedAt: &zeroValue}\n\ti.GetFailedAt()\n\ti = &Invitation{}\n\ti.GetFailedAt()\n\ti = nil\n\ti.GetFailedAt()\n}\n\nfunc TestInvitation_GetFailedReason(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Invitation{FailedReason: &zeroValue}\n\ti.GetFailedReason()\n\ti = &Invitation{}\n\ti.GetFailedReason()\n\ti = nil\n\ti.GetFailedReason()\n}\n\nfunc TestInvitation_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ti := &Invitation{ID: &zeroValue}\n\ti.GetID()\n\ti = &Invitation{}\n\ti.GetID()\n\ti = nil\n\ti.GetID()\n}\n\nfunc TestInvitation_GetInvitationTeamURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Invitation{InvitationTeamURL: &zeroValue}\n\ti.GetInvitationTeamURL()\n\ti = &Invitation{}\n\ti.GetInvitationTeamURL()\n\ti = nil\n\ti.GetInvitationTeamURL()\n}\n\nfunc TestInvitation_GetInviter(tt *testing.T) {\n\ttt.Parallel()\n\ti := &Invitation{}\n\ti.GetInviter()\n\ti = nil\n\ti.GetInviter()\n}\n\nfunc TestInvitation_GetLogin(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Invitation{Login: &zeroValue}\n\ti.GetLogin()\n\ti = &Invitation{}\n\ti.GetLogin()\n\ti = nil\n\ti.GetLogin()\n}\n\nfunc TestInvitation_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Invitation{NodeID: &zeroValue}\n\ti.GetNodeID()\n\ti = &Invitation{}\n\ti.GetNodeID()\n\ti = nil\n\ti.GetNodeID()\n}\n\nfunc TestInvitation_GetRole(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Invitation{Role: &zeroValue}\n\ti.GetRole()\n\ti = &Invitation{}\n\ti.GetRole()\n\ti = nil\n\ti.GetRole()\n}\n\nfunc TestInvitation_GetTeamCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ti := &Invitation{TeamCount: &zeroValue}\n\ti.GetTeamCount()\n\ti = &Invitation{}\n\ti.GetTeamCount()\n\ti = nil\n\ti.GetTeamCount()\n}\n\nfunc TestIssue_GetActiveLockReason(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Issue{ActiveLockReason: &zeroValue}\n\ti.GetActiveLockReason()\n\ti = &Issue{}\n\ti.GetActiveLockReason()\n\ti = nil\n\ti.GetActiveLockReason()\n}\n\nfunc TestIssue_GetAssignee(tt *testing.T) {\n\ttt.Parallel()\n\ti := &Issue{}\n\ti.GetAssignee()\n\ti = nil\n\ti.GetAssignee()\n}\n\nfunc TestIssue_GetAssignees(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*User{}\n\ti := &Issue{Assignees: zeroValue}\n\ti.GetAssignees()\n\ti = &Issue{}\n\ti.GetAssignees()\n\ti = nil\n\ti.GetAssignees()\n}\n\nfunc TestIssue_GetAuthorAssociation(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Issue{AuthorAssociation: &zeroValue}\n\ti.GetAuthorAssociation()\n\ti = &Issue{}\n\ti.GetAuthorAssociation()\n\ti = nil\n\ti.GetAuthorAssociation()\n}\n\nfunc TestIssue_GetBody(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Issue{Body: &zeroValue}\n\ti.GetBody()\n\ti = &Issue{}\n\ti.GetBody()\n\ti = nil\n\ti.GetBody()\n}\n\nfunc TestIssue_GetClosedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ti := &Issue{ClosedAt: &zeroValue}\n\ti.GetClosedAt()\n\ti = &Issue{}\n\ti.GetClosedAt()\n\ti = nil\n\ti.GetClosedAt()\n}\n\nfunc TestIssue_GetClosedBy(tt *testing.T) {\n\ttt.Parallel()\n\ti := &Issue{}\n\ti.GetClosedBy()\n\ti = nil\n\ti.GetClosedBy()\n}\n\nfunc TestIssue_GetComments(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ti := &Issue{Comments: &zeroValue}\n\ti.GetComments()\n\ti = &Issue{}\n\ti.GetComments()\n\ti = nil\n\ti.GetComments()\n}\n\nfunc TestIssue_GetCommentsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Issue{CommentsURL: &zeroValue}\n\ti.GetCommentsURL()\n\ti = &Issue{}\n\ti.GetCommentsURL()\n\ti = nil\n\ti.GetCommentsURL()\n}\n\nfunc TestIssue_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ti := &Issue{CreatedAt: &zeroValue}\n\ti.GetCreatedAt()\n\ti = &Issue{}\n\ti.GetCreatedAt()\n\ti = nil\n\ti.GetCreatedAt()\n}\n\nfunc TestIssue_GetDraft(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ti := &Issue{Draft: &zeroValue}\n\ti.GetDraft()\n\ti = &Issue{}\n\ti.GetDraft()\n\ti = nil\n\ti.GetDraft()\n}\n\nfunc TestIssue_GetEventsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Issue{EventsURL: &zeroValue}\n\ti.GetEventsURL()\n\ti = &Issue{}\n\ti.GetEventsURL()\n\ti = nil\n\ti.GetEventsURL()\n}\n\nfunc TestIssue_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Issue{HTMLURL: &zeroValue}\n\ti.GetHTMLURL()\n\ti = &Issue{}\n\ti.GetHTMLURL()\n\ti = nil\n\ti.GetHTMLURL()\n}\n\nfunc TestIssue_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ti := &Issue{ID: &zeroValue}\n\ti.GetID()\n\ti = &Issue{}\n\ti.GetID()\n\ti = nil\n\ti.GetID()\n}\n\nfunc TestIssue_GetLabels(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Label{}\n\ti := &Issue{Labels: zeroValue}\n\ti.GetLabels()\n\ti = &Issue{}\n\ti.GetLabels()\n\ti = nil\n\ti.GetLabels()\n}\n\nfunc TestIssue_GetLabelsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Issue{LabelsURL: &zeroValue}\n\ti.GetLabelsURL()\n\ti = &Issue{}\n\ti.GetLabelsURL()\n\ti = nil\n\ti.GetLabelsURL()\n}\n\nfunc TestIssue_GetLocked(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ti := &Issue{Locked: &zeroValue}\n\ti.GetLocked()\n\ti = &Issue{}\n\ti.GetLocked()\n\ti = nil\n\ti.GetLocked()\n}\n\nfunc TestIssue_GetMilestone(tt *testing.T) {\n\ttt.Parallel()\n\ti := &Issue{}\n\ti.GetMilestone()\n\ti = nil\n\ti.GetMilestone()\n}\n\nfunc TestIssue_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Issue{NodeID: &zeroValue}\n\ti.GetNodeID()\n\ti = &Issue{}\n\ti.GetNodeID()\n\ti = nil\n\ti.GetNodeID()\n}\n\nfunc TestIssue_GetNumber(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ti := &Issue{Number: &zeroValue}\n\ti.GetNumber()\n\ti = &Issue{}\n\ti.GetNumber()\n\ti = nil\n\ti.GetNumber()\n}\n\nfunc TestIssue_GetParentIssueURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Issue{ParentIssueURL: &zeroValue}\n\ti.GetParentIssueURL()\n\ti = &Issue{}\n\ti.GetParentIssueURL()\n\ti = nil\n\ti.GetParentIssueURL()\n}\n\nfunc TestIssue_GetPullRequestLinks(tt *testing.T) {\n\ttt.Parallel()\n\ti := &Issue{}\n\ti.GetPullRequestLinks()\n\ti = nil\n\ti.GetPullRequestLinks()\n}\n\nfunc TestIssue_GetReactions(tt *testing.T) {\n\ttt.Parallel()\n\ti := &Issue{}\n\ti.GetReactions()\n\ti = nil\n\ti.GetReactions()\n}\n\nfunc TestIssue_GetRepository(tt *testing.T) {\n\ttt.Parallel()\n\ti := &Issue{}\n\ti.GetRepository()\n\ti = nil\n\ti.GetRepository()\n}\n\nfunc TestIssue_GetRepositoryURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Issue{RepositoryURL: &zeroValue}\n\ti.GetRepositoryURL()\n\ti = &Issue{}\n\ti.GetRepositoryURL()\n\ti = nil\n\ti.GetRepositoryURL()\n}\n\nfunc TestIssue_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Issue{State: &zeroValue}\n\ti.GetState()\n\ti = &Issue{}\n\ti.GetState()\n\ti = nil\n\ti.GetState()\n}\n\nfunc TestIssue_GetStateReason(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Issue{StateReason: &zeroValue}\n\ti.GetStateReason()\n\ti = &Issue{}\n\ti.GetStateReason()\n\ti = nil\n\ti.GetStateReason()\n}\n\nfunc TestIssue_GetTextMatches(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*TextMatch{}\n\ti := &Issue{TextMatches: zeroValue}\n\ti.GetTextMatches()\n\ti = &Issue{}\n\ti.GetTextMatches()\n\ti = nil\n\ti.GetTextMatches()\n}\n\nfunc TestIssue_GetTitle(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Issue{Title: &zeroValue}\n\ti.GetTitle()\n\ti = &Issue{}\n\ti.GetTitle()\n\ti = nil\n\ti.GetTitle()\n}\n\nfunc TestIssue_GetType(tt *testing.T) {\n\ttt.Parallel()\n\ti := &Issue{}\n\ti.GetType()\n\ti = nil\n\ti.GetType()\n}\n\nfunc TestIssue_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ti := &Issue{UpdatedAt: &zeroValue}\n\ti.GetUpdatedAt()\n\ti = &Issue{}\n\ti.GetUpdatedAt()\n\ti = nil\n\ti.GetUpdatedAt()\n}\n\nfunc TestIssue_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &Issue{URL: &zeroValue}\n\ti.GetURL()\n\ti = &Issue{}\n\ti.GetURL()\n\ti = nil\n\ti.GetURL()\n}\n\nfunc TestIssue_GetUser(tt *testing.T) {\n\ttt.Parallel()\n\ti := &Issue{}\n\ti.GetUser()\n\ti = nil\n\ti.GetUser()\n}\n\nfunc TestIssueComment_GetAuthorAssociation(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueComment{AuthorAssociation: &zeroValue}\n\ti.GetAuthorAssociation()\n\ti = &IssueComment{}\n\ti.GetAuthorAssociation()\n\ti = nil\n\ti.GetAuthorAssociation()\n}\n\nfunc TestIssueComment_GetBody(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueComment{Body: &zeroValue}\n\ti.GetBody()\n\ti = &IssueComment{}\n\ti.GetBody()\n\ti = nil\n\ti.GetBody()\n}\n\nfunc TestIssueComment_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ti := &IssueComment{CreatedAt: &zeroValue}\n\ti.GetCreatedAt()\n\ti = &IssueComment{}\n\ti.GetCreatedAt()\n\ti = nil\n\ti.GetCreatedAt()\n}\n\nfunc TestIssueComment_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueComment{HTMLURL: &zeroValue}\n\ti.GetHTMLURL()\n\ti = &IssueComment{}\n\ti.GetHTMLURL()\n\ti = nil\n\ti.GetHTMLURL()\n}\n\nfunc TestIssueComment_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ti := &IssueComment{ID: &zeroValue}\n\ti.GetID()\n\ti = &IssueComment{}\n\ti.GetID()\n\ti = nil\n\ti.GetID()\n}\n\nfunc TestIssueComment_GetIssueURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueComment{IssueURL: &zeroValue}\n\ti.GetIssueURL()\n\ti = &IssueComment{}\n\ti.GetIssueURL()\n\ti = nil\n\ti.GetIssueURL()\n}\n\nfunc TestIssueComment_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueComment{NodeID: &zeroValue}\n\ti.GetNodeID()\n\ti = &IssueComment{}\n\ti.GetNodeID()\n\ti = nil\n\ti.GetNodeID()\n}\n\nfunc TestIssueComment_GetReactions(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueComment{}\n\ti.GetReactions()\n\ti = nil\n\ti.GetReactions()\n}\n\nfunc TestIssueComment_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ti := &IssueComment{UpdatedAt: &zeroValue}\n\ti.GetUpdatedAt()\n\ti = &IssueComment{}\n\ti.GetUpdatedAt()\n\ti = nil\n\ti.GetUpdatedAt()\n}\n\nfunc TestIssueComment_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueComment{URL: &zeroValue}\n\ti.GetURL()\n\ti = &IssueComment{}\n\ti.GetURL()\n\ti = nil\n\ti.GetURL()\n}\n\nfunc TestIssueComment_GetUser(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueComment{}\n\ti.GetUser()\n\ti = nil\n\ti.GetUser()\n}\n\nfunc TestIssueCommentEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueCommentEvent{Action: &zeroValue}\n\ti.GetAction()\n\ti = &IssueCommentEvent{}\n\ti.GetAction()\n\ti = nil\n\ti.GetAction()\n}\n\nfunc TestIssueCommentEvent_GetChanges(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueCommentEvent{}\n\ti.GetChanges()\n\ti = nil\n\ti.GetChanges()\n}\n\nfunc TestIssueCommentEvent_GetComment(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueCommentEvent{}\n\ti.GetComment()\n\ti = nil\n\ti.GetComment()\n}\n\nfunc TestIssueCommentEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueCommentEvent{}\n\ti.GetInstallation()\n\ti = nil\n\ti.GetInstallation()\n}\n\nfunc TestIssueCommentEvent_GetIssue(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueCommentEvent{}\n\ti.GetIssue()\n\ti = nil\n\ti.GetIssue()\n}\n\nfunc TestIssueCommentEvent_GetOrganization(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueCommentEvent{}\n\ti.GetOrganization()\n\ti = nil\n\ti.GetOrganization()\n}\n\nfunc TestIssueCommentEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueCommentEvent{}\n\ti.GetRepo()\n\ti = nil\n\ti.GetRepo()\n}\n\nfunc TestIssueCommentEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueCommentEvent{}\n\ti.GetSender()\n\ti = nil\n\ti.GetSender()\n}\n\nfunc TestIssueEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueEvent{}\n\ti.GetAction()\n\ti = nil\n\ti.GetAction()\n}\n\nfunc TestIssueEvent_GetActor(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueEvent{}\n\ti.GetActor()\n\ti = nil\n\ti.GetActor()\n}\n\nfunc TestIssueEvent_GetAssignee(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueEvent{}\n\ti.GetAssignee()\n\ti = nil\n\ti.GetAssignee()\n}\n\nfunc TestIssueEvent_GetAssigner(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueEvent{}\n\ti.GetAssigner()\n\ti = nil\n\ti.GetAssigner()\n}\n\nfunc TestIssueEvent_GetCommitID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueEvent{CommitID: &zeroValue}\n\ti.GetCommitID()\n\ti = &IssueEvent{}\n\ti.GetCommitID()\n\ti = nil\n\ti.GetCommitID()\n}\n\nfunc TestIssueEvent_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ti := &IssueEvent{CreatedAt: &zeroValue}\n\ti.GetCreatedAt()\n\ti = &IssueEvent{}\n\ti.GetCreatedAt()\n\ti = nil\n\ti.GetCreatedAt()\n}\n\nfunc TestIssueEvent_GetDismissedReview(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueEvent{}\n\ti.GetDismissedReview()\n\ti = nil\n\ti.GetDismissedReview()\n}\n\nfunc TestIssueEvent_GetEvent(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueEvent{Event: &zeroValue}\n\ti.GetEvent()\n\ti = &IssueEvent{}\n\ti.GetEvent()\n\ti = nil\n\ti.GetEvent()\n}\n\nfunc TestIssueEvent_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ti := &IssueEvent{ID: &zeroValue}\n\ti.GetID()\n\ti = &IssueEvent{}\n\ti.GetID()\n\ti = nil\n\ti.GetID()\n}\n\nfunc TestIssueEvent_GetIssue(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueEvent{}\n\ti.GetIssue()\n\ti = nil\n\ti.GetIssue()\n}\n\nfunc TestIssueEvent_GetLabel(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueEvent{}\n\ti.GetLabel()\n\ti = nil\n\ti.GetLabel()\n}\n\nfunc TestIssueEvent_GetLockReason(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueEvent{LockReason: &zeroValue}\n\ti.GetLockReason()\n\ti = &IssueEvent{}\n\ti.GetLockReason()\n\ti = nil\n\ti.GetLockReason()\n}\n\nfunc TestIssueEvent_GetMilestone(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueEvent{}\n\ti.GetMilestone()\n\ti = nil\n\ti.GetMilestone()\n}\n\nfunc TestIssueEvent_GetPerformedViaGithubApp(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueEvent{}\n\ti.GetPerformedViaGithubApp()\n\ti = nil\n\ti.GetPerformedViaGithubApp()\n}\n\nfunc TestIssueEvent_GetRename(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueEvent{}\n\ti.GetRename()\n\ti = nil\n\ti.GetRename()\n}\n\nfunc TestIssueEvent_GetRepository(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueEvent{}\n\ti.GetRepository()\n\ti = nil\n\ti.GetRepository()\n}\n\nfunc TestIssueEvent_GetRequestedReviewer(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueEvent{}\n\ti.GetRequestedReviewer()\n\ti = nil\n\ti.GetRequestedReviewer()\n}\n\nfunc TestIssueEvent_GetRequestedTeam(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueEvent{}\n\ti.GetRequestedTeam()\n\ti = nil\n\ti.GetRequestedTeam()\n}\n\nfunc TestIssueEvent_GetReviewRequester(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueEvent{}\n\ti.GetReviewRequester()\n\ti = nil\n\ti.GetReviewRequester()\n}\n\nfunc TestIssueEvent_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueEvent{URL: &zeroValue}\n\ti.GetURL()\n\ti = &IssueEvent{}\n\ti.GetURL()\n\ti = nil\n\ti.GetURL()\n}\n\nfunc TestIssueImport_GetAssignee(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueImport{Assignee: &zeroValue}\n\ti.GetAssignee()\n\ti = &IssueImport{}\n\ti.GetAssignee()\n\ti = nil\n\ti.GetAssignee()\n}\n\nfunc TestIssueImport_GetBody(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueImport{}\n\ti.GetBody()\n\ti = nil\n\ti.GetBody()\n}\n\nfunc TestIssueImport_GetClosed(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ti := &IssueImport{Closed: &zeroValue}\n\ti.GetClosed()\n\ti = &IssueImport{}\n\ti.GetClosed()\n\ti = nil\n\ti.GetClosed()\n}\n\nfunc TestIssueImport_GetClosedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ti := &IssueImport{ClosedAt: &zeroValue}\n\ti.GetClosedAt()\n\ti = &IssueImport{}\n\ti.GetClosedAt()\n\ti = nil\n\ti.GetClosedAt()\n}\n\nfunc TestIssueImport_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ti := &IssueImport{CreatedAt: &zeroValue}\n\ti.GetCreatedAt()\n\ti = &IssueImport{}\n\ti.GetCreatedAt()\n\ti = nil\n\ti.GetCreatedAt()\n}\n\nfunc TestIssueImport_GetLabels(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ti := &IssueImport{Labels: zeroValue}\n\ti.GetLabels()\n\ti = &IssueImport{}\n\ti.GetLabels()\n\ti = nil\n\ti.GetLabels()\n}\n\nfunc TestIssueImport_GetMilestone(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ti := &IssueImport{Milestone: &zeroValue}\n\ti.GetMilestone()\n\ti = &IssueImport{}\n\ti.GetMilestone()\n\ti = nil\n\ti.GetMilestone()\n}\n\nfunc TestIssueImport_GetTitle(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueImport{}\n\ti.GetTitle()\n\ti = nil\n\ti.GetTitle()\n}\n\nfunc TestIssueImport_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ti := &IssueImport{UpdatedAt: &zeroValue}\n\ti.GetUpdatedAt()\n\ti = &IssueImport{}\n\ti.GetUpdatedAt()\n\ti = nil\n\ti.GetUpdatedAt()\n}\n\nfunc TestIssueImportError_GetCode(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueImportError{Code: &zeroValue}\n\ti.GetCode()\n\ti = &IssueImportError{}\n\ti.GetCode()\n\ti = nil\n\ti.GetCode()\n}\n\nfunc TestIssueImportError_GetField(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueImportError{Field: &zeroValue}\n\ti.GetField()\n\ti = &IssueImportError{}\n\ti.GetField()\n\ti = nil\n\ti.GetField()\n}\n\nfunc TestIssueImportError_GetLocation(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueImportError{Location: &zeroValue}\n\ti.GetLocation()\n\ti = &IssueImportError{}\n\ti.GetLocation()\n\ti = nil\n\ti.GetLocation()\n}\n\nfunc TestIssueImportError_GetResource(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueImportError{Resource: &zeroValue}\n\ti.GetResource()\n\ti = &IssueImportError{}\n\ti.GetResource()\n\ti = nil\n\ti.GetResource()\n}\n\nfunc TestIssueImportError_GetValue(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueImportError{Value: &zeroValue}\n\ti.GetValue()\n\ti = &IssueImportError{}\n\ti.GetValue()\n\ti = nil\n\ti.GetValue()\n}\n\nfunc TestIssueImportRequest_GetComments(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Comment{}\n\ti := &IssueImportRequest{Comments: zeroValue}\n\ti.GetComments()\n\ti = &IssueImportRequest{}\n\ti.GetComments()\n\ti = nil\n\ti.GetComments()\n}\n\nfunc TestIssueImportRequest_GetIssueImport(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueImportRequest{}\n\ti.GetIssueImport()\n\ti = nil\n\ti.GetIssueImport()\n}\n\nfunc TestIssueImportResponse_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ti := &IssueImportResponse{CreatedAt: &zeroValue}\n\ti.GetCreatedAt()\n\ti = &IssueImportResponse{}\n\ti.GetCreatedAt()\n\ti = nil\n\ti.GetCreatedAt()\n}\n\nfunc TestIssueImportResponse_GetDocumentationURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueImportResponse{DocumentationURL: &zeroValue}\n\ti.GetDocumentationURL()\n\ti = &IssueImportResponse{}\n\ti.GetDocumentationURL()\n\ti = nil\n\ti.GetDocumentationURL()\n}\n\nfunc TestIssueImportResponse_GetErrors(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*IssueImportError{}\n\ti := &IssueImportResponse{Errors: zeroValue}\n\ti.GetErrors()\n\ti = &IssueImportResponse{}\n\ti.GetErrors()\n\ti = nil\n\ti.GetErrors()\n}\n\nfunc TestIssueImportResponse_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ti := &IssueImportResponse{ID: &zeroValue}\n\ti.GetID()\n\ti = &IssueImportResponse{}\n\ti.GetID()\n\ti = nil\n\ti.GetID()\n}\n\nfunc TestIssueImportResponse_GetImportIssuesURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueImportResponse{ImportIssuesURL: &zeroValue}\n\ti.GetImportIssuesURL()\n\ti = &IssueImportResponse{}\n\ti.GetImportIssuesURL()\n\ti = nil\n\ti.GetImportIssuesURL()\n}\n\nfunc TestIssueImportResponse_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueImportResponse{Message: &zeroValue}\n\ti.GetMessage()\n\ti = &IssueImportResponse{}\n\ti.GetMessage()\n\ti = nil\n\ti.GetMessage()\n}\n\nfunc TestIssueImportResponse_GetRepositoryURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueImportResponse{RepositoryURL: &zeroValue}\n\ti.GetRepositoryURL()\n\ti = &IssueImportResponse{}\n\ti.GetRepositoryURL()\n\ti = nil\n\ti.GetRepositoryURL()\n}\n\nfunc TestIssueImportResponse_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueImportResponse{Status: &zeroValue}\n\ti.GetStatus()\n\ti = &IssueImportResponse{}\n\ti.GetStatus()\n\ti = nil\n\ti.GetStatus()\n}\n\nfunc TestIssueImportResponse_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ti := &IssueImportResponse{UpdatedAt: &zeroValue}\n\ti.GetUpdatedAt()\n\ti = &IssueImportResponse{}\n\ti.GetUpdatedAt()\n\ti = nil\n\ti.GetUpdatedAt()\n}\n\nfunc TestIssueImportResponse_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueImportResponse{URL: &zeroValue}\n\ti.GetURL()\n\ti = &IssueImportResponse{}\n\ti.GetURL()\n\ti = nil\n\ti.GetURL()\n}\n\nfunc TestIssueListByOrgOptions_GetDirection(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueListByOrgOptions{}\n\ti.GetDirection()\n\ti = nil\n\ti.GetDirection()\n}\n\nfunc TestIssueListByOrgOptions_GetFilter(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueListByOrgOptions{}\n\ti.GetFilter()\n\ti = nil\n\ti.GetFilter()\n}\n\nfunc TestIssueListByOrgOptions_GetLabels(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ti := &IssueListByOrgOptions{Labels: zeroValue}\n\ti.GetLabels()\n\ti = &IssueListByOrgOptions{}\n\ti.GetLabels()\n\ti = nil\n\ti.GetLabels()\n}\n\nfunc TestIssueListByOrgOptions_GetSince(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueListByOrgOptions{}\n\ti.GetSince()\n\ti = nil\n\ti.GetSince()\n}\n\nfunc TestIssueListByOrgOptions_GetSort(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueListByOrgOptions{}\n\ti.GetSort()\n\ti = nil\n\ti.GetSort()\n}\n\nfunc TestIssueListByOrgOptions_GetState(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueListByOrgOptions{}\n\ti.GetState()\n\ti = nil\n\ti.GetState()\n}\n\nfunc TestIssueListByOrgOptions_GetType(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueListByOrgOptions{}\n\ti.GetType()\n\ti = nil\n\ti.GetType()\n}\n\nfunc TestIssueListByRepoOptions_GetAssignee(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueListByRepoOptions{}\n\ti.GetAssignee()\n\ti = nil\n\ti.GetAssignee()\n}\n\nfunc TestIssueListByRepoOptions_GetCreator(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueListByRepoOptions{}\n\ti.GetCreator()\n\ti = nil\n\ti.GetCreator()\n}\n\nfunc TestIssueListByRepoOptions_GetDirection(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueListByRepoOptions{}\n\ti.GetDirection()\n\ti = nil\n\ti.GetDirection()\n}\n\nfunc TestIssueListByRepoOptions_GetLabels(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ti := &IssueListByRepoOptions{Labels: zeroValue}\n\ti.GetLabels()\n\ti = &IssueListByRepoOptions{}\n\ti.GetLabels()\n\ti = nil\n\ti.GetLabels()\n}\n\nfunc TestIssueListByRepoOptions_GetMentioned(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueListByRepoOptions{}\n\ti.GetMentioned()\n\ti = nil\n\ti.GetMentioned()\n}\n\nfunc TestIssueListByRepoOptions_GetMilestone(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueListByRepoOptions{}\n\ti.GetMilestone()\n\ti = nil\n\ti.GetMilestone()\n}\n\nfunc TestIssueListByRepoOptions_GetSince(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueListByRepoOptions{}\n\ti.GetSince()\n\ti = nil\n\ti.GetSince()\n}\n\nfunc TestIssueListByRepoOptions_GetSort(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueListByRepoOptions{}\n\ti.GetSort()\n\ti = nil\n\ti.GetSort()\n}\n\nfunc TestIssueListByRepoOptions_GetState(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueListByRepoOptions{}\n\ti.GetState()\n\ti = nil\n\ti.GetState()\n}\n\nfunc TestIssueListByRepoOptions_GetType(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssueListByRepoOptions{}\n\ti.GetType()\n\ti = nil\n\ti.GetType()\n}\n\nfunc TestIssueListCommentsOptions_GetDirection(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueListCommentsOptions{Direction: &zeroValue}\n\ti.GetDirection()\n\ti = &IssueListCommentsOptions{}\n\ti.GetDirection()\n\ti = nil\n\ti.GetDirection()\n}\n\nfunc TestIssueListCommentsOptions_GetSince(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue time.Time\n\ti := &IssueListCommentsOptions{Since: &zeroValue}\n\ti.GetSince()\n\ti = &IssueListCommentsOptions{}\n\ti.GetSince()\n\ti = nil\n\ti.GetSince()\n}\n\nfunc TestIssueListCommentsOptions_GetSort(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueListCommentsOptions{Sort: &zeroValue}\n\ti.GetSort()\n\ti = &IssueListCommentsOptions{}\n\ti.GetSort()\n\ti = nil\n\ti.GetSort()\n}\n\nfunc TestIssueRequest_GetAssignee(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueRequest{Assignee: &zeroValue}\n\ti.GetAssignee()\n\ti = &IssueRequest{}\n\ti.GetAssignee()\n\ti = nil\n\ti.GetAssignee()\n}\n\nfunc TestIssueRequest_GetAssignees(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue []string\n\ti := &IssueRequest{Assignees: &zeroValue}\n\ti.GetAssignees()\n\ti = &IssueRequest{}\n\ti.GetAssignees()\n\ti = nil\n\ti.GetAssignees()\n}\n\nfunc TestIssueRequest_GetBody(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueRequest{Body: &zeroValue}\n\ti.GetBody()\n\ti = &IssueRequest{}\n\ti.GetBody()\n\ti = nil\n\ti.GetBody()\n}\n\nfunc TestIssueRequest_GetLabels(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue []string\n\ti := &IssueRequest{Labels: &zeroValue}\n\ti.GetLabels()\n\ti = &IssueRequest{}\n\ti.GetLabels()\n\ti = nil\n\ti.GetLabels()\n}\n\nfunc TestIssueRequest_GetMilestone(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ti := &IssueRequest{Milestone: &zeroValue}\n\ti.GetMilestone()\n\ti = &IssueRequest{}\n\ti.GetMilestone()\n\ti = nil\n\ti.GetMilestone()\n}\n\nfunc TestIssueRequest_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueRequest{State: &zeroValue}\n\ti.GetState()\n\ti = &IssueRequest{}\n\ti.GetState()\n\ti = nil\n\ti.GetState()\n}\n\nfunc TestIssueRequest_GetStateReason(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueRequest{StateReason: &zeroValue}\n\ti.GetStateReason()\n\ti = &IssueRequest{}\n\ti.GetStateReason()\n\ti = nil\n\ti.GetStateReason()\n}\n\nfunc TestIssueRequest_GetTitle(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueRequest{Title: &zeroValue}\n\ti.GetTitle()\n\ti = &IssueRequest{}\n\ti.GetTitle()\n\ti = nil\n\ti.GetTitle()\n}\n\nfunc TestIssueRequest_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueRequest{Type: &zeroValue}\n\ti.GetType()\n\ti = &IssueRequest{}\n\ti.GetType()\n\ti = nil\n\ti.GetType()\n}\n\nfunc TestIssuesEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssuesEvent{Action: &zeroValue}\n\ti.GetAction()\n\ti = &IssuesEvent{}\n\ti.GetAction()\n\ti = nil\n\ti.GetAction()\n}\n\nfunc TestIssuesEvent_GetAssignee(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssuesEvent{}\n\ti.GetAssignee()\n\ti = nil\n\ti.GetAssignee()\n}\n\nfunc TestIssuesEvent_GetChanges(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssuesEvent{}\n\ti.GetChanges()\n\ti = nil\n\ti.GetChanges()\n}\n\nfunc TestIssuesEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssuesEvent{}\n\ti.GetInstallation()\n\ti = nil\n\ti.GetInstallation()\n}\n\nfunc TestIssuesEvent_GetIssue(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssuesEvent{}\n\ti.GetIssue()\n\ti = nil\n\ti.GetIssue()\n}\n\nfunc TestIssuesEvent_GetLabel(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssuesEvent{}\n\ti.GetLabel()\n\ti = nil\n\ti.GetLabel()\n}\n\nfunc TestIssuesEvent_GetMilestone(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssuesEvent{}\n\ti.GetMilestone()\n\ti = nil\n\ti.GetMilestone()\n}\n\nfunc TestIssuesEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssuesEvent{}\n\ti.GetOrg()\n\ti = nil\n\ti.GetOrg()\n}\n\nfunc TestIssuesEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssuesEvent{}\n\ti.GetRepo()\n\ti = nil\n\ti.GetRepo()\n}\n\nfunc TestIssuesEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\ti := &IssuesEvent{}\n\ti.GetSender()\n\ti = nil\n\ti.GetSender()\n}\n\nfunc TestIssuesSearchResult_GetIncompleteResults(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ti := &IssuesSearchResult{IncompleteResults: &zeroValue}\n\ti.GetIncompleteResults()\n\ti = &IssuesSearchResult{}\n\ti.GetIncompleteResults()\n\ti = nil\n\ti.GetIncompleteResults()\n}\n\nfunc TestIssuesSearchResult_GetIssues(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Issue{}\n\ti := &IssuesSearchResult{Issues: zeroValue}\n\ti.GetIssues()\n\ti = &IssuesSearchResult{}\n\ti.GetIssues()\n\ti = nil\n\ti.GetIssues()\n}\n\nfunc TestIssuesSearchResult_GetTotal(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ti := &IssuesSearchResult{Total: &zeroValue}\n\ti.GetTotal()\n\ti = &IssuesSearchResult{}\n\ti.GetTotal()\n\ti = nil\n\ti.GetTotal()\n}\n\nfunc TestIssueStats_GetClosedIssues(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ti := &IssueStats{ClosedIssues: &zeroValue}\n\ti.GetClosedIssues()\n\ti = &IssueStats{}\n\ti.GetClosedIssues()\n\ti = nil\n\ti.GetClosedIssues()\n}\n\nfunc TestIssueStats_GetOpenIssues(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ti := &IssueStats{OpenIssues: &zeroValue}\n\ti.GetOpenIssues()\n\ti = &IssueStats{}\n\ti.GetOpenIssues()\n\ti = nil\n\ti.GetOpenIssues()\n}\n\nfunc TestIssueStats_GetTotalIssues(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ti := &IssueStats{TotalIssues: &zeroValue}\n\ti.GetTotalIssues()\n\ti = &IssueStats{}\n\ti.GetTotalIssues()\n\ti = nil\n\ti.GetTotalIssues()\n}\n\nfunc TestIssueType_GetColor(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueType{Color: &zeroValue}\n\ti.GetColor()\n\ti = &IssueType{}\n\ti.GetColor()\n\ti = nil\n\ti.GetColor()\n}\n\nfunc TestIssueType_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ti := &IssueType{CreatedAt: &zeroValue}\n\ti.GetCreatedAt()\n\ti = &IssueType{}\n\ti.GetCreatedAt()\n\ti = nil\n\ti.GetCreatedAt()\n}\n\nfunc TestIssueType_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueType{Description: &zeroValue}\n\ti.GetDescription()\n\ti = &IssueType{}\n\ti.GetDescription()\n\ti = nil\n\ti.GetDescription()\n}\n\nfunc TestIssueType_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ti := &IssueType{ID: &zeroValue}\n\ti.GetID()\n\ti = &IssueType{}\n\ti.GetID()\n\ti = nil\n\ti.GetID()\n}\n\nfunc TestIssueType_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueType{Name: &zeroValue}\n\ti.GetName()\n\ti = &IssueType{}\n\ti.GetName()\n\ti = nil\n\ti.GetName()\n}\n\nfunc TestIssueType_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ti := &IssueType{NodeID: &zeroValue}\n\ti.GetNodeID()\n\ti = &IssueType{}\n\ti.GetNodeID()\n\ti = nil\n\ti.GetNodeID()\n}\n\nfunc TestIssueType_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ti := &IssueType{UpdatedAt: &zeroValue}\n\ti.GetUpdatedAt()\n\ti = &IssueType{}\n\ti.GetUpdatedAt()\n\ti = nil\n\ti.GetUpdatedAt()\n}\n\nfunc TestJITRunnerConfig_GetEncodedJITConfig(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tj := &JITRunnerConfig{EncodedJITConfig: &zeroValue}\n\tj.GetEncodedJITConfig()\n\tj = &JITRunnerConfig{}\n\tj.GetEncodedJITConfig()\n\tj = nil\n\tj.GetEncodedJITConfig()\n}\n\nfunc TestJITRunnerConfig_GetRunner(tt *testing.T) {\n\ttt.Parallel()\n\tj := &JITRunnerConfig{}\n\tj.GetRunner()\n\tj = nil\n\tj.GetRunner()\n}\n\nfunc TestJobs_GetJobs(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*WorkflowJob{}\n\tj := &Jobs{Jobs: zeroValue}\n\tj.GetJobs()\n\tj = &Jobs{}\n\tj.GetJobs()\n\tj = nil\n\tj.GetJobs()\n}\n\nfunc TestJobs_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tj := &Jobs{TotalCount: &zeroValue}\n\tj.GetTotalCount()\n\tj = &Jobs{}\n\tj.GetTotalCount()\n\tj = nil\n\tj.GetTotalCount()\n}\n\nfunc TestKey_GetAddedBy(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tk := &Key{AddedBy: &zeroValue}\n\tk.GetAddedBy()\n\tk = &Key{}\n\tk.GetAddedBy()\n\tk = nil\n\tk.GetAddedBy()\n}\n\nfunc TestKey_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tk := &Key{CreatedAt: &zeroValue}\n\tk.GetCreatedAt()\n\tk = &Key{}\n\tk.GetCreatedAt()\n\tk = nil\n\tk.GetCreatedAt()\n}\n\nfunc TestKey_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tk := &Key{ID: &zeroValue}\n\tk.GetID()\n\tk = &Key{}\n\tk.GetID()\n\tk = nil\n\tk.GetID()\n}\n\nfunc TestKey_GetKey(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tk := &Key{Key: &zeroValue}\n\tk.GetKey()\n\tk = &Key{}\n\tk.GetKey()\n\tk = nil\n\tk.GetKey()\n}\n\nfunc TestKey_GetLastUsed(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tk := &Key{LastUsed: &zeroValue}\n\tk.GetLastUsed()\n\tk = &Key{}\n\tk.GetLastUsed()\n\tk = nil\n\tk.GetLastUsed()\n}\n\nfunc TestKey_GetReadOnly(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tk := &Key{ReadOnly: &zeroValue}\n\tk.GetReadOnly()\n\tk = &Key{}\n\tk.GetReadOnly()\n\tk = nil\n\tk.GetReadOnly()\n}\n\nfunc TestKey_GetTitle(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tk := &Key{Title: &zeroValue}\n\tk.GetTitle()\n\tk = &Key{}\n\tk.GetTitle()\n\tk = nil\n\tk.GetTitle()\n}\n\nfunc TestKey_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tk := &Key{URL: &zeroValue}\n\tk.GetURL()\n\tk = &Key{}\n\tk.GetURL()\n\tk = nil\n\tk.GetURL()\n}\n\nfunc TestKey_GetVerified(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tk := &Key{Verified: &zeroValue}\n\tk.GetVerified()\n\tk = &Key{}\n\tk.GetVerified()\n\tk = nil\n\tk.GetVerified()\n}\n\nfunc TestLabel_GetColor(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &Label{Color: &zeroValue}\n\tl.GetColor()\n\tl = &Label{}\n\tl.GetColor()\n\tl = nil\n\tl.GetColor()\n}\n\nfunc TestLabel_GetDefault(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tl := &Label{Default: &zeroValue}\n\tl.GetDefault()\n\tl = &Label{}\n\tl.GetDefault()\n\tl = nil\n\tl.GetDefault()\n}\n\nfunc TestLabel_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &Label{Description: &zeroValue}\n\tl.GetDescription()\n\tl = &Label{}\n\tl.GetDescription()\n\tl = nil\n\tl.GetDescription()\n}\n\nfunc TestLabel_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tl := &Label{ID: &zeroValue}\n\tl.GetID()\n\tl = &Label{}\n\tl.GetID()\n\tl = nil\n\tl.GetID()\n}\n\nfunc TestLabel_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &Label{Name: &zeroValue}\n\tl.GetName()\n\tl = &Label{}\n\tl.GetName()\n\tl = nil\n\tl.GetName()\n}\n\nfunc TestLabel_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &Label{NodeID: &zeroValue}\n\tl.GetNodeID()\n\tl = &Label{}\n\tl.GetNodeID()\n\tl = nil\n\tl.GetNodeID()\n}\n\nfunc TestLabel_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &Label{URL: &zeroValue}\n\tl.GetURL()\n\tl = &Label{}\n\tl.GetURL()\n\tl = nil\n\tl.GetURL()\n}\n\nfunc TestLabelEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &LabelEvent{Action: &zeroValue}\n\tl.GetAction()\n\tl = &LabelEvent{}\n\tl.GetAction()\n\tl = nil\n\tl.GetAction()\n}\n\nfunc TestLabelEvent_GetChanges(tt *testing.T) {\n\ttt.Parallel()\n\tl := &LabelEvent{}\n\tl.GetChanges()\n\tl = nil\n\tl.GetChanges()\n}\n\nfunc TestLabelEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tl := &LabelEvent{}\n\tl.GetInstallation()\n\tl = nil\n\tl.GetInstallation()\n}\n\nfunc TestLabelEvent_GetLabel(tt *testing.T) {\n\ttt.Parallel()\n\tl := &LabelEvent{}\n\tl.GetLabel()\n\tl = nil\n\tl.GetLabel()\n}\n\nfunc TestLabelEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tl := &LabelEvent{}\n\tl.GetOrg()\n\tl = nil\n\tl.GetOrg()\n}\n\nfunc TestLabelEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tl := &LabelEvent{}\n\tl.GetRepo()\n\tl = nil\n\tl.GetRepo()\n}\n\nfunc TestLabelEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tl := &LabelEvent{}\n\tl.GetSender()\n\tl = nil\n\tl.GetSender()\n}\n\nfunc TestLabelResult_GetColor(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &LabelResult{Color: &zeroValue}\n\tl.GetColor()\n\tl = &LabelResult{}\n\tl.GetColor()\n\tl = nil\n\tl.GetColor()\n}\n\nfunc TestLabelResult_GetDefault(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tl := &LabelResult{Default: &zeroValue}\n\tl.GetDefault()\n\tl = &LabelResult{}\n\tl.GetDefault()\n\tl = nil\n\tl.GetDefault()\n}\n\nfunc TestLabelResult_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &LabelResult{Description: &zeroValue}\n\tl.GetDescription()\n\tl = &LabelResult{}\n\tl.GetDescription()\n\tl = nil\n\tl.GetDescription()\n}\n\nfunc TestLabelResult_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tl := &LabelResult{ID: &zeroValue}\n\tl.GetID()\n\tl = &LabelResult{}\n\tl.GetID()\n\tl = nil\n\tl.GetID()\n}\n\nfunc TestLabelResult_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &LabelResult{Name: &zeroValue}\n\tl.GetName()\n\tl = &LabelResult{}\n\tl.GetName()\n\tl = nil\n\tl.GetName()\n}\n\nfunc TestLabelResult_GetScore(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue float64\n\tl := &LabelResult{Score: &zeroValue}\n\tl.GetScore()\n\tl = &LabelResult{}\n\tl.GetScore()\n\tl = nil\n\tl.GetScore()\n}\n\nfunc TestLabelResult_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &LabelResult{URL: &zeroValue}\n\tl.GetURL()\n\tl = &LabelResult{}\n\tl.GetURL()\n\tl = nil\n\tl.GetURL()\n}\n\nfunc TestLabelsSearchResult_GetIncompleteResults(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tl := &LabelsSearchResult{IncompleteResults: &zeroValue}\n\tl.GetIncompleteResults()\n\tl = &LabelsSearchResult{}\n\tl.GetIncompleteResults()\n\tl = nil\n\tl.GetIncompleteResults()\n}\n\nfunc TestLabelsSearchResult_GetLabels(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*LabelResult{}\n\tl := &LabelsSearchResult{Labels: zeroValue}\n\tl.GetLabels()\n\tl = &LabelsSearchResult{}\n\tl.GetLabels()\n\tl = nil\n\tl.GetLabels()\n}\n\nfunc TestLabelsSearchResult_GetTotal(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tl := &LabelsSearchResult{Total: &zeroValue}\n\tl.GetTotal()\n\tl = &LabelsSearchResult{}\n\tl.GetTotal()\n\tl = nil\n\tl.GetTotal()\n}\n\nfunc TestLargeFile_GetOID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &LargeFile{OID: &zeroValue}\n\tl.GetOID()\n\tl = &LargeFile{}\n\tl.GetOID()\n\tl = nil\n\tl.GetOID()\n}\n\nfunc TestLargeFile_GetPath(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &LargeFile{Path: &zeroValue}\n\tl.GetPath()\n\tl = &LargeFile{}\n\tl.GetPath()\n\tl = nil\n\tl.GetPath()\n}\n\nfunc TestLargeFile_GetRefName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &LargeFile{RefName: &zeroValue}\n\tl.GetRefName()\n\tl = &LargeFile{}\n\tl.GetRefName()\n\tl = nil\n\tl.GetRefName()\n}\n\nfunc TestLargeFile_GetSize(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tl := &LargeFile{Size: &zeroValue}\n\tl.GetSize()\n\tl = &LargeFile{}\n\tl.GetSize()\n\tl = nil\n\tl.GetSize()\n}\n\nfunc TestLastLicenseSync_GetProperties(tt *testing.T) {\n\ttt.Parallel()\n\tl := &LastLicenseSync{}\n\tl.GetProperties()\n\tl = nil\n\tl.GetProperties()\n}\n\nfunc TestLastLicenseSync_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tl := &LastLicenseSync{}\n\tl.GetType()\n\tl = nil\n\tl.GetType()\n}\n\nfunc TestLastLicenseSyncProperties_GetDate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tl := &LastLicenseSyncProperties{Date: &zeroValue}\n\tl.GetDate()\n\tl = &LastLicenseSyncProperties{}\n\tl.GetDate()\n\tl = nil\n\tl.GetDate()\n}\n\nfunc TestLastLicenseSyncProperties_GetError(tt *testing.T) {\n\ttt.Parallel()\n\tl := &LastLicenseSyncProperties{}\n\tl.GetError()\n\tl = nil\n\tl.GetError()\n}\n\nfunc TestLastLicenseSyncProperties_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tl := &LastLicenseSyncProperties{}\n\tl.GetStatus()\n\tl = nil\n\tl.GetStatus()\n}\n\nfunc TestLicense_GetBody(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &License{Body: &zeroValue}\n\tl.GetBody()\n\tl = &License{}\n\tl.GetBody()\n\tl = nil\n\tl.GetBody()\n}\n\nfunc TestLicense_GetConditions(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue []string\n\tl := &License{Conditions: &zeroValue}\n\tl.GetConditions()\n\tl = &License{}\n\tl.GetConditions()\n\tl = nil\n\tl.GetConditions()\n}\n\nfunc TestLicense_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &License{Description: &zeroValue}\n\tl.GetDescription()\n\tl = &License{}\n\tl.GetDescription()\n\tl = nil\n\tl.GetDescription()\n}\n\nfunc TestLicense_GetFeatured(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tl := &License{Featured: &zeroValue}\n\tl.GetFeatured()\n\tl = &License{}\n\tl.GetFeatured()\n\tl = nil\n\tl.GetFeatured()\n}\n\nfunc TestLicense_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &License{HTMLURL: &zeroValue}\n\tl.GetHTMLURL()\n\tl = &License{}\n\tl.GetHTMLURL()\n\tl = nil\n\tl.GetHTMLURL()\n}\n\nfunc TestLicense_GetImplementation(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &License{Implementation: &zeroValue}\n\tl.GetImplementation()\n\tl = &License{}\n\tl.GetImplementation()\n\tl = nil\n\tl.GetImplementation()\n}\n\nfunc TestLicense_GetKey(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &License{Key: &zeroValue}\n\tl.GetKey()\n\tl = &License{}\n\tl.GetKey()\n\tl = nil\n\tl.GetKey()\n}\n\nfunc TestLicense_GetLimitations(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue []string\n\tl := &License{Limitations: &zeroValue}\n\tl.GetLimitations()\n\tl = &License{}\n\tl.GetLimitations()\n\tl = nil\n\tl.GetLimitations()\n}\n\nfunc TestLicense_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &License{Name: &zeroValue}\n\tl.GetName()\n\tl = &License{}\n\tl.GetName()\n\tl = nil\n\tl.GetName()\n}\n\nfunc TestLicense_GetPermissions(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue []string\n\tl := &License{Permissions: &zeroValue}\n\tl.GetPermissions()\n\tl = &License{}\n\tl.GetPermissions()\n\tl = nil\n\tl.GetPermissions()\n}\n\nfunc TestLicense_GetSPDXID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &License{SPDXID: &zeroValue}\n\tl.GetSPDXID()\n\tl = &License{}\n\tl.GetSPDXID()\n\tl = nil\n\tl.GetSPDXID()\n}\n\nfunc TestLicense_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &License{URL: &zeroValue}\n\tl.GetURL()\n\tl = &License{}\n\tl.GetURL()\n\tl = nil\n\tl.GetURL()\n}\n\nfunc TestLicenseCheck_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &LicenseCheck{Status: &zeroValue}\n\tl.GetStatus()\n\tl = &LicenseCheck{}\n\tl.GetStatus()\n\tl = nil\n\tl.GetStatus()\n}\n\nfunc TestLicenseStatus_GetAdvancedSecurityEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tl := &LicenseStatus{AdvancedSecurityEnabled: &zeroValue}\n\tl.GetAdvancedSecurityEnabled()\n\tl = &LicenseStatus{}\n\tl.GetAdvancedSecurityEnabled()\n\tl = nil\n\tl.GetAdvancedSecurityEnabled()\n}\n\nfunc TestLicenseStatus_GetAdvancedSecuritySeats(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tl := &LicenseStatus{AdvancedSecuritySeats: &zeroValue}\n\tl.GetAdvancedSecuritySeats()\n\tl = &LicenseStatus{}\n\tl.GetAdvancedSecuritySeats()\n\tl = nil\n\tl.GetAdvancedSecuritySeats()\n}\n\nfunc TestLicenseStatus_GetClusterSupport(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tl := &LicenseStatus{ClusterSupport: &zeroValue}\n\tl.GetClusterSupport()\n\tl = &LicenseStatus{}\n\tl.GetClusterSupport()\n\tl = nil\n\tl.GetClusterSupport()\n}\n\nfunc TestLicenseStatus_GetCompany(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &LicenseStatus{Company: &zeroValue}\n\tl.GetCompany()\n\tl = &LicenseStatus{}\n\tl.GetCompany()\n\tl = nil\n\tl.GetCompany()\n}\n\nfunc TestLicenseStatus_GetCroquetSupport(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tl := &LicenseStatus{CroquetSupport: &zeroValue}\n\tl.GetCroquetSupport()\n\tl = &LicenseStatus{}\n\tl.GetCroquetSupport()\n\tl = nil\n\tl.GetCroquetSupport()\n}\n\nfunc TestLicenseStatus_GetCustomTerms(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tl := &LicenseStatus{CustomTerms: &zeroValue}\n\tl.GetCustomTerms()\n\tl = &LicenseStatus{}\n\tl.GetCustomTerms()\n\tl = nil\n\tl.GetCustomTerms()\n}\n\nfunc TestLicenseStatus_GetEvaluation(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tl := &LicenseStatus{Evaluation: &zeroValue}\n\tl.GetEvaluation()\n\tl = &LicenseStatus{}\n\tl.GetEvaluation()\n\tl = nil\n\tl.GetEvaluation()\n}\n\nfunc TestLicenseStatus_GetExpireAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tl := &LicenseStatus{ExpireAt: &zeroValue}\n\tl.GetExpireAt()\n\tl = &LicenseStatus{}\n\tl.GetExpireAt()\n\tl = nil\n\tl.GetExpireAt()\n}\n\nfunc TestLicenseStatus_GetInsightsEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tl := &LicenseStatus{InsightsEnabled: &zeroValue}\n\tl.GetInsightsEnabled()\n\tl = &LicenseStatus{}\n\tl.GetInsightsEnabled()\n\tl = nil\n\tl.GetInsightsEnabled()\n}\n\nfunc TestLicenseStatus_GetInsightsExpireAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tl := &LicenseStatus{InsightsExpireAt: &zeroValue}\n\tl.GetInsightsExpireAt()\n\tl = &LicenseStatus{}\n\tl.GetInsightsExpireAt()\n\tl = nil\n\tl.GetInsightsExpireAt()\n}\n\nfunc TestLicenseStatus_GetLearningLabEvaluationExpires(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tl := &LicenseStatus{LearningLabEvaluationExpires: &zeroValue}\n\tl.GetLearningLabEvaluationExpires()\n\tl = &LicenseStatus{}\n\tl.GetLearningLabEvaluationExpires()\n\tl = nil\n\tl.GetLearningLabEvaluationExpires()\n}\n\nfunc TestLicenseStatus_GetLearningLabSeats(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tl := &LicenseStatus{LearningLabSeats: &zeroValue}\n\tl.GetLearningLabSeats()\n\tl = &LicenseStatus{}\n\tl.GetLearningLabSeats()\n\tl = nil\n\tl.GetLearningLabSeats()\n}\n\nfunc TestLicenseStatus_GetPerpetual(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tl := &LicenseStatus{Perpetual: &zeroValue}\n\tl.GetPerpetual()\n\tl = &LicenseStatus{}\n\tl.GetPerpetual()\n\tl = nil\n\tl.GetPerpetual()\n}\n\nfunc TestLicenseStatus_GetReferenceNumber(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &LicenseStatus{ReferenceNumber: &zeroValue}\n\tl.GetReferenceNumber()\n\tl = &LicenseStatus{}\n\tl.GetReferenceNumber()\n\tl = nil\n\tl.GetReferenceNumber()\n}\n\nfunc TestLicenseStatus_GetSeats(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tl := &LicenseStatus{Seats: &zeroValue}\n\tl.GetSeats()\n\tl = &LicenseStatus{}\n\tl.GetSeats()\n\tl = nil\n\tl.GetSeats()\n}\n\nfunc TestLicenseStatus_GetSSHAllowed(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tl := &LicenseStatus{SSHAllowed: &zeroValue}\n\tl.GetSSHAllowed()\n\tl = &LicenseStatus{}\n\tl.GetSSHAllowed()\n\tl = nil\n\tl.GetSSHAllowed()\n}\n\nfunc TestLicenseStatus_GetSupportKey(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &LicenseStatus{SupportKey: &zeroValue}\n\tl.GetSupportKey()\n\tl = &LicenseStatus{}\n\tl.GetSupportKey()\n\tl = nil\n\tl.GetSupportKey()\n}\n\nfunc TestLicenseStatus_GetUnlimitedSeating(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tl := &LicenseStatus{UnlimitedSeating: &zeroValue}\n\tl.GetUnlimitedSeating()\n\tl = &LicenseStatus{}\n\tl.GetUnlimitedSeating()\n\tl = nil\n\tl.GetUnlimitedSeating()\n}\n\nfunc TestLinearHistoryRequirementEnforcementLevelChanges_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &LinearHistoryRequirementEnforcementLevelChanges{From: &zeroValue}\n\tl.GetFrom()\n\tl = &LinearHistoryRequirementEnforcementLevelChanges{}\n\tl.GetFrom()\n\tl = nil\n\tl.GetFrom()\n}\n\nfunc TestListAlertsOptions_GetDirection(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListAlertsOptions{Direction: &zeroValue}\n\tl.GetDirection()\n\tl = &ListAlertsOptions{}\n\tl.GetDirection()\n\tl = nil\n\tl.GetDirection()\n}\n\nfunc TestListAlertsOptions_GetEcosystem(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListAlertsOptions{Ecosystem: &zeroValue}\n\tl.GetEcosystem()\n\tl = &ListAlertsOptions{}\n\tl.GetEcosystem()\n\tl = nil\n\tl.GetEcosystem()\n}\n\nfunc TestListAlertsOptions_GetPackage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListAlertsOptions{Package: &zeroValue}\n\tl.GetPackage()\n\tl = &ListAlertsOptions{}\n\tl.GetPackage()\n\tl = nil\n\tl.GetPackage()\n}\n\nfunc TestListAlertsOptions_GetScope(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListAlertsOptions{Scope: &zeroValue}\n\tl.GetScope()\n\tl = &ListAlertsOptions{}\n\tl.GetScope()\n\tl = nil\n\tl.GetScope()\n}\n\nfunc TestListAlertsOptions_GetSeverity(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListAlertsOptions{Severity: &zeroValue}\n\tl.GetSeverity()\n\tl = &ListAlertsOptions{}\n\tl.GetSeverity()\n\tl = nil\n\tl.GetSeverity()\n}\n\nfunc TestListAlertsOptions_GetSort(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListAlertsOptions{Sort: &zeroValue}\n\tl.GetSort()\n\tl = &ListAlertsOptions{}\n\tl.GetSort()\n\tl = nil\n\tl.GetSort()\n}\n\nfunc TestListAlertsOptions_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListAlertsOptions{State: &zeroValue}\n\tl.GetState()\n\tl = &ListAlertsOptions{}\n\tl.GetState()\n\tl = nil\n\tl.GetState()\n}\n\nfunc TestListAllIssuesOptions_GetCollab(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListAllIssuesOptions{}\n\tl.GetCollab()\n\tl = nil\n\tl.GetCollab()\n}\n\nfunc TestListAllIssuesOptions_GetDirection(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListAllIssuesOptions{}\n\tl.GetDirection()\n\tl = nil\n\tl.GetDirection()\n}\n\nfunc TestListAllIssuesOptions_GetFilter(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListAllIssuesOptions{}\n\tl.GetFilter()\n\tl = nil\n\tl.GetFilter()\n}\n\nfunc TestListAllIssuesOptions_GetLabels(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tl := &ListAllIssuesOptions{Labels: zeroValue}\n\tl.GetLabels()\n\tl = &ListAllIssuesOptions{}\n\tl.GetLabels()\n\tl = nil\n\tl.GetLabels()\n}\n\nfunc TestListAllIssuesOptions_GetOrgs(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListAllIssuesOptions{}\n\tl.GetOrgs()\n\tl = nil\n\tl.GetOrgs()\n}\n\nfunc TestListAllIssuesOptions_GetOwned(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListAllIssuesOptions{}\n\tl.GetOwned()\n\tl = nil\n\tl.GetOwned()\n}\n\nfunc TestListAllIssuesOptions_GetPulls(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListAllIssuesOptions{}\n\tl.GetPulls()\n\tl = nil\n\tl.GetPulls()\n}\n\nfunc TestListAllIssuesOptions_GetSince(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListAllIssuesOptions{}\n\tl.GetSince()\n\tl = nil\n\tl.GetSince()\n}\n\nfunc TestListAllIssuesOptions_GetSort(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListAllIssuesOptions{}\n\tl.GetSort()\n\tl = nil\n\tl.GetSort()\n}\n\nfunc TestListAllIssuesOptions_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListAllIssuesOptions{}\n\tl.GetState()\n\tl = nil\n\tl.GetState()\n}\n\nfunc TestListArtifactsOptions_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListArtifactsOptions{Name: &zeroValue}\n\tl.GetName()\n\tl = &ListArtifactsOptions{}\n\tl.GetName()\n\tl = nil\n\tl.GetName()\n}\n\nfunc TestListCheckRunsOptions_GetAppID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tl := &ListCheckRunsOptions{AppID: &zeroValue}\n\tl.GetAppID()\n\tl = &ListCheckRunsOptions{}\n\tl.GetAppID()\n\tl = nil\n\tl.GetAppID()\n}\n\nfunc TestListCheckRunsOptions_GetCheckName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListCheckRunsOptions{CheckName: &zeroValue}\n\tl.GetCheckName()\n\tl = &ListCheckRunsOptions{}\n\tl.GetCheckName()\n\tl = nil\n\tl.GetCheckName()\n}\n\nfunc TestListCheckRunsOptions_GetFilter(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListCheckRunsOptions{Filter: &zeroValue}\n\tl.GetFilter()\n\tl = &ListCheckRunsOptions{}\n\tl.GetFilter()\n\tl = nil\n\tl.GetFilter()\n}\n\nfunc TestListCheckRunsOptions_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListCheckRunsOptions{Status: &zeroValue}\n\tl.GetStatus()\n\tl = &ListCheckRunsOptions{}\n\tl.GetStatus()\n\tl = nil\n\tl.GetStatus()\n}\n\nfunc TestListCheckRunsResults_GetCheckRuns(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CheckRun{}\n\tl := &ListCheckRunsResults{CheckRuns: zeroValue}\n\tl.GetCheckRuns()\n\tl = &ListCheckRunsResults{}\n\tl.GetCheckRuns()\n\tl = nil\n\tl.GetCheckRuns()\n}\n\nfunc TestListCheckRunsResults_GetTotal(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tl := &ListCheckRunsResults{Total: &zeroValue}\n\tl.GetTotal()\n\tl = &ListCheckRunsResults{}\n\tl.GetTotal()\n\tl = nil\n\tl.GetTotal()\n}\n\nfunc TestListCheckSuiteOptions_GetAppID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tl := &ListCheckSuiteOptions{AppID: &zeroValue}\n\tl.GetAppID()\n\tl = &ListCheckSuiteOptions{}\n\tl.GetAppID()\n\tl = nil\n\tl.GetAppID()\n}\n\nfunc TestListCheckSuiteOptions_GetCheckName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListCheckSuiteOptions{CheckName: &zeroValue}\n\tl.GetCheckName()\n\tl = &ListCheckSuiteOptions{}\n\tl.GetCheckName()\n\tl = nil\n\tl.GetCheckName()\n}\n\nfunc TestListCheckSuiteResults_GetCheckSuites(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CheckSuite{}\n\tl := &ListCheckSuiteResults{CheckSuites: zeroValue}\n\tl.GetCheckSuites()\n\tl = &ListCheckSuiteResults{}\n\tl.GetCheckSuites()\n\tl = nil\n\tl.GetCheckSuites()\n}\n\nfunc TestListCheckSuiteResults_GetTotal(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tl := &ListCheckSuiteResults{Total: &zeroValue}\n\tl.GetTotal()\n\tl = &ListCheckSuiteResults{}\n\tl.GetTotal()\n\tl = nil\n\tl.GetTotal()\n}\n\nfunc TestListCodeSecurityConfigurationRepositoriesOptions_GetAfter(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListCodeSecurityConfigurationRepositoriesOptions{}\n\tl.GetAfter()\n\tl = nil\n\tl.GetAfter()\n}\n\nfunc TestListCodeSecurityConfigurationRepositoriesOptions_GetBefore(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListCodeSecurityConfigurationRepositoriesOptions{}\n\tl.GetBefore()\n\tl = nil\n\tl.GetBefore()\n}\n\nfunc TestListCodeSecurityConfigurationRepositoriesOptions_GetPerPage(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListCodeSecurityConfigurationRepositoriesOptions{}\n\tl.GetPerPage()\n\tl = nil\n\tl.GetPerPage()\n}\n\nfunc TestListCodeSecurityConfigurationRepositoriesOptions_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListCodeSecurityConfigurationRepositoriesOptions{}\n\tl.GetStatus()\n\tl = nil\n\tl.GetStatus()\n}\n\nfunc TestListCodespaces_GetCodespaces(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Codespace{}\n\tl := &ListCodespaces{Codespaces: zeroValue}\n\tl.GetCodespaces()\n\tl = &ListCodespaces{}\n\tl.GetCodespaces()\n\tl = nil\n\tl.GetCodespaces()\n}\n\nfunc TestListCodespaces_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tl := &ListCodespaces{TotalCount: &zeroValue}\n\tl.GetTotalCount()\n\tl = &ListCodespaces{}\n\tl.GetTotalCount()\n\tl = nil\n\tl.GetTotalCount()\n}\n\nfunc TestListCodespacesOptions_GetRepositoryID(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListCodespacesOptions{}\n\tl.GetRepositoryID()\n\tl = nil\n\tl.GetRepositoryID()\n}\n\nfunc TestListCollaboratorsOptions_GetAffiliation(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListCollaboratorsOptions{}\n\tl.GetAffiliation()\n\tl = nil\n\tl.GetAffiliation()\n}\n\nfunc TestListCollaboratorsOptions_GetPermission(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListCollaboratorsOptions{}\n\tl.GetPermission()\n\tl = nil\n\tl.GetPermission()\n}\n\nfunc TestListContributorsOptions_GetAnon(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListContributorsOptions{}\n\tl.GetAnon()\n\tl = nil\n\tl.GetAnon()\n}\n\nfunc TestListCopilotSeatsResponse_GetSeats(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CopilotSeatDetails{}\n\tl := &ListCopilotSeatsResponse{Seats: zeroValue}\n\tl.GetSeats()\n\tl = &ListCopilotSeatsResponse{}\n\tl.GetSeats()\n\tl = nil\n\tl.GetSeats()\n}\n\nfunc TestListCopilotSeatsResponse_GetTotalSeats(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListCopilotSeatsResponse{}\n\tl.GetTotalSeats()\n\tl = nil\n\tl.GetTotalSeats()\n}\n\nfunc TestListCostCenterOptions_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListCostCenterOptions{State: &zeroValue}\n\tl.GetState()\n\tl = &ListCostCenterOptions{}\n\tl.GetState()\n\tl = nil\n\tl.GetState()\n}\n\nfunc TestListCursorOptions_GetAfter(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListCursorOptions{}\n\tl.GetAfter()\n\tl = nil\n\tl.GetAfter()\n}\n\nfunc TestListCursorOptions_GetBefore(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListCursorOptions{}\n\tl.GetBefore()\n\tl = nil\n\tl.GetBefore()\n}\n\nfunc TestListCursorOptions_GetCursor(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListCursorOptions{}\n\tl.GetCursor()\n\tl = nil\n\tl.GetCursor()\n}\n\nfunc TestListCursorOptions_GetFirst(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListCursorOptions{}\n\tl.GetFirst()\n\tl = nil\n\tl.GetFirst()\n}\n\nfunc TestListCursorOptions_GetLast(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListCursorOptions{}\n\tl.GetLast()\n\tl = nil\n\tl.GetLast()\n}\n\nfunc TestListCursorOptions_GetPage(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListCursorOptions{}\n\tl.GetPage()\n\tl = nil\n\tl.GetPage()\n}\n\nfunc TestListCursorOptions_GetPerPage(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListCursorOptions{}\n\tl.GetPerPage()\n\tl = nil\n\tl.GetPerPage()\n}\n\nfunc TestListCustomDeploymentRuleIntegrationsResponse_GetAvailableIntegrations(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CustomDeploymentProtectionRuleApp{}\n\tl := &ListCustomDeploymentRuleIntegrationsResponse{AvailableIntegrations: zeroValue}\n\tl.GetAvailableIntegrations()\n\tl = &ListCustomDeploymentRuleIntegrationsResponse{}\n\tl.GetAvailableIntegrations()\n\tl = nil\n\tl.GetAvailableIntegrations()\n}\n\nfunc TestListCustomDeploymentRuleIntegrationsResponse_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tl := &ListCustomDeploymentRuleIntegrationsResponse{TotalCount: &zeroValue}\n\tl.GetTotalCount()\n\tl = &ListCustomDeploymentRuleIntegrationsResponse{}\n\tl.GetTotalCount()\n\tl = nil\n\tl.GetTotalCount()\n}\n\nfunc TestListCustomPropertyValuesOptions_GetRepositoryQuery(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListCustomPropertyValuesOptions{}\n\tl.GetRepositoryQuery()\n\tl = nil\n\tl.GetRepositoryQuery()\n}\n\nfunc TestListDeploymentProtectionRuleResponse_GetProtectionRules(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CustomDeploymentProtectionRule{}\n\tl := &ListDeploymentProtectionRuleResponse{ProtectionRules: zeroValue}\n\tl.GetProtectionRules()\n\tl = &ListDeploymentProtectionRuleResponse{}\n\tl.GetProtectionRules()\n\tl = nil\n\tl.GetProtectionRules()\n}\n\nfunc TestListDeploymentProtectionRuleResponse_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tl := &ListDeploymentProtectionRuleResponse{TotalCount: &zeroValue}\n\tl.GetTotalCount()\n\tl = &ListDeploymentProtectionRuleResponse{}\n\tl.GetTotalCount()\n\tl = nil\n\tl.GetTotalCount()\n}\n\nfunc TestListEnterpriseCodeSecurityConfigurationOptions_GetAfter(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListEnterpriseCodeSecurityConfigurationOptions{}\n\tl.GetAfter()\n\tl = nil\n\tl.GetAfter()\n}\n\nfunc TestListEnterpriseCodeSecurityConfigurationOptions_GetBefore(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListEnterpriseCodeSecurityConfigurationOptions{}\n\tl.GetBefore()\n\tl = nil\n\tl.GetBefore()\n}\n\nfunc TestListEnterpriseCodeSecurityConfigurationOptions_GetPerPage(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListEnterpriseCodeSecurityConfigurationOptions{}\n\tl.GetPerPage()\n\tl = nil\n\tl.GetPerPage()\n}\n\nfunc TestListEnterpriseRunnerGroupOptions_GetVisibleToOrganization(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListEnterpriseRunnerGroupOptions{}\n\tl.GetVisibleToOrganization()\n\tl = nil\n\tl.GetVisibleToOrganization()\n}\n\nfunc TestListExternalGroupsOptions_GetDisplayName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListExternalGroupsOptions{DisplayName: &zeroValue}\n\tl.GetDisplayName()\n\tl = &ListExternalGroupsOptions{}\n\tl.GetDisplayName()\n\tl = nil\n\tl.GetDisplayName()\n}\n\nfunc TestListFineGrainedPATOptions_GetDirection(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListFineGrainedPATOptions{}\n\tl.GetDirection()\n\tl = nil\n\tl.GetDirection()\n}\n\nfunc TestListFineGrainedPATOptions_GetLastUsedAfter(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListFineGrainedPATOptions{}\n\tl.GetLastUsedAfter()\n\tl = nil\n\tl.GetLastUsedAfter()\n}\n\nfunc TestListFineGrainedPATOptions_GetLastUsedBefore(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListFineGrainedPATOptions{}\n\tl.GetLastUsedBefore()\n\tl = nil\n\tl.GetLastUsedBefore()\n}\n\nfunc TestListFineGrainedPATOptions_GetOwner(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tl := &ListFineGrainedPATOptions{Owner: zeroValue}\n\tl.GetOwner()\n\tl = &ListFineGrainedPATOptions{}\n\tl.GetOwner()\n\tl = nil\n\tl.GetOwner()\n}\n\nfunc TestListFineGrainedPATOptions_GetPermission(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListFineGrainedPATOptions{}\n\tl.GetPermission()\n\tl = nil\n\tl.GetPermission()\n}\n\nfunc TestListFineGrainedPATOptions_GetRepository(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListFineGrainedPATOptions{}\n\tl.GetRepository()\n\tl = nil\n\tl.GetRepository()\n}\n\nfunc TestListFineGrainedPATOptions_GetSort(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListFineGrainedPATOptions{}\n\tl.GetSort()\n\tl = nil\n\tl.GetSort()\n}\n\nfunc TestListFineGrainedPATOptions_GetTokenID(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []int64{}\n\tl := &ListFineGrainedPATOptions{TokenID: zeroValue}\n\tl.GetTokenID()\n\tl = &ListFineGrainedPATOptions{}\n\tl.GetTokenID()\n\tl = nil\n\tl.GetTokenID()\n}\n\nfunc TestListGlobalSecurityAdvisoriesOptions_GetAffects(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListGlobalSecurityAdvisoriesOptions{Affects: &zeroValue}\n\tl.GetAffects()\n\tl = &ListGlobalSecurityAdvisoriesOptions{}\n\tl.GetAffects()\n\tl = nil\n\tl.GetAffects()\n}\n\nfunc TestListGlobalSecurityAdvisoriesOptions_GetCVEID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListGlobalSecurityAdvisoriesOptions{CVEID: &zeroValue}\n\tl.GetCVEID()\n\tl = &ListGlobalSecurityAdvisoriesOptions{}\n\tl.GetCVEID()\n\tl = nil\n\tl.GetCVEID()\n}\n\nfunc TestListGlobalSecurityAdvisoriesOptions_GetCWEs(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tl := &ListGlobalSecurityAdvisoriesOptions{CWEs: zeroValue}\n\tl.GetCWEs()\n\tl = &ListGlobalSecurityAdvisoriesOptions{}\n\tl.GetCWEs()\n\tl = nil\n\tl.GetCWEs()\n}\n\nfunc TestListGlobalSecurityAdvisoriesOptions_GetEcosystem(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListGlobalSecurityAdvisoriesOptions{Ecosystem: &zeroValue}\n\tl.GetEcosystem()\n\tl = &ListGlobalSecurityAdvisoriesOptions{}\n\tl.GetEcosystem()\n\tl = nil\n\tl.GetEcosystem()\n}\n\nfunc TestListGlobalSecurityAdvisoriesOptions_GetGHSAID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListGlobalSecurityAdvisoriesOptions{GHSAID: &zeroValue}\n\tl.GetGHSAID()\n\tl = &ListGlobalSecurityAdvisoriesOptions{}\n\tl.GetGHSAID()\n\tl = nil\n\tl.GetGHSAID()\n}\n\nfunc TestListGlobalSecurityAdvisoriesOptions_GetIsWithdrawn(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tl := &ListGlobalSecurityAdvisoriesOptions{IsWithdrawn: &zeroValue}\n\tl.GetIsWithdrawn()\n\tl = &ListGlobalSecurityAdvisoriesOptions{}\n\tl.GetIsWithdrawn()\n\tl = nil\n\tl.GetIsWithdrawn()\n}\n\nfunc TestListGlobalSecurityAdvisoriesOptions_GetModified(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListGlobalSecurityAdvisoriesOptions{Modified: &zeroValue}\n\tl.GetModified()\n\tl = &ListGlobalSecurityAdvisoriesOptions{}\n\tl.GetModified()\n\tl = nil\n\tl.GetModified()\n}\n\nfunc TestListGlobalSecurityAdvisoriesOptions_GetPublished(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListGlobalSecurityAdvisoriesOptions{Published: &zeroValue}\n\tl.GetPublished()\n\tl = &ListGlobalSecurityAdvisoriesOptions{}\n\tl.GetPublished()\n\tl = nil\n\tl.GetPublished()\n}\n\nfunc TestListGlobalSecurityAdvisoriesOptions_GetSeverity(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListGlobalSecurityAdvisoriesOptions{Severity: &zeroValue}\n\tl.GetSeverity()\n\tl = &ListGlobalSecurityAdvisoriesOptions{}\n\tl.GetSeverity()\n\tl = nil\n\tl.GetSeverity()\n}\n\nfunc TestListGlobalSecurityAdvisoriesOptions_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListGlobalSecurityAdvisoriesOptions{Type: &zeroValue}\n\tl.GetType()\n\tl = &ListGlobalSecurityAdvisoriesOptions{}\n\tl.GetType()\n\tl = nil\n\tl.GetType()\n}\n\nfunc TestListGlobalSecurityAdvisoriesOptions_GetUpdated(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListGlobalSecurityAdvisoriesOptions{Updated: &zeroValue}\n\tl.GetUpdated()\n\tl = &ListGlobalSecurityAdvisoriesOptions{}\n\tl.GetUpdated()\n\tl = nil\n\tl.GetUpdated()\n}\n\nfunc TestListIDPGroupsOptions_GetQuery(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListIDPGroupsOptions{}\n\tl.GetQuery()\n\tl = nil\n\tl.GetQuery()\n}\n\nfunc TestListLicensesOptions_GetFeatured(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tl := &ListLicensesOptions{Featured: &zeroValue}\n\tl.GetFeatured()\n\tl = &ListLicensesOptions{}\n\tl.GetFeatured()\n\tl = nil\n\tl.GetFeatured()\n}\n\nfunc TestListMembersOptions_GetFilter(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListMembersOptions{}\n\tl.GetFilter()\n\tl = nil\n\tl.GetFilter()\n}\n\nfunc TestListMembersOptions_GetPublicOnly(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListMembersOptions{}\n\tl.GetPublicOnly()\n\tl = nil\n\tl.GetPublicOnly()\n}\n\nfunc TestListMembersOptions_GetRole(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListMembersOptions{}\n\tl.GetRole()\n\tl = nil\n\tl.GetRole()\n}\n\nfunc TestListOptions_GetPage(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListOptions{}\n\tl.GetPage()\n\tl = nil\n\tl.GetPage()\n}\n\nfunc TestListOptions_GetPerPage(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListOptions{}\n\tl.GetPerPage()\n\tl = nil\n\tl.GetPerPage()\n}\n\nfunc TestListOrganizations_GetOrganizations(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Organization{}\n\tl := &ListOrganizations{Organizations: zeroValue}\n\tl.GetOrganizations()\n\tl = &ListOrganizations{}\n\tl.GetOrganizations()\n\tl = nil\n\tl.GetOrganizations()\n}\n\nfunc TestListOrganizations_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tl := &ListOrganizations{TotalCount: &zeroValue}\n\tl.GetTotalCount()\n\tl = &ListOrganizations{}\n\tl.GetTotalCount()\n\tl = nil\n\tl.GetTotalCount()\n}\n\nfunc TestListOrgCodeSecurityConfigurationOptions_GetAfter(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListOrgCodeSecurityConfigurationOptions{}\n\tl.GetAfter()\n\tl = nil\n\tl.GetAfter()\n}\n\nfunc TestListOrgCodeSecurityConfigurationOptions_GetBefore(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListOrgCodeSecurityConfigurationOptions{}\n\tl.GetBefore()\n\tl = nil\n\tl.GetBefore()\n}\n\nfunc TestListOrgCodeSecurityConfigurationOptions_GetPerPage(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListOrgCodeSecurityConfigurationOptions{}\n\tl.GetPerPage()\n\tl = nil\n\tl.GetPerPage()\n}\n\nfunc TestListOrgCodeSecurityConfigurationOptions_GetTargetType(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListOrgCodeSecurityConfigurationOptions{}\n\tl.GetTargetType()\n\tl = nil\n\tl.GetTargetType()\n}\n\nfunc TestListOrgMembershipsOptions_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListOrgMembershipsOptions{}\n\tl.GetState()\n\tl = nil\n\tl.GetState()\n}\n\nfunc TestListOrgRunnerGroupOptions_GetVisibleToRepository(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListOrgRunnerGroupOptions{}\n\tl.GetVisibleToRepository()\n\tl = nil\n\tl.GetVisibleToRepository()\n}\n\nfunc TestListOutsideCollaboratorsOptions_GetFilter(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListOutsideCollaboratorsOptions{}\n\tl.GetFilter()\n\tl = nil\n\tl.GetFilter()\n}\n\nfunc TestListPackageVersionsOptions_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListPackageVersionsOptions{}\n\tl.GetState()\n\tl = nil\n\tl.GetState()\n}\n\nfunc TestListProjectItemsOptions_GetFields(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []int64{}\n\tl := &ListProjectItemsOptions{Fields: zeroValue}\n\tl.GetFields()\n\tl = &ListProjectItemsOptions{}\n\tl.GetFields()\n\tl = nil\n\tl.GetFields()\n}\n\nfunc TestListProjectsOptions_GetQuery(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListProjectsOptions{}\n\tl.GetQuery()\n\tl = nil\n\tl.GetQuery()\n}\n\nfunc TestListProjectsPaginationOptions_GetAfter(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListProjectsPaginationOptions{}\n\tl.GetAfter()\n\tl = nil\n\tl.GetAfter()\n}\n\nfunc TestListProjectsPaginationOptions_GetBefore(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListProjectsPaginationOptions{}\n\tl.GetBefore()\n\tl = nil\n\tl.GetBefore()\n}\n\nfunc TestListProjectsPaginationOptions_GetPerPage(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListProjectsPaginationOptions{}\n\tl.GetPerPage()\n\tl = nil\n\tl.GetPerPage()\n}\n\nfunc TestListProvisionedSCIMGroupsEnterpriseOptions_GetCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tl := &ListProvisionedSCIMGroupsEnterpriseOptions{Count: &zeroValue}\n\tl.GetCount()\n\tl = &ListProvisionedSCIMGroupsEnterpriseOptions{}\n\tl.GetCount()\n\tl = nil\n\tl.GetCount()\n}\n\nfunc TestListProvisionedSCIMGroupsEnterpriseOptions_GetExcludedAttributes(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListProvisionedSCIMGroupsEnterpriseOptions{ExcludedAttributes: &zeroValue}\n\tl.GetExcludedAttributes()\n\tl = &ListProvisionedSCIMGroupsEnterpriseOptions{}\n\tl.GetExcludedAttributes()\n\tl = nil\n\tl.GetExcludedAttributes()\n}\n\nfunc TestListProvisionedSCIMGroupsEnterpriseOptions_GetFilter(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListProvisionedSCIMGroupsEnterpriseOptions{Filter: &zeroValue}\n\tl.GetFilter()\n\tl = &ListProvisionedSCIMGroupsEnterpriseOptions{}\n\tl.GetFilter()\n\tl = nil\n\tl.GetFilter()\n}\n\nfunc TestListProvisionedSCIMGroupsEnterpriseOptions_GetStartIndex(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tl := &ListProvisionedSCIMGroupsEnterpriseOptions{StartIndex: &zeroValue}\n\tl.GetStartIndex()\n\tl = &ListProvisionedSCIMGroupsEnterpriseOptions{}\n\tl.GetStartIndex()\n\tl = nil\n\tl.GetStartIndex()\n}\n\nfunc TestListProvisionedSCIMUsersEnterpriseOptions_GetCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tl := &ListProvisionedSCIMUsersEnterpriseOptions{Count: &zeroValue}\n\tl.GetCount()\n\tl = &ListProvisionedSCIMUsersEnterpriseOptions{}\n\tl.GetCount()\n\tl = nil\n\tl.GetCount()\n}\n\nfunc TestListProvisionedSCIMUsersEnterpriseOptions_GetFilter(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListProvisionedSCIMUsersEnterpriseOptions{Filter: &zeroValue}\n\tl.GetFilter()\n\tl = &ListProvisionedSCIMUsersEnterpriseOptions{}\n\tl.GetFilter()\n\tl = nil\n\tl.GetFilter()\n}\n\nfunc TestListProvisionedSCIMUsersEnterpriseOptions_GetStartIndex(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tl := &ListProvisionedSCIMUsersEnterpriseOptions{StartIndex: &zeroValue}\n\tl.GetStartIndex()\n\tl = &ListProvisionedSCIMUsersEnterpriseOptions{}\n\tl.GetStartIndex()\n\tl = nil\n\tl.GetStartIndex()\n}\n\nfunc TestListReactionOptions_GetContent(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListReactionOptions{}\n\tl.GetContent()\n\tl = nil\n\tl.GetContent()\n}\n\nfunc TestListRepoMachineTypesOptions_GetClientIP(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListRepoMachineTypesOptions{ClientIP: &zeroValue}\n\tl.GetClientIP()\n\tl = &ListRepoMachineTypesOptions{}\n\tl.GetClientIP()\n\tl = nil\n\tl.GetClientIP()\n}\n\nfunc TestListRepoMachineTypesOptions_GetLocation(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListRepoMachineTypesOptions{Location: &zeroValue}\n\tl.GetLocation()\n\tl = &ListRepoMachineTypesOptions{}\n\tl.GetLocation()\n\tl = nil\n\tl.GetLocation()\n}\n\nfunc TestListRepoMachineTypesOptions_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListRepoMachineTypesOptions{Ref: &zeroValue}\n\tl.GetRef()\n\tl = &ListRepoMachineTypesOptions{}\n\tl.GetRef()\n\tl = nil\n\tl.GetRef()\n}\n\nfunc TestListRepositories_GetRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Repository{}\n\tl := &ListRepositories{Repositories: zeroValue}\n\tl.GetRepositories()\n\tl = &ListRepositories{}\n\tl.GetRepositories()\n\tl = nil\n\tl.GetRepositories()\n}\n\nfunc TestListRepositories_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tl := &ListRepositories{TotalCount: &zeroValue}\n\tl.GetTotalCount()\n\tl = &ListRepositories{}\n\tl.GetTotalCount()\n\tl = nil\n\tl.GetTotalCount()\n}\n\nfunc TestListRepositoryActivityOptions_GetActivityType(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListRepositoryActivityOptions{}\n\tl.GetActivityType()\n\tl = nil\n\tl.GetActivityType()\n}\n\nfunc TestListRepositoryActivityOptions_GetActor(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListRepositoryActivityOptions{}\n\tl.GetActor()\n\tl = nil\n\tl.GetActor()\n}\n\nfunc TestListRepositoryActivityOptions_GetAfter(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListRepositoryActivityOptions{}\n\tl.GetAfter()\n\tl = nil\n\tl.GetAfter()\n}\n\nfunc TestListRepositoryActivityOptions_GetBefore(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListRepositoryActivityOptions{}\n\tl.GetBefore()\n\tl = nil\n\tl.GetBefore()\n}\n\nfunc TestListRepositoryActivityOptions_GetDirection(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListRepositoryActivityOptions{}\n\tl.GetDirection()\n\tl = nil\n\tl.GetDirection()\n}\n\nfunc TestListRepositoryActivityOptions_GetPerPage(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListRepositoryActivityOptions{}\n\tl.GetPerPage()\n\tl = nil\n\tl.GetPerPage()\n}\n\nfunc TestListRepositoryActivityOptions_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListRepositoryActivityOptions{}\n\tl.GetRef()\n\tl = nil\n\tl.GetRef()\n}\n\nfunc TestListRepositoryActivityOptions_GetTimePeriod(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListRepositoryActivityOptions{}\n\tl.GetTimePeriod()\n\tl = nil\n\tl.GetTimePeriod()\n}\n\nfunc TestListRepositorySecurityAdvisoriesOptions_GetDirection(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListRepositorySecurityAdvisoriesOptions{}\n\tl.GetDirection()\n\tl = nil\n\tl.GetDirection()\n}\n\nfunc TestListRepositorySecurityAdvisoriesOptions_GetSort(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListRepositorySecurityAdvisoriesOptions{}\n\tl.GetSort()\n\tl = nil\n\tl.GetSort()\n}\n\nfunc TestListRepositorySecurityAdvisoriesOptions_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListRepositorySecurityAdvisoriesOptions{}\n\tl.GetState()\n\tl = nil\n\tl.GetState()\n}\n\nfunc TestListRunnersOptions_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListRunnersOptions{Name: &zeroValue}\n\tl.GetName()\n\tl = &ListRunnersOptions{}\n\tl.GetName()\n\tl = nil\n\tl.GetName()\n}\n\nfunc TestListSCIMProvisionedIdentitiesOptions_GetCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tl := &ListSCIMProvisionedIdentitiesOptions{Count: &zeroValue}\n\tl.GetCount()\n\tl = &ListSCIMProvisionedIdentitiesOptions{}\n\tl.GetCount()\n\tl = nil\n\tl.GetCount()\n}\n\nfunc TestListSCIMProvisionedIdentitiesOptions_GetFilter(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &ListSCIMProvisionedIdentitiesOptions{Filter: &zeroValue}\n\tl.GetFilter()\n\tl = &ListSCIMProvisionedIdentitiesOptions{}\n\tl.GetFilter()\n\tl = nil\n\tl.GetFilter()\n}\n\nfunc TestListSCIMProvisionedIdentitiesOptions_GetStartIndex(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tl := &ListSCIMProvisionedIdentitiesOptions{StartIndex: &zeroValue}\n\tl.GetStartIndex()\n\tl = &ListSCIMProvisionedIdentitiesOptions{}\n\tl.GetStartIndex()\n\tl = nil\n\tl.GetStartIndex()\n}\n\nfunc TestListUserIssuesOptions_GetDirection(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListUserIssuesOptions{}\n\tl.GetDirection()\n\tl = nil\n\tl.GetDirection()\n}\n\nfunc TestListUserIssuesOptions_GetFilter(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListUserIssuesOptions{}\n\tl.GetFilter()\n\tl = nil\n\tl.GetFilter()\n}\n\nfunc TestListUserIssuesOptions_GetLabels(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tl := &ListUserIssuesOptions{Labels: zeroValue}\n\tl.GetLabels()\n\tl = &ListUserIssuesOptions{}\n\tl.GetLabels()\n\tl = nil\n\tl.GetLabels()\n}\n\nfunc TestListUserIssuesOptions_GetSince(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListUserIssuesOptions{}\n\tl.GetSince()\n\tl = nil\n\tl.GetSince()\n}\n\nfunc TestListUserIssuesOptions_GetSort(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListUserIssuesOptions{}\n\tl.GetSort()\n\tl = nil\n\tl.GetSort()\n}\n\nfunc TestListUserIssuesOptions_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListUserIssuesOptions{}\n\tl.GetState()\n\tl = nil\n\tl.GetState()\n}\n\nfunc TestListWorkflowJobsOptions_GetFilter(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListWorkflowJobsOptions{}\n\tl.GetFilter()\n\tl = nil\n\tl.GetFilter()\n}\n\nfunc TestListWorkflowRunsOptions_GetActor(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListWorkflowRunsOptions{}\n\tl.GetActor()\n\tl = nil\n\tl.GetActor()\n}\n\nfunc TestListWorkflowRunsOptions_GetBranch(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListWorkflowRunsOptions{}\n\tl.GetBranch()\n\tl = nil\n\tl.GetBranch()\n}\n\nfunc TestListWorkflowRunsOptions_GetCheckSuiteID(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListWorkflowRunsOptions{}\n\tl.GetCheckSuiteID()\n\tl = nil\n\tl.GetCheckSuiteID()\n}\n\nfunc TestListWorkflowRunsOptions_GetCreated(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListWorkflowRunsOptions{}\n\tl.GetCreated()\n\tl = nil\n\tl.GetCreated()\n}\n\nfunc TestListWorkflowRunsOptions_GetEvent(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListWorkflowRunsOptions{}\n\tl.GetEvent()\n\tl = nil\n\tl.GetEvent()\n}\n\nfunc TestListWorkflowRunsOptions_GetExcludePullRequests(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListWorkflowRunsOptions{}\n\tl.GetExcludePullRequests()\n\tl = nil\n\tl.GetExcludePullRequests()\n}\n\nfunc TestListWorkflowRunsOptions_GetHeadSHA(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListWorkflowRunsOptions{}\n\tl.GetHeadSHA()\n\tl = nil\n\tl.GetHeadSHA()\n}\n\nfunc TestListWorkflowRunsOptions_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tl := &ListWorkflowRunsOptions{}\n\tl.GetStatus()\n\tl = nil\n\tl.GetStatus()\n}\n\nfunc TestLocation_GetEndColumn(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tl := &Location{EndColumn: &zeroValue}\n\tl.GetEndColumn()\n\tl = &Location{}\n\tl.GetEndColumn()\n\tl = nil\n\tl.GetEndColumn()\n}\n\nfunc TestLocation_GetEndLine(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tl := &Location{EndLine: &zeroValue}\n\tl.GetEndLine()\n\tl = &Location{}\n\tl.GetEndLine()\n\tl = nil\n\tl.GetEndLine()\n}\n\nfunc TestLocation_GetPath(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tl := &Location{Path: &zeroValue}\n\tl.GetPath()\n\tl = &Location{}\n\tl.GetPath()\n\tl = nil\n\tl.GetPath()\n}\n\nfunc TestLocation_GetStartColumn(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tl := &Location{StartColumn: &zeroValue}\n\tl.GetStartColumn()\n\tl = &Location{}\n\tl.GetStartColumn()\n\tl = nil\n\tl.GetStartColumn()\n}\n\nfunc TestLocation_GetStartLine(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tl := &Location{StartLine: &zeroValue}\n\tl.GetStartLine()\n\tl = &Location{}\n\tl.GetStartLine()\n\tl = nil\n\tl.GetStartLine()\n}\n\nfunc TestLockBranch_GetEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tl := &LockBranch{Enabled: &zeroValue}\n\tl.GetEnabled()\n\tl = &LockBranch{}\n\tl.GetEnabled()\n\tl = nil\n\tl.GetEnabled()\n}\n\nfunc TestLockIssueOptions_GetLockReason(tt *testing.T) {\n\ttt.Parallel()\n\tl := &LockIssueOptions{}\n\tl.GetLockReason()\n\tl = nil\n\tl.GetLockReason()\n}\n\nfunc TestMaintenanceOperationStatus_GetHostname(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MaintenanceOperationStatus{Hostname: &zeroValue}\n\tm.GetHostname()\n\tm = &MaintenanceOperationStatus{}\n\tm.GetHostname()\n\tm = nil\n\tm.GetHostname()\n}\n\nfunc TestMaintenanceOperationStatus_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MaintenanceOperationStatus{Message: &zeroValue}\n\tm.GetMessage()\n\tm = &MaintenanceOperationStatus{}\n\tm.GetMessage()\n\tm = nil\n\tm.GetMessage()\n}\n\nfunc TestMaintenanceOperationStatus_GetUUID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MaintenanceOperationStatus{UUID: &zeroValue}\n\tm.GetUUID()\n\tm = &MaintenanceOperationStatus{}\n\tm.GetUUID()\n\tm = nil\n\tm.GetUUID()\n}\n\nfunc TestMaintenanceOptions_GetEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MaintenanceOptions{}\n\tm.GetEnabled()\n\tm = nil\n\tm.GetEnabled()\n}\n\nfunc TestMaintenanceOptions_GetIPExceptionList(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tm := &MaintenanceOptions{IPExceptionList: zeroValue}\n\tm.GetIPExceptionList()\n\tm = &MaintenanceOptions{}\n\tm.GetIPExceptionList()\n\tm = nil\n\tm.GetIPExceptionList()\n}\n\nfunc TestMaintenanceOptions_GetMaintenanceModeMessage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MaintenanceOptions{MaintenanceModeMessage: &zeroValue}\n\tm.GetMaintenanceModeMessage()\n\tm = &MaintenanceOptions{}\n\tm.GetMaintenanceModeMessage()\n\tm = nil\n\tm.GetMaintenanceModeMessage()\n}\n\nfunc TestMaintenanceOptions_GetUUID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MaintenanceOptions{UUID: &zeroValue}\n\tm.GetUUID()\n\tm = &MaintenanceOptions{}\n\tm.GetUUID()\n\tm = nil\n\tm.GetUUID()\n}\n\nfunc TestMaintenanceOptions_GetWhen(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MaintenanceOptions{When: &zeroValue}\n\tm.GetWhen()\n\tm = &MaintenanceOptions{}\n\tm.GetWhen()\n\tm = nil\n\tm.GetWhen()\n}\n\nfunc TestMaintenanceStatus_GetCanUnsetMaintenance(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tm := &MaintenanceStatus{CanUnsetMaintenance: &zeroValue}\n\tm.GetCanUnsetMaintenance()\n\tm = &MaintenanceStatus{}\n\tm.GetCanUnsetMaintenance()\n\tm = nil\n\tm.GetCanUnsetMaintenance()\n}\n\nfunc TestMaintenanceStatus_GetConnectionServices(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*ConnectionServiceItem{}\n\tm := &MaintenanceStatus{ConnectionServices: zeroValue}\n\tm.GetConnectionServices()\n\tm = &MaintenanceStatus{}\n\tm.GetConnectionServices()\n\tm = nil\n\tm.GetConnectionServices()\n}\n\nfunc TestMaintenanceStatus_GetHostname(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MaintenanceStatus{Hostname: &zeroValue}\n\tm.GetHostname()\n\tm = &MaintenanceStatus{}\n\tm.GetHostname()\n\tm = nil\n\tm.GetHostname()\n}\n\nfunc TestMaintenanceStatus_GetIPExceptionList(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tm := &MaintenanceStatus{IPExceptionList: zeroValue}\n\tm.GetIPExceptionList()\n\tm = &MaintenanceStatus{}\n\tm.GetIPExceptionList()\n\tm = nil\n\tm.GetIPExceptionList()\n}\n\nfunc TestMaintenanceStatus_GetMaintenanceModeMessage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MaintenanceStatus{MaintenanceModeMessage: &zeroValue}\n\tm.GetMaintenanceModeMessage()\n\tm = &MaintenanceStatus{}\n\tm.GetMaintenanceModeMessage()\n\tm = nil\n\tm.GetMaintenanceModeMessage()\n}\n\nfunc TestMaintenanceStatus_GetScheduledTime(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tm := &MaintenanceStatus{ScheduledTime: &zeroValue}\n\tm.GetScheduledTime()\n\tm = &MaintenanceStatus{}\n\tm.GetScheduledTime()\n\tm = nil\n\tm.GetScheduledTime()\n}\n\nfunc TestMaintenanceStatus_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MaintenanceStatus{Status: &zeroValue}\n\tm.GetStatus()\n\tm = &MaintenanceStatus{}\n\tm.GetStatus()\n\tm = nil\n\tm.GetStatus()\n}\n\nfunc TestMaintenanceStatus_GetUUID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MaintenanceStatus{UUID: &zeroValue}\n\tm.GetUUID()\n\tm = &MaintenanceStatus{}\n\tm.GetUUID()\n\tm = nil\n\tm.GetUUID()\n}\n\nfunc TestMarkdownOptions_GetContext(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MarkdownOptions{}\n\tm.GetContext()\n\tm = nil\n\tm.GetContext()\n}\n\nfunc TestMarkdownOptions_GetMode(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MarkdownOptions{}\n\tm.GetMode()\n\tm = nil\n\tm.GetMode()\n}\n\nfunc TestMarketplacePendingChange_GetEffectiveDate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tm := &MarketplacePendingChange{EffectiveDate: &zeroValue}\n\tm.GetEffectiveDate()\n\tm = &MarketplacePendingChange{}\n\tm.GetEffectiveDate()\n\tm = nil\n\tm.GetEffectiveDate()\n}\n\nfunc TestMarketplacePendingChange_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tm := &MarketplacePendingChange{ID: &zeroValue}\n\tm.GetID()\n\tm = &MarketplacePendingChange{}\n\tm.GetID()\n\tm = nil\n\tm.GetID()\n}\n\nfunc TestMarketplacePendingChange_GetPlan(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MarketplacePendingChange{}\n\tm.GetPlan()\n\tm = nil\n\tm.GetPlan()\n}\n\nfunc TestMarketplacePendingChange_GetUnitCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tm := &MarketplacePendingChange{UnitCount: &zeroValue}\n\tm.GetUnitCount()\n\tm = &MarketplacePendingChange{}\n\tm.GetUnitCount()\n\tm = nil\n\tm.GetUnitCount()\n}\n\nfunc TestMarketplacePlan_GetAccountsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MarketplacePlan{AccountsURL: &zeroValue}\n\tm.GetAccountsURL()\n\tm = &MarketplacePlan{}\n\tm.GetAccountsURL()\n\tm = nil\n\tm.GetAccountsURL()\n}\n\nfunc TestMarketplacePlan_GetBullets(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue []string\n\tm := &MarketplacePlan{Bullets: &zeroValue}\n\tm.GetBullets()\n\tm = &MarketplacePlan{}\n\tm.GetBullets()\n\tm = nil\n\tm.GetBullets()\n}\n\nfunc TestMarketplacePlan_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MarketplacePlan{Description: &zeroValue}\n\tm.GetDescription()\n\tm = &MarketplacePlan{}\n\tm.GetDescription()\n\tm = nil\n\tm.GetDescription()\n}\n\nfunc TestMarketplacePlan_GetHasFreeTrial(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tm := &MarketplacePlan{HasFreeTrial: &zeroValue}\n\tm.GetHasFreeTrial()\n\tm = &MarketplacePlan{}\n\tm.GetHasFreeTrial()\n\tm = nil\n\tm.GetHasFreeTrial()\n}\n\nfunc TestMarketplacePlan_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tm := &MarketplacePlan{ID: &zeroValue}\n\tm.GetID()\n\tm = &MarketplacePlan{}\n\tm.GetID()\n\tm = nil\n\tm.GetID()\n}\n\nfunc TestMarketplacePlan_GetMonthlyPriceInCents(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tm := &MarketplacePlan{MonthlyPriceInCents: &zeroValue}\n\tm.GetMonthlyPriceInCents()\n\tm = &MarketplacePlan{}\n\tm.GetMonthlyPriceInCents()\n\tm = nil\n\tm.GetMonthlyPriceInCents()\n}\n\nfunc TestMarketplacePlan_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MarketplacePlan{Name: &zeroValue}\n\tm.GetName()\n\tm = &MarketplacePlan{}\n\tm.GetName()\n\tm = nil\n\tm.GetName()\n}\n\nfunc TestMarketplacePlan_GetNumber(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tm := &MarketplacePlan{Number: &zeroValue}\n\tm.GetNumber()\n\tm = &MarketplacePlan{}\n\tm.GetNumber()\n\tm = nil\n\tm.GetNumber()\n}\n\nfunc TestMarketplacePlan_GetPriceModel(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MarketplacePlan{PriceModel: &zeroValue}\n\tm.GetPriceModel()\n\tm = &MarketplacePlan{}\n\tm.GetPriceModel()\n\tm = nil\n\tm.GetPriceModel()\n}\n\nfunc TestMarketplacePlan_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MarketplacePlan{State: &zeroValue}\n\tm.GetState()\n\tm = &MarketplacePlan{}\n\tm.GetState()\n\tm = nil\n\tm.GetState()\n}\n\nfunc TestMarketplacePlan_GetUnitName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MarketplacePlan{UnitName: &zeroValue}\n\tm.GetUnitName()\n\tm = &MarketplacePlan{}\n\tm.GetUnitName()\n\tm = nil\n\tm.GetUnitName()\n}\n\nfunc TestMarketplacePlan_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MarketplacePlan{URL: &zeroValue}\n\tm.GetURL()\n\tm = &MarketplacePlan{}\n\tm.GetURL()\n\tm = nil\n\tm.GetURL()\n}\n\nfunc TestMarketplacePlan_GetYearlyPriceInCents(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tm := &MarketplacePlan{YearlyPriceInCents: &zeroValue}\n\tm.GetYearlyPriceInCents()\n\tm = &MarketplacePlan{}\n\tm.GetYearlyPriceInCents()\n\tm = nil\n\tm.GetYearlyPriceInCents()\n}\n\nfunc TestMarketplacePlanAccount_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tm := &MarketplacePlanAccount{ID: &zeroValue}\n\tm.GetID()\n\tm = &MarketplacePlanAccount{}\n\tm.GetID()\n\tm = nil\n\tm.GetID()\n}\n\nfunc TestMarketplacePlanAccount_GetLogin(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MarketplacePlanAccount{Login: &zeroValue}\n\tm.GetLogin()\n\tm = &MarketplacePlanAccount{}\n\tm.GetLogin()\n\tm = nil\n\tm.GetLogin()\n}\n\nfunc TestMarketplacePlanAccount_GetMarketplacePendingChange(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MarketplacePlanAccount{}\n\tm.GetMarketplacePendingChange()\n\tm = nil\n\tm.GetMarketplacePendingChange()\n}\n\nfunc TestMarketplacePlanAccount_GetMarketplacePurchase(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MarketplacePlanAccount{}\n\tm.GetMarketplacePurchase()\n\tm = nil\n\tm.GetMarketplacePurchase()\n}\n\nfunc TestMarketplacePlanAccount_GetOrganizationBillingEmail(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MarketplacePlanAccount{OrganizationBillingEmail: &zeroValue}\n\tm.GetOrganizationBillingEmail()\n\tm = &MarketplacePlanAccount{}\n\tm.GetOrganizationBillingEmail()\n\tm = nil\n\tm.GetOrganizationBillingEmail()\n}\n\nfunc TestMarketplacePlanAccount_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MarketplacePlanAccount{Type: &zeroValue}\n\tm.GetType()\n\tm = &MarketplacePlanAccount{}\n\tm.GetType()\n\tm = nil\n\tm.GetType()\n}\n\nfunc TestMarketplacePlanAccount_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MarketplacePlanAccount{URL: &zeroValue}\n\tm.GetURL()\n\tm = &MarketplacePlanAccount{}\n\tm.GetURL()\n\tm = nil\n\tm.GetURL()\n}\n\nfunc TestMarketplacePurchase_GetAccount(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MarketplacePurchase{}\n\tm.GetAccount()\n\tm = nil\n\tm.GetAccount()\n}\n\nfunc TestMarketplacePurchase_GetBillingCycle(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MarketplacePurchase{BillingCycle: &zeroValue}\n\tm.GetBillingCycle()\n\tm = &MarketplacePurchase{}\n\tm.GetBillingCycle()\n\tm = nil\n\tm.GetBillingCycle()\n}\n\nfunc TestMarketplacePurchase_GetFreeTrialEndsOn(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tm := &MarketplacePurchase{FreeTrialEndsOn: &zeroValue}\n\tm.GetFreeTrialEndsOn()\n\tm = &MarketplacePurchase{}\n\tm.GetFreeTrialEndsOn()\n\tm = nil\n\tm.GetFreeTrialEndsOn()\n}\n\nfunc TestMarketplacePurchase_GetNextBillingDate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tm := &MarketplacePurchase{NextBillingDate: &zeroValue}\n\tm.GetNextBillingDate()\n\tm = &MarketplacePurchase{}\n\tm.GetNextBillingDate()\n\tm = nil\n\tm.GetNextBillingDate()\n}\n\nfunc TestMarketplacePurchase_GetOnFreeTrial(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tm := &MarketplacePurchase{OnFreeTrial: &zeroValue}\n\tm.GetOnFreeTrial()\n\tm = &MarketplacePurchase{}\n\tm.GetOnFreeTrial()\n\tm = nil\n\tm.GetOnFreeTrial()\n}\n\nfunc TestMarketplacePurchase_GetPlan(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MarketplacePurchase{}\n\tm.GetPlan()\n\tm = nil\n\tm.GetPlan()\n}\n\nfunc TestMarketplacePurchase_GetUnitCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tm := &MarketplacePurchase{UnitCount: &zeroValue}\n\tm.GetUnitCount()\n\tm = &MarketplacePurchase{}\n\tm.GetUnitCount()\n\tm = nil\n\tm.GetUnitCount()\n}\n\nfunc TestMarketplacePurchase_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tm := &MarketplacePurchase{UpdatedAt: &zeroValue}\n\tm.GetUpdatedAt()\n\tm = &MarketplacePurchase{}\n\tm.GetUpdatedAt()\n\tm = nil\n\tm.GetUpdatedAt()\n}\n\nfunc TestMarketplacePurchaseAccount_GetEmail(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MarketplacePurchaseAccount{Email: &zeroValue}\n\tm.GetEmail()\n\tm = &MarketplacePurchaseAccount{}\n\tm.GetEmail()\n\tm = nil\n\tm.GetEmail()\n}\n\nfunc TestMarketplacePurchaseAccount_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tm := &MarketplacePurchaseAccount{ID: &zeroValue}\n\tm.GetID()\n\tm = &MarketplacePurchaseAccount{}\n\tm.GetID()\n\tm = nil\n\tm.GetID()\n}\n\nfunc TestMarketplacePurchaseAccount_GetLogin(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MarketplacePurchaseAccount{Login: &zeroValue}\n\tm.GetLogin()\n\tm = &MarketplacePurchaseAccount{}\n\tm.GetLogin()\n\tm = nil\n\tm.GetLogin()\n}\n\nfunc TestMarketplacePurchaseAccount_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MarketplacePurchaseAccount{NodeID: &zeroValue}\n\tm.GetNodeID()\n\tm = &MarketplacePurchaseAccount{}\n\tm.GetNodeID()\n\tm = nil\n\tm.GetNodeID()\n}\n\nfunc TestMarketplacePurchaseAccount_GetOrganizationBillingEmail(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MarketplacePurchaseAccount{OrganizationBillingEmail: &zeroValue}\n\tm.GetOrganizationBillingEmail()\n\tm = &MarketplacePurchaseAccount{}\n\tm.GetOrganizationBillingEmail()\n\tm = nil\n\tm.GetOrganizationBillingEmail()\n}\n\nfunc TestMarketplacePurchaseAccount_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MarketplacePurchaseAccount{Type: &zeroValue}\n\tm.GetType()\n\tm = &MarketplacePurchaseAccount{}\n\tm.GetType()\n\tm = nil\n\tm.GetType()\n}\n\nfunc TestMarketplacePurchaseAccount_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MarketplacePurchaseAccount{URL: &zeroValue}\n\tm.GetURL()\n\tm = &MarketplacePurchaseAccount{}\n\tm.GetURL()\n\tm = nil\n\tm.GetURL()\n}\n\nfunc TestMarketplacePurchaseEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MarketplacePurchaseEvent{Action: &zeroValue}\n\tm.GetAction()\n\tm = &MarketplacePurchaseEvent{}\n\tm.GetAction()\n\tm = nil\n\tm.GetAction()\n}\n\nfunc TestMarketplacePurchaseEvent_GetEffectiveDate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tm := &MarketplacePurchaseEvent{EffectiveDate: &zeroValue}\n\tm.GetEffectiveDate()\n\tm = &MarketplacePurchaseEvent{}\n\tm.GetEffectiveDate()\n\tm = nil\n\tm.GetEffectiveDate()\n}\n\nfunc TestMarketplacePurchaseEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MarketplacePurchaseEvent{}\n\tm.GetInstallation()\n\tm = nil\n\tm.GetInstallation()\n}\n\nfunc TestMarketplacePurchaseEvent_GetMarketplacePurchase(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MarketplacePurchaseEvent{}\n\tm.GetMarketplacePurchase()\n\tm = nil\n\tm.GetMarketplacePurchase()\n}\n\nfunc TestMarketplacePurchaseEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MarketplacePurchaseEvent{}\n\tm.GetOrg()\n\tm = nil\n\tm.GetOrg()\n}\n\nfunc TestMarketplacePurchaseEvent_GetPreviousMarketplacePurchase(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MarketplacePurchaseEvent{}\n\tm.GetPreviousMarketplacePurchase()\n\tm = nil\n\tm.GetPreviousMarketplacePurchase()\n}\n\nfunc TestMarketplacePurchaseEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MarketplacePurchaseEvent{}\n\tm.GetSender()\n\tm = nil\n\tm.GetSender()\n}\n\nfunc TestMatch_GetIndices(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []int{}\n\tm := &Match{Indices: zeroValue}\n\tm.GetIndices()\n\tm = &Match{}\n\tm.GetIndices()\n\tm = nil\n\tm.GetIndices()\n}\n\nfunc TestMatch_GetText(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &Match{Text: &zeroValue}\n\tm.GetText()\n\tm = &Match{}\n\tm.GetText()\n\tm = nil\n\tm.GetText()\n}\n\nfunc TestMaxFilePathLengthBranchRule_GetParameters(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MaxFilePathLengthBranchRule{}\n\tm.GetParameters()\n\tm = nil\n\tm.GetParameters()\n}\n\nfunc TestMaxFilePathLengthRuleParameters_GetMaxFilePathLength(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MaxFilePathLengthRuleParameters{}\n\tm.GetMaxFilePathLength()\n\tm = nil\n\tm.GetMaxFilePathLength()\n}\n\nfunc TestMaxFileSizeBranchRule_GetParameters(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MaxFileSizeBranchRule{}\n\tm.GetParameters()\n\tm = nil\n\tm.GetParameters()\n}\n\nfunc TestMaxFileSizeRuleParameters_GetMaxFileSize(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MaxFileSizeRuleParameters{}\n\tm.GetMaxFileSize()\n\tm = nil\n\tm.GetMaxFileSize()\n}\n\nfunc TestMemberChanges_GetPermission(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MemberChanges{}\n\tm.GetPermission()\n\tm = nil\n\tm.GetPermission()\n}\n\nfunc TestMemberChanges_GetRoleName(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MemberChanges{}\n\tm.GetRoleName()\n\tm = nil\n\tm.GetRoleName()\n}\n\nfunc TestMemberChangesPermission_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MemberChangesPermission{From: &zeroValue}\n\tm.GetFrom()\n\tm = &MemberChangesPermission{}\n\tm.GetFrom()\n\tm = nil\n\tm.GetFrom()\n}\n\nfunc TestMemberChangesPermission_GetTo(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MemberChangesPermission{To: &zeroValue}\n\tm.GetTo()\n\tm = &MemberChangesPermission{}\n\tm.GetTo()\n\tm = nil\n\tm.GetTo()\n}\n\nfunc TestMemberChangesRoleName_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MemberChangesRoleName{From: &zeroValue}\n\tm.GetFrom()\n\tm = &MemberChangesRoleName{}\n\tm.GetFrom()\n\tm = nil\n\tm.GetFrom()\n}\n\nfunc TestMemberChangesRoleName_GetTo(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MemberChangesRoleName{To: &zeroValue}\n\tm.GetTo()\n\tm = &MemberChangesRoleName{}\n\tm.GetTo()\n\tm = nil\n\tm.GetTo()\n}\n\nfunc TestMemberEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MemberEvent{Action: &zeroValue}\n\tm.GetAction()\n\tm = &MemberEvent{}\n\tm.GetAction()\n\tm = nil\n\tm.GetAction()\n}\n\nfunc TestMemberEvent_GetChanges(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MemberEvent{}\n\tm.GetChanges()\n\tm = nil\n\tm.GetChanges()\n}\n\nfunc TestMemberEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MemberEvent{}\n\tm.GetInstallation()\n\tm = nil\n\tm.GetInstallation()\n}\n\nfunc TestMemberEvent_GetMember(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MemberEvent{}\n\tm.GetMember()\n\tm = nil\n\tm.GetMember()\n}\n\nfunc TestMemberEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MemberEvent{}\n\tm.GetOrg()\n\tm = nil\n\tm.GetOrg()\n}\n\nfunc TestMemberEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MemberEvent{}\n\tm.GetRepo()\n\tm = nil\n\tm.GetRepo()\n}\n\nfunc TestMemberEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MemberEvent{}\n\tm.GetSender()\n\tm = nil\n\tm.GetSender()\n}\n\nfunc TestMembership_GetOrganization(tt *testing.T) {\n\ttt.Parallel()\n\tm := &Membership{}\n\tm.GetOrganization()\n\tm = nil\n\tm.GetOrganization()\n}\n\nfunc TestMembership_GetOrganizationURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &Membership{OrganizationURL: &zeroValue}\n\tm.GetOrganizationURL()\n\tm = &Membership{}\n\tm.GetOrganizationURL()\n\tm = nil\n\tm.GetOrganizationURL()\n}\n\nfunc TestMembership_GetRole(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &Membership{Role: &zeroValue}\n\tm.GetRole()\n\tm = &Membership{}\n\tm.GetRole()\n\tm = nil\n\tm.GetRole()\n}\n\nfunc TestMembership_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &Membership{State: &zeroValue}\n\tm.GetState()\n\tm = &Membership{}\n\tm.GetState()\n\tm = nil\n\tm.GetState()\n}\n\nfunc TestMembership_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &Membership{URL: &zeroValue}\n\tm.GetURL()\n\tm = &Membership{}\n\tm.GetURL()\n\tm = nil\n\tm.GetURL()\n}\n\nfunc TestMembership_GetUser(tt *testing.T) {\n\ttt.Parallel()\n\tm := &Membership{}\n\tm.GetUser()\n\tm = nil\n\tm.GetUser()\n}\n\nfunc TestMembershipEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MembershipEvent{Action: &zeroValue}\n\tm.GetAction()\n\tm = &MembershipEvent{}\n\tm.GetAction()\n\tm = nil\n\tm.GetAction()\n}\n\nfunc TestMembershipEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MembershipEvent{}\n\tm.GetInstallation()\n\tm = nil\n\tm.GetInstallation()\n}\n\nfunc TestMembershipEvent_GetMember(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MembershipEvent{}\n\tm.GetMember()\n\tm = nil\n\tm.GetMember()\n}\n\nfunc TestMembershipEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MembershipEvent{}\n\tm.GetOrg()\n\tm = nil\n\tm.GetOrg()\n}\n\nfunc TestMembershipEvent_GetScope(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MembershipEvent{Scope: &zeroValue}\n\tm.GetScope()\n\tm = &MembershipEvent{}\n\tm.GetScope()\n\tm = nil\n\tm.GetScope()\n}\n\nfunc TestMembershipEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MembershipEvent{}\n\tm.GetSender()\n\tm = nil\n\tm.GetSender()\n}\n\nfunc TestMembershipEvent_GetTeam(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MembershipEvent{}\n\tm.GetTeam()\n\tm = nil\n\tm.GetTeam()\n}\n\nfunc TestMergeGroup_GetBaseRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MergeGroup{BaseRef: &zeroValue}\n\tm.GetBaseRef()\n\tm = &MergeGroup{}\n\tm.GetBaseRef()\n\tm = nil\n\tm.GetBaseRef()\n}\n\nfunc TestMergeGroup_GetBaseSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MergeGroup{BaseSHA: &zeroValue}\n\tm.GetBaseSHA()\n\tm = &MergeGroup{}\n\tm.GetBaseSHA()\n\tm = nil\n\tm.GetBaseSHA()\n}\n\nfunc TestMergeGroup_GetHeadCommit(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MergeGroup{}\n\tm.GetHeadCommit()\n\tm = nil\n\tm.GetHeadCommit()\n}\n\nfunc TestMergeGroup_GetHeadRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MergeGroup{HeadRef: &zeroValue}\n\tm.GetHeadRef()\n\tm = &MergeGroup{}\n\tm.GetHeadRef()\n\tm = nil\n\tm.GetHeadRef()\n}\n\nfunc TestMergeGroup_GetHeadSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MergeGroup{HeadSHA: &zeroValue}\n\tm.GetHeadSHA()\n\tm = &MergeGroup{}\n\tm.GetHeadSHA()\n\tm = nil\n\tm.GetHeadSHA()\n}\n\nfunc TestMergeGroupEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MergeGroupEvent{Action: &zeroValue}\n\tm.GetAction()\n\tm = &MergeGroupEvent{}\n\tm.GetAction()\n\tm = nil\n\tm.GetAction()\n}\n\nfunc TestMergeGroupEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MergeGroupEvent{}\n\tm.GetInstallation()\n\tm = nil\n\tm.GetInstallation()\n}\n\nfunc TestMergeGroupEvent_GetMergeGroup(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MergeGroupEvent{}\n\tm.GetMergeGroup()\n\tm = nil\n\tm.GetMergeGroup()\n}\n\nfunc TestMergeGroupEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MergeGroupEvent{}\n\tm.GetOrg()\n\tm = nil\n\tm.GetOrg()\n}\n\nfunc TestMergeGroupEvent_GetReason(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MergeGroupEvent{Reason: &zeroValue}\n\tm.GetReason()\n\tm = &MergeGroupEvent{}\n\tm.GetReason()\n\tm = nil\n\tm.GetReason()\n}\n\nfunc TestMergeGroupEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MergeGroupEvent{}\n\tm.GetRepo()\n\tm = nil\n\tm.GetRepo()\n}\n\nfunc TestMergeGroupEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MergeGroupEvent{}\n\tm.GetSender()\n\tm = nil\n\tm.GetSender()\n}\n\nfunc TestMergeQueueBranchRule_GetParameters(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MergeQueueBranchRule{}\n\tm.GetParameters()\n\tm = nil\n\tm.GetParameters()\n}\n\nfunc TestMergeQueueRuleParameters_GetCheckResponseTimeoutMinutes(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MergeQueueRuleParameters{}\n\tm.GetCheckResponseTimeoutMinutes()\n\tm = nil\n\tm.GetCheckResponseTimeoutMinutes()\n}\n\nfunc TestMergeQueueRuleParameters_GetGroupingStrategy(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MergeQueueRuleParameters{}\n\tm.GetGroupingStrategy()\n\tm = nil\n\tm.GetGroupingStrategy()\n}\n\nfunc TestMergeQueueRuleParameters_GetMaxEntriesToBuild(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MergeQueueRuleParameters{}\n\tm.GetMaxEntriesToBuild()\n\tm = nil\n\tm.GetMaxEntriesToBuild()\n}\n\nfunc TestMergeQueueRuleParameters_GetMaxEntriesToMerge(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MergeQueueRuleParameters{}\n\tm.GetMaxEntriesToMerge()\n\tm = nil\n\tm.GetMaxEntriesToMerge()\n}\n\nfunc TestMergeQueueRuleParameters_GetMergeMethod(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MergeQueueRuleParameters{}\n\tm.GetMergeMethod()\n\tm = nil\n\tm.GetMergeMethod()\n}\n\nfunc TestMergeQueueRuleParameters_GetMinEntriesToMerge(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MergeQueueRuleParameters{}\n\tm.GetMinEntriesToMerge()\n\tm = nil\n\tm.GetMinEntriesToMerge()\n}\n\nfunc TestMergeQueueRuleParameters_GetMinEntriesToMergeWaitMinutes(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MergeQueueRuleParameters{}\n\tm.GetMinEntriesToMergeWaitMinutes()\n\tm = nil\n\tm.GetMinEntriesToMergeWaitMinutes()\n}\n\nfunc TestMessage_GetText(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &Message{Text: &zeroValue}\n\tm.GetText()\n\tm = &Message{}\n\tm.GetText()\n\tm = nil\n\tm.GetText()\n}\n\nfunc TestMetaEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MetaEvent{Action: &zeroValue}\n\tm.GetAction()\n\tm = &MetaEvent{}\n\tm.GetAction()\n\tm = nil\n\tm.GetAction()\n}\n\nfunc TestMetaEvent_GetHook(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MetaEvent{}\n\tm.GetHook()\n\tm = nil\n\tm.GetHook()\n}\n\nfunc TestMetaEvent_GetHookID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tm := &MetaEvent{HookID: &zeroValue}\n\tm.GetHookID()\n\tm = &MetaEvent{}\n\tm.GetHookID()\n\tm = nil\n\tm.GetHookID()\n}\n\nfunc TestMetaEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MetaEvent{}\n\tm.GetInstallation()\n\tm = nil\n\tm.GetInstallation()\n}\n\nfunc TestMetaEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MetaEvent{}\n\tm.GetOrg()\n\tm = nil\n\tm.GetOrg()\n}\n\nfunc TestMetaEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MetaEvent{}\n\tm.GetRepo()\n\tm = nil\n\tm.GetRepo()\n}\n\nfunc TestMetaEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MetaEvent{}\n\tm.GetSender()\n\tm = nil\n\tm.GetSender()\n}\n\nfunc TestMetric_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &Metric{HTMLURL: &zeroValue}\n\tm.GetHTMLURL()\n\tm = &Metric{}\n\tm.GetHTMLURL()\n\tm = nil\n\tm.GetHTMLURL()\n}\n\nfunc TestMetric_GetKey(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &Metric{Key: &zeroValue}\n\tm.GetKey()\n\tm = &Metric{}\n\tm.GetKey()\n\tm = nil\n\tm.GetKey()\n}\n\nfunc TestMetric_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &Metric{Name: &zeroValue}\n\tm.GetName()\n\tm = &Metric{}\n\tm.GetName()\n\tm = nil\n\tm.GetName()\n}\n\nfunc TestMetric_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &Metric{NodeID: &zeroValue}\n\tm.GetNodeID()\n\tm = &Metric{}\n\tm.GetNodeID()\n\tm = nil\n\tm.GetNodeID()\n}\n\nfunc TestMetric_GetSPDXID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &Metric{SPDXID: &zeroValue}\n\tm.GetSPDXID()\n\tm = &Metric{}\n\tm.GetSPDXID()\n\tm = nil\n\tm.GetSPDXID()\n}\n\nfunc TestMetric_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &Metric{URL: &zeroValue}\n\tm.GetURL()\n\tm = &Metric{}\n\tm.GetURL()\n\tm = nil\n\tm.GetURL()\n}\n\nfunc TestMigration_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &Migration{CreatedAt: &zeroValue}\n\tm.GetCreatedAt()\n\tm = &Migration{}\n\tm.GetCreatedAt()\n\tm = nil\n\tm.GetCreatedAt()\n}\n\nfunc TestMigration_GetExcludeAttachments(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tm := &Migration{ExcludeAttachments: &zeroValue}\n\tm.GetExcludeAttachments()\n\tm = &Migration{}\n\tm.GetExcludeAttachments()\n\tm = nil\n\tm.GetExcludeAttachments()\n}\n\nfunc TestMigration_GetGUID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &Migration{GUID: &zeroValue}\n\tm.GetGUID()\n\tm = &Migration{}\n\tm.GetGUID()\n\tm = nil\n\tm.GetGUID()\n}\n\nfunc TestMigration_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tm := &Migration{ID: &zeroValue}\n\tm.GetID()\n\tm = &Migration{}\n\tm.GetID()\n\tm = nil\n\tm.GetID()\n}\n\nfunc TestMigration_GetLockRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tm := &Migration{LockRepositories: &zeroValue}\n\tm.GetLockRepositories()\n\tm = &Migration{}\n\tm.GetLockRepositories()\n\tm = nil\n\tm.GetLockRepositories()\n}\n\nfunc TestMigration_GetRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Repository{}\n\tm := &Migration{Repositories: zeroValue}\n\tm.GetRepositories()\n\tm = &Migration{}\n\tm.GetRepositories()\n\tm = nil\n\tm.GetRepositories()\n}\n\nfunc TestMigration_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &Migration{State: &zeroValue}\n\tm.GetState()\n\tm = &Migration{}\n\tm.GetState()\n\tm = nil\n\tm.GetState()\n}\n\nfunc TestMigration_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &Migration{UpdatedAt: &zeroValue}\n\tm.GetUpdatedAt()\n\tm = &Migration{}\n\tm.GetUpdatedAt()\n\tm = nil\n\tm.GetUpdatedAt()\n}\n\nfunc TestMigration_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &Migration{URL: &zeroValue}\n\tm.GetURL()\n\tm = &Migration{}\n\tm.GetURL()\n\tm = nil\n\tm.GetURL()\n}\n\nfunc TestMigrationOptions_GetExclude(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tm := &MigrationOptions{Exclude: zeroValue}\n\tm.GetExclude()\n\tm = &MigrationOptions{}\n\tm.GetExclude()\n\tm = nil\n\tm.GetExclude()\n}\n\nfunc TestMigrationOptions_GetExcludeAttachments(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MigrationOptions{}\n\tm.GetExcludeAttachments()\n\tm = nil\n\tm.GetExcludeAttachments()\n}\n\nfunc TestMigrationOptions_GetExcludeReleases(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MigrationOptions{}\n\tm.GetExcludeReleases()\n\tm = nil\n\tm.GetExcludeReleases()\n}\n\nfunc TestMigrationOptions_GetLockRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MigrationOptions{}\n\tm.GetLockRepositories()\n\tm = nil\n\tm.GetLockRepositories()\n}\n\nfunc TestMilestone_GetClosedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tm := &Milestone{ClosedAt: &zeroValue}\n\tm.GetClosedAt()\n\tm = &Milestone{}\n\tm.GetClosedAt()\n\tm = nil\n\tm.GetClosedAt()\n}\n\nfunc TestMilestone_GetClosedIssues(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tm := &Milestone{ClosedIssues: &zeroValue}\n\tm.GetClosedIssues()\n\tm = &Milestone{}\n\tm.GetClosedIssues()\n\tm = nil\n\tm.GetClosedIssues()\n}\n\nfunc TestMilestone_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tm := &Milestone{CreatedAt: &zeroValue}\n\tm.GetCreatedAt()\n\tm = &Milestone{}\n\tm.GetCreatedAt()\n\tm = nil\n\tm.GetCreatedAt()\n}\n\nfunc TestMilestone_GetCreator(tt *testing.T) {\n\ttt.Parallel()\n\tm := &Milestone{}\n\tm.GetCreator()\n\tm = nil\n\tm.GetCreator()\n}\n\nfunc TestMilestone_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &Milestone{Description: &zeroValue}\n\tm.GetDescription()\n\tm = &Milestone{}\n\tm.GetDescription()\n\tm = nil\n\tm.GetDescription()\n}\n\nfunc TestMilestone_GetDueOn(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tm := &Milestone{DueOn: &zeroValue}\n\tm.GetDueOn()\n\tm = &Milestone{}\n\tm.GetDueOn()\n\tm = nil\n\tm.GetDueOn()\n}\n\nfunc TestMilestone_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &Milestone{HTMLURL: &zeroValue}\n\tm.GetHTMLURL()\n\tm = &Milestone{}\n\tm.GetHTMLURL()\n\tm = nil\n\tm.GetHTMLURL()\n}\n\nfunc TestMilestone_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tm := &Milestone{ID: &zeroValue}\n\tm.GetID()\n\tm = &Milestone{}\n\tm.GetID()\n\tm = nil\n\tm.GetID()\n}\n\nfunc TestMilestone_GetLabelsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &Milestone{LabelsURL: &zeroValue}\n\tm.GetLabelsURL()\n\tm = &Milestone{}\n\tm.GetLabelsURL()\n\tm = nil\n\tm.GetLabelsURL()\n}\n\nfunc TestMilestone_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &Milestone{NodeID: &zeroValue}\n\tm.GetNodeID()\n\tm = &Milestone{}\n\tm.GetNodeID()\n\tm = nil\n\tm.GetNodeID()\n}\n\nfunc TestMilestone_GetNumber(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tm := &Milestone{Number: &zeroValue}\n\tm.GetNumber()\n\tm = &Milestone{}\n\tm.GetNumber()\n\tm = nil\n\tm.GetNumber()\n}\n\nfunc TestMilestone_GetOpenIssues(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tm := &Milestone{OpenIssues: &zeroValue}\n\tm.GetOpenIssues()\n\tm = &Milestone{}\n\tm.GetOpenIssues()\n\tm = nil\n\tm.GetOpenIssues()\n}\n\nfunc TestMilestone_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &Milestone{State: &zeroValue}\n\tm.GetState()\n\tm = &Milestone{}\n\tm.GetState()\n\tm = nil\n\tm.GetState()\n}\n\nfunc TestMilestone_GetTitle(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &Milestone{Title: &zeroValue}\n\tm.GetTitle()\n\tm = &Milestone{}\n\tm.GetTitle()\n\tm = nil\n\tm.GetTitle()\n}\n\nfunc TestMilestone_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tm := &Milestone{UpdatedAt: &zeroValue}\n\tm.GetUpdatedAt()\n\tm = &Milestone{}\n\tm.GetUpdatedAt()\n\tm = nil\n\tm.GetUpdatedAt()\n}\n\nfunc TestMilestone_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &Milestone{URL: &zeroValue}\n\tm.GetURL()\n\tm = &Milestone{}\n\tm.GetURL()\n\tm = nil\n\tm.GetURL()\n}\n\nfunc TestMilestoneEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MilestoneEvent{Action: &zeroValue}\n\tm.GetAction()\n\tm = &MilestoneEvent{}\n\tm.GetAction()\n\tm = nil\n\tm.GetAction()\n}\n\nfunc TestMilestoneEvent_GetChanges(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MilestoneEvent{}\n\tm.GetChanges()\n\tm = nil\n\tm.GetChanges()\n}\n\nfunc TestMilestoneEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MilestoneEvent{}\n\tm.GetInstallation()\n\tm = nil\n\tm.GetInstallation()\n}\n\nfunc TestMilestoneEvent_GetMilestone(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MilestoneEvent{}\n\tm.GetMilestone()\n\tm = nil\n\tm.GetMilestone()\n}\n\nfunc TestMilestoneEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MilestoneEvent{}\n\tm.GetOrg()\n\tm = nil\n\tm.GetOrg()\n}\n\nfunc TestMilestoneEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MilestoneEvent{}\n\tm.GetRepo()\n\tm = nil\n\tm.GetRepo()\n}\n\nfunc TestMilestoneEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MilestoneEvent{}\n\tm.GetSender()\n\tm = nil\n\tm.GetSender()\n}\n\nfunc TestMilestoneListOptions_GetDirection(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MilestoneListOptions{}\n\tm.GetDirection()\n\tm = nil\n\tm.GetDirection()\n}\n\nfunc TestMilestoneListOptions_GetSort(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MilestoneListOptions{}\n\tm.GetSort()\n\tm = nil\n\tm.GetSort()\n}\n\nfunc TestMilestoneListOptions_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MilestoneListOptions{}\n\tm.GetState()\n\tm = nil\n\tm.GetState()\n}\n\nfunc TestMilestoneStats_GetClosedMilestones(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tm := &MilestoneStats{ClosedMilestones: &zeroValue}\n\tm.GetClosedMilestones()\n\tm = &MilestoneStats{}\n\tm.GetClosedMilestones()\n\tm = nil\n\tm.GetClosedMilestones()\n}\n\nfunc TestMilestoneStats_GetOpenMilestones(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tm := &MilestoneStats{OpenMilestones: &zeroValue}\n\tm.GetOpenMilestones()\n\tm = &MilestoneStats{}\n\tm.GetOpenMilestones()\n\tm = nil\n\tm.GetOpenMilestones()\n}\n\nfunc TestMilestoneStats_GetTotalMilestones(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tm := &MilestoneStats{TotalMilestones: &zeroValue}\n\tm.GetTotalMilestones()\n\tm = &MilestoneStats{}\n\tm.GetTotalMilestones()\n\tm = nil\n\tm.GetTotalMilestones()\n}\n\nfunc TestMostRecentInstance_GetAnalysisKey(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MostRecentInstance{AnalysisKey: &zeroValue}\n\tm.GetAnalysisKey()\n\tm = &MostRecentInstance{}\n\tm.GetAnalysisKey()\n\tm = nil\n\tm.GetAnalysisKey()\n}\n\nfunc TestMostRecentInstance_GetCategory(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MostRecentInstance{Category: &zeroValue}\n\tm.GetCategory()\n\tm = &MostRecentInstance{}\n\tm.GetCategory()\n\tm = nil\n\tm.GetCategory()\n}\n\nfunc TestMostRecentInstance_GetClassifications(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tm := &MostRecentInstance{Classifications: zeroValue}\n\tm.GetClassifications()\n\tm = &MostRecentInstance{}\n\tm.GetClassifications()\n\tm = nil\n\tm.GetClassifications()\n}\n\nfunc TestMostRecentInstance_GetCommitSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MostRecentInstance{CommitSHA: &zeroValue}\n\tm.GetCommitSHA()\n\tm = &MostRecentInstance{}\n\tm.GetCommitSHA()\n\tm = nil\n\tm.GetCommitSHA()\n}\n\nfunc TestMostRecentInstance_GetEnvironment(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MostRecentInstance{Environment: &zeroValue}\n\tm.GetEnvironment()\n\tm = &MostRecentInstance{}\n\tm.GetEnvironment()\n\tm = nil\n\tm.GetEnvironment()\n}\n\nfunc TestMostRecentInstance_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MostRecentInstance{HTMLURL: &zeroValue}\n\tm.GetHTMLURL()\n\tm = &MostRecentInstance{}\n\tm.GetHTMLURL()\n\tm = nil\n\tm.GetHTMLURL()\n}\n\nfunc TestMostRecentInstance_GetLocation(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MostRecentInstance{}\n\tm.GetLocation()\n\tm = nil\n\tm.GetLocation()\n}\n\nfunc TestMostRecentInstance_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\tm := &MostRecentInstance{}\n\tm.GetMessage()\n\tm = nil\n\tm.GetMessage()\n}\n\nfunc TestMostRecentInstance_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MostRecentInstance{Ref: &zeroValue}\n\tm.GetRef()\n\tm = &MostRecentInstance{}\n\tm.GetRef()\n\tm = nil\n\tm.GetRef()\n}\n\nfunc TestMostRecentInstance_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tm := &MostRecentInstance{State: &zeroValue}\n\tm.GetState()\n\tm = &MostRecentInstance{}\n\tm.GetState()\n\tm = nil\n\tm.GetState()\n}\n\nfunc TestNetworkConfiguration_GetComputeService(tt *testing.T) {\n\ttt.Parallel()\n\tn := &NetworkConfiguration{}\n\tn.GetComputeService()\n\tn = nil\n\tn.GetComputeService()\n}\n\nfunc TestNetworkConfiguration_GetCreatedOn(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tn := &NetworkConfiguration{CreatedOn: &zeroValue}\n\tn.GetCreatedOn()\n\tn = &NetworkConfiguration{}\n\tn.GetCreatedOn()\n\tn = nil\n\tn.GetCreatedOn()\n}\n\nfunc TestNetworkConfiguration_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &NetworkConfiguration{ID: &zeroValue}\n\tn.GetID()\n\tn = &NetworkConfiguration{}\n\tn.GetID()\n\tn = nil\n\tn.GetID()\n}\n\nfunc TestNetworkConfiguration_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &NetworkConfiguration{Name: &zeroValue}\n\tn.GetName()\n\tn = &NetworkConfiguration{}\n\tn.GetName()\n\tn = nil\n\tn.GetName()\n}\n\nfunc TestNetworkConfiguration_GetNetworkSettingsIDs(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tn := &NetworkConfiguration{NetworkSettingsIDs: zeroValue}\n\tn.GetNetworkSettingsIDs()\n\tn = &NetworkConfiguration{}\n\tn.GetNetworkSettingsIDs()\n\tn = nil\n\tn.GetNetworkSettingsIDs()\n}\n\nfunc TestNetworkConfigurationRequest_GetComputeService(tt *testing.T) {\n\ttt.Parallel()\n\tn := &NetworkConfigurationRequest{}\n\tn.GetComputeService()\n\tn = nil\n\tn.GetComputeService()\n}\n\nfunc TestNetworkConfigurationRequest_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &NetworkConfigurationRequest{Name: &zeroValue}\n\tn.GetName()\n\tn = &NetworkConfigurationRequest{}\n\tn.GetName()\n\tn = nil\n\tn.GetName()\n}\n\nfunc TestNetworkConfigurationRequest_GetNetworkSettingsIDs(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tn := &NetworkConfigurationRequest{NetworkSettingsIDs: zeroValue}\n\tn.GetNetworkSettingsIDs()\n\tn = &NetworkConfigurationRequest{}\n\tn.GetNetworkSettingsIDs()\n\tn = nil\n\tn.GetNetworkSettingsIDs()\n}\n\nfunc TestNetworkConfigurations_GetNetworkConfigurations(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*NetworkConfiguration{}\n\tn := &NetworkConfigurations{NetworkConfigurations: zeroValue}\n\tn.GetNetworkConfigurations()\n\tn = &NetworkConfigurations{}\n\tn.GetNetworkConfigurations()\n\tn = nil\n\tn.GetNetworkConfigurations()\n}\n\nfunc TestNetworkConfigurations_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tn := &NetworkConfigurations{TotalCount: &zeroValue}\n\tn.GetTotalCount()\n\tn = &NetworkConfigurations{}\n\tn.GetTotalCount()\n\tn = nil\n\tn.GetTotalCount()\n}\n\nfunc TestNetworkSettingsResource_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &NetworkSettingsResource{ID: &zeroValue}\n\tn.GetID()\n\tn = &NetworkSettingsResource{}\n\tn.GetID()\n\tn = nil\n\tn.GetID()\n}\n\nfunc TestNetworkSettingsResource_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &NetworkSettingsResource{Name: &zeroValue}\n\tn.GetName()\n\tn = &NetworkSettingsResource{}\n\tn.GetName()\n\tn = nil\n\tn.GetName()\n}\n\nfunc TestNetworkSettingsResource_GetNetworkConfigurationID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &NetworkSettingsResource{NetworkConfigurationID: &zeroValue}\n\tn.GetNetworkConfigurationID()\n\tn = &NetworkSettingsResource{}\n\tn.GetNetworkConfigurationID()\n\tn = nil\n\tn.GetNetworkConfigurationID()\n}\n\nfunc TestNetworkSettingsResource_GetRegion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &NetworkSettingsResource{Region: &zeroValue}\n\tn.GetRegion()\n\tn = &NetworkSettingsResource{}\n\tn.GetRegion()\n\tn = nil\n\tn.GetRegion()\n}\n\nfunc TestNetworkSettingsResource_GetSubnetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &NetworkSettingsResource{SubnetID: &zeroValue}\n\tn.GetSubnetID()\n\tn = &NetworkSettingsResource{}\n\tn.GetSubnetID()\n\tn = nil\n\tn.GetSubnetID()\n}\n\nfunc TestNewPullRequest_GetBase(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &NewPullRequest{Base: &zeroValue}\n\tn.GetBase()\n\tn = &NewPullRequest{}\n\tn.GetBase()\n\tn = nil\n\tn.GetBase()\n}\n\nfunc TestNewPullRequest_GetBody(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &NewPullRequest{Body: &zeroValue}\n\tn.GetBody()\n\tn = &NewPullRequest{}\n\tn.GetBody()\n\tn = nil\n\tn.GetBody()\n}\n\nfunc TestNewPullRequest_GetDraft(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tn := &NewPullRequest{Draft: &zeroValue}\n\tn.GetDraft()\n\tn = &NewPullRequest{}\n\tn.GetDraft()\n\tn = nil\n\tn.GetDraft()\n}\n\nfunc TestNewPullRequest_GetHead(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &NewPullRequest{Head: &zeroValue}\n\tn.GetHead()\n\tn = &NewPullRequest{}\n\tn.GetHead()\n\tn = nil\n\tn.GetHead()\n}\n\nfunc TestNewPullRequest_GetHeadRepo(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &NewPullRequest{HeadRepo: &zeroValue}\n\tn.GetHeadRepo()\n\tn = &NewPullRequest{}\n\tn.GetHeadRepo()\n\tn = nil\n\tn.GetHeadRepo()\n}\n\nfunc TestNewPullRequest_GetIssue(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tn := &NewPullRequest{Issue: &zeroValue}\n\tn.GetIssue()\n\tn = &NewPullRequest{}\n\tn.GetIssue()\n\tn = nil\n\tn.GetIssue()\n}\n\nfunc TestNewPullRequest_GetMaintainerCanModify(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tn := &NewPullRequest{MaintainerCanModify: &zeroValue}\n\tn.GetMaintainerCanModify()\n\tn = &NewPullRequest{}\n\tn.GetMaintainerCanModify()\n\tn = nil\n\tn.GetMaintainerCanModify()\n}\n\nfunc TestNewPullRequest_GetTitle(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &NewPullRequest{Title: &zeroValue}\n\tn.GetTitle()\n\tn = &NewPullRequest{}\n\tn.GetTitle()\n\tn = nil\n\tn.GetTitle()\n}\n\nfunc TestNewTeam_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &NewTeam{Description: &zeroValue}\n\tn.GetDescription()\n\tn = &NewTeam{}\n\tn.GetDescription()\n\tn = nil\n\tn.GetDescription()\n}\n\nfunc TestNewTeam_GetLDAPDN(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &NewTeam{LDAPDN: &zeroValue}\n\tn.GetLDAPDN()\n\tn = &NewTeam{}\n\tn.GetLDAPDN()\n\tn = nil\n\tn.GetLDAPDN()\n}\n\nfunc TestNewTeam_GetMaintainers(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tn := &NewTeam{Maintainers: zeroValue}\n\tn.GetMaintainers()\n\tn = &NewTeam{}\n\tn.GetMaintainers()\n\tn = nil\n\tn.GetMaintainers()\n}\n\nfunc TestNewTeam_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tn := &NewTeam{}\n\tn.GetName()\n\tn = nil\n\tn.GetName()\n}\n\nfunc TestNewTeam_GetNotificationSetting(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &NewTeam{NotificationSetting: &zeroValue}\n\tn.GetNotificationSetting()\n\tn = &NewTeam{}\n\tn.GetNotificationSetting()\n\tn = nil\n\tn.GetNotificationSetting()\n}\n\nfunc TestNewTeam_GetParentTeamID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tn := &NewTeam{ParentTeamID: &zeroValue}\n\tn.GetParentTeamID()\n\tn = &NewTeam{}\n\tn.GetParentTeamID()\n\tn = nil\n\tn.GetParentTeamID()\n}\n\nfunc TestNewTeam_GetPermission(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &NewTeam{Permission: &zeroValue}\n\tn.GetPermission()\n\tn = &NewTeam{}\n\tn.GetPermission()\n\tn = nil\n\tn.GetPermission()\n}\n\nfunc TestNewTeam_GetPrivacy(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &NewTeam{Privacy: &zeroValue}\n\tn.GetPrivacy()\n\tn = &NewTeam{}\n\tn.GetPrivacy()\n\tn = nil\n\tn.GetPrivacy()\n}\n\nfunc TestNewTeam_GetRepoNames(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tn := &NewTeam{RepoNames: zeroValue}\n\tn.GetRepoNames()\n\tn = &NewTeam{}\n\tn.GetRepoNames()\n\tn = nil\n\tn.GetRepoNames()\n}\n\nfunc TestNodeDetails_GetClusterRoles(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tn := &NodeDetails{ClusterRoles: zeroValue}\n\tn.GetClusterRoles()\n\tn = &NodeDetails{}\n\tn.GetClusterRoles()\n\tn = nil\n\tn.GetClusterRoles()\n}\n\nfunc TestNodeDetails_GetHostname(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &NodeDetails{Hostname: &zeroValue}\n\tn.GetHostname()\n\tn = &NodeDetails{}\n\tn.GetHostname()\n\tn = nil\n\tn.GetHostname()\n}\n\nfunc TestNodeDetails_GetUUID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &NodeDetails{UUID: &zeroValue}\n\tn.GetUUID()\n\tn = &NodeDetails{}\n\tn.GetUUID()\n\tn = nil\n\tn.GetUUID()\n}\n\nfunc TestNodeMetadataStatus_GetNodes(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*NodeDetails{}\n\tn := &NodeMetadataStatus{Nodes: zeroValue}\n\tn.GetNodes()\n\tn = &NodeMetadataStatus{}\n\tn.GetNodes()\n\tn = nil\n\tn.GetNodes()\n}\n\nfunc TestNodeMetadataStatus_GetTopology(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &NodeMetadataStatus{Topology: &zeroValue}\n\tn.GetTopology()\n\tn = &NodeMetadataStatus{}\n\tn.GetTopology()\n\tn = nil\n\tn.GetTopology()\n}\n\nfunc TestNodeQueryOptions_GetClusterRoles(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &NodeQueryOptions{ClusterRoles: &zeroValue}\n\tn.GetClusterRoles()\n\tn = &NodeQueryOptions{}\n\tn.GetClusterRoles()\n\tn = nil\n\tn.GetClusterRoles()\n}\n\nfunc TestNodeQueryOptions_GetUUID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &NodeQueryOptions{UUID: &zeroValue}\n\tn.GetUUID()\n\tn = &NodeQueryOptions{}\n\tn.GetUUID()\n\tn = nil\n\tn.GetUUID()\n}\n\nfunc TestNodeReleaseVersion_GetHostname(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &NodeReleaseVersion{Hostname: &zeroValue}\n\tn.GetHostname()\n\tn = &NodeReleaseVersion{}\n\tn.GetHostname()\n\tn = nil\n\tn.GetHostname()\n}\n\nfunc TestNodeReleaseVersion_GetVersion(tt *testing.T) {\n\ttt.Parallel()\n\tn := &NodeReleaseVersion{}\n\tn.GetVersion()\n\tn = nil\n\tn.GetVersion()\n}\n\nfunc TestNotification_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &Notification{ID: &zeroValue}\n\tn.GetID()\n\tn = &Notification{}\n\tn.GetID()\n\tn = nil\n\tn.GetID()\n}\n\nfunc TestNotification_GetLastReadAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tn := &Notification{LastReadAt: &zeroValue}\n\tn.GetLastReadAt()\n\tn = &Notification{}\n\tn.GetLastReadAt()\n\tn = nil\n\tn.GetLastReadAt()\n}\n\nfunc TestNotification_GetReason(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &Notification{Reason: &zeroValue}\n\tn.GetReason()\n\tn = &Notification{}\n\tn.GetReason()\n\tn = nil\n\tn.GetReason()\n}\n\nfunc TestNotification_GetRepository(tt *testing.T) {\n\ttt.Parallel()\n\tn := &Notification{}\n\tn.GetRepository()\n\tn = nil\n\tn.GetRepository()\n}\n\nfunc TestNotification_GetSubject(tt *testing.T) {\n\ttt.Parallel()\n\tn := &Notification{}\n\tn.GetSubject()\n\tn = nil\n\tn.GetSubject()\n}\n\nfunc TestNotification_GetUnread(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tn := &Notification{Unread: &zeroValue}\n\tn.GetUnread()\n\tn = &Notification{}\n\tn.GetUnread()\n\tn = nil\n\tn.GetUnread()\n}\n\nfunc TestNotification_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tn := &Notification{UpdatedAt: &zeroValue}\n\tn.GetUpdatedAt()\n\tn = &Notification{}\n\tn.GetUpdatedAt()\n\tn = nil\n\tn.GetUpdatedAt()\n}\n\nfunc TestNotification_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &Notification{URL: &zeroValue}\n\tn.GetURL()\n\tn = &Notification{}\n\tn.GetURL()\n\tn = nil\n\tn.GetURL()\n}\n\nfunc TestNotificationListOptions_GetAll(tt *testing.T) {\n\ttt.Parallel()\n\tn := &NotificationListOptions{}\n\tn.GetAll()\n\tn = nil\n\tn.GetAll()\n}\n\nfunc TestNotificationListOptions_GetBefore(tt *testing.T) {\n\ttt.Parallel()\n\tn := &NotificationListOptions{}\n\tn.GetBefore()\n\tn = nil\n\tn.GetBefore()\n}\n\nfunc TestNotificationListOptions_GetParticipating(tt *testing.T) {\n\ttt.Parallel()\n\tn := &NotificationListOptions{}\n\tn.GetParticipating()\n\tn = nil\n\tn.GetParticipating()\n}\n\nfunc TestNotificationListOptions_GetSince(tt *testing.T) {\n\ttt.Parallel()\n\tn := &NotificationListOptions{}\n\tn.GetSince()\n\tn = nil\n\tn.GetSince()\n}\n\nfunc TestNotificationSubject_GetLatestCommentURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &NotificationSubject{LatestCommentURL: &zeroValue}\n\tn.GetLatestCommentURL()\n\tn = &NotificationSubject{}\n\tn.GetLatestCommentURL()\n\tn = nil\n\tn.GetLatestCommentURL()\n}\n\nfunc TestNotificationSubject_GetTitle(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &NotificationSubject{Title: &zeroValue}\n\tn.GetTitle()\n\tn = &NotificationSubject{}\n\tn.GetTitle()\n\tn = nil\n\tn.GetTitle()\n}\n\nfunc TestNotificationSubject_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &NotificationSubject{Type: &zeroValue}\n\tn.GetType()\n\tn = &NotificationSubject{}\n\tn.GetType()\n\tn = nil\n\tn.GetType()\n}\n\nfunc TestNotificationSubject_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tn := &NotificationSubject{URL: &zeroValue}\n\tn.GetURL()\n\tn = &NotificationSubject{}\n\tn.GetURL()\n\tn = nil\n\tn.GetURL()\n}\n\nfunc TestOAuthAPP_GetClientID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\to := &OAuthAPP{ClientID: &zeroValue}\n\to.GetClientID()\n\to = &OAuthAPP{}\n\to.GetClientID()\n\to = nil\n\to.GetClientID()\n}\n\nfunc TestOAuthAPP_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\to := &OAuthAPP{Name: &zeroValue}\n\to.GetName()\n\to = &OAuthAPP{}\n\to.GetName()\n\to = nil\n\to.GetName()\n}\n\nfunc TestOAuthAPP_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\to := &OAuthAPP{URL: &zeroValue}\n\to.GetURL()\n\to = &OAuthAPP{}\n\to.GetURL()\n\to = nil\n\to.GetURL()\n}\n\nfunc TestOIDCSubjectClaimCustomTemplate_GetIncludeClaimKeys(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\to := &OIDCSubjectClaimCustomTemplate{IncludeClaimKeys: zeroValue}\n\to.GetIncludeClaimKeys()\n\to = &OIDCSubjectClaimCustomTemplate{}\n\to.GetIncludeClaimKeys()\n\to = nil\n\to.GetIncludeClaimKeys()\n}\n\nfunc TestOIDCSubjectClaimCustomTemplate_GetUseDefault(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\to := &OIDCSubjectClaimCustomTemplate{UseDefault: &zeroValue}\n\to.GetUseDefault()\n\to = &OIDCSubjectClaimCustomTemplate{}\n\to.GetUseDefault()\n\to = nil\n\to.GetUseDefault()\n}\n\nfunc TestOrganization_GetAdvancedSecurityEnabledForNewRepos(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\to := &Organization{AdvancedSecurityEnabledForNewRepos: &zeroValue}\n\to.GetAdvancedSecurityEnabledForNewRepos()\n\to = &Organization{}\n\to.GetAdvancedSecurityEnabledForNewRepos()\n\to = nil\n\to.GetAdvancedSecurityEnabledForNewRepos()\n}\n\nfunc TestOrganization_GetAvatarURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\to := &Organization{AvatarURL: &zeroValue}\n\to.GetAvatarURL()\n\to = &Organization{}\n\to.GetAvatarURL()\n\to = nil\n\to.GetAvatarURL()\n}\n\nfunc TestOrganization_GetBillingEmail(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\to := &Organization{BillingEmail: &zeroValue}\n\to.GetBillingEmail()\n\to = &Organization{}\n\to.GetBillingEmail()\n\to = nil\n\to.GetBillingEmail()\n}\n\nfunc TestOrganization_GetBlog(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\to := &Organization{Blog: &zeroValue}\n\to.GetBlog()\n\to = &Organization{}\n\to.GetBlog()\n\to = nil\n\to.GetBlog()\n}\n\nfunc TestOrganization_GetCollaborators(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\to := &Organization{Collaborators: &zeroValue}\n\to.GetCollaborators()\n\to = &Organization{}\n\to.GetCollaborators()\n\to = nil\n\to.GetCollaborators()\n}\n\nfunc TestOrganization_GetCompany(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\to := &Organization{Company: &zeroValue}\n\to.GetCompany()\n\to = &Organization{}\n\to.GetCompany()\n\to = nil\n\to.GetCompany()\n}\n\nfunc TestOrganization_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\to := &Organization{CreatedAt: &zeroValue}\n\to.GetCreatedAt()\n\to = &Organization{}\n\to.GetCreatedAt()\n\to = nil\n\to.GetCreatedAt()\n}\n\nfunc TestOrganization_GetDefaultRepoPermission(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\to := &Organization{DefaultRepoPermission: &zeroValue}\n\to.GetDefaultRepoPermission()\n\to = &Organization{}\n\to.GetDefaultRepoPermission()\n\to = nil\n\to.GetDefaultRepoPermission()\n}\n\nfunc TestOrganization_GetDefaultRepoSettings(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\to := &Organization{DefaultRepoSettings: &zeroValue}\n\to.GetDefaultRepoSettings()\n\to = &Organization{}\n\to.GetDefaultRepoSettings()\n\to = nil\n\to.GetDefaultRepoSettings()\n}\n\nfunc TestOrganization_GetDefaultRepositoryBranch(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\to := &Organization{DefaultRepositoryBranch: &zeroValue}\n\to.GetDefaultRepositoryBranch()\n\to = &Organization{}\n\to.GetDefaultRepositoryBranch()\n\to = nil\n\to.GetDefaultRepositoryBranch()\n}\n\nfunc TestOrganization_GetDependabotAlertsEnabledForNewRepos(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\to := &Organization{DependabotAlertsEnabledForNewRepos: &zeroValue}\n\to.GetDependabotAlertsEnabledForNewRepos()\n\to = &Organization{}\n\to.GetDependabotAlertsEnabledForNewRepos()\n\to = nil\n\to.GetDependabotAlertsEnabledForNewRepos()\n}\n\nfunc TestOrganization_GetDependabotSecurityUpdatesEnabledForNewRepos(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\to := &Organization{DependabotSecurityUpdatesEnabledForNewRepos: &zeroValue}\n\to.GetDependabotSecurityUpdatesEnabledForNewRepos()\n\to = &Organization{}\n\to.GetDependabotSecurityUpdatesEnabledForNewRepos()\n\to = nil\n\to.GetDependabotSecurityUpdatesEnabledForNewRepos()\n}\n\nfunc TestOrganization_GetDependencyGraphEnabledForNewRepos(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\to := &Organization{DependencyGraphEnabledForNewRepos: &zeroValue}\n\to.GetDependencyGraphEnabledForNewRepos()\n\to = &Organization{}\n\to.GetDependencyGraphEnabledForNewRepos()\n\to = nil\n\to.GetDependencyGraphEnabledForNewRepos()\n}\n\nfunc TestOrganization_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\to := &Organization{Description: &zeroValue}\n\to.GetDescription()\n\to = &Organization{}\n\to.GetDescription()\n\to = nil\n\to.GetDescription()\n}\n\nfunc TestOrganization_GetDiskUsage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\to := &Organization{DiskUsage: &zeroValue}\n\to.GetDiskUsage()\n\to = &Organization{}\n\to.GetDiskUsage()\n\to = nil\n\to.GetDiskUsage()\n}\n\nfunc TestOrganization_GetDisplayCommenterFullNameSettingEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\to := &Organization{DisplayCommenterFullNameSettingEnabled: &zeroValue}\n\to.GetDisplayCommenterFullNameSettingEnabled()\n\to = &Organization{}\n\to.GetDisplayCommenterFullNameSettingEnabled()\n\to = nil\n\to.GetDisplayCommenterFullNameSettingEnabled()\n}\n\nfunc TestOrganization_GetEmail(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\to := &Organization{Email: &zeroValue}\n\to.GetEmail()\n\to = &Organization{}\n\to.GetEmail()\n\to = nil\n\to.GetEmail()\n}\n\nfunc TestOrganization_GetEventsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\to := &Organization{EventsURL: &zeroValue}\n\to.GetEventsURL()\n\to = &Organization{}\n\to.GetEventsURL()\n\to = nil\n\to.GetEventsURL()\n}\n\nfunc TestOrganization_GetFollowers(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\to := &Organization{Followers: &zeroValue}\n\to.GetFollowers()\n\to = &Organization{}\n\to.GetFollowers()\n\to = nil\n\to.GetFollowers()\n}\n\nfunc TestOrganization_GetFollowing(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\to := &Organization{Following: &zeroValue}\n\to.GetFollowing()\n\to = &Organization{}\n\to.GetFollowing()\n\to = nil\n\to.GetFollowing()\n}\n\nfunc TestOrganization_GetHasOrganizationProjects(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\to := &Organization{HasOrganizationProjects: &zeroValue}\n\to.GetHasOrganizationProjects()\n\to = &Organization{}\n\to.GetHasOrganizationProjects()\n\to = nil\n\to.GetHasOrganizationProjects()\n}\n\nfunc TestOrganization_GetHasRepositoryProjects(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\to := &Organization{HasRepositoryProjects: &zeroValue}\n\to.GetHasRepositoryProjects()\n\to = &Organization{}\n\to.GetHasRepositoryProjects()\n\to = nil\n\to.GetHasRepositoryProjects()\n}\n\nfunc TestOrganization_GetHooksURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\to := &Organization{HooksURL: &zeroValue}\n\to.GetHooksURL()\n\to = &Organization{}\n\to.GetHooksURL()\n\to = nil\n\to.GetHooksURL()\n}\n\nfunc TestOrganization_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\to := &Organization{HTMLURL: &zeroValue}\n\to.GetHTMLURL()\n\to = &Organization{}\n\to.GetHTMLURL()\n\to = nil\n\to.GetHTMLURL()\n}\n\nfunc TestOrganization_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\to := &Organization{ID: &zeroValue}\n\to.GetID()\n\to = &Organization{}\n\to.GetID()\n\to = nil\n\to.GetID()\n}\n\nfunc TestOrganization_GetIssuesURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\to := &Organization{IssuesURL: &zeroValue}\n\to.GetIssuesURL()\n\to = &Organization{}\n\to.GetIssuesURL()\n\to = nil\n\to.GetIssuesURL()\n}\n\nfunc TestOrganization_GetIsVerified(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\to := &Organization{IsVerified: &zeroValue}\n\to.GetIsVerified()\n\to = &Organization{}\n\to.GetIsVerified()\n\to = nil\n\to.GetIsVerified()\n}\n\nfunc TestOrganization_GetLocation(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\to := &Organization{Location: &zeroValue}\n\to.GetLocation()\n\to = &Organization{}\n\to.GetLocation()\n\to = nil\n\to.GetLocation()\n}\n\nfunc TestOrganization_GetLogin(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\to := &Organization{Login: &zeroValue}\n\to.GetLogin()\n\to = &Organization{}\n\to.GetLogin()\n\to = nil\n\to.GetLogin()\n}\n\nfunc TestOrganization_GetMembersAllowedRepositoryCreationType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\to := &Organization{MembersAllowedRepositoryCreationType: &zeroValue}\n\to.GetMembersAllowedRepositoryCreationType()\n\to = &Organization{}\n\to.GetMembersAllowedRepositoryCreationType()\n\to = nil\n\to.GetMembersAllowedRepositoryCreationType()\n}\n\nfunc TestOrganization_GetMembersCanChangeRepoVisibility(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\to := &Organization{MembersCanChangeRepoVisibility: &zeroValue}\n\to.GetMembersCanChangeRepoVisibility()\n\to = &Organization{}\n\to.GetMembersCanChangeRepoVisibility()\n\to = nil\n\to.GetMembersCanChangeRepoVisibility()\n}\n\nfunc TestOrganization_GetMembersCanCreateInternalRepos(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\to := &Organization{MembersCanCreateInternalRepos: &zeroValue}\n\to.GetMembersCanCreateInternalRepos()\n\to = &Organization{}\n\to.GetMembersCanCreateInternalRepos()\n\to = nil\n\to.GetMembersCanCreateInternalRepos()\n}\n\nfunc TestOrganization_GetMembersCanCreatePages(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\to := &Organization{MembersCanCreatePages: &zeroValue}\n\to.GetMembersCanCreatePages()\n\to = &Organization{}\n\to.GetMembersCanCreatePages()\n\to = nil\n\to.GetMembersCanCreatePages()\n}\n\nfunc TestOrganization_GetMembersCanCreatePrivatePages(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\to := &Organization{MembersCanCreatePrivatePages: &zeroValue}\n\to.GetMembersCanCreatePrivatePages()\n\to = &Organization{}\n\to.GetMembersCanCreatePrivatePages()\n\to = nil\n\to.GetMembersCanCreatePrivatePages()\n}\n\nfunc TestOrganization_GetMembersCanCreatePrivateRepos(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\to := &Organization{MembersCanCreatePrivateRepos: &zeroValue}\n\to.GetMembersCanCreatePrivateRepos()\n\to = &Organization{}\n\to.GetMembersCanCreatePrivateRepos()\n\to = nil\n\to.GetMembersCanCreatePrivateRepos()\n}\n\nfunc TestOrganization_GetMembersCanCreatePublicPages(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\to := &Organization{MembersCanCreatePublicPages: &zeroValue}\n\to.GetMembersCanCreatePublicPages()\n\to = &Organization{}\n\to.GetMembersCanCreatePublicPages()\n\to = nil\n\to.GetMembersCanCreatePublicPages()\n}\n\nfunc TestOrganization_GetMembersCanCreatePublicRepos(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\to := &Organization{MembersCanCreatePublicRepos: &zeroValue}\n\to.GetMembersCanCreatePublicRepos()\n\to = &Organization{}\n\to.GetMembersCanCreatePublicRepos()\n\to = nil\n\to.GetMembersCanCreatePublicRepos()\n}\n\nfunc TestOrganization_GetMembersCanCreateRepos(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\to := &Organization{MembersCanCreateRepos: &zeroValue}\n\to.GetMembersCanCreateRepos()\n\to = &Organization{}\n\to.GetMembersCanCreateRepos()\n\to = nil\n\to.GetMembersCanCreateRepos()\n}\n\nfunc TestOrganization_GetMembersCanCreateTeams(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\to := &Organization{MembersCanCreateTeams: &zeroValue}\n\to.GetMembersCanCreateTeams()\n\to = &Organization{}\n\to.GetMembersCanCreateTeams()\n\to = nil\n\to.GetMembersCanCreateTeams()\n}\n\nfunc TestOrganization_GetMembersCanDeleteIssues(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\to := &Organization{MembersCanDeleteIssues: &zeroValue}\n\to.GetMembersCanDeleteIssues()\n\to = &Organization{}\n\to.GetMembersCanDeleteIssues()\n\to = nil\n\to.GetMembersCanDeleteIssues()\n}\n\nfunc TestOrganization_GetMembersCanDeleteRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\to := &Organization{MembersCanDeleteRepositories: &zeroValue}\n\to.GetMembersCanDeleteRepositories()\n\to = &Organization{}\n\to.GetMembersCanDeleteRepositories()\n\to = nil\n\to.GetMembersCanDeleteRepositories()\n}\n\nfunc TestOrganization_GetMembersCanForkPrivateRepos(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\to := &Organization{MembersCanForkPrivateRepos: &zeroValue}\n\to.GetMembersCanForkPrivateRepos()\n\to = &Organization{}\n\to.GetMembersCanForkPrivateRepos()\n\to = nil\n\to.GetMembersCanForkPrivateRepos()\n}\n\nfunc TestOrganization_GetMembersCanInviteOutsideCollaborators(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\to := &Organization{MembersCanInviteOutsideCollaborators: &zeroValue}\n\to.GetMembersCanInviteOutsideCollaborators()\n\to = &Organization{}\n\to.GetMembersCanInviteOutsideCollaborators()\n\to = nil\n\to.GetMembersCanInviteOutsideCollaborators()\n}\n\nfunc TestOrganization_GetMembersCanViewDependencyInsights(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\to := &Organization{MembersCanViewDependencyInsights: &zeroValue}\n\to.GetMembersCanViewDependencyInsights()\n\to = &Organization{}\n\to.GetMembersCanViewDependencyInsights()\n\to = nil\n\to.GetMembersCanViewDependencyInsights()\n}\n\nfunc TestOrganization_GetMembersURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\to := &Organization{MembersURL: &zeroValue}\n\to.GetMembersURL()\n\to = &Organization{}\n\to.GetMembersURL()\n\to = nil\n\to.GetMembersURL()\n}\n\nfunc TestOrganization_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\to := &Organization{Name: &zeroValue}\n\to.GetName()\n\to = &Organization{}\n\to.GetName()\n\to = nil\n\to.GetName()\n}\n\nfunc TestOrganization_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\to := &Organization{NodeID: &zeroValue}\n\to.GetNodeID()\n\to = &Organization{}\n\to.GetNodeID()\n\to = nil\n\to.GetNodeID()\n}\n\nfunc TestOrganization_GetOwnedPrivateRepos(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\to := &Organization{OwnedPrivateRepos: &zeroValue}\n\to.GetOwnedPrivateRepos()\n\to = &Organization{}\n\to.GetOwnedPrivateRepos()\n\to = nil\n\to.GetOwnedPrivateRepos()\n}\n\nfunc TestOrganization_GetPlan(tt *testing.T) {\n\ttt.Parallel()\n\to := &Organization{}\n\to.GetPlan()\n\to = nil\n\to.GetPlan()\n}\n\nfunc TestOrganization_GetPrivateGists(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\to := &Organization{PrivateGists: &zeroValue}\n\to.GetPrivateGists()\n\to = &Organization{}\n\to.GetPrivateGists()\n\to = nil\n\to.GetPrivateGists()\n}\n\nfunc TestOrganization_GetPublicGists(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\to := &Organization{PublicGists: &zeroValue}\n\to.GetPublicGists()\n\to = &Organization{}\n\to.GetPublicGists()\n\to = nil\n\to.GetPublicGists()\n}\n\nfunc TestOrganization_GetPublicMembersURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\to := &Organization{PublicMembersURL: &zeroValue}\n\to.GetPublicMembersURL()\n\to = &Organization{}\n\to.GetPublicMembersURL()\n\to = nil\n\to.GetPublicMembersURL()\n}\n\nfunc TestOrganization_GetPublicRepos(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\to := &Organization{PublicRepos: &zeroValue}\n\to.GetPublicRepos()\n\to = &Organization{}\n\to.GetPublicRepos()\n\to = nil\n\to.GetPublicRepos()\n}\n\nfunc TestOrganization_GetReadersCanCreateDiscussions(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\to := &Organization{ReadersCanCreateDiscussions: &zeroValue}\n\to.GetReadersCanCreateDiscussions()\n\to = &Organization{}\n\to.GetReadersCanCreateDiscussions()\n\to = nil\n\to.GetReadersCanCreateDiscussions()\n}\n\nfunc TestOrganization_GetReposURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\to := &Organization{ReposURL: &zeroValue}\n\to.GetReposURL()\n\to = &Organization{}\n\to.GetReposURL()\n\to = nil\n\to.GetReposURL()\n}\n\nfunc TestOrganization_GetSecretScanningEnabledForNewRepos(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\to := &Organization{SecretScanningEnabledForNewRepos: &zeroValue}\n\to.GetSecretScanningEnabledForNewRepos()\n\to = &Organization{}\n\to.GetSecretScanningEnabledForNewRepos()\n\to = nil\n\to.GetSecretScanningEnabledForNewRepos()\n}\n\nfunc TestOrganization_GetSecretScanningPushProtectionEnabledForNewRepos(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\to := &Organization{SecretScanningPushProtectionEnabledForNewRepos: &zeroValue}\n\to.GetSecretScanningPushProtectionEnabledForNewRepos()\n\to = &Organization{}\n\to.GetSecretScanningPushProtectionEnabledForNewRepos()\n\to = nil\n\to.GetSecretScanningPushProtectionEnabledForNewRepos()\n}\n\nfunc TestOrganization_GetSecretScanningValidityChecksEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\to := &Organization{SecretScanningValidityChecksEnabled: &zeroValue}\n\to.GetSecretScanningValidityChecksEnabled()\n\to = &Organization{}\n\to.GetSecretScanningValidityChecksEnabled()\n\to = nil\n\to.GetSecretScanningValidityChecksEnabled()\n}\n\nfunc TestOrganization_GetTotalPrivateRepos(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\to := &Organization{TotalPrivateRepos: &zeroValue}\n\to.GetTotalPrivateRepos()\n\to = &Organization{}\n\to.GetTotalPrivateRepos()\n\to = nil\n\to.GetTotalPrivateRepos()\n}\n\nfunc TestOrganization_GetTwitterUsername(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\to := &Organization{TwitterUsername: &zeroValue}\n\to.GetTwitterUsername()\n\to = &Organization{}\n\to.GetTwitterUsername()\n\to = nil\n\to.GetTwitterUsername()\n}\n\nfunc TestOrganization_GetTwoFactorRequirementEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\to := &Organization{TwoFactorRequirementEnabled: &zeroValue}\n\to.GetTwoFactorRequirementEnabled()\n\to = &Organization{}\n\to.GetTwoFactorRequirementEnabled()\n\to = nil\n\to.GetTwoFactorRequirementEnabled()\n}\n\nfunc TestOrganization_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\to := &Organization{Type: &zeroValue}\n\to.GetType()\n\to = &Organization{}\n\to.GetType()\n\to = nil\n\to.GetType()\n}\n\nfunc TestOrganization_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\to := &Organization{UpdatedAt: &zeroValue}\n\to.GetUpdatedAt()\n\to = &Organization{}\n\to.GetUpdatedAt()\n\to = nil\n\to.GetUpdatedAt()\n}\n\nfunc TestOrganization_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\to := &Organization{URL: &zeroValue}\n\to.GetURL()\n\to = &Organization{}\n\to.GetURL()\n\to = nil\n\to.GetURL()\n}\n\nfunc TestOrganization_GetWebCommitSignoffRequired(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\to := &Organization{WebCommitSignoffRequired: &zeroValue}\n\to.GetWebCommitSignoffRequired()\n\to = &Organization{}\n\to.GetWebCommitSignoffRequired()\n\to = nil\n\to.GetWebCommitSignoffRequired()\n}\n\nfunc TestOrganizationCustomPropertyValues_GetProperties(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CustomPropertyValue{}\n\to := &OrganizationCustomPropertyValues{Properties: zeroValue}\n\to.GetProperties()\n\to = &OrganizationCustomPropertyValues{}\n\to.GetProperties()\n\to = nil\n\to.GetProperties()\n}\n\nfunc TestOrganizationCustomRepoRoles_GetCustomRepoRoles(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CustomRepoRoles{}\n\to := &OrganizationCustomRepoRoles{CustomRepoRoles: zeroValue}\n\to.GetCustomRepoRoles()\n\to = &OrganizationCustomRepoRoles{}\n\to.GetCustomRepoRoles()\n\to = nil\n\to.GetCustomRepoRoles()\n}\n\nfunc TestOrganizationCustomRepoRoles_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\to := &OrganizationCustomRepoRoles{TotalCount: &zeroValue}\n\to.GetTotalCount()\n\to = &OrganizationCustomRepoRoles{}\n\to.GetTotalCount()\n\to = nil\n\to.GetTotalCount()\n}\n\nfunc TestOrganizationCustomRoles_GetCustomRepoRoles(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CustomOrgRole{}\n\to := &OrganizationCustomRoles{CustomRepoRoles: zeroValue}\n\to.GetCustomRepoRoles()\n\to = &OrganizationCustomRoles{}\n\to.GetCustomRepoRoles()\n\to = nil\n\to.GetCustomRepoRoles()\n}\n\nfunc TestOrganizationCustomRoles_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\to := &OrganizationCustomRoles{TotalCount: &zeroValue}\n\to.GetTotalCount()\n\to = &OrganizationCustomRoles{}\n\to.GetTotalCount()\n\to = nil\n\to.GetTotalCount()\n}\n\nfunc TestOrganizationEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\to := &OrganizationEvent{Action: &zeroValue}\n\to.GetAction()\n\to = &OrganizationEvent{}\n\to.GetAction()\n\to = nil\n\to.GetAction()\n}\n\nfunc TestOrganizationEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\to := &OrganizationEvent{}\n\to.GetInstallation()\n\to = nil\n\to.GetInstallation()\n}\n\nfunc TestOrganizationEvent_GetInvitation(tt *testing.T) {\n\ttt.Parallel()\n\to := &OrganizationEvent{}\n\to.GetInvitation()\n\to = nil\n\to.GetInvitation()\n}\n\nfunc TestOrganizationEvent_GetMembership(tt *testing.T) {\n\ttt.Parallel()\n\to := &OrganizationEvent{}\n\to.GetMembership()\n\to = nil\n\to.GetMembership()\n}\n\nfunc TestOrganizationEvent_GetOrganization(tt *testing.T) {\n\ttt.Parallel()\n\to := &OrganizationEvent{}\n\to.GetOrganization()\n\to = nil\n\to.GetOrganization()\n}\n\nfunc TestOrganizationEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\to := &OrganizationEvent{}\n\to.GetSender()\n\to = nil\n\to.GetSender()\n}\n\nfunc TestOrganizationFineGrainedPermission_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\to := &OrganizationFineGrainedPermission{}\n\to.GetDescription()\n\to = nil\n\to.GetDescription()\n}\n\nfunc TestOrganizationFineGrainedPermission_GetName(tt *testing.T) {\n\ttt.Parallel()\n\to := &OrganizationFineGrainedPermission{}\n\to.GetName()\n\to = nil\n\to.GetName()\n}\n\nfunc TestOrganizationInstallations_GetInstallations(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Installation{}\n\to := &OrganizationInstallations{Installations: zeroValue}\n\to.GetInstallations()\n\to = &OrganizationInstallations{}\n\to.GetInstallations()\n\to = nil\n\to.GetInstallations()\n}\n\nfunc TestOrganizationInstallations_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\to := &OrganizationInstallations{TotalCount: &zeroValue}\n\to.GetTotalCount()\n\to = &OrganizationInstallations{}\n\to.GetTotalCount()\n\to = nil\n\to.GetTotalCount()\n}\n\nfunc TestOrganizationsListOptions_GetPerPage(tt *testing.T) {\n\ttt.Parallel()\n\to := &OrganizationsListOptions{}\n\to.GetPerPage()\n\to = nil\n\to.GetPerPage()\n}\n\nfunc TestOrganizationsListOptions_GetSince(tt *testing.T) {\n\ttt.Parallel()\n\to := &OrganizationsListOptions{}\n\to.GetSince()\n\to = nil\n\to.GetSince()\n}\n\nfunc TestOrgBlockEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\to := &OrgBlockEvent{Action: &zeroValue}\n\to.GetAction()\n\to = &OrgBlockEvent{}\n\to.GetAction()\n\to = nil\n\to.GetAction()\n}\n\nfunc TestOrgBlockEvent_GetBlockedUser(tt *testing.T) {\n\ttt.Parallel()\n\to := &OrgBlockEvent{}\n\to.GetBlockedUser()\n\to = nil\n\to.GetBlockedUser()\n}\n\nfunc TestOrgBlockEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\to := &OrgBlockEvent{}\n\to.GetInstallation()\n\to = nil\n\to.GetInstallation()\n}\n\nfunc TestOrgBlockEvent_GetOrganization(tt *testing.T) {\n\ttt.Parallel()\n\to := &OrgBlockEvent{}\n\to.GetOrganization()\n\to = nil\n\to.GetOrganization()\n}\n\nfunc TestOrgBlockEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\to := &OrgBlockEvent{}\n\to.GetSender()\n\to = nil\n\to.GetSender()\n}\n\nfunc TestOrgStats_GetDisabledOrgs(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\to := &OrgStats{DisabledOrgs: &zeroValue}\n\to.GetDisabledOrgs()\n\to = &OrgStats{}\n\to.GetDisabledOrgs()\n\to = nil\n\to.GetDisabledOrgs()\n}\n\nfunc TestOrgStats_GetTotalOrgs(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\to := &OrgStats{TotalOrgs: &zeroValue}\n\to.GetTotalOrgs()\n\to = &OrgStats{}\n\to.GetTotalOrgs()\n\to = nil\n\to.GetTotalOrgs()\n}\n\nfunc TestOrgStats_GetTotalTeamMembers(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\to := &OrgStats{TotalTeamMembers: &zeroValue}\n\to.GetTotalTeamMembers()\n\to = &OrgStats{}\n\to.GetTotalTeamMembers()\n\to = nil\n\to.GetTotalTeamMembers()\n}\n\nfunc TestOrgStats_GetTotalTeams(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\to := &OrgStats{TotalTeams: &zeroValue}\n\to.GetTotalTeams()\n\to = &OrgStats{}\n\to.GetTotalTeams()\n\to = nil\n\to.GetTotalTeams()\n}\n\nfunc TestOwnerInfo_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\to := &OwnerInfo{}\n\to.GetOrg()\n\to = nil\n\to.GetOrg()\n}\n\nfunc TestOwnerInfo_GetUser(tt *testing.T) {\n\ttt.Parallel()\n\to := &OwnerInfo{}\n\to.GetUser()\n\to = nil\n\to.GetUser()\n}\n\nfunc TestPackage_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &Package{CreatedAt: &zeroValue}\n\tp.GetCreatedAt()\n\tp = &Package{}\n\tp.GetCreatedAt()\n\tp = nil\n\tp.GetCreatedAt()\n}\n\nfunc TestPackage_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &Package{Description: &zeroValue}\n\tp.GetDescription()\n\tp = &Package{}\n\tp.GetDescription()\n\tp = nil\n\tp.GetDescription()\n}\n\nfunc TestPackage_GetEcosystem(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &Package{Ecosystem: &zeroValue}\n\tp.GetEcosystem()\n\tp = &Package{}\n\tp.GetEcosystem()\n\tp = nil\n\tp.GetEcosystem()\n}\n\nfunc TestPackage_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &Package{HTMLURL: &zeroValue}\n\tp.GetHTMLURL()\n\tp = &Package{}\n\tp.GetHTMLURL()\n\tp = nil\n\tp.GetHTMLURL()\n}\n\nfunc TestPackage_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &Package{ID: &zeroValue}\n\tp.GetID()\n\tp = &Package{}\n\tp.GetID()\n\tp = nil\n\tp.GetID()\n}\n\nfunc TestPackage_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &Package{Name: &zeroValue}\n\tp.GetName()\n\tp = &Package{}\n\tp.GetName()\n\tp = nil\n\tp.GetName()\n}\n\nfunc TestPackage_GetNamespace(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &Package{Namespace: &zeroValue}\n\tp.GetNamespace()\n\tp = &Package{}\n\tp.GetNamespace()\n\tp = nil\n\tp.GetNamespace()\n}\n\nfunc TestPackage_GetOwner(tt *testing.T) {\n\ttt.Parallel()\n\tp := &Package{}\n\tp.GetOwner()\n\tp = nil\n\tp.GetOwner()\n}\n\nfunc TestPackage_GetPackageType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &Package{PackageType: &zeroValue}\n\tp.GetPackageType()\n\tp = &Package{}\n\tp.GetPackageType()\n\tp = nil\n\tp.GetPackageType()\n}\n\nfunc TestPackage_GetPackageVersion(tt *testing.T) {\n\ttt.Parallel()\n\tp := &Package{}\n\tp.GetPackageVersion()\n\tp = nil\n\tp.GetPackageVersion()\n}\n\nfunc TestPackage_GetRegistry(tt *testing.T) {\n\ttt.Parallel()\n\tp := &Package{}\n\tp.GetRegistry()\n\tp = nil\n\tp.GetRegistry()\n}\n\nfunc TestPackage_GetRepository(tt *testing.T) {\n\ttt.Parallel()\n\tp := &Package{}\n\tp.GetRepository()\n\tp = nil\n\tp.GetRepository()\n}\n\nfunc TestPackage_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &Package{UpdatedAt: &zeroValue}\n\tp.GetUpdatedAt()\n\tp = &Package{}\n\tp.GetUpdatedAt()\n\tp = nil\n\tp.GetUpdatedAt()\n}\n\nfunc TestPackage_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &Package{URL: &zeroValue}\n\tp.GetURL()\n\tp = &Package{}\n\tp.GetURL()\n\tp = nil\n\tp.GetURL()\n}\n\nfunc TestPackage_GetVersionCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &Package{VersionCount: &zeroValue}\n\tp.GetVersionCount()\n\tp = &Package{}\n\tp.GetVersionCount()\n\tp = nil\n\tp.GetVersionCount()\n}\n\nfunc TestPackage_GetVisibility(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &Package{Visibility: &zeroValue}\n\tp.GetVisibility()\n\tp = &Package{}\n\tp.GetVisibility()\n\tp = nil\n\tp.GetVisibility()\n}\n\nfunc TestPackageContainerMetadata_GetTags(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tp := &PackageContainerMetadata{Tags: zeroValue}\n\tp.GetTags()\n\tp = &PackageContainerMetadata{}\n\tp.GetTags()\n\tp = nil\n\tp.GetTags()\n}\n\nfunc TestPackageEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageEvent{Action: &zeroValue}\n\tp.GetAction()\n\tp = &PackageEvent{}\n\tp.GetAction()\n\tp = nil\n\tp.GetAction()\n}\n\nfunc TestPackageEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PackageEvent{}\n\tp.GetInstallation()\n\tp = nil\n\tp.GetInstallation()\n}\n\nfunc TestPackageEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PackageEvent{}\n\tp.GetOrg()\n\tp = nil\n\tp.GetOrg()\n}\n\nfunc TestPackageEvent_GetPackage(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PackageEvent{}\n\tp.GetPackage()\n\tp = nil\n\tp.GetPackage()\n}\n\nfunc TestPackageEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PackageEvent{}\n\tp.GetRepo()\n\tp = nil\n\tp.GetRepo()\n}\n\nfunc TestPackageEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PackageEvent{}\n\tp.GetSender()\n\tp = nil\n\tp.GetSender()\n}\n\nfunc TestPackageEventContainerMetadata_GetLabels(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]any{}\n\tp := &PackageEventContainerMetadata{Labels: zeroValue}\n\tp.GetLabels()\n\tp = &PackageEventContainerMetadata{}\n\tp.GetLabels()\n\tp = nil\n\tp.GetLabels()\n}\n\nfunc TestPackageEventContainerMetadata_GetManifest(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]any{}\n\tp := &PackageEventContainerMetadata{Manifest: zeroValue}\n\tp.GetManifest()\n\tp = &PackageEventContainerMetadata{}\n\tp.GetManifest()\n\tp = nil\n\tp.GetManifest()\n}\n\nfunc TestPackageEventContainerMetadata_GetTag(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PackageEventContainerMetadata{}\n\tp.GetTag()\n\tp = nil\n\tp.GetTag()\n}\n\nfunc TestPackageEventContainerMetadataTag_GetDigest(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageEventContainerMetadataTag{Digest: &zeroValue}\n\tp.GetDigest()\n\tp = &PackageEventContainerMetadataTag{}\n\tp.GetDigest()\n\tp = nil\n\tp.GetDigest()\n}\n\nfunc TestPackageEventContainerMetadataTag_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageEventContainerMetadataTag{Name: &zeroValue}\n\tp.GetName()\n\tp = &PackageEventContainerMetadataTag{}\n\tp.GetName()\n\tp = nil\n\tp.GetName()\n}\n\nfunc TestPackageExternalRef_GetReferenceCategory(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PackageExternalRef{}\n\tp.GetReferenceCategory()\n\tp = nil\n\tp.GetReferenceCategory()\n}\n\nfunc TestPackageExternalRef_GetReferenceLocator(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PackageExternalRef{}\n\tp.GetReferenceLocator()\n\tp = nil\n\tp.GetReferenceLocator()\n}\n\nfunc TestPackageExternalRef_GetReferenceType(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PackageExternalRef{}\n\tp.GetReferenceType()\n\tp = nil\n\tp.GetReferenceType()\n}\n\nfunc TestPackageFile_GetAuthor(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PackageFile{}\n\tp.GetAuthor()\n\tp = nil\n\tp.GetAuthor()\n}\n\nfunc TestPackageFile_GetContentType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageFile{ContentType: &zeroValue}\n\tp.GetContentType()\n\tp = &PackageFile{}\n\tp.GetContentType()\n\tp = nil\n\tp.GetContentType()\n}\n\nfunc TestPackageFile_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PackageFile{CreatedAt: &zeroValue}\n\tp.GetCreatedAt()\n\tp = &PackageFile{}\n\tp.GetCreatedAt()\n\tp = nil\n\tp.GetCreatedAt()\n}\n\nfunc TestPackageFile_GetDownloadURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageFile{DownloadURL: &zeroValue}\n\tp.GetDownloadURL()\n\tp = &PackageFile{}\n\tp.GetDownloadURL()\n\tp = nil\n\tp.GetDownloadURL()\n}\n\nfunc TestPackageFile_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &PackageFile{ID: &zeroValue}\n\tp.GetID()\n\tp = &PackageFile{}\n\tp.GetID()\n\tp = nil\n\tp.GetID()\n}\n\nfunc TestPackageFile_GetMD5(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageFile{MD5: &zeroValue}\n\tp.GetMD5()\n\tp = &PackageFile{}\n\tp.GetMD5()\n\tp = nil\n\tp.GetMD5()\n}\n\nfunc TestPackageFile_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageFile{Name: &zeroValue}\n\tp.GetName()\n\tp = &PackageFile{}\n\tp.GetName()\n\tp = nil\n\tp.GetName()\n}\n\nfunc TestPackageFile_GetSHA1(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageFile{SHA1: &zeroValue}\n\tp.GetSHA1()\n\tp = &PackageFile{}\n\tp.GetSHA1()\n\tp = nil\n\tp.GetSHA1()\n}\n\nfunc TestPackageFile_GetSHA256(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageFile{SHA256: &zeroValue}\n\tp.GetSHA256()\n\tp = &PackageFile{}\n\tp.GetSHA256()\n\tp = nil\n\tp.GetSHA256()\n}\n\nfunc TestPackageFile_GetSize(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &PackageFile{Size: &zeroValue}\n\tp.GetSize()\n\tp = &PackageFile{}\n\tp.GetSize()\n\tp = nil\n\tp.GetSize()\n}\n\nfunc TestPackageFile_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageFile{State: &zeroValue}\n\tp.GetState()\n\tp = &PackageFile{}\n\tp.GetState()\n\tp = nil\n\tp.GetState()\n}\n\nfunc TestPackageFile_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PackageFile{UpdatedAt: &zeroValue}\n\tp.GetUpdatedAt()\n\tp = &PackageFile{}\n\tp.GetUpdatedAt()\n\tp = nil\n\tp.GetUpdatedAt()\n}\n\nfunc TestPackageListOptions_GetPackageType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageListOptions{PackageType: &zeroValue}\n\tp.GetPackageType()\n\tp = &PackageListOptions{}\n\tp.GetPackageType()\n\tp = nil\n\tp.GetPackageType()\n}\n\nfunc TestPackageListOptions_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageListOptions{State: &zeroValue}\n\tp.GetState()\n\tp = &PackageListOptions{}\n\tp.GetState()\n\tp = nil\n\tp.GetState()\n}\n\nfunc TestPackageListOptions_GetVisibility(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageListOptions{Visibility: &zeroValue}\n\tp.GetVisibility()\n\tp = &PackageListOptions{}\n\tp.GetVisibility()\n\tp = nil\n\tp.GetVisibility()\n}\n\nfunc TestPackageMetadata_GetContainer(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PackageMetadata{}\n\tp.GetContainer()\n\tp = nil\n\tp.GetContainer()\n}\n\nfunc TestPackageMetadata_GetPackageType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageMetadata{PackageType: &zeroValue}\n\tp.GetPackageType()\n\tp = &PackageMetadata{}\n\tp.GetPackageType()\n\tp = nil\n\tp.GetPackageType()\n}\n\nfunc TestPackageNPMMetadata_GetAuthor(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]string{}\n\tp := &PackageNPMMetadata{Author: zeroValue}\n\tp.GetAuthor()\n\tp = &PackageNPMMetadata{}\n\tp.GetAuthor()\n\tp = nil\n\tp.GetAuthor()\n}\n\nfunc TestPackageNPMMetadata_GetBin(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]any{}\n\tp := &PackageNPMMetadata{Bin: zeroValue}\n\tp.GetBin()\n\tp = &PackageNPMMetadata{}\n\tp.GetBin()\n\tp = nil\n\tp.GetBin()\n}\n\nfunc TestPackageNPMMetadata_GetBugs(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]string{}\n\tp := &PackageNPMMetadata{Bugs: zeroValue}\n\tp.GetBugs()\n\tp = &PackageNPMMetadata{}\n\tp.GetBugs()\n\tp = nil\n\tp.GetBugs()\n}\n\nfunc TestPackageNPMMetadata_GetCommitOID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageNPMMetadata{CommitOID: &zeroValue}\n\tp.GetCommitOID()\n\tp = &PackageNPMMetadata{}\n\tp.GetCommitOID()\n\tp = nil\n\tp.GetCommitOID()\n}\n\nfunc TestPackageNPMMetadata_GetContributors(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []any{}\n\tp := &PackageNPMMetadata{Contributors: zeroValue}\n\tp.GetContributors()\n\tp = &PackageNPMMetadata{}\n\tp.GetContributors()\n\tp = nil\n\tp.GetContributors()\n}\n\nfunc TestPackageNPMMetadata_GetCPU(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tp := &PackageNPMMetadata{CPU: zeroValue}\n\tp.GetCPU()\n\tp = &PackageNPMMetadata{}\n\tp.GetCPU()\n\tp = nil\n\tp.GetCPU()\n}\n\nfunc TestPackageNPMMetadata_GetDeletedByID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &PackageNPMMetadata{DeletedByID: &zeroValue}\n\tp.GetDeletedByID()\n\tp = &PackageNPMMetadata{}\n\tp.GetDeletedByID()\n\tp = nil\n\tp.GetDeletedByID()\n}\n\nfunc TestPackageNPMMetadata_GetDependencies(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]string{}\n\tp := &PackageNPMMetadata{Dependencies: zeroValue}\n\tp.GetDependencies()\n\tp = &PackageNPMMetadata{}\n\tp.GetDependencies()\n\tp = nil\n\tp.GetDependencies()\n}\n\nfunc TestPackageNPMMetadata_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageNPMMetadata{Description: &zeroValue}\n\tp.GetDescription()\n\tp = &PackageNPMMetadata{}\n\tp.GetDescription()\n\tp = nil\n\tp.GetDescription()\n}\n\nfunc TestPackageNPMMetadata_GetDevDependencies(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]string{}\n\tp := &PackageNPMMetadata{DevDependencies: zeroValue}\n\tp.GetDevDependencies()\n\tp = &PackageNPMMetadata{}\n\tp.GetDevDependencies()\n\tp = nil\n\tp.GetDevDependencies()\n}\n\nfunc TestPackageNPMMetadata_GetDirectories(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]string{}\n\tp := &PackageNPMMetadata{Directories: zeroValue}\n\tp.GetDirectories()\n\tp = &PackageNPMMetadata{}\n\tp.GetDirectories()\n\tp = nil\n\tp.GetDirectories()\n}\n\nfunc TestPackageNPMMetadata_GetDist(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]string{}\n\tp := &PackageNPMMetadata{Dist: zeroValue}\n\tp.GetDist()\n\tp = &PackageNPMMetadata{}\n\tp.GetDist()\n\tp = nil\n\tp.GetDist()\n}\n\nfunc TestPackageNPMMetadata_GetEngines(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]string{}\n\tp := &PackageNPMMetadata{Engines: zeroValue}\n\tp.GetEngines()\n\tp = &PackageNPMMetadata{}\n\tp.GetEngines()\n\tp = nil\n\tp.GetEngines()\n}\n\nfunc TestPackageNPMMetadata_GetFiles(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tp := &PackageNPMMetadata{Files: zeroValue}\n\tp.GetFiles()\n\tp = &PackageNPMMetadata{}\n\tp.GetFiles()\n\tp = nil\n\tp.GetFiles()\n}\n\nfunc TestPackageNPMMetadata_GetGitHead(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageNPMMetadata{GitHead: &zeroValue}\n\tp.GetGitHead()\n\tp = &PackageNPMMetadata{}\n\tp.GetGitHead()\n\tp = nil\n\tp.GetGitHead()\n}\n\nfunc TestPackageNPMMetadata_GetHasShrinkwrap(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PackageNPMMetadata{HasShrinkwrap: &zeroValue}\n\tp.GetHasShrinkwrap()\n\tp = &PackageNPMMetadata{}\n\tp.GetHasShrinkwrap()\n\tp = nil\n\tp.GetHasShrinkwrap()\n}\n\nfunc TestPackageNPMMetadata_GetHomepage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageNPMMetadata{Homepage: &zeroValue}\n\tp.GetHomepage()\n\tp = &PackageNPMMetadata{}\n\tp.GetHomepage()\n\tp = nil\n\tp.GetHomepage()\n}\n\nfunc TestPackageNPMMetadata_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageNPMMetadata{ID: &zeroValue}\n\tp.GetID()\n\tp = &PackageNPMMetadata{}\n\tp.GetID()\n\tp = nil\n\tp.GetID()\n}\n\nfunc TestPackageNPMMetadata_GetInstallationCommand(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageNPMMetadata{InstallationCommand: &zeroValue}\n\tp.GetInstallationCommand()\n\tp = &PackageNPMMetadata{}\n\tp.GetInstallationCommand()\n\tp = nil\n\tp.GetInstallationCommand()\n}\n\nfunc TestPackageNPMMetadata_GetKeywords(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tp := &PackageNPMMetadata{Keywords: zeroValue}\n\tp.GetKeywords()\n\tp = &PackageNPMMetadata{}\n\tp.GetKeywords()\n\tp = nil\n\tp.GetKeywords()\n}\n\nfunc TestPackageNPMMetadata_GetLicense(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageNPMMetadata{License: &zeroValue}\n\tp.GetLicense()\n\tp = &PackageNPMMetadata{}\n\tp.GetLicense()\n\tp = nil\n\tp.GetLicense()\n}\n\nfunc TestPackageNPMMetadata_GetMain(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageNPMMetadata{Main: &zeroValue}\n\tp.GetMain()\n\tp = &PackageNPMMetadata{}\n\tp.GetMain()\n\tp = nil\n\tp.GetMain()\n}\n\nfunc TestPackageNPMMetadata_GetMaintainers(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []any{}\n\tp := &PackageNPMMetadata{Maintainers: zeroValue}\n\tp.GetMaintainers()\n\tp = &PackageNPMMetadata{}\n\tp.GetMaintainers()\n\tp = nil\n\tp.GetMaintainers()\n}\n\nfunc TestPackageNPMMetadata_GetMan(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]any{}\n\tp := &PackageNPMMetadata{Man: zeroValue}\n\tp.GetMan()\n\tp = &PackageNPMMetadata{}\n\tp.GetMan()\n\tp = nil\n\tp.GetMan()\n}\n\nfunc TestPackageNPMMetadata_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageNPMMetadata{Name: &zeroValue}\n\tp.GetName()\n\tp = &PackageNPMMetadata{}\n\tp.GetName()\n\tp = nil\n\tp.GetName()\n}\n\nfunc TestPackageNPMMetadata_GetNodeVersion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageNPMMetadata{NodeVersion: &zeroValue}\n\tp.GetNodeVersion()\n\tp = &PackageNPMMetadata{}\n\tp.GetNodeVersion()\n\tp = nil\n\tp.GetNodeVersion()\n}\n\nfunc TestPackageNPMMetadata_GetNPMUser(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageNPMMetadata{NPMUser: &zeroValue}\n\tp.GetNPMUser()\n\tp = &PackageNPMMetadata{}\n\tp.GetNPMUser()\n\tp = nil\n\tp.GetNPMUser()\n}\n\nfunc TestPackageNPMMetadata_GetNPMVersion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageNPMMetadata{NPMVersion: &zeroValue}\n\tp.GetNPMVersion()\n\tp = &PackageNPMMetadata{}\n\tp.GetNPMVersion()\n\tp = nil\n\tp.GetNPMVersion()\n}\n\nfunc TestPackageNPMMetadata_GetOptionalDependencies(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]string{}\n\tp := &PackageNPMMetadata{OptionalDependencies: zeroValue}\n\tp.GetOptionalDependencies()\n\tp = &PackageNPMMetadata{}\n\tp.GetOptionalDependencies()\n\tp = nil\n\tp.GetOptionalDependencies()\n}\n\nfunc TestPackageNPMMetadata_GetOS(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tp := &PackageNPMMetadata{OS: zeroValue}\n\tp.GetOS()\n\tp = &PackageNPMMetadata{}\n\tp.GetOS()\n\tp = nil\n\tp.GetOS()\n}\n\nfunc TestPackageNPMMetadata_GetPeerDependencies(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]string{}\n\tp := &PackageNPMMetadata{PeerDependencies: zeroValue}\n\tp.GetPeerDependencies()\n\tp = &PackageNPMMetadata{}\n\tp.GetPeerDependencies()\n\tp = nil\n\tp.GetPeerDependencies()\n}\n\nfunc TestPackageNPMMetadata_GetPublishedViaActions(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PackageNPMMetadata{PublishedViaActions: &zeroValue}\n\tp.GetPublishedViaActions()\n\tp = &PackageNPMMetadata{}\n\tp.GetPublishedViaActions()\n\tp = nil\n\tp.GetPublishedViaActions()\n}\n\nfunc TestPackageNPMMetadata_GetReadme(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageNPMMetadata{Readme: &zeroValue}\n\tp.GetReadme()\n\tp = &PackageNPMMetadata{}\n\tp.GetReadme()\n\tp = nil\n\tp.GetReadme()\n}\n\nfunc TestPackageNPMMetadata_GetReleaseID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &PackageNPMMetadata{ReleaseID: &zeroValue}\n\tp.GetReleaseID()\n\tp = &PackageNPMMetadata{}\n\tp.GetReleaseID()\n\tp = nil\n\tp.GetReleaseID()\n}\n\nfunc TestPackageNPMMetadata_GetRepository(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]string{}\n\tp := &PackageNPMMetadata{Repository: zeroValue}\n\tp.GetRepository()\n\tp = &PackageNPMMetadata{}\n\tp.GetRepository()\n\tp = nil\n\tp.GetRepository()\n}\n\nfunc TestPackageNPMMetadata_GetScripts(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]any{}\n\tp := &PackageNPMMetadata{Scripts: zeroValue}\n\tp.GetScripts()\n\tp = &PackageNPMMetadata{}\n\tp.GetScripts()\n\tp = nil\n\tp.GetScripts()\n}\n\nfunc TestPackageNPMMetadata_GetVersion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageNPMMetadata{Version: &zeroValue}\n\tp.GetVersion()\n\tp = &PackageNPMMetadata{}\n\tp.GetVersion()\n\tp = nil\n\tp.GetVersion()\n}\n\nfunc TestPackageNugetMetadata_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PackageNugetMetadata{}\n\tp.GetID()\n\tp = nil\n\tp.GetID()\n}\n\nfunc TestPackageNugetMetadata_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageNugetMetadata{Name: &zeroValue}\n\tp.GetName()\n\tp = &PackageNugetMetadata{}\n\tp.GetName()\n\tp = nil\n\tp.GetName()\n}\n\nfunc TestPackageNugetMetadata_GetValue(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PackageNugetMetadata{}\n\tp.GetValue()\n\tp = nil\n\tp.GetValue()\n}\n\nfunc TestPackageRegistry_GetAboutURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageRegistry{AboutURL: &zeroValue}\n\tp.GetAboutURL()\n\tp = &PackageRegistry{}\n\tp.GetAboutURL()\n\tp = nil\n\tp.GetAboutURL()\n}\n\nfunc TestPackageRegistry_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageRegistry{Name: &zeroValue}\n\tp.GetName()\n\tp = &PackageRegistry{}\n\tp.GetName()\n\tp = nil\n\tp.GetName()\n}\n\nfunc TestPackageRegistry_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageRegistry{Type: &zeroValue}\n\tp.GetType()\n\tp = &PackageRegistry{}\n\tp.GetType()\n\tp = nil\n\tp.GetType()\n}\n\nfunc TestPackageRegistry_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageRegistry{URL: &zeroValue}\n\tp.GetURL()\n\tp = &PackageRegistry{}\n\tp.GetURL()\n\tp = nil\n\tp.GetURL()\n}\n\nfunc TestPackageRegistry_GetVendor(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageRegistry{Vendor: &zeroValue}\n\tp.GetVendor()\n\tp = &PackageRegistry{}\n\tp.GetVendor()\n\tp = nil\n\tp.GetVendor()\n}\n\nfunc TestPackageRelease_GetAuthor(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PackageRelease{}\n\tp.GetAuthor()\n\tp = nil\n\tp.GetAuthor()\n}\n\nfunc TestPackageRelease_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PackageRelease{CreatedAt: &zeroValue}\n\tp.GetCreatedAt()\n\tp = &PackageRelease{}\n\tp.GetCreatedAt()\n\tp = nil\n\tp.GetCreatedAt()\n}\n\nfunc TestPackageRelease_GetDraft(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PackageRelease{Draft: &zeroValue}\n\tp.GetDraft()\n\tp = &PackageRelease{}\n\tp.GetDraft()\n\tp = nil\n\tp.GetDraft()\n}\n\nfunc TestPackageRelease_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageRelease{HTMLURL: &zeroValue}\n\tp.GetHTMLURL()\n\tp = &PackageRelease{}\n\tp.GetHTMLURL()\n\tp = nil\n\tp.GetHTMLURL()\n}\n\nfunc TestPackageRelease_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &PackageRelease{ID: &zeroValue}\n\tp.GetID()\n\tp = &PackageRelease{}\n\tp.GetID()\n\tp = nil\n\tp.GetID()\n}\n\nfunc TestPackageRelease_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageRelease{Name: &zeroValue}\n\tp.GetName()\n\tp = &PackageRelease{}\n\tp.GetName()\n\tp = nil\n\tp.GetName()\n}\n\nfunc TestPackageRelease_GetPrerelease(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PackageRelease{Prerelease: &zeroValue}\n\tp.GetPrerelease()\n\tp = &PackageRelease{}\n\tp.GetPrerelease()\n\tp = nil\n\tp.GetPrerelease()\n}\n\nfunc TestPackageRelease_GetPublishedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PackageRelease{PublishedAt: &zeroValue}\n\tp.GetPublishedAt()\n\tp = &PackageRelease{}\n\tp.GetPublishedAt()\n\tp = nil\n\tp.GetPublishedAt()\n}\n\nfunc TestPackageRelease_GetTagName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageRelease{TagName: &zeroValue}\n\tp.GetTagName()\n\tp = &PackageRelease{}\n\tp.GetTagName()\n\tp = nil\n\tp.GetTagName()\n}\n\nfunc TestPackageRelease_GetTargetCommitish(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageRelease{TargetCommitish: &zeroValue}\n\tp.GetTargetCommitish()\n\tp = &PackageRelease{}\n\tp.GetTargetCommitish()\n\tp = nil\n\tp.GetTargetCommitish()\n}\n\nfunc TestPackageRelease_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageRelease{URL: &zeroValue}\n\tp.GetURL()\n\tp = &PackageRelease{}\n\tp.GetURL()\n\tp = nil\n\tp.GetURL()\n}\n\nfunc TestPackagesBilling_GetIncludedGigabytesBandwidth(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PackagesBilling{}\n\tp.GetIncludedGigabytesBandwidth()\n\tp = nil\n\tp.GetIncludedGigabytesBandwidth()\n}\n\nfunc TestPackagesBilling_GetTotalGigabytesBandwidthUsed(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PackagesBilling{}\n\tp.GetTotalGigabytesBandwidthUsed()\n\tp = nil\n\tp.GetTotalGigabytesBandwidthUsed()\n}\n\nfunc TestPackagesBilling_GetTotalPaidGigabytesBandwidthUsed(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PackagesBilling{}\n\tp.GetTotalPaidGigabytesBandwidthUsed()\n\tp = nil\n\tp.GetTotalPaidGigabytesBandwidthUsed()\n}\n\nfunc TestPackageVersion_GetAuthor(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PackageVersion{}\n\tp.GetAuthor()\n\tp = nil\n\tp.GetAuthor()\n}\n\nfunc TestPackageVersion_GetBodyHTML(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageVersion{BodyHTML: &zeroValue}\n\tp.GetBodyHTML()\n\tp = &PackageVersion{}\n\tp.GetBodyHTML()\n\tp = nil\n\tp.GetBodyHTML()\n}\n\nfunc TestPackageVersion_GetContainerMetadata(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PackageVersion{}\n\tp.GetContainerMetadata()\n\tp = nil\n\tp.GetContainerMetadata()\n}\n\nfunc TestPackageVersion_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PackageVersion{CreatedAt: &zeroValue}\n\tp.GetCreatedAt()\n\tp = &PackageVersion{}\n\tp.GetCreatedAt()\n\tp = nil\n\tp.GetCreatedAt()\n}\n\nfunc TestPackageVersion_GetDeletedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PackageVersion{DeletedAt: &zeroValue}\n\tp.GetDeletedAt()\n\tp = &PackageVersion{}\n\tp.GetDeletedAt()\n\tp = nil\n\tp.GetDeletedAt()\n}\n\nfunc TestPackageVersion_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageVersion{Description: &zeroValue}\n\tp.GetDescription()\n\tp = &PackageVersion{}\n\tp.GetDescription()\n\tp = nil\n\tp.GetDescription()\n}\n\nfunc TestPackageVersion_GetDockerMetadata(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []any{}\n\tp := &PackageVersion{DockerMetadata: zeroValue}\n\tp.GetDockerMetadata()\n\tp = &PackageVersion{}\n\tp.GetDockerMetadata()\n\tp = nil\n\tp.GetDockerMetadata()\n}\n\nfunc TestPackageVersion_GetDraft(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PackageVersion{Draft: &zeroValue}\n\tp.GetDraft()\n\tp = &PackageVersion{}\n\tp.GetDraft()\n\tp = nil\n\tp.GetDraft()\n}\n\nfunc TestPackageVersion_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageVersion{HTMLURL: &zeroValue}\n\tp.GetHTMLURL()\n\tp = &PackageVersion{}\n\tp.GetHTMLURL()\n\tp = nil\n\tp.GetHTMLURL()\n}\n\nfunc TestPackageVersion_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &PackageVersion{ID: &zeroValue}\n\tp.GetID()\n\tp = &PackageVersion{}\n\tp.GetID()\n\tp = nil\n\tp.GetID()\n}\n\nfunc TestPackageVersion_GetInstallationCommand(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageVersion{InstallationCommand: &zeroValue}\n\tp.GetInstallationCommand()\n\tp = &PackageVersion{}\n\tp.GetInstallationCommand()\n\tp = nil\n\tp.GetInstallationCommand()\n}\n\nfunc TestPackageVersion_GetLicense(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageVersion{License: &zeroValue}\n\tp.GetLicense()\n\tp = &PackageVersion{}\n\tp.GetLicense()\n\tp = nil\n\tp.GetLicense()\n}\n\nfunc TestPackageVersion_GetManifest(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageVersion{Manifest: &zeroValue}\n\tp.GetManifest()\n\tp = &PackageVersion{}\n\tp.GetManifest()\n\tp = nil\n\tp.GetManifest()\n}\n\nfunc TestPackageVersion_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageVersion{Name: &zeroValue}\n\tp.GetName()\n\tp = &PackageVersion{}\n\tp.GetName()\n\tp = nil\n\tp.GetName()\n}\n\nfunc TestPackageVersion_GetNPMMetadata(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PackageVersion{}\n\tp.GetNPMMetadata()\n\tp = nil\n\tp.GetNPMMetadata()\n}\n\nfunc TestPackageVersion_GetNugetMetadata(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*PackageNugetMetadata{}\n\tp := &PackageVersion{NugetMetadata: zeroValue}\n\tp.GetNugetMetadata()\n\tp = &PackageVersion{}\n\tp.GetNugetMetadata()\n\tp = nil\n\tp.GetNugetMetadata()\n}\n\nfunc TestPackageVersion_GetPackageFiles(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*PackageFile{}\n\tp := &PackageVersion{PackageFiles: zeroValue}\n\tp.GetPackageFiles()\n\tp = &PackageVersion{}\n\tp.GetPackageFiles()\n\tp = nil\n\tp.GetPackageFiles()\n}\n\nfunc TestPackageVersion_GetPackageHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageVersion{PackageHTMLURL: &zeroValue}\n\tp.GetPackageHTMLURL()\n\tp = &PackageVersion{}\n\tp.GetPackageHTMLURL()\n\tp = nil\n\tp.GetPackageHTMLURL()\n}\n\nfunc TestPackageVersion_GetPackageURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageVersion{PackageURL: &zeroValue}\n\tp.GetPackageURL()\n\tp = &PackageVersion{}\n\tp.GetPackageURL()\n\tp = nil\n\tp.GetPackageURL()\n}\n\nfunc TestPackageVersion_GetPrerelease(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PackageVersion{Prerelease: &zeroValue}\n\tp.GetPrerelease()\n\tp = &PackageVersion{}\n\tp.GetPrerelease()\n\tp = nil\n\tp.GetPrerelease()\n}\n\nfunc TestPackageVersion_GetRelease(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PackageVersion{}\n\tp.GetRelease()\n\tp = nil\n\tp.GetRelease()\n}\n\nfunc TestPackageVersion_GetRubyMetadata(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]any{}\n\tp := &PackageVersion{RubyMetadata: zeroValue}\n\tp.GetRubyMetadata()\n\tp = &PackageVersion{}\n\tp.GetRubyMetadata()\n\tp = nil\n\tp.GetRubyMetadata()\n}\n\nfunc TestPackageVersion_GetSourceURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageVersion{SourceURL: &zeroValue}\n\tp.GetSourceURL()\n\tp = &PackageVersion{}\n\tp.GetSourceURL()\n\tp = nil\n\tp.GetSourceURL()\n}\n\nfunc TestPackageVersion_GetSummary(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageVersion{Summary: &zeroValue}\n\tp.GetSummary()\n\tp = &PackageVersion{}\n\tp.GetSummary()\n\tp = nil\n\tp.GetSummary()\n}\n\nfunc TestPackageVersion_GetTagName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageVersion{TagName: &zeroValue}\n\tp.GetTagName()\n\tp = &PackageVersion{}\n\tp.GetTagName()\n\tp = nil\n\tp.GetTagName()\n}\n\nfunc TestPackageVersion_GetTargetCommitish(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageVersion{TargetCommitish: &zeroValue}\n\tp.GetTargetCommitish()\n\tp = &PackageVersion{}\n\tp.GetTargetCommitish()\n\tp = nil\n\tp.GetTargetCommitish()\n}\n\nfunc TestPackageVersion_GetTargetOID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageVersion{TargetOID: &zeroValue}\n\tp.GetTargetOID()\n\tp = &PackageVersion{}\n\tp.GetTargetOID()\n\tp = nil\n\tp.GetTargetOID()\n}\n\nfunc TestPackageVersion_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PackageVersion{UpdatedAt: &zeroValue}\n\tp.GetUpdatedAt()\n\tp = &PackageVersion{}\n\tp.GetUpdatedAt()\n\tp = nil\n\tp.GetUpdatedAt()\n}\n\nfunc TestPackageVersion_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageVersion{URL: &zeroValue}\n\tp.GetURL()\n\tp = &PackageVersion{}\n\tp.GetURL()\n\tp = nil\n\tp.GetURL()\n}\n\nfunc TestPackageVersion_GetVersion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageVersion{Version: &zeroValue}\n\tp.GetVersion()\n\tp = &PackageVersion{}\n\tp.GetVersion()\n\tp = nil\n\tp.GetVersion()\n}\n\nfunc TestPackageVersionBody_GetInfo(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PackageVersionBody{}\n\tp.GetInfo()\n\tp = nil\n\tp.GetInfo()\n}\n\nfunc TestPackageVersionBody_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PackageVersionBody{}\n\tp.GetRepo()\n\tp = nil\n\tp.GetRepo()\n}\n\nfunc TestPackageVersionBodyInfo_GetCollection(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PackageVersionBodyInfo{Collection: &zeroValue}\n\tp.GetCollection()\n\tp = &PackageVersionBodyInfo{}\n\tp.GetCollection()\n\tp = nil\n\tp.GetCollection()\n}\n\nfunc TestPackageVersionBodyInfo_GetMode(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &PackageVersionBodyInfo{Mode: &zeroValue}\n\tp.GetMode()\n\tp = &PackageVersionBodyInfo{}\n\tp.GetMode()\n\tp = nil\n\tp.GetMode()\n}\n\nfunc TestPackageVersionBodyInfo_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageVersionBodyInfo{Name: &zeroValue}\n\tp.GetName()\n\tp = &PackageVersionBodyInfo{}\n\tp.GetName()\n\tp = nil\n\tp.GetName()\n}\n\nfunc TestPackageVersionBodyInfo_GetOID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageVersionBodyInfo{OID: &zeroValue}\n\tp.GetOID()\n\tp = &PackageVersionBodyInfo{}\n\tp.GetOID()\n\tp = nil\n\tp.GetOID()\n}\n\nfunc TestPackageVersionBodyInfo_GetPath(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageVersionBodyInfo{Path: &zeroValue}\n\tp.GetPath()\n\tp = &PackageVersionBodyInfo{}\n\tp.GetPath()\n\tp = nil\n\tp.GetPath()\n}\n\nfunc TestPackageVersionBodyInfo_GetSize(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &PackageVersionBodyInfo{Size: &zeroValue}\n\tp.GetSize()\n\tp = &PackageVersionBodyInfo{}\n\tp.GetSize()\n\tp = nil\n\tp.GetSize()\n}\n\nfunc TestPackageVersionBodyInfo_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PackageVersionBodyInfo{Type: &zeroValue}\n\tp.GetType()\n\tp = &PackageVersionBodyInfo{}\n\tp.GetType()\n\tp = nil\n\tp.GetType()\n}\n\nfunc TestPage_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &Page{Action: &zeroValue}\n\tp.GetAction()\n\tp = &Page{}\n\tp.GetAction()\n\tp = nil\n\tp.GetAction()\n}\n\nfunc TestPage_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &Page{HTMLURL: &zeroValue}\n\tp.GetHTMLURL()\n\tp = &Page{}\n\tp.GetHTMLURL()\n\tp = nil\n\tp.GetHTMLURL()\n}\n\nfunc TestPage_GetPageName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &Page{PageName: &zeroValue}\n\tp.GetPageName()\n\tp = &Page{}\n\tp.GetPageName()\n\tp = nil\n\tp.GetPageName()\n}\n\nfunc TestPage_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &Page{SHA: &zeroValue}\n\tp.GetSHA()\n\tp = &Page{}\n\tp.GetSHA()\n\tp = nil\n\tp.GetSHA()\n}\n\nfunc TestPage_GetSummary(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &Page{Summary: &zeroValue}\n\tp.GetSummary()\n\tp = &Page{}\n\tp.GetSummary()\n\tp = nil\n\tp.GetSummary()\n}\n\nfunc TestPage_GetTitle(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &Page{Title: &zeroValue}\n\tp.GetTitle()\n\tp = &Page{}\n\tp.GetTitle()\n\tp = nil\n\tp.GetTitle()\n}\n\nfunc TestPageBuildEvent_GetBuild(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PageBuildEvent{}\n\tp.GetBuild()\n\tp = nil\n\tp.GetBuild()\n}\n\nfunc TestPageBuildEvent_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &PageBuildEvent{ID: &zeroValue}\n\tp.GetID()\n\tp = &PageBuildEvent{}\n\tp.GetID()\n\tp = nil\n\tp.GetID()\n}\n\nfunc TestPageBuildEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PageBuildEvent{}\n\tp.GetInstallation()\n\tp = nil\n\tp.GetInstallation()\n}\n\nfunc TestPageBuildEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PageBuildEvent{}\n\tp.GetOrg()\n\tp = nil\n\tp.GetOrg()\n}\n\nfunc TestPageBuildEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PageBuildEvent{}\n\tp.GetRepo()\n\tp = nil\n\tp.GetRepo()\n}\n\nfunc TestPageBuildEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PageBuildEvent{}\n\tp.GetSender()\n\tp = nil\n\tp.GetSender()\n}\n\nfunc TestPages_GetBuildType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &Pages{BuildType: &zeroValue}\n\tp.GetBuildType()\n\tp = &Pages{}\n\tp.GetBuildType()\n\tp = nil\n\tp.GetBuildType()\n}\n\nfunc TestPages_GetCNAME(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &Pages{CNAME: &zeroValue}\n\tp.GetCNAME()\n\tp = &Pages{}\n\tp.GetCNAME()\n\tp = nil\n\tp.GetCNAME()\n}\n\nfunc TestPages_GetCustom404(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &Pages{Custom404: &zeroValue}\n\tp.GetCustom404()\n\tp = &Pages{}\n\tp.GetCustom404()\n\tp = nil\n\tp.GetCustom404()\n}\n\nfunc TestPages_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &Pages{HTMLURL: &zeroValue}\n\tp.GetHTMLURL()\n\tp = &Pages{}\n\tp.GetHTMLURL()\n\tp = nil\n\tp.GetHTMLURL()\n}\n\nfunc TestPages_GetHTTPSCertificate(tt *testing.T) {\n\ttt.Parallel()\n\tp := &Pages{}\n\tp.GetHTTPSCertificate()\n\tp = nil\n\tp.GetHTTPSCertificate()\n}\n\nfunc TestPages_GetHTTPSEnforced(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &Pages{HTTPSEnforced: &zeroValue}\n\tp.GetHTTPSEnforced()\n\tp = &Pages{}\n\tp.GetHTTPSEnforced()\n\tp = nil\n\tp.GetHTTPSEnforced()\n}\n\nfunc TestPages_GetPublic(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &Pages{Public: &zeroValue}\n\tp.GetPublic()\n\tp = &Pages{}\n\tp.GetPublic()\n\tp = nil\n\tp.GetPublic()\n}\n\nfunc TestPages_GetSource(tt *testing.T) {\n\ttt.Parallel()\n\tp := &Pages{}\n\tp.GetSource()\n\tp = nil\n\tp.GetSource()\n}\n\nfunc TestPages_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &Pages{Status: &zeroValue}\n\tp.GetStatus()\n\tp = &Pages{}\n\tp.GetStatus()\n\tp = nil\n\tp.GetStatus()\n}\n\nfunc TestPages_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &Pages{URL: &zeroValue}\n\tp.GetURL()\n\tp = &Pages{}\n\tp.GetURL()\n\tp = nil\n\tp.GetURL()\n}\n\nfunc TestPagesBuild_GetCommit(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PagesBuild{Commit: &zeroValue}\n\tp.GetCommit()\n\tp = &PagesBuild{}\n\tp.GetCommit()\n\tp = nil\n\tp.GetCommit()\n}\n\nfunc TestPagesBuild_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PagesBuild{CreatedAt: &zeroValue}\n\tp.GetCreatedAt()\n\tp = &PagesBuild{}\n\tp.GetCreatedAt()\n\tp = nil\n\tp.GetCreatedAt()\n}\n\nfunc TestPagesBuild_GetDuration(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PagesBuild{Duration: &zeroValue}\n\tp.GetDuration()\n\tp = &PagesBuild{}\n\tp.GetDuration()\n\tp = nil\n\tp.GetDuration()\n}\n\nfunc TestPagesBuild_GetError(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PagesBuild{}\n\tp.GetError()\n\tp = nil\n\tp.GetError()\n}\n\nfunc TestPagesBuild_GetPusher(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PagesBuild{}\n\tp.GetPusher()\n\tp = nil\n\tp.GetPusher()\n}\n\nfunc TestPagesBuild_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PagesBuild{Status: &zeroValue}\n\tp.GetStatus()\n\tp = &PagesBuild{}\n\tp.GetStatus()\n\tp = nil\n\tp.GetStatus()\n}\n\nfunc TestPagesBuild_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PagesBuild{UpdatedAt: &zeroValue}\n\tp.GetUpdatedAt()\n\tp = &PagesBuild{}\n\tp.GetUpdatedAt()\n\tp = nil\n\tp.GetUpdatedAt()\n}\n\nfunc TestPagesBuild_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PagesBuild{URL: &zeroValue}\n\tp.GetURL()\n\tp = &PagesBuild{}\n\tp.GetURL()\n\tp = nil\n\tp.GetURL()\n}\n\nfunc TestPagesDomain_GetCAAError(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PagesDomain{CAAError: &zeroValue}\n\tp.GetCAAError()\n\tp = &PagesDomain{}\n\tp.GetCAAError()\n\tp = nil\n\tp.GetCAAError()\n}\n\nfunc TestPagesDomain_GetDNSResolves(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PagesDomain{DNSResolves: &zeroValue}\n\tp.GetDNSResolves()\n\tp = &PagesDomain{}\n\tp.GetDNSResolves()\n\tp = nil\n\tp.GetDNSResolves()\n}\n\nfunc TestPagesDomain_GetEnforcesHTTPS(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PagesDomain{EnforcesHTTPS: &zeroValue}\n\tp.GetEnforcesHTTPS()\n\tp = &PagesDomain{}\n\tp.GetEnforcesHTTPS()\n\tp = nil\n\tp.GetEnforcesHTTPS()\n}\n\nfunc TestPagesDomain_GetHasCNAMERecord(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PagesDomain{HasCNAMERecord: &zeroValue}\n\tp.GetHasCNAMERecord()\n\tp = &PagesDomain{}\n\tp.GetHasCNAMERecord()\n\tp = nil\n\tp.GetHasCNAMERecord()\n}\n\nfunc TestPagesDomain_GetHasMXRecordsPresent(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PagesDomain{HasMXRecordsPresent: &zeroValue}\n\tp.GetHasMXRecordsPresent()\n\tp = &PagesDomain{}\n\tp.GetHasMXRecordsPresent()\n\tp = nil\n\tp.GetHasMXRecordsPresent()\n}\n\nfunc TestPagesDomain_GetHost(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PagesDomain{Host: &zeroValue}\n\tp.GetHost()\n\tp = &PagesDomain{}\n\tp.GetHost()\n\tp = nil\n\tp.GetHost()\n}\n\nfunc TestPagesDomain_GetHTTPSError(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PagesDomain{HTTPSError: &zeroValue}\n\tp.GetHTTPSError()\n\tp = &PagesDomain{}\n\tp.GetHTTPSError()\n\tp = nil\n\tp.GetHTTPSError()\n}\n\nfunc TestPagesDomain_GetIsApexDomain(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PagesDomain{IsApexDomain: &zeroValue}\n\tp.GetIsApexDomain()\n\tp = &PagesDomain{}\n\tp.GetIsApexDomain()\n\tp = nil\n\tp.GetIsApexDomain()\n}\n\nfunc TestPagesDomain_GetIsARecord(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PagesDomain{IsARecord: &zeroValue}\n\tp.GetIsARecord()\n\tp = &PagesDomain{}\n\tp.GetIsARecord()\n\tp = nil\n\tp.GetIsARecord()\n}\n\nfunc TestPagesDomain_GetIsCloudflareIP(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PagesDomain{IsCloudflareIP: &zeroValue}\n\tp.GetIsCloudflareIP()\n\tp = &PagesDomain{}\n\tp.GetIsCloudflareIP()\n\tp = nil\n\tp.GetIsCloudflareIP()\n}\n\nfunc TestPagesDomain_GetIsCNAMEToFastly(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PagesDomain{IsCNAMEToFastly: &zeroValue}\n\tp.GetIsCNAMEToFastly()\n\tp = &PagesDomain{}\n\tp.GetIsCNAMEToFastly()\n\tp = nil\n\tp.GetIsCNAMEToFastly()\n}\n\nfunc TestPagesDomain_GetIsCNAMEToGithubUserDomain(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PagesDomain{IsCNAMEToGithubUserDomain: &zeroValue}\n\tp.GetIsCNAMEToGithubUserDomain()\n\tp = &PagesDomain{}\n\tp.GetIsCNAMEToGithubUserDomain()\n\tp = nil\n\tp.GetIsCNAMEToGithubUserDomain()\n}\n\nfunc TestPagesDomain_GetIsCNAMEToPagesDotGithubDotCom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PagesDomain{IsCNAMEToPagesDotGithubDotCom: &zeroValue}\n\tp.GetIsCNAMEToPagesDotGithubDotCom()\n\tp = &PagesDomain{}\n\tp.GetIsCNAMEToPagesDotGithubDotCom()\n\tp = nil\n\tp.GetIsCNAMEToPagesDotGithubDotCom()\n}\n\nfunc TestPagesDomain_GetIsFastlyIP(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PagesDomain{IsFastlyIP: &zeroValue}\n\tp.GetIsFastlyIP()\n\tp = &PagesDomain{}\n\tp.GetIsFastlyIP()\n\tp = nil\n\tp.GetIsFastlyIP()\n}\n\nfunc TestPagesDomain_GetIsHTTPSEligible(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PagesDomain{IsHTTPSEligible: &zeroValue}\n\tp.GetIsHTTPSEligible()\n\tp = &PagesDomain{}\n\tp.GetIsHTTPSEligible()\n\tp = nil\n\tp.GetIsHTTPSEligible()\n}\n\nfunc TestPagesDomain_GetIsNonGithubPagesIPPresent(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PagesDomain{IsNonGithubPagesIPPresent: &zeroValue}\n\tp.GetIsNonGithubPagesIPPresent()\n\tp = &PagesDomain{}\n\tp.GetIsNonGithubPagesIPPresent()\n\tp = nil\n\tp.GetIsNonGithubPagesIPPresent()\n}\n\nfunc TestPagesDomain_GetIsOldIPAddress(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PagesDomain{IsOldIPAddress: &zeroValue}\n\tp.GetIsOldIPAddress()\n\tp = &PagesDomain{}\n\tp.GetIsOldIPAddress()\n\tp = nil\n\tp.GetIsOldIPAddress()\n}\n\nfunc TestPagesDomain_GetIsPagesDomain(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PagesDomain{IsPagesDomain: &zeroValue}\n\tp.GetIsPagesDomain()\n\tp = &PagesDomain{}\n\tp.GetIsPagesDomain()\n\tp = nil\n\tp.GetIsPagesDomain()\n}\n\nfunc TestPagesDomain_GetIsPointedToGithubPagesIP(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PagesDomain{IsPointedToGithubPagesIP: &zeroValue}\n\tp.GetIsPointedToGithubPagesIP()\n\tp = &PagesDomain{}\n\tp.GetIsPointedToGithubPagesIP()\n\tp = nil\n\tp.GetIsPointedToGithubPagesIP()\n}\n\nfunc TestPagesDomain_GetIsProxied(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PagesDomain{IsProxied: &zeroValue}\n\tp.GetIsProxied()\n\tp = &PagesDomain{}\n\tp.GetIsProxied()\n\tp = nil\n\tp.GetIsProxied()\n}\n\nfunc TestPagesDomain_GetIsServedByPages(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PagesDomain{IsServedByPages: &zeroValue}\n\tp.GetIsServedByPages()\n\tp = &PagesDomain{}\n\tp.GetIsServedByPages()\n\tp = nil\n\tp.GetIsServedByPages()\n}\n\nfunc TestPagesDomain_GetIsValid(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PagesDomain{IsValid: &zeroValue}\n\tp.GetIsValid()\n\tp = &PagesDomain{}\n\tp.GetIsValid()\n\tp = nil\n\tp.GetIsValid()\n}\n\nfunc TestPagesDomain_GetIsValidDomain(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PagesDomain{IsValidDomain: &zeroValue}\n\tp.GetIsValidDomain()\n\tp = &PagesDomain{}\n\tp.GetIsValidDomain()\n\tp = nil\n\tp.GetIsValidDomain()\n}\n\nfunc TestPagesDomain_GetNameservers(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PagesDomain{Nameservers: &zeroValue}\n\tp.GetNameservers()\n\tp = &PagesDomain{}\n\tp.GetNameservers()\n\tp = nil\n\tp.GetNameservers()\n}\n\nfunc TestPagesDomain_GetReason(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PagesDomain{Reason: &zeroValue}\n\tp.GetReason()\n\tp = &PagesDomain{}\n\tp.GetReason()\n\tp = nil\n\tp.GetReason()\n}\n\nfunc TestPagesDomain_GetRespondsToHTTPS(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PagesDomain{RespondsToHTTPS: &zeroValue}\n\tp.GetRespondsToHTTPS()\n\tp = &PagesDomain{}\n\tp.GetRespondsToHTTPS()\n\tp = nil\n\tp.GetRespondsToHTTPS()\n}\n\nfunc TestPagesDomain_GetShouldBeARecord(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PagesDomain{ShouldBeARecord: &zeroValue}\n\tp.GetShouldBeARecord()\n\tp = &PagesDomain{}\n\tp.GetShouldBeARecord()\n\tp = nil\n\tp.GetShouldBeARecord()\n}\n\nfunc TestPagesDomain_GetURI(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PagesDomain{URI: &zeroValue}\n\tp.GetURI()\n\tp = &PagesDomain{}\n\tp.GetURI()\n\tp = nil\n\tp.GetURI()\n}\n\nfunc TestPagesError_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PagesError{Message: &zeroValue}\n\tp.GetMessage()\n\tp = &PagesError{}\n\tp.GetMessage()\n\tp = nil\n\tp.GetMessage()\n}\n\nfunc TestPagesHealthCheckResponse_GetAltDomain(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PagesHealthCheckResponse{}\n\tp.GetAltDomain()\n\tp = nil\n\tp.GetAltDomain()\n}\n\nfunc TestPagesHealthCheckResponse_GetDomain(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PagesHealthCheckResponse{}\n\tp.GetDomain()\n\tp = nil\n\tp.GetDomain()\n}\n\nfunc TestPagesHTTPSCertificate_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PagesHTTPSCertificate{Description: &zeroValue}\n\tp.GetDescription()\n\tp = &PagesHTTPSCertificate{}\n\tp.GetDescription()\n\tp = nil\n\tp.GetDescription()\n}\n\nfunc TestPagesHTTPSCertificate_GetDomains(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tp := &PagesHTTPSCertificate{Domains: zeroValue}\n\tp.GetDomains()\n\tp = &PagesHTTPSCertificate{}\n\tp.GetDomains()\n\tp = nil\n\tp.GetDomains()\n}\n\nfunc TestPagesHTTPSCertificate_GetExpiresAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PagesHTTPSCertificate{ExpiresAt: &zeroValue}\n\tp.GetExpiresAt()\n\tp = &PagesHTTPSCertificate{}\n\tp.GetExpiresAt()\n\tp = nil\n\tp.GetExpiresAt()\n}\n\nfunc TestPagesHTTPSCertificate_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PagesHTTPSCertificate{State: &zeroValue}\n\tp.GetState()\n\tp = &PagesHTTPSCertificate{}\n\tp.GetState()\n\tp = nil\n\tp.GetState()\n}\n\nfunc TestPagesSource_GetBranch(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PagesSource{Branch: &zeroValue}\n\tp.GetBranch()\n\tp = &PagesSource{}\n\tp.GetBranch()\n\tp = nil\n\tp.GetBranch()\n}\n\nfunc TestPagesSource_GetPath(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PagesSource{Path: &zeroValue}\n\tp.GetPath()\n\tp = &PagesSource{}\n\tp.GetPath()\n\tp = nil\n\tp.GetPath()\n}\n\nfunc TestPageStats_GetTotalPages(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PageStats{TotalPages: &zeroValue}\n\tp.GetTotalPages()\n\tp = &PageStats{}\n\tp.GetTotalPages()\n\tp = nil\n\tp.GetTotalPages()\n}\n\nfunc TestPagesUpdate_GetBuildType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PagesUpdate{BuildType: &zeroValue}\n\tp.GetBuildType()\n\tp = &PagesUpdate{}\n\tp.GetBuildType()\n\tp = nil\n\tp.GetBuildType()\n}\n\nfunc TestPagesUpdate_GetCNAME(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PagesUpdate{CNAME: &zeroValue}\n\tp.GetCNAME()\n\tp = &PagesUpdate{}\n\tp.GetCNAME()\n\tp = nil\n\tp.GetCNAME()\n}\n\nfunc TestPagesUpdate_GetHTTPSEnforced(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PagesUpdate{HTTPSEnforced: &zeroValue}\n\tp.GetHTTPSEnforced()\n\tp = &PagesUpdate{}\n\tp.GetHTTPSEnforced()\n\tp = nil\n\tp.GetHTTPSEnforced()\n}\n\nfunc TestPagesUpdate_GetPublic(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PagesUpdate{Public: &zeroValue}\n\tp.GetPublic()\n\tp = &PagesUpdate{}\n\tp.GetPublic()\n\tp = nil\n\tp.GetPublic()\n}\n\nfunc TestPagesUpdate_GetSource(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PagesUpdate{}\n\tp.GetSource()\n\tp = nil\n\tp.GetSource()\n}\n\nfunc TestPagesUpdateWithoutCNAME_GetBuildType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PagesUpdateWithoutCNAME{BuildType: &zeroValue}\n\tp.GetBuildType()\n\tp = &PagesUpdateWithoutCNAME{}\n\tp.GetBuildType()\n\tp = nil\n\tp.GetBuildType()\n}\n\nfunc TestPagesUpdateWithoutCNAME_GetHTTPSEnforced(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PagesUpdateWithoutCNAME{HTTPSEnforced: &zeroValue}\n\tp.GetHTTPSEnforced()\n\tp = &PagesUpdateWithoutCNAME{}\n\tp.GetHTTPSEnforced()\n\tp = nil\n\tp.GetHTTPSEnforced()\n}\n\nfunc TestPagesUpdateWithoutCNAME_GetPublic(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PagesUpdateWithoutCNAME{Public: &zeroValue}\n\tp.GetPublic()\n\tp = &PagesUpdateWithoutCNAME{}\n\tp.GetPublic()\n\tp = nil\n\tp.GetPublic()\n}\n\nfunc TestPagesUpdateWithoutCNAME_GetSource(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PagesUpdateWithoutCNAME{}\n\tp.GetSource()\n\tp = nil\n\tp.GetSource()\n}\n\nfunc TestPatternBranchRule_GetParameters(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PatternBranchRule{}\n\tp.GetParameters()\n\tp = nil\n\tp.GetParameters()\n}\n\nfunc TestPatternRuleParameters_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PatternRuleParameters{Name: &zeroValue}\n\tp.GetName()\n\tp = &PatternRuleParameters{}\n\tp.GetName()\n\tp = nil\n\tp.GetName()\n}\n\nfunc TestPatternRuleParameters_GetNegate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PatternRuleParameters{Negate: &zeroValue}\n\tp.GetNegate()\n\tp = &PatternRuleParameters{}\n\tp.GetNegate()\n\tp = nil\n\tp.GetNegate()\n}\n\nfunc TestPatternRuleParameters_GetOperator(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PatternRuleParameters{}\n\tp.GetOperator()\n\tp = nil\n\tp.GetOperator()\n}\n\nfunc TestPatternRuleParameters_GetPattern(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PatternRuleParameters{}\n\tp.GetPattern()\n\tp = nil\n\tp.GetPattern()\n}\n\nfunc TestPendingDeployment_GetCurrentUserCanApprove(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PendingDeployment{CurrentUserCanApprove: &zeroValue}\n\tp.GetCurrentUserCanApprove()\n\tp = &PendingDeployment{}\n\tp.GetCurrentUserCanApprove()\n\tp = nil\n\tp.GetCurrentUserCanApprove()\n}\n\nfunc TestPendingDeployment_GetEnvironment(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PendingDeployment{}\n\tp.GetEnvironment()\n\tp = nil\n\tp.GetEnvironment()\n}\n\nfunc TestPendingDeployment_GetReviewers(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*RequiredReviewer{}\n\tp := &PendingDeployment{Reviewers: zeroValue}\n\tp.GetReviewers()\n\tp = &PendingDeployment{}\n\tp.GetReviewers()\n\tp = nil\n\tp.GetReviewers()\n}\n\nfunc TestPendingDeployment_GetWaitTimer(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &PendingDeployment{WaitTimer: &zeroValue}\n\tp.GetWaitTimer()\n\tp = &PendingDeployment{}\n\tp.GetWaitTimer()\n\tp = nil\n\tp.GetWaitTimer()\n}\n\nfunc TestPendingDeployment_GetWaitTimerStartedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PendingDeployment{WaitTimerStartedAt: &zeroValue}\n\tp.GetWaitTimerStartedAt()\n\tp = &PendingDeployment{}\n\tp.GetWaitTimerStartedAt()\n\tp = nil\n\tp.GetWaitTimerStartedAt()\n}\n\nfunc TestPendingDeploymentEnvironment_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PendingDeploymentEnvironment{HTMLURL: &zeroValue}\n\tp.GetHTMLURL()\n\tp = &PendingDeploymentEnvironment{}\n\tp.GetHTMLURL()\n\tp = nil\n\tp.GetHTMLURL()\n}\n\nfunc TestPendingDeploymentEnvironment_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &PendingDeploymentEnvironment{ID: &zeroValue}\n\tp.GetID()\n\tp = &PendingDeploymentEnvironment{}\n\tp.GetID()\n\tp = nil\n\tp.GetID()\n}\n\nfunc TestPendingDeploymentEnvironment_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PendingDeploymentEnvironment{Name: &zeroValue}\n\tp.GetName()\n\tp = &PendingDeploymentEnvironment{}\n\tp.GetName()\n\tp = nil\n\tp.GetName()\n}\n\nfunc TestPendingDeploymentEnvironment_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PendingDeploymentEnvironment{NodeID: &zeroValue}\n\tp.GetNodeID()\n\tp = &PendingDeploymentEnvironment{}\n\tp.GetNodeID()\n\tp = nil\n\tp.GetNodeID()\n}\n\nfunc TestPendingDeploymentEnvironment_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PendingDeploymentEnvironment{URL: &zeroValue}\n\tp.GetURL()\n\tp = &PendingDeploymentEnvironment{}\n\tp.GetURL()\n\tp = nil\n\tp.GetURL()\n}\n\nfunc TestPendingDeploymentsRequest_GetComment(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PendingDeploymentsRequest{}\n\tp.GetComment()\n\tp = nil\n\tp.GetComment()\n}\n\nfunc TestPendingDeploymentsRequest_GetEnvironmentIDs(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []int64{}\n\tp := &PendingDeploymentsRequest{EnvironmentIDs: zeroValue}\n\tp.GetEnvironmentIDs()\n\tp = &PendingDeploymentsRequest{}\n\tp.GetEnvironmentIDs()\n\tp = nil\n\tp.GetEnvironmentIDs()\n}\n\nfunc TestPendingDeploymentsRequest_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PendingDeploymentsRequest{}\n\tp.GetState()\n\tp = nil\n\tp.GetState()\n}\n\nfunc TestPersonalAccessToken_GetAccessGrantedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PersonalAccessToken{AccessGrantedAt: &zeroValue}\n\tp.GetAccessGrantedAt()\n\tp = &PersonalAccessToken{}\n\tp.GetAccessGrantedAt()\n\tp = nil\n\tp.GetAccessGrantedAt()\n}\n\nfunc TestPersonalAccessToken_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &PersonalAccessToken{ID: &zeroValue}\n\tp.GetID()\n\tp = &PersonalAccessToken{}\n\tp.GetID()\n\tp = nil\n\tp.GetID()\n}\n\nfunc TestPersonalAccessToken_GetOwner(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PersonalAccessToken{}\n\tp.GetOwner()\n\tp = nil\n\tp.GetOwner()\n}\n\nfunc TestPersonalAccessToken_GetPermissions(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PersonalAccessToken{}\n\tp.GetPermissions()\n\tp = nil\n\tp.GetPermissions()\n}\n\nfunc TestPersonalAccessToken_GetRepositoriesURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PersonalAccessToken{RepositoriesURL: &zeroValue}\n\tp.GetRepositoriesURL()\n\tp = &PersonalAccessToken{}\n\tp.GetRepositoriesURL()\n\tp = nil\n\tp.GetRepositoriesURL()\n}\n\nfunc TestPersonalAccessToken_GetRepositorySelection(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PersonalAccessToken{RepositorySelection: &zeroValue}\n\tp.GetRepositorySelection()\n\tp = &PersonalAccessToken{}\n\tp.GetRepositorySelection()\n\tp = nil\n\tp.GetRepositorySelection()\n}\n\nfunc TestPersonalAccessToken_GetTokenExpired(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PersonalAccessToken{TokenExpired: &zeroValue}\n\tp.GetTokenExpired()\n\tp = &PersonalAccessToken{}\n\tp.GetTokenExpired()\n\tp = nil\n\tp.GetTokenExpired()\n}\n\nfunc TestPersonalAccessToken_GetTokenExpiresAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PersonalAccessToken{TokenExpiresAt: &zeroValue}\n\tp.GetTokenExpiresAt()\n\tp = &PersonalAccessToken{}\n\tp.GetTokenExpiresAt()\n\tp = nil\n\tp.GetTokenExpiresAt()\n}\n\nfunc TestPersonalAccessToken_GetTokenID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &PersonalAccessToken{TokenID: &zeroValue}\n\tp.GetTokenID()\n\tp = &PersonalAccessToken{}\n\tp.GetTokenID()\n\tp = nil\n\tp.GetTokenID()\n}\n\nfunc TestPersonalAccessToken_GetTokenLastUsedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PersonalAccessToken{TokenLastUsedAt: &zeroValue}\n\tp.GetTokenLastUsedAt()\n\tp = &PersonalAccessToken{}\n\tp.GetTokenLastUsedAt()\n\tp = nil\n\tp.GetTokenLastUsedAt()\n}\n\nfunc TestPersonalAccessToken_GetTokenName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PersonalAccessToken{TokenName: &zeroValue}\n\tp.GetTokenName()\n\tp = &PersonalAccessToken{}\n\tp.GetTokenName()\n\tp = nil\n\tp.GetTokenName()\n}\n\nfunc TestPersonalAccessTokenPermissions_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]string{}\n\tp := &PersonalAccessTokenPermissions{Org: zeroValue}\n\tp.GetOrg()\n\tp = &PersonalAccessTokenPermissions{}\n\tp.GetOrg()\n\tp = nil\n\tp.GetOrg()\n}\n\nfunc TestPersonalAccessTokenPermissions_GetOther(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]string{}\n\tp := &PersonalAccessTokenPermissions{Other: zeroValue}\n\tp.GetOther()\n\tp = &PersonalAccessTokenPermissions{}\n\tp.GetOther()\n\tp = nil\n\tp.GetOther()\n}\n\nfunc TestPersonalAccessTokenPermissions_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]string{}\n\tp := &PersonalAccessTokenPermissions{Repo: zeroValue}\n\tp.GetRepo()\n\tp = &PersonalAccessTokenPermissions{}\n\tp.GetRepo()\n\tp = nil\n\tp.GetRepo()\n}\n\nfunc TestPersonalAccessTokenRequest_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PersonalAccessTokenRequest{CreatedAt: &zeroValue}\n\tp.GetCreatedAt()\n\tp = &PersonalAccessTokenRequest{}\n\tp.GetCreatedAt()\n\tp = nil\n\tp.GetCreatedAt()\n}\n\nfunc TestPersonalAccessTokenRequest_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &PersonalAccessTokenRequest{ID: &zeroValue}\n\tp.GetID()\n\tp = &PersonalAccessTokenRequest{}\n\tp.GetID()\n\tp = nil\n\tp.GetID()\n}\n\nfunc TestPersonalAccessTokenRequest_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PersonalAccessTokenRequest{}\n\tp.GetOrg()\n\tp = nil\n\tp.GetOrg()\n}\n\nfunc TestPersonalAccessTokenRequest_GetOwner(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PersonalAccessTokenRequest{}\n\tp.GetOwner()\n\tp = nil\n\tp.GetOwner()\n}\n\nfunc TestPersonalAccessTokenRequest_GetPermissionsAdded(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PersonalAccessTokenRequest{}\n\tp.GetPermissionsAdded()\n\tp = nil\n\tp.GetPermissionsAdded()\n}\n\nfunc TestPersonalAccessTokenRequest_GetPermissionsResult(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PersonalAccessTokenRequest{}\n\tp.GetPermissionsResult()\n\tp = nil\n\tp.GetPermissionsResult()\n}\n\nfunc TestPersonalAccessTokenRequest_GetPermissionsUpgraded(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PersonalAccessTokenRequest{}\n\tp.GetPermissionsUpgraded()\n\tp = nil\n\tp.GetPermissionsUpgraded()\n}\n\nfunc TestPersonalAccessTokenRequest_GetRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Repository{}\n\tp := &PersonalAccessTokenRequest{Repositories: zeroValue}\n\tp.GetRepositories()\n\tp = &PersonalAccessTokenRequest{}\n\tp.GetRepositories()\n\tp = nil\n\tp.GetRepositories()\n}\n\nfunc TestPersonalAccessTokenRequest_GetRepositoryCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &PersonalAccessTokenRequest{RepositoryCount: &zeroValue}\n\tp.GetRepositoryCount()\n\tp = &PersonalAccessTokenRequest{}\n\tp.GetRepositoryCount()\n\tp = nil\n\tp.GetRepositoryCount()\n}\n\nfunc TestPersonalAccessTokenRequest_GetRepositorySelection(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PersonalAccessTokenRequest{RepositorySelection: &zeroValue}\n\tp.GetRepositorySelection()\n\tp = &PersonalAccessTokenRequest{}\n\tp.GetRepositorySelection()\n\tp = nil\n\tp.GetRepositorySelection()\n}\n\nfunc TestPersonalAccessTokenRequest_GetTokenExpired(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PersonalAccessTokenRequest{TokenExpired: &zeroValue}\n\tp.GetTokenExpired()\n\tp = &PersonalAccessTokenRequest{}\n\tp.GetTokenExpired()\n\tp = nil\n\tp.GetTokenExpired()\n}\n\nfunc TestPersonalAccessTokenRequest_GetTokenExpiresAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PersonalAccessTokenRequest{TokenExpiresAt: &zeroValue}\n\tp.GetTokenExpiresAt()\n\tp = &PersonalAccessTokenRequest{}\n\tp.GetTokenExpiresAt()\n\tp = nil\n\tp.GetTokenExpiresAt()\n}\n\nfunc TestPersonalAccessTokenRequest_GetTokenLastUsedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PersonalAccessTokenRequest{TokenLastUsedAt: &zeroValue}\n\tp.GetTokenLastUsedAt()\n\tp = &PersonalAccessTokenRequest{}\n\tp.GetTokenLastUsedAt()\n\tp = nil\n\tp.GetTokenLastUsedAt()\n}\n\nfunc TestPersonalAccessTokenRequestEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PersonalAccessTokenRequestEvent{Action: &zeroValue}\n\tp.GetAction()\n\tp = &PersonalAccessTokenRequestEvent{}\n\tp.GetAction()\n\tp = nil\n\tp.GetAction()\n}\n\nfunc TestPersonalAccessTokenRequestEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PersonalAccessTokenRequestEvent{}\n\tp.GetInstallation()\n\tp = nil\n\tp.GetInstallation()\n}\n\nfunc TestPersonalAccessTokenRequestEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PersonalAccessTokenRequestEvent{}\n\tp.GetOrg()\n\tp = nil\n\tp.GetOrg()\n}\n\nfunc TestPersonalAccessTokenRequestEvent_GetPersonalAccessTokenRequest(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PersonalAccessTokenRequestEvent{}\n\tp.GetPersonalAccessTokenRequest()\n\tp = nil\n\tp.GetPersonalAccessTokenRequest()\n}\n\nfunc TestPersonalAccessTokenRequestEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PersonalAccessTokenRequestEvent{}\n\tp.GetSender()\n\tp = nil\n\tp.GetSender()\n}\n\nfunc TestPingEvent_GetHook(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PingEvent{}\n\tp.GetHook()\n\tp = nil\n\tp.GetHook()\n}\n\nfunc TestPingEvent_GetHookID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &PingEvent{HookID: &zeroValue}\n\tp.GetHookID()\n\tp = &PingEvent{}\n\tp.GetHookID()\n\tp = nil\n\tp.GetHookID()\n}\n\nfunc TestPingEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PingEvent{}\n\tp.GetInstallation()\n\tp = nil\n\tp.GetInstallation()\n}\n\nfunc TestPingEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PingEvent{}\n\tp.GetOrg()\n\tp = nil\n\tp.GetOrg()\n}\n\nfunc TestPingEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PingEvent{}\n\tp.GetRepo()\n\tp = nil\n\tp.GetRepo()\n}\n\nfunc TestPingEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PingEvent{}\n\tp.GetSender()\n\tp = nil\n\tp.GetSender()\n}\n\nfunc TestPingEvent_GetZen(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PingEvent{Zen: &zeroValue}\n\tp.GetZen()\n\tp = &PingEvent{}\n\tp.GetZen()\n\tp = nil\n\tp.GetZen()\n}\n\nfunc TestPlan_GetCollaborators(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &Plan{Collaborators: &zeroValue}\n\tp.GetCollaborators()\n\tp = &Plan{}\n\tp.GetCollaborators()\n\tp = nil\n\tp.GetCollaborators()\n}\n\nfunc TestPlan_GetFilledSeats(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &Plan{FilledSeats: &zeroValue}\n\tp.GetFilledSeats()\n\tp = &Plan{}\n\tp.GetFilledSeats()\n\tp = nil\n\tp.GetFilledSeats()\n}\n\nfunc TestPlan_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &Plan{Name: &zeroValue}\n\tp.GetName()\n\tp = &Plan{}\n\tp.GetName()\n\tp = nil\n\tp.GetName()\n}\n\nfunc TestPlan_GetPrivateRepos(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &Plan{PrivateRepos: &zeroValue}\n\tp.GetPrivateRepos()\n\tp = &Plan{}\n\tp.GetPrivateRepos()\n\tp = nil\n\tp.GetPrivateRepos()\n}\n\nfunc TestPlan_GetSeats(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &Plan{Seats: &zeroValue}\n\tp.GetSeats()\n\tp = &Plan{}\n\tp.GetSeats()\n\tp = nil\n\tp.GetSeats()\n}\n\nfunc TestPlan_GetSpace(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &Plan{Space: &zeroValue}\n\tp.GetSpace()\n\tp = &Plan{}\n\tp.GetSpace()\n\tp = nil\n\tp.GetSpace()\n}\n\nfunc TestPreferenceList_GetAutoTriggerChecks(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*AutoTriggerCheck{}\n\tp := &PreferenceList{AutoTriggerChecks: zeroValue}\n\tp.GetAutoTriggerChecks()\n\tp = &PreferenceList{}\n\tp.GetAutoTriggerChecks()\n\tp = nil\n\tp.GetAutoTriggerChecks()\n}\n\nfunc TestPremiumRequestUsageItem_GetDiscountAmount(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PremiumRequestUsageItem{}\n\tp.GetDiscountAmount()\n\tp = nil\n\tp.GetDiscountAmount()\n}\n\nfunc TestPremiumRequestUsageItem_GetDiscountQuantity(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PremiumRequestUsageItem{}\n\tp.GetDiscountQuantity()\n\tp = nil\n\tp.GetDiscountQuantity()\n}\n\nfunc TestPremiumRequestUsageItem_GetGrossAmount(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PremiumRequestUsageItem{}\n\tp.GetGrossAmount()\n\tp = nil\n\tp.GetGrossAmount()\n}\n\nfunc TestPremiumRequestUsageItem_GetGrossQuantity(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PremiumRequestUsageItem{}\n\tp.GetGrossQuantity()\n\tp = nil\n\tp.GetGrossQuantity()\n}\n\nfunc TestPremiumRequestUsageItem_GetModel(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PremiumRequestUsageItem{}\n\tp.GetModel()\n\tp = nil\n\tp.GetModel()\n}\n\nfunc TestPremiumRequestUsageItem_GetNetAmount(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PremiumRequestUsageItem{}\n\tp.GetNetAmount()\n\tp = nil\n\tp.GetNetAmount()\n}\n\nfunc TestPremiumRequestUsageItem_GetNetQuantity(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PremiumRequestUsageItem{}\n\tp.GetNetQuantity()\n\tp = nil\n\tp.GetNetQuantity()\n}\n\nfunc TestPremiumRequestUsageItem_GetPricePerUnit(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PremiumRequestUsageItem{}\n\tp.GetPricePerUnit()\n\tp = nil\n\tp.GetPricePerUnit()\n}\n\nfunc TestPremiumRequestUsageItem_GetProduct(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PremiumRequestUsageItem{}\n\tp.GetProduct()\n\tp = nil\n\tp.GetProduct()\n}\n\nfunc TestPremiumRequestUsageItem_GetSKU(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PremiumRequestUsageItem{}\n\tp.GetSKU()\n\tp = nil\n\tp.GetSKU()\n}\n\nfunc TestPremiumRequestUsageItem_GetUnitType(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PremiumRequestUsageItem{}\n\tp.GetUnitType()\n\tp = nil\n\tp.GetUnitType()\n}\n\nfunc TestPremiumRequestUsageReport_GetModel(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PremiumRequestUsageReport{Model: &zeroValue}\n\tp.GetModel()\n\tp = &PremiumRequestUsageReport{}\n\tp.GetModel()\n\tp = nil\n\tp.GetModel()\n}\n\nfunc TestPremiumRequestUsageReport_GetOrganization(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PremiumRequestUsageReport{Organization: &zeroValue}\n\tp.GetOrganization()\n\tp = &PremiumRequestUsageReport{}\n\tp.GetOrganization()\n\tp = nil\n\tp.GetOrganization()\n}\n\nfunc TestPremiumRequestUsageReport_GetProduct(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PremiumRequestUsageReport{Product: &zeroValue}\n\tp.GetProduct()\n\tp = &PremiumRequestUsageReport{}\n\tp.GetProduct()\n\tp = nil\n\tp.GetProduct()\n}\n\nfunc TestPremiumRequestUsageReport_GetTimePeriod(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PremiumRequestUsageReport{}\n\tp.GetTimePeriod()\n\tp = nil\n\tp.GetTimePeriod()\n}\n\nfunc TestPremiumRequestUsageReport_GetUsageItems(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*PremiumRequestUsageItem{}\n\tp := &PremiumRequestUsageReport{UsageItems: zeroValue}\n\tp.GetUsageItems()\n\tp = &PremiumRequestUsageReport{}\n\tp.GetUsageItems()\n\tp = nil\n\tp.GetUsageItems()\n}\n\nfunc TestPremiumRequestUsageReport_GetUser(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PremiumRequestUsageReport{User: &zeroValue}\n\tp.GetUser()\n\tp = &PremiumRequestUsageReport{}\n\tp.GetUser()\n\tp = nil\n\tp.GetUser()\n}\n\nfunc TestPremiumRequestUsageReportOptions_GetDay(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PremiumRequestUsageReportOptions{Day: &zeroValue}\n\tp.GetDay()\n\tp = &PremiumRequestUsageReportOptions{}\n\tp.GetDay()\n\tp = nil\n\tp.GetDay()\n}\n\nfunc TestPremiumRequestUsageReportOptions_GetModel(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PremiumRequestUsageReportOptions{Model: &zeroValue}\n\tp.GetModel()\n\tp = &PremiumRequestUsageReportOptions{}\n\tp.GetModel()\n\tp = nil\n\tp.GetModel()\n}\n\nfunc TestPremiumRequestUsageReportOptions_GetMonth(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PremiumRequestUsageReportOptions{Month: &zeroValue}\n\tp.GetMonth()\n\tp = &PremiumRequestUsageReportOptions{}\n\tp.GetMonth()\n\tp = nil\n\tp.GetMonth()\n}\n\nfunc TestPremiumRequestUsageReportOptions_GetProduct(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PremiumRequestUsageReportOptions{Product: &zeroValue}\n\tp.GetProduct()\n\tp = &PremiumRequestUsageReportOptions{}\n\tp.GetProduct()\n\tp = nil\n\tp.GetProduct()\n}\n\nfunc TestPremiumRequestUsageReportOptions_GetUser(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PremiumRequestUsageReportOptions{User: &zeroValue}\n\tp.GetUser()\n\tp = &PremiumRequestUsageReportOptions{}\n\tp.GetUser()\n\tp = nil\n\tp.GetUser()\n}\n\nfunc TestPremiumRequestUsageReportOptions_GetYear(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PremiumRequestUsageReportOptions{Year: &zeroValue}\n\tp.GetYear()\n\tp = &PremiumRequestUsageReportOptions{}\n\tp.GetYear()\n\tp = nil\n\tp.GetYear()\n}\n\nfunc TestPremiumRequestUsageTimePeriod_GetDay(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PremiumRequestUsageTimePeriod{Day: &zeroValue}\n\tp.GetDay()\n\tp = &PremiumRequestUsageTimePeriod{}\n\tp.GetDay()\n\tp = nil\n\tp.GetDay()\n}\n\nfunc TestPremiumRequestUsageTimePeriod_GetMonth(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PremiumRequestUsageTimePeriod{Month: &zeroValue}\n\tp.GetMonth()\n\tp = &PremiumRequestUsageTimePeriod{}\n\tp.GetMonth()\n\tp = nil\n\tp.GetMonth()\n}\n\nfunc TestPremiumRequestUsageTimePeriod_GetYear(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PremiumRequestUsageTimePeriod{}\n\tp.GetYear()\n\tp = nil\n\tp.GetYear()\n}\n\nfunc TestPreReceiveHook_GetConfigURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PreReceiveHook{ConfigURL: &zeroValue}\n\tp.GetConfigURL()\n\tp = &PreReceiveHook{}\n\tp.GetConfigURL()\n\tp = nil\n\tp.GetConfigURL()\n}\n\nfunc TestPreReceiveHook_GetEnforcement(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PreReceiveHook{Enforcement: &zeroValue}\n\tp.GetEnforcement()\n\tp = &PreReceiveHook{}\n\tp.GetEnforcement()\n\tp = nil\n\tp.GetEnforcement()\n}\n\nfunc TestPreReceiveHook_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &PreReceiveHook{ID: &zeroValue}\n\tp.GetID()\n\tp = &PreReceiveHook{}\n\tp.GetID()\n\tp = nil\n\tp.GetID()\n}\n\nfunc TestPreReceiveHook_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PreReceiveHook{Name: &zeroValue}\n\tp.GetName()\n\tp = &PreReceiveHook{}\n\tp.GetName()\n\tp = nil\n\tp.GetName()\n}\n\nfunc TestPrivateRegistries_GetConfigurations(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*PrivateRegistry{}\n\tp := &PrivateRegistries{Configurations: zeroValue}\n\tp.GetConfigurations()\n\tp = &PrivateRegistries{}\n\tp.GetConfigurations()\n\tp = nil\n\tp.GetConfigurations()\n}\n\nfunc TestPrivateRegistries_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PrivateRegistries{TotalCount: &zeroValue}\n\tp.GetTotalCount()\n\tp = &PrivateRegistries{}\n\tp.GetTotalCount()\n\tp = nil\n\tp.GetTotalCount()\n}\n\nfunc TestPrivateRegistry_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PrivateRegistry{CreatedAt: &zeroValue}\n\tp.GetCreatedAt()\n\tp = &PrivateRegistry{}\n\tp.GetCreatedAt()\n\tp = nil\n\tp.GetCreatedAt()\n}\n\nfunc TestPrivateRegistry_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PrivateRegistry{Name: &zeroValue}\n\tp.GetName()\n\tp = &PrivateRegistry{}\n\tp.GetName()\n\tp = nil\n\tp.GetName()\n}\n\nfunc TestPrivateRegistry_GetRegistryType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PrivateRegistry{RegistryType: &zeroValue}\n\tp.GetRegistryType()\n\tp = &PrivateRegistry{}\n\tp.GetRegistryType()\n\tp = nil\n\tp.GetRegistryType()\n}\n\nfunc TestPrivateRegistry_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PrivateRegistry{UpdatedAt: &zeroValue}\n\tp.GetUpdatedAt()\n\tp = &PrivateRegistry{}\n\tp.GetUpdatedAt()\n\tp = nil\n\tp.GetUpdatedAt()\n}\n\nfunc TestPrivateRegistry_GetUsername(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PrivateRegistry{Username: &zeroValue}\n\tp.GetUsername()\n\tp = &PrivateRegistry{}\n\tp.GetUsername()\n\tp = nil\n\tp.GetUsername()\n}\n\nfunc TestPrivateRegistry_GetVisibility(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PrivateRegistry{}\n\tp.GetVisibility()\n\tp = nil\n\tp.GetVisibility()\n}\n\nfunc TestPRLink_GetHRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PRLink{HRef: &zeroValue}\n\tp.GetHRef()\n\tp = &PRLink{}\n\tp.GetHRef()\n\tp = nil\n\tp.GetHRef()\n}\n\nfunc TestPRLinks_GetComments(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PRLinks{}\n\tp.GetComments()\n\tp = nil\n\tp.GetComments()\n}\n\nfunc TestPRLinks_GetCommits(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PRLinks{}\n\tp.GetCommits()\n\tp = nil\n\tp.GetCommits()\n}\n\nfunc TestPRLinks_GetHTML(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PRLinks{}\n\tp.GetHTML()\n\tp = nil\n\tp.GetHTML()\n}\n\nfunc TestPRLinks_GetIssue(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PRLinks{}\n\tp.GetIssue()\n\tp = nil\n\tp.GetIssue()\n}\n\nfunc TestPRLinks_GetReviewComment(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PRLinks{}\n\tp.GetReviewComment()\n\tp = nil\n\tp.GetReviewComment()\n}\n\nfunc TestPRLinks_GetReviewComments(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PRLinks{}\n\tp.GetReviewComments()\n\tp = nil\n\tp.GetReviewComments()\n}\n\nfunc TestPRLinks_GetSelf(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PRLinks{}\n\tp.GetSelf()\n\tp = nil\n\tp.GetSelf()\n}\n\nfunc TestPRLinks_GetStatuses(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PRLinks{}\n\tp.GetStatuses()\n\tp = nil\n\tp.GetStatuses()\n}\n\nfunc TestProjectBody_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectBody{From: &zeroValue}\n\tp.GetFrom()\n\tp = &ProjectBody{}\n\tp.GetFrom()\n\tp = nil\n\tp.GetFrom()\n}\n\nfunc TestProjectCardChange_GetNote(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectCardChange{}\n\tp.GetNote()\n\tp = nil\n\tp.GetNote()\n}\n\nfunc TestProjectCardNote_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectCardNote{From: &zeroValue}\n\tp.GetFrom()\n\tp = &ProjectCardNote{}\n\tp.GetFrom()\n\tp = nil\n\tp.GetFrom()\n}\n\nfunc TestProjectChange_GetBody(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectChange{}\n\tp.GetBody()\n\tp = nil\n\tp.GetBody()\n}\n\nfunc TestProjectChange_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectChange{}\n\tp.GetName()\n\tp = nil\n\tp.GetName()\n}\n\nfunc TestProjectColumnChange_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectColumnChange{}\n\tp.GetName()\n\tp = nil\n\tp.GetName()\n}\n\nfunc TestProjectColumnName_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectColumnName{From: &zeroValue}\n\tp.GetFrom()\n\tp = &ProjectColumnName{}\n\tp.GetFrom()\n\tp = nil\n\tp.GetFrom()\n}\n\nfunc TestProjectName_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectName{From: &zeroValue}\n\tp.GetFrom()\n\tp = &ProjectName{}\n\tp.GetFrom()\n\tp = nil\n\tp.GetFrom()\n}\n\nfunc TestProjectV2_GetBody(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2{Body: &zeroValue}\n\tp.GetBody()\n\tp = &ProjectV2{}\n\tp.GetBody()\n\tp = nil\n\tp.GetBody()\n}\n\nfunc TestProjectV2_GetClosedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &ProjectV2{ClosedAt: &zeroValue}\n\tp.GetClosedAt()\n\tp = &ProjectV2{}\n\tp.GetClosedAt()\n\tp = nil\n\tp.GetClosedAt()\n}\n\nfunc TestProjectV2_GetColumnsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2{ColumnsURL: &zeroValue}\n\tp.GetColumnsURL()\n\tp = &ProjectV2{}\n\tp.GetColumnsURL()\n\tp = nil\n\tp.GetColumnsURL()\n}\n\nfunc TestProjectV2_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &ProjectV2{CreatedAt: &zeroValue}\n\tp.GetCreatedAt()\n\tp = &ProjectV2{}\n\tp.GetCreatedAt()\n\tp = nil\n\tp.GetCreatedAt()\n}\n\nfunc TestProjectV2_GetCreator(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectV2{}\n\tp.GetCreator()\n\tp = nil\n\tp.GetCreator()\n}\n\nfunc TestProjectV2_GetDeletedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &ProjectV2{DeletedAt: &zeroValue}\n\tp.GetDeletedAt()\n\tp = &ProjectV2{}\n\tp.GetDeletedAt()\n\tp = nil\n\tp.GetDeletedAt()\n}\n\nfunc TestProjectV2_GetDeletedBy(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectV2{}\n\tp.GetDeletedBy()\n\tp = nil\n\tp.GetDeletedBy()\n}\n\nfunc TestProjectV2_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2{Description: &zeroValue}\n\tp.GetDescription()\n\tp = &ProjectV2{}\n\tp.GetDescription()\n\tp = nil\n\tp.GetDescription()\n}\n\nfunc TestProjectV2_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2{HTMLURL: &zeroValue}\n\tp.GetHTMLURL()\n\tp = &ProjectV2{}\n\tp.GetHTMLURL()\n\tp = nil\n\tp.GetHTMLURL()\n}\n\nfunc TestProjectV2_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &ProjectV2{ID: &zeroValue}\n\tp.GetID()\n\tp = &ProjectV2{}\n\tp.GetID()\n\tp = nil\n\tp.GetID()\n}\n\nfunc TestProjectV2_GetIsTemplate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &ProjectV2{IsTemplate: &zeroValue}\n\tp.GetIsTemplate()\n\tp = &ProjectV2{}\n\tp.GetIsTemplate()\n\tp = nil\n\tp.GetIsTemplate()\n}\n\nfunc TestProjectV2_GetLatestStatusUpdate(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectV2{}\n\tp.GetLatestStatusUpdate()\n\tp = nil\n\tp.GetLatestStatusUpdate()\n}\n\nfunc TestProjectV2_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2{Name: &zeroValue}\n\tp.GetName()\n\tp = &ProjectV2{}\n\tp.GetName()\n\tp = nil\n\tp.GetName()\n}\n\nfunc TestProjectV2_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2{NodeID: &zeroValue}\n\tp.GetNodeID()\n\tp = &ProjectV2{}\n\tp.GetNodeID()\n\tp = nil\n\tp.GetNodeID()\n}\n\nfunc TestProjectV2_GetNumber(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &ProjectV2{Number: &zeroValue}\n\tp.GetNumber()\n\tp = &ProjectV2{}\n\tp.GetNumber()\n\tp = nil\n\tp.GetNumber()\n}\n\nfunc TestProjectV2_GetOrganizationPermission(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2{OrganizationPermission: &zeroValue}\n\tp.GetOrganizationPermission()\n\tp = &ProjectV2{}\n\tp.GetOrganizationPermission()\n\tp = nil\n\tp.GetOrganizationPermission()\n}\n\nfunc TestProjectV2_GetOwner(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectV2{}\n\tp.GetOwner()\n\tp = nil\n\tp.GetOwner()\n}\n\nfunc TestProjectV2_GetOwnerURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2{OwnerURL: &zeroValue}\n\tp.GetOwnerURL()\n\tp = &ProjectV2{}\n\tp.GetOwnerURL()\n\tp = nil\n\tp.GetOwnerURL()\n}\n\nfunc TestProjectV2_GetPrivate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &ProjectV2{Private: &zeroValue}\n\tp.GetPrivate()\n\tp = &ProjectV2{}\n\tp.GetPrivate()\n\tp = nil\n\tp.GetPrivate()\n}\n\nfunc TestProjectV2_GetPublic(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &ProjectV2{Public: &zeroValue}\n\tp.GetPublic()\n\tp = &ProjectV2{}\n\tp.GetPublic()\n\tp = nil\n\tp.GetPublic()\n}\n\nfunc TestProjectV2_GetShortDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2{ShortDescription: &zeroValue}\n\tp.GetShortDescription()\n\tp = &ProjectV2{}\n\tp.GetShortDescription()\n\tp = nil\n\tp.GetShortDescription()\n}\n\nfunc TestProjectV2_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2{State: &zeroValue}\n\tp.GetState()\n\tp = &ProjectV2{}\n\tp.GetState()\n\tp = nil\n\tp.GetState()\n}\n\nfunc TestProjectV2_GetTitle(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2{Title: &zeroValue}\n\tp.GetTitle()\n\tp = &ProjectV2{}\n\tp.GetTitle()\n\tp = nil\n\tp.GetTitle()\n}\n\nfunc TestProjectV2_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &ProjectV2{UpdatedAt: &zeroValue}\n\tp.GetUpdatedAt()\n\tp = &ProjectV2{}\n\tp.GetUpdatedAt()\n\tp = nil\n\tp.GetUpdatedAt()\n}\n\nfunc TestProjectV2_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2{URL: &zeroValue}\n\tp.GetURL()\n\tp = &ProjectV2{}\n\tp.GetURL()\n\tp = nil\n\tp.GetURL()\n}\n\nfunc TestProjectV2DraftIssue_GetBody(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2DraftIssue{Body: &zeroValue}\n\tp.GetBody()\n\tp = &ProjectV2DraftIssue{}\n\tp.GetBody()\n\tp = nil\n\tp.GetBody()\n}\n\nfunc TestProjectV2DraftIssue_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &ProjectV2DraftIssue{CreatedAt: &zeroValue}\n\tp.GetCreatedAt()\n\tp = &ProjectV2DraftIssue{}\n\tp.GetCreatedAt()\n\tp = nil\n\tp.GetCreatedAt()\n}\n\nfunc TestProjectV2DraftIssue_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &ProjectV2DraftIssue{ID: &zeroValue}\n\tp.GetID()\n\tp = &ProjectV2DraftIssue{}\n\tp.GetID()\n\tp = nil\n\tp.GetID()\n}\n\nfunc TestProjectV2DraftIssue_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2DraftIssue{NodeID: &zeroValue}\n\tp.GetNodeID()\n\tp = &ProjectV2DraftIssue{}\n\tp.GetNodeID()\n\tp = nil\n\tp.GetNodeID()\n}\n\nfunc TestProjectV2DraftIssue_GetTitle(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2DraftIssue{Title: &zeroValue}\n\tp.GetTitle()\n\tp = &ProjectV2DraftIssue{}\n\tp.GetTitle()\n\tp = nil\n\tp.GetTitle()\n}\n\nfunc TestProjectV2DraftIssue_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &ProjectV2DraftIssue{UpdatedAt: &zeroValue}\n\tp.GetUpdatedAt()\n\tp = &ProjectV2DraftIssue{}\n\tp.GetUpdatedAt()\n\tp = nil\n\tp.GetUpdatedAt()\n}\n\nfunc TestProjectV2DraftIssue_GetUser(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectV2DraftIssue{}\n\tp.GetUser()\n\tp = nil\n\tp.GetUser()\n}\n\nfunc TestProjectV2Event_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2Event{Action: &zeroValue}\n\tp.GetAction()\n\tp = &ProjectV2Event{}\n\tp.GetAction()\n\tp = nil\n\tp.GetAction()\n}\n\nfunc TestProjectV2Event_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectV2Event{}\n\tp.GetInstallation()\n\tp = nil\n\tp.GetInstallation()\n}\n\nfunc TestProjectV2Event_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectV2Event{}\n\tp.GetOrg()\n\tp = nil\n\tp.GetOrg()\n}\n\nfunc TestProjectV2Event_GetProjectsV2(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectV2Event{}\n\tp.GetProjectsV2()\n\tp = nil\n\tp.GetProjectsV2()\n}\n\nfunc TestProjectV2Event_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectV2Event{}\n\tp.GetSender()\n\tp = nil\n\tp.GetSender()\n}\n\nfunc TestProjectV2Field_GetConfiguration(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectV2Field{}\n\tp.GetConfiguration()\n\tp = nil\n\tp.GetConfiguration()\n}\n\nfunc TestProjectV2Field_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &ProjectV2Field{CreatedAt: &zeroValue}\n\tp.GetCreatedAt()\n\tp = &ProjectV2Field{}\n\tp.GetCreatedAt()\n\tp = nil\n\tp.GetCreatedAt()\n}\n\nfunc TestProjectV2Field_GetDataType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2Field{DataType: &zeroValue}\n\tp.GetDataType()\n\tp = &ProjectV2Field{}\n\tp.GetDataType()\n\tp = nil\n\tp.GetDataType()\n}\n\nfunc TestProjectV2Field_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &ProjectV2Field{ID: &zeroValue}\n\tp.GetID()\n\tp = &ProjectV2Field{}\n\tp.GetID()\n\tp = nil\n\tp.GetID()\n}\n\nfunc TestProjectV2Field_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2Field{Name: &zeroValue}\n\tp.GetName()\n\tp = &ProjectV2Field{}\n\tp.GetName()\n\tp = nil\n\tp.GetName()\n}\n\nfunc TestProjectV2Field_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2Field{NodeID: &zeroValue}\n\tp.GetNodeID()\n\tp = &ProjectV2Field{}\n\tp.GetNodeID()\n\tp = nil\n\tp.GetNodeID()\n}\n\nfunc TestProjectV2Field_GetOptions(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*ProjectV2FieldOption{}\n\tp := &ProjectV2Field{Options: zeroValue}\n\tp.GetOptions()\n\tp = &ProjectV2Field{}\n\tp.GetOptions()\n\tp = nil\n\tp.GetOptions()\n}\n\nfunc TestProjectV2Field_GetProjectURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2Field{ProjectURL: &zeroValue}\n\tp.GetProjectURL()\n\tp = &ProjectV2Field{}\n\tp.GetProjectURL()\n\tp = nil\n\tp.GetProjectURL()\n}\n\nfunc TestProjectV2Field_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &ProjectV2Field{UpdatedAt: &zeroValue}\n\tp.GetUpdatedAt()\n\tp = &ProjectV2Field{}\n\tp.GetUpdatedAt()\n\tp = nil\n\tp.GetUpdatedAt()\n}\n\nfunc TestProjectV2FieldConfiguration_GetDuration(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &ProjectV2FieldConfiguration{Duration: &zeroValue}\n\tp.GetDuration()\n\tp = &ProjectV2FieldConfiguration{}\n\tp.GetDuration()\n\tp = nil\n\tp.GetDuration()\n}\n\nfunc TestProjectV2FieldConfiguration_GetIterations(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*ProjectV2FieldIteration{}\n\tp := &ProjectV2FieldConfiguration{Iterations: zeroValue}\n\tp.GetIterations()\n\tp = &ProjectV2FieldConfiguration{}\n\tp.GetIterations()\n\tp = nil\n\tp.GetIterations()\n}\n\nfunc TestProjectV2FieldConfiguration_GetStartDay(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &ProjectV2FieldConfiguration{StartDay: &zeroValue}\n\tp.GetStartDay()\n\tp = &ProjectV2FieldConfiguration{}\n\tp.GetStartDay()\n\tp = nil\n\tp.GetStartDay()\n}\n\nfunc TestProjectV2FieldIteration_GetDuration(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &ProjectV2FieldIteration{Duration: &zeroValue}\n\tp.GetDuration()\n\tp = &ProjectV2FieldIteration{}\n\tp.GetDuration()\n\tp = nil\n\tp.GetDuration()\n}\n\nfunc TestProjectV2FieldIteration_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2FieldIteration{ID: &zeroValue}\n\tp.GetID()\n\tp = &ProjectV2FieldIteration{}\n\tp.GetID()\n\tp = nil\n\tp.GetID()\n}\n\nfunc TestProjectV2FieldIteration_GetStartDate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2FieldIteration{StartDate: &zeroValue}\n\tp.GetStartDate()\n\tp = &ProjectV2FieldIteration{}\n\tp.GetStartDate()\n\tp = nil\n\tp.GetStartDate()\n}\n\nfunc TestProjectV2FieldIteration_GetTitle(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectV2FieldIteration{}\n\tp.GetTitle()\n\tp = nil\n\tp.GetTitle()\n}\n\nfunc TestProjectV2FieldOption_GetColor(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2FieldOption{Color: &zeroValue}\n\tp.GetColor()\n\tp = &ProjectV2FieldOption{}\n\tp.GetColor()\n\tp = nil\n\tp.GetColor()\n}\n\nfunc TestProjectV2FieldOption_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectV2FieldOption{}\n\tp.GetDescription()\n\tp = nil\n\tp.GetDescription()\n}\n\nfunc TestProjectV2FieldOption_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2FieldOption{ID: &zeroValue}\n\tp.GetID()\n\tp = &ProjectV2FieldOption{}\n\tp.GetID()\n\tp = nil\n\tp.GetID()\n}\n\nfunc TestProjectV2FieldOption_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectV2FieldOption{}\n\tp.GetName()\n\tp = nil\n\tp.GetName()\n}\n\nfunc TestProjectV2Item_GetArchivedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &ProjectV2Item{ArchivedAt: &zeroValue}\n\tp.GetArchivedAt()\n\tp = &ProjectV2Item{}\n\tp.GetArchivedAt()\n\tp = nil\n\tp.GetArchivedAt()\n}\n\nfunc TestProjectV2Item_GetContent(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectV2Item{}\n\tp.GetContent()\n\tp = nil\n\tp.GetContent()\n}\n\nfunc TestProjectV2Item_GetContentNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2Item{ContentNodeID: &zeroValue}\n\tp.GetContentNodeID()\n\tp = &ProjectV2Item{}\n\tp.GetContentNodeID()\n\tp = nil\n\tp.GetContentNodeID()\n}\n\nfunc TestProjectV2Item_GetContentType(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectV2Item{}\n\tp.GetContentType()\n\tp = nil\n\tp.GetContentType()\n}\n\nfunc TestProjectV2Item_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &ProjectV2Item{CreatedAt: &zeroValue}\n\tp.GetCreatedAt()\n\tp = &ProjectV2Item{}\n\tp.GetCreatedAt()\n\tp = nil\n\tp.GetCreatedAt()\n}\n\nfunc TestProjectV2Item_GetCreator(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectV2Item{}\n\tp.GetCreator()\n\tp = nil\n\tp.GetCreator()\n}\n\nfunc TestProjectV2Item_GetFields(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*ProjectV2ItemFieldValue{}\n\tp := &ProjectV2Item{Fields: zeroValue}\n\tp.GetFields()\n\tp = &ProjectV2Item{}\n\tp.GetFields()\n\tp = nil\n\tp.GetFields()\n}\n\nfunc TestProjectV2Item_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &ProjectV2Item{ID: &zeroValue}\n\tp.GetID()\n\tp = &ProjectV2Item{}\n\tp.GetID()\n\tp = nil\n\tp.GetID()\n}\n\nfunc TestProjectV2Item_GetItemURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2Item{ItemURL: &zeroValue}\n\tp.GetItemURL()\n\tp = &ProjectV2Item{}\n\tp.GetItemURL()\n\tp = nil\n\tp.GetItemURL()\n}\n\nfunc TestProjectV2Item_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2Item{NodeID: &zeroValue}\n\tp.GetNodeID()\n\tp = &ProjectV2Item{}\n\tp.GetNodeID()\n\tp = nil\n\tp.GetNodeID()\n}\n\nfunc TestProjectV2Item_GetProjectNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2Item{ProjectNodeID: &zeroValue}\n\tp.GetProjectNodeID()\n\tp = &ProjectV2Item{}\n\tp.GetProjectNodeID()\n\tp = nil\n\tp.GetProjectNodeID()\n}\n\nfunc TestProjectV2Item_GetProjectURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2Item{ProjectURL: &zeroValue}\n\tp.GetProjectURL()\n\tp = &ProjectV2Item{}\n\tp.GetProjectURL()\n\tp = nil\n\tp.GetProjectURL()\n}\n\nfunc TestProjectV2Item_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &ProjectV2Item{UpdatedAt: &zeroValue}\n\tp.GetUpdatedAt()\n\tp = &ProjectV2Item{}\n\tp.GetUpdatedAt()\n\tp = nil\n\tp.GetUpdatedAt()\n}\n\nfunc TestProjectV2ItemChange_GetArchivedAt(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectV2ItemChange{}\n\tp.GetArchivedAt()\n\tp = nil\n\tp.GetArchivedAt()\n}\n\nfunc TestProjectV2ItemChange_GetFieldValue(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectV2ItemChange{}\n\tp.GetFieldValue()\n\tp = nil\n\tp.GetFieldValue()\n}\n\nfunc TestProjectV2ItemContent_GetDraftIssue(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectV2ItemContent{}\n\tp.GetDraftIssue()\n\tp = nil\n\tp.GetDraftIssue()\n}\n\nfunc TestProjectV2ItemContent_GetIssue(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectV2ItemContent{}\n\tp.GetIssue()\n\tp = nil\n\tp.GetIssue()\n}\n\nfunc TestProjectV2ItemContent_GetPullRequest(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectV2ItemContent{}\n\tp.GetPullRequest()\n\tp = nil\n\tp.GetPullRequest()\n}\n\nfunc TestProjectV2ItemEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2ItemEvent{Action: &zeroValue}\n\tp.GetAction()\n\tp = &ProjectV2ItemEvent{}\n\tp.GetAction()\n\tp = nil\n\tp.GetAction()\n}\n\nfunc TestProjectV2ItemEvent_GetChanges(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectV2ItemEvent{}\n\tp.GetChanges()\n\tp = nil\n\tp.GetChanges()\n}\n\nfunc TestProjectV2ItemEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectV2ItemEvent{}\n\tp.GetInstallation()\n\tp = nil\n\tp.GetInstallation()\n}\n\nfunc TestProjectV2ItemEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectV2ItemEvent{}\n\tp.GetOrg()\n\tp = nil\n\tp.GetOrg()\n}\n\nfunc TestProjectV2ItemEvent_GetProjectV2Item(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectV2ItemEvent{}\n\tp.GetProjectV2Item()\n\tp = nil\n\tp.GetProjectV2Item()\n}\n\nfunc TestProjectV2ItemEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectV2ItemEvent{}\n\tp.GetSender()\n\tp = nil\n\tp.GetSender()\n}\n\nfunc TestProjectV2ItemFieldValue_GetDataType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2ItemFieldValue{DataType: &zeroValue}\n\tp.GetDataType()\n\tp = &ProjectV2ItemFieldValue{}\n\tp.GetDataType()\n\tp = nil\n\tp.GetDataType()\n}\n\nfunc TestProjectV2ItemFieldValue_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &ProjectV2ItemFieldValue{ID: &zeroValue}\n\tp.GetID()\n\tp = &ProjectV2ItemFieldValue{}\n\tp.GetID()\n\tp = nil\n\tp.GetID()\n}\n\nfunc TestProjectV2ItemFieldValue_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2ItemFieldValue{Name: &zeroValue}\n\tp.GetName()\n\tp = &ProjectV2ItemFieldValue{}\n\tp.GetName()\n\tp = nil\n\tp.GetName()\n}\n\nfunc TestProjectV2ItemFieldValue_GetValue(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectV2ItemFieldValue{}\n\tp.GetValue()\n\tp = nil\n\tp.GetValue()\n}\n\nfunc TestProjectV2StatusUpdate_GetBody(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2StatusUpdate{Body: &zeroValue}\n\tp.GetBody()\n\tp = &ProjectV2StatusUpdate{}\n\tp.GetBody()\n\tp = nil\n\tp.GetBody()\n}\n\nfunc TestProjectV2StatusUpdate_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &ProjectV2StatusUpdate{CreatedAt: &zeroValue}\n\tp.GetCreatedAt()\n\tp = &ProjectV2StatusUpdate{}\n\tp.GetCreatedAt()\n\tp = nil\n\tp.GetCreatedAt()\n}\n\nfunc TestProjectV2StatusUpdate_GetCreator(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProjectV2StatusUpdate{}\n\tp.GetCreator()\n\tp = nil\n\tp.GetCreator()\n}\n\nfunc TestProjectV2StatusUpdate_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &ProjectV2StatusUpdate{ID: &zeroValue}\n\tp.GetID()\n\tp = &ProjectV2StatusUpdate{}\n\tp.GetID()\n\tp = nil\n\tp.GetID()\n}\n\nfunc TestProjectV2StatusUpdate_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2StatusUpdate{NodeID: &zeroValue}\n\tp.GetNodeID()\n\tp = &ProjectV2StatusUpdate{}\n\tp.GetNodeID()\n\tp = nil\n\tp.GetNodeID()\n}\n\nfunc TestProjectV2StatusUpdate_GetProjectNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2StatusUpdate{ProjectNodeID: &zeroValue}\n\tp.GetProjectNodeID()\n\tp = &ProjectV2StatusUpdate{}\n\tp.GetProjectNodeID()\n\tp = nil\n\tp.GetProjectNodeID()\n}\n\nfunc TestProjectV2StatusUpdate_GetStartDate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2StatusUpdate{StartDate: &zeroValue}\n\tp.GetStartDate()\n\tp = &ProjectV2StatusUpdate{}\n\tp.GetStartDate()\n\tp = nil\n\tp.GetStartDate()\n}\n\nfunc TestProjectV2StatusUpdate_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2StatusUpdate{Status: &zeroValue}\n\tp.GetStatus()\n\tp = &ProjectV2StatusUpdate{}\n\tp.GetStatus()\n\tp = nil\n\tp.GetStatus()\n}\n\nfunc TestProjectV2StatusUpdate_GetTargetDate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2StatusUpdate{TargetDate: &zeroValue}\n\tp.GetTargetDate()\n\tp = &ProjectV2StatusUpdate{}\n\tp.GetTargetDate()\n\tp = nil\n\tp.GetTargetDate()\n}\n\nfunc TestProjectV2StatusUpdate_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &ProjectV2StatusUpdate{UpdatedAt: &zeroValue}\n\tp.GetUpdatedAt()\n\tp = &ProjectV2StatusUpdate{}\n\tp.GetUpdatedAt()\n\tp = nil\n\tp.GetUpdatedAt()\n}\n\nfunc TestProjectV2TextContent_GetHTML(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2TextContent{HTML: &zeroValue}\n\tp.GetHTML()\n\tp = &ProjectV2TextContent{}\n\tp.GetHTML()\n\tp = nil\n\tp.GetHTML()\n}\n\nfunc TestProjectV2TextContent_GetRaw(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProjectV2TextContent{Raw: &zeroValue}\n\tp.GetRaw()\n\tp = &ProjectV2TextContent{}\n\tp.GetRaw()\n\tp = nil\n\tp.GetRaw()\n}\n\nfunc TestProtection_GetAllowDeletions(tt *testing.T) {\n\ttt.Parallel()\n\tp := &Protection{}\n\tp.GetAllowDeletions()\n\tp = nil\n\tp.GetAllowDeletions()\n}\n\nfunc TestProtection_GetAllowForcePushes(tt *testing.T) {\n\ttt.Parallel()\n\tp := &Protection{}\n\tp.GetAllowForcePushes()\n\tp = nil\n\tp.GetAllowForcePushes()\n}\n\nfunc TestProtection_GetAllowForkSyncing(tt *testing.T) {\n\ttt.Parallel()\n\tp := &Protection{}\n\tp.GetAllowForkSyncing()\n\tp = nil\n\tp.GetAllowForkSyncing()\n}\n\nfunc TestProtection_GetBlockCreations(tt *testing.T) {\n\ttt.Parallel()\n\tp := &Protection{}\n\tp.GetBlockCreations()\n\tp = nil\n\tp.GetBlockCreations()\n}\n\nfunc TestProtection_GetEnforceAdmins(tt *testing.T) {\n\ttt.Parallel()\n\tp := &Protection{}\n\tp.GetEnforceAdmins()\n\tp = nil\n\tp.GetEnforceAdmins()\n}\n\nfunc TestProtection_GetLockBranch(tt *testing.T) {\n\ttt.Parallel()\n\tp := &Protection{}\n\tp.GetLockBranch()\n\tp = nil\n\tp.GetLockBranch()\n}\n\nfunc TestProtection_GetRequiredConversationResolution(tt *testing.T) {\n\ttt.Parallel()\n\tp := &Protection{}\n\tp.GetRequiredConversationResolution()\n\tp = nil\n\tp.GetRequiredConversationResolution()\n}\n\nfunc TestProtection_GetRequiredPullRequestReviews(tt *testing.T) {\n\ttt.Parallel()\n\tp := &Protection{}\n\tp.GetRequiredPullRequestReviews()\n\tp = nil\n\tp.GetRequiredPullRequestReviews()\n}\n\nfunc TestProtection_GetRequiredSignatures(tt *testing.T) {\n\ttt.Parallel()\n\tp := &Protection{}\n\tp.GetRequiredSignatures()\n\tp = nil\n\tp.GetRequiredSignatures()\n}\n\nfunc TestProtection_GetRequiredStatusChecks(tt *testing.T) {\n\ttt.Parallel()\n\tp := &Protection{}\n\tp.GetRequiredStatusChecks()\n\tp = nil\n\tp.GetRequiredStatusChecks()\n}\n\nfunc TestProtection_GetRequireLinearHistory(tt *testing.T) {\n\ttt.Parallel()\n\tp := &Protection{}\n\tp.GetRequireLinearHistory()\n\tp = nil\n\tp.GetRequireLinearHistory()\n}\n\nfunc TestProtection_GetRestrictions(tt *testing.T) {\n\ttt.Parallel()\n\tp := &Protection{}\n\tp.GetRestrictions()\n\tp = nil\n\tp.GetRestrictions()\n}\n\nfunc TestProtection_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &Protection{URL: &zeroValue}\n\tp.GetURL()\n\tp = &Protection{}\n\tp.GetURL()\n\tp = nil\n\tp.GetURL()\n}\n\nfunc TestProtectionChanges_GetAdminEnforced(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProtectionChanges{}\n\tp.GetAdminEnforced()\n\tp = nil\n\tp.GetAdminEnforced()\n}\n\nfunc TestProtectionChanges_GetAllowDeletionsEnforcementLevel(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProtectionChanges{}\n\tp.GetAllowDeletionsEnforcementLevel()\n\tp = nil\n\tp.GetAllowDeletionsEnforcementLevel()\n}\n\nfunc TestProtectionChanges_GetAuthorizedActorNames(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProtectionChanges{}\n\tp.GetAuthorizedActorNames()\n\tp = nil\n\tp.GetAuthorizedActorNames()\n}\n\nfunc TestProtectionChanges_GetAuthorizedActorsOnly(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProtectionChanges{}\n\tp.GetAuthorizedActorsOnly()\n\tp = nil\n\tp.GetAuthorizedActorsOnly()\n}\n\nfunc TestProtectionChanges_GetAuthorizedDismissalActorsOnly(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProtectionChanges{}\n\tp.GetAuthorizedDismissalActorsOnly()\n\tp = nil\n\tp.GetAuthorizedDismissalActorsOnly()\n}\n\nfunc TestProtectionChanges_GetCreateProtected(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProtectionChanges{}\n\tp.GetCreateProtected()\n\tp = nil\n\tp.GetCreateProtected()\n}\n\nfunc TestProtectionChanges_GetDismissStaleReviewsOnPush(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProtectionChanges{}\n\tp.GetDismissStaleReviewsOnPush()\n\tp = nil\n\tp.GetDismissStaleReviewsOnPush()\n}\n\nfunc TestProtectionChanges_GetLinearHistoryRequirementEnforcementLevel(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProtectionChanges{}\n\tp.GetLinearHistoryRequirementEnforcementLevel()\n\tp = nil\n\tp.GetLinearHistoryRequirementEnforcementLevel()\n}\n\nfunc TestProtectionChanges_GetPullRequestReviewsEnforcementLevel(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProtectionChanges{}\n\tp.GetPullRequestReviewsEnforcementLevel()\n\tp = nil\n\tp.GetPullRequestReviewsEnforcementLevel()\n}\n\nfunc TestProtectionChanges_GetRequireCodeOwnerReview(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProtectionChanges{}\n\tp.GetRequireCodeOwnerReview()\n\tp = nil\n\tp.GetRequireCodeOwnerReview()\n}\n\nfunc TestProtectionChanges_GetRequiredConversationResolutionLevel(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProtectionChanges{}\n\tp.GetRequiredConversationResolutionLevel()\n\tp = nil\n\tp.GetRequiredConversationResolutionLevel()\n}\n\nfunc TestProtectionChanges_GetRequiredDeploymentsEnforcementLevel(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProtectionChanges{}\n\tp.GetRequiredDeploymentsEnforcementLevel()\n\tp = nil\n\tp.GetRequiredDeploymentsEnforcementLevel()\n}\n\nfunc TestProtectionChanges_GetRequiredStatusChecks(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProtectionChanges{}\n\tp.GetRequiredStatusChecks()\n\tp = nil\n\tp.GetRequiredStatusChecks()\n}\n\nfunc TestProtectionChanges_GetRequiredStatusChecksEnforcementLevel(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProtectionChanges{}\n\tp.GetRequiredStatusChecksEnforcementLevel()\n\tp = nil\n\tp.GetRequiredStatusChecksEnforcementLevel()\n}\n\nfunc TestProtectionChanges_GetRequireLastPushApproval(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProtectionChanges{}\n\tp.GetRequireLastPushApproval()\n\tp = nil\n\tp.GetRequireLastPushApproval()\n}\n\nfunc TestProtectionChanges_GetSignatureRequirementEnforcementLevel(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProtectionChanges{}\n\tp.GetSignatureRequirementEnforcementLevel()\n\tp = nil\n\tp.GetSignatureRequirementEnforcementLevel()\n}\n\nfunc TestProtectionRequest_GetAllowDeletions(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &ProtectionRequest{AllowDeletions: &zeroValue}\n\tp.GetAllowDeletions()\n\tp = &ProtectionRequest{}\n\tp.GetAllowDeletions()\n\tp = nil\n\tp.GetAllowDeletions()\n}\n\nfunc TestProtectionRequest_GetAllowForcePushes(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &ProtectionRequest{AllowForcePushes: &zeroValue}\n\tp.GetAllowForcePushes()\n\tp = &ProtectionRequest{}\n\tp.GetAllowForcePushes()\n\tp = nil\n\tp.GetAllowForcePushes()\n}\n\nfunc TestProtectionRequest_GetAllowForkSyncing(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &ProtectionRequest{AllowForkSyncing: &zeroValue}\n\tp.GetAllowForkSyncing()\n\tp = &ProtectionRequest{}\n\tp.GetAllowForkSyncing()\n\tp = nil\n\tp.GetAllowForkSyncing()\n}\n\nfunc TestProtectionRequest_GetBlockCreations(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &ProtectionRequest{BlockCreations: &zeroValue}\n\tp.GetBlockCreations()\n\tp = &ProtectionRequest{}\n\tp.GetBlockCreations()\n\tp = nil\n\tp.GetBlockCreations()\n}\n\nfunc TestProtectionRequest_GetEnforceAdmins(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProtectionRequest{}\n\tp.GetEnforceAdmins()\n\tp = nil\n\tp.GetEnforceAdmins()\n}\n\nfunc TestProtectionRequest_GetLockBranch(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &ProtectionRequest{LockBranch: &zeroValue}\n\tp.GetLockBranch()\n\tp = &ProtectionRequest{}\n\tp.GetLockBranch()\n\tp = nil\n\tp.GetLockBranch()\n}\n\nfunc TestProtectionRequest_GetRequiredConversationResolution(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &ProtectionRequest{RequiredConversationResolution: &zeroValue}\n\tp.GetRequiredConversationResolution()\n\tp = &ProtectionRequest{}\n\tp.GetRequiredConversationResolution()\n\tp = nil\n\tp.GetRequiredConversationResolution()\n}\n\nfunc TestProtectionRequest_GetRequiredPullRequestReviews(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProtectionRequest{}\n\tp.GetRequiredPullRequestReviews()\n\tp = nil\n\tp.GetRequiredPullRequestReviews()\n}\n\nfunc TestProtectionRequest_GetRequiredStatusChecks(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProtectionRequest{}\n\tp.GetRequiredStatusChecks()\n\tp = nil\n\tp.GetRequiredStatusChecks()\n}\n\nfunc TestProtectionRequest_GetRequireLinearHistory(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &ProtectionRequest{RequireLinearHistory: &zeroValue}\n\tp.GetRequireLinearHistory()\n\tp = &ProtectionRequest{}\n\tp.GetRequireLinearHistory()\n\tp = nil\n\tp.GetRequireLinearHistory()\n}\n\nfunc TestProtectionRequest_GetRestrictions(tt *testing.T) {\n\ttt.Parallel()\n\tp := &ProtectionRequest{}\n\tp.GetRestrictions()\n\tp = nil\n\tp.GetRestrictions()\n}\n\nfunc TestProtectionRule_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &ProtectionRule{ID: &zeroValue}\n\tp.GetID()\n\tp = &ProtectionRule{}\n\tp.GetID()\n\tp = nil\n\tp.GetID()\n}\n\nfunc TestProtectionRule_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProtectionRule{NodeID: &zeroValue}\n\tp.GetNodeID()\n\tp = &ProtectionRule{}\n\tp.GetNodeID()\n\tp = nil\n\tp.GetNodeID()\n}\n\nfunc TestProtectionRule_GetPreventSelfReview(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &ProtectionRule{PreventSelfReview: &zeroValue}\n\tp.GetPreventSelfReview()\n\tp = &ProtectionRule{}\n\tp.GetPreventSelfReview()\n\tp = nil\n\tp.GetPreventSelfReview()\n}\n\nfunc TestProtectionRule_GetReviewers(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*RequiredReviewer{}\n\tp := &ProtectionRule{Reviewers: zeroValue}\n\tp.GetReviewers()\n\tp = &ProtectionRule{}\n\tp.GetReviewers()\n\tp = nil\n\tp.GetReviewers()\n}\n\nfunc TestProtectionRule_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &ProtectionRule{Type: &zeroValue}\n\tp.GetType()\n\tp = &ProtectionRule{}\n\tp.GetType()\n\tp = nil\n\tp.GetType()\n}\n\nfunc TestProtectionRule_GetWaitTimer(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &ProtectionRule{WaitTimer: &zeroValue}\n\tp.GetWaitTimer()\n\tp = &ProtectionRule{}\n\tp.GetWaitTimer()\n\tp = nil\n\tp.GetWaitTimer()\n}\n\nfunc TestPublicEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PublicEvent{}\n\tp.GetInstallation()\n\tp = nil\n\tp.GetInstallation()\n}\n\nfunc TestPublicEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PublicEvent{}\n\tp.GetOrg()\n\tp = nil\n\tp.GetOrg()\n}\n\nfunc TestPublicEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PublicEvent{}\n\tp.GetRepo()\n\tp = nil\n\tp.GetRepo()\n}\n\nfunc TestPublicEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PublicEvent{}\n\tp.GetSender()\n\tp = nil\n\tp.GetSender()\n}\n\nfunc TestPublicIPUsage_GetCurrentUsage(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PublicIPUsage{}\n\tp.GetCurrentUsage()\n\tp = nil\n\tp.GetCurrentUsage()\n}\n\nfunc TestPublicIPUsage_GetMaximum(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PublicIPUsage{}\n\tp.GetMaximum()\n\tp = nil\n\tp.GetMaximum()\n}\n\nfunc TestPublicKey_GetKey(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PublicKey{Key: &zeroValue}\n\tp.GetKey()\n\tp = &PublicKey{}\n\tp.GetKey()\n\tp = nil\n\tp.GetKey()\n}\n\nfunc TestPublicKey_GetKeyID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PublicKey{KeyID: &zeroValue}\n\tp.GetKeyID()\n\tp = &PublicKey{}\n\tp.GetKeyID()\n\tp = nil\n\tp.GetKeyID()\n}\n\nfunc TestPublishCodespaceOptions_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PublishCodespaceOptions{Name: &zeroValue}\n\tp.GetName()\n\tp = &PublishCodespaceOptions{}\n\tp.GetName()\n\tp = nil\n\tp.GetName()\n}\n\nfunc TestPublishCodespaceOptions_GetPrivate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PublishCodespaceOptions{Private: &zeroValue}\n\tp.GetPrivate()\n\tp = &PublishCodespaceOptions{}\n\tp.GetPrivate()\n\tp = nil\n\tp.GetPrivate()\n}\n\nfunc TestPullRequest_GetActiveLockReason(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequest{ActiveLockReason: &zeroValue}\n\tp.GetActiveLockReason()\n\tp = &PullRequest{}\n\tp.GetActiveLockReason()\n\tp = nil\n\tp.GetActiveLockReason()\n}\n\nfunc TestPullRequest_GetAdditions(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PullRequest{Additions: &zeroValue}\n\tp.GetAdditions()\n\tp = &PullRequest{}\n\tp.GetAdditions()\n\tp = nil\n\tp.GetAdditions()\n}\n\nfunc TestPullRequest_GetAssignee(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequest{}\n\tp.GetAssignee()\n\tp = nil\n\tp.GetAssignee()\n}\n\nfunc TestPullRequest_GetAssignees(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*User{}\n\tp := &PullRequest{Assignees: zeroValue}\n\tp.GetAssignees()\n\tp = &PullRequest{}\n\tp.GetAssignees()\n\tp = nil\n\tp.GetAssignees()\n}\n\nfunc TestPullRequest_GetAuthorAssociation(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequest{AuthorAssociation: &zeroValue}\n\tp.GetAuthorAssociation()\n\tp = &PullRequest{}\n\tp.GetAuthorAssociation()\n\tp = nil\n\tp.GetAuthorAssociation()\n}\n\nfunc TestPullRequest_GetAutoMerge(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequest{}\n\tp.GetAutoMerge()\n\tp = nil\n\tp.GetAutoMerge()\n}\n\nfunc TestPullRequest_GetBase(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequest{}\n\tp.GetBase()\n\tp = nil\n\tp.GetBase()\n}\n\nfunc TestPullRequest_GetBody(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequest{Body: &zeroValue}\n\tp.GetBody()\n\tp = &PullRequest{}\n\tp.GetBody()\n\tp = nil\n\tp.GetBody()\n}\n\nfunc TestPullRequest_GetChangedFiles(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PullRequest{ChangedFiles: &zeroValue}\n\tp.GetChangedFiles()\n\tp = &PullRequest{}\n\tp.GetChangedFiles()\n\tp = nil\n\tp.GetChangedFiles()\n}\n\nfunc TestPullRequest_GetClosedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PullRequest{ClosedAt: &zeroValue}\n\tp.GetClosedAt()\n\tp = &PullRequest{}\n\tp.GetClosedAt()\n\tp = nil\n\tp.GetClosedAt()\n}\n\nfunc TestPullRequest_GetComments(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PullRequest{Comments: &zeroValue}\n\tp.GetComments()\n\tp = &PullRequest{}\n\tp.GetComments()\n\tp = nil\n\tp.GetComments()\n}\n\nfunc TestPullRequest_GetCommentsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequest{CommentsURL: &zeroValue}\n\tp.GetCommentsURL()\n\tp = &PullRequest{}\n\tp.GetCommentsURL()\n\tp = nil\n\tp.GetCommentsURL()\n}\n\nfunc TestPullRequest_GetCommits(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PullRequest{Commits: &zeroValue}\n\tp.GetCommits()\n\tp = &PullRequest{}\n\tp.GetCommits()\n\tp = nil\n\tp.GetCommits()\n}\n\nfunc TestPullRequest_GetCommitsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequest{CommitsURL: &zeroValue}\n\tp.GetCommitsURL()\n\tp = &PullRequest{}\n\tp.GetCommitsURL()\n\tp = nil\n\tp.GetCommitsURL()\n}\n\nfunc TestPullRequest_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PullRequest{CreatedAt: &zeroValue}\n\tp.GetCreatedAt()\n\tp = &PullRequest{}\n\tp.GetCreatedAt()\n\tp = nil\n\tp.GetCreatedAt()\n}\n\nfunc TestPullRequest_GetDeletions(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PullRequest{Deletions: &zeroValue}\n\tp.GetDeletions()\n\tp = &PullRequest{}\n\tp.GetDeletions()\n\tp = nil\n\tp.GetDeletions()\n}\n\nfunc TestPullRequest_GetDiffURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequest{DiffURL: &zeroValue}\n\tp.GetDiffURL()\n\tp = &PullRequest{}\n\tp.GetDiffURL()\n\tp = nil\n\tp.GetDiffURL()\n}\n\nfunc TestPullRequest_GetDraft(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PullRequest{Draft: &zeroValue}\n\tp.GetDraft()\n\tp = &PullRequest{}\n\tp.GetDraft()\n\tp = nil\n\tp.GetDraft()\n}\n\nfunc TestPullRequest_GetHead(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequest{}\n\tp.GetHead()\n\tp = nil\n\tp.GetHead()\n}\n\nfunc TestPullRequest_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequest{HTMLURL: &zeroValue}\n\tp.GetHTMLURL()\n\tp = &PullRequest{}\n\tp.GetHTMLURL()\n\tp = nil\n\tp.GetHTMLURL()\n}\n\nfunc TestPullRequest_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &PullRequest{ID: &zeroValue}\n\tp.GetID()\n\tp = &PullRequest{}\n\tp.GetID()\n\tp = nil\n\tp.GetID()\n}\n\nfunc TestPullRequest_GetIssueURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequest{IssueURL: &zeroValue}\n\tp.GetIssueURL()\n\tp = &PullRequest{}\n\tp.GetIssueURL()\n\tp = nil\n\tp.GetIssueURL()\n}\n\nfunc TestPullRequest_GetLabels(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Label{}\n\tp := &PullRequest{Labels: zeroValue}\n\tp.GetLabels()\n\tp = &PullRequest{}\n\tp.GetLabels()\n\tp = nil\n\tp.GetLabels()\n}\n\nfunc TestPullRequest_GetLinks(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequest{}\n\tp.GetLinks()\n\tp = nil\n\tp.GetLinks()\n}\n\nfunc TestPullRequest_GetLocked(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PullRequest{Locked: &zeroValue}\n\tp.GetLocked()\n\tp = &PullRequest{}\n\tp.GetLocked()\n\tp = nil\n\tp.GetLocked()\n}\n\nfunc TestPullRequest_GetMaintainerCanModify(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PullRequest{MaintainerCanModify: &zeroValue}\n\tp.GetMaintainerCanModify()\n\tp = &PullRequest{}\n\tp.GetMaintainerCanModify()\n\tp = nil\n\tp.GetMaintainerCanModify()\n}\n\nfunc TestPullRequest_GetMergeable(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PullRequest{Mergeable: &zeroValue}\n\tp.GetMergeable()\n\tp = &PullRequest{}\n\tp.GetMergeable()\n\tp = nil\n\tp.GetMergeable()\n}\n\nfunc TestPullRequest_GetMergeableState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequest{MergeableState: &zeroValue}\n\tp.GetMergeableState()\n\tp = &PullRequest{}\n\tp.GetMergeableState()\n\tp = nil\n\tp.GetMergeableState()\n}\n\nfunc TestPullRequest_GetMergeCommitSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequest{MergeCommitSHA: &zeroValue}\n\tp.GetMergeCommitSHA()\n\tp = &PullRequest{}\n\tp.GetMergeCommitSHA()\n\tp = nil\n\tp.GetMergeCommitSHA()\n}\n\nfunc TestPullRequest_GetMerged(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PullRequest{Merged: &zeroValue}\n\tp.GetMerged()\n\tp = &PullRequest{}\n\tp.GetMerged()\n\tp = nil\n\tp.GetMerged()\n}\n\nfunc TestPullRequest_GetMergedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PullRequest{MergedAt: &zeroValue}\n\tp.GetMergedAt()\n\tp = &PullRequest{}\n\tp.GetMergedAt()\n\tp = nil\n\tp.GetMergedAt()\n}\n\nfunc TestPullRequest_GetMergedBy(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequest{}\n\tp.GetMergedBy()\n\tp = nil\n\tp.GetMergedBy()\n}\n\nfunc TestPullRequest_GetMilestone(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequest{}\n\tp.GetMilestone()\n\tp = nil\n\tp.GetMilestone()\n}\n\nfunc TestPullRequest_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequest{NodeID: &zeroValue}\n\tp.GetNodeID()\n\tp = &PullRequest{}\n\tp.GetNodeID()\n\tp = nil\n\tp.GetNodeID()\n}\n\nfunc TestPullRequest_GetNumber(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PullRequest{Number: &zeroValue}\n\tp.GetNumber()\n\tp = &PullRequest{}\n\tp.GetNumber()\n\tp = nil\n\tp.GetNumber()\n}\n\nfunc TestPullRequest_GetPatchURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequest{PatchURL: &zeroValue}\n\tp.GetPatchURL()\n\tp = &PullRequest{}\n\tp.GetPatchURL()\n\tp = nil\n\tp.GetPatchURL()\n}\n\nfunc TestPullRequest_GetRebaseable(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PullRequest{Rebaseable: &zeroValue}\n\tp.GetRebaseable()\n\tp = &PullRequest{}\n\tp.GetRebaseable()\n\tp = nil\n\tp.GetRebaseable()\n}\n\nfunc TestPullRequest_GetRequestedReviewers(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*User{}\n\tp := &PullRequest{RequestedReviewers: zeroValue}\n\tp.GetRequestedReviewers()\n\tp = &PullRequest{}\n\tp.GetRequestedReviewers()\n\tp = nil\n\tp.GetRequestedReviewers()\n}\n\nfunc TestPullRequest_GetRequestedTeams(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Team{}\n\tp := &PullRequest{RequestedTeams: zeroValue}\n\tp.GetRequestedTeams()\n\tp = &PullRequest{}\n\tp.GetRequestedTeams()\n\tp = nil\n\tp.GetRequestedTeams()\n}\n\nfunc TestPullRequest_GetReviewComments(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PullRequest{ReviewComments: &zeroValue}\n\tp.GetReviewComments()\n\tp = &PullRequest{}\n\tp.GetReviewComments()\n\tp = nil\n\tp.GetReviewComments()\n}\n\nfunc TestPullRequest_GetReviewCommentsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequest{ReviewCommentsURL: &zeroValue}\n\tp.GetReviewCommentsURL()\n\tp = &PullRequest{}\n\tp.GetReviewCommentsURL()\n\tp = nil\n\tp.GetReviewCommentsURL()\n}\n\nfunc TestPullRequest_GetReviewCommentURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequest{ReviewCommentURL: &zeroValue}\n\tp.GetReviewCommentURL()\n\tp = &PullRequest{}\n\tp.GetReviewCommentURL()\n\tp = nil\n\tp.GetReviewCommentURL()\n}\n\nfunc TestPullRequest_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequest{State: &zeroValue}\n\tp.GetState()\n\tp = &PullRequest{}\n\tp.GetState()\n\tp = nil\n\tp.GetState()\n}\n\nfunc TestPullRequest_GetStatusesURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequest{StatusesURL: &zeroValue}\n\tp.GetStatusesURL()\n\tp = &PullRequest{}\n\tp.GetStatusesURL()\n\tp = nil\n\tp.GetStatusesURL()\n}\n\nfunc TestPullRequest_GetTitle(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequest{Title: &zeroValue}\n\tp.GetTitle()\n\tp = &PullRequest{}\n\tp.GetTitle()\n\tp = nil\n\tp.GetTitle()\n}\n\nfunc TestPullRequest_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PullRequest{UpdatedAt: &zeroValue}\n\tp.GetUpdatedAt()\n\tp = &PullRequest{}\n\tp.GetUpdatedAt()\n\tp = nil\n\tp.GetUpdatedAt()\n}\n\nfunc TestPullRequest_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequest{URL: &zeroValue}\n\tp.GetURL()\n\tp = &PullRequest{}\n\tp.GetURL()\n\tp = nil\n\tp.GetURL()\n}\n\nfunc TestPullRequest_GetUser(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequest{}\n\tp.GetUser()\n\tp = nil\n\tp.GetUser()\n}\n\nfunc TestPullRequestAutoMerge_GetCommitMessage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestAutoMerge{CommitMessage: &zeroValue}\n\tp.GetCommitMessage()\n\tp = &PullRequestAutoMerge{}\n\tp.GetCommitMessage()\n\tp = nil\n\tp.GetCommitMessage()\n}\n\nfunc TestPullRequestAutoMerge_GetCommitTitle(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestAutoMerge{CommitTitle: &zeroValue}\n\tp.GetCommitTitle()\n\tp = &PullRequestAutoMerge{}\n\tp.GetCommitTitle()\n\tp = nil\n\tp.GetCommitTitle()\n}\n\nfunc TestPullRequestAutoMerge_GetEnabledBy(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestAutoMerge{}\n\tp.GetEnabledBy()\n\tp = nil\n\tp.GetEnabledBy()\n}\n\nfunc TestPullRequestAutoMerge_GetMergeMethod(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestAutoMerge{MergeMethod: &zeroValue}\n\tp.GetMergeMethod()\n\tp = &PullRequestAutoMerge{}\n\tp.GetMergeMethod()\n\tp = nil\n\tp.GetMergeMethod()\n}\n\nfunc TestPullRequestBranch_GetLabel(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestBranch{Label: &zeroValue}\n\tp.GetLabel()\n\tp = &PullRequestBranch{}\n\tp.GetLabel()\n\tp = nil\n\tp.GetLabel()\n}\n\nfunc TestPullRequestBranch_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestBranch{Ref: &zeroValue}\n\tp.GetRef()\n\tp = &PullRequestBranch{}\n\tp.GetRef()\n\tp = nil\n\tp.GetRef()\n}\n\nfunc TestPullRequestBranch_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestBranch{}\n\tp.GetRepo()\n\tp = nil\n\tp.GetRepo()\n}\n\nfunc TestPullRequestBranch_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestBranch{SHA: &zeroValue}\n\tp.GetSHA()\n\tp = &PullRequestBranch{}\n\tp.GetSHA()\n\tp = nil\n\tp.GetSHA()\n}\n\nfunc TestPullRequestBranch_GetUser(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestBranch{}\n\tp.GetUser()\n\tp = nil\n\tp.GetUser()\n}\n\nfunc TestPullRequestBranchRule_GetParameters(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestBranchRule{}\n\tp.GetParameters()\n\tp = nil\n\tp.GetParameters()\n}\n\nfunc TestPullRequestBranchUpdateOptions_GetExpectedHeadSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestBranchUpdateOptions{ExpectedHeadSHA: &zeroValue}\n\tp.GetExpectedHeadSHA()\n\tp = &PullRequestBranchUpdateOptions{}\n\tp.GetExpectedHeadSHA()\n\tp = nil\n\tp.GetExpectedHeadSHA()\n}\n\nfunc TestPullRequestBranchUpdateResponse_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestBranchUpdateResponse{Message: &zeroValue}\n\tp.GetMessage()\n\tp = &PullRequestBranchUpdateResponse{}\n\tp.GetMessage()\n\tp = nil\n\tp.GetMessage()\n}\n\nfunc TestPullRequestBranchUpdateResponse_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestBranchUpdateResponse{URL: &zeroValue}\n\tp.GetURL()\n\tp = &PullRequestBranchUpdateResponse{}\n\tp.GetURL()\n\tp = nil\n\tp.GetURL()\n}\n\nfunc TestPullRequestComment_GetAuthorAssociation(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestComment{AuthorAssociation: &zeroValue}\n\tp.GetAuthorAssociation()\n\tp = &PullRequestComment{}\n\tp.GetAuthorAssociation()\n\tp = nil\n\tp.GetAuthorAssociation()\n}\n\nfunc TestPullRequestComment_GetBody(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestComment{Body: &zeroValue}\n\tp.GetBody()\n\tp = &PullRequestComment{}\n\tp.GetBody()\n\tp = nil\n\tp.GetBody()\n}\n\nfunc TestPullRequestComment_GetCommitID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestComment{CommitID: &zeroValue}\n\tp.GetCommitID()\n\tp = &PullRequestComment{}\n\tp.GetCommitID()\n\tp = nil\n\tp.GetCommitID()\n}\n\nfunc TestPullRequestComment_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PullRequestComment{CreatedAt: &zeroValue}\n\tp.GetCreatedAt()\n\tp = &PullRequestComment{}\n\tp.GetCreatedAt()\n\tp = nil\n\tp.GetCreatedAt()\n}\n\nfunc TestPullRequestComment_GetDiffHunk(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestComment{DiffHunk: &zeroValue}\n\tp.GetDiffHunk()\n\tp = &PullRequestComment{}\n\tp.GetDiffHunk()\n\tp = nil\n\tp.GetDiffHunk()\n}\n\nfunc TestPullRequestComment_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestComment{HTMLURL: &zeroValue}\n\tp.GetHTMLURL()\n\tp = &PullRequestComment{}\n\tp.GetHTMLURL()\n\tp = nil\n\tp.GetHTMLURL()\n}\n\nfunc TestPullRequestComment_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &PullRequestComment{ID: &zeroValue}\n\tp.GetID()\n\tp = &PullRequestComment{}\n\tp.GetID()\n\tp = nil\n\tp.GetID()\n}\n\nfunc TestPullRequestComment_GetInReplyTo(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &PullRequestComment{InReplyTo: &zeroValue}\n\tp.GetInReplyTo()\n\tp = &PullRequestComment{}\n\tp.GetInReplyTo()\n\tp = nil\n\tp.GetInReplyTo()\n}\n\nfunc TestPullRequestComment_GetLine(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PullRequestComment{Line: &zeroValue}\n\tp.GetLine()\n\tp = &PullRequestComment{}\n\tp.GetLine()\n\tp = nil\n\tp.GetLine()\n}\n\nfunc TestPullRequestComment_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestComment{NodeID: &zeroValue}\n\tp.GetNodeID()\n\tp = &PullRequestComment{}\n\tp.GetNodeID()\n\tp = nil\n\tp.GetNodeID()\n}\n\nfunc TestPullRequestComment_GetOriginalCommitID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestComment{OriginalCommitID: &zeroValue}\n\tp.GetOriginalCommitID()\n\tp = &PullRequestComment{}\n\tp.GetOriginalCommitID()\n\tp = nil\n\tp.GetOriginalCommitID()\n}\n\nfunc TestPullRequestComment_GetOriginalLine(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PullRequestComment{OriginalLine: &zeroValue}\n\tp.GetOriginalLine()\n\tp = &PullRequestComment{}\n\tp.GetOriginalLine()\n\tp = nil\n\tp.GetOriginalLine()\n}\n\nfunc TestPullRequestComment_GetOriginalPosition(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PullRequestComment{OriginalPosition: &zeroValue}\n\tp.GetOriginalPosition()\n\tp = &PullRequestComment{}\n\tp.GetOriginalPosition()\n\tp = nil\n\tp.GetOriginalPosition()\n}\n\nfunc TestPullRequestComment_GetOriginalStartLine(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PullRequestComment{OriginalStartLine: &zeroValue}\n\tp.GetOriginalStartLine()\n\tp = &PullRequestComment{}\n\tp.GetOriginalStartLine()\n\tp = nil\n\tp.GetOriginalStartLine()\n}\n\nfunc TestPullRequestComment_GetPath(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestComment{Path: &zeroValue}\n\tp.GetPath()\n\tp = &PullRequestComment{}\n\tp.GetPath()\n\tp = nil\n\tp.GetPath()\n}\n\nfunc TestPullRequestComment_GetPosition(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PullRequestComment{Position: &zeroValue}\n\tp.GetPosition()\n\tp = &PullRequestComment{}\n\tp.GetPosition()\n\tp = nil\n\tp.GetPosition()\n}\n\nfunc TestPullRequestComment_GetPullRequestReviewID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &PullRequestComment{PullRequestReviewID: &zeroValue}\n\tp.GetPullRequestReviewID()\n\tp = &PullRequestComment{}\n\tp.GetPullRequestReviewID()\n\tp = nil\n\tp.GetPullRequestReviewID()\n}\n\nfunc TestPullRequestComment_GetPullRequestURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestComment{PullRequestURL: &zeroValue}\n\tp.GetPullRequestURL()\n\tp = &PullRequestComment{}\n\tp.GetPullRequestURL()\n\tp = nil\n\tp.GetPullRequestURL()\n}\n\nfunc TestPullRequestComment_GetReactions(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestComment{}\n\tp.GetReactions()\n\tp = nil\n\tp.GetReactions()\n}\n\nfunc TestPullRequestComment_GetSide(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestComment{Side: &zeroValue}\n\tp.GetSide()\n\tp = &PullRequestComment{}\n\tp.GetSide()\n\tp = nil\n\tp.GetSide()\n}\n\nfunc TestPullRequestComment_GetStartLine(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PullRequestComment{StartLine: &zeroValue}\n\tp.GetStartLine()\n\tp = &PullRequestComment{}\n\tp.GetStartLine()\n\tp = nil\n\tp.GetStartLine()\n}\n\nfunc TestPullRequestComment_GetStartSide(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestComment{StartSide: &zeroValue}\n\tp.GetStartSide()\n\tp = &PullRequestComment{}\n\tp.GetStartSide()\n\tp = nil\n\tp.GetStartSide()\n}\n\nfunc TestPullRequestComment_GetSubjectType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestComment{SubjectType: &zeroValue}\n\tp.GetSubjectType()\n\tp = &PullRequestComment{}\n\tp.GetSubjectType()\n\tp = nil\n\tp.GetSubjectType()\n}\n\nfunc TestPullRequestComment_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PullRequestComment{UpdatedAt: &zeroValue}\n\tp.GetUpdatedAt()\n\tp = &PullRequestComment{}\n\tp.GetUpdatedAt()\n\tp = nil\n\tp.GetUpdatedAt()\n}\n\nfunc TestPullRequestComment_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestComment{URL: &zeroValue}\n\tp.GetURL()\n\tp = &PullRequestComment{}\n\tp.GetURL()\n\tp = nil\n\tp.GetURL()\n}\n\nfunc TestPullRequestComment_GetUser(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestComment{}\n\tp.GetUser()\n\tp = nil\n\tp.GetUser()\n}\n\nfunc TestPullRequestEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestEvent{Action: &zeroValue}\n\tp.GetAction()\n\tp = &PullRequestEvent{}\n\tp.GetAction()\n\tp = nil\n\tp.GetAction()\n}\n\nfunc TestPullRequestEvent_GetAfter(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestEvent{After: &zeroValue}\n\tp.GetAfter()\n\tp = &PullRequestEvent{}\n\tp.GetAfter()\n\tp = nil\n\tp.GetAfter()\n}\n\nfunc TestPullRequestEvent_GetAssignee(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestEvent{}\n\tp.GetAssignee()\n\tp = nil\n\tp.GetAssignee()\n}\n\nfunc TestPullRequestEvent_GetBefore(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestEvent{Before: &zeroValue}\n\tp.GetBefore()\n\tp = &PullRequestEvent{}\n\tp.GetBefore()\n\tp = nil\n\tp.GetBefore()\n}\n\nfunc TestPullRequestEvent_GetChanges(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestEvent{}\n\tp.GetChanges()\n\tp = nil\n\tp.GetChanges()\n}\n\nfunc TestPullRequestEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestEvent{}\n\tp.GetInstallation()\n\tp = nil\n\tp.GetInstallation()\n}\n\nfunc TestPullRequestEvent_GetLabel(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestEvent{}\n\tp.GetLabel()\n\tp = nil\n\tp.GetLabel()\n}\n\nfunc TestPullRequestEvent_GetNumber(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PullRequestEvent{Number: &zeroValue}\n\tp.GetNumber()\n\tp = &PullRequestEvent{}\n\tp.GetNumber()\n\tp = nil\n\tp.GetNumber()\n}\n\nfunc TestPullRequestEvent_GetOrganization(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestEvent{}\n\tp.GetOrganization()\n\tp = nil\n\tp.GetOrganization()\n}\n\nfunc TestPullRequestEvent_GetPerformedViaGithubApp(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestEvent{}\n\tp.GetPerformedViaGithubApp()\n\tp = nil\n\tp.GetPerformedViaGithubApp()\n}\n\nfunc TestPullRequestEvent_GetPullRequest(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestEvent{}\n\tp.GetPullRequest()\n\tp = nil\n\tp.GetPullRequest()\n}\n\nfunc TestPullRequestEvent_GetReason(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestEvent{Reason: &zeroValue}\n\tp.GetReason()\n\tp = &PullRequestEvent{}\n\tp.GetReason()\n\tp = nil\n\tp.GetReason()\n}\n\nfunc TestPullRequestEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestEvent{}\n\tp.GetRepo()\n\tp = nil\n\tp.GetRepo()\n}\n\nfunc TestPullRequestEvent_GetRequestedReviewer(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestEvent{}\n\tp.GetRequestedReviewer()\n\tp = nil\n\tp.GetRequestedReviewer()\n}\n\nfunc TestPullRequestEvent_GetRequestedTeam(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestEvent{}\n\tp.GetRequestedTeam()\n\tp = nil\n\tp.GetRequestedTeam()\n}\n\nfunc TestPullRequestEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestEvent{}\n\tp.GetSender()\n\tp = nil\n\tp.GetSender()\n}\n\nfunc TestPullRequestLinks_GetDiffURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestLinks{DiffURL: &zeroValue}\n\tp.GetDiffURL()\n\tp = &PullRequestLinks{}\n\tp.GetDiffURL()\n\tp = nil\n\tp.GetDiffURL()\n}\n\nfunc TestPullRequestLinks_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestLinks{HTMLURL: &zeroValue}\n\tp.GetHTMLURL()\n\tp = &PullRequestLinks{}\n\tp.GetHTMLURL()\n\tp = nil\n\tp.GetHTMLURL()\n}\n\nfunc TestPullRequestLinks_GetMergedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PullRequestLinks{MergedAt: &zeroValue}\n\tp.GetMergedAt()\n\tp = &PullRequestLinks{}\n\tp.GetMergedAt()\n\tp = nil\n\tp.GetMergedAt()\n}\n\nfunc TestPullRequestLinks_GetPatchURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestLinks{PatchURL: &zeroValue}\n\tp.GetPatchURL()\n\tp = &PullRequestLinks{}\n\tp.GetPatchURL()\n\tp = nil\n\tp.GetPatchURL()\n}\n\nfunc TestPullRequestLinks_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestLinks{URL: &zeroValue}\n\tp.GetURL()\n\tp = &PullRequestLinks{}\n\tp.GetURL()\n\tp = nil\n\tp.GetURL()\n}\n\nfunc TestPullRequestListCommentsOptions_GetDirection(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestListCommentsOptions{}\n\tp.GetDirection()\n\tp = nil\n\tp.GetDirection()\n}\n\nfunc TestPullRequestListCommentsOptions_GetSince(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestListCommentsOptions{}\n\tp.GetSince()\n\tp = nil\n\tp.GetSince()\n}\n\nfunc TestPullRequestListCommentsOptions_GetSort(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestListCommentsOptions{}\n\tp.GetSort()\n\tp = nil\n\tp.GetSort()\n}\n\nfunc TestPullRequestListOptions_GetBase(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestListOptions{}\n\tp.GetBase()\n\tp = nil\n\tp.GetBase()\n}\n\nfunc TestPullRequestListOptions_GetDirection(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestListOptions{}\n\tp.GetDirection()\n\tp = nil\n\tp.GetDirection()\n}\n\nfunc TestPullRequestListOptions_GetHead(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestListOptions{}\n\tp.GetHead()\n\tp = nil\n\tp.GetHead()\n}\n\nfunc TestPullRequestListOptions_GetSort(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestListOptions{}\n\tp.GetSort()\n\tp = nil\n\tp.GetSort()\n}\n\nfunc TestPullRequestListOptions_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestListOptions{}\n\tp.GetState()\n\tp = nil\n\tp.GetState()\n}\n\nfunc TestPullRequestMergeResult_GetMerged(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PullRequestMergeResult{Merged: &zeroValue}\n\tp.GetMerged()\n\tp = &PullRequestMergeResult{}\n\tp.GetMerged()\n\tp = nil\n\tp.GetMerged()\n}\n\nfunc TestPullRequestMergeResult_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestMergeResult{Message: &zeroValue}\n\tp.GetMessage()\n\tp = &PullRequestMergeResult{}\n\tp.GetMessage()\n\tp = nil\n\tp.GetMessage()\n}\n\nfunc TestPullRequestMergeResult_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestMergeResult{SHA: &zeroValue}\n\tp.GetSHA()\n\tp = &PullRequestMergeResult{}\n\tp.GetSHA()\n\tp = nil\n\tp.GetSHA()\n}\n\nfunc TestPullRequestOptions_GetCommitTitle(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestOptions{}\n\tp.GetCommitTitle()\n\tp = nil\n\tp.GetCommitTitle()\n}\n\nfunc TestPullRequestOptions_GetDontDefaultIfBlank(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestOptions{}\n\tp.GetDontDefaultIfBlank()\n\tp = nil\n\tp.GetDontDefaultIfBlank()\n}\n\nfunc TestPullRequestOptions_GetMergeMethod(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestOptions{}\n\tp.GetMergeMethod()\n\tp = nil\n\tp.GetMergeMethod()\n}\n\nfunc TestPullRequestOptions_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestOptions{}\n\tp.GetSHA()\n\tp = nil\n\tp.GetSHA()\n}\n\nfunc TestPullRequestReview_GetAuthorAssociation(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestReview{AuthorAssociation: &zeroValue}\n\tp.GetAuthorAssociation()\n\tp = &PullRequestReview{}\n\tp.GetAuthorAssociation()\n\tp = nil\n\tp.GetAuthorAssociation()\n}\n\nfunc TestPullRequestReview_GetBody(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestReview{Body: &zeroValue}\n\tp.GetBody()\n\tp = &PullRequestReview{}\n\tp.GetBody()\n\tp = nil\n\tp.GetBody()\n}\n\nfunc TestPullRequestReview_GetCommitID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestReview{CommitID: &zeroValue}\n\tp.GetCommitID()\n\tp = &PullRequestReview{}\n\tp.GetCommitID()\n\tp = nil\n\tp.GetCommitID()\n}\n\nfunc TestPullRequestReview_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestReview{HTMLURL: &zeroValue}\n\tp.GetHTMLURL()\n\tp = &PullRequestReview{}\n\tp.GetHTMLURL()\n\tp = nil\n\tp.GetHTMLURL()\n}\n\nfunc TestPullRequestReview_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &PullRequestReview{ID: &zeroValue}\n\tp.GetID()\n\tp = &PullRequestReview{}\n\tp.GetID()\n\tp = nil\n\tp.GetID()\n}\n\nfunc TestPullRequestReview_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestReview{NodeID: &zeroValue}\n\tp.GetNodeID()\n\tp = &PullRequestReview{}\n\tp.GetNodeID()\n\tp = nil\n\tp.GetNodeID()\n}\n\nfunc TestPullRequestReview_GetPullRequestURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestReview{PullRequestURL: &zeroValue}\n\tp.GetPullRequestURL()\n\tp = &PullRequestReview{}\n\tp.GetPullRequestURL()\n\tp = nil\n\tp.GetPullRequestURL()\n}\n\nfunc TestPullRequestReview_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestReview{State: &zeroValue}\n\tp.GetState()\n\tp = &PullRequestReview{}\n\tp.GetState()\n\tp = nil\n\tp.GetState()\n}\n\nfunc TestPullRequestReview_GetSubmittedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PullRequestReview{SubmittedAt: &zeroValue}\n\tp.GetSubmittedAt()\n\tp = &PullRequestReview{}\n\tp.GetSubmittedAt()\n\tp = nil\n\tp.GetSubmittedAt()\n}\n\nfunc TestPullRequestReview_GetUser(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReview{}\n\tp.GetUser()\n\tp = nil\n\tp.GetUser()\n}\n\nfunc TestPullRequestReviewCommentEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestReviewCommentEvent{Action: &zeroValue}\n\tp.GetAction()\n\tp = &PullRequestReviewCommentEvent{}\n\tp.GetAction()\n\tp = nil\n\tp.GetAction()\n}\n\nfunc TestPullRequestReviewCommentEvent_GetChanges(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewCommentEvent{}\n\tp.GetChanges()\n\tp = nil\n\tp.GetChanges()\n}\n\nfunc TestPullRequestReviewCommentEvent_GetComment(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewCommentEvent{}\n\tp.GetComment()\n\tp = nil\n\tp.GetComment()\n}\n\nfunc TestPullRequestReviewCommentEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewCommentEvent{}\n\tp.GetInstallation()\n\tp = nil\n\tp.GetInstallation()\n}\n\nfunc TestPullRequestReviewCommentEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewCommentEvent{}\n\tp.GetOrg()\n\tp = nil\n\tp.GetOrg()\n}\n\nfunc TestPullRequestReviewCommentEvent_GetPullRequest(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewCommentEvent{}\n\tp.GetPullRequest()\n\tp = nil\n\tp.GetPullRequest()\n}\n\nfunc TestPullRequestReviewCommentEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewCommentEvent{}\n\tp.GetRepo()\n\tp = nil\n\tp.GetRepo()\n}\n\nfunc TestPullRequestReviewCommentEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewCommentEvent{}\n\tp.GetSender()\n\tp = nil\n\tp.GetSender()\n}\n\nfunc TestPullRequestReviewDismissalRequest_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestReviewDismissalRequest{Message: &zeroValue}\n\tp.GetMessage()\n\tp = &PullRequestReviewDismissalRequest{}\n\tp.GetMessage()\n\tp = nil\n\tp.GetMessage()\n}\n\nfunc TestPullRequestReviewEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestReviewEvent{Action: &zeroValue}\n\tp.GetAction()\n\tp = &PullRequestReviewEvent{}\n\tp.GetAction()\n\tp = nil\n\tp.GetAction()\n}\n\nfunc TestPullRequestReviewEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewEvent{}\n\tp.GetInstallation()\n\tp = nil\n\tp.GetInstallation()\n}\n\nfunc TestPullRequestReviewEvent_GetOrganization(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewEvent{}\n\tp.GetOrganization()\n\tp = nil\n\tp.GetOrganization()\n}\n\nfunc TestPullRequestReviewEvent_GetPullRequest(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewEvent{}\n\tp.GetPullRequest()\n\tp = nil\n\tp.GetPullRequest()\n}\n\nfunc TestPullRequestReviewEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewEvent{}\n\tp.GetRepo()\n\tp = nil\n\tp.GetRepo()\n}\n\nfunc TestPullRequestReviewEvent_GetReview(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewEvent{}\n\tp.GetReview()\n\tp = nil\n\tp.GetReview()\n}\n\nfunc TestPullRequestReviewEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewEvent{}\n\tp.GetSender()\n\tp = nil\n\tp.GetSender()\n}\n\nfunc TestPullRequestReviewRequest_GetBody(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestReviewRequest{Body: &zeroValue}\n\tp.GetBody()\n\tp = &PullRequestReviewRequest{}\n\tp.GetBody()\n\tp = nil\n\tp.GetBody()\n}\n\nfunc TestPullRequestReviewRequest_GetComments(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*DraftReviewComment{}\n\tp := &PullRequestReviewRequest{Comments: zeroValue}\n\tp.GetComments()\n\tp = &PullRequestReviewRequest{}\n\tp.GetComments()\n\tp = nil\n\tp.GetComments()\n}\n\nfunc TestPullRequestReviewRequest_GetCommitID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestReviewRequest{CommitID: &zeroValue}\n\tp.GetCommitID()\n\tp = &PullRequestReviewRequest{}\n\tp.GetCommitID()\n\tp = nil\n\tp.GetCommitID()\n}\n\nfunc TestPullRequestReviewRequest_GetEvent(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestReviewRequest{Event: &zeroValue}\n\tp.GetEvent()\n\tp = &PullRequestReviewRequest{}\n\tp.GetEvent()\n\tp = nil\n\tp.GetEvent()\n}\n\nfunc TestPullRequestReviewRequest_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestReviewRequest{NodeID: &zeroValue}\n\tp.GetNodeID()\n\tp = &PullRequestReviewRequest{}\n\tp.GetNodeID()\n\tp = nil\n\tp.GetNodeID()\n}\n\nfunc TestPullRequestReviewsEnforcement_GetBypassPullRequestAllowances(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewsEnforcement{}\n\tp.GetBypassPullRequestAllowances()\n\tp = nil\n\tp.GetBypassPullRequestAllowances()\n}\n\nfunc TestPullRequestReviewsEnforcement_GetDismissalRestrictions(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewsEnforcement{}\n\tp.GetDismissalRestrictions()\n\tp = nil\n\tp.GetDismissalRestrictions()\n}\n\nfunc TestPullRequestReviewsEnforcement_GetDismissStaleReviews(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewsEnforcement{}\n\tp.GetDismissStaleReviews()\n\tp = nil\n\tp.GetDismissStaleReviews()\n}\n\nfunc TestPullRequestReviewsEnforcement_GetRequireCodeOwnerReviews(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewsEnforcement{}\n\tp.GetRequireCodeOwnerReviews()\n\tp = nil\n\tp.GetRequireCodeOwnerReviews()\n}\n\nfunc TestPullRequestReviewsEnforcement_GetRequiredApprovingReviewCount(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewsEnforcement{}\n\tp.GetRequiredApprovingReviewCount()\n\tp = nil\n\tp.GetRequiredApprovingReviewCount()\n}\n\nfunc TestPullRequestReviewsEnforcement_GetRequireLastPushApproval(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewsEnforcement{}\n\tp.GetRequireLastPushApproval()\n\tp = nil\n\tp.GetRequireLastPushApproval()\n}\n\nfunc TestPullRequestReviewsEnforcementLevelChanges_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestReviewsEnforcementLevelChanges{From: &zeroValue}\n\tp.GetFrom()\n\tp = &PullRequestReviewsEnforcementLevelChanges{}\n\tp.GetFrom()\n\tp = nil\n\tp.GetFrom()\n}\n\nfunc TestPullRequestReviewsEnforcementRequest_GetBypassPullRequestAllowancesRequest(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewsEnforcementRequest{}\n\tp.GetBypassPullRequestAllowancesRequest()\n\tp = nil\n\tp.GetBypassPullRequestAllowancesRequest()\n}\n\nfunc TestPullRequestReviewsEnforcementRequest_GetDismissalRestrictionsRequest(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewsEnforcementRequest{}\n\tp.GetDismissalRestrictionsRequest()\n\tp = nil\n\tp.GetDismissalRestrictionsRequest()\n}\n\nfunc TestPullRequestReviewsEnforcementRequest_GetDismissStaleReviews(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewsEnforcementRequest{}\n\tp.GetDismissStaleReviews()\n\tp = nil\n\tp.GetDismissStaleReviews()\n}\n\nfunc TestPullRequestReviewsEnforcementRequest_GetRequireCodeOwnerReviews(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewsEnforcementRequest{}\n\tp.GetRequireCodeOwnerReviews()\n\tp = nil\n\tp.GetRequireCodeOwnerReviews()\n}\n\nfunc TestPullRequestReviewsEnforcementRequest_GetRequiredApprovingReviewCount(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewsEnforcementRequest{}\n\tp.GetRequiredApprovingReviewCount()\n\tp = nil\n\tp.GetRequiredApprovingReviewCount()\n}\n\nfunc TestPullRequestReviewsEnforcementRequest_GetRequireLastPushApproval(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PullRequestReviewsEnforcementRequest{RequireLastPushApproval: &zeroValue}\n\tp.GetRequireLastPushApproval()\n\tp = &PullRequestReviewsEnforcementRequest{}\n\tp.GetRequireLastPushApproval()\n\tp = nil\n\tp.GetRequireLastPushApproval()\n}\n\nfunc TestPullRequestReviewsEnforcementUpdate_GetBypassPullRequestAllowancesRequest(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewsEnforcementUpdate{}\n\tp.GetBypassPullRequestAllowancesRequest()\n\tp = nil\n\tp.GetBypassPullRequestAllowancesRequest()\n}\n\nfunc TestPullRequestReviewsEnforcementUpdate_GetDismissalRestrictionsRequest(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewsEnforcementUpdate{}\n\tp.GetDismissalRestrictionsRequest()\n\tp = nil\n\tp.GetDismissalRestrictionsRequest()\n}\n\nfunc TestPullRequestReviewsEnforcementUpdate_GetDismissStaleReviews(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PullRequestReviewsEnforcementUpdate{DismissStaleReviews: &zeroValue}\n\tp.GetDismissStaleReviews()\n\tp = &PullRequestReviewsEnforcementUpdate{}\n\tp.GetDismissStaleReviews()\n\tp = nil\n\tp.GetDismissStaleReviews()\n}\n\nfunc TestPullRequestReviewsEnforcementUpdate_GetRequireCodeOwnerReviews(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PullRequestReviewsEnforcementUpdate{RequireCodeOwnerReviews: &zeroValue}\n\tp.GetRequireCodeOwnerReviews()\n\tp = &PullRequestReviewsEnforcementUpdate{}\n\tp.GetRequireCodeOwnerReviews()\n\tp = nil\n\tp.GetRequireCodeOwnerReviews()\n}\n\nfunc TestPullRequestReviewsEnforcementUpdate_GetRequiredApprovingReviewCount(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewsEnforcementUpdate{}\n\tp.GetRequiredApprovingReviewCount()\n\tp = nil\n\tp.GetRequiredApprovingReviewCount()\n}\n\nfunc TestPullRequestReviewsEnforcementUpdate_GetRequireLastPushApproval(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PullRequestReviewsEnforcementUpdate{RequireLastPushApproval: &zeroValue}\n\tp.GetRequireLastPushApproval()\n\tp = &PullRequestReviewsEnforcementUpdate{}\n\tp.GetRequireLastPushApproval()\n\tp = nil\n\tp.GetRequireLastPushApproval()\n}\n\nfunc TestPullRequestReviewThreadEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestReviewThreadEvent{Action: &zeroValue}\n\tp.GetAction()\n\tp = &PullRequestReviewThreadEvent{}\n\tp.GetAction()\n\tp = nil\n\tp.GetAction()\n}\n\nfunc TestPullRequestReviewThreadEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewThreadEvent{}\n\tp.GetInstallation()\n\tp = nil\n\tp.GetInstallation()\n}\n\nfunc TestPullRequestReviewThreadEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewThreadEvent{}\n\tp.GetOrg()\n\tp = nil\n\tp.GetOrg()\n}\n\nfunc TestPullRequestReviewThreadEvent_GetPullRequest(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewThreadEvent{}\n\tp.GetPullRequest()\n\tp = nil\n\tp.GetPullRequest()\n}\n\nfunc TestPullRequestReviewThreadEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewThreadEvent{}\n\tp.GetRepo()\n\tp = nil\n\tp.GetRepo()\n}\n\nfunc TestPullRequestReviewThreadEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewThreadEvent{}\n\tp.GetSender()\n\tp = nil\n\tp.GetSender()\n}\n\nfunc TestPullRequestReviewThreadEvent_GetThread(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestReviewThreadEvent{}\n\tp.GetThread()\n\tp = nil\n\tp.GetThread()\n}\n\nfunc TestPullRequestRuleParameters_GetAllowedMergeMethods(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []PullRequestMergeMethod{}\n\tp := &PullRequestRuleParameters{AllowedMergeMethods: zeroValue}\n\tp.GetAllowedMergeMethods()\n\tp = &PullRequestRuleParameters{}\n\tp.GetAllowedMergeMethods()\n\tp = nil\n\tp.GetAllowedMergeMethods()\n}\n\nfunc TestPullRequestRuleParameters_GetDismissStaleReviewsOnPush(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestRuleParameters{}\n\tp.GetDismissStaleReviewsOnPush()\n\tp = nil\n\tp.GetDismissStaleReviewsOnPush()\n}\n\nfunc TestPullRequestRuleParameters_GetRequireCodeOwnerReview(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestRuleParameters{}\n\tp.GetRequireCodeOwnerReview()\n\tp = nil\n\tp.GetRequireCodeOwnerReview()\n}\n\nfunc TestPullRequestRuleParameters_GetRequiredApprovingReviewCount(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestRuleParameters{}\n\tp.GetRequiredApprovingReviewCount()\n\tp = nil\n\tp.GetRequiredApprovingReviewCount()\n}\n\nfunc TestPullRequestRuleParameters_GetRequiredReviewers(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*RulesetRequiredReviewer{}\n\tp := &PullRequestRuleParameters{RequiredReviewers: zeroValue}\n\tp.GetRequiredReviewers()\n\tp = &PullRequestRuleParameters{}\n\tp.GetRequiredReviewers()\n\tp = nil\n\tp.GetRequiredReviewers()\n}\n\nfunc TestPullRequestRuleParameters_GetRequiredReviewThreadResolution(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestRuleParameters{}\n\tp.GetRequiredReviewThreadResolution()\n\tp = nil\n\tp.GetRequiredReviewThreadResolution()\n}\n\nfunc TestPullRequestRuleParameters_GetRequireLastPushApproval(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestRuleParameters{}\n\tp.GetRequireLastPushApproval()\n\tp = nil\n\tp.GetRequireLastPushApproval()\n}\n\nfunc TestPullRequestTargetEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestTargetEvent{Action: &zeroValue}\n\tp.GetAction()\n\tp = &PullRequestTargetEvent{}\n\tp.GetAction()\n\tp = nil\n\tp.GetAction()\n}\n\nfunc TestPullRequestTargetEvent_GetAfter(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestTargetEvent{After: &zeroValue}\n\tp.GetAfter()\n\tp = &PullRequestTargetEvent{}\n\tp.GetAfter()\n\tp = nil\n\tp.GetAfter()\n}\n\nfunc TestPullRequestTargetEvent_GetAssignee(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestTargetEvent{}\n\tp.GetAssignee()\n\tp = nil\n\tp.GetAssignee()\n}\n\nfunc TestPullRequestTargetEvent_GetBefore(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestTargetEvent{Before: &zeroValue}\n\tp.GetBefore()\n\tp = &PullRequestTargetEvent{}\n\tp.GetBefore()\n\tp = nil\n\tp.GetBefore()\n}\n\nfunc TestPullRequestTargetEvent_GetChanges(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestTargetEvent{}\n\tp.GetChanges()\n\tp = nil\n\tp.GetChanges()\n}\n\nfunc TestPullRequestTargetEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestTargetEvent{}\n\tp.GetInstallation()\n\tp = nil\n\tp.GetInstallation()\n}\n\nfunc TestPullRequestTargetEvent_GetLabel(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestTargetEvent{}\n\tp.GetLabel()\n\tp = nil\n\tp.GetLabel()\n}\n\nfunc TestPullRequestTargetEvent_GetNumber(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PullRequestTargetEvent{Number: &zeroValue}\n\tp.GetNumber()\n\tp = &PullRequestTargetEvent{}\n\tp.GetNumber()\n\tp = nil\n\tp.GetNumber()\n}\n\nfunc TestPullRequestTargetEvent_GetOrganization(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestTargetEvent{}\n\tp.GetOrganization()\n\tp = nil\n\tp.GetOrganization()\n}\n\nfunc TestPullRequestTargetEvent_GetPerformedViaGithubApp(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestTargetEvent{}\n\tp.GetPerformedViaGithubApp()\n\tp = nil\n\tp.GetPerformedViaGithubApp()\n}\n\nfunc TestPullRequestTargetEvent_GetPullRequest(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestTargetEvent{}\n\tp.GetPullRequest()\n\tp = nil\n\tp.GetPullRequest()\n}\n\nfunc TestPullRequestTargetEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestTargetEvent{}\n\tp.GetRepo()\n\tp = nil\n\tp.GetRepo()\n}\n\nfunc TestPullRequestTargetEvent_GetRequestedReviewer(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestTargetEvent{}\n\tp.GetRequestedReviewer()\n\tp = nil\n\tp.GetRequestedReviewer()\n}\n\nfunc TestPullRequestTargetEvent_GetRequestedTeam(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestTargetEvent{}\n\tp.GetRequestedTeam()\n\tp = nil\n\tp.GetRequestedTeam()\n}\n\nfunc TestPullRequestTargetEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PullRequestTargetEvent{}\n\tp.GetSender()\n\tp = nil\n\tp.GetSender()\n}\n\nfunc TestPullRequestThread_GetComments(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*PullRequestComment{}\n\tp := &PullRequestThread{Comments: zeroValue}\n\tp.GetComments()\n\tp = &PullRequestThread{}\n\tp.GetComments()\n\tp = nil\n\tp.GetComments()\n}\n\nfunc TestPullRequestThread_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &PullRequestThread{ID: &zeroValue}\n\tp.GetID()\n\tp = &PullRequestThread{}\n\tp.GetID()\n\tp = nil\n\tp.GetID()\n}\n\nfunc TestPullRequestThread_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PullRequestThread{NodeID: &zeroValue}\n\tp.GetNodeID()\n\tp = &PullRequestThread{}\n\tp.GetNodeID()\n\tp = nil\n\tp.GetNodeID()\n}\n\nfunc TestPullStats_GetMergeablePulls(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PullStats{MergeablePulls: &zeroValue}\n\tp.GetMergeablePulls()\n\tp = &PullStats{}\n\tp.GetMergeablePulls()\n\tp = nil\n\tp.GetMergeablePulls()\n}\n\nfunc TestPullStats_GetMergedPulls(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PullStats{MergedPulls: &zeroValue}\n\tp.GetMergedPulls()\n\tp = &PullStats{}\n\tp.GetMergedPulls()\n\tp = nil\n\tp.GetMergedPulls()\n}\n\nfunc TestPullStats_GetTotalPulls(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PullStats{TotalPulls: &zeroValue}\n\tp.GetTotalPulls()\n\tp = &PullStats{}\n\tp.GetTotalPulls()\n\tp = nil\n\tp.GetTotalPulls()\n}\n\nfunc TestPullStats_GetUnmergeablePulls(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PullStats{UnmergeablePulls: &zeroValue}\n\tp.GetUnmergeablePulls()\n\tp = &PullStats{}\n\tp.GetUnmergeablePulls()\n\tp = nil\n\tp.GetUnmergeablePulls()\n}\n\nfunc TestPunchCard_GetCommits(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PunchCard{Commits: &zeroValue}\n\tp.GetCommits()\n\tp = &PunchCard{}\n\tp.GetCommits()\n\tp = nil\n\tp.GetCommits()\n}\n\nfunc TestPunchCard_GetDay(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PunchCard{Day: &zeroValue}\n\tp.GetDay()\n\tp = &PunchCard{}\n\tp.GetDay()\n\tp = nil\n\tp.GetDay()\n}\n\nfunc TestPunchCard_GetHour(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PunchCard{Hour: &zeroValue}\n\tp.GetHour()\n\tp = &PunchCard{}\n\tp.GetHour()\n\tp = nil\n\tp.GetHour()\n}\n\nfunc TestPushEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PushEvent{Action: &zeroValue}\n\tp.GetAction()\n\tp = &PushEvent{}\n\tp.GetAction()\n\tp = nil\n\tp.GetAction()\n}\n\nfunc TestPushEvent_GetAfter(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PushEvent{After: &zeroValue}\n\tp.GetAfter()\n\tp = &PushEvent{}\n\tp.GetAfter()\n\tp = nil\n\tp.GetAfter()\n}\n\nfunc TestPushEvent_GetBaseRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PushEvent{BaseRef: &zeroValue}\n\tp.GetBaseRef()\n\tp = &PushEvent{}\n\tp.GetBaseRef()\n\tp = nil\n\tp.GetBaseRef()\n}\n\nfunc TestPushEvent_GetBefore(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PushEvent{Before: &zeroValue}\n\tp.GetBefore()\n\tp = &PushEvent{}\n\tp.GetBefore()\n\tp = nil\n\tp.GetBefore()\n}\n\nfunc TestPushEvent_GetCommits(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*HeadCommit{}\n\tp := &PushEvent{Commits: zeroValue}\n\tp.GetCommits()\n\tp = &PushEvent{}\n\tp.GetCommits()\n\tp = nil\n\tp.GetCommits()\n}\n\nfunc TestPushEvent_GetCompare(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PushEvent{Compare: &zeroValue}\n\tp.GetCompare()\n\tp = &PushEvent{}\n\tp.GetCompare()\n\tp = nil\n\tp.GetCompare()\n}\n\nfunc TestPushEvent_GetCreated(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PushEvent{Created: &zeroValue}\n\tp.GetCreated()\n\tp = &PushEvent{}\n\tp.GetCreated()\n\tp = nil\n\tp.GetCreated()\n}\n\nfunc TestPushEvent_GetDeleted(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PushEvent{Deleted: &zeroValue}\n\tp.GetDeleted()\n\tp = &PushEvent{}\n\tp.GetDeleted()\n\tp = nil\n\tp.GetDeleted()\n}\n\nfunc TestPushEvent_GetDistinctSize(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PushEvent{DistinctSize: &zeroValue}\n\tp.GetDistinctSize()\n\tp = &PushEvent{}\n\tp.GetDistinctSize()\n\tp = nil\n\tp.GetDistinctSize()\n}\n\nfunc TestPushEvent_GetForced(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PushEvent{Forced: &zeroValue}\n\tp.GetForced()\n\tp = &PushEvent{}\n\tp.GetForced()\n\tp = nil\n\tp.GetForced()\n}\n\nfunc TestPushEvent_GetHead(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PushEvent{Head: &zeroValue}\n\tp.GetHead()\n\tp = &PushEvent{}\n\tp.GetHead()\n\tp = nil\n\tp.GetHead()\n}\n\nfunc TestPushEvent_GetHeadCommit(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PushEvent{}\n\tp.GetHeadCommit()\n\tp = nil\n\tp.GetHeadCommit()\n}\n\nfunc TestPushEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PushEvent{}\n\tp.GetInstallation()\n\tp = nil\n\tp.GetInstallation()\n}\n\nfunc TestPushEvent_GetOrganization(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PushEvent{}\n\tp.GetOrganization()\n\tp = nil\n\tp.GetOrganization()\n}\n\nfunc TestPushEvent_GetPusher(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PushEvent{}\n\tp.GetPusher()\n\tp = nil\n\tp.GetPusher()\n}\n\nfunc TestPushEvent_GetPushID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &PushEvent{PushID: &zeroValue}\n\tp.GetPushID()\n\tp = &PushEvent{}\n\tp.GetPushID()\n\tp = nil\n\tp.GetPushID()\n}\n\nfunc TestPushEvent_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PushEvent{Ref: &zeroValue}\n\tp.GetRef()\n\tp = &PushEvent{}\n\tp.GetRef()\n\tp = nil\n\tp.GetRef()\n}\n\nfunc TestPushEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PushEvent{}\n\tp.GetRepo()\n\tp = nil\n\tp.GetRepo()\n}\n\nfunc TestPushEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PushEvent{}\n\tp.GetSender()\n\tp = nil\n\tp.GetSender()\n}\n\nfunc TestPushEvent_GetSize(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PushEvent{Size: &zeroValue}\n\tp.GetSize()\n\tp = &PushEvent{}\n\tp.GetSize()\n\tp = nil\n\tp.GetSize()\n}\n\nfunc TestPushEventRepoOwner_GetEmail(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PushEventRepoOwner{Email: &zeroValue}\n\tp.GetEmail()\n\tp = &PushEventRepoOwner{}\n\tp.GetEmail()\n\tp = nil\n\tp.GetEmail()\n}\n\nfunc TestPushEventRepoOwner_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PushEventRepoOwner{Name: &zeroValue}\n\tp.GetName()\n\tp = &PushEventRepoOwner{}\n\tp.GetName()\n\tp = nil\n\tp.GetName()\n}\n\nfunc TestPushEventRepository_GetArchived(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PushEventRepository{Archived: &zeroValue}\n\tp.GetArchived()\n\tp = &PushEventRepository{}\n\tp.GetArchived()\n\tp = nil\n\tp.GetArchived()\n}\n\nfunc TestPushEventRepository_GetArchiveURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PushEventRepository{ArchiveURL: &zeroValue}\n\tp.GetArchiveURL()\n\tp = &PushEventRepository{}\n\tp.GetArchiveURL()\n\tp = nil\n\tp.GetArchiveURL()\n}\n\nfunc TestPushEventRepository_GetCloneURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PushEventRepository{CloneURL: &zeroValue}\n\tp.GetCloneURL()\n\tp = &PushEventRepository{}\n\tp.GetCloneURL()\n\tp = nil\n\tp.GetCloneURL()\n}\n\nfunc TestPushEventRepository_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PushEventRepository{CreatedAt: &zeroValue}\n\tp.GetCreatedAt()\n\tp = &PushEventRepository{}\n\tp.GetCreatedAt()\n\tp = nil\n\tp.GetCreatedAt()\n}\n\nfunc TestPushEventRepository_GetCustomProperties(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]any{}\n\tp := &PushEventRepository{CustomProperties: zeroValue}\n\tp.GetCustomProperties()\n\tp = &PushEventRepository{}\n\tp.GetCustomProperties()\n\tp = nil\n\tp.GetCustomProperties()\n}\n\nfunc TestPushEventRepository_GetDefaultBranch(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PushEventRepository{DefaultBranch: &zeroValue}\n\tp.GetDefaultBranch()\n\tp = &PushEventRepository{}\n\tp.GetDefaultBranch()\n\tp = nil\n\tp.GetDefaultBranch()\n}\n\nfunc TestPushEventRepository_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PushEventRepository{Description: &zeroValue}\n\tp.GetDescription()\n\tp = &PushEventRepository{}\n\tp.GetDescription()\n\tp = nil\n\tp.GetDescription()\n}\n\nfunc TestPushEventRepository_GetDisabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PushEventRepository{Disabled: &zeroValue}\n\tp.GetDisabled()\n\tp = &PushEventRepository{}\n\tp.GetDisabled()\n\tp = nil\n\tp.GetDisabled()\n}\n\nfunc TestPushEventRepository_GetFork(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PushEventRepository{Fork: &zeroValue}\n\tp.GetFork()\n\tp = &PushEventRepository{}\n\tp.GetFork()\n\tp = nil\n\tp.GetFork()\n}\n\nfunc TestPushEventRepository_GetForksCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PushEventRepository{ForksCount: &zeroValue}\n\tp.GetForksCount()\n\tp = &PushEventRepository{}\n\tp.GetForksCount()\n\tp = nil\n\tp.GetForksCount()\n}\n\nfunc TestPushEventRepository_GetFullName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PushEventRepository{FullName: &zeroValue}\n\tp.GetFullName()\n\tp = &PushEventRepository{}\n\tp.GetFullName()\n\tp = nil\n\tp.GetFullName()\n}\n\nfunc TestPushEventRepository_GetGitURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PushEventRepository{GitURL: &zeroValue}\n\tp.GetGitURL()\n\tp = &PushEventRepository{}\n\tp.GetGitURL()\n\tp = nil\n\tp.GetGitURL()\n}\n\nfunc TestPushEventRepository_GetHasDownloads(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PushEventRepository{HasDownloads: &zeroValue}\n\tp.GetHasDownloads()\n\tp = &PushEventRepository{}\n\tp.GetHasDownloads()\n\tp = nil\n\tp.GetHasDownloads()\n}\n\nfunc TestPushEventRepository_GetHasIssues(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PushEventRepository{HasIssues: &zeroValue}\n\tp.GetHasIssues()\n\tp = &PushEventRepository{}\n\tp.GetHasIssues()\n\tp = nil\n\tp.GetHasIssues()\n}\n\nfunc TestPushEventRepository_GetHasPages(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PushEventRepository{HasPages: &zeroValue}\n\tp.GetHasPages()\n\tp = &PushEventRepository{}\n\tp.GetHasPages()\n\tp = nil\n\tp.GetHasPages()\n}\n\nfunc TestPushEventRepository_GetHasWiki(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PushEventRepository{HasWiki: &zeroValue}\n\tp.GetHasWiki()\n\tp = &PushEventRepository{}\n\tp.GetHasWiki()\n\tp = nil\n\tp.GetHasWiki()\n}\n\nfunc TestPushEventRepository_GetHomepage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PushEventRepository{Homepage: &zeroValue}\n\tp.GetHomepage()\n\tp = &PushEventRepository{}\n\tp.GetHomepage()\n\tp = nil\n\tp.GetHomepage()\n}\n\nfunc TestPushEventRepository_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PushEventRepository{HTMLURL: &zeroValue}\n\tp.GetHTMLURL()\n\tp = &PushEventRepository{}\n\tp.GetHTMLURL()\n\tp = nil\n\tp.GetHTMLURL()\n}\n\nfunc TestPushEventRepository_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tp := &PushEventRepository{ID: &zeroValue}\n\tp.GetID()\n\tp = &PushEventRepository{}\n\tp.GetID()\n\tp = nil\n\tp.GetID()\n}\n\nfunc TestPushEventRepository_GetLanguage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PushEventRepository{Language: &zeroValue}\n\tp.GetLanguage()\n\tp = &PushEventRepository{}\n\tp.GetLanguage()\n\tp = nil\n\tp.GetLanguage()\n}\n\nfunc TestPushEventRepository_GetMasterBranch(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PushEventRepository{MasterBranch: &zeroValue}\n\tp.GetMasterBranch()\n\tp = &PushEventRepository{}\n\tp.GetMasterBranch()\n\tp = nil\n\tp.GetMasterBranch()\n}\n\nfunc TestPushEventRepository_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PushEventRepository{Name: &zeroValue}\n\tp.GetName()\n\tp = &PushEventRepository{}\n\tp.GetName()\n\tp = nil\n\tp.GetName()\n}\n\nfunc TestPushEventRepository_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PushEventRepository{NodeID: &zeroValue}\n\tp.GetNodeID()\n\tp = &PushEventRepository{}\n\tp.GetNodeID()\n\tp = nil\n\tp.GetNodeID()\n}\n\nfunc TestPushEventRepository_GetOpenIssuesCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PushEventRepository{OpenIssuesCount: &zeroValue}\n\tp.GetOpenIssuesCount()\n\tp = &PushEventRepository{}\n\tp.GetOpenIssuesCount()\n\tp = nil\n\tp.GetOpenIssuesCount()\n}\n\nfunc TestPushEventRepository_GetOrganization(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PushEventRepository{Organization: &zeroValue}\n\tp.GetOrganization()\n\tp = &PushEventRepository{}\n\tp.GetOrganization()\n\tp = nil\n\tp.GetOrganization()\n}\n\nfunc TestPushEventRepository_GetOwner(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PushEventRepository{}\n\tp.GetOwner()\n\tp = nil\n\tp.GetOwner()\n}\n\nfunc TestPushEventRepository_GetPrivate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tp := &PushEventRepository{Private: &zeroValue}\n\tp.GetPrivate()\n\tp = &PushEventRepository{}\n\tp.GetPrivate()\n\tp = nil\n\tp.GetPrivate()\n}\n\nfunc TestPushEventRepository_GetPullsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PushEventRepository{PullsURL: &zeroValue}\n\tp.GetPullsURL()\n\tp = &PushEventRepository{}\n\tp.GetPullsURL()\n\tp = nil\n\tp.GetPullsURL()\n}\n\nfunc TestPushEventRepository_GetPushedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PushEventRepository{PushedAt: &zeroValue}\n\tp.GetPushedAt()\n\tp = &PushEventRepository{}\n\tp.GetPushedAt()\n\tp = nil\n\tp.GetPushedAt()\n}\n\nfunc TestPushEventRepository_GetSize(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PushEventRepository{Size: &zeroValue}\n\tp.GetSize()\n\tp = &PushEventRepository{}\n\tp.GetSize()\n\tp = nil\n\tp.GetSize()\n}\n\nfunc TestPushEventRepository_GetSSHURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PushEventRepository{SSHURL: &zeroValue}\n\tp.GetSSHURL()\n\tp = &PushEventRepository{}\n\tp.GetSSHURL()\n\tp = nil\n\tp.GetSSHURL()\n}\n\nfunc TestPushEventRepository_GetStargazersCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PushEventRepository{StargazersCount: &zeroValue}\n\tp.GetStargazersCount()\n\tp = &PushEventRepository{}\n\tp.GetStargazersCount()\n\tp = nil\n\tp.GetStargazersCount()\n}\n\nfunc TestPushEventRepository_GetStatusesURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PushEventRepository{StatusesURL: &zeroValue}\n\tp.GetStatusesURL()\n\tp = &PushEventRepository{}\n\tp.GetStatusesURL()\n\tp = nil\n\tp.GetStatusesURL()\n}\n\nfunc TestPushEventRepository_GetSVNURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PushEventRepository{SVNURL: &zeroValue}\n\tp.GetSVNURL()\n\tp = &PushEventRepository{}\n\tp.GetSVNURL()\n\tp = nil\n\tp.GetSVNURL()\n}\n\nfunc TestPushEventRepository_GetTopics(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tp := &PushEventRepository{Topics: zeroValue}\n\tp.GetTopics()\n\tp = &PushEventRepository{}\n\tp.GetTopics()\n\tp = nil\n\tp.GetTopics()\n}\n\nfunc TestPushEventRepository_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PushEventRepository{UpdatedAt: &zeroValue}\n\tp.GetUpdatedAt()\n\tp = &PushEventRepository{}\n\tp.GetUpdatedAt()\n\tp = nil\n\tp.GetUpdatedAt()\n}\n\nfunc TestPushEventRepository_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tp := &PushEventRepository{URL: &zeroValue}\n\tp.GetURL()\n\tp = &PushEventRepository{}\n\tp.GetURL()\n\tp = nil\n\tp.GetURL()\n}\n\nfunc TestPushEventRepository_GetWatchersCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tp := &PushEventRepository{WatchersCount: &zeroValue}\n\tp.GetWatchersCount()\n\tp = &PushEventRepository{}\n\tp.GetWatchersCount()\n\tp = nil\n\tp.GetWatchersCount()\n}\n\nfunc TestPushProtectionBypass_GetExpireAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tp := &PushProtectionBypass{ExpireAt: &zeroValue}\n\tp.GetExpireAt()\n\tp = &PushProtectionBypass{}\n\tp.GetExpireAt()\n\tp = nil\n\tp.GetExpireAt()\n}\n\nfunc TestPushProtectionBypass_GetReason(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PushProtectionBypass{}\n\tp.GetReason()\n\tp = nil\n\tp.GetReason()\n}\n\nfunc TestPushProtectionBypass_GetTokenType(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PushProtectionBypass{}\n\tp.GetTokenType()\n\tp = nil\n\tp.GetTokenType()\n}\n\nfunc TestPushProtectionBypassRequest_GetPlaceholderID(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PushProtectionBypassRequest{}\n\tp.GetPlaceholderID()\n\tp = nil\n\tp.GetPlaceholderID()\n}\n\nfunc TestPushProtectionBypassRequest_GetReason(tt *testing.T) {\n\ttt.Parallel()\n\tp := &PushProtectionBypassRequest{}\n\tp.GetReason()\n\tp = nil\n\tp.GetReason()\n}\n\nfunc TestRate_GetLimit(tt *testing.T) {\n\ttt.Parallel()\n\tr := &Rate{}\n\tr.GetLimit()\n\tr = nil\n\tr.GetLimit()\n}\n\nfunc TestRate_GetRemaining(tt *testing.T) {\n\ttt.Parallel()\n\tr := &Rate{}\n\tr.GetRemaining()\n\tr = nil\n\tr.GetRemaining()\n}\n\nfunc TestRate_GetReset(tt *testing.T) {\n\ttt.Parallel()\n\tr := &Rate{}\n\tr.GetReset()\n\tr = nil\n\tr.GetReset()\n}\n\nfunc TestRate_GetResource(tt *testing.T) {\n\ttt.Parallel()\n\tr := &Rate{}\n\tr.GetResource()\n\tr = nil\n\tr.GetResource()\n}\n\nfunc TestRate_GetUsed(tt *testing.T) {\n\ttt.Parallel()\n\tr := &Rate{}\n\tr.GetUsed()\n\tr = nil\n\tr.GetUsed()\n}\n\nfunc TestRateLimitError_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RateLimitError{}\n\tr.GetMessage()\n\tr = nil\n\tr.GetMessage()\n}\n\nfunc TestRateLimitError_GetRate(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RateLimitError{}\n\tr.GetRate()\n\tr = nil\n\tr.GetRate()\n}\n\nfunc TestRateLimits_GetActionsRunnerRegistration(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RateLimits{}\n\tr.GetActionsRunnerRegistration()\n\tr = nil\n\tr.GetActionsRunnerRegistration()\n}\n\nfunc TestRateLimits_GetAuditLog(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RateLimits{}\n\tr.GetAuditLog()\n\tr = nil\n\tr.GetAuditLog()\n}\n\nfunc TestRateLimits_GetCodeScanningUpload(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RateLimits{}\n\tr.GetCodeScanningUpload()\n\tr = nil\n\tr.GetCodeScanningUpload()\n}\n\nfunc TestRateLimits_GetCodeSearch(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RateLimits{}\n\tr.GetCodeSearch()\n\tr = nil\n\tr.GetCodeSearch()\n}\n\nfunc TestRateLimits_GetCore(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RateLimits{}\n\tr.GetCore()\n\tr = nil\n\tr.GetCore()\n}\n\nfunc TestRateLimits_GetDependencySBOM(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RateLimits{}\n\tr.GetDependencySBOM()\n\tr = nil\n\tr.GetDependencySBOM()\n}\n\nfunc TestRateLimits_GetDependencySnapshots(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RateLimits{}\n\tr.GetDependencySnapshots()\n\tr = nil\n\tr.GetDependencySnapshots()\n}\n\nfunc TestRateLimits_GetGraphQL(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RateLimits{}\n\tr.GetGraphQL()\n\tr = nil\n\tr.GetGraphQL()\n}\n\nfunc TestRateLimits_GetIntegrationManifest(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RateLimits{}\n\tr.GetIntegrationManifest()\n\tr = nil\n\tr.GetIntegrationManifest()\n}\n\nfunc TestRateLimits_GetSCIM(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RateLimits{}\n\tr.GetSCIM()\n\tr = nil\n\tr.GetSCIM()\n}\n\nfunc TestRateLimits_GetSearch(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RateLimits{}\n\tr.GetSearch()\n\tr = nil\n\tr.GetSearch()\n}\n\nfunc TestRateLimits_GetSourceImport(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RateLimits{}\n\tr.GetSourceImport()\n\tr = nil\n\tr.GetSourceImport()\n}\n\nfunc TestRawOptions_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RawOptions{}\n\tr.GetType()\n\tr = nil\n\tr.GetType()\n}\n\nfunc TestReaction_GetContent(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Reaction{Content: &zeroValue}\n\tr.GetContent()\n\tr = &Reaction{}\n\tr.GetContent()\n\tr = nil\n\tr.GetContent()\n}\n\nfunc TestReaction_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tr := &Reaction{CreatedAt: &zeroValue}\n\tr.GetCreatedAt()\n\tr = &Reaction{}\n\tr.GetCreatedAt()\n\tr = nil\n\tr.GetCreatedAt()\n}\n\nfunc TestReaction_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tr := &Reaction{ID: &zeroValue}\n\tr.GetID()\n\tr = &Reaction{}\n\tr.GetID()\n\tr = nil\n\tr.GetID()\n}\n\nfunc TestReaction_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Reaction{NodeID: &zeroValue}\n\tr.GetNodeID()\n\tr = &Reaction{}\n\tr.GetNodeID()\n\tr = nil\n\tr.GetNodeID()\n}\n\nfunc TestReaction_GetUser(tt *testing.T) {\n\ttt.Parallel()\n\tr := &Reaction{}\n\tr.GetUser()\n\tr = nil\n\tr.GetUser()\n}\n\nfunc TestReactions_GetConfused(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &Reactions{Confused: &zeroValue}\n\tr.GetConfused()\n\tr = &Reactions{}\n\tr.GetConfused()\n\tr = nil\n\tr.GetConfused()\n}\n\nfunc TestReactions_GetEyes(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &Reactions{Eyes: &zeroValue}\n\tr.GetEyes()\n\tr = &Reactions{}\n\tr.GetEyes()\n\tr = nil\n\tr.GetEyes()\n}\n\nfunc TestReactions_GetHeart(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &Reactions{Heart: &zeroValue}\n\tr.GetHeart()\n\tr = &Reactions{}\n\tr.GetHeart()\n\tr = nil\n\tr.GetHeart()\n}\n\nfunc TestReactions_GetHooray(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &Reactions{Hooray: &zeroValue}\n\tr.GetHooray()\n\tr = &Reactions{}\n\tr.GetHooray()\n\tr = nil\n\tr.GetHooray()\n}\n\nfunc TestReactions_GetLaugh(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &Reactions{Laugh: &zeroValue}\n\tr.GetLaugh()\n\tr = &Reactions{}\n\tr.GetLaugh()\n\tr = nil\n\tr.GetLaugh()\n}\n\nfunc TestReactions_GetMinusOne(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &Reactions{MinusOne: &zeroValue}\n\tr.GetMinusOne()\n\tr = &Reactions{}\n\tr.GetMinusOne()\n\tr = nil\n\tr.GetMinusOne()\n}\n\nfunc TestReactions_GetPlusOne(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &Reactions{PlusOne: &zeroValue}\n\tr.GetPlusOne()\n\tr = &Reactions{}\n\tr.GetPlusOne()\n\tr = nil\n\tr.GetPlusOne()\n}\n\nfunc TestReactions_GetRocket(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &Reactions{Rocket: &zeroValue}\n\tr.GetRocket()\n\tr = &Reactions{}\n\tr.GetRocket()\n\tr = nil\n\tr.GetRocket()\n}\n\nfunc TestReactions_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &Reactions{TotalCount: &zeroValue}\n\tr.GetTotalCount()\n\tr = &Reactions{}\n\tr.GetTotalCount()\n\tr = nil\n\tr.GetTotalCount()\n}\n\nfunc TestReactions_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Reactions{URL: &zeroValue}\n\tr.GetURL()\n\tr = &Reactions{}\n\tr.GetURL()\n\tr = nil\n\tr.GetURL()\n}\n\nfunc TestReassignedResource_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &ReassignedResource{Name: &zeroValue}\n\tr.GetName()\n\tr = &ReassignedResource{}\n\tr.GetName()\n\tr = nil\n\tr.GetName()\n}\n\nfunc TestReassignedResource_GetPreviousCostCenter(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &ReassignedResource{PreviousCostCenter: &zeroValue}\n\tr.GetPreviousCostCenter()\n\tr = &ReassignedResource{}\n\tr.GetPreviousCostCenter()\n\tr = nil\n\tr.GetPreviousCostCenter()\n}\n\nfunc TestReassignedResource_GetResourceType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &ReassignedResource{ResourceType: &zeroValue}\n\tr.GetResourceType()\n\tr = &ReassignedResource{}\n\tr.GetResourceType()\n\tr = nil\n\tr.GetResourceType()\n}\n\nfunc TestRedirectionError_GetStatusCode(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RedirectionError{}\n\tr.GetStatusCode()\n\tr = nil\n\tr.GetStatusCode()\n}\n\nfunc TestReference_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Reference{NodeID: &zeroValue}\n\tr.GetNodeID()\n\tr = &Reference{}\n\tr.GetNodeID()\n\tr = nil\n\tr.GetNodeID()\n}\n\nfunc TestReference_GetObject(tt *testing.T) {\n\ttt.Parallel()\n\tr := &Reference{}\n\tr.GetObject()\n\tr = nil\n\tr.GetObject()\n}\n\nfunc TestReference_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Reference{Ref: &zeroValue}\n\tr.GetRef()\n\tr = &Reference{}\n\tr.GetRef()\n\tr = nil\n\tr.GetRef()\n}\n\nfunc TestReference_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Reference{URL: &zeroValue}\n\tr.GetURL()\n\tr = &Reference{}\n\tr.GetURL()\n\tr = nil\n\tr.GetURL()\n}\n\nfunc TestReferencedWorkflow_GetPath(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &ReferencedWorkflow{Path: &zeroValue}\n\tr.GetPath()\n\tr = &ReferencedWorkflow{}\n\tr.GetPath()\n\tr = nil\n\tr.GetPath()\n}\n\nfunc TestReferencedWorkflow_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &ReferencedWorkflow{Ref: &zeroValue}\n\tr.GetRef()\n\tr = &ReferencedWorkflow{}\n\tr.GetRef()\n\tr = nil\n\tr.GetRef()\n}\n\nfunc TestReferencedWorkflow_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &ReferencedWorkflow{SHA: &zeroValue}\n\tr.GetSHA()\n\tr = &ReferencedWorkflow{}\n\tr.GetSHA()\n\tr = nil\n\tr.GetSHA()\n}\n\nfunc TestRegistrationToken_GetExpiresAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tr := &RegistrationToken{ExpiresAt: &zeroValue}\n\tr.GetExpiresAt()\n\tr = &RegistrationToken{}\n\tr.GetExpiresAt()\n\tr = nil\n\tr.GetExpiresAt()\n}\n\nfunc TestRegistrationToken_GetToken(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RegistrationToken{Token: &zeroValue}\n\tr.GetToken()\n\tr = &RegistrationToken{}\n\tr.GetToken()\n\tr = nil\n\tr.GetToken()\n}\n\nfunc TestRegistryPackageEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RegistryPackageEvent{Action: &zeroValue}\n\tr.GetAction()\n\tr = &RegistryPackageEvent{}\n\tr.GetAction()\n\tr = nil\n\tr.GetAction()\n}\n\nfunc TestRegistryPackageEvent_GetEnterprise(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RegistryPackageEvent{}\n\tr.GetEnterprise()\n\tr = nil\n\tr.GetEnterprise()\n}\n\nfunc TestRegistryPackageEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RegistryPackageEvent{}\n\tr.GetInstallation()\n\tr = nil\n\tr.GetInstallation()\n}\n\nfunc TestRegistryPackageEvent_GetOrganization(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RegistryPackageEvent{}\n\tr.GetOrganization()\n\tr = nil\n\tr.GetOrganization()\n}\n\nfunc TestRegistryPackageEvent_GetRegistryPackage(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RegistryPackageEvent{}\n\tr.GetRegistryPackage()\n\tr = nil\n\tr.GetRegistryPackage()\n}\n\nfunc TestRegistryPackageEvent_GetRepository(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RegistryPackageEvent{}\n\tr.GetRepository()\n\tr = nil\n\tr.GetRepository()\n}\n\nfunc TestRegistryPackageEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RegistryPackageEvent{}\n\tr.GetSender()\n\tr = nil\n\tr.GetSender()\n}\n\nfunc TestReleaseAsset_GetBrowserDownloadURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &ReleaseAsset{BrowserDownloadURL: &zeroValue}\n\tr.GetBrowserDownloadURL()\n\tr = &ReleaseAsset{}\n\tr.GetBrowserDownloadURL()\n\tr = nil\n\tr.GetBrowserDownloadURL()\n}\n\nfunc TestReleaseAsset_GetContentType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &ReleaseAsset{ContentType: &zeroValue}\n\tr.GetContentType()\n\tr = &ReleaseAsset{}\n\tr.GetContentType()\n\tr = nil\n\tr.GetContentType()\n}\n\nfunc TestReleaseAsset_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tr := &ReleaseAsset{CreatedAt: &zeroValue}\n\tr.GetCreatedAt()\n\tr = &ReleaseAsset{}\n\tr.GetCreatedAt()\n\tr = nil\n\tr.GetCreatedAt()\n}\n\nfunc TestReleaseAsset_GetDigest(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &ReleaseAsset{Digest: &zeroValue}\n\tr.GetDigest()\n\tr = &ReleaseAsset{}\n\tr.GetDigest()\n\tr = nil\n\tr.GetDigest()\n}\n\nfunc TestReleaseAsset_GetDownloadCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &ReleaseAsset{DownloadCount: &zeroValue}\n\tr.GetDownloadCount()\n\tr = &ReleaseAsset{}\n\tr.GetDownloadCount()\n\tr = nil\n\tr.GetDownloadCount()\n}\n\nfunc TestReleaseAsset_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tr := &ReleaseAsset{ID: &zeroValue}\n\tr.GetID()\n\tr = &ReleaseAsset{}\n\tr.GetID()\n\tr = nil\n\tr.GetID()\n}\n\nfunc TestReleaseAsset_GetLabel(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &ReleaseAsset{Label: &zeroValue}\n\tr.GetLabel()\n\tr = &ReleaseAsset{}\n\tr.GetLabel()\n\tr = nil\n\tr.GetLabel()\n}\n\nfunc TestReleaseAsset_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &ReleaseAsset{Name: &zeroValue}\n\tr.GetName()\n\tr = &ReleaseAsset{}\n\tr.GetName()\n\tr = nil\n\tr.GetName()\n}\n\nfunc TestReleaseAsset_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &ReleaseAsset{NodeID: &zeroValue}\n\tr.GetNodeID()\n\tr = &ReleaseAsset{}\n\tr.GetNodeID()\n\tr = nil\n\tr.GetNodeID()\n}\n\nfunc TestReleaseAsset_GetSize(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &ReleaseAsset{Size: &zeroValue}\n\tr.GetSize()\n\tr = &ReleaseAsset{}\n\tr.GetSize()\n\tr = nil\n\tr.GetSize()\n}\n\nfunc TestReleaseAsset_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &ReleaseAsset{State: &zeroValue}\n\tr.GetState()\n\tr = &ReleaseAsset{}\n\tr.GetState()\n\tr = nil\n\tr.GetState()\n}\n\nfunc TestReleaseAsset_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tr := &ReleaseAsset{UpdatedAt: &zeroValue}\n\tr.GetUpdatedAt()\n\tr = &ReleaseAsset{}\n\tr.GetUpdatedAt()\n\tr = nil\n\tr.GetUpdatedAt()\n}\n\nfunc TestReleaseAsset_GetUploader(tt *testing.T) {\n\ttt.Parallel()\n\tr := &ReleaseAsset{}\n\tr.GetUploader()\n\tr = nil\n\tr.GetUploader()\n}\n\nfunc TestReleaseAsset_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &ReleaseAsset{URL: &zeroValue}\n\tr.GetURL()\n\tr = &ReleaseAsset{}\n\tr.GetURL()\n\tr = nil\n\tr.GetURL()\n}\n\nfunc TestReleaseEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &ReleaseEvent{Action: &zeroValue}\n\tr.GetAction()\n\tr = &ReleaseEvent{}\n\tr.GetAction()\n\tr = nil\n\tr.GetAction()\n}\n\nfunc TestReleaseEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tr := &ReleaseEvent{}\n\tr.GetInstallation()\n\tr = nil\n\tr.GetInstallation()\n}\n\nfunc TestReleaseEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tr := &ReleaseEvent{}\n\tr.GetOrg()\n\tr = nil\n\tr.GetOrg()\n}\n\nfunc TestReleaseEvent_GetRelease(tt *testing.T) {\n\ttt.Parallel()\n\tr := &ReleaseEvent{}\n\tr.GetRelease()\n\tr = nil\n\tr.GetRelease()\n}\n\nfunc TestReleaseEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tr := &ReleaseEvent{}\n\tr.GetRepo()\n\tr = nil\n\tr.GetRepo()\n}\n\nfunc TestReleaseEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tr := &ReleaseEvent{}\n\tr.GetSender()\n\tr = nil\n\tr.GetSender()\n}\n\nfunc TestReleaseVersion_GetBuildDate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &ReleaseVersion{BuildDate: &zeroValue}\n\tr.GetBuildDate()\n\tr = &ReleaseVersion{}\n\tr.GetBuildDate()\n\tr = nil\n\tr.GetBuildDate()\n}\n\nfunc TestReleaseVersion_GetBuildID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &ReleaseVersion{BuildID: &zeroValue}\n\tr.GetBuildID()\n\tr = &ReleaseVersion{}\n\tr.GetBuildID()\n\tr = nil\n\tr.GetBuildID()\n}\n\nfunc TestReleaseVersion_GetPlatform(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &ReleaseVersion{Platform: &zeroValue}\n\tr.GetPlatform()\n\tr = &ReleaseVersion{}\n\tr.GetPlatform()\n\tr = nil\n\tr.GetPlatform()\n}\n\nfunc TestReleaseVersion_GetVersion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &ReleaseVersion{Version: &zeroValue}\n\tr.GetVersion()\n\tr = &ReleaseVersion{}\n\tr.GetVersion()\n\tr = nil\n\tr.GetVersion()\n}\n\nfunc TestRemoveResourcesFromCostCenterResponse_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RemoveResourcesFromCostCenterResponse{Message: &zeroValue}\n\tr.GetMessage()\n\tr = &RemoveResourcesFromCostCenterResponse{}\n\tr.GetMessage()\n\tr = nil\n\tr.GetMessage()\n}\n\nfunc TestRemoveToken_GetExpiresAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tr := &RemoveToken{ExpiresAt: &zeroValue}\n\tr.GetExpiresAt()\n\tr = &RemoveToken{}\n\tr.GetExpiresAt()\n\tr = nil\n\tr.GetExpiresAt()\n}\n\nfunc TestRemoveToken_GetToken(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RemoveToken{Token: &zeroValue}\n\tr.GetToken()\n\tr = &RemoveToken{}\n\tr.GetToken()\n\tr = nil\n\tr.GetToken()\n}\n\nfunc TestRename_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Rename{From: &zeroValue}\n\tr.GetFrom()\n\tr = &Rename{}\n\tr.GetFrom()\n\tr = nil\n\tr.GetFrom()\n}\n\nfunc TestRename_GetTo(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Rename{To: &zeroValue}\n\tr.GetTo()\n\tr = &Rename{}\n\tr.GetTo()\n\tr = nil\n\tr.GetTo()\n}\n\nfunc TestRenameOrgResponse_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RenameOrgResponse{Message: &zeroValue}\n\tr.GetMessage()\n\tr = &RenameOrgResponse{}\n\tr.GetMessage()\n\tr = nil\n\tr.GetMessage()\n}\n\nfunc TestRenameOrgResponse_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RenameOrgResponse{URL: &zeroValue}\n\tr.GetURL()\n\tr = &RenameOrgResponse{}\n\tr.GetURL()\n\tr = nil\n\tr.GetURL()\n}\n\nfunc TestRepoAdvisoryCredit_GetLogin(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepoAdvisoryCredit{Login: &zeroValue}\n\tr.GetLogin()\n\tr = &RepoAdvisoryCredit{}\n\tr.GetLogin()\n\tr = nil\n\tr.GetLogin()\n}\n\nfunc TestRepoAdvisoryCredit_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepoAdvisoryCredit{Type: &zeroValue}\n\tr.GetType()\n\tr = &RepoAdvisoryCredit{}\n\tr.GetType()\n\tr = nil\n\tr.GetType()\n}\n\nfunc TestRepoAdvisoryCreditDetailed_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepoAdvisoryCreditDetailed{State: &zeroValue}\n\tr.GetState()\n\tr = &RepoAdvisoryCreditDetailed{}\n\tr.GetState()\n\tr = nil\n\tr.GetState()\n}\n\nfunc TestRepoAdvisoryCreditDetailed_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepoAdvisoryCreditDetailed{Type: &zeroValue}\n\tr.GetType()\n\tr = &RepoAdvisoryCreditDetailed{}\n\tr.GetType()\n\tr = nil\n\tr.GetType()\n}\n\nfunc TestRepoAdvisoryCreditDetailed_GetUser(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepoAdvisoryCreditDetailed{}\n\tr.GetUser()\n\tr = nil\n\tr.GetUser()\n}\n\nfunc TestRepoCustomPropertyValue_GetProperties(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CustomPropertyValue{}\n\tr := &RepoCustomPropertyValue{Properties: zeroValue}\n\tr.GetProperties()\n\tr = &RepoCustomPropertyValue{}\n\tr.GetProperties()\n\tr = nil\n\tr.GetProperties()\n}\n\nfunc TestRepoCustomPropertyValue_GetRepositoryFullName(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepoCustomPropertyValue{}\n\tr.GetRepositoryFullName()\n\tr = nil\n\tr.GetRepositoryFullName()\n}\n\nfunc TestRepoCustomPropertyValue_GetRepositoryID(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepoCustomPropertyValue{}\n\tr.GetRepositoryID()\n\tr = nil\n\tr.GetRepositoryID()\n}\n\nfunc TestRepoCustomPropertyValue_GetRepositoryName(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepoCustomPropertyValue{}\n\tr.GetRepositoryName()\n\tr = nil\n\tr.GetRepositoryName()\n}\n\nfunc TestRepoDependencies_GetDownloadLocation(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepoDependencies{DownloadLocation: &zeroValue}\n\tr.GetDownloadLocation()\n\tr = &RepoDependencies{}\n\tr.GetDownloadLocation()\n\tr = nil\n\tr.GetDownloadLocation()\n}\n\nfunc TestRepoDependencies_GetExternalRefs(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*PackageExternalRef{}\n\tr := &RepoDependencies{ExternalRefs: zeroValue}\n\tr.GetExternalRefs()\n\tr = &RepoDependencies{}\n\tr.GetExternalRefs()\n\tr = nil\n\tr.GetExternalRefs()\n}\n\nfunc TestRepoDependencies_GetFilesAnalyzed(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &RepoDependencies{FilesAnalyzed: &zeroValue}\n\tr.GetFilesAnalyzed()\n\tr = &RepoDependencies{}\n\tr.GetFilesAnalyzed()\n\tr = nil\n\tr.GetFilesAnalyzed()\n}\n\nfunc TestRepoDependencies_GetLicenseConcluded(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepoDependencies{LicenseConcluded: &zeroValue}\n\tr.GetLicenseConcluded()\n\tr = &RepoDependencies{}\n\tr.GetLicenseConcluded()\n\tr = nil\n\tr.GetLicenseConcluded()\n}\n\nfunc TestRepoDependencies_GetLicenseDeclared(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepoDependencies{LicenseDeclared: &zeroValue}\n\tr.GetLicenseDeclared()\n\tr = &RepoDependencies{}\n\tr.GetLicenseDeclared()\n\tr = nil\n\tr.GetLicenseDeclared()\n}\n\nfunc TestRepoDependencies_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepoDependencies{Name: &zeroValue}\n\tr.GetName()\n\tr = &RepoDependencies{}\n\tr.GetName()\n\tr = nil\n\tr.GetName()\n}\n\nfunc TestRepoDependencies_GetSPDXID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepoDependencies{SPDXID: &zeroValue}\n\tr.GetSPDXID()\n\tr = &RepoDependencies{}\n\tr.GetSPDXID()\n\tr = nil\n\tr.GetSPDXID()\n}\n\nfunc TestRepoDependencies_GetVersionInfo(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepoDependencies{VersionInfo: &zeroValue}\n\tr.GetVersionInfo()\n\tr = &RepoDependencies{}\n\tr.GetVersionInfo()\n\tr = nil\n\tr.GetVersionInfo()\n}\n\nfunc TestRepoFineGrainedPermission_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepoFineGrainedPermission{}\n\tr.GetDescription()\n\tr = nil\n\tr.GetDescription()\n}\n\nfunc TestRepoFineGrainedPermission_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepoFineGrainedPermission{}\n\tr.GetName()\n\tr = nil\n\tr.GetName()\n}\n\nfunc TestRepoImmutableReleasesStatus_GetEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &RepoImmutableReleasesStatus{Enabled: &zeroValue}\n\tr.GetEnabled()\n\tr = &RepoImmutableReleasesStatus{}\n\tr.GetEnabled()\n\tr = nil\n\tr.GetEnabled()\n}\n\nfunc TestRepoImmutableReleasesStatus_GetEnforcedByOwner(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &RepoImmutableReleasesStatus{EnforcedByOwner: &zeroValue}\n\tr.GetEnforcedByOwner()\n\tr = &RepoImmutableReleasesStatus{}\n\tr.GetEnforcedByOwner()\n\tr = nil\n\tr.GetEnforcedByOwner()\n}\n\nfunc TestRepoMergeUpstreamRequest_GetBranch(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepoMergeUpstreamRequest{Branch: &zeroValue}\n\tr.GetBranch()\n\tr = &RepoMergeUpstreamRequest{}\n\tr.GetBranch()\n\tr = nil\n\tr.GetBranch()\n}\n\nfunc TestRepoMergeUpstreamResult_GetBaseBranch(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepoMergeUpstreamResult{BaseBranch: &zeroValue}\n\tr.GetBaseBranch()\n\tr = &RepoMergeUpstreamResult{}\n\tr.GetBaseBranch()\n\tr = nil\n\tr.GetBaseBranch()\n}\n\nfunc TestRepoMergeUpstreamResult_GetMergeType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepoMergeUpstreamResult{MergeType: &zeroValue}\n\tr.GetMergeType()\n\tr = &RepoMergeUpstreamResult{}\n\tr.GetMergeType()\n\tr = nil\n\tr.GetMergeType()\n}\n\nfunc TestRepoMergeUpstreamResult_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepoMergeUpstreamResult{Message: &zeroValue}\n\tr.GetMessage()\n\tr = &RepoMergeUpstreamResult{}\n\tr.GetMessage()\n\tr = nil\n\tr.GetMessage()\n}\n\nfunc TestRepoName_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepoName{From: &zeroValue}\n\tr.GetFrom()\n\tr = &RepoName{}\n\tr.GetFrom()\n\tr = nil\n\tr.GetFrom()\n}\n\nfunc TestRepositoriesSearchResult_GetIncompleteResults(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &RepositoriesSearchResult{IncompleteResults: &zeroValue}\n\tr.GetIncompleteResults()\n\tr = &RepositoriesSearchResult{}\n\tr.GetIncompleteResults()\n\tr = nil\n\tr.GetIncompleteResults()\n}\n\nfunc TestRepositoriesSearchResult_GetRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Repository{}\n\tr := &RepositoriesSearchResult{Repositories: zeroValue}\n\tr.GetRepositories()\n\tr = &RepositoriesSearchResult{}\n\tr.GetRepositories()\n\tr = nil\n\tr.GetRepositories()\n}\n\nfunc TestRepositoriesSearchResult_GetTotal(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &RepositoriesSearchResult{Total: &zeroValue}\n\tr.GetTotal()\n\tr = &RepositoriesSearchResult{}\n\tr.GetTotal()\n\tr = nil\n\tr.GetTotal()\n}\n\nfunc TestRepository_GetAllowAutoMerge(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &Repository{AllowAutoMerge: &zeroValue}\n\tr.GetAllowAutoMerge()\n\tr = &Repository{}\n\tr.GetAllowAutoMerge()\n\tr = nil\n\tr.GetAllowAutoMerge()\n}\n\nfunc TestRepository_GetAllowForking(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &Repository{AllowForking: &zeroValue}\n\tr.GetAllowForking()\n\tr = &Repository{}\n\tr.GetAllowForking()\n\tr = nil\n\tr.GetAllowForking()\n}\n\nfunc TestRepository_GetAllowMergeCommit(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &Repository{AllowMergeCommit: &zeroValue}\n\tr.GetAllowMergeCommit()\n\tr = &Repository{}\n\tr.GetAllowMergeCommit()\n\tr = nil\n\tr.GetAllowMergeCommit()\n}\n\nfunc TestRepository_GetAllowRebaseMerge(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &Repository{AllowRebaseMerge: &zeroValue}\n\tr.GetAllowRebaseMerge()\n\tr = &Repository{}\n\tr.GetAllowRebaseMerge()\n\tr = nil\n\tr.GetAllowRebaseMerge()\n}\n\nfunc TestRepository_GetAllowSquashMerge(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &Repository{AllowSquashMerge: &zeroValue}\n\tr.GetAllowSquashMerge()\n\tr = &Repository{}\n\tr.GetAllowSquashMerge()\n\tr = nil\n\tr.GetAllowSquashMerge()\n}\n\nfunc TestRepository_GetAllowUpdateBranch(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &Repository{AllowUpdateBranch: &zeroValue}\n\tr.GetAllowUpdateBranch()\n\tr = &Repository{}\n\tr.GetAllowUpdateBranch()\n\tr = nil\n\tr.GetAllowUpdateBranch()\n}\n\nfunc TestRepository_GetArchived(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &Repository{Archived: &zeroValue}\n\tr.GetArchived()\n\tr = &Repository{}\n\tr.GetArchived()\n\tr = nil\n\tr.GetArchived()\n}\n\nfunc TestRepository_GetArchiveURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{ArchiveURL: &zeroValue}\n\tr.GetArchiveURL()\n\tr = &Repository{}\n\tr.GetArchiveURL()\n\tr = nil\n\tr.GetArchiveURL()\n}\n\nfunc TestRepository_GetAssigneesURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{AssigneesURL: &zeroValue}\n\tr.GetAssigneesURL()\n\tr = &Repository{}\n\tr.GetAssigneesURL()\n\tr = nil\n\tr.GetAssigneesURL()\n}\n\nfunc TestRepository_GetAutoInit(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &Repository{AutoInit: &zeroValue}\n\tr.GetAutoInit()\n\tr = &Repository{}\n\tr.GetAutoInit()\n\tr = nil\n\tr.GetAutoInit()\n}\n\nfunc TestRepository_GetBlobsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{BlobsURL: &zeroValue}\n\tr.GetBlobsURL()\n\tr = &Repository{}\n\tr.GetBlobsURL()\n\tr = nil\n\tr.GetBlobsURL()\n}\n\nfunc TestRepository_GetBranchesURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{BranchesURL: &zeroValue}\n\tr.GetBranchesURL()\n\tr = &Repository{}\n\tr.GetBranchesURL()\n\tr = nil\n\tr.GetBranchesURL()\n}\n\nfunc TestRepository_GetCloneURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{CloneURL: &zeroValue}\n\tr.GetCloneURL()\n\tr = &Repository{}\n\tr.GetCloneURL()\n\tr = nil\n\tr.GetCloneURL()\n}\n\nfunc TestRepository_GetCodeOfConduct(tt *testing.T) {\n\ttt.Parallel()\n\tr := &Repository{}\n\tr.GetCodeOfConduct()\n\tr = nil\n\tr.GetCodeOfConduct()\n}\n\nfunc TestRepository_GetCollaboratorsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{CollaboratorsURL: &zeroValue}\n\tr.GetCollaboratorsURL()\n\tr = &Repository{}\n\tr.GetCollaboratorsURL()\n\tr = nil\n\tr.GetCollaboratorsURL()\n}\n\nfunc TestRepository_GetCommentsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{CommentsURL: &zeroValue}\n\tr.GetCommentsURL()\n\tr = &Repository{}\n\tr.GetCommentsURL()\n\tr = nil\n\tr.GetCommentsURL()\n}\n\nfunc TestRepository_GetCommitsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{CommitsURL: &zeroValue}\n\tr.GetCommitsURL()\n\tr = &Repository{}\n\tr.GetCommitsURL()\n\tr = nil\n\tr.GetCommitsURL()\n}\n\nfunc TestRepository_GetCompareURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{CompareURL: &zeroValue}\n\tr.GetCompareURL()\n\tr = &Repository{}\n\tr.GetCompareURL()\n\tr = nil\n\tr.GetCompareURL()\n}\n\nfunc TestRepository_GetContentsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{ContentsURL: &zeroValue}\n\tr.GetContentsURL()\n\tr = &Repository{}\n\tr.GetContentsURL()\n\tr = nil\n\tr.GetContentsURL()\n}\n\nfunc TestRepository_GetContributorsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{ContributorsURL: &zeroValue}\n\tr.GetContributorsURL()\n\tr = &Repository{}\n\tr.GetContributorsURL()\n\tr = nil\n\tr.GetContributorsURL()\n}\n\nfunc TestRepository_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tr := &Repository{CreatedAt: &zeroValue}\n\tr.GetCreatedAt()\n\tr = &Repository{}\n\tr.GetCreatedAt()\n\tr = nil\n\tr.GetCreatedAt()\n}\n\nfunc TestRepository_GetCustomProperties(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]any{}\n\tr := &Repository{CustomProperties: zeroValue}\n\tr.GetCustomProperties()\n\tr = &Repository{}\n\tr.GetCustomProperties()\n\tr = nil\n\tr.GetCustomProperties()\n}\n\nfunc TestRepository_GetDefaultBranch(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{DefaultBranch: &zeroValue}\n\tr.GetDefaultBranch()\n\tr = &Repository{}\n\tr.GetDefaultBranch()\n\tr = nil\n\tr.GetDefaultBranch()\n}\n\nfunc TestRepository_GetDeleteBranchOnMerge(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &Repository{DeleteBranchOnMerge: &zeroValue}\n\tr.GetDeleteBranchOnMerge()\n\tr = &Repository{}\n\tr.GetDeleteBranchOnMerge()\n\tr = nil\n\tr.GetDeleteBranchOnMerge()\n}\n\nfunc TestRepository_GetDeploymentsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{DeploymentsURL: &zeroValue}\n\tr.GetDeploymentsURL()\n\tr = &Repository{}\n\tr.GetDeploymentsURL()\n\tr = nil\n\tr.GetDeploymentsURL()\n}\n\nfunc TestRepository_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{Description: &zeroValue}\n\tr.GetDescription()\n\tr = &Repository{}\n\tr.GetDescription()\n\tr = nil\n\tr.GetDescription()\n}\n\nfunc TestRepository_GetDisabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &Repository{Disabled: &zeroValue}\n\tr.GetDisabled()\n\tr = &Repository{}\n\tr.GetDisabled()\n\tr = nil\n\tr.GetDisabled()\n}\n\nfunc TestRepository_GetDownloadsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{DownloadsURL: &zeroValue}\n\tr.GetDownloadsURL()\n\tr = &Repository{}\n\tr.GetDownloadsURL()\n\tr = nil\n\tr.GetDownloadsURL()\n}\n\nfunc TestRepository_GetEventsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{EventsURL: &zeroValue}\n\tr.GetEventsURL()\n\tr = &Repository{}\n\tr.GetEventsURL()\n\tr = nil\n\tr.GetEventsURL()\n}\n\nfunc TestRepository_GetFork(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &Repository{Fork: &zeroValue}\n\tr.GetFork()\n\tr = &Repository{}\n\tr.GetFork()\n\tr = nil\n\tr.GetFork()\n}\n\nfunc TestRepository_GetForksCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &Repository{ForksCount: &zeroValue}\n\tr.GetForksCount()\n\tr = &Repository{}\n\tr.GetForksCount()\n\tr = nil\n\tr.GetForksCount()\n}\n\nfunc TestRepository_GetForksURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{ForksURL: &zeroValue}\n\tr.GetForksURL()\n\tr = &Repository{}\n\tr.GetForksURL()\n\tr = nil\n\tr.GetForksURL()\n}\n\nfunc TestRepository_GetFullName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{FullName: &zeroValue}\n\tr.GetFullName()\n\tr = &Repository{}\n\tr.GetFullName()\n\tr = nil\n\tr.GetFullName()\n}\n\nfunc TestRepository_GetGitCommitsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{GitCommitsURL: &zeroValue}\n\tr.GetGitCommitsURL()\n\tr = &Repository{}\n\tr.GetGitCommitsURL()\n\tr = nil\n\tr.GetGitCommitsURL()\n}\n\nfunc TestRepository_GetGitignoreTemplate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{GitignoreTemplate: &zeroValue}\n\tr.GetGitignoreTemplate()\n\tr = &Repository{}\n\tr.GetGitignoreTemplate()\n\tr = nil\n\tr.GetGitignoreTemplate()\n}\n\nfunc TestRepository_GetGitRefsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{GitRefsURL: &zeroValue}\n\tr.GetGitRefsURL()\n\tr = &Repository{}\n\tr.GetGitRefsURL()\n\tr = nil\n\tr.GetGitRefsURL()\n}\n\nfunc TestRepository_GetGitTagsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{GitTagsURL: &zeroValue}\n\tr.GetGitTagsURL()\n\tr = &Repository{}\n\tr.GetGitTagsURL()\n\tr = nil\n\tr.GetGitTagsURL()\n}\n\nfunc TestRepository_GetGitURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{GitURL: &zeroValue}\n\tr.GetGitURL()\n\tr = &Repository{}\n\tr.GetGitURL()\n\tr = nil\n\tr.GetGitURL()\n}\n\nfunc TestRepository_GetHasDiscussions(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &Repository{HasDiscussions: &zeroValue}\n\tr.GetHasDiscussions()\n\tr = &Repository{}\n\tr.GetHasDiscussions()\n\tr = nil\n\tr.GetHasDiscussions()\n}\n\nfunc TestRepository_GetHasDownloads(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &Repository{HasDownloads: &zeroValue}\n\tr.GetHasDownloads()\n\tr = &Repository{}\n\tr.GetHasDownloads()\n\tr = nil\n\tr.GetHasDownloads()\n}\n\nfunc TestRepository_GetHasIssues(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &Repository{HasIssues: &zeroValue}\n\tr.GetHasIssues()\n\tr = &Repository{}\n\tr.GetHasIssues()\n\tr = nil\n\tr.GetHasIssues()\n}\n\nfunc TestRepository_GetHasPages(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &Repository{HasPages: &zeroValue}\n\tr.GetHasPages()\n\tr = &Repository{}\n\tr.GetHasPages()\n\tr = nil\n\tr.GetHasPages()\n}\n\nfunc TestRepository_GetHasProjects(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &Repository{HasProjects: &zeroValue}\n\tr.GetHasProjects()\n\tr = &Repository{}\n\tr.GetHasProjects()\n\tr = nil\n\tr.GetHasProjects()\n}\n\nfunc TestRepository_GetHasWiki(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &Repository{HasWiki: &zeroValue}\n\tr.GetHasWiki()\n\tr = &Repository{}\n\tr.GetHasWiki()\n\tr = nil\n\tr.GetHasWiki()\n}\n\nfunc TestRepository_GetHomepage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{Homepage: &zeroValue}\n\tr.GetHomepage()\n\tr = &Repository{}\n\tr.GetHomepage()\n\tr = nil\n\tr.GetHomepage()\n}\n\nfunc TestRepository_GetHooksURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{HooksURL: &zeroValue}\n\tr.GetHooksURL()\n\tr = &Repository{}\n\tr.GetHooksURL()\n\tr = nil\n\tr.GetHooksURL()\n}\n\nfunc TestRepository_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{HTMLURL: &zeroValue}\n\tr.GetHTMLURL()\n\tr = &Repository{}\n\tr.GetHTMLURL()\n\tr = nil\n\tr.GetHTMLURL()\n}\n\nfunc TestRepository_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tr := &Repository{ID: &zeroValue}\n\tr.GetID()\n\tr = &Repository{}\n\tr.GetID()\n\tr = nil\n\tr.GetID()\n}\n\nfunc TestRepository_GetIssueCommentURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{IssueCommentURL: &zeroValue}\n\tr.GetIssueCommentURL()\n\tr = &Repository{}\n\tr.GetIssueCommentURL()\n\tr = nil\n\tr.GetIssueCommentURL()\n}\n\nfunc TestRepository_GetIssueEventsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{IssueEventsURL: &zeroValue}\n\tr.GetIssueEventsURL()\n\tr = &Repository{}\n\tr.GetIssueEventsURL()\n\tr = nil\n\tr.GetIssueEventsURL()\n}\n\nfunc TestRepository_GetIssuesURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{IssuesURL: &zeroValue}\n\tr.GetIssuesURL()\n\tr = &Repository{}\n\tr.GetIssuesURL()\n\tr = nil\n\tr.GetIssuesURL()\n}\n\nfunc TestRepository_GetIsTemplate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &Repository{IsTemplate: &zeroValue}\n\tr.GetIsTemplate()\n\tr = &Repository{}\n\tr.GetIsTemplate()\n\tr = nil\n\tr.GetIsTemplate()\n}\n\nfunc TestRepository_GetKeysURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{KeysURL: &zeroValue}\n\tr.GetKeysURL()\n\tr = &Repository{}\n\tr.GetKeysURL()\n\tr = nil\n\tr.GetKeysURL()\n}\n\nfunc TestRepository_GetLabelsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{LabelsURL: &zeroValue}\n\tr.GetLabelsURL()\n\tr = &Repository{}\n\tr.GetLabelsURL()\n\tr = nil\n\tr.GetLabelsURL()\n}\n\nfunc TestRepository_GetLanguage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{Language: &zeroValue}\n\tr.GetLanguage()\n\tr = &Repository{}\n\tr.GetLanguage()\n\tr = nil\n\tr.GetLanguage()\n}\n\nfunc TestRepository_GetLanguagesURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{LanguagesURL: &zeroValue}\n\tr.GetLanguagesURL()\n\tr = &Repository{}\n\tr.GetLanguagesURL()\n\tr = nil\n\tr.GetLanguagesURL()\n}\n\nfunc TestRepository_GetLicense(tt *testing.T) {\n\ttt.Parallel()\n\tr := &Repository{}\n\tr.GetLicense()\n\tr = nil\n\tr.GetLicense()\n}\n\nfunc TestRepository_GetLicenseTemplate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{LicenseTemplate: &zeroValue}\n\tr.GetLicenseTemplate()\n\tr = &Repository{}\n\tr.GetLicenseTemplate()\n\tr = nil\n\tr.GetLicenseTemplate()\n}\n\nfunc TestRepository_GetMasterBranch(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{MasterBranch: &zeroValue}\n\tr.GetMasterBranch()\n\tr = &Repository{}\n\tr.GetMasterBranch()\n\tr = nil\n\tr.GetMasterBranch()\n}\n\nfunc TestRepository_GetMergeCommitMessage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{MergeCommitMessage: &zeroValue}\n\tr.GetMergeCommitMessage()\n\tr = &Repository{}\n\tr.GetMergeCommitMessage()\n\tr = nil\n\tr.GetMergeCommitMessage()\n}\n\nfunc TestRepository_GetMergeCommitTitle(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{MergeCommitTitle: &zeroValue}\n\tr.GetMergeCommitTitle()\n\tr = &Repository{}\n\tr.GetMergeCommitTitle()\n\tr = nil\n\tr.GetMergeCommitTitle()\n}\n\nfunc TestRepository_GetMergesURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{MergesURL: &zeroValue}\n\tr.GetMergesURL()\n\tr = &Repository{}\n\tr.GetMergesURL()\n\tr = nil\n\tr.GetMergesURL()\n}\n\nfunc TestRepository_GetMilestonesURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{MilestonesURL: &zeroValue}\n\tr.GetMilestonesURL()\n\tr = &Repository{}\n\tr.GetMilestonesURL()\n\tr = nil\n\tr.GetMilestonesURL()\n}\n\nfunc TestRepository_GetMirrorURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{MirrorURL: &zeroValue}\n\tr.GetMirrorURL()\n\tr = &Repository{}\n\tr.GetMirrorURL()\n\tr = nil\n\tr.GetMirrorURL()\n}\n\nfunc TestRepository_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{Name: &zeroValue}\n\tr.GetName()\n\tr = &Repository{}\n\tr.GetName()\n\tr = nil\n\tr.GetName()\n}\n\nfunc TestRepository_GetNetworkCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &Repository{NetworkCount: &zeroValue}\n\tr.GetNetworkCount()\n\tr = &Repository{}\n\tr.GetNetworkCount()\n\tr = nil\n\tr.GetNetworkCount()\n}\n\nfunc TestRepository_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{NodeID: &zeroValue}\n\tr.GetNodeID()\n\tr = &Repository{}\n\tr.GetNodeID()\n\tr = nil\n\tr.GetNodeID()\n}\n\nfunc TestRepository_GetNotificationsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{NotificationsURL: &zeroValue}\n\tr.GetNotificationsURL()\n\tr = &Repository{}\n\tr.GetNotificationsURL()\n\tr = nil\n\tr.GetNotificationsURL()\n}\n\nfunc TestRepository_GetOpenIssues(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &Repository{OpenIssues: &zeroValue}\n\tr.GetOpenIssues()\n\tr = &Repository{}\n\tr.GetOpenIssues()\n\tr = nil\n\tr.GetOpenIssues()\n}\n\nfunc TestRepository_GetOpenIssuesCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &Repository{OpenIssuesCount: &zeroValue}\n\tr.GetOpenIssuesCount()\n\tr = &Repository{}\n\tr.GetOpenIssuesCount()\n\tr = nil\n\tr.GetOpenIssuesCount()\n}\n\nfunc TestRepository_GetOrganization(tt *testing.T) {\n\ttt.Parallel()\n\tr := &Repository{}\n\tr.GetOrganization()\n\tr = nil\n\tr.GetOrganization()\n}\n\nfunc TestRepository_GetOwner(tt *testing.T) {\n\ttt.Parallel()\n\tr := &Repository{}\n\tr.GetOwner()\n\tr = nil\n\tr.GetOwner()\n}\n\nfunc TestRepository_GetParent(tt *testing.T) {\n\ttt.Parallel()\n\tr := &Repository{}\n\tr.GetParent()\n\tr = nil\n\tr.GetParent()\n}\n\nfunc TestRepository_GetPermissions(tt *testing.T) {\n\ttt.Parallel()\n\tr := &Repository{}\n\tr.GetPermissions()\n\tr = nil\n\tr.GetPermissions()\n}\n\nfunc TestRepository_GetPrivate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &Repository{Private: &zeroValue}\n\tr.GetPrivate()\n\tr = &Repository{}\n\tr.GetPrivate()\n\tr = nil\n\tr.GetPrivate()\n}\n\nfunc TestRepository_GetPullsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{PullsURL: &zeroValue}\n\tr.GetPullsURL()\n\tr = &Repository{}\n\tr.GetPullsURL()\n\tr = nil\n\tr.GetPullsURL()\n}\n\nfunc TestRepository_GetPushedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tr := &Repository{PushedAt: &zeroValue}\n\tr.GetPushedAt()\n\tr = &Repository{}\n\tr.GetPushedAt()\n\tr = nil\n\tr.GetPushedAt()\n}\n\nfunc TestRepository_GetReleasesURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{ReleasesURL: &zeroValue}\n\tr.GetReleasesURL()\n\tr = &Repository{}\n\tr.GetReleasesURL()\n\tr = nil\n\tr.GetReleasesURL()\n}\n\nfunc TestRepository_GetRoleName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{RoleName: &zeroValue}\n\tr.GetRoleName()\n\tr = &Repository{}\n\tr.GetRoleName()\n\tr = nil\n\tr.GetRoleName()\n}\n\nfunc TestRepository_GetSecurityAndAnalysis(tt *testing.T) {\n\ttt.Parallel()\n\tr := &Repository{}\n\tr.GetSecurityAndAnalysis()\n\tr = nil\n\tr.GetSecurityAndAnalysis()\n}\n\nfunc TestRepository_GetSize(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &Repository{Size: &zeroValue}\n\tr.GetSize()\n\tr = &Repository{}\n\tr.GetSize()\n\tr = nil\n\tr.GetSize()\n}\n\nfunc TestRepository_GetSource(tt *testing.T) {\n\ttt.Parallel()\n\tr := &Repository{}\n\tr.GetSource()\n\tr = nil\n\tr.GetSource()\n}\n\nfunc TestRepository_GetSquashMergeCommitMessage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{SquashMergeCommitMessage: &zeroValue}\n\tr.GetSquashMergeCommitMessage()\n\tr = &Repository{}\n\tr.GetSquashMergeCommitMessage()\n\tr = nil\n\tr.GetSquashMergeCommitMessage()\n}\n\nfunc TestRepository_GetSquashMergeCommitTitle(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{SquashMergeCommitTitle: &zeroValue}\n\tr.GetSquashMergeCommitTitle()\n\tr = &Repository{}\n\tr.GetSquashMergeCommitTitle()\n\tr = nil\n\tr.GetSquashMergeCommitTitle()\n}\n\nfunc TestRepository_GetSSHURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{SSHURL: &zeroValue}\n\tr.GetSSHURL()\n\tr = &Repository{}\n\tr.GetSSHURL()\n\tr = nil\n\tr.GetSSHURL()\n}\n\nfunc TestRepository_GetStargazersCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &Repository{StargazersCount: &zeroValue}\n\tr.GetStargazersCount()\n\tr = &Repository{}\n\tr.GetStargazersCount()\n\tr = nil\n\tr.GetStargazersCount()\n}\n\nfunc TestRepository_GetStargazersURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{StargazersURL: &zeroValue}\n\tr.GetStargazersURL()\n\tr = &Repository{}\n\tr.GetStargazersURL()\n\tr = nil\n\tr.GetStargazersURL()\n}\n\nfunc TestRepository_GetStatusesURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{StatusesURL: &zeroValue}\n\tr.GetStatusesURL()\n\tr = &Repository{}\n\tr.GetStatusesURL()\n\tr = nil\n\tr.GetStatusesURL()\n}\n\nfunc TestRepository_GetSubscribersCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &Repository{SubscribersCount: &zeroValue}\n\tr.GetSubscribersCount()\n\tr = &Repository{}\n\tr.GetSubscribersCount()\n\tr = nil\n\tr.GetSubscribersCount()\n}\n\nfunc TestRepository_GetSubscribersURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{SubscribersURL: &zeroValue}\n\tr.GetSubscribersURL()\n\tr = &Repository{}\n\tr.GetSubscribersURL()\n\tr = nil\n\tr.GetSubscribersURL()\n}\n\nfunc TestRepository_GetSubscriptionURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{SubscriptionURL: &zeroValue}\n\tr.GetSubscriptionURL()\n\tr = &Repository{}\n\tr.GetSubscriptionURL()\n\tr = nil\n\tr.GetSubscriptionURL()\n}\n\nfunc TestRepository_GetSVNURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{SVNURL: &zeroValue}\n\tr.GetSVNURL()\n\tr = &Repository{}\n\tr.GetSVNURL()\n\tr = nil\n\tr.GetSVNURL()\n}\n\nfunc TestRepository_GetTagsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{TagsURL: &zeroValue}\n\tr.GetTagsURL()\n\tr = &Repository{}\n\tr.GetTagsURL()\n\tr = nil\n\tr.GetTagsURL()\n}\n\nfunc TestRepository_GetTeamID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tr := &Repository{TeamID: &zeroValue}\n\tr.GetTeamID()\n\tr = &Repository{}\n\tr.GetTeamID()\n\tr = nil\n\tr.GetTeamID()\n}\n\nfunc TestRepository_GetTeamsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{TeamsURL: &zeroValue}\n\tr.GetTeamsURL()\n\tr = &Repository{}\n\tr.GetTeamsURL()\n\tr = nil\n\tr.GetTeamsURL()\n}\n\nfunc TestRepository_GetTemplateRepository(tt *testing.T) {\n\ttt.Parallel()\n\tr := &Repository{}\n\tr.GetTemplateRepository()\n\tr = nil\n\tr.GetTemplateRepository()\n}\n\nfunc TestRepository_GetTextMatches(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*TextMatch{}\n\tr := &Repository{TextMatches: zeroValue}\n\tr.GetTextMatches()\n\tr = &Repository{}\n\tr.GetTextMatches()\n\tr = nil\n\tr.GetTextMatches()\n}\n\nfunc TestRepository_GetTopics(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tr := &Repository{Topics: zeroValue}\n\tr.GetTopics()\n\tr = &Repository{}\n\tr.GetTopics()\n\tr = nil\n\tr.GetTopics()\n}\n\nfunc TestRepository_GetTreesURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{TreesURL: &zeroValue}\n\tr.GetTreesURL()\n\tr = &Repository{}\n\tr.GetTreesURL()\n\tr = nil\n\tr.GetTreesURL()\n}\n\nfunc TestRepository_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tr := &Repository{UpdatedAt: &zeroValue}\n\tr.GetUpdatedAt()\n\tr = &Repository{}\n\tr.GetUpdatedAt()\n\tr = nil\n\tr.GetUpdatedAt()\n}\n\nfunc TestRepository_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{URL: &zeroValue}\n\tr.GetURL()\n\tr = &Repository{}\n\tr.GetURL()\n\tr = nil\n\tr.GetURL()\n}\n\nfunc TestRepository_GetUseSquashPRTitleAsDefault(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &Repository{UseSquashPRTitleAsDefault: &zeroValue}\n\tr.GetUseSquashPRTitleAsDefault()\n\tr = &Repository{}\n\tr.GetUseSquashPRTitleAsDefault()\n\tr = nil\n\tr.GetUseSquashPRTitleAsDefault()\n}\n\nfunc TestRepository_GetVisibility(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Repository{Visibility: &zeroValue}\n\tr.GetVisibility()\n\tr = &Repository{}\n\tr.GetVisibility()\n\tr = nil\n\tr.GetVisibility()\n}\n\nfunc TestRepository_GetWatchers(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &Repository{Watchers: &zeroValue}\n\tr.GetWatchers()\n\tr = &Repository{}\n\tr.GetWatchers()\n\tr = nil\n\tr.GetWatchers()\n}\n\nfunc TestRepository_GetWatchersCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &Repository{WatchersCount: &zeroValue}\n\tr.GetWatchersCount()\n\tr = &Repository{}\n\tr.GetWatchersCount()\n\tr = nil\n\tr.GetWatchersCount()\n}\n\nfunc TestRepository_GetWebCommitSignoffRequired(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &Repository{WebCommitSignoffRequired: &zeroValue}\n\tr.GetWebCommitSignoffRequired()\n\tr = &Repository{}\n\tr.GetWebCommitSignoffRequired()\n\tr = nil\n\tr.GetWebCommitSignoffRequired()\n}\n\nfunc TestRepositoryActionsAccessLevel_GetAccessLevel(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryActionsAccessLevel{AccessLevel: &zeroValue}\n\tr.GetAccessLevel()\n\tr = &RepositoryActionsAccessLevel{}\n\tr.GetAccessLevel()\n\tr = nil\n\tr.GetAccessLevel()\n}\n\nfunc TestRepositoryActiveCommitters_GetAdvancedSecurityCommitters(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryActiveCommitters{}\n\tr.GetAdvancedSecurityCommitters()\n\tr = nil\n\tr.GetAdvancedSecurityCommitters()\n}\n\nfunc TestRepositoryActiveCommitters_GetAdvancedSecurityCommittersBreakdown(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*AdvancedSecurityCommittersBreakdown{}\n\tr := &RepositoryActiveCommitters{AdvancedSecurityCommittersBreakdown: zeroValue}\n\tr.GetAdvancedSecurityCommittersBreakdown()\n\tr = &RepositoryActiveCommitters{}\n\tr.GetAdvancedSecurityCommittersBreakdown()\n\tr = nil\n\tr.GetAdvancedSecurityCommittersBreakdown()\n}\n\nfunc TestRepositoryActiveCommitters_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryActiveCommitters{}\n\tr.GetName()\n\tr = nil\n\tr.GetName()\n}\n\nfunc TestRepositoryActivity_GetActivityType(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryActivity{}\n\tr.GetActivityType()\n\tr = nil\n\tr.GetActivityType()\n}\n\nfunc TestRepositoryActivity_GetActor(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryActivity{}\n\tr.GetActor()\n\tr = nil\n\tr.GetActor()\n}\n\nfunc TestRepositoryActivity_GetAfter(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryActivity{}\n\tr.GetAfter()\n\tr = nil\n\tr.GetAfter()\n}\n\nfunc TestRepositoryActivity_GetBefore(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryActivity{}\n\tr.GetBefore()\n\tr = nil\n\tr.GetBefore()\n}\n\nfunc TestRepositoryActivity_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryActivity{}\n\tr.GetID()\n\tr = nil\n\tr.GetID()\n}\n\nfunc TestRepositoryActivity_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryActivity{}\n\tr.GetNodeID()\n\tr = nil\n\tr.GetNodeID()\n}\n\nfunc TestRepositoryActivity_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryActivity{}\n\tr.GetRef()\n\tr = nil\n\tr.GetRef()\n}\n\nfunc TestRepositoryActivity_GetTimestamp(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tr := &RepositoryActivity{Timestamp: &zeroValue}\n\tr.GetTimestamp()\n\tr = &RepositoryActivity{}\n\tr.GetTimestamp()\n\tr = nil\n\tr.GetTimestamp()\n}\n\nfunc TestRepositoryActor_GetAvatarURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryActor{AvatarURL: &zeroValue}\n\tr.GetAvatarURL()\n\tr = &RepositoryActor{}\n\tr.GetAvatarURL()\n\tr = nil\n\tr.GetAvatarURL()\n}\n\nfunc TestRepositoryActor_GetEventsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryActor{EventsURL: &zeroValue}\n\tr.GetEventsURL()\n\tr = &RepositoryActor{}\n\tr.GetEventsURL()\n\tr = nil\n\tr.GetEventsURL()\n}\n\nfunc TestRepositoryActor_GetFollowersURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryActor{FollowersURL: &zeroValue}\n\tr.GetFollowersURL()\n\tr = &RepositoryActor{}\n\tr.GetFollowersURL()\n\tr = nil\n\tr.GetFollowersURL()\n}\n\nfunc TestRepositoryActor_GetFollowingURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryActor{FollowingURL: &zeroValue}\n\tr.GetFollowingURL()\n\tr = &RepositoryActor{}\n\tr.GetFollowingURL()\n\tr = nil\n\tr.GetFollowingURL()\n}\n\nfunc TestRepositoryActor_GetGistsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryActor{GistsURL: &zeroValue}\n\tr.GetGistsURL()\n\tr = &RepositoryActor{}\n\tr.GetGistsURL()\n\tr = nil\n\tr.GetGistsURL()\n}\n\nfunc TestRepositoryActor_GetGravatarID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryActor{GravatarID: &zeroValue}\n\tr.GetGravatarID()\n\tr = &RepositoryActor{}\n\tr.GetGravatarID()\n\tr = nil\n\tr.GetGravatarID()\n}\n\nfunc TestRepositoryActor_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryActor{HTMLURL: &zeroValue}\n\tr.GetHTMLURL()\n\tr = &RepositoryActor{}\n\tr.GetHTMLURL()\n\tr = nil\n\tr.GetHTMLURL()\n}\n\nfunc TestRepositoryActor_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tr := &RepositoryActor{ID: &zeroValue}\n\tr.GetID()\n\tr = &RepositoryActor{}\n\tr.GetID()\n\tr = nil\n\tr.GetID()\n}\n\nfunc TestRepositoryActor_GetLogin(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryActor{Login: &zeroValue}\n\tr.GetLogin()\n\tr = &RepositoryActor{}\n\tr.GetLogin()\n\tr = nil\n\tr.GetLogin()\n}\n\nfunc TestRepositoryActor_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryActor{NodeID: &zeroValue}\n\tr.GetNodeID()\n\tr = &RepositoryActor{}\n\tr.GetNodeID()\n\tr = nil\n\tr.GetNodeID()\n}\n\nfunc TestRepositoryActor_GetOrganizationsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryActor{OrganizationsURL: &zeroValue}\n\tr.GetOrganizationsURL()\n\tr = &RepositoryActor{}\n\tr.GetOrganizationsURL()\n\tr = nil\n\tr.GetOrganizationsURL()\n}\n\nfunc TestRepositoryActor_GetReceivedEventsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryActor{ReceivedEventsURL: &zeroValue}\n\tr.GetReceivedEventsURL()\n\tr = &RepositoryActor{}\n\tr.GetReceivedEventsURL()\n\tr = nil\n\tr.GetReceivedEventsURL()\n}\n\nfunc TestRepositoryActor_GetReposURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryActor{ReposURL: &zeroValue}\n\tr.GetReposURL()\n\tr = &RepositoryActor{}\n\tr.GetReposURL()\n\tr = nil\n\tr.GetReposURL()\n}\n\nfunc TestRepositoryActor_GetSiteAdmin(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &RepositoryActor{SiteAdmin: &zeroValue}\n\tr.GetSiteAdmin()\n\tr = &RepositoryActor{}\n\tr.GetSiteAdmin()\n\tr = nil\n\tr.GetSiteAdmin()\n}\n\nfunc TestRepositoryActor_GetStarredURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryActor{StarredURL: &zeroValue}\n\tr.GetStarredURL()\n\tr = &RepositoryActor{}\n\tr.GetStarredURL()\n\tr = nil\n\tr.GetStarredURL()\n}\n\nfunc TestRepositoryActor_GetSubscriptionsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryActor{SubscriptionsURL: &zeroValue}\n\tr.GetSubscriptionsURL()\n\tr = &RepositoryActor{}\n\tr.GetSubscriptionsURL()\n\tr = nil\n\tr.GetSubscriptionsURL()\n}\n\nfunc TestRepositoryActor_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryActor{Type: &zeroValue}\n\tr.GetType()\n\tr = &RepositoryActor{}\n\tr.GetType()\n\tr = nil\n\tr.GetType()\n}\n\nfunc TestRepositoryActor_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryActor{URL: &zeroValue}\n\tr.GetURL()\n\tr = &RepositoryActor{}\n\tr.GetURL()\n\tr = nil\n\tr.GetURL()\n}\n\nfunc TestRepositoryActor_GetUserViewType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryActor{UserViewType: &zeroValue}\n\tr.GetUserViewType()\n\tr = &RepositoryActor{}\n\tr.GetUserViewType()\n\tr = nil\n\tr.GetUserViewType()\n}\n\nfunc TestRepositoryAddCollaboratorOptions_GetPermission(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryAddCollaboratorOptions{}\n\tr.GetPermission()\n\tr = nil\n\tr.GetPermission()\n}\n\nfunc TestRepositoryAttachment_GetRepository(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryAttachment{}\n\tr.GetRepository()\n\tr = nil\n\tr.GetRepository()\n}\n\nfunc TestRepositoryAttachment_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryAttachment{Status: &zeroValue}\n\tr.GetStatus()\n\tr = &RepositoryAttachment{}\n\tr.GetStatus()\n\tr = nil\n\tr.GetStatus()\n}\n\nfunc TestRepositoryCodeSecurityConfiguration_GetConfiguration(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryCodeSecurityConfiguration{}\n\tr.GetConfiguration()\n\tr = nil\n\tr.GetConfiguration()\n}\n\nfunc TestRepositoryCodeSecurityConfiguration_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryCodeSecurityConfiguration{State: &zeroValue}\n\tr.GetState()\n\tr = &RepositoryCodeSecurityConfiguration{}\n\tr.GetState()\n\tr = nil\n\tr.GetState()\n}\n\nfunc TestRepositoryComment_GetBody(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryComment{Body: &zeroValue}\n\tr.GetBody()\n\tr = &RepositoryComment{}\n\tr.GetBody()\n\tr = nil\n\tr.GetBody()\n}\n\nfunc TestRepositoryComment_GetCommitID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryComment{CommitID: &zeroValue}\n\tr.GetCommitID()\n\tr = &RepositoryComment{}\n\tr.GetCommitID()\n\tr = nil\n\tr.GetCommitID()\n}\n\nfunc TestRepositoryComment_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tr := &RepositoryComment{CreatedAt: &zeroValue}\n\tr.GetCreatedAt()\n\tr = &RepositoryComment{}\n\tr.GetCreatedAt()\n\tr = nil\n\tr.GetCreatedAt()\n}\n\nfunc TestRepositoryComment_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryComment{HTMLURL: &zeroValue}\n\tr.GetHTMLURL()\n\tr = &RepositoryComment{}\n\tr.GetHTMLURL()\n\tr = nil\n\tr.GetHTMLURL()\n}\n\nfunc TestRepositoryComment_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tr := &RepositoryComment{ID: &zeroValue}\n\tr.GetID()\n\tr = &RepositoryComment{}\n\tr.GetID()\n\tr = nil\n\tr.GetID()\n}\n\nfunc TestRepositoryComment_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryComment{NodeID: &zeroValue}\n\tr.GetNodeID()\n\tr = &RepositoryComment{}\n\tr.GetNodeID()\n\tr = nil\n\tr.GetNodeID()\n}\n\nfunc TestRepositoryComment_GetPath(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryComment{Path: &zeroValue}\n\tr.GetPath()\n\tr = &RepositoryComment{}\n\tr.GetPath()\n\tr = nil\n\tr.GetPath()\n}\n\nfunc TestRepositoryComment_GetPosition(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &RepositoryComment{Position: &zeroValue}\n\tr.GetPosition()\n\tr = &RepositoryComment{}\n\tr.GetPosition()\n\tr = nil\n\tr.GetPosition()\n}\n\nfunc TestRepositoryComment_GetReactions(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryComment{}\n\tr.GetReactions()\n\tr = nil\n\tr.GetReactions()\n}\n\nfunc TestRepositoryComment_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tr := &RepositoryComment{UpdatedAt: &zeroValue}\n\tr.GetUpdatedAt()\n\tr = &RepositoryComment{}\n\tr.GetUpdatedAt()\n\tr = nil\n\tr.GetUpdatedAt()\n}\n\nfunc TestRepositoryComment_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryComment{URL: &zeroValue}\n\tr.GetURL()\n\tr = &RepositoryComment{}\n\tr.GetURL()\n\tr = nil\n\tr.GetURL()\n}\n\nfunc TestRepositoryComment_GetUser(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryComment{}\n\tr.GetUser()\n\tr = nil\n\tr.GetUser()\n}\n\nfunc TestRepositoryCommit_GetAuthor(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryCommit{}\n\tr.GetAuthor()\n\tr = nil\n\tr.GetAuthor()\n}\n\nfunc TestRepositoryCommit_GetCommentsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryCommit{CommentsURL: &zeroValue}\n\tr.GetCommentsURL()\n\tr = &RepositoryCommit{}\n\tr.GetCommentsURL()\n\tr = nil\n\tr.GetCommentsURL()\n}\n\nfunc TestRepositoryCommit_GetCommit(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryCommit{}\n\tr.GetCommit()\n\tr = nil\n\tr.GetCommit()\n}\n\nfunc TestRepositoryCommit_GetCommitter(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryCommit{}\n\tr.GetCommitter()\n\tr = nil\n\tr.GetCommitter()\n}\n\nfunc TestRepositoryCommit_GetFiles(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CommitFile{}\n\tr := &RepositoryCommit{Files: zeroValue}\n\tr.GetFiles()\n\tr = &RepositoryCommit{}\n\tr.GetFiles()\n\tr = nil\n\tr.GetFiles()\n}\n\nfunc TestRepositoryCommit_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryCommit{HTMLURL: &zeroValue}\n\tr.GetHTMLURL()\n\tr = &RepositoryCommit{}\n\tr.GetHTMLURL()\n\tr = nil\n\tr.GetHTMLURL()\n}\n\nfunc TestRepositoryCommit_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryCommit{NodeID: &zeroValue}\n\tr.GetNodeID()\n\tr = &RepositoryCommit{}\n\tr.GetNodeID()\n\tr = nil\n\tr.GetNodeID()\n}\n\nfunc TestRepositoryCommit_GetParents(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Commit{}\n\tr := &RepositoryCommit{Parents: zeroValue}\n\tr.GetParents()\n\tr = &RepositoryCommit{}\n\tr.GetParents()\n\tr = nil\n\tr.GetParents()\n}\n\nfunc TestRepositoryCommit_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryCommit{SHA: &zeroValue}\n\tr.GetSHA()\n\tr = &RepositoryCommit{}\n\tr.GetSHA()\n\tr = nil\n\tr.GetSHA()\n}\n\nfunc TestRepositoryCommit_GetStats(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryCommit{}\n\tr.GetStats()\n\tr = nil\n\tr.GetStats()\n}\n\nfunc TestRepositoryCommit_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryCommit{URL: &zeroValue}\n\tr.GetURL()\n\tr = &RepositoryCommit{}\n\tr.GetURL()\n\tr = nil\n\tr.GetURL()\n}\n\nfunc TestRepositoryContent_GetDownloadURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryContent{DownloadURL: &zeroValue}\n\tr.GetDownloadURL()\n\tr = &RepositoryContent{}\n\tr.GetDownloadURL()\n\tr = nil\n\tr.GetDownloadURL()\n}\n\nfunc TestRepositoryContent_GetEncoding(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryContent{Encoding: &zeroValue}\n\tr.GetEncoding()\n\tr = &RepositoryContent{}\n\tr.GetEncoding()\n\tr = nil\n\tr.GetEncoding()\n}\n\nfunc TestRepositoryContent_GetGitURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryContent{GitURL: &zeroValue}\n\tr.GetGitURL()\n\tr = &RepositoryContent{}\n\tr.GetGitURL()\n\tr = nil\n\tr.GetGitURL()\n}\n\nfunc TestRepositoryContent_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryContent{HTMLURL: &zeroValue}\n\tr.GetHTMLURL()\n\tr = &RepositoryContent{}\n\tr.GetHTMLURL()\n\tr = nil\n\tr.GetHTMLURL()\n}\n\nfunc TestRepositoryContent_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryContent{Name: &zeroValue}\n\tr.GetName()\n\tr = &RepositoryContent{}\n\tr.GetName()\n\tr = nil\n\tr.GetName()\n}\n\nfunc TestRepositoryContent_GetPath(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryContent{Path: &zeroValue}\n\tr.GetPath()\n\tr = &RepositoryContent{}\n\tr.GetPath()\n\tr = nil\n\tr.GetPath()\n}\n\nfunc TestRepositoryContent_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryContent{SHA: &zeroValue}\n\tr.GetSHA()\n\tr = &RepositoryContent{}\n\tr.GetSHA()\n\tr = nil\n\tr.GetSHA()\n}\n\nfunc TestRepositoryContent_GetSize(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &RepositoryContent{Size: &zeroValue}\n\tr.GetSize()\n\tr = &RepositoryContent{}\n\tr.GetSize()\n\tr = nil\n\tr.GetSize()\n}\n\nfunc TestRepositoryContent_GetSubmoduleGitURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryContent{SubmoduleGitURL: &zeroValue}\n\tr.GetSubmoduleGitURL()\n\tr = &RepositoryContent{}\n\tr.GetSubmoduleGitURL()\n\tr = nil\n\tr.GetSubmoduleGitURL()\n}\n\nfunc TestRepositoryContent_GetTarget(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryContent{Target: &zeroValue}\n\tr.GetTarget()\n\tr = &RepositoryContent{}\n\tr.GetTarget()\n\tr = nil\n\tr.GetTarget()\n}\n\nfunc TestRepositoryContent_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryContent{Type: &zeroValue}\n\tr.GetType()\n\tr = &RepositoryContent{}\n\tr.GetType()\n\tr = nil\n\tr.GetType()\n}\n\nfunc TestRepositoryContent_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryContent{URL: &zeroValue}\n\tr.GetURL()\n\tr = &RepositoryContent{}\n\tr.GetURL()\n\tr = nil\n\tr.GetURL()\n}\n\nfunc TestRepositoryContentFileOptions_GetAuthor(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryContentFileOptions{}\n\tr.GetAuthor()\n\tr = nil\n\tr.GetAuthor()\n}\n\nfunc TestRepositoryContentFileOptions_GetBranch(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryContentFileOptions{Branch: &zeroValue}\n\tr.GetBranch()\n\tr = &RepositoryContentFileOptions{}\n\tr.GetBranch()\n\tr = nil\n\tr.GetBranch()\n}\n\nfunc TestRepositoryContentFileOptions_GetCommitter(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryContentFileOptions{}\n\tr.GetCommitter()\n\tr = nil\n\tr.GetCommitter()\n}\n\nfunc TestRepositoryContentFileOptions_GetContent(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []byte{}\n\tr := &RepositoryContentFileOptions{Content: zeroValue}\n\tr.GetContent()\n\tr = &RepositoryContentFileOptions{}\n\tr.GetContent()\n\tr = nil\n\tr.GetContent()\n}\n\nfunc TestRepositoryContentFileOptions_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryContentFileOptions{Message: &zeroValue}\n\tr.GetMessage()\n\tr = &RepositoryContentFileOptions{}\n\tr.GetMessage()\n\tr = nil\n\tr.GetMessage()\n}\n\nfunc TestRepositoryContentFileOptions_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryContentFileOptions{SHA: &zeroValue}\n\tr.GetSHA()\n\tr = &RepositoryContentFileOptions{}\n\tr.GetSHA()\n\tr = nil\n\tr.GetSHA()\n}\n\nfunc TestRepositoryContentGetOptions_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryContentGetOptions{}\n\tr.GetRef()\n\tr = nil\n\tr.GetRef()\n}\n\nfunc TestRepositoryContentResponse_GetContent(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryContentResponse{}\n\tr.GetContent()\n\tr = nil\n\tr.GetContent()\n}\n\nfunc TestRepositoryCreateForkOptions_GetDefaultBranchOnly(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryCreateForkOptions{}\n\tr.GetDefaultBranchOnly()\n\tr = nil\n\tr.GetDefaultBranchOnly()\n}\n\nfunc TestRepositoryCreateForkOptions_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryCreateForkOptions{}\n\tr.GetName()\n\tr = nil\n\tr.GetName()\n}\n\nfunc TestRepositoryCreateForkOptions_GetOrganization(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryCreateForkOptions{}\n\tr.GetOrganization()\n\tr = nil\n\tr.GetOrganization()\n}\n\nfunc TestRepositoryDispatchEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryDispatchEvent{Action: &zeroValue}\n\tr.GetAction()\n\tr = &RepositoryDispatchEvent{}\n\tr.GetAction()\n\tr = nil\n\tr.GetAction()\n}\n\nfunc TestRepositoryDispatchEvent_GetBranch(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryDispatchEvent{Branch: &zeroValue}\n\tr.GetBranch()\n\tr = &RepositoryDispatchEvent{}\n\tr.GetBranch()\n\tr = nil\n\tr.GetBranch()\n}\n\nfunc TestRepositoryDispatchEvent_GetClientPayload(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryDispatchEvent{}\n\tr.GetClientPayload()\n\tr = nil\n\tr.GetClientPayload()\n}\n\nfunc TestRepositoryDispatchEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryDispatchEvent{}\n\tr.GetInstallation()\n\tr = nil\n\tr.GetInstallation()\n}\n\nfunc TestRepositoryDispatchEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryDispatchEvent{}\n\tr.GetOrg()\n\tr = nil\n\tr.GetOrg()\n}\n\nfunc TestRepositoryDispatchEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryDispatchEvent{}\n\tr.GetRepo()\n\tr = nil\n\tr.GetRepo()\n}\n\nfunc TestRepositoryDispatchEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryDispatchEvent{}\n\tr.GetSender()\n\tr = nil\n\tr.GetSender()\n}\n\nfunc TestRepositoryEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryEvent{Action: &zeroValue}\n\tr.GetAction()\n\tr = &RepositoryEvent{}\n\tr.GetAction()\n\tr = nil\n\tr.GetAction()\n}\n\nfunc TestRepositoryEvent_GetChanges(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryEvent{}\n\tr.GetChanges()\n\tr = nil\n\tr.GetChanges()\n}\n\nfunc TestRepositoryEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryEvent{}\n\tr.GetInstallation()\n\tr = nil\n\tr.GetInstallation()\n}\n\nfunc TestRepositoryEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryEvent{}\n\tr.GetOrg()\n\tr = nil\n\tr.GetOrg()\n}\n\nfunc TestRepositoryEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryEvent{}\n\tr.GetRepo()\n\tr = nil\n\tr.GetRepo()\n}\n\nfunc TestRepositoryEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryEvent{}\n\tr.GetSender()\n\tr = nil\n\tr.GetSender()\n}\n\nfunc TestRepositoryImportEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryImportEvent{}\n\tr.GetOrg()\n\tr = nil\n\tr.GetOrg()\n}\n\nfunc TestRepositoryImportEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryImportEvent{}\n\tr.GetRepo()\n\tr = nil\n\tr.GetRepo()\n}\n\nfunc TestRepositoryImportEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryImportEvent{}\n\tr.GetSender()\n\tr = nil\n\tr.GetSender()\n}\n\nfunc TestRepositoryImportEvent_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryImportEvent{Status: &zeroValue}\n\tr.GetStatus()\n\tr = &RepositoryImportEvent{}\n\tr.GetStatus()\n\tr = nil\n\tr.GetStatus()\n}\n\nfunc TestRepositoryInvitation_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tr := &RepositoryInvitation{CreatedAt: &zeroValue}\n\tr.GetCreatedAt()\n\tr = &RepositoryInvitation{}\n\tr.GetCreatedAt()\n\tr = nil\n\tr.GetCreatedAt()\n}\n\nfunc TestRepositoryInvitation_GetExpired(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &RepositoryInvitation{Expired: &zeroValue}\n\tr.GetExpired()\n\tr = &RepositoryInvitation{}\n\tr.GetExpired()\n\tr = nil\n\tr.GetExpired()\n}\n\nfunc TestRepositoryInvitation_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryInvitation{HTMLURL: &zeroValue}\n\tr.GetHTMLURL()\n\tr = &RepositoryInvitation{}\n\tr.GetHTMLURL()\n\tr = nil\n\tr.GetHTMLURL()\n}\n\nfunc TestRepositoryInvitation_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tr := &RepositoryInvitation{ID: &zeroValue}\n\tr.GetID()\n\tr = &RepositoryInvitation{}\n\tr.GetID()\n\tr = nil\n\tr.GetID()\n}\n\nfunc TestRepositoryInvitation_GetInvitee(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryInvitation{}\n\tr.GetInvitee()\n\tr = nil\n\tr.GetInvitee()\n}\n\nfunc TestRepositoryInvitation_GetInviter(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryInvitation{}\n\tr.GetInviter()\n\tr = nil\n\tr.GetInviter()\n}\n\nfunc TestRepositoryInvitation_GetPermissions(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryInvitation{Permissions: &zeroValue}\n\tr.GetPermissions()\n\tr = &RepositoryInvitation{}\n\tr.GetPermissions()\n\tr = nil\n\tr.GetPermissions()\n}\n\nfunc TestRepositoryInvitation_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryInvitation{}\n\tr.GetRepo()\n\tr = nil\n\tr.GetRepo()\n}\n\nfunc TestRepositoryInvitation_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryInvitation{URL: &zeroValue}\n\tr.GetURL()\n\tr = &RepositoryInvitation{}\n\tr.GetURL()\n\tr = nil\n\tr.GetURL()\n}\n\nfunc TestRepositoryLicense_GetContent(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryLicense{Content: &zeroValue}\n\tr.GetContent()\n\tr = &RepositoryLicense{}\n\tr.GetContent()\n\tr = nil\n\tr.GetContent()\n}\n\nfunc TestRepositoryLicense_GetDownloadURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryLicense{DownloadURL: &zeroValue}\n\tr.GetDownloadURL()\n\tr = &RepositoryLicense{}\n\tr.GetDownloadURL()\n\tr = nil\n\tr.GetDownloadURL()\n}\n\nfunc TestRepositoryLicense_GetEncoding(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryLicense{Encoding: &zeroValue}\n\tr.GetEncoding()\n\tr = &RepositoryLicense{}\n\tr.GetEncoding()\n\tr = nil\n\tr.GetEncoding()\n}\n\nfunc TestRepositoryLicense_GetGitURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryLicense{GitURL: &zeroValue}\n\tr.GetGitURL()\n\tr = &RepositoryLicense{}\n\tr.GetGitURL()\n\tr = nil\n\tr.GetGitURL()\n}\n\nfunc TestRepositoryLicense_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryLicense{HTMLURL: &zeroValue}\n\tr.GetHTMLURL()\n\tr = &RepositoryLicense{}\n\tr.GetHTMLURL()\n\tr = nil\n\tr.GetHTMLURL()\n}\n\nfunc TestRepositoryLicense_GetLicense(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryLicense{}\n\tr.GetLicense()\n\tr = nil\n\tr.GetLicense()\n}\n\nfunc TestRepositoryLicense_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryLicense{Name: &zeroValue}\n\tr.GetName()\n\tr = &RepositoryLicense{}\n\tr.GetName()\n\tr = nil\n\tr.GetName()\n}\n\nfunc TestRepositoryLicense_GetPath(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryLicense{Path: &zeroValue}\n\tr.GetPath()\n\tr = &RepositoryLicense{}\n\tr.GetPath()\n\tr = nil\n\tr.GetPath()\n}\n\nfunc TestRepositoryLicense_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryLicense{SHA: &zeroValue}\n\tr.GetSHA()\n\tr = &RepositoryLicense{}\n\tr.GetSHA()\n\tr = nil\n\tr.GetSHA()\n}\n\nfunc TestRepositoryLicense_GetSize(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &RepositoryLicense{Size: &zeroValue}\n\tr.GetSize()\n\tr = &RepositoryLicense{}\n\tr.GetSize()\n\tr = nil\n\tr.GetSize()\n}\n\nfunc TestRepositoryLicense_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryLicense{Type: &zeroValue}\n\tr.GetType()\n\tr = &RepositoryLicense{}\n\tr.GetType()\n\tr = nil\n\tr.GetType()\n}\n\nfunc TestRepositoryLicense_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryLicense{URL: &zeroValue}\n\tr.GetURL()\n\tr = &RepositoryLicense{}\n\tr.GetURL()\n\tr = nil\n\tr.GetURL()\n}\n\nfunc TestRepositoryListAllOptions_GetSince(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryListAllOptions{}\n\tr.GetSince()\n\tr = nil\n\tr.GetSince()\n}\n\nfunc TestRepositoryListByAuthenticatedUserOptions_GetAffiliation(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryListByAuthenticatedUserOptions{}\n\tr.GetAffiliation()\n\tr = nil\n\tr.GetAffiliation()\n}\n\nfunc TestRepositoryListByAuthenticatedUserOptions_GetDirection(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryListByAuthenticatedUserOptions{}\n\tr.GetDirection()\n\tr = nil\n\tr.GetDirection()\n}\n\nfunc TestRepositoryListByAuthenticatedUserOptions_GetSort(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryListByAuthenticatedUserOptions{}\n\tr.GetSort()\n\tr = nil\n\tr.GetSort()\n}\n\nfunc TestRepositoryListByAuthenticatedUserOptions_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryListByAuthenticatedUserOptions{}\n\tr.GetType()\n\tr = nil\n\tr.GetType()\n}\n\nfunc TestRepositoryListByAuthenticatedUserOptions_GetVisibility(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryListByAuthenticatedUserOptions{}\n\tr.GetVisibility()\n\tr = nil\n\tr.GetVisibility()\n}\n\nfunc TestRepositoryListByOrgOptions_GetDirection(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryListByOrgOptions{}\n\tr.GetDirection()\n\tr = nil\n\tr.GetDirection()\n}\n\nfunc TestRepositoryListByOrgOptions_GetSort(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryListByOrgOptions{}\n\tr.GetSort()\n\tr = nil\n\tr.GetSort()\n}\n\nfunc TestRepositoryListByOrgOptions_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryListByOrgOptions{}\n\tr.GetType()\n\tr = nil\n\tr.GetType()\n}\n\nfunc TestRepositoryListByUserOptions_GetDirection(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryListByUserOptions{}\n\tr.GetDirection()\n\tr = nil\n\tr.GetDirection()\n}\n\nfunc TestRepositoryListByUserOptions_GetSort(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryListByUserOptions{}\n\tr.GetSort()\n\tr = nil\n\tr.GetSort()\n}\n\nfunc TestRepositoryListByUserOptions_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryListByUserOptions{}\n\tr.GetType()\n\tr = nil\n\tr.GetType()\n}\n\nfunc TestRepositoryListForksOptions_GetSort(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryListForksOptions{}\n\tr.GetSort()\n\tr = nil\n\tr.GetSort()\n}\n\nfunc TestRepositoryListOptions_GetAffiliation(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryListOptions{}\n\tr.GetAffiliation()\n\tr = nil\n\tr.GetAffiliation()\n}\n\nfunc TestRepositoryListOptions_GetDirection(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryListOptions{}\n\tr.GetDirection()\n\tr = nil\n\tr.GetDirection()\n}\n\nfunc TestRepositoryListOptions_GetSort(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryListOptions{}\n\tr.GetSort()\n\tr = nil\n\tr.GetSort()\n}\n\nfunc TestRepositoryListOptions_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryListOptions{}\n\tr.GetType()\n\tr = nil\n\tr.GetType()\n}\n\nfunc TestRepositoryListOptions_GetVisibility(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryListOptions{}\n\tr.GetVisibility()\n\tr = nil\n\tr.GetVisibility()\n}\n\nfunc TestRepositoryListRulesetsOptions_GetIncludesParents(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &RepositoryListRulesetsOptions{IncludesParents: &zeroValue}\n\tr.GetIncludesParents()\n\tr = &RepositoryListRulesetsOptions{}\n\tr.GetIncludesParents()\n\tr = nil\n\tr.GetIncludesParents()\n}\n\nfunc TestRepositoryMergeRequest_GetBase(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryMergeRequest{Base: &zeroValue}\n\tr.GetBase()\n\tr = &RepositoryMergeRequest{}\n\tr.GetBase()\n\tr = nil\n\tr.GetBase()\n}\n\nfunc TestRepositoryMergeRequest_GetCommitMessage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryMergeRequest{CommitMessage: &zeroValue}\n\tr.GetCommitMessage()\n\tr = &RepositoryMergeRequest{}\n\tr.GetCommitMessage()\n\tr = nil\n\tr.GetCommitMessage()\n}\n\nfunc TestRepositoryMergeRequest_GetHead(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryMergeRequest{Head: &zeroValue}\n\tr.GetHead()\n\tr = &RepositoryMergeRequest{}\n\tr.GetHead()\n\tr = nil\n\tr.GetHead()\n}\n\nfunc TestRepositoryParticipation_GetAll(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []int{}\n\tr := &RepositoryParticipation{All: zeroValue}\n\tr.GetAll()\n\tr = &RepositoryParticipation{}\n\tr.GetAll()\n\tr = nil\n\tr.GetAll()\n}\n\nfunc TestRepositoryParticipation_GetOwner(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []int{}\n\tr := &RepositoryParticipation{Owner: zeroValue}\n\tr.GetOwner()\n\tr = &RepositoryParticipation{}\n\tr.GetOwner()\n\tr = nil\n\tr.GetOwner()\n}\n\nfunc TestRepositoryPermissionLevel_GetPermission(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryPermissionLevel{Permission: &zeroValue}\n\tr.GetPermission()\n\tr = &RepositoryPermissionLevel{}\n\tr.GetPermission()\n\tr = nil\n\tr.GetPermission()\n}\n\nfunc TestRepositoryPermissionLevel_GetRoleName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryPermissionLevel{RoleName: &zeroValue}\n\tr.GetRoleName()\n\tr = &RepositoryPermissionLevel{}\n\tr.GetRoleName()\n\tr = nil\n\tr.GetRoleName()\n}\n\nfunc TestRepositoryPermissionLevel_GetUser(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryPermissionLevel{}\n\tr.GetUser()\n\tr = nil\n\tr.GetUser()\n}\n\nfunc TestRepositoryPermissions_GetAdmin(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &RepositoryPermissions{Admin: &zeroValue}\n\tr.GetAdmin()\n\tr = &RepositoryPermissions{}\n\tr.GetAdmin()\n\tr = nil\n\tr.GetAdmin()\n}\n\nfunc TestRepositoryPermissions_GetMaintain(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &RepositoryPermissions{Maintain: &zeroValue}\n\tr.GetMaintain()\n\tr = &RepositoryPermissions{}\n\tr.GetMaintain()\n\tr = nil\n\tr.GetMaintain()\n}\n\nfunc TestRepositoryPermissions_GetPull(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &RepositoryPermissions{Pull: &zeroValue}\n\tr.GetPull()\n\tr = &RepositoryPermissions{}\n\tr.GetPull()\n\tr = nil\n\tr.GetPull()\n}\n\nfunc TestRepositoryPermissions_GetPush(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &RepositoryPermissions{Push: &zeroValue}\n\tr.GetPush()\n\tr = &RepositoryPermissions{}\n\tr.GetPush()\n\tr = nil\n\tr.GetPush()\n}\n\nfunc TestRepositoryPermissions_GetTriage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &RepositoryPermissions{Triage: &zeroValue}\n\tr.GetTriage()\n\tr = &RepositoryPermissions{}\n\tr.GetTriage()\n\tr = nil\n\tr.GetTriage()\n}\n\nfunc TestRepositoryRelease_GetAssets(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*ReleaseAsset{}\n\tr := &RepositoryRelease{Assets: zeroValue}\n\tr.GetAssets()\n\tr = &RepositoryRelease{}\n\tr.GetAssets()\n\tr = nil\n\tr.GetAssets()\n}\n\nfunc TestRepositoryRelease_GetAssetsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryRelease{AssetsURL: &zeroValue}\n\tr.GetAssetsURL()\n\tr = &RepositoryRelease{}\n\tr.GetAssetsURL()\n\tr = nil\n\tr.GetAssetsURL()\n}\n\nfunc TestRepositoryRelease_GetAuthor(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRelease{}\n\tr.GetAuthor()\n\tr = nil\n\tr.GetAuthor()\n}\n\nfunc TestRepositoryRelease_GetBody(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryRelease{Body: &zeroValue}\n\tr.GetBody()\n\tr = &RepositoryRelease{}\n\tr.GetBody()\n\tr = nil\n\tr.GetBody()\n}\n\nfunc TestRepositoryRelease_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tr := &RepositoryRelease{CreatedAt: &zeroValue}\n\tr.GetCreatedAt()\n\tr = &RepositoryRelease{}\n\tr.GetCreatedAt()\n\tr = nil\n\tr.GetCreatedAt()\n}\n\nfunc TestRepositoryRelease_GetDiscussionCategoryName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryRelease{DiscussionCategoryName: &zeroValue}\n\tr.GetDiscussionCategoryName()\n\tr = &RepositoryRelease{}\n\tr.GetDiscussionCategoryName()\n\tr = nil\n\tr.GetDiscussionCategoryName()\n}\n\nfunc TestRepositoryRelease_GetDraft(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &RepositoryRelease{Draft: &zeroValue}\n\tr.GetDraft()\n\tr = &RepositoryRelease{}\n\tr.GetDraft()\n\tr = nil\n\tr.GetDraft()\n}\n\nfunc TestRepositoryRelease_GetGenerateReleaseNotes(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &RepositoryRelease{GenerateReleaseNotes: &zeroValue}\n\tr.GetGenerateReleaseNotes()\n\tr = &RepositoryRelease{}\n\tr.GetGenerateReleaseNotes()\n\tr = nil\n\tr.GetGenerateReleaseNotes()\n}\n\nfunc TestRepositoryRelease_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryRelease{HTMLURL: &zeroValue}\n\tr.GetHTMLURL()\n\tr = &RepositoryRelease{}\n\tr.GetHTMLURL()\n\tr = nil\n\tr.GetHTMLURL()\n}\n\nfunc TestRepositoryRelease_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tr := &RepositoryRelease{ID: &zeroValue}\n\tr.GetID()\n\tr = &RepositoryRelease{}\n\tr.GetID()\n\tr = nil\n\tr.GetID()\n}\n\nfunc TestRepositoryRelease_GetImmutable(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &RepositoryRelease{Immutable: &zeroValue}\n\tr.GetImmutable()\n\tr = &RepositoryRelease{}\n\tr.GetImmutable()\n\tr = nil\n\tr.GetImmutable()\n}\n\nfunc TestRepositoryRelease_GetMakeLatest(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryRelease{MakeLatest: &zeroValue}\n\tr.GetMakeLatest()\n\tr = &RepositoryRelease{}\n\tr.GetMakeLatest()\n\tr = nil\n\tr.GetMakeLatest()\n}\n\nfunc TestRepositoryRelease_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryRelease{Name: &zeroValue}\n\tr.GetName()\n\tr = &RepositoryRelease{}\n\tr.GetName()\n\tr = nil\n\tr.GetName()\n}\n\nfunc TestRepositoryRelease_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryRelease{NodeID: &zeroValue}\n\tr.GetNodeID()\n\tr = &RepositoryRelease{}\n\tr.GetNodeID()\n\tr = nil\n\tr.GetNodeID()\n}\n\nfunc TestRepositoryRelease_GetPrerelease(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &RepositoryRelease{Prerelease: &zeroValue}\n\tr.GetPrerelease()\n\tr = &RepositoryRelease{}\n\tr.GetPrerelease()\n\tr = nil\n\tr.GetPrerelease()\n}\n\nfunc TestRepositoryRelease_GetPublishedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tr := &RepositoryRelease{PublishedAt: &zeroValue}\n\tr.GetPublishedAt()\n\tr = &RepositoryRelease{}\n\tr.GetPublishedAt()\n\tr = nil\n\tr.GetPublishedAt()\n}\n\nfunc TestRepositoryRelease_GetTagName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryRelease{TagName: &zeroValue}\n\tr.GetTagName()\n\tr = &RepositoryRelease{}\n\tr.GetTagName()\n\tr = nil\n\tr.GetTagName()\n}\n\nfunc TestRepositoryRelease_GetTarballURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryRelease{TarballURL: &zeroValue}\n\tr.GetTarballURL()\n\tr = &RepositoryRelease{}\n\tr.GetTarballURL()\n\tr = nil\n\tr.GetTarballURL()\n}\n\nfunc TestRepositoryRelease_GetTargetCommitish(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryRelease{TargetCommitish: &zeroValue}\n\tr.GetTargetCommitish()\n\tr = &RepositoryRelease{}\n\tr.GetTargetCommitish()\n\tr = nil\n\tr.GetTargetCommitish()\n}\n\nfunc TestRepositoryRelease_GetUploadURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryRelease{UploadURL: &zeroValue}\n\tr.GetUploadURL()\n\tr = &RepositoryRelease{}\n\tr.GetUploadURL()\n\tr = nil\n\tr.GetUploadURL()\n}\n\nfunc TestRepositoryRelease_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryRelease{URL: &zeroValue}\n\tr.GetURL()\n\tr = &RepositoryRelease{}\n\tr.GetURL()\n\tr = nil\n\tr.GetURL()\n}\n\nfunc TestRepositoryRelease_GetZipballURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryRelease{ZipballURL: &zeroValue}\n\tr.GetZipballURL()\n\tr = &RepositoryRelease{}\n\tr.GetZipballURL()\n\tr = nil\n\tr.GetZipballURL()\n}\n\nfunc TestRepositoryReleaseNotes_GetBody(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryReleaseNotes{}\n\tr.GetBody()\n\tr = nil\n\tr.GetBody()\n}\n\nfunc TestRepositoryReleaseNotes_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryReleaseNotes{}\n\tr.GetName()\n\tr = nil\n\tr.GetName()\n}\n\nfunc TestRepositoryRule_GetParameters(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRule{}\n\tr.GetParameters()\n\tr = nil\n\tr.GetParameters()\n}\n\nfunc TestRepositoryRule_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRule{}\n\tr.GetType()\n\tr = nil\n\tr.GetType()\n}\n\nfunc TestRepositoryRuleset_GetBypassActors(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*BypassActor{}\n\tr := &RepositoryRuleset{BypassActors: zeroValue}\n\tr.GetBypassActors()\n\tr = &RepositoryRuleset{}\n\tr.GetBypassActors()\n\tr = nil\n\tr.GetBypassActors()\n}\n\nfunc TestRepositoryRuleset_GetConditions(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRuleset{}\n\tr.GetConditions()\n\tr = nil\n\tr.GetConditions()\n}\n\nfunc TestRepositoryRuleset_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tr := &RepositoryRuleset{CreatedAt: &zeroValue}\n\tr.GetCreatedAt()\n\tr = &RepositoryRuleset{}\n\tr.GetCreatedAt()\n\tr = nil\n\tr.GetCreatedAt()\n}\n\nfunc TestRepositoryRuleset_GetCurrentUserCanBypass(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRuleset{}\n\tr.GetCurrentUserCanBypass()\n\tr = nil\n\tr.GetCurrentUserCanBypass()\n}\n\nfunc TestRepositoryRuleset_GetEnforcement(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRuleset{}\n\tr.GetEnforcement()\n\tr = nil\n\tr.GetEnforcement()\n}\n\nfunc TestRepositoryRuleset_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tr := &RepositoryRuleset{ID: &zeroValue}\n\tr.GetID()\n\tr = &RepositoryRuleset{}\n\tr.GetID()\n\tr = nil\n\tr.GetID()\n}\n\nfunc TestRepositoryRuleset_GetLinks(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRuleset{}\n\tr.GetLinks()\n\tr = nil\n\tr.GetLinks()\n}\n\nfunc TestRepositoryRuleset_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRuleset{}\n\tr.GetName()\n\tr = nil\n\tr.GetName()\n}\n\nfunc TestRepositoryRuleset_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryRuleset{NodeID: &zeroValue}\n\tr.GetNodeID()\n\tr = &RepositoryRuleset{}\n\tr.GetNodeID()\n\tr = nil\n\tr.GetNodeID()\n}\n\nfunc TestRepositoryRuleset_GetRules(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRuleset{}\n\tr.GetRules()\n\tr = nil\n\tr.GetRules()\n}\n\nfunc TestRepositoryRuleset_GetSource(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRuleset{}\n\tr.GetSource()\n\tr = nil\n\tr.GetSource()\n}\n\nfunc TestRepositoryRuleset_GetSourceType(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRuleset{}\n\tr.GetSourceType()\n\tr = nil\n\tr.GetSourceType()\n}\n\nfunc TestRepositoryRuleset_GetTarget(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRuleset{}\n\tr.GetTarget()\n\tr = nil\n\tr.GetTarget()\n}\n\nfunc TestRepositoryRuleset_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tr := &RepositoryRuleset{UpdatedAt: &zeroValue}\n\tr.GetUpdatedAt()\n\tr = &RepositoryRuleset{}\n\tr.GetUpdatedAt()\n\tr = nil\n\tr.GetUpdatedAt()\n}\n\nfunc TestRepositoryRulesetChangedConditions_GetAdded(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*RepositoryRulesetConditions{}\n\tr := &RepositoryRulesetChangedConditions{Added: zeroValue}\n\tr.GetAdded()\n\tr = &RepositoryRulesetChangedConditions{}\n\tr.GetAdded()\n\tr = nil\n\tr.GetAdded()\n}\n\nfunc TestRepositoryRulesetChangedConditions_GetDeleted(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*RepositoryRulesetConditions{}\n\tr := &RepositoryRulesetChangedConditions{Deleted: zeroValue}\n\tr.GetDeleted()\n\tr = &RepositoryRulesetChangedConditions{}\n\tr.GetDeleted()\n\tr = nil\n\tr.GetDeleted()\n}\n\nfunc TestRepositoryRulesetChangedConditions_GetUpdated(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*RepositoryRulesetUpdatedConditions{}\n\tr := &RepositoryRulesetChangedConditions{Updated: zeroValue}\n\tr.GetUpdated()\n\tr = &RepositoryRulesetChangedConditions{}\n\tr.GetUpdated()\n\tr = nil\n\tr.GetUpdated()\n}\n\nfunc TestRepositoryRulesetChangedRule_GetConfiguration(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetChangedRule{}\n\tr.GetConfiguration()\n\tr = nil\n\tr.GetConfiguration()\n}\n\nfunc TestRepositoryRulesetChangedRule_GetPattern(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetChangedRule{}\n\tr.GetPattern()\n\tr = nil\n\tr.GetPattern()\n}\n\nfunc TestRepositoryRulesetChangedRule_GetRuleType(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetChangedRule{}\n\tr.GetRuleType()\n\tr = nil\n\tr.GetRuleType()\n}\n\nfunc TestRepositoryRulesetChangedRules_GetAdded(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*RepositoryRule{}\n\tr := &RepositoryRulesetChangedRules{Added: zeroValue}\n\tr.GetAdded()\n\tr = &RepositoryRulesetChangedRules{}\n\tr.GetAdded()\n\tr = nil\n\tr.GetAdded()\n}\n\nfunc TestRepositoryRulesetChangedRules_GetDeleted(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*RepositoryRule{}\n\tr := &RepositoryRulesetChangedRules{Deleted: zeroValue}\n\tr.GetDeleted()\n\tr = &RepositoryRulesetChangedRules{}\n\tr.GetDeleted()\n\tr = nil\n\tr.GetDeleted()\n}\n\nfunc TestRepositoryRulesetChangedRules_GetUpdated(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*RepositoryRulesetUpdatedRules{}\n\tr := &RepositoryRulesetChangedRules{Updated: zeroValue}\n\tr.GetUpdated()\n\tr = &RepositoryRulesetChangedRules{}\n\tr.GetUpdated()\n\tr = nil\n\tr.GetUpdated()\n}\n\nfunc TestRepositoryRulesetChanges_GetConditions(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetChanges{}\n\tr.GetConditions()\n\tr = nil\n\tr.GetConditions()\n}\n\nfunc TestRepositoryRulesetChanges_GetEnforcement(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetChanges{}\n\tr.GetEnforcement()\n\tr = nil\n\tr.GetEnforcement()\n}\n\nfunc TestRepositoryRulesetChanges_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetChanges{}\n\tr.GetName()\n\tr = nil\n\tr.GetName()\n}\n\nfunc TestRepositoryRulesetChanges_GetRules(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetChanges{}\n\tr.GetRules()\n\tr = nil\n\tr.GetRules()\n}\n\nfunc TestRepositoryRulesetChangeSource_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryRulesetChangeSource{From: &zeroValue}\n\tr.GetFrom()\n\tr = &RepositoryRulesetChangeSource{}\n\tr.GetFrom()\n\tr = nil\n\tr.GetFrom()\n}\n\nfunc TestRepositoryRulesetChangeSources_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tr := &RepositoryRulesetChangeSources{From: zeroValue}\n\tr.GetFrom()\n\tr = &RepositoryRulesetChangeSources{}\n\tr.GetFrom()\n\tr = nil\n\tr.GetFrom()\n}\n\nfunc TestRepositoryRulesetConditions_GetOrganizationID(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetConditions{}\n\tr.GetOrganizationID()\n\tr = nil\n\tr.GetOrganizationID()\n}\n\nfunc TestRepositoryRulesetConditions_GetOrganizationName(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetConditions{}\n\tr.GetOrganizationName()\n\tr = nil\n\tr.GetOrganizationName()\n}\n\nfunc TestRepositoryRulesetConditions_GetOrganizationProperty(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetConditions{}\n\tr.GetOrganizationProperty()\n\tr = nil\n\tr.GetOrganizationProperty()\n}\n\nfunc TestRepositoryRulesetConditions_GetRefName(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetConditions{}\n\tr.GetRefName()\n\tr = nil\n\tr.GetRefName()\n}\n\nfunc TestRepositoryRulesetConditions_GetRepositoryID(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetConditions{}\n\tr.GetRepositoryID()\n\tr = nil\n\tr.GetRepositoryID()\n}\n\nfunc TestRepositoryRulesetConditions_GetRepositoryName(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetConditions{}\n\tr.GetRepositoryName()\n\tr = nil\n\tr.GetRepositoryName()\n}\n\nfunc TestRepositoryRulesetConditions_GetRepositoryProperty(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetConditions{}\n\tr.GetRepositoryProperty()\n\tr = nil\n\tr.GetRepositoryProperty()\n}\n\nfunc TestRepositoryRulesetEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryRulesetEvent{Action: &zeroValue}\n\tr.GetAction()\n\tr = &RepositoryRulesetEvent{}\n\tr.GetAction()\n\tr = nil\n\tr.GetAction()\n}\n\nfunc TestRepositoryRulesetEvent_GetChanges(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetEvent{}\n\tr.GetChanges()\n\tr = nil\n\tr.GetChanges()\n}\n\nfunc TestRepositoryRulesetEvent_GetEnterprise(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetEvent{}\n\tr.GetEnterprise()\n\tr = nil\n\tr.GetEnterprise()\n}\n\nfunc TestRepositoryRulesetEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetEvent{}\n\tr.GetInstallation()\n\tr = nil\n\tr.GetInstallation()\n}\n\nfunc TestRepositoryRulesetEvent_GetOrganization(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetEvent{}\n\tr.GetOrganization()\n\tr = nil\n\tr.GetOrganization()\n}\n\nfunc TestRepositoryRulesetEvent_GetRepository(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetEvent{}\n\tr.GetRepository()\n\tr = nil\n\tr.GetRepository()\n}\n\nfunc TestRepositoryRulesetEvent_GetRepositoryRuleset(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetEvent{}\n\tr.GetRepositoryRuleset()\n\tr = nil\n\tr.GetRepositoryRuleset()\n}\n\nfunc TestRepositoryRulesetEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetEvent{}\n\tr.GetSender()\n\tr = nil\n\tr.GetSender()\n}\n\nfunc TestRepositoryRulesetLink_GetHRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryRulesetLink{HRef: &zeroValue}\n\tr.GetHRef()\n\tr = &RepositoryRulesetLink{}\n\tr.GetHRef()\n\tr = nil\n\tr.GetHRef()\n}\n\nfunc TestRepositoryRulesetLinks_GetHTML(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetLinks{}\n\tr.GetHTML()\n\tr = nil\n\tr.GetHTML()\n}\n\nfunc TestRepositoryRulesetLinks_GetSelf(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetLinks{}\n\tr.GetSelf()\n\tr = nil\n\tr.GetSelf()\n}\n\nfunc TestRepositoryRulesetOrganizationIDsConditionParameters_GetOrganizationIDs(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []int64{}\n\tr := &RepositoryRulesetOrganizationIDsConditionParameters{OrganizationIDs: zeroValue}\n\tr.GetOrganizationIDs()\n\tr = &RepositoryRulesetOrganizationIDsConditionParameters{}\n\tr.GetOrganizationIDs()\n\tr = nil\n\tr.GetOrganizationIDs()\n}\n\nfunc TestRepositoryRulesetOrganizationNamesConditionParameters_GetExclude(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tr := &RepositoryRulesetOrganizationNamesConditionParameters{Exclude: zeroValue}\n\tr.GetExclude()\n\tr = &RepositoryRulesetOrganizationNamesConditionParameters{}\n\tr.GetExclude()\n\tr = nil\n\tr.GetExclude()\n}\n\nfunc TestRepositoryRulesetOrganizationNamesConditionParameters_GetInclude(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tr := &RepositoryRulesetOrganizationNamesConditionParameters{Include: zeroValue}\n\tr.GetInclude()\n\tr = &RepositoryRulesetOrganizationNamesConditionParameters{}\n\tr.GetInclude()\n\tr = nil\n\tr.GetInclude()\n}\n\nfunc TestRepositoryRulesetOrganizationPropertyConditionParameters_GetExclude(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*RepositoryRulesetRepositoryPropertyTargetParameters{}\n\tr := &RepositoryRulesetOrganizationPropertyConditionParameters{Exclude: zeroValue}\n\tr.GetExclude()\n\tr = &RepositoryRulesetOrganizationPropertyConditionParameters{}\n\tr.GetExclude()\n\tr = nil\n\tr.GetExclude()\n}\n\nfunc TestRepositoryRulesetOrganizationPropertyConditionParameters_GetInclude(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*RepositoryRulesetRepositoryPropertyTargetParameters{}\n\tr := &RepositoryRulesetOrganizationPropertyConditionParameters{Include: zeroValue}\n\tr.GetInclude()\n\tr = &RepositoryRulesetOrganizationPropertyConditionParameters{}\n\tr.GetInclude()\n\tr = nil\n\tr.GetInclude()\n}\n\nfunc TestRepositoryRulesetRefConditionParameters_GetExclude(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tr := &RepositoryRulesetRefConditionParameters{Exclude: zeroValue}\n\tr.GetExclude()\n\tr = &RepositoryRulesetRefConditionParameters{}\n\tr.GetExclude()\n\tr = nil\n\tr.GetExclude()\n}\n\nfunc TestRepositoryRulesetRefConditionParameters_GetInclude(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tr := &RepositoryRulesetRefConditionParameters{Include: zeroValue}\n\tr.GetInclude()\n\tr = &RepositoryRulesetRefConditionParameters{}\n\tr.GetInclude()\n\tr = nil\n\tr.GetInclude()\n}\n\nfunc TestRepositoryRulesetRepositoryIDsConditionParameters_GetRepositoryIDs(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []int64{}\n\tr := &RepositoryRulesetRepositoryIDsConditionParameters{RepositoryIDs: zeroValue}\n\tr.GetRepositoryIDs()\n\tr = &RepositoryRulesetRepositoryIDsConditionParameters{}\n\tr.GetRepositoryIDs()\n\tr = nil\n\tr.GetRepositoryIDs()\n}\n\nfunc TestRepositoryRulesetRepositoryNamesConditionParameters_GetExclude(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tr := &RepositoryRulesetRepositoryNamesConditionParameters{Exclude: zeroValue}\n\tr.GetExclude()\n\tr = &RepositoryRulesetRepositoryNamesConditionParameters{}\n\tr.GetExclude()\n\tr = nil\n\tr.GetExclude()\n}\n\nfunc TestRepositoryRulesetRepositoryNamesConditionParameters_GetInclude(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tr := &RepositoryRulesetRepositoryNamesConditionParameters{Include: zeroValue}\n\tr.GetInclude()\n\tr = &RepositoryRulesetRepositoryNamesConditionParameters{}\n\tr.GetInclude()\n\tr = nil\n\tr.GetInclude()\n}\n\nfunc TestRepositoryRulesetRepositoryNamesConditionParameters_GetProtected(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &RepositoryRulesetRepositoryNamesConditionParameters{Protected: &zeroValue}\n\tr.GetProtected()\n\tr = &RepositoryRulesetRepositoryNamesConditionParameters{}\n\tr.GetProtected()\n\tr = nil\n\tr.GetProtected()\n}\n\nfunc TestRepositoryRulesetRepositoryPropertyConditionParameters_GetExclude(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*RepositoryRulesetRepositoryPropertyTargetParameters{}\n\tr := &RepositoryRulesetRepositoryPropertyConditionParameters{Exclude: zeroValue}\n\tr.GetExclude()\n\tr = &RepositoryRulesetRepositoryPropertyConditionParameters{}\n\tr.GetExclude()\n\tr = nil\n\tr.GetExclude()\n}\n\nfunc TestRepositoryRulesetRepositoryPropertyConditionParameters_GetInclude(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*RepositoryRulesetRepositoryPropertyTargetParameters{}\n\tr := &RepositoryRulesetRepositoryPropertyConditionParameters{Include: zeroValue}\n\tr.GetInclude()\n\tr = &RepositoryRulesetRepositoryPropertyConditionParameters{}\n\tr.GetInclude()\n\tr = nil\n\tr.GetInclude()\n}\n\nfunc TestRepositoryRulesetRepositoryPropertyTargetParameters_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetRepositoryPropertyTargetParameters{}\n\tr.GetName()\n\tr = nil\n\tr.GetName()\n}\n\nfunc TestRepositoryRulesetRepositoryPropertyTargetParameters_GetPropertyValues(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tr := &RepositoryRulesetRepositoryPropertyTargetParameters{PropertyValues: zeroValue}\n\tr.GetPropertyValues()\n\tr = &RepositoryRulesetRepositoryPropertyTargetParameters{}\n\tr.GetPropertyValues()\n\tr = nil\n\tr.GetPropertyValues()\n}\n\nfunc TestRepositoryRulesetRepositoryPropertyTargetParameters_GetSource(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryRulesetRepositoryPropertyTargetParameters{Source: &zeroValue}\n\tr.GetSource()\n\tr = &RepositoryRulesetRepositoryPropertyTargetParameters{}\n\tr.GetSource()\n\tr = nil\n\tr.GetSource()\n}\n\nfunc TestRepositoryRulesetRules_GetBranchNamePattern(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetRules{}\n\tr.GetBranchNamePattern()\n\tr = nil\n\tr.GetBranchNamePattern()\n}\n\nfunc TestRepositoryRulesetRules_GetCodeScanning(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetRules{}\n\tr.GetCodeScanning()\n\tr = nil\n\tr.GetCodeScanning()\n}\n\nfunc TestRepositoryRulesetRules_GetCommitAuthorEmailPattern(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetRules{}\n\tr.GetCommitAuthorEmailPattern()\n\tr = nil\n\tr.GetCommitAuthorEmailPattern()\n}\n\nfunc TestRepositoryRulesetRules_GetCommitMessagePattern(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetRules{}\n\tr.GetCommitMessagePattern()\n\tr = nil\n\tr.GetCommitMessagePattern()\n}\n\nfunc TestRepositoryRulesetRules_GetCommitterEmailPattern(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetRules{}\n\tr.GetCommitterEmailPattern()\n\tr = nil\n\tr.GetCommitterEmailPattern()\n}\n\nfunc TestRepositoryRulesetRules_GetCopilotCodeReview(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetRules{}\n\tr.GetCopilotCodeReview()\n\tr = nil\n\tr.GetCopilotCodeReview()\n}\n\nfunc TestRepositoryRulesetRules_GetCreation(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetRules{}\n\tr.GetCreation()\n\tr = nil\n\tr.GetCreation()\n}\n\nfunc TestRepositoryRulesetRules_GetDeletion(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetRules{}\n\tr.GetDeletion()\n\tr = nil\n\tr.GetDeletion()\n}\n\nfunc TestRepositoryRulesetRules_GetFileExtensionRestriction(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetRules{}\n\tr.GetFileExtensionRestriction()\n\tr = nil\n\tr.GetFileExtensionRestriction()\n}\n\nfunc TestRepositoryRulesetRules_GetFilePathRestriction(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetRules{}\n\tr.GetFilePathRestriction()\n\tr = nil\n\tr.GetFilePathRestriction()\n}\n\nfunc TestRepositoryRulesetRules_GetMaxFilePathLength(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetRules{}\n\tr.GetMaxFilePathLength()\n\tr = nil\n\tr.GetMaxFilePathLength()\n}\n\nfunc TestRepositoryRulesetRules_GetMaxFileSize(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetRules{}\n\tr.GetMaxFileSize()\n\tr = nil\n\tr.GetMaxFileSize()\n}\n\nfunc TestRepositoryRulesetRules_GetMergeQueue(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetRules{}\n\tr.GetMergeQueue()\n\tr = nil\n\tr.GetMergeQueue()\n}\n\nfunc TestRepositoryRulesetRules_GetNonFastForward(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetRules{}\n\tr.GetNonFastForward()\n\tr = nil\n\tr.GetNonFastForward()\n}\n\nfunc TestRepositoryRulesetRules_GetPullRequest(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetRules{}\n\tr.GetPullRequest()\n\tr = nil\n\tr.GetPullRequest()\n}\n\nfunc TestRepositoryRulesetRules_GetRepositoryCreate(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetRules{}\n\tr.GetRepositoryCreate()\n\tr = nil\n\tr.GetRepositoryCreate()\n}\n\nfunc TestRepositoryRulesetRules_GetRepositoryDelete(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetRules{}\n\tr.GetRepositoryDelete()\n\tr = nil\n\tr.GetRepositoryDelete()\n}\n\nfunc TestRepositoryRulesetRules_GetRepositoryName(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetRules{}\n\tr.GetRepositoryName()\n\tr = nil\n\tr.GetRepositoryName()\n}\n\nfunc TestRepositoryRulesetRules_GetRepositoryTransfer(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetRules{}\n\tr.GetRepositoryTransfer()\n\tr = nil\n\tr.GetRepositoryTransfer()\n}\n\nfunc TestRepositoryRulesetRules_GetRepositoryVisibility(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetRules{}\n\tr.GetRepositoryVisibility()\n\tr = nil\n\tr.GetRepositoryVisibility()\n}\n\nfunc TestRepositoryRulesetRules_GetRequiredDeployments(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetRules{}\n\tr.GetRequiredDeployments()\n\tr = nil\n\tr.GetRequiredDeployments()\n}\n\nfunc TestRepositoryRulesetRules_GetRequiredLinearHistory(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetRules{}\n\tr.GetRequiredLinearHistory()\n\tr = nil\n\tr.GetRequiredLinearHistory()\n}\n\nfunc TestRepositoryRulesetRules_GetRequiredSignatures(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetRules{}\n\tr.GetRequiredSignatures()\n\tr = nil\n\tr.GetRequiredSignatures()\n}\n\nfunc TestRepositoryRulesetRules_GetRequiredStatusChecks(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetRules{}\n\tr.GetRequiredStatusChecks()\n\tr = nil\n\tr.GetRequiredStatusChecks()\n}\n\nfunc TestRepositoryRulesetRules_GetTagNamePattern(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetRules{}\n\tr.GetTagNamePattern()\n\tr = nil\n\tr.GetTagNamePattern()\n}\n\nfunc TestRepositoryRulesetRules_GetUpdate(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetRules{}\n\tr.GetUpdate()\n\tr = nil\n\tr.GetUpdate()\n}\n\nfunc TestRepositoryRulesetRules_GetWorkflows(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetRules{}\n\tr.GetWorkflows()\n\tr = nil\n\tr.GetWorkflows()\n}\n\nfunc TestRepositoryRulesetUpdatedCondition_GetConditionType(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetUpdatedCondition{}\n\tr.GetConditionType()\n\tr = nil\n\tr.GetConditionType()\n}\n\nfunc TestRepositoryRulesetUpdatedCondition_GetExclude(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetUpdatedCondition{}\n\tr.GetExclude()\n\tr = nil\n\tr.GetExclude()\n}\n\nfunc TestRepositoryRulesetUpdatedCondition_GetInclude(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetUpdatedCondition{}\n\tr.GetInclude()\n\tr = nil\n\tr.GetInclude()\n}\n\nfunc TestRepositoryRulesetUpdatedCondition_GetTarget(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetUpdatedCondition{}\n\tr.GetTarget()\n\tr = nil\n\tr.GetTarget()\n}\n\nfunc TestRepositoryRulesetUpdatedConditions_GetChanges(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetUpdatedConditions{}\n\tr.GetChanges()\n\tr = nil\n\tr.GetChanges()\n}\n\nfunc TestRepositoryRulesetUpdatedConditions_GetCondition(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetUpdatedConditions{}\n\tr.GetCondition()\n\tr = nil\n\tr.GetCondition()\n}\n\nfunc TestRepositoryRulesetUpdatedRules_GetChanges(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetUpdatedRules{}\n\tr.GetChanges()\n\tr = nil\n\tr.GetChanges()\n}\n\nfunc TestRepositoryRulesetUpdatedRules_GetRule(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryRulesetUpdatedRules{}\n\tr.GetRule()\n\tr = nil\n\tr.GetRule()\n}\n\nfunc TestRepositoryTag_GetCommit(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryTag{}\n\tr.GetCommit()\n\tr = nil\n\tr.GetCommit()\n}\n\nfunc TestRepositoryTag_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryTag{Name: &zeroValue}\n\tr.GetName()\n\tr = &RepositoryTag{}\n\tr.GetName()\n\tr = nil\n\tr.GetName()\n}\n\nfunc TestRepositoryTag_GetTarballURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryTag{TarballURL: &zeroValue}\n\tr.GetTarballURL()\n\tr = &RepositoryTag{}\n\tr.GetTarballURL()\n\tr = nil\n\tr.GetTarballURL()\n}\n\nfunc TestRepositoryTag_GetZipballURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryTag{ZipballURL: &zeroValue}\n\tr.GetZipballURL()\n\tr = &RepositoryTag{}\n\tr.GetZipballURL()\n\tr = nil\n\tr.GetZipballURL()\n}\n\nfunc TestRepositoryVisibilityRuleParameters_GetInternal(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryVisibilityRuleParameters{}\n\tr.GetInternal()\n\tr = nil\n\tr.GetInternal()\n}\n\nfunc TestRepositoryVisibilityRuleParameters_GetPrivate(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryVisibilityRuleParameters{}\n\tr.GetPrivate()\n\tr = nil\n\tr.GetPrivate()\n}\n\nfunc TestRepositoryVulnerabilityAlert_GetAffectedPackageName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryVulnerabilityAlert{AffectedPackageName: &zeroValue}\n\tr.GetAffectedPackageName()\n\tr = &RepositoryVulnerabilityAlert{}\n\tr.GetAffectedPackageName()\n\tr = nil\n\tr.GetAffectedPackageName()\n}\n\nfunc TestRepositoryVulnerabilityAlert_GetAffectedRange(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryVulnerabilityAlert{AffectedRange: &zeroValue}\n\tr.GetAffectedRange()\n\tr = &RepositoryVulnerabilityAlert{}\n\tr.GetAffectedRange()\n\tr = nil\n\tr.GetAffectedRange()\n}\n\nfunc TestRepositoryVulnerabilityAlert_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tr := &RepositoryVulnerabilityAlert{CreatedAt: &zeroValue}\n\tr.GetCreatedAt()\n\tr = &RepositoryVulnerabilityAlert{}\n\tr.GetCreatedAt()\n\tr = nil\n\tr.GetCreatedAt()\n}\n\nfunc TestRepositoryVulnerabilityAlert_GetDismissedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tr := &RepositoryVulnerabilityAlert{DismissedAt: &zeroValue}\n\tr.GetDismissedAt()\n\tr = &RepositoryVulnerabilityAlert{}\n\tr.GetDismissedAt()\n\tr = nil\n\tr.GetDismissedAt()\n}\n\nfunc TestRepositoryVulnerabilityAlert_GetDismisser(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryVulnerabilityAlert{}\n\tr.GetDismisser()\n\tr = nil\n\tr.GetDismisser()\n}\n\nfunc TestRepositoryVulnerabilityAlert_GetDismissReason(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryVulnerabilityAlert{DismissReason: &zeroValue}\n\tr.GetDismissReason()\n\tr = &RepositoryVulnerabilityAlert{}\n\tr.GetDismissReason()\n\tr = nil\n\tr.GetDismissReason()\n}\n\nfunc TestRepositoryVulnerabilityAlert_GetExternalIdentifier(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryVulnerabilityAlert{ExternalIdentifier: &zeroValue}\n\tr.GetExternalIdentifier()\n\tr = &RepositoryVulnerabilityAlert{}\n\tr.GetExternalIdentifier()\n\tr = nil\n\tr.GetExternalIdentifier()\n}\n\nfunc TestRepositoryVulnerabilityAlert_GetExternalReference(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryVulnerabilityAlert{ExternalReference: &zeroValue}\n\tr.GetExternalReference()\n\tr = &RepositoryVulnerabilityAlert{}\n\tr.GetExternalReference()\n\tr = nil\n\tr.GetExternalReference()\n}\n\nfunc TestRepositoryVulnerabilityAlert_GetFixedIn(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryVulnerabilityAlert{FixedIn: &zeroValue}\n\tr.GetFixedIn()\n\tr = &RepositoryVulnerabilityAlert{}\n\tr.GetFixedIn()\n\tr = nil\n\tr.GetFixedIn()\n}\n\nfunc TestRepositoryVulnerabilityAlert_GetGitHubSecurityAdvisoryID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryVulnerabilityAlert{GitHubSecurityAdvisoryID: &zeroValue}\n\tr.GetGitHubSecurityAdvisoryID()\n\tr = &RepositoryVulnerabilityAlert{}\n\tr.GetGitHubSecurityAdvisoryID()\n\tr = nil\n\tr.GetGitHubSecurityAdvisoryID()\n}\n\nfunc TestRepositoryVulnerabilityAlert_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tr := &RepositoryVulnerabilityAlert{ID: &zeroValue}\n\tr.GetID()\n\tr = &RepositoryVulnerabilityAlert{}\n\tr.GetID()\n\tr = nil\n\tr.GetID()\n}\n\nfunc TestRepositoryVulnerabilityAlert_GetSeverity(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryVulnerabilityAlert{Severity: &zeroValue}\n\tr.GetSeverity()\n\tr = &RepositoryVulnerabilityAlert{}\n\tr.GetSeverity()\n\tr = nil\n\tr.GetSeverity()\n}\n\nfunc TestRepositoryVulnerabilityAlertEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepositoryVulnerabilityAlertEvent{Action: &zeroValue}\n\tr.GetAction()\n\tr = &RepositoryVulnerabilityAlertEvent{}\n\tr.GetAction()\n\tr = nil\n\tr.GetAction()\n}\n\nfunc TestRepositoryVulnerabilityAlertEvent_GetAlert(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryVulnerabilityAlertEvent{}\n\tr.GetAlert()\n\tr = nil\n\tr.GetAlert()\n}\n\nfunc TestRepositoryVulnerabilityAlertEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryVulnerabilityAlertEvent{}\n\tr.GetInstallation()\n\tr = nil\n\tr.GetInstallation()\n}\n\nfunc TestRepositoryVulnerabilityAlertEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryVulnerabilityAlertEvent{}\n\tr.GetOrg()\n\tr = nil\n\tr.GetOrg()\n}\n\nfunc TestRepositoryVulnerabilityAlertEvent_GetRepository(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryVulnerabilityAlertEvent{}\n\tr.GetRepository()\n\tr = nil\n\tr.GetRepository()\n}\n\nfunc TestRepositoryVulnerabilityAlertEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepositoryVulnerabilityAlertEvent{}\n\tr.GetSender()\n\tr = nil\n\tr.GetSender()\n}\n\nfunc TestRepoStats_GetForkRepos(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &RepoStats{ForkRepos: &zeroValue}\n\tr.GetForkRepos()\n\tr = &RepoStats{}\n\tr.GetForkRepos()\n\tr = nil\n\tr.GetForkRepos()\n}\n\nfunc TestRepoStats_GetOrgRepos(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &RepoStats{OrgRepos: &zeroValue}\n\tr.GetOrgRepos()\n\tr = &RepoStats{}\n\tr.GetOrgRepos()\n\tr = nil\n\tr.GetOrgRepos()\n}\n\nfunc TestRepoStats_GetRootRepos(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &RepoStats{RootRepos: &zeroValue}\n\tr.GetRootRepos()\n\tr = &RepoStats{}\n\tr.GetRootRepos()\n\tr = nil\n\tr.GetRootRepos()\n}\n\nfunc TestRepoStats_GetTotalPushes(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &RepoStats{TotalPushes: &zeroValue}\n\tr.GetTotalPushes()\n\tr = &RepoStats{}\n\tr.GetTotalPushes()\n\tr = nil\n\tr.GetTotalPushes()\n}\n\nfunc TestRepoStats_GetTotalRepos(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &RepoStats{TotalRepos: &zeroValue}\n\tr.GetTotalRepos()\n\tr = &RepoStats{}\n\tr.GetTotalRepos()\n\tr = nil\n\tr.GetTotalRepos()\n}\n\nfunc TestRepoStats_GetTotalWikis(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &RepoStats{TotalWikis: &zeroValue}\n\tr.GetTotalWikis()\n\tr = &RepoStats{}\n\tr.GetTotalWikis()\n\tr = nil\n\tr.GetTotalWikis()\n}\n\nfunc TestRepoStatus_GetAvatarURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepoStatus{AvatarURL: &zeroValue}\n\tr.GetAvatarURL()\n\tr = &RepoStatus{}\n\tr.GetAvatarURL()\n\tr = nil\n\tr.GetAvatarURL()\n}\n\nfunc TestRepoStatus_GetContext(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepoStatus{Context: &zeroValue}\n\tr.GetContext()\n\tr = &RepoStatus{}\n\tr.GetContext()\n\tr = nil\n\tr.GetContext()\n}\n\nfunc TestRepoStatus_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tr := &RepoStatus{CreatedAt: &zeroValue}\n\tr.GetCreatedAt()\n\tr = &RepoStatus{}\n\tr.GetCreatedAt()\n\tr = nil\n\tr.GetCreatedAt()\n}\n\nfunc TestRepoStatus_GetCreator(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RepoStatus{}\n\tr.GetCreator()\n\tr = nil\n\tr.GetCreator()\n}\n\nfunc TestRepoStatus_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepoStatus{Description: &zeroValue}\n\tr.GetDescription()\n\tr = &RepoStatus{}\n\tr.GetDescription()\n\tr = nil\n\tr.GetDescription()\n}\n\nfunc TestRepoStatus_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tr := &RepoStatus{ID: &zeroValue}\n\tr.GetID()\n\tr = &RepoStatus{}\n\tr.GetID()\n\tr = nil\n\tr.GetID()\n}\n\nfunc TestRepoStatus_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepoStatus{NodeID: &zeroValue}\n\tr.GetNodeID()\n\tr = &RepoStatus{}\n\tr.GetNodeID()\n\tr = nil\n\tr.GetNodeID()\n}\n\nfunc TestRepoStatus_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepoStatus{State: &zeroValue}\n\tr.GetState()\n\tr = &RepoStatus{}\n\tr.GetState()\n\tr = nil\n\tr.GetState()\n}\n\nfunc TestRepoStatus_GetTargetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepoStatus{TargetURL: &zeroValue}\n\tr.GetTargetURL()\n\tr = &RepoStatus{}\n\tr.GetTargetURL()\n\tr = nil\n\tr.GetTargetURL()\n}\n\nfunc TestRepoStatus_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tr := &RepoStatus{UpdatedAt: &zeroValue}\n\tr.GetUpdatedAt()\n\tr = &RepoStatus{}\n\tr.GetUpdatedAt()\n\tr = nil\n\tr.GetUpdatedAt()\n}\n\nfunc TestRepoStatus_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RepoStatus{URL: &zeroValue}\n\tr.GetURL()\n\tr = &RepoStatus{}\n\tr.GetURL()\n\tr = nil\n\tr.GetURL()\n}\n\nfunc TestRequestedAction_GetIdentifier(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RequestedAction{}\n\tr.GetIdentifier()\n\tr = nil\n\tr.GetIdentifier()\n}\n\nfunc TestRequireCodeOwnerReviewChanges_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &RequireCodeOwnerReviewChanges{From: &zeroValue}\n\tr.GetFrom()\n\tr = &RequireCodeOwnerReviewChanges{}\n\tr.GetFrom()\n\tr = nil\n\tr.GetFrom()\n}\n\nfunc TestRequiredConversationResolution_GetEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RequiredConversationResolution{}\n\tr.GetEnabled()\n\tr = nil\n\tr.GetEnabled()\n}\n\nfunc TestRequiredConversationResolutionLevelChanges_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RequiredConversationResolutionLevelChanges{From: &zeroValue}\n\tr.GetFrom()\n\tr = &RequiredConversationResolutionLevelChanges{}\n\tr.GetFrom()\n\tr = nil\n\tr.GetFrom()\n}\n\nfunc TestRequiredDeploymentsBranchRule_GetParameters(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RequiredDeploymentsBranchRule{}\n\tr.GetParameters()\n\tr = nil\n\tr.GetParameters()\n}\n\nfunc TestRequiredDeploymentsEnforcementLevelChanges_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RequiredDeploymentsEnforcementLevelChanges{From: &zeroValue}\n\tr.GetFrom()\n\tr = &RequiredDeploymentsEnforcementLevelChanges{}\n\tr.GetFrom()\n\tr = nil\n\tr.GetFrom()\n}\n\nfunc TestRequiredDeploymentsRuleParameters_GetRequiredDeploymentEnvironments(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tr := &RequiredDeploymentsRuleParameters{RequiredDeploymentEnvironments: zeroValue}\n\tr.GetRequiredDeploymentEnvironments()\n\tr = &RequiredDeploymentsRuleParameters{}\n\tr.GetRequiredDeploymentEnvironments()\n\tr = nil\n\tr.GetRequiredDeploymentEnvironments()\n}\n\nfunc TestRequiredReviewer_GetReviewer(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RequiredReviewer{}\n\tr.GetReviewer()\n\tr = nil\n\tr.GetReviewer()\n}\n\nfunc TestRequiredReviewer_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RequiredReviewer{Type: &zeroValue}\n\tr.GetType()\n\tr = &RequiredReviewer{}\n\tr.GetType()\n\tr = nil\n\tr.GetType()\n}\n\nfunc TestRequiredStatusCheck_GetAppID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tr := &RequiredStatusCheck{AppID: &zeroValue}\n\tr.GetAppID()\n\tr = &RequiredStatusCheck{}\n\tr.GetAppID()\n\tr = nil\n\tr.GetAppID()\n}\n\nfunc TestRequiredStatusCheck_GetContext(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RequiredStatusCheck{}\n\tr.GetContext()\n\tr = nil\n\tr.GetContext()\n}\n\nfunc TestRequiredStatusChecks_GetChecks(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue []*RequiredStatusCheck\n\tr := &RequiredStatusChecks{Checks: &zeroValue}\n\tr.GetChecks()\n\tr = &RequiredStatusChecks{}\n\tr.GetChecks()\n\tr = nil\n\tr.GetChecks()\n}\n\nfunc TestRequiredStatusChecks_GetContexts(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue []string\n\tr := &RequiredStatusChecks{Contexts: &zeroValue}\n\tr.GetContexts()\n\tr = &RequiredStatusChecks{}\n\tr.GetContexts()\n\tr = nil\n\tr.GetContexts()\n}\n\nfunc TestRequiredStatusChecks_GetContextsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RequiredStatusChecks{ContextsURL: &zeroValue}\n\tr.GetContextsURL()\n\tr = &RequiredStatusChecks{}\n\tr.GetContextsURL()\n\tr = nil\n\tr.GetContextsURL()\n}\n\nfunc TestRequiredStatusChecks_GetStrict(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RequiredStatusChecks{}\n\tr.GetStrict()\n\tr = nil\n\tr.GetStrict()\n}\n\nfunc TestRequiredStatusChecks_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RequiredStatusChecks{URL: &zeroValue}\n\tr.GetURL()\n\tr = &RequiredStatusChecks{}\n\tr.GetURL()\n\tr = nil\n\tr.GetURL()\n}\n\nfunc TestRequiredStatusChecksBranchRule_GetParameters(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RequiredStatusChecksBranchRule{}\n\tr.GetParameters()\n\tr = nil\n\tr.GetParameters()\n}\n\nfunc TestRequiredStatusChecksChanges_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tr := &RequiredStatusChecksChanges{From: zeroValue}\n\tr.GetFrom()\n\tr = &RequiredStatusChecksChanges{}\n\tr.GetFrom()\n\tr = nil\n\tr.GetFrom()\n}\n\nfunc TestRequiredStatusChecksEnforcementLevelChanges_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RequiredStatusChecksEnforcementLevelChanges{From: &zeroValue}\n\tr.GetFrom()\n\tr = &RequiredStatusChecksEnforcementLevelChanges{}\n\tr.GetFrom()\n\tr = nil\n\tr.GetFrom()\n}\n\nfunc TestRequiredStatusChecksRequest_GetChecks(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*RequiredStatusCheck{}\n\tr := &RequiredStatusChecksRequest{Checks: zeroValue}\n\tr.GetChecks()\n\tr = &RequiredStatusChecksRequest{}\n\tr.GetChecks()\n\tr = nil\n\tr.GetChecks()\n}\n\nfunc TestRequiredStatusChecksRequest_GetContexts(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tr := &RequiredStatusChecksRequest{Contexts: zeroValue}\n\tr.GetContexts()\n\tr = &RequiredStatusChecksRequest{}\n\tr.GetContexts()\n\tr = nil\n\tr.GetContexts()\n}\n\nfunc TestRequiredStatusChecksRequest_GetStrict(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &RequiredStatusChecksRequest{Strict: &zeroValue}\n\tr.GetStrict()\n\tr = &RequiredStatusChecksRequest{}\n\tr.GetStrict()\n\tr = nil\n\tr.GetStrict()\n}\n\nfunc TestRequiredStatusChecksRuleParameters_GetDoNotEnforceOnCreate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &RequiredStatusChecksRuleParameters{DoNotEnforceOnCreate: &zeroValue}\n\tr.GetDoNotEnforceOnCreate()\n\tr = &RequiredStatusChecksRuleParameters{}\n\tr.GetDoNotEnforceOnCreate()\n\tr = nil\n\tr.GetDoNotEnforceOnCreate()\n}\n\nfunc TestRequiredStatusChecksRuleParameters_GetRequiredStatusChecks(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*RuleStatusCheck{}\n\tr := &RequiredStatusChecksRuleParameters{RequiredStatusChecks: zeroValue}\n\tr.GetRequiredStatusChecks()\n\tr = &RequiredStatusChecksRuleParameters{}\n\tr.GetRequiredStatusChecks()\n\tr = nil\n\tr.GetRequiredStatusChecks()\n}\n\nfunc TestRequiredStatusChecksRuleParameters_GetStrictRequiredStatusChecksPolicy(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RequiredStatusChecksRuleParameters{}\n\tr.GetStrictRequiredStatusChecksPolicy()\n\tr = nil\n\tr.GetStrictRequiredStatusChecksPolicy()\n}\n\nfunc TestRequireLastPushApprovalChanges_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &RequireLastPushApprovalChanges{From: &zeroValue}\n\tr.GetFrom()\n\tr = &RequireLastPushApprovalChanges{}\n\tr.GetFrom()\n\tr = nil\n\tr.GetFrom()\n}\n\nfunc TestRequireLinearHistory_GetEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RequireLinearHistory{}\n\tr.GetEnabled()\n\tr = nil\n\tr.GetEnabled()\n}\n\nfunc TestResponse_GetAfter(tt *testing.T) {\n\ttt.Parallel()\n\tr := &Response{}\n\tr.GetAfter()\n\tr = nil\n\tr.GetAfter()\n}\n\nfunc TestResponse_GetBefore(tt *testing.T) {\n\ttt.Parallel()\n\tr := &Response{}\n\tr.GetBefore()\n\tr = nil\n\tr.GetBefore()\n}\n\nfunc TestResponse_GetCursor(tt *testing.T) {\n\ttt.Parallel()\n\tr := &Response{}\n\tr.GetCursor()\n\tr = nil\n\tr.GetCursor()\n}\n\nfunc TestResponse_GetFirstPage(tt *testing.T) {\n\ttt.Parallel()\n\tr := &Response{}\n\tr.GetFirstPage()\n\tr = nil\n\tr.GetFirstPage()\n}\n\nfunc TestResponse_GetLastPage(tt *testing.T) {\n\ttt.Parallel()\n\tr := &Response{}\n\tr.GetLastPage()\n\tr = nil\n\tr.GetLastPage()\n}\n\nfunc TestResponse_GetNextPage(tt *testing.T) {\n\ttt.Parallel()\n\tr := &Response{}\n\tr.GetNextPage()\n\tr = nil\n\tr.GetNextPage()\n}\n\nfunc TestResponse_GetNextPageToken(tt *testing.T) {\n\ttt.Parallel()\n\tr := &Response{}\n\tr.GetNextPageToken()\n\tr = nil\n\tr.GetNextPageToken()\n}\n\nfunc TestResponse_GetPrevPage(tt *testing.T) {\n\ttt.Parallel()\n\tr := &Response{}\n\tr.GetPrevPage()\n\tr = nil\n\tr.GetPrevPage()\n}\n\nfunc TestResponse_GetRate(tt *testing.T) {\n\ttt.Parallel()\n\tr := &Response{}\n\tr.GetRate()\n\tr = nil\n\tr.GetRate()\n}\n\nfunc TestResponse_GetTokenExpiration(tt *testing.T) {\n\ttt.Parallel()\n\tr := &Response{}\n\tr.GetTokenExpiration()\n\tr = nil\n\tr.GetTokenExpiration()\n}\n\nfunc TestReviewCustomDeploymentProtectionRuleRequest_GetComment(tt *testing.T) {\n\ttt.Parallel()\n\tr := &ReviewCustomDeploymentProtectionRuleRequest{}\n\tr.GetComment()\n\tr = nil\n\tr.GetComment()\n}\n\nfunc TestReviewCustomDeploymentProtectionRuleRequest_GetEnvironmentName(tt *testing.T) {\n\ttt.Parallel()\n\tr := &ReviewCustomDeploymentProtectionRuleRequest{}\n\tr.GetEnvironmentName()\n\tr = nil\n\tr.GetEnvironmentName()\n}\n\nfunc TestReviewCustomDeploymentProtectionRuleRequest_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tr := &ReviewCustomDeploymentProtectionRuleRequest{}\n\tr.GetState()\n\tr = nil\n\tr.GetState()\n}\n\nfunc TestReviewers_GetTeams(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Team{}\n\tr := &Reviewers{Teams: zeroValue}\n\tr.GetTeams()\n\tr = &Reviewers{}\n\tr.GetTeams()\n\tr = nil\n\tr.GetTeams()\n}\n\nfunc TestReviewers_GetUsers(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*User{}\n\tr := &Reviewers{Users: zeroValue}\n\tr.GetUsers()\n\tr = &Reviewers{}\n\tr.GetUsers()\n\tr = nil\n\tr.GetUsers()\n}\n\nfunc TestReviewersRequest_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &ReviewersRequest{NodeID: &zeroValue}\n\tr.GetNodeID()\n\tr = &ReviewersRequest{}\n\tr.GetNodeID()\n\tr = nil\n\tr.GetNodeID()\n}\n\nfunc TestReviewersRequest_GetReviewers(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tr := &ReviewersRequest{Reviewers: zeroValue}\n\tr.GetReviewers()\n\tr = &ReviewersRequest{}\n\tr.GetReviewers()\n\tr = nil\n\tr.GetReviewers()\n}\n\nfunc TestReviewersRequest_GetTeamReviewers(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tr := &ReviewersRequest{TeamReviewers: zeroValue}\n\tr.GetTeamReviewers()\n\tr = &ReviewersRequest{}\n\tr.GetTeamReviewers()\n\tr = nil\n\tr.GetTeamReviewers()\n}\n\nfunc TestReviewPersonalAccessTokenRequestOptions_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tr := &ReviewPersonalAccessTokenRequestOptions{}\n\tr.GetAction()\n\tr = nil\n\tr.GetAction()\n}\n\nfunc TestReviewPersonalAccessTokenRequestOptions_GetReason(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &ReviewPersonalAccessTokenRequestOptions{Reason: &zeroValue}\n\tr.GetReason()\n\tr = &ReviewPersonalAccessTokenRequestOptions{}\n\tr.GetReason()\n\tr = nil\n\tr.GetReason()\n}\n\nfunc TestRule_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Rule{Description: &zeroValue}\n\tr.GetDescription()\n\tr = &Rule{}\n\tr.GetDescription()\n\tr = nil\n\tr.GetDescription()\n}\n\nfunc TestRule_GetFullDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Rule{FullDescription: &zeroValue}\n\tr.GetFullDescription()\n\tr = &Rule{}\n\tr.GetFullDescription()\n\tr = nil\n\tr.GetFullDescription()\n}\n\nfunc TestRule_GetHelp(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Rule{Help: &zeroValue}\n\tr.GetHelp()\n\tr = &Rule{}\n\tr.GetHelp()\n\tr = nil\n\tr.GetHelp()\n}\n\nfunc TestRule_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Rule{ID: &zeroValue}\n\tr.GetID()\n\tr = &Rule{}\n\tr.GetID()\n\tr = nil\n\tr.GetID()\n}\n\nfunc TestRule_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Rule{Name: &zeroValue}\n\tr.GetName()\n\tr = &Rule{}\n\tr.GetName()\n\tr = nil\n\tr.GetName()\n}\n\nfunc TestRule_GetSecuritySeverityLevel(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Rule{SecuritySeverityLevel: &zeroValue}\n\tr.GetSecuritySeverityLevel()\n\tr = &Rule{}\n\tr.GetSecuritySeverityLevel()\n\tr = nil\n\tr.GetSecuritySeverityLevel()\n}\n\nfunc TestRule_GetSeverity(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Rule{Severity: &zeroValue}\n\tr.GetSeverity()\n\tr = &Rule{}\n\tr.GetSeverity()\n\tr = nil\n\tr.GetSeverity()\n}\n\nfunc TestRule_GetTags(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tr := &Rule{Tags: zeroValue}\n\tr.GetTags()\n\tr = &Rule{}\n\tr.GetTags()\n\tr = nil\n\tr.GetTags()\n}\n\nfunc TestRuleCodeScanningTool_GetAlertsThreshold(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RuleCodeScanningTool{}\n\tr.GetAlertsThreshold()\n\tr = nil\n\tr.GetAlertsThreshold()\n}\n\nfunc TestRuleCodeScanningTool_GetSecurityAlertsThreshold(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RuleCodeScanningTool{}\n\tr.GetSecurityAlertsThreshold()\n\tr = nil\n\tr.GetSecurityAlertsThreshold()\n}\n\nfunc TestRuleCodeScanningTool_GetTool(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RuleCodeScanningTool{}\n\tr.GetTool()\n\tr = nil\n\tr.GetTool()\n}\n\nfunc TestRulesetRequiredReviewer_GetFilePatterns(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tr := &RulesetRequiredReviewer{FilePatterns: zeroValue}\n\tr.GetFilePatterns()\n\tr = &RulesetRequiredReviewer{}\n\tr.GetFilePatterns()\n\tr = nil\n\tr.GetFilePatterns()\n}\n\nfunc TestRulesetRequiredReviewer_GetMinimumApprovals(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tr := &RulesetRequiredReviewer{MinimumApprovals: &zeroValue}\n\tr.GetMinimumApprovals()\n\tr = &RulesetRequiredReviewer{}\n\tr.GetMinimumApprovals()\n\tr = nil\n\tr.GetMinimumApprovals()\n}\n\nfunc TestRulesetRequiredReviewer_GetReviewer(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RulesetRequiredReviewer{}\n\tr.GetReviewer()\n\tr = nil\n\tr.GetReviewer()\n}\n\nfunc TestRulesetReviewer_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tr := &RulesetReviewer{ID: &zeroValue}\n\tr.GetID()\n\tr = &RulesetReviewer{}\n\tr.GetID()\n\tr = nil\n\tr.GetID()\n}\n\nfunc TestRulesetReviewer_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RulesetReviewer{}\n\tr.GetType()\n\tr = nil\n\tr.GetType()\n}\n\nfunc TestRuleStatusCheck_GetContext(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RuleStatusCheck{}\n\tr.GetContext()\n\tr = nil\n\tr.GetContext()\n}\n\nfunc TestRuleStatusCheck_GetIntegrationID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tr := &RuleStatusCheck{IntegrationID: &zeroValue}\n\tr.GetIntegrationID()\n\tr = &RuleStatusCheck{}\n\tr.GetIntegrationID()\n\tr = nil\n\tr.GetIntegrationID()\n}\n\nfunc TestRuleWorkflow_GetPath(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RuleWorkflow{}\n\tr.GetPath()\n\tr = nil\n\tr.GetPath()\n}\n\nfunc TestRuleWorkflow_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RuleWorkflow{Ref: &zeroValue}\n\tr.GetRef()\n\tr = &RuleWorkflow{}\n\tr.GetRef()\n\tr = nil\n\tr.GetRef()\n}\n\nfunc TestRuleWorkflow_GetRepositoryID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tr := &RuleWorkflow{RepositoryID: &zeroValue}\n\tr.GetRepositoryID()\n\tr = &RuleWorkflow{}\n\tr.GetRepositoryID()\n\tr = nil\n\tr.GetRepositoryID()\n}\n\nfunc TestRuleWorkflow_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RuleWorkflow{SHA: &zeroValue}\n\tr.GetSHA()\n\tr = &RuleWorkflow{}\n\tr.GetSHA()\n\tr = nil\n\tr.GetSHA()\n}\n\nfunc TestRunner_GetBusy(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &Runner{Busy: &zeroValue}\n\tr.GetBusy()\n\tr = &Runner{}\n\tr.GetBusy()\n\tr = nil\n\tr.GetBusy()\n}\n\nfunc TestRunner_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tr := &Runner{ID: &zeroValue}\n\tr.GetID()\n\tr = &Runner{}\n\tr.GetID()\n\tr = nil\n\tr.GetID()\n}\n\nfunc TestRunner_GetLabels(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*RunnerLabels{}\n\tr := &Runner{Labels: zeroValue}\n\tr.GetLabels()\n\tr = &Runner{}\n\tr.GetLabels()\n\tr = nil\n\tr.GetLabels()\n}\n\nfunc TestRunner_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Runner{Name: &zeroValue}\n\tr.GetName()\n\tr = &Runner{}\n\tr.GetName()\n\tr = nil\n\tr.GetName()\n}\n\nfunc TestRunner_GetOS(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Runner{OS: &zeroValue}\n\tr.GetOS()\n\tr = &Runner{}\n\tr.GetOS()\n\tr = nil\n\tr.GetOS()\n}\n\nfunc TestRunner_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &Runner{Status: &zeroValue}\n\tr.GetStatus()\n\tr = &Runner{}\n\tr.GetStatus()\n\tr = nil\n\tr.GetStatus()\n}\n\nfunc TestRunnerApplicationDownload_GetArchitecture(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RunnerApplicationDownload{Architecture: &zeroValue}\n\tr.GetArchitecture()\n\tr = &RunnerApplicationDownload{}\n\tr.GetArchitecture()\n\tr = nil\n\tr.GetArchitecture()\n}\n\nfunc TestRunnerApplicationDownload_GetDownloadURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RunnerApplicationDownload{DownloadURL: &zeroValue}\n\tr.GetDownloadURL()\n\tr = &RunnerApplicationDownload{}\n\tr.GetDownloadURL()\n\tr = nil\n\tr.GetDownloadURL()\n}\n\nfunc TestRunnerApplicationDownload_GetFilename(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RunnerApplicationDownload{Filename: &zeroValue}\n\tr.GetFilename()\n\tr = &RunnerApplicationDownload{}\n\tr.GetFilename()\n\tr = nil\n\tr.GetFilename()\n}\n\nfunc TestRunnerApplicationDownload_GetOS(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RunnerApplicationDownload{OS: &zeroValue}\n\tr.GetOS()\n\tr = &RunnerApplicationDownload{}\n\tr.GetOS()\n\tr = nil\n\tr.GetOS()\n}\n\nfunc TestRunnerApplicationDownload_GetSHA256Checksum(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RunnerApplicationDownload{SHA256Checksum: &zeroValue}\n\tr.GetSHA256Checksum()\n\tr = &RunnerApplicationDownload{}\n\tr.GetSHA256Checksum()\n\tr = nil\n\tr.GetSHA256Checksum()\n}\n\nfunc TestRunnerApplicationDownload_GetTempDownloadToken(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RunnerApplicationDownload{TempDownloadToken: &zeroValue}\n\tr.GetTempDownloadToken()\n\tr = &RunnerApplicationDownload{}\n\tr.GetTempDownloadToken()\n\tr = nil\n\tr.GetTempDownloadToken()\n}\n\nfunc TestRunnerGroup_GetAllowsPublicRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &RunnerGroup{AllowsPublicRepositories: &zeroValue}\n\tr.GetAllowsPublicRepositories()\n\tr = &RunnerGroup{}\n\tr.GetAllowsPublicRepositories()\n\tr = nil\n\tr.GetAllowsPublicRepositories()\n}\n\nfunc TestRunnerGroup_GetDefault(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &RunnerGroup{Default: &zeroValue}\n\tr.GetDefault()\n\tr = &RunnerGroup{}\n\tr.GetDefault()\n\tr = nil\n\tr.GetDefault()\n}\n\nfunc TestRunnerGroup_GetHostedRunnersURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RunnerGroup{HostedRunnersURL: &zeroValue}\n\tr.GetHostedRunnersURL()\n\tr = &RunnerGroup{}\n\tr.GetHostedRunnersURL()\n\tr = nil\n\tr.GetHostedRunnersURL()\n}\n\nfunc TestRunnerGroup_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tr := &RunnerGroup{ID: &zeroValue}\n\tr.GetID()\n\tr = &RunnerGroup{}\n\tr.GetID()\n\tr = nil\n\tr.GetID()\n}\n\nfunc TestRunnerGroup_GetInherited(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &RunnerGroup{Inherited: &zeroValue}\n\tr.GetInherited()\n\tr = &RunnerGroup{}\n\tr.GetInherited()\n\tr = nil\n\tr.GetInherited()\n}\n\nfunc TestRunnerGroup_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RunnerGroup{Name: &zeroValue}\n\tr.GetName()\n\tr = &RunnerGroup{}\n\tr.GetName()\n\tr = nil\n\tr.GetName()\n}\n\nfunc TestRunnerGroup_GetNetworkConfigurationID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RunnerGroup{NetworkConfigurationID: &zeroValue}\n\tr.GetNetworkConfigurationID()\n\tr = &RunnerGroup{}\n\tr.GetNetworkConfigurationID()\n\tr = nil\n\tr.GetNetworkConfigurationID()\n}\n\nfunc TestRunnerGroup_GetRestrictedToWorkflows(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &RunnerGroup{RestrictedToWorkflows: &zeroValue}\n\tr.GetRestrictedToWorkflows()\n\tr = &RunnerGroup{}\n\tr.GetRestrictedToWorkflows()\n\tr = nil\n\tr.GetRestrictedToWorkflows()\n}\n\nfunc TestRunnerGroup_GetRunnersURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RunnerGroup{RunnersURL: &zeroValue}\n\tr.GetRunnersURL()\n\tr = &RunnerGroup{}\n\tr.GetRunnersURL()\n\tr = nil\n\tr.GetRunnersURL()\n}\n\nfunc TestRunnerGroup_GetSelectedRepositoriesURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RunnerGroup{SelectedRepositoriesURL: &zeroValue}\n\tr.GetSelectedRepositoriesURL()\n\tr = &RunnerGroup{}\n\tr.GetSelectedRepositoriesURL()\n\tr = nil\n\tr.GetSelectedRepositoriesURL()\n}\n\nfunc TestRunnerGroup_GetSelectedWorkflows(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tr := &RunnerGroup{SelectedWorkflows: zeroValue}\n\tr.GetSelectedWorkflows()\n\tr = &RunnerGroup{}\n\tr.GetSelectedWorkflows()\n\tr = nil\n\tr.GetSelectedWorkflows()\n}\n\nfunc TestRunnerGroup_GetVisibility(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RunnerGroup{Visibility: &zeroValue}\n\tr.GetVisibility()\n\tr = &RunnerGroup{}\n\tr.GetVisibility()\n\tr = nil\n\tr.GetVisibility()\n}\n\nfunc TestRunnerGroup_GetWorkflowRestrictionsReadOnly(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tr := &RunnerGroup{WorkflowRestrictionsReadOnly: &zeroValue}\n\tr.GetWorkflowRestrictionsReadOnly()\n\tr = &RunnerGroup{}\n\tr.GetWorkflowRestrictionsReadOnly()\n\tr = nil\n\tr.GetWorkflowRestrictionsReadOnly()\n}\n\nfunc TestRunnerGroups_GetRunnerGroups(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*RunnerGroup{}\n\tr := &RunnerGroups{RunnerGroups: zeroValue}\n\tr.GetRunnerGroups()\n\tr = &RunnerGroups{}\n\tr.GetRunnerGroups()\n\tr = nil\n\tr.GetRunnerGroups()\n}\n\nfunc TestRunnerGroups_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\tr := &RunnerGroups{}\n\tr.GetTotalCount()\n\tr = nil\n\tr.GetTotalCount()\n}\n\nfunc TestRunnerLabels_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tr := &RunnerLabels{ID: &zeroValue}\n\tr.GetID()\n\tr = &RunnerLabels{}\n\tr.GetID()\n\tr = nil\n\tr.GetID()\n}\n\nfunc TestRunnerLabels_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RunnerLabels{Name: &zeroValue}\n\tr.GetName()\n\tr = &RunnerLabels{}\n\tr.GetName()\n\tr = nil\n\tr.GetName()\n}\n\nfunc TestRunnerLabels_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tr := &RunnerLabels{Type: &zeroValue}\n\tr.GetType()\n\tr = &RunnerLabels{}\n\tr.GetType()\n\tr = nil\n\tr.GetType()\n}\n\nfunc TestRunners_GetRunners(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Runner{}\n\tr := &Runners{Runners: zeroValue}\n\tr.GetRunners()\n\tr = &Runners{}\n\tr.GetRunners()\n\tr = nil\n\tr.GetRunners()\n}\n\nfunc TestRunners_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\tr := &Runners{}\n\tr.GetTotalCount()\n\tr = nil\n\tr.GetTotalCount()\n}\n\nfunc TestSarifAnalysis_GetCheckoutURI(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SarifAnalysis{CheckoutURI: &zeroValue}\n\ts.GetCheckoutURI()\n\ts = &SarifAnalysis{}\n\ts.GetCheckoutURI()\n\ts = nil\n\ts.GetCheckoutURI()\n}\n\nfunc TestSarifAnalysis_GetCommitSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SarifAnalysis{CommitSHA: &zeroValue}\n\ts.GetCommitSHA()\n\ts = &SarifAnalysis{}\n\ts.GetCommitSHA()\n\ts = nil\n\ts.GetCommitSHA()\n}\n\nfunc TestSarifAnalysis_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SarifAnalysis{Ref: &zeroValue}\n\ts.GetRef()\n\ts = &SarifAnalysis{}\n\ts.GetRef()\n\ts = nil\n\ts.GetRef()\n}\n\nfunc TestSarifAnalysis_GetSarif(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SarifAnalysis{Sarif: &zeroValue}\n\ts.GetSarif()\n\ts = &SarifAnalysis{}\n\ts.GetSarif()\n\ts = nil\n\ts.GetSarif()\n}\n\nfunc TestSarifAnalysis_GetStartedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ts := &SarifAnalysis{StartedAt: &zeroValue}\n\ts.GetStartedAt()\n\ts = &SarifAnalysis{}\n\ts.GetStartedAt()\n\ts = nil\n\ts.GetStartedAt()\n}\n\nfunc TestSarifAnalysis_GetToolName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SarifAnalysis{ToolName: &zeroValue}\n\ts.GetToolName()\n\ts = &SarifAnalysis{}\n\ts.GetToolName()\n\ts = nil\n\ts.GetToolName()\n}\n\nfunc TestSarifID_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SarifID{ID: &zeroValue}\n\ts.GetID()\n\ts = &SarifID{}\n\ts.GetID()\n\ts = nil\n\ts.GetID()\n}\n\nfunc TestSarifID_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SarifID{URL: &zeroValue}\n\ts.GetURL()\n\ts = &SarifID{}\n\ts.GetURL()\n\ts = nil\n\ts.GetURL()\n}\n\nfunc TestSARIFUpload_GetAnalysesURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SARIFUpload{AnalysesURL: &zeroValue}\n\ts.GetAnalysesURL()\n\ts = &SARIFUpload{}\n\ts.GetAnalysesURL()\n\ts = nil\n\ts.GetAnalysesURL()\n}\n\nfunc TestSARIFUpload_GetProcessingStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SARIFUpload{ProcessingStatus: &zeroValue}\n\ts.GetProcessingStatus()\n\ts = &SARIFUpload{}\n\ts.GetProcessingStatus()\n\ts = nil\n\ts.GetProcessingStatus()\n}\n\nfunc TestSBOM_GetSBOM(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SBOM{}\n\ts.GetSBOM()\n\ts = nil\n\ts.GetSBOM()\n}\n\nfunc TestSBOMInfo_GetCreationInfo(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SBOMInfo{}\n\ts.GetCreationInfo()\n\ts = nil\n\ts.GetCreationInfo()\n}\n\nfunc TestSBOMInfo_GetDataLicense(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SBOMInfo{DataLicense: &zeroValue}\n\ts.GetDataLicense()\n\ts = &SBOMInfo{}\n\ts.GetDataLicense()\n\ts = nil\n\ts.GetDataLicense()\n}\n\nfunc TestSBOMInfo_GetDocumentDescribes(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ts := &SBOMInfo{DocumentDescribes: zeroValue}\n\ts.GetDocumentDescribes()\n\ts = &SBOMInfo{}\n\ts.GetDocumentDescribes()\n\ts = nil\n\ts.GetDocumentDescribes()\n}\n\nfunc TestSBOMInfo_GetDocumentNamespace(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SBOMInfo{DocumentNamespace: &zeroValue}\n\ts.GetDocumentNamespace()\n\ts = &SBOMInfo{}\n\ts.GetDocumentNamespace()\n\ts = nil\n\ts.GetDocumentNamespace()\n}\n\nfunc TestSBOMInfo_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SBOMInfo{Name: &zeroValue}\n\ts.GetName()\n\ts = &SBOMInfo{}\n\ts.GetName()\n\ts = nil\n\ts.GetName()\n}\n\nfunc TestSBOMInfo_GetPackages(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*RepoDependencies{}\n\ts := &SBOMInfo{Packages: zeroValue}\n\ts.GetPackages()\n\ts = &SBOMInfo{}\n\ts.GetPackages()\n\ts = nil\n\ts.GetPackages()\n}\n\nfunc TestSBOMInfo_GetRelationships(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*SBOMRelationship{}\n\ts := &SBOMInfo{Relationships: zeroValue}\n\ts.GetRelationships()\n\ts = &SBOMInfo{}\n\ts.GetRelationships()\n\ts = nil\n\ts.GetRelationships()\n}\n\nfunc TestSBOMInfo_GetSPDXID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SBOMInfo{SPDXID: &zeroValue}\n\ts.GetSPDXID()\n\ts = &SBOMInfo{}\n\ts.GetSPDXID()\n\ts = nil\n\ts.GetSPDXID()\n}\n\nfunc TestSBOMInfo_GetSPDXVersion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SBOMInfo{SPDXVersion: &zeroValue}\n\ts.GetSPDXVersion()\n\ts = &SBOMInfo{}\n\ts.GetSPDXVersion()\n\ts = nil\n\ts.GetSPDXVersion()\n}\n\nfunc TestSBOMRelationship_GetRelatedSPDXElement(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SBOMRelationship{}\n\ts.GetRelatedSPDXElement()\n\ts = nil\n\ts.GetRelatedSPDXElement()\n}\n\nfunc TestSBOMRelationship_GetRelationshipType(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SBOMRelationship{}\n\ts.GetRelationshipType()\n\ts = nil\n\ts.GetRelationshipType()\n}\n\nfunc TestSBOMRelationship_GetSPDXElementID(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SBOMRelationship{}\n\ts.GetSPDXElementID()\n\ts = nil\n\ts.GetSPDXElementID()\n}\n\nfunc TestScanningAnalysis_GetAnalysisKey(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &ScanningAnalysis{AnalysisKey: &zeroValue}\n\ts.GetAnalysisKey()\n\ts = &ScanningAnalysis{}\n\ts.GetAnalysisKey()\n\ts = nil\n\ts.GetAnalysisKey()\n}\n\nfunc TestScanningAnalysis_GetCategory(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &ScanningAnalysis{Category: &zeroValue}\n\ts.GetCategory()\n\ts = &ScanningAnalysis{}\n\ts.GetCategory()\n\ts = nil\n\ts.GetCategory()\n}\n\nfunc TestScanningAnalysis_GetCommitSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &ScanningAnalysis{CommitSHA: &zeroValue}\n\ts.GetCommitSHA()\n\ts = &ScanningAnalysis{}\n\ts.GetCommitSHA()\n\ts = nil\n\ts.GetCommitSHA()\n}\n\nfunc TestScanningAnalysis_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ts := &ScanningAnalysis{CreatedAt: &zeroValue}\n\ts.GetCreatedAt()\n\ts = &ScanningAnalysis{}\n\ts.GetCreatedAt()\n\ts = nil\n\ts.GetCreatedAt()\n}\n\nfunc TestScanningAnalysis_GetDeletable(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ts := &ScanningAnalysis{Deletable: &zeroValue}\n\ts.GetDeletable()\n\ts = &ScanningAnalysis{}\n\ts.GetDeletable()\n\ts = nil\n\ts.GetDeletable()\n}\n\nfunc TestScanningAnalysis_GetEnvironment(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &ScanningAnalysis{Environment: &zeroValue}\n\ts.GetEnvironment()\n\ts = &ScanningAnalysis{}\n\ts.GetEnvironment()\n\ts = nil\n\ts.GetEnvironment()\n}\n\nfunc TestScanningAnalysis_GetError(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &ScanningAnalysis{Error: &zeroValue}\n\ts.GetError()\n\ts = &ScanningAnalysis{}\n\ts.GetError()\n\ts = nil\n\ts.GetError()\n}\n\nfunc TestScanningAnalysis_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ts := &ScanningAnalysis{ID: &zeroValue}\n\ts.GetID()\n\ts = &ScanningAnalysis{}\n\ts.GetID()\n\ts = nil\n\ts.GetID()\n}\n\nfunc TestScanningAnalysis_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &ScanningAnalysis{Ref: &zeroValue}\n\ts.GetRef()\n\ts = &ScanningAnalysis{}\n\ts.GetRef()\n\ts = nil\n\ts.GetRef()\n}\n\nfunc TestScanningAnalysis_GetResultsCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ts := &ScanningAnalysis{ResultsCount: &zeroValue}\n\ts.GetResultsCount()\n\ts = &ScanningAnalysis{}\n\ts.GetResultsCount()\n\ts = nil\n\ts.GetResultsCount()\n}\n\nfunc TestScanningAnalysis_GetRulesCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ts := &ScanningAnalysis{RulesCount: &zeroValue}\n\ts.GetRulesCount()\n\ts = &ScanningAnalysis{}\n\ts.GetRulesCount()\n\ts = nil\n\ts.GetRulesCount()\n}\n\nfunc TestScanningAnalysis_GetSarifID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &ScanningAnalysis{SarifID: &zeroValue}\n\ts.GetSarifID()\n\ts = &ScanningAnalysis{}\n\ts.GetSarifID()\n\ts = nil\n\ts.GetSarifID()\n}\n\nfunc TestScanningAnalysis_GetTool(tt *testing.T) {\n\ttt.Parallel()\n\ts := &ScanningAnalysis{}\n\ts.GetTool()\n\ts = nil\n\ts.GetTool()\n}\n\nfunc TestScanningAnalysis_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &ScanningAnalysis{URL: &zeroValue}\n\ts.GetURL()\n\ts = &ScanningAnalysis{}\n\ts.GetURL()\n\ts = nil\n\ts.GetURL()\n}\n\nfunc TestScanningAnalysis_GetWarning(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &ScanningAnalysis{Warning: &zeroValue}\n\ts.GetWarning()\n\ts = &ScanningAnalysis{}\n\ts.GetWarning()\n\ts = nil\n\ts.GetWarning()\n}\n\nfunc TestSCIMEnterpriseAttribute_GetOperations(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*SCIMEnterpriseAttributeOperation{}\n\ts := &SCIMEnterpriseAttribute{Operations: zeroValue}\n\ts.GetOperations()\n\ts = &SCIMEnterpriseAttribute{}\n\ts.GetOperations()\n\ts = nil\n\ts.GetOperations()\n}\n\nfunc TestSCIMEnterpriseAttribute_GetSchemas(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ts := &SCIMEnterpriseAttribute{Schemas: zeroValue}\n\ts.GetSchemas()\n\ts = &SCIMEnterpriseAttribute{}\n\ts.GetSchemas()\n\ts = nil\n\ts.GetSchemas()\n}\n\nfunc TestSCIMEnterpriseAttributeOperation_GetOp(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SCIMEnterpriseAttributeOperation{}\n\ts.GetOp()\n\ts = nil\n\ts.GetOp()\n}\n\nfunc TestSCIMEnterpriseAttributeOperation_GetPath(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SCIMEnterpriseAttributeOperation{Path: &zeroValue}\n\ts.GetPath()\n\ts = &SCIMEnterpriseAttributeOperation{}\n\ts.GetPath()\n\ts = nil\n\ts.GetPath()\n}\n\nfunc TestSCIMEnterpriseAttributeOperation_GetValue(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SCIMEnterpriseAttributeOperation{}\n\ts.GetValue()\n\ts = nil\n\ts.GetValue()\n}\n\nfunc TestSCIMEnterpriseDisplayReference_GetDisplay(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SCIMEnterpriseDisplayReference{Display: &zeroValue}\n\ts.GetDisplay()\n\ts = &SCIMEnterpriseDisplayReference{}\n\ts.GetDisplay()\n\ts = nil\n\ts.GetDisplay()\n}\n\nfunc TestSCIMEnterpriseDisplayReference_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SCIMEnterpriseDisplayReference{Ref: &zeroValue}\n\ts.GetRef()\n\ts = &SCIMEnterpriseDisplayReference{}\n\ts.GetRef()\n\ts = nil\n\ts.GetRef()\n}\n\nfunc TestSCIMEnterpriseDisplayReference_GetValue(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SCIMEnterpriseDisplayReference{}\n\ts.GetValue()\n\ts = nil\n\ts.GetValue()\n}\n\nfunc TestSCIMEnterpriseGroupAttributes_GetDisplayName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SCIMEnterpriseGroupAttributes{DisplayName: &zeroValue}\n\ts.GetDisplayName()\n\ts = &SCIMEnterpriseGroupAttributes{}\n\ts.GetDisplayName()\n\ts = nil\n\ts.GetDisplayName()\n}\n\nfunc TestSCIMEnterpriseGroupAttributes_GetExternalID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SCIMEnterpriseGroupAttributes{ExternalID: &zeroValue}\n\ts.GetExternalID()\n\ts = &SCIMEnterpriseGroupAttributes{}\n\ts.GetExternalID()\n\ts = nil\n\ts.GetExternalID()\n}\n\nfunc TestSCIMEnterpriseGroupAttributes_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SCIMEnterpriseGroupAttributes{ID: &zeroValue}\n\ts.GetID()\n\ts = &SCIMEnterpriseGroupAttributes{}\n\ts.GetID()\n\ts = nil\n\ts.GetID()\n}\n\nfunc TestSCIMEnterpriseGroupAttributes_GetMembers(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*SCIMEnterpriseDisplayReference{}\n\ts := &SCIMEnterpriseGroupAttributes{Members: zeroValue}\n\ts.GetMembers()\n\ts = &SCIMEnterpriseGroupAttributes{}\n\ts.GetMembers()\n\ts = nil\n\ts.GetMembers()\n}\n\nfunc TestSCIMEnterpriseGroupAttributes_GetMeta(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SCIMEnterpriseGroupAttributes{}\n\ts.GetMeta()\n\ts = nil\n\ts.GetMeta()\n}\n\nfunc TestSCIMEnterpriseGroupAttributes_GetSchemas(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ts := &SCIMEnterpriseGroupAttributes{Schemas: zeroValue}\n\ts.GetSchemas()\n\ts = &SCIMEnterpriseGroupAttributes{}\n\ts.GetSchemas()\n\ts = nil\n\ts.GetSchemas()\n}\n\nfunc TestSCIMEnterpriseGroups_GetItemsPerPage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ts := &SCIMEnterpriseGroups{ItemsPerPage: &zeroValue}\n\ts.GetItemsPerPage()\n\ts = &SCIMEnterpriseGroups{}\n\ts.GetItemsPerPage()\n\ts = nil\n\ts.GetItemsPerPage()\n}\n\nfunc TestSCIMEnterpriseGroups_GetResources(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*SCIMEnterpriseGroupAttributes{}\n\ts := &SCIMEnterpriseGroups{Resources: zeroValue}\n\ts.GetResources()\n\ts = &SCIMEnterpriseGroups{}\n\ts.GetResources()\n\ts = nil\n\ts.GetResources()\n}\n\nfunc TestSCIMEnterpriseGroups_GetSchemas(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ts := &SCIMEnterpriseGroups{Schemas: zeroValue}\n\ts.GetSchemas()\n\ts = &SCIMEnterpriseGroups{}\n\ts.GetSchemas()\n\ts = nil\n\ts.GetSchemas()\n}\n\nfunc TestSCIMEnterpriseGroups_GetStartIndex(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ts := &SCIMEnterpriseGroups{StartIndex: &zeroValue}\n\ts.GetStartIndex()\n\ts = &SCIMEnterpriseGroups{}\n\ts.GetStartIndex()\n\ts = nil\n\ts.GetStartIndex()\n}\n\nfunc TestSCIMEnterpriseGroups_GetTotalResults(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ts := &SCIMEnterpriseGroups{TotalResults: &zeroValue}\n\ts.GetTotalResults()\n\ts = &SCIMEnterpriseGroups{}\n\ts.GetTotalResults()\n\ts = nil\n\ts.GetTotalResults()\n}\n\nfunc TestSCIMEnterpriseMeta_GetCreated(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ts := &SCIMEnterpriseMeta{Created: &zeroValue}\n\ts.GetCreated()\n\ts = &SCIMEnterpriseMeta{}\n\ts.GetCreated()\n\ts = nil\n\ts.GetCreated()\n}\n\nfunc TestSCIMEnterpriseMeta_GetLastModified(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ts := &SCIMEnterpriseMeta{LastModified: &zeroValue}\n\ts.GetLastModified()\n\ts = &SCIMEnterpriseMeta{}\n\ts.GetLastModified()\n\ts = nil\n\ts.GetLastModified()\n}\n\nfunc TestSCIMEnterpriseMeta_GetLocation(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SCIMEnterpriseMeta{Location: &zeroValue}\n\ts.GetLocation()\n\ts = &SCIMEnterpriseMeta{}\n\ts.GetLocation()\n\ts = nil\n\ts.GetLocation()\n}\n\nfunc TestSCIMEnterpriseMeta_GetResourceType(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SCIMEnterpriseMeta{}\n\ts.GetResourceType()\n\ts = nil\n\ts.GetResourceType()\n}\n\nfunc TestSCIMEnterpriseUserAttributes_GetActive(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SCIMEnterpriseUserAttributes{}\n\ts.GetActive()\n\ts = nil\n\ts.GetActive()\n}\n\nfunc TestSCIMEnterpriseUserAttributes_GetDisplayName(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SCIMEnterpriseUserAttributes{}\n\ts.GetDisplayName()\n\ts = nil\n\ts.GetDisplayName()\n}\n\nfunc TestSCIMEnterpriseUserAttributes_GetEmails(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*SCIMEnterpriseUserEmail{}\n\ts := &SCIMEnterpriseUserAttributes{Emails: zeroValue}\n\ts.GetEmails()\n\ts = &SCIMEnterpriseUserAttributes{}\n\ts.GetEmails()\n\ts = nil\n\ts.GetEmails()\n}\n\nfunc TestSCIMEnterpriseUserAttributes_GetExternalID(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SCIMEnterpriseUserAttributes{}\n\ts.GetExternalID()\n\ts = nil\n\ts.GetExternalID()\n}\n\nfunc TestSCIMEnterpriseUserAttributes_GetGroups(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*SCIMEnterpriseDisplayReference{}\n\ts := &SCIMEnterpriseUserAttributes{Groups: zeroValue}\n\ts.GetGroups()\n\ts = &SCIMEnterpriseUserAttributes{}\n\ts.GetGroups()\n\ts = nil\n\ts.GetGroups()\n}\n\nfunc TestSCIMEnterpriseUserAttributes_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SCIMEnterpriseUserAttributes{ID: &zeroValue}\n\ts.GetID()\n\ts = &SCIMEnterpriseUserAttributes{}\n\ts.GetID()\n\ts = nil\n\ts.GetID()\n}\n\nfunc TestSCIMEnterpriseUserAttributes_GetMeta(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SCIMEnterpriseUserAttributes{}\n\ts.GetMeta()\n\ts = nil\n\ts.GetMeta()\n}\n\nfunc TestSCIMEnterpriseUserAttributes_GetName(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SCIMEnterpriseUserAttributes{}\n\ts.GetName()\n\ts = nil\n\ts.GetName()\n}\n\nfunc TestSCIMEnterpriseUserAttributes_GetRoles(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*SCIMEnterpriseUserRole{}\n\ts := &SCIMEnterpriseUserAttributes{Roles: zeroValue}\n\ts.GetRoles()\n\ts = &SCIMEnterpriseUserAttributes{}\n\ts.GetRoles()\n\ts = nil\n\ts.GetRoles()\n}\n\nfunc TestSCIMEnterpriseUserAttributes_GetSchemas(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ts := &SCIMEnterpriseUserAttributes{Schemas: zeroValue}\n\ts.GetSchemas()\n\ts = &SCIMEnterpriseUserAttributes{}\n\ts.GetSchemas()\n\ts = nil\n\ts.GetSchemas()\n}\n\nfunc TestSCIMEnterpriseUserAttributes_GetUserName(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SCIMEnterpriseUserAttributes{}\n\ts.GetUserName()\n\ts = nil\n\ts.GetUserName()\n}\n\nfunc TestSCIMEnterpriseUserEmail_GetPrimary(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SCIMEnterpriseUserEmail{}\n\ts.GetPrimary()\n\ts = nil\n\ts.GetPrimary()\n}\n\nfunc TestSCIMEnterpriseUserEmail_GetType(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SCIMEnterpriseUserEmail{}\n\ts.GetType()\n\ts = nil\n\ts.GetType()\n}\n\nfunc TestSCIMEnterpriseUserEmail_GetValue(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SCIMEnterpriseUserEmail{}\n\ts.GetValue()\n\ts = nil\n\ts.GetValue()\n}\n\nfunc TestSCIMEnterpriseUserName_GetFamilyName(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SCIMEnterpriseUserName{}\n\ts.GetFamilyName()\n\ts = nil\n\ts.GetFamilyName()\n}\n\nfunc TestSCIMEnterpriseUserName_GetFormatted(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SCIMEnterpriseUserName{Formatted: &zeroValue}\n\ts.GetFormatted()\n\ts = &SCIMEnterpriseUserName{}\n\ts.GetFormatted()\n\ts = nil\n\ts.GetFormatted()\n}\n\nfunc TestSCIMEnterpriseUserName_GetGivenName(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SCIMEnterpriseUserName{}\n\ts.GetGivenName()\n\ts = nil\n\ts.GetGivenName()\n}\n\nfunc TestSCIMEnterpriseUserName_GetMiddleName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SCIMEnterpriseUserName{MiddleName: &zeroValue}\n\ts.GetMiddleName()\n\ts = &SCIMEnterpriseUserName{}\n\ts.GetMiddleName()\n\ts = nil\n\ts.GetMiddleName()\n}\n\nfunc TestSCIMEnterpriseUserRole_GetDisplay(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SCIMEnterpriseUserRole{Display: &zeroValue}\n\ts.GetDisplay()\n\ts = &SCIMEnterpriseUserRole{}\n\ts.GetDisplay()\n\ts = nil\n\ts.GetDisplay()\n}\n\nfunc TestSCIMEnterpriseUserRole_GetPrimary(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ts := &SCIMEnterpriseUserRole{Primary: &zeroValue}\n\ts.GetPrimary()\n\ts = &SCIMEnterpriseUserRole{}\n\ts.GetPrimary()\n\ts = nil\n\ts.GetPrimary()\n}\n\nfunc TestSCIMEnterpriseUserRole_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SCIMEnterpriseUserRole{Type: &zeroValue}\n\ts.GetType()\n\ts = &SCIMEnterpriseUserRole{}\n\ts.GetType()\n\ts = nil\n\ts.GetType()\n}\n\nfunc TestSCIMEnterpriseUserRole_GetValue(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SCIMEnterpriseUserRole{}\n\ts.GetValue()\n\ts = nil\n\ts.GetValue()\n}\n\nfunc TestSCIMEnterpriseUsers_GetItemsPerPage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ts := &SCIMEnterpriseUsers{ItemsPerPage: &zeroValue}\n\ts.GetItemsPerPage()\n\ts = &SCIMEnterpriseUsers{}\n\ts.GetItemsPerPage()\n\ts = nil\n\ts.GetItemsPerPage()\n}\n\nfunc TestSCIMEnterpriseUsers_GetResources(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*SCIMEnterpriseUserAttributes{}\n\ts := &SCIMEnterpriseUsers{Resources: zeroValue}\n\ts.GetResources()\n\ts = &SCIMEnterpriseUsers{}\n\ts.GetResources()\n\ts = nil\n\ts.GetResources()\n}\n\nfunc TestSCIMEnterpriseUsers_GetSchemas(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ts := &SCIMEnterpriseUsers{Schemas: zeroValue}\n\ts.GetSchemas()\n\ts = &SCIMEnterpriseUsers{}\n\ts.GetSchemas()\n\ts = nil\n\ts.GetSchemas()\n}\n\nfunc TestSCIMEnterpriseUsers_GetStartIndex(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ts := &SCIMEnterpriseUsers{StartIndex: &zeroValue}\n\ts.GetStartIndex()\n\ts = &SCIMEnterpriseUsers{}\n\ts.GetStartIndex()\n\ts = nil\n\ts.GetStartIndex()\n}\n\nfunc TestSCIMEnterpriseUsers_GetTotalResults(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ts := &SCIMEnterpriseUsers{TotalResults: &zeroValue}\n\ts.GetTotalResults()\n\ts = &SCIMEnterpriseUsers{}\n\ts.GetTotalResults()\n\ts = nil\n\ts.GetTotalResults()\n}\n\nfunc TestSCIMMeta_GetCreated(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ts := &SCIMMeta{Created: &zeroValue}\n\ts.GetCreated()\n\ts = &SCIMMeta{}\n\ts.GetCreated()\n\ts = nil\n\ts.GetCreated()\n}\n\nfunc TestSCIMMeta_GetLastModified(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ts := &SCIMMeta{LastModified: &zeroValue}\n\ts.GetLastModified()\n\ts = &SCIMMeta{}\n\ts.GetLastModified()\n\ts = nil\n\ts.GetLastModified()\n}\n\nfunc TestSCIMMeta_GetLocation(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SCIMMeta{Location: &zeroValue}\n\ts.GetLocation()\n\ts = &SCIMMeta{}\n\ts.GetLocation()\n\ts = nil\n\ts.GetLocation()\n}\n\nfunc TestSCIMMeta_GetResourceType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SCIMMeta{ResourceType: &zeroValue}\n\ts.GetResourceType()\n\ts = &SCIMMeta{}\n\ts.GetResourceType()\n\ts = nil\n\ts.GetResourceType()\n}\n\nfunc TestSCIMProvisionedIdentities_GetItemsPerPage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ts := &SCIMProvisionedIdentities{ItemsPerPage: &zeroValue}\n\ts.GetItemsPerPage()\n\ts = &SCIMProvisionedIdentities{}\n\ts.GetItemsPerPage()\n\ts = nil\n\ts.GetItemsPerPage()\n}\n\nfunc TestSCIMProvisionedIdentities_GetResources(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*SCIMUserAttributes{}\n\ts := &SCIMProvisionedIdentities{Resources: zeroValue}\n\ts.GetResources()\n\ts = &SCIMProvisionedIdentities{}\n\ts.GetResources()\n\ts = nil\n\ts.GetResources()\n}\n\nfunc TestSCIMProvisionedIdentities_GetSchemas(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ts := &SCIMProvisionedIdentities{Schemas: zeroValue}\n\ts.GetSchemas()\n\ts = &SCIMProvisionedIdentities{}\n\ts.GetSchemas()\n\ts = nil\n\ts.GetSchemas()\n}\n\nfunc TestSCIMProvisionedIdentities_GetStartIndex(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ts := &SCIMProvisionedIdentities{StartIndex: &zeroValue}\n\ts.GetStartIndex()\n\ts = &SCIMProvisionedIdentities{}\n\ts.GetStartIndex()\n\ts = nil\n\ts.GetStartIndex()\n}\n\nfunc TestSCIMProvisionedIdentities_GetTotalResults(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ts := &SCIMProvisionedIdentities{TotalResults: &zeroValue}\n\ts.GetTotalResults()\n\ts = &SCIMProvisionedIdentities{}\n\ts.GetTotalResults()\n\ts = nil\n\ts.GetTotalResults()\n}\n\nfunc TestSCIMUserAttributes_GetActive(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ts := &SCIMUserAttributes{Active: &zeroValue}\n\ts.GetActive()\n\ts = &SCIMUserAttributes{}\n\ts.GetActive()\n\ts = nil\n\ts.GetActive()\n}\n\nfunc TestSCIMUserAttributes_GetDisplayName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SCIMUserAttributes{DisplayName: &zeroValue}\n\ts.GetDisplayName()\n\ts = &SCIMUserAttributes{}\n\ts.GetDisplayName()\n\ts = nil\n\ts.GetDisplayName()\n}\n\nfunc TestSCIMUserAttributes_GetEmails(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*SCIMUserEmail{}\n\ts := &SCIMUserAttributes{Emails: zeroValue}\n\ts.GetEmails()\n\ts = &SCIMUserAttributes{}\n\ts.GetEmails()\n\ts = nil\n\ts.GetEmails()\n}\n\nfunc TestSCIMUserAttributes_GetExternalID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SCIMUserAttributes{ExternalID: &zeroValue}\n\ts.GetExternalID()\n\ts = &SCIMUserAttributes{}\n\ts.GetExternalID()\n\ts = nil\n\ts.GetExternalID()\n}\n\nfunc TestSCIMUserAttributes_GetGroups(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ts := &SCIMUserAttributes{Groups: zeroValue}\n\ts.GetGroups()\n\ts = &SCIMUserAttributes{}\n\ts.GetGroups()\n\ts = nil\n\ts.GetGroups()\n}\n\nfunc TestSCIMUserAttributes_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SCIMUserAttributes{ID: &zeroValue}\n\ts.GetID()\n\ts = &SCIMUserAttributes{}\n\ts.GetID()\n\ts = nil\n\ts.GetID()\n}\n\nfunc TestSCIMUserAttributes_GetMeta(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SCIMUserAttributes{}\n\ts.GetMeta()\n\ts = nil\n\ts.GetMeta()\n}\n\nfunc TestSCIMUserAttributes_GetName(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SCIMUserAttributes{}\n\ts.GetName()\n\ts = nil\n\ts.GetName()\n}\n\nfunc TestSCIMUserAttributes_GetRoles(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*SCIMUserRole{}\n\ts := &SCIMUserAttributes{Roles: zeroValue}\n\ts.GetRoles()\n\ts = &SCIMUserAttributes{}\n\ts.GetRoles()\n\ts = nil\n\ts.GetRoles()\n}\n\nfunc TestSCIMUserAttributes_GetSchemas(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ts := &SCIMUserAttributes{Schemas: zeroValue}\n\ts.GetSchemas()\n\ts = &SCIMUserAttributes{}\n\ts.GetSchemas()\n\ts = nil\n\ts.GetSchemas()\n}\n\nfunc TestSCIMUserAttributes_GetUserName(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SCIMUserAttributes{}\n\ts.GetUserName()\n\ts = nil\n\ts.GetUserName()\n}\n\nfunc TestSCIMUserEmail_GetPrimary(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ts := &SCIMUserEmail{Primary: &zeroValue}\n\ts.GetPrimary()\n\ts = &SCIMUserEmail{}\n\ts.GetPrimary()\n\ts = nil\n\ts.GetPrimary()\n}\n\nfunc TestSCIMUserEmail_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SCIMUserEmail{Type: &zeroValue}\n\ts.GetType()\n\ts = &SCIMUserEmail{}\n\ts.GetType()\n\ts = nil\n\ts.GetType()\n}\n\nfunc TestSCIMUserEmail_GetValue(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SCIMUserEmail{}\n\ts.GetValue()\n\ts = nil\n\ts.GetValue()\n}\n\nfunc TestSCIMUserName_GetFamilyName(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SCIMUserName{}\n\ts.GetFamilyName()\n\ts = nil\n\ts.GetFamilyName()\n}\n\nfunc TestSCIMUserName_GetFormatted(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SCIMUserName{Formatted: &zeroValue}\n\ts.GetFormatted()\n\ts = &SCIMUserName{}\n\ts.GetFormatted()\n\ts = nil\n\ts.GetFormatted()\n}\n\nfunc TestSCIMUserName_GetGivenName(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SCIMUserName{}\n\ts.GetGivenName()\n\ts = nil\n\ts.GetGivenName()\n}\n\nfunc TestSCIMUserRole_GetDisplay(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SCIMUserRole{Display: &zeroValue}\n\ts.GetDisplay()\n\ts = &SCIMUserRole{}\n\ts.GetDisplay()\n\ts = nil\n\ts.GetDisplay()\n}\n\nfunc TestSCIMUserRole_GetPrimary(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ts := &SCIMUserRole{Primary: &zeroValue}\n\ts.GetPrimary()\n\ts = &SCIMUserRole{}\n\ts.GetPrimary()\n\ts = nil\n\ts.GetPrimary()\n}\n\nfunc TestSCIMUserRole_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SCIMUserRole{Type: &zeroValue}\n\ts.GetType()\n\ts = &SCIMUserRole{}\n\ts.GetType()\n\ts = nil\n\ts.GetType()\n}\n\nfunc TestSCIMUserRole_GetValue(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SCIMUserRole{}\n\ts.GetValue()\n\ts = nil\n\ts.GetValue()\n}\n\nfunc TestSearchOptions_GetAdvancedSearch(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ts := &SearchOptions{AdvancedSearch: &zeroValue}\n\ts.GetAdvancedSearch()\n\ts = &SearchOptions{}\n\ts.GetAdvancedSearch()\n\ts = nil\n\ts.GetAdvancedSearch()\n}\n\nfunc TestSearchOptions_GetOrder(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SearchOptions{}\n\ts.GetOrder()\n\ts = nil\n\ts.GetOrder()\n}\n\nfunc TestSearchOptions_GetSort(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SearchOptions{}\n\ts.GetSort()\n\ts = nil\n\ts.GetSort()\n}\n\nfunc TestSearchOptions_GetTextMatch(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SearchOptions{}\n\ts.GetTextMatch()\n\ts = nil\n\ts.GetTextMatch()\n}\n\nfunc TestSeatAssignments_GetSeatsCreated(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SeatAssignments{}\n\ts.GetSeatsCreated()\n\ts = nil\n\ts.GetSeatsCreated()\n}\n\nfunc TestSeatCancellations_GetSeatsCancelled(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SeatCancellations{}\n\ts.GetSeatsCancelled()\n\ts = nil\n\ts.GetSeatsCancelled()\n}\n\nfunc TestSecret_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\ts := &Secret{}\n\ts.GetCreatedAt()\n\ts = nil\n\ts.GetCreatedAt()\n}\n\nfunc TestSecret_GetName(tt *testing.T) {\n\ttt.Parallel()\n\ts := &Secret{}\n\ts.GetName()\n\ts = nil\n\ts.GetName()\n}\n\nfunc TestSecret_GetSelectedRepositoriesURL(tt *testing.T) {\n\ttt.Parallel()\n\ts := &Secret{}\n\ts.GetSelectedRepositoriesURL()\n\ts = nil\n\ts.GetSelectedRepositoriesURL()\n}\n\nfunc TestSecret_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\ts := &Secret{}\n\ts.GetUpdatedAt()\n\ts = nil\n\ts.GetUpdatedAt()\n}\n\nfunc TestSecret_GetVisibility(tt *testing.T) {\n\ttt.Parallel()\n\ts := &Secret{}\n\ts.GetVisibility()\n\ts = nil\n\ts.GetVisibility()\n}\n\nfunc TestSecrets_GetSecrets(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Secret{}\n\ts := &Secrets{Secrets: zeroValue}\n\ts.GetSecrets()\n\ts = &Secrets{}\n\ts.GetSecrets()\n\ts = nil\n\ts.GetSecrets()\n}\n\nfunc TestSecrets_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\ts := &Secrets{}\n\ts.GetTotalCount()\n\ts = nil\n\ts.GetTotalCount()\n}\n\nfunc TestSecretScanning_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanning{Status: &zeroValue}\n\ts.GetStatus()\n\ts = &SecretScanning{}\n\ts.GetStatus()\n\ts = nil\n\ts.GetStatus()\n}\n\nfunc TestSecretScanningAlert_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ts := &SecretScanningAlert{CreatedAt: &zeroValue}\n\ts.GetCreatedAt()\n\ts = &SecretScanningAlert{}\n\ts.GetCreatedAt()\n\ts = nil\n\ts.GetCreatedAt()\n}\n\nfunc TestSecretScanningAlert_GetFirstLocationDetected(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningAlert{}\n\ts.GetFirstLocationDetected()\n\ts = nil\n\ts.GetFirstLocationDetected()\n}\n\nfunc TestSecretScanningAlert_GetHasMoreLocations(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ts := &SecretScanningAlert{HasMoreLocations: &zeroValue}\n\ts.GetHasMoreLocations()\n\ts = &SecretScanningAlert{}\n\ts.GetHasMoreLocations()\n\ts = nil\n\ts.GetHasMoreLocations()\n}\n\nfunc TestSecretScanningAlert_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningAlert{HTMLURL: &zeroValue}\n\ts.GetHTMLURL()\n\ts = &SecretScanningAlert{}\n\ts.GetHTMLURL()\n\ts = nil\n\ts.GetHTMLURL()\n}\n\nfunc TestSecretScanningAlert_GetIsBase64Encoded(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ts := &SecretScanningAlert{IsBase64Encoded: &zeroValue}\n\ts.GetIsBase64Encoded()\n\ts = &SecretScanningAlert{}\n\ts.GetIsBase64Encoded()\n\ts = nil\n\ts.GetIsBase64Encoded()\n}\n\nfunc TestSecretScanningAlert_GetLocationsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningAlert{LocationsURL: &zeroValue}\n\ts.GetLocationsURL()\n\ts = &SecretScanningAlert{}\n\ts.GetLocationsURL()\n\ts = nil\n\ts.GetLocationsURL()\n}\n\nfunc TestSecretScanningAlert_GetMultiRepo(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ts := &SecretScanningAlert{MultiRepo: &zeroValue}\n\ts.GetMultiRepo()\n\ts = &SecretScanningAlert{}\n\ts.GetMultiRepo()\n\ts = nil\n\ts.GetMultiRepo()\n}\n\nfunc TestSecretScanningAlert_GetNumber(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ts := &SecretScanningAlert{Number: &zeroValue}\n\ts.GetNumber()\n\ts = &SecretScanningAlert{}\n\ts.GetNumber()\n\ts = nil\n\ts.GetNumber()\n}\n\nfunc TestSecretScanningAlert_GetPubliclyLeaked(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ts := &SecretScanningAlert{PubliclyLeaked: &zeroValue}\n\ts.GetPubliclyLeaked()\n\ts = &SecretScanningAlert{}\n\ts.GetPubliclyLeaked()\n\ts = nil\n\ts.GetPubliclyLeaked()\n}\n\nfunc TestSecretScanningAlert_GetPushProtectionBypassed(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ts := &SecretScanningAlert{PushProtectionBypassed: &zeroValue}\n\ts.GetPushProtectionBypassed()\n\ts = &SecretScanningAlert{}\n\ts.GetPushProtectionBypassed()\n\ts = nil\n\ts.GetPushProtectionBypassed()\n}\n\nfunc TestSecretScanningAlert_GetPushProtectionBypassedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ts := &SecretScanningAlert{PushProtectionBypassedAt: &zeroValue}\n\ts.GetPushProtectionBypassedAt()\n\ts = &SecretScanningAlert{}\n\ts.GetPushProtectionBypassedAt()\n\ts = nil\n\ts.GetPushProtectionBypassedAt()\n}\n\nfunc TestSecretScanningAlert_GetPushProtectionBypassedBy(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningAlert{}\n\ts.GetPushProtectionBypassedBy()\n\ts = nil\n\ts.GetPushProtectionBypassedBy()\n}\n\nfunc TestSecretScanningAlert_GetPushProtectionBypassRequestComment(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningAlert{PushProtectionBypassRequestComment: &zeroValue}\n\ts.GetPushProtectionBypassRequestComment()\n\ts = &SecretScanningAlert{}\n\ts.GetPushProtectionBypassRequestComment()\n\ts = nil\n\ts.GetPushProtectionBypassRequestComment()\n}\n\nfunc TestSecretScanningAlert_GetPushProtectionBypassRequestHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningAlert{PushProtectionBypassRequestHTMLURL: &zeroValue}\n\ts.GetPushProtectionBypassRequestHTMLURL()\n\ts = &SecretScanningAlert{}\n\ts.GetPushProtectionBypassRequestHTMLURL()\n\ts = nil\n\ts.GetPushProtectionBypassRequestHTMLURL()\n}\n\nfunc TestSecretScanningAlert_GetPushProtectionBypassRequestReviewer(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningAlert{}\n\ts.GetPushProtectionBypassRequestReviewer()\n\ts = nil\n\ts.GetPushProtectionBypassRequestReviewer()\n}\n\nfunc TestSecretScanningAlert_GetPushProtectionBypassRequestReviewerComment(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningAlert{PushProtectionBypassRequestReviewerComment: &zeroValue}\n\ts.GetPushProtectionBypassRequestReviewerComment()\n\ts = &SecretScanningAlert{}\n\ts.GetPushProtectionBypassRequestReviewerComment()\n\ts = nil\n\ts.GetPushProtectionBypassRequestReviewerComment()\n}\n\nfunc TestSecretScanningAlert_GetRepository(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningAlert{}\n\ts.GetRepository()\n\ts = nil\n\ts.GetRepository()\n}\n\nfunc TestSecretScanningAlert_GetResolution(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningAlert{Resolution: &zeroValue}\n\ts.GetResolution()\n\ts = &SecretScanningAlert{}\n\ts.GetResolution()\n\ts = nil\n\ts.GetResolution()\n}\n\nfunc TestSecretScanningAlert_GetResolutionComment(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningAlert{ResolutionComment: &zeroValue}\n\ts.GetResolutionComment()\n\ts = &SecretScanningAlert{}\n\ts.GetResolutionComment()\n\ts = nil\n\ts.GetResolutionComment()\n}\n\nfunc TestSecretScanningAlert_GetResolvedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ts := &SecretScanningAlert{ResolvedAt: &zeroValue}\n\ts.GetResolvedAt()\n\ts = &SecretScanningAlert{}\n\ts.GetResolvedAt()\n\ts = nil\n\ts.GetResolvedAt()\n}\n\nfunc TestSecretScanningAlert_GetResolvedBy(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningAlert{}\n\ts.GetResolvedBy()\n\ts = nil\n\ts.GetResolvedBy()\n}\n\nfunc TestSecretScanningAlert_GetSecret(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningAlert{Secret: &zeroValue}\n\ts.GetSecret()\n\ts = &SecretScanningAlert{}\n\ts.GetSecret()\n\ts = nil\n\ts.GetSecret()\n}\n\nfunc TestSecretScanningAlert_GetSecretType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningAlert{SecretType: &zeroValue}\n\ts.GetSecretType()\n\ts = &SecretScanningAlert{}\n\ts.GetSecretType()\n\ts = nil\n\ts.GetSecretType()\n}\n\nfunc TestSecretScanningAlert_GetSecretTypeDisplayName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningAlert{SecretTypeDisplayName: &zeroValue}\n\ts.GetSecretTypeDisplayName()\n\ts = &SecretScanningAlert{}\n\ts.GetSecretTypeDisplayName()\n\ts = nil\n\ts.GetSecretTypeDisplayName()\n}\n\nfunc TestSecretScanningAlert_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningAlert{State: &zeroValue}\n\ts.GetState()\n\ts = &SecretScanningAlert{}\n\ts.GetState()\n\ts = nil\n\ts.GetState()\n}\n\nfunc TestSecretScanningAlert_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ts := &SecretScanningAlert{UpdatedAt: &zeroValue}\n\ts.GetUpdatedAt()\n\ts = &SecretScanningAlert{}\n\ts.GetUpdatedAt()\n\ts = nil\n\ts.GetUpdatedAt()\n}\n\nfunc TestSecretScanningAlert_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningAlert{URL: &zeroValue}\n\ts.GetURL()\n\ts = &SecretScanningAlert{}\n\ts.GetURL()\n\ts = nil\n\ts.GetURL()\n}\n\nfunc TestSecretScanningAlert_GetValidity(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningAlert{Validity: &zeroValue}\n\ts.GetValidity()\n\ts = &SecretScanningAlert{}\n\ts.GetValidity()\n\ts = nil\n\ts.GetValidity()\n}\n\nfunc TestSecretScanningAlertEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningAlertEvent{Action: &zeroValue}\n\ts.GetAction()\n\ts = &SecretScanningAlertEvent{}\n\ts.GetAction()\n\ts = nil\n\ts.GetAction()\n}\n\nfunc TestSecretScanningAlertEvent_GetAlert(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningAlertEvent{}\n\ts.GetAlert()\n\ts = nil\n\ts.GetAlert()\n}\n\nfunc TestSecretScanningAlertEvent_GetEnterprise(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningAlertEvent{}\n\ts.GetEnterprise()\n\ts = nil\n\ts.GetEnterprise()\n}\n\nfunc TestSecretScanningAlertEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningAlertEvent{}\n\ts.GetInstallation()\n\ts = nil\n\ts.GetInstallation()\n}\n\nfunc TestSecretScanningAlertEvent_GetOrganization(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningAlertEvent{}\n\ts.GetOrganization()\n\ts = nil\n\ts.GetOrganization()\n}\n\nfunc TestSecretScanningAlertEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningAlertEvent{}\n\ts.GetRepo()\n\ts = nil\n\ts.GetRepo()\n}\n\nfunc TestSecretScanningAlertEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningAlertEvent{}\n\ts.GetSender()\n\ts = nil\n\ts.GetSender()\n}\n\nfunc TestSecretScanningAlertListOptions_GetDirection(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningAlertListOptions{}\n\ts.GetDirection()\n\ts = nil\n\ts.GetDirection()\n}\n\nfunc TestSecretScanningAlertListOptions_GetIsMultiRepo(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningAlertListOptions{}\n\ts.GetIsMultiRepo()\n\ts = nil\n\ts.GetIsMultiRepo()\n}\n\nfunc TestSecretScanningAlertListOptions_GetIsPubliclyLeaked(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningAlertListOptions{}\n\ts.GetIsPubliclyLeaked()\n\ts = nil\n\ts.GetIsPubliclyLeaked()\n}\n\nfunc TestSecretScanningAlertListOptions_GetResolution(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningAlertListOptions{}\n\ts.GetResolution()\n\ts = nil\n\ts.GetResolution()\n}\n\nfunc TestSecretScanningAlertListOptions_GetSecretType(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningAlertListOptions{}\n\ts.GetSecretType()\n\ts = nil\n\ts.GetSecretType()\n}\n\nfunc TestSecretScanningAlertListOptions_GetSort(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningAlertListOptions{}\n\ts.GetSort()\n\ts = nil\n\ts.GetSort()\n}\n\nfunc TestSecretScanningAlertListOptions_GetState(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningAlertListOptions{}\n\ts.GetState()\n\ts = nil\n\ts.GetState()\n}\n\nfunc TestSecretScanningAlertListOptions_GetValidity(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningAlertListOptions{}\n\ts.GetValidity()\n\ts = nil\n\ts.GetValidity()\n}\n\nfunc TestSecretScanningAlertLocation_GetDetails(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningAlertLocation{}\n\ts.GetDetails()\n\ts = nil\n\ts.GetDetails()\n}\n\nfunc TestSecretScanningAlertLocation_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningAlertLocation{Type: &zeroValue}\n\ts.GetType()\n\ts = &SecretScanningAlertLocation{}\n\ts.GetType()\n\ts = nil\n\ts.GetType()\n}\n\nfunc TestSecretScanningAlertLocationDetails_GetBlobSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningAlertLocationDetails{BlobSHA: &zeroValue}\n\ts.GetBlobSHA()\n\ts = &SecretScanningAlertLocationDetails{}\n\ts.GetBlobSHA()\n\ts = nil\n\ts.GetBlobSHA()\n}\n\nfunc TestSecretScanningAlertLocationDetails_GetBlobURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningAlertLocationDetails{BlobURL: &zeroValue}\n\ts.GetBlobURL()\n\ts = &SecretScanningAlertLocationDetails{}\n\ts.GetBlobURL()\n\ts = nil\n\ts.GetBlobURL()\n}\n\nfunc TestSecretScanningAlertLocationDetails_GetCommitSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningAlertLocationDetails{CommitSHA: &zeroValue}\n\ts.GetCommitSHA()\n\ts = &SecretScanningAlertLocationDetails{}\n\ts.GetCommitSHA()\n\ts = nil\n\ts.GetCommitSHA()\n}\n\nfunc TestSecretScanningAlertLocationDetails_GetCommitURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningAlertLocationDetails{CommitURL: &zeroValue}\n\ts.GetCommitURL()\n\ts = &SecretScanningAlertLocationDetails{}\n\ts.GetCommitURL()\n\ts = nil\n\ts.GetCommitURL()\n}\n\nfunc TestSecretScanningAlertLocationDetails_GetEndColumn(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ts := &SecretScanningAlertLocationDetails{EndColumn: &zeroValue}\n\ts.GetEndColumn()\n\ts = &SecretScanningAlertLocationDetails{}\n\ts.GetEndColumn()\n\ts = nil\n\ts.GetEndColumn()\n}\n\nfunc TestSecretScanningAlertLocationDetails_GetEndLine(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ts := &SecretScanningAlertLocationDetails{EndLine: &zeroValue}\n\ts.GetEndLine()\n\ts = &SecretScanningAlertLocationDetails{}\n\ts.GetEndLine()\n\ts = nil\n\ts.GetEndLine()\n}\n\nfunc TestSecretScanningAlertLocationDetails_GetPath(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningAlertLocationDetails{Path: &zeroValue}\n\ts.GetPath()\n\ts = &SecretScanningAlertLocationDetails{}\n\ts.GetPath()\n\ts = nil\n\ts.GetPath()\n}\n\nfunc TestSecretScanningAlertLocationDetails_GetPullRequestCommentURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningAlertLocationDetails{PullRequestCommentURL: &zeroValue}\n\ts.GetPullRequestCommentURL()\n\ts = &SecretScanningAlertLocationDetails{}\n\ts.GetPullRequestCommentURL()\n\ts = nil\n\ts.GetPullRequestCommentURL()\n}\n\nfunc TestSecretScanningAlertLocationDetails_GetStartColumn(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ts := &SecretScanningAlertLocationDetails{StartColumn: &zeroValue}\n\ts.GetStartColumn()\n\ts = &SecretScanningAlertLocationDetails{}\n\ts.GetStartColumn()\n\ts = nil\n\ts.GetStartColumn()\n}\n\nfunc TestSecretScanningAlertLocationDetails_GetStartline(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ts := &SecretScanningAlertLocationDetails{Startline: &zeroValue}\n\ts.GetStartline()\n\ts = &SecretScanningAlertLocationDetails{}\n\ts.GetStartline()\n\ts = nil\n\ts.GetStartline()\n}\n\nfunc TestSecretScanningAlertLocationEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningAlertLocationEvent{Action: &zeroValue}\n\ts.GetAction()\n\ts = &SecretScanningAlertLocationEvent{}\n\ts.GetAction()\n\ts = nil\n\ts.GetAction()\n}\n\nfunc TestSecretScanningAlertLocationEvent_GetAlert(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningAlertLocationEvent{}\n\ts.GetAlert()\n\ts = nil\n\ts.GetAlert()\n}\n\nfunc TestSecretScanningAlertLocationEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningAlertLocationEvent{}\n\ts.GetInstallation()\n\ts = nil\n\ts.GetInstallation()\n}\n\nfunc TestSecretScanningAlertLocationEvent_GetLocation(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningAlertLocationEvent{}\n\ts.GetLocation()\n\ts = nil\n\ts.GetLocation()\n}\n\nfunc TestSecretScanningAlertLocationEvent_GetOrganization(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningAlertLocationEvent{}\n\ts.GetOrganization()\n\ts = nil\n\ts.GetOrganization()\n}\n\nfunc TestSecretScanningAlertLocationEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningAlertLocationEvent{}\n\ts.GetRepo()\n\ts = nil\n\ts.GetRepo()\n}\n\nfunc TestSecretScanningAlertLocationEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningAlertLocationEvent{}\n\ts.GetSender()\n\ts = nil\n\ts.GetSender()\n}\n\nfunc TestSecretScanningAlertUpdateOptions_GetResolution(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningAlertUpdateOptions{Resolution: &zeroValue}\n\ts.GetResolution()\n\ts = &SecretScanningAlertUpdateOptions{}\n\ts.GetResolution()\n\ts = nil\n\ts.GetResolution()\n}\n\nfunc TestSecretScanningAlertUpdateOptions_GetResolutionComment(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningAlertUpdateOptions{ResolutionComment: &zeroValue}\n\ts.GetResolutionComment()\n\ts = &SecretScanningAlertUpdateOptions{}\n\ts.GetResolutionComment()\n\ts = nil\n\ts.GetResolutionComment()\n}\n\nfunc TestSecretScanningAlertUpdateOptions_GetState(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningAlertUpdateOptions{}\n\ts.GetState()\n\ts = nil\n\ts.GetState()\n}\n\nfunc TestSecretScanningCustomPatternSetting_GetCustomPatternVersion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningCustomPatternSetting{CustomPatternVersion: &zeroValue}\n\ts.GetCustomPatternVersion()\n\ts = &SecretScanningCustomPatternSetting{}\n\ts.GetCustomPatternVersion()\n\ts = nil\n\ts.GetCustomPatternVersion()\n}\n\nfunc TestSecretScanningCustomPatternSetting_GetPushProtectionSetting(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningCustomPatternSetting{}\n\ts.GetPushProtectionSetting()\n\ts = nil\n\ts.GetPushProtectionSetting()\n}\n\nfunc TestSecretScanningCustomPatternSetting_GetTokenType(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningCustomPatternSetting{}\n\ts.GetTokenType()\n\ts = nil\n\ts.GetTokenType()\n}\n\nfunc TestSecretScanningDelegatedBypassOptions_GetReviewers(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*BypassReviewer{}\n\ts := &SecretScanningDelegatedBypassOptions{Reviewers: zeroValue}\n\ts.GetReviewers()\n\ts = &SecretScanningDelegatedBypassOptions{}\n\ts.GetReviewers()\n\ts = nil\n\ts.GetReviewers()\n}\n\nfunc TestSecretScanningPatternConfigs_GetCustomPatternOverrides(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*SecretScanningPatternOverride{}\n\ts := &SecretScanningPatternConfigs{CustomPatternOverrides: zeroValue}\n\ts.GetCustomPatternOverrides()\n\ts = &SecretScanningPatternConfigs{}\n\ts.GetCustomPatternOverrides()\n\ts = nil\n\ts.GetCustomPatternOverrides()\n}\n\nfunc TestSecretScanningPatternConfigs_GetPatternConfigVersion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningPatternConfigs{PatternConfigVersion: &zeroValue}\n\ts.GetPatternConfigVersion()\n\ts = &SecretScanningPatternConfigs{}\n\ts.GetPatternConfigVersion()\n\ts = nil\n\ts.GetPatternConfigVersion()\n}\n\nfunc TestSecretScanningPatternConfigs_GetProviderPatternOverrides(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*SecretScanningPatternOverride{}\n\ts := &SecretScanningPatternConfigs{ProviderPatternOverrides: zeroValue}\n\ts.GetProviderPatternOverrides()\n\ts = &SecretScanningPatternConfigs{}\n\ts.GetProviderPatternOverrides()\n\ts = nil\n\ts.GetProviderPatternOverrides()\n}\n\nfunc TestSecretScanningPatternConfigsUpdate_GetPatternConfigVersion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningPatternConfigsUpdate{PatternConfigVersion: &zeroValue}\n\ts.GetPatternConfigVersion()\n\ts = &SecretScanningPatternConfigsUpdate{}\n\ts.GetPatternConfigVersion()\n\ts = nil\n\ts.GetPatternConfigVersion()\n}\n\nfunc TestSecretScanningPatternConfigsUpdateOptions_GetCustomPatternSettings(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*SecretScanningCustomPatternSetting{}\n\ts := &SecretScanningPatternConfigsUpdateOptions{CustomPatternSettings: zeroValue}\n\ts.GetCustomPatternSettings()\n\ts = &SecretScanningPatternConfigsUpdateOptions{}\n\ts.GetCustomPatternSettings()\n\ts = nil\n\ts.GetCustomPatternSettings()\n}\n\nfunc TestSecretScanningPatternConfigsUpdateOptions_GetPatternConfigVersion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningPatternConfigsUpdateOptions{PatternConfigVersion: &zeroValue}\n\ts.GetPatternConfigVersion()\n\ts = &SecretScanningPatternConfigsUpdateOptions{}\n\ts.GetPatternConfigVersion()\n\ts = nil\n\ts.GetPatternConfigVersion()\n}\n\nfunc TestSecretScanningPatternConfigsUpdateOptions_GetProviderPatternSettings(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*SecretScanningProviderPatternSetting{}\n\ts := &SecretScanningPatternConfigsUpdateOptions{ProviderPatternSettings: zeroValue}\n\ts.GetProviderPatternSettings()\n\ts = &SecretScanningPatternConfigsUpdateOptions{}\n\ts.GetProviderPatternSettings()\n\ts = nil\n\ts.GetProviderPatternSettings()\n}\n\nfunc TestSecretScanningPatternOverride_GetAlertTotal(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ts := &SecretScanningPatternOverride{AlertTotal: &zeroValue}\n\ts.GetAlertTotal()\n\ts = &SecretScanningPatternOverride{}\n\ts.GetAlertTotal()\n\ts = nil\n\ts.GetAlertTotal()\n}\n\nfunc TestSecretScanningPatternOverride_GetAlertTotalPercentage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ts := &SecretScanningPatternOverride{AlertTotalPercentage: &zeroValue}\n\ts.GetAlertTotalPercentage()\n\ts = &SecretScanningPatternOverride{}\n\ts.GetAlertTotalPercentage()\n\ts = nil\n\ts.GetAlertTotalPercentage()\n}\n\nfunc TestSecretScanningPatternOverride_GetBypassrate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ts := &SecretScanningPatternOverride{Bypassrate: &zeroValue}\n\ts.GetBypassrate()\n\ts = &SecretScanningPatternOverride{}\n\ts.GetBypassrate()\n\ts = nil\n\ts.GetBypassrate()\n}\n\nfunc TestSecretScanningPatternOverride_GetCustomPatternVersion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningPatternOverride{CustomPatternVersion: &zeroValue}\n\ts.GetCustomPatternVersion()\n\ts = &SecretScanningPatternOverride{}\n\ts.GetCustomPatternVersion()\n\ts = nil\n\ts.GetCustomPatternVersion()\n}\n\nfunc TestSecretScanningPatternOverride_GetDefaultSetting(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningPatternOverride{DefaultSetting: &zeroValue}\n\ts.GetDefaultSetting()\n\ts = &SecretScanningPatternOverride{}\n\ts.GetDefaultSetting()\n\ts = nil\n\ts.GetDefaultSetting()\n}\n\nfunc TestSecretScanningPatternOverride_GetDisplayName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningPatternOverride{DisplayName: &zeroValue}\n\ts.GetDisplayName()\n\ts = &SecretScanningPatternOverride{}\n\ts.GetDisplayName()\n\ts = nil\n\ts.GetDisplayName()\n}\n\nfunc TestSecretScanningPatternOverride_GetEnterpriseSetting(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningPatternOverride{EnterpriseSetting: &zeroValue}\n\ts.GetEnterpriseSetting()\n\ts = &SecretScanningPatternOverride{}\n\ts.GetEnterpriseSetting()\n\ts = nil\n\ts.GetEnterpriseSetting()\n}\n\nfunc TestSecretScanningPatternOverride_GetFalsePositiveRate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ts := &SecretScanningPatternOverride{FalsePositiveRate: &zeroValue}\n\ts.GetFalsePositiveRate()\n\ts = &SecretScanningPatternOverride{}\n\ts.GetFalsePositiveRate()\n\ts = nil\n\ts.GetFalsePositiveRate()\n}\n\nfunc TestSecretScanningPatternOverride_GetFalsePositives(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ts := &SecretScanningPatternOverride{FalsePositives: &zeroValue}\n\ts.GetFalsePositives()\n\ts = &SecretScanningPatternOverride{}\n\ts.GetFalsePositives()\n\ts = nil\n\ts.GetFalsePositives()\n}\n\nfunc TestSecretScanningPatternOverride_GetSetting(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningPatternOverride{Setting: &zeroValue}\n\ts.GetSetting()\n\ts = &SecretScanningPatternOverride{}\n\ts.GetSetting()\n\ts = nil\n\ts.GetSetting()\n}\n\nfunc TestSecretScanningPatternOverride_GetSlug(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningPatternOverride{Slug: &zeroValue}\n\ts.GetSlug()\n\ts = &SecretScanningPatternOverride{}\n\ts.GetSlug()\n\ts = nil\n\ts.GetSlug()\n}\n\nfunc TestSecretScanningPatternOverride_GetTokenType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningPatternOverride{TokenType: &zeroValue}\n\ts.GetTokenType()\n\ts = &SecretScanningPatternOverride{}\n\ts.GetTokenType()\n\ts = nil\n\ts.GetTokenType()\n}\n\nfunc TestSecretScanningProviderPatternSetting_GetPushProtectionSetting(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningProviderPatternSetting{}\n\ts.GetPushProtectionSetting()\n\ts = nil\n\ts.GetPushProtectionSetting()\n}\n\nfunc TestSecretScanningProviderPatternSetting_GetTokenType(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretScanningProviderPatternSetting{}\n\ts.GetTokenType()\n\ts = nil\n\ts.GetTokenType()\n}\n\nfunc TestSecretScanningPushProtection_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningPushProtection{Status: &zeroValue}\n\ts.GetStatus()\n\ts = &SecretScanningPushProtection{}\n\ts.GetStatus()\n\ts = nil\n\ts.GetStatus()\n}\n\nfunc TestSecretScanningScanHistory_GetBackfillScans(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*SecretsScan{}\n\ts := &SecretScanningScanHistory{BackfillScans: zeroValue}\n\ts.GetBackfillScans()\n\ts = &SecretScanningScanHistory{}\n\ts.GetBackfillScans()\n\ts = nil\n\ts.GetBackfillScans()\n}\n\nfunc TestSecretScanningScanHistory_GetCustomPatternBackfillScans(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CustomPatternBackfillScan{}\n\ts := &SecretScanningScanHistory{CustomPatternBackfillScans: zeroValue}\n\ts.GetCustomPatternBackfillScans()\n\ts = &SecretScanningScanHistory{}\n\ts.GetCustomPatternBackfillScans()\n\ts = nil\n\ts.GetCustomPatternBackfillScans()\n}\n\nfunc TestSecretScanningScanHistory_GetIncrementalScans(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*SecretsScan{}\n\ts := &SecretScanningScanHistory{IncrementalScans: zeroValue}\n\ts.GetIncrementalScans()\n\ts = &SecretScanningScanHistory{}\n\ts.GetIncrementalScans()\n\ts = nil\n\ts.GetIncrementalScans()\n}\n\nfunc TestSecretScanningScanHistory_GetPatternUpdateScans(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*SecretsScan{}\n\ts := &SecretScanningScanHistory{PatternUpdateScans: zeroValue}\n\ts.GetPatternUpdateScans()\n\ts = &SecretScanningScanHistory{}\n\ts.GetPatternUpdateScans()\n\ts = nil\n\ts.GetPatternUpdateScans()\n}\n\nfunc TestSecretScanningValidityChecks_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecretScanningValidityChecks{Status: &zeroValue}\n\ts.GetStatus()\n\ts = &SecretScanningValidityChecks{}\n\ts.GetStatus()\n\ts = nil\n\ts.GetStatus()\n}\n\nfunc TestSecretsScan_GetCompletedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ts := &SecretsScan{CompletedAt: &zeroValue}\n\ts.GetCompletedAt()\n\ts = &SecretsScan{}\n\ts.GetCompletedAt()\n\ts = nil\n\ts.GetCompletedAt()\n}\n\nfunc TestSecretsScan_GetStartedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ts := &SecretsScan{StartedAt: &zeroValue}\n\ts.GetStartedAt()\n\ts = &SecretsScan{}\n\ts.GetStartedAt()\n\ts = nil\n\ts.GetStartedAt()\n}\n\nfunc TestSecretsScan_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretsScan{}\n\ts.GetStatus()\n\ts = nil\n\ts.GetStatus()\n}\n\nfunc TestSecretsScan_GetType(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecretsScan{}\n\ts.GetType()\n\ts = nil\n\ts.GetType()\n}\n\nfunc TestSecurityAdvisory_GetAuthor(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecurityAdvisory{}\n\ts.GetAuthor()\n\ts = nil\n\ts.GetAuthor()\n}\n\nfunc TestSecurityAdvisory_GetClosedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ts := &SecurityAdvisory{ClosedAt: &zeroValue}\n\ts.GetClosedAt()\n\ts = &SecurityAdvisory{}\n\ts.GetClosedAt()\n\ts = nil\n\ts.GetClosedAt()\n}\n\nfunc TestSecurityAdvisory_GetCollaboratingTeams(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Team{}\n\ts := &SecurityAdvisory{CollaboratingTeams: zeroValue}\n\ts.GetCollaboratingTeams()\n\ts = &SecurityAdvisory{}\n\ts.GetCollaboratingTeams()\n\ts = nil\n\ts.GetCollaboratingTeams()\n}\n\nfunc TestSecurityAdvisory_GetCollaboratingUsers(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*User{}\n\ts := &SecurityAdvisory{CollaboratingUsers: zeroValue}\n\ts.GetCollaboratingUsers()\n\ts = &SecurityAdvisory{}\n\ts.GetCollaboratingUsers()\n\ts = nil\n\ts.GetCollaboratingUsers()\n}\n\nfunc TestSecurityAdvisory_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ts := &SecurityAdvisory{CreatedAt: &zeroValue}\n\ts.GetCreatedAt()\n\ts = &SecurityAdvisory{}\n\ts.GetCreatedAt()\n\ts = nil\n\ts.GetCreatedAt()\n}\n\nfunc TestSecurityAdvisory_GetCredits(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*RepoAdvisoryCredit{}\n\ts := &SecurityAdvisory{Credits: zeroValue}\n\ts.GetCredits()\n\ts = &SecurityAdvisory{}\n\ts.GetCredits()\n\ts = nil\n\ts.GetCredits()\n}\n\nfunc TestSecurityAdvisory_GetCreditsDetailed(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*RepoAdvisoryCreditDetailed{}\n\ts := &SecurityAdvisory{CreditsDetailed: zeroValue}\n\ts.GetCreditsDetailed()\n\ts = &SecurityAdvisory{}\n\ts.GetCreditsDetailed()\n\ts = nil\n\ts.GetCreditsDetailed()\n}\n\nfunc TestSecurityAdvisory_GetCVEID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecurityAdvisory{CVEID: &zeroValue}\n\ts.GetCVEID()\n\ts = &SecurityAdvisory{}\n\ts.GetCVEID()\n\ts = nil\n\ts.GetCVEID()\n}\n\nfunc TestSecurityAdvisory_GetCVSS(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecurityAdvisory{}\n\ts.GetCVSS()\n\ts = nil\n\ts.GetCVSS()\n}\n\nfunc TestSecurityAdvisory_GetCWEIDs(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\ts := &SecurityAdvisory{CWEIDs: zeroValue}\n\ts.GetCWEIDs()\n\ts = &SecurityAdvisory{}\n\ts.GetCWEIDs()\n\ts = nil\n\ts.GetCWEIDs()\n}\n\nfunc TestSecurityAdvisory_GetCWEs(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*AdvisoryCWEs{}\n\ts := &SecurityAdvisory{CWEs: zeroValue}\n\ts.GetCWEs()\n\ts = &SecurityAdvisory{}\n\ts.GetCWEs()\n\ts = nil\n\ts.GetCWEs()\n}\n\nfunc TestSecurityAdvisory_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecurityAdvisory{Description: &zeroValue}\n\ts.GetDescription()\n\ts = &SecurityAdvisory{}\n\ts.GetDescription()\n\ts = nil\n\ts.GetDescription()\n}\n\nfunc TestSecurityAdvisory_GetGHSAID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecurityAdvisory{GHSAID: &zeroValue}\n\ts.GetGHSAID()\n\ts = &SecurityAdvisory{}\n\ts.GetGHSAID()\n\ts = nil\n\ts.GetGHSAID()\n}\n\nfunc TestSecurityAdvisory_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecurityAdvisory{HTMLURL: &zeroValue}\n\ts.GetHTMLURL()\n\ts = &SecurityAdvisory{}\n\ts.GetHTMLURL()\n\ts = nil\n\ts.GetHTMLURL()\n}\n\nfunc TestSecurityAdvisory_GetIdentifiers(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*AdvisoryIdentifier{}\n\ts := &SecurityAdvisory{Identifiers: zeroValue}\n\ts.GetIdentifiers()\n\ts = &SecurityAdvisory{}\n\ts.GetIdentifiers()\n\ts = nil\n\ts.GetIdentifiers()\n}\n\nfunc TestSecurityAdvisory_GetPrivateFork(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecurityAdvisory{}\n\ts.GetPrivateFork()\n\ts = nil\n\ts.GetPrivateFork()\n}\n\nfunc TestSecurityAdvisory_GetPublishedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ts := &SecurityAdvisory{PublishedAt: &zeroValue}\n\ts.GetPublishedAt()\n\ts = &SecurityAdvisory{}\n\ts.GetPublishedAt()\n\ts = nil\n\ts.GetPublishedAt()\n}\n\nfunc TestSecurityAdvisory_GetPublisher(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecurityAdvisory{}\n\ts.GetPublisher()\n\ts = nil\n\ts.GetPublisher()\n}\n\nfunc TestSecurityAdvisory_GetReferences(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*AdvisoryReference{}\n\ts := &SecurityAdvisory{References: zeroValue}\n\ts.GetReferences()\n\ts = &SecurityAdvisory{}\n\ts.GetReferences()\n\ts = nil\n\ts.GetReferences()\n}\n\nfunc TestSecurityAdvisory_GetSeverity(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecurityAdvisory{Severity: &zeroValue}\n\ts.GetSeverity()\n\ts = &SecurityAdvisory{}\n\ts.GetSeverity()\n\ts = nil\n\ts.GetSeverity()\n}\n\nfunc TestSecurityAdvisory_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecurityAdvisory{State: &zeroValue}\n\ts.GetState()\n\ts = &SecurityAdvisory{}\n\ts.GetState()\n\ts = nil\n\ts.GetState()\n}\n\nfunc TestSecurityAdvisory_GetSubmission(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecurityAdvisory{}\n\ts.GetSubmission()\n\ts = nil\n\ts.GetSubmission()\n}\n\nfunc TestSecurityAdvisory_GetSummary(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecurityAdvisory{Summary: &zeroValue}\n\ts.GetSummary()\n\ts = &SecurityAdvisory{}\n\ts.GetSummary()\n\ts = nil\n\ts.GetSummary()\n}\n\nfunc TestSecurityAdvisory_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ts := &SecurityAdvisory{UpdatedAt: &zeroValue}\n\ts.GetUpdatedAt()\n\ts = &SecurityAdvisory{}\n\ts.GetUpdatedAt()\n\ts = nil\n\ts.GetUpdatedAt()\n}\n\nfunc TestSecurityAdvisory_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecurityAdvisory{URL: &zeroValue}\n\ts.GetURL()\n\ts = &SecurityAdvisory{}\n\ts.GetURL()\n\ts = nil\n\ts.GetURL()\n}\n\nfunc TestSecurityAdvisory_GetVulnerabilities(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*AdvisoryVulnerability{}\n\ts := &SecurityAdvisory{Vulnerabilities: zeroValue}\n\ts.GetVulnerabilities()\n\ts = &SecurityAdvisory{}\n\ts.GetVulnerabilities()\n\ts = nil\n\ts.GetVulnerabilities()\n}\n\nfunc TestSecurityAdvisory_GetWithdrawnAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ts := &SecurityAdvisory{WithdrawnAt: &zeroValue}\n\ts.GetWithdrawnAt()\n\ts = &SecurityAdvisory{}\n\ts.GetWithdrawnAt()\n\ts = nil\n\ts.GetWithdrawnAt()\n}\n\nfunc TestSecurityAdvisoryEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SecurityAdvisoryEvent{Action: &zeroValue}\n\ts.GetAction()\n\ts = &SecurityAdvisoryEvent{}\n\ts.GetAction()\n\ts = nil\n\ts.GetAction()\n}\n\nfunc TestSecurityAdvisoryEvent_GetEnterprise(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecurityAdvisoryEvent{}\n\ts.GetEnterprise()\n\ts = nil\n\ts.GetEnterprise()\n}\n\nfunc TestSecurityAdvisoryEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecurityAdvisoryEvent{}\n\ts.GetInstallation()\n\ts = nil\n\ts.GetInstallation()\n}\n\nfunc TestSecurityAdvisoryEvent_GetOrganization(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecurityAdvisoryEvent{}\n\ts.GetOrganization()\n\ts = nil\n\ts.GetOrganization()\n}\n\nfunc TestSecurityAdvisoryEvent_GetRepository(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecurityAdvisoryEvent{}\n\ts.GetRepository()\n\ts = nil\n\ts.GetRepository()\n}\n\nfunc TestSecurityAdvisoryEvent_GetSecurityAdvisory(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecurityAdvisoryEvent{}\n\ts.GetSecurityAdvisory()\n\ts = nil\n\ts.GetSecurityAdvisory()\n}\n\nfunc TestSecurityAdvisoryEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecurityAdvisoryEvent{}\n\ts.GetSender()\n\ts = nil\n\ts.GetSender()\n}\n\nfunc TestSecurityAdvisorySubmission_GetAccepted(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ts := &SecurityAdvisorySubmission{Accepted: &zeroValue}\n\ts.GetAccepted()\n\ts = &SecurityAdvisorySubmission{}\n\ts.GetAccepted()\n\ts = nil\n\ts.GetAccepted()\n}\n\nfunc TestSecurityAndAnalysis_GetAdvancedSecurity(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecurityAndAnalysis{}\n\ts.GetAdvancedSecurity()\n\ts = nil\n\ts.GetAdvancedSecurity()\n}\n\nfunc TestSecurityAndAnalysis_GetDependabotSecurityUpdates(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecurityAndAnalysis{}\n\ts.GetDependabotSecurityUpdates()\n\ts = nil\n\ts.GetDependabotSecurityUpdates()\n}\n\nfunc TestSecurityAndAnalysis_GetSecretScanning(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecurityAndAnalysis{}\n\ts.GetSecretScanning()\n\ts = nil\n\ts.GetSecretScanning()\n}\n\nfunc TestSecurityAndAnalysis_GetSecretScanningPushProtection(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecurityAndAnalysis{}\n\ts.GetSecretScanningPushProtection()\n\ts = nil\n\ts.GetSecretScanningPushProtection()\n}\n\nfunc TestSecurityAndAnalysis_GetSecretScanningValidityChecks(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecurityAndAnalysis{}\n\ts.GetSecretScanningValidityChecks()\n\ts = nil\n\ts.GetSecretScanningValidityChecks()\n}\n\nfunc TestSecurityAndAnalysisChange_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecurityAndAnalysisChange{}\n\ts.GetFrom()\n\ts = nil\n\ts.GetFrom()\n}\n\nfunc TestSecurityAndAnalysisChangeFrom_GetSecurityAndAnalysis(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecurityAndAnalysisChangeFrom{}\n\ts.GetSecurityAndAnalysis()\n\ts = nil\n\ts.GetSecurityAndAnalysis()\n}\n\nfunc TestSecurityAndAnalysisEvent_GetChanges(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecurityAndAnalysisEvent{}\n\ts.GetChanges()\n\ts = nil\n\ts.GetChanges()\n}\n\nfunc TestSecurityAndAnalysisEvent_GetEnterprise(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecurityAndAnalysisEvent{}\n\ts.GetEnterprise()\n\ts = nil\n\ts.GetEnterprise()\n}\n\nfunc TestSecurityAndAnalysisEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecurityAndAnalysisEvent{}\n\ts.GetInstallation()\n\ts = nil\n\ts.GetInstallation()\n}\n\nfunc TestSecurityAndAnalysisEvent_GetOrganization(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecurityAndAnalysisEvent{}\n\ts.GetOrganization()\n\ts = nil\n\ts.GetOrganization()\n}\n\nfunc TestSecurityAndAnalysisEvent_GetRepository(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecurityAndAnalysisEvent{}\n\ts.GetRepository()\n\ts = nil\n\ts.GetRepository()\n}\n\nfunc TestSecurityAndAnalysisEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SecurityAndAnalysisEvent{}\n\ts.GetSender()\n\ts = nil\n\ts.GetSender()\n}\n\nfunc TestSelectedReposList_GetRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Repository{}\n\ts := &SelectedReposList{Repositories: zeroValue}\n\ts.GetRepositories()\n\ts = &SelectedReposList{}\n\ts.GetRepositories()\n\ts = nil\n\ts.GetRepositories()\n}\n\nfunc TestSelectedReposList_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\ts := &SelectedReposList{TotalCount: &zeroValue}\n\ts.GetTotalCount()\n\ts = &SelectedReposList{}\n\ts.GetTotalCount()\n\ts = nil\n\ts.GetTotalCount()\n}\n\nfunc TestSelfHostedRunnersAllowedRepos_GetRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Repository{}\n\ts := &SelfHostedRunnersAllowedRepos{Repositories: zeroValue}\n\ts.GetRepositories()\n\ts = &SelfHostedRunnersAllowedRepos{}\n\ts.GetRepositories()\n\ts = nil\n\ts.GetRepositories()\n}\n\nfunc TestSelfHostedRunnersAllowedRepos_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SelfHostedRunnersAllowedRepos{}\n\ts.GetTotalCount()\n\ts = nil\n\ts.GetTotalCount()\n}\n\nfunc TestSelfHostedRunnersSettingsOrganization_GetEnabledRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SelfHostedRunnersSettingsOrganization{EnabledRepositories: &zeroValue}\n\ts.GetEnabledRepositories()\n\ts = &SelfHostedRunnersSettingsOrganization{}\n\ts.GetEnabledRepositories()\n\ts = nil\n\ts.GetEnabledRepositories()\n}\n\nfunc TestSelfHostedRunnersSettingsOrganization_GetSelectedRepositoriesURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SelfHostedRunnersSettingsOrganization{SelectedRepositoriesURL: &zeroValue}\n\ts.GetSelectedRepositoriesURL()\n\ts = &SelfHostedRunnersSettingsOrganization{}\n\ts.GetSelectedRepositoriesURL()\n\ts = nil\n\ts.GetSelectedRepositoriesURL()\n}\n\nfunc TestSelfHostedRunnersSettingsOrganizationOpt_GetEnabledRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SelfHostedRunnersSettingsOrganizationOpt{EnabledRepositories: &zeroValue}\n\ts.GetEnabledRepositories()\n\ts = &SelfHostedRunnersSettingsOrganizationOpt{}\n\ts.GetEnabledRepositories()\n\ts = nil\n\ts.GetEnabledRepositories()\n}\n\nfunc TestSelfHostRunnerPermissionsEnterprise_GetDisableSelfHostedRunnersForAllOrgs(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ts := &SelfHostRunnerPermissionsEnterprise{DisableSelfHostedRunnersForAllOrgs: &zeroValue}\n\ts.GetDisableSelfHostedRunnersForAllOrgs()\n\ts = &SelfHostRunnerPermissionsEnterprise{}\n\ts.GetDisableSelfHostedRunnersForAllOrgs()\n\ts = nil\n\ts.GetDisableSelfHostedRunnersForAllOrgs()\n}\n\nfunc TestServerInstanceProperties_GetServerInstances(tt *testing.T) {\n\ttt.Parallel()\n\ts := &ServerInstanceProperties{}\n\ts.GetServerInstances()\n\ts = nil\n\ts.GetServerInstances()\n}\n\nfunc TestServerInstances_GetItems(tt *testing.T) {\n\ttt.Parallel()\n\ts := &ServerInstances{}\n\ts.GetItems()\n\ts = nil\n\ts.GetItems()\n}\n\nfunc TestServerInstances_GetType(tt *testing.T) {\n\ttt.Parallel()\n\ts := &ServerInstances{}\n\ts.GetType()\n\ts = nil\n\ts.GetType()\n}\n\nfunc TestServerItemProperties_GetHostname(tt *testing.T) {\n\ttt.Parallel()\n\ts := &ServerItemProperties{}\n\ts.GetHostname()\n\ts = nil\n\ts.GetHostname()\n}\n\nfunc TestServerItemProperties_GetLastSync(tt *testing.T) {\n\ttt.Parallel()\n\ts := &ServerItemProperties{}\n\ts.GetLastSync()\n\ts = nil\n\ts.GetLastSync()\n}\n\nfunc TestServerItemProperties_GetServerID(tt *testing.T) {\n\ttt.Parallel()\n\ts := &ServerItemProperties{}\n\ts.GetServerID()\n\ts = nil\n\ts.GetServerID()\n}\n\nfunc TestServiceInstanceItems_GetProperties(tt *testing.T) {\n\ttt.Parallel()\n\ts := &ServiceInstanceItems{}\n\ts.GetProperties()\n\ts = nil\n\ts.GetProperties()\n}\n\nfunc TestServiceInstanceItems_GetType(tt *testing.T) {\n\ttt.Parallel()\n\ts := &ServiceInstanceItems{}\n\ts.GetType()\n\ts = nil\n\ts.GetType()\n}\n\nfunc TestSetOrgAccessRunnerGroupRequest_GetSelectedOrganizationIDs(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []int64{}\n\ts := &SetOrgAccessRunnerGroupRequest{SelectedOrganizationIDs: zeroValue}\n\ts.GetSelectedOrganizationIDs()\n\ts = &SetOrgAccessRunnerGroupRequest{}\n\ts.GetSelectedOrganizationIDs()\n\ts = nil\n\ts.GetSelectedOrganizationIDs()\n}\n\nfunc TestSetRepoAccessRunnerGroupRequest_GetSelectedRepositoryIDs(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []int64{}\n\ts := &SetRepoAccessRunnerGroupRequest{SelectedRepositoryIDs: zeroValue}\n\ts.GetSelectedRepositoryIDs()\n\ts = &SetRepoAccessRunnerGroupRequest{}\n\ts.GetSelectedRepositoryIDs()\n\ts = nil\n\ts.GetSelectedRepositoryIDs()\n}\n\nfunc TestSetRunnerGroupRunnersRequest_GetRunners(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []int64{}\n\ts := &SetRunnerGroupRunnersRequest{Runners: zeroValue}\n\ts.GetRunners()\n\ts = &SetRunnerGroupRunnersRequest{}\n\ts.GetRunners()\n\ts = nil\n\ts.GetRunners()\n}\n\nfunc TestSignatureRequirementEnforcementLevelChanges_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SignatureRequirementEnforcementLevelChanges{From: &zeroValue}\n\ts.GetFrom()\n\ts = &SignatureRequirementEnforcementLevelChanges{}\n\ts.GetFrom()\n\ts = nil\n\ts.GetFrom()\n}\n\nfunc TestSignaturesProtectedBranch_GetEnabled(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ts := &SignaturesProtectedBranch{Enabled: &zeroValue}\n\ts.GetEnabled()\n\ts = &SignaturesProtectedBranch{}\n\ts.GetEnabled()\n\ts = nil\n\ts.GetEnabled()\n}\n\nfunc TestSignaturesProtectedBranch_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SignaturesProtectedBranch{URL: &zeroValue}\n\ts.GetURL()\n\ts = &SignaturesProtectedBranch{}\n\ts.GetURL()\n\ts = nil\n\ts.GetURL()\n}\n\nfunc TestSignatureVerification_GetPayload(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SignatureVerification{Payload: &zeroValue}\n\ts.GetPayload()\n\ts = &SignatureVerification{}\n\ts.GetPayload()\n\ts = nil\n\ts.GetPayload()\n}\n\nfunc TestSignatureVerification_GetReason(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SignatureVerification{Reason: &zeroValue}\n\ts.GetReason()\n\ts = &SignatureVerification{}\n\ts.GetReason()\n\ts = nil\n\ts.GetReason()\n}\n\nfunc TestSignatureVerification_GetSignature(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SignatureVerification{Signature: &zeroValue}\n\ts.GetSignature()\n\ts = &SignatureVerification{}\n\ts.GetSignature()\n\ts = nil\n\ts.GetSignature()\n}\n\nfunc TestSignatureVerification_GetVerified(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ts := &SignatureVerification{Verified: &zeroValue}\n\ts.GetVerified()\n\ts = &SignatureVerification{}\n\ts.GetVerified()\n\ts = nil\n\ts.GetVerified()\n}\n\nfunc TestSimplePatternRuleParameters_GetNegate(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SimplePatternRuleParameters{}\n\ts.GetNegate()\n\ts = nil\n\ts.GetNegate()\n}\n\nfunc TestSimplePatternRuleParameters_GetPattern(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SimplePatternRuleParameters{}\n\ts.GetPattern()\n\ts = nil\n\ts.GetPattern()\n}\n\nfunc TestSocialAccount_GetProvider(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SocialAccount{Provider: &zeroValue}\n\ts.GetProvider()\n\ts = &SocialAccount{}\n\ts.GetProvider()\n\ts = nil\n\ts.GetProvider()\n}\n\nfunc TestSocialAccount_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SocialAccount{URL: &zeroValue}\n\ts.GetURL()\n\ts = &SocialAccount{}\n\ts.GetURL()\n\ts = nil\n\ts.GetURL()\n}\n\nfunc TestSource_GetActor(tt *testing.T) {\n\ttt.Parallel()\n\ts := &Source{}\n\ts.GetActor()\n\ts = nil\n\ts.GetActor()\n}\n\nfunc TestSource_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ts := &Source{ID: &zeroValue}\n\ts.GetID()\n\ts = &Source{}\n\ts.GetID()\n\ts = nil\n\ts.GetID()\n}\n\nfunc TestSource_GetIssue(tt *testing.T) {\n\ttt.Parallel()\n\ts := &Source{}\n\ts.GetIssue()\n\ts = nil\n\ts.GetIssue()\n}\n\nfunc TestSource_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &Source{Type: &zeroValue}\n\ts.GetType()\n\ts = &Source{}\n\ts.GetType()\n\ts = nil\n\ts.GetType()\n}\n\nfunc TestSource_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &Source{URL: &zeroValue}\n\ts.GetURL()\n\ts = &Source{}\n\ts.GetURL()\n\ts = nil\n\ts.GetURL()\n}\n\nfunc TestSourceImportAuthor_GetEmail(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SourceImportAuthor{Email: &zeroValue}\n\ts.GetEmail()\n\ts = &SourceImportAuthor{}\n\ts.GetEmail()\n\ts = nil\n\ts.GetEmail()\n}\n\nfunc TestSourceImportAuthor_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ts := &SourceImportAuthor{ID: &zeroValue}\n\ts.GetID()\n\ts = &SourceImportAuthor{}\n\ts.GetID()\n\ts = nil\n\ts.GetID()\n}\n\nfunc TestSourceImportAuthor_GetImportURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SourceImportAuthor{ImportURL: &zeroValue}\n\ts.GetImportURL()\n\ts = &SourceImportAuthor{}\n\ts.GetImportURL()\n\ts = nil\n\ts.GetImportURL()\n}\n\nfunc TestSourceImportAuthor_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SourceImportAuthor{Name: &zeroValue}\n\ts.GetName()\n\ts = &SourceImportAuthor{}\n\ts.GetName()\n\ts = nil\n\ts.GetName()\n}\n\nfunc TestSourceImportAuthor_GetRemoteID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SourceImportAuthor{RemoteID: &zeroValue}\n\ts.GetRemoteID()\n\ts = &SourceImportAuthor{}\n\ts.GetRemoteID()\n\ts = nil\n\ts.GetRemoteID()\n}\n\nfunc TestSourceImportAuthor_GetRemoteName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SourceImportAuthor{RemoteName: &zeroValue}\n\ts.GetRemoteName()\n\ts = &SourceImportAuthor{}\n\ts.GetRemoteName()\n\ts = nil\n\ts.GetRemoteName()\n}\n\nfunc TestSourceImportAuthor_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SourceImportAuthor{URL: &zeroValue}\n\ts.GetURL()\n\ts = &SourceImportAuthor{}\n\ts.GetURL()\n\ts = nil\n\ts.GetURL()\n}\n\nfunc TestSplunkConfig_GetDomain(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SplunkConfig{}\n\ts.GetDomain()\n\ts = nil\n\ts.GetDomain()\n}\n\nfunc TestSplunkConfig_GetEncryptedToken(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SplunkConfig{}\n\ts.GetEncryptedToken()\n\ts = nil\n\ts.GetEncryptedToken()\n}\n\nfunc TestSplunkConfig_GetKeyID(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SplunkConfig{}\n\ts.GetKeyID()\n\ts = nil\n\ts.GetKeyID()\n}\n\nfunc TestSplunkConfig_GetPort(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SplunkConfig{}\n\ts.GetPort()\n\ts = nil\n\ts.GetPort()\n}\n\nfunc TestSplunkConfig_GetSSLVerify(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SplunkConfig{}\n\ts.GetSSLVerify()\n\ts = nil\n\ts.GetSSLVerify()\n}\n\nfunc TestSponsorshipChanges_GetPrivacyLevel(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SponsorshipChanges{PrivacyLevel: &zeroValue}\n\ts.GetPrivacyLevel()\n\ts = &SponsorshipChanges{}\n\ts.GetPrivacyLevel()\n\ts = nil\n\ts.GetPrivacyLevel()\n}\n\nfunc TestSponsorshipChanges_GetTier(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SponsorshipChanges{}\n\ts.GetTier()\n\ts = nil\n\ts.GetTier()\n}\n\nfunc TestSponsorshipEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SponsorshipEvent{Action: &zeroValue}\n\ts.GetAction()\n\ts = &SponsorshipEvent{}\n\ts.GetAction()\n\ts = nil\n\ts.GetAction()\n}\n\nfunc TestSponsorshipEvent_GetChanges(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SponsorshipEvent{}\n\ts.GetChanges()\n\ts = nil\n\ts.GetChanges()\n}\n\nfunc TestSponsorshipEvent_GetEffectiveDate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SponsorshipEvent{EffectiveDate: &zeroValue}\n\ts.GetEffectiveDate()\n\ts = &SponsorshipEvent{}\n\ts.GetEffectiveDate()\n\ts = nil\n\ts.GetEffectiveDate()\n}\n\nfunc TestSponsorshipEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SponsorshipEvent{}\n\ts.GetInstallation()\n\ts = nil\n\ts.GetInstallation()\n}\n\nfunc TestSponsorshipEvent_GetOrganization(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SponsorshipEvent{}\n\ts.GetOrganization()\n\ts = nil\n\ts.GetOrganization()\n}\n\nfunc TestSponsorshipEvent_GetRepository(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SponsorshipEvent{}\n\ts.GetRepository()\n\ts = nil\n\ts.GetRepository()\n}\n\nfunc TestSponsorshipEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SponsorshipEvent{}\n\ts.GetSender()\n\ts = nil\n\ts.GetSender()\n}\n\nfunc TestSponsorshipTier_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SponsorshipTier{From: &zeroValue}\n\ts.GetFrom()\n\ts = &SponsorshipTier{}\n\ts.GetFrom()\n\ts = nil\n\ts.GetFrom()\n}\n\nfunc TestSSHKeyOptions_GetKey(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SSHKeyOptions{}\n\ts.GetKey()\n\ts = nil\n\ts.GetKey()\n}\n\nfunc TestSSHKeyStatus_GetHostname(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SSHKeyStatus{Hostname: &zeroValue}\n\ts.GetHostname()\n\ts = &SSHKeyStatus{}\n\ts.GetHostname()\n\ts = nil\n\ts.GetHostname()\n}\n\nfunc TestSSHKeyStatus_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SSHKeyStatus{Message: &zeroValue}\n\ts.GetMessage()\n\ts = &SSHKeyStatus{}\n\ts.GetMessage()\n\ts = nil\n\ts.GetMessage()\n}\n\nfunc TestSSHKeyStatus_GetModified(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ts := &SSHKeyStatus{Modified: &zeroValue}\n\ts.GetModified()\n\ts = &SSHKeyStatus{}\n\ts.GetModified()\n\ts = nil\n\ts.GetModified()\n}\n\nfunc TestSSHKeyStatus_GetUUID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SSHKeyStatus{UUID: &zeroValue}\n\ts.GetUUID()\n\ts = &SSHKeyStatus{}\n\ts.GetUUID()\n\ts = nil\n\ts.GetUUID()\n}\n\nfunc TestSSHSigningKey_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ts := &SSHSigningKey{CreatedAt: &zeroValue}\n\ts.GetCreatedAt()\n\ts = &SSHSigningKey{}\n\ts.GetCreatedAt()\n\ts = nil\n\ts.GetCreatedAt()\n}\n\nfunc TestSSHSigningKey_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ts := &SSHSigningKey{ID: &zeroValue}\n\ts.GetID()\n\ts = &SSHSigningKey{}\n\ts.GetID()\n\ts = nil\n\ts.GetID()\n}\n\nfunc TestSSHSigningKey_GetKey(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SSHSigningKey{Key: &zeroValue}\n\ts.GetKey()\n\ts = &SSHSigningKey{}\n\ts.GetKey()\n\ts = nil\n\ts.GetKey()\n}\n\nfunc TestSSHSigningKey_GetTitle(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SSHSigningKey{Title: &zeroValue}\n\ts.GetTitle()\n\ts = &SSHSigningKey{}\n\ts.GetTitle()\n\ts = nil\n\ts.GetTitle()\n}\n\nfunc TestStarEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &StarEvent{Action: &zeroValue}\n\ts.GetAction()\n\ts = &StarEvent{}\n\ts.GetAction()\n\ts = nil\n\ts.GetAction()\n}\n\nfunc TestStarEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\ts := &StarEvent{}\n\ts.GetInstallation()\n\ts = nil\n\ts.GetInstallation()\n}\n\nfunc TestStarEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\ts := &StarEvent{}\n\ts.GetOrg()\n\ts = nil\n\ts.GetOrg()\n}\n\nfunc TestStarEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\ts := &StarEvent{}\n\ts.GetRepo()\n\ts = nil\n\ts.GetRepo()\n}\n\nfunc TestStarEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\ts := &StarEvent{}\n\ts.GetSender()\n\ts = nil\n\ts.GetSender()\n}\n\nfunc TestStarEvent_GetStarredAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ts := &StarEvent{StarredAt: &zeroValue}\n\ts.GetStarredAt()\n\ts = &StarEvent{}\n\ts.GetStarredAt()\n\ts = nil\n\ts.GetStarredAt()\n}\n\nfunc TestStargazer_GetStarredAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ts := &Stargazer{StarredAt: &zeroValue}\n\ts.GetStarredAt()\n\ts = &Stargazer{}\n\ts.GetStarredAt()\n\ts = nil\n\ts.GetStarredAt()\n}\n\nfunc TestStargazer_GetUser(tt *testing.T) {\n\ttt.Parallel()\n\ts := &Stargazer{}\n\ts.GetUser()\n\ts = nil\n\ts.GetUser()\n}\n\nfunc TestStarredRepository_GetRepository(tt *testing.T) {\n\ttt.Parallel()\n\ts := &StarredRepository{}\n\ts.GetRepository()\n\ts = nil\n\ts.GetRepository()\n}\n\nfunc TestStarredRepository_GetStarredAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ts := &StarredRepository{StarredAt: &zeroValue}\n\ts.GetStarredAt()\n\ts = &StarredRepository{}\n\ts.GetStarredAt()\n\ts = nil\n\ts.GetStarredAt()\n}\n\nfunc TestStatusEvent_GetBranches(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Branch{}\n\ts := &StatusEvent{Branches: zeroValue}\n\ts.GetBranches()\n\ts = &StatusEvent{}\n\ts.GetBranches()\n\ts = nil\n\ts.GetBranches()\n}\n\nfunc TestStatusEvent_GetCommit(tt *testing.T) {\n\ttt.Parallel()\n\ts := &StatusEvent{}\n\ts.GetCommit()\n\ts = nil\n\ts.GetCommit()\n}\n\nfunc TestStatusEvent_GetContext(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &StatusEvent{Context: &zeroValue}\n\ts.GetContext()\n\ts = &StatusEvent{}\n\ts.GetContext()\n\ts = nil\n\ts.GetContext()\n}\n\nfunc TestStatusEvent_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ts := &StatusEvent{CreatedAt: &zeroValue}\n\ts.GetCreatedAt()\n\ts = &StatusEvent{}\n\ts.GetCreatedAt()\n\ts = nil\n\ts.GetCreatedAt()\n}\n\nfunc TestStatusEvent_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &StatusEvent{Description: &zeroValue}\n\ts.GetDescription()\n\ts = &StatusEvent{}\n\ts.GetDescription()\n\ts = nil\n\ts.GetDescription()\n}\n\nfunc TestStatusEvent_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ts := &StatusEvent{ID: &zeroValue}\n\ts.GetID()\n\ts = &StatusEvent{}\n\ts.GetID()\n\ts = nil\n\ts.GetID()\n}\n\nfunc TestStatusEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\ts := &StatusEvent{}\n\ts.GetInstallation()\n\ts = nil\n\ts.GetInstallation()\n}\n\nfunc TestStatusEvent_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &StatusEvent{Name: &zeroValue}\n\ts.GetName()\n\ts = &StatusEvent{}\n\ts.GetName()\n\ts = nil\n\ts.GetName()\n}\n\nfunc TestStatusEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\ts := &StatusEvent{}\n\ts.GetOrg()\n\ts = nil\n\ts.GetOrg()\n}\n\nfunc TestStatusEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\ts := &StatusEvent{}\n\ts.GetRepo()\n\ts = nil\n\ts.GetRepo()\n}\n\nfunc TestStatusEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\ts := &StatusEvent{}\n\ts.GetSender()\n\ts = nil\n\ts.GetSender()\n}\n\nfunc TestStatusEvent_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &StatusEvent{SHA: &zeroValue}\n\ts.GetSHA()\n\ts = &StatusEvent{}\n\ts.GetSHA()\n\ts = nil\n\ts.GetSHA()\n}\n\nfunc TestStatusEvent_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &StatusEvent{State: &zeroValue}\n\ts.GetState()\n\ts = &StatusEvent{}\n\ts.GetState()\n\ts = nil\n\ts.GetState()\n}\n\nfunc TestStatusEvent_GetTargetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &StatusEvent{TargetURL: &zeroValue}\n\ts.GetTargetURL()\n\ts = &StatusEvent{}\n\ts.GetTargetURL()\n\ts = nil\n\ts.GetTargetURL()\n}\n\nfunc TestStatusEvent_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ts := &StatusEvent{UpdatedAt: &zeroValue}\n\ts.GetUpdatedAt()\n\ts = &StatusEvent{}\n\ts.GetUpdatedAt()\n\ts = nil\n\ts.GetUpdatedAt()\n}\n\nfunc TestStorageBilling_GetDaysLeftInBillingCycle(tt *testing.T) {\n\ttt.Parallel()\n\ts := &StorageBilling{}\n\ts.GetDaysLeftInBillingCycle()\n\ts = nil\n\ts.GetDaysLeftInBillingCycle()\n}\n\nfunc TestStorageBilling_GetEstimatedPaidStorageForMonth(tt *testing.T) {\n\ttt.Parallel()\n\ts := &StorageBilling{}\n\ts.GetEstimatedPaidStorageForMonth()\n\ts = nil\n\ts.GetEstimatedPaidStorageForMonth()\n}\n\nfunc TestStorageBilling_GetEstimatedStorageForMonth(tt *testing.T) {\n\ttt.Parallel()\n\ts := &StorageBilling{}\n\ts.GetEstimatedStorageForMonth()\n\ts = nil\n\ts.GetEstimatedStorageForMonth()\n}\n\nfunc TestSubIssueRequest_GetAfterID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ts := &SubIssueRequest{AfterID: &zeroValue}\n\ts.GetAfterID()\n\ts = &SubIssueRequest{}\n\ts.GetAfterID()\n\ts = nil\n\ts.GetAfterID()\n}\n\nfunc TestSubIssueRequest_GetBeforeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\ts := &SubIssueRequest{BeforeID: &zeroValue}\n\ts.GetBeforeID()\n\ts = &SubIssueRequest{}\n\ts.GetBeforeID()\n\ts = nil\n\ts.GetBeforeID()\n}\n\nfunc TestSubIssueRequest_GetReplaceParent(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ts := &SubIssueRequest{ReplaceParent: &zeroValue}\n\ts.GetReplaceParent()\n\ts = &SubIssueRequest{}\n\ts.GetReplaceParent()\n\ts = nil\n\ts.GetReplaceParent()\n}\n\nfunc TestSubIssueRequest_GetSubIssueID(tt *testing.T) {\n\ttt.Parallel()\n\ts := &SubIssueRequest{}\n\ts.GetSubIssueID()\n\ts = nil\n\ts.GetSubIssueID()\n}\n\nfunc TestSubscription_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\ts := &Subscription{CreatedAt: &zeroValue}\n\ts.GetCreatedAt()\n\ts = &Subscription{}\n\ts.GetCreatedAt()\n\ts = nil\n\ts.GetCreatedAt()\n}\n\nfunc TestSubscription_GetIgnored(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ts := &Subscription{Ignored: &zeroValue}\n\ts.GetIgnored()\n\ts = &Subscription{}\n\ts.GetIgnored()\n\ts = nil\n\ts.GetIgnored()\n}\n\nfunc TestSubscription_GetReason(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &Subscription{Reason: &zeroValue}\n\ts.GetReason()\n\ts = &Subscription{}\n\ts.GetReason()\n\ts = nil\n\ts.GetReason()\n}\n\nfunc TestSubscription_GetRepositoryURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &Subscription{RepositoryURL: &zeroValue}\n\ts.GetRepositoryURL()\n\ts = &Subscription{}\n\ts.GetRepositoryURL()\n\ts = nil\n\ts.GetRepositoryURL()\n}\n\nfunc TestSubscription_GetSubscribed(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\ts := &Subscription{Subscribed: &zeroValue}\n\ts.GetSubscribed()\n\ts = &Subscription{}\n\ts.GetSubscribed()\n\ts = nil\n\ts.GetSubscribed()\n}\n\nfunc TestSubscription_GetThreadURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &Subscription{ThreadURL: &zeroValue}\n\ts.GetThreadURL()\n\ts = &Subscription{}\n\ts.GetThreadURL()\n\ts = nil\n\ts.GetThreadURL()\n}\n\nfunc TestSubscription_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &Subscription{URL: &zeroValue}\n\ts.GetURL()\n\ts = &Subscription{}\n\ts.GetURL()\n\ts = nil\n\ts.GetURL()\n}\n\nfunc TestSystemRequirements_GetNodes(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*SystemRequirementsNode{}\n\ts := &SystemRequirements{Nodes: zeroValue}\n\ts.GetNodes()\n\ts = &SystemRequirements{}\n\ts.GetNodes()\n\ts = nil\n\ts.GetNodes()\n}\n\nfunc TestSystemRequirements_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SystemRequirements{Status: &zeroValue}\n\ts.GetStatus()\n\ts = &SystemRequirements{}\n\ts.GetStatus()\n\ts = nil\n\ts.GetStatus()\n}\n\nfunc TestSystemRequirementsNode_GetHostname(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SystemRequirementsNode{Hostname: &zeroValue}\n\ts.GetHostname()\n\ts = &SystemRequirementsNode{}\n\ts.GetHostname()\n\ts = nil\n\ts.GetHostname()\n}\n\nfunc TestSystemRequirementsNode_GetRolesStatus(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*SystemRequirementsNodeRoleStatus{}\n\ts := &SystemRequirementsNode{RolesStatus: zeroValue}\n\ts.GetRolesStatus()\n\ts = &SystemRequirementsNode{}\n\ts.GetRolesStatus()\n\ts = nil\n\ts.GetRolesStatus()\n}\n\nfunc TestSystemRequirementsNode_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SystemRequirementsNode{Status: &zeroValue}\n\ts.GetStatus()\n\ts = &SystemRequirementsNode{}\n\ts.GetStatus()\n\ts = nil\n\ts.GetStatus()\n}\n\nfunc TestSystemRequirementsNodeRoleStatus_GetRole(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SystemRequirementsNodeRoleStatus{Role: &zeroValue}\n\ts.GetRole()\n\ts = &SystemRequirementsNodeRoleStatus{}\n\ts.GetRole()\n\ts = nil\n\ts.GetRole()\n}\n\nfunc TestSystemRequirementsNodeRoleStatus_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\ts := &SystemRequirementsNodeRoleStatus{Status: &zeroValue}\n\ts.GetStatus()\n\ts = &SystemRequirementsNodeRoleStatus{}\n\ts.GetStatus()\n\ts = nil\n\ts.GetStatus()\n}\n\nfunc TestTag_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Tag{Message: &zeroValue}\n\tt.GetMessage()\n\tt = &Tag{}\n\tt.GetMessage()\n\tt = nil\n\tt.GetMessage()\n}\n\nfunc TestTag_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Tag{NodeID: &zeroValue}\n\tt.GetNodeID()\n\tt = &Tag{}\n\tt.GetNodeID()\n\tt = nil\n\tt.GetNodeID()\n}\n\nfunc TestTag_GetObject(tt *testing.T) {\n\ttt.Parallel()\n\tt := &Tag{}\n\tt.GetObject()\n\tt = nil\n\tt.GetObject()\n}\n\nfunc TestTag_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Tag{SHA: &zeroValue}\n\tt.GetSHA()\n\tt = &Tag{}\n\tt.GetSHA()\n\tt = nil\n\tt.GetSHA()\n}\n\nfunc TestTag_GetTag(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Tag{Tag: &zeroValue}\n\tt.GetTag()\n\tt = &Tag{}\n\tt.GetTag()\n\tt = nil\n\tt.GetTag()\n}\n\nfunc TestTag_GetTagger(tt *testing.T) {\n\ttt.Parallel()\n\tt := &Tag{}\n\tt.GetTagger()\n\tt = nil\n\tt.GetTagger()\n}\n\nfunc TestTag_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Tag{URL: &zeroValue}\n\tt.GetURL()\n\tt = &Tag{}\n\tt.GetURL()\n\tt = nil\n\tt.GetURL()\n}\n\nfunc TestTag_GetVerification(tt *testing.T) {\n\ttt.Parallel()\n\tt := &Tag{}\n\tt.GetVerification()\n\tt = nil\n\tt.GetVerification()\n}\n\nfunc TestTagProtection_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tt := &TagProtection{ID: &zeroValue}\n\tt.GetID()\n\tt = &TagProtection{}\n\tt.GetID()\n\tt = nil\n\tt.GetID()\n}\n\nfunc TestTagProtection_GetPattern(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TagProtection{Pattern: &zeroValue}\n\tt.GetPattern()\n\tt = &TagProtection{}\n\tt.GetPattern()\n\tt = nil\n\tt.GetPattern()\n}\n\nfunc TestTaskStep_GetCompletedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tt := &TaskStep{CompletedAt: &zeroValue}\n\tt.GetCompletedAt()\n\tt = &TaskStep{}\n\tt.GetCompletedAt()\n\tt = nil\n\tt.GetCompletedAt()\n}\n\nfunc TestTaskStep_GetConclusion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TaskStep{Conclusion: &zeroValue}\n\tt.GetConclusion()\n\tt = &TaskStep{}\n\tt.GetConclusion()\n\tt = nil\n\tt.GetConclusion()\n}\n\nfunc TestTaskStep_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TaskStep{Name: &zeroValue}\n\tt.GetName()\n\tt = &TaskStep{}\n\tt.GetName()\n\tt = nil\n\tt.GetName()\n}\n\nfunc TestTaskStep_GetNumber(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tt := &TaskStep{Number: &zeroValue}\n\tt.GetNumber()\n\tt = &TaskStep{}\n\tt.GetNumber()\n\tt = nil\n\tt.GetNumber()\n}\n\nfunc TestTaskStep_GetStartedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tt := &TaskStep{StartedAt: &zeroValue}\n\tt.GetStartedAt()\n\tt = &TaskStep{}\n\tt.GetStartedAt()\n\tt = nil\n\tt.GetStartedAt()\n}\n\nfunc TestTaskStep_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TaskStep{Status: &zeroValue}\n\tt.GetStatus()\n\tt = &TaskStep{}\n\tt.GetStatus()\n\tt = nil\n\tt.GetStatus()\n}\n\nfunc TestTeam_GetAssignment(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Team{Assignment: &zeroValue}\n\tt.GetAssignment()\n\tt = &Team{}\n\tt.GetAssignment()\n\tt = nil\n\tt.GetAssignment()\n}\n\nfunc TestTeam_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Team{Description: &zeroValue}\n\tt.GetDescription()\n\tt = &Team{}\n\tt.GetDescription()\n\tt = nil\n\tt.GetDescription()\n}\n\nfunc TestTeam_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Team{HTMLURL: &zeroValue}\n\tt.GetHTMLURL()\n\tt = &Team{}\n\tt.GetHTMLURL()\n\tt = nil\n\tt.GetHTMLURL()\n}\n\nfunc TestTeam_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tt := &Team{ID: &zeroValue}\n\tt.GetID()\n\tt = &Team{}\n\tt.GetID()\n\tt = nil\n\tt.GetID()\n}\n\nfunc TestTeam_GetLDAPDN(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Team{LDAPDN: &zeroValue}\n\tt.GetLDAPDN()\n\tt = &Team{}\n\tt.GetLDAPDN()\n\tt = nil\n\tt.GetLDAPDN()\n}\n\nfunc TestTeam_GetMembersCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tt := &Team{MembersCount: &zeroValue}\n\tt.GetMembersCount()\n\tt = &Team{}\n\tt.GetMembersCount()\n\tt = nil\n\tt.GetMembersCount()\n}\n\nfunc TestTeam_GetMembersURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Team{MembersURL: &zeroValue}\n\tt.GetMembersURL()\n\tt = &Team{}\n\tt.GetMembersURL()\n\tt = nil\n\tt.GetMembersURL()\n}\n\nfunc TestTeam_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Team{Name: &zeroValue}\n\tt.GetName()\n\tt = &Team{}\n\tt.GetName()\n\tt = nil\n\tt.GetName()\n}\n\nfunc TestTeam_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Team{NodeID: &zeroValue}\n\tt.GetNodeID()\n\tt = &Team{}\n\tt.GetNodeID()\n\tt = nil\n\tt.GetNodeID()\n}\n\nfunc TestTeam_GetNotificationSetting(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Team{NotificationSetting: &zeroValue}\n\tt.GetNotificationSetting()\n\tt = &Team{}\n\tt.GetNotificationSetting()\n\tt = nil\n\tt.GetNotificationSetting()\n}\n\nfunc TestTeam_GetOrganization(tt *testing.T) {\n\ttt.Parallel()\n\tt := &Team{}\n\tt.GetOrganization()\n\tt = nil\n\tt.GetOrganization()\n}\n\nfunc TestTeam_GetParent(tt *testing.T) {\n\ttt.Parallel()\n\tt := &Team{}\n\tt.GetParent()\n\tt = nil\n\tt.GetParent()\n}\n\nfunc TestTeam_GetPermission(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Team{Permission: &zeroValue}\n\tt.GetPermission()\n\tt = &Team{}\n\tt.GetPermission()\n\tt = nil\n\tt.GetPermission()\n}\n\nfunc TestTeam_GetPermissions(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := map[string]bool{}\n\tt := &Team{Permissions: zeroValue}\n\tt.GetPermissions()\n\tt = &Team{}\n\tt.GetPermissions()\n\tt = nil\n\tt.GetPermissions()\n}\n\nfunc TestTeam_GetPrivacy(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Team{Privacy: &zeroValue}\n\tt.GetPrivacy()\n\tt = &Team{}\n\tt.GetPrivacy()\n\tt = nil\n\tt.GetPrivacy()\n}\n\nfunc TestTeam_GetReposCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tt := &Team{ReposCount: &zeroValue}\n\tt.GetReposCount()\n\tt = &Team{}\n\tt.GetReposCount()\n\tt = nil\n\tt.GetReposCount()\n}\n\nfunc TestTeam_GetRepositoriesURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Team{RepositoriesURL: &zeroValue}\n\tt.GetRepositoriesURL()\n\tt = &Team{}\n\tt.GetRepositoriesURL()\n\tt = nil\n\tt.GetRepositoriesURL()\n}\n\nfunc TestTeam_GetSlug(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Team{Slug: &zeroValue}\n\tt.GetSlug()\n\tt = &Team{}\n\tt.GetSlug()\n\tt = nil\n\tt.GetSlug()\n}\n\nfunc TestTeam_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Team{Type: &zeroValue}\n\tt.GetType()\n\tt = &Team{}\n\tt.GetType()\n\tt = nil\n\tt.GetType()\n}\n\nfunc TestTeam_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Team{URL: &zeroValue}\n\tt.GetURL()\n\tt = &Team{}\n\tt.GetURL()\n\tt = nil\n\tt.GetURL()\n}\n\nfunc TestTeamAddEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tt := &TeamAddEvent{}\n\tt.GetInstallation()\n\tt = nil\n\tt.GetInstallation()\n}\n\nfunc TestTeamAddEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tt := &TeamAddEvent{}\n\tt.GetOrg()\n\tt = nil\n\tt.GetOrg()\n}\n\nfunc TestTeamAddEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tt := &TeamAddEvent{}\n\tt.GetRepo()\n\tt = nil\n\tt.GetRepo()\n}\n\nfunc TestTeamAddEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tt := &TeamAddEvent{}\n\tt.GetSender()\n\tt = nil\n\tt.GetSender()\n}\n\nfunc TestTeamAddEvent_GetTeam(tt *testing.T) {\n\ttt.Parallel()\n\tt := &TeamAddEvent{}\n\tt.GetTeam()\n\tt = nil\n\tt.GetTeam()\n}\n\nfunc TestTeamAddTeamMembershipOptions_GetRole(tt *testing.T) {\n\ttt.Parallel()\n\tt := &TeamAddTeamMembershipOptions{}\n\tt.GetRole()\n\tt = nil\n\tt.GetRole()\n}\n\nfunc TestTeamAddTeamRepoOptions_GetPermission(tt *testing.T) {\n\ttt.Parallel()\n\tt := &TeamAddTeamRepoOptions{}\n\tt.GetPermission()\n\tt = nil\n\tt.GetPermission()\n}\n\nfunc TestTeamChange_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tt := &TeamChange{}\n\tt.GetDescription()\n\tt = nil\n\tt.GetDescription()\n}\n\nfunc TestTeamChange_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tt := &TeamChange{}\n\tt.GetName()\n\tt = nil\n\tt.GetName()\n}\n\nfunc TestTeamChange_GetPrivacy(tt *testing.T) {\n\ttt.Parallel()\n\tt := &TeamChange{}\n\tt.GetPrivacy()\n\tt = nil\n\tt.GetPrivacy()\n}\n\nfunc TestTeamChange_GetRepository(tt *testing.T) {\n\ttt.Parallel()\n\tt := &TeamChange{}\n\tt.GetRepository()\n\tt = nil\n\tt.GetRepository()\n}\n\nfunc TestTeamDescription_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TeamDescription{From: &zeroValue}\n\tt.GetFrom()\n\tt = &TeamDescription{}\n\tt.GetFrom()\n\tt = nil\n\tt.GetFrom()\n}\n\nfunc TestTeamDiscussion_GetAuthor(tt *testing.T) {\n\ttt.Parallel()\n\tt := &TeamDiscussion{}\n\tt.GetAuthor()\n\tt = nil\n\tt.GetAuthor()\n}\n\nfunc TestTeamDiscussion_GetBody(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TeamDiscussion{Body: &zeroValue}\n\tt.GetBody()\n\tt = &TeamDiscussion{}\n\tt.GetBody()\n\tt = nil\n\tt.GetBody()\n}\n\nfunc TestTeamDiscussion_GetBodyHTML(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TeamDiscussion{BodyHTML: &zeroValue}\n\tt.GetBodyHTML()\n\tt = &TeamDiscussion{}\n\tt.GetBodyHTML()\n\tt = nil\n\tt.GetBodyHTML()\n}\n\nfunc TestTeamDiscussion_GetBodyVersion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TeamDiscussion{BodyVersion: &zeroValue}\n\tt.GetBodyVersion()\n\tt = &TeamDiscussion{}\n\tt.GetBodyVersion()\n\tt = nil\n\tt.GetBodyVersion()\n}\n\nfunc TestTeamDiscussion_GetCommentsCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tt := &TeamDiscussion{CommentsCount: &zeroValue}\n\tt.GetCommentsCount()\n\tt = &TeamDiscussion{}\n\tt.GetCommentsCount()\n\tt = nil\n\tt.GetCommentsCount()\n}\n\nfunc TestTeamDiscussion_GetCommentsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TeamDiscussion{CommentsURL: &zeroValue}\n\tt.GetCommentsURL()\n\tt = &TeamDiscussion{}\n\tt.GetCommentsURL()\n\tt = nil\n\tt.GetCommentsURL()\n}\n\nfunc TestTeamDiscussion_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tt := &TeamDiscussion{CreatedAt: &zeroValue}\n\tt.GetCreatedAt()\n\tt = &TeamDiscussion{}\n\tt.GetCreatedAt()\n\tt = nil\n\tt.GetCreatedAt()\n}\n\nfunc TestTeamDiscussion_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TeamDiscussion{HTMLURL: &zeroValue}\n\tt.GetHTMLURL()\n\tt = &TeamDiscussion{}\n\tt.GetHTMLURL()\n\tt = nil\n\tt.GetHTMLURL()\n}\n\nfunc TestTeamDiscussion_GetLastEditedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tt := &TeamDiscussion{LastEditedAt: &zeroValue}\n\tt.GetLastEditedAt()\n\tt = &TeamDiscussion{}\n\tt.GetLastEditedAt()\n\tt = nil\n\tt.GetLastEditedAt()\n}\n\nfunc TestTeamDiscussion_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TeamDiscussion{NodeID: &zeroValue}\n\tt.GetNodeID()\n\tt = &TeamDiscussion{}\n\tt.GetNodeID()\n\tt = nil\n\tt.GetNodeID()\n}\n\nfunc TestTeamDiscussion_GetNumber(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tt := &TeamDiscussion{Number: &zeroValue}\n\tt.GetNumber()\n\tt = &TeamDiscussion{}\n\tt.GetNumber()\n\tt = nil\n\tt.GetNumber()\n}\n\nfunc TestTeamDiscussion_GetPinned(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tt := &TeamDiscussion{Pinned: &zeroValue}\n\tt.GetPinned()\n\tt = &TeamDiscussion{}\n\tt.GetPinned()\n\tt = nil\n\tt.GetPinned()\n}\n\nfunc TestTeamDiscussion_GetPrivate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tt := &TeamDiscussion{Private: &zeroValue}\n\tt.GetPrivate()\n\tt = &TeamDiscussion{}\n\tt.GetPrivate()\n\tt = nil\n\tt.GetPrivate()\n}\n\nfunc TestTeamDiscussion_GetReactions(tt *testing.T) {\n\ttt.Parallel()\n\tt := &TeamDiscussion{}\n\tt.GetReactions()\n\tt = nil\n\tt.GetReactions()\n}\n\nfunc TestTeamDiscussion_GetTeamURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TeamDiscussion{TeamURL: &zeroValue}\n\tt.GetTeamURL()\n\tt = &TeamDiscussion{}\n\tt.GetTeamURL()\n\tt = nil\n\tt.GetTeamURL()\n}\n\nfunc TestTeamDiscussion_GetTitle(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TeamDiscussion{Title: &zeroValue}\n\tt.GetTitle()\n\tt = &TeamDiscussion{}\n\tt.GetTitle()\n\tt = nil\n\tt.GetTitle()\n}\n\nfunc TestTeamDiscussion_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tt := &TeamDiscussion{UpdatedAt: &zeroValue}\n\tt.GetUpdatedAt()\n\tt = &TeamDiscussion{}\n\tt.GetUpdatedAt()\n\tt = nil\n\tt.GetUpdatedAt()\n}\n\nfunc TestTeamDiscussion_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TeamDiscussion{URL: &zeroValue}\n\tt.GetURL()\n\tt = &TeamDiscussion{}\n\tt.GetURL()\n\tt = nil\n\tt.GetURL()\n}\n\nfunc TestTeamEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TeamEvent{Action: &zeroValue}\n\tt.GetAction()\n\tt = &TeamEvent{}\n\tt.GetAction()\n\tt = nil\n\tt.GetAction()\n}\n\nfunc TestTeamEvent_GetChanges(tt *testing.T) {\n\ttt.Parallel()\n\tt := &TeamEvent{}\n\tt.GetChanges()\n\tt = nil\n\tt.GetChanges()\n}\n\nfunc TestTeamEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tt := &TeamEvent{}\n\tt.GetInstallation()\n\tt = nil\n\tt.GetInstallation()\n}\n\nfunc TestTeamEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tt := &TeamEvent{}\n\tt.GetOrg()\n\tt = nil\n\tt.GetOrg()\n}\n\nfunc TestTeamEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tt := &TeamEvent{}\n\tt.GetRepo()\n\tt = nil\n\tt.GetRepo()\n}\n\nfunc TestTeamEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tt := &TeamEvent{}\n\tt.GetSender()\n\tt = nil\n\tt.GetSender()\n}\n\nfunc TestTeamEvent_GetTeam(tt *testing.T) {\n\ttt.Parallel()\n\tt := &TeamEvent{}\n\tt.GetTeam()\n\tt = nil\n\tt.GetTeam()\n}\n\nfunc TestTeamLDAPMapping_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TeamLDAPMapping{Description: &zeroValue}\n\tt.GetDescription()\n\tt = &TeamLDAPMapping{}\n\tt.GetDescription()\n\tt = nil\n\tt.GetDescription()\n}\n\nfunc TestTeamLDAPMapping_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tt := &TeamLDAPMapping{ID: &zeroValue}\n\tt.GetID()\n\tt = &TeamLDAPMapping{}\n\tt.GetID()\n\tt = nil\n\tt.GetID()\n}\n\nfunc TestTeamLDAPMapping_GetLDAPDN(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TeamLDAPMapping{LDAPDN: &zeroValue}\n\tt.GetLDAPDN()\n\tt = &TeamLDAPMapping{}\n\tt.GetLDAPDN()\n\tt = nil\n\tt.GetLDAPDN()\n}\n\nfunc TestTeamLDAPMapping_GetMembersURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TeamLDAPMapping{MembersURL: &zeroValue}\n\tt.GetMembersURL()\n\tt = &TeamLDAPMapping{}\n\tt.GetMembersURL()\n\tt = nil\n\tt.GetMembersURL()\n}\n\nfunc TestTeamLDAPMapping_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TeamLDAPMapping{Name: &zeroValue}\n\tt.GetName()\n\tt = &TeamLDAPMapping{}\n\tt.GetName()\n\tt = nil\n\tt.GetName()\n}\n\nfunc TestTeamLDAPMapping_GetPermission(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TeamLDAPMapping{Permission: &zeroValue}\n\tt.GetPermission()\n\tt = &TeamLDAPMapping{}\n\tt.GetPermission()\n\tt = nil\n\tt.GetPermission()\n}\n\nfunc TestTeamLDAPMapping_GetPrivacy(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TeamLDAPMapping{Privacy: &zeroValue}\n\tt.GetPrivacy()\n\tt = &TeamLDAPMapping{}\n\tt.GetPrivacy()\n\tt = nil\n\tt.GetPrivacy()\n}\n\nfunc TestTeamLDAPMapping_GetRepositoriesURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TeamLDAPMapping{RepositoriesURL: &zeroValue}\n\tt.GetRepositoriesURL()\n\tt = &TeamLDAPMapping{}\n\tt.GetRepositoriesURL()\n\tt = nil\n\tt.GetRepositoriesURL()\n}\n\nfunc TestTeamLDAPMapping_GetSlug(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TeamLDAPMapping{Slug: &zeroValue}\n\tt.GetSlug()\n\tt = &TeamLDAPMapping{}\n\tt.GetSlug()\n\tt = nil\n\tt.GetSlug()\n}\n\nfunc TestTeamLDAPMapping_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TeamLDAPMapping{URL: &zeroValue}\n\tt.GetURL()\n\tt = &TeamLDAPMapping{}\n\tt.GetURL()\n\tt = nil\n\tt.GetURL()\n}\n\nfunc TestTeamListTeamMembersOptions_GetRole(tt *testing.T) {\n\ttt.Parallel()\n\tt := &TeamListTeamMembersOptions{}\n\tt.GetRole()\n\tt = nil\n\tt.GetRole()\n}\n\nfunc TestTeamName_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TeamName{From: &zeroValue}\n\tt.GetFrom()\n\tt = &TeamName{}\n\tt.GetFrom()\n\tt = nil\n\tt.GetFrom()\n}\n\nfunc TestTeamPermissions_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tt := &TeamPermissions{}\n\tt.GetFrom()\n\tt = nil\n\tt.GetFrom()\n}\n\nfunc TestTeamPermissionsFrom_GetAdmin(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tt := &TeamPermissionsFrom{Admin: &zeroValue}\n\tt.GetAdmin()\n\tt = &TeamPermissionsFrom{}\n\tt.GetAdmin()\n\tt = nil\n\tt.GetAdmin()\n}\n\nfunc TestTeamPermissionsFrom_GetPull(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tt := &TeamPermissionsFrom{Pull: &zeroValue}\n\tt.GetPull()\n\tt = &TeamPermissionsFrom{}\n\tt.GetPull()\n\tt = nil\n\tt.GetPull()\n}\n\nfunc TestTeamPermissionsFrom_GetPush(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tt := &TeamPermissionsFrom{Push: &zeroValue}\n\tt.GetPush()\n\tt = &TeamPermissionsFrom{}\n\tt.GetPush()\n\tt = nil\n\tt.GetPush()\n}\n\nfunc TestTeamPrivacy_GetFrom(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TeamPrivacy{From: &zeroValue}\n\tt.GetFrom()\n\tt = &TeamPrivacy{}\n\tt.GetFrom()\n\tt = nil\n\tt.GetFrom()\n}\n\nfunc TestTeamProjectOptions_GetPermission(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TeamProjectOptions{Permission: &zeroValue}\n\tt.GetPermission()\n\tt = &TeamProjectOptions{}\n\tt.GetPermission()\n\tt = nil\n\tt.GetPermission()\n}\n\nfunc TestTeamRepository_GetPermissions(tt *testing.T) {\n\ttt.Parallel()\n\tt := &TeamRepository{}\n\tt.GetPermissions()\n\tt = nil\n\tt.GetPermissions()\n}\n\nfunc TestTemplateRepoRequest_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TemplateRepoRequest{Description: &zeroValue}\n\tt.GetDescription()\n\tt = &TemplateRepoRequest{}\n\tt.GetDescription()\n\tt = nil\n\tt.GetDescription()\n}\n\nfunc TestTemplateRepoRequest_GetIncludeAllBranches(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tt := &TemplateRepoRequest{IncludeAllBranches: &zeroValue}\n\tt.GetIncludeAllBranches()\n\tt = &TemplateRepoRequest{}\n\tt.GetIncludeAllBranches()\n\tt = nil\n\tt.GetIncludeAllBranches()\n}\n\nfunc TestTemplateRepoRequest_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TemplateRepoRequest{Name: &zeroValue}\n\tt.GetName()\n\tt = &TemplateRepoRequest{}\n\tt.GetName()\n\tt = nil\n\tt.GetName()\n}\n\nfunc TestTemplateRepoRequest_GetOwner(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TemplateRepoRequest{Owner: &zeroValue}\n\tt.GetOwner()\n\tt = &TemplateRepoRequest{}\n\tt.GetOwner()\n\tt = nil\n\tt.GetOwner()\n}\n\nfunc TestTemplateRepoRequest_GetPrivate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tt := &TemplateRepoRequest{Private: &zeroValue}\n\tt.GetPrivate()\n\tt = &TemplateRepoRequest{}\n\tt.GetPrivate()\n\tt = nil\n\tt.GetPrivate()\n}\n\nfunc TestTextMatch_GetFragment(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TextMatch{Fragment: &zeroValue}\n\tt.GetFragment()\n\tt = &TextMatch{}\n\tt.GetFragment()\n\tt = nil\n\tt.GetFragment()\n}\n\nfunc TestTextMatch_GetMatches(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Match{}\n\tt := &TextMatch{Matches: zeroValue}\n\tt.GetMatches()\n\tt = &TextMatch{}\n\tt.GetMatches()\n\tt = nil\n\tt.GetMatches()\n}\n\nfunc TestTextMatch_GetObjectType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TextMatch{ObjectType: &zeroValue}\n\tt.GetObjectType()\n\tt = &TextMatch{}\n\tt.GetObjectType()\n\tt = nil\n\tt.GetObjectType()\n}\n\nfunc TestTextMatch_GetObjectURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TextMatch{ObjectURL: &zeroValue}\n\tt.GetObjectURL()\n\tt = &TextMatch{}\n\tt.GetObjectURL()\n\tt = nil\n\tt.GetObjectURL()\n}\n\nfunc TestTextMatch_GetProperty(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TextMatch{Property: &zeroValue}\n\tt.GetProperty()\n\tt = &TextMatch{}\n\tt.GetProperty()\n\tt = nil\n\tt.GetProperty()\n}\n\nfunc TestTimeline_GetActor(tt *testing.T) {\n\ttt.Parallel()\n\tt := &Timeline{}\n\tt.GetActor()\n\tt = nil\n\tt.GetActor()\n}\n\nfunc TestTimeline_GetAssignee(tt *testing.T) {\n\ttt.Parallel()\n\tt := &Timeline{}\n\tt.GetAssignee()\n\tt = nil\n\tt.GetAssignee()\n}\n\nfunc TestTimeline_GetAssigner(tt *testing.T) {\n\ttt.Parallel()\n\tt := &Timeline{}\n\tt.GetAssigner()\n\tt = nil\n\tt.GetAssigner()\n}\n\nfunc TestTimeline_GetAuthor(tt *testing.T) {\n\ttt.Parallel()\n\tt := &Timeline{}\n\tt.GetAuthor()\n\tt = nil\n\tt.GetAuthor()\n}\n\nfunc TestTimeline_GetBody(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Timeline{Body: &zeroValue}\n\tt.GetBody()\n\tt = &Timeline{}\n\tt.GetBody()\n\tt = nil\n\tt.GetBody()\n}\n\nfunc TestTimeline_GetCommitID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Timeline{CommitID: &zeroValue}\n\tt.GetCommitID()\n\tt = &Timeline{}\n\tt.GetCommitID()\n\tt = nil\n\tt.GetCommitID()\n}\n\nfunc TestTimeline_GetCommitter(tt *testing.T) {\n\ttt.Parallel()\n\tt := &Timeline{}\n\tt.GetCommitter()\n\tt = nil\n\tt.GetCommitter()\n}\n\nfunc TestTimeline_GetCommitURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Timeline{CommitURL: &zeroValue}\n\tt.GetCommitURL()\n\tt = &Timeline{}\n\tt.GetCommitURL()\n\tt = nil\n\tt.GetCommitURL()\n}\n\nfunc TestTimeline_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tt := &Timeline{CreatedAt: &zeroValue}\n\tt.GetCreatedAt()\n\tt = &Timeline{}\n\tt.GetCreatedAt()\n\tt = nil\n\tt.GetCreatedAt()\n}\n\nfunc TestTimeline_GetEvent(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Timeline{Event: &zeroValue}\n\tt.GetEvent()\n\tt = &Timeline{}\n\tt.GetEvent()\n\tt = nil\n\tt.GetEvent()\n}\n\nfunc TestTimeline_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tt := &Timeline{ID: &zeroValue}\n\tt.GetID()\n\tt = &Timeline{}\n\tt.GetID()\n\tt = nil\n\tt.GetID()\n}\n\nfunc TestTimeline_GetLabel(tt *testing.T) {\n\ttt.Parallel()\n\tt := &Timeline{}\n\tt.GetLabel()\n\tt = nil\n\tt.GetLabel()\n}\n\nfunc TestTimeline_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Timeline{Message: &zeroValue}\n\tt.GetMessage()\n\tt = &Timeline{}\n\tt.GetMessage()\n\tt = nil\n\tt.GetMessage()\n}\n\nfunc TestTimeline_GetMilestone(tt *testing.T) {\n\ttt.Parallel()\n\tt := &Timeline{}\n\tt.GetMilestone()\n\tt = nil\n\tt.GetMilestone()\n}\n\nfunc TestTimeline_GetParents(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Commit{}\n\tt := &Timeline{Parents: zeroValue}\n\tt.GetParents()\n\tt = &Timeline{}\n\tt.GetParents()\n\tt = nil\n\tt.GetParents()\n}\n\nfunc TestTimeline_GetPerformedViaGithubApp(tt *testing.T) {\n\ttt.Parallel()\n\tt := &Timeline{}\n\tt.GetPerformedViaGithubApp()\n\tt = nil\n\tt.GetPerformedViaGithubApp()\n}\n\nfunc TestTimeline_GetRename(tt *testing.T) {\n\ttt.Parallel()\n\tt := &Timeline{}\n\tt.GetRename()\n\tt = nil\n\tt.GetRename()\n}\n\nfunc TestTimeline_GetRequestedTeam(tt *testing.T) {\n\ttt.Parallel()\n\tt := &Timeline{}\n\tt.GetRequestedTeam()\n\tt = nil\n\tt.GetRequestedTeam()\n}\n\nfunc TestTimeline_GetRequester(tt *testing.T) {\n\ttt.Parallel()\n\tt := &Timeline{}\n\tt.GetRequester()\n\tt = nil\n\tt.GetRequester()\n}\n\nfunc TestTimeline_GetReviewer(tt *testing.T) {\n\ttt.Parallel()\n\tt := &Timeline{}\n\tt.GetReviewer()\n\tt = nil\n\tt.GetReviewer()\n}\n\nfunc TestTimeline_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Timeline{SHA: &zeroValue}\n\tt.GetSHA()\n\tt = &Timeline{}\n\tt.GetSHA()\n\tt = nil\n\tt.GetSHA()\n}\n\nfunc TestTimeline_GetSource(tt *testing.T) {\n\ttt.Parallel()\n\tt := &Timeline{}\n\tt.GetSource()\n\tt = nil\n\tt.GetSource()\n}\n\nfunc TestTimeline_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Timeline{State: &zeroValue}\n\tt.GetState()\n\tt = &Timeline{}\n\tt.GetState()\n\tt = nil\n\tt.GetState()\n}\n\nfunc TestTimeline_GetSubmittedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tt := &Timeline{SubmittedAt: &zeroValue}\n\tt.GetSubmittedAt()\n\tt = &Timeline{}\n\tt.GetSubmittedAt()\n\tt = nil\n\tt.GetSubmittedAt()\n}\n\nfunc TestTimeline_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Timeline{URL: &zeroValue}\n\tt.GetURL()\n\tt = &Timeline{}\n\tt.GetURL()\n\tt = nil\n\tt.GetURL()\n}\n\nfunc TestTimeline_GetUser(tt *testing.T) {\n\ttt.Parallel()\n\tt := &Timeline{}\n\tt.GetUser()\n\tt = nil\n\tt.GetUser()\n}\n\nfunc TestTool_GetGUID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Tool{GUID: &zeroValue}\n\tt.GetGUID()\n\tt = &Tool{}\n\tt.GetGUID()\n\tt = nil\n\tt.GetGUID()\n}\n\nfunc TestTool_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Tool{Name: &zeroValue}\n\tt.GetName()\n\tt = &Tool{}\n\tt.GetName()\n\tt = nil\n\tt.GetName()\n}\n\nfunc TestTool_GetVersion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Tool{Version: &zeroValue}\n\tt.GetVersion()\n\tt = &Tool{}\n\tt.GetVersion()\n\tt = nil\n\tt.GetVersion()\n}\n\nfunc TestTopicResult_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tt := &TopicResult{CreatedAt: &zeroValue}\n\tt.GetCreatedAt()\n\tt = &TopicResult{}\n\tt.GetCreatedAt()\n\tt = nil\n\tt.GetCreatedAt()\n}\n\nfunc TestTopicResult_GetCreatedBy(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TopicResult{CreatedBy: &zeroValue}\n\tt.GetCreatedBy()\n\tt = &TopicResult{}\n\tt.GetCreatedBy()\n\tt = nil\n\tt.GetCreatedBy()\n}\n\nfunc TestTopicResult_GetCurated(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tt := &TopicResult{Curated: &zeroValue}\n\tt.GetCurated()\n\tt = &TopicResult{}\n\tt.GetCurated()\n\tt = nil\n\tt.GetCurated()\n}\n\nfunc TestTopicResult_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TopicResult{Description: &zeroValue}\n\tt.GetDescription()\n\tt = &TopicResult{}\n\tt.GetDescription()\n\tt = nil\n\tt.GetDescription()\n}\n\nfunc TestTopicResult_GetDisplayName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TopicResult{DisplayName: &zeroValue}\n\tt.GetDisplayName()\n\tt = &TopicResult{}\n\tt.GetDisplayName()\n\tt = nil\n\tt.GetDisplayName()\n}\n\nfunc TestTopicResult_GetFeatured(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tt := &TopicResult{Featured: &zeroValue}\n\tt.GetFeatured()\n\tt = &TopicResult{}\n\tt.GetFeatured()\n\tt = nil\n\tt.GetFeatured()\n}\n\nfunc TestTopicResult_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TopicResult{Name: &zeroValue}\n\tt.GetName()\n\tt = &TopicResult{}\n\tt.GetName()\n\tt = nil\n\tt.GetName()\n}\n\nfunc TestTopicResult_GetScore(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue float64\n\tt := &TopicResult{Score: &zeroValue}\n\tt.GetScore()\n\tt = &TopicResult{}\n\tt.GetScore()\n\tt = nil\n\tt.GetScore()\n}\n\nfunc TestTopicResult_GetShortDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TopicResult{ShortDescription: &zeroValue}\n\tt.GetShortDescription()\n\tt = &TopicResult{}\n\tt.GetShortDescription()\n\tt = nil\n\tt.GetShortDescription()\n}\n\nfunc TestTopicResult_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TopicResult{UpdatedAt: &zeroValue}\n\tt.GetUpdatedAt()\n\tt = &TopicResult{}\n\tt.GetUpdatedAt()\n\tt = nil\n\tt.GetUpdatedAt()\n}\n\nfunc TestTopicsSearchResult_GetIncompleteResults(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tt := &TopicsSearchResult{IncompleteResults: &zeroValue}\n\tt.GetIncompleteResults()\n\tt = &TopicsSearchResult{}\n\tt.GetIncompleteResults()\n\tt = nil\n\tt.GetIncompleteResults()\n}\n\nfunc TestTopicsSearchResult_GetTopics(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*TopicResult{}\n\tt := &TopicsSearchResult{Topics: zeroValue}\n\tt.GetTopics()\n\tt = &TopicsSearchResult{}\n\tt.GetTopics()\n\tt = nil\n\tt.GetTopics()\n}\n\nfunc TestTopicsSearchResult_GetTotal(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tt := &TopicsSearchResult{Total: &zeroValue}\n\tt.GetTotal()\n\tt = &TopicsSearchResult{}\n\tt.GetTotal()\n\tt = nil\n\tt.GetTotal()\n}\n\nfunc TestTotalCacheUsage_GetTotalActiveCachesCount(tt *testing.T) {\n\ttt.Parallel()\n\tt := &TotalCacheUsage{}\n\tt.GetTotalActiveCachesCount()\n\tt = nil\n\tt.GetTotalActiveCachesCount()\n}\n\nfunc TestTotalCacheUsage_GetTotalActiveCachesUsageSizeInBytes(tt *testing.T) {\n\ttt.Parallel()\n\tt := &TotalCacheUsage{}\n\tt.GetTotalActiveCachesUsageSizeInBytes()\n\tt = nil\n\tt.GetTotalActiveCachesUsageSizeInBytes()\n}\n\nfunc TestTrafficBreakdownOptions_GetPer(tt *testing.T) {\n\ttt.Parallel()\n\tt := &TrafficBreakdownOptions{}\n\tt.GetPer()\n\tt = nil\n\tt.GetPer()\n}\n\nfunc TestTrafficClones_GetClones(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*TrafficData{}\n\tt := &TrafficClones{Clones: zeroValue}\n\tt.GetClones()\n\tt = &TrafficClones{}\n\tt.GetClones()\n\tt = nil\n\tt.GetClones()\n}\n\nfunc TestTrafficClones_GetCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tt := &TrafficClones{Count: &zeroValue}\n\tt.GetCount()\n\tt = &TrafficClones{}\n\tt.GetCount()\n\tt = nil\n\tt.GetCount()\n}\n\nfunc TestTrafficClones_GetUniques(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tt := &TrafficClones{Uniques: &zeroValue}\n\tt.GetUniques()\n\tt = &TrafficClones{}\n\tt.GetUniques()\n\tt = nil\n\tt.GetUniques()\n}\n\nfunc TestTrafficData_GetCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tt := &TrafficData{Count: &zeroValue}\n\tt.GetCount()\n\tt = &TrafficData{}\n\tt.GetCount()\n\tt = nil\n\tt.GetCount()\n}\n\nfunc TestTrafficData_GetTimestamp(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tt := &TrafficData{Timestamp: &zeroValue}\n\tt.GetTimestamp()\n\tt = &TrafficData{}\n\tt.GetTimestamp()\n\tt = nil\n\tt.GetTimestamp()\n}\n\nfunc TestTrafficData_GetUniques(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tt := &TrafficData{Uniques: &zeroValue}\n\tt.GetUniques()\n\tt = &TrafficData{}\n\tt.GetUniques()\n\tt = nil\n\tt.GetUniques()\n}\n\nfunc TestTrafficPath_GetCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tt := &TrafficPath{Count: &zeroValue}\n\tt.GetCount()\n\tt = &TrafficPath{}\n\tt.GetCount()\n\tt = nil\n\tt.GetCount()\n}\n\nfunc TestTrafficPath_GetPath(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TrafficPath{Path: &zeroValue}\n\tt.GetPath()\n\tt = &TrafficPath{}\n\tt.GetPath()\n\tt = nil\n\tt.GetPath()\n}\n\nfunc TestTrafficPath_GetTitle(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TrafficPath{Title: &zeroValue}\n\tt.GetTitle()\n\tt = &TrafficPath{}\n\tt.GetTitle()\n\tt = nil\n\tt.GetTitle()\n}\n\nfunc TestTrafficPath_GetUniques(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tt := &TrafficPath{Uniques: &zeroValue}\n\tt.GetUniques()\n\tt = &TrafficPath{}\n\tt.GetUniques()\n\tt = nil\n\tt.GetUniques()\n}\n\nfunc TestTrafficReferrer_GetCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tt := &TrafficReferrer{Count: &zeroValue}\n\tt.GetCount()\n\tt = &TrafficReferrer{}\n\tt.GetCount()\n\tt = nil\n\tt.GetCount()\n}\n\nfunc TestTrafficReferrer_GetReferrer(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TrafficReferrer{Referrer: &zeroValue}\n\tt.GetReferrer()\n\tt = &TrafficReferrer{}\n\tt.GetReferrer()\n\tt = nil\n\tt.GetReferrer()\n}\n\nfunc TestTrafficReferrer_GetUniques(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tt := &TrafficReferrer{Uniques: &zeroValue}\n\tt.GetUniques()\n\tt = &TrafficReferrer{}\n\tt.GetUniques()\n\tt = nil\n\tt.GetUniques()\n}\n\nfunc TestTrafficViews_GetCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tt := &TrafficViews{Count: &zeroValue}\n\tt.GetCount()\n\tt = &TrafficViews{}\n\tt.GetCount()\n\tt = nil\n\tt.GetCount()\n}\n\nfunc TestTrafficViews_GetUniques(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tt := &TrafficViews{Uniques: &zeroValue}\n\tt.GetUniques()\n\tt = &TrafficViews{}\n\tt.GetUniques()\n\tt = nil\n\tt.GetUniques()\n}\n\nfunc TestTrafficViews_GetViews(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*TrafficData{}\n\tt := &TrafficViews{Views: zeroValue}\n\tt.GetViews()\n\tt = &TrafficViews{}\n\tt.GetViews()\n\tt = nil\n\tt.GetViews()\n}\n\nfunc TestTransferRequest_GetNewName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TransferRequest{NewName: &zeroValue}\n\tt.GetNewName()\n\tt = &TransferRequest{}\n\tt.GetNewName()\n\tt = nil\n\tt.GetNewName()\n}\n\nfunc TestTransferRequest_GetNewOwner(tt *testing.T) {\n\ttt.Parallel()\n\tt := &TransferRequest{}\n\tt.GetNewOwner()\n\tt = nil\n\tt.GetNewOwner()\n}\n\nfunc TestTransferRequest_GetTeamID(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []int64{}\n\tt := &TransferRequest{TeamID: zeroValue}\n\tt.GetTeamID()\n\tt = &TransferRequest{}\n\tt.GetTeamID()\n\tt = nil\n\tt.GetTeamID()\n}\n\nfunc TestTree_GetEntries(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*TreeEntry{}\n\tt := &Tree{Entries: zeroValue}\n\tt.GetEntries()\n\tt = &Tree{}\n\tt.GetEntries()\n\tt = nil\n\tt.GetEntries()\n}\n\nfunc TestTree_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &Tree{SHA: &zeroValue}\n\tt.GetSHA()\n\tt = &Tree{}\n\tt.GetSHA()\n\tt = nil\n\tt.GetSHA()\n}\n\nfunc TestTree_GetTruncated(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tt := &Tree{Truncated: &zeroValue}\n\tt.GetTruncated()\n\tt = &Tree{}\n\tt.GetTruncated()\n\tt = nil\n\tt.GetTruncated()\n}\n\nfunc TestTreeEntry_GetContent(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TreeEntry{Content: &zeroValue}\n\tt.GetContent()\n\tt = &TreeEntry{}\n\tt.GetContent()\n\tt = nil\n\tt.GetContent()\n}\n\nfunc TestTreeEntry_GetMode(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TreeEntry{Mode: &zeroValue}\n\tt.GetMode()\n\tt = &TreeEntry{}\n\tt.GetMode()\n\tt = nil\n\tt.GetMode()\n}\n\nfunc TestTreeEntry_GetPath(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TreeEntry{Path: &zeroValue}\n\tt.GetPath()\n\tt = &TreeEntry{}\n\tt.GetPath()\n\tt = nil\n\tt.GetPath()\n}\n\nfunc TestTreeEntry_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TreeEntry{SHA: &zeroValue}\n\tt.GetSHA()\n\tt = &TreeEntry{}\n\tt.GetSHA()\n\tt = nil\n\tt.GetSHA()\n}\n\nfunc TestTreeEntry_GetSize(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tt := &TreeEntry{Size: &zeroValue}\n\tt.GetSize()\n\tt = &TreeEntry{}\n\tt.GetSize()\n\tt = nil\n\tt.GetSize()\n}\n\nfunc TestTreeEntry_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TreeEntry{Type: &zeroValue}\n\tt.GetType()\n\tt = &TreeEntry{}\n\tt.GetType()\n\tt = nil\n\tt.GetType()\n}\n\nfunc TestTreeEntry_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tt := &TreeEntry{URL: &zeroValue}\n\tt.GetURL()\n\tt = &TreeEntry{}\n\tt.GetURL()\n\tt = nil\n\tt.GetURL()\n}\n\nfunc TestUnauthenticatedRateLimitedTransport_GetClientID(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UnauthenticatedRateLimitedTransport{}\n\tu.GetClientID()\n\tu = nil\n\tu.GetClientID()\n}\n\nfunc TestUnauthenticatedRateLimitedTransport_GetClientSecret(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UnauthenticatedRateLimitedTransport{}\n\tu.GetClientSecret()\n\tu = nil\n\tu.GetClientSecret()\n}\n\nfunc TestUpdateAppInstallationRepositoriesOptions_GetRepositorySelection(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UpdateAppInstallationRepositoriesOptions{RepositorySelection: &zeroValue}\n\tu.GetRepositorySelection()\n\tu = &UpdateAppInstallationRepositoriesOptions{}\n\tu.GetRepositorySelection()\n\tu = nil\n\tu.GetRepositorySelection()\n}\n\nfunc TestUpdateAppInstallationRepositoriesOptions_GetSelectedRepositoryIDs(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []int64{}\n\tu := &UpdateAppInstallationRepositoriesOptions{SelectedRepositoryIDs: zeroValue}\n\tu.GetSelectedRepositoryIDs()\n\tu = &UpdateAppInstallationRepositoriesOptions{}\n\tu.GetSelectedRepositoryIDs()\n\tu = nil\n\tu.GetSelectedRepositoryIDs()\n}\n\nfunc TestUpdateAttributeForSCIMUserOperations_GetOp(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UpdateAttributeForSCIMUserOperations{}\n\tu.GetOp()\n\tu = nil\n\tu.GetOp()\n}\n\nfunc TestUpdateAttributeForSCIMUserOperations_GetPath(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UpdateAttributeForSCIMUserOperations{Path: &zeroValue}\n\tu.GetPath()\n\tu = &UpdateAttributeForSCIMUserOperations{}\n\tu.GetPath()\n\tu = nil\n\tu.GetPath()\n}\n\nfunc TestUpdateAttributeForSCIMUserOperations_GetValue(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UpdateAttributeForSCIMUserOperations{}\n\tu.GetValue()\n\tu = nil\n\tu.GetValue()\n}\n\nfunc TestUpdateAttributeForSCIMUserOptions_GetOperations(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UpdateAttributeForSCIMUserOptions{}\n\tu.GetOperations()\n\tu = nil\n\tu.GetOperations()\n}\n\nfunc TestUpdateAttributeForSCIMUserOptions_GetSchemas(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tu := &UpdateAttributeForSCIMUserOptions{Schemas: zeroValue}\n\tu.GetSchemas()\n\tu = &UpdateAttributeForSCIMUserOptions{}\n\tu.GetSchemas()\n\tu = nil\n\tu.GetSchemas()\n}\n\nfunc TestUpdateBranchRule_GetParameters(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UpdateBranchRule{}\n\tu.GetParameters()\n\tu = nil\n\tu.GetParameters()\n}\n\nfunc TestUpdateCheckRunOptions_GetActions(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*CheckRunAction{}\n\tu := &UpdateCheckRunOptions{Actions: zeroValue}\n\tu.GetActions()\n\tu = &UpdateCheckRunOptions{}\n\tu.GetActions()\n\tu = nil\n\tu.GetActions()\n}\n\nfunc TestUpdateCheckRunOptions_GetCompletedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tu := &UpdateCheckRunOptions{CompletedAt: &zeroValue}\n\tu.GetCompletedAt()\n\tu = &UpdateCheckRunOptions{}\n\tu.GetCompletedAt()\n\tu = nil\n\tu.GetCompletedAt()\n}\n\nfunc TestUpdateCheckRunOptions_GetConclusion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UpdateCheckRunOptions{Conclusion: &zeroValue}\n\tu.GetConclusion()\n\tu = &UpdateCheckRunOptions{}\n\tu.GetConclusion()\n\tu = nil\n\tu.GetConclusion()\n}\n\nfunc TestUpdateCheckRunOptions_GetDetailsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UpdateCheckRunOptions{DetailsURL: &zeroValue}\n\tu.GetDetailsURL()\n\tu = &UpdateCheckRunOptions{}\n\tu.GetDetailsURL()\n\tu = nil\n\tu.GetDetailsURL()\n}\n\nfunc TestUpdateCheckRunOptions_GetExternalID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UpdateCheckRunOptions{ExternalID: &zeroValue}\n\tu.GetExternalID()\n\tu = &UpdateCheckRunOptions{}\n\tu.GetExternalID()\n\tu = nil\n\tu.GetExternalID()\n}\n\nfunc TestUpdateCheckRunOptions_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UpdateCheckRunOptions{}\n\tu.GetName()\n\tu = nil\n\tu.GetName()\n}\n\nfunc TestUpdateCheckRunOptions_GetOutput(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UpdateCheckRunOptions{}\n\tu.GetOutput()\n\tu = nil\n\tu.GetOutput()\n}\n\nfunc TestUpdateCheckRunOptions_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UpdateCheckRunOptions{Status: &zeroValue}\n\tu.GetStatus()\n\tu = &UpdateCheckRunOptions{}\n\tu.GetStatus()\n\tu = nil\n\tu.GetStatus()\n}\n\nfunc TestUpdateCodespaceOptions_GetMachine(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UpdateCodespaceOptions{Machine: &zeroValue}\n\tu.GetMachine()\n\tu = &UpdateCodespaceOptions{}\n\tu.GetMachine()\n\tu = nil\n\tu.GetMachine()\n}\n\nfunc TestUpdateCodespaceOptions_GetRecentFolders(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tu := &UpdateCodespaceOptions{RecentFolders: zeroValue}\n\tu.GetRecentFolders()\n\tu = &UpdateCodespaceOptions{}\n\tu.GetRecentFolders()\n\tu = nil\n\tu.GetRecentFolders()\n}\n\nfunc TestUpdateCustomOrgRoleRequest_GetBaseRole(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UpdateCustomOrgRoleRequest{BaseRole: &zeroValue}\n\tu.GetBaseRole()\n\tu = &UpdateCustomOrgRoleRequest{}\n\tu.GetBaseRole()\n\tu = nil\n\tu.GetBaseRole()\n}\n\nfunc TestUpdateCustomOrgRoleRequest_GetDescription(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UpdateCustomOrgRoleRequest{Description: &zeroValue}\n\tu.GetDescription()\n\tu = &UpdateCustomOrgRoleRequest{}\n\tu.GetDescription()\n\tu = nil\n\tu.GetDescription()\n}\n\nfunc TestUpdateCustomOrgRoleRequest_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UpdateCustomOrgRoleRequest{Name: &zeroValue}\n\tu.GetName()\n\tu = &UpdateCustomOrgRoleRequest{}\n\tu.GetName()\n\tu = nil\n\tu.GetName()\n}\n\nfunc TestUpdateCustomOrgRoleRequest_GetPermissions(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tu := &UpdateCustomOrgRoleRequest{Permissions: zeroValue}\n\tu.GetPermissions()\n\tu = &UpdateCustomOrgRoleRequest{}\n\tu.GetPermissions()\n\tu = nil\n\tu.GetPermissions()\n}\n\nfunc TestUpdateDefaultSetupConfigurationOptions_GetLanguages(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tu := &UpdateDefaultSetupConfigurationOptions{Languages: zeroValue}\n\tu.GetLanguages()\n\tu = &UpdateDefaultSetupConfigurationOptions{}\n\tu.GetLanguages()\n\tu = nil\n\tu.GetLanguages()\n}\n\nfunc TestUpdateDefaultSetupConfigurationOptions_GetQuerySuite(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UpdateDefaultSetupConfigurationOptions{QuerySuite: &zeroValue}\n\tu.GetQuerySuite()\n\tu = &UpdateDefaultSetupConfigurationOptions{}\n\tu.GetQuerySuite()\n\tu = nil\n\tu.GetQuerySuite()\n}\n\nfunc TestUpdateDefaultSetupConfigurationOptions_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UpdateDefaultSetupConfigurationOptions{}\n\tu.GetState()\n\tu = nil\n\tu.GetState()\n}\n\nfunc TestUpdateDefaultSetupConfigurationResponse_GetRunID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tu := &UpdateDefaultSetupConfigurationResponse{RunID: &zeroValue}\n\tu.GetRunID()\n\tu = &UpdateDefaultSetupConfigurationResponse{}\n\tu.GetRunID()\n\tu = nil\n\tu.GetRunID()\n}\n\nfunc TestUpdateDefaultSetupConfigurationResponse_GetRunURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UpdateDefaultSetupConfigurationResponse{RunURL: &zeroValue}\n\tu.GetRunURL()\n\tu = &UpdateDefaultSetupConfigurationResponse{}\n\tu.GetRunURL()\n\tu = nil\n\tu.GetRunURL()\n}\n\nfunc TestUpdateEnterpriseRunnerGroupRequest_GetAllowsPublicRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tu := &UpdateEnterpriseRunnerGroupRequest{AllowsPublicRepositories: &zeroValue}\n\tu.GetAllowsPublicRepositories()\n\tu = &UpdateEnterpriseRunnerGroupRequest{}\n\tu.GetAllowsPublicRepositories()\n\tu = nil\n\tu.GetAllowsPublicRepositories()\n}\n\nfunc TestUpdateEnterpriseRunnerGroupRequest_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UpdateEnterpriseRunnerGroupRequest{Name: &zeroValue}\n\tu.GetName()\n\tu = &UpdateEnterpriseRunnerGroupRequest{}\n\tu.GetName()\n\tu = nil\n\tu.GetName()\n}\n\nfunc TestUpdateEnterpriseRunnerGroupRequest_GetNetworkConfigurationID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UpdateEnterpriseRunnerGroupRequest{NetworkConfigurationID: &zeroValue}\n\tu.GetNetworkConfigurationID()\n\tu = &UpdateEnterpriseRunnerGroupRequest{}\n\tu.GetNetworkConfigurationID()\n\tu = nil\n\tu.GetNetworkConfigurationID()\n}\n\nfunc TestUpdateEnterpriseRunnerGroupRequest_GetRestrictedToWorkflows(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tu := &UpdateEnterpriseRunnerGroupRequest{RestrictedToWorkflows: &zeroValue}\n\tu.GetRestrictedToWorkflows()\n\tu = &UpdateEnterpriseRunnerGroupRequest{}\n\tu.GetRestrictedToWorkflows()\n\tu = nil\n\tu.GetRestrictedToWorkflows()\n}\n\nfunc TestUpdateEnterpriseRunnerGroupRequest_GetSelectedWorkflows(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tu := &UpdateEnterpriseRunnerGroupRequest{SelectedWorkflows: zeroValue}\n\tu.GetSelectedWorkflows()\n\tu = &UpdateEnterpriseRunnerGroupRequest{}\n\tu.GetSelectedWorkflows()\n\tu = nil\n\tu.GetSelectedWorkflows()\n}\n\nfunc TestUpdateEnterpriseRunnerGroupRequest_GetVisibility(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UpdateEnterpriseRunnerGroupRequest{Visibility: &zeroValue}\n\tu.GetVisibility()\n\tu = &UpdateEnterpriseRunnerGroupRequest{}\n\tu.GetVisibility()\n\tu = nil\n\tu.GetVisibility()\n}\n\nfunc TestUpdateHostedRunnerRequest_GetEnableStaticIP(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tu := &UpdateHostedRunnerRequest{EnableStaticIP: &zeroValue}\n\tu.GetEnableStaticIP()\n\tu = &UpdateHostedRunnerRequest{}\n\tu.GetEnableStaticIP()\n\tu = nil\n\tu.GetEnableStaticIP()\n}\n\nfunc TestUpdateHostedRunnerRequest_GetImageID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UpdateHostedRunnerRequest{ImageID: &zeroValue}\n\tu.GetImageID()\n\tu = &UpdateHostedRunnerRequest{}\n\tu.GetImageID()\n\tu = nil\n\tu.GetImageID()\n}\n\nfunc TestUpdateHostedRunnerRequest_GetImageVersion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UpdateHostedRunnerRequest{ImageVersion: &zeroValue}\n\tu.GetImageVersion()\n\tu = &UpdateHostedRunnerRequest{}\n\tu.GetImageVersion()\n\tu = nil\n\tu.GetImageVersion()\n}\n\nfunc TestUpdateHostedRunnerRequest_GetMaximumRunners(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tu := &UpdateHostedRunnerRequest{MaximumRunners: &zeroValue}\n\tu.GetMaximumRunners()\n\tu = &UpdateHostedRunnerRequest{}\n\tu.GetMaximumRunners()\n\tu = nil\n\tu.GetMaximumRunners()\n}\n\nfunc TestUpdateHostedRunnerRequest_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UpdateHostedRunnerRequest{Name: &zeroValue}\n\tu.GetName()\n\tu = &UpdateHostedRunnerRequest{}\n\tu.GetName()\n\tu = nil\n\tu.GetName()\n}\n\nfunc TestUpdateHostedRunnerRequest_GetRunnerGroupID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tu := &UpdateHostedRunnerRequest{RunnerGroupID: &zeroValue}\n\tu.GetRunnerGroupID()\n\tu = &UpdateHostedRunnerRequest{}\n\tu.GetRunnerGroupID()\n\tu = nil\n\tu.GetRunnerGroupID()\n}\n\nfunc TestUpdateHostedRunnerRequest_GetSize(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UpdateHostedRunnerRequest{Size: &zeroValue}\n\tu.GetSize()\n\tu = &UpdateHostedRunnerRequest{}\n\tu.GetSize()\n\tu = nil\n\tu.GetSize()\n}\n\nfunc TestUpdateOrganizationPrivateRegistry_GetEncryptedValue(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UpdateOrganizationPrivateRegistry{EncryptedValue: &zeroValue}\n\tu.GetEncryptedValue()\n\tu = &UpdateOrganizationPrivateRegistry{}\n\tu.GetEncryptedValue()\n\tu = nil\n\tu.GetEncryptedValue()\n}\n\nfunc TestUpdateOrganizationPrivateRegistry_GetKeyID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UpdateOrganizationPrivateRegistry{KeyID: &zeroValue}\n\tu.GetKeyID()\n\tu = &UpdateOrganizationPrivateRegistry{}\n\tu.GetKeyID()\n\tu = nil\n\tu.GetKeyID()\n}\n\nfunc TestUpdateOrganizationPrivateRegistry_GetRegistryType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UpdateOrganizationPrivateRegistry{RegistryType: &zeroValue}\n\tu.GetRegistryType()\n\tu = &UpdateOrganizationPrivateRegistry{}\n\tu.GetRegistryType()\n\tu = nil\n\tu.GetRegistryType()\n}\n\nfunc TestUpdateOrganizationPrivateRegistry_GetSelectedRepositoryIDs(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []int64{}\n\tu := &UpdateOrganizationPrivateRegistry{SelectedRepositoryIDs: zeroValue}\n\tu.GetSelectedRepositoryIDs()\n\tu = &UpdateOrganizationPrivateRegistry{}\n\tu.GetSelectedRepositoryIDs()\n\tu = nil\n\tu.GetSelectedRepositoryIDs()\n}\n\nfunc TestUpdateOrganizationPrivateRegistry_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UpdateOrganizationPrivateRegistry{URL: &zeroValue}\n\tu.GetURL()\n\tu = &UpdateOrganizationPrivateRegistry{}\n\tu.GetURL()\n\tu = nil\n\tu.GetURL()\n}\n\nfunc TestUpdateOrganizationPrivateRegistry_GetUsername(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UpdateOrganizationPrivateRegistry{Username: &zeroValue}\n\tu.GetUsername()\n\tu = &UpdateOrganizationPrivateRegistry{}\n\tu.GetUsername()\n\tu = nil\n\tu.GetUsername()\n}\n\nfunc TestUpdateOrganizationPrivateRegistry_GetVisibility(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UpdateOrganizationPrivateRegistry{}\n\tu.GetVisibility()\n\tu = nil\n\tu.GetVisibility()\n}\n\nfunc TestUpdateProjectItemOptions_GetArchived(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tu := &UpdateProjectItemOptions{Archived: &zeroValue}\n\tu.GetArchived()\n\tu = &UpdateProjectItemOptions{}\n\tu.GetArchived()\n\tu = nil\n\tu.GetArchived()\n}\n\nfunc TestUpdateProjectItemOptions_GetFields(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*UpdateProjectV2Field{}\n\tu := &UpdateProjectItemOptions{Fields: zeroValue}\n\tu.GetFields()\n\tu = &UpdateProjectItemOptions{}\n\tu.GetFields()\n\tu = nil\n\tu.GetFields()\n}\n\nfunc TestUpdateProjectV2Field_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UpdateProjectV2Field{}\n\tu.GetID()\n\tu = nil\n\tu.GetID()\n}\n\nfunc TestUpdateProjectV2Field_GetValue(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UpdateProjectV2Field{}\n\tu.GetValue()\n\tu = nil\n\tu.GetValue()\n}\n\nfunc TestUpdateRef_GetForce(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tu := &UpdateRef{Force: &zeroValue}\n\tu.GetForce()\n\tu = &UpdateRef{}\n\tu.GetForce()\n\tu = nil\n\tu.GetForce()\n}\n\nfunc TestUpdateRef_GetSHA(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UpdateRef{}\n\tu.GetSHA()\n\tu = nil\n\tu.GetSHA()\n}\n\nfunc TestUpdateRuleParameters_GetUpdateAllowsFetchAndMerge(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UpdateRuleParameters{}\n\tu.GetUpdateAllowsFetchAndMerge()\n\tu = nil\n\tu.GetUpdateAllowsFetchAndMerge()\n}\n\nfunc TestUpdateRunnerGroupRequest_GetAllowsPublicRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tu := &UpdateRunnerGroupRequest{AllowsPublicRepositories: &zeroValue}\n\tu.GetAllowsPublicRepositories()\n\tu = &UpdateRunnerGroupRequest{}\n\tu.GetAllowsPublicRepositories()\n\tu = nil\n\tu.GetAllowsPublicRepositories()\n}\n\nfunc TestUpdateRunnerGroupRequest_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UpdateRunnerGroupRequest{Name: &zeroValue}\n\tu.GetName()\n\tu = &UpdateRunnerGroupRequest{}\n\tu.GetName()\n\tu = nil\n\tu.GetName()\n}\n\nfunc TestUpdateRunnerGroupRequest_GetNetworkConfigurationID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UpdateRunnerGroupRequest{NetworkConfigurationID: &zeroValue}\n\tu.GetNetworkConfigurationID()\n\tu = &UpdateRunnerGroupRequest{}\n\tu.GetNetworkConfigurationID()\n\tu = nil\n\tu.GetNetworkConfigurationID()\n}\n\nfunc TestUpdateRunnerGroupRequest_GetRestrictedToWorkflows(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tu := &UpdateRunnerGroupRequest{RestrictedToWorkflows: &zeroValue}\n\tu.GetRestrictedToWorkflows()\n\tu = &UpdateRunnerGroupRequest{}\n\tu.GetRestrictedToWorkflows()\n\tu = nil\n\tu.GetRestrictedToWorkflows()\n}\n\nfunc TestUpdateRunnerGroupRequest_GetSelectedWorkflows(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tu := &UpdateRunnerGroupRequest{SelectedWorkflows: zeroValue}\n\tu.GetSelectedWorkflows()\n\tu = &UpdateRunnerGroupRequest{}\n\tu.GetSelectedWorkflows()\n\tu = nil\n\tu.GetSelectedWorkflows()\n}\n\nfunc TestUpdateRunnerGroupRequest_GetVisibility(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UpdateRunnerGroupRequest{Visibility: &zeroValue}\n\tu.GetVisibility()\n\tu = &UpdateRunnerGroupRequest{}\n\tu.GetVisibility()\n\tu = nil\n\tu.GetVisibility()\n}\n\nfunc TestUploadLicenseOptions_GetLicense(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UploadLicenseOptions{}\n\tu.GetLicense()\n\tu = nil\n\tu.GetLicense()\n}\n\nfunc TestUploadOptions_GetLabel(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UploadOptions{}\n\tu.GetLabel()\n\tu = nil\n\tu.GetLabel()\n}\n\nfunc TestUploadOptions_GetMediaType(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UploadOptions{}\n\tu.GetMediaType()\n\tu = nil\n\tu.GetMediaType()\n}\n\nfunc TestUploadOptions_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UploadOptions{}\n\tu.GetName()\n\tu = nil\n\tu.GetName()\n}\n\nfunc TestUsageItem_GetDate(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UsageItem{}\n\tu.GetDate()\n\tu = nil\n\tu.GetDate()\n}\n\nfunc TestUsageItem_GetDiscountAmount(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UsageItem{}\n\tu.GetDiscountAmount()\n\tu = nil\n\tu.GetDiscountAmount()\n}\n\nfunc TestUsageItem_GetGrossAmount(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UsageItem{}\n\tu.GetGrossAmount()\n\tu = nil\n\tu.GetGrossAmount()\n}\n\nfunc TestUsageItem_GetNetAmount(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UsageItem{}\n\tu.GetNetAmount()\n\tu = nil\n\tu.GetNetAmount()\n}\n\nfunc TestUsageItem_GetOrganizationName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UsageItem{OrganizationName: &zeroValue}\n\tu.GetOrganizationName()\n\tu = &UsageItem{}\n\tu.GetOrganizationName()\n\tu = nil\n\tu.GetOrganizationName()\n}\n\nfunc TestUsageItem_GetPricePerUnit(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UsageItem{}\n\tu.GetPricePerUnit()\n\tu = nil\n\tu.GetPricePerUnit()\n}\n\nfunc TestUsageItem_GetProduct(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UsageItem{}\n\tu.GetProduct()\n\tu = nil\n\tu.GetProduct()\n}\n\nfunc TestUsageItem_GetQuantity(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UsageItem{}\n\tu.GetQuantity()\n\tu = nil\n\tu.GetQuantity()\n}\n\nfunc TestUsageItem_GetRepositoryName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UsageItem{RepositoryName: &zeroValue}\n\tu.GetRepositoryName()\n\tu = &UsageItem{}\n\tu.GetRepositoryName()\n\tu = nil\n\tu.GetRepositoryName()\n}\n\nfunc TestUsageItem_GetSKU(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UsageItem{}\n\tu.GetSKU()\n\tu = nil\n\tu.GetSKU()\n}\n\nfunc TestUsageItem_GetUnitType(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UsageItem{}\n\tu.GetUnitType()\n\tu = nil\n\tu.GetUnitType()\n}\n\nfunc TestUsageReport_GetUsageItems(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*UsageItem{}\n\tu := &UsageReport{UsageItems: zeroValue}\n\tu.GetUsageItems()\n\tu = &UsageReport{}\n\tu.GetUsageItems()\n\tu = nil\n\tu.GetUsageItems()\n}\n\nfunc TestUsageReportOptions_GetDay(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tu := &UsageReportOptions{Day: &zeroValue}\n\tu.GetDay()\n\tu = &UsageReportOptions{}\n\tu.GetDay()\n\tu = nil\n\tu.GetDay()\n}\n\nfunc TestUsageReportOptions_GetHour(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tu := &UsageReportOptions{Hour: &zeroValue}\n\tu.GetHour()\n\tu = &UsageReportOptions{}\n\tu.GetHour()\n\tu = nil\n\tu.GetHour()\n}\n\nfunc TestUsageReportOptions_GetMonth(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tu := &UsageReportOptions{Month: &zeroValue}\n\tu.GetMonth()\n\tu = &UsageReportOptions{}\n\tu.GetMonth()\n\tu = nil\n\tu.GetMonth()\n}\n\nfunc TestUsageReportOptions_GetYear(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tu := &UsageReportOptions{Year: &zeroValue}\n\tu.GetYear()\n\tu = &UsageReportOptions{}\n\tu.GetYear()\n\tu = nil\n\tu.GetYear()\n}\n\nfunc TestUser_GetAssignment(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &User{Assignment: &zeroValue}\n\tu.GetAssignment()\n\tu = &User{}\n\tu.GetAssignment()\n\tu = nil\n\tu.GetAssignment()\n}\n\nfunc TestUser_GetAvatarURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &User{AvatarURL: &zeroValue}\n\tu.GetAvatarURL()\n\tu = &User{}\n\tu.GetAvatarURL()\n\tu = nil\n\tu.GetAvatarURL()\n}\n\nfunc TestUser_GetBio(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &User{Bio: &zeroValue}\n\tu.GetBio()\n\tu = &User{}\n\tu.GetBio()\n\tu = nil\n\tu.GetBio()\n}\n\nfunc TestUser_GetBlog(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &User{Blog: &zeroValue}\n\tu.GetBlog()\n\tu = &User{}\n\tu.GetBlog()\n\tu = nil\n\tu.GetBlog()\n}\n\nfunc TestUser_GetCollaborators(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tu := &User{Collaborators: &zeroValue}\n\tu.GetCollaborators()\n\tu = &User{}\n\tu.GetCollaborators()\n\tu = nil\n\tu.GetCollaborators()\n}\n\nfunc TestUser_GetCompany(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &User{Company: &zeroValue}\n\tu.GetCompany()\n\tu = &User{}\n\tu.GetCompany()\n\tu = nil\n\tu.GetCompany()\n}\n\nfunc TestUser_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tu := &User{CreatedAt: &zeroValue}\n\tu.GetCreatedAt()\n\tu = &User{}\n\tu.GetCreatedAt()\n\tu = nil\n\tu.GetCreatedAt()\n}\n\nfunc TestUser_GetDiskUsage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tu := &User{DiskUsage: &zeroValue}\n\tu.GetDiskUsage()\n\tu = &User{}\n\tu.GetDiskUsage()\n\tu = nil\n\tu.GetDiskUsage()\n}\n\nfunc TestUser_GetEmail(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &User{Email: &zeroValue}\n\tu.GetEmail()\n\tu = &User{}\n\tu.GetEmail()\n\tu = nil\n\tu.GetEmail()\n}\n\nfunc TestUser_GetEventsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &User{EventsURL: &zeroValue}\n\tu.GetEventsURL()\n\tu = &User{}\n\tu.GetEventsURL()\n\tu = nil\n\tu.GetEventsURL()\n}\n\nfunc TestUser_GetFollowers(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tu := &User{Followers: &zeroValue}\n\tu.GetFollowers()\n\tu = &User{}\n\tu.GetFollowers()\n\tu = nil\n\tu.GetFollowers()\n}\n\nfunc TestUser_GetFollowersURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &User{FollowersURL: &zeroValue}\n\tu.GetFollowersURL()\n\tu = &User{}\n\tu.GetFollowersURL()\n\tu = nil\n\tu.GetFollowersURL()\n}\n\nfunc TestUser_GetFollowing(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tu := &User{Following: &zeroValue}\n\tu.GetFollowing()\n\tu = &User{}\n\tu.GetFollowing()\n\tu = nil\n\tu.GetFollowing()\n}\n\nfunc TestUser_GetFollowingURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &User{FollowingURL: &zeroValue}\n\tu.GetFollowingURL()\n\tu = &User{}\n\tu.GetFollowingURL()\n\tu = nil\n\tu.GetFollowingURL()\n}\n\nfunc TestUser_GetGistsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &User{GistsURL: &zeroValue}\n\tu.GetGistsURL()\n\tu = &User{}\n\tu.GetGistsURL()\n\tu = nil\n\tu.GetGistsURL()\n}\n\nfunc TestUser_GetGravatarID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &User{GravatarID: &zeroValue}\n\tu.GetGravatarID()\n\tu = &User{}\n\tu.GetGravatarID()\n\tu = nil\n\tu.GetGravatarID()\n}\n\nfunc TestUser_GetHireable(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tu := &User{Hireable: &zeroValue}\n\tu.GetHireable()\n\tu = &User{}\n\tu.GetHireable()\n\tu = nil\n\tu.GetHireable()\n}\n\nfunc TestUser_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &User{HTMLURL: &zeroValue}\n\tu.GetHTMLURL()\n\tu = &User{}\n\tu.GetHTMLURL()\n\tu = nil\n\tu.GetHTMLURL()\n}\n\nfunc TestUser_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tu := &User{ID: &zeroValue}\n\tu.GetID()\n\tu = &User{}\n\tu.GetID()\n\tu = nil\n\tu.GetID()\n}\n\nfunc TestUser_GetInheritedFrom(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Team{}\n\tu := &User{InheritedFrom: zeroValue}\n\tu.GetInheritedFrom()\n\tu = &User{}\n\tu.GetInheritedFrom()\n\tu = nil\n\tu.GetInheritedFrom()\n}\n\nfunc TestUser_GetLdapDn(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &User{LdapDn: &zeroValue}\n\tu.GetLdapDn()\n\tu = &User{}\n\tu.GetLdapDn()\n\tu = nil\n\tu.GetLdapDn()\n}\n\nfunc TestUser_GetLocation(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &User{Location: &zeroValue}\n\tu.GetLocation()\n\tu = &User{}\n\tu.GetLocation()\n\tu = nil\n\tu.GetLocation()\n}\n\nfunc TestUser_GetLogin(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &User{Login: &zeroValue}\n\tu.GetLogin()\n\tu = &User{}\n\tu.GetLogin()\n\tu = nil\n\tu.GetLogin()\n}\n\nfunc TestUser_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &User{Name: &zeroValue}\n\tu.GetName()\n\tu = &User{}\n\tu.GetName()\n\tu = nil\n\tu.GetName()\n}\n\nfunc TestUser_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &User{NodeID: &zeroValue}\n\tu.GetNodeID()\n\tu = &User{}\n\tu.GetNodeID()\n\tu = nil\n\tu.GetNodeID()\n}\n\nfunc TestUser_GetOrganizationsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &User{OrganizationsURL: &zeroValue}\n\tu.GetOrganizationsURL()\n\tu = &User{}\n\tu.GetOrganizationsURL()\n\tu = nil\n\tu.GetOrganizationsURL()\n}\n\nfunc TestUser_GetOwnedPrivateRepos(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tu := &User{OwnedPrivateRepos: &zeroValue}\n\tu.GetOwnedPrivateRepos()\n\tu = &User{}\n\tu.GetOwnedPrivateRepos()\n\tu = nil\n\tu.GetOwnedPrivateRepos()\n}\n\nfunc TestUser_GetPermissions(tt *testing.T) {\n\ttt.Parallel()\n\tu := &User{}\n\tu.GetPermissions()\n\tu = nil\n\tu.GetPermissions()\n}\n\nfunc TestUser_GetPlan(tt *testing.T) {\n\ttt.Parallel()\n\tu := &User{}\n\tu.GetPlan()\n\tu = nil\n\tu.GetPlan()\n}\n\nfunc TestUser_GetPrivateGists(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tu := &User{PrivateGists: &zeroValue}\n\tu.GetPrivateGists()\n\tu = &User{}\n\tu.GetPrivateGists()\n\tu = nil\n\tu.GetPrivateGists()\n}\n\nfunc TestUser_GetPublicGists(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tu := &User{PublicGists: &zeroValue}\n\tu.GetPublicGists()\n\tu = &User{}\n\tu.GetPublicGists()\n\tu = nil\n\tu.GetPublicGists()\n}\n\nfunc TestUser_GetPublicRepos(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tu := &User{PublicRepos: &zeroValue}\n\tu.GetPublicRepos()\n\tu = &User{}\n\tu.GetPublicRepos()\n\tu = nil\n\tu.GetPublicRepos()\n}\n\nfunc TestUser_GetReceivedEventsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &User{ReceivedEventsURL: &zeroValue}\n\tu.GetReceivedEventsURL()\n\tu = &User{}\n\tu.GetReceivedEventsURL()\n\tu = nil\n\tu.GetReceivedEventsURL()\n}\n\nfunc TestUser_GetReposURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &User{ReposURL: &zeroValue}\n\tu.GetReposURL()\n\tu = &User{}\n\tu.GetReposURL()\n\tu = nil\n\tu.GetReposURL()\n}\n\nfunc TestUser_GetRoleName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &User{RoleName: &zeroValue}\n\tu.GetRoleName()\n\tu = &User{}\n\tu.GetRoleName()\n\tu = nil\n\tu.GetRoleName()\n}\n\nfunc TestUser_GetSiteAdmin(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tu := &User{SiteAdmin: &zeroValue}\n\tu.GetSiteAdmin()\n\tu = &User{}\n\tu.GetSiteAdmin()\n\tu = nil\n\tu.GetSiteAdmin()\n}\n\nfunc TestUser_GetStarredURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &User{StarredURL: &zeroValue}\n\tu.GetStarredURL()\n\tu = &User{}\n\tu.GetStarredURL()\n\tu = nil\n\tu.GetStarredURL()\n}\n\nfunc TestUser_GetSubscriptionsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &User{SubscriptionsURL: &zeroValue}\n\tu.GetSubscriptionsURL()\n\tu = &User{}\n\tu.GetSubscriptionsURL()\n\tu = nil\n\tu.GetSubscriptionsURL()\n}\n\nfunc TestUser_GetSuspendedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tu := &User{SuspendedAt: &zeroValue}\n\tu.GetSuspendedAt()\n\tu = &User{}\n\tu.GetSuspendedAt()\n\tu = nil\n\tu.GetSuspendedAt()\n}\n\nfunc TestUser_GetTextMatches(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*TextMatch{}\n\tu := &User{TextMatches: zeroValue}\n\tu.GetTextMatches()\n\tu = &User{}\n\tu.GetTextMatches()\n\tu = nil\n\tu.GetTextMatches()\n}\n\nfunc TestUser_GetTotalPrivateRepos(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tu := &User{TotalPrivateRepos: &zeroValue}\n\tu.GetTotalPrivateRepos()\n\tu = &User{}\n\tu.GetTotalPrivateRepos()\n\tu = nil\n\tu.GetTotalPrivateRepos()\n}\n\nfunc TestUser_GetTwitterUsername(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &User{TwitterUsername: &zeroValue}\n\tu.GetTwitterUsername()\n\tu = &User{}\n\tu.GetTwitterUsername()\n\tu = nil\n\tu.GetTwitterUsername()\n}\n\nfunc TestUser_GetTwoFactorAuthentication(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tu := &User{TwoFactorAuthentication: &zeroValue}\n\tu.GetTwoFactorAuthentication()\n\tu = &User{}\n\tu.GetTwoFactorAuthentication()\n\tu = nil\n\tu.GetTwoFactorAuthentication()\n}\n\nfunc TestUser_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &User{Type: &zeroValue}\n\tu.GetType()\n\tu = &User{}\n\tu.GetType()\n\tu = nil\n\tu.GetType()\n}\n\nfunc TestUser_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tu := &User{UpdatedAt: &zeroValue}\n\tu.GetUpdatedAt()\n\tu = &User{}\n\tu.GetUpdatedAt()\n\tu = nil\n\tu.GetUpdatedAt()\n}\n\nfunc TestUser_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &User{URL: &zeroValue}\n\tu.GetURL()\n\tu = &User{}\n\tu.GetURL()\n\tu = nil\n\tu.GetURL()\n}\n\nfunc TestUserAuthorization_GetApp(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UserAuthorization{}\n\tu.GetApp()\n\tu = nil\n\tu.GetApp()\n}\n\nfunc TestUserAuthorization_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tu := &UserAuthorization{CreatedAt: &zeroValue}\n\tu.GetCreatedAt()\n\tu = &UserAuthorization{}\n\tu.GetCreatedAt()\n\tu = nil\n\tu.GetCreatedAt()\n}\n\nfunc TestUserAuthorization_GetFingerprint(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserAuthorization{Fingerprint: &zeroValue}\n\tu.GetFingerprint()\n\tu = &UserAuthorization{}\n\tu.GetFingerprint()\n\tu = nil\n\tu.GetFingerprint()\n}\n\nfunc TestUserAuthorization_GetHashedToken(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserAuthorization{HashedToken: &zeroValue}\n\tu.GetHashedToken()\n\tu = &UserAuthorization{}\n\tu.GetHashedToken()\n\tu = nil\n\tu.GetHashedToken()\n}\n\nfunc TestUserAuthorization_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tu := &UserAuthorization{ID: &zeroValue}\n\tu.GetID()\n\tu = &UserAuthorization{}\n\tu.GetID()\n\tu = nil\n\tu.GetID()\n}\n\nfunc TestUserAuthorization_GetNote(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserAuthorization{Note: &zeroValue}\n\tu.GetNote()\n\tu = &UserAuthorization{}\n\tu.GetNote()\n\tu = nil\n\tu.GetNote()\n}\n\nfunc TestUserAuthorization_GetNoteURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserAuthorization{NoteURL: &zeroValue}\n\tu.GetNoteURL()\n\tu = &UserAuthorization{}\n\tu.GetNoteURL()\n\tu = nil\n\tu.GetNoteURL()\n}\n\nfunc TestUserAuthorization_GetScopes(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tu := &UserAuthorization{Scopes: zeroValue}\n\tu.GetScopes()\n\tu = &UserAuthorization{}\n\tu.GetScopes()\n\tu = nil\n\tu.GetScopes()\n}\n\nfunc TestUserAuthorization_GetToken(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserAuthorization{Token: &zeroValue}\n\tu.GetToken()\n\tu = &UserAuthorization{}\n\tu.GetToken()\n\tu = nil\n\tu.GetToken()\n}\n\nfunc TestUserAuthorization_GetTokenLastEight(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserAuthorization{TokenLastEight: &zeroValue}\n\tu.GetTokenLastEight()\n\tu = &UserAuthorization{}\n\tu.GetTokenLastEight()\n\tu = nil\n\tu.GetTokenLastEight()\n}\n\nfunc TestUserAuthorization_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tu := &UserAuthorization{UpdatedAt: &zeroValue}\n\tu.GetUpdatedAt()\n\tu = &UserAuthorization{}\n\tu.GetUpdatedAt()\n\tu = nil\n\tu.GetUpdatedAt()\n}\n\nfunc TestUserAuthorization_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserAuthorization{URL: &zeroValue}\n\tu.GetURL()\n\tu = &UserAuthorization{}\n\tu.GetURL()\n\tu = nil\n\tu.GetURL()\n}\n\nfunc TestUserContext_GetMessage(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserContext{Message: &zeroValue}\n\tu.GetMessage()\n\tu = &UserContext{}\n\tu.GetMessage()\n\tu = nil\n\tu.GetMessage()\n}\n\nfunc TestUserContext_GetOcticon(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserContext{Octicon: &zeroValue}\n\tu.GetOcticon()\n\tu = &UserContext{}\n\tu.GetOcticon()\n\tu = nil\n\tu.GetOcticon()\n}\n\nfunc TestUserEmail_GetEmail(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserEmail{Email: &zeroValue}\n\tu.GetEmail()\n\tu = &UserEmail{}\n\tu.GetEmail()\n\tu = nil\n\tu.GetEmail()\n}\n\nfunc TestUserEmail_GetPrimary(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tu := &UserEmail{Primary: &zeroValue}\n\tu.GetPrimary()\n\tu = &UserEmail{}\n\tu.GetPrimary()\n\tu = nil\n\tu.GetPrimary()\n}\n\nfunc TestUserEmail_GetVerified(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tu := &UserEmail{Verified: &zeroValue}\n\tu.GetVerified()\n\tu = &UserEmail{}\n\tu.GetVerified()\n\tu = nil\n\tu.GetVerified()\n}\n\nfunc TestUserEmail_GetVisibility(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserEmail{Visibility: &zeroValue}\n\tu.GetVisibility()\n\tu = &UserEmail{}\n\tu.GetVisibility()\n\tu = nil\n\tu.GetVisibility()\n}\n\nfunc TestUserEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserEvent{Action: &zeroValue}\n\tu.GetAction()\n\tu = &UserEvent{}\n\tu.GetAction()\n\tu = nil\n\tu.GetAction()\n}\n\nfunc TestUserEvent_GetEnterprise(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UserEvent{}\n\tu.GetEnterprise()\n\tu = nil\n\tu.GetEnterprise()\n}\n\nfunc TestUserEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UserEvent{}\n\tu.GetInstallation()\n\tu = nil\n\tu.GetInstallation()\n}\n\nfunc TestUserEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UserEvent{}\n\tu.GetSender()\n\tu = nil\n\tu.GetSender()\n}\n\nfunc TestUserEvent_GetUser(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UserEvent{}\n\tu.GetUser()\n\tu = nil\n\tu.GetUser()\n}\n\nfunc TestUserLDAPMapping_GetAvatarURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserLDAPMapping{AvatarURL: &zeroValue}\n\tu.GetAvatarURL()\n\tu = &UserLDAPMapping{}\n\tu.GetAvatarURL()\n\tu = nil\n\tu.GetAvatarURL()\n}\n\nfunc TestUserLDAPMapping_GetEventsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserLDAPMapping{EventsURL: &zeroValue}\n\tu.GetEventsURL()\n\tu = &UserLDAPMapping{}\n\tu.GetEventsURL()\n\tu = nil\n\tu.GetEventsURL()\n}\n\nfunc TestUserLDAPMapping_GetFollowersURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserLDAPMapping{FollowersURL: &zeroValue}\n\tu.GetFollowersURL()\n\tu = &UserLDAPMapping{}\n\tu.GetFollowersURL()\n\tu = nil\n\tu.GetFollowersURL()\n}\n\nfunc TestUserLDAPMapping_GetFollowingURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserLDAPMapping{FollowingURL: &zeroValue}\n\tu.GetFollowingURL()\n\tu = &UserLDAPMapping{}\n\tu.GetFollowingURL()\n\tu = nil\n\tu.GetFollowingURL()\n}\n\nfunc TestUserLDAPMapping_GetGistsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserLDAPMapping{GistsURL: &zeroValue}\n\tu.GetGistsURL()\n\tu = &UserLDAPMapping{}\n\tu.GetGistsURL()\n\tu = nil\n\tu.GetGistsURL()\n}\n\nfunc TestUserLDAPMapping_GetGravatarID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserLDAPMapping{GravatarID: &zeroValue}\n\tu.GetGravatarID()\n\tu = &UserLDAPMapping{}\n\tu.GetGravatarID()\n\tu = nil\n\tu.GetGravatarID()\n}\n\nfunc TestUserLDAPMapping_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tu := &UserLDAPMapping{ID: &zeroValue}\n\tu.GetID()\n\tu = &UserLDAPMapping{}\n\tu.GetID()\n\tu = nil\n\tu.GetID()\n}\n\nfunc TestUserLDAPMapping_GetLDAPDN(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserLDAPMapping{LDAPDN: &zeroValue}\n\tu.GetLDAPDN()\n\tu = &UserLDAPMapping{}\n\tu.GetLDAPDN()\n\tu = nil\n\tu.GetLDAPDN()\n}\n\nfunc TestUserLDAPMapping_GetLogin(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserLDAPMapping{Login: &zeroValue}\n\tu.GetLogin()\n\tu = &UserLDAPMapping{}\n\tu.GetLogin()\n\tu = nil\n\tu.GetLogin()\n}\n\nfunc TestUserLDAPMapping_GetOrganizationsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserLDAPMapping{OrganizationsURL: &zeroValue}\n\tu.GetOrganizationsURL()\n\tu = &UserLDAPMapping{}\n\tu.GetOrganizationsURL()\n\tu = nil\n\tu.GetOrganizationsURL()\n}\n\nfunc TestUserLDAPMapping_GetReceivedEventsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserLDAPMapping{ReceivedEventsURL: &zeroValue}\n\tu.GetReceivedEventsURL()\n\tu = &UserLDAPMapping{}\n\tu.GetReceivedEventsURL()\n\tu = nil\n\tu.GetReceivedEventsURL()\n}\n\nfunc TestUserLDAPMapping_GetReposURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserLDAPMapping{ReposURL: &zeroValue}\n\tu.GetReposURL()\n\tu = &UserLDAPMapping{}\n\tu.GetReposURL()\n\tu = nil\n\tu.GetReposURL()\n}\n\nfunc TestUserLDAPMapping_GetSiteAdmin(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tu := &UserLDAPMapping{SiteAdmin: &zeroValue}\n\tu.GetSiteAdmin()\n\tu = &UserLDAPMapping{}\n\tu.GetSiteAdmin()\n\tu = nil\n\tu.GetSiteAdmin()\n}\n\nfunc TestUserLDAPMapping_GetStarredURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserLDAPMapping{StarredURL: &zeroValue}\n\tu.GetStarredURL()\n\tu = &UserLDAPMapping{}\n\tu.GetStarredURL()\n\tu = nil\n\tu.GetStarredURL()\n}\n\nfunc TestUserLDAPMapping_GetSubscriptionsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserLDAPMapping{SubscriptionsURL: &zeroValue}\n\tu.GetSubscriptionsURL()\n\tu = &UserLDAPMapping{}\n\tu.GetSubscriptionsURL()\n\tu = nil\n\tu.GetSubscriptionsURL()\n}\n\nfunc TestUserLDAPMapping_GetType(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserLDAPMapping{Type: &zeroValue}\n\tu.GetType()\n\tu = &UserLDAPMapping{}\n\tu.GetType()\n\tu = nil\n\tu.GetType()\n}\n\nfunc TestUserLDAPMapping_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserLDAPMapping{URL: &zeroValue}\n\tu.GetURL()\n\tu = &UserLDAPMapping{}\n\tu.GetURL()\n\tu = nil\n\tu.GetURL()\n}\n\nfunc TestUserListOptions_GetPerPage(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UserListOptions{}\n\tu.GetPerPage()\n\tu = nil\n\tu.GetPerPage()\n}\n\nfunc TestUserListOptions_GetSince(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UserListOptions{}\n\tu.GetSince()\n\tu = nil\n\tu.GetSince()\n}\n\nfunc TestUserMigration_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserMigration{CreatedAt: &zeroValue}\n\tu.GetCreatedAt()\n\tu = &UserMigration{}\n\tu.GetCreatedAt()\n\tu = nil\n\tu.GetCreatedAt()\n}\n\nfunc TestUserMigration_GetExcludeAttachments(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tu := &UserMigration{ExcludeAttachments: &zeroValue}\n\tu.GetExcludeAttachments()\n\tu = &UserMigration{}\n\tu.GetExcludeAttachments()\n\tu = nil\n\tu.GetExcludeAttachments()\n}\n\nfunc TestUserMigration_GetGUID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserMigration{GUID: &zeroValue}\n\tu.GetGUID()\n\tu = &UserMigration{}\n\tu.GetGUID()\n\tu = nil\n\tu.GetGUID()\n}\n\nfunc TestUserMigration_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tu := &UserMigration{ID: &zeroValue}\n\tu.GetID()\n\tu = &UserMigration{}\n\tu.GetID()\n\tu = nil\n\tu.GetID()\n}\n\nfunc TestUserMigration_GetLockRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tu := &UserMigration{LockRepositories: &zeroValue}\n\tu.GetLockRepositories()\n\tu = &UserMigration{}\n\tu.GetLockRepositories()\n\tu = nil\n\tu.GetLockRepositories()\n}\n\nfunc TestUserMigration_GetRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Repository{}\n\tu := &UserMigration{Repositories: zeroValue}\n\tu.GetRepositories()\n\tu = &UserMigration{}\n\tu.GetRepositories()\n\tu = nil\n\tu.GetRepositories()\n}\n\nfunc TestUserMigration_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserMigration{State: &zeroValue}\n\tu.GetState()\n\tu = &UserMigration{}\n\tu.GetState()\n\tu = nil\n\tu.GetState()\n}\n\nfunc TestUserMigration_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserMigration{UpdatedAt: &zeroValue}\n\tu.GetUpdatedAt()\n\tu = &UserMigration{}\n\tu.GetUpdatedAt()\n\tu = nil\n\tu.GetUpdatedAt()\n}\n\nfunc TestUserMigration_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserMigration{URL: &zeroValue}\n\tu.GetURL()\n\tu = &UserMigration{}\n\tu.GetURL()\n\tu = nil\n\tu.GetURL()\n}\n\nfunc TestUserMigrationOptions_GetExcludeAttachments(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UserMigrationOptions{}\n\tu.GetExcludeAttachments()\n\tu = nil\n\tu.GetExcludeAttachments()\n}\n\nfunc TestUserMigrationOptions_GetLockRepositories(tt *testing.T) {\n\ttt.Parallel()\n\tu := &UserMigrationOptions{}\n\tu.GetLockRepositories()\n\tu = nil\n\tu.GetLockRepositories()\n}\n\nfunc TestUsersSearchResult_GetIncompleteResults(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tu := &UsersSearchResult{IncompleteResults: &zeroValue}\n\tu.GetIncompleteResults()\n\tu = &UsersSearchResult{}\n\tu.GetIncompleteResults()\n\tu = nil\n\tu.GetIncompleteResults()\n}\n\nfunc TestUsersSearchResult_GetTotal(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tu := &UsersSearchResult{Total: &zeroValue}\n\tu.GetTotal()\n\tu = &UsersSearchResult{}\n\tu.GetTotal()\n\tu = nil\n\tu.GetTotal()\n}\n\nfunc TestUsersSearchResult_GetUsers(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*User{}\n\tu := &UsersSearchResult{Users: zeroValue}\n\tu.GetUsers()\n\tu = &UsersSearchResult{}\n\tu.GetUsers()\n\tu = nil\n\tu.GetUsers()\n}\n\nfunc TestUserStats_GetAdminUsers(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tu := &UserStats{AdminUsers: &zeroValue}\n\tu.GetAdminUsers()\n\tu = &UserStats{}\n\tu.GetAdminUsers()\n\tu = nil\n\tu.GetAdminUsers()\n}\n\nfunc TestUserStats_GetSuspendedUsers(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tu := &UserStats{SuspendedUsers: &zeroValue}\n\tu.GetSuspendedUsers()\n\tu = &UserStats{}\n\tu.GetSuspendedUsers()\n\tu = nil\n\tu.GetSuspendedUsers()\n}\n\nfunc TestUserStats_GetTotalUsers(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tu := &UserStats{TotalUsers: &zeroValue}\n\tu.GetTotalUsers()\n\tu = &UserStats{}\n\tu.GetTotalUsers()\n\tu = nil\n\tu.GetTotalUsers()\n}\n\nfunc TestUserSuspendOptions_GetReason(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tu := &UserSuspendOptions{Reason: &zeroValue}\n\tu.GetReason()\n\tu = &UserSuspendOptions{}\n\tu.GetReason()\n\tu = nil\n\tu.GetReason()\n}\n\nfunc TestVulnerabilityPackage_GetEcosystem(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tv := &VulnerabilityPackage{Ecosystem: &zeroValue}\n\tv.GetEcosystem()\n\tv = &VulnerabilityPackage{}\n\tv.GetEcosystem()\n\tv = nil\n\tv.GetEcosystem()\n}\n\nfunc TestVulnerabilityPackage_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tv := &VulnerabilityPackage{Name: &zeroValue}\n\tv.GetName()\n\tv = &VulnerabilityPackage{}\n\tv.GetName()\n\tv = nil\n\tv.GetName()\n}\n\nfunc TestWatchEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WatchEvent{Action: &zeroValue}\n\tw.GetAction()\n\tw = &WatchEvent{}\n\tw.GetAction()\n\tw = nil\n\tw.GetAction()\n}\n\nfunc TestWatchEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WatchEvent{}\n\tw.GetInstallation()\n\tw = nil\n\tw.GetInstallation()\n}\n\nfunc TestWatchEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WatchEvent{}\n\tw.GetOrg()\n\tw = nil\n\tw.GetOrg()\n}\n\nfunc TestWatchEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WatchEvent{}\n\tw.GetRepo()\n\tw = nil\n\tw.GetRepo()\n}\n\nfunc TestWatchEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WatchEvent{}\n\tw.GetSender()\n\tw = nil\n\tw.GetSender()\n}\n\nfunc TestWeeklyCommitActivity_GetDays(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []int{}\n\tw := &WeeklyCommitActivity{Days: zeroValue}\n\tw.GetDays()\n\tw = &WeeklyCommitActivity{}\n\tw.GetDays()\n\tw = nil\n\tw.GetDays()\n}\n\nfunc TestWeeklyCommitActivity_GetTotal(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tw := &WeeklyCommitActivity{Total: &zeroValue}\n\tw.GetTotal()\n\tw = &WeeklyCommitActivity{}\n\tw.GetTotal()\n\tw = nil\n\tw.GetTotal()\n}\n\nfunc TestWeeklyCommitActivity_GetWeek(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tw := &WeeklyCommitActivity{Week: &zeroValue}\n\tw.GetWeek()\n\tw = &WeeklyCommitActivity{}\n\tw.GetWeek()\n\tw = nil\n\tw.GetWeek()\n}\n\nfunc TestWeeklyStats_GetAdditions(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tw := &WeeklyStats{Additions: &zeroValue}\n\tw.GetAdditions()\n\tw = &WeeklyStats{}\n\tw.GetAdditions()\n\tw = nil\n\tw.GetAdditions()\n}\n\nfunc TestWeeklyStats_GetCommits(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tw := &WeeklyStats{Commits: &zeroValue}\n\tw.GetCommits()\n\tw = &WeeklyStats{}\n\tw.GetCommits()\n\tw = nil\n\tw.GetCommits()\n}\n\nfunc TestWeeklyStats_GetDeletions(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tw := &WeeklyStats{Deletions: &zeroValue}\n\tw.GetDeletions()\n\tw = &WeeklyStats{}\n\tw.GetDeletions()\n\tw = nil\n\tw.GetDeletions()\n}\n\nfunc TestWeeklyStats_GetWeek(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tw := &WeeklyStats{Week: &zeroValue}\n\tw.GetWeek()\n\tw = &WeeklyStats{}\n\tw.GetWeek()\n\tw = nil\n\tw.GetWeek()\n}\n\nfunc TestWorkflow_GetBadgeURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &Workflow{BadgeURL: &zeroValue}\n\tw.GetBadgeURL()\n\tw = &Workflow{}\n\tw.GetBadgeURL()\n\tw = nil\n\tw.GetBadgeURL()\n}\n\nfunc TestWorkflow_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tw := &Workflow{CreatedAt: &zeroValue}\n\tw.GetCreatedAt()\n\tw = &Workflow{}\n\tw.GetCreatedAt()\n\tw = nil\n\tw.GetCreatedAt()\n}\n\nfunc TestWorkflow_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &Workflow{HTMLURL: &zeroValue}\n\tw.GetHTMLURL()\n\tw = &Workflow{}\n\tw.GetHTMLURL()\n\tw = nil\n\tw.GetHTMLURL()\n}\n\nfunc TestWorkflow_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tw := &Workflow{ID: &zeroValue}\n\tw.GetID()\n\tw = &Workflow{}\n\tw.GetID()\n\tw = nil\n\tw.GetID()\n}\n\nfunc TestWorkflow_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &Workflow{Name: &zeroValue}\n\tw.GetName()\n\tw = &Workflow{}\n\tw.GetName()\n\tw = nil\n\tw.GetName()\n}\n\nfunc TestWorkflow_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &Workflow{NodeID: &zeroValue}\n\tw.GetNodeID()\n\tw = &Workflow{}\n\tw.GetNodeID()\n\tw = nil\n\tw.GetNodeID()\n}\n\nfunc TestWorkflow_GetPath(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &Workflow{Path: &zeroValue}\n\tw.GetPath()\n\tw = &Workflow{}\n\tw.GetPath()\n\tw = nil\n\tw.GetPath()\n}\n\nfunc TestWorkflow_GetState(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &Workflow{State: &zeroValue}\n\tw.GetState()\n\tw = &Workflow{}\n\tw.GetState()\n\tw = nil\n\tw.GetState()\n}\n\nfunc TestWorkflow_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tw := &Workflow{UpdatedAt: &zeroValue}\n\tw.GetUpdatedAt()\n\tw = &Workflow{}\n\tw.GetUpdatedAt()\n\tw = nil\n\tw.GetUpdatedAt()\n}\n\nfunc TestWorkflow_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &Workflow{URL: &zeroValue}\n\tw.GetURL()\n\tw = &Workflow{}\n\tw.GetURL()\n\tw = nil\n\tw.GetURL()\n}\n\nfunc TestWorkflowBill_GetTotalMS(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tw := &WorkflowBill{TotalMS: &zeroValue}\n\tw.GetTotalMS()\n\tw = &WorkflowBill{}\n\tw.GetTotalMS()\n\tw = nil\n\tw.GetTotalMS()\n}\n\nfunc TestWorkflowDispatchEvent_GetInputs(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WorkflowDispatchEvent{}\n\tw.GetInputs()\n\tw = nil\n\tw.GetInputs()\n}\n\nfunc TestWorkflowDispatchEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WorkflowDispatchEvent{}\n\tw.GetInstallation()\n\tw = nil\n\tw.GetInstallation()\n}\n\nfunc TestWorkflowDispatchEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WorkflowDispatchEvent{}\n\tw.GetOrg()\n\tw = nil\n\tw.GetOrg()\n}\n\nfunc TestWorkflowDispatchEvent_GetRef(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowDispatchEvent{Ref: &zeroValue}\n\tw.GetRef()\n\tw = &WorkflowDispatchEvent{}\n\tw.GetRef()\n\tw = nil\n\tw.GetRef()\n}\n\nfunc TestWorkflowDispatchEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WorkflowDispatchEvent{}\n\tw.GetRepo()\n\tw = nil\n\tw.GetRepo()\n}\n\nfunc TestWorkflowDispatchEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WorkflowDispatchEvent{}\n\tw.GetSender()\n\tw = nil\n\tw.GetSender()\n}\n\nfunc TestWorkflowDispatchEvent_GetWorkflow(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowDispatchEvent{Workflow: &zeroValue}\n\tw.GetWorkflow()\n\tw = &WorkflowDispatchEvent{}\n\tw.GetWorkflow()\n\tw = nil\n\tw.GetWorkflow()\n}\n\nfunc TestWorkflowDispatchRunDetails_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowDispatchRunDetails{HTMLURL: &zeroValue}\n\tw.GetHTMLURL()\n\tw = &WorkflowDispatchRunDetails{}\n\tw.GetHTMLURL()\n\tw = nil\n\tw.GetHTMLURL()\n}\n\nfunc TestWorkflowDispatchRunDetails_GetRunURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowDispatchRunDetails{RunURL: &zeroValue}\n\tw.GetRunURL()\n\tw = &WorkflowDispatchRunDetails{}\n\tw.GetRunURL()\n\tw = nil\n\tw.GetRunURL()\n}\n\nfunc TestWorkflowDispatchRunDetails_GetWorkflowRunID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tw := &WorkflowDispatchRunDetails{WorkflowRunID: &zeroValue}\n\tw.GetWorkflowRunID()\n\tw = &WorkflowDispatchRunDetails{}\n\tw.GetWorkflowRunID()\n\tw = nil\n\tw.GetWorkflowRunID()\n}\n\nfunc TestWorkflowJob_GetCheckRunURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowJob{CheckRunURL: &zeroValue}\n\tw.GetCheckRunURL()\n\tw = &WorkflowJob{}\n\tw.GetCheckRunURL()\n\tw = nil\n\tw.GetCheckRunURL()\n}\n\nfunc TestWorkflowJob_GetCompletedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tw := &WorkflowJob{CompletedAt: &zeroValue}\n\tw.GetCompletedAt()\n\tw = &WorkflowJob{}\n\tw.GetCompletedAt()\n\tw = nil\n\tw.GetCompletedAt()\n}\n\nfunc TestWorkflowJob_GetConclusion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowJob{Conclusion: &zeroValue}\n\tw.GetConclusion()\n\tw = &WorkflowJob{}\n\tw.GetConclusion()\n\tw = nil\n\tw.GetConclusion()\n}\n\nfunc TestWorkflowJob_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tw := &WorkflowJob{CreatedAt: &zeroValue}\n\tw.GetCreatedAt()\n\tw = &WorkflowJob{}\n\tw.GetCreatedAt()\n\tw = nil\n\tw.GetCreatedAt()\n}\n\nfunc TestWorkflowJob_GetHeadBranch(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowJob{HeadBranch: &zeroValue}\n\tw.GetHeadBranch()\n\tw = &WorkflowJob{}\n\tw.GetHeadBranch()\n\tw = nil\n\tw.GetHeadBranch()\n}\n\nfunc TestWorkflowJob_GetHeadSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowJob{HeadSHA: &zeroValue}\n\tw.GetHeadSHA()\n\tw = &WorkflowJob{}\n\tw.GetHeadSHA()\n\tw = nil\n\tw.GetHeadSHA()\n}\n\nfunc TestWorkflowJob_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowJob{HTMLURL: &zeroValue}\n\tw.GetHTMLURL()\n\tw = &WorkflowJob{}\n\tw.GetHTMLURL()\n\tw = nil\n\tw.GetHTMLURL()\n}\n\nfunc TestWorkflowJob_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tw := &WorkflowJob{ID: &zeroValue}\n\tw.GetID()\n\tw = &WorkflowJob{}\n\tw.GetID()\n\tw = nil\n\tw.GetID()\n}\n\nfunc TestWorkflowJob_GetLabels(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []string{}\n\tw := &WorkflowJob{Labels: zeroValue}\n\tw.GetLabels()\n\tw = &WorkflowJob{}\n\tw.GetLabels()\n\tw = nil\n\tw.GetLabels()\n}\n\nfunc TestWorkflowJob_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowJob{Name: &zeroValue}\n\tw.GetName()\n\tw = &WorkflowJob{}\n\tw.GetName()\n\tw = nil\n\tw.GetName()\n}\n\nfunc TestWorkflowJob_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowJob{NodeID: &zeroValue}\n\tw.GetNodeID()\n\tw = &WorkflowJob{}\n\tw.GetNodeID()\n\tw = nil\n\tw.GetNodeID()\n}\n\nfunc TestWorkflowJob_GetRunAttempt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tw := &WorkflowJob{RunAttempt: &zeroValue}\n\tw.GetRunAttempt()\n\tw = &WorkflowJob{}\n\tw.GetRunAttempt()\n\tw = nil\n\tw.GetRunAttempt()\n}\n\nfunc TestWorkflowJob_GetRunID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tw := &WorkflowJob{RunID: &zeroValue}\n\tw.GetRunID()\n\tw = &WorkflowJob{}\n\tw.GetRunID()\n\tw = nil\n\tw.GetRunID()\n}\n\nfunc TestWorkflowJob_GetRunnerGroupID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tw := &WorkflowJob{RunnerGroupID: &zeroValue}\n\tw.GetRunnerGroupID()\n\tw = &WorkflowJob{}\n\tw.GetRunnerGroupID()\n\tw = nil\n\tw.GetRunnerGroupID()\n}\n\nfunc TestWorkflowJob_GetRunnerGroupName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowJob{RunnerGroupName: &zeroValue}\n\tw.GetRunnerGroupName()\n\tw = &WorkflowJob{}\n\tw.GetRunnerGroupName()\n\tw = nil\n\tw.GetRunnerGroupName()\n}\n\nfunc TestWorkflowJob_GetRunnerID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tw := &WorkflowJob{RunnerID: &zeroValue}\n\tw.GetRunnerID()\n\tw = &WorkflowJob{}\n\tw.GetRunnerID()\n\tw = nil\n\tw.GetRunnerID()\n}\n\nfunc TestWorkflowJob_GetRunnerName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowJob{RunnerName: &zeroValue}\n\tw.GetRunnerName()\n\tw = &WorkflowJob{}\n\tw.GetRunnerName()\n\tw = nil\n\tw.GetRunnerName()\n}\n\nfunc TestWorkflowJob_GetRunURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowJob{RunURL: &zeroValue}\n\tw.GetRunURL()\n\tw = &WorkflowJob{}\n\tw.GetRunURL()\n\tw = nil\n\tw.GetRunURL()\n}\n\nfunc TestWorkflowJob_GetStartedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tw := &WorkflowJob{StartedAt: &zeroValue}\n\tw.GetStartedAt()\n\tw = &WorkflowJob{}\n\tw.GetStartedAt()\n\tw = nil\n\tw.GetStartedAt()\n}\n\nfunc TestWorkflowJob_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowJob{Status: &zeroValue}\n\tw.GetStatus()\n\tw = &WorkflowJob{}\n\tw.GetStatus()\n\tw = nil\n\tw.GetStatus()\n}\n\nfunc TestWorkflowJob_GetSteps(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*TaskStep{}\n\tw := &WorkflowJob{Steps: zeroValue}\n\tw.GetSteps()\n\tw = &WorkflowJob{}\n\tw.GetSteps()\n\tw = nil\n\tw.GetSteps()\n}\n\nfunc TestWorkflowJob_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowJob{URL: &zeroValue}\n\tw.GetURL()\n\tw = &WorkflowJob{}\n\tw.GetURL()\n\tw = nil\n\tw.GetURL()\n}\n\nfunc TestWorkflowJob_GetWorkflowName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowJob{WorkflowName: &zeroValue}\n\tw.GetWorkflowName()\n\tw = &WorkflowJob{}\n\tw.GetWorkflowName()\n\tw = nil\n\tw.GetWorkflowName()\n}\n\nfunc TestWorkflowJobEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowJobEvent{Action: &zeroValue}\n\tw.GetAction()\n\tw = &WorkflowJobEvent{}\n\tw.GetAction()\n\tw = nil\n\tw.GetAction()\n}\n\nfunc TestWorkflowJobEvent_GetDeployment(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WorkflowJobEvent{}\n\tw.GetDeployment()\n\tw = nil\n\tw.GetDeployment()\n}\n\nfunc TestWorkflowJobEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WorkflowJobEvent{}\n\tw.GetInstallation()\n\tw = nil\n\tw.GetInstallation()\n}\n\nfunc TestWorkflowJobEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WorkflowJobEvent{}\n\tw.GetOrg()\n\tw = nil\n\tw.GetOrg()\n}\n\nfunc TestWorkflowJobEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WorkflowJobEvent{}\n\tw.GetRepo()\n\tw = nil\n\tw.GetRepo()\n}\n\nfunc TestWorkflowJobEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WorkflowJobEvent{}\n\tw.GetSender()\n\tw = nil\n\tw.GetSender()\n}\n\nfunc TestWorkflowJobEvent_GetWorkflowJob(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WorkflowJobEvent{}\n\tw.GetWorkflowJob()\n\tw = nil\n\tw.GetWorkflowJob()\n}\n\nfunc TestWorkflowJobRun_GetConclusion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowJobRun{Conclusion: &zeroValue}\n\tw.GetConclusion()\n\tw = &WorkflowJobRun{}\n\tw.GetConclusion()\n\tw = nil\n\tw.GetConclusion()\n}\n\nfunc TestWorkflowJobRun_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tw := &WorkflowJobRun{CreatedAt: &zeroValue}\n\tw.GetCreatedAt()\n\tw = &WorkflowJobRun{}\n\tw.GetCreatedAt()\n\tw = nil\n\tw.GetCreatedAt()\n}\n\nfunc TestWorkflowJobRun_GetEnvironment(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowJobRun{Environment: &zeroValue}\n\tw.GetEnvironment()\n\tw = &WorkflowJobRun{}\n\tw.GetEnvironment()\n\tw = nil\n\tw.GetEnvironment()\n}\n\nfunc TestWorkflowJobRun_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowJobRun{HTMLURL: &zeroValue}\n\tw.GetHTMLURL()\n\tw = &WorkflowJobRun{}\n\tw.GetHTMLURL()\n\tw = nil\n\tw.GetHTMLURL()\n}\n\nfunc TestWorkflowJobRun_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tw := &WorkflowJobRun{ID: &zeroValue}\n\tw.GetID()\n\tw = &WorkflowJobRun{}\n\tw.GetID()\n\tw = nil\n\tw.GetID()\n}\n\nfunc TestWorkflowJobRun_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowJobRun{Name: &zeroValue}\n\tw.GetName()\n\tw = &WorkflowJobRun{}\n\tw.GetName()\n\tw = nil\n\tw.GetName()\n}\n\nfunc TestWorkflowJobRun_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowJobRun{Status: &zeroValue}\n\tw.GetStatus()\n\tw = &WorkflowJobRun{}\n\tw.GetStatus()\n\tw = nil\n\tw.GetStatus()\n}\n\nfunc TestWorkflowJobRun_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tw := &WorkflowJobRun{UpdatedAt: &zeroValue}\n\tw.GetUpdatedAt()\n\tw = &WorkflowJobRun{}\n\tw.GetUpdatedAt()\n\tw = nil\n\tw.GetUpdatedAt()\n}\n\nfunc TestWorkflowRun_GetActor(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WorkflowRun{}\n\tw.GetActor()\n\tw = nil\n\tw.GetActor()\n}\n\nfunc TestWorkflowRun_GetArtifactsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowRun{ArtifactsURL: &zeroValue}\n\tw.GetArtifactsURL()\n\tw = &WorkflowRun{}\n\tw.GetArtifactsURL()\n\tw = nil\n\tw.GetArtifactsURL()\n}\n\nfunc TestWorkflowRun_GetCancelURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowRun{CancelURL: &zeroValue}\n\tw.GetCancelURL()\n\tw = &WorkflowRun{}\n\tw.GetCancelURL()\n\tw = nil\n\tw.GetCancelURL()\n}\n\nfunc TestWorkflowRun_GetCheckSuiteID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tw := &WorkflowRun{CheckSuiteID: &zeroValue}\n\tw.GetCheckSuiteID()\n\tw = &WorkflowRun{}\n\tw.GetCheckSuiteID()\n\tw = nil\n\tw.GetCheckSuiteID()\n}\n\nfunc TestWorkflowRun_GetCheckSuiteNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowRun{CheckSuiteNodeID: &zeroValue}\n\tw.GetCheckSuiteNodeID()\n\tw = &WorkflowRun{}\n\tw.GetCheckSuiteNodeID()\n\tw = nil\n\tw.GetCheckSuiteNodeID()\n}\n\nfunc TestWorkflowRun_GetCheckSuiteURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowRun{CheckSuiteURL: &zeroValue}\n\tw.GetCheckSuiteURL()\n\tw = &WorkflowRun{}\n\tw.GetCheckSuiteURL()\n\tw = nil\n\tw.GetCheckSuiteURL()\n}\n\nfunc TestWorkflowRun_GetConclusion(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowRun{Conclusion: &zeroValue}\n\tw.GetConclusion()\n\tw = &WorkflowRun{}\n\tw.GetConclusion()\n\tw = nil\n\tw.GetConclusion()\n}\n\nfunc TestWorkflowRun_GetCreatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tw := &WorkflowRun{CreatedAt: &zeroValue}\n\tw.GetCreatedAt()\n\tw = &WorkflowRun{}\n\tw.GetCreatedAt()\n\tw = nil\n\tw.GetCreatedAt()\n}\n\nfunc TestWorkflowRun_GetDisplayTitle(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowRun{DisplayTitle: &zeroValue}\n\tw.GetDisplayTitle()\n\tw = &WorkflowRun{}\n\tw.GetDisplayTitle()\n\tw = nil\n\tw.GetDisplayTitle()\n}\n\nfunc TestWorkflowRun_GetEvent(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowRun{Event: &zeroValue}\n\tw.GetEvent()\n\tw = &WorkflowRun{}\n\tw.GetEvent()\n\tw = nil\n\tw.GetEvent()\n}\n\nfunc TestWorkflowRun_GetHeadBranch(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowRun{HeadBranch: &zeroValue}\n\tw.GetHeadBranch()\n\tw = &WorkflowRun{}\n\tw.GetHeadBranch()\n\tw = nil\n\tw.GetHeadBranch()\n}\n\nfunc TestWorkflowRun_GetHeadCommit(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WorkflowRun{}\n\tw.GetHeadCommit()\n\tw = nil\n\tw.GetHeadCommit()\n}\n\nfunc TestWorkflowRun_GetHeadRepository(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WorkflowRun{}\n\tw.GetHeadRepository()\n\tw = nil\n\tw.GetHeadRepository()\n}\n\nfunc TestWorkflowRun_GetHeadSHA(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowRun{HeadSHA: &zeroValue}\n\tw.GetHeadSHA()\n\tw = &WorkflowRun{}\n\tw.GetHeadSHA()\n\tw = nil\n\tw.GetHeadSHA()\n}\n\nfunc TestWorkflowRun_GetHTMLURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowRun{HTMLURL: &zeroValue}\n\tw.GetHTMLURL()\n\tw = &WorkflowRun{}\n\tw.GetHTMLURL()\n\tw = nil\n\tw.GetHTMLURL()\n}\n\nfunc TestWorkflowRun_GetID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tw := &WorkflowRun{ID: &zeroValue}\n\tw.GetID()\n\tw = &WorkflowRun{}\n\tw.GetID()\n\tw = nil\n\tw.GetID()\n}\n\nfunc TestWorkflowRun_GetJobsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowRun{JobsURL: &zeroValue}\n\tw.GetJobsURL()\n\tw = &WorkflowRun{}\n\tw.GetJobsURL()\n\tw = nil\n\tw.GetJobsURL()\n}\n\nfunc TestWorkflowRun_GetLogsURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowRun{LogsURL: &zeroValue}\n\tw.GetLogsURL()\n\tw = &WorkflowRun{}\n\tw.GetLogsURL()\n\tw = nil\n\tw.GetLogsURL()\n}\n\nfunc TestWorkflowRun_GetName(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowRun{Name: &zeroValue}\n\tw.GetName()\n\tw = &WorkflowRun{}\n\tw.GetName()\n\tw = nil\n\tw.GetName()\n}\n\nfunc TestWorkflowRun_GetNodeID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowRun{NodeID: &zeroValue}\n\tw.GetNodeID()\n\tw = &WorkflowRun{}\n\tw.GetNodeID()\n\tw = nil\n\tw.GetNodeID()\n}\n\nfunc TestWorkflowRun_GetPath(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowRun{Path: &zeroValue}\n\tw.GetPath()\n\tw = &WorkflowRun{}\n\tw.GetPath()\n\tw = nil\n\tw.GetPath()\n}\n\nfunc TestWorkflowRun_GetPreviousAttemptURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowRun{PreviousAttemptURL: &zeroValue}\n\tw.GetPreviousAttemptURL()\n\tw = &WorkflowRun{}\n\tw.GetPreviousAttemptURL()\n\tw = nil\n\tw.GetPreviousAttemptURL()\n}\n\nfunc TestWorkflowRun_GetPullRequests(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*PullRequest{}\n\tw := &WorkflowRun{PullRequests: zeroValue}\n\tw.GetPullRequests()\n\tw = &WorkflowRun{}\n\tw.GetPullRequests()\n\tw = nil\n\tw.GetPullRequests()\n}\n\nfunc TestWorkflowRun_GetReferencedWorkflows(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*ReferencedWorkflow{}\n\tw := &WorkflowRun{ReferencedWorkflows: zeroValue}\n\tw.GetReferencedWorkflows()\n\tw = &WorkflowRun{}\n\tw.GetReferencedWorkflows()\n\tw = nil\n\tw.GetReferencedWorkflows()\n}\n\nfunc TestWorkflowRun_GetRepository(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WorkflowRun{}\n\tw.GetRepository()\n\tw = nil\n\tw.GetRepository()\n}\n\nfunc TestWorkflowRun_GetRerunURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowRun{RerunURL: &zeroValue}\n\tw.GetRerunURL()\n\tw = &WorkflowRun{}\n\tw.GetRerunURL()\n\tw = nil\n\tw.GetRerunURL()\n}\n\nfunc TestWorkflowRun_GetRunAttempt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tw := &WorkflowRun{RunAttempt: &zeroValue}\n\tw.GetRunAttempt()\n\tw = &WorkflowRun{}\n\tw.GetRunAttempt()\n\tw = nil\n\tw.GetRunAttempt()\n}\n\nfunc TestWorkflowRun_GetRunNumber(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tw := &WorkflowRun{RunNumber: &zeroValue}\n\tw.GetRunNumber()\n\tw = &WorkflowRun{}\n\tw.GetRunNumber()\n\tw = nil\n\tw.GetRunNumber()\n}\n\nfunc TestWorkflowRun_GetRunStartedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tw := &WorkflowRun{RunStartedAt: &zeroValue}\n\tw.GetRunStartedAt()\n\tw = &WorkflowRun{}\n\tw.GetRunStartedAt()\n\tw = nil\n\tw.GetRunStartedAt()\n}\n\nfunc TestWorkflowRun_GetStatus(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowRun{Status: &zeroValue}\n\tw.GetStatus()\n\tw = &WorkflowRun{}\n\tw.GetStatus()\n\tw = nil\n\tw.GetStatus()\n}\n\nfunc TestWorkflowRun_GetTriggeringActor(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WorkflowRun{}\n\tw.GetTriggeringActor()\n\tw = nil\n\tw.GetTriggeringActor()\n}\n\nfunc TestWorkflowRun_GetUpdatedAt(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue Timestamp\n\tw := &WorkflowRun{UpdatedAt: &zeroValue}\n\tw.GetUpdatedAt()\n\tw = &WorkflowRun{}\n\tw.GetUpdatedAt()\n\tw = nil\n\tw.GetUpdatedAt()\n}\n\nfunc TestWorkflowRun_GetURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowRun{URL: &zeroValue}\n\tw.GetURL()\n\tw = &WorkflowRun{}\n\tw.GetURL()\n\tw = nil\n\tw.GetURL()\n}\n\nfunc TestWorkflowRun_GetWorkflowID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tw := &WorkflowRun{WorkflowID: &zeroValue}\n\tw.GetWorkflowID()\n\tw = &WorkflowRun{}\n\tw.GetWorkflowID()\n\tw = nil\n\tw.GetWorkflowID()\n}\n\nfunc TestWorkflowRun_GetWorkflowURL(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowRun{WorkflowURL: &zeroValue}\n\tw.GetWorkflowURL()\n\tw = &WorkflowRun{}\n\tw.GetWorkflowURL()\n\tw = nil\n\tw.GetWorkflowURL()\n}\n\nfunc TestWorkflowRunAttemptOptions_GetExcludePullRequests(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tw := &WorkflowRunAttemptOptions{ExcludePullRequests: &zeroValue}\n\tw.GetExcludePullRequests()\n\tw = &WorkflowRunAttemptOptions{}\n\tw.GetExcludePullRequests()\n\tw = nil\n\tw.GetExcludePullRequests()\n}\n\nfunc TestWorkflowRunBill_GetJobRuns(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*WorkflowRunJobRun{}\n\tw := &WorkflowRunBill{JobRuns: zeroValue}\n\tw.GetJobRuns()\n\tw = &WorkflowRunBill{}\n\tw.GetJobRuns()\n\tw = nil\n\tw.GetJobRuns()\n}\n\nfunc TestWorkflowRunBill_GetJobs(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tw := &WorkflowRunBill{Jobs: &zeroValue}\n\tw.GetJobs()\n\tw = &WorkflowRunBill{}\n\tw.GetJobs()\n\tw = nil\n\tw.GetJobs()\n}\n\nfunc TestWorkflowRunBill_GetTotalMS(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tw := &WorkflowRunBill{TotalMS: &zeroValue}\n\tw.GetTotalMS()\n\tw = &WorkflowRunBill{}\n\tw.GetTotalMS()\n\tw = nil\n\tw.GetTotalMS()\n}\n\nfunc TestWorkflowRunEvent_GetAction(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue string\n\tw := &WorkflowRunEvent{Action: &zeroValue}\n\tw.GetAction()\n\tw = &WorkflowRunEvent{}\n\tw.GetAction()\n\tw = nil\n\tw.GetAction()\n}\n\nfunc TestWorkflowRunEvent_GetInstallation(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WorkflowRunEvent{}\n\tw.GetInstallation()\n\tw = nil\n\tw.GetInstallation()\n}\n\nfunc TestWorkflowRunEvent_GetOrg(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WorkflowRunEvent{}\n\tw.GetOrg()\n\tw = nil\n\tw.GetOrg()\n}\n\nfunc TestWorkflowRunEvent_GetRepo(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WorkflowRunEvent{}\n\tw.GetRepo()\n\tw = nil\n\tw.GetRepo()\n}\n\nfunc TestWorkflowRunEvent_GetSender(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WorkflowRunEvent{}\n\tw.GetSender()\n\tw = nil\n\tw.GetSender()\n}\n\nfunc TestWorkflowRunEvent_GetWorkflow(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WorkflowRunEvent{}\n\tw.GetWorkflow()\n\tw = nil\n\tw.GetWorkflow()\n}\n\nfunc TestWorkflowRunEvent_GetWorkflowRun(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WorkflowRunEvent{}\n\tw.GetWorkflowRun()\n\tw = nil\n\tw.GetWorkflowRun()\n}\n\nfunc TestWorkflowRunJobRun_GetDurationMS(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tw := &WorkflowRunJobRun{DurationMS: &zeroValue}\n\tw.GetDurationMS()\n\tw = &WorkflowRunJobRun{}\n\tw.GetDurationMS()\n\tw = nil\n\tw.GetDurationMS()\n}\n\nfunc TestWorkflowRunJobRun_GetJobID(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tw := &WorkflowRunJobRun{JobID: &zeroValue}\n\tw.GetJobID()\n\tw = &WorkflowRunJobRun{}\n\tw.GetJobID()\n\tw = nil\n\tw.GetJobID()\n}\n\nfunc TestWorkflowRuns_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tw := &WorkflowRuns{TotalCount: &zeroValue}\n\tw.GetTotalCount()\n\tw = &WorkflowRuns{}\n\tw.GetTotalCount()\n\tw = nil\n\tw.GetTotalCount()\n}\n\nfunc TestWorkflowRuns_GetWorkflowRuns(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*WorkflowRun{}\n\tw := &WorkflowRuns{WorkflowRuns: zeroValue}\n\tw.GetWorkflowRuns()\n\tw = &WorkflowRuns{}\n\tw.GetWorkflowRuns()\n\tw = nil\n\tw.GetWorkflowRuns()\n}\n\nfunc TestWorkflowRunUsage_GetBillable(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WorkflowRunUsage{}\n\tw.GetBillable()\n\tw = nil\n\tw.GetBillable()\n}\n\nfunc TestWorkflowRunUsage_GetRunDurationMS(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int64\n\tw := &WorkflowRunUsage{RunDurationMS: &zeroValue}\n\tw.GetRunDurationMS()\n\tw = &WorkflowRunUsage{}\n\tw.GetRunDurationMS()\n\tw = nil\n\tw.GetRunDurationMS()\n}\n\nfunc TestWorkflows_GetTotalCount(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue int\n\tw := &Workflows{TotalCount: &zeroValue}\n\tw.GetTotalCount()\n\tw = &Workflows{}\n\tw.GetTotalCount()\n\tw = nil\n\tw.GetTotalCount()\n}\n\nfunc TestWorkflows_GetWorkflows(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*Workflow{}\n\tw := &Workflows{Workflows: zeroValue}\n\tw.GetWorkflows()\n\tw = &Workflows{}\n\tw.GetWorkflows()\n\tw = nil\n\tw.GetWorkflows()\n}\n\nfunc TestWorkflowsBranchRule_GetParameters(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WorkflowsBranchRule{}\n\tw.GetParameters()\n\tw = nil\n\tw.GetParameters()\n}\n\nfunc TestWorkflowsPermissions_GetRequireApprovalForForkPRWorkflows(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tw := &WorkflowsPermissions{RequireApprovalForForkPRWorkflows: &zeroValue}\n\tw.GetRequireApprovalForForkPRWorkflows()\n\tw = &WorkflowsPermissions{}\n\tw.GetRequireApprovalForForkPRWorkflows()\n\tw = nil\n\tw.GetRequireApprovalForForkPRWorkflows()\n}\n\nfunc TestWorkflowsPermissions_GetRunWorkflowsFromForkPullRequests(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tw := &WorkflowsPermissions{RunWorkflowsFromForkPullRequests: &zeroValue}\n\tw.GetRunWorkflowsFromForkPullRequests()\n\tw = &WorkflowsPermissions{}\n\tw.GetRunWorkflowsFromForkPullRequests()\n\tw = nil\n\tw.GetRunWorkflowsFromForkPullRequests()\n}\n\nfunc TestWorkflowsPermissions_GetSendSecretsAndVariables(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tw := &WorkflowsPermissions{SendSecretsAndVariables: &zeroValue}\n\tw.GetSendSecretsAndVariables()\n\tw = &WorkflowsPermissions{}\n\tw.GetSendSecretsAndVariables()\n\tw = nil\n\tw.GetSendSecretsAndVariables()\n}\n\nfunc TestWorkflowsPermissions_GetSendWriteTokensToWorkflows(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tw := &WorkflowsPermissions{SendWriteTokensToWorkflows: &zeroValue}\n\tw.GetSendWriteTokensToWorkflows()\n\tw = &WorkflowsPermissions{}\n\tw.GetSendWriteTokensToWorkflows()\n\tw = nil\n\tw.GetSendWriteTokensToWorkflows()\n}\n\nfunc TestWorkflowsPermissionsOpt_GetRequireApprovalForForkPRWorkflows(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tw := &WorkflowsPermissionsOpt{RequireApprovalForForkPRWorkflows: &zeroValue}\n\tw.GetRequireApprovalForForkPRWorkflows()\n\tw = &WorkflowsPermissionsOpt{}\n\tw.GetRequireApprovalForForkPRWorkflows()\n\tw = nil\n\tw.GetRequireApprovalForForkPRWorkflows()\n}\n\nfunc TestWorkflowsPermissionsOpt_GetRunWorkflowsFromForkPullRequests(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WorkflowsPermissionsOpt{}\n\tw.GetRunWorkflowsFromForkPullRequests()\n\tw = nil\n\tw.GetRunWorkflowsFromForkPullRequests()\n}\n\nfunc TestWorkflowsPermissionsOpt_GetSendSecretsAndVariables(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tw := &WorkflowsPermissionsOpt{SendSecretsAndVariables: &zeroValue}\n\tw.GetSendSecretsAndVariables()\n\tw = &WorkflowsPermissionsOpt{}\n\tw.GetSendSecretsAndVariables()\n\tw = nil\n\tw.GetSendSecretsAndVariables()\n}\n\nfunc TestWorkflowsPermissionsOpt_GetSendWriteTokensToWorkflows(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tw := &WorkflowsPermissionsOpt{SendWriteTokensToWorkflows: &zeroValue}\n\tw.GetSendWriteTokensToWorkflows()\n\tw = &WorkflowsPermissionsOpt{}\n\tw.GetSendWriteTokensToWorkflows()\n\tw = nil\n\tw.GetSendWriteTokensToWorkflows()\n}\n\nfunc TestWorkflowsRuleParameters_GetDoNotEnforceOnCreate(tt *testing.T) {\n\ttt.Parallel()\n\tvar zeroValue bool\n\tw := &WorkflowsRuleParameters{DoNotEnforceOnCreate: &zeroValue}\n\tw.GetDoNotEnforceOnCreate()\n\tw = &WorkflowsRuleParameters{}\n\tw.GetDoNotEnforceOnCreate()\n\tw = nil\n\tw.GetDoNotEnforceOnCreate()\n}\n\nfunc TestWorkflowsRuleParameters_GetWorkflows(tt *testing.T) {\n\ttt.Parallel()\n\tzeroValue := []*RuleWorkflow{}\n\tw := &WorkflowsRuleParameters{Workflows: zeroValue}\n\tw.GetWorkflows()\n\tw = &WorkflowsRuleParameters{}\n\tw.GetWorkflows()\n\tw = nil\n\tw.GetWorkflows()\n}\n\nfunc TestWorkflowUsage_GetBillable(tt *testing.T) {\n\ttt.Parallel()\n\tw := &WorkflowUsage{}\n\tw.GetBillable()\n\tw = nil\n\tw.GetBillable()\n}\n"
  },
  {
    "path": "github/github-iterators.go",
    "content": "// Code generated by gen-iterators; DO NOT EDIT.\n// Instead, please run \"go generate ./...\" as described here:\n// https://github.com/google/go-github/blob/master/CONTRIBUTING.md#submitting-a-patch\n\n// Copyright 2026 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"iter\"\n)\n\n// ListArtifactsIter returns an iterator that paginates through all results of ListArtifacts.\nfunc (s *ActionsService) ListArtifactsIter(ctx context.Context, owner string, repo string, opts *ListArtifactsOptions) iter.Seq2[*Artifact, error] {\n\treturn func(yield func(*Artifact, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListArtifactsOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListArtifacts(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Artifact\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Artifacts\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListCacheUsageByRepoForOrgIter returns an iterator that paginates through all results of ListCacheUsageByRepoForOrg.\nfunc (s *ActionsService) ListCacheUsageByRepoForOrgIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*ActionsCacheUsage, error] {\n\treturn func(yield func(*ActionsCacheUsage, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListCacheUsageByRepoForOrg(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*ActionsCacheUsage\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.RepoCacheUsage\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListCachesIter returns an iterator that paginates through all results of ListCaches.\nfunc (s *ActionsService) ListCachesIter(ctx context.Context, owner string, repo string, opts *ActionsCacheListOptions) iter.Seq2[*ActionsCache, error] {\n\treturn func(yield func(*ActionsCache, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ActionsCacheListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListCaches(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*ActionsCache\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.ActionsCaches\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListEnabledOrgsInEnterpriseIter returns an iterator that paginates through all results of ListEnabledOrgsInEnterprise.\nfunc (s *ActionsService) ListEnabledOrgsInEnterpriseIter(ctx context.Context, owner string, opts *ListOptions) iter.Seq2[*Organization, error] {\n\treturn func(yield func(*Organization, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListEnabledOrgsInEnterprise(ctx, owner, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Organization\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Organizations\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListEnabledReposInOrgIter returns an iterator that paginates through all results of ListEnabledReposInOrg.\nfunc (s *ActionsService) ListEnabledReposInOrgIter(ctx context.Context, owner string, opts *ListOptions) iter.Seq2[*Repository, error] {\n\treturn func(yield func(*Repository, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListEnabledReposInOrg(ctx, owner, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Repository\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Repositories\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListEnvSecretsIter returns an iterator that paginates through all results of ListEnvSecrets.\nfunc (s *ActionsService) ListEnvSecretsIter(ctx context.Context, repoID int, env string, opts *ListOptions) iter.Seq2[*Secret, error] {\n\treturn func(yield func(*Secret, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListEnvSecrets(ctx, repoID, env, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Secret\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Secrets\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListEnvVariablesIter returns an iterator that paginates through all results of ListEnvVariables.\nfunc (s *ActionsService) ListEnvVariablesIter(ctx context.Context, owner string, repo string, env string, opts *ListOptions) iter.Seq2[*ActionsVariable, error] {\n\treturn func(yield func(*ActionsVariable, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListEnvVariables(ctx, owner, repo, env, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*ActionsVariable\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Variables\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListHostedRunnersIter returns an iterator that paginates through all results of ListHostedRunners.\nfunc (s *ActionsService) ListHostedRunnersIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*HostedRunner, error] {\n\treturn func(yield func(*HostedRunner, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListHostedRunners(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*HostedRunner\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Runners\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListOrgSecretsIter returns an iterator that paginates through all results of ListOrgSecrets.\nfunc (s *ActionsService) ListOrgSecretsIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Secret, error] {\n\treturn func(yield func(*Secret, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListOrgSecrets(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Secret\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Secrets\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListOrgVariablesIter returns an iterator that paginates through all results of ListOrgVariables.\nfunc (s *ActionsService) ListOrgVariablesIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*ActionsVariable, error] {\n\treturn func(yield func(*ActionsVariable, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListOrgVariables(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*ActionsVariable\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Variables\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListOrganizationRunnerGroupsIter returns an iterator that paginates through all results of ListOrganizationRunnerGroups.\nfunc (s *ActionsService) ListOrganizationRunnerGroupsIter(ctx context.Context, org string, opts *ListOrgRunnerGroupOptions) iter.Seq2[*RunnerGroup, error] {\n\treturn func(yield func(*RunnerGroup, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOrgRunnerGroupOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListOrganizationRunnerGroups(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*RunnerGroup\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.RunnerGroups\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListOrganizationRunnersIter returns an iterator that paginates through all results of ListOrganizationRunners.\nfunc (s *ActionsService) ListOrganizationRunnersIter(ctx context.Context, org string, opts *ListRunnersOptions) iter.Seq2[*Runner, error] {\n\treturn func(yield func(*Runner, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListRunnersOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListOrganizationRunners(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Runner\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Runners\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListRepoOrgSecretsIter returns an iterator that paginates through all results of ListRepoOrgSecrets.\nfunc (s *ActionsService) ListRepoOrgSecretsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Secret, error] {\n\treturn func(yield func(*Secret, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListRepoOrgSecrets(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Secret\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Secrets\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListRepoOrgVariablesIter returns an iterator that paginates through all results of ListRepoOrgVariables.\nfunc (s *ActionsService) ListRepoOrgVariablesIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*ActionsVariable, error] {\n\treturn func(yield func(*ActionsVariable, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListRepoOrgVariables(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*ActionsVariable\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Variables\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListRepoSecretsIter returns an iterator that paginates through all results of ListRepoSecrets.\nfunc (s *ActionsService) ListRepoSecretsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Secret, error] {\n\treturn func(yield func(*Secret, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListRepoSecrets(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Secret\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Secrets\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListRepoVariablesIter returns an iterator that paginates through all results of ListRepoVariables.\nfunc (s *ActionsService) ListRepoVariablesIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*ActionsVariable, error] {\n\treturn func(yield func(*ActionsVariable, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListRepoVariables(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*ActionsVariable\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Variables\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListRepositoriesSelfHostedRunnersAllowedInOrganizationIter returns an iterator that paginates through all results of ListRepositoriesSelfHostedRunnersAllowedInOrganization.\nfunc (s *ActionsService) ListRepositoriesSelfHostedRunnersAllowedInOrganizationIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Repository, error] {\n\treturn func(yield func(*Repository, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListRepositoriesSelfHostedRunnersAllowedInOrganization(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Repository\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Repositories\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListRepositoryAccessRunnerGroupIter returns an iterator that paginates through all results of ListRepositoryAccessRunnerGroup.\nfunc (s *ActionsService) ListRepositoryAccessRunnerGroupIter(ctx context.Context, org string, groupID int64, opts *ListOptions) iter.Seq2[*Repository, error] {\n\treturn func(yield func(*Repository, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListRepositoryAccessRunnerGroup(ctx, org, groupID, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Repository\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Repositories\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListRepositoryWorkflowRunsIter returns an iterator that paginates through all results of ListRepositoryWorkflowRuns.\nfunc (s *ActionsService) ListRepositoryWorkflowRunsIter(ctx context.Context, owner string, repo string, opts *ListWorkflowRunsOptions) iter.Seq2[*WorkflowRun, error] {\n\treturn func(yield func(*WorkflowRun, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListWorkflowRunsOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListRepositoryWorkflowRuns(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*WorkflowRun\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.WorkflowRuns\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListRunnerGroupHostedRunnersIter returns an iterator that paginates through all results of ListRunnerGroupHostedRunners.\nfunc (s *ActionsService) ListRunnerGroupHostedRunnersIter(ctx context.Context, org string, groupID int64, opts *ListOptions) iter.Seq2[*HostedRunner, error] {\n\treturn func(yield func(*HostedRunner, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListRunnerGroupHostedRunners(ctx, org, groupID, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*HostedRunner\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Runners\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListRunnerGroupRunnersIter returns an iterator that paginates through all results of ListRunnerGroupRunners.\nfunc (s *ActionsService) ListRunnerGroupRunnersIter(ctx context.Context, org string, groupID int64, opts *ListOptions) iter.Seq2[*Runner, error] {\n\treturn func(yield func(*Runner, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListRunnerGroupRunners(ctx, org, groupID, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Runner\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Runners\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListRunnersIter returns an iterator that paginates through all results of ListRunners.\nfunc (s *ActionsService) ListRunnersIter(ctx context.Context, owner string, repo string, opts *ListRunnersOptions) iter.Seq2[*Runner, error] {\n\treturn func(yield func(*Runner, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListRunnersOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListRunners(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Runner\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Runners\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListSelectedReposForOrgSecretIter returns an iterator that paginates through all results of ListSelectedReposForOrgSecret.\nfunc (s *ActionsService) ListSelectedReposForOrgSecretIter(ctx context.Context, org string, name string, opts *ListOptions) iter.Seq2[*Repository, error] {\n\treturn func(yield func(*Repository, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListSelectedReposForOrgSecret(ctx, org, name, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Repository\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Repositories\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListSelectedReposForOrgVariableIter returns an iterator that paginates through all results of ListSelectedReposForOrgVariable.\nfunc (s *ActionsService) ListSelectedReposForOrgVariableIter(ctx context.Context, org string, name string, opts *ListOptions) iter.Seq2[*Repository, error] {\n\treturn func(yield func(*Repository, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListSelectedReposForOrgVariable(ctx, org, name, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Repository\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Repositories\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListWorkflowJobsIter returns an iterator that paginates through all results of ListWorkflowJobs.\nfunc (s *ActionsService) ListWorkflowJobsIter(ctx context.Context, owner string, repo string, runID int64, opts *ListWorkflowJobsOptions) iter.Seq2[*WorkflowJob, error] {\n\treturn func(yield func(*WorkflowJob, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListWorkflowJobsOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListWorkflowJobs(ctx, owner, repo, runID, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*WorkflowJob\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Jobs\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListWorkflowJobsAttemptIter returns an iterator that paginates through all results of ListWorkflowJobsAttempt.\nfunc (s *ActionsService) ListWorkflowJobsAttemptIter(ctx context.Context, owner string, repo string, runID int64, attemptNumber int64, opts *ListOptions) iter.Seq2[*WorkflowJob, error] {\n\treturn func(yield func(*WorkflowJob, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListWorkflowJobsAttempt(ctx, owner, repo, runID, attemptNumber, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*WorkflowJob\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Jobs\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListWorkflowRunArtifactsIter returns an iterator that paginates through all results of ListWorkflowRunArtifacts.\nfunc (s *ActionsService) ListWorkflowRunArtifactsIter(ctx context.Context, owner string, repo string, runID int64, opts *ListOptions) iter.Seq2[*Artifact, error] {\n\treturn func(yield func(*Artifact, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListWorkflowRunArtifacts(ctx, owner, repo, runID, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Artifact\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Artifacts\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListWorkflowRunsByFileNameIter returns an iterator that paginates through all results of ListWorkflowRunsByFileName.\nfunc (s *ActionsService) ListWorkflowRunsByFileNameIter(ctx context.Context, owner string, repo string, workflowFileName string, opts *ListWorkflowRunsOptions) iter.Seq2[*WorkflowRun, error] {\n\treturn func(yield func(*WorkflowRun, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListWorkflowRunsOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListWorkflowRunsByFileName(ctx, owner, repo, workflowFileName, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*WorkflowRun\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.WorkflowRuns\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListWorkflowRunsByIDIter returns an iterator that paginates through all results of ListWorkflowRunsByID.\nfunc (s *ActionsService) ListWorkflowRunsByIDIter(ctx context.Context, owner string, repo string, workflowID int64, opts *ListWorkflowRunsOptions) iter.Seq2[*WorkflowRun, error] {\n\treturn func(yield func(*WorkflowRun, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListWorkflowRunsOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListWorkflowRunsByID(ctx, owner, repo, workflowID, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*WorkflowRun\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.WorkflowRuns\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListWorkflowsIter returns an iterator that paginates through all results of ListWorkflows.\nfunc (s *ActionsService) ListWorkflowsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Workflow, error] {\n\treturn func(yield func(*Workflow, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListWorkflows(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Workflow\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Workflows\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListEventsIter returns an iterator that paginates through all results of ListEvents.\nfunc (s *ActivityService) ListEventsIter(ctx context.Context, opts *ListOptions) iter.Seq2[*Event, error] {\n\treturn func(yield func(*Event, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListEvents(ctx, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListEventsForOrganizationIter returns an iterator that paginates through all results of ListEventsForOrganization.\nfunc (s *ActivityService) ListEventsForOrganizationIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Event, error] {\n\treturn func(yield func(*Event, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListEventsForOrganization(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListEventsForRepoNetworkIter returns an iterator that paginates through all results of ListEventsForRepoNetwork.\nfunc (s *ActivityService) ListEventsForRepoNetworkIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Event, error] {\n\treturn func(yield func(*Event, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListEventsForRepoNetwork(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListEventsPerformedByUserIter returns an iterator that paginates through all results of ListEventsPerformedByUser.\nfunc (s *ActivityService) ListEventsPerformedByUserIter(ctx context.Context, user string, publicOnly bool, opts *ListOptions) iter.Seq2[*Event, error] {\n\treturn func(yield func(*Event, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListEventsPerformedByUser(ctx, user, publicOnly, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListEventsReceivedByUserIter returns an iterator that paginates through all results of ListEventsReceivedByUser.\nfunc (s *ActivityService) ListEventsReceivedByUserIter(ctx context.Context, user string, publicOnly bool, opts *ListOptions) iter.Seq2[*Event, error] {\n\treturn func(yield func(*Event, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListEventsReceivedByUser(ctx, user, publicOnly, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListIssueEventsForRepositoryIter returns an iterator that paginates through all results of ListIssueEventsForRepository.\nfunc (s *ActivityService) ListIssueEventsForRepositoryIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*IssueEvent, error] {\n\treturn func(yield func(*IssueEvent, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListIssueEventsForRepository(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListNotificationsIter returns an iterator that paginates through all results of ListNotifications.\nfunc (s *ActivityService) ListNotificationsIter(ctx context.Context, opts *NotificationListOptions) iter.Seq2[*Notification, error] {\n\treturn func(yield func(*Notification, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &NotificationListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListNotifications(ctx, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListRepositoryEventsIter returns an iterator that paginates through all results of ListRepositoryEvents.\nfunc (s *ActivityService) ListRepositoryEventsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Event, error] {\n\treturn func(yield func(*Event, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListRepositoryEvents(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListRepositoryNotificationsIter returns an iterator that paginates through all results of ListRepositoryNotifications.\nfunc (s *ActivityService) ListRepositoryNotificationsIter(ctx context.Context, owner string, repo string, opts *NotificationListOptions) iter.Seq2[*Notification, error] {\n\treturn func(yield func(*Notification, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &NotificationListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListRepositoryNotifications(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListStargazersIter returns an iterator that paginates through all results of ListStargazers.\nfunc (s *ActivityService) ListStargazersIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Stargazer, error] {\n\treturn func(yield func(*Stargazer, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListStargazers(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListStarredIter returns an iterator that paginates through all results of ListStarred.\nfunc (s *ActivityService) ListStarredIter(ctx context.Context, user string, opts *ActivityListStarredOptions) iter.Seq2[*StarredRepository, error] {\n\treturn func(yield func(*StarredRepository, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ActivityListStarredOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListStarred(ctx, user, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListUserEventsForOrganizationIter returns an iterator that paginates through all results of ListUserEventsForOrganization.\nfunc (s *ActivityService) ListUserEventsForOrganizationIter(ctx context.Context, org string, user string, opts *ListOptions) iter.Seq2[*Event, error] {\n\treturn func(yield func(*Event, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListUserEventsForOrganization(ctx, org, user, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListWatchedIter returns an iterator that paginates through all results of ListWatched.\nfunc (s *ActivityService) ListWatchedIter(ctx context.Context, user string, opts *ListOptions) iter.Seq2[*Repository, error] {\n\treturn func(yield func(*Repository, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListWatched(ctx, user, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListWatchersIter returns an iterator that paginates through all results of ListWatchers.\nfunc (s *ActivityService) ListWatchersIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*User, error] {\n\treturn func(yield func(*User, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListWatchers(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListHookDeliveriesIter returns an iterator that paginates through all results of ListHookDeliveries.\nfunc (s *AppsService) ListHookDeliveriesIter(ctx context.Context, opts *ListCursorOptions) iter.Seq2[*HookDelivery, error] {\n\treturn func(yield func(*HookDelivery, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListCursorOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListHookDeliveries(ctx, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.Cursor == \"\" {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Cursor = resp.Cursor\n\t\t}\n\t}\n}\n\n// ListInstallationRequestsIter returns an iterator that paginates through all results of ListInstallationRequests.\nfunc (s *AppsService) ListInstallationRequestsIter(ctx context.Context, opts *ListOptions) iter.Seq2[*InstallationRequest, error] {\n\treturn func(yield func(*InstallationRequest, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListInstallationRequests(ctx, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListInstallationsIter returns an iterator that paginates through all results of ListInstallations.\nfunc (s *AppsService) ListInstallationsIter(ctx context.Context, opts *ListOptions) iter.Seq2[*Installation, error] {\n\treturn func(yield func(*Installation, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListInstallations(ctx, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListReposIter returns an iterator that paginates through all results of ListRepos.\nfunc (s *AppsService) ListReposIter(ctx context.Context, opts *ListOptions) iter.Seq2[*Repository, error] {\n\treturn func(yield func(*Repository, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListRepos(ctx, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Repository\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Repositories\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListUserInstallationsIter returns an iterator that paginates through all results of ListUserInstallations.\nfunc (s *AppsService) ListUserInstallationsIter(ctx context.Context, opts *ListOptions) iter.Seq2[*Installation, error] {\n\treturn func(yield func(*Installation, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListUserInstallations(ctx, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListUserReposIter returns an iterator that paginates through all results of ListUserRepos.\nfunc (s *AppsService) ListUserReposIter(ctx context.Context, id int64, opts *ListOptions) iter.Seq2[*Repository, error] {\n\treturn func(yield func(*Repository, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListUserRepos(ctx, id, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Repository\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Repositories\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListCheckRunAnnotationsIter returns an iterator that paginates through all results of ListCheckRunAnnotations.\nfunc (s *ChecksService) ListCheckRunAnnotationsIter(ctx context.Context, owner string, repo string, checkRunID int64, opts *ListOptions) iter.Seq2[*CheckRunAnnotation, error] {\n\treturn func(yield func(*CheckRunAnnotation, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListCheckRunAnnotations(ctx, owner, repo, checkRunID, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListCheckRunsCheckSuiteIter returns an iterator that paginates through all results of ListCheckRunsCheckSuite.\nfunc (s *ChecksService) ListCheckRunsCheckSuiteIter(ctx context.Context, owner string, repo string, checkSuiteID int64, opts *ListCheckRunsOptions) iter.Seq2[*CheckRun, error] {\n\treturn func(yield func(*CheckRun, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListCheckRunsOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListCheckRunsCheckSuite(ctx, owner, repo, checkSuiteID, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*CheckRun\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.CheckRuns\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListCheckRunsForRefIter returns an iterator that paginates through all results of ListCheckRunsForRef.\nfunc (s *ChecksService) ListCheckRunsForRefIter(ctx context.Context, owner string, repo string, ref string, opts *ListCheckRunsOptions) iter.Seq2[*CheckRun, error] {\n\treturn func(yield func(*CheckRun, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListCheckRunsOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListCheckRunsForRef(ctx, owner, repo, ref, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*CheckRun\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.CheckRuns\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListCheckSuitesForRefIter returns an iterator that paginates through all results of ListCheckSuitesForRef.\nfunc (s *ChecksService) ListCheckSuitesForRefIter(ctx context.Context, owner string, repo string, ref string, opts *ListCheckSuiteOptions) iter.Seq2[*CheckSuite, error] {\n\treturn func(yield func(*CheckSuite, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListCheckSuiteOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListCheckSuitesForRef(ctx, owner, repo, ref, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*CheckSuite\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.CheckSuites\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListAcceptedAssignmentsIter returns an iterator that paginates through all results of ListAcceptedAssignments.\nfunc (s *ClassroomService) ListAcceptedAssignmentsIter(ctx context.Context, assignmentID int64, opts *ListOptions) iter.Seq2[*AcceptedAssignment, error] {\n\treturn func(yield func(*AcceptedAssignment, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListAcceptedAssignments(ctx, assignmentID, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListClassroomAssignmentsIter returns an iterator that paginates through all results of ListClassroomAssignments.\nfunc (s *ClassroomService) ListClassroomAssignmentsIter(ctx context.Context, classroomID int64, opts *ListOptions) iter.Seq2[*ClassroomAssignment, error] {\n\treturn func(yield func(*ClassroomAssignment, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListClassroomAssignments(ctx, classroomID, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListClassroomsIter returns an iterator that paginates through all results of ListClassrooms.\nfunc (s *ClassroomService) ListClassroomsIter(ctx context.Context, opts *ListOptions) iter.Seq2[*Classroom, error] {\n\treturn func(yield func(*Classroom, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListClassrooms(ctx, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListAlertInstancesIter returns an iterator that paginates through all results of ListAlertInstances.\nfunc (s *CodeScanningService) ListAlertInstancesIter(ctx context.Context, owner string, repo string, id int64, opts *AlertInstancesListOptions) iter.Seq2[*MostRecentInstance, error] {\n\treturn func(yield func(*MostRecentInstance, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &AlertInstancesListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListAlertInstances(ctx, owner, repo, id, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListAlertsForOrgIter returns an iterator that paginates through all results of ListAlertsForOrg.\nfunc (s *CodeScanningService) ListAlertsForOrgIter(ctx context.Context, org string, opts *AlertListOptions) iter.Seq2[*Alert, error] {\n\treturn func(yield func(*Alert, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &AlertListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListAlertsForOrg(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.After == \"\" && resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListCursorOptions.After = resp.After\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListAlertsForRepoIter returns an iterator that paginates through all results of ListAlertsForRepo.\nfunc (s *CodeScanningService) ListAlertsForRepoIter(ctx context.Context, owner string, repo string, opts *AlertListOptions) iter.Seq2[*Alert, error] {\n\treturn func(yield func(*Alert, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &AlertListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListAlertsForRepo(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.After == \"\" && resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListCursorOptions.After = resp.After\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListAnalysesForRepoIter returns an iterator that paginates through all results of ListAnalysesForRepo.\nfunc (s *CodeScanningService) ListAnalysesForRepoIter(ctx context.Context, owner string, repo string, opts *AnalysesListOptions) iter.Seq2[*ScanningAnalysis, error] {\n\treturn func(yield func(*ScanningAnalysis, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &AnalysesListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListAnalysesForRepo(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListIter returns an iterator that paginates through all results of List.\nfunc (s *CodespacesService) ListIter(ctx context.Context, opts *ListCodespacesOptions) iter.Seq2[*Codespace, error] {\n\treturn func(yield func(*Codespace, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListCodespacesOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.List(ctx, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Codespace\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Codespaces\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListDevContainerConfigurationsIter returns an iterator that paginates through all results of ListDevContainerConfigurations.\nfunc (s *CodespacesService) ListDevContainerConfigurationsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*DevContainer, error] {\n\treturn func(yield func(*DevContainer, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListDevContainerConfigurations(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*DevContainer\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Devcontainers\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListInOrgIter returns an iterator that paginates through all results of ListInOrg.\nfunc (s *CodespacesService) ListInOrgIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Codespace, error] {\n\treturn func(yield func(*Codespace, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListInOrg(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Codespace\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Codespaces\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListInRepoIter returns an iterator that paginates through all results of ListInRepo.\nfunc (s *CodespacesService) ListInRepoIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Codespace, error] {\n\treturn func(yield func(*Codespace, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListInRepo(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Codespace\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Codespaces\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListOrgSecretsIter returns an iterator that paginates through all results of ListOrgSecrets.\nfunc (s *CodespacesService) ListOrgSecretsIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Secret, error] {\n\treturn func(yield func(*Secret, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListOrgSecrets(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Secret\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Secrets\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListRepoSecretsIter returns an iterator that paginates through all results of ListRepoSecrets.\nfunc (s *CodespacesService) ListRepoSecretsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Secret, error] {\n\treturn func(yield func(*Secret, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListRepoSecrets(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Secret\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Secrets\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListSelectedReposForOrgSecretIter returns an iterator that paginates through all results of ListSelectedReposForOrgSecret.\nfunc (s *CodespacesService) ListSelectedReposForOrgSecretIter(ctx context.Context, org string, name string, opts *ListOptions) iter.Seq2[*Repository, error] {\n\treturn func(yield func(*Repository, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListSelectedReposForOrgSecret(ctx, org, name, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Repository\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Repositories\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListSelectedReposForUserSecretIter returns an iterator that paginates through all results of ListSelectedReposForUserSecret.\nfunc (s *CodespacesService) ListSelectedReposForUserSecretIter(ctx context.Context, name string, opts *ListOptions) iter.Seq2[*Repository, error] {\n\treturn func(yield func(*Repository, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListSelectedReposForUserSecret(ctx, name, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Repository\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Repositories\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListUserCodespacesInOrgIter returns an iterator that paginates through all results of ListUserCodespacesInOrg.\nfunc (s *CodespacesService) ListUserCodespacesInOrgIter(ctx context.Context, org string, username string, opts *ListOptions) iter.Seq2[*Codespace, error] {\n\treturn func(yield func(*Codespace, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListUserCodespacesInOrg(ctx, org, username, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Codespace\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Codespaces\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListUserSecretsIter returns an iterator that paginates through all results of ListUserSecrets.\nfunc (s *CodespacesService) ListUserSecretsIter(ctx context.Context, opts *ListOptions) iter.Seq2[*Secret, error] {\n\treturn func(yield func(*Secret, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListUserSecrets(ctx, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Secret\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Secrets\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListCopilotEnterpriseSeatsIter returns an iterator that paginates through all results of ListCopilotEnterpriseSeats.\nfunc (s *CopilotService) ListCopilotEnterpriseSeatsIter(ctx context.Context, enterprise string, opts *ListOptions) iter.Seq2[*CopilotSeatDetails, error] {\n\treturn func(yield func(*CopilotSeatDetails, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListCopilotEnterpriseSeats(ctx, enterprise, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*CopilotSeatDetails\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Seats\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListCopilotSeatsIter returns an iterator that paginates through all results of ListCopilotSeats.\nfunc (s *CopilotService) ListCopilotSeatsIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*CopilotSeatDetails, error] {\n\treturn func(yield func(*CopilotSeatDetails, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListCopilotSeats(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*CopilotSeatDetails\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Seats\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListOrgAlertsIter returns an iterator that paginates through all results of ListOrgAlerts.\nfunc (s *DependabotService) ListOrgAlertsIter(ctx context.Context, org string, opts *ListAlertsOptions) iter.Seq2[*DependabotAlert, error] {\n\treturn func(yield func(*DependabotAlert, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListAlertsOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListOrgAlerts(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.After == \"\" && resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListCursorOptions.After = resp.After\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListOrgSecretsIter returns an iterator that paginates through all results of ListOrgSecrets.\nfunc (s *DependabotService) ListOrgSecretsIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Secret, error] {\n\treturn func(yield func(*Secret, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListOrgSecrets(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Secret\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Secrets\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListRepoAlertsIter returns an iterator that paginates through all results of ListRepoAlerts.\nfunc (s *DependabotService) ListRepoAlertsIter(ctx context.Context, owner string, repo string, opts *ListAlertsOptions) iter.Seq2[*DependabotAlert, error] {\n\treturn func(yield func(*DependabotAlert, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListAlertsOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListRepoAlerts(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.After == \"\" && resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListCursorOptions.After = resp.After\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListRepoSecretsIter returns an iterator that paginates through all results of ListRepoSecrets.\nfunc (s *DependabotService) ListRepoSecretsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Secret, error] {\n\treturn func(yield func(*Secret, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListRepoSecrets(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Secret\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Secrets\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListSelectedReposForOrgSecretIter returns an iterator that paginates through all results of ListSelectedReposForOrgSecret.\nfunc (s *DependabotService) ListSelectedReposForOrgSecretIter(ctx context.Context, org string, name string, opts *ListOptions) iter.Seq2[*Repository, error] {\n\treturn func(yield func(*Repository, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListSelectedReposForOrgSecret(ctx, org, name, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Repository\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Repositories\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListAppAccessibleOrganizationRepositoriesIter returns an iterator that paginates through all results of ListAppAccessibleOrganizationRepositories.\nfunc (s *EnterpriseService) ListAppAccessibleOrganizationRepositoriesIter(ctx context.Context, enterprise string, org string, opts *ListOptions) iter.Seq2[*AccessibleRepository, error] {\n\treturn func(yield func(*AccessibleRepository, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListAppAccessibleOrganizationRepositories(ctx, enterprise, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListAppInstallableOrganizationsIter returns an iterator that paginates through all results of ListAppInstallableOrganizations.\nfunc (s *EnterpriseService) ListAppInstallableOrganizationsIter(ctx context.Context, enterprise string, opts *ListOptions) iter.Seq2[*InstallableOrganization, error] {\n\treturn func(yield func(*InstallableOrganization, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListAppInstallableOrganizations(ctx, enterprise, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListAppInstallationsIter returns an iterator that paginates through all results of ListAppInstallations.\nfunc (s *EnterpriseService) ListAppInstallationsIter(ctx context.Context, enterprise string, org string, opts *ListOptions) iter.Seq2[*Installation, error] {\n\treturn func(yield func(*Installation, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListAppInstallations(ctx, enterprise, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListAssignmentsIter returns an iterator that paginates through all results of ListAssignments.\nfunc (s *EnterpriseService) ListAssignmentsIter(ctx context.Context, enterprise string, enterpriseTeam string, opts *ListOptions) iter.Seq2[*Organization, error] {\n\treturn func(yield func(*Organization, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListAssignments(ctx, enterprise, enterpriseTeam, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListCodeSecurityConfigurationRepositoriesIter returns an iterator that paginates through all results of ListCodeSecurityConfigurationRepositories.\nfunc (s *EnterpriseService) ListCodeSecurityConfigurationRepositoriesIter(ctx context.Context, enterprise string, configurationID int64, opts *ListCodeSecurityConfigurationRepositoriesOptions) iter.Seq2[*RepositoryAttachment, error] {\n\treturn func(yield func(*RepositoryAttachment, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListCodeSecurityConfigurationRepositoriesOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListCodeSecurityConfigurationRepositories(ctx, enterprise, configurationID, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.After == \"\" {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.After = resp.After\n\t\t}\n\t}\n}\n\n// ListCodeSecurityConfigurationsIter returns an iterator that paginates through all results of ListCodeSecurityConfigurations.\nfunc (s *EnterpriseService) ListCodeSecurityConfigurationsIter(ctx context.Context, enterprise string, opts *ListEnterpriseCodeSecurityConfigurationOptions) iter.Seq2[*CodeSecurityConfiguration, error] {\n\treturn func(yield func(*CodeSecurityConfiguration, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListEnterpriseCodeSecurityConfigurationOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListCodeSecurityConfigurations(ctx, enterprise, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.After == \"\" {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.After = resp.After\n\t\t}\n\t}\n}\n\n// ListEnterpriseNetworkConfigurationsIter returns an iterator that paginates through all results of ListEnterpriseNetworkConfigurations.\nfunc (s *EnterpriseService) ListEnterpriseNetworkConfigurationsIter(ctx context.Context, enterprise string, opts *ListOptions) iter.Seq2[*NetworkConfiguration, error] {\n\treturn func(yield func(*NetworkConfiguration, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListEnterpriseNetworkConfigurations(ctx, enterprise, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*NetworkConfiguration\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.NetworkConfigurations\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListHostedRunnersIter returns an iterator that paginates through all results of ListHostedRunners.\nfunc (s *EnterpriseService) ListHostedRunnersIter(ctx context.Context, enterprise string, opts *ListOptions) iter.Seq2[*HostedRunner, error] {\n\treturn func(yield func(*HostedRunner, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListHostedRunners(ctx, enterprise, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*HostedRunner\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Runners\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListOrganizationAccessRunnerGroupIter returns an iterator that paginates through all results of ListOrganizationAccessRunnerGroup.\nfunc (s *EnterpriseService) ListOrganizationAccessRunnerGroupIter(ctx context.Context, enterprise string, groupID int64, opts *ListOptions) iter.Seq2[*Organization, error] {\n\treturn func(yield func(*Organization, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListOrganizationAccessRunnerGroup(ctx, enterprise, groupID, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Organization\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Organizations\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListOrganizationCustomPropertyValuesIter returns an iterator that paginates through all results of ListOrganizationCustomPropertyValues.\nfunc (s *EnterpriseService) ListOrganizationCustomPropertyValuesIter(ctx context.Context, enterprise string, opts *ListOptions) iter.Seq2[*EnterpriseCustomPropertiesValues, error] {\n\treturn func(yield func(*EnterpriseCustomPropertiesValues, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListOrganizationCustomPropertyValues(ctx, enterprise, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListRepositoriesForOrgAppInstallationIter returns an iterator that paginates through all results of ListRepositoriesForOrgAppInstallation.\nfunc (s *EnterpriseService) ListRepositoriesForOrgAppInstallationIter(ctx context.Context, enterprise string, org string, installationID int64, opts *ListOptions) iter.Seq2[*AccessibleRepository, error] {\n\treturn func(yield func(*AccessibleRepository, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListRepositoriesForOrgAppInstallation(ctx, enterprise, org, installationID, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListRunnerGroupRunnersIter returns an iterator that paginates through all results of ListRunnerGroupRunners.\nfunc (s *EnterpriseService) ListRunnerGroupRunnersIter(ctx context.Context, enterprise string, groupID int64, opts *ListOptions) iter.Seq2[*Runner, error] {\n\treturn func(yield func(*Runner, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListRunnerGroupRunners(ctx, enterprise, groupID, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Runner\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Runners\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListRunnerGroupsIter returns an iterator that paginates through all results of ListRunnerGroups.\nfunc (s *EnterpriseService) ListRunnerGroupsIter(ctx context.Context, enterprise string, opts *ListEnterpriseRunnerGroupOptions) iter.Seq2[*EnterpriseRunnerGroup, error] {\n\treturn func(yield func(*EnterpriseRunnerGroup, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListEnterpriseRunnerGroupOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListRunnerGroups(ctx, enterprise, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*EnterpriseRunnerGroup\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.RunnerGroups\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListRunnersIter returns an iterator that paginates through all results of ListRunners.\nfunc (s *EnterpriseService) ListRunnersIter(ctx context.Context, enterprise string, opts *ListRunnersOptions) iter.Seq2[*Runner, error] {\n\treturn func(yield func(*Runner, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListRunnersOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListRunners(ctx, enterprise, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Runner\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Runners\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListTeamMembersIter returns an iterator that paginates through all results of ListTeamMembers.\nfunc (s *EnterpriseService) ListTeamMembersIter(ctx context.Context, enterprise string, enterpriseTeam string, opts *ListOptions) iter.Seq2[*User, error] {\n\treturn func(yield func(*User, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListTeamMembers(ctx, enterprise, enterpriseTeam, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListTeamsIter returns an iterator that paginates through all results of ListTeams.\nfunc (s *EnterpriseService) ListTeamsIter(ctx context.Context, enterprise string, opts *ListOptions) iter.Seq2[*EnterpriseTeam, error] {\n\treturn func(yield func(*EnterpriseTeam, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListTeams(ctx, enterprise, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListIter returns an iterator that paginates through all results of List.\nfunc (s *GistsService) ListIter(ctx context.Context, user string, opts *GistListOptions) iter.Seq2[*Gist, error] {\n\treturn func(yield func(*Gist, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &GistListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.List(ctx, user, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListAllIter returns an iterator that paginates through all results of ListAll.\nfunc (s *GistsService) ListAllIter(ctx context.Context, opts *GistListOptions) iter.Seq2[*Gist, error] {\n\treturn func(yield func(*Gist, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &GistListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListAll(ctx, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListCommentsIter returns an iterator that paginates through all results of ListComments.\nfunc (s *GistsService) ListCommentsIter(ctx context.Context, gistID string, opts *ListOptions) iter.Seq2[*GistComment, error] {\n\treturn func(yield func(*GistComment, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListComments(ctx, gistID, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListCommitsIter returns an iterator that paginates through all results of ListCommits.\nfunc (s *GistsService) ListCommitsIter(ctx context.Context, id string, opts *ListOptions) iter.Seq2[*GistCommit, error] {\n\treturn func(yield func(*GistCommit, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListCommits(ctx, id, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListForksIter returns an iterator that paginates through all results of ListForks.\nfunc (s *GistsService) ListForksIter(ctx context.Context, id string, opts *ListOptions) iter.Seq2[*GistFork, error] {\n\treturn func(yield func(*GistFork, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListForks(ctx, id, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListStarredIter returns an iterator that paginates through all results of ListStarred.\nfunc (s *GistsService) ListStarredIter(ctx context.Context, opts *GistListOptions) iter.Seq2[*Gist, error] {\n\treturn func(yield func(*Gist, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &GistListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListStarred(ctx, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListAllIssuesIter returns an iterator that paginates through all results of ListAllIssues.\nfunc (s *IssuesService) ListAllIssuesIter(ctx context.Context, opts *ListAllIssuesOptions) iter.Seq2[*Issue, error] {\n\treturn func(yield func(*Issue, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListAllIssuesOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListAllIssues(ctx, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListAssigneesIter returns an iterator that paginates through all results of ListAssignees.\nfunc (s *IssuesService) ListAssigneesIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*User, error] {\n\treturn func(yield func(*User, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListAssignees(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListByOrgIter returns an iterator that paginates through all results of ListByOrg.\nfunc (s *IssuesService) ListByOrgIter(ctx context.Context, org string, opts *IssueListByOrgOptions) iter.Seq2[*Issue, error] {\n\treturn func(yield func(*Issue, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &IssueListByOrgOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListByOrg(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListByRepoIter returns an iterator that paginates through all results of ListByRepo.\nfunc (s *IssuesService) ListByRepoIter(ctx context.Context, owner string, repo string, opts *IssueListByRepoOptions) iter.Seq2[*Issue, error] {\n\treturn func(yield func(*Issue, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &IssueListByRepoOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListByRepo(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.After == \"\" && resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListCursorOptions.After = resp.After\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListCommentsIter returns an iterator that paginates through all results of ListComments.\nfunc (s *IssuesService) ListCommentsIter(ctx context.Context, owner string, repo string, number int, opts *IssueListCommentsOptions) iter.Seq2[*IssueComment, error] {\n\treturn func(yield func(*IssueComment, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &IssueListCommentsOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListComments(ctx, owner, repo, number, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListIssueEventsIter returns an iterator that paginates through all results of ListIssueEvents.\nfunc (s *IssuesService) ListIssueEventsIter(ctx context.Context, owner string, repo string, number int, opts *ListOptions) iter.Seq2[*IssueEvent, error] {\n\treturn func(yield func(*IssueEvent, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListIssueEvents(ctx, owner, repo, number, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListIssueTimelineIter returns an iterator that paginates through all results of ListIssueTimeline.\nfunc (s *IssuesService) ListIssueTimelineIter(ctx context.Context, owner string, repo string, number int, opts *ListOptions) iter.Seq2[*Timeline, error] {\n\treturn func(yield func(*Timeline, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListIssueTimeline(ctx, owner, repo, number, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListLabelsIter returns an iterator that paginates through all results of ListLabels.\nfunc (s *IssuesService) ListLabelsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Label, error] {\n\treturn func(yield func(*Label, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListLabels(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListLabelsByIssueIter returns an iterator that paginates through all results of ListLabelsByIssue.\nfunc (s *IssuesService) ListLabelsByIssueIter(ctx context.Context, owner string, repo string, number int, opts *ListOptions) iter.Seq2[*Label, error] {\n\treturn func(yield func(*Label, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListLabelsByIssue(ctx, owner, repo, number, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListLabelsForMilestoneIter returns an iterator that paginates through all results of ListLabelsForMilestone.\nfunc (s *IssuesService) ListLabelsForMilestoneIter(ctx context.Context, owner string, repo string, number int, opts *ListOptions) iter.Seq2[*Label, error] {\n\treturn func(yield func(*Label, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListLabelsForMilestone(ctx, owner, repo, number, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListMilestonesIter returns an iterator that paginates through all results of ListMilestones.\nfunc (s *IssuesService) ListMilestonesIter(ctx context.Context, owner string, repo string, opts *MilestoneListOptions) iter.Seq2[*Milestone, error] {\n\treturn func(yield func(*Milestone, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &MilestoneListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListMilestones(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListRepositoryEventsIter returns an iterator that paginates through all results of ListRepositoryEvents.\nfunc (s *IssuesService) ListRepositoryEventsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*IssueEvent, error] {\n\treturn func(yield func(*IssueEvent, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListRepositoryEvents(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListUserIssuesIter returns an iterator that paginates through all results of ListUserIssues.\nfunc (s *IssuesService) ListUserIssuesIter(ctx context.Context, opts *ListUserIssuesOptions) iter.Seq2[*Issue, error] {\n\treturn func(yield func(*Issue, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListUserIssuesOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListUserIssues(ctx, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListIter returns an iterator that paginates through all results of List.\nfunc (s *LicensesService) ListIter(ctx context.Context, opts *ListLicensesOptions) iter.Seq2[*License, error] {\n\treturn func(yield func(*License, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListLicensesOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.List(ctx, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListMarketplacePurchasesForUserIter returns an iterator that paginates through all results of ListMarketplacePurchasesForUser.\nfunc (s *MarketplaceService) ListMarketplacePurchasesForUserIter(ctx context.Context, opts *ListOptions) iter.Seq2[*MarketplacePurchase, error] {\n\treturn func(yield func(*MarketplacePurchase, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListMarketplacePurchasesForUser(ctx, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListPlanAccountsForPlanIter returns an iterator that paginates through all results of ListPlanAccountsForPlan.\nfunc (s *MarketplaceService) ListPlanAccountsForPlanIter(ctx context.Context, planID int64, opts *ListOptions) iter.Seq2[*MarketplacePlanAccount, error] {\n\treturn func(yield func(*MarketplacePlanAccount, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListPlanAccountsForPlan(ctx, planID, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListPlansIter returns an iterator that paginates through all results of ListPlans.\nfunc (s *MarketplaceService) ListPlansIter(ctx context.Context, opts *ListOptions) iter.Seq2[*MarketplacePlan, error] {\n\treturn func(yield func(*MarketplacePlan, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListPlans(ctx, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListMigrationsIter returns an iterator that paginates through all results of ListMigrations.\nfunc (s *MigrationService) ListMigrationsIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Migration, error] {\n\treturn func(yield func(*Migration, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListMigrations(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListUserMigrationsIter returns an iterator that paginates through all results of ListUserMigrations.\nfunc (s *MigrationService) ListUserMigrationsIter(ctx context.Context, opts *ListOptions) iter.Seq2[*UserMigration, error] {\n\treturn func(yield func(*UserMigration, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListUserMigrations(ctx, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListIter returns an iterator that paginates through all results of List.\nfunc (s *OrganizationsService) ListIter(ctx context.Context, user string, opts *ListOptions) iter.Seq2[*Organization, error] {\n\treturn func(yield func(*Organization, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.List(ctx, user, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListAttestationsIter returns an iterator that paginates through all results of ListAttestations.\nfunc (s *OrganizationsService) ListAttestationsIter(ctx context.Context, org string, subjectDigest string, opts *ListOptions) iter.Seq2[*Attestation, error] {\n\treturn func(yield func(*Attestation, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListAttestations(ctx, org, subjectDigest, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Attestation\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Attestations\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListBlockedUsersIter returns an iterator that paginates through all results of ListBlockedUsers.\nfunc (s *OrganizationsService) ListBlockedUsersIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*User, error] {\n\treturn func(yield func(*User, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListBlockedUsers(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListCodeSecurityConfigurationRepositoriesIter returns an iterator that paginates through all results of ListCodeSecurityConfigurationRepositories.\nfunc (s *OrganizationsService) ListCodeSecurityConfigurationRepositoriesIter(ctx context.Context, org string, configurationID int64, opts *ListCodeSecurityConfigurationRepositoriesOptions) iter.Seq2[*RepositoryAttachment, error] {\n\treturn func(yield func(*RepositoryAttachment, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListCodeSecurityConfigurationRepositoriesOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListCodeSecurityConfigurationRepositories(ctx, org, configurationID, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.After == \"\" {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.After = resp.After\n\t\t}\n\t}\n}\n\n// ListCodeSecurityConfigurationsIter returns an iterator that paginates through all results of ListCodeSecurityConfigurations.\nfunc (s *OrganizationsService) ListCodeSecurityConfigurationsIter(ctx context.Context, org string, opts *ListOrgCodeSecurityConfigurationOptions) iter.Seq2[*CodeSecurityConfiguration, error] {\n\treturn func(yield func(*CodeSecurityConfiguration, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOrgCodeSecurityConfigurationOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListCodeSecurityConfigurations(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.After == \"\" {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.After = resp.After\n\t\t}\n\t}\n}\n\n// ListCredentialAuthorizationsIter returns an iterator that paginates through all results of ListCredentialAuthorizations.\nfunc (s *OrganizationsService) ListCredentialAuthorizationsIter(ctx context.Context, org string, opts *CredentialAuthorizationsListOptions) iter.Seq2[*CredentialAuthorization, error] {\n\treturn func(yield func(*CredentialAuthorization, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &CredentialAuthorizationsListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListCredentialAuthorizations(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListCustomPropertyValuesIter returns an iterator that paginates through all results of ListCustomPropertyValues.\nfunc (s *OrganizationsService) ListCustomPropertyValuesIter(ctx context.Context, org string, opts *ListCustomPropertyValuesOptions) iter.Seq2[*RepoCustomPropertyValue, error] {\n\treturn func(yield func(*RepoCustomPropertyValue, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListCustomPropertyValuesOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListCustomPropertyValues(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListFailedOrgInvitationsIter returns an iterator that paginates through all results of ListFailedOrgInvitations.\nfunc (s *OrganizationsService) ListFailedOrgInvitationsIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Invitation, error] {\n\treturn func(yield func(*Invitation, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListFailedOrgInvitations(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListFineGrainedPersonalAccessTokenRequestsIter returns an iterator that paginates through all results of ListFineGrainedPersonalAccessTokenRequests.\nfunc (s *OrganizationsService) ListFineGrainedPersonalAccessTokenRequestsIter(ctx context.Context, org string, opts *ListFineGrainedPATOptions) iter.Seq2[*FineGrainedPersonalAccessTokenRequest, error] {\n\treturn func(yield func(*FineGrainedPersonalAccessTokenRequest, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListFineGrainedPATOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListFineGrainedPersonalAccessTokenRequests(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListFineGrainedPersonalAccessTokensIter returns an iterator that paginates through all results of ListFineGrainedPersonalAccessTokens.\nfunc (s *OrganizationsService) ListFineGrainedPersonalAccessTokensIter(ctx context.Context, org string, opts *ListFineGrainedPATOptions) iter.Seq2[*PersonalAccessToken, error] {\n\treturn func(yield func(*PersonalAccessToken, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListFineGrainedPATOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListFineGrainedPersonalAccessTokens(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListHookDeliveriesIter returns an iterator that paginates through all results of ListHookDeliveries.\nfunc (s *OrganizationsService) ListHookDeliveriesIter(ctx context.Context, org string, id int64, opts *ListCursorOptions) iter.Seq2[*HookDelivery, error] {\n\treturn func(yield func(*HookDelivery, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListCursorOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListHookDeliveries(ctx, org, id, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.Cursor == \"\" {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Cursor = resp.Cursor\n\t\t}\n\t}\n}\n\n// ListHooksIter returns an iterator that paginates through all results of ListHooks.\nfunc (s *OrganizationsService) ListHooksIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Hook, error] {\n\treturn func(yield func(*Hook, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListHooks(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListImmutableReleaseRepositoriesIter returns an iterator that paginates through all results of ListImmutableReleaseRepositories.\nfunc (s *OrganizationsService) ListImmutableReleaseRepositoriesIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Repository, error] {\n\treturn func(yield func(*Repository, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListImmutableReleaseRepositories(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Repository\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Repositories\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListInstallationsIter returns an iterator that paginates through all results of ListInstallations.\nfunc (s *OrganizationsService) ListInstallationsIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Installation, error] {\n\treturn func(yield func(*Installation, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListInstallations(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Installation\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Installations\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListMembersIter returns an iterator that paginates through all results of ListMembers.\nfunc (s *OrganizationsService) ListMembersIter(ctx context.Context, org string, opts *ListMembersOptions) iter.Seq2[*User, error] {\n\treturn func(yield func(*User, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListMembersOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListMembers(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListNetworkConfigurationsIter returns an iterator that paginates through all results of ListNetworkConfigurations.\nfunc (s *OrganizationsService) ListNetworkConfigurationsIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*NetworkConfiguration, error] {\n\treturn func(yield func(*NetworkConfiguration, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListNetworkConfigurations(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*NetworkConfiguration\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.NetworkConfigurations\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListOrgInvitationTeamsIter returns an iterator that paginates through all results of ListOrgInvitationTeams.\nfunc (s *OrganizationsService) ListOrgInvitationTeamsIter(ctx context.Context, org string, invitationID string, opts *ListOptions) iter.Seq2[*Team, error] {\n\treturn func(yield func(*Team, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListOrgInvitationTeams(ctx, org, invitationID, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListOrgMembershipsIter returns an iterator that paginates through all results of ListOrgMemberships.\nfunc (s *OrganizationsService) ListOrgMembershipsIter(ctx context.Context, opts *ListOrgMembershipsOptions) iter.Seq2[*Membership, error] {\n\treturn func(yield func(*Membership, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOrgMembershipsOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListOrgMemberships(ctx, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListOutsideCollaboratorsIter returns an iterator that paginates through all results of ListOutsideCollaborators.\nfunc (s *OrganizationsService) ListOutsideCollaboratorsIter(ctx context.Context, org string, opts *ListOutsideCollaboratorsOptions) iter.Seq2[*User, error] {\n\treturn func(yield func(*User, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOutsideCollaboratorsOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListOutsideCollaborators(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListPackagesIter returns an iterator that paginates through all results of ListPackages.\nfunc (s *OrganizationsService) ListPackagesIter(ctx context.Context, org string, opts *PackageListOptions) iter.Seq2[*Package, error] {\n\treturn func(yield func(*Package, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &PackageListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListPackages(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListPendingOrgInvitationsIter returns an iterator that paginates through all results of ListPendingOrgInvitations.\nfunc (s *OrganizationsService) ListPendingOrgInvitationsIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Invitation, error] {\n\treturn func(yield func(*Invitation, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListPendingOrgInvitations(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListTeamsAssignedToOrgRoleIter returns an iterator that paginates through all results of ListTeamsAssignedToOrgRole.\nfunc (s *OrganizationsService) ListTeamsAssignedToOrgRoleIter(ctx context.Context, org string, roleID int64, opts *ListOptions) iter.Seq2[*Team, error] {\n\treturn func(yield func(*Team, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListTeamsAssignedToOrgRole(ctx, org, roleID, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListUsersAssignedToOrgRoleIter returns an iterator that paginates through all results of ListUsersAssignedToOrgRole.\nfunc (s *OrganizationsService) ListUsersAssignedToOrgRoleIter(ctx context.Context, org string, roleID int64, opts *ListOptions) iter.Seq2[*User, error] {\n\treturn func(yield func(*User, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListUsersAssignedToOrgRole(ctx, org, roleID, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListOrganizationPrivateRegistriesIter returns an iterator that paginates through all results of ListOrganizationPrivateRegistries.\nfunc (s *PrivateRegistriesService) ListOrganizationPrivateRegistriesIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*PrivateRegistry, error] {\n\treturn func(yield func(*PrivateRegistry, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListOrganizationPrivateRegistries(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*PrivateRegistry\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Configurations\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListOrganizationProjectFieldsIter returns an iterator that paginates through all results of ListOrganizationProjectFields.\nfunc (s *ProjectsService) ListOrganizationProjectFieldsIter(ctx context.Context, org string, projectNumber int, opts *ListProjectsOptions) iter.Seq2[*ProjectV2Field, error] {\n\treturn func(yield func(*ProjectV2Field, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListProjectsOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListOrganizationProjectFields(ctx, org, projectNumber, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.After == \"\" {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.After = resp.After\n\t\t}\n\t}\n}\n\n// ListOrganizationProjectItemsIter returns an iterator that paginates through all results of ListOrganizationProjectItems.\nfunc (s *ProjectsService) ListOrganizationProjectItemsIter(ctx context.Context, org string, projectNumber int, opts *ListProjectItemsOptions) iter.Seq2[*ProjectV2Item, error] {\n\treturn func(yield func(*ProjectV2Item, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListProjectItemsOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListOrganizationProjectItems(ctx, org, projectNumber, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.After == \"\" {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.After = resp.After\n\t\t}\n\t}\n}\n\n// ListOrganizationProjectsIter returns an iterator that paginates through all results of ListOrganizationProjects.\nfunc (s *ProjectsService) ListOrganizationProjectsIter(ctx context.Context, org string, opts *ListProjectsOptions) iter.Seq2[*ProjectV2, error] {\n\treturn func(yield func(*ProjectV2, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListProjectsOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListOrganizationProjects(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.After == \"\" {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.After = resp.After\n\t\t}\n\t}\n}\n\n// ListUserProjectFieldsIter returns an iterator that paginates through all results of ListUserProjectFields.\nfunc (s *ProjectsService) ListUserProjectFieldsIter(ctx context.Context, user string, projectNumber int, opts *ListProjectsOptions) iter.Seq2[*ProjectV2Field, error] {\n\treturn func(yield func(*ProjectV2Field, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListProjectsOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListUserProjectFields(ctx, user, projectNumber, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.After == \"\" {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.After = resp.After\n\t\t}\n\t}\n}\n\n// ListUserProjectItemsIter returns an iterator that paginates through all results of ListUserProjectItems.\nfunc (s *ProjectsService) ListUserProjectItemsIter(ctx context.Context, username string, projectNumber int, opts *ListProjectItemsOptions) iter.Seq2[*ProjectV2Item, error] {\n\treturn func(yield func(*ProjectV2Item, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListProjectItemsOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListUserProjectItems(ctx, username, projectNumber, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.After == \"\" {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.After = resp.After\n\t\t}\n\t}\n}\n\n// ListUserProjectsIter returns an iterator that paginates through all results of ListUserProjects.\nfunc (s *ProjectsService) ListUserProjectsIter(ctx context.Context, username string, opts *ListProjectsOptions) iter.Seq2[*ProjectV2, error] {\n\treturn func(yield func(*ProjectV2, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListProjectsOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListUserProjects(ctx, username, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.After == \"\" {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.After = resp.After\n\t\t}\n\t}\n}\n\n// ListIter returns an iterator that paginates through all results of List.\nfunc (s *PullRequestsService) ListIter(ctx context.Context, owner string, repo string, opts *PullRequestListOptions) iter.Seq2[*PullRequest, error] {\n\treturn func(yield func(*PullRequest, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &PullRequestListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.List(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListCommentsIter returns an iterator that paginates through all results of ListComments.\nfunc (s *PullRequestsService) ListCommentsIter(ctx context.Context, owner string, repo string, number int, opts *PullRequestListCommentsOptions) iter.Seq2[*PullRequestComment, error] {\n\treturn func(yield func(*PullRequestComment, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &PullRequestListCommentsOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListComments(ctx, owner, repo, number, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListCommitsIter returns an iterator that paginates through all results of ListCommits.\nfunc (s *PullRequestsService) ListCommitsIter(ctx context.Context, owner string, repo string, number int, opts *ListOptions) iter.Seq2[*RepositoryCommit, error] {\n\treturn func(yield func(*RepositoryCommit, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListCommits(ctx, owner, repo, number, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListFilesIter returns an iterator that paginates through all results of ListFiles.\nfunc (s *PullRequestsService) ListFilesIter(ctx context.Context, owner string, repo string, number int, opts *ListOptions) iter.Seq2[*CommitFile, error] {\n\treturn func(yield func(*CommitFile, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListFiles(ctx, owner, repo, number, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListPullRequestsWithCommitIter returns an iterator that paginates through all results of ListPullRequestsWithCommit.\nfunc (s *PullRequestsService) ListPullRequestsWithCommitIter(ctx context.Context, owner string, repo string, sha string, opts *ListOptions) iter.Seq2[*PullRequest, error] {\n\treturn func(yield func(*PullRequest, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListPullRequestsWithCommit(ctx, owner, repo, sha, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListReviewCommentsIter returns an iterator that paginates through all results of ListReviewComments.\nfunc (s *PullRequestsService) ListReviewCommentsIter(ctx context.Context, owner string, repo string, number int, reviewID int64, opts *ListOptions) iter.Seq2[*PullRequestComment, error] {\n\treturn func(yield func(*PullRequestComment, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListReviewComments(ctx, owner, repo, number, reviewID, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListReviewsIter returns an iterator that paginates through all results of ListReviews.\nfunc (s *PullRequestsService) ListReviewsIter(ctx context.Context, owner string, repo string, number int, opts *ListOptions) iter.Seq2[*PullRequestReview, error] {\n\treturn func(yield func(*PullRequestReview, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListReviews(ctx, owner, repo, number, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListCommentReactionsIter returns an iterator that paginates through all results of ListCommentReactions.\nfunc (s *ReactionsService) ListCommentReactionsIter(ctx context.Context, owner string, repo string, id int64, opts *ListReactionOptions) iter.Seq2[*Reaction, error] {\n\treturn func(yield func(*Reaction, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListReactionOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListCommentReactions(ctx, owner, repo, id, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListIssueCommentReactionsIter returns an iterator that paginates through all results of ListIssueCommentReactions.\nfunc (s *ReactionsService) ListIssueCommentReactionsIter(ctx context.Context, owner string, repo string, id int64, opts *ListReactionOptions) iter.Seq2[*Reaction, error] {\n\treturn func(yield func(*Reaction, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListReactionOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListIssueCommentReactions(ctx, owner, repo, id, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListIssueReactionsIter returns an iterator that paginates through all results of ListIssueReactions.\nfunc (s *ReactionsService) ListIssueReactionsIter(ctx context.Context, owner string, repo string, number int, opts *ListReactionOptions) iter.Seq2[*Reaction, error] {\n\treturn func(yield func(*Reaction, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListReactionOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListIssueReactions(ctx, owner, repo, number, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListPullRequestCommentReactionsIter returns an iterator that paginates through all results of ListPullRequestCommentReactions.\nfunc (s *ReactionsService) ListPullRequestCommentReactionsIter(ctx context.Context, owner string, repo string, id int64, opts *ListReactionOptions) iter.Seq2[*Reaction, error] {\n\treturn func(yield func(*Reaction, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListReactionOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListPullRequestCommentReactions(ctx, owner, repo, id, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListReleaseReactionsIter returns an iterator that paginates through all results of ListReleaseReactions.\nfunc (s *ReactionsService) ListReleaseReactionsIter(ctx context.Context, owner string, repo string, releaseID int64, opts *ListReactionOptions) iter.Seq2[*Reaction, error] {\n\treturn func(yield func(*Reaction, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListReactionOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListReleaseReactions(ctx, owner, repo, releaseID, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListTeamDiscussionCommentReactionsIter returns an iterator that paginates through all results of ListTeamDiscussionCommentReactions.\nfunc (s *ReactionsService) ListTeamDiscussionCommentReactionsIter(ctx context.Context, teamID int64, discussionNumber int, commentNumber int, opts *ListReactionOptions) iter.Seq2[*Reaction, error] {\n\treturn func(yield func(*Reaction, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListReactionOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListTeamDiscussionCommentReactions(ctx, teamID, discussionNumber, commentNumber, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListTeamDiscussionReactionsIter returns an iterator that paginates through all results of ListTeamDiscussionReactions.\nfunc (s *ReactionsService) ListTeamDiscussionReactionsIter(ctx context.Context, teamID int64, discussionNumber int, opts *ListReactionOptions) iter.Seq2[*Reaction, error] {\n\treturn func(yield func(*Reaction, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListReactionOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListTeamDiscussionReactions(ctx, teamID, discussionNumber, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListIter returns an iterator that paginates through all results of List.\nfunc (s *RepositoriesService) ListIter(ctx context.Context, user string, opts *RepositoryListOptions) iter.Seq2[*Repository, error] {\n\treturn func(yield func(*Repository, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &RepositoryListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.List(ctx, user, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListAllTopicsIter returns an iterator that paginates through all results of ListAllTopics.\nfunc (s *RepositoriesService) ListAllTopicsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[string, error] {\n\treturn func(yield func(string, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListAllTopics(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(*new(string), err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListAttestationsIter returns an iterator that paginates through all results of ListAttestations.\nfunc (s *RepositoriesService) ListAttestationsIter(ctx context.Context, owner string, repo string, subjectDigest string, opts *ListOptions) iter.Seq2[*Attestation, error] {\n\treturn func(yield func(*Attestation, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListAttestations(ctx, owner, repo, subjectDigest, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Attestation\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Attestations\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListBranchesIter returns an iterator that paginates through all results of ListBranches.\nfunc (s *RepositoriesService) ListBranchesIter(ctx context.Context, owner string, repo string, opts *BranchListOptions) iter.Seq2[*Branch, error] {\n\treturn func(yield func(*Branch, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &BranchListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListBranches(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListByAuthenticatedUserIter returns an iterator that paginates through all results of ListByAuthenticatedUser.\nfunc (s *RepositoriesService) ListByAuthenticatedUserIter(ctx context.Context, opts *RepositoryListByAuthenticatedUserOptions) iter.Seq2[*Repository, error] {\n\treturn func(yield func(*Repository, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &RepositoryListByAuthenticatedUserOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListByAuthenticatedUser(ctx, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListByOrgIter returns an iterator that paginates through all results of ListByOrg.\nfunc (s *RepositoriesService) ListByOrgIter(ctx context.Context, org string, opts *RepositoryListByOrgOptions) iter.Seq2[*Repository, error] {\n\treturn func(yield func(*Repository, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &RepositoryListByOrgOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListByOrg(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListByUserIter returns an iterator that paginates through all results of ListByUser.\nfunc (s *RepositoriesService) ListByUserIter(ctx context.Context, user string, opts *RepositoryListByUserOptions) iter.Seq2[*Repository, error] {\n\treturn func(yield func(*Repository, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &RepositoryListByUserOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListByUser(ctx, user, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListCollaboratorsIter returns an iterator that paginates through all results of ListCollaborators.\nfunc (s *RepositoriesService) ListCollaboratorsIter(ctx context.Context, owner string, repo string, opts *ListCollaboratorsOptions) iter.Seq2[*User, error] {\n\treturn func(yield func(*User, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListCollaboratorsOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListCollaborators(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListCommentsIter returns an iterator that paginates through all results of ListComments.\nfunc (s *RepositoriesService) ListCommentsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*RepositoryComment, error] {\n\treturn func(yield func(*RepositoryComment, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListComments(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListCommitCommentsIter returns an iterator that paginates through all results of ListCommitComments.\nfunc (s *RepositoriesService) ListCommitCommentsIter(ctx context.Context, owner string, repo string, sha string, opts *ListOptions) iter.Seq2[*RepositoryComment, error] {\n\treturn func(yield func(*RepositoryComment, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListCommitComments(ctx, owner, repo, sha, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListCommitsIter returns an iterator that paginates through all results of ListCommits.\nfunc (s *RepositoriesService) ListCommitsIter(ctx context.Context, owner string, repo string, opts *CommitsListOptions) iter.Seq2[*RepositoryCommit, error] {\n\treturn func(yield func(*RepositoryCommit, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &CommitsListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListCommits(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListContributorsIter returns an iterator that paginates through all results of ListContributors.\nfunc (s *RepositoriesService) ListContributorsIter(ctx context.Context, owner string, repository string, opts *ListContributorsOptions) iter.Seq2[*Contributor, error] {\n\treturn func(yield func(*Contributor, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListContributorsOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListContributors(ctx, owner, repository, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListCustomDeploymentRuleIntegrationsIter returns an iterator that paginates through all results of ListCustomDeploymentRuleIntegrations.\nfunc (s *RepositoriesService) ListCustomDeploymentRuleIntegrationsIter(ctx context.Context, owner string, repo string, environment string, opts *ListOptions) iter.Seq2[*CustomDeploymentProtectionRuleApp, error] {\n\treturn func(yield func(*CustomDeploymentProtectionRuleApp, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListCustomDeploymentRuleIntegrations(ctx, owner, repo, environment, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*CustomDeploymentProtectionRuleApp\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.AvailableIntegrations\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListDeploymentBranchPoliciesIter returns an iterator that paginates through all results of ListDeploymentBranchPolicies.\nfunc (s *RepositoriesService) ListDeploymentBranchPoliciesIter(ctx context.Context, owner string, repo string, environment string, opts *ListOptions) iter.Seq2[*DeploymentBranchPolicy, error] {\n\treturn func(yield func(*DeploymentBranchPolicy, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListDeploymentBranchPolicies(ctx, owner, repo, environment, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*DeploymentBranchPolicy\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.BranchPolicies\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListDeploymentStatusesIter returns an iterator that paginates through all results of ListDeploymentStatuses.\nfunc (s *RepositoriesService) ListDeploymentStatusesIter(ctx context.Context, owner string, repo string, deployment int64, opts *ListOptions) iter.Seq2[*DeploymentStatus, error] {\n\treturn func(yield func(*DeploymentStatus, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListDeploymentStatuses(ctx, owner, repo, deployment, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListDeploymentsIter returns an iterator that paginates through all results of ListDeployments.\nfunc (s *RepositoriesService) ListDeploymentsIter(ctx context.Context, owner string, repo string, opts *DeploymentsListOptions) iter.Seq2[*Deployment, error] {\n\treturn func(yield func(*Deployment, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &DeploymentsListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListDeployments(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListEnvironmentsIter returns an iterator that paginates through all results of ListEnvironments.\nfunc (s *RepositoriesService) ListEnvironmentsIter(ctx context.Context, owner string, repo string, opts *EnvironmentListOptions) iter.Seq2[*Environment, error] {\n\treturn func(yield func(*Environment, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &EnvironmentListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListEnvironments(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Environment\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Environments\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListForksIter returns an iterator that paginates through all results of ListForks.\nfunc (s *RepositoriesService) ListForksIter(ctx context.Context, owner string, repo string, opts *RepositoryListForksOptions) iter.Seq2[*Repository, error] {\n\treturn func(yield func(*Repository, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &RepositoryListForksOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListForks(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListHookDeliveriesIter returns an iterator that paginates through all results of ListHookDeliveries.\nfunc (s *RepositoriesService) ListHookDeliveriesIter(ctx context.Context, owner string, repo string, id int64, opts *ListCursorOptions) iter.Seq2[*HookDelivery, error] {\n\treturn func(yield func(*HookDelivery, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListCursorOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListHookDeliveries(ctx, owner, repo, id, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.Cursor == \"\" {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Cursor = resp.Cursor\n\t\t}\n\t}\n}\n\n// ListHooksIter returns an iterator that paginates through all results of ListHooks.\nfunc (s *RepositoriesService) ListHooksIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Hook, error] {\n\treturn func(yield func(*Hook, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListHooks(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListInvitationsIter returns an iterator that paginates through all results of ListInvitations.\nfunc (s *RepositoriesService) ListInvitationsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*RepositoryInvitation, error] {\n\treturn func(yield func(*RepositoryInvitation, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListInvitations(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListKeysIter returns an iterator that paginates through all results of ListKeys.\nfunc (s *RepositoriesService) ListKeysIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Key, error] {\n\treturn func(yield func(*Key, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListKeys(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListPagesBuildsIter returns an iterator that paginates through all results of ListPagesBuilds.\nfunc (s *RepositoriesService) ListPagesBuildsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*PagesBuild, error] {\n\treturn func(yield func(*PagesBuild, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListPagesBuilds(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListPreReceiveHooksIter returns an iterator that paginates through all results of ListPreReceiveHooks.\nfunc (s *RepositoriesService) ListPreReceiveHooksIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*PreReceiveHook, error] {\n\treturn func(yield func(*PreReceiveHook, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListPreReceiveHooks(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListReleaseAssetsIter returns an iterator that paginates through all results of ListReleaseAssets.\nfunc (s *RepositoriesService) ListReleaseAssetsIter(ctx context.Context, owner string, repo string, id int64, opts *ListOptions) iter.Seq2[*ReleaseAsset, error] {\n\treturn func(yield func(*ReleaseAsset, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListReleaseAssets(ctx, owner, repo, id, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListReleasesIter returns an iterator that paginates through all results of ListReleases.\nfunc (s *RepositoriesService) ListReleasesIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*RepositoryRelease, error] {\n\treturn func(yield func(*RepositoryRelease, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListReleases(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListRepositoryActivitiesIter returns an iterator that paginates through all results of ListRepositoryActivities.\nfunc (s *RepositoriesService) ListRepositoryActivitiesIter(ctx context.Context, owner string, repo string, opts *ListRepositoryActivityOptions) iter.Seq2[*RepositoryActivity, error] {\n\treturn func(yield func(*RepositoryActivity, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListRepositoryActivityOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListRepositoryActivities(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.After == \"\" {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.After = resp.After\n\t\t}\n\t}\n}\n\n// ListStatusesIter returns an iterator that paginates through all results of ListStatuses.\nfunc (s *RepositoriesService) ListStatusesIter(ctx context.Context, owner string, repo string, ref string, opts *ListOptions) iter.Seq2[*RepoStatus, error] {\n\treturn func(yield func(*RepoStatus, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListStatuses(ctx, owner, repo, ref, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListTagsIter returns an iterator that paginates through all results of ListTags.\nfunc (s *RepositoriesService) ListTagsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*RepositoryTag, error] {\n\treturn func(yield func(*RepositoryTag, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListTags(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListTeamsIter returns an iterator that paginates through all results of ListTeams.\nfunc (s *RepositoriesService) ListTeamsIter(ctx context.Context, owner string, repo string, opts *ListOptions) iter.Seq2[*Team, error] {\n\treturn func(yield func(*Team, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListTeams(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListAlertsForEnterpriseIter returns an iterator that paginates through all results of ListAlertsForEnterprise.\nfunc (s *SecretScanningService) ListAlertsForEnterpriseIter(ctx context.Context, enterprise string, opts *SecretScanningAlertListOptions) iter.Seq2[*SecretScanningAlert, error] {\n\treturn func(yield func(*SecretScanningAlert, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &SecretScanningAlertListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListAlertsForEnterprise(ctx, enterprise, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.After == \"\" && resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListCursorOptions.After = resp.After\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListAlertsForOrgIter returns an iterator that paginates through all results of ListAlertsForOrg.\nfunc (s *SecretScanningService) ListAlertsForOrgIter(ctx context.Context, org string, opts *SecretScanningAlertListOptions) iter.Seq2[*SecretScanningAlert, error] {\n\treturn func(yield func(*SecretScanningAlert, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &SecretScanningAlertListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListAlertsForOrg(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.After == \"\" && resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListCursorOptions.After = resp.After\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListAlertsForRepoIter returns an iterator that paginates through all results of ListAlertsForRepo.\nfunc (s *SecretScanningService) ListAlertsForRepoIter(ctx context.Context, owner string, repo string, opts *SecretScanningAlertListOptions) iter.Seq2[*SecretScanningAlert, error] {\n\treturn func(yield func(*SecretScanningAlert, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &SecretScanningAlertListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListAlertsForRepo(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.After == \"\" && resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListCursorOptions.After = resp.After\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListLocationsForAlertIter returns an iterator that paginates through all results of ListLocationsForAlert.\nfunc (s *SecretScanningService) ListLocationsForAlertIter(ctx context.Context, owner string, repo string, number int64, opts *ListOptions) iter.Seq2[*SecretScanningAlertLocation, error] {\n\treturn func(yield func(*SecretScanningAlertLocation, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListLocationsForAlert(ctx, owner, repo, number, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListGlobalSecurityAdvisoriesIter returns an iterator that paginates through all results of ListGlobalSecurityAdvisories.\nfunc (s *SecurityAdvisoriesService) ListGlobalSecurityAdvisoriesIter(ctx context.Context, opts *ListGlobalSecurityAdvisoriesOptions) iter.Seq2[*GlobalSecurityAdvisory, error] {\n\treturn func(yield func(*GlobalSecurityAdvisory, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListGlobalSecurityAdvisoriesOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListGlobalSecurityAdvisories(ctx, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.After == \"\" {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListCursorOptions.After = resp.After\n\t\t}\n\t}\n}\n\n// ListRepositorySecurityAdvisoriesIter returns an iterator that paginates through all results of ListRepositorySecurityAdvisories.\nfunc (s *SecurityAdvisoriesService) ListRepositorySecurityAdvisoriesIter(ctx context.Context, owner string, repo string, opts *ListRepositorySecurityAdvisoriesOptions) iter.Seq2[*SecurityAdvisory, error] {\n\treturn func(yield func(*SecurityAdvisory, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListRepositorySecurityAdvisoriesOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListRepositorySecurityAdvisories(ctx, owner, repo, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.After == \"\" {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListCursorOptions.After = resp.After\n\t\t}\n\t}\n}\n\n// ListRepositorySecurityAdvisoriesForOrgIter returns an iterator that paginates through all results of ListRepositorySecurityAdvisoriesForOrg.\nfunc (s *SecurityAdvisoriesService) ListRepositorySecurityAdvisoriesForOrgIter(ctx context.Context, org string, opts *ListRepositorySecurityAdvisoriesOptions) iter.Seq2[*SecurityAdvisory, error] {\n\treturn func(yield func(*SecurityAdvisory, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListRepositorySecurityAdvisoriesOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListRepositorySecurityAdvisoriesForOrg(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.After == \"\" {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListCursorOptions.After = resp.After\n\t\t}\n\t}\n}\n\n// ListByIssueIter returns an iterator that paginates through all results of ListByIssue.\nfunc (s *SubIssueService) ListByIssueIter(ctx context.Context, owner string, repo string, issueNumber int64, opts *ListOptions) iter.Seq2[*SubIssue, error] {\n\treturn func(yield func(*SubIssue, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListByIssue(ctx, owner, repo, issueNumber, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListChildTeamsByParentIDIter returns an iterator that paginates through all results of ListChildTeamsByParentID.\nfunc (s *TeamsService) ListChildTeamsByParentIDIter(ctx context.Context, orgID int64, teamID int64, opts *ListOptions) iter.Seq2[*Team, error] {\n\treturn func(yield func(*Team, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListChildTeamsByParentID(ctx, orgID, teamID, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListChildTeamsByParentSlugIter returns an iterator that paginates through all results of ListChildTeamsByParentSlug.\nfunc (s *TeamsService) ListChildTeamsByParentSlugIter(ctx context.Context, org string, slug string, opts *ListOptions) iter.Seq2[*Team, error] {\n\treturn func(yield func(*Team, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListChildTeamsByParentSlug(ctx, org, slug, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListCommentsByIDIter returns an iterator that paginates through all results of ListCommentsByID.\nfunc (s *TeamsService) ListCommentsByIDIter(ctx context.Context, orgID int64, teamID int64, discussionNumber int, options *DiscussionCommentListOptions) iter.Seq2[*DiscussionComment, error] {\n\treturn func(yield func(*DiscussionComment, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif options == nil {\n\t\t\toptions = &DiscussionCommentListOptions{}\n\t\t} else {\n\t\t\toptions = Ptr(*options)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListCommentsByID(ctx, orgID, teamID, discussionNumber, options)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\toptions.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListCommentsBySlugIter returns an iterator that paginates through all results of ListCommentsBySlug.\nfunc (s *TeamsService) ListCommentsBySlugIter(ctx context.Context, org string, slug string, discussionNumber int, options *DiscussionCommentListOptions) iter.Seq2[*DiscussionComment, error] {\n\treturn func(yield func(*DiscussionComment, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif options == nil {\n\t\t\toptions = &DiscussionCommentListOptions{}\n\t\t} else {\n\t\t\toptions = Ptr(*options)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListCommentsBySlug(ctx, org, slug, discussionNumber, options)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\toptions.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListDiscussionsByIDIter returns an iterator that paginates through all results of ListDiscussionsByID.\nfunc (s *TeamsService) ListDiscussionsByIDIter(ctx context.Context, orgID int64, teamID int64, opts *DiscussionListOptions) iter.Seq2[*TeamDiscussion, error] {\n\treturn func(yield func(*TeamDiscussion, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &DiscussionListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListDiscussionsByID(ctx, orgID, teamID, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListDiscussionsBySlugIter returns an iterator that paginates through all results of ListDiscussionsBySlug.\nfunc (s *TeamsService) ListDiscussionsBySlugIter(ctx context.Context, org string, slug string, opts *DiscussionListOptions) iter.Seq2[*TeamDiscussion, error] {\n\treturn func(yield func(*TeamDiscussion, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &DiscussionListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListDiscussionsBySlug(ctx, org, slug, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListExternalGroupsIter returns an iterator that paginates through all results of ListExternalGroups.\nfunc (s *TeamsService) ListExternalGroupsIter(ctx context.Context, org string, opts *ListExternalGroupsOptions) iter.Seq2[*ExternalGroup, error] {\n\treturn func(yield func(*ExternalGroup, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListExternalGroupsOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListExternalGroups(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*ExternalGroup\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Groups\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListIDPGroupsInOrganizationIter returns an iterator that paginates through all results of ListIDPGroupsInOrganization.\nfunc (s *TeamsService) ListIDPGroupsInOrganizationIter(ctx context.Context, org string, opts *ListIDPGroupsOptions) iter.Seq2[*IDPGroup, error] {\n\treturn func(yield func(*IDPGroup, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListIDPGroupsOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListIDPGroupsInOrganization(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*IDPGroup\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Groups\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.After == \"\" {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListCursorOptions.After = resp.After\n\t\t}\n\t}\n}\n\n// ListPendingTeamInvitationsByIDIter returns an iterator that paginates through all results of ListPendingTeamInvitationsByID.\nfunc (s *TeamsService) ListPendingTeamInvitationsByIDIter(ctx context.Context, orgID int64, teamID int64, opts *ListOptions) iter.Seq2[*Invitation, error] {\n\treturn func(yield func(*Invitation, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListPendingTeamInvitationsByID(ctx, orgID, teamID, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListPendingTeamInvitationsBySlugIter returns an iterator that paginates through all results of ListPendingTeamInvitationsBySlug.\nfunc (s *TeamsService) ListPendingTeamInvitationsBySlugIter(ctx context.Context, org string, slug string, opts *ListOptions) iter.Seq2[*Invitation, error] {\n\treturn func(yield func(*Invitation, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListPendingTeamInvitationsBySlug(ctx, org, slug, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListTeamMembersByIDIter returns an iterator that paginates through all results of ListTeamMembersByID.\nfunc (s *TeamsService) ListTeamMembersByIDIter(ctx context.Context, orgID int64, teamID int64, opts *TeamListTeamMembersOptions) iter.Seq2[*User, error] {\n\treturn func(yield func(*User, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &TeamListTeamMembersOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListTeamMembersByID(ctx, orgID, teamID, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListTeamMembersBySlugIter returns an iterator that paginates through all results of ListTeamMembersBySlug.\nfunc (s *TeamsService) ListTeamMembersBySlugIter(ctx context.Context, org string, slug string, opts *TeamListTeamMembersOptions) iter.Seq2[*User, error] {\n\treturn func(yield func(*User, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &TeamListTeamMembersOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListTeamMembersBySlug(ctx, org, slug, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListTeamReposByIDIter returns an iterator that paginates through all results of ListTeamReposByID.\nfunc (s *TeamsService) ListTeamReposByIDIter(ctx context.Context, orgID int64, teamID int64, opts *ListOptions) iter.Seq2[*Repository, error] {\n\treturn func(yield func(*Repository, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListTeamReposByID(ctx, orgID, teamID, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListTeamReposBySlugIter returns an iterator that paginates through all results of ListTeamReposBySlug.\nfunc (s *TeamsService) ListTeamReposBySlugIter(ctx context.Context, org string, slug string, opts *ListOptions) iter.Seq2[*Repository, error] {\n\treturn func(yield func(*Repository, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListTeamReposBySlug(ctx, org, slug, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListTeamsIter returns an iterator that paginates through all results of ListTeams.\nfunc (s *TeamsService) ListTeamsIter(ctx context.Context, org string, opts *ListOptions) iter.Seq2[*Team, error] {\n\treturn func(yield func(*Team, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListTeams(ctx, org, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListUserTeamsIter returns an iterator that paginates through all results of ListUserTeams.\nfunc (s *TeamsService) ListUserTeamsIter(ctx context.Context, opts *ListOptions) iter.Seq2[*Team, error] {\n\treturn func(yield func(*Team, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListUserTeams(ctx, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListAttestationsIter returns an iterator that paginates through all results of ListAttestations.\nfunc (s *UsersService) ListAttestationsIter(ctx context.Context, user string, subjectDigest string, opts *ListOptions) iter.Seq2[*Attestation, error] {\n\treturn func(yield func(*Attestation, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListAttestations(ctx, user, subjectDigest, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvar iterItems []*Attestation\n\t\t\tif results != nil {\n\t\t\t\titerItems = results.Attestations\n\t\t\t}\n\t\t\tfor _, item := range iterItems {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListBlockedUsersIter returns an iterator that paginates through all results of ListBlockedUsers.\nfunc (s *UsersService) ListBlockedUsersIter(ctx context.Context, opts *ListOptions) iter.Seq2[*User, error] {\n\treturn func(yield func(*User, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListBlockedUsers(ctx, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListEmailsIter returns an iterator that paginates through all results of ListEmails.\nfunc (s *UsersService) ListEmailsIter(ctx context.Context, opts *ListOptions) iter.Seq2[*UserEmail, error] {\n\treturn func(yield func(*UserEmail, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListEmails(ctx, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListFollowersIter returns an iterator that paginates through all results of ListFollowers.\nfunc (s *UsersService) ListFollowersIter(ctx context.Context, user string, opts *ListOptions) iter.Seq2[*User, error] {\n\treturn func(yield func(*User, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListFollowers(ctx, user, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListFollowingIter returns an iterator that paginates through all results of ListFollowing.\nfunc (s *UsersService) ListFollowingIter(ctx context.Context, user string, opts *ListOptions) iter.Seq2[*User, error] {\n\treturn func(yield func(*User, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListFollowing(ctx, user, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListGPGKeysIter returns an iterator that paginates through all results of ListGPGKeys.\nfunc (s *UsersService) ListGPGKeysIter(ctx context.Context, user string, opts *ListOptions) iter.Seq2[*GPGKey, error] {\n\treturn func(yield func(*GPGKey, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListGPGKeys(ctx, user, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListInvitationsIter returns an iterator that paginates through all results of ListInvitations.\nfunc (s *UsersService) ListInvitationsIter(ctx context.Context, opts *ListOptions) iter.Seq2[*RepositoryInvitation, error] {\n\treturn func(yield func(*RepositoryInvitation, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListInvitations(ctx, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListKeysIter returns an iterator that paginates through all results of ListKeys.\nfunc (s *UsersService) ListKeysIter(ctx context.Context, user string, opts *ListOptions) iter.Seq2[*Key, error] {\n\treturn func(yield func(*Key, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListKeys(ctx, user, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListPackageVersionsIter returns an iterator that paginates through all results of ListPackageVersions.\nfunc (s *UsersService) ListPackageVersionsIter(ctx context.Context, packageType string, packageName string, opts *ListPackageVersionsOptions) iter.Seq2[*PackageVersion, error] {\n\treturn func(yield func(*PackageVersion, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListPackageVersionsOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListPackageVersions(ctx, packageType, packageName, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListPackagesIter returns an iterator that paginates through all results of ListPackages.\nfunc (s *UsersService) ListPackagesIter(ctx context.Context, user string, opts *PackageListOptions) iter.Seq2[*Package, error] {\n\treturn func(yield func(*Package, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &PackageListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListPackages(ctx, user, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.ListOptions.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListSSHSigningKeysIter returns an iterator that paginates through all results of ListSSHSigningKeys.\nfunc (s *UsersService) ListSSHSigningKeysIter(ctx context.Context, user string, opts *ListOptions) iter.Seq2[*SSHSigningKey, error] {\n\treturn func(yield func(*SSHSigningKey, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListSSHSigningKeys(ctx, user, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListSocialAccountsIter returns an iterator that paginates through all results of ListSocialAccounts.\nfunc (s *UsersService) ListSocialAccountsIter(ctx context.Context, opts *ListOptions) iter.Seq2[*SocialAccount, error] {\n\treturn func(yield func(*SocialAccount, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListSocialAccounts(ctx, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n\n// ListUserSocialAccountsIter returns an iterator that paginates through all results of ListUserSocialAccounts.\nfunc (s *UsersService) ListUserSocialAccountsIter(ctx context.Context, username string, opts *ListOptions) iter.Seq2[*SocialAccount, error] {\n\treturn func(yield func(*SocialAccount, error) bool) {\n\t\t// Create a copy of opts to avoid mutating the caller's struct\n\t\tif opts == nil {\n\t\t\topts = &ListOptions{}\n\t\t} else {\n\t\t\topts = Ptr(*opts)\n\t\t}\n\n\t\tfor {\n\t\t\tresults, resp, err := s.ListUserSocialAccounts(ctx, username, opts)\n\t\t\tif err != nil {\n\t\t\t\tyield(nil, err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tfor _, item := range results {\n\t\t\t\tif !yield(item, nil) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif resp.NextPage == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\topts.Page = resp.NextPage\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "github/github-iterators_test.go",
    "content": "// Code generated by gen-iterators; DO NOT EDIT.\n// Instead, please run \"go generate ./...\" as described here:\n// https://github.com/google/go-github/blob/master/CONTRIBUTING.md#submitting-a-patch\n\n// Copyright 2026 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n)\n\nfunc TestActionsService_ListArtifactsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"artifacts\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"artifacts\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"artifacts\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"artifacts\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListArtifactsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListArtifactsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListArtifactsOptions{}\n\titer = client.Actions.ListArtifactsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListArtifactsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListArtifactsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListArtifactsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListArtifactsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Artifact, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListArtifactsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActionsService_ListCacheUsageByRepoForOrgIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"repository_cache_usages\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"repository_cache_usages\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"repository_cache_usages\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"repository_cache_usages\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListCacheUsageByRepoForOrgIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListCacheUsageByRepoForOrgIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Actions.ListCacheUsageByRepoForOrgIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListCacheUsageByRepoForOrgIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListCacheUsageByRepoForOrgIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListCacheUsageByRepoForOrgIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListCacheUsageByRepoForOrgIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *ActionsCacheUsage, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListCacheUsageByRepoForOrgIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActionsService_ListCachesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"actions_caches\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"actions_caches\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"actions_caches\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"actions_caches\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListCachesIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListCachesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ActionsCacheListOptions{}\n\titer = client.Actions.ListCachesIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListCachesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListCachesIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListCachesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListCachesIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *ActionsCache, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListCachesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActionsService_ListEnabledOrgsInEnterpriseIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"organizations\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"organizations\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"organizations\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"organizations\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListEnabledOrgsInEnterpriseIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListEnabledOrgsInEnterpriseIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Actions.ListEnabledOrgsInEnterpriseIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListEnabledOrgsInEnterpriseIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListEnabledOrgsInEnterpriseIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListEnabledOrgsInEnterpriseIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListEnabledOrgsInEnterpriseIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *Organization, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListEnabledOrgsInEnterpriseIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActionsService_ListEnabledReposInOrgIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListEnabledReposInOrgIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListEnabledReposInOrgIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Actions.ListEnabledReposInOrgIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListEnabledReposInOrgIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListEnabledReposInOrgIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListEnabledReposInOrgIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListEnabledReposInOrgIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *Repository, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListEnabledReposInOrgIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActionsService_ListEnvSecretsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListEnvSecretsIter(t.Context(), 0, \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListEnvSecretsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Actions.ListEnvSecretsIter(t.Context(), 0, \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListEnvSecretsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListEnvSecretsIter(t.Context(), 0, \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListEnvSecretsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListEnvSecretsIter(t.Context(), 0, \"\", nil)\n\tgotItems = 0\n\titer(func(item *Secret, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListEnvSecretsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActionsService_ListEnvVariablesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"variables\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"variables\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"variables\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"variables\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListEnvVariablesIter(t.Context(), \"\", \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListEnvVariablesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Actions.ListEnvVariablesIter(t.Context(), \"\", \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListEnvVariablesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListEnvVariablesIter(t.Context(), \"\", \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListEnvVariablesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListEnvVariablesIter(t.Context(), \"\", \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *ActionsVariable, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListEnvVariablesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActionsService_ListHostedRunnersIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListHostedRunnersIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListHostedRunnersIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Actions.ListHostedRunnersIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListHostedRunnersIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListHostedRunnersIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListHostedRunnersIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListHostedRunnersIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *HostedRunner, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListHostedRunnersIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActionsService_ListOrgSecretsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListOrgSecretsIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListOrgSecretsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Actions.ListOrgSecretsIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListOrgSecretsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListOrgSecretsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListOrgSecretsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListOrgSecretsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *Secret, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListOrgSecretsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActionsService_ListOrgVariablesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"variables\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"variables\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"variables\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"variables\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListOrgVariablesIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListOrgVariablesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Actions.ListOrgVariablesIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListOrgVariablesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListOrgVariablesIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListOrgVariablesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListOrgVariablesIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *ActionsVariable, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListOrgVariablesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActionsService_ListOrganizationRunnerGroupsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"runner_groups\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"runner_groups\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"runner_groups\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"runner_groups\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListOrganizationRunnerGroupsIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListOrganizationRunnerGroupsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOrgRunnerGroupOptions{}\n\titer = client.Actions.ListOrganizationRunnerGroupsIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListOrganizationRunnerGroupsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListOrganizationRunnerGroupsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListOrganizationRunnerGroupsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListOrganizationRunnerGroupsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *RunnerGroup, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListOrganizationRunnerGroupsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActionsService_ListOrganizationRunnersIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListOrganizationRunnersIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListOrganizationRunnersIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListRunnersOptions{}\n\titer = client.Actions.ListOrganizationRunnersIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListOrganizationRunnersIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListOrganizationRunnersIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListOrganizationRunnersIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListOrganizationRunnersIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *Runner, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListOrganizationRunnersIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActionsService_ListRepoOrgSecretsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListRepoOrgSecretsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListRepoOrgSecretsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Actions.ListRepoOrgSecretsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListRepoOrgSecretsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListRepoOrgSecretsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListRepoOrgSecretsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListRepoOrgSecretsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Secret, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListRepoOrgSecretsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActionsService_ListRepoOrgVariablesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"variables\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"variables\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"variables\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"variables\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListRepoOrgVariablesIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListRepoOrgVariablesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Actions.ListRepoOrgVariablesIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListRepoOrgVariablesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListRepoOrgVariablesIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListRepoOrgVariablesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListRepoOrgVariablesIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *ActionsVariable, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListRepoOrgVariablesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActionsService_ListRepoSecretsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListRepoSecretsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListRepoSecretsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Actions.ListRepoSecretsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListRepoSecretsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListRepoSecretsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListRepoSecretsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListRepoSecretsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Secret, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListRepoSecretsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActionsService_ListRepoVariablesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"variables\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"variables\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"variables\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"variables\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListRepoVariablesIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListRepoVariablesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Actions.ListRepoVariablesIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListRepoVariablesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListRepoVariablesIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListRepoVariablesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListRepoVariablesIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *ActionsVariable, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListRepoVariablesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActionsService_ListRepositoriesSelfHostedRunnersAllowedInOrganizationIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListRepositoriesSelfHostedRunnersAllowedInOrganizationIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListRepositoriesSelfHostedRunnersAllowedInOrganizationIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Actions.ListRepositoriesSelfHostedRunnersAllowedInOrganizationIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListRepositoriesSelfHostedRunnersAllowedInOrganizationIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListRepositoriesSelfHostedRunnersAllowedInOrganizationIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListRepositoriesSelfHostedRunnersAllowedInOrganizationIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListRepositoriesSelfHostedRunnersAllowedInOrganizationIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *Repository, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListRepositoriesSelfHostedRunnersAllowedInOrganizationIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActionsService_ListRepositoryAccessRunnerGroupIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListRepositoryAccessRunnerGroupIter(t.Context(), \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListRepositoryAccessRunnerGroupIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Actions.ListRepositoryAccessRunnerGroupIter(t.Context(), \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListRepositoryAccessRunnerGroupIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListRepositoryAccessRunnerGroupIter(t.Context(), \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListRepositoryAccessRunnerGroupIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListRepositoryAccessRunnerGroupIter(t.Context(), \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *Repository, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListRepositoryAccessRunnerGroupIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActionsService_ListRepositoryWorkflowRunsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"workflow_runs\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"workflow_runs\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"workflow_runs\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"workflow_runs\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListRepositoryWorkflowRunsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListRepositoryWorkflowRunsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListWorkflowRunsOptions{}\n\titer = client.Actions.ListRepositoryWorkflowRunsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListRepositoryWorkflowRunsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListRepositoryWorkflowRunsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListRepositoryWorkflowRunsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListRepositoryWorkflowRunsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *WorkflowRun, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListRepositoryWorkflowRunsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActionsService_ListRunnerGroupHostedRunnersIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListRunnerGroupHostedRunnersIter(t.Context(), \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListRunnerGroupHostedRunnersIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Actions.ListRunnerGroupHostedRunnersIter(t.Context(), \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListRunnerGroupHostedRunnersIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListRunnerGroupHostedRunnersIter(t.Context(), \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListRunnerGroupHostedRunnersIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListRunnerGroupHostedRunnersIter(t.Context(), \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *HostedRunner, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListRunnerGroupHostedRunnersIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActionsService_ListRunnerGroupRunnersIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListRunnerGroupRunnersIter(t.Context(), \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListRunnerGroupRunnersIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Actions.ListRunnerGroupRunnersIter(t.Context(), \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListRunnerGroupRunnersIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListRunnerGroupRunnersIter(t.Context(), \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListRunnerGroupRunnersIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListRunnerGroupRunnersIter(t.Context(), \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *Runner, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListRunnerGroupRunnersIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActionsService_ListRunnersIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListRunnersIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListRunnersIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListRunnersOptions{}\n\titer = client.Actions.ListRunnersIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListRunnersIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListRunnersIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListRunnersIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListRunnersIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Runner, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListRunnersIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActionsService_ListSelectedReposForOrgSecretIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListSelectedReposForOrgSecretIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListSelectedReposForOrgSecretIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Actions.ListSelectedReposForOrgSecretIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListSelectedReposForOrgSecretIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListSelectedReposForOrgSecretIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListSelectedReposForOrgSecretIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListSelectedReposForOrgSecretIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Repository, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListSelectedReposForOrgSecretIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActionsService_ListSelectedReposForOrgVariableIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListSelectedReposForOrgVariableIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListSelectedReposForOrgVariableIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Actions.ListSelectedReposForOrgVariableIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListSelectedReposForOrgVariableIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListSelectedReposForOrgVariableIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListSelectedReposForOrgVariableIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListSelectedReposForOrgVariableIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Repository, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListSelectedReposForOrgVariableIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActionsService_ListWorkflowJobsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"jobs\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"jobs\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"jobs\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"jobs\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListWorkflowJobsIter(t.Context(), \"\", \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListWorkflowJobsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListWorkflowJobsOptions{}\n\titer = client.Actions.ListWorkflowJobsIter(t.Context(), \"\", \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListWorkflowJobsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListWorkflowJobsIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListWorkflowJobsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListWorkflowJobsIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *WorkflowJob, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListWorkflowJobsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActionsService_ListWorkflowJobsAttemptIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"jobs\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"jobs\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"jobs\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"jobs\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListWorkflowJobsAttemptIter(t.Context(), \"\", \"\", 0, 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListWorkflowJobsAttemptIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Actions.ListWorkflowJobsAttemptIter(t.Context(), \"\", \"\", 0, 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListWorkflowJobsAttemptIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListWorkflowJobsAttemptIter(t.Context(), \"\", \"\", 0, 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListWorkflowJobsAttemptIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListWorkflowJobsAttemptIter(t.Context(), \"\", \"\", 0, 0, nil)\n\tgotItems = 0\n\titer(func(item *WorkflowJob, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListWorkflowJobsAttemptIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActionsService_ListWorkflowRunArtifactsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"artifacts\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"artifacts\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"artifacts\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"artifacts\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListWorkflowRunArtifactsIter(t.Context(), \"\", \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListWorkflowRunArtifactsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Actions.ListWorkflowRunArtifactsIter(t.Context(), \"\", \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListWorkflowRunArtifactsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListWorkflowRunArtifactsIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListWorkflowRunArtifactsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListWorkflowRunArtifactsIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *Artifact, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListWorkflowRunArtifactsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActionsService_ListWorkflowRunsByFileNameIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"workflow_runs\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"workflow_runs\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"workflow_runs\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"workflow_runs\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListWorkflowRunsByFileNameIter(t.Context(), \"\", \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListWorkflowRunsByFileNameIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListWorkflowRunsOptions{}\n\titer = client.Actions.ListWorkflowRunsByFileNameIter(t.Context(), \"\", \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListWorkflowRunsByFileNameIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListWorkflowRunsByFileNameIter(t.Context(), \"\", \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListWorkflowRunsByFileNameIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListWorkflowRunsByFileNameIter(t.Context(), \"\", \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *WorkflowRun, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListWorkflowRunsByFileNameIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActionsService_ListWorkflowRunsByIDIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"workflow_runs\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"workflow_runs\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"workflow_runs\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"workflow_runs\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListWorkflowRunsByIDIter(t.Context(), \"\", \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListWorkflowRunsByIDIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListWorkflowRunsOptions{}\n\titer = client.Actions.ListWorkflowRunsByIDIter(t.Context(), \"\", \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListWorkflowRunsByIDIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListWorkflowRunsByIDIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListWorkflowRunsByIDIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListWorkflowRunsByIDIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *WorkflowRun, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListWorkflowRunsByIDIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActionsService_ListWorkflowsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"workflows\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"workflows\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"workflows\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"workflows\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Actions.ListWorkflowsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListWorkflowsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Actions.ListWorkflowsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Actions.ListWorkflowsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Actions.ListWorkflowsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListWorkflowsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Actions.ListWorkflowsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Workflow, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Actions.ListWorkflowsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActivityService_ListEventsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Activity.ListEventsIter(t.Context(), nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Activity.ListEventsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Activity.ListEventsIter(t.Context(), opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Activity.ListEventsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Activity.ListEventsIter(t.Context(), nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Activity.ListEventsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Activity.ListEventsIter(t.Context(), nil)\n\tgotItems = 0\n\titer(func(item *Event, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Activity.ListEventsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActivityService_ListEventsForOrganizationIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Activity.ListEventsForOrganizationIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Activity.ListEventsForOrganizationIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Activity.ListEventsForOrganizationIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Activity.ListEventsForOrganizationIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Activity.ListEventsForOrganizationIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Activity.ListEventsForOrganizationIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Activity.ListEventsForOrganizationIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *Event, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Activity.ListEventsForOrganizationIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActivityService_ListEventsForRepoNetworkIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Activity.ListEventsForRepoNetworkIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Activity.ListEventsForRepoNetworkIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Activity.ListEventsForRepoNetworkIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Activity.ListEventsForRepoNetworkIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Activity.ListEventsForRepoNetworkIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Activity.ListEventsForRepoNetworkIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Activity.ListEventsForRepoNetworkIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Event, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Activity.ListEventsForRepoNetworkIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActivityService_ListEventsPerformedByUserIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Activity.ListEventsPerformedByUserIter(t.Context(), \"\", false, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Activity.ListEventsPerformedByUserIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Activity.ListEventsPerformedByUserIter(t.Context(), \"\", false, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Activity.ListEventsPerformedByUserIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Activity.ListEventsPerformedByUserIter(t.Context(), \"\", false, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Activity.ListEventsPerformedByUserIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Activity.ListEventsPerformedByUserIter(t.Context(), \"\", false, nil)\n\tgotItems = 0\n\titer(func(item *Event, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Activity.ListEventsPerformedByUserIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActivityService_ListEventsReceivedByUserIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Activity.ListEventsReceivedByUserIter(t.Context(), \"\", false, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Activity.ListEventsReceivedByUserIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Activity.ListEventsReceivedByUserIter(t.Context(), \"\", false, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Activity.ListEventsReceivedByUserIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Activity.ListEventsReceivedByUserIter(t.Context(), \"\", false, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Activity.ListEventsReceivedByUserIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Activity.ListEventsReceivedByUserIter(t.Context(), \"\", false, nil)\n\tgotItems = 0\n\titer(func(item *Event, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Activity.ListEventsReceivedByUserIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActivityService_ListIssueEventsForRepositoryIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Activity.ListIssueEventsForRepositoryIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Activity.ListIssueEventsForRepositoryIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Activity.ListIssueEventsForRepositoryIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Activity.ListIssueEventsForRepositoryIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Activity.ListIssueEventsForRepositoryIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Activity.ListIssueEventsForRepositoryIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Activity.ListIssueEventsForRepositoryIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *IssueEvent, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Activity.ListIssueEventsForRepositoryIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActivityService_ListNotificationsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Activity.ListNotificationsIter(t.Context(), nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Activity.ListNotificationsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &NotificationListOptions{}\n\titer = client.Activity.ListNotificationsIter(t.Context(), opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Activity.ListNotificationsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Activity.ListNotificationsIter(t.Context(), nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Activity.ListNotificationsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Activity.ListNotificationsIter(t.Context(), nil)\n\tgotItems = 0\n\titer(func(item *Notification, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Activity.ListNotificationsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActivityService_ListRepositoryEventsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Activity.ListRepositoryEventsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Activity.ListRepositoryEventsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Activity.ListRepositoryEventsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Activity.ListRepositoryEventsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Activity.ListRepositoryEventsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Activity.ListRepositoryEventsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Activity.ListRepositoryEventsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Event, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Activity.ListRepositoryEventsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActivityService_ListRepositoryNotificationsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Activity.ListRepositoryNotificationsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Activity.ListRepositoryNotificationsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &NotificationListOptions{}\n\titer = client.Activity.ListRepositoryNotificationsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Activity.ListRepositoryNotificationsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Activity.ListRepositoryNotificationsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Activity.ListRepositoryNotificationsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Activity.ListRepositoryNotificationsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Notification, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Activity.ListRepositoryNotificationsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActivityService_ListStargazersIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Activity.ListStargazersIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Activity.ListStargazersIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Activity.ListStargazersIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Activity.ListStargazersIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Activity.ListStargazersIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Activity.ListStargazersIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Activity.ListStargazersIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Stargazer, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Activity.ListStargazersIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActivityService_ListStarredIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Activity.ListStarredIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Activity.ListStarredIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ActivityListStarredOptions{}\n\titer = client.Activity.ListStarredIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Activity.ListStarredIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Activity.ListStarredIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Activity.ListStarredIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Activity.ListStarredIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *StarredRepository, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Activity.ListStarredIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActivityService_ListUserEventsForOrganizationIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Activity.ListUserEventsForOrganizationIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Activity.ListUserEventsForOrganizationIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Activity.ListUserEventsForOrganizationIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Activity.ListUserEventsForOrganizationIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Activity.ListUserEventsForOrganizationIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Activity.ListUserEventsForOrganizationIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Activity.ListUserEventsForOrganizationIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Event, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Activity.ListUserEventsForOrganizationIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActivityService_ListWatchedIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Activity.ListWatchedIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Activity.ListWatchedIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Activity.ListWatchedIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Activity.ListWatchedIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Activity.ListWatchedIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Activity.ListWatchedIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Activity.ListWatchedIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *Repository, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Activity.ListWatchedIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestActivityService_ListWatchersIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Activity.ListWatchersIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Activity.ListWatchersIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Activity.ListWatchersIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Activity.ListWatchersIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Activity.ListWatchersIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Activity.ListWatchersIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Activity.ListWatchersIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *User, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Activity.ListWatchersIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestAppsService_ListHookDeliveriesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?cursor=yo>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Apps.ListHookDeliveriesIter(t.Context(), nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Apps.ListHookDeliveriesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListCursorOptions{}\n\titer = client.Apps.ListHookDeliveriesIter(t.Context(), opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Apps.ListHookDeliveriesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Apps.ListHookDeliveriesIter(t.Context(), nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Apps.ListHookDeliveriesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Apps.ListHookDeliveriesIter(t.Context(), nil)\n\tgotItems = 0\n\titer(func(item *HookDelivery, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Apps.ListHookDeliveriesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestAppsService_ListInstallationRequestsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Apps.ListInstallationRequestsIter(t.Context(), nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Apps.ListInstallationRequestsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Apps.ListInstallationRequestsIter(t.Context(), opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Apps.ListInstallationRequestsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Apps.ListInstallationRequestsIter(t.Context(), nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Apps.ListInstallationRequestsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Apps.ListInstallationRequestsIter(t.Context(), nil)\n\tgotItems = 0\n\titer(func(item *InstallationRequest, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Apps.ListInstallationRequestsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestAppsService_ListInstallationsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Apps.ListInstallationsIter(t.Context(), nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Apps.ListInstallationsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Apps.ListInstallationsIter(t.Context(), opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Apps.ListInstallationsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Apps.ListInstallationsIter(t.Context(), nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Apps.ListInstallationsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Apps.ListInstallationsIter(t.Context(), nil)\n\tgotItems = 0\n\titer(func(item *Installation, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Apps.ListInstallationsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestAppsService_ListReposIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Apps.ListReposIter(t.Context(), nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Apps.ListReposIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Apps.ListReposIter(t.Context(), opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Apps.ListReposIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Apps.ListReposIter(t.Context(), nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Apps.ListReposIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Apps.ListReposIter(t.Context(), nil)\n\tgotItems = 0\n\titer(func(item *Repository, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Apps.ListReposIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestAppsService_ListUserInstallationsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"installations\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"installations\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"installations\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"installations\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Apps.ListUserInstallationsIter(t.Context(), nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Apps.ListUserInstallationsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Apps.ListUserInstallationsIter(t.Context(), opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Apps.ListUserInstallationsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Apps.ListUserInstallationsIter(t.Context(), nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Apps.ListUserInstallationsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Apps.ListUserInstallationsIter(t.Context(), nil)\n\tgotItems = 0\n\titer(func(item *Installation, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Apps.ListUserInstallationsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestAppsService_ListUserReposIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Apps.ListUserReposIter(t.Context(), 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Apps.ListUserReposIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Apps.ListUserReposIter(t.Context(), 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Apps.ListUserReposIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Apps.ListUserReposIter(t.Context(), 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Apps.ListUserReposIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Apps.ListUserReposIter(t.Context(), 0, nil)\n\tgotItems = 0\n\titer(func(item *Repository, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Apps.ListUserReposIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestChecksService_ListCheckRunAnnotationsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Checks.ListCheckRunAnnotationsIter(t.Context(), \"\", \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Checks.ListCheckRunAnnotationsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Checks.ListCheckRunAnnotationsIter(t.Context(), \"\", \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Checks.ListCheckRunAnnotationsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Checks.ListCheckRunAnnotationsIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Checks.ListCheckRunAnnotationsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Checks.ListCheckRunAnnotationsIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *CheckRunAnnotation, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Checks.ListCheckRunAnnotationsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestChecksService_ListCheckRunsCheckSuiteIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"check_runs\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"check_runs\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"check_runs\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"check_runs\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Checks.ListCheckRunsCheckSuiteIter(t.Context(), \"\", \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Checks.ListCheckRunsCheckSuiteIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListCheckRunsOptions{}\n\titer = client.Checks.ListCheckRunsCheckSuiteIter(t.Context(), \"\", \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Checks.ListCheckRunsCheckSuiteIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Checks.ListCheckRunsCheckSuiteIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Checks.ListCheckRunsCheckSuiteIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Checks.ListCheckRunsCheckSuiteIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *CheckRun, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Checks.ListCheckRunsCheckSuiteIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestChecksService_ListCheckRunsForRefIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"check_runs\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"check_runs\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"check_runs\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"check_runs\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Checks.ListCheckRunsForRefIter(t.Context(), \"\", \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Checks.ListCheckRunsForRefIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListCheckRunsOptions{}\n\titer = client.Checks.ListCheckRunsForRefIter(t.Context(), \"\", \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Checks.ListCheckRunsForRefIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Checks.ListCheckRunsForRefIter(t.Context(), \"\", \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Checks.ListCheckRunsForRefIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Checks.ListCheckRunsForRefIter(t.Context(), \"\", \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *CheckRun, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Checks.ListCheckRunsForRefIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestChecksService_ListCheckSuitesForRefIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"check_suites\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"check_suites\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"check_suites\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"check_suites\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Checks.ListCheckSuitesForRefIter(t.Context(), \"\", \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Checks.ListCheckSuitesForRefIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListCheckSuiteOptions{}\n\titer = client.Checks.ListCheckSuitesForRefIter(t.Context(), \"\", \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Checks.ListCheckSuitesForRefIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Checks.ListCheckSuitesForRefIter(t.Context(), \"\", \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Checks.ListCheckSuitesForRefIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Checks.ListCheckSuitesForRefIter(t.Context(), \"\", \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *CheckSuite, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Checks.ListCheckSuitesForRefIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestClassroomService_ListAcceptedAssignmentsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Classroom.ListAcceptedAssignmentsIter(t.Context(), 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Classroom.ListAcceptedAssignmentsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Classroom.ListAcceptedAssignmentsIter(t.Context(), 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Classroom.ListAcceptedAssignmentsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Classroom.ListAcceptedAssignmentsIter(t.Context(), 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Classroom.ListAcceptedAssignmentsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Classroom.ListAcceptedAssignmentsIter(t.Context(), 0, nil)\n\tgotItems = 0\n\titer(func(item *AcceptedAssignment, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Classroom.ListAcceptedAssignmentsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestClassroomService_ListClassroomAssignmentsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Classroom.ListClassroomAssignmentsIter(t.Context(), 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Classroom.ListClassroomAssignmentsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Classroom.ListClassroomAssignmentsIter(t.Context(), 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Classroom.ListClassroomAssignmentsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Classroom.ListClassroomAssignmentsIter(t.Context(), 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Classroom.ListClassroomAssignmentsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Classroom.ListClassroomAssignmentsIter(t.Context(), 0, nil)\n\tgotItems = 0\n\titer(func(item *ClassroomAssignment, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Classroom.ListClassroomAssignmentsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestClassroomService_ListClassroomsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Classroom.ListClassroomsIter(t.Context(), nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Classroom.ListClassroomsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Classroom.ListClassroomsIter(t.Context(), opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Classroom.ListClassroomsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Classroom.ListClassroomsIter(t.Context(), nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Classroom.ListClassroomsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Classroom.ListClassroomsIter(t.Context(), nil)\n\tgotItems = 0\n\titer(func(item *Classroom, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Classroom.ListClassroomsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestCodeScanningService_ListAlertInstancesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.CodeScanning.ListAlertInstancesIter(t.Context(), \"\", \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.CodeScanning.ListAlertInstancesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &AlertInstancesListOptions{}\n\titer = client.CodeScanning.ListAlertInstancesIter(t.Context(), \"\", \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.CodeScanning.ListAlertInstancesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.CodeScanning.ListAlertInstancesIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.CodeScanning.ListAlertInstancesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.CodeScanning.ListAlertInstancesIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *MostRecentInstance, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.CodeScanning.ListAlertInstancesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestCodeScanningService_ListAlertsForOrgIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?after=yo>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.CodeScanning.ListAlertsForOrgIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.CodeScanning.ListAlertsForOrgIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &AlertListOptions{}\n\titer = client.CodeScanning.ListAlertsForOrgIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.CodeScanning.ListAlertsForOrgIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.CodeScanning.ListAlertsForOrgIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.CodeScanning.ListAlertsForOrgIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.CodeScanning.ListAlertsForOrgIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *Alert, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.CodeScanning.ListAlertsForOrgIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestCodeScanningService_ListAlertsForRepoIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?after=yo>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.CodeScanning.ListAlertsForRepoIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.CodeScanning.ListAlertsForRepoIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &AlertListOptions{}\n\titer = client.CodeScanning.ListAlertsForRepoIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.CodeScanning.ListAlertsForRepoIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.CodeScanning.ListAlertsForRepoIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.CodeScanning.ListAlertsForRepoIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.CodeScanning.ListAlertsForRepoIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Alert, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.CodeScanning.ListAlertsForRepoIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestCodeScanningService_ListAnalysesForRepoIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.CodeScanning.ListAnalysesForRepoIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.CodeScanning.ListAnalysesForRepoIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &AnalysesListOptions{}\n\titer = client.CodeScanning.ListAnalysesForRepoIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.CodeScanning.ListAnalysesForRepoIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.CodeScanning.ListAnalysesForRepoIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.CodeScanning.ListAnalysesForRepoIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.CodeScanning.ListAnalysesForRepoIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *ScanningAnalysis, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.CodeScanning.ListAnalysesForRepoIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestCodespacesService_ListIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"codespaces\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"codespaces\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"codespaces\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"codespaces\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Codespaces.ListIter(t.Context(), nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Codespaces.ListIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListCodespacesOptions{}\n\titer = client.Codespaces.ListIter(t.Context(), opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Codespaces.ListIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Codespaces.ListIter(t.Context(), nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Codespaces.ListIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Codespaces.ListIter(t.Context(), nil)\n\tgotItems = 0\n\titer(func(item *Codespace, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Codespaces.ListIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestCodespacesService_ListDevContainerConfigurationsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"devcontainers\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"devcontainers\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"devcontainers\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"devcontainers\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Codespaces.ListDevContainerConfigurationsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Codespaces.ListDevContainerConfigurationsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Codespaces.ListDevContainerConfigurationsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Codespaces.ListDevContainerConfigurationsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Codespaces.ListDevContainerConfigurationsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Codespaces.ListDevContainerConfigurationsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Codespaces.ListDevContainerConfigurationsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *DevContainer, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Codespaces.ListDevContainerConfigurationsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestCodespacesService_ListInOrgIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"codespaces\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"codespaces\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"codespaces\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"codespaces\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Codespaces.ListInOrgIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Codespaces.ListInOrgIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Codespaces.ListInOrgIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Codespaces.ListInOrgIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Codespaces.ListInOrgIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Codespaces.ListInOrgIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Codespaces.ListInOrgIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *Codespace, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Codespaces.ListInOrgIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestCodespacesService_ListInRepoIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"codespaces\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"codespaces\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"codespaces\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"codespaces\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Codespaces.ListInRepoIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Codespaces.ListInRepoIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Codespaces.ListInRepoIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Codespaces.ListInRepoIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Codespaces.ListInRepoIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Codespaces.ListInRepoIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Codespaces.ListInRepoIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Codespace, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Codespaces.ListInRepoIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestCodespacesService_ListOrgSecretsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Codespaces.ListOrgSecretsIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Codespaces.ListOrgSecretsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Codespaces.ListOrgSecretsIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Codespaces.ListOrgSecretsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Codespaces.ListOrgSecretsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Codespaces.ListOrgSecretsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Codespaces.ListOrgSecretsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *Secret, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Codespaces.ListOrgSecretsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestCodespacesService_ListRepoSecretsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Codespaces.ListRepoSecretsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Codespaces.ListRepoSecretsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Codespaces.ListRepoSecretsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Codespaces.ListRepoSecretsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Codespaces.ListRepoSecretsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Codespaces.ListRepoSecretsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Codespaces.ListRepoSecretsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Secret, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Codespaces.ListRepoSecretsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestCodespacesService_ListSelectedReposForOrgSecretIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Codespaces.ListSelectedReposForOrgSecretIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Codespaces.ListSelectedReposForOrgSecretIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Codespaces.ListSelectedReposForOrgSecretIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Codespaces.ListSelectedReposForOrgSecretIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Codespaces.ListSelectedReposForOrgSecretIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Codespaces.ListSelectedReposForOrgSecretIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Codespaces.ListSelectedReposForOrgSecretIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Repository, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Codespaces.ListSelectedReposForOrgSecretIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestCodespacesService_ListSelectedReposForUserSecretIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Codespaces.ListSelectedReposForUserSecretIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Codespaces.ListSelectedReposForUserSecretIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Codespaces.ListSelectedReposForUserSecretIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Codespaces.ListSelectedReposForUserSecretIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Codespaces.ListSelectedReposForUserSecretIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Codespaces.ListSelectedReposForUserSecretIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Codespaces.ListSelectedReposForUserSecretIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *Repository, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Codespaces.ListSelectedReposForUserSecretIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestCodespacesService_ListUserCodespacesInOrgIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"codespaces\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"codespaces\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"codespaces\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"codespaces\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Codespaces.ListUserCodespacesInOrgIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Codespaces.ListUserCodespacesInOrgIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Codespaces.ListUserCodespacesInOrgIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Codespaces.ListUserCodespacesInOrgIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Codespaces.ListUserCodespacesInOrgIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Codespaces.ListUserCodespacesInOrgIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Codespaces.ListUserCodespacesInOrgIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Codespace, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Codespaces.ListUserCodespacesInOrgIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestCodespacesService_ListUserSecretsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Codespaces.ListUserSecretsIter(t.Context(), nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Codespaces.ListUserSecretsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Codespaces.ListUserSecretsIter(t.Context(), opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Codespaces.ListUserSecretsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Codespaces.ListUserSecretsIter(t.Context(), nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Codespaces.ListUserSecretsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Codespaces.ListUserSecretsIter(t.Context(), nil)\n\tgotItems = 0\n\titer(func(item *Secret, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Codespaces.ListUserSecretsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestCopilotService_ListCopilotEnterpriseSeatsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"seats\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"seats\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"seats\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"seats\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Copilot.ListCopilotEnterpriseSeatsIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Copilot.ListCopilotEnterpriseSeatsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Copilot.ListCopilotEnterpriseSeatsIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Copilot.ListCopilotEnterpriseSeatsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Copilot.ListCopilotEnterpriseSeatsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Copilot.ListCopilotEnterpriseSeatsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Copilot.ListCopilotEnterpriseSeatsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *CopilotSeatDetails, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Copilot.ListCopilotEnterpriseSeatsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestCopilotService_ListCopilotSeatsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"seats\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"seats\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"seats\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"seats\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Copilot.ListCopilotSeatsIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Copilot.ListCopilotSeatsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Copilot.ListCopilotSeatsIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Copilot.ListCopilotSeatsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Copilot.ListCopilotSeatsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Copilot.ListCopilotSeatsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Copilot.ListCopilotSeatsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *CopilotSeatDetails, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Copilot.ListCopilotSeatsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestDependabotService_ListOrgAlertsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?after=yo>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Dependabot.ListOrgAlertsIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Dependabot.ListOrgAlertsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListAlertsOptions{}\n\titer = client.Dependabot.ListOrgAlertsIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Dependabot.ListOrgAlertsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Dependabot.ListOrgAlertsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Dependabot.ListOrgAlertsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Dependabot.ListOrgAlertsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *DependabotAlert, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Dependabot.ListOrgAlertsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestDependabotService_ListOrgSecretsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Dependabot.ListOrgSecretsIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Dependabot.ListOrgSecretsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Dependabot.ListOrgSecretsIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Dependabot.ListOrgSecretsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Dependabot.ListOrgSecretsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Dependabot.ListOrgSecretsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Dependabot.ListOrgSecretsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *Secret, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Dependabot.ListOrgSecretsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestDependabotService_ListRepoAlertsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?after=yo>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Dependabot.ListRepoAlertsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Dependabot.ListRepoAlertsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListAlertsOptions{}\n\titer = client.Dependabot.ListRepoAlertsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Dependabot.ListRepoAlertsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Dependabot.ListRepoAlertsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Dependabot.ListRepoAlertsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Dependabot.ListRepoAlertsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *DependabotAlert, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Dependabot.ListRepoAlertsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestDependabotService_ListRepoSecretsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"secrets\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Dependabot.ListRepoSecretsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Dependabot.ListRepoSecretsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Dependabot.ListRepoSecretsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Dependabot.ListRepoSecretsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Dependabot.ListRepoSecretsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Dependabot.ListRepoSecretsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Dependabot.ListRepoSecretsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Secret, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Dependabot.ListRepoSecretsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestDependabotService_ListSelectedReposForOrgSecretIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Dependabot.ListSelectedReposForOrgSecretIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Dependabot.ListSelectedReposForOrgSecretIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Dependabot.ListSelectedReposForOrgSecretIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Dependabot.ListSelectedReposForOrgSecretIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Dependabot.ListSelectedReposForOrgSecretIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Dependabot.ListSelectedReposForOrgSecretIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Dependabot.ListSelectedReposForOrgSecretIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Repository, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Dependabot.ListSelectedReposForOrgSecretIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestEnterpriseService_ListAppAccessibleOrganizationRepositoriesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Enterprise.ListAppAccessibleOrganizationRepositoriesIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListAppAccessibleOrganizationRepositoriesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Enterprise.ListAppAccessibleOrganizationRepositoriesIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListAppAccessibleOrganizationRepositoriesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Enterprise.ListAppAccessibleOrganizationRepositoriesIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListAppAccessibleOrganizationRepositoriesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Enterprise.ListAppAccessibleOrganizationRepositoriesIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *AccessibleRepository, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListAppAccessibleOrganizationRepositoriesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestEnterpriseService_ListAppInstallableOrganizationsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Enterprise.ListAppInstallableOrganizationsIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListAppInstallableOrganizationsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Enterprise.ListAppInstallableOrganizationsIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListAppInstallableOrganizationsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Enterprise.ListAppInstallableOrganizationsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListAppInstallableOrganizationsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Enterprise.ListAppInstallableOrganizationsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *InstallableOrganization, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListAppInstallableOrganizationsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestEnterpriseService_ListAppInstallationsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Enterprise.ListAppInstallationsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListAppInstallationsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Enterprise.ListAppInstallationsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListAppInstallationsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Enterprise.ListAppInstallationsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListAppInstallationsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Enterprise.ListAppInstallationsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Installation, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListAppInstallationsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestEnterpriseService_ListAssignmentsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Enterprise.ListAssignmentsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListAssignmentsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Enterprise.ListAssignmentsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListAssignmentsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Enterprise.ListAssignmentsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListAssignmentsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Enterprise.ListAssignmentsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Organization, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListAssignmentsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestEnterpriseService_ListCodeSecurityConfigurationRepositoriesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?after=yo>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Enterprise.ListCodeSecurityConfigurationRepositoriesIter(t.Context(), \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListCodeSecurityConfigurationRepositoriesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListCodeSecurityConfigurationRepositoriesOptions{}\n\titer = client.Enterprise.ListCodeSecurityConfigurationRepositoriesIter(t.Context(), \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListCodeSecurityConfigurationRepositoriesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Enterprise.ListCodeSecurityConfigurationRepositoriesIter(t.Context(), \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListCodeSecurityConfigurationRepositoriesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Enterprise.ListCodeSecurityConfigurationRepositoriesIter(t.Context(), \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *RepositoryAttachment, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListCodeSecurityConfigurationRepositoriesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestEnterpriseService_ListCodeSecurityConfigurationsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?after=yo>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Enterprise.ListCodeSecurityConfigurationsIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListCodeSecurityConfigurationsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListEnterpriseCodeSecurityConfigurationOptions{}\n\titer = client.Enterprise.ListCodeSecurityConfigurationsIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListCodeSecurityConfigurationsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Enterprise.ListCodeSecurityConfigurationsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListCodeSecurityConfigurationsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Enterprise.ListCodeSecurityConfigurationsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *CodeSecurityConfiguration, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListCodeSecurityConfigurationsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestEnterpriseService_ListEnterpriseNetworkConfigurationsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"network_configurations\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"network_configurations\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"network_configurations\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"network_configurations\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Enterprise.ListEnterpriseNetworkConfigurationsIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListEnterpriseNetworkConfigurationsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Enterprise.ListEnterpriseNetworkConfigurationsIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListEnterpriseNetworkConfigurationsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Enterprise.ListEnterpriseNetworkConfigurationsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListEnterpriseNetworkConfigurationsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Enterprise.ListEnterpriseNetworkConfigurationsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *NetworkConfiguration, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListEnterpriseNetworkConfigurationsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestEnterpriseService_ListHostedRunnersIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Enterprise.ListHostedRunnersIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListHostedRunnersIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Enterprise.ListHostedRunnersIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListHostedRunnersIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Enterprise.ListHostedRunnersIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListHostedRunnersIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Enterprise.ListHostedRunnersIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *HostedRunner, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListHostedRunnersIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestEnterpriseService_ListOrganizationAccessRunnerGroupIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"organizations\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"organizations\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"organizations\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"organizations\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Enterprise.ListOrganizationAccessRunnerGroupIter(t.Context(), \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListOrganizationAccessRunnerGroupIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Enterprise.ListOrganizationAccessRunnerGroupIter(t.Context(), \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListOrganizationAccessRunnerGroupIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Enterprise.ListOrganizationAccessRunnerGroupIter(t.Context(), \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListOrganizationAccessRunnerGroupIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Enterprise.ListOrganizationAccessRunnerGroupIter(t.Context(), \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *Organization, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListOrganizationAccessRunnerGroupIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestEnterpriseService_ListOrganizationCustomPropertyValuesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Enterprise.ListOrganizationCustomPropertyValuesIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListOrganizationCustomPropertyValuesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Enterprise.ListOrganizationCustomPropertyValuesIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListOrganizationCustomPropertyValuesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Enterprise.ListOrganizationCustomPropertyValuesIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListOrganizationCustomPropertyValuesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Enterprise.ListOrganizationCustomPropertyValuesIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *EnterpriseCustomPropertiesValues, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListOrganizationCustomPropertyValuesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestEnterpriseService_ListRepositoriesForOrgAppInstallationIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Enterprise.ListRepositoriesForOrgAppInstallationIter(t.Context(), \"\", \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListRepositoriesForOrgAppInstallationIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Enterprise.ListRepositoriesForOrgAppInstallationIter(t.Context(), \"\", \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListRepositoriesForOrgAppInstallationIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Enterprise.ListRepositoriesForOrgAppInstallationIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListRepositoriesForOrgAppInstallationIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Enterprise.ListRepositoriesForOrgAppInstallationIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *AccessibleRepository, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListRepositoriesForOrgAppInstallationIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestEnterpriseService_ListRunnerGroupRunnersIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Enterprise.ListRunnerGroupRunnersIter(t.Context(), \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListRunnerGroupRunnersIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Enterprise.ListRunnerGroupRunnersIter(t.Context(), \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListRunnerGroupRunnersIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Enterprise.ListRunnerGroupRunnersIter(t.Context(), \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListRunnerGroupRunnersIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Enterprise.ListRunnerGroupRunnersIter(t.Context(), \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *Runner, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListRunnerGroupRunnersIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestEnterpriseService_ListRunnerGroupsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"runner_groups\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"runner_groups\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"runner_groups\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"runner_groups\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Enterprise.ListRunnerGroupsIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListRunnerGroupsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListEnterpriseRunnerGroupOptions{}\n\titer = client.Enterprise.ListRunnerGroupsIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListRunnerGroupsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Enterprise.ListRunnerGroupsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListRunnerGroupsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Enterprise.ListRunnerGroupsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *EnterpriseRunnerGroup, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListRunnerGroupsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestEnterpriseService_ListRunnersIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"runners\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Enterprise.ListRunnersIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListRunnersIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListRunnersOptions{}\n\titer = client.Enterprise.ListRunnersIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListRunnersIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Enterprise.ListRunnersIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListRunnersIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Enterprise.ListRunnersIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *Runner, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListRunnersIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestEnterpriseService_ListTeamMembersIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Enterprise.ListTeamMembersIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListTeamMembersIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Enterprise.ListTeamMembersIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListTeamMembersIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Enterprise.ListTeamMembersIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListTeamMembersIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Enterprise.ListTeamMembersIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *User, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListTeamMembersIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestEnterpriseService_ListTeamsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Enterprise.ListTeamsIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListTeamsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Enterprise.ListTeamsIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Enterprise.ListTeamsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Enterprise.ListTeamsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListTeamsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Enterprise.ListTeamsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *EnterpriseTeam, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Enterprise.ListTeamsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestGistsService_ListIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Gists.ListIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Gists.ListIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &GistListOptions{}\n\titer = client.Gists.ListIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Gists.ListIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Gists.ListIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Gists.ListIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Gists.ListIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *Gist, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Gists.ListIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestGistsService_ListAllIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Gists.ListAllIter(t.Context(), nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Gists.ListAllIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &GistListOptions{}\n\titer = client.Gists.ListAllIter(t.Context(), opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Gists.ListAllIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Gists.ListAllIter(t.Context(), nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Gists.ListAllIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Gists.ListAllIter(t.Context(), nil)\n\tgotItems = 0\n\titer(func(item *Gist, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Gists.ListAllIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestGistsService_ListCommentsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Gists.ListCommentsIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Gists.ListCommentsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Gists.ListCommentsIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Gists.ListCommentsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Gists.ListCommentsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Gists.ListCommentsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Gists.ListCommentsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *GistComment, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Gists.ListCommentsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestGistsService_ListCommitsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Gists.ListCommitsIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Gists.ListCommitsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Gists.ListCommitsIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Gists.ListCommitsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Gists.ListCommitsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Gists.ListCommitsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Gists.ListCommitsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *GistCommit, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Gists.ListCommitsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestGistsService_ListForksIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Gists.ListForksIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Gists.ListForksIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Gists.ListForksIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Gists.ListForksIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Gists.ListForksIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Gists.ListForksIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Gists.ListForksIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *GistFork, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Gists.ListForksIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestGistsService_ListStarredIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Gists.ListStarredIter(t.Context(), nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Gists.ListStarredIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &GistListOptions{}\n\titer = client.Gists.ListStarredIter(t.Context(), opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Gists.ListStarredIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Gists.ListStarredIter(t.Context(), nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Gists.ListStarredIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Gists.ListStarredIter(t.Context(), nil)\n\tgotItems = 0\n\titer(func(item *Gist, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Gists.ListStarredIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestIssuesService_ListAllIssuesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Issues.ListAllIssuesIter(t.Context(), nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Issues.ListAllIssuesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListAllIssuesOptions{}\n\titer = client.Issues.ListAllIssuesIter(t.Context(), opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Issues.ListAllIssuesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Issues.ListAllIssuesIter(t.Context(), nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Issues.ListAllIssuesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Issues.ListAllIssuesIter(t.Context(), nil)\n\tgotItems = 0\n\titer(func(item *Issue, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Issues.ListAllIssuesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestIssuesService_ListAssigneesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Issues.ListAssigneesIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Issues.ListAssigneesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Issues.ListAssigneesIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Issues.ListAssigneesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Issues.ListAssigneesIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Issues.ListAssigneesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Issues.ListAssigneesIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *User, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Issues.ListAssigneesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestIssuesService_ListByOrgIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Issues.ListByOrgIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Issues.ListByOrgIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &IssueListByOrgOptions{}\n\titer = client.Issues.ListByOrgIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Issues.ListByOrgIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Issues.ListByOrgIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Issues.ListByOrgIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Issues.ListByOrgIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *Issue, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Issues.ListByOrgIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestIssuesService_ListByRepoIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?after=yo>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Issues.ListByRepoIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Issues.ListByRepoIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &IssueListByRepoOptions{}\n\titer = client.Issues.ListByRepoIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Issues.ListByRepoIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Issues.ListByRepoIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Issues.ListByRepoIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Issues.ListByRepoIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Issue, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Issues.ListByRepoIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestIssuesService_ListCommentsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Issues.ListCommentsIter(t.Context(), \"\", \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Issues.ListCommentsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &IssueListCommentsOptions{}\n\titer = client.Issues.ListCommentsIter(t.Context(), \"\", \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Issues.ListCommentsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Issues.ListCommentsIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Issues.ListCommentsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Issues.ListCommentsIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *IssueComment, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Issues.ListCommentsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestIssuesService_ListIssueEventsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Issues.ListIssueEventsIter(t.Context(), \"\", \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Issues.ListIssueEventsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Issues.ListIssueEventsIter(t.Context(), \"\", \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Issues.ListIssueEventsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Issues.ListIssueEventsIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Issues.ListIssueEventsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Issues.ListIssueEventsIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *IssueEvent, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Issues.ListIssueEventsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestIssuesService_ListIssueTimelineIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Issues.ListIssueTimelineIter(t.Context(), \"\", \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Issues.ListIssueTimelineIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Issues.ListIssueTimelineIter(t.Context(), \"\", \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Issues.ListIssueTimelineIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Issues.ListIssueTimelineIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Issues.ListIssueTimelineIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Issues.ListIssueTimelineIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *Timeline, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Issues.ListIssueTimelineIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestIssuesService_ListLabelsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Issues.ListLabelsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Issues.ListLabelsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Issues.ListLabelsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Issues.ListLabelsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Issues.ListLabelsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Issues.ListLabelsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Issues.ListLabelsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Label, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Issues.ListLabelsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestIssuesService_ListLabelsByIssueIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Issues.ListLabelsByIssueIter(t.Context(), \"\", \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Issues.ListLabelsByIssueIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Issues.ListLabelsByIssueIter(t.Context(), \"\", \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Issues.ListLabelsByIssueIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Issues.ListLabelsByIssueIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Issues.ListLabelsByIssueIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Issues.ListLabelsByIssueIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *Label, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Issues.ListLabelsByIssueIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestIssuesService_ListLabelsForMilestoneIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Issues.ListLabelsForMilestoneIter(t.Context(), \"\", \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Issues.ListLabelsForMilestoneIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Issues.ListLabelsForMilestoneIter(t.Context(), \"\", \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Issues.ListLabelsForMilestoneIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Issues.ListLabelsForMilestoneIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Issues.ListLabelsForMilestoneIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Issues.ListLabelsForMilestoneIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *Label, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Issues.ListLabelsForMilestoneIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestIssuesService_ListMilestonesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Issues.ListMilestonesIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Issues.ListMilestonesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &MilestoneListOptions{}\n\titer = client.Issues.ListMilestonesIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Issues.ListMilestonesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Issues.ListMilestonesIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Issues.ListMilestonesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Issues.ListMilestonesIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Milestone, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Issues.ListMilestonesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestIssuesService_ListRepositoryEventsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Issues.ListRepositoryEventsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Issues.ListRepositoryEventsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Issues.ListRepositoryEventsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Issues.ListRepositoryEventsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Issues.ListRepositoryEventsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Issues.ListRepositoryEventsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Issues.ListRepositoryEventsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *IssueEvent, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Issues.ListRepositoryEventsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestIssuesService_ListUserIssuesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Issues.ListUserIssuesIter(t.Context(), nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Issues.ListUserIssuesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListUserIssuesOptions{}\n\titer = client.Issues.ListUserIssuesIter(t.Context(), opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Issues.ListUserIssuesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Issues.ListUserIssuesIter(t.Context(), nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Issues.ListUserIssuesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Issues.ListUserIssuesIter(t.Context(), nil)\n\tgotItems = 0\n\titer(func(item *Issue, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Issues.ListUserIssuesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestLicensesService_ListIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Licenses.ListIter(t.Context(), nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Licenses.ListIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListLicensesOptions{}\n\titer = client.Licenses.ListIter(t.Context(), opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Licenses.ListIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Licenses.ListIter(t.Context(), nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Licenses.ListIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Licenses.ListIter(t.Context(), nil)\n\tgotItems = 0\n\titer(func(item *License, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Licenses.ListIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestMarketplaceService_ListMarketplacePurchasesForUserIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Marketplace.ListMarketplacePurchasesForUserIter(t.Context(), nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Marketplace.ListMarketplacePurchasesForUserIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Marketplace.ListMarketplacePurchasesForUserIter(t.Context(), opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Marketplace.ListMarketplacePurchasesForUserIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Marketplace.ListMarketplacePurchasesForUserIter(t.Context(), nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Marketplace.ListMarketplacePurchasesForUserIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Marketplace.ListMarketplacePurchasesForUserIter(t.Context(), nil)\n\tgotItems = 0\n\titer(func(item *MarketplacePurchase, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Marketplace.ListMarketplacePurchasesForUserIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestMarketplaceService_ListPlanAccountsForPlanIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Marketplace.ListPlanAccountsForPlanIter(t.Context(), 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Marketplace.ListPlanAccountsForPlanIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Marketplace.ListPlanAccountsForPlanIter(t.Context(), 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Marketplace.ListPlanAccountsForPlanIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Marketplace.ListPlanAccountsForPlanIter(t.Context(), 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Marketplace.ListPlanAccountsForPlanIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Marketplace.ListPlanAccountsForPlanIter(t.Context(), 0, nil)\n\tgotItems = 0\n\titer(func(item *MarketplacePlanAccount, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Marketplace.ListPlanAccountsForPlanIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestMarketplaceService_ListPlansIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Marketplace.ListPlansIter(t.Context(), nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Marketplace.ListPlansIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Marketplace.ListPlansIter(t.Context(), opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Marketplace.ListPlansIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Marketplace.ListPlansIter(t.Context(), nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Marketplace.ListPlansIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Marketplace.ListPlansIter(t.Context(), nil)\n\tgotItems = 0\n\titer(func(item *MarketplacePlan, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Marketplace.ListPlansIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestMigrationService_ListMigrationsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Migrations.ListMigrationsIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Migrations.ListMigrationsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Migrations.ListMigrationsIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Migrations.ListMigrationsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Migrations.ListMigrationsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Migrations.ListMigrationsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Migrations.ListMigrationsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *Migration, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Migrations.ListMigrationsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestMigrationService_ListUserMigrationsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Migrations.ListUserMigrationsIter(t.Context(), nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Migrations.ListUserMigrationsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Migrations.ListUserMigrationsIter(t.Context(), opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Migrations.ListUserMigrationsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Migrations.ListUserMigrationsIter(t.Context(), nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Migrations.ListUserMigrationsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Migrations.ListUserMigrationsIter(t.Context(), nil)\n\tgotItems = 0\n\titer(func(item *UserMigration, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Migrations.ListUserMigrationsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestOrganizationsService_ListIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Organizations.ListIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Organizations.ListIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Organizations.ListIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Organizations.ListIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *Organization, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestOrganizationsService_ListAttestationsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"attestations\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"attestations\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"attestations\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"attestations\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Organizations.ListAttestationsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListAttestationsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Organizations.ListAttestationsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListAttestationsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Organizations.ListAttestationsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListAttestationsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Organizations.ListAttestationsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Attestation, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListAttestationsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestOrganizationsService_ListBlockedUsersIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Organizations.ListBlockedUsersIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListBlockedUsersIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Organizations.ListBlockedUsersIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListBlockedUsersIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Organizations.ListBlockedUsersIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListBlockedUsersIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Organizations.ListBlockedUsersIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *User, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListBlockedUsersIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestOrganizationsService_ListCodeSecurityConfigurationRepositoriesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?after=yo>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Organizations.ListCodeSecurityConfigurationRepositoriesIter(t.Context(), \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListCodeSecurityConfigurationRepositoriesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListCodeSecurityConfigurationRepositoriesOptions{}\n\titer = client.Organizations.ListCodeSecurityConfigurationRepositoriesIter(t.Context(), \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListCodeSecurityConfigurationRepositoriesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Organizations.ListCodeSecurityConfigurationRepositoriesIter(t.Context(), \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListCodeSecurityConfigurationRepositoriesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Organizations.ListCodeSecurityConfigurationRepositoriesIter(t.Context(), \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *RepositoryAttachment, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListCodeSecurityConfigurationRepositoriesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestOrganizationsService_ListCodeSecurityConfigurationsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?after=yo>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Organizations.ListCodeSecurityConfigurationsIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListCodeSecurityConfigurationsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOrgCodeSecurityConfigurationOptions{}\n\titer = client.Organizations.ListCodeSecurityConfigurationsIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListCodeSecurityConfigurationsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Organizations.ListCodeSecurityConfigurationsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListCodeSecurityConfigurationsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Organizations.ListCodeSecurityConfigurationsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *CodeSecurityConfiguration, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListCodeSecurityConfigurationsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestOrganizationsService_ListCredentialAuthorizationsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Organizations.ListCredentialAuthorizationsIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListCredentialAuthorizationsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &CredentialAuthorizationsListOptions{}\n\titer = client.Organizations.ListCredentialAuthorizationsIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListCredentialAuthorizationsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Organizations.ListCredentialAuthorizationsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListCredentialAuthorizationsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Organizations.ListCredentialAuthorizationsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *CredentialAuthorization, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListCredentialAuthorizationsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestOrganizationsService_ListCustomPropertyValuesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Organizations.ListCustomPropertyValuesIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListCustomPropertyValuesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListCustomPropertyValuesOptions{}\n\titer = client.Organizations.ListCustomPropertyValuesIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListCustomPropertyValuesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Organizations.ListCustomPropertyValuesIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListCustomPropertyValuesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Organizations.ListCustomPropertyValuesIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *RepoCustomPropertyValue, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListCustomPropertyValuesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestOrganizationsService_ListFailedOrgInvitationsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Organizations.ListFailedOrgInvitationsIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListFailedOrgInvitationsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Organizations.ListFailedOrgInvitationsIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListFailedOrgInvitationsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Organizations.ListFailedOrgInvitationsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListFailedOrgInvitationsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Organizations.ListFailedOrgInvitationsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *Invitation, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListFailedOrgInvitationsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestOrganizationsService_ListFineGrainedPersonalAccessTokenRequestsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Organizations.ListFineGrainedPersonalAccessTokenRequestsIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListFineGrainedPersonalAccessTokenRequestsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListFineGrainedPATOptions{}\n\titer = client.Organizations.ListFineGrainedPersonalAccessTokenRequestsIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListFineGrainedPersonalAccessTokenRequestsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Organizations.ListFineGrainedPersonalAccessTokenRequestsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListFineGrainedPersonalAccessTokenRequestsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Organizations.ListFineGrainedPersonalAccessTokenRequestsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *FineGrainedPersonalAccessTokenRequest, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListFineGrainedPersonalAccessTokenRequestsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestOrganizationsService_ListFineGrainedPersonalAccessTokensIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Organizations.ListFineGrainedPersonalAccessTokensIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListFineGrainedPersonalAccessTokensIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListFineGrainedPATOptions{}\n\titer = client.Organizations.ListFineGrainedPersonalAccessTokensIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListFineGrainedPersonalAccessTokensIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Organizations.ListFineGrainedPersonalAccessTokensIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListFineGrainedPersonalAccessTokensIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Organizations.ListFineGrainedPersonalAccessTokensIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *PersonalAccessToken, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListFineGrainedPersonalAccessTokensIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestOrganizationsService_ListHookDeliveriesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?cursor=yo>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Organizations.ListHookDeliveriesIter(t.Context(), \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListHookDeliveriesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListCursorOptions{}\n\titer = client.Organizations.ListHookDeliveriesIter(t.Context(), \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListHookDeliveriesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Organizations.ListHookDeliveriesIter(t.Context(), \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListHookDeliveriesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Organizations.ListHookDeliveriesIter(t.Context(), \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *HookDelivery, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListHookDeliveriesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestOrganizationsService_ListHooksIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Organizations.ListHooksIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListHooksIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Organizations.ListHooksIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListHooksIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Organizations.ListHooksIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListHooksIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Organizations.ListHooksIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *Hook, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListHooksIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestOrganizationsService_ListImmutableReleaseRepositoriesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"repositories\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Organizations.ListImmutableReleaseRepositoriesIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListImmutableReleaseRepositoriesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Organizations.ListImmutableReleaseRepositoriesIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListImmutableReleaseRepositoriesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Organizations.ListImmutableReleaseRepositoriesIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListImmutableReleaseRepositoriesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Organizations.ListImmutableReleaseRepositoriesIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *Repository, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListImmutableReleaseRepositoriesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestOrganizationsService_ListInstallationsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"installations\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"installations\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"installations\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"installations\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Organizations.ListInstallationsIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListInstallationsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Organizations.ListInstallationsIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListInstallationsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Organizations.ListInstallationsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListInstallationsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Organizations.ListInstallationsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *Installation, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListInstallationsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestOrganizationsService_ListMembersIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Organizations.ListMembersIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListMembersIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListMembersOptions{}\n\titer = client.Organizations.ListMembersIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListMembersIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Organizations.ListMembersIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListMembersIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Organizations.ListMembersIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *User, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListMembersIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestOrganizationsService_ListNetworkConfigurationsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"network_configurations\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"network_configurations\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"network_configurations\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"network_configurations\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Organizations.ListNetworkConfigurationsIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListNetworkConfigurationsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Organizations.ListNetworkConfigurationsIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListNetworkConfigurationsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Organizations.ListNetworkConfigurationsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListNetworkConfigurationsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Organizations.ListNetworkConfigurationsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *NetworkConfiguration, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListNetworkConfigurationsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestOrganizationsService_ListOrgInvitationTeamsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Organizations.ListOrgInvitationTeamsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListOrgInvitationTeamsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Organizations.ListOrgInvitationTeamsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListOrgInvitationTeamsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Organizations.ListOrgInvitationTeamsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListOrgInvitationTeamsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Organizations.ListOrgInvitationTeamsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Team, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListOrgInvitationTeamsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestOrganizationsService_ListOrgMembershipsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Organizations.ListOrgMembershipsIter(t.Context(), nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListOrgMembershipsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOrgMembershipsOptions{}\n\titer = client.Organizations.ListOrgMembershipsIter(t.Context(), opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListOrgMembershipsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Organizations.ListOrgMembershipsIter(t.Context(), nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListOrgMembershipsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Organizations.ListOrgMembershipsIter(t.Context(), nil)\n\tgotItems = 0\n\titer(func(item *Membership, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListOrgMembershipsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestOrganizationsService_ListOutsideCollaboratorsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Organizations.ListOutsideCollaboratorsIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListOutsideCollaboratorsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOutsideCollaboratorsOptions{}\n\titer = client.Organizations.ListOutsideCollaboratorsIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListOutsideCollaboratorsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Organizations.ListOutsideCollaboratorsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListOutsideCollaboratorsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Organizations.ListOutsideCollaboratorsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *User, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListOutsideCollaboratorsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestOrganizationsService_ListPackagesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Organizations.ListPackagesIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListPackagesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &PackageListOptions{}\n\titer = client.Organizations.ListPackagesIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListPackagesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Organizations.ListPackagesIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListPackagesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Organizations.ListPackagesIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *Package, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListPackagesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestOrganizationsService_ListPendingOrgInvitationsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Organizations.ListPendingOrgInvitationsIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListPendingOrgInvitationsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Organizations.ListPendingOrgInvitationsIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListPendingOrgInvitationsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Organizations.ListPendingOrgInvitationsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListPendingOrgInvitationsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Organizations.ListPendingOrgInvitationsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *Invitation, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListPendingOrgInvitationsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestOrganizationsService_ListTeamsAssignedToOrgRoleIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Organizations.ListTeamsAssignedToOrgRoleIter(t.Context(), \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListTeamsAssignedToOrgRoleIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Organizations.ListTeamsAssignedToOrgRoleIter(t.Context(), \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListTeamsAssignedToOrgRoleIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Organizations.ListTeamsAssignedToOrgRoleIter(t.Context(), \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListTeamsAssignedToOrgRoleIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Organizations.ListTeamsAssignedToOrgRoleIter(t.Context(), \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *Team, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListTeamsAssignedToOrgRoleIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestOrganizationsService_ListUsersAssignedToOrgRoleIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Organizations.ListUsersAssignedToOrgRoleIter(t.Context(), \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListUsersAssignedToOrgRoleIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Organizations.ListUsersAssignedToOrgRoleIter(t.Context(), \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Organizations.ListUsersAssignedToOrgRoleIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Organizations.ListUsersAssignedToOrgRoleIter(t.Context(), \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListUsersAssignedToOrgRoleIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Organizations.ListUsersAssignedToOrgRoleIter(t.Context(), \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *User, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Organizations.ListUsersAssignedToOrgRoleIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestPrivateRegistriesService_ListOrganizationPrivateRegistriesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"configurations\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"configurations\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"configurations\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"configurations\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.PrivateRegistries.ListOrganizationPrivateRegistriesIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.PrivateRegistries.ListOrganizationPrivateRegistriesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.PrivateRegistries.ListOrganizationPrivateRegistriesIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.PrivateRegistries.ListOrganizationPrivateRegistriesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.PrivateRegistries.ListOrganizationPrivateRegistriesIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.PrivateRegistries.ListOrganizationPrivateRegistriesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.PrivateRegistries.ListOrganizationPrivateRegistriesIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *PrivateRegistry, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.PrivateRegistries.ListOrganizationPrivateRegistriesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestProjectsService_ListOrganizationProjectFieldsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?after=yo>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Projects.ListOrganizationProjectFieldsIter(t.Context(), \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Projects.ListOrganizationProjectFieldsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListProjectsOptions{}\n\titer = client.Projects.ListOrganizationProjectFieldsIter(t.Context(), \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Projects.ListOrganizationProjectFieldsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Projects.ListOrganizationProjectFieldsIter(t.Context(), \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Projects.ListOrganizationProjectFieldsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Projects.ListOrganizationProjectFieldsIter(t.Context(), \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *ProjectV2Field, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Projects.ListOrganizationProjectFieldsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestProjectsService_ListOrganizationProjectItemsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?after=yo>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Projects.ListOrganizationProjectItemsIter(t.Context(), \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Projects.ListOrganizationProjectItemsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListProjectItemsOptions{}\n\titer = client.Projects.ListOrganizationProjectItemsIter(t.Context(), \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Projects.ListOrganizationProjectItemsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Projects.ListOrganizationProjectItemsIter(t.Context(), \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Projects.ListOrganizationProjectItemsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Projects.ListOrganizationProjectItemsIter(t.Context(), \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *ProjectV2Item, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Projects.ListOrganizationProjectItemsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestProjectsService_ListOrganizationProjectsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?after=yo>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Projects.ListOrganizationProjectsIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Projects.ListOrganizationProjectsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListProjectsOptions{}\n\titer = client.Projects.ListOrganizationProjectsIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Projects.ListOrganizationProjectsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Projects.ListOrganizationProjectsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Projects.ListOrganizationProjectsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Projects.ListOrganizationProjectsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *ProjectV2, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Projects.ListOrganizationProjectsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestProjectsService_ListUserProjectFieldsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?after=yo>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Projects.ListUserProjectFieldsIter(t.Context(), \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Projects.ListUserProjectFieldsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListProjectsOptions{}\n\titer = client.Projects.ListUserProjectFieldsIter(t.Context(), \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Projects.ListUserProjectFieldsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Projects.ListUserProjectFieldsIter(t.Context(), \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Projects.ListUserProjectFieldsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Projects.ListUserProjectFieldsIter(t.Context(), \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *ProjectV2Field, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Projects.ListUserProjectFieldsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestProjectsService_ListUserProjectItemsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?after=yo>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Projects.ListUserProjectItemsIter(t.Context(), \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Projects.ListUserProjectItemsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListProjectItemsOptions{}\n\titer = client.Projects.ListUserProjectItemsIter(t.Context(), \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Projects.ListUserProjectItemsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Projects.ListUserProjectItemsIter(t.Context(), \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Projects.ListUserProjectItemsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Projects.ListUserProjectItemsIter(t.Context(), \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *ProjectV2Item, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Projects.ListUserProjectItemsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestProjectsService_ListUserProjectsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?after=yo>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Projects.ListUserProjectsIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Projects.ListUserProjectsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListProjectsOptions{}\n\titer = client.Projects.ListUserProjectsIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Projects.ListUserProjectsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Projects.ListUserProjectsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Projects.ListUserProjectsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Projects.ListUserProjectsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *ProjectV2, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Projects.ListUserProjectsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestPullRequestsService_ListIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.PullRequests.ListIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.PullRequests.ListIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &PullRequestListOptions{}\n\titer = client.PullRequests.ListIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.PullRequests.ListIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.PullRequests.ListIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.PullRequests.ListIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.PullRequests.ListIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *PullRequest, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.PullRequests.ListIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestPullRequestsService_ListCommentsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.PullRequests.ListCommentsIter(t.Context(), \"\", \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.PullRequests.ListCommentsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &PullRequestListCommentsOptions{}\n\titer = client.PullRequests.ListCommentsIter(t.Context(), \"\", \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.PullRequests.ListCommentsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.PullRequests.ListCommentsIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.PullRequests.ListCommentsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.PullRequests.ListCommentsIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *PullRequestComment, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.PullRequests.ListCommentsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestPullRequestsService_ListCommitsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.PullRequests.ListCommitsIter(t.Context(), \"\", \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.PullRequests.ListCommitsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.PullRequests.ListCommitsIter(t.Context(), \"\", \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.PullRequests.ListCommitsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.PullRequests.ListCommitsIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.PullRequests.ListCommitsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.PullRequests.ListCommitsIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *RepositoryCommit, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.PullRequests.ListCommitsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestPullRequestsService_ListFilesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.PullRequests.ListFilesIter(t.Context(), \"\", \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.PullRequests.ListFilesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.PullRequests.ListFilesIter(t.Context(), \"\", \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.PullRequests.ListFilesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.PullRequests.ListFilesIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.PullRequests.ListFilesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.PullRequests.ListFilesIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *CommitFile, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.PullRequests.ListFilesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestPullRequestsService_ListPullRequestsWithCommitIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.PullRequests.ListPullRequestsWithCommitIter(t.Context(), \"\", \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.PullRequests.ListPullRequestsWithCommitIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.PullRequests.ListPullRequestsWithCommitIter(t.Context(), \"\", \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.PullRequests.ListPullRequestsWithCommitIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.PullRequests.ListPullRequestsWithCommitIter(t.Context(), \"\", \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.PullRequests.ListPullRequestsWithCommitIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.PullRequests.ListPullRequestsWithCommitIter(t.Context(), \"\", \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *PullRequest, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.PullRequests.ListPullRequestsWithCommitIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestPullRequestsService_ListReviewCommentsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.PullRequests.ListReviewCommentsIter(t.Context(), \"\", \"\", 0, 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.PullRequests.ListReviewCommentsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.PullRequests.ListReviewCommentsIter(t.Context(), \"\", \"\", 0, 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.PullRequests.ListReviewCommentsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.PullRequests.ListReviewCommentsIter(t.Context(), \"\", \"\", 0, 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.PullRequests.ListReviewCommentsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.PullRequests.ListReviewCommentsIter(t.Context(), \"\", \"\", 0, 0, nil)\n\tgotItems = 0\n\titer(func(item *PullRequestComment, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.PullRequests.ListReviewCommentsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestPullRequestsService_ListReviewsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.PullRequests.ListReviewsIter(t.Context(), \"\", \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.PullRequests.ListReviewsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.PullRequests.ListReviewsIter(t.Context(), \"\", \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.PullRequests.ListReviewsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.PullRequests.ListReviewsIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.PullRequests.ListReviewsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.PullRequests.ListReviewsIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *PullRequestReview, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.PullRequests.ListReviewsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestReactionsService_ListCommentReactionsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Reactions.ListCommentReactionsIter(t.Context(), \"\", \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Reactions.ListCommentReactionsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListReactionOptions{}\n\titer = client.Reactions.ListCommentReactionsIter(t.Context(), \"\", \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Reactions.ListCommentReactionsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Reactions.ListCommentReactionsIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Reactions.ListCommentReactionsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Reactions.ListCommentReactionsIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *Reaction, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Reactions.ListCommentReactionsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestReactionsService_ListIssueCommentReactionsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Reactions.ListIssueCommentReactionsIter(t.Context(), \"\", \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Reactions.ListIssueCommentReactionsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListReactionOptions{}\n\titer = client.Reactions.ListIssueCommentReactionsIter(t.Context(), \"\", \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Reactions.ListIssueCommentReactionsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Reactions.ListIssueCommentReactionsIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Reactions.ListIssueCommentReactionsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Reactions.ListIssueCommentReactionsIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *Reaction, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Reactions.ListIssueCommentReactionsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestReactionsService_ListIssueReactionsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Reactions.ListIssueReactionsIter(t.Context(), \"\", \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Reactions.ListIssueReactionsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListReactionOptions{}\n\titer = client.Reactions.ListIssueReactionsIter(t.Context(), \"\", \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Reactions.ListIssueReactionsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Reactions.ListIssueReactionsIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Reactions.ListIssueReactionsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Reactions.ListIssueReactionsIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *Reaction, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Reactions.ListIssueReactionsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestReactionsService_ListPullRequestCommentReactionsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Reactions.ListPullRequestCommentReactionsIter(t.Context(), \"\", \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Reactions.ListPullRequestCommentReactionsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListReactionOptions{}\n\titer = client.Reactions.ListPullRequestCommentReactionsIter(t.Context(), \"\", \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Reactions.ListPullRequestCommentReactionsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Reactions.ListPullRequestCommentReactionsIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Reactions.ListPullRequestCommentReactionsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Reactions.ListPullRequestCommentReactionsIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *Reaction, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Reactions.ListPullRequestCommentReactionsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestReactionsService_ListReleaseReactionsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Reactions.ListReleaseReactionsIter(t.Context(), \"\", \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Reactions.ListReleaseReactionsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListReactionOptions{}\n\titer = client.Reactions.ListReleaseReactionsIter(t.Context(), \"\", \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Reactions.ListReleaseReactionsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Reactions.ListReleaseReactionsIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Reactions.ListReleaseReactionsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Reactions.ListReleaseReactionsIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *Reaction, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Reactions.ListReleaseReactionsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestReactionsService_ListTeamDiscussionCommentReactionsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Reactions.ListTeamDiscussionCommentReactionsIter(t.Context(), 0, 0, 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Reactions.ListTeamDiscussionCommentReactionsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListReactionOptions{}\n\titer = client.Reactions.ListTeamDiscussionCommentReactionsIter(t.Context(), 0, 0, 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Reactions.ListTeamDiscussionCommentReactionsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Reactions.ListTeamDiscussionCommentReactionsIter(t.Context(), 0, 0, 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Reactions.ListTeamDiscussionCommentReactionsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Reactions.ListTeamDiscussionCommentReactionsIter(t.Context(), 0, 0, 0, nil)\n\tgotItems = 0\n\titer(func(item *Reaction, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Reactions.ListTeamDiscussionCommentReactionsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestReactionsService_ListTeamDiscussionReactionsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Reactions.ListTeamDiscussionReactionsIter(t.Context(), 0, 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Reactions.ListTeamDiscussionReactionsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListReactionOptions{}\n\titer = client.Reactions.ListTeamDiscussionReactionsIter(t.Context(), 0, 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Reactions.ListTeamDiscussionReactionsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Reactions.ListTeamDiscussionReactionsIter(t.Context(), 0, 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Reactions.ListTeamDiscussionReactionsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Reactions.ListTeamDiscussionReactionsIter(t.Context(), 0, 0, nil)\n\tgotItems = 0\n\titer(func(item *Reaction, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Reactions.ListTeamDiscussionReactionsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &RepositoryListOptions{}\n\titer = client.Repositories.ListIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *Repository, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListAllTopicsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"names\": [\"\",\"\",\"\"]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"names\": [\"\",\"\",\"\",\"\"]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"names\": [\"\",\"\"]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"names\": [\"\",\"\"]}`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListAllTopicsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListAllTopicsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Repositories.ListAllTopicsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListAllTopicsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListAllTopicsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListAllTopicsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListAllTopicsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item string, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListAllTopicsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListAttestationsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"attestations\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"attestations\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"attestations\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"attestations\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListAttestationsIter(t.Context(), \"\", \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListAttestationsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Repositories.ListAttestationsIter(t.Context(), \"\", \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListAttestationsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListAttestationsIter(t.Context(), \"\", \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListAttestationsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListAttestationsIter(t.Context(), \"\", \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Attestation, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListAttestationsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListBranchesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListBranchesIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListBranchesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &BranchListOptions{}\n\titer = client.Repositories.ListBranchesIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListBranchesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListBranchesIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListBranchesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListBranchesIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Branch, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListBranchesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListByAuthenticatedUserIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListByAuthenticatedUserIter(t.Context(), nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListByAuthenticatedUserIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &RepositoryListByAuthenticatedUserOptions{}\n\titer = client.Repositories.ListByAuthenticatedUserIter(t.Context(), opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListByAuthenticatedUserIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListByAuthenticatedUserIter(t.Context(), nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListByAuthenticatedUserIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListByAuthenticatedUserIter(t.Context(), nil)\n\tgotItems = 0\n\titer(func(item *Repository, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListByAuthenticatedUserIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListByOrgIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListByOrgIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListByOrgIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &RepositoryListByOrgOptions{}\n\titer = client.Repositories.ListByOrgIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListByOrgIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListByOrgIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListByOrgIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListByOrgIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *Repository, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListByOrgIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListByUserIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListByUserIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListByUserIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &RepositoryListByUserOptions{}\n\titer = client.Repositories.ListByUserIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListByUserIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListByUserIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListByUserIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListByUserIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *Repository, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListByUserIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListCollaboratorsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListCollaboratorsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListCollaboratorsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListCollaboratorsOptions{}\n\titer = client.Repositories.ListCollaboratorsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListCollaboratorsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListCollaboratorsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListCollaboratorsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListCollaboratorsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *User, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListCollaboratorsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListCommentsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListCommentsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListCommentsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Repositories.ListCommentsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListCommentsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListCommentsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListCommentsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListCommentsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *RepositoryComment, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListCommentsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListCommitCommentsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListCommitCommentsIter(t.Context(), \"\", \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListCommitCommentsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Repositories.ListCommitCommentsIter(t.Context(), \"\", \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListCommitCommentsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListCommitCommentsIter(t.Context(), \"\", \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListCommitCommentsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListCommitCommentsIter(t.Context(), \"\", \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *RepositoryComment, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListCommitCommentsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListCommitsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListCommitsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListCommitsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &CommitsListOptions{}\n\titer = client.Repositories.ListCommitsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListCommitsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListCommitsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListCommitsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListCommitsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *RepositoryCommit, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListCommitsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListContributorsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListContributorsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListContributorsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListContributorsOptions{}\n\titer = client.Repositories.ListContributorsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListContributorsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListContributorsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListContributorsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListContributorsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Contributor, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListContributorsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListCustomDeploymentRuleIntegrationsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"available_custom_deployment_protection_rule_integrations\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"available_custom_deployment_protection_rule_integrations\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"available_custom_deployment_protection_rule_integrations\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"available_custom_deployment_protection_rule_integrations\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListCustomDeploymentRuleIntegrationsIter(t.Context(), \"\", \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListCustomDeploymentRuleIntegrationsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Repositories.ListCustomDeploymentRuleIntegrationsIter(t.Context(), \"\", \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListCustomDeploymentRuleIntegrationsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListCustomDeploymentRuleIntegrationsIter(t.Context(), \"\", \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListCustomDeploymentRuleIntegrationsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListCustomDeploymentRuleIntegrationsIter(t.Context(), \"\", \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *CustomDeploymentProtectionRuleApp, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListCustomDeploymentRuleIntegrationsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListDeploymentBranchPoliciesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"branch_policies\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"branch_policies\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"branch_policies\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"branch_policies\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListDeploymentBranchPoliciesIter(t.Context(), \"\", \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListDeploymentBranchPoliciesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Repositories.ListDeploymentBranchPoliciesIter(t.Context(), \"\", \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListDeploymentBranchPoliciesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListDeploymentBranchPoliciesIter(t.Context(), \"\", \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListDeploymentBranchPoliciesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListDeploymentBranchPoliciesIter(t.Context(), \"\", \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *DeploymentBranchPolicy, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListDeploymentBranchPoliciesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListDeploymentStatusesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListDeploymentStatusesIter(t.Context(), \"\", \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListDeploymentStatusesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Repositories.ListDeploymentStatusesIter(t.Context(), \"\", \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListDeploymentStatusesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListDeploymentStatusesIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListDeploymentStatusesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListDeploymentStatusesIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *DeploymentStatus, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListDeploymentStatusesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListDeploymentsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListDeploymentsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListDeploymentsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &DeploymentsListOptions{}\n\titer = client.Repositories.ListDeploymentsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListDeploymentsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListDeploymentsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListDeploymentsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListDeploymentsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Deployment, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListDeploymentsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListEnvironmentsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"environments\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"environments\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"environments\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"environments\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListEnvironmentsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListEnvironmentsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &EnvironmentListOptions{}\n\titer = client.Repositories.ListEnvironmentsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListEnvironmentsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListEnvironmentsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListEnvironmentsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListEnvironmentsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Environment, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListEnvironmentsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListForksIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListForksIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListForksIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &RepositoryListForksOptions{}\n\titer = client.Repositories.ListForksIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListForksIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListForksIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListForksIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListForksIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Repository, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListForksIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListHookDeliveriesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?cursor=yo>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListHookDeliveriesIter(t.Context(), \"\", \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListHookDeliveriesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListCursorOptions{}\n\titer = client.Repositories.ListHookDeliveriesIter(t.Context(), \"\", \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListHookDeliveriesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListHookDeliveriesIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListHookDeliveriesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListHookDeliveriesIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *HookDelivery, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListHookDeliveriesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListHooksIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListHooksIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListHooksIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Repositories.ListHooksIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListHooksIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListHooksIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListHooksIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListHooksIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Hook, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListHooksIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListInvitationsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListInvitationsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListInvitationsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Repositories.ListInvitationsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListInvitationsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListInvitationsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListInvitationsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListInvitationsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *RepositoryInvitation, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListInvitationsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListKeysIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListKeysIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListKeysIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Repositories.ListKeysIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListKeysIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListKeysIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListKeysIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListKeysIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Key, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListKeysIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListPagesBuildsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListPagesBuildsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListPagesBuildsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Repositories.ListPagesBuildsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListPagesBuildsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListPagesBuildsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListPagesBuildsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListPagesBuildsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *PagesBuild, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListPagesBuildsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListPreReceiveHooksIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListPreReceiveHooksIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListPreReceiveHooksIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Repositories.ListPreReceiveHooksIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListPreReceiveHooksIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListPreReceiveHooksIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListPreReceiveHooksIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListPreReceiveHooksIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *PreReceiveHook, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListPreReceiveHooksIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListReleaseAssetsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListReleaseAssetsIter(t.Context(), \"\", \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListReleaseAssetsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Repositories.ListReleaseAssetsIter(t.Context(), \"\", \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListReleaseAssetsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListReleaseAssetsIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListReleaseAssetsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListReleaseAssetsIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *ReleaseAsset, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListReleaseAssetsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListReleasesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListReleasesIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListReleasesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Repositories.ListReleasesIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListReleasesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListReleasesIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListReleasesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListReleasesIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *RepositoryRelease, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListReleasesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListRepositoryActivitiesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?after=yo>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListRepositoryActivitiesIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListRepositoryActivitiesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListRepositoryActivityOptions{}\n\titer = client.Repositories.ListRepositoryActivitiesIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListRepositoryActivitiesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListRepositoryActivitiesIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListRepositoryActivitiesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListRepositoryActivitiesIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *RepositoryActivity, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListRepositoryActivitiesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListStatusesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListStatusesIter(t.Context(), \"\", \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListStatusesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Repositories.ListStatusesIter(t.Context(), \"\", \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListStatusesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListStatusesIter(t.Context(), \"\", \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListStatusesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListStatusesIter(t.Context(), \"\", \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *RepoStatus, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListStatusesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListTagsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListTagsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListTagsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Repositories.ListTagsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListTagsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListTagsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListTagsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListTagsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *RepositoryTag, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListTagsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestRepositoriesService_ListTeamsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Repositories.ListTeamsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListTeamsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Repositories.ListTeamsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Repositories.ListTeamsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Repositories.ListTeamsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListTeamsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Repositories.ListTeamsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Team, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Repositories.ListTeamsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestSecretScanningService_ListAlertsForEnterpriseIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?after=yo>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.SecretScanning.ListAlertsForEnterpriseIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.SecretScanning.ListAlertsForEnterpriseIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &SecretScanningAlertListOptions{}\n\titer = client.SecretScanning.ListAlertsForEnterpriseIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.SecretScanning.ListAlertsForEnterpriseIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.SecretScanning.ListAlertsForEnterpriseIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.SecretScanning.ListAlertsForEnterpriseIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.SecretScanning.ListAlertsForEnterpriseIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *SecretScanningAlert, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.SecretScanning.ListAlertsForEnterpriseIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestSecretScanningService_ListAlertsForOrgIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?after=yo>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.SecretScanning.ListAlertsForOrgIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.SecretScanning.ListAlertsForOrgIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &SecretScanningAlertListOptions{}\n\titer = client.SecretScanning.ListAlertsForOrgIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.SecretScanning.ListAlertsForOrgIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.SecretScanning.ListAlertsForOrgIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.SecretScanning.ListAlertsForOrgIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.SecretScanning.ListAlertsForOrgIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *SecretScanningAlert, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.SecretScanning.ListAlertsForOrgIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestSecretScanningService_ListAlertsForRepoIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?after=yo>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.SecretScanning.ListAlertsForRepoIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.SecretScanning.ListAlertsForRepoIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &SecretScanningAlertListOptions{}\n\titer = client.SecretScanning.ListAlertsForRepoIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.SecretScanning.ListAlertsForRepoIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.SecretScanning.ListAlertsForRepoIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.SecretScanning.ListAlertsForRepoIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.SecretScanning.ListAlertsForRepoIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *SecretScanningAlert, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.SecretScanning.ListAlertsForRepoIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestSecretScanningService_ListLocationsForAlertIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.SecretScanning.ListLocationsForAlertIter(t.Context(), \"\", \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.SecretScanning.ListLocationsForAlertIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.SecretScanning.ListLocationsForAlertIter(t.Context(), \"\", \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.SecretScanning.ListLocationsForAlertIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.SecretScanning.ListLocationsForAlertIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.SecretScanning.ListLocationsForAlertIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.SecretScanning.ListLocationsForAlertIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *SecretScanningAlertLocation, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.SecretScanning.ListLocationsForAlertIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestSecurityAdvisoriesService_ListGlobalSecurityAdvisoriesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?after=yo>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.SecurityAdvisories.ListGlobalSecurityAdvisoriesIter(t.Context(), nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.SecurityAdvisories.ListGlobalSecurityAdvisoriesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListGlobalSecurityAdvisoriesOptions{}\n\titer = client.SecurityAdvisories.ListGlobalSecurityAdvisoriesIter(t.Context(), opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.SecurityAdvisories.ListGlobalSecurityAdvisoriesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.SecurityAdvisories.ListGlobalSecurityAdvisoriesIter(t.Context(), nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.SecurityAdvisories.ListGlobalSecurityAdvisoriesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.SecurityAdvisories.ListGlobalSecurityAdvisoriesIter(t.Context(), nil)\n\tgotItems = 0\n\titer(func(item *GlobalSecurityAdvisory, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.SecurityAdvisories.ListGlobalSecurityAdvisoriesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?after=yo>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.SecurityAdvisories.ListRepositorySecurityAdvisoriesIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.SecurityAdvisories.ListRepositorySecurityAdvisoriesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListRepositorySecurityAdvisoriesOptions{}\n\titer = client.SecurityAdvisories.ListRepositorySecurityAdvisoriesIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.SecurityAdvisories.ListRepositorySecurityAdvisoriesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.SecurityAdvisories.ListRepositorySecurityAdvisoriesIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.SecurityAdvisories.ListRepositorySecurityAdvisoriesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.SecurityAdvisories.ListRepositorySecurityAdvisoriesIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *SecurityAdvisory, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.SecurityAdvisories.ListRepositorySecurityAdvisoriesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrgIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?after=yo>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.SecurityAdvisories.ListRepositorySecurityAdvisoriesForOrgIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.SecurityAdvisories.ListRepositorySecurityAdvisoriesForOrgIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListRepositorySecurityAdvisoriesOptions{}\n\titer = client.SecurityAdvisories.ListRepositorySecurityAdvisoriesForOrgIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.SecurityAdvisories.ListRepositorySecurityAdvisoriesForOrgIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.SecurityAdvisories.ListRepositorySecurityAdvisoriesForOrgIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.SecurityAdvisories.ListRepositorySecurityAdvisoriesForOrgIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.SecurityAdvisories.ListRepositorySecurityAdvisoriesForOrgIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *SecurityAdvisory, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.SecurityAdvisories.ListRepositorySecurityAdvisoriesForOrgIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestSubIssueService_ListByIssueIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.SubIssue.ListByIssueIter(t.Context(), \"\", \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.SubIssue.ListByIssueIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.SubIssue.ListByIssueIter(t.Context(), \"\", \"\", 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.SubIssue.ListByIssueIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.SubIssue.ListByIssueIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.SubIssue.ListByIssueIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.SubIssue.ListByIssueIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *SubIssue, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.SubIssue.ListByIssueIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestTeamsService_ListChildTeamsByParentIDIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Teams.ListChildTeamsByParentIDIter(t.Context(), 0, 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListChildTeamsByParentIDIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Teams.ListChildTeamsByParentIDIter(t.Context(), 0, 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListChildTeamsByParentIDIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Teams.ListChildTeamsByParentIDIter(t.Context(), 0, 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListChildTeamsByParentIDIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Teams.ListChildTeamsByParentIDIter(t.Context(), 0, 0, nil)\n\tgotItems = 0\n\titer(func(item *Team, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListChildTeamsByParentIDIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestTeamsService_ListChildTeamsByParentSlugIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Teams.ListChildTeamsByParentSlugIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListChildTeamsByParentSlugIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Teams.ListChildTeamsByParentSlugIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListChildTeamsByParentSlugIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Teams.ListChildTeamsByParentSlugIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListChildTeamsByParentSlugIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Teams.ListChildTeamsByParentSlugIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Team, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListChildTeamsByParentSlugIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestTeamsService_ListCommentsByIDIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Teams.ListCommentsByIDIter(t.Context(), 0, 0, 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListCommentsByIDIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\toptions := &DiscussionCommentListOptions{}\n\titer = client.Teams.ListCommentsByIDIter(t.Context(), 0, 0, 0, options)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListCommentsByIDIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Teams.ListCommentsByIDIter(t.Context(), 0, 0, 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListCommentsByIDIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Teams.ListCommentsByIDIter(t.Context(), 0, 0, 0, nil)\n\tgotItems = 0\n\titer(func(item *DiscussionComment, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListCommentsByIDIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestTeamsService_ListCommentsBySlugIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Teams.ListCommentsBySlugIter(t.Context(), \"\", \"\", 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListCommentsBySlugIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\toptions := &DiscussionCommentListOptions{}\n\titer = client.Teams.ListCommentsBySlugIter(t.Context(), \"\", \"\", 0, options)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListCommentsBySlugIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Teams.ListCommentsBySlugIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListCommentsBySlugIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Teams.ListCommentsBySlugIter(t.Context(), \"\", \"\", 0, nil)\n\tgotItems = 0\n\titer(func(item *DiscussionComment, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListCommentsBySlugIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestTeamsService_ListDiscussionsByIDIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Teams.ListDiscussionsByIDIter(t.Context(), 0, 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListDiscussionsByIDIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &DiscussionListOptions{}\n\titer = client.Teams.ListDiscussionsByIDIter(t.Context(), 0, 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListDiscussionsByIDIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Teams.ListDiscussionsByIDIter(t.Context(), 0, 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListDiscussionsByIDIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Teams.ListDiscussionsByIDIter(t.Context(), 0, 0, nil)\n\tgotItems = 0\n\titer(func(item *TeamDiscussion, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListDiscussionsByIDIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestTeamsService_ListDiscussionsBySlugIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Teams.ListDiscussionsBySlugIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListDiscussionsBySlugIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &DiscussionListOptions{}\n\titer = client.Teams.ListDiscussionsBySlugIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListDiscussionsBySlugIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Teams.ListDiscussionsBySlugIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListDiscussionsBySlugIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Teams.ListDiscussionsBySlugIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *TeamDiscussion, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListDiscussionsBySlugIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestTeamsService_ListExternalGroupsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"groups\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"groups\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"groups\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"groups\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Teams.ListExternalGroupsIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListExternalGroupsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListExternalGroupsOptions{}\n\titer = client.Teams.ListExternalGroupsIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListExternalGroupsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Teams.ListExternalGroupsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListExternalGroupsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Teams.ListExternalGroupsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *ExternalGroup, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListExternalGroupsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestTeamsService_ListIDPGroupsInOrganizationIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?after=yo>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"groups\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"groups\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"groups\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"groups\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Teams.ListIDPGroupsInOrganizationIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListIDPGroupsInOrganizationIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListIDPGroupsOptions{}\n\titer = client.Teams.ListIDPGroupsInOrganizationIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListIDPGroupsInOrganizationIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Teams.ListIDPGroupsInOrganizationIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListIDPGroupsInOrganizationIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Teams.ListIDPGroupsInOrganizationIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *IDPGroup, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListIDPGroupsInOrganizationIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestTeamsService_ListPendingTeamInvitationsByIDIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Teams.ListPendingTeamInvitationsByIDIter(t.Context(), 0, 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListPendingTeamInvitationsByIDIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Teams.ListPendingTeamInvitationsByIDIter(t.Context(), 0, 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListPendingTeamInvitationsByIDIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Teams.ListPendingTeamInvitationsByIDIter(t.Context(), 0, 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListPendingTeamInvitationsByIDIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Teams.ListPendingTeamInvitationsByIDIter(t.Context(), 0, 0, nil)\n\tgotItems = 0\n\titer(func(item *Invitation, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListPendingTeamInvitationsByIDIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestTeamsService_ListPendingTeamInvitationsBySlugIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Teams.ListPendingTeamInvitationsBySlugIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListPendingTeamInvitationsBySlugIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Teams.ListPendingTeamInvitationsBySlugIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListPendingTeamInvitationsBySlugIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Teams.ListPendingTeamInvitationsBySlugIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListPendingTeamInvitationsBySlugIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Teams.ListPendingTeamInvitationsBySlugIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Invitation, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListPendingTeamInvitationsBySlugIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestTeamsService_ListTeamMembersByIDIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Teams.ListTeamMembersByIDIter(t.Context(), 0, 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListTeamMembersByIDIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &TeamListTeamMembersOptions{}\n\titer = client.Teams.ListTeamMembersByIDIter(t.Context(), 0, 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListTeamMembersByIDIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Teams.ListTeamMembersByIDIter(t.Context(), 0, 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListTeamMembersByIDIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Teams.ListTeamMembersByIDIter(t.Context(), 0, 0, nil)\n\tgotItems = 0\n\titer(func(item *User, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListTeamMembersByIDIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestTeamsService_ListTeamMembersBySlugIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Teams.ListTeamMembersBySlugIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListTeamMembersBySlugIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &TeamListTeamMembersOptions{}\n\titer = client.Teams.ListTeamMembersBySlugIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListTeamMembersBySlugIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Teams.ListTeamMembersBySlugIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListTeamMembersBySlugIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Teams.ListTeamMembersBySlugIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *User, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListTeamMembersBySlugIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestTeamsService_ListTeamReposByIDIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Teams.ListTeamReposByIDIter(t.Context(), 0, 0, nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListTeamReposByIDIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Teams.ListTeamReposByIDIter(t.Context(), 0, 0, opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListTeamReposByIDIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Teams.ListTeamReposByIDIter(t.Context(), 0, 0, nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListTeamReposByIDIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Teams.ListTeamReposByIDIter(t.Context(), 0, 0, nil)\n\tgotItems = 0\n\titer(func(item *Repository, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListTeamReposByIDIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestTeamsService_ListTeamReposBySlugIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Teams.ListTeamReposBySlugIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListTeamReposBySlugIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Teams.ListTeamReposBySlugIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListTeamReposBySlugIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Teams.ListTeamReposBySlugIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListTeamReposBySlugIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Teams.ListTeamReposBySlugIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Repository, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListTeamReposBySlugIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestTeamsService_ListTeamsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Teams.ListTeamsIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListTeamsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Teams.ListTeamsIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListTeamsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Teams.ListTeamsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListTeamsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Teams.ListTeamsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *Team, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListTeamsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestTeamsService_ListUserTeamsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Teams.ListUserTeamsIter(t.Context(), nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListUserTeamsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Teams.ListUserTeamsIter(t.Context(), opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Teams.ListUserTeamsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Teams.ListUserTeamsIter(t.Context(), nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListUserTeamsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Teams.ListUserTeamsIter(t.Context(), nil)\n\tgotItems = 0\n\titer(func(item *Team, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Teams.ListUserTeamsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestUsersService_ListAttestationsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `{\"attestations\": [{},{},{}]}`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `{\"attestations\": [{},{},{},{}]}`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `{\"attestations\": [{},{}]}`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `{\"attestations\": [{},{}]}`)\n\t\t}\n\t})\n\n\titer := client.Users.ListAttestationsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Users.ListAttestationsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Users.ListAttestationsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Users.ListAttestationsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Users.ListAttestationsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Users.ListAttestationsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Users.ListAttestationsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *Attestation, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Users.ListAttestationsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestUsersService_ListBlockedUsersIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Users.ListBlockedUsersIter(t.Context(), nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Users.ListBlockedUsersIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Users.ListBlockedUsersIter(t.Context(), opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Users.ListBlockedUsersIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Users.ListBlockedUsersIter(t.Context(), nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Users.ListBlockedUsersIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Users.ListBlockedUsersIter(t.Context(), nil)\n\tgotItems = 0\n\titer(func(item *User, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Users.ListBlockedUsersIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestUsersService_ListEmailsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Users.ListEmailsIter(t.Context(), nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Users.ListEmailsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Users.ListEmailsIter(t.Context(), opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Users.ListEmailsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Users.ListEmailsIter(t.Context(), nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Users.ListEmailsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Users.ListEmailsIter(t.Context(), nil)\n\tgotItems = 0\n\titer(func(item *UserEmail, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Users.ListEmailsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestUsersService_ListFollowersIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Users.ListFollowersIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Users.ListFollowersIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Users.ListFollowersIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Users.ListFollowersIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Users.ListFollowersIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Users.ListFollowersIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Users.ListFollowersIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *User, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Users.ListFollowersIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestUsersService_ListFollowingIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Users.ListFollowingIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Users.ListFollowingIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Users.ListFollowingIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Users.ListFollowingIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Users.ListFollowingIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Users.ListFollowingIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Users.ListFollowingIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *User, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Users.ListFollowingIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestUsersService_ListGPGKeysIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Users.ListGPGKeysIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Users.ListGPGKeysIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Users.ListGPGKeysIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Users.ListGPGKeysIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Users.ListGPGKeysIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Users.ListGPGKeysIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Users.ListGPGKeysIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *GPGKey, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Users.ListGPGKeysIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestUsersService_ListInvitationsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Users.ListInvitationsIter(t.Context(), nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Users.ListInvitationsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Users.ListInvitationsIter(t.Context(), opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Users.ListInvitationsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Users.ListInvitationsIter(t.Context(), nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Users.ListInvitationsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Users.ListInvitationsIter(t.Context(), nil)\n\tgotItems = 0\n\titer(func(item *RepositoryInvitation, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Users.ListInvitationsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestUsersService_ListKeysIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Users.ListKeysIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Users.ListKeysIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Users.ListKeysIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Users.ListKeysIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Users.ListKeysIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Users.ListKeysIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Users.ListKeysIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *Key, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Users.ListKeysIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestUsersService_ListPackageVersionsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Users.ListPackageVersionsIter(t.Context(), \"\", \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Users.ListPackageVersionsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListPackageVersionsOptions{}\n\titer = client.Users.ListPackageVersionsIter(t.Context(), \"\", \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Users.ListPackageVersionsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Users.ListPackageVersionsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Users.ListPackageVersionsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Users.ListPackageVersionsIter(t.Context(), \"\", \"\", nil)\n\tgotItems = 0\n\titer(func(item *PackageVersion, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Users.ListPackageVersionsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestUsersService_ListPackagesIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Users.ListPackagesIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Users.ListPackagesIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &PackageListOptions{}\n\titer = client.Users.ListPackagesIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Users.ListPackagesIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Users.ListPackagesIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Users.ListPackagesIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Users.ListPackagesIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *Package, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Users.ListPackagesIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestUsersService_ListSSHSigningKeysIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Users.ListSSHSigningKeysIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Users.ListSSHSigningKeysIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Users.ListSSHSigningKeysIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Users.ListSSHSigningKeysIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Users.ListSSHSigningKeysIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Users.ListSSHSigningKeysIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Users.ListSSHSigningKeysIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *SSHSigningKey, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Users.ListSSHSigningKeysIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestUsersService_ListSocialAccountsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Users.ListSocialAccountsIter(t.Context(), nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Users.ListSocialAccountsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Users.ListSocialAccountsIter(t.Context(), opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Users.ListSocialAccountsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Users.ListSocialAccountsIter(t.Context(), nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Users.ListSocialAccountsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Users.ListSocialAccountsIter(t.Context(), nil)\n\tgotItems = 0\n\titer(func(item *SocialAccount, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Users.ListSocialAccountsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n\nfunc TestUsersService_ListUserSocialAccountsIter(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tvar callNum int\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tcallNum++\n\t\tswitch callNum {\n\t\tcase 1:\n\t\t\tw.Header().Set(\"Link\", `<https://api.github.com/?page=1>; rel=\"next\"`)\n\t\t\tfmt.Fprint(w, `[{},{},{}]`)\n\t\tcase 2:\n\t\t\tfmt.Fprint(w, `[{},{},{},{}]`)\n\t\tcase 3:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\tcase 4:\n\t\t\tw.WriteHeader(http.StatusNotFound)\n\t\tcase 5:\n\t\t\tfmt.Fprint(w, `[{},{}]`)\n\t\t}\n\t})\n\n\titer := client.Users.ListUserSocialAccountsIter(t.Context(), \"\", nil)\n\tvar gotItems int\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 7; gotItems != want {\n\t\tt.Errorf(\"client.Users.ListUserSocialAccountsIter call 1 got %v items; want %v\", gotItems, want)\n\t}\n\n\topts := &ListOptions{}\n\titer = client.Users.ListUserSocialAccountsIter(t.Context(), \"\", opts)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t}\n\tif want := 2; gotItems != want {\n\t\tt.Errorf(\"client.Users.ListUserSocialAccountsIter call 2 got %v items; want %v\", gotItems, want)\n\t}\n\n\titer = client.Users.ListUserSocialAccountsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\tfor _, err := range iter {\n\t\tgotItems++\n\t\tif err == nil {\n\t\t\tt.Error(\"expected error; got nil\")\n\t\t}\n\t}\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Users.ListUserSocialAccountsIter call 3 got %v items; want 1 (an error)\", gotItems)\n\t}\n\n\titer = client.Users.ListUserSocialAccountsIter(t.Context(), \"\", nil)\n\tgotItems = 0\n\titer(func(item *SocialAccount, err error) bool {\n\t\tgotItems++\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unexpected error: %v\", err)\n\t\t}\n\t\treturn false\n\t})\n\tif gotItems != 1 {\n\t\tt.Errorf(\"client.Users.ListUserSocialAccountsIter call 4 got %v items; want 1 (an error)\", gotItems)\n\t}\n}\n"
  },
  {
    "path": "github/github-stringify_test.go",
    "content": "// Code generated by gen-stringify-tests; DO NOT EDIT.\n// Instead, please run \"go generate ./...\" as described here:\n// https://github.com/google/go-github/blob/master/CONTRIBUTING.md#submitting-a-patch\n\n// Copyright 2019 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"testing\"\n)\n\nfunc TestAcceptedAssignment_String(t *testing.T) {\n\tt.Parallel()\n\tv := AcceptedAssignment{\n\t\tID:          Ptr(int64(0)),\n\t\tSubmitted:   Ptr(false),\n\t\tPassing:     Ptr(false),\n\t\tCommitCount: Ptr(0),\n\t\tGrade:       Ptr(\"\"),\n\t\tRepository:  &Repository{},\n\t\tAssignment:  &ClassroomAssignment{},\n\t}\n\twant := `github.AcceptedAssignment{ID:0, Submitted:false, Passing:false, CommitCount:0, Grade:\"\", Repository:github.Repository{}, Assignment:github.ClassroomAssignment{}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"AcceptedAssignment.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestActionsAllowed_String(t *testing.T) {\n\tt.Parallel()\n\tv := ActionsAllowed{\n\t\tGithubOwnedAllowed: Ptr(false),\n\t\tVerifiedAllowed:    Ptr(false),\n\t\tPatternsAllowed:    []string{\"\"},\n\t}\n\twant := `github.ActionsAllowed{GithubOwnedAllowed:false, VerifiedAllowed:false, PatternsAllowed:[\"\"]}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"ActionsAllowed.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestActionsPermissions_String(t *testing.T) {\n\tt.Parallel()\n\tv := ActionsPermissions{\n\t\tEnabledRepositories: Ptr(\"\"),\n\t\tAllowedActions:      Ptr(\"\"),\n\t\tSelectedActionsURL:  Ptr(\"\"),\n\t\tSHAPinningRequired:  Ptr(false),\n\t}\n\twant := `github.ActionsPermissions{EnabledRepositories:\"\", AllowedActions:\"\", SelectedActionsURL:\"\", SHAPinningRequired:false}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"ActionsPermissions.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestActionsPermissionsEnterprise_String(t *testing.T) {\n\tt.Parallel()\n\tv := ActionsPermissionsEnterprise{\n\t\tEnabledOrganizations: Ptr(\"\"),\n\t\tAllowedActions:       Ptr(\"\"),\n\t\tSelectedActionsURL:   Ptr(\"\"),\n\t}\n\twant := `github.ActionsPermissionsEnterprise{EnabledOrganizations:\"\", AllowedActions:\"\", SelectedActionsURL:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"ActionsPermissionsEnterprise.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestActionsPermissionsRepository_String(t *testing.T) {\n\tt.Parallel()\n\tv := ActionsPermissionsRepository{\n\t\tEnabled:            Ptr(false),\n\t\tAllowedActions:     Ptr(\"\"),\n\t\tSelectedActionsURL: Ptr(\"\"),\n\t\tSHAPinningRequired: Ptr(false),\n\t}\n\twant := `github.ActionsPermissionsRepository{Enabled:false, AllowedActions:\"\", SelectedActionsURL:\"\", SHAPinningRequired:false}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"ActionsPermissionsRepository.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestAdminStats_String(t *testing.T) {\n\tt.Parallel()\n\tv := AdminStats{\n\t\tIssues:     &IssueStats{},\n\t\tHooks:      &HookStats{},\n\t\tMilestones: &MilestoneStats{},\n\t\tOrgs:       &OrgStats{},\n\t\tComments:   &CommentStats{},\n\t\tPages:      &PageStats{},\n\t\tUsers:      &UserStats{},\n\t\tGists:      &GistStats{},\n\t\tPulls:      &PullStats{},\n\t\tRepos:      &RepoStats{},\n\t}\n\twant := `github.AdminStats{Issues:github.IssueStats{}, Hooks:github.HookStats{}, Milestones:github.MilestoneStats{}, Orgs:github.OrgStats{}, Comments:github.CommentStats{}, Pages:github.PageStats{}, Users:github.UserStats{}, Gists:github.GistStats{}, Pulls:github.PullStats{}, Repos:github.RepoStats{}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"AdminStats.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestAdvancedSecurity_String(t *testing.T) {\n\tt.Parallel()\n\tv := AdvancedSecurity{\n\t\tStatus: Ptr(\"\"),\n\t}\n\twant := `github.AdvancedSecurity{Status:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"AdvancedSecurity.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestArtifactPeriod_String(t *testing.T) {\n\tt.Parallel()\n\tv := ArtifactPeriod{\n\t\tDays:               Ptr(0),\n\t\tMaximumAllowedDays: Ptr(0),\n\t}\n\twant := `github.ArtifactPeriod{Days:0, MaximumAllowedDays:0}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"ArtifactPeriod.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestAssignmentGrade_String(t *testing.T) {\n\tt.Parallel()\n\tv := AssignmentGrade{\n\t\tAssignmentName:        Ptr(\"\"),\n\t\tAssignmentURL:         Ptr(\"\"),\n\t\tStarterCodeURL:        Ptr(\"\"),\n\t\tGithubUsername:        Ptr(\"\"),\n\t\tRosterIdentifier:      Ptr(\"\"),\n\t\tStudentRepositoryName: Ptr(\"\"),\n\t\tStudentRepositoryURL:  Ptr(\"\"),\n\t\tSubmissionTimestamp:   &Timestamp{},\n\t\tPointsAwarded:         Ptr(0),\n\t\tPointsAvailable:       Ptr(0),\n\t\tGroupName:             Ptr(\"\"),\n\t}\n\twant := `github.AssignmentGrade{AssignmentName:\"\", AssignmentURL:\"\", StarterCodeURL:\"\", GithubUsername:\"\", RosterIdentifier:\"\", StudentRepositoryName:\"\", StudentRepositoryURL:\"\", SubmissionTimestamp:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, PointsAwarded:0, PointsAvailable:0, GroupName:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"AssignmentGrade.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestAuthorization_String(t *testing.T) {\n\tt.Parallel()\n\tv := Authorization{\n\t\tID:             Ptr(int64(0)),\n\t\tURL:            Ptr(\"\"),\n\t\tScopes:         []Scope{ScopeNone},\n\t\tToken:          Ptr(\"\"),\n\t\tTokenLastEight: Ptr(\"\"),\n\t\tHashedToken:    Ptr(\"\"),\n\t\tApp:            &AuthorizationApp{},\n\t\tNote:           Ptr(\"\"),\n\t\tNoteURL:        Ptr(\"\"),\n\t\tUpdatedAt:      &Timestamp{},\n\t\tCreatedAt:      &Timestamp{},\n\t\tFingerprint:    Ptr(\"\"),\n\t\tUser:           &User{},\n\t}\n\twant := `github.Authorization{ID:0, URL:\"\", Scopes:[\"(no scope)\"], Token:\"\", TokenLastEight:\"\", HashedToken:\"\", App:github.AuthorizationApp{}, Note:\"\", NoteURL:\"\", UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Fingerprint:\"\", User:github.User{}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"Authorization.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestAuthorizationApp_String(t *testing.T) {\n\tt.Parallel()\n\tv := AuthorizationApp{\n\t\tURL:      Ptr(\"\"),\n\t\tName:     Ptr(\"\"),\n\t\tClientID: Ptr(\"\"),\n\t}\n\twant := `github.AuthorizationApp{URL:\"\", Name:\"\", ClientID:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"AuthorizationApp.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestAuthorizationRequest_String(t *testing.T) {\n\tt.Parallel()\n\tv := AuthorizationRequest{\n\t\tScopes:       []Scope{ScopeNone},\n\t\tNote:         Ptr(\"\"),\n\t\tNoteURL:      Ptr(\"\"),\n\t\tClientID:     Ptr(\"\"),\n\t\tClientSecret: Ptr(\"\"),\n\t\tFingerprint:  Ptr(\"\"),\n\t}\n\twant := `github.AuthorizationRequest{Scopes:[\"(no scope)\"], Note:\"\", NoteURL:\"\", ClientID:\"\", ClientSecret:\"\", Fingerprint:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"AuthorizationRequest.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestAuthorizationUpdateRequest_String(t *testing.T) {\n\tt.Parallel()\n\tv := AuthorizationUpdateRequest{\n\t\tScopes:       []string{\"\"},\n\t\tAddScopes:    []string{\"\"},\n\t\tRemoveScopes: []string{\"\"},\n\t\tNote:         Ptr(\"\"),\n\t\tNoteURL:      Ptr(\"\"),\n\t\tFingerprint:  Ptr(\"\"),\n\t}\n\twant := `github.AuthorizationUpdateRequest{Scopes:[\"\"], AddScopes:[\"\"], RemoveScopes:[\"\"], Note:\"\", NoteURL:\"\", Fingerprint:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"AuthorizationUpdateRequest.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestCheckRun_String(t *testing.T) {\n\tt.Parallel()\n\tv := CheckRun{\n\t\tID:          Ptr(int64(0)),\n\t\tNodeID:      Ptr(\"\"),\n\t\tHeadSHA:     Ptr(\"\"),\n\t\tExternalID:  Ptr(\"\"),\n\t\tURL:         Ptr(\"\"),\n\t\tHTMLURL:     Ptr(\"\"),\n\t\tDetailsURL:  Ptr(\"\"),\n\t\tStatus:      Ptr(\"\"),\n\t\tConclusion:  Ptr(\"\"),\n\t\tStartedAt:   &Timestamp{},\n\t\tCompletedAt: &Timestamp{},\n\t\tOutput:      &CheckRunOutput{},\n\t\tName:        Ptr(\"\"),\n\t\tCheckSuite:  &CheckSuite{},\n\t\tApp:         &App{},\n\t}\n\twant := `github.CheckRun{ID:0, NodeID:\"\", HeadSHA:\"\", ExternalID:\"\", URL:\"\", HTMLURL:\"\", DetailsURL:\"\", Status:\"\", Conclusion:\"\", StartedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, CompletedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Output:github.CheckRunOutput{}, Name:\"\", CheckSuite:github.CheckSuite{}, App:github.App{}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"CheckRun.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestCheckSuite_String(t *testing.T) {\n\tt.Parallel()\n\tv := CheckSuite{\n\t\tID:                   Ptr(int64(0)),\n\t\tNodeID:               Ptr(\"\"),\n\t\tHeadBranch:           Ptr(\"\"),\n\t\tHeadSHA:              Ptr(\"\"),\n\t\tURL:                  Ptr(\"\"),\n\t\tBeforeSHA:            Ptr(\"\"),\n\t\tAfterSHA:             Ptr(\"\"),\n\t\tStatus:               Ptr(\"\"),\n\t\tConclusion:           Ptr(\"\"),\n\t\tCreatedAt:            &Timestamp{},\n\t\tUpdatedAt:            &Timestamp{},\n\t\tApp:                  &App{},\n\t\tRepository:           &Repository{},\n\t\tHeadCommit:           &Commit{},\n\t\tLatestCheckRunsCount: Ptr(int64(0)),\n\t\tRerequestable:        Ptr(false),\n\t\tRunsRerequestable:    Ptr(false),\n\t}\n\twant := `github.CheckSuite{ID:0, NodeID:\"\", HeadBranch:\"\", HeadSHA:\"\", URL:\"\", BeforeSHA:\"\", AfterSHA:\"\", Status:\"\", Conclusion:\"\", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, App:github.App{}, Repository:github.Repository{}, HeadCommit:github.Commit{}, LatestCheckRunsCount:0, Rerequestable:false, RunsRerequestable:false}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"CheckSuite.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestClassroom_String(t *testing.T) {\n\tt.Parallel()\n\tv := Classroom{\n\t\tID:           Ptr(int64(0)),\n\t\tName:         Ptr(\"\"),\n\t\tArchived:     Ptr(false),\n\t\tOrganization: &Organization{},\n\t\tURL:          Ptr(\"\"),\n\t}\n\twant := `github.Classroom{ID:0, Name:\"\", Archived:false, Organization:github.Organization{}, URL:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"Classroom.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestClassroomAssignment_String(t *testing.T) {\n\tt.Parallel()\n\tv := ClassroomAssignment{\n\t\tID:                          Ptr(int64(0)),\n\t\tPublicRepo:                  Ptr(false),\n\t\tTitle:                       Ptr(\"\"),\n\t\tType:                        Ptr(\"\"),\n\t\tInviteLink:                  Ptr(\"\"),\n\t\tInvitationsEnabled:          Ptr(false),\n\t\tSlug:                        Ptr(\"\"),\n\t\tStudentsAreRepoAdmins:       Ptr(false),\n\t\tFeedbackPullRequestsEnabled: Ptr(false),\n\t\tMaxTeams:                    Ptr(0),\n\t\tMaxMembers:                  Ptr(0),\n\t\tEditor:                      Ptr(\"\"),\n\t\tAccepted:                    Ptr(0),\n\t\tSubmitted:                   Ptr(0),\n\t\tPassing:                     Ptr(0),\n\t\tLanguage:                    Ptr(\"\"),\n\t\tDeadline:                    &Timestamp{},\n\t\tStarterCodeRepository:       &Repository{},\n\t\tClassroom:                   &Classroom{},\n\t}\n\twant := `github.ClassroomAssignment{ID:0, PublicRepo:false, Title:\"\", Type:\"\", InviteLink:\"\", InvitationsEnabled:false, Slug:\"\", StudentsAreRepoAdmins:false, FeedbackPullRequestsEnabled:false, MaxTeams:0, MaxMembers:0, Editor:\"\", Accepted:0, Submitted:0, Passing:0, Language:\"\", Deadline:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, StarterCodeRepository:github.Repository{}, Classroom:github.Classroom{}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"ClassroomAssignment.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestClassroomUser_String(t *testing.T) {\n\tt.Parallel()\n\tv := ClassroomUser{\n\t\tID:        Ptr(int64(0)),\n\t\tLogin:     Ptr(\"\"),\n\t\tAvatarURL: Ptr(\"\"),\n\t\tHTMLURL:   Ptr(\"\"),\n\t}\n\twant := `github.ClassroomUser{ID:0, Login:\"\", AvatarURL:\"\", HTMLURL:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"ClassroomUser.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestCodeOfConduct_String(t *testing.T) {\n\tt.Parallel()\n\tv := CodeOfConduct{\n\t\tName: Ptr(\"\"),\n\t\tKey:  Ptr(\"\"),\n\t\tURL:  Ptr(\"\"),\n\t\tBody: Ptr(\"\"),\n\t}\n\twant := `github.CodeOfConduct{Name:\"\", Key:\"\", URL:\"\", Body:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"CodeOfConduct.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestCodeResult_String(t *testing.T) {\n\tt.Parallel()\n\tv := CodeResult{\n\t\tName:       Ptr(\"\"),\n\t\tPath:       Ptr(\"\"),\n\t\tSHA:        Ptr(\"\"),\n\t\tHTMLURL:    Ptr(\"\"),\n\t\tRepository: &Repository{},\n\t}\n\twant := `github.CodeResult{Name:\"\", Path:\"\", SHA:\"\", HTMLURL:\"\", Repository:github.Repository{}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"CodeResult.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestCombinedStatus_String(t *testing.T) {\n\tt.Parallel()\n\tv := CombinedStatus{\n\t\tState:         Ptr(\"\"),\n\t\tName:          Ptr(\"\"),\n\t\tSHA:           Ptr(\"\"),\n\t\tTotalCount:    Ptr(0),\n\t\tCommitURL:     Ptr(\"\"),\n\t\tRepositoryURL: Ptr(\"\"),\n\t}\n\twant := `github.CombinedStatus{State:\"\", Name:\"\", SHA:\"\", TotalCount:0, CommitURL:\"\", RepositoryURL:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"CombinedStatus.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestCommentStats_String(t *testing.T) {\n\tt.Parallel()\n\tv := CommentStats{\n\t\tTotalCommitComments:      Ptr(0),\n\t\tTotalGistComments:        Ptr(0),\n\t\tTotalIssueComments:       Ptr(0),\n\t\tTotalPullRequestComments: Ptr(0),\n\t}\n\twant := `github.CommentStats{TotalCommitComments:0, TotalGistComments:0, TotalIssueComments:0, TotalPullRequestComments:0}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"CommentStats.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestCommit_String(t *testing.T) {\n\tt.Parallel()\n\tv := Commit{\n\t\tSHA:          Ptr(\"\"),\n\t\tAuthor:       &CommitAuthor{},\n\t\tCommitter:    &CommitAuthor{},\n\t\tMessage:      Ptr(\"\"),\n\t\tTree:         &Tree{},\n\t\tHTMLURL:      Ptr(\"\"),\n\t\tURL:          Ptr(\"\"),\n\t\tVerification: &SignatureVerification{},\n\t\tNodeID:       Ptr(\"\"),\n\t\tCommentCount: Ptr(0),\n\t}\n\twant := `github.Commit{SHA:\"\", Author:github.CommitAuthor{}, Committer:github.CommitAuthor{}, Message:\"\", Tree:github.Tree{}, HTMLURL:\"\", URL:\"\", Verification:github.SignatureVerification{}, NodeID:\"\", CommentCount:0}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"Commit.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestCommitAuthor_String(t *testing.T) {\n\tt.Parallel()\n\tv := CommitAuthor{\n\t\tDate:  &Timestamp{},\n\t\tName:  Ptr(\"\"),\n\t\tEmail: Ptr(\"\"),\n\t\tLogin: Ptr(\"\"),\n\t}\n\twant := `github.CommitAuthor{Date:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Name:\"\", Email:\"\", Login:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"CommitAuthor.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestCommitFile_String(t *testing.T) {\n\tt.Parallel()\n\tv := CommitFile{\n\t\tSHA:              Ptr(\"\"),\n\t\tFilename:         Ptr(\"\"),\n\t\tAdditions:        Ptr(0),\n\t\tDeletions:        Ptr(0),\n\t\tChanges:          Ptr(0),\n\t\tStatus:           Ptr(\"\"),\n\t\tPatch:            Ptr(\"\"),\n\t\tBlobURL:          Ptr(\"\"),\n\t\tRawURL:           Ptr(\"\"),\n\t\tContentsURL:      Ptr(\"\"),\n\t\tPreviousFilename: Ptr(\"\"),\n\t}\n\twant := `github.CommitFile{SHA:\"\", Filename:\"\", Additions:0, Deletions:0, Changes:0, Status:\"\", Patch:\"\", BlobURL:\"\", RawURL:\"\", ContentsURL:\"\", PreviousFilename:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"CommitFile.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestCommitStats_String(t *testing.T) {\n\tt.Parallel()\n\tv := CommitStats{\n\t\tAdditions: Ptr(0),\n\t\tDeletions: Ptr(0),\n\t\tTotal:     Ptr(0),\n\t}\n\twant := `github.CommitStats{Additions:0, Deletions:0, Total:0}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"CommitStats.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestCommitsComparison_String(t *testing.T) {\n\tt.Parallel()\n\tv := CommitsComparison{\n\t\tBaseCommit:      &RepositoryCommit{},\n\t\tMergeBaseCommit: &RepositoryCommit{},\n\t\tStatus:          Ptr(\"\"),\n\t\tAheadBy:         Ptr(0),\n\t\tBehindBy:        Ptr(0),\n\t\tTotalCommits:    Ptr(0),\n\t\tHTMLURL:         Ptr(\"\"),\n\t\tPermalinkURL:    Ptr(\"\"),\n\t\tDiffURL:         Ptr(\"\"),\n\t\tPatchURL:        Ptr(\"\"),\n\t\tURL:             Ptr(\"\"),\n\t}\n\twant := `github.CommitsComparison{BaseCommit:github.RepositoryCommit{}, MergeBaseCommit:github.RepositoryCommit{}, Status:\"\", AheadBy:0, BehindBy:0, TotalCommits:0, HTMLURL:\"\", PermalinkURL:\"\", DiffURL:\"\", PatchURL:\"\", URL:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"CommitsComparison.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestContributorApprovalPermissions_String(t *testing.T) {\n\tt.Parallel()\n\tv := ContributorApprovalPermissions{\n\t\tApprovalPolicy: \"\",\n\t}\n\twant := `github.ContributorApprovalPermissions{ApprovalPolicy:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"ContributorApprovalPermissions.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestContributorStats_String(t *testing.T) {\n\tt.Parallel()\n\tv := ContributorStats{\n\t\tAuthor: &Contributor{},\n\t\tTotal:  Ptr(0),\n\t}\n\twant := `github.ContributorStats{Author:github.Contributor{}, Total:0}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"ContributorStats.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestDependabotSecurityUpdates_String(t *testing.T) {\n\tt.Parallel()\n\tv := DependabotSecurityUpdates{\n\t\tStatus: Ptr(\"\"),\n\t}\n\twant := `github.DependabotSecurityUpdates{Status:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"DependabotSecurityUpdates.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestDiscussionComment_String(t *testing.T) {\n\tt.Parallel()\n\tv := DiscussionComment{\n\t\tAuthor:        &User{},\n\t\tBody:          Ptr(\"\"),\n\t\tBodyHTML:      Ptr(\"\"),\n\t\tBodyVersion:   Ptr(\"\"),\n\t\tCreatedAt:     &Timestamp{},\n\t\tLastEditedAt:  &Timestamp{},\n\t\tDiscussionURL: Ptr(\"\"),\n\t\tHTMLURL:       Ptr(\"\"),\n\t\tNodeID:        Ptr(\"\"),\n\t\tNumber:        Ptr(0),\n\t\tUpdatedAt:     &Timestamp{},\n\t\tURL:           Ptr(\"\"),\n\t\tReactions:     &Reactions{},\n\t}\n\twant := `github.DiscussionComment{Author:github.User{}, Body:\"\", BodyHTML:\"\", BodyVersion:\"\", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, LastEditedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, DiscussionURL:\"\", HTMLURL:\"\", NodeID:\"\", Number:0, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, URL:\"\", Reactions:github.Reactions{}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"DiscussionComment.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestDraftReviewComment_String(t *testing.T) {\n\tt.Parallel()\n\tv := DraftReviewComment{\n\t\tPath:      Ptr(\"\"),\n\t\tPosition:  Ptr(0),\n\t\tBody:      Ptr(\"\"),\n\t\tStartSide: Ptr(\"\"),\n\t\tSide:      Ptr(\"\"),\n\t\tStartLine: Ptr(0),\n\t\tLine:      Ptr(0),\n\t}\n\twant := `github.DraftReviewComment{Path:\"\", Position:0, Body:\"\", StartSide:\"\", Side:\"\", StartLine:0, Line:0}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"DraftReviewComment.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestEnterprise_String(t *testing.T) {\n\tt.Parallel()\n\tv := Enterprise{\n\t\tID:          Ptr(0),\n\t\tSlug:        Ptr(\"\"),\n\t\tName:        Ptr(\"\"),\n\t\tNodeID:      Ptr(\"\"),\n\t\tAvatarURL:   Ptr(\"\"),\n\t\tDescription: Ptr(\"\"),\n\t\tWebsiteURL:  Ptr(\"\"),\n\t\tHTMLURL:     Ptr(\"\"),\n\t\tCreatedAt:   &Timestamp{},\n\t\tUpdatedAt:   &Timestamp{},\n\t}\n\twant := `github.Enterprise{ID:0, Slug:\"\", Name:\"\", NodeID:\"\", AvatarURL:\"\", Description:\"\", WebsiteURL:\"\", HTMLURL:\"\", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"Enterprise.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestEnterpriseBudget_String(t *testing.T) {\n\tt.Parallel()\n\tv := EnterpriseBudget{\n\t\tID:                  Ptr(\"\"),\n\t\tBudgetType:          Ptr(\"\"),\n\t\tBudgetProductSKU:    Ptr(\"\"),\n\t\tBudgetScope:         Ptr(\"\"),\n\t\tBudgetEntityName:    Ptr(\"\"),\n\t\tBudgetAmount:        Ptr(0),\n\t\tPreventFurtherUsage: Ptr(false),\n\t\tBudgetAlerting:      &EnterpriseBudgetAlerting{},\n\t}\n\twant := `github.EnterpriseBudget{ID:\"\", BudgetType:\"\", BudgetProductSKU:\"\", BudgetScope:\"\", BudgetEntityName:\"\", BudgetAmount:0, PreventFurtherUsage:false, BudgetAlerting:github.EnterpriseBudgetAlerting{}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"EnterpriseBudget.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestEvent_String(t *testing.T) {\n\tt.Parallel()\n\tv := Event{\n\t\tType:      Ptr(\"\"),\n\t\tPublic:    Ptr(false),\n\t\tRepo:      &Repository{},\n\t\tActor:     &User{},\n\t\tOrg:       &Organization{},\n\t\tCreatedAt: &Timestamp{},\n\t\tID:        Ptr(\"\"),\n\t}\n\twant := `github.Event{Type:\"\", Public:false, Repo:github.Repository{}, Actor:github.User{}, Org:github.Organization{}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, ID:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"Event.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestGPGKey_String(t *testing.T) {\n\tt.Parallel()\n\tv := GPGKey{\n\t\tID:                Ptr(int64(0)),\n\t\tPrimaryKeyID:      Ptr(int64(0)),\n\t\tKeyID:             Ptr(\"\"),\n\t\tRawKey:            Ptr(\"\"),\n\t\tPublicKey:         Ptr(\"\"),\n\t\tCanSign:           Ptr(false),\n\t\tCanEncryptComms:   Ptr(false),\n\t\tCanEncryptStorage: Ptr(false),\n\t\tCanCertify:        Ptr(false),\n\t\tCreatedAt:         &Timestamp{},\n\t\tExpiresAt:         &Timestamp{},\n\t}\n\twant := `github.GPGKey{ID:0, PrimaryKeyID:0, KeyID:\"\", RawKey:\"\", PublicKey:\"\", CanSign:false, CanEncryptComms:false, CanEncryptStorage:false, CanCertify:false, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, ExpiresAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"GPGKey.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestGist_String(t *testing.T) {\n\tt.Parallel()\n\tv := Gist{\n\t\tID:          Ptr(\"\"),\n\t\tDescription: Ptr(\"\"),\n\t\tPublic:      Ptr(false),\n\t\tOwner:       &User{},\n\t\tComments:    Ptr(0),\n\t\tHTMLURL:     Ptr(\"\"),\n\t\tGitPullURL:  Ptr(\"\"),\n\t\tGitPushURL:  Ptr(\"\"),\n\t\tCreatedAt:   &Timestamp{},\n\t\tUpdatedAt:   &Timestamp{},\n\t\tNodeID:      Ptr(\"\"),\n\t}\n\twant := `github.Gist{ID:\"\", Description:\"\", Public:false, Owner:github.User{}, Comments:0, HTMLURL:\"\", GitPullURL:\"\", GitPushURL:\"\", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, NodeID:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"Gist.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestGistComment_String(t *testing.T) {\n\tt.Parallel()\n\tv := GistComment{\n\t\tID:        Ptr(int64(0)),\n\t\tURL:       Ptr(\"\"),\n\t\tBody:      Ptr(\"\"),\n\t\tUser:      &User{},\n\t\tCreatedAt: &Timestamp{},\n\t}\n\twant := `github.GistComment{ID:0, URL:\"\", Body:\"\", User:github.User{}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"GistComment.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestGistCommit_String(t *testing.T) {\n\tt.Parallel()\n\tv := GistCommit{\n\t\tURL:          Ptr(\"\"),\n\t\tVersion:      Ptr(\"\"),\n\t\tUser:         &User{},\n\t\tChangeStatus: &CommitStats{},\n\t\tCommittedAt:  &Timestamp{},\n\t\tNodeID:       Ptr(\"\"),\n\t}\n\twant := `github.GistCommit{URL:\"\", Version:\"\", User:github.User{}, ChangeStatus:github.CommitStats{}, CommittedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, NodeID:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"GistCommit.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestGistFile_String(t *testing.T) {\n\tt.Parallel()\n\tv := GistFile{\n\t\tSize:     Ptr(0),\n\t\tFilename: Ptr(\"\"),\n\t\tLanguage: Ptr(\"\"),\n\t\tType:     Ptr(\"\"),\n\t\tRawURL:   Ptr(\"\"),\n\t\tContent:  Ptr(\"\"),\n\t}\n\twant := `github.GistFile{Size:0, Filename:\"\", Language:\"\", Type:\"\", RawURL:\"\", Content:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"GistFile.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestGistFork_String(t *testing.T) {\n\tt.Parallel()\n\tv := GistFork{\n\t\tURL:       Ptr(\"\"),\n\t\tUser:      &User{},\n\t\tID:        Ptr(\"\"),\n\t\tCreatedAt: &Timestamp{},\n\t\tUpdatedAt: &Timestamp{},\n\t\tNodeID:    Ptr(\"\"),\n\t}\n\twant := `github.GistFork{URL:\"\", User:github.User{}, ID:\"\", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, NodeID:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"GistFork.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestGistStats_String(t *testing.T) {\n\tt.Parallel()\n\tv := GistStats{\n\t\tTotalGists:   Ptr(0),\n\t\tPrivateGists: Ptr(0),\n\t\tPublicGists:  Ptr(0),\n\t}\n\twant := `github.GistStats{TotalGists:0, PrivateGists:0, PublicGists:0}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"GistStats.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestGitObject_String(t *testing.T) {\n\tt.Parallel()\n\tv := GitObject{\n\t\tType: Ptr(\"\"),\n\t\tSHA:  Ptr(\"\"),\n\t\tURL:  Ptr(\"\"),\n\t}\n\twant := `github.GitObject{Type:\"\", SHA:\"\", URL:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"GitObject.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestGitignore_String(t *testing.T) {\n\tt.Parallel()\n\tv := Gitignore{\n\t\tName:   Ptr(\"\"),\n\t\tSource: Ptr(\"\"),\n\t}\n\twant := `github.Gitignore{Name:\"\", Source:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"Gitignore.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestGrant_String(t *testing.T) {\n\tt.Parallel()\n\tv := Grant{\n\t\tID:        Ptr(int64(0)),\n\t\tURL:       Ptr(\"\"),\n\t\tApp:       &AuthorizationApp{},\n\t\tCreatedAt: &Timestamp{},\n\t\tUpdatedAt: &Timestamp{},\n\t\tScopes:    []string{\"\"},\n\t}\n\twant := `github.Grant{ID:0, URL:\"\", App:github.AuthorizationApp{}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Scopes:[\"\"]}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"Grant.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestHeadCommit_String(t *testing.T) {\n\tt.Parallel()\n\tv := HeadCommit{\n\t\tMessage:   Ptr(\"\"),\n\t\tAuthor:    &CommitAuthor{},\n\t\tURL:       Ptr(\"\"),\n\t\tDistinct:  Ptr(false),\n\t\tSHA:       Ptr(\"\"),\n\t\tID:        Ptr(\"\"),\n\t\tTreeID:    Ptr(\"\"),\n\t\tTimestamp: &Timestamp{},\n\t\tCommitter: &CommitAuthor{},\n\t\tAdded:     []string{\"\"},\n\t\tRemoved:   []string{\"\"},\n\t\tModified:  []string{\"\"},\n\t}\n\twant := `github.HeadCommit{Message:\"\", Author:github.CommitAuthor{}, URL:\"\", Distinct:false, SHA:\"\", ID:\"\", TreeID:\"\", Timestamp:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Committer:github.CommitAuthor{}, Added:[\"\"], Removed:[\"\"], Modified:[\"\"]}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"HeadCommit.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestHook_String(t *testing.T) {\n\tt.Parallel()\n\tv := Hook{\n\t\tCreatedAt: &Timestamp{},\n\t\tUpdatedAt: &Timestamp{},\n\t\tURL:       Ptr(\"\"),\n\t\tID:        Ptr(int64(0)),\n\t\tType:      Ptr(\"\"),\n\t\tName:      Ptr(\"\"),\n\t\tTestURL:   Ptr(\"\"),\n\t\tPingURL:   Ptr(\"\"),\n\t\tConfig:    &HookConfig{},\n\t\tEvents:    []string{\"\"},\n\t\tActive:    Ptr(false),\n\t}\n\twant := `github.Hook{CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, URL:\"\", ID:0, Type:\"\", Name:\"\", TestURL:\"\", PingURL:\"\", Config:github.HookConfig{}, Events:[\"\"], Active:false}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"Hook.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestHookDelivery_String(t *testing.T) {\n\tt.Parallel()\n\tv := HookDelivery{\n\t\tID:             Ptr(int64(0)),\n\t\tGUID:           Ptr(\"\"),\n\t\tDeliveredAt:    &Timestamp{},\n\t\tRedelivery:     Ptr(false),\n\t\tDuration:       Ptr(0.0),\n\t\tStatus:         Ptr(\"\"),\n\t\tStatusCode:     Ptr(0),\n\t\tEvent:          Ptr(\"\"),\n\t\tAction:         Ptr(\"\"),\n\t\tInstallationID: Ptr(int64(0)),\n\t\tRepositoryID:   Ptr(int64(0)),\n\t\tRequest:        &HookRequest{},\n\t\tResponse:       &HookResponse{},\n\t}\n\twant := `github.HookDelivery{ID:0, GUID:\"\", DeliveredAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Redelivery:false, Duration:0, Status:\"\", StatusCode:0, Event:\"\", Action:\"\", InstallationID:0, RepositoryID:0, Request:github.HookRequest{}, Response:github.HookResponse{}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"HookDelivery.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestHookStats_String(t *testing.T) {\n\tt.Parallel()\n\tv := HookStats{\n\t\tTotalHooks:    Ptr(0),\n\t\tActiveHooks:   Ptr(0),\n\t\tInactiveHooks: Ptr(0),\n\t}\n\twant := `github.HookStats{TotalHooks:0, ActiveHooks:0, InactiveHooks:0}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"HookStats.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestImport_String(t *testing.T) {\n\tt.Parallel()\n\tv := Import{\n\t\tVCSURL:          Ptr(\"\"),\n\t\tVCS:             Ptr(\"\"),\n\t\tVCSUsername:     Ptr(\"\"),\n\t\tVCSPassword:     Ptr(\"\"),\n\t\tTFVCProject:     Ptr(\"\"),\n\t\tUseLFS:          Ptr(\"\"),\n\t\tHasLargeFiles:   Ptr(false),\n\t\tLargeFilesSize:  Ptr(0),\n\t\tLargeFilesCount: Ptr(0),\n\t\tStatus:          Ptr(\"\"),\n\t\tCommitCount:     Ptr(0),\n\t\tStatusText:      Ptr(\"\"),\n\t\tAuthorsCount:    Ptr(0),\n\t\tPercent:         Ptr(0),\n\t\tPushPercent:     Ptr(0),\n\t\tURL:             Ptr(\"\"),\n\t\tHTMLURL:         Ptr(\"\"),\n\t\tAuthorsURL:      Ptr(\"\"),\n\t\tRepositoryURL:   Ptr(\"\"),\n\t\tMessage:         Ptr(\"\"),\n\t\tFailedStep:      Ptr(\"\"),\n\t\tHumanName:       Ptr(\"\"),\n\t}\n\twant := `github.Import{VCSURL:\"\", VCS:\"\", VCSUsername:\"\", VCSPassword:\"\", TFVCProject:\"\", UseLFS:\"\", HasLargeFiles:false, LargeFilesSize:0, LargeFilesCount:0, Status:\"\", CommitCount:0, StatusText:\"\", AuthorsCount:0, Percent:0, PushPercent:0, URL:\"\", HTMLURL:\"\", AuthorsURL:\"\", RepositoryURL:\"\", Message:\"\", FailedStep:\"\", HumanName:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"Import.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestInstallation_String(t *testing.T) {\n\tt.Parallel()\n\tv := Installation{\n\t\tID:                     Ptr(int64(0)),\n\t\tNodeID:                 Ptr(\"\"),\n\t\tClientID:               Ptr(\"\"),\n\t\tAppID:                  Ptr(int64(0)),\n\t\tAppSlug:                Ptr(\"\"),\n\t\tTargetID:               Ptr(int64(0)),\n\t\tAccount:                &User{},\n\t\tAccessTokensURL:        Ptr(\"\"),\n\t\tRepositoriesURL:        Ptr(\"\"),\n\t\tHTMLURL:                Ptr(\"\"),\n\t\tTargetType:             Ptr(\"\"),\n\t\tSingleFileName:         Ptr(\"\"),\n\t\tRepositorySelection:    Ptr(\"\"),\n\t\tEvents:                 []string{\"\"},\n\t\tSingleFilePaths:        []string{\"\"},\n\t\tPermissions:            &InstallationPermissions{},\n\t\tCreatedAt:              &Timestamp{},\n\t\tUpdatedAt:              &Timestamp{},\n\t\tHasMultipleSingleFiles: Ptr(false),\n\t\tSuspendedBy:            &User{},\n\t\tSuspendedAt:            &Timestamp{},\n\t}\n\twant := `github.Installation{ID:0, NodeID:\"\", ClientID:\"\", AppID:0, AppSlug:\"\", TargetID:0, Account:github.User{}, AccessTokensURL:\"\", RepositoriesURL:\"\", HTMLURL:\"\", TargetType:\"\", SingleFileName:\"\", RepositorySelection:\"\", Events:[\"\"], SingleFilePaths:[\"\"], Permissions:github.InstallationPermissions{}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, HasMultipleSingleFiles:false, SuspendedBy:github.User{}, SuspendedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"Installation.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestInvitation_String(t *testing.T) {\n\tt.Parallel()\n\tv := Invitation{\n\t\tID:                Ptr(int64(0)),\n\t\tNodeID:            Ptr(\"\"),\n\t\tLogin:             Ptr(\"\"),\n\t\tEmail:             Ptr(\"\"),\n\t\tRole:              Ptr(\"\"),\n\t\tCreatedAt:         &Timestamp{},\n\t\tInviter:           &User{},\n\t\tTeamCount:         Ptr(0),\n\t\tInvitationTeamURL: Ptr(\"\"),\n\t\tFailedAt:          &Timestamp{},\n\t\tFailedReason:      Ptr(\"\"),\n\t}\n\twant := `github.Invitation{ID:0, NodeID:\"\", Login:\"\", Email:\"\", Role:\"\", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Inviter:github.User{}, TeamCount:0, InvitationTeamURL:\"\", FailedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, FailedReason:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"Invitation.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestIssue_String(t *testing.T) {\n\tt.Parallel()\n\tv := Issue{\n\t\tID:                Ptr(int64(0)),\n\t\tNumber:            Ptr(0),\n\t\tState:             Ptr(\"\"),\n\t\tStateReason:       Ptr(\"\"),\n\t\tLocked:            Ptr(false),\n\t\tTitle:             Ptr(\"\"),\n\t\tBody:              Ptr(\"\"),\n\t\tAuthorAssociation: Ptr(\"\"),\n\t\tUser:              &User{},\n\t\tAssignee:          &User{},\n\t\tComments:          Ptr(0),\n\t\tClosedAt:          &Timestamp{},\n\t\tCreatedAt:         &Timestamp{},\n\t\tUpdatedAt:         &Timestamp{},\n\t\tClosedBy:          &User{},\n\t\tURL:               Ptr(\"\"),\n\t\tHTMLURL:           Ptr(\"\"),\n\t\tCommentsURL:       Ptr(\"\"),\n\t\tEventsURL:         Ptr(\"\"),\n\t\tLabelsURL:         Ptr(\"\"),\n\t\tRepositoryURL:     Ptr(\"\"),\n\t\tParentIssueURL:    Ptr(\"\"),\n\t\tMilestone:         &Milestone{},\n\t\tPullRequestLinks:  &PullRequestLinks{},\n\t\tRepository:        &Repository{},\n\t\tReactions:         &Reactions{},\n\t\tNodeID:            Ptr(\"\"),\n\t\tDraft:             Ptr(false),\n\t\tType:              &IssueType{},\n\t\tActiveLockReason:  Ptr(\"\"),\n\t}\n\twant := `github.Issue{ID:0, Number:0, State:\"\", StateReason:\"\", Locked:false, Title:\"\", Body:\"\", AuthorAssociation:\"\", User:github.User{}, Assignee:github.User{}, Comments:0, ClosedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, ClosedBy:github.User{}, URL:\"\", HTMLURL:\"\", CommentsURL:\"\", EventsURL:\"\", LabelsURL:\"\", RepositoryURL:\"\", ParentIssueURL:\"\", Milestone:github.Milestone{}, PullRequestLinks:github.PullRequestLinks{}, Repository:github.Repository{}, Reactions:github.Reactions{}, NodeID:\"\", Draft:false, Type:github.IssueType{}, ActiveLockReason:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"Issue.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestIssueComment_String(t *testing.T) {\n\tt.Parallel()\n\tv := IssueComment{\n\t\tID:                Ptr(int64(0)),\n\t\tNodeID:            Ptr(\"\"),\n\t\tBody:              Ptr(\"\"),\n\t\tUser:              &User{},\n\t\tReactions:         &Reactions{},\n\t\tCreatedAt:         &Timestamp{},\n\t\tUpdatedAt:         &Timestamp{},\n\t\tAuthorAssociation: Ptr(\"\"),\n\t\tURL:               Ptr(\"\"),\n\t\tHTMLURL:           Ptr(\"\"),\n\t\tIssueURL:          Ptr(\"\"),\n\t}\n\twant := `github.IssueComment{ID:0, NodeID:\"\", Body:\"\", User:github.User{}, Reactions:github.Reactions{}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, AuthorAssociation:\"\", URL:\"\", HTMLURL:\"\", IssueURL:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"IssueComment.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestIssueStats_String(t *testing.T) {\n\tt.Parallel()\n\tv := IssueStats{\n\t\tTotalIssues:  Ptr(0),\n\t\tOpenIssues:   Ptr(0),\n\t\tClosedIssues: Ptr(0),\n\t}\n\twant := `github.IssueStats{TotalIssues:0, OpenIssues:0, ClosedIssues:0}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"IssueStats.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestKey_String(t *testing.T) {\n\tt.Parallel()\n\tv := Key{\n\t\tID:        Ptr(int64(0)),\n\t\tKey:       Ptr(\"\"),\n\t\tURL:       Ptr(\"\"),\n\t\tTitle:     Ptr(\"\"),\n\t\tReadOnly:  Ptr(false),\n\t\tVerified:  Ptr(false),\n\t\tCreatedAt: &Timestamp{},\n\t\tAddedBy:   Ptr(\"\"),\n\t\tLastUsed:  &Timestamp{},\n\t}\n\twant := `github.Key{ID:0, Key:\"\", URL:\"\", Title:\"\", ReadOnly:false, Verified:false, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, AddedBy:\"\", LastUsed:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"Key.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestLabel_String(t *testing.T) {\n\tt.Parallel()\n\tv := Label{\n\t\tID:          Ptr(int64(0)),\n\t\tURL:         Ptr(\"\"),\n\t\tName:        Ptr(\"\"),\n\t\tColor:       Ptr(\"\"),\n\t\tDescription: Ptr(\"\"),\n\t\tDefault:     Ptr(false),\n\t\tNodeID:      Ptr(\"\"),\n\t}\n\twant := `github.Label{ID:0, URL:\"\", Name:\"\", Color:\"\", Description:\"\", Default:false, NodeID:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"Label.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestLabelResult_String(t *testing.T) {\n\tt.Parallel()\n\tv := LabelResult{\n\t\tID:          Ptr(int64(0)),\n\t\tURL:         Ptr(\"\"),\n\t\tName:        Ptr(\"\"),\n\t\tColor:       Ptr(\"\"),\n\t\tDefault:     Ptr(false),\n\t\tDescription: Ptr(\"\"),\n\t\tScore:       Ptr(0.0),\n\t}\n\twant := `github.LabelResult{ID:0, URL:\"\", Name:\"\", Color:\"\", Default:false, Description:\"\", Score:0}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"LabelResult.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestLargeFile_String(t *testing.T) {\n\tt.Parallel()\n\tv := LargeFile{\n\t\tRefName: Ptr(\"\"),\n\t\tPath:    Ptr(\"\"),\n\t\tOID:     Ptr(\"\"),\n\t\tSize:    Ptr(0),\n\t}\n\twant := `github.LargeFile{RefName:\"\", Path:\"\", OID:\"\", Size:0}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"LargeFile.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestLicense_String(t *testing.T) {\n\tt.Parallel()\n\tv := License{\n\t\tKey:            Ptr(\"\"),\n\t\tName:           Ptr(\"\"),\n\t\tURL:            Ptr(\"\"),\n\t\tSPDXID:         Ptr(\"\"),\n\t\tHTMLURL:        Ptr(\"\"),\n\t\tFeatured:       Ptr(false),\n\t\tDescription:    Ptr(\"\"),\n\t\tImplementation: Ptr(\"\"),\n\t\tBody:           Ptr(\"\"),\n\t}\n\twant := `github.License{Key:\"\", Name:\"\", URL:\"\", SPDXID:\"\", HTMLURL:\"\", Featured:false, Description:\"\", Implementation:\"\", Body:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"License.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestMembership_String(t *testing.T) {\n\tt.Parallel()\n\tv := Membership{\n\t\tURL:             Ptr(\"\"),\n\t\tState:           Ptr(\"\"),\n\t\tRole:            Ptr(\"\"),\n\t\tOrganizationURL: Ptr(\"\"),\n\t\tOrganization:    &Organization{},\n\t\tUser:            &User{},\n\t}\n\twant := `github.Membership{URL:\"\", State:\"\", Role:\"\", OrganizationURL:\"\", Organization:github.Organization{}, User:github.User{}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"Membership.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestMigration_String(t *testing.T) {\n\tt.Parallel()\n\tv := Migration{\n\t\tID:                 Ptr(int64(0)),\n\t\tGUID:               Ptr(\"\"),\n\t\tState:              Ptr(\"\"),\n\t\tLockRepositories:   Ptr(false),\n\t\tExcludeAttachments: Ptr(false),\n\t\tURL:                Ptr(\"\"),\n\t\tCreatedAt:          Ptr(\"\"),\n\t\tUpdatedAt:          Ptr(\"\"),\n\t}\n\twant := `github.Migration{ID:0, GUID:\"\", State:\"\", LockRepositories:false, ExcludeAttachments:false, URL:\"\", CreatedAt:\"\", UpdatedAt:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"Migration.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestMilestone_String(t *testing.T) {\n\tt.Parallel()\n\tv := Milestone{\n\t\tURL:          Ptr(\"\"),\n\t\tHTMLURL:      Ptr(\"\"),\n\t\tLabelsURL:    Ptr(\"\"),\n\t\tID:           Ptr(int64(0)),\n\t\tNumber:       Ptr(0),\n\t\tState:        Ptr(\"\"),\n\t\tTitle:        Ptr(\"\"),\n\t\tDescription:  Ptr(\"\"),\n\t\tCreator:      &User{},\n\t\tOpenIssues:   Ptr(0),\n\t\tClosedIssues: Ptr(0),\n\t\tCreatedAt:    &Timestamp{},\n\t\tUpdatedAt:    &Timestamp{},\n\t\tClosedAt:     &Timestamp{},\n\t\tDueOn:        &Timestamp{},\n\t\tNodeID:       Ptr(\"\"),\n\t}\n\twant := `github.Milestone{URL:\"\", HTMLURL:\"\", LabelsURL:\"\", ID:0, Number:0, State:\"\", Title:\"\", Description:\"\", Creator:github.User{}, OpenIssues:0, ClosedIssues:0, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, ClosedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, DueOn:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, NodeID:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"Milestone.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestMilestoneStats_String(t *testing.T) {\n\tt.Parallel()\n\tv := MilestoneStats{\n\t\tTotalMilestones:  Ptr(0),\n\t\tOpenMilestones:   Ptr(0),\n\t\tClosedMilestones: Ptr(0),\n\t}\n\twant := `github.MilestoneStats{TotalMilestones:0, OpenMilestones:0, ClosedMilestones:0}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"MilestoneStats.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestNewTeam_String(t *testing.T) {\n\tt.Parallel()\n\tv := NewTeam{\n\t\tName:                \"\",\n\t\tDescription:         Ptr(\"\"),\n\t\tMaintainers:         []string{\"\"},\n\t\tRepoNames:           []string{\"\"},\n\t\tParentTeamID:        Ptr(int64(0)),\n\t\tNotificationSetting: Ptr(\"\"),\n\t\tPermission:          Ptr(\"\"),\n\t\tPrivacy:             Ptr(\"\"),\n\t\tLDAPDN:              Ptr(\"\"),\n\t}\n\twant := `github.NewTeam{Name:\"\", Description:\"\", Maintainers:[\"\"], RepoNames:[\"\"], ParentTeamID:0, NotificationSetting:\"\", Permission:\"\", Privacy:\"\", LDAPDN:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"NewTeam.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestOAuthAPP_String(t *testing.T) {\n\tt.Parallel()\n\tv := OAuthAPP{\n\t\tURL:      Ptr(\"\"),\n\t\tName:     Ptr(\"\"),\n\t\tClientID: Ptr(\"\"),\n\t}\n\twant := `github.OAuthAPP{URL:\"\", Name:\"\", ClientID:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"OAuthAPP.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestOrgStats_String(t *testing.T) {\n\tt.Parallel()\n\tv := OrgStats{\n\t\tTotalOrgs:        Ptr(0),\n\t\tDisabledOrgs:     Ptr(0),\n\t\tTotalTeams:       Ptr(0),\n\t\tTotalTeamMembers: Ptr(0),\n\t}\n\twant := `github.OrgStats{TotalOrgs:0, DisabledOrgs:0, TotalTeams:0, TotalTeamMembers:0}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"OrgStats.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestOrganization_String(t *testing.T) {\n\tt.Parallel()\n\tv := Organization{\n\t\tLogin:                                Ptr(\"\"),\n\t\tID:                                   Ptr(int64(0)),\n\t\tNodeID:                               Ptr(\"\"),\n\t\tAvatarURL:                            Ptr(\"\"),\n\t\tHTMLURL:                              Ptr(\"\"),\n\t\tName:                                 Ptr(\"\"),\n\t\tCompany:                              Ptr(\"\"),\n\t\tBlog:                                 Ptr(\"\"),\n\t\tLocation:                             Ptr(\"\"),\n\t\tEmail:                                Ptr(\"\"),\n\t\tTwitterUsername:                      Ptr(\"\"),\n\t\tDescription:                          Ptr(\"\"),\n\t\tPublicRepos:                          Ptr(0),\n\t\tPublicGists:                          Ptr(0),\n\t\tFollowers:                            Ptr(0),\n\t\tFollowing:                            Ptr(0),\n\t\tCreatedAt:                            &Timestamp{},\n\t\tUpdatedAt:                            &Timestamp{},\n\t\tTotalPrivateRepos:                    Ptr(int64(0)),\n\t\tOwnedPrivateRepos:                    Ptr(int64(0)),\n\t\tPrivateGists:                         Ptr(0),\n\t\tDiskUsage:                            Ptr(0),\n\t\tCollaborators:                        Ptr(0),\n\t\tBillingEmail:                         Ptr(\"\"),\n\t\tType:                                 Ptr(\"\"),\n\t\tPlan:                                 &Plan{},\n\t\tTwoFactorRequirementEnabled:          Ptr(false),\n\t\tIsVerified:                           Ptr(false),\n\t\tHasOrganizationProjects:              Ptr(false),\n\t\tHasRepositoryProjects:                Ptr(false),\n\t\tDefaultRepoPermission:                Ptr(\"\"),\n\t\tDefaultRepoSettings:                  Ptr(\"\"),\n\t\tMembersCanCreateRepos:                Ptr(false),\n\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\tMembersCanCreatePrivateRepos:         Ptr(false),\n\t\tMembersCanCreateInternalRepos:        Ptr(false),\n\t\tMembersCanForkPrivateRepos:           Ptr(false),\n\t\tMembersAllowedRepositoryCreationType: Ptr(\"\"),\n\t\tMembersCanCreatePages:                Ptr(false),\n\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\tMembersCanCreatePrivatePages:         Ptr(false),\n\t\tWebCommitSignoffRequired:             Ptr(false),\n\t\tAdvancedSecurityEnabledForNewRepos:   Ptr(false),\n\t\tDependabotAlertsEnabledForNewRepos:   Ptr(false),\n\t\tDependabotSecurityUpdatesEnabledForNewRepos:    Ptr(false),\n\t\tDependencyGraphEnabledForNewRepos:              Ptr(false),\n\t\tSecretScanningEnabledForNewRepos:               Ptr(false),\n\t\tSecretScanningPushProtectionEnabledForNewRepos: Ptr(false),\n\t\tSecretScanningValidityChecksEnabled:            Ptr(false),\n\t\tMembersCanDeleteRepositories:                   Ptr(false),\n\t\tMembersCanChangeRepoVisibility:                 Ptr(false),\n\t\tMembersCanInviteOutsideCollaborators:           Ptr(false),\n\t\tMembersCanDeleteIssues:                         Ptr(false),\n\t\tDisplayCommenterFullNameSettingEnabled:         Ptr(false),\n\t\tReadersCanCreateDiscussions:                    Ptr(false),\n\t\tMembersCanCreateTeams:                          Ptr(false),\n\t\tMembersCanViewDependencyInsights:               Ptr(false),\n\t\tDefaultRepositoryBranch:                        Ptr(\"\"),\n\t\tURL:                                            Ptr(\"\"),\n\t\tEventsURL:                                      Ptr(\"\"),\n\t\tHooksURL:                                       Ptr(\"\"),\n\t\tIssuesURL:                                      Ptr(\"\"),\n\t\tMembersURL:                                     Ptr(\"\"),\n\t\tPublicMembersURL:                               Ptr(\"\"),\n\t\tReposURL:                                       Ptr(\"\"),\n\t}\n\twant := `github.Organization{Login:\"\", ID:0, NodeID:\"\", AvatarURL:\"\", HTMLURL:\"\", Name:\"\", Company:\"\", Blog:\"\", Location:\"\", Email:\"\", TwitterUsername:\"\", Description:\"\", PublicRepos:0, PublicGists:0, Followers:0, Following:0, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, TotalPrivateRepos:0, OwnedPrivateRepos:0, PrivateGists:0, DiskUsage:0, Collaborators:0, BillingEmail:\"\", Type:\"\", Plan:github.Plan{}, TwoFactorRequirementEnabled:false, IsVerified:false, HasOrganizationProjects:false, HasRepositoryProjects:false, DefaultRepoPermission:\"\", DefaultRepoSettings:\"\", MembersCanCreateRepos:false, MembersCanCreatePublicRepos:false, MembersCanCreatePrivateRepos:false, MembersCanCreateInternalRepos:false, MembersCanForkPrivateRepos:false, MembersAllowedRepositoryCreationType:\"\", MembersCanCreatePages:false, MembersCanCreatePublicPages:false, MembersCanCreatePrivatePages:false, WebCommitSignoffRequired:false, AdvancedSecurityEnabledForNewRepos:false, DependabotAlertsEnabledForNewRepos:false, DependabotSecurityUpdatesEnabledForNewRepos:false, DependencyGraphEnabledForNewRepos:false, SecretScanningEnabledForNewRepos:false, SecretScanningPushProtectionEnabledForNewRepos:false, SecretScanningValidityChecksEnabled:false, MembersCanDeleteRepositories:false, MembersCanChangeRepoVisibility:false, MembersCanInviteOutsideCollaborators:false, MembersCanDeleteIssues:false, DisplayCommenterFullNameSettingEnabled:false, ReadersCanCreateDiscussions:false, MembersCanCreateTeams:false, MembersCanViewDependencyInsights:false, DefaultRepositoryBranch:\"\", URL:\"\", EventsURL:\"\", HooksURL:\"\", IssuesURL:\"\", MembersURL:\"\", PublicMembersURL:\"\", ReposURL:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"Organization.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestPackage_String(t *testing.T) {\n\tt.Parallel()\n\tv := Package{\n\t\tID:             Ptr(int64(0)),\n\t\tName:           Ptr(\"\"),\n\t\tPackageType:    Ptr(\"\"),\n\t\tHTMLURL:        Ptr(\"\"),\n\t\tVisibility:     Ptr(\"\"),\n\t\tOwner:          &User{},\n\t\tRepository:     &Repository{},\n\t\tCreatedAt:      &Timestamp{},\n\t\tUpdatedAt:      &Timestamp{},\n\t\tNamespace:      Ptr(\"\"),\n\t\tDescription:    Ptr(\"\"),\n\t\tEcosystem:      Ptr(\"\"),\n\t\tPackageVersion: &PackageVersion{},\n\t\tRegistry:       &PackageRegistry{},\n\t\tURL:            Ptr(\"\"),\n\t\tVersionCount:   Ptr(int64(0)),\n\t}\n\twant := `github.Package{ID:0, Name:\"\", PackageType:\"\", HTMLURL:\"\", Visibility:\"\", Owner:github.User{}, Repository:github.Repository{}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Namespace:\"\", Description:\"\", Ecosystem:\"\", PackageVersion:github.PackageVersion{}, Registry:github.PackageRegistry{}, URL:\"\", VersionCount:0}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"Package.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestPackageContainerMetadata_String(t *testing.T) {\n\tt.Parallel()\n\tv := PackageContainerMetadata{\n\t\tTags: []string{\"\"},\n\t}\n\twant := `github.PackageContainerMetadata{Tags:[\"\"]}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"PackageContainerMetadata.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestPackageEventContainerMetadata_String(t *testing.T) {\n\tt.Parallel()\n\tv := PackageEventContainerMetadata{\n\t\tTag: &PackageEventContainerMetadataTag{},\n\t}\n\twant := `github.PackageEventContainerMetadata{Tag:github.PackageEventContainerMetadataTag{}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"PackageEventContainerMetadata.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestPackageEventContainerMetadataTag_String(t *testing.T) {\n\tt.Parallel()\n\tv := PackageEventContainerMetadataTag{\n\t\tName:   Ptr(\"\"),\n\t\tDigest: Ptr(\"\"),\n\t}\n\twant := `github.PackageEventContainerMetadataTag{Name:\"\", Digest:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"PackageEventContainerMetadataTag.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestPackageFile_String(t *testing.T) {\n\tt.Parallel()\n\tv := PackageFile{\n\t\tDownloadURL: Ptr(\"\"),\n\t\tID:          Ptr(int64(0)),\n\t\tName:        Ptr(\"\"),\n\t\tSHA256:      Ptr(\"\"),\n\t\tSHA1:        Ptr(\"\"),\n\t\tMD5:         Ptr(\"\"),\n\t\tContentType: Ptr(\"\"),\n\t\tState:       Ptr(\"\"),\n\t\tAuthor:      &User{},\n\t\tSize:        Ptr(int64(0)),\n\t\tCreatedAt:   &Timestamp{},\n\t\tUpdatedAt:   &Timestamp{},\n\t}\n\twant := `github.PackageFile{DownloadURL:\"\", ID:0, Name:\"\", SHA256:\"\", SHA1:\"\", MD5:\"\", ContentType:\"\", State:\"\", Author:github.User{}, Size:0, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"PackageFile.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestPackageMetadata_String(t *testing.T) {\n\tt.Parallel()\n\tv := PackageMetadata{\n\t\tPackageType: Ptr(\"\"),\n\t\tContainer:   &PackageContainerMetadata{},\n\t}\n\twant := `github.PackageMetadata{PackageType:\"\", Container:github.PackageContainerMetadata{}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"PackageMetadata.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestPackageNPMMetadata_String(t *testing.T) {\n\tt.Parallel()\n\tv := PackageNPMMetadata{\n\t\tName:                Ptr(\"\"),\n\t\tVersion:             Ptr(\"\"),\n\t\tNPMUser:             Ptr(\"\"),\n\t\tDescription:         Ptr(\"\"),\n\t\tGitHead:             Ptr(\"\"),\n\t\tHomepage:            Ptr(\"\"),\n\t\tLicense:             Ptr(\"\"),\n\t\tMain:                Ptr(\"\"),\n\t\tID:                  Ptr(\"\"),\n\t\tNodeVersion:         Ptr(\"\"),\n\t\tNPMVersion:          Ptr(\"\"),\n\t\tHasShrinkwrap:       Ptr(false),\n\t\tMaintainers:         []any{nil},\n\t\tContributors:        []any{nil},\n\t\tKeywords:            []string{\"\"},\n\t\tFiles:               []string{\"\"},\n\t\tOS:                  []string{\"\"},\n\t\tCPU:                 []string{\"\"},\n\t\tReadme:              Ptr(\"\"),\n\t\tInstallationCommand: Ptr(\"\"),\n\t\tReleaseID:           Ptr(int64(0)),\n\t\tCommitOID:           Ptr(\"\"),\n\t\tPublishedViaActions: Ptr(false),\n\t\tDeletedByID:         Ptr(int64(0)),\n\t}\n\twant := `github.PackageNPMMetadata{Name:\"\", Version:\"\", NPMUser:\"\", Description:\"\", GitHead:\"\", Homepage:\"\", License:\"\", Main:\"\", ID:\"\", NodeVersion:\"\", NPMVersion:\"\", HasShrinkwrap:false, Maintainers:[<nil>], Contributors:[<nil>], Keywords:[\"\"], Files:[\"\"], OS:[\"\"], CPU:[\"\"], Readme:\"\", InstallationCommand:\"\", ReleaseID:0, CommitOID:\"\", PublishedViaActions:false, DeletedByID:0}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"PackageNPMMetadata.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestPackageNugetMetadata_String(t *testing.T) {\n\tt.Parallel()\n\tv := PackageNugetMetadata{\n\t\tName: Ptr(\"\"),\n\t}\n\twant := `github.PackageNugetMetadata{Name:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"PackageNugetMetadata.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestPackageRegistry_String(t *testing.T) {\n\tt.Parallel()\n\tv := PackageRegistry{\n\t\tAboutURL: Ptr(\"\"),\n\t\tName:     Ptr(\"\"),\n\t\tType:     Ptr(\"\"),\n\t\tURL:      Ptr(\"\"),\n\t\tVendor:   Ptr(\"\"),\n\t}\n\twant := `github.PackageRegistry{AboutURL:\"\", Name:\"\", Type:\"\", URL:\"\", Vendor:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"PackageRegistry.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestPackageRelease_String(t *testing.T) {\n\tt.Parallel()\n\tv := PackageRelease{\n\t\tURL:             Ptr(\"\"),\n\t\tHTMLURL:         Ptr(\"\"),\n\t\tID:              Ptr(int64(0)),\n\t\tTagName:         Ptr(\"\"),\n\t\tTargetCommitish: Ptr(\"\"),\n\t\tName:            Ptr(\"\"),\n\t\tDraft:           Ptr(false),\n\t\tAuthor:          &User{},\n\t\tPrerelease:      Ptr(false),\n\t\tCreatedAt:       &Timestamp{},\n\t\tPublishedAt:     &Timestamp{},\n\t}\n\twant := `github.PackageRelease{URL:\"\", HTMLURL:\"\", ID:0, TagName:\"\", TargetCommitish:\"\", Name:\"\", Draft:false, Author:github.User{}, Prerelease:false, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, PublishedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"PackageRelease.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestPackageVersion_String(t *testing.T) {\n\tt.Parallel()\n\tv := PackageVersion{\n\t\tID:                  Ptr(int64(0)),\n\t\tName:                Ptr(\"\"),\n\t\tURL:                 Ptr(\"\"),\n\t\tPackageHTMLURL:      Ptr(\"\"),\n\t\tLicense:             Ptr(\"\"),\n\t\tDescription:         Ptr(\"\"),\n\t\tCreatedAt:           &Timestamp{},\n\t\tUpdatedAt:           &Timestamp{},\n\t\tVersion:             Ptr(\"\"),\n\t\tSummary:             Ptr(\"\"),\n\t\tBodyHTML:            Ptr(\"\"),\n\t\tRelease:             &PackageRelease{},\n\t\tManifest:            Ptr(\"\"),\n\t\tHTMLURL:             Ptr(\"\"),\n\t\tTagName:             Ptr(\"\"),\n\t\tTargetCommitish:     Ptr(\"\"),\n\t\tTargetOID:           Ptr(\"\"),\n\t\tDraft:               Ptr(false),\n\t\tPrerelease:          Ptr(false),\n\t\tContainerMetadata:   &PackageEventContainerMetadata{},\n\t\tDockerMetadata:      []any{nil},\n\t\tNPMMetadata:         &PackageNPMMetadata{},\n\t\tPackageURL:          Ptr(\"\"),\n\t\tAuthor:              &User{},\n\t\tSourceURL:           Ptr(\"\"),\n\t\tInstallationCommand: Ptr(\"\"),\n\t\tDeletedAt:           &Timestamp{},\n\t}\n\twant := `github.PackageVersion{ID:0, Name:\"\", URL:\"\", PackageHTMLURL:\"\", License:\"\", Description:\"\", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Version:\"\", Summary:\"\", BodyHTML:\"\", Release:github.PackageRelease{}, Manifest:\"\", HTMLURL:\"\", TagName:\"\", TargetCommitish:\"\", TargetOID:\"\", Draft:false, Prerelease:false, ContainerMetadata:github.PackageEventContainerMetadata{}, DockerMetadata:[<nil>], NPMMetadata:github.PackageNPMMetadata{}, PackageURL:\"\", Author:github.User{}, SourceURL:\"\", InstallationCommand:\"\", DeletedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"PackageVersion.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestPackageVersionBody_String(t *testing.T) {\n\tt.Parallel()\n\tv := PackageVersionBody{\n\t\tRepo: &Repository{},\n\t\tInfo: &PackageVersionBodyInfo{},\n\t}\n\twant := `github.PackageVersionBody{Repo:github.Repository{}, Info:github.PackageVersionBodyInfo{}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"PackageVersionBody.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestPackageVersionBodyInfo_String(t *testing.T) {\n\tt.Parallel()\n\tv := PackageVersionBodyInfo{\n\t\tType:       Ptr(\"\"),\n\t\tOID:        Ptr(\"\"),\n\t\tMode:       Ptr(int64(0)),\n\t\tName:       Ptr(\"\"),\n\t\tPath:       Ptr(\"\"),\n\t\tSize:       Ptr(int64(0)),\n\t\tCollection: Ptr(false),\n\t}\n\twant := `github.PackageVersionBodyInfo{Type:\"\", OID:\"\", Mode:0, Name:\"\", Path:\"\", Size:0, Collection:false}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"PackageVersionBodyInfo.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestPageStats_String(t *testing.T) {\n\tt.Parallel()\n\tv := PageStats{\n\t\tTotalPages: Ptr(0),\n\t}\n\twant := `github.PageStats{TotalPages:0}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"PageStats.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestPlan_String(t *testing.T) {\n\tt.Parallel()\n\tv := Plan{\n\t\tName:          Ptr(\"\"),\n\t\tSpace:         Ptr(0),\n\t\tCollaborators: Ptr(0),\n\t\tPrivateRepos:  Ptr(int64(0)),\n\t\tFilledSeats:   Ptr(0),\n\t\tSeats:         Ptr(0),\n\t}\n\twant := `github.Plan{Name:\"\", Space:0, Collaborators:0, PrivateRepos:0, FilledSeats:0, Seats:0}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"Plan.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestPreReceiveHook_String(t *testing.T) {\n\tt.Parallel()\n\tv := PreReceiveHook{\n\t\tID:          Ptr(int64(0)),\n\t\tName:        Ptr(\"\"),\n\t\tEnforcement: Ptr(\"\"),\n\t\tConfigURL:   Ptr(\"\"),\n\t}\n\twant := `github.PreReceiveHook{ID:0, Name:\"\", Enforcement:\"\", ConfigURL:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"PreReceiveHook.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestProjectV2_String(t *testing.T) {\n\tt.Parallel()\n\tv := ProjectV2{\n\t\tID:                     Ptr(int64(0)),\n\t\tNodeID:                 Ptr(\"\"),\n\t\tOwner:                  &User{},\n\t\tCreator:                &User{},\n\t\tTitle:                  Ptr(\"\"),\n\t\tDescription:            Ptr(\"\"),\n\t\tPublic:                 Ptr(false),\n\t\tClosedAt:               &Timestamp{},\n\t\tCreatedAt:              &Timestamp{},\n\t\tUpdatedAt:              &Timestamp{},\n\t\tDeletedAt:              &Timestamp{},\n\t\tNumber:                 Ptr(0),\n\t\tShortDescription:       Ptr(\"\"),\n\t\tDeletedBy:              &User{},\n\t\tState:                  Ptr(\"\"),\n\t\tLatestStatusUpdate:     &ProjectV2StatusUpdate{},\n\t\tIsTemplate:             Ptr(false),\n\t\tURL:                    Ptr(\"\"),\n\t\tHTMLURL:                Ptr(\"\"),\n\t\tColumnsURL:             Ptr(\"\"),\n\t\tOwnerURL:               Ptr(\"\"),\n\t\tName:                   Ptr(\"\"),\n\t\tBody:                   Ptr(\"\"),\n\t\tOrganizationPermission: Ptr(\"\"),\n\t\tPrivate:                Ptr(false),\n\t}\n\twant := `github.ProjectV2{ID:0, NodeID:\"\", Owner:github.User{}, Creator:github.User{}, Title:\"\", Description:\"\", Public:false, ClosedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, DeletedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Number:0, ShortDescription:\"\", DeletedBy:github.User{}, State:\"\", LatestStatusUpdate:github.ProjectV2StatusUpdate{}, IsTemplate:false, URL:\"\", HTMLURL:\"\", ColumnsURL:\"\", OwnerURL:\"\", Name:\"\", Body:\"\", OrganizationPermission:\"\", Private:false}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"ProjectV2.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestPullRequest_String(t *testing.T) {\n\tt.Parallel()\n\tv := PullRequest{\n\t\tID:                  Ptr(int64(0)),\n\t\tNumber:              Ptr(0),\n\t\tState:               Ptr(\"\"),\n\t\tLocked:              Ptr(false),\n\t\tTitle:               Ptr(\"\"),\n\t\tBody:                Ptr(\"\"),\n\t\tCreatedAt:           &Timestamp{},\n\t\tUpdatedAt:           &Timestamp{},\n\t\tClosedAt:            &Timestamp{},\n\t\tMergedAt:            &Timestamp{},\n\t\tUser:                &User{},\n\t\tDraft:               Ptr(false),\n\t\tURL:                 Ptr(\"\"),\n\t\tHTMLURL:             Ptr(\"\"),\n\t\tIssueURL:            Ptr(\"\"),\n\t\tStatusesURL:         Ptr(\"\"),\n\t\tDiffURL:             Ptr(\"\"),\n\t\tPatchURL:            Ptr(\"\"),\n\t\tCommitsURL:          Ptr(\"\"),\n\t\tCommentsURL:         Ptr(\"\"),\n\t\tReviewCommentsURL:   Ptr(\"\"),\n\t\tReviewCommentURL:    Ptr(\"\"),\n\t\tAssignee:            &User{},\n\t\tMilestone:           &Milestone{},\n\t\tAuthorAssociation:   Ptr(\"\"),\n\t\tNodeID:              Ptr(\"\"),\n\t\tAutoMerge:           &PullRequestAutoMerge{},\n\t\tMerged:              Ptr(false),\n\t\tMergeable:           Ptr(false),\n\t\tMergeableState:      Ptr(\"\"),\n\t\tRebaseable:          Ptr(false),\n\t\tMergedBy:            &User{},\n\t\tMergeCommitSHA:      Ptr(\"\"),\n\t\tComments:            Ptr(0),\n\t\tCommits:             Ptr(0),\n\t\tAdditions:           Ptr(0),\n\t\tDeletions:           Ptr(0),\n\t\tChangedFiles:        Ptr(0),\n\t\tMaintainerCanModify: Ptr(false),\n\t\tReviewComments:      Ptr(0),\n\t\tLinks:               &PRLinks{},\n\t\tHead:                &PullRequestBranch{},\n\t\tBase:                &PullRequestBranch{},\n\t\tActiveLockReason:    Ptr(\"\"),\n\t}\n\twant := `github.PullRequest{ID:0, Number:0, State:\"\", Locked:false, Title:\"\", Body:\"\", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, ClosedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, MergedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, User:github.User{}, Draft:false, URL:\"\", HTMLURL:\"\", IssueURL:\"\", StatusesURL:\"\", DiffURL:\"\", PatchURL:\"\", CommitsURL:\"\", CommentsURL:\"\", ReviewCommentsURL:\"\", ReviewCommentURL:\"\", Assignee:github.User{}, Milestone:github.Milestone{}, AuthorAssociation:\"\", NodeID:\"\", AutoMerge:github.PullRequestAutoMerge{}, Merged:false, Mergeable:false, MergeableState:\"\", Rebaseable:false, MergedBy:github.User{}, MergeCommitSHA:\"\", Comments:0, Commits:0, Additions:0, Deletions:0, ChangedFiles:0, MaintainerCanModify:false, ReviewComments:0, Links:github.PRLinks{}, Head:github.PullRequestBranch{}, Base:github.PullRequestBranch{}, ActiveLockReason:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"PullRequest.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestPullRequestComment_String(t *testing.T) {\n\tt.Parallel()\n\tv := PullRequestComment{\n\t\tID:                  Ptr(int64(0)),\n\t\tNodeID:              Ptr(\"\"),\n\t\tInReplyTo:           Ptr(int64(0)),\n\t\tBody:                Ptr(\"\"),\n\t\tPath:                Ptr(\"\"),\n\t\tDiffHunk:            Ptr(\"\"),\n\t\tPullRequestReviewID: Ptr(int64(0)),\n\t\tPosition:            Ptr(0),\n\t\tOriginalPosition:    Ptr(0),\n\t\tStartLine:           Ptr(0),\n\t\tLine:                Ptr(0),\n\t\tOriginalLine:        Ptr(0),\n\t\tOriginalStartLine:   Ptr(0),\n\t\tSide:                Ptr(\"\"),\n\t\tStartSide:           Ptr(\"\"),\n\t\tCommitID:            Ptr(\"\"),\n\t\tOriginalCommitID:    Ptr(\"\"),\n\t\tUser:                &User{},\n\t\tReactions:           &Reactions{},\n\t\tCreatedAt:           &Timestamp{},\n\t\tUpdatedAt:           &Timestamp{},\n\t\tAuthorAssociation:   Ptr(\"\"),\n\t\tURL:                 Ptr(\"\"),\n\t\tHTMLURL:             Ptr(\"\"),\n\t\tPullRequestURL:      Ptr(\"\"),\n\t\tSubjectType:         Ptr(\"\"),\n\t}\n\twant := `github.PullRequestComment{ID:0, NodeID:\"\", InReplyTo:0, Body:\"\", Path:\"\", DiffHunk:\"\", PullRequestReviewID:0, Position:0, OriginalPosition:0, StartLine:0, Line:0, OriginalLine:0, OriginalStartLine:0, Side:\"\", StartSide:\"\", CommitID:\"\", OriginalCommitID:\"\", User:github.User{}, Reactions:github.Reactions{}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, AuthorAssociation:\"\", URL:\"\", HTMLURL:\"\", PullRequestURL:\"\", SubjectType:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"PullRequestComment.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestPullRequestReview_String(t *testing.T) {\n\tt.Parallel()\n\tv := PullRequestReview{\n\t\tID:                Ptr(int64(0)),\n\t\tNodeID:            Ptr(\"\"),\n\t\tUser:              &User{},\n\t\tBody:              Ptr(\"\"),\n\t\tSubmittedAt:       &Timestamp{},\n\t\tCommitID:          Ptr(\"\"),\n\t\tHTMLURL:           Ptr(\"\"),\n\t\tPullRequestURL:    Ptr(\"\"),\n\t\tState:             Ptr(\"\"),\n\t\tAuthorAssociation: Ptr(\"\"),\n\t}\n\twant := `github.PullRequestReview{ID:0, NodeID:\"\", User:github.User{}, Body:\"\", SubmittedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, CommitID:\"\", HTMLURL:\"\", PullRequestURL:\"\", State:\"\", AuthorAssociation:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"PullRequestReview.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestPullRequestReviewDismissalRequest_String(t *testing.T) {\n\tt.Parallel()\n\tv := PullRequestReviewDismissalRequest{\n\t\tMessage: Ptr(\"\"),\n\t}\n\twant := `github.PullRequestReviewDismissalRequest{Message:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"PullRequestReviewDismissalRequest.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestPullRequestReviewRequest_String(t *testing.T) {\n\tt.Parallel()\n\tv := PullRequestReviewRequest{\n\t\tNodeID:   Ptr(\"\"),\n\t\tCommitID: Ptr(\"\"),\n\t\tBody:     Ptr(\"\"),\n\t\tEvent:    Ptr(\"\"),\n\t}\n\twant := `github.PullRequestReviewRequest{NodeID:\"\", CommitID:\"\", Body:\"\", Event:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"PullRequestReviewRequest.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestPullRequestThread_String(t *testing.T) {\n\tt.Parallel()\n\tv := PullRequestThread{\n\t\tID:     Ptr(int64(0)),\n\t\tNodeID: Ptr(\"\"),\n\t}\n\twant := `github.PullRequestThread{ID:0, NodeID:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"PullRequestThread.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestPullStats_String(t *testing.T) {\n\tt.Parallel()\n\tv := PullStats{\n\t\tTotalPulls:       Ptr(0),\n\t\tMergedPulls:      Ptr(0),\n\t\tMergeablePulls:   Ptr(0),\n\t\tUnmergeablePulls: Ptr(0),\n\t}\n\twant := `github.PullStats{TotalPulls:0, MergedPulls:0, MergeablePulls:0, UnmergeablePulls:0}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"PullStats.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestPushEvent_String(t *testing.T) {\n\tt.Parallel()\n\tv := PushEvent{\n\t\tPushID:       Ptr(int64(0)),\n\t\tHead:         Ptr(\"\"),\n\t\tRef:          Ptr(\"\"),\n\t\tSize:         Ptr(0),\n\t\tBefore:       Ptr(\"\"),\n\t\tDistinctSize: Ptr(0),\n\t\tAction:       Ptr(\"\"),\n\t\tAfter:        Ptr(\"\"),\n\t\tCreated:      Ptr(false),\n\t\tDeleted:      Ptr(false),\n\t\tForced:       Ptr(false),\n\t\tBaseRef:      Ptr(\"\"),\n\t\tCompare:      Ptr(\"\"),\n\t\tRepo:         &PushEventRepository{},\n\t\tHeadCommit:   &HeadCommit{},\n\t\tPusher:       &CommitAuthor{},\n\t\tSender:       &User{},\n\t\tInstallation: &Installation{},\n\t\tOrganization: &Organization{},\n\t}\n\twant := `github.PushEvent{PushID:0, Head:\"\", Ref:\"\", Size:0, Before:\"\", DistinctSize:0, Action:\"\", After:\"\", Created:false, Deleted:false, Forced:false, BaseRef:\"\", Compare:\"\", Repo:github.PushEventRepository{}, HeadCommit:github.HeadCommit{}, Pusher:github.CommitAuthor{}, Sender:github.User{}, Installation:github.Installation{}, Organization:github.Organization{}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"PushEvent.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestRate_String(t *testing.T) {\n\tt.Parallel()\n\tv := Rate{\n\t\tLimit:     0,\n\t\tRemaining: 0,\n\t\tUsed:      0,\n\t\tReset:     Timestamp{},\n\t\tResource:  \"\",\n\t}\n\twant := `github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"Rate.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestReaction_String(t *testing.T) {\n\tt.Parallel()\n\tv := Reaction{\n\t\tID:        Ptr(int64(0)),\n\t\tUser:      &User{},\n\t\tNodeID:    Ptr(\"\"),\n\t\tContent:   Ptr(\"\"),\n\t\tCreatedAt: &Timestamp{},\n\t}\n\twant := `github.Reaction{ID:0, User:github.User{}, NodeID:\"\", Content:\"\", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"Reaction.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestReference_String(t *testing.T) {\n\tt.Parallel()\n\tv := Reference{\n\t\tRef:    Ptr(\"\"),\n\t\tURL:    Ptr(\"\"),\n\t\tObject: &GitObject{},\n\t\tNodeID: Ptr(\"\"),\n\t}\n\twant := `github.Reference{Ref:\"\", URL:\"\", Object:github.GitObject{}, NodeID:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"Reference.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestReleaseAsset_String(t *testing.T) {\n\tt.Parallel()\n\tv := ReleaseAsset{\n\t\tID:                 Ptr(int64(0)),\n\t\tURL:                Ptr(\"\"),\n\t\tName:               Ptr(\"\"),\n\t\tLabel:              Ptr(\"\"),\n\t\tState:              Ptr(\"\"),\n\t\tContentType:        Ptr(\"\"),\n\t\tSize:               Ptr(0),\n\t\tDownloadCount:      Ptr(0),\n\t\tCreatedAt:          &Timestamp{},\n\t\tUpdatedAt:          &Timestamp{},\n\t\tBrowserDownloadURL: Ptr(\"\"),\n\t\tUploader:           &User{},\n\t\tNodeID:             Ptr(\"\"),\n\t\tDigest:             Ptr(\"\"),\n\t}\n\twant := `github.ReleaseAsset{ID:0, URL:\"\", Name:\"\", Label:\"\", State:\"\", ContentType:\"\", Size:0, DownloadCount:0, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, BrowserDownloadURL:\"\", Uploader:github.User{}, NodeID:\"\", Digest:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"ReleaseAsset.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestRename_String(t *testing.T) {\n\tt.Parallel()\n\tv := Rename{\n\t\tFrom: Ptr(\"\"),\n\t\tTo:   Ptr(\"\"),\n\t}\n\twant := `github.Rename{From:\"\", To:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"Rename.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestRepoStats_String(t *testing.T) {\n\tt.Parallel()\n\tv := RepoStats{\n\t\tTotalRepos:  Ptr(0),\n\t\tRootRepos:   Ptr(0),\n\t\tForkRepos:   Ptr(0),\n\t\tOrgRepos:    Ptr(0),\n\t\tTotalPushes: Ptr(0),\n\t\tTotalWikis:  Ptr(0),\n\t}\n\twant := `github.RepoStats{TotalRepos:0, RootRepos:0, ForkRepos:0, OrgRepos:0, TotalPushes:0, TotalWikis:0}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"RepoStats.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestRepoStatus_String(t *testing.T) {\n\tt.Parallel()\n\tv := RepoStatus{\n\t\tID:          Ptr(int64(0)),\n\t\tNodeID:      Ptr(\"\"),\n\t\tURL:         Ptr(\"\"),\n\t\tState:       Ptr(\"\"),\n\t\tTargetURL:   Ptr(\"\"),\n\t\tDescription: Ptr(\"\"),\n\t\tContext:     Ptr(\"\"),\n\t\tAvatarURL:   Ptr(\"\"),\n\t\tCreator:     &User{},\n\t\tCreatedAt:   &Timestamp{},\n\t\tUpdatedAt:   &Timestamp{},\n\t}\n\twant := `github.RepoStatus{ID:0, NodeID:\"\", URL:\"\", State:\"\", TargetURL:\"\", Description:\"\", Context:\"\", AvatarURL:\"\", Creator:github.User{}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"RepoStatus.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestRepository_String(t *testing.T) {\n\tt.Parallel()\n\tv := Repository{\n\t\tID:                        Ptr(int64(0)),\n\t\tNodeID:                    Ptr(\"\"),\n\t\tOwner:                     &User{},\n\t\tName:                      Ptr(\"\"),\n\t\tFullName:                  Ptr(\"\"),\n\t\tDescription:               Ptr(\"\"),\n\t\tHomepage:                  Ptr(\"\"),\n\t\tCodeOfConduct:             &CodeOfConduct{},\n\t\tDefaultBranch:             Ptr(\"\"),\n\t\tMasterBranch:              Ptr(\"\"),\n\t\tCreatedAt:                 &Timestamp{},\n\t\tPushedAt:                  &Timestamp{},\n\t\tUpdatedAt:                 &Timestamp{},\n\t\tHTMLURL:                   Ptr(\"\"),\n\t\tCloneURL:                  Ptr(\"\"),\n\t\tGitURL:                    Ptr(\"\"),\n\t\tMirrorURL:                 Ptr(\"\"),\n\t\tSSHURL:                    Ptr(\"\"),\n\t\tSVNURL:                    Ptr(\"\"),\n\t\tLanguage:                  Ptr(\"\"),\n\t\tFork:                      Ptr(false),\n\t\tForksCount:                Ptr(0),\n\t\tNetworkCount:              Ptr(0),\n\t\tOpenIssuesCount:           Ptr(0),\n\t\tOpenIssues:                Ptr(0),\n\t\tStargazersCount:           Ptr(0),\n\t\tSubscribersCount:          Ptr(0),\n\t\tWatchersCount:             Ptr(0),\n\t\tWatchers:                  Ptr(0),\n\t\tSize:                      Ptr(0),\n\t\tAutoInit:                  Ptr(false),\n\t\tParent:                    &Repository{},\n\t\tSource:                    &Repository{},\n\t\tTemplateRepository:        &Repository{},\n\t\tOrganization:              &Organization{},\n\t\tPermissions:               &RepositoryPermissions{},\n\t\tAllowRebaseMerge:          Ptr(false),\n\t\tAllowUpdateBranch:         Ptr(false),\n\t\tAllowSquashMerge:          Ptr(false),\n\t\tAllowMergeCommit:          Ptr(false),\n\t\tAllowAutoMerge:            Ptr(false),\n\t\tAllowForking:              Ptr(false),\n\t\tWebCommitSignoffRequired:  Ptr(false),\n\t\tDeleteBranchOnMerge:       Ptr(false),\n\t\tUseSquashPRTitleAsDefault: Ptr(false),\n\t\tSquashMergeCommitTitle:    Ptr(\"\"),\n\t\tSquashMergeCommitMessage:  Ptr(\"\"),\n\t\tMergeCommitTitle:          Ptr(\"\"),\n\t\tMergeCommitMessage:        Ptr(\"\"),\n\t\tTopics:                    []string{\"\"},\n\t\tArchived:                  Ptr(false),\n\t\tDisabled:                  Ptr(false),\n\t\tLicense:                   &License{},\n\t\tPrivate:                   Ptr(false),\n\t\tHasIssues:                 Ptr(false),\n\t\tHasWiki:                   Ptr(false),\n\t\tHasPages:                  Ptr(false),\n\t\tHasProjects:               Ptr(false),\n\t\tHasDownloads:              Ptr(false),\n\t\tHasDiscussions:            Ptr(false),\n\t\tIsTemplate:                Ptr(false),\n\t\tLicenseTemplate:           Ptr(\"\"),\n\t\tGitignoreTemplate:         Ptr(\"\"),\n\t\tSecurityAndAnalysis:       &SecurityAndAnalysis{},\n\t\tTeamID:                    Ptr(int64(0)),\n\t\tURL:                       Ptr(\"\"),\n\t\tArchiveURL:                Ptr(\"\"),\n\t\tAssigneesURL:              Ptr(\"\"),\n\t\tBlobsURL:                  Ptr(\"\"),\n\t\tBranchesURL:               Ptr(\"\"),\n\t\tCollaboratorsURL:          Ptr(\"\"),\n\t\tCommentsURL:               Ptr(\"\"),\n\t\tCommitsURL:                Ptr(\"\"),\n\t\tCompareURL:                Ptr(\"\"),\n\t\tContentsURL:               Ptr(\"\"),\n\t\tContributorsURL:           Ptr(\"\"),\n\t\tDeploymentsURL:            Ptr(\"\"),\n\t\tDownloadsURL:              Ptr(\"\"),\n\t\tEventsURL:                 Ptr(\"\"),\n\t\tForksURL:                  Ptr(\"\"),\n\t\tGitCommitsURL:             Ptr(\"\"),\n\t\tGitRefsURL:                Ptr(\"\"),\n\t\tGitTagsURL:                Ptr(\"\"),\n\t\tHooksURL:                  Ptr(\"\"),\n\t\tIssueCommentURL:           Ptr(\"\"),\n\t\tIssueEventsURL:            Ptr(\"\"),\n\t\tIssuesURL:                 Ptr(\"\"),\n\t\tKeysURL:                   Ptr(\"\"),\n\t\tLabelsURL:                 Ptr(\"\"),\n\t\tLanguagesURL:              Ptr(\"\"),\n\t\tMergesURL:                 Ptr(\"\"),\n\t\tMilestonesURL:             Ptr(\"\"),\n\t\tNotificationsURL:          Ptr(\"\"),\n\t\tPullsURL:                  Ptr(\"\"),\n\t\tReleasesURL:               Ptr(\"\"),\n\t\tStargazersURL:             Ptr(\"\"),\n\t\tStatusesURL:               Ptr(\"\"),\n\t\tSubscribersURL:            Ptr(\"\"),\n\t\tSubscriptionURL:           Ptr(\"\"),\n\t\tTagsURL:                   Ptr(\"\"),\n\t\tTreesURL:                  Ptr(\"\"),\n\t\tTeamsURL:                  Ptr(\"\"),\n\t\tVisibility:                Ptr(\"\"),\n\t\tRoleName:                  Ptr(\"\"),\n\t}\n\twant := `github.Repository{ID:0, NodeID:\"\", Owner:github.User{}, Name:\"\", FullName:\"\", Description:\"\", Homepage:\"\", CodeOfConduct:github.CodeOfConduct{}, DefaultBranch:\"\", MasterBranch:\"\", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, PushedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, HTMLURL:\"\", CloneURL:\"\", GitURL:\"\", MirrorURL:\"\", SSHURL:\"\", SVNURL:\"\", Language:\"\", Fork:false, ForksCount:0, NetworkCount:0, OpenIssuesCount:0, OpenIssues:0, StargazersCount:0, SubscribersCount:0, WatchersCount:0, Watchers:0, Size:0, AutoInit:false, Parent:github.Repository{}, Source:github.Repository{}, TemplateRepository:github.Repository{}, Organization:github.Organization{}, Permissions:github.RepositoryPermissions{}, AllowRebaseMerge:false, AllowUpdateBranch:false, AllowSquashMerge:false, AllowMergeCommit:false, AllowAutoMerge:false, AllowForking:false, WebCommitSignoffRequired:false, DeleteBranchOnMerge:false, UseSquashPRTitleAsDefault:false, SquashMergeCommitTitle:\"\", SquashMergeCommitMessage:\"\", MergeCommitTitle:\"\", MergeCommitMessage:\"\", Topics:[\"\"], Archived:false, Disabled:false, License:github.License{}, Private:false, HasIssues:false, HasWiki:false, HasPages:false, HasProjects:false, HasDownloads:false, HasDiscussions:false, IsTemplate:false, LicenseTemplate:\"\", GitignoreTemplate:\"\", SecurityAndAnalysis:github.SecurityAndAnalysis{}, TeamID:0, URL:\"\", ArchiveURL:\"\", AssigneesURL:\"\", BlobsURL:\"\", BranchesURL:\"\", CollaboratorsURL:\"\", CommentsURL:\"\", CommitsURL:\"\", CompareURL:\"\", ContentsURL:\"\", ContributorsURL:\"\", DeploymentsURL:\"\", DownloadsURL:\"\", EventsURL:\"\", ForksURL:\"\", GitCommitsURL:\"\", GitRefsURL:\"\", GitTagsURL:\"\", HooksURL:\"\", IssueCommentURL:\"\", IssueEventsURL:\"\", IssuesURL:\"\", KeysURL:\"\", LabelsURL:\"\", LanguagesURL:\"\", MergesURL:\"\", MilestonesURL:\"\", NotificationsURL:\"\", PullsURL:\"\", ReleasesURL:\"\", StargazersURL:\"\", StatusesURL:\"\", SubscribersURL:\"\", SubscriptionURL:\"\", TagsURL:\"\", TreesURL:\"\", TeamsURL:\"\", Visibility:\"\", RoleName:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"Repository.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestRepositoryComment_String(t *testing.T) {\n\tt.Parallel()\n\tv := RepositoryComment{\n\t\tHTMLURL:   Ptr(\"\"),\n\t\tURL:       Ptr(\"\"),\n\t\tID:        Ptr(int64(0)),\n\t\tNodeID:    Ptr(\"\"),\n\t\tCommitID:  Ptr(\"\"),\n\t\tUser:      &User{},\n\t\tReactions: &Reactions{},\n\t\tCreatedAt: &Timestamp{},\n\t\tUpdatedAt: &Timestamp{},\n\t\tBody:      Ptr(\"\"),\n\t\tPath:      Ptr(\"\"),\n\t\tPosition:  Ptr(0),\n\t}\n\twant := `github.RepositoryComment{HTMLURL:\"\", URL:\"\", ID:0, NodeID:\"\", CommitID:\"\", User:github.User{}, Reactions:github.Reactions{}, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Body:\"\", Path:\"\", Position:0}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"RepositoryComment.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestRepositoryCommit_String(t *testing.T) {\n\tt.Parallel()\n\tv := RepositoryCommit{\n\t\tNodeID:      Ptr(\"\"),\n\t\tSHA:         Ptr(\"\"),\n\t\tCommit:      &Commit{},\n\t\tAuthor:      &User{},\n\t\tCommitter:   &User{},\n\t\tHTMLURL:     Ptr(\"\"),\n\t\tURL:         Ptr(\"\"),\n\t\tCommentsURL: Ptr(\"\"),\n\t\tStats:       &CommitStats{},\n\t}\n\twant := `github.RepositoryCommit{NodeID:\"\", SHA:\"\", Commit:github.Commit{}, Author:github.User{}, Committer:github.User{}, HTMLURL:\"\", URL:\"\", CommentsURL:\"\", Stats:github.CommitStats{}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"RepositoryCommit.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestRepositoryContent_String(t *testing.T) {\n\tt.Parallel()\n\tv := RepositoryContent{\n\t\tType:            Ptr(\"\"),\n\t\tTarget:          Ptr(\"\"),\n\t\tEncoding:        Ptr(\"\"),\n\t\tSize:            Ptr(0),\n\t\tName:            Ptr(\"\"),\n\t\tPath:            Ptr(\"\"),\n\t\tContent:         Ptr(\"\"),\n\t\tSHA:             Ptr(\"\"),\n\t\tURL:             Ptr(\"\"),\n\t\tGitURL:          Ptr(\"\"),\n\t\tHTMLURL:         Ptr(\"\"),\n\t\tDownloadURL:     Ptr(\"\"),\n\t\tSubmoduleGitURL: Ptr(\"\"),\n\t}\n\twant := `github.RepositoryContent{Type:\"\", Target:\"\", Encoding:\"\", Size:0, Name:\"\", Path:\"\", Content:\"\", SHA:\"\", URL:\"\", GitURL:\"\", HTMLURL:\"\", DownloadURL:\"\", SubmoduleGitURL:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"RepositoryContent.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestRepositoryLicense_String(t *testing.T) {\n\tt.Parallel()\n\tv := RepositoryLicense{\n\t\tName:        Ptr(\"\"),\n\t\tPath:        Ptr(\"\"),\n\t\tSHA:         Ptr(\"\"),\n\t\tSize:        Ptr(0),\n\t\tURL:         Ptr(\"\"),\n\t\tHTMLURL:     Ptr(\"\"),\n\t\tGitURL:      Ptr(\"\"),\n\t\tDownloadURL: Ptr(\"\"),\n\t\tType:        Ptr(\"\"),\n\t\tContent:     Ptr(\"\"),\n\t\tEncoding:    Ptr(\"\"),\n\t\tLicense:     &License{},\n\t}\n\twant := `github.RepositoryLicense{Name:\"\", Path:\"\", SHA:\"\", Size:0, URL:\"\", HTMLURL:\"\", GitURL:\"\", DownloadURL:\"\", Type:\"\", Content:\"\", Encoding:\"\", License:github.License{}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"RepositoryLicense.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestRepositoryParticipation_String(t *testing.T) {\n\tt.Parallel()\n\tv := RepositoryParticipation{\n\t\tAll:   []int{0},\n\t\tOwner: []int{0},\n\t}\n\twant := `github.RepositoryParticipation{All:[0], Owner:[0]}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"RepositoryParticipation.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestRepositoryRelease_String(t *testing.T) {\n\tt.Parallel()\n\tv := RepositoryRelease{\n\t\tTagName:                Ptr(\"\"),\n\t\tTargetCommitish:        Ptr(\"\"),\n\t\tName:                   Ptr(\"\"),\n\t\tBody:                   Ptr(\"\"),\n\t\tDraft:                  Ptr(false),\n\t\tPrerelease:             Ptr(false),\n\t\tMakeLatest:             Ptr(\"\"),\n\t\tDiscussionCategoryName: Ptr(\"\"),\n\t\tGenerateReleaseNotes:   Ptr(false),\n\t\tID:                     Ptr(int64(0)),\n\t\tCreatedAt:              &Timestamp{},\n\t\tPublishedAt:            &Timestamp{},\n\t\tURL:                    Ptr(\"\"),\n\t\tHTMLURL:                Ptr(\"\"),\n\t\tAssetsURL:              Ptr(\"\"),\n\t\tUploadURL:              Ptr(\"\"),\n\t\tZipballURL:             Ptr(\"\"),\n\t\tTarballURL:             Ptr(\"\"),\n\t\tAuthor:                 &User{},\n\t\tNodeID:                 Ptr(\"\"),\n\t\tImmutable:              Ptr(false),\n\t}\n\twant := `github.RepositoryRelease{TagName:\"\", TargetCommitish:\"\", Name:\"\", Body:\"\", Draft:false, Prerelease:false, MakeLatest:\"\", DiscussionCategoryName:\"\", GenerateReleaseNotes:false, ID:0, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, PublishedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, URL:\"\", HTMLURL:\"\", AssetsURL:\"\", UploadURL:\"\", ZipballURL:\"\", TarballURL:\"\", Author:github.User{}, NodeID:\"\", Immutable:false}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"RepositoryRelease.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestSBOM_String(t *testing.T) {\n\tt.Parallel()\n\tv := SBOM{\n\t\tSBOM: &SBOMInfo{},\n\t}\n\twant := `github.SBOM{SBOM:github.SBOMInfo{}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"SBOM.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestSSHSigningKey_String(t *testing.T) {\n\tt.Parallel()\n\tv := SSHSigningKey{\n\t\tID:        Ptr(int64(0)),\n\t\tKey:       Ptr(\"\"),\n\t\tTitle:     Ptr(\"\"),\n\t\tCreatedAt: &Timestamp{},\n\t}\n\twant := `github.SSHSigningKey{ID:0, Key:\"\", Title:\"\", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"SSHSigningKey.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestSecretScanning_String(t *testing.T) {\n\tt.Parallel()\n\tv := SecretScanning{\n\t\tStatus: Ptr(\"\"),\n\t}\n\twant := `github.SecretScanning{Status:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"SecretScanning.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestSecretScanningPushProtection_String(t *testing.T) {\n\tt.Parallel()\n\tv := SecretScanningPushProtection{\n\t\tStatus: Ptr(\"\"),\n\t}\n\twant := `github.SecretScanningPushProtection{Status:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"SecretScanningPushProtection.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestSecurityAndAnalysis_String(t *testing.T) {\n\tt.Parallel()\n\tv := SecurityAndAnalysis{\n\t\tAdvancedSecurity:             &AdvancedSecurity{},\n\t\tSecretScanning:               &SecretScanning{},\n\t\tSecretScanningPushProtection: &SecretScanningPushProtection{},\n\t\tDependabotSecurityUpdates:    &DependabotSecurityUpdates{},\n\t\tSecretScanningValidityChecks: &SecretScanningValidityChecks{},\n\t}\n\twant := `github.SecurityAndAnalysis{AdvancedSecurity:github.AdvancedSecurity{}, SecretScanning:github.SecretScanning{}, SecretScanningPushProtection:github.SecretScanningPushProtection{}, DependabotSecurityUpdates:github.DependabotSecurityUpdates{}, SecretScanningValidityChecks:github.SecretScanningValidityChecks{}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"SecurityAndAnalysis.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestSelfHostRunnerPermissionsEnterprise_String(t *testing.T) {\n\tt.Parallel()\n\tv := SelfHostRunnerPermissionsEnterprise{\n\t\tDisableSelfHostedRunnersForAllOrgs: Ptr(false),\n\t}\n\twant := `github.SelfHostRunnerPermissionsEnterprise{DisableSelfHostedRunnersForAllOrgs:false}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"SelfHostRunnerPermissionsEnterprise.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestSelfHostedRunnersSettingsOrganization_String(t *testing.T) {\n\tt.Parallel()\n\tv := SelfHostedRunnersSettingsOrganization{\n\t\tEnabledRepositories:     Ptr(\"\"),\n\t\tSelectedRepositoriesURL: Ptr(\"\"),\n\t}\n\twant := `github.SelfHostedRunnersSettingsOrganization{EnabledRepositories:\"\", SelectedRepositoriesURL:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"SelfHostedRunnersSettingsOrganization.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestSourceImportAuthor_String(t *testing.T) {\n\tt.Parallel()\n\tv := SourceImportAuthor{\n\t\tID:         Ptr(int64(0)),\n\t\tRemoteID:   Ptr(\"\"),\n\t\tRemoteName: Ptr(\"\"),\n\t\tEmail:      Ptr(\"\"),\n\t\tName:       Ptr(\"\"),\n\t\tURL:        Ptr(\"\"),\n\t\tImportURL:  Ptr(\"\"),\n\t}\n\twant := `github.SourceImportAuthor{ID:0, RemoteID:\"\", RemoteName:\"\", Email:\"\", Name:\"\", URL:\"\", ImportURL:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"SourceImportAuthor.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestTeam_String(t *testing.T) {\n\tt.Parallel()\n\tv := Team{\n\t\tID:                  Ptr(int64(0)),\n\t\tNodeID:              Ptr(\"\"),\n\t\tName:                Ptr(\"\"),\n\t\tDescription:         Ptr(\"\"),\n\t\tURL:                 Ptr(\"\"),\n\t\tSlug:                Ptr(\"\"),\n\t\tPermission:          Ptr(\"\"),\n\t\tPrivacy:             Ptr(\"\"),\n\t\tNotificationSetting: Ptr(\"\"),\n\t\tMembersCount:        Ptr(0),\n\t\tReposCount:          Ptr(0),\n\t\tOrganization:        &Organization{},\n\t\tHTMLURL:             Ptr(\"\"),\n\t\tMembersURL:          Ptr(\"\"),\n\t\tRepositoriesURL:     Ptr(\"\"),\n\t\tParent:              &Team{},\n\t\tLDAPDN:              Ptr(\"\"),\n\t\tAssignment:          Ptr(\"\"),\n\t\tType:                Ptr(\"\"),\n\t}\n\twant := `github.Team{ID:0, NodeID:\"\", Name:\"\", Description:\"\", URL:\"\", Slug:\"\", Permission:\"\", Privacy:\"\", NotificationSetting:\"\", MembersCount:0, ReposCount:0, Organization:github.Organization{}, HTMLURL:\"\", MembersURL:\"\", RepositoriesURL:\"\", Parent:github.Team{}, LDAPDN:\"\", Assignment:\"\", Type:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"Team.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestTeamDiscussion_String(t *testing.T) {\n\tt.Parallel()\n\tv := TeamDiscussion{\n\t\tAuthor:        &User{},\n\t\tBody:          Ptr(\"\"),\n\t\tBodyHTML:      Ptr(\"\"),\n\t\tBodyVersion:   Ptr(\"\"),\n\t\tCommentsCount: Ptr(0),\n\t\tCommentsURL:   Ptr(\"\"),\n\t\tCreatedAt:     &Timestamp{},\n\t\tLastEditedAt:  &Timestamp{},\n\t\tHTMLURL:       Ptr(\"\"),\n\t\tNodeID:        Ptr(\"\"),\n\t\tNumber:        Ptr(0),\n\t\tPinned:        Ptr(false),\n\t\tPrivate:       Ptr(false),\n\t\tTeamURL:       Ptr(\"\"),\n\t\tTitle:         Ptr(\"\"),\n\t\tUpdatedAt:     &Timestamp{},\n\t\tURL:           Ptr(\"\"),\n\t\tReactions:     &Reactions{},\n\t}\n\twant := `github.TeamDiscussion{Author:github.User{}, Body:\"\", BodyHTML:\"\", BodyVersion:\"\", CommentsCount:0, CommentsURL:\"\", CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, LastEditedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, HTMLURL:\"\", NodeID:\"\", Number:0, Pinned:false, Private:false, TeamURL:\"\", Title:\"\", UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, URL:\"\", Reactions:github.Reactions{}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"TeamDiscussion.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestTeamLDAPMapping_String(t *testing.T) {\n\tt.Parallel()\n\tv := TeamLDAPMapping{\n\t\tID:              Ptr(int64(0)),\n\t\tLDAPDN:          Ptr(\"\"),\n\t\tURL:             Ptr(\"\"),\n\t\tName:            Ptr(\"\"),\n\t\tSlug:            Ptr(\"\"),\n\t\tDescription:     Ptr(\"\"),\n\t\tPrivacy:         Ptr(\"\"),\n\t\tPermission:      Ptr(\"\"),\n\t\tMembersURL:      Ptr(\"\"),\n\t\tRepositoriesURL: Ptr(\"\"),\n\t}\n\twant := `github.TeamLDAPMapping{ID:0, LDAPDN:\"\", URL:\"\", Name:\"\", Slug:\"\", Description:\"\", Privacy:\"\", Permission:\"\", MembersURL:\"\", RepositoriesURL:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"TeamLDAPMapping.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestTextMatch_String(t *testing.T) {\n\tt.Parallel()\n\tv := TextMatch{\n\t\tObjectURL:  Ptr(\"\"),\n\t\tObjectType: Ptr(\"\"),\n\t\tProperty:   Ptr(\"\"),\n\t\tFragment:   Ptr(\"\"),\n\t}\n\twant := `github.TextMatch{ObjectURL:\"\", ObjectType:\"\", Property:\"\", Fragment:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"TextMatch.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestTree_String(t *testing.T) {\n\tt.Parallel()\n\tv := Tree{\n\t\tSHA:       Ptr(\"\"),\n\t\tTruncated: Ptr(false),\n\t}\n\twant := `github.Tree{SHA:\"\", Truncated:false}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"Tree.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestTreeEntry_String(t *testing.T) {\n\tt.Parallel()\n\tv := TreeEntry{\n\t\tSHA:     Ptr(\"\"),\n\t\tPath:    Ptr(\"\"),\n\t\tMode:    Ptr(\"\"),\n\t\tType:    Ptr(\"\"),\n\t\tSize:    Ptr(0),\n\t\tContent: Ptr(\"\"),\n\t\tURL:     Ptr(\"\"),\n\t}\n\twant := `github.TreeEntry{SHA:\"\", Path:\"\", Mode:\"\", Type:\"\", Size:0, Content:\"\", URL:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"TreeEntry.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestUser_String(t *testing.T) {\n\tt.Parallel()\n\tv := User{\n\t\tLogin:                   Ptr(\"\"),\n\t\tID:                      Ptr(int64(0)),\n\t\tNodeID:                  Ptr(\"\"),\n\t\tAvatarURL:               Ptr(\"\"),\n\t\tHTMLURL:                 Ptr(\"\"),\n\t\tGravatarID:              Ptr(\"\"),\n\t\tName:                    Ptr(\"\"),\n\t\tCompany:                 Ptr(\"\"),\n\t\tBlog:                    Ptr(\"\"),\n\t\tLocation:                Ptr(\"\"),\n\t\tEmail:                   Ptr(\"\"),\n\t\tHireable:                Ptr(false),\n\t\tBio:                     Ptr(\"\"),\n\t\tTwitterUsername:         Ptr(\"\"),\n\t\tPublicRepos:             Ptr(0),\n\t\tPublicGists:             Ptr(0),\n\t\tFollowers:               Ptr(0),\n\t\tFollowing:               Ptr(0),\n\t\tCreatedAt:               &Timestamp{},\n\t\tUpdatedAt:               &Timestamp{},\n\t\tSuspendedAt:             &Timestamp{},\n\t\tType:                    Ptr(\"\"),\n\t\tSiteAdmin:               Ptr(false),\n\t\tTotalPrivateRepos:       Ptr(int64(0)),\n\t\tOwnedPrivateRepos:       Ptr(int64(0)),\n\t\tPrivateGists:            Ptr(0),\n\t\tDiskUsage:               Ptr(0),\n\t\tCollaborators:           Ptr(0),\n\t\tTwoFactorAuthentication: Ptr(false),\n\t\tPlan:                    &Plan{},\n\t\tLdapDn:                  Ptr(\"\"),\n\t\tURL:                     Ptr(\"\"),\n\t\tEventsURL:               Ptr(\"\"),\n\t\tFollowingURL:            Ptr(\"\"),\n\t\tFollowersURL:            Ptr(\"\"),\n\t\tGistsURL:                Ptr(\"\"),\n\t\tOrganizationsURL:        Ptr(\"\"),\n\t\tReceivedEventsURL:       Ptr(\"\"),\n\t\tReposURL:                Ptr(\"\"),\n\t\tStarredURL:              Ptr(\"\"),\n\t\tSubscriptionsURL:        Ptr(\"\"),\n\t\tPermissions:             &RepositoryPermissions{},\n\t\tRoleName:                Ptr(\"\"),\n\t\tAssignment:              Ptr(\"\"),\n\t}\n\twant := `github.User{Login:\"\", ID:0, NodeID:\"\", AvatarURL:\"\", HTMLURL:\"\", GravatarID:\"\", Name:\"\", Company:\"\", Blog:\"\", Location:\"\", Email:\"\", Hireable:false, Bio:\"\", TwitterUsername:\"\", PublicRepos:0, PublicGists:0, Followers:0, Following:0, CreatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, UpdatedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, SuspendedAt:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Type:\"\", SiteAdmin:false, TotalPrivateRepos:0, OwnedPrivateRepos:0, PrivateGists:0, DiskUsage:0, Collaborators:0, TwoFactorAuthentication:false, Plan:github.Plan{}, LdapDn:\"\", URL:\"\", EventsURL:\"\", FollowingURL:\"\", FollowersURL:\"\", GistsURL:\"\", OrganizationsURL:\"\", ReceivedEventsURL:\"\", ReposURL:\"\", StarredURL:\"\", SubscriptionsURL:\"\", Permissions:github.RepositoryPermissions{}, RoleName:\"\", Assignment:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"User.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestUserLDAPMapping_String(t *testing.T) {\n\tt.Parallel()\n\tv := UserLDAPMapping{\n\t\tID:                Ptr(int64(0)),\n\t\tLDAPDN:            Ptr(\"\"),\n\t\tLogin:             Ptr(\"\"),\n\t\tAvatarURL:         Ptr(\"\"),\n\t\tGravatarID:        Ptr(\"\"),\n\t\tType:              Ptr(\"\"),\n\t\tSiteAdmin:         Ptr(false),\n\t\tURL:               Ptr(\"\"),\n\t\tEventsURL:         Ptr(\"\"),\n\t\tFollowingURL:      Ptr(\"\"),\n\t\tFollowersURL:      Ptr(\"\"),\n\t\tGistsURL:          Ptr(\"\"),\n\t\tOrganizationsURL:  Ptr(\"\"),\n\t\tReceivedEventsURL: Ptr(\"\"),\n\t\tReposURL:          Ptr(\"\"),\n\t\tStarredURL:        Ptr(\"\"),\n\t\tSubscriptionsURL:  Ptr(\"\"),\n\t}\n\twant := `github.UserLDAPMapping{ID:0, LDAPDN:\"\", Login:\"\", AvatarURL:\"\", GravatarID:\"\", Type:\"\", SiteAdmin:false, URL:\"\", EventsURL:\"\", FollowingURL:\"\", FollowersURL:\"\", GistsURL:\"\", OrganizationsURL:\"\", ReceivedEventsURL:\"\", ReposURL:\"\", StarredURL:\"\", SubscriptionsURL:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"UserLDAPMapping.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestUserMigration_String(t *testing.T) {\n\tt.Parallel()\n\tv := UserMigration{\n\t\tID:                 Ptr(int64(0)),\n\t\tGUID:               Ptr(\"\"),\n\t\tState:              Ptr(\"\"),\n\t\tLockRepositories:   Ptr(false),\n\t\tExcludeAttachments: Ptr(false),\n\t\tURL:                Ptr(\"\"),\n\t\tCreatedAt:          Ptr(\"\"),\n\t\tUpdatedAt:          Ptr(\"\"),\n\t}\n\twant := `github.UserMigration{ID:0, GUID:\"\", State:\"\", LockRepositories:false, ExcludeAttachments:false, URL:\"\", CreatedAt:\"\", UpdatedAt:\"\"}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"UserMigration.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestUserStats_String(t *testing.T) {\n\tt.Parallel()\n\tv := UserStats{\n\t\tTotalUsers:     Ptr(0),\n\t\tAdminUsers:     Ptr(0),\n\t\tSuspendedUsers: Ptr(0),\n\t}\n\twant := `github.UserStats{TotalUsers:0, AdminUsers:0, SuspendedUsers:0}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"UserStats.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestWeeklyCommitActivity_String(t *testing.T) {\n\tt.Parallel()\n\tv := WeeklyCommitActivity{\n\t\tDays:  []int{0},\n\t\tTotal: Ptr(0),\n\t\tWeek:  &Timestamp{},\n\t}\n\twant := `github.WeeklyCommitActivity{Days:[0], Total:0, Week:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"WeeklyCommitActivity.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestWeeklyStats_String(t *testing.T) {\n\tt.Parallel()\n\tv := WeeklyStats{\n\t\tWeek:      &Timestamp{},\n\t\tAdditions: Ptr(0),\n\t\tDeletions: Ptr(0),\n\t\tCommits:   Ptr(0),\n\t}\n\twant := `github.WeeklyStats{Week:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Additions:0, Deletions:0, Commits:0}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"WeeklyStats.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestWorkflowsPermissions_String(t *testing.T) {\n\tt.Parallel()\n\tv := WorkflowsPermissions{\n\t\tRunWorkflowsFromForkPullRequests:  Ptr(false),\n\t\tSendWriteTokensToWorkflows:        Ptr(false),\n\t\tSendSecretsAndVariables:           Ptr(false),\n\t\tRequireApprovalForForkPRWorkflows: Ptr(false),\n\t}\n\twant := `github.WorkflowsPermissions{RunWorkflowsFromForkPullRequests:false, SendWriteTokensToWorkflows:false, SendSecretsAndVariables:false, RequireApprovalForForkPRWorkflows:false}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"WorkflowsPermissions.String = %v, want %v\", got, want)\n\t}\n}\n"
  },
  {
    "path": "github/github.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n//go:generate go run gen-accessors.go\n//go:generate go run gen-iterators.go\n//go:generate go run gen-stringify-test.go\n//go:generate sh ../script/metadata.sh update-go\n\npackage github\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"regexp\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/google/go-querystring/query\"\n)\n\nconst (\n\tVersion = \"v84.0.0\"\n\n\tHeaderRateLimit     = \"X-Ratelimit-Limit\"\n\tHeaderRateRemaining = \"X-Ratelimit-Remaining\"\n\tHeaderRateReset     = \"X-Ratelimit-Reset\"\n\tHeaderRateResource  = \"X-Ratelimit-Resource\"\n\tHeaderRateUsed      = \"X-Ratelimit-Used\"\n\tHeaderRequestID     = \"X-Github-Request-Id\"\n\n\tdefaultAPIVersion = \"2022-11-28\"\n\tdefaultBaseURL    = \"https://api.github.com/\"\n\tdefaultUserAgent  = \"go-github\" + \"/\" + Version\n\tuploadBaseURL     = \"https://uploads.github.com/\"\n\n\theaderAPIVersion = \"X-Github-Api-Version\"\n\theaderOTP        = \"X-Github-Otp\"\n\theaderRetryAfter = \"Retry-After\"\n\n\theaderTokenExpiration = \"Github-Authentication-Token-Expiration\"\n\n\tmediaTypeV3                = \"application/vnd.github.v3+json\"\n\tdefaultMediaType           = \"application/octet-stream\"\n\tmediaTypeV3SHA             = \"application/vnd.github.v3.sha\"\n\tmediaTypeV3Diff            = \"application/vnd.github.v3.diff\"\n\tmediaTypeV3Patch           = \"application/vnd.github.v3.patch\"\n\tmediaTypeOrgPermissionRepo = \"application/vnd.github.v3.repository+json\"\n\tmediaTypeIssueImportAPI    = \"application/vnd.github.golden-comet-preview+json\"\n\tmediaTypeStarring          = \"application/vnd.github.star+json\"\n\tmediaTypeSCIM              = \"application/scim+json\"\n\n\t// Media Type values to access preview APIs.\n\t// These media types will be added to the API request as headers\n\t// and used to enable particular features on GitHub API that are still in preview.\n\t// After some time, specific media types will be promoted (to a \"stable\" state).\n\t// From then on, the preview headers are not required anymore to activate the additional\n\t// feature on GitHub.com's API. However, this API header might still be needed for users\n\t// to run a GitHub Enterprise Server on-premise.\n\t// It's not uncommon for GitHub Enterprise Server customers to run older versions which\n\t// would probably rely on the preview headers for some time.\n\t// While the header promotion is going out for GitHub.com, it may be some time before it\n\t// even arrives in GitHub Enterprise Server.\n\t// We keep those preview headers around to avoid breaking older GitHub Enterprise Server\n\t// versions. Additionally, non-functional (preview) headers don't create any side effects\n\t// on GitHub Cloud version.\n\t//\n\t// See https://github.com/google/go-github/pull/2125 and https://github.com/google/go-github/pull/2188 for full context.\n\n\t// https://help.github.com/enterprise/2.4/admin/guides/migrations/exporting-the-github-com-organization-s-repositories/\n\tmediaTypeMigrationsPreview = \"application/vnd.github.wyandotte-preview+json\"\n\n\t// https://developer.github.com/changes/2016-04-06-deployment-and-deployment-status-enhancements/\n\tmediaTypeDeploymentStatusPreview = \"application/vnd.github.ant-man-preview+json\"\n\n\t// https://developer.github.com/changes/2018-10-16-deployments-environments-states-and-auto-inactive-updates/\n\tmediaTypeExpandDeploymentStatusPreview = \"application/vnd.github.flash-preview+json\"\n\n\t// https://developer.github.com/changes/2016-05-12-reactions-api-preview/\n\tmediaTypeReactionsPreview = \"application/vnd.github.squirrel-girl-preview\"\n\n\t// https://developer.github.com/changes/2016-05-23-timeline-preview-api/\n\tmediaTypeTimelinePreview = \"application/vnd.github.mockingbird-preview+json\"\n\n\t// https://developer.github.com/changes/2016-09-14-projects-api/\n\tmediaTypeProjectsPreview = \"application/vnd.github.inertia-preview+json\"\n\n\t// https://developer.github.com/changes/2017-01-05-commit-search-api/\n\tmediaTypeCommitSearchPreview = \"application/vnd.github.cloak-preview+json\"\n\n\t// https://developer.github.com/changes/2017-02-28-user-blocking-apis-and-webhook/\n\tmediaTypeBlockUsersPreview = \"application/vnd.github.giant-sentry-fist-preview+json\"\n\n\t// https://developer.github.com/changes/2017-05-23-coc-api/\n\tmediaTypeCodesOfConductPreview = \"application/vnd.github.scarlet-witch-preview+json\"\n\n\t// https://developer.github.com/changes/2017-07-17-update-topics-on-repositories/\n\tmediaTypeTopicsPreview = \"application/vnd.github.mercy-preview+json\"\n\n\t// https://developer.github.com/changes/2018-03-16-protected-branches-required-approving-reviews/\n\tmediaTypeRequiredApprovingReviewsPreview = \"application/vnd.github.luke-cage-preview+json\"\n\n\t// https://developer.github.com/changes/2018-05-07-new-checks-api-public-beta/\n\tmediaTypeCheckRunsPreview = \"application/vnd.github.antiope-preview+json\"\n\n\t// https://developer.github.com/enterprise/2.13/v3/repos/pre_receive_hooks/\n\tmediaTypePreReceiveHooksPreview = \"application/vnd.github.eye-scream-preview\"\n\n\t// https://developer.github.com/changes/2018-02-22-protected-branches-required-signatures/\n\tmediaTypeSignaturePreview = \"application/vnd.github.zzzax-preview+json\"\n\n\t// https://developer.github.com/changes/2018-09-05-project-card-events/\n\tmediaTypeProjectCardDetailsPreview = \"application/vnd.github.starfox-preview+json\"\n\n\t// https://developer.github.com/changes/2018-12-18-interactions-preview/\n\tmediaTypeInteractionRestrictionsPreview = \"application/vnd.github.sombra-preview+json\"\n\n\t// https://developer.github.com/changes/2019-03-14-enabling-disabling-pages/\n\tmediaTypeEnablePagesAPIPreview = \"application/vnd.github.switcheroo-preview+json\"\n\n\t// https://developer.github.com/changes/2019-04-24-vulnerability-alerts/\n\tmediaTypeRequiredVulnerabilityAlertsPreview = \"application/vnd.github.dorian-preview+json\"\n\n\t// https://developer.github.com/changes/2019-05-29-update-branch-api/\n\tmediaTypeUpdatePullRequestBranchPreview = \"application/vnd.github.lydian-preview+json\"\n\n\t// https://developer.github.com/changes/2019-04-11-pulls-branches-for-commit/\n\tmediaTypeListPullsOrBranchesForCommitPreview = \"application/vnd.github.groot-preview+json\"\n\n\t// https://docs.github.com/rest/previews/#repository-creation-permissions\n\tmediaTypeMemberAllowedRepoCreationTypePreview = \"application/vnd.github.surtur-preview+json\"\n\n\t// https://docs.github.com/rest/previews/#create-and-use-repository-templates\n\tmediaTypeRepositoryTemplatePreview = \"application/vnd.github.baptiste-preview+json\"\n\n\t// https://developer.github.com/changes/2019-10-03-multi-line-comments/\n\tmediaTypeMultiLineCommentsPreview = \"application/vnd.github.comfort-fade-preview+json\"\n\n\t// https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api/\n\tmediaTypeOAuthAppPreview = \"application/vnd.github.doctor-strange-preview+json\"\n\n\t// https://developer.github.com/changes/2019-12-03-internal-visibility-changes/\n\tmediaTypeRepositoryVisibilityPreview = \"application/vnd.github.nebula-preview+json\"\n\n\t// https://developer.github.com/changes/2018-12-10-content-attachments-api/\n\tmediaTypeContentAttachmentsPreview = \"application/vnd.github.corsair-preview+json\"\n)\n\nvar errNonNilContext = errors.New(\"context must be non-nil\")\n\n// A Client manages communication with the GitHub API.\ntype Client struct {\n\tclientMu              sync.Mutex   // clientMu protects the client during calls that modify the CheckRedirect func.\n\tclient                *http.Client // HTTP client used to communicate with the API.\n\tclientIgnoreRedirects *http.Client // HTTP client used to communicate with the API on endpoints where we don't want to follow redirects.\n\n\t// Base URL for API requests. Defaults to the public GitHub API, but can be\n\t// set to a domain endpoint to use with GitHub Enterprise. BaseURL should\n\t// always be specified with a trailing slash.\n\tBaseURL *url.URL\n\n\t// Base URL for uploading files.\n\tUploadURL *url.URL\n\n\t// User agent used when communicating with the GitHub API.\n\tUserAgent string\n\n\t// DisableRateLimitCheck stops the client checking for rate limits or tracking\n\t// them. This is different to setting BypassRateLimitCheck in the context,\n\t// as that still tracks the rate limits.\n\tDisableRateLimitCheck bool\n\n\trateMu                  sync.Mutex\n\trateLimits              [Categories]Rate // Rate limits for the client as determined by the most recent API calls.\n\tsecondaryRateLimitReset time.Time        // Secondary rate limit reset for the client as determined by the most recent API calls.\n\n\t// If specified, Client will block requests for at most this duration in case of reaching a secondary\n\t// rate limit\n\tMaxSecondaryRateLimitRetryAfterDuration time.Duration\n\n\t// Whether to respect rate limit headers on endpoints that return 302 redirections to artifacts\n\tRateLimitRedirectionalEndpoints bool\n\n\tcommon service // Reuse a single struct instead of allocating one for each service on the heap.\n\n\t// Services used for talking to different parts of the GitHub API.\n\tActions            *ActionsService\n\tActivity           *ActivityService\n\tAdmin              *AdminService\n\tApps               *AppsService\n\tAuthorizations     *AuthorizationsService\n\tBilling            *BillingService\n\tChecks             *ChecksService\n\tClassroom          *ClassroomService\n\tCodeScanning       *CodeScanningService\n\tCodesOfConduct     *CodesOfConductService\n\tCodespaces         *CodespacesService\n\tCopilot            *CopilotService\n\tCredentials        *CredentialsService\n\tDependabot         *DependabotService\n\tDependencyGraph    *DependencyGraphService\n\tEmojis             *EmojisService\n\tEnterprise         *EnterpriseService\n\tGists              *GistsService\n\tGit                *GitService\n\tGitignores         *GitignoresService\n\tInteractions       *InteractionsService\n\tIssueImport        *IssueImportService\n\tIssues             *IssuesService\n\tLicenses           *LicensesService\n\tMarkdown           *MarkdownService\n\tMarketplace        *MarketplaceService\n\tMeta               *MetaService\n\tMigrations         *MigrationService\n\tOrganizations      *OrganizationsService\n\tPrivateRegistries  *PrivateRegistriesService\n\tProjects           *ProjectsService\n\tPullRequests       *PullRequestsService\n\tRateLimit          *RateLimitService\n\tReactions          *ReactionsService\n\tRepositories       *RepositoriesService\n\tSCIM               *SCIMService\n\tSearch             *SearchService\n\tSecretScanning     *SecretScanningService\n\tSecurityAdvisories *SecurityAdvisoriesService\n\tSubIssue           *SubIssueService\n\tTeams              *TeamsService\n\tUsers              *UsersService\n}\n\ntype service struct {\n\tclient *Client\n}\n\n// Client returns the http.Client used by this GitHub client.\n// This should only be used for requests to the GitHub API because\n// request headers will contain an authorization token.\nfunc (c *Client) Client() *http.Client {\n\tc.clientMu.Lock()\n\tdefer c.clientMu.Unlock()\n\tclientCopy := *c.client\n\treturn &clientCopy\n}\n\n// ListOptions specifies the optional parameters to various List methods that\n// support offset pagination.\ntype ListOptions struct {\n\t// For paginated result sets, page of results to retrieve.\n\tPage int `url:\"page,omitempty\"`\n\n\t// For paginated result sets, the number of results to include per page.\n\tPerPage int `url:\"per_page,omitempty\"`\n}\n\n// ListCursorOptions specifies the optional parameters to various List methods that\n// support cursor pagination.\ntype ListCursorOptions struct {\n\t// For paginated result sets, page of results to retrieve.\n\tPage string `url:\"page,omitempty\"`\n\n\t// For paginated result sets, the number of results to include per page.\n\tPerPage int `url:\"per_page,omitempty\"`\n\n\t// For paginated result sets, the number of results per page (max 100), starting from the first matching result.\n\t// This parameter must not be used in combination with last.\n\tFirst int `url:\"first,omitempty\"`\n\n\t// For paginated result sets, the number of results per page (max 100), starting from the last matching result.\n\t// This parameter must not be used in combination with first.\n\tLast int `url:\"last,omitempty\"`\n\n\t// A cursor, as given in the Link header. If specified, the query only searches for events after this cursor.\n\tAfter string `url:\"after,omitempty\"`\n\n\t// A cursor, as given in the Link header. If specified, the query only searches for events before this cursor.\n\tBefore string `url:\"before,omitempty\"`\n\n\t// A cursor, as given in the Link header. If specified, the query continues the search using this cursor.\n\tCursor string `url:\"cursor,omitempty\"`\n}\n\n// UploadOptions specifies the parameters to methods that support uploads.\ntype UploadOptions struct {\n\tName      string `url:\"name,omitempty\"`\n\tLabel     string `url:\"label,omitempty\"`\n\tMediaType string `url:\"-\"`\n}\n\n// RawType represents type of raw format of a request instead of JSON.\ntype RawType uint8\n\nconst (\n\t// Diff format.\n\tDiff RawType = 1 + iota\n\t// Patch format.\n\tPatch\n)\n\n// RawOptions specifies parameters when user wants to get raw format of\n// a response instead of JSON.\ntype RawOptions struct {\n\tType RawType\n}\n\ntype structPtr[T any] interface{ *T }\n\n// addOptions adds the parameters in opts as URL query parameters to s. opts\n// must be a struct whose fields may contain \"url\" tags.\nfunc addOptions[P structPtr[T], T any](s string, opts P) (string, error) {\n\tif opts == nil {\n\t\treturn s, nil\n\t}\n\n\tu, err := url.Parse(s)\n\tif err != nil {\n\t\treturn s, err\n\t}\n\n\tqs, err := query.Values(opts)\n\tif err != nil {\n\t\treturn s, err\n\t}\n\n\tu.RawQuery = qs.Encode()\n\treturn u.String(), nil\n}\n\n// NewClient returns a new GitHub API client. If a nil httpClient is\n// provided, a new http.Client will be used. To use API methods which require\n// authentication, either use Client.WithAuthToken or provide NewClient with\n// an http.Client that will perform the authentication for you (such as that\n// provided by the golang.org/x/oauth2 library).\n//\n// Note: When using a nil httpClient, the default client has no timeout set.\n// This may not be suitable for production environments. It is recommended to\n// provide a custom http.Client with an appropriate timeout.\nfunc NewClient(httpClient *http.Client) *Client {\n\tif httpClient == nil {\n\t\thttpClient = &http.Client{}\n\t}\n\thttpClient2 := *httpClient\n\tc := &Client{client: &httpClient2}\n\tc.initialize()\n\treturn c\n}\n\n// WithAuthToken returns a copy of the client configured to use the provided token for the Authorization header.\nfunc (c *Client) WithAuthToken(token string) *Client {\n\tc2 := c.copy()\n\tdefer c2.initialize()\n\ttransport := c2.client.Transport\n\tif transport == nil {\n\t\ttransport = http.DefaultTransport\n\t}\n\tc2.client.Transport = roundTripperFunc(\n\t\tfunc(req *http.Request) (*http.Response, error) {\n\t\t\treq = req.Clone(req.Context())\n\t\t\tif token != \"\" {\n\t\t\t\treq.Header.Set(\"Authorization\", fmt.Sprintf(\"Bearer %v\", token))\n\t\t\t}\n\t\t\treturn transport.RoundTrip(req)\n\t\t},\n\t)\n\treturn c2\n}\n\n// WithEnterpriseURLs returns a copy of the client configured to use the provided base and\n// upload URLs. If the base URL does not have the suffix \"/api/v3/\", it will be added\n// automatically. If the upload URL does not have the suffix \"/api/uploads\", it will be\n// added automatically.\n//\n// Note that WithEnterpriseURLs is a convenience helper only;\n// its behavior is equivalent to setting the BaseURL and UploadURL fields.\n//\n// Another important thing is that by default, the GitHub Enterprise URL format\n// should be http(s)://[hostname]/api/v3/ or you will always receive the 406 status code.\n// The upload URL format should be http(s)://[hostname]/api/uploads/.\nfunc (c *Client) WithEnterpriseURLs(baseURL, uploadURL string) (*Client, error) {\n\tc2 := c.copy()\n\tdefer c2.initialize()\n\tvar err error\n\tc2.BaseURL, err = url.Parse(baseURL)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif !strings.HasSuffix(c2.BaseURL.Path, \"/\") {\n\t\tc2.BaseURL.Path += \"/\"\n\t}\n\tif !strings.HasSuffix(c2.BaseURL.Path, \"/api/v3/\") &&\n\t\t!strings.HasPrefix(c2.BaseURL.Host, \"api.\") &&\n\t\t!strings.Contains(c2.BaseURL.Host, \".api.\") {\n\t\tc2.BaseURL.Path += \"api/v3/\"\n\t}\n\n\tc2.UploadURL, err = url.Parse(uploadURL)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif !strings.HasSuffix(c2.UploadURL.Path, \"/\") {\n\t\tc2.UploadURL.Path += \"/\"\n\t}\n\tif !strings.HasSuffix(c2.UploadURL.Path, \"/api/uploads/\") &&\n\t\t!strings.HasPrefix(c2.UploadURL.Host, \"api.\") &&\n\t\t!strings.Contains(c2.UploadURL.Host, \".api.\") &&\n\t\t!strings.HasPrefix(c2.UploadURL.Host, \"uploads.\") {\n\t\tc2.UploadURL.Path += \"api/uploads/\"\n\t}\n\treturn c2, nil\n}\n\n// initialize sets default values and initializes services.\nfunc (c *Client) initialize() {\n\tif c.client == nil {\n\t\tc.client = &http.Client{}\n\t}\n\t// Copy the main http client into the IgnoreRedirects one, overriding the `CheckRedirect` func\n\tc.clientIgnoreRedirects = &http.Client{}\n\tc.clientIgnoreRedirects.Transport = c.client.Transport\n\tc.clientIgnoreRedirects.Timeout = c.client.Timeout\n\tc.clientIgnoreRedirects.Jar = c.client.Jar\n\tc.clientIgnoreRedirects.CheckRedirect = func(*http.Request, []*http.Request) error {\n\t\treturn http.ErrUseLastResponse\n\t}\n\tif c.BaseURL == nil {\n\t\tc.BaseURL, _ = url.Parse(defaultBaseURL)\n\t}\n\tif c.UploadURL == nil {\n\t\tc.UploadURL, _ = url.Parse(uploadBaseURL)\n\t}\n\tif c.UserAgent == \"\" {\n\t\tc.UserAgent = defaultUserAgent\n\t}\n\tc.common.client = c\n\tc.Actions = (*ActionsService)(&c.common)\n\tc.Activity = (*ActivityService)(&c.common)\n\tc.Admin = (*AdminService)(&c.common)\n\tc.Apps = (*AppsService)(&c.common)\n\tc.Authorizations = (*AuthorizationsService)(&c.common)\n\tc.Billing = (*BillingService)(&c.common)\n\tc.Checks = (*ChecksService)(&c.common)\n\tc.Classroom = (*ClassroomService)(&c.common)\n\tc.CodeScanning = (*CodeScanningService)(&c.common)\n\tc.Codespaces = (*CodespacesService)(&c.common)\n\tc.CodesOfConduct = (*CodesOfConductService)(&c.common)\n\tc.Copilot = (*CopilotService)(&c.common)\n\tc.Credentials = (*CredentialsService)(&c.common)\n\tc.Dependabot = (*DependabotService)(&c.common)\n\tc.DependencyGraph = (*DependencyGraphService)(&c.common)\n\tc.Emojis = (*EmojisService)(&c.common)\n\tc.Enterprise = (*EnterpriseService)(&c.common)\n\tc.Gists = (*GistsService)(&c.common)\n\tc.Git = (*GitService)(&c.common)\n\tc.Gitignores = (*GitignoresService)(&c.common)\n\tc.Interactions = (*InteractionsService)(&c.common)\n\tc.IssueImport = (*IssueImportService)(&c.common)\n\tc.Issues = (*IssuesService)(&c.common)\n\tc.Licenses = (*LicensesService)(&c.common)\n\tc.Markdown = (*MarkdownService)(&c.common)\n\tc.Marketplace = &MarketplaceService{client: c}\n\tc.Meta = (*MetaService)(&c.common)\n\tc.Migrations = (*MigrationService)(&c.common)\n\tc.Organizations = (*OrganizationsService)(&c.common)\n\tc.PrivateRegistries = (*PrivateRegistriesService)(&c.common)\n\tc.Projects = (*ProjectsService)(&c.common)\n\tc.PullRequests = (*PullRequestsService)(&c.common)\n\tc.RateLimit = (*RateLimitService)(&c.common)\n\tc.Reactions = (*ReactionsService)(&c.common)\n\tc.Repositories = (*RepositoriesService)(&c.common)\n\tc.SCIM = (*SCIMService)(&c.common)\n\tc.Search = (*SearchService)(&c.common)\n\tc.SecretScanning = (*SecretScanningService)(&c.common)\n\tc.SecurityAdvisories = (*SecurityAdvisoriesService)(&c.common)\n\tc.SubIssue = (*SubIssueService)(&c.common)\n\tc.Teams = (*TeamsService)(&c.common)\n\tc.Users = (*UsersService)(&c.common)\n}\n\n// copy returns a copy of the current client. It must be initialized before use.\nfunc (c *Client) copy() *Client {\n\tc.clientMu.Lock()\n\t// can't use *c here because that would copy mutexes by value.\n\tclone := Client{\n\t\tclient:                          &http.Client{},\n\t\tUserAgent:                       c.UserAgent,\n\t\tBaseURL:                         c.BaseURL,\n\t\tUploadURL:                       c.UploadURL,\n\t\tRateLimitRedirectionalEndpoints: c.RateLimitRedirectionalEndpoints,\n\t\tsecondaryRateLimitReset:         c.secondaryRateLimitReset,\n\t}\n\tc.clientMu.Unlock()\n\tif c.client != nil {\n\t\tclone.client.Transport = c.client.Transport\n\t\tclone.client.CheckRedirect = c.client.CheckRedirect\n\t\tclone.client.Jar = c.client.Jar\n\t\tclone.client.Timeout = c.client.Timeout\n\t}\n\tc.rateMu.Lock()\n\tcopy(clone.rateLimits[:], c.rateLimits[:])\n\tc.rateMu.Unlock()\n\treturn &clone\n}\n\n// NewClientWithEnvProxy enhances NewClient with the HttpProxy env.\nfunc NewClientWithEnvProxy() *Client {\n\treturn NewClient(&http.Client{Transport: &http.Transport{Proxy: http.ProxyFromEnvironment}})\n}\n\n// NewTokenClient returns a new GitHub API client authenticated with the provided token.\n//\n// Deprecated: Use NewClient(nil).WithAuthToken(token) instead.\nfunc NewTokenClient(_ context.Context, token string) *Client {\n\t// This always returns a nil error.\n\treturn NewClient(nil).WithAuthToken(token)\n}\n\n// NewEnterpriseClient returns a new GitHub API client with provided\n// base URL and upload URL (often is your GitHub Enterprise hostname).\n//\n// Deprecated: Use NewClient(httpClient).WithEnterpriseURLs(baseURL, uploadURL) instead.\nfunc NewEnterpriseClient(baseURL, uploadURL string, httpClient *http.Client) (*Client, error) {\n\treturn NewClient(httpClient).WithEnterpriseURLs(baseURL, uploadURL)\n}\n\n// RequestOption represents an option that can modify an http.Request.\ntype RequestOption func(req *http.Request)\n\n// WithVersion overrides the GitHub v3 API version for this individual request.\n// For more information, see:\n// https://github.blog/2022-11-28-to-infinity-and-beyond-enabling-the-future-of-githubs-rest-api-with-api-versioning/\nfunc WithVersion(version string) RequestOption {\n\treturn func(req *http.Request) {\n\t\treq.Header.Set(headerAPIVersion, version)\n\t}\n}\n\n// NewRequest creates an API request. A relative URL can be provided in urlStr,\n// in which case it is resolved relative to the BaseURL of the Client.\n// Relative URLs should always be specified without a preceding slash. If\n// specified, the value pointed to by body is JSON encoded and included as the\n// request body.\nfunc (c *Client) NewRequest(method, urlStr string, body any, opts ...RequestOption) (*http.Request, error) {\n\tif !strings.HasSuffix(c.BaseURL.Path, \"/\") {\n\t\treturn nil, fmt.Errorf(\"baseURL must have a trailing slash, but %q does not\", c.BaseURL)\n\t}\n\n\tu, err := c.BaseURL.Parse(urlStr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar buf io.ReadWriter\n\tif body != nil {\n\t\tbuf = &bytes.Buffer{}\n\t\tenc := json.NewEncoder(buf)\n\t\tenc.SetEscapeHTML(false)\n\t\terr := enc.Encode(body)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treq, err := http.NewRequest(method, u.String(), buf)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif body != nil {\n\t\treq.Header.Set(\"Content-Type\", \"application/json\")\n\t}\n\treq.Header.Set(\"Accept\", mediaTypeV3)\n\tif c.UserAgent != \"\" {\n\t\treq.Header.Set(\"User-Agent\", c.UserAgent)\n\t}\n\treq.Header.Set(headerAPIVersion, defaultAPIVersion)\n\n\tfor _, opt := range opts {\n\t\topt(req)\n\t}\n\n\treturn req, nil\n}\n\n// NewFormRequest creates an API request. A relative URL can be provided in urlStr,\n// in which case it is resolved relative to the BaseURL of the Client.\n// Relative URLs should always be specified without a preceding slash.\n// Body is sent with Content-Type: application/x-www-form-urlencoded.\nfunc (c *Client) NewFormRequest(urlStr string, body io.Reader, opts ...RequestOption) (*http.Request, error) {\n\tif !strings.HasSuffix(c.BaseURL.Path, \"/\") {\n\t\treturn nil, fmt.Errorf(\"baseURL must have a trailing slash, but %q does not\", c.BaseURL)\n\t}\n\n\tu, err := c.BaseURL.Parse(urlStr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq, err := http.NewRequest(\"POST\", u.String(), body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.Header.Set(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\treq.Header.Set(\"Accept\", mediaTypeV3)\n\tif c.UserAgent != \"\" {\n\t\treq.Header.Set(\"User-Agent\", c.UserAgent)\n\t}\n\treq.Header.Set(headerAPIVersion, defaultAPIVersion)\n\n\tfor _, opt := range opts {\n\t\topt(req)\n\t}\n\n\treturn req, nil\n}\n\n// NewUploadRequest creates an upload request. A relative URL can be provided in\n// urlStr, in which case it is resolved relative to the UploadURL of the Client.\n// Relative URLs should always be specified without a preceding slash.\nfunc (c *Client) NewUploadRequest(urlStr string, reader io.Reader, size int64, mediaType string, opts ...RequestOption) (*http.Request, error) {\n\tif !strings.HasSuffix(c.UploadURL.Path, \"/\") {\n\t\treturn nil, fmt.Errorf(\"uploadURL must have a trailing slash, but %q does not\", c.UploadURL)\n\t}\n\tu, err := c.UploadURL.Parse(urlStr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\trequestBody := reader\n\tif reader != nil {\n\t\t// Wrap the provided reader so transport code does not observe concrete body types\n\t\t// (for example *os.File) and switch to platform-specific sendfile fast paths.\n\t\t//\n\t\t// Why this exists:\n\t\t// race-enabled test runs on Windows have surfaced data races in the sendfile path\n\t\t// while request read/write loops run concurrently. Hiding concrete type information\n\t\t// keeps uploads on the generic io.Reader copy path, which is race-stable and preserves\n\t\t// request semantics (same bytes, same headers, same content length).\n\t\trequestBody = uploadRequestBodyReader{Reader: reader}\n\t}\n\n\treq, err := http.NewRequest(\"POST\", u.String(), requestBody)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.ContentLength = size\n\n\tif mediaType == \"\" {\n\t\tmediaType = defaultMediaType\n\t}\n\treq.Header.Set(\"Content-Type\", mediaType)\n\treq.Header.Set(\"Accept\", mediaTypeV3)\n\treq.Header.Set(\"User-Agent\", c.UserAgent)\n\treq.Header.Set(headerAPIVersion, defaultAPIVersion)\n\n\tfor _, opt := range opts {\n\t\topt(req)\n\t}\n\n\treturn req, nil\n}\n\n// uploadRequestBodyReader intentionally wraps an io.Reader to hide concrete reader types.\n// See NewUploadRequest for why this prevents race-prone transport optimizations.\ntype uploadRequestBodyReader struct {\n\tio.Reader\n}\n\n// Response is a GitHub API response. This wraps the standard http.Response\n// returned from GitHub and provides convenient access to things like\n// pagination links.\ntype Response struct {\n\t*http.Response\n\n\t// These fields provide the page values for paginating through a set of\n\t// results. Any or all of these may be set to the zero value for\n\t// responses that are not part of a paginated set, or for which there\n\t// are no additional pages.\n\t//\n\t// These fields support what is called \"offset pagination\" and should\n\t// be used with the ListOptions struct.\n\tNextPage  int\n\tPrevPage  int\n\tFirstPage int\n\tLastPage  int\n\n\t// Additionally, some APIs support \"cursor pagination\" instead of offset.\n\t// This means that a token points directly to the next record which\n\t// can lead to O(1) performance compared to O(n) performance provided\n\t// by offset pagination.\n\t//\n\t// For APIs that support cursor pagination (such as\n\t// TeamsService.ListIDPGroupsInOrganization), the following field\n\t// will be populated to point to the next page.\n\t//\n\t// To use this token, set ListCursorOptions.Page to this value before\n\t// calling the endpoint again.\n\tNextPageToken string\n\n\t// For APIs that support cursor pagination, such as RepositoriesService.ListHookDeliveries,\n\t// the following field will be populated to point to the next page.\n\t// Set ListCursorOptions.Cursor to this value when calling the endpoint again.\n\tCursor string\n\n\t// For APIs that support before/after pagination, such as OrganizationsService.AuditLog.\n\tBefore string\n\tAfter  string\n\n\t// Explicitly specify the Rate type so Rate's String() receiver doesn't\n\t// propagate to Response.\n\tRate Rate\n\n\t// token's expiration date. Timestamp is 0001-01-01 when token doesn't expire.\n\t// So it is valid for TokenExpiration.Equal(Timestamp{}) or TokenExpiration.Time.After(time.Now())\n\tTokenExpiration Timestamp\n}\n\n// newResponse creates a new Response for the provided http.Response.\n// r must not be nil.\nfunc newResponse(r *http.Response) *Response {\n\tresponse := &Response{Response: r}\n\tresponse.populatePageValues()\n\tresponse.Rate = parseRate(r)\n\tresponse.TokenExpiration = parseTokenExpiration(r)\n\treturn response\n}\n\n// populatePageValues parses the HTTP Link response headers and populates the\n// various pagination link values in the Response.\nfunc (r *Response) populatePageValues() {\n\tif links, ok := r.Response.Header[\"Link\"]; ok && len(links) > 0 {\n\t\tfor link := range strings.SplitSeq(links[0], \",\") {\n\t\t\tsegments := strings.Split(strings.TrimSpace(link), \";\")\n\n\t\t\t// link must at least have href and rel\n\t\t\tif len(segments) < 2 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// ensure href is properly formatted\n\t\t\tif !strings.HasPrefix(segments[0], \"<\") || !strings.HasSuffix(segments[0], \">\") {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// try to pull out page parameter\n\t\t\turl, err := url.Parse(segments[0][1 : len(segments[0])-1])\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tq := url.Query()\n\n\t\t\tif cursor := q.Get(\"cursor\"); cursor != \"\" {\n\t\t\t\tfor _, segment := range segments[1:] {\n\t\t\t\t\tif strings.TrimSpace(segment) == `rel=\"next\"` {\n\t\t\t\t\t\tr.Cursor = cursor\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tpage := q.Get(\"page\")\n\t\t\tsince := q.Get(\"since\")\n\t\t\tbefore := q.Get(\"before\")\n\t\t\tafter := q.Get(\"after\")\n\n\t\t\tif page == \"\" && before == \"\" && after == \"\" && since == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif since != \"\" && page == \"\" {\n\t\t\t\tpage = since\n\t\t\t}\n\n\t\t\tfor _, segment := range segments[1:] {\n\t\t\t\tswitch strings.TrimSpace(segment) {\n\t\t\t\tcase `rel=\"next\"`:\n\t\t\t\t\tif r.NextPage, err = strconv.Atoi(page); err != nil {\n\t\t\t\t\t\tr.NextPageToken = page\n\t\t\t\t\t}\n\t\t\t\t\tr.After = after\n\t\t\t\tcase `rel=\"prev\"`:\n\t\t\t\t\tr.PrevPage, _ = strconv.Atoi(page)\n\t\t\t\t\tr.Before = before\n\t\t\t\tcase `rel=\"first\"`:\n\t\t\t\t\tr.FirstPage, _ = strconv.Atoi(page)\n\t\t\t\tcase `rel=\"last\"`:\n\t\t\t\t\tr.LastPage, _ = strconv.Atoi(page)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n// parseRate parses the rate related headers.\nfunc parseRate(r *http.Response) Rate {\n\tvar rate Rate\n\tif limit := r.Header.Get(HeaderRateLimit); limit != \"\" {\n\t\trate.Limit, _ = strconv.Atoi(limit)\n\t}\n\tif remaining := r.Header.Get(HeaderRateRemaining); remaining != \"\" {\n\t\trate.Remaining, _ = strconv.Atoi(remaining)\n\t}\n\tif used := r.Header.Get(HeaderRateUsed); used != \"\" {\n\t\trate.Used, _ = strconv.Atoi(used)\n\t}\n\tif reset := r.Header.Get(HeaderRateReset); reset != \"\" {\n\t\tif v, _ := strconv.ParseInt(reset, 10, 64); v != 0 {\n\t\t\trate.Reset = Timestamp{time.Unix(v, 0)}\n\t\t}\n\t}\n\tif resource := r.Header.Get(HeaderRateResource); resource != \"\" {\n\t\trate.Resource = resource\n\t}\n\treturn rate\n}\n\n// parseSecondaryRate parses the secondary rate related headers,\n// and returns the time to retry after.\nfunc parseSecondaryRate(r *http.Response) *time.Duration {\n\t// According to GitHub support, the \"Retry-After\" header value will be\n\t// an integer which represents the number of seconds that one should\n\t// wait before resuming making requests.\n\tif v := r.Header.Get(headerRetryAfter); v != \"\" {\n\t\tretryAfterSeconds, _ := strconv.ParseInt(v, 10, 64) // Error handling is noop.\n\t\tretryAfter := time.Duration(retryAfterSeconds) * time.Second\n\t\treturn &retryAfter\n\t}\n\n\t// According to GitHub support, endpoints might return x-ratelimit-reset instead,\n\t// as an integer which represents the number of seconds since epoch UTC,\n\t// representing the time to resume making requests.\n\tif v := r.Header.Get(HeaderRateReset); v != \"\" {\n\t\tsecondsSinceEpoch, _ := strconv.ParseInt(v, 10, 64) // Error handling is noop.\n\t\tretryAfter := time.Until(time.Unix(secondsSinceEpoch, 0))\n\t\treturn &retryAfter\n\t}\n\n\treturn nil\n}\n\n// parseTokenExpiration parses the TokenExpiration related headers.\n// Returns 0001-01-01 if the header is not defined or could not be parsed.\nfunc parseTokenExpiration(r *http.Response) Timestamp {\n\tif v := r.Header.Get(headerTokenExpiration); v != \"\" {\n\t\tif t, err := time.Parse(\"2006-01-02 15:04:05 MST\", v); err == nil {\n\t\t\treturn Timestamp{t.Local()}\n\t\t}\n\t\t// Some tokens include the timezone offset instead of the timezone.\n\t\t// https://github.com/google/go-github/issues/2649\n\t\tif t, err := time.Parse(\"2006-01-02 15:04:05 -0700\", v); err == nil {\n\t\t\treturn Timestamp{t.Local()}\n\t\t}\n\t}\n\treturn Timestamp{} // 0001-01-01 00:00:00\n}\n\ntype requestContext uint8\n\nconst (\n\t// BypassRateLimitCheck prevents a pre-emptive check for exceeded primary rate limits\n\t// Specify this by providing a context with this key, e.g.\n\t//   context.WithValue(context.Background(), github.BypassRateLimitCheck, true)\n\tBypassRateLimitCheck requestContext = iota\n\n\tSleepUntilPrimaryRateLimitResetWhenRateLimited\n)\n\n// bareDo sends an API request using `caller` http.Client passed in the parameters\n// and lets you handle the api response. If an error or API Error occurs, the error\n// will contain more information. Otherwise, you are supposed to read and close the\n// response's Body. If rate limit is exceeded and reset time is in the future,\n// bareDo returns *RateLimitError immediately without making a network API call.\n//\n// The provided ctx must be non-nil, if it is nil an error is returned. If it is\n// canceled or times out, ctx.Err() will be returned.\nfunc (c *Client) bareDo(ctx context.Context, caller *http.Client, req *http.Request) (*Response, error) {\n\tif ctx == nil {\n\t\treturn nil, errNonNilContext\n\t}\n\n\treq = withContext(ctx, req)\n\n\trateLimitCategory := CoreCategory\n\n\tif !c.DisableRateLimitCheck {\n\t\trateLimitCategory = GetRateLimitCategory(req.Method, req.URL.Path)\n\n\t\tif bypass := ctx.Value(BypassRateLimitCheck); bypass == nil {\n\t\t\t// If we've hit rate limit, don't make further requests before Reset time.\n\t\t\tif err := c.checkRateLimitBeforeDo(req, rateLimitCategory); err != nil {\n\t\t\t\treturn &Response{\n\t\t\t\t\tResponse: err.Response,\n\t\t\t\t\tRate:     err.Rate,\n\t\t\t\t}, err\n\t\t\t}\n\n\t\t\t// If we've hit a secondary rate limit, don't make further requests before Retry After.\n\t\t\tif err := c.checkSecondaryRateLimitBeforeDo(req); err != nil {\n\t\t\t\treturn &Response{\n\t\t\t\t\tResponse: err.Response,\n\t\t\t\t}, err\n\t\t\t}\n\t\t}\n\t}\n\n\tresp, err := caller.Do(req)\n\tvar response *Response\n\tif resp != nil {\n\t\tresponse = newResponse(resp)\n\t}\n\n\tif err != nil {\n\t\t// If we got an error, and the context has been canceled,\n\t\t// the context's error is probably more useful.\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn response, ctx.Err()\n\t\tdefault:\n\t\t}\n\n\t\t// If the error type is *url.Error, sanitize its URL before returning.\n\t\tvar e *url.Error\n\t\tif errors.As(err, &e) {\n\t\t\tif url, err := url.Parse(e.URL); err == nil {\n\t\t\t\te.URL = sanitizeURL(url).String()\n\t\t\t\treturn response, e\n\t\t\t}\n\t\t}\n\n\t\treturn response, err\n\t}\n\n\t// Don't update the rate limits if the client has rate limits disabled or if\n\t// this was a cached response. The X-From-Cache is set by\n\t// https://github.com/bartventer/httpcache if it's enabled.\n\tif !c.DisableRateLimitCheck && response.Header.Get(\"X-From-Cache\") == \"\" {\n\t\tc.rateMu.Lock()\n\t\tc.rateLimits[rateLimitCategory] = response.Rate\n\t\tc.rateMu.Unlock()\n\t}\n\n\terr = CheckResponse(resp)\n\tif err != nil {\n\t\tdefer resp.Body.Close()\n\t\t// Special case for AcceptedErrors. If an AcceptedError\n\t\t// has been encountered, the response's payload will be\n\t\t// added to the AcceptedError and returned.\n\t\t//\n\t\t// Issue #1022\n\t\tvar aerr *AcceptedError\n\t\tif errors.As(err, &aerr) {\n\t\t\tb, readErr := io.ReadAll(resp.Body)\n\t\t\tif readErr != nil {\n\t\t\t\treturn response, readErr\n\t\t\t}\n\n\t\t\taerr.Raw = b\n\t\t\terr = aerr\n\t\t}\n\n\t\tvar rateLimitError *RateLimitError\n\t\tif errors.As(err, &rateLimitError) &&\n\t\t\treq.Context().Value(SleepUntilPrimaryRateLimitResetWhenRateLimited) != nil {\n\t\t\tif err := sleepUntilResetWithBuffer(req.Context(), rateLimitError.Rate.Reset.Time); err != nil {\n\t\t\t\treturn response, err\n\t\t\t}\n\t\t\t// retry the request once when the rate limit has reset\n\t\t\treturn c.bareDo(context.WithValue(req.Context(), SleepUntilPrimaryRateLimitResetWhenRateLimited, nil), caller, req)\n\t\t}\n\n\t\t// Update the secondary rate limit if we hit it.\n\t\tvar rerr *AbuseRateLimitError\n\t\tif errors.As(err, &rerr) && rerr.RetryAfter != nil {\n\t\t\t// if a max duration is specified, make sure that we are waiting at most this duration\n\t\t\tif c.MaxSecondaryRateLimitRetryAfterDuration > 0 && rerr.GetRetryAfter() > c.MaxSecondaryRateLimitRetryAfterDuration {\n\t\t\t\trerr.RetryAfter = &c.MaxSecondaryRateLimitRetryAfterDuration\n\t\t\t}\n\t\t\tc.rateMu.Lock()\n\t\t\tc.secondaryRateLimitReset = time.Now().Add(*rerr.RetryAfter)\n\t\t\tc.rateMu.Unlock()\n\t\t}\n\t}\n\treturn response, err\n}\n\n// BareDo sends an API request and lets you handle the api response. If an error\n// or API Error occurs, the error will contain more information. Otherwise, you\n// are supposed to read and close the response's Body. If rate limit is exceeded\n// and reset time is in the future, BareDo returns *RateLimitError immediately\n// without making a network API call.\n//\n// The provided ctx must be non-nil, if it is nil an error is returned. If it is\n// canceled or times out, ctx.Err() will be returned.\nfunc (c *Client) BareDo(ctx context.Context, req *http.Request) (*Response, error) {\n\treturn c.bareDo(ctx, c.client, req)\n}\n\n// bareDoIgnoreRedirects has the exact same behavior as BareDo but stops at the first\n// redirection code returned by the API. If a redirection is returned by the api, bareDoIgnoreRedirects\n// returns a *RedirectionError.\n//\n// The provided ctx must be non-nil, if it is nil an error is returned. If it is\n// canceled or times out, ctx.Err() will be returned.\nfunc (c *Client) bareDoIgnoreRedirects(ctx context.Context, req *http.Request) (*Response, error) {\n\treturn c.bareDo(ctx, c.clientIgnoreRedirects, req)\n}\n\nvar errInvalidLocation = errors.New(\"invalid or empty Location header in redirection response\")\n\n// bareDoUntilFound has the exact same behavior as BareDo but only follows 301s, up to maxRedirects times. If it receives\n// a 302, it will parse the Location header into a *url.URL and return that.\n// This is useful for endpoints that return a 302 in successful cases but still might return 301s for\n// permanent redirections.\n//\n// The provided ctx must be non-nil, if it is nil an error is returned. If it is\n// canceled or times out, ctx.Err() will be returned.\nfunc (c *Client) bareDoUntilFound(ctx context.Context, req *http.Request, maxRedirects int) (*url.URL, *Response, error) {\n\tresponse, err := c.bareDoIgnoreRedirects(ctx, req)\n\tif err != nil {\n\t\tvar rerr *RedirectionError\n\t\tif errors.As(err, &rerr) {\n\t\t\t// If we receive a 302, transform potential relative locations into absolute and return it.\n\t\t\tif rerr.StatusCode == http.StatusFound {\n\t\t\t\tif rerr.Location == nil {\n\t\t\t\t\treturn nil, nil, errInvalidLocation\n\t\t\t\t}\n\t\t\t\tnewURL := c.BaseURL.ResolveReference(rerr.Location)\n\t\t\t\treturn newURL, response, nil\n\t\t\t}\n\t\t\t// If permanent redirect response is returned, follow it\n\t\t\tif maxRedirects > 0 && rerr.StatusCode == http.StatusMovedPermanently {\n\t\t\t\tif rerr.Location == nil {\n\t\t\t\t\treturn nil, nil, errInvalidLocation\n\t\t\t\t}\n\t\t\t\tnewURL := c.BaseURL.ResolveReference(rerr.Location)\n\t\t\t\tnewRequest := req.Clone(ctx)\n\t\t\t\tnewRequest.URL = newURL\n\t\t\t\treturn c.bareDoUntilFound(ctx, newRequest, maxRedirects-1)\n\t\t\t}\n\t\t\t// If we reached the maximum amount of redirections, return an error\n\t\t\tif maxRedirects <= 0 && rerr.StatusCode == http.StatusMovedPermanently {\n\t\t\t\treturn nil, response, fmt.Errorf(\"reached the maximum amount of redirections: %w\", err)\n\t\t\t}\n\t\t\treturn nil, response, fmt.Errorf(\"unexpected redirection response: %w\", err)\n\t\t}\n\t}\n\n\t// If we don't receive a redirection, forward the response and potential error\n\treturn nil, response, err\n}\n\n// Do sends an API request and returns the API response. The API response is\n// JSON decoded and stored in the value pointed to by v, or returned as an\n// error if an API error has occurred. If v implements the io.Writer interface,\n// the raw response body will be written to v, without attempting to first\n// decode it. If v is nil, and no error happens, the response is returned as is.\n// If rate limit is exceeded and reset time is in the future, Do returns\n// *RateLimitError immediately without making a network API call.\n//\n// The provided ctx must be non-nil, if it is nil an error is returned. If it\n// is canceled or times out, ctx.Err() will be returned.\nfunc (c *Client) Do(ctx context.Context, req *http.Request, v any) (*Response, error) {\n\tresp, err := c.BareDo(ctx, req)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\tdefer resp.Body.Close()\n\n\tswitch v := v.(type) {\n\tcase nil:\n\tcase io.Writer:\n\t\t_, err = io.Copy(v, resp.Body)\n\tdefault:\n\t\tdecErr := json.NewDecoder(resp.Body).Decode(v)\n\t\tif decErr == io.EOF {\n\t\t\tdecErr = nil // ignore EOF errors caused by empty response body\n\t\t}\n\t\tif decErr != nil {\n\t\t\terr = decErr\n\t\t}\n\t}\n\treturn resp, err\n}\n\n// checkRateLimitBeforeDo does not make any network calls, but uses existing knowledge from\n// current client state in order to quickly check if *RateLimitError can be immediately returned\n// from Client.Do, and if so, returns it so that Client.Do can skip making a network API call unnecessarily.\n// Otherwise it returns nil, and Client.Do should proceed normally.\nfunc (c *Client) checkRateLimitBeforeDo(req *http.Request, rateLimitCategory RateLimitCategory) *RateLimitError {\n\tc.rateMu.Lock()\n\trate := c.rateLimits[rateLimitCategory]\n\tc.rateMu.Unlock()\n\tif !rate.Reset.Time.IsZero() && rate.Remaining == 0 && time.Now().Before(rate.Reset.Time) {\n\t\t// Create a fake response.\n\t\tresp := &http.Response{\n\t\t\tStatus:     http.StatusText(http.StatusForbidden),\n\t\t\tStatusCode: http.StatusForbidden,\n\t\t\tRequest:    req,\n\t\t\tHeader:     make(http.Header),\n\t\t\tBody:       io.NopCloser(strings.NewReader(\"\")),\n\t\t}\n\n\t\tif req.Context().Value(SleepUntilPrimaryRateLimitResetWhenRateLimited) != nil {\n\t\t\tif err := sleepUntilResetWithBuffer(req.Context(), rate.Reset.Time); err == nil {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn &RateLimitError{\n\t\t\t\tRate:     rate,\n\t\t\t\tResponse: resp,\n\t\t\t\tMessage:  fmt.Sprintf(\"Context cancelled while waiting for rate limit to reset until %v, not making remote request.\", rate.Reset.Time),\n\t\t\t}\n\t\t}\n\n\t\treturn &RateLimitError{\n\t\t\tRate:     rate,\n\t\t\tResponse: resp,\n\t\t\tMessage:  fmt.Sprintf(\"API rate limit of %v still exceeded until %v, not making remote request.\", rate.Limit, rate.Reset.Time),\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// checkSecondaryRateLimitBeforeDo does not make any network calls, but uses existing knowledge from\n// current client state in order to quickly check if *AbuseRateLimitError can be immediately returned\n// from Client.Do, and if so, returns it so that Client.Do can skip making a network API call unnecessarily.\n// Otherwise it returns nil, and Client.Do should proceed normally.\nfunc (c *Client) checkSecondaryRateLimitBeforeDo(req *http.Request) *AbuseRateLimitError {\n\tc.rateMu.Lock()\n\tsecondary := c.secondaryRateLimitReset\n\tc.rateMu.Unlock()\n\tif !secondary.IsZero() && time.Now().Before(secondary) {\n\t\t// Create a fake response.\n\t\tresp := &http.Response{\n\t\t\tStatus:     http.StatusText(http.StatusForbidden),\n\t\t\tStatusCode: http.StatusForbidden,\n\t\t\tRequest:    req,\n\t\t\tHeader:     make(http.Header),\n\t\t\tBody:       io.NopCloser(strings.NewReader(\"\")),\n\t\t}\n\n\t\tretryAfter := time.Until(secondary)\n\t\treturn &AbuseRateLimitError{\n\t\t\tResponse:   resp,\n\t\t\tMessage:    fmt.Sprintf(\"API secondary rate limit exceeded until %v, not making remote request.\", secondary),\n\t\t\tRetryAfter: &retryAfter,\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// compareHTTPResponse returns whether two http.Response objects are equal or not.\n// Currently, only StatusCode is checked. This function is used when implementing the\n// Is(error) bool interface for the custom error types in this package.\nfunc compareHTTPResponse(r1, r2 *http.Response) bool {\n\tif r1 == nil && r2 == nil {\n\t\treturn true\n\t}\n\n\tif r1 != nil && r2 != nil {\n\t\treturn r1.StatusCode == r2.StatusCode\n\t}\n\treturn false\n}\n\n/*\nAn ErrorResponse reports one or more errors caused by an API request.\n\nGitHub API docs: https://docs.github.com/rest/#client-errors\n*/\ntype ErrorResponse struct {\n\tResponse *http.Response `json:\"-\"`       // HTTP response that caused this error\n\tMessage  string         `json:\"message\"` // error message\n\t//nolint:sliceofpointers\n\tErrors []Error `json:\"errors\"` // more detail on individual errors\n\t// Block is only populated on certain types of errors such as code 451.\n\tBlock *ErrorBlock `json:\"block,omitempty\"`\n\t// Most errors will also include a documentation_url field pointing\n\t// to some content that might help you resolve the error, see\n\t// https://docs.github.com/rest/#client-errors\n\tDocumentationURL string `json:\"documentation_url,omitempty\"`\n}\n\n// ErrorBlock contains a further explanation for the reason of an error.\n// See https://developer.github.com/changes/2016-03-17-the-451-status-code-is-now-supported/\n// for more information.\ntype ErrorBlock struct {\n\tReason    string     `json:\"reason,omitempty\"`\n\tCreatedAt *Timestamp `json:\"created_at,omitempty\"`\n}\n\nfunc (r *ErrorResponse) Error() string {\n\tif r.Response != nil && r.Response.Request != nil {\n\t\treturn fmt.Sprintf(\"%v %v: %v %v %+v\",\n\t\t\tr.Response.Request.Method, sanitizeURL(r.Response.Request.URL),\n\t\t\tr.Response.StatusCode, r.Message, r.Errors)\n\t}\n\n\tif r.Response != nil {\n\t\treturn fmt.Sprintf(\"%v %v %+v\", r.Response.StatusCode, r.Message, r.Errors)\n\t}\n\n\treturn fmt.Sprintf(\"%v %+v\", r.Message, r.Errors)\n}\n\n// Is returns whether the provided error equals this error.\nfunc (r *ErrorResponse) Is(target error) bool {\n\tvar v *ErrorResponse\n\tif !errors.As(target, &v) {\n\t\treturn false\n\t}\n\n\tif r.Message != v.Message || (r.DocumentationURL != v.DocumentationURL) ||\n\t\t!compareHTTPResponse(r.Response, v.Response) {\n\t\treturn false\n\t}\n\n\t// Compare Errors.\n\tif len(r.Errors) != len(v.Errors) {\n\t\treturn false\n\t}\n\tfor idx := range r.Errors {\n\t\tif r.Errors[idx] != v.Errors[idx] {\n\t\t\treturn false\n\t\t}\n\t}\n\n\t// Compare Block.\n\tif (r.Block != nil && v.Block == nil) || (r.Block == nil && v.Block != nil) {\n\t\treturn false\n\t}\n\tif r.Block != nil && v.Block != nil {\n\t\tif r.Block.Reason != v.Block.Reason {\n\t\t\treturn false\n\t\t}\n\t\tif (r.Block.CreatedAt != nil && v.Block.CreatedAt == nil) || (r.Block.CreatedAt ==\n\t\t\tnil && v.Block.CreatedAt != nil) {\n\t\t\treturn false\n\t\t}\n\t\tif r.Block.CreatedAt != nil && v.Block.CreatedAt != nil {\n\t\t\tif *(r.Block.CreatedAt) != *(v.Block.CreatedAt) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\n\treturn true\n}\n\n// TwoFactorAuthError occurs when using HTTP Basic Authentication for a user\n// that has two-factor authentication enabled. The request can be reattempted\n// by providing a one-time password in the request.\ntype TwoFactorAuthError ErrorResponse\n\nfunc (r *TwoFactorAuthError) Error() string { return (*ErrorResponse)(r).Error() }\n\n// RateLimitError occurs when GitHub returns 403 Forbidden response with a rate limit\n// remaining value of 0.\ntype RateLimitError struct {\n\tRate     Rate           // Rate specifies last known rate limit for the client\n\tResponse *http.Response // HTTP response that caused this error\n\tMessage  string         `json:\"message\"` // error message\n}\n\nfunc (r *RateLimitError) Error() string {\n\treturn fmt.Sprintf(\"%v %v: %v %v %v\",\n\t\tr.Response.Request.Method, sanitizeURL(r.Response.Request.URL),\n\t\tr.Response.StatusCode, r.Message, formatRateReset(time.Until(r.Rate.Reset.Time)))\n}\n\n// Is returns whether the provided error equals this error.\nfunc (r *RateLimitError) Is(target error) bool {\n\tvar v *RateLimitError\n\tif !errors.As(target, &v) {\n\t\treturn false\n\t}\n\n\treturn r.Rate == v.Rate &&\n\t\tr.Message == v.Message &&\n\t\tcompareHTTPResponse(r.Response, v.Response)\n}\n\n// AcceptedError occurs when GitHub returns 202 Accepted response with an\n// empty body, which means a job was scheduled on the GitHub side to process\n// the information needed and cache it.\n// Technically, 202 Accepted is not a real error, it's just used to\n// indicate that results are not ready yet, but should be available soon.\n// The request can be repeated after some time.\ntype AcceptedError struct {\n\t// Raw contains the response body.\n\tRaw []byte\n}\n\nfunc (*AcceptedError) Error() string {\n\treturn \"job scheduled on GitHub side; try again later\"\n}\n\n// Is returns whether the provided error equals this error.\nfunc (ae *AcceptedError) Is(target error) bool {\n\tvar v *AcceptedError\n\tif !errors.As(target, &v) {\n\t\treturn false\n\t}\n\treturn bytes.Equal(ae.Raw, v.Raw)\n}\n\n// AbuseRateLimitError occurs when GitHub returns 403 Forbidden response with the\n// \"documentation_url\" field value equal to \"https://docs.github.com/rest/overview/rate-limits-for-the-rest-api#about-secondary-rate-limits\".\ntype AbuseRateLimitError struct {\n\tResponse *http.Response // HTTP response that caused this error\n\tMessage  string         `json:\"message\"` // error message\n\n\t// RetryAfter is provided with some abuse rate limit errors. If present,\n\t// it is the amount of time that the client should wait before retrying.\n\t// Otherwise, the client should try again later (after an unspecified amount of time).\n\tRetryAfter *time.Duration\n}\n\nfunc (r *AbuseRateLimitError) Error() string {\n\treturn fmt.Sprintf(\"%v %v: %v %v\",\n\t\tr.Response.Request.Method, sanitizeURL(r.Response.Request.URL),\n\t\tr.Response.StatusCode, r.Message)\n}\n\n// Is returns whether the provided error equals this error.\nfunc (r *AbuseRateLimitError) Is(target error) bool {\n\tvar v *AbuseRateLimitError\n\tif !errors.As(target, &v) {\n\t\treturn false\n\t}\n\n\treturn r.Message == v.Message &&\n\t\tr.RetryAfter == v.RetryAfter &&\n\t\tcompareHTTPResponse(r.Response, v.Response)\n}\n\n// RedirectionError represents a response that returned a redirect status code:\n//\n//\t301 (Moved Permanently)\n//\t302 (Found)\n//\t303 (See Other)\n//\t307 (Temporary Redirect)\n//\t308 (Permanent Redirect)\n//\n// If there was a valid Location header included, it will be parsed to a URL. You should use\n// `BaseURL.ResolveReference()` to enrich it with the correct hostname where needed.\ntype RedirectionError struct {\n\tResponse   *http.Response // HTTP response that caused this error\n\tStatusCode int\n\tLocation   *url.URL // location header of the redirection if present\n}\n\nfunc (r *RedirectionError) Error() string {\n\treturn fmt.Sprintf(\"%v %v: %v location %v\",\n\t\tr.Response.Request.Method, sanitizeURL(r.Response.Request.URL),\n\t\tr.StatusCode, sanitizeURL(r.Location))\n}\n\n// Is returns whether the provided error equals this error.\nfunc (r *RedirectionError) Is(target error) bool {\n\tvar v *RedirectionError\n\tif !errors.As(target, &v) {\n\t\treturn false\n\t}\n\n\treturn r.StatusCode == v.StatusCode &&\n\t\t(r.Location == v.Location || // either both locations are nil or exactly the same pointer\n\t\t\tr.Location != nil && v.Location != nil && r.Location.String() == v.Location.String()) // or they are both not nil and marshaled identically\n}\n\n// sanitizeURL redacts the client_secret parameter from the URL which may be\n// exposed to the user.\nfunc sanitizeURL(uri *url.URL) *url.URL {\n\tif uri == nil {\n\t\treturn nil\n\t}\n\tparams := uri.Query()\n\tif len(params.Get(\"client_secret\")) > 0 {\n\t\tparams.Set(\"client_secret\", \"REDACTED\")\n\t\turi.RawQuery = params.Encode()\n\t}\n\treturn uri\n}\n\n/*\nAn Error reports more details on an individual error in an ErrorResponse.\nThese are the possible validation error codes:\n\n\tmissing:\n\t    resource does not exist\n\tmissing_field:\n\t    a required field on a resource has not been set\n\tinvalid:\n\t    the formatting of a field is invalid\n\talready_exists:\n\t    another resource has the same valid as this field\n\tcustom:\n\t    some resources return this (e.g. github.User.CreateKey()), additional\n\t    information is set in the Message field of the Error\n\nGitHub error responses structure are often undocumented and inconsistent.\nSometimes error is just a simple string (Issue #540).\nIn such cases, Message represents an error message as a workaround.\n\nGitHub API docs: https://docs.github.com/rest/#client-errors\n*/\ntype Error struct {\n\tResource string `json:\"resource\"` // resource on which the error occurred\n\tField    string `json:\"field\"`    // field on which the error occurred\n\tCode     string `json:\"code\"`     // validation error code\n\tMessage  string `json:\"message\"`  // Message describing the error. Errors with Code == \"custom\" will always have this set.\n}\n\nfunc (e *Error) Error() string {\n\treturn fmt.Sprintf(\"%v error caused by %v field on %v resource\",\n\t\te.Code, e.Field, e.Resource)\n}\n\n// UnmarshalJSON implements the json.Unmarshaler interface.\nfunc (e *Error) UnmarshalJSON(data []byte) error {\n\ttype aliasError Error // avoid infinite recursion by using type alias.\n\tif err := json.Unmarshal(data, (*aliasError)(e)); err != nil {\n\t\treturn json.Unmarshal(data, &e.Message) // data can be json string.\n\t}\n\treturn nil\n}\n\n// CheckResponse checks the API response for errors, and returns them if\n// present. A response is considered an error if it has a status code outside\n// the 200 range or equal to 202 Accepted.\n// API error responses are expected to have response\n// body, and a JSON response body that maps to [ErrorResponse].\n//\n// The error type will be *[RateLimitError] for rate limit exceeded errors,\n// *[AcceptedError] for 202 Accepted status codes,\n// *[TwoFactorAuthError] for two-factor authentication errors,\n// and *[RedirectionError] for redirect status codes (only happens when ignoring redirections).\nfunc CheckResponse(r *http.Response) error {\n\tif r.StatusCode == http.StatusAccepted {\n\t\treturn &AcceptedError{}\n\t}\n\tif c := r.StatusCode; 200 <= c && c <= 299 {\n\t\treturn nil\n\t}\n\n\terrorResponse := &ErrorResponse{Response: r}\n\tdata, err := io.ReadAll(r.Body)\n\tif err == nil && data != nil {\n\t\terr = json.Unmarshal(data, errorResponse)\n\t\tif err != nil {\n\t\t\t// reset the response as if this never happened\n\t\t\terrorResponse = &ErrorResponse{Response: r}\n\t\t}\n\t}\n\t// Re-populate error response body because GitHub error responses are often\n\t// undocumented and inconsistent.\n\t// Issue #1136, #540.\n\tr.Body = io.NopCloser(bytes.NewBuffer(data))\n\tswitch {\n\tcase r.StatusCode == http.StatusUnauthorized && strings.HasPrefix(r.Header.Get(headerOTP), \"required\"):\n\t\treturn (*TwoFactorAuthError)(errorResponse)\n\t// Primary rate limit exceeded: GitHub returns 403 or 429 with X-RateLimit-Remaining: 0\n\t// See: https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api\n\tcase (r.StatusCode == http.StatusForbidden || r.StatusCode == http.StatusTooManyRequests) &&\n\t\tr.Header.Get(HeaderRateRemaining) == \"0\":\n\t\treturn &RateLimitError{\n\t\t\tRate:     parseRate(r),\n\t\t\tResponse: errorResponse.Response,\n\t\t\tMessage:  errorResponse.Message,\n\t\t}\n\t// Secondary rate limit exceeded: GitHub returns 403 or 429 with specific documentation_url\n\t// See: https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits\n\tcase (r.StatusCode == http.StatusForbidden || r.StatusCode == http.StatusTooManyRequests) &&\n\t\t(strings.HasSuffix(errorResponse.DocumentationURL, \"#abuse-rate-limits\") ||\n\t\t\tstrings.HasSuffix(errorResponse.DocumentationURL, \"secondary-rate-limits\")):\n\t\tabuseRateLimitError := &AbuseRateLimitError{\n\t\t\tResponse: errorResponse.Response,\n\t\t\tMessage:  errorResponse.Message,\n\t\t}\n\t\tif retryAfter := parseSecondaryRate(r); retryAfter != nil {\n\t\t\tabuseRateLimitError.RetryAfter = retryAfter\n\t\t}\n\t\treturn abuseRateLimitError\n\t// Check that the status code is a redirection and return a sentinel error that can be used to handle special cases\n\t// where 302 is considered a successful result.\n\t// This should never happen with the default `CheckRedirect`, because it would return a `url.Error` that should be handled upstream.\n\tcase r.StatusCode == http.StatusMovedPermanently ||\n\t\tr.StatusCode == http.StatusFound ||\n\t\tr.StatusCode == http.StatusSeeOther ||\n\t\tr.StatusCode == http.StatusTemporaryRedirect ||\n\t\tr.StatusCode == http.StatusPermanentRedirect:\n\n\t\tlocationStr := r.Header.Get(\"Location\")\n\t\tvar location *url.URL\n\t\tif locationStr != \"\" {\n\t\t\tlocation, _ = url.Parse(locationStr)\n\t\t}\n\t\treturn &RedirectionError{\n\t\t\tResponse:   errorResponse.Response,\n\t\t\tStatusCode: r.StatusCode,\n\t\t\tLocation:   location,\n\t\t}\n\tdefault:\n\t\treturn errorResponse\n\t}\n}\n\n// parseBoolResponse determines the boolean result from a GitHub API response.\n// Several GitHub API methods return boolean responses indicated by the HTTP\n// status code in the response (true indicated by a 204, false indicated by a\n// 404). This helper function will determine that result and hide the 404\n// error if present. Any other error will be returned through as-is.\nfunc parseBoolResponse(err error) (bool, error) {\n\tif err == nil {\n\t\treturn true, nil\n\t}\n\n\tvar rerr *ErrorResponse\n\tif errors.As(err, &rerr) && rerr.Response.StatusCode == http.StatusNotFound {\n\t\t// Simply false. In this one case, we do not pass the error through.\n\t\treturn false, nil\n\t}\n\n\t// some other real error occurred\n\treturn false, err\n}\n\n// RateLimitCategory represents the enumeration of rate limit categories.\ntype RateLimitCategory uint8\n\nconst (\n\tCoreCategory RateLimitCategory = iota\n\tSearchCategory\n\tGraphqlCategory\n\tIntegrationManifestCategory\n\tSourceImportCategory\n\tCodeScanningUploadCategory\n\tActionsRunnerRegistrationCategory\n\tScimCategory\n\tDependencySnapshotsCategory\n\tCodeSearchCategory\n\tAuditLogCategory\n\tDependencySBOMCategory\n\n\tCategories // An array of this length will be able to contain all rate limit categories.\n)\n\n// GetRateLimitCategory returns the rate limit RateLimitCategory of the endpoint, determined by HTTP method and Request.URL.Path.\nfunc GetRateLimitCategory(method, path string) RateLimitCategory {\n\tswitch {\n\t// https://docs.github.com/rest/rate-limit#about-rate-limits\n\tdefault:\n\t\t// NOTE: coreCategory is returned for actionsRunnerRegistrationCategory too,\n\t\t// because no API found for this category.\n\t\treturn CoreCategory\n\n\t// https://docs.github.com/en/rest/search/search#search-code\n\tcase strings.HasPrefix(path, \"/search/code\") &&\n\t\tmethod == \"GET\":\n\t\treturn CodeSearchCategory\n\n\tcase strings.HasPrefix(path, \"/search/\"):\n\t\treturn SearchCategory\n\tcase path == \"/graphql\":\n\t\treturn GraphqlCategory\n\tcase strings.HasPrefix(path, \"/app-manifests/\") &&\n\t\tstrings.HasSuffix(path, \"/conversions\") &&\n\t\tmethod == \"POST\":\n\t\treturn IntegrationManifestCategory\n\n\t// https://docs.github.com/rest/migrations/source-imports#start-an-import\n\tcase strings.HasPrefix(path, \"/repos/\") &&\n\t\tstrings.HasSuffix(path, \"/import\") &&\n\t\tmethod == \"PUT\":\n\t\treturn SourceImportCategory\n\n\t// https://docs.github.com/rest/code-scanning#upload-an-analysis-as-sarif-data\n\tcase strings.HasSuffix(path, \"/code-scanning/sarifs\"):\n\t\treturn CodeScanningUploadCategory\n\n\t// https://docs.github.com/enterprise-cloud@latest/rest/scim\n\tcase strings.HasPrefix(path, \"/scim/\"):\n\t\treturn ScimCategory\n\n\t// https://docs.github.com/en/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository\n\tcase strings.HasPrefix(path, \"/repos/\") &&\n\t\tstrings.HasSuffix(path, \"/dependency-graph/snapshots\") &&\n\t\tmethod == \"POST\":\n\t\treturn DependencySnapshotsCategory\n\n\t// https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/orgs?apiVersion=2022-11-28#get-the-audit-log-for-an-organization\n\tcase strings.HasSuffix(path, \"/audit-log\"):\n\t\treturn AuditLogCategory\n\n\t// https://docs.github.com/en/rest/dependency-graph/sboms?apiVersion=2022-11-28#export-a-software-bill-of-materials-sbom-for-a-repository\n\tcase strings.HasPrefix(path, \"/repos/\") &&\n\t\tstrings.HasSuffix(path, \"/dependency-graph/sbom\"):\n\t\treturn DependencySBOMCategory\n\t}\n}\n\n// RateLimits returns the rate limits for the current client.\n//\n// Deprecated: Use RateLimitService.Get instead.\nfunc (c *Client) RateLimits(ctx context.Context) (*RateLimits, *Response, error) {\n\treturn c.RateLimit.Get(ctx)\n}\n\nfunc setCredentialsAsHeaders(req *http.Request, id, secret string) *http.Request {\n\t// To set extra headers, we must make a copy of the Request so\n\t// that we don't modify the Request we were given. This is required by the\n\t// specification of http.RoundTripper.\n\t//\n\t// Since we are going to modify only req.Header here, we only need a deep copy\n\t// of req.Header.\n\tconvertedRequest := *req\n\tconvertedRequest.Header = make(http.Header, len(req.Header))\n\n\tfor k, s := range req.Header {\n\t\tconvertedRequest.Header[k] = append([]string(nil), s...)\n\t}\n\tconvertedRequest.SetBasicAuth(id, secret)\n\treturn &convertedRequest\n}\n\n/*\nUnauthenticatedRateLimitedTransport allows you to make unauthenticated calls\nthat need to use a higher rate limit associated with your OAuth application.\n\n\tt := &github.UnauthenticatedRateLimitedTransport{\n\t\tClientID:     \"your app's client ID\",\n\t\tClientSecret: \"your app's client secret\",\n\t}\n\tclient := github.NewClient(t.Client())\n\nThis will add the client id and secret as a base64-encoded string in the format\nClientID:ClientSecret and apply it as an \"Authorization\": \"Basic\" header.\n\nSee https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api#primary-rate-limit-for-oauth-apps\nfor more information.\n*/\ntype UnauthenticatedRateLimitedTransport struct {\n\t// ClientID is the GitHub OAuth client ID of the current application, which\n\t// can be found by selecting its entry in the list at\n\t// https://github.com/settings/applications.\n\tClientID string\n\n\t// ClientSecret is the GitHub OAuth client secret of the current\n\t// application.\n\tClientSecret string\n\n\t// Transport is the underlying HTTP transport to use when making requests.\n\t// It will default to http.DefaultTransport if nil.\n\tTransport http.RoundTripper\n}\n\n// RoundTrip implements the RoundTripper interface.\nfunc (t *UnauthenticatedRateLimitedTransport) RoundTrip(req *http.Request) (*http.Response, error) {\n\tif t.ClientID == \"\" {\n\t\treturn nil, errors.New(\"t.ClientID is empty\")\n\t}\n\tif t.ClientSecret == \"\" {\n\t\treturn nil, errors.New(\"t.ClientSecret is empty\")\n\t}\n\n\treq2 := setCredentialsAsHeaders(req, t.ClientID, t.ClientSecret)\n\t// Make the HTTP request.\n\treturn t.transport().RoundTrip(req2)\n}\n\n// Client returns an *http.Client that makes requests which are subject to the\n// rate limit of your OAuth application.\nfunc (t *UnauthenticatedRateLimitedTransport) Client() *http.Client {\n\treturn &http.Client{Transport: t}\n}\n\nfunc (t *UnauthenticatedRateLimitedTransport) transport() http.RoundTripper {\n\tif t.Transport != nil {\n\t\treturn t.Transport\n\t}\n\treturn http.DefaultTransport\n}\n\n// BasicAuthTransport is an http.RoundTripper that authenticates all requests\n// using HTTP Basic Authentication with the provided username and password. It\n// additionally supports users who have two-factor authentication enabled on\n// their GitHub account.\ntype BasicAuthTransport struct {\n\tUsername string // GitHub username\n\tPassword string // GitHub password\n\tOTP      string // one-time password for users with two-factor auth enabled\n\n\t// Transport is the underlying HTTP transport to use when making requests.\n\t// It will default to http.DefaultTransport if nil.\n\tTransport http.RoundTripper\n}\n\n// RoundTrip implements the RoundTripper interface.\nfunc (t *BasicAuthTransport) RoundTrip(req *http.Request) (*http.Response, error) {\n\treq2 := setCredentialsAsHeaders(req, t.Username, t.Password)\n\tif t.OTP != \"\" {\n\t\treq2.Header.Set(headerOTP, t.OTP)\n\t}\n\treturn t.transport().RoundTrip(req2)\n}\n\n// Client returns an *http.Client that makes requests that are authenticated\n// using HTTP Basic Authentication.\nfunc (t *BasicAuthTransport) Client() *http.Client {\n\treturn &http.Client{Transport: t}\n}\n\nfunc (t *BasicAuthTransport) transport() http.RoundTripper {\n\tif t.Transport != nil {\n\t\treturn t.Transport\n\t}\n\treturn http.DefaultTransport\n}\n\n// formatRateReset formats d to look like \"[rate reset in 2s]\" or\n// \"[rate reset in 87m02s]\" for the positive durations. And like \"[rate limit was reset 87m02s ago]\"\n// for the negative cases.\nfunc formatRateReset(d time.Duration) string {\n\tisNegative := d < 0\n\tif isNegative {\n\t\td *= -1\n\t}\n\tsecondsTotal := int(0.5 + d.Seconds())\n\tminutes := secondsTotal / 60\n\tseconds := secondsTotal - minutes*60\n\n\tvar timeString string\n\tif minutes > 0 {\n\t\ttimeString = fmt.Sprintf(\"%vm%02ds\", minutes, seconds)\n\t} else {\n\t\ttimeString = fmt.Sprintf(\"%vs\", seconds)\n\t}\n\n\tif isNegative {\n\t\treturn fmt.Sprintf(\"[rate limit was reset %v ago]\", timeString)\n\t}\n\treturn fmt.Sprintf(\"[rate reset in %v]\", timeString)\n}\n\nfunc sleepUntilResetWithBuffer(ctx context.Context, reset time.Time) error {\n\tbuffer := time.Second\n\ttimer := time.NewTimer(time.Until(reset) + buffer)\n\tselect {\n\tcase <-ctx.Done():\n\t\tif !timer.Stop() {\n\t\t\t<-timer.C\n\t\t}\n\t\treturn ctx.Err()\n\tcase <-timer.C:\n\t}\n\treturn nil\n}\n\n// When using roundTripWithOptionalFollowRedirect, note that it\n// is the responsibility of the caller to close the response body.\nfunc (c *Client) roundTripWithOptionalFollowRedirect(ctx context.Context, u string, maxRedirects int, opts ...RequestOption) (*http.Response, error) {\n\treq, err := c.NewRequest(\"GET\", u, nil, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar resp *http.Response\n\t// Use http.DefaultTransport if no custom Transport is configured\n\treq = withContext(ctx, req)\n\tif c.client.Transport == nil {\n\t\tresp, err = http.DefaultTransport.RoundTrip(req)\n\t} else {\n\t\tresp, err = c.client.Transport.RoundTrip(req)\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// If redirect response is returned, follow it\n\tif maxRedirects > 0 && resp.StatusCode == http.StatusMovedPermanently {\n\t\t_ = resp.Body.Close()\n\t\tu = resp.Header.Get(\"Location\")\n\t\tresp, err = c.roundTripWithOptionalFollowRedirect(ctx, u, maxRedirects-1, opts...)\n\t}\n\treturn resp, err\n}\n\n// Ptr is a helper routine that allocates a new T value\n// to store v and returns a pointer to it.\nfunc Ptr[T any](v T) *T {\n\treturn &v\n}\n\n// Bool is a helper routine that allocates a new bool value\n// to store v and returns a pointer to it.\n//\n// Deprecated: use Ptr instead.\n//\n//go:fix inline\nfunc Bool(v bool) *bool { return Ptr(v) }\n\n// Int is a helper routine that allocates a new int value\n// to store v and returns a pointer to it.\n//\n// Deprecated: use Ptr instead.\n//\n//go:fix inline\nfunc Int(v int) *int { return Ptr(v) }\n\n// Int64 is a helper routine that allocates a new int64 value\n// to store v and returns a pointer to it.\n//\n// Deprecated: use Ptr instead.\n//\n//go:fix inline\nfunc Int64(v int64) *int64 { return Ptr(v) }\n\n// String is a helper routine that allocates a new string value\n// to store v and returns a pointer to it.\n//\n// Deprecated: use Ptr instead.\n//\n//go:fix inline\nfunc String(v string) *string { return Ptr(v) }\n\n// roundTripperFunc creates a RoundTripper (transport).\ntype roundTripperFunc func(*http.Request) (*http.Response, error)\n\nfunc (fn roundTripperFunc) RoundTrip(r *http.Request) (*http.Response, error) {\n\treturn fn(r)\n}\n\nvar runIDFromURLRE = regexp.MustCompile(`repos/.*/actions/runs/(\\d+)/deployment_protection_rule$`)\n\n// GetRunID is a Helper Function used to extract the workflow RunID from the *DeploymentProtectionRuleEvent.DeploymentCallBackURL.\nfunc (e *DeploymentProtectionRuleEvent) GetRunID() (int64, error) {\n\tmatch := runIDFromURLRE.FindStringSubmatch(*e.DeploymentCallbackURL)\n\tif len(match) != 2 {\n\t\treturn -1, errors.New(\"no match\")\n\t}\n\trunID, err := strconv.ParseInt(match[1], 10, 64)\n\tif err != nil {\n\t\treturn -1, err\n\t}\n\treturn runID, nil\n}\n"
  },
  {
    "path": "github/github_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"net/url\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"strings\"\n\t\"testing\"\n\t\"testing/synctest\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nconst (\n\t// baseURLPath is a non-empty Client.BaseURL path to use during tests,\n\t// to ensure relative URLs are used for all endpoints. See issue #752.\n\tbaseURLPath = \"/api-v3\"\n)\n\n// raceSafeTestConn wraps a net.Conn to hide concrete connection types such as *net.TCPConn.\n//\n// Go's HTTP transport may enable OS-level sendfile optimizations when it sees a concrete\n// TCP connection and an *os.File request body. Under the race detector on Windows, that\n// specific optimized path can trigger a known data race in internal polling structures.\n// Returning this wrapper from DialContext keeps behavior identical for tests while forcing\n// the transport onto the generic copy path, which is stable under -race.\ntype raceSafeTestConn struct {\n\tnet.Conn\n}\n\n// setup sets up a test HTTP server along with a github.Client that is\n// configured to talk to that test server. Tests should register handlers on\n// mux which provide mock responses for the API method being tested.\nfunc setup(t *testing.T) (client *Client, mux *http.ServeMux, serverURL string) {\n\tt.Helper()\n\t// mux is the HTTP request multiplexer used with the test server.\n\tmux = http.NewServeMux()\n\n\t// We want to ensure that tests catch mistakes where the endpoint URL is\n\t// specified as absolute rather than relative. It only makes a difference\n\t// when there's a non-empty base URL path. So, use that. See issue #752.\n\tapiHandler := http.NewServeMux()\n\tapiHandler.Handle(baseURLPath+\"/\", http.StripPrefix(baseURLPath, mux))\n\tapiHandler.HandleFunc(\"/\", func(w http.ResponseWriter, req *http.Request) {\n\t\tfmt.Fprintln(os.Stderr, \"FAIL: Client.BaseURL path prefix is not preserved in the request URL:\")\n\t\tfmt.Fprintln(os.Stderr)\n\t\tfmt.Fprintln(os.Stderr, \"\\t\"+req.URL.String())\n\t\tfmt.Fprintln(os.Stderr)\n\t\tfmt.Fprintln(os.Stderr, \"\\tDid you accidentally use an absolute endpoint URL rather than relative?\")\n\t\tfmt.Fprintln(os.Stderr, \"\\tSee https://github.com/google/go-github/issues/752 for information.\")\n\t\thttp.Error(w, \"Client.BaseURL path prefix is not preserved in the request URL.\", http.StatusInternalServerError)\n\t})\n\n\t// server is a test HTTP server used to provide mock API responses.\n\tserver := httptest.NewServer(apiHandler)\n\n\ttestDialer := &net.Dialer{Timeout: 30 * time.Second}\n\n\t// Create a custom transport with isolated connection pool\n\ttransport := &http.Transport{\n\t\t// Wrap dialed connections so transport does not take concrete-TCP sendfile fast paths\n\t\t// that can race under Windows + -race in upload tests.\n\t\tDialContext: func(ctx context.Context, network, addr string) (net.Conn, error) {\n\t\t\tconn, err := testDialer.DialContext(ctx, network, addr)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn &raceSafeTestConn{Conn: conn}, nil\n\t\t},\n\t\t// Controls connection reuse - false allows reuse, true forces new connections for each request\n\t\tDisableKeepAlives: false,\n\t\t// Maximum concurrent connections per host (active + idle)\n\t\tMaxConnsPerHost: 10,\n\t\t// Maximum idle connections maintained per host for reuse\n\t\tMaxIdleConnsPerHost: 5,\n\t\t// Maximum total idle connections across all hosts\n\t\tMaxIdleConns: 20,\n\t\t// How long an idle connection remains in the pool before being closed\n\t\tIdleConnTimeout: 20 * time.Second,\n\t}\n\n\t// Create HTTP client with the isolated transport\n\thttpClient := &http.Client{\n\t\tTransport: transport,\n\t\tTimeout:   30 * time.Second,\n\t}\n\t// client is the GitHub client being tested and is\n\t// configured to use test server.\n\tclient = NewClient(httpClient)\n\n\turl, _ := url.Parse(server.URL + baseURLPath + \"/\")\n\tclient.BaseURL = url\n\tclient.UploadURL = url\n\n\tt.Cleanup(server.Close)\n\n\treturn client, mux, server.URL\n}\n\n// openTestFile creates a new file with the given name and content for testing.\n// In order to ensure the exact file name, this function will create a new temp\n// directory, and create the file in that directory. The file is automatically\n// cleaned up after the test.\nfunc openTestFile(t *testing.T, name, content string) *os.File {\n\tt.Helper()\n\tfname := filepath.Join(t.TempDir(), name)\n\terr := os.WriteFile(fname, []byte(content), 0o600)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfile, err := os.Open(fname)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tt.Cleanup(func() { file.Close() })\n\n\treturn file\n}\n\nfunc testMethod(t *testing.T, r *http.Request, want string) {\n\tt.Helper()\n\tif got := r.Method; got != want {\n\t\tt.Errorf(\"Request method: %v, want %v\", got, want)\n\t}\n}\n\ntype values map[string]string\n\n// testFormValues checks that the request form values match the expected values.\n// It expects exactly one value per key.\nfunc testFormValues(t *testing.T, r *http.Request, want values) {\n\tt.Helper()\n\n\twantValues := url.Values{}\n\tfor k, v := range want {\n\t\twantValues.Add(k, v)\n\t}\n\n\tassertNilError(t, r.ParseForm())\n\tif got := r.Form; !cmp.Equal(got, wantValues) {\n\t\tt.Errorf(\"Request query parameters: %v, want %v\", got, wantValues)\n\t}\n}\n\n// testFormValuesList checks that the request form values match the expected values.\n// It allows for multiple values per key.\nfunc testFormValuesList(t *testing.T, r *http.Request, want url.Values) {\n\tt.Helper()\n\n\tassertNilError(t, r.ParseForm())\n\tif got := r.Form; !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Request query parameters: %v, want %v\", got, want)\n\t}\n}\n\nfunc testHeader(t *testing.T, r *http.Request, header, want string) {\n\tt.Helper()\n\tif got := r.Header.Get(header); got != want {\n\t\tt.Errorf(\"Header.Get(%q) returned %q, want %q\", header, got, want)\n\t}\n}\n\nfunc testURLParseError(t *testing.T, err error) {\n\tt.Helper()\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned\")\n\t}\n\tvar uerr *url.Error\n\tif !errors.As(err, &uerr) || uerr.Op != \"parse\" {\n\t\tt.Errorf(\"Expected URL parse error, got %+v\", err)\n\t}\n}\n\nfunc testBody(t *testing.T, r *http.Request, want string) {\n\tt.Helper()\n\tb, err := io.ReadAll(r.Body)\n\tif err != nil {\n\t\tt.Errorf(\"Error reading request body: %v\", err)\n\t}\n\tif got := string(b); got != want {\n\t\tt.Errorf(\"request Body is %v, want %v\", got, want)\n\t}\n}\n\n// testJSONMarshal tests both JSON marshaling and unmarshaling of a value by comparing\n// the marshaled output with the expected JSON string.\n//\n// This is the recommended function for most use cases.\n// It performs a round-trip test that ensures both marshaling (Go value to JSON)\n// and unmarshaling (JSON to Go value) work correctly and produce semantically equivalent results.\nfunc testJSONMarshal[T any](t *testing.T, v T, want string, opts ...cmp.Option) {\n\tt.Helper()\n\n\ttestJSONMarshalOnly(t, v, want)\n\ttestJSONUnmarshalOnly(t, v, want, opts...)\n}\n\n// testJSONMarshalOnly tests JSON marshaling by comparing the marshaled output with the expected JSON string.\n//\n// This function compares JSON by unmarshaling both values into any and using cmp.Diff.\n// This means the comparison ignores:\n//   - White space differences\n//   - Key ordering in objects\n//   - Numeric type differences (e.g., int vs float with same value)\n//\n// In most cases, use testJSONMarshal instead.\n// Only use this function in rare cases where you need to test marshaling behavior in isolation.\nfunc testJSONMarshalOnly[T any](t *testing.T, v T, want string) {\n\tt.Helper()\n\n\tgot, err := json.Marshal(v)\n\tif err != nil {\n\t\tt.Fatalf(\"Unable to marshal got JSON for %#v: %v\", v, err)\n\t}\n\n\t// Unmarshal both the marshaled output and expected JSON into any\n\t// to enable semantic comparison that ignores formatting differences\n\tvar gotAny any\n\tif err := json.Unmarshal(got, &gotAny); err != nil {\n\t\tt.Fatalf(\"Unable to unmarshal got JSON %v: %v\", got, err)\n\t}\n\n\tvar wantAny any\n\tif err := json.Unmarshal([]byte(want), &wantAny); err != nil {\n\t\tt.Fatalf(\"Unable to unmarshal want JSON %v: %v\", want, err)\n\t}\n\n\t// Compare the semantic content\n\tif diff := cmp.Diff(wantAny, gotAny); diff != \"\" {\n\t\tt.Errorf(\"json.Marshal returned:\\n%v\\nwant:\\n%v\\ndiff:\\n%v\", got, want, diff)\n\t}\n}\n\n// testJSONUnmarshalOnly tests JSON unmarshaling by parsing the JSON string\n// and comparing the result with the expected value.\n//\n// In most cases, use testJSONMarshal instead.\n// Only use this function in rare cases where you need to test unmarshaling behavior in isolation.\nfunc testJSONUnmarshalOnly[T any](t *testing.T, want T, v string, opts ...cmp.Option) {\n\tt.Helper()\n\n\tvar got T\n\tif err := json.Unmarshal([]byte(v), &got); err != nil {\n\t\tt.Fatalf(\"Unable to unmarshal JSON %v: %v\", v, err)\n\t}\n\n\tif diff := cmp.Diff(want, got, opts...); diff != \"\" {\n\t\tt.Errorf(\"json.Unmarshal returned:\\n%#v\\nwant:\\n%#v\\ndiff:\\n%v\", got, want, diff)\n\t}\n}\n\n// cmpJSONRawMessageComparator returns an option for use in testJSONUnmarshalData that compares\n// json.RawMessage values by their semantic JSON content rather than byte-for-byte equality.\nfunc cmpJSONRawMessageComparator() cmp.Option {\n\treturn cmp.Comparer(func(x, y json.RawMessage) bool {\n\t\tif len(x) == 0 && len(y) == 0 {\n\t\t\treturn true\n\t\t}\n\t\tvar xVal, yVal any\n\t\tif err := json.Unmarshal(x, &xVal); err != nil {\n\t\t\treturn false\n\t\t}\n\t\tif err := json.Unmarshal(y, &yVal); err != nil {\n\t\t\treturn false\n\t\t}\n\t\treturn cmp.Equal(xVal, yVal)\n\t})\n}\n\n// cmpIgnoreFieldOption returns an option for use in testJSONUnmarshalData that ignores a specific\n// field by name, but only when it's a top-level field (not nested within other structs).\n// This prevents accidentally ignoring nested struct fields with the same name.\nfunc cmpIgnoreFieldOption(fieldName string) cmp.Option {\n\treturn cmp.FilterPath(func(p cmp.Path) bool {\n\t\tif len(p) == 0 {\n\t\t\treturn false\n\t\t}\n\t\tsf, ok := p[len(p)-1].(cmp.StructField)\n\t\tif !ok || sf.Name() != fieldName {\n\t\t\treturn false\n\t\t}\n\t\t// Only ignore top-level fields (path contains exactly one StructField)\n\t\tstructFieldCount := 0\n\t\tfor i := range p {\n\t\t\tif _, ok := p[i].(cmp.StructField); ok {\n\t\t\t\tstructFieldCount++\n\t\t\t}\n\t\t}\n\t\treturn structFieldCount == 1\n\t}, cmp.Ignore())\n}\n\n// Test how bad options are handled. Method f under test should\n// return an error.\nfunc testBadOptions(t *testing.T, methodName string, f func() error) {\n\tt.Helper()\n\tif methodName == \"\" {\n\t\tt.Error(\"testBadOptions: must supply method methodName\")\n\t}\n\tif err := f(); err == nil {\n\t\tt.Errorf(\"bad options %v err = nil, want error\", methodName)\n\t}\n}\n\n// Test function under NewRequest failure and then s.client.Do failure.\n// Method f should be a regular call that would normally succeed, but\n// should return an error when NewRequest or s.client.Do fails.\nfunc testNewRequestAndDoFailure(t *testing.T, methodName string, client *Client, f func() (*Response, error)) {\n\ttestNewRequestAndDoFailureCategory(t, methodName, client, CoreCategory, f)\n}\n\n// testNewRequestAndDoFailureCategory works Like testNewRequestAndDoFailure, but allows setting the category.\nfunc testNewRequestAndDoFailureCategory(t *testing.T, methodName string, client *Client, category RateLimitCategory, f func() (*Response, error)) {\n\tt.Helper()\n\tif methodName == \"\" {\n\t\tt.Error(\"testNewRequestAndDoFailure: must supply method methodName\")\n\t}\n\n\tclient.BaseURL.Path = \"\"\n\tresp, err := f()\n\tif resp != nil {\n\t\tt.Errorf(\"client.BaseURL.Path='' %v resp = %#v, want nil\", methodName, resp)\n\t}\n\tif err == nil {\n\t\tt.Errorf(\"client.BaseURL.Path='' %v err = nil, want error\", methodName)\n\t}\n\n\tclient.BaseURL.Path = \"/api-v3/\"\n\tclient.rateLimits[category].Reset.Time = time.Now().Add(10 * time.Minute)\n\tresp, err = f()\n\tif client.DisableRateLimitCheck {\n\t\treturn\n\t}\n\tif bypass := resp.Request.Context().Value(BypassRateLimitCheck); bypass != nil {\n\t\treturn\n\t}\n\tif want := http.StatusForbidden; resp == nil || resp.Response.StatusCode != want {\n\t\tif resp != nil {\n\t\t\tt.Errorf(\"rate.Reset.Time > now %v resp = %#v, want StatusCode=%v\", methodName, resp.Response, want)\n\t\t} else {\n\t\t\tt.Errorf(\"rate.Reset.Time > now %v resp = nil, want StatusCode=%v\", methodName, want)\n\t\t}\n\t}\n\tif err == nil {\n\t\tt.Errorf(\"rate.Reset.Time > now %v err = nil, want error\", methodName)\n\t}\n}\n\n// Test that all error response types contain the status code.\nfunc testErrorResponseForStatusCode(t *testing.T, code int) {\n\tt.Helper()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/hooks\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(code)\n\t})\n\n\t_, _, err := client.Repositories.ListHooks(t.Context(), \"o\", \"r\", nil)\n\n\tvar abuseErr *AbuseRateLimitError\n\tswitch {\n\tcase errors.As(err, new(*ErrorResponse)):\n\tcase errors.As(err, new(*RateLimitError)):\n\tcase errors.As(err, &abuseErr):\n\t\tif code != abuseErr.Response.StatusCode {\n\t\t\tt.Error(\"Error response does not contain status code\")\n\t\t}\n\tdefault:\n\t\tt.Error(\"Unknown error response type\")\n\t}\n}\n\nfunc assertNoDiff(t *testing.T, want, got any) {\n\tt.Helper()\n\tif diff := cmp.Diff(want, got); diff != \"\" {\n\t\tt.Errorf(\"diff mismatch (-want +got):\\n%v\", diff)\n\t}\n}\n\nfunc assertNilError(t *testing.T, err error) {\n\tt.Helper()\n\tif err != nil {\n\t\tt.Errorf(\"unexpected error: %v\", err)\n\t}\n}\n\nfunc assertWrite(t *testing.T, w io.Writer, data []byte) {\n\tt.Helper()\n\t_, err := w.Write(data)\n\tassertNilError(t, err)\n}\n\nfunc TestNewClient(t *testing.T) {\n\tt.Parallel()\n\tc := NewClient(nil)\n\n\tif got, want := c.BaseURL.String(), defaultBaseURL; got != want {\n\t\tt.Errorf(\"NewClient BaseURL is %v, want %v\", got, want)\n\t}\n\tif got, want := c.UserAgent, defaultUserAgent; got != want {\n\t\tt.Errorf(\"NewClient UserAgent is %v, want %v\", got, want)\n\t}\n\n\tc2 := NewClient(nil)\n\tif c.client == c2.client {\n\t\tt.Error(\"NewClient returned same http.Clients, but they should differ\")\n\t}\n}\n\nfunc TestNewClientWithEnvProxy(t *testing.T) {\n\tt.Parallel()\n\tclient := NewClientWithEnvProxy()\n\tif got, want := client.BaseURL.String(), defaultBaseURL; got != want {\n\t\tt.Errorf(\"NewClient BaseURL is %v, want %v\", got, want)\n\t}\n}\n\nfunc TestClient(t *testing.T) {\n\tt.Parallel()\n\tc := NewClient(nil)\n\tc2 := c.Client()\n\tif c.client == c2 {\n\t\tt.Error(\"Client returned same http.Client, but should be different\")\n\t}\n}\n\nfunc TestWithAuthToken(t *testing.T) {\n\tt.Parallel()\n\ttoken := \"gh_test_token\"\n\n\tvalidate := func(t *testing.T, c *http.Client, token string) {\n\t\tt.Helper()\n\t\twant := token\n\t\tif want != \"\" {\n\t\t\twant = \"Bearer \" + want\n\t\t}\n\t\tgotReq := false\n\t\theaderVal := \"\"\n\t\tsrv := httptest.NewServer(http.HandlerFunc(func(_ http.ResponseWriter, r *http.Request) {\n\t\t\tgotReq = true\n\t\t\theaderVal = r.Header.Get(\"Authorization\")\n\t\t}))\n\t\t_, err := c.Get(srv.URL)\n\t\tassertNilError(t, err)\n\t\tif !gotReq {\n\t\t\tt.Error(\"request not sent\")\n\t\t}\n\t\tif headerVal != want {\n\t\t\tt.Errorf(\"Authorization header is %v, want %v\", headerVal, want)\n\t\t}\n\t}\n\n\tt.Run(\"zero-value Client\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tc := new(Client).WithAuthToken(token)\n\t\tvalidate(t, c.Client(), token)\n\t})\n\n\tt.Run(\"NewClient\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\thttpClient := &http.Client{}\n\t\tclient := NewClient(httpClient).WithAuthToken(token)\n\t\tvalidate(t, client.Client(), token)\n\t\t// make sure the original client isn't setting auth headers now\n\t\tvalidate(t, httpClient, \"\")\n\t})\n\n\tt.Run(\"NewTokenClient\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tvalidate(t, NewTokenClient(t.Context(), token).Client(), token)\n\t})\n\n\tt.Run(\"do not set Authorization when empty token\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tc := new(Client).WithAuthToken(\"\")\n\n\t\tgotReq := false\n\t\tifAuthorizationSet := false\n\t\tsrv := httptest.NewServer(http.HandlerFunc(func(_ http.ResponseWriter, r *http.Request) {\n\t\t\tgotReq = true\n\t\t\t_, ifAuthorizationSet = r.Header[\"Authorization\"]\n\t\t}))\n\t\t_, err := c.client.Get(srv.URL)\n\t\tassertNilError(t, err)\n\t\tif !gotReq {\n\t\t\tt.Error(\"request not sent\")\n\t\t}\n\t\tif ifAuthorizationSet {\n\t\t\tt.Error(\"The header 'Authorization' must not be set\")\n\t\t}\n\t})\n}\n\nfunc TestWithEnterpriseURLs(t *testing.T) {\n\tt.Parallel()\n\tfor _, test := range []struct {\n\t\tname          string\n\t\tbaseURL       string\n\t\twantBaseURL   string\n\t\tuploadURL     string\n\t\twantUploadURL string\n\t\twantErr       string\n\t}{\n\t\t{\n\t\t\tname:          \"does not modify properly formed URLs\",\n\t\t\tbaseURL:       \"https://custom-url/api/v3/\",\n\t\t\twantBaseURL:   \"https://custom-url/api/v3/\",\n\t\t\tuploadURL:     \"https://custom-upload-url/api/uploads/\",\n\t\t\twantUploadURL: \"https://custom-upload-url/api/uploads/\",\n\t\t},\n\t\t{\n\t\t\tname:          \"adds trailing slash\",\n\t\t\tbaseURL:       \"https://custom-url/api/v3\",\n\t\t\twantBaseURL:   \"https://custom-url/api/v3/\",\n\t\t\tuploadURL:     \"https://custom-upload-url/api/uploads\",\n\t\t\twantUploadURL: \"https://custom-upload-url/api/uploads/\",\n\t\t},\n\t\t{\n\t\t\tname:          \"adds enterprise suffix\",\n\t\t\tbaseURL:       \"https://custom-url/\",\n\t\t\twantBaseURL:   \"https://custom-url/api/v3/\",\n\t\t\tuploadURL:     \"https://custom-upload-url/\",\n\t\t\twantUploadURL: \"https://custom-upload-url/api/uploads/\",\n\t\t},\n\t\t{\n\t\t\tname:          \"adds enterprise suffix and trailing slash\",\n\t\t\tbaseURL:       \"https://custom-url\",\n\t\t\twantBaseURL:   \"https://custom-url/api/v3/\",\n\t\t\tuploadURL:     \"https://custom-upload-url\",\n\t\t\twantUploadURL: \"https://custom-upload-url/api/uploads/\",\n\t\t},\n\t\t{\n\t\t\tname:      \"bad base URL\",\n\t\t\tbaseURL:   \"bogus\\nbase\\nURL\",\n\t\t\tuploadURL: \"https://custom-upload-url/api/uploads/\",\n\t\t\twantErr:   `invalid control character in URL`,\n\t\t},\n\t\t{\n\t\t\tname:      \"bad upload URL\",\n\t\t\tbaseURL:   \"https://custom-url/api/v3/\",\n\t\t\tuploadURL: \"bogus\\nupload\\nURL\",\n\t\t\twantErr:   `invalid control character in URL`,\n\t\t},\n\t\t{\n\t\t\tname:          \"URL has existing API prefix, adds trailing slash\",\n\t\t\tbaseURL:       \"https://api.custom-url\",\n\t\t\twantBaseURL:   \"https://api.custom-url/\",\n\t\t\tuploadURL:     \"https://api.custom-upload-url\",\n\t\t\twantUploadURL: \"https://api.custom-upload-url/\",\n\t\t},\n\t\t{\n\t\t\tname:          \"URL has existing API prefix and trailing slash\",\n\t\t\tbaseURL:       \"https://api.custom-url/\",\n\t\t\twantBaseURL:   \"https://api.custom-url/\",\n\t\t\tuploadURL:     \"https://api.custom-upload-url/\",\n\t\t\twantUploadURL: \"https://api.custom-upload-url/\",\n\t\t},\n\t\t{\n\t\t\tname:          \"URL has API subdomain, adds trailing slash\",\n\t\t\tbaseURL:       \"https://catalog.api.custom-url\",\n\t\t\twantBaseURL:   \"https://catalog.api.custom-url/\",\n\t\t\tuploadURL:     \"https://catalog.api.custom-upload-url\",\n\t\t\twantUploadURL: \"https://catalog.api.custom-upload-url/\",\n\t\t},\n\t\t{\n\t\t\tname:          \"URL has API subdomain and trailing slash\",\n\t\t\tbaseURL:       \"https://catalog.api.custom-url/\",\n\t\t\twantBaseURL:   \"https://catalog.api.custom-url/\",\n\t\t\tuploadURL:     \"https://catalog.api.custom-upload-url/\",\n\t\t\twantUploadURL: \"https://catalog.api.custom-upload-url/\",\n\t\t},\n\t\t{\n\t\t\tname:          \"URL is not a proper API subdomain, adds enterprise suffix and slash\",\n\t\t\tbaseURL:       \"https://cloud-api.custom-url\",\n\t\t\twantBaseURL:   \"https://cloud-api.custom-url/api/v3/\",\n\t\t\tuploadURL:     \"https://cloud-api.custom-upload-url\",\n\t\t\twantUploadURL: \"https://cloud-api.custom-upload-url/api/uploads/\",\n\t\t},\n\t\t{\n\t\t\tname:          \"URL is not a proper API subdomain, adds enterprise suffix\",\n\t\t\tbaseURL:       \"https://cloud-api.custom-url/\",\n\t\t\twantBaseURL:   \"https://cloud-api.custom-url/api/v3/\",\n\t\t\tuploadURL:     \"https://cloud-api.custom-upload-url/\",\n\t\t\twantUploadURL: \"https://cloud-api.custom-upload-url/api/uploads/\",\n\t\t},\n\t\t{\n\t\t\tname:          \"URL has uploads subdomain, does not modify\",\n\t\t\tbaseURL:       \"https://api.custom-url/\",\n\t\t\twantBaseURL:   \"https://api.custom-url/\",\n\t\t\tuploadURL:     \"https://uploads.custom-upload-url/\",\n\t\t\twantUploadURL: \"https://uploads.custom-upload-url/\",\n\t\t},\n\t} {\n\t\tt.Run(test.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tvalidate := func(c *Client, err error) {\n\t\t\t\tt.Helper()\n\t\t\t\tif test.wantErr != \"\" {\n\t\t\t\t\tif err == nil || !strings.Contains(err.Error(), test.wantErr) {\n\t\t\t\t\t\tt.Fatalf(\"error does not contain expected string %q: %v\", test.wantErr, err)\n\t\t\t\t\t}\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Fatalf(\"got unexpected error: %v\", err)\n\t\t\t\t}\n\t\t\t\tif c.BaseURL.String() != test.wantBaseURL {\n\t\t\t\t\tt.Errorf(\"BaseURL is %v, want %v\", c.BaseURL, test.wantBaseURL)\n\t\t\t\t}\n\t\t\t\tif c.UploadURL.String() != test.wantUploadURL {\n\t\t\t\t\tt.Errorf(\"UploadURL is %v, want %v\", c.UploadURL, test.wantUploadURL)\n\t\t\t\t}\n\t\t\t}\n\t\t\tvalidate(NewClient(nil).WithEnterpriseURLs(test.baseURL, test.uploadURL))\n\t\t\tvalidate(new(Client).WithEnterpriseURLs(test.baseURL, test.uploadURL))\n\t\t\tvalidate(NewEnterpriseClient(test.baseURL, test.uploadURL, nil))\n\t\t})\n\t}\n}\n\n// Ensure that length of Client.rateLimits is the same as number of fields in RateLimits struct.\nfunc TestClient_rateLimits(t *testing.T) {\n\tt.Parallel()\n\tif got, want := len(Client{}.rateLimits), reflect.TypeFor[RateLimits]().NumField(); got != want {\n\t\tt.Errorf(\"len(Client{}.rateLimits) is %v, want %v\", got, want)\n\t}\n}\n\nfunc TestNewRequest(t *testing.T) {\n\tt.Parallel()\n\tc := NewClient(nil)\n\n\tinURL, outURL := \"/foo\", defaultBaseURL+\"foo\"\n\tinBody, outBody := &User{Login: Ptr(\"l\")}, `{\"login\":\"l\"}`+\"\\n\"\n\treq, _ := c.NewRequest(\"GET\", inURL, inBody)\n\n\t// test that relative URL was expanded\n\tif got, want := req.URL.String(), outURL; got != want {\n\t\tt.Errorf(\"NewRequest(%q) URL is %v, want %v\", inURL, got, want)\n\t}\n\n\t// test that body was JSON encoded\n\tbody, _ := io.ReadAll(req.Body)\n\tif got, want := string(body), outBody; got != want {\n\t\tt.Errorf(\"NewRequest(%q) Body is %v, want %v\", inBody, got, want)\n\t}\n\n\tuserAgent := req.Header.Get(\"User-Agent\")\n\n\t// test that default user-agent is attached to the request\n\tif got, want := userAgent, c.UserAgent; got != want {\n\t\tt.Errorf(\"NewRequest() User-Agent is %v, want %v\", got, want)\n\t}\n\n\tif !strings.Contains(userAgent, Version) {\n\t\tt.Errorf(\"NewRequest() User-Agent should contain %v, found %v\", Version, userAgent)\n\t}\n\n\tapiVersion := req.Header.Get(headerAPIVersion)\n\tif got, want := apiVersion, defaultAPIVersion; got != want {\n\t\tt.Errorf(\"NewRequest() %v header is %v, want %v\", headerAPIVersion, got, want)\n\t}\n\n\treq, _ = c.NewRequest(\"GET\", inURL, inBody, WithVersion(\"2022-11-29\"))\n\tapiVersion = req.Header.Get(headerAPIVersion)\n\tif got, want := apiVersion, \"2022-11-29\"; got != want {\n\t\tt.Errorf(\"NewRequest() %v header is %v, want %v\", headerAPIVersion, got, want)\n\t}\n}\n\nfunc TestNewRequest_invalidJSON(t *testing.T) {\n\tt.Parallel()\n\tc := NewClient(nil)\n\n\ttype T struct {\n\t\tF func()\n\t}\n\t_, err := c.NewRequest(\"GET\", \".\", &T{})\n\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned.\")\n\t}\n}\n\nfunc TestNewRequest_badURL(t *testing.T) {\n\tt.Parallel()\n\tc := NewClient(nil)\n\t_, err := c.NewRequest(\"GET\", \":\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestNewRequest_badMethod(t *testing.T) {\n\tt.Parallel()\n\tc := NewClient(nil)\n\tif _, err := c.NewRequest(\"BOGUS\\nMETHOD\", \".\", nil); err == nil {\n\t\tt.Fatal(\"NewRequest returned nil; expected error\")\n\t}\n}\n\n// ensure that no User-Agent header is set if the client's UserAgent is empty.\n// This caused a problem with Google's internal http client.\nfunc TestNewRequest_emptyUserAgent(t *testing.T) {\n\tt.Parallel()\n\tc := NewClient(nil)\n\tc.UserAgent = \"\"\n\treq, err := c.NewRequest(\"GET\", \".\", nil)\n\tif err != nil {\n\t\tt.Fatalf(\"NewRequest returned unexpected error: %v\", err)\n\t}\n\tif _, ok := req.Header[\"User-Agent\"]; ok {\n\t\tt.Fatal(\"constructed request contains unexpected User-Agent header\")\n\t}\n}\n\n// If a nil body is passed to github.NewRequest, make sure that nil is also\n// passed to http.NewRequest. In most cases, passing an io.Reader that returns\n// no content is fine, since there is no difference between an HTTP request\n// body that is an empty string versus one that is not set at all. However in\n// certain cases, intermediate systems may treat these differently resulting in\n// subtle errors.\nfunc TestNewRequest_emptyBody(t *testing.T) {\n\tt.Parallel()\n\tc := NewClient(nil)\n\treq, err := c.NewRequest(\"GET\", \".\", nil)\n\tif err != nil {\n\t\tt.Fatalf(\"NewRequest returned unexpected error: %v\", err)\n\t}\n\tif req.Body != nil {\n\t\tt.Fatal(\"constructed request contains a non-nil Body\")\n\t}\n}\n\nfunc TestNewRequest_errorForNoTrailingSlash(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\trawurl    string\n\t\twantError bool\n\t}{\n\t\t{rawurl: \"https://example.com/api/v3\", wantError: true},\n\t\t{rawurl: \"https://example.com/api/v3/\", wantError: false},\n\t}\n\tc := NewClient(nil)\n\tfor _, test := range tests {\n\t\tu, err := url.Parse(test.rawurl)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"url.Parse returned unexpected error: %v.\", err)\n\t\t}\n\t\tc.BaseURL = u\n\t\tif _, err := c.NewRequest(\"GET\", \"test\", nil); test.wantError && err == nil {\n\t\t\tt.Fatal(\"Expected error to be returned.\")\n\t\t} else if !test.wantError && err != nil {\n\t\t\tt.Fatalf(\"NewRequest returned unexpected error: %v.\", err)\n\t\t}\n\t}\n}\n\nfunc TestNewFormRequest(t *testing.T) {\n\tt.Parallel()\n\tc := NewClient(nil)\n\n\tinURL, outURL := \"/foo\", defaultBaseURL+\"foo\"\n\tform := url.Values{}\n\tform.Add(\"login\", \"l\")\n\tinBody, outBody := strings.NewReader(form.Encode()), \"login=l\"\n\treq, err := c.NewFormRequest(inURL, inBody)\n\tif err != nil {\n\t\tt.Fatalf(\"NewFormRequest returned unexpected error: %v\", err)\n\t}\n\n\t// test that relative URL was expanded\n\tif got, want := req.URL.String(), outURL; got != want {\n\t\tt.Errorf(\"NewFormRequest(%q) URL is %v, want %v\", inURL, got, want)\n\t}\n\n\t// test that body was form encoded\n\tbody, err := io.ReadAll(req.Body)\n\tif err != nil {\n\t\tt.Fatalf(\"Error reading request body: %v\", err)\n\t}\n\tif got, want := string(body), outBody; got != want {\n\t\tt.Errorf(\"NewFormRequest() Body is %v, want %v\", got, want)\n\t}\n\n\t// test that default user-agent is attached to the request\n\tif got, want := req.Header.Get(\"User-Agent\"), c.UserAgent; got != want {\n\t\tt.Errorf(\"NewFormRequest() User-Agent is %v, want %v\", got, want)\n\t}\n\n\tapiVersion := req.Header.Get(headerAPIVersion)\n\tif got, want := apiVersion, defaultAPIVersion; got != want {\n\t\tt.Errorf(\"NewFormRequest() %v header is %v, want %v\", headerAPIVersion, got, want)\n\t}\n\n\treq, err = c.NewFormRequest(inURL, inBody, WithVersion(\"2022-11-29\"))\n\tif err != nil {\n\t\tt.Fatalf(\"NewFormRequest with WithVersion returned unexpected error: %v\", err)\n\t}\n\tapiVersion = req.Header.Get(headerAPIVersion)\n\tif got, want := apiVersion, \"2022-11-29\"; got != want {\n\t\tt.Errorf(\"NewFormRequest() %v header is %v, want %v\", headerAPIVersion, got, want)\n\t}\n}\n\nfunc TestNewFormRequest_badURL(t *testing.T) {\n\tt.Parallel()\n\tc := NewClient(nil)\n\t_, err := c.NewFormRequest(\":\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestNewFormRequest_emptyUserAgent(t *testing.T) {\n\tt.Parallel()\n\tc := NewClient(nil)\n\tc.UserAgent = \"\"\n\treq, err := c.NewFormRequest(\".\", nil)\n\tif err != nil {\n\t\tt.Fatalf(\"NewFormRequest returned unexpected error: %v\", err)\n\t}\n\tif _, ok := req.Header[\"User-Agent\"]; ok {\n\t\tt.Fatal(\"constructed request contains unexpected User-Agent header\")\n\t}\n}\n\nfunc TestNewFormRequest_emptyBody(t *testing.T) {\n\tt.Parallel()\n\tc := NewClient(nil)\n\treq, err := c.NewFormRequest(\".\", nil)\n\tif err != nil {\n\t\tt.Fatalf(\"NewFormRequest returned unexpected error: %v\", err)\n\t}\n\tif req.Body != nil {\n\t\tt.Fatal(\"constructed request contains a non-nil Body\")\n\t}\n}\n\nfunc TestNewFormRequest_errorForNoTrailingSlash(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\trawURL    string\n\t\twantError bool\n\t}{\n\t\t{rawURL: \"https://example.com/api/v3\", wantError: true},\n\t\t{rawURL: \"https://example.com/api/v3/\", wantError: false},\n\t}\n\tc := NewClient(nil)\n\tfor _, test := range tests {\n\t\tu, err := url.Parse(test.rawURL)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"url.Parse returned unexpected error: %v.\", err)\n\t\t}\n\t\tc.BaseURL = u\n\t\tif _, err := c.NewFormRequest(\"test\", nil); test.wantError && err == nil {\n\t\t\tt.Fatal(\"Expected error to be returned.\")\n\t\t} else if !test.wantError && err != nil {\n\t\t\tt.Fatalf(\"NewFormRequest returned unexpected error: %v.\", err)\n\t\t}\n\t}\n}\n\nfunc TestNewUploadRequest_WithVersion(t *testing.T) {\n\tt.Parallel()\n\tc := NewClient(nil)\n\treq, _ := c.NewUploadRequest(\"https://example.com/\", nil, 0, \"\")\n\n\tapiVersion := req.Header.Get(headerAPIVersion)\n\tif got, want := apiVersion, defaultAPIVersion; got != want {\n\t\tt.Errorf(\"NewRequest() %v header is %v, want %v\", headerAPIVersion, got, want)\n\t}\n\n\treq, _ = c.NewUploadRequest(\"https://example.com/\", nil, 0, \"\", WithVersion(\"2022-11-29\"))\n\tapiVersion = req.Header.Get(headerAPIVersion)\n\tif got, want := apiVersion, \"2022-11-29\"; got != want {\n\t\tt.Errorf(\"NewRequest() %v header is %v, want %v\", headerAPIVersion, got, want)\n\t}\n}\n\nfunc TestNewUploadRequest_badURL(t *testing.T) {\n\tt.Parallel()\n\tc := NewClient(nil)\n\t_, err := c.NewUploadRequest(\":\", nil, 0, \"\")\n\ttestURLParseError(t, err)\n\n\tconst methodName = \"NewUploadRequest\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = c.NewUploadRequest(\"\\n\", nil, -1, \"\\n\")\n\t\treturn err\n\t})\n}\n\nfunc TestNewUploadRequest_errorForNoTrailingSlash(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\trawurl    string\n\t\twantError bool\n\t}{\n\t\t{rawurl: \"https://example.com/api/uploads\", wantError: true},\n\t\t{rawurl: \"https://example.com/api/uploads/\", wantError: false},\n\t}\n\tc := NewClient(nil)\n\tfor _, test := range tests {\n\t\tu, err := url.Parse(test.rawurl)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"url.Parse returned unexpected error: %v.\", err)\n\t\t}\n\t\tc.UploadURL = u\n\t\tif _, err = c.NewUploadRequest(\"test\", nil, 0, \"\"); test.wantError && err == nil {\n\t\t\tt.Fatal(\"Expected error to be returned.\")\n\t\t} else if !test.wantError && err != nil {\n\t\t\tt.Fatalf(\"NewUploadRequest returned unexpected error: %v.\", err)\n\t\t}\n\t}\n}\n\nfunc TestResponse_populatePageValues(t *testing.T) {\n\tt.Parallel()\n\tr := http.Response{\n\t\tHeader: http.Header{\n\t\t\t\"Link\": {\n\t\t\t\t`<https://api.github.com/?page=1>; rel=\"first\",` +\n\t\t\t\t\t` <https://api.github.com/?page=2>; rel=\"prev\",` +\n\t\t\t\t\t` <https://api.github.com/?page=4>; rel=\"next\",` +\n\t\t\t\t\t` <https://api.github.com/?page=5>; rel=\"last\"`,\n\t\t\t},\n\t\t},\n\t}\n\n\tresponse := newResponse(&r)\n\tif got, want := response.FirstPage, 1; got != want {\n\t\tt.Errorf(\"response.FirstPage: %v, want %v\", got, want)\n\t}\n\tif got, want := response.PrevPage, 2; want != got {\n\t\tt.Errorf(\"response.PrevPage: %v, want %v\", got, want)\n\t}\n\tif got, want := response.NextPage, 4; want != got {\n\t\tt.Errorf(\"response.NextPage: %v, want %v\", got, want)\n\t}\n\tif got, want := response.LastPage, 5; want != got {\n\t\tt.Errorf(\"response.LastPage: %v, want %v\", got, want)\n\t}\n\tif got, want := response.NextPageToken, \"\"; want != got {\n\t\tt.Errorf(\"response.NextPageToken: %v, want %v\", got, want)\n\t}\n}\n\nfunc TestResponse_populateSinceValues(t *testing.T) {\n\tt.Parallel()\n\tr := http.Response{\n\t\tHeader: http.Header{\n\t\t\t\"Link\": {\n\t\t\t\t`<https://api.github.com/?since=1>; rel=\"first\",` +\n\t\t\t\t\t` <https://api.github.com/?since=2>; rel=\"prev\",` +\n\t\t\t\t\t` <https://api.github.com/?since=4>; rel=\"next\",` +\n\t\t\t\t\t` <https://api.github.com/?since=5>; rel=\"last\"`,\n\t\t\t},\n\t\t},\n\t}\n\n\tresponse := newResponse(&r)\n\tif got, want := response.FirstPage, 1; got != want {\n\t\tt.Errorf(\"response.FirstPage: %v, want %v\", got, want)\n\t}\n\tif got, want := response.PrevPage, 2; want != got {\n\t\tt.Errorf(\"response.PrevPage: %v, want %v\", got, want)\n\t}\n\tif got, want := response.NextPage, 4; want != got {\n\t\tt.Errorf(\"response.NextPage: %v, want %v\", got, want)\n\t}\n\tif got, want := response.LastPage, 5; want != got {\n\t\tt.Errorf(\"response.LastPage: %v, want %v\", got, want)\n\t}\n\tif got, want := response.NextPageToken, \"\"; want != got {\n\t\tt.Errorf(\"response.NextPageToken: %v, want %v\", got, want)\n\t}\n}\n\nfunc TestResponse_SinceWithPage(t *testing.T) {\n\tt.Parallel()\n\tr := http.Response{\n\t\tHeader: http.Header{\n\t\t\t\"Link\": {\n\t\t\t\t`<https://api.github.com/?since=2021-12-04T10%3A43%3A42Z&page=1>; rel=\"first\",` +\n\t\t\t\t\t` <https://api.github.com/?since=2021-12-04T10%3A43%3A42Z&page=2>; rel=\"prev\",` +\n\t\t\t\t\t` <https://api.github.com/?since=2021-12-04T10%3A43%3A42Z&page=4>; rel=\"next\",` +\n\t\t\t\t\t` <https://api.github.com/?since=2021-12-04T10%3A43%3A42Z&page=5>; rel=\"last\"`,\n\t\t\t},\n\t\t},\n\t}\n\n\tresponse := newResponse(&r)\n\tif got, want := response.FirstPage, 1; got != want {\n\t\tt.Errorf(\"response.FirstPage: %v, want %v\", got, want)\n\t}\n\tif got, want := response.PrevPage, 2; want != got {\n\t\tt.Errorf(\"response.PrevPage: %v, want %v\", got, want)\n\t}\n\tif got, want := response.NextPage, 4; want != got {\n\t\tt.Errorf(\"response.NextPage: %v, want %v\", got, want)\n\t}\n\tif got, want := response.LastPage, 5; want != got {\n\t\tt.Errorf(\"response.LastPage: %v, want %v\", got, want)\n\t}\n\tif got, want := response.NextPageToken, \"\"; want != got {\n\t\tt.Errorf(\"response.NextPageToken: %v, want %v\", got, want)\n\t}\n}\n\nfunc TestResponse_cursorPagination(t *testing.T) {\n\tt.Parallel()\n\tr := http.Response{\n\t\tHeader: http.Header{\n\t\t\t\"Status\": {\"200 OK\"},\n\t\t\t\"Link\":   {`<https://api.github.com/resource?per_page=2&page=url-encoded-next-page-token>; rel=\"next\"`},\n\t\t},\n\t}\n\n\tresponse := newResponse(&r)\n\tif got, want := response.FirstPage, 0; got != want {\n\t\tt.Errorf(\"response.FirstPage: %v, want %v\", got, want)\n\t}\n\tif got, want := response.PrevPage, 0; want != got {\n\t\tt.Errorf(\"response.PrevPage: %v, want %v\", got, want)\n\t}\n\tif got, want := response.NextPage, 0; want != got {\n\t\tt.Errorf(\"response.NextPage: %v, want %v\", got, want)\n\t}\n\tif got, want := response.LastPage, 0; want != got {\n\t\tt.Errorf(\"response.LastPage: %v, want %v\", got, want)\n\t}\n\tif got, want := response.NextPageToken, \"url-encoded-next-page-token\"; want != got {\n\t\tt.Errorf(\"response.NextPageToken: %v, want %v\", got, want)\n\t}\n\n\t// cursor-based pagination with \"cursor\" param\n\tr = http.Response{\n\t\tHeader: http.Header{\n\t\t\t\"Link\": {\n\t\t\t\t`<https://api.github.com/?cursor=v1_12345678>; rel=\"next\"`,\n\t\t\t},\n\t\t},\n\t}\n\n\tresponse = newResponse(&r)\n\tif got, want := response.Cursor, \"v1_12345678\"; got != want {\n\t\tt.Errorf(\"response.Cursor: %v, want %v\", got, want)\n\t}\n}\n\nfunc TestResponse_beforeAfterPagination(t *testing.T) {\n\tt.Parallel()\n\tr := http.Response{\n\t\tHeader: http.Header{\n\t\t\t\"Link\": {\n\t\t\t\t`<https://api.github.com/?after=a1b2c3&before=>; rel=\"next\",` +\n\t\t\t\t\t` <https://api.github.com/?after=&before=>; rel=\"first\",` +\n\t\t\t\t\t` <https://api.github.com/?after=&before=d4e5f6>; rel=\"prev\",`,\n\t\t\t},\n\t\t},\n\t}\n\n\tresponse := newResponse(&r)\n\tif got, want := response.Before, \"d4e5f6\"; got != want {\n\t\tt.Errorf(\"response.Before: %v, want %v\", got, want)\n\t}\n\tif got, want := response.After, \"a1b2c3\"; got != want {\n\t\tt.Errorf(\"response.After: %v, want %v\", got, want)\n\t}\n\tif got, want := response.FirstPage, 0; got != want {\n\t\tt.Errorf(\"response.FirstPage: %v, want %v\", got, want)\n\t}\n\tif got, want := response.PrevPage, 0; want != got {\n\t\tt.Errorf(\"response.PrevPage: %v, want %v\", got, want)\n\t}\n\tif got, want := response.NextPage, 0; want != got {\n\t\tt.Errorf(\"response.NextPage: %v, want %v\", got, want)\n\t}\n\tif got, want := response.LastPage, 0; want != got {\n\t\tt.Errorf(\"response.LastPage: %v, want %v\", got, want)\n\t}\n\tif got, want := response.NextPageToken, \"\"; want != got {\n\t\tt.Errorf(\"response.NextPageToken: %v, want %v\", got, want)\n\t}\n}\n\nfunc TestResponse_populatePageValues_invalid(t *testing.T) {\n\tt.Parallel()\n\tr := http.Response{\n\t\tHeader: http.Header{\n\t\t\t\"Link\": {\n\t\t\t\t`<https://api.github.com/?page=1>,` +\n\t\t\t\t\t`<https://api.github.com/?page=abc>; rel=\"first\",` +\n\t\t\t\t\t`https://api.github.com/?page=2; rel=\"prev\",` +\n\t\t\t\t\t`<https://api.github.com/>; rel=\"next\",` +\n\t\t\t\t\t`<https://api.github.com/?page=>; rel=\"last\"`,\n\t\t\t},\n\t\t},\n\t}\n\n\tresponse := newResponse(&r)\n\tif got, want := response.FirstPage, 0; got != want {\n\t\tt.Errorf(\"response.FirstPage: %v, want %v\", got, want)\n\t}\n\tif got, want := response.PrevPage, 0; got != want {\n\t\tt.Errorf(\"response.PrevPage: %v, want %v\", got, want)\n\t}\n\tif got, want := response.NextPage, 0; got != want {\n\t\tt.Errorf(\"response.NextPage: %v, want %v\", got, want)\n\t}\n\tif got, want := response.LastPage, 0; got != want {\n\t\tt.Errorf(\"response.LastPage: %v, want %v\", got, want)\n\t}\n\n\t// more invalid URLs\n\tr = http.Response{\n\t\tHeader: http.Header{\n\t\t\t\"Link\": {`<https://api.github.com/%?page=2>; rel=\"first\"`},\n\t\t},\n\t}\n\n\tresponse = newResponse(&r)\n\tif got, want := response.FirstPage, 0; got != want {\n\t\tt.Errorf(\"response.FirstPage: %v, want %v\", got, want)\n\t}\n}\n\nfunc TestResponse_populateSinceValues_invalid(t *testing.T) {\n\tt.Parallel()\n\tr := http.Response{\n\t\tHeader: http.Header{\n\t\t\t\"Link\": {\n\t\t\t\t`<https://api.github.com/?since=1>,` +\n\t\t\t\t\t`<https://api.github.com/?since=abc>; rel=\"first\",` +\n\t\t\t\t\t`https://api.github.com/?since=2; rel=\"prev\",` +\n\t\t\t\t\t`<https://api.github.com/>; rel=\"next\",` +\n\t\t\t\t\t`<https://api.github.com/?since=>; rel=\"last\"`,\n\t\t\t},\n\t\t},\n\t}\n\n\tresponse := newResponse(&r)\n\tif got, want := response.FirstPage, 0; got != want {\n\t\tt.Errorf(\"response.FirstPage: %v, want %v\", got, want)\n\t}\n\tif got, want := response.PrevPage, 0; got != want {\n\t\tt.Errorf(\"response.PrevPage: %v, want %v\", got, want)\n\t}\n\tif got, want := response.NextPage, 0; got != want {\n\t\tt.Errorf(\"response.NextPage: %v, want %v\", got, want)\n\t}\n\tif got, want := response.LastPage, 0; got != want {\n\t\tt.Errorf(\"response.LastPage: %v, want %v\", got, want)\n\t}\n\n\t// more invalid URLs\n\tr = http.Response{\n\t\tHeader: http.Header{\n\t\t\t\"Link\": {`<https://api.github.com/%?since=2>; rel=\"first\"`},\n\t\t},\n\t}\n\n\tresponse = newResponse(&r)\n\tif got, want := response.FirstPage, 0; got != want {\n\t\tt.Errorf(\"response.FirstPage: %v, want %v\", got, want)\n\t}\n}\n\nfunc TestDo(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\ttype foo struct {\n\t\tA string\n\t}\n\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"A\":\"a\"}`)\n\t})\n\n\treq, _ := client.NewRequest(\"GET\", \".\", nil)\n\tvar body *foo\n\t_, err := client.Do(t.Context(), req, &body)\n\tassertNilError(t, err)\n\n\twant := &foo{\"a\"}\n\tif !cmp.Equal(body, want) {\n\t\tt.Errorf(\"Response body = %v, want %v\", body, want)\n\t}\n}\n\nfunc TestDo_nilContext(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\treq, _ := client.NewRequest(\"GET\", \".\", nil)\n\t_, err := client.Do(nil, req, nil)\n\n\tif !errors.Is(err, errNonNilContext) {\n\t\tt.Error(\"Expected context must be non-nil error\")\n\t}\n}\n\nfunc TestDo_httpError(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, _ *http.Request) {\n\t\thttp.Error(w, \"Bad Request\", 400)\n\t})\n\n\treq, _ := client.NewRequest(\"GET\", \".\", nil)\n\tresp, err := client.Do(t.Context(), req, nil)\n\n\tif err == nil {\n\t\tt.Fatal(\"Expected HTTP 400 error, got no error.\")\n\t}\n\tif resp.StatusCode != 400 {\n\t\tt.Errorf(\"Expected HTTP 400 error, got %v status code.\", resp.StatusCode)\n\t}\n}\n\n// Test handling of an error caused by the internal http client's Do()\n// function. A redirect loop is pretty unlikely to occur within the GitHub\n// API, but does allow us to exercise the right code path.\nfunc TestDo_redirectLoop(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\thttp.Redirect(w, r, baseURLPath, http.StatusFound)\n\t})\n\n\treq, _ := client.NewRequest(\"GET\", \".\", nil)\n\t_, err := client.Do(t.Context(), req, nil)\n\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned.\")\n\t}\n\tif !errors.As(err, new(*url.Error)) {\n\t\tt.Errorf(\"Expected a URL error; got %#v.\", err)\n\t}\n}\n\nfunc TestDo_preservesResponseInHTTPError(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, _ *http.Request) {\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t\tfmt.Fprint(w, `{\n\t\t\t\"message\": \"Resource not found\",\n\t\t\t\"documentation_url\": \"https://docs.github.com/rest/reference/repos#get-a-repository\"\n\t\t}`)\n\t})\n\n\treq, _ := client.NewRequest(\"GET\", \".\", nil)\n\tvar resp *Response\n\tvar data any\n\tresp, err := client.Do(t.Context(), req, &data)\n\n\tif err == nil {\n\t\tt.Fatal(\"Expected error response\")\n\t}\n\n\t// Verify error type and access to status code\n\tvar errResp *ErrorResponse\n\tif !errors.As(err, &errResp) {\n\t\tt.Fatalf(\"Expected *ErrorResponse error, got %T\", err)\n\t}\n\n\t// Verify status code is accessible from both Response and ErrorResponse\n\tif resp == nil {\n\t\tt.Fatal(\"Expected response to be returned even with error\")\n\t}\n\tif got, want := resp.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Response status = %v, want %v\", got, want)\n\t}\n\tif got, want := errResp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Error response status = %v, want %v\", got, want)\n\t}\n\n\t// Verify error contains proper message\n\tif !strings.Contains(errResp.Message, \"Resource not found\") {\n\t\tt.Errorf(\"Error message = %q, want to contain 'Resource not found'\", errResp.Message)\n\t}\n}\n\n// Test that an error caused by the internal http client's Do() function\n// does not leak the client secret.\nfunc TestDo_sanitizeURL(t *testing.T) {\n\tt.Parallel()\n\ttp := &UnauthenticatedRateLimitedTransport{\n\t\tClientID:     \"id\",\n\t\tClientSecret: \"secret\",\n\t}\n\tunauthedClient := NewClient(tp.Client())\n\tunauthedClient.BaseURL = &url.URL{Scheme: \"http\", Host: \"127.0.0.1:0\", Path: \"/\"} // Use port 0 on purpose to trigger a dial TCP error, expect to get \"dial tcp 127.0.0.1:0: connect: can't assign requested address\".\n\treq, err := unauthedClient.NewRequest(\"GET\", \".\", nil)\n\tif err != nil {\n\t\tt.Fatalf(\"NewRequest returned unexpected error: %v\", err)\n\t}\n\t_, err = unauthedClient.Do(t.Context(), req, nil)\n\tif err == nil {\n\t\tt.Fatal(\"Expected error to be returned.\")\n\t}\n\tif strings.Contains(err.Error(), \"client_secret=secret\") {\n\t\tt.Errorf(\"Do error contains secret, should be redacted:\\n%q\", err)\n\t}\n}\n\nfunc TestDo_rateLimit(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, _ *http.Request) {\n\t\tw.Header().Set(HeaderRateLimit, \"60\")\n\t\tw.Header().Set(HeaderRateRemaining, \"59\")\n\t\tw.Header().Set(HeaderRateUsed, \"1\")\n\t\tw.Header().Set(HeaderRateReset, \"1372700873\")\n\t\tw.Header().Set(HeaderRateResource, \"core\")\n\t})\n\n\treq, _ := client.NewRequest(\"GET\", \".\", nil)\n\tresp, err := client.Do(t.Context(), req, nil)\n\tif err != nil {\n\t\tt.Errorf(\"Do returned unexpected error: %v\", err)\n\t}\n\tif got, want := resp.Rate.Limit, 60; got != want {\n\t\tt.Errorf(\"Client rate limit = %v, want %v\", got, want)\n\t}\n\tif got, want := resp.Rate.Remaining, 59; got != want {\n\t\tt.Errorf(\"Client rate remaining = %v, want %v\", got, want)\n\t}\n\tif got, want := resp.Rate.Used, 1; got != want {\n\t\tt.Errorf(\"Client rate used = %v, want %v\", got, want)\n\t}\n\treset := time.Date(2013, time.July, 1, 17, 47, 53, 0, time.UTC)\n\tif !resp.Rate.Reset.UTC().Equal(reset) {\n\t\tt.Errorf(\"Client rate reset = %v, want %v\", resp.Rate.Reset.UTC(), reset)\n\t}\n\tif got, want := resp.Rate.Resource, \"core\"; got != want {\n\t\tt.Errorf(\"Client rate resource = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestDo_rateLimitCategory(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tmethod   string\n\t\turl      string\n\t\tcategory RateLimitCategory\n\t}{\n\t\t{\n\t\t\tmethod:   \"GET\",\n\t\t\turl:      \"/\",\n\t\t\tcategory: CoreCategory,\n\t\t},\n\t\t{\n\t\t\tmethod:   \"GET\",\n\t\t\turl:      \"/search/issues?q=rate\",\n\t\t\tcategory: SearchCategory,\n\t\t},\n\t\t{\n\t\t\tmethod:   \"GET\",\n\t\t\turl:      \"/graphql\",\n\t\t\tcategory: GraphqlCategory,\n\t\t},\n\t\t{\n\t\t\tmethod:   \"POST\",\n\t\t\turl:      \"/app-manifests/code/conversions\",\n\t\t\tcategory: IntegrationManifestCategory,\n\t\t},\n\t\t{\n\t\t\tmethod:   \"GET\",\n\t\t\turl:      \"/app-manifests/code/conversions\",\n\t\t\tcategory: CoreCategory, // only POST requests are in the integration manifest category\n\t\t},\n\t\t{\n\t\t\tmethod:   \"PUT\",\n\t\t\turl:      \"/repos/google/go-github/import\",\n\t\t\tcategory: SourceImportCategory,\n\t\t},\n\t\t{\n\t\t\tmethod:   \"GET\",\n\t\t\turl:      \"/repos/google/go-github/import\",\n\t\t\tcategory: CoreCategory, // only PUT requests are in the source import category\n\t\t},\n\t\t{\n\t\t\tmethod:   \"POST\",\n\t\t\turl:      \"/repos/google/go-github/code-scanning/sarifs\",\n\t\t\tcategory: CodeScanningUploadCategory,\n\t\t},\n\t\t{\n\t\t\tmethod:   \"GET\",\n\t\t\turl:      \"/scim/v2/organizations/ORG/Users\",\n\t\t\tcategory: ScimCategory,\n\t\t},\n\t\t{\n\t\t\tmethod:   \"POST\",\n\t\t\turl:      \"/repos/google/go-github/dependency-graph/snapshots\",\n\t\t\tcategory: DependencySnapshotsCategory,\n\t\t},\n\t\t{\n\t\t\tmethod:   \"GET\",\n\t\t\turl:      \"/search/code?q=rate\",\n\t\t\tcategory: CodeSearchCategory,\n\t\t},\n\t\t{\n\t\t\tmethod:   \"GET\",\n\t\t\turl:      \"/orgs/google/audit-log\",\n\t\t\tcategory: AuditLogCategory,\n\t\t},\n\t\t{\n\t\t\tmethod:   \"GET\",\n\t\t\turl:      \"/repos/google/go-github/dependency-graph/sbom\",\n\t\t\tcategory: DependencySBOMCategory,\n\t\t},\n\t\t// missing a check for actionsRunnerRegistrationCategory: API not found\n\t}\n\n\tfor _, tt := range tests {\n\t\tif got, want := GetRateLimitCategory(tt.method, tt.url), tt.category; got != want {\n\t\t\tt.Errorf(\"expecting category %v, found %v\", got, want)\n\t\t}\n\t}\n}\n\n// Ensure rate limit is still parsed, even for error responses.\nfunc TestDo_rateLimit_errorResponse(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, _ *http.Request) {\n\t\tw.Header().Set(HeaderRateLimit, \"60\")\n\t\tw.Header().Set(HeaderRateRemaining, \"59\")\n\t\tw.Header().Set(HeaderRateUsed, \"1\")\n\t\tw.Header().Set(HeaderRateReset, \"1372700873\")\n\t\tw.Header().Set(HeaderRateResource, \"core\")\n\t\thttp.Error(w, \"Bad Request\", 400)\n\t})\n\n\treq, _ := client.NewRequest(\"GET\", \".\", nil)\n\tresp, err := client.Do(t.Context(), req, nil)\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned.\")\n\t}\n\tif errors.As(err, new(*RateLimitError)) {\n\t\tt.Errorf(\"Did not expect a *RateLimitError error; got %#v.\", err)\n\t}\n\tif got, want := resp.Rate.Limit, 60; got != want {\n\t\tt.Errorf(\"Client rate limit = %v, want %v\", got, want)\n\t}\n\tif got, want := resp.Rate.Remaining, 59; got != want {\n\t\tt.Errorf(\"Client rate remaining = %v, want %v\", got, want)\n\t}\n\tif got, want := resp.Rate.Used, 1; got != want {\n\t\tt.Errorf(\"Client rate used = %v, want %v\", got, want)\n\t}\n\treset := time.Date(2013, time.July, 1, 17, 47, 53, 0, time.UTC)\n\tif !resp.Rate.Reset.UTC().Equal(reset) {\n\t\tt.Errorf(\"Client rate reset = %v, want %v\", resp.Rate.Reset, reset)\n\t}\n\tif got, want := resp.Rate.Resource, \"core\"; got != want {\n\t\tt.Errorf(\"Client rate resource = %v, want %v\", got, want)\n\t}\n}\n\n// Ensure *RateLimitError is returned when API rate limit is exceeded.\nfunc TestDo_rateLimit_rateLimitError(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, _ *http.Request) {\n\t\tw.Header().Set(HeaderRateLimit, \"60\")\n\t\tw.Header().Set(HeaderRateRemaining, \"0\")\n\t\tw.Header().Set(HeaderRateUsed, \"60\")\n\t\tw.Header().Set(HeaderRateReset, \"1372700873\")\n\t\tw.Header().Set(HeaderRateResource, \"core\")\n\t\tw.Header().Set(\"Content-Type\", \"application/json; charset=utf-8\")\n\t\tw.WriteHeader(http.StatusForbidden)\n\t\tfmt.Fprintln(w, `{\n   \"message\": \"API rate limit exceeded for xxx.xxx.xxx.xxx. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)\",\n   \"documentation_url\": \"https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits\"\n}`)\n\t})\n\n\treq, _ := client.NewRequest(\"GET\", \".\", nil)\n\t_, err := client.Do(t.Context(), req, nil)\n\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned.\")\n\t}\n\tvar rateLimitErr *RateLimitError\n\tif !errors.As(err, &rateLimitErr) {\n\t\tt.Fatalf(\"Expected a *RateLimitError error; got %#v.\", err)\n\t}\n\tif got, want := rateLimitErr.Rate.Limit, 60; got != want {\n\t\tt.Errorf(\"rateLimitErr rate limit = %v, want %v\", got, want)\n\t}\n\tif got, want := rateLimitErr.Rate.Remaining, 0; got != want {\n\t\tt.Errorf(\"rateLimitErr rate remaining = %v, want %v\", got, want)\n\t}\n\tif got, want := rateLimitErr.Rate.Used, 60; got != want {\n\t\tt.Errorf(\"rateLimitErr rate used = %v, want %v\", got, want)\n\t}\n\treset := time.Date(2013, time.July, 1, 17, 47, 53, 0, time.UTC)\n\tif !rateLimitErr.Rate.Reset.UTC().Equal(reset) {\n\t\tt.Errorf(\"rateLimitErr rate reset = %v, want %v\", rateLimitErr.Rate.Reset.UTC(), reset)\n\t}\n\tif got, want := rateLimitErr.Rate.Resource, \"core\"; got != want {\n\t\tt.Errorf(\"rateLimitErr rate resource = %v, want %v\", got, want)\n\t}\n}\n\n// Ensure a network call is not made when it's known that API rate limit is still exceeded.\nfunc TestDo_rateLimit_noNetworkCall(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\treset := time.Now().UTC().Add(time.Minute).Round(time.Second) // Rate reset is a minute from now, with 1 second precision.\n\n\tmux.HandleFunc(\"/first\", func(w http.ResponseWriter, _ *http.Request) {\n\t\tw.Header().Set(HeaderRateLimit, \"60\")\n\t\tw.Header().Set(HeaderRateRemaining, \"0\")\n\t\tw.Header().Set(HeaderRateUsed, \"60\")\n\t\tw.Header().Set(HeaderRateReset, fmt.Sprint(reset.Unix()))\n\t\tw.Header().Set(HeaderRateResource, \"core\")\n\t\tw.Header().Set(\"Content-Type\", \"application/json; charset=utf-8\")\n\t\tw.WriteHeader(http.StatusForbidden)\n\t\tfmt.Fprintln(w, `{\n   \"message\": \"API rate limit exceeded for xxx.xxx.xxx.xxx. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)\",\n   \"documentation_url\": \"https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits\"\n}`)\n\t})\n\n\tmadeNetworkCall := false\n\tmux.HandleFunc(\"/second\", func(http.ResponseWriter, *http.Request) {\n\t\tmadeNetworkCall = true\n\t})\n\n\t// First request is made, and it makes the client aware of rate reset time being in the future.\n\treq, _ := client.NewRequest(\"GET\", \"first\", nil)\n\tctx := t.Context()\n\t_, err := client.Do(ctx, req, nil)\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned.\")\n\t}\n\n\t// Second request should not cause a network call to be made, since client can predict a rate limit error.\n\treq, _ = client.NewRequest(\"GET\", \"second\", nil)\n\t_, err = client.Do(ctx, req, nil)\n\n\tif madeNetworkCall {\n\t\tt.Fatal(\"Network call was made, even though rate limit is known to still be exceeded.\")\n\t}\n\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned.\")\n\t}\n\tvar rateLimitErr *RateLimitError\n\tif !errors.As(err, &rateLimitErr) {\n\t\tt.Fatalf(\"Expected a *RateLimitError error; got %#v.\", err)\n\t}\n\tif got, want := rateLimitErr.Rate.Limit, 60; got != want {\n\t\tt.Errorf(\"rateLimitErr rate limit = %v, want %v\", got, want)\n\t}\n\tif got, want := rateLimitErr.Rate.Remaining, 0; got != want {\n\t\tt.Errorf(\"rateLimitErr rate remaining = %v, want %v\", got, want)\n\t}\n\tif got, want := rateLimitErr.Rate.Used, 60; got != want {\n\t\tt.Errorf(\"rateLimitErr rate used = %v, want %v\", got, want)\n\t}\n\tif !rateLimitErr.Rate.Reset.UTC().Equal(reset) {\n\t\tt.Errorf(\"rateLimitErr rate reset = %v, want %v\", rateLimitErr.Rate.Reset.UTC(), reset)\n\t}\n\tif got, want := rateLimitErr.Rate.Resource, \"core\"; got != want {\n\t\tt.Errorf(\"rateLimitErr rate resource = %v, want %v\", got, want)\n\t}\n}\n\n// Ignore rate limit headers if the response was served from cache.\nfunc TestDo_rateLimit_ignoredFromCache(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\treset := time.Now().UTC().Add(time.Minute).Round(time.Second) // Rate reset is a minute from now, with 1 second precision.\n\n\t// By adding the X-From-Cache header we pretend this is served from a cache.\n\tmux.HandleFunc(\"/first\", func(w http.ResponseWriter, _ *http.Request) {\n\t\tw.Header().Set(\"X-From-Cache\", \"1\")\n\t\tw.Header().Set(HeaderRateLimit, \"60\")\n\t\tw.Header().Set(HeaderRateRemaining, \"0\")\n\t\tw.Header().Set(HeaderRateUsed, \"60\")\n\t\tw.Header().Set(HeaderRateReset, fmt.Sprint(reset.Unix()))\n\t\tw.Header().Set(HeaderRateResource, \"core\")\n\t\tw.Header().Set(\"Content-Type\", \"application/json; charset=utf-8\")\n\t\tw.WriteHeader(http.StatusForbidden)\n\t\tfmt.Fprintln(w, `{\n   \"message\": \"API rate limit exceeded for xxx.xxx.xxx.xxx. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)\",\n   \"documentation_url\": \"https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits\"\n}`)\n\t})\n\n\tmadeNetworkCall := false\n\tmux.HandleFunc(\"/second\", func(http.ResponseWriter, *http.Request) {\n\t\tmadeNetworkCall = true\n\t})\n\n\t// First request is made so afterwards we can check the returned rate limit headers were ignored.\n\treq, _ := client.NewRequest(\"GET\", \"first\", nil)\n\tctx := t.Context()\n\t_, err := client.Do(ctx, req, nil)\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned.\")\n\t}\n\n\t// Second request should not be hindered by rate limits.\n\treq, _ = client.NewRequest(\"GET\", \"second\", nil)\n\t_, err = client.Do(ctx, req, nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Second request failed, even though the rate limits from the cache should've been ignored: %v\", err)\n\t}\n\tif !madeNetworkCall {\n\t\tt.Fatal(\"Network call was not made, even though the rate limits from the cache should've been ignored\")\n\t}\n}\n\n// Ensure sleeps until the rate limit is reset when the client is rate limited.\nfunc TestDo_rateLimit_sleepUntilResponseResetLimit(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\treset := time.Now().UTC().Add(time.Second)\n\n\tfirstRequest := true\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, _ *http.Request) {\n\t\tif firstRequest {\n\t\t\tfirstRequest = false\n\t\t\tw.Header().Set(HeaderRateLimit, \"60\")\n\t\t\tw.Header().Set(HeaderRateRemaining, \"0\")\n\t\t\tw.Header().Set(HeaderRateUsed, \"60\")\n\t\t\tw.Header().Set(HeaderRateReset, fmt.Sprint(reset.Unix()))\n\t\t\tw.Header().Set(HeaderRateResource, \"core\")\n\t\t\tw.Header().Set(\"Content-Type\", \"application/json; charset=utf-8\")\n\t\t\tw.WriteHeader(http.StatusForbidden)\n\t\t\tfmt.Fprintln(w, `{\n   \"message\": \"API rate limit exceeded for xxx.xxx.xxx.xxx. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)\",\n   \"documentation_url\": \"https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits\"\n}`)\n\t\t\treturn\n\t\t}\n\t\tw.Header().Set(HeaderRateLimit, \"5000\")\n\t\tw.Header().Set(HeaderRateRemaining, \"5000\")\n\t\tw.Header().Set(HeaderRateUsed, \"0\")\n\t\tw.Header().Set(HeaderRateReset, fmt.Sprint(reset.Add(time.Hour).Unix()))\n\t\tw.Header().Set(HeaderRateResource, \"core\")\n\t\tw.Header().Set(\"Content-Type\", \"application/json; charset=utf-8\")\n\t\tw.WriteHeader(http.StatusOK)\n\t\tfmt.Fprintln(w, `{}`)\n\t})\n\n\treq, _ := client.NewRequest(\"GET\", \".\", nil)\n\tresp, err := client.Do(context.WithValue(t.Context(), SleepUntilPrimaryRateLimitResetWhenRateLimited, true), req, nil)\n\tif err != nil {\n\t\tt.Errorf(\"Do returned unexpected error: %v\", err)\n\t}\n\tif got, want := resp.StatusCode, http.StatusOK; got != want {\n\t\tt.Errorf(\"Response status code = %v, want %v\", got, want)\n\t}\n}\n\n// Ensure tries to sleep until the rate limit is reset when the client is rate limited, but only once.\nfunc TestDo_rateLimit_sleepUntilResponseResetLimitRetryOnce(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\treset := time.Now().UTC().Add(time.Second)\n\n\trequestCount := 0\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, _ *http.Request) {\n\t\trequestCount++\n\t\tw.Header().Set(HeaderRateLimit, \"60\")\n\t\tw.Header().Set(HeaderRateRemaining, \"0\")\n\t\tw.Header().Set(HeaderRateUsed, \"60\")\n\t\tw.Header().Set(HeaderRateReset, fmt.Sprint(reset.Unix()))\n\t\tw.Header().Set(HeaderRateResource, \"core\")\n\t\tw.Header().Set(\"Content-Type\", \"application/json; charset=utf-8\")\n\t\tw.WriteHeader(http.StatusForbidden)\n\t\tfmt.Fprintln(w, `{\n   \"message\": \"API rate limit exceeded for xxx.xxx.xxx.xxx. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)\",\n   \"documentation_url\": \"https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits\"\n}`)\n\t})\n\n\treq, _ := client.NewRequest(\"GET\", \".\", nil)\n\t_, err := client.Do(context.WithValue(t.Context(), SleepUntilPrimaryRateLimitResetWhenRateLimited, true), req, nil)\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned.\")\n\t}\n\tif got, want := requestCount, 2; got != want {\n\t\tt.Errorf(\"Expected 2 requests, got %v\", got)\n\t}\n}\n\n// Ensure a network call is not made when it's known that API rate limit is still exceeded.\nfunc TestDo_rateLimit_sleepUntilClientResetLimit(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\treset := time.Now().UTC().Add(time.Second)\n\tclient.rateLimits[CoreCategory] = Rate{Limit: 5000, Remaining: 0, Reset: Timestamp{reset}}\n\trequestCount := 0\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, _ *http.Request) {\n\t\trequestCount++\n\t\tw.Header().Set(HeaderRateLimit, \"5000\")\n\t\tw.Header().Set(HeaderRateRemaining, \"5000\")\n\t\tw.Header().Set(HeaderRateUsed, \"0\")\n\t\tw.Header().Set(HeaderRateReset, fmt.Sprint(reset.Add(time.Hour).Unix()))\n\t\tw.Header().Set(HeaderRateResource, \"core\")\n\t\tw.Header().Set(\"Content-Type\", \"application/json; charset=utf-8\")\n\t\tw.WriteHeader(http.StatusOK)\n\t\tfmt.Fprintln(w, `{}`)\n\t})\n\treq, _ := client.NewRequest(\"GET\", \".\", nil)\n\tresp, err := client.Do(context.WithValue(t.Context(), SleepUntilPrimaryRateLimitResetWhenRateLimited, true), req, nil)\n\tif err != nil {\n\t\tt.Errorf(\"Do returned unexpected error: %v\", err)\n\t}\n\tif got, want := resp.StatusCode, http.StatusOK; got != want {\n\t\tt.Errorf(\"Response status code = %v, want %v\", got, want)\n\t}\n\tif got, want := requestCount, 1; got != want {\n\t\tt.Errorf(\"Expected 1 request, got %v\", got)\n\t}\n}\n\n// Ensure sleep is aborted when the context is cancelled.\nfunc TestDo_rateLimit_abortSleepContextCancelled(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\t// We use a 1 minute reset time to ensure the sleep is not completed.\n\treset := time.Now().UTC().Add(time.Minute)\n\trequestCount := 0\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, _ *http.Request) {\n\t\trequestCount++\n\t\tw.Header().Set(HeaderRateLimit, \"60\")\n\t\tw.Header().Set(HeaderRateRemaining, \"0\")\n\t\tw.Header().Set(HeaderRateUsed, \"60\")\n\t\tw.Header().Set(HeaderRateReset, fmt.Sprint(reset.Unix()))\n\t\tw.Header().Set(HeaderRateResource, \"core\")\n\t\tw.Header().Set(\"Content-Type\", \"application/json; charset=utf-8\")\n\t\tw.WriteHeader(http.StatusForbidden)\n\t\tfmt.Fprintln(w, `{\n   \"message\": \"API rate limit exceeded for xxx.xxx.xxx.xxx. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)\",\n   \"documentation_url\": \"https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits\"\n}`)\n\t})\n\n\treq, _ := client.NewRequest(\"GET\", \".\", nil)\n\tctx, cancel := context.WithTimeout(t.Context(), 10*time.Millisecond)\n\tdefer cancel()\n\t_, err := client.Do(context.WithValue(ctx, SleepUntilPrimaryRateLimitResetWhenRateLimited, true), req, nil)\n\tif !errors.Is(err, context.DeadlineExceeded) {\n\t\tt.Error(\"Expected context deadline exceeded error.\")\n\t}\n\tif got, want := requestCount, 1; got != want {\n\t\tt.Errorf(\"Expected 1 requests, got %v\", got)\n\t}\n}\n\n// Ensure sleep is aborted when the context is cancelled on initial request.\nfunc TestDo_rateLimit_abortSleepContextCancelledClientLimit(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\treset := time.Now().UTC().Add(time.Minute)\n\tclient.rateLimits[CoreCategory] = Rate{Limit: 5000, Remaining: 0, Reset: Timestamp{reset}}\n\trequestCount := 0\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, _ *http.Request) {\n\t\trequestCount++\n\t\tw.Header().Set(HeaderRateLimit, \"5000\")\n\t\tw.Header().Set(HeaderRateRemaining, \"5000\")\n\t\tw.Header().Set(HeaderRateUsed, \"0\")\n\t\tw.Header().Set(HeaderRateReset, fmt.Sprint(reset.Add(time.Hour).Unix()))\n\t\tw.Header().Set(HeaderRateResource, \"core\")\n\t\tw.Header().Set(\"Content-Type\", \"application/json; charset=utf-8\")\n\t\tw.WriteHeader(http.StatusOK)\n\t\tfmt.Fprintln(w, `{}`)\n\t})\n\treq, _ := client.NewRequest(\"GET\", \".\", nil)\n\tctx, cancel := context.WithTimeout(t.Context(), 10*time.Millisecond)\n\tdefer cancel()\n\t_, err := client.Do(context.WithValue(ctx, SleepUntilPrimaryRateLimitResetWhenRateLimited, true), req, nil)\n\tvar rateLimitError *RateLimitError\n\tif !errors.As(err, &rateLimitError) {\n\t\tt.Fatalf(\"Expected a *rateLimitError error; got %#v.\", err)\n\t}\n\tif got, wantSuffix := rateLimitError.Message, \"Context cancelled while waiting for rate limit to reset until\"; !strings.HasPrefix(got, wantSuffix) {\n\t\tt.Errorf(\"Expected request to be prevented because context cancellation, got: %v.\", got)\n\t}\n\tif got, want := requestCount, 0; got != want {\n\t\tt.Errorf(\"Expected 1 requests, got %v\", got)\n\t}\n}\n\n// Ensure *AbuseRateLimitError is returned when the response indicates that\n// the client has triggered an abuse detection mechanism.\nfunc TestDo_rateLimit_abuseRateLimitError(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, _ *http.Request) {\n\t\tw.Header().Set(\"Content-Type\", \"application/json; charset=utf-8\")\n\t\tw.WriteHeader(http.StatusForbidden)\n\t\t// When the abuse rate limit error is of the \"temporarily blocked from content creation\" type,\n\t\t// there is no \"Retry-After\" header.\n\t\tfmt.Fprintln(w, `{\n   \"message\": \"You have triggered an abuse detection mechanism and have been temporarily blocked from content creation. Please retry your request again later.\",\n   \"documentation_url\": \"https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits\"\n}`)\n\t})\n\n\treq, _ := client.NewRequest(\"GET\", \".\", nil)\n\t_, err := client.Do(t.Context(), req, nil)\n\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned.\")\n\t}\n\tvar abuseRateLimitErr *AbuseRateLimitError\n\tif !errors.As(err, &abuseRateLimitErr) {\n\t\tt.Fatalf(\"Expected a *AbuseRateLimitError error; got %#v.\", err)\n\t}\n\tif got, want := abuseRateLimitErr.RetryAfter, (*time.Duration)(nil); got != want {\n\t\tt.Errorf(\"abuseRateLimitErr RetryAfter = %v, want %v\", got, want)\n\t}\n}\n\n// Ensure *AbuseRateLimitError is returned when the response indicates that\n// the client has triggered an abuse detection mechanism on GitHub Enterprise.\nfunc TestDo_rateLimit_abuseRateLimitErrorEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, _ *http.Request) {\n\t\tw.Header().Set(\"Content-Type\", \"application/json; charset=utf-8\")\n\t\tw.WriteHeader(http.StatusForbidden)\n\t\t// When the abuse rate limit error is of the \"temporarily blocked from content creation\" type,\n\t\t// there is no \"Retry-After\" header.\n\t\t// This response returns a documentation url like the one returned for GitHub Enterprise, this\n\t\t// url changes between versions but follows roughly the same format.\n\t\tfmt.Fprintln(w, `{\n   \"message\": \"You have triggered an abuse detection mechanism and have been temporarily blocked from content creation. Please retry your request again later.\",\n   \"documentation_url\": \"https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits\"\n}`)\n\t})\n\n\treq, _ := client.NewRequest(\"GET\", \".\", nil)\n\t_, err := client.Do(t.Context(), req, nil)\n\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned.\")\n\t}\n\tvar abuseRateLimitErr *AbuseRateLimitError\n\tif !errors.As(err, &abuseRateLimitErr) {\n\t\tt.Fatalf(\"Expected a *AbuseRateLimitError error; got %#v.\", err)\n\t}\n\tif got, want := abuseRateLimitErr.RetryAfter, (*time.Duration)(nil); got != want {\n\t\tt.Errorf(\"abuseRateLimitErr RetryAfter = %v, want %v\", got, want)\n\t}\n}\n\n// Ensure *AbuseRateLimitError.RetryAfter is parsed correctly for the Retry-After header.\nfunc TestDo_rateLimit_abuseRateLimitError_retryAfter(t *testing.T) {\n\tt.Parallel()\n\tsynctest.Test(t, func(t *testing.T) {\n\t\tclient, mux, _ := setup(t)\n\n\t\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, _ *http.Request) {\n\t\t\tw.Header().Set(\"Content-Type\", \"application/json; charset=utf-8\")\n\t\t\tw.Header().Set(headerRetryAfter, \"123\") // Retry after value of 123 seconds.\n\t\t\tw.WriteHeader(http.StatusForbidden)\n\t\t\tfmt.Fprintln(w, `{\n   \"message\": \"You have triggered an abuse detection mechanism ...\",\n   \"documentation_url\": \"https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits\"\n}`)\n\t\t})\n\n\t\treq, _ := client.NewRequest(\"GET\", \".\", nil)\n\t\tctx := t.Context()\n\t\t_, err := client.Do(ctx, req, nil)\n\n\t\tif err == nil {\n\t\t\tt.Error(\"Expected error to be returned.\")\n\t\t}\n\t\tvar abuseRateLimitErr *AbuseRateLimitError\n\t\tif !errors.As(err, &abuseRateLimitErr) {\n\t\t\tt.Fatalf(\"Expected a *AbuseRateLimitError error; got %#v.\", err)\n\t\t}\n\t\tif abuseRateLimitErr.RetryAfter == nil {\n\t\t\tt.Fatal(\"abuseRateLimitErr RetryAfter is nil, expected not-nil\")\n\t\t}\n\t\tif got, want := *abuseRateLimitErr.RetryAfter, 123*time.Second; got != want {\n\t\t\tt.Errorf(\"abuseRateLimitErr RetryAfter = %v, want %v\", got, want)\n\t\t}\n\n\t\t// expect prevention of a following request\n\t\tif _, err = client.Do(ctx, req, nil); err == nil {\n\t\t\tt.Error(\"Expected error to be returned.\")\n\t\t}\n\t\tif !errors.As(err, &abuseRateLimitErr) {\n\t\t\tt.Fatalf(\"Expected a *AbuseRateLimitError error; got %#v.\", err)\n\t\t}\n\t\tif abuseRateLimitErr.RetryAfter == nil {\n\t\t\tt.Fatal(\"abuseRateLimitErr RetryAfter is nil, expected not-nil\")\n\t\t}\n\t\tif got, want := 123*time.Second, *abuseRateLimitErr.RetryAfter; got != want {\n\t\t\tt.Errorf(\"abuseRateLimitErr RetryAfter = %v, want %v\", got, want)\n\t\t}\n\t\tif got, wantSuffix := abuseRateLimitErr.Message, \"not making remote request.\"; !strings.HasSuffix(got, wantSuffix) {\n\t\t\tt.Errorf(\"Expected request to be prevented because of secondary rate limit, got: %v.\", got)\n\t\t}\n\t})\n}\n\n// Ensure *AbuseRateLimitError.RetryAfter is parsed correctly for the x-ratelimit-reset header.\nfunc TestDo_rateLimit_abuseRateLimitError_xRateLimitReset(t *testing.T) {\n\tt.Parallel()\n\tsynctest.Test(t, func(t *testing.T) {\n\t\tclient, mux, _ := setup(t)\n\n\t\t// x-ratelimit-reset value of 123 seconds into the future.\n\t\tblockUntil := time.Now().UTC().Add(123 * time.Second).Unix()\n\n\t\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, _ *http.Request) {\n\t\t\tw.Header().Set(\"Content-Type\", \"application/json; charset=utf-8\")\n\t\t\tw.Header().Set(HeaderRateReset, strconv.Itoa(int(blockUntil)))\n\t\t\tw.Header().Set(HeaderRateRemaining, \"1\") // set remaining to a value > 0 to distinct from a primary rate limit\n\t\t\tw.WriteHeader(http.StatusForbidden)\n\t\t\tfmt.Fprintln(w, `{\n   \"message\": \"You have triggered an abuse detection mechanism ...\",\n   \"documentation_url\": \"https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits\"\n}`)\n\t\t})\n\n\t\treq, _ := client.NewRequest(\"GET\", \".\", nil)\n\t\tctx := t.Context()\n\t\t_, err := client.Do(ctx, req, nil)\n\n\t\tif err == nil {\n\t\t\tt.Error(\"Expected error to be returned.\")\n\t\t}\n\t\tvar abuseRateLimitErr *AbuseRateLimitError\n\t\tif !errors.As(err, &abuseRateLimitErr) {\n\t\t\tt.Fatalf(\"Expected a *AbuseRateLimitError error; got %#v.\", err)\n\t\t}\n\t\tif abuseRateLimitErr.RetryAfter == nil {\n\t\t\tt.Fatal(\"abuseRateLimitErr RetryAfter is nil, expected not-nil\")\n\t\t}\n\n\t\tif got, want := *abuseRateLimitErr.RetryAfter, 123*time.Second; got != want {\n\t\t\tt.Errorf(\"abuseRateLimitErr RetryAfter = %v, want %v\", got, want)\n\t\t}\n\n\t\t// expect prevention of a following request\n\t\tif _, err = client.Do(ctx, req, nil); err == nil {\n\t\t\tt.Error(\"Expected error to be returned.\")\n\t\t}\n\t\tif !errors.As(err, &abuseRateLimitErr) {\n\t\t\tt.Fatalf(\"Expected a *AbuseRateLimitError error; got %#v.\", err)\n\t\t}\n\t\tif abuseRateLimitErr.RetryAfter == nil {\n\t\t\tt.Fatal(\"abuseRateLimitErr RetryAfter is nil, expected not-nil\")\n\t\t}\n\t\tif got, want := *abuseRateLimitErr.RetryAfter, 123*time.Second; got != want {\n\t\t\tt.Errorf(\"abuseRateLimitErr RetryAfter = %v, want %v\", got, want)\n\t\t}\n\t\tif got, wantSuffix := abuseRateLimitErr.Message, \"not making remote request.\"; !strings.HasSuffix(got, wantSuffix) {\n\t\t\tt.Errorf(\"Expected request to be prevented because of secondary rate limit, got: %v.\", got)\n\t\t}\n\t})\n}\n\n// Ensure *AbuseRateLimitError.RetryAfter respect a max duration if specified.\nfunc TestDo_rateLimit_abuseRateLimitError_maxDuration(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\t// specify a max retry after duration of 1 min\n\tclient.MaxSecondaryRateLimitRetryAfterDuration = 60 * time.Second\n\n\t// x-ratelimit-reset value of 1h into the future, to make sure we are way over the max wait time duration.\n\tblockUntil := time.Now().Add(1 * time.Hour).Unix()\n\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, _ *http.Request) {\n\t\tw.Header().Set(\"Content-Type\", \"application/json; charset=utf-8\")\n\t\tw.Header().Set(HeaderRateReset, strconv.Itoa(int(blockUntil)))\n\t\tw.Header().Set(HeaderRateRemaining, \"1\") // set remaining to a value > 0 to distinct from a primary rate limit\n\t\tw.WriteHeader(http.StatusForbidden)\n\t\tfmt.Fprintln(w, `{\n   \"message\": \"You have triggered an abuse detection mechanism ...\",\n   \"documentation_url\": \"https://docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits\"\n}`)\n\t})\n\n\treq, _ := client.NewRequest(\"GET\", \".\", nil)\n\t_, err := client.Do(t.Context(), req, nil)\n\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned.\")\n\t}\n\tvar abuseRateLimitErr *AbuseRateLimitError\n\tif !errors.As(err, &abuseRateLimitErr) {\n\t\tt.Fatalf(\"Expected a *AbuseRateLimitError error; got %#v.\", err)\n\t}\n\tif abuseRateLimitErr.RetryAfter == nil {\n\t\tt.Fatal(\"abuseRateLimitErr RetryAfter is nil, expected not-nil\")\n\t}\n\t// check that the retry after is set to be the max allowed duration\n\tif got, want := *abuseRateLimitErr.RetryAfter, client.MaxSecondaryRateLimitRetryAfterDuration; got != want {\n\t\tt.Errorf(\"abuseRateLimitErr RetryAfter = %v, want %v\", got, want)\n\t}\n}\n\n// Make network call if client has disabled the rate limit check.\nfunc TestDo_rateLimit_disableRateLimitCheck(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tclient.DisableRateLimitCheck = true\n\n\treset := time.Now().UTC().Add(60 * time.Second)\n\tclient.rateLimits[CoreCategory] = Rate{Limit: 5000, Remaining: 0, Reset: Timestamp{reset}}\n\trequestCount := 0\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, _ *http.Request) {\n\t\trequestCount++\n\t\tw.Header().Set(HeaderRateLimit, \"5000\")\n\t\tw.Header().Set(HeaderRateRemaining, \"5000\")\n\t\tw.Header().Set(HeaderRateUsed, \"0\")\n\t\tw.Header().Set(HeaderRateReset, fmt.Sprint(reset.Add(time.Hour).Unix()))\n\t\tw.Header().Set(HeaderRateResource, \"core\")\n\t\tw.Header().Set(\"Content-Type\", \"application/json; charset=utf-8\")\n\t\tw.WriteHeader(http.StatusOK)\n\t\tfmt.Fprintln(w, `{}`)\n\t})\n\treq, _ := client.NewRequest(\"GET\", \".\", nil)\n\tresp, err := client.Do(t.Context(), req, nil)\n\tif err != nil {\n\t\tt.Errorf(\"Do returned unexpected error: %v\", err)\n\t}\n\tif got, want := resp.StatusCode, http.StatusOK; got != want {\n\t\tt.Errorf(\"Response status code = %v, want %v\", got, want)\n\t}\n\tif got, want := requestCount, 1; got != want {\n\t\tt.Errorf(\"Expected 1 request, got %v\", got)\n\t}\n\tif got, want := client.rateLimits[CoreCategory].Remaining, 0; got != want {\n\t\tt.Errorf(\"Expected 0 requests remaining, got %v\", got)\n\t}\n}\n\n// Make network call if client has bypassed the rate limit check.\nfunc TestDo_rateLimit_bypassRateLimitCheck(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\treset := time.Now().UTC().Add(60 * time.Second)\n\tclient.rateLimits[CoreCategory] = Rate{Limit: 5000, Remaining: 0, Reset: Timestamp{reset}}\n\trequestCount := 0\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, _ *http.Request) {\n\t\trequestCount++\n\t\tw.Header().Set(HeaderRateLimit, \"5000\")\n\t\tw.Header().Set(HeaderRateRemaining, \"5000\")\n\t\tw.Header().Set(HeaderRateUsed, \"0\")\n\t\tw.Header().Set(HeaderRateReset, fmt.Sprint(reset.Add(time.Hour).Unix()))\n\t\tw.Header().Set(HeaderRateResource, \"core\")\n\t\tw.Header().Set(\"Content-Type\", \"application/json; charset=utf-8\")\n\t\tw.WriteHeader(http.StatusOK)\n\t\tfmt.Fprintln(w, `{}`)\n\t})\n\treq, _ := client.NewRequest(\"GET\", \".\", nil)\n\tresp, err := client.Do(context.WithValue(t.Context(), BypassRateLimitCheck, true), req, nil)\n\tif err != nil {\n\t\tt.Errorf(\"Do returned unexpected error: %v\", err)\n\t}\n\tif got, want := resp.StatusCode, http.StatusOK; got != want {\n\t\tt.Errorf(\"Response status code = %v, want %v\", got, want)\n\t}\n\tif got, want := requestCount, 1; got != want {\n\t\tt.Errorf(\"Expected 1 request, got %v\", got)\n\t}\n\tif got, want := client.rateLimits[CoreCategory].Remaining, 5000; got != want {\n\t\tt.Errorf(\"Expected 5000 requests remaining, got %v\", got)\n\t}\n}\n\nfunc TestDo_noContent(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, _ *http.Request) {\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tvar body json.RawMessage\n\n\treq, _ := client.NewRequest(\"GET\", \".\", nil)\n\t_, err := client.Do(t.Context(), req, &body)\n\tif err != nil {\n\t\tt.Fatalf(\"Do returned unexpected error: %v\", err)\n\t}\n}\n\nfunc TestBareDoUntilFound_redirectLoop(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\thttp.Redirect(w, r, baseURLPath, http.StatusMovedPermanently)\n\t})\n\n\treq, _ := client.NewRequest(\"GET\", \".\", nil)\n\t_, _, err := client.bareDoUntilFound(t.Context(), req, 1)\n\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned.\")\n\t}\n\tif !errors.As(err, new(*RedirectionError)) {\n\t\tt.Errorf(\"Expected a Redirection error; got %#v.\", err)\n\t}\n}\n\nfunc TestBareDoUntilFound_UnexpectedRedirection(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\thttp.Redirect(w, r, baseURLPath, http.StatusSeeOther)\n\t})\n\n\treq, _ := client.NewRequest(\"GET\", \".\", nil)\n\t_, _, err := client.bareDoUntilFound(t.Context(), req, 1)\n\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned.\")\n\t}\n\tif !errors.As(err, new(*RedirectionError)) {\n\t\tt.Errorf(\"Expected a Redirection error; got %#v.\", err)\n\t}\n}\n\nfunc TestSanitizeURL(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tin, want string\n\t}{\n\t\t{\"/?a=b\", \"/?a=b\"},\n\t\t{\"/?a=b&client_secret=secret\", \"/?a=b&client_secret=REDACTED\"},\n\t\t{\"/?a=b&client_id=id&client_secret=secret\", \"/?a=b&client_id=id&client_secret=REDACTED\"},\n\t}\n\n\tfor _, tt := range tests {\n\t\tinURL, _ := url.Parse(tt.in)\n\t\twant, _ := url.Parse(tt.want)\n\n\t\tif got := sanitizeURL(inURL); !cmp.Equal(got, want) {\n\t\t\tt.Errorf(\"sanitizeURL(%v) returned %v, want %v\", tt.in, got, want)\n\t\t}\n\t}\n}\n\nfunc TestCheckResponse(t *testing.T) {\n\tt.Parallel()\n\tres := &http.Response{\n\t\tRequest:    &http.Request{},\n\t\tStatusCode: http.StatusBadRequest,\n\t\tBody: io.NopCloser(strings.NewReader(`{\"message\":\"m\",\n\t\t\t\"errors\": [{\"resource\": \"r\", \"field\": \"f\", \"code\": \"c\"}],\n\t\t\t\"block\": {\"reason\": \"dmca\", \"created_at\": \"2016-03-17T15:39:46Z\"}}`)),\n\t}\n\tvar err *ErrorResponse\n\terrors.As(CheckResponse(res), &err)\n\n\tif err == nil {\n\t\tt.Error(\"Expected error response.\")\n\t}\n\n\twant := &ErrorResponse{\n\t\tResponse: res,\n\t\tMessage:  \"m\",\n\t\tErrors:   []Error{{Resource: \"r\", Field: \"f\", Code: \"c\"}},\n\t\tBlock: &ErrorBlock{\n\t\t\tReason:    \"dmca\",\n\t\t\tCreatedAt: &Timestamp{time.Date(2016, time.March, 17, 15, 39, 46, 0, time.UTC)},\n\t\t},\n\t}\n\tif !errors.Is(err, want) {\n\t\tt.Errorf(\"Error = %#v, want %#v\", err, want)\n\t}\n}\n\nfunc TestCheckResponse_RateLimit(t *testing.T) {\n\tt.Parallel()\n\tres := &http.Response{\n\t\tRequest:    &http.Request{},\n\t\tStatusCode: http.StatusForbidden,\n\t\tHeader:     http.Header{},\n\t\tBody: io.NopCloser(strings.NewReader(`{\"message\":\"m\",\n\t\t\t\"documentation_url\": \"url\"}`)),\n\t}\n\tres.Header.Set(HeaderRateLimit, \"60\")\n\tres.Header.Set(HeaderRateRemaining, \"0\")\n\tres.Header.Set(HeaderRateUsed, \"1\")\n\tres.Header.Set(HeaderRateReset, \"243424\")\n\tres.Header.Set(HeaderRateResource, \"core\")\n\n\tvar err *RateLimitError\n\terrors.As(CheckResponse(res), &err)\n\n\tif err == nil {\n\t\tt.Error(\"Expected error response.\")\n\t}\n\n\twant := &RateLimitError{\n\t\tRate:     parseRate(res),\n\t\tResponse: res,\n\t\tMessage:  \"m\",\n\t}\n\tif !errors.Is(err, want) {\n\t\tt.Errorf(\"Error = %#v, want %#v\", err, want)\n\t}\n}\n\nfunc TestCheckResponse_AbuseRateLimit(t *testing.T) {\n\tt.Parallel()\n\tres := &http.Response{\n\t\tRequest:    &http.Request{},\n\t\tStatusCode: http.StatusForbidden,\n\t\tBody: io.NopCloser(strings.NewReader(`{\"message\":\"m\",\n\t\t\t\"documentation_url\": \"docs.github.com/en/rest/overview/resources-in-the-rest-api#abuse-rate-limits\"}`)),\n\t}\n\tvar err *AbuseRateLimitError\n\terrors.As(CheckResponse(res), &err)\n\n\tif err == nil {\n\t\tt.Error(\"Expected error response.\")\n\t}\n\n\twant := &AbuseRateLimitError{\n\t\tResponse: res,\n\t\tMessage:  \"m\",\n\t}\n\tif !errors.Is(err, want) {\n\t\tt.Errorf(\"Error = %#v, want %#v\", err, want)\n\t}\n}\n\n// TestCheckResponse_RateLimit_TooManyRequests tests that HTTP 429 with\n// X-RateLimit-Remaining: 0 is correctly detected as RateLimitError.\n// GitHub API can return either 403 or 429 for rate limiting.\n// See: https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api\nfunc TestCheckResponse_RateLimit_TooManyRequests(t *testing.T) {\n\tt.Parallel()\n\tres := &http.Response{\n\t\tRequest:    &http.Request{},\n\t\tStatusCode: http.StatusTooManyRequests,\n\t\tHeader:     http.Header{},\n\t\tBody: io.NopCloser(strings.NewReader(`{\"message\":\"m\",\n\t\t\t\"documentation_url\": \"url\"}`)),\n\t}\n\tres.Header.Set(HeaderRateLimit, \"60\")\n\tres.Header.Set(HeaderRateRemaining, \"0\")\n\tres.Header.Set(HeaderRateUsed, \"60\")\n\tres.Header.Set(HeaderRateReset, \"243424\")\n\tres.Header.Set(HeaderRateResource, \"core\")\n\n\tvar err *RateLimitError\n\terrors.As(CheckResponse(res), &err)\n\n\tif err == nil {\n\t\tt.Error(\"Expected error response.\")\n\t}\n\n\twant := &RateLimitError{\n\t\tRate:     parseRate(res),\n\t\tResponse: res,\n\t\tMessage:  \"m\",\n\t}\n\tif !errors.Is(err, want) {\n\t\tt.Errorf(\"Error = %#v, want %#v\", err, want)\n\t}\n}\n\n// TestCheckResponse_AbuseRateLimit_TooManyRequests tests that HTTP 429 with\n// secondary rate limit documentation_url is correctly detected as AbuseRateLimitError.\n// GitHub API can return either 403 or 429 for secondary rate limits.\n// See: https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits\nfunc TestCheckResponse_AbuseRateLimit_TooManyRequests(t *testing.T) {\n\tt.Parallel()\n\tres := &http.Response{\n\t\tRequest:    &http.Request{},\n\t\tStatusCode: http.StatusTooManyRequests,\n\t\tHeader:     http.Header{},\n\t\tBody: io.NopCloser(strings.NewReader(`{\"message\":\"m\",\n\t\t\t\"documentation_url\": \"https://docs.github.com/rest/overview/rate-limits-for-the-rest-api#about-secondary-rate-limits\"}`)),\n\t}\n\tres.Header.Set(headerRetryAfter, \"60\")\n\n\tvar err *AbuseRateLimitError\n\terrors.As(CheckResponse(res), &err)\n\n\tif err == nil {\n\t\tt.Fatal(\"Expected error response.\")\n\t}\n\n\tif err.Response != res {\n\t\tt.Errorf(\"Response = %v, want %v\", err.Response, res)\n\t}\n\tif err.Message != \"m\" {\n\t\tt.Errorf(\"Message = %q, want %q\", err.Message, \"m\")\n\t}\n\tif err.RetryAfter == nil {\n\t\tt.Error(\"Expected RetryAfter to be set\")\n\t} else if *err.RetryAfter != 60*time.Second {\n\t\tt.Errorf(\"RetryAfter = %v, want %v\", *err.RetryAfter, 60*time.Second)\n\t}\n}\n\nfunc TestCheckResponse_RedirectionError(t *testing.T) {\n\tt.Parallel()\n\turlStr := \"/foo/bar\"\n\n\tres := &http.Response{\n\t\tRequest:    &http.Request{},\n\t\tStatusCode: http.StatusFound,\n\t\tHeader:     http.Header{},\n\t\tBody:       io.NopCloser(strings.NewReader(``)),\n\t}\n\tres.Header.Set(\"Location\", urlStr)\n\tvar err *RedirectionError\n\terrors.As(CheckResponse(res), &err)\n\n\tif err == nil {\n\t\tt.Error(\"Expected error response.\")\n\t}\n\n\twantedURL, parseErr := url.Parse(urlStr)\n\tif parseErr != nil {\n\t\tt.Errorf(\"Error parsing fixture url: %v\", parseErr)\n\t}\n\n\twant := &RedirectionError{\n\t\tResponse:   res,\n\t\tStatusCode: http.StatusFound,\n\t\tLocation:   wantedURL,\n\t}\n\tif !errors.Is(err, want) {\n\t\tt.Errorf(\"Error = %#v, want %#v\", err, want)\n\t}\n}\n\nfunc TestCompareHttpResponse(t *testing.T) {\n\tt.Parallel()\n\ttestcases := map[string]struct {\n\t\th1       *http.Response\n\t\th2       *http.Response\n\t\texpected bool\n\t}{\n\t\t\"both are nil\": {\n\t\t\texpected: true,\n\t\t},\n\t\t\"both are non nil - same StatusCode\": {\n\t\t\texpected: true,\n\t\t\th1:       &http.Response{StatusCode: 200},\n\t\t\th2:       &http.Response{StatusCode: 200},\n\t\t},\n\t\t\"both are non nil - different StatusCode\": {\n\t\t\texpected: false,\n\t\t\th1:       &http.Response{StatusCode: 200},\n\t\t\th2:       &http.Response{StatusCode: 404},\n\t\t},\n\t\t\"one is nil, other is not\": {\n\t\t\texpected: false,\n\t\t\th2:       &http.Response{},\n\t\t},\n\t}\n\n\tfor name, tc := range testcases {\n\t\tt.Run(name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tv := compareHTTPResponse(tc.h1, tc.h2)\n\t\t\tif tc.expected != v {\n\t\t\t\tt.Errorf(\"Expected %t, got %t for (%#v, %#v)\", tc.expected, v, tc.h1, tc.h2)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestErrorResponse_Is(t *testing.T) {\n\tt.Parallel()\n\terr := &ErrorResponse{\n\t\tResponse: &http.Response{},\n\t\tMessage:  \"m\",\n\t\tErrors:   []Error{{Resource: \"r\", Field: \"f\", Code: \"c\"}},\n\t\tBlock: &ErrorBlock{\n\t\t\tReason:    \"r\",\n\t\t\tCreatedAt: &Timestamp{time.Date(2016, time.March, 17, 15, 39, 46, 0, time.UTC)},\n\t\t},\n\t\tDocumentationURL: \"https://github.com\",\n\t}\n\ttestcases := map[string]struct {\n\t\twantSame   bool\n\t\totherError error\n\t}{\n\t\t\"errors are same\": {\n\t\t\twantSame: true,\n\t\t\totherError: &ErrorResponse{\n\t\t\t\tResponse: &http.Response{},\n\t\t\t\tErrors:   []Error{{Resource: \"r\", Field: \"f\", Code: \"c\"}},\n\t\t\t\tMessage:  \"m\",\n\t\t\t\tBlock: &ErrorBlock{\n\t\t\t\t\tReason:    \"r\",\n\t\t\t\t\tCreatedAt: &Timestamp{time.Date(2016, time.March, 17, 15, 39, 46, 0, time.UTC)},\n\t\t\t\t},\n\t\t\t\tDocumentationURL: \"https://github.com\",\n\t\t\t},\n\t\t},\n\t\t\"errors have different values - Message\": {\n\t\t\twantSame: false,\n\t\t\totherError: &ErrorResponse{\n\t\t\t\tResponse: &http.Response{},\n\t\t\t\tErrors:   []Error{{Resource: \"r\", Field: \"f\", Code: \"c\"}},\n\t\t\t\tMessage:  \"m1\",\n\t\t\t\tBlock: &ErrorBlock{\n\t\t\t\t\tReason:    \"r\",\n\t\t\t\t\tCreatedAt: &Timestamp{time.Date(2016, time.March, 17, 15, 39, 46, 0, time.UTC)},\n\t\t\t\t},\n\t\t\t\tDocumentationURL: \"https://github.com\",\n\t\t\t},\n\t\t},\n\t\t\"errors have different values - DocumentationURL\": {\n\t\t\twantSame: false,\n\t\t\totherError: &ErrorResponse{\n\t\t\t\tResponse: &http.Response{},\n\t\t\t\tErrors:   []Error{{Resource: \"r\", Field: \"f\", Code: \"c\"}},\n\t\t\t\tMessage:  \"m\",\n\t\t\t\tBlock: &ErrorBlock{\n\t\t\t\t\tReason:    \"r\",\n\t\t\t\t\tCreatedAt: &Timestamp{time.Date(2016, time.March, 17, 15, 39, 46, 0, time.UTC)},\n\t\t\t\t},\n\t\t\t\tDocumentationURL: \"https://google.com\",\n\t\t\t},\n\t\t},\n\t\t\"errors have different values - Response is nil\": {\n\t\t\twantSame: false,\n\t\t\totherError: &ErrorResponse{\n\t\t\t\tErrors:  []Error{{Resource: \"r\", Field: \"f\", Code: \"c\"}},\n\t\t\t\tMessage: \"m\",\n\t\t\t\tBlock: &ErrorBlock{\n\t\t\t\t\tReason:    \"r\",\n\t\t\t\t\tCreatedAt: &Timestamp{time.Date(2016, time.March, 17, 15, 39, 46, 0, time.UTC)},\n\t\t\t\t},\n\t\t\t\tDocumentationURL: \"https://github.com\",\n\t\t\t},\n\t\t},\n\t\t\"errors have different values - Errors\": {\n\t\t\twantSame: false,\n\t\t\totherError: &ErrorResponse{\n\t\t\t\tResponse: &http.Response{},\n\t\t\t\tErrors:   []Error{{Resource: \"r1\", Field: \"f1\", Code: \"c1\"}},\n\t\t\t\tMessage:  \"m\",\n\t\t\t\tBlock: &ErrorBlock{\n\t\t\t\t\tReason:    \"r\",\n\t\t\t\t\tCreatedAt: &Timestamp{time.Date(2016, time.March, 17, 15, 39, 46, 0, time.UTC)},\n\t\t\t\t},\n\t\t\t\tDocumentationURL: \"https://github.com\",\n\t\t\t},\n\t\t},\n\t\t\"errors have different values - Errors have different length\": {\n\t\t\twantSame: false,\n\t\t\totherError: &ErrorResponse{\n\t\t\t\tResponse: &http.Response{},\n\t\t\t\tErrors:   []Error{},\n\t\t\t\tMessage:  \"m\",\n\t\t\t\tBlock: &ErrorBlock{\n\t\t\t\t\tReason:    \"r\",\n\t\t\t\t\tCreatedAt: &Timestamp{time.Date(2016, time.March, 17, 15, 39, 46, 0, time.UTC)},\n\t\t\t\t},\n\t\t\t\tDocumentationURL: \"https://github.com\",\n\t\t\t},\n\t\t},\n\t\t\"errors have different values - Block - one is nil, other is not\": {\n\t\t\twantSame: false,\n\t\t\totherError: &ErrorResponse{\n\t\t\t\tResponse:         &http.Response{},\n\t\t\t\tErrors:           []Error{{Resource: \"r\", Field: \"f\", Code: \"c\"}},\n\t\t\t\tMessage:          \"m\",\n\t\t\t\tDocumentationURL: \"https://github.com\",\n\t\t\t},\n\t\t},\n\t\t\"errors have different values - Block - different Reason\": {\n\t\t\twantSame: false,\n\t\t\totherError: &ErrorResponse{\n\t\t\t\tResponse: &http.Response{},\n\t\t\t\tErrors:   []Error{{Resource: \"r\", Field: \"f\", Code: \"c\"}},\n\t\t\t\tMessage:  \"m\",\n\t\t\t\tBlock: &ErrorBlock{\n\t\t\t\t\tReason:    \"r1\",\n\t\t\t\t\tCreatedAt: &Timestamp{time.Date(2016, time.March, 17, 15, 39, 46, 0, time.UTC)},\n\t\t\t\t},\n\t\t\t\tDocumentationURL: \"https://github.com\",\n\t\t\t},\n\t\t},\n\t\t\"errors have different values - Block - different CreatedAt #1\": {\n\t\t\twantSame: false,\n\t\t\totherError: &ErrorResponse{\n\t\t\t\tResponse: &http.Response{},\n\t\t\t\tErrors:   []Error{{Resource: \"r\", Field: \"f\", Code: \"c\"}},\n\t\t\t\tMessage:  \"m\",\n\t\t\t\tBlock: &ErrorBlock{\n\t\t\t\t\tReason:    \"r\",\n\t\t\t\t\tCreatedAt: nil,\n\t\t\t\t},\n\t\t\t\tDocumentationURL: \"https://github.com\",\n\t\t\t},\n\t\t},\n\t\t\"errors have different values - Block - different CreatedAt #2\": {\n\t\t\twantSame: false,\n\t\t\totherError: &ErrorResponse{\n\t\t\t\tResponse: &http.Response{},\n\t\t\t\tErrors:   []Error{{Resource: \"r\", Field: \"f\", Code: \"c\"}},\n\t\t\t\tMessage:  \"m\",\n\t\t\t\tBlock: &ErrorBlock{\n\t\t\t\t\tReason:    \"r\",\n\t\t\t\t\tCreatedAt: &Timestamp{time.Date(2017, time.March, 17, 15, 39, 46, 0, time.UTC)},\n\t\t\t\t},\n\t\t\t\tDocumentationURL: \"https://github.com\",\n\t\t\t},\n\t\t},\n\t\t\"errors have different types\": {\n\t\t\twantSame:   false,\n\t\t\totherError: errors.New(\"github\"),\n\t\t},\n\t}\n\n\tfor name, tc := range testcases {\n\t\tt.Run(name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tif tc.wantSame != err.Is(tc.otherError) {\n\t\t\t\tt.Errorf(\"Error = %#v, want %#v\", err, tc.otherError)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestRateLimitError_Is(t *testing.T) {\n\tt.Parallel()\n\terr := &RateLimitError{\n\t\tResponse: &http.Response{},\n\t\tMessage:  \"Github\",\n\t}\n\ttestcases := map[string]struct {\n\t\twantSame   bool\n\t\terr        *RateLimitError\n\t\totherError error\n\t}{\n\t\t\"errors are same\": {\n\t\t\twantSame: true,\n\t\t\terr:      err,\n\t\t\totherError: &RateLimitError{\n\t\t\t\tResponse: &http.Response{},\n\t\t\t\tMessage:  \"Github\",\n\t\t\t},\n\t\t},\n\t\t\"errors are same - Response is nil\": {\n\t\t\twantSame: true,\n\t\t\terr: &RateLimitError{\n\t\t\t\tMessage: \"Github\",\n\t\t\t},\n\t\t\totherError: &RateLimitError{\n\t\t\t\tMessage: \"Github\",\n\t\t\t},\n\t\t},\n\t\t\"errors have different values - Rate\": {\n\t\t\twantSame: false,\n\t\t\terr:      err,\n\t\t\totherError: &RateLimitError{\n\t\t\t\tRate:     Rate{Limit: 10},\n\t\t\t\tResponse: &http.Response{},\n\t\t\t\tMessage:  \"Gitlab\",\n\t\t\t},\n\t\t},\n\t\t\"errors have different values - Response is nil\": {\n\t\t\twantSame: false,\n\t\t\terr:      err,\n\t\t\totherError: &RateLimitError{\n\t\t\t\tMessage: \"Github\",\n\t\t\t},\n\t\t},\n\t\t\"errors have different values - StatusCode\": {\n\t\t\twantSame: false,\n\t\t\terr:      err,\n\t\t\totherError: &RateLimitError{\n\t\t\t\tResponse: &http.Response{StatusCode: 200},\n\t\t\t\tMessage:  \"Github\",\n\t\t\t},\n\t\t},\n\t\t\"errors have different types\": {\n\t\t\twantSame:   false,\n\t\t\terr:        err,\n\t\t\totherError: errors.New(\"github\"),\n\t\t},\n\t}\n\n\tfor name, tc := range testcases {\n\t\tt.Run(name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tif tc.wantSame != tc.err.Is(tc.otherError) {\n\t\t\t\tt.Errorf(\"Error = %#v, want %#v\", tc.err, tc.otherError)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestAbuseRateLimitError_Is(t *testing.T) {\n\tt.Parallel()\n\tt1 := 1 * time.Second\n\tt2 := 2 * time.Second\n\terr := &AbuseRateLimitError{\n\t\tResponse:   &http.Response{},\n\t\tMessage:    \"Github\",\n\t\tRetryAfter: &t1,\n\t}\n\ttestcases := map[string]struct {\n\t\twantSame   bool\n\t\terr        *AbuseRateLimitError\n\t\totherError error\n\t}{\n\t\t\"errors are same\": {\n\t\t\twantSame: true,\n\t\t\terr:      err,\n\t\t\totherError: &AbuseRateLimitError{\n\t\t\t\tResponse:   &http.Response{},\n\t\t\t\tMessage:    \"Github\",\n\t\t\t\tRetryAfter: &t1,\n\t\t\t},\n\t\t},\n\t\t\"errors are same - Response is nil\": {\n\t\t\twantSame: true,\n\t\t\terr: &AbuseRateLimitError{\n\t\t\t\tMessage:    \"Github\",\n\t\t\t\tRetryAfter: &t1,\n\t\t\t},\n\t\t\totherError: &AbuseRateLimitError{\n\t\t\t\tMessage:    \"Github\",\n\t\t\t\tRetryAfter: &t1,\n\t\t\t},\n\t\t},\n\t\t\"errors have different values - Message\": {\n\t\t\twantSame: false,\n\t\t\terr:      err,\n\t\t\totherError: &AbuseRateLimitError{\n\t\t\t\tResponse:   &http.Response{},\n\t\t\t\tMessage:    \"Gitlab\",\n\t\t\t\tRetryAfter: nil,\n\t\t\t},\n\t\t},\n\t\t\"errors have different values - RetryAfter\": {\n\t\t\twantSame: false,\n\t\t\terr:      err,\n\t\t\totherError: &AbuseRateLimitError{\n\t\t\t\tResponse:   &http.Response{},\n\t\t\t\tMessage:    \"Github\",\n\t\t\t\tRetryAfter: &t2,\n\t\t\t},\n\t\t},\n\t\t\"errors have different values - Response is nil\": {\n\t\t\twantSame: false,\n\t\t\terr:      err,\n\t\t\totherError: &AbuseRateLimitError{\n\t\t\t\tMessage:    \"Github\",\n\t\t\t\tRetryAfter: &t1,\n\t\t\t},\n\t\t},\n\t\t\"errors have different values - StatusCode\": {\n\t\t\twantSame: false,\n\t\t\terr:      err,\n\t\t\totherError: &AbuseRateLimitError{\n\t\t\t\tResponse:   &http.Response{StatusCode: 200},\n\t\t\t\tMessage:    \"Github\",\n\t\t\t\tRetryAfter: &t1,\n\t\t\t},\n\t\t},\n\t\t\"errors have different types\": {\n\t\t\twantSame:   false,\n\t\t\terr:        err,\n\t\t\totherError: errors.New(\"github\"),\n\t\t},\n\t}\n\n\tfor name, tc := range testcases {\n\t\tt.Run(name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tif tc.wantSame != tc.err.Is(tc.otherError) {\n\t\t\t\tt.Errorf(\"Error = %#v, want %#v\", tc.err, tc.otherError)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestAcceptedError_Is(t *testing.T) {\n\tt.Parallel()\n\terr := &AcceptedError{Raw: []byte(\"Github\")}\n\ttestcases := map[string]struct {\n\t\twantSame   bool\n\t\totherError error\n\t}{\n\t\t\"errors are same\": {\n\t\t\twantSame:   true,\n\t\t\totherError: &AcceptedError{Raw: []byte(\"Github\")},\n\t\t},\n\t\t\"errors have different values\": {\n\t\t\twantSame:   false,\n\t\t\totherError: &AcceptedError{Raw: []byte(\"Gitlab\")},\n\t\t},\n\t\t\"errors have different types\": {\n\t\t\twantSame:   false,\n\t\t\totherError: errors.New(\"github\"),\n\t\t},\n\t}\n\n\tfor name, tc := range testcases {\n\t\tt.Run(name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tif tc.wantSame != err.Is(tc.otherError) {\n\t\t\t\tt.Errorf(\"Error = %#v, want %#v\", err, tc.otherError)\n\t\t\t}\n\t\t})\n\t}\n}\n\n// Ensure that we properly handle API errors that do not contain a response body.\nfunc TestCheckResponse_noBody(t *testing.T) {\n\tt.Parallel()\n\tres := &http.Response{\n\t\tRequest:    &http.Request{},\n\t\tStatusCode: http.StatusBadRequest,\n\t\tBody:       io.NopCloser(strings.NewReader(\"\")),\n\t}\n\tvar err *ErrorResponse\n\terrors.As(CheckResponse(res), &err)\n\n\tif err == nil {\n\t\tt.Error(\"Expected error response.\")\n\t}\n\n\twant := &ErrorResponse{\n\t\tResponse: res,\n\t}\n\tif !errors.Is(err, want) {\n\t\tt.Errorf(\"Error = %#v, want %#v\", err, want)\n\t}\n}\n\nfunc TestCheckResponse_unexpectedErrorStructure(t *testing.T) {\n\tt.Parallel()\n\thttpBody := `{\"message\":\"m\", \"errors\": [\"error 1\"]}`\n\tres := &http.Response{\n\t\tRequest:    &http.Request{},\n\t\tStatusCode: http.StatusBadRequest,\n\t\tBody:       io.NopCloser(strings.NewReader(httpBody)),\n\t}\n\tvar err *ErrorResponse\n\terrors.As(CheckResponse(res), &err)\n\n\tif err == nil {\n\t\tt.Error(\"Expected error response.\")\n\t}\n\n\twant := &ErrorResponse{\n\t\tResponse: res,\n\t\tMessage:  \"m\",\n\t\tErrors:   []Error{{Message: \"error 1\"}},\n\t}\n\tif !errors.Is(err, want) {\n\t\tt.Errorf(\"Error = %#v, want %#v\", err, want)\n\t}\n\tdata, err2 := io.ReadAll(err.Response.Body)\n\tif err2 != nil {\n\t\tt.Fatalf(\"failed to read response body: %v\", err)\n\t}\n\tif got := string(data); got != httpBody {\n\t\tt.Errorf(\"ErrorResponse.Response.Body = %q, want %q\", got, httpBody)\n\t}\n}\n\nfunc TestParseBooleanResponse_true(t *testing.T) {\n\tt.Parallel()\n\tresult, err := parseBoolResponse(nil)\n\tif err != nil {\n\t\tt.Errorf(\"parseBoolResponse returned error: %+v\", err)\n\t}\n\n\tif want := true; result != want {\n\t\tt.Errorf(\"parseBoolResponse returned %+v, want: %+v\", result, want)\n\t}\n}\n\nfunc TestParseBooleanResponse_false(t *testing.T) {\n\tt.Parallel()\n\tv := &ErrorResponse{Response: &http.Response{StatusCode: http.StatusNotFound}}\n\tresult, err := parseBoolResponse(v)\n\tif err != nil {\n\t\tt.Errorf(\"parseBoolResponse returned error: %+v\", err)\n\t}\n\n\tif want := false; result != want {\n\t\tt.Errorf(\"parseBoolResponse returned %+v, want: %+v\", result, want)\n\t}\n}\n\nfunc TestParseBooleanResponse_error(t *testing.T) {\n\tt.Parallel()\n\tv := &ErrorResponse{Response: &http.Response{StatusCode: http.StatusBadRequest}}\n\tresult, err := parseBoolResponse(v)\n\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned.\")\n\t}\n\n\tif want := false; result != want {\n\t\tt.Errorf(\"parseBoolResponse returned %+v, want: %+v\", result, want)\n\t}\n}\n\nfunc TestErrorResponse_Error(t *testing.T) {\n\tt.Parallel()\n\tres := &http.Response{Request: &http.Request{}}\n\terr := ErrorResponse{Message: \"m\", Response: res}\n\tif err.Error() == \"\" {\n\t\tt.Error(\"Expected non-empty ErrorResponse.Error()\")\n\t}\n\n\t// dont panic if request is nil\n\tres = &http.Response{}\n\terr = ErrorResponse{Message: \"m\", Response: res}\n\tif err.Error() == \"\" {\n\t\tt.Error(\"Expected non-empty ErrorResponse.Error()\")\n\t}\n\n\t// dont panic if response is nil\n\terr = ErrorResponse{Message: \"m\"}\n\tif err.Error() == \"\" {\n\t\tt.Error(\"Expected non-empty ErrorResponse.Error()\")\n\t}\n}\n\nfunc TestError_Error(t *testing.T) {\n\tt.Parallel()\n\terr := Error{}\n\tif err.Error() == \"\" {\n\t\tt.Error(\"Expected non-empty Error.Error()\")\n\t}\n}\n\nfunc TestSetCredentialsAsHeaders(t *testing.T) {\n\tt.Parallel()\n\treq := new(http.Request)\n\tid, secret := \"id\", \"secret\"\n\tmodifiedRequest := setCredentialsAsHeaders(req, id, secret)\n\n\tactualID, actualSecret, ok := modifiedRequest.BasicAuth()\n\tif !ok {\n\t\tt.Error(\"request does not contain basic credentials\")\n\t}\n\n\tif actualID != id {\n\t\tt.Errorf(\"id is %v, want %v\", actualID, id)\n\t}\n\n\tif actualSecret != secret {\n\t\tt.Errorf(\"secret is %v, want %v\", actualSecret, secret)\n\t}\n}\n\nfunc TestUnauthenticatedRateLimitedTransport(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tclientID, clientSecret := \"id\", \"secret\"\n\tmux.HandleFunc(\"/\", func(_ http.ResponseWriter, r *http.Request) {\n\t\tid, secret, ok := r.BasicAuth()\n\t\tif !ok {\n\t\t\tt.Error(\"request does not contain basic auth credentials\")\n\t\t}\n\t\tif id != clientID {\n\t\t\tt.Errorf(\"request contained basic auth username %q, want %q\", id, clientID)\n\t\t}\n\t\tif secret != clientSecret {\n\t\t\tt.Errorf(\"request contained basic auth password %q, want %q\", secret, clientSecret)\n\t\t}\n\t})\n\n\ttp := &UnauthenticatedRateLimitedTransport{\n\t\tClientID:     clientID,\n\t\tClientSecret: clientSecret,\n\t}\n\tunauthedClient := NewClient(tp.Client())\n\tunauthedClient.BaseURL = client.BaseURL\n\treq, _ := unauthedClient.NewRequest(\"GET\", \".\", nil)\n\t_, err := unauthedClient.Do(t.Context(), req, nil)\n\tassertNilError(t, err)\n}\n\nfunc TestUnauthenticatedRateLimitedTransport_missingFields(t *testing.T) {\n\tt.Parallel()\n\t// missing ClientID\n\ttp := &UnauthenticatedRateLimitedTransport{\n\t\tClientSecret: \"secret\",\n\t}\n\t_, err := tp.RoundTrip(nil)\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned\")\n\t}\n\n\t// missing ClientSecret\n\ttp = &UnauthenticatedRateLimitedTransport{\n\t\tClientID: \"id\",\n\t}\n\t_, err = tp.RoundTrip(nil)\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned\")\n\t}\n}\n\nfunc TestUnauthenticatedRateLimitedTransport_transport(t *testing.T) {\n\tt.Parallel()\n\t// default transport\n\ttp := &UnauthenticatedRateLimitedTransport{\n\t\tClientID:     \"id\",\n\t\tClientSecret: \"secret\",\n\t}\n\tif tp.transport() != http.DefaultTransport {\n\t\tt.Error(\"Expected http.DefaultTransport to be used.\")\n\t}\n\n\t// custom transport\n\ttp = &UnauthenticatedRateLimitedTransport{\n\t\tClientID:     \"id\",\n\t\tClientSecret: \"secret\",\n\t\tTransport:    &http.Transport{},\n\t}\n\tif tp.transport() == http.DefaultTransport {\n\t\tt.Error(\"Expected custom transport to be used.\")\n\t}\n}\n\nfunc TestBasicAuthTransport(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tusername, password, otp := \"u\", \"p\", \"123456\"\n\n\tmux.HandleFunc(\"/\", func(_ http.ResponseWriter, r *http.Request) {\n\t\tu, p, ok := r.BasicAuth()\n\t\tif !ok {\n\t\t\tt.Error(\"request does not contain basic auth credentials\")\n\t\t}\n\t\tif u != username {\n\t\t\tt.Errorf(\"request contained basic auth username %q, want %q\", u, username)\n\t\t}\n\t\tif p != password {\n\t\t\tt.Errorf(\"request contained basic auth password %q, want %q\", p, password)\n\t\t}\n\t\tif got, want := r.Header.Get(headerOTP), otp; got != want {\n\t\t\tt.Errorf(\"request contained OTP %q, want %q\", got, want)\n\t\t}\n\t})\n\n\ttp := &BasicAuthTransport{\n\t\tUsername: username,\n\t\tPassword: password,\n\t\tOTP:      otp,\n\t}\n\tbasicAuthClient := NewClient(tp.Client())\n\tbasicAuthClient.BaseURL = client.BaseURL\n\treq, _ := basicAuthClient.NewRequest(\"GET\", \".\", nil)\n\t_, err := basicAuthClient.Do(t.Context(), req, nil)\n\tassertNilError(t, err)\n}\n\nfunc TestBasicAuthTransport_transport(t *testing.T) {\n\tt.Parallel()\n\t// default transport\n\ttp := &BasicAuthTransport{}\n\tif tp.transport() != http.DefaultTransport {\n\t\tt.Error(\"Expected http.DefaultTransport to be used.\")\n\t}\n\n\t// custom transport\n\ttp = &BasicAuthTransport{\n\t\tTransport: &http.Transport{},\n\t}\n\tif tp.transport() == http.DefaultTransport {\n\t\tt.Error(\"Expected custom transport to be used.\")\n\t}\n}\n\nfunc TestFormatRateReset(t *testing.T) {\n\tt.Parallel()\n\td := 120*time.Minute + 12*time.Second\n\tgot := formatRateReset(d)\n\twant := \"[rate reset in 120m12s]\"\n\tif got != want {\n\t\tt.Errorf(\"Format is wrong. got: %v, want: %v\", got, want)\n\t}\n\n\td = 14*time.Minute + 2*time.Second\n\tgot = formatRateReset(d)\n\twant = \"[rate reset in 14m02s]\"\n\tif got != want {\n\t\tt.Errorf(\"Format is wrong. got: %v, want: %v\", got, want)\n\t}\n\n\td = 2*time.Minute + 2*time.Second\n\tgot = formatRateReset(d)\n\twant = \"[rate reset in 2m02s]\"\n\tif got != want {\n\t\tt.Errorf(\"Format is wrong. got: %v, want: %v\", got, want)\n\t}\n\n\td = 12 * time.Second\n\tgot = formatRateReset(d)\n\twant = \"[rate reset in 12s]\"\n\tif got != want {\n\t\tt.Errorf(\"Format is wrong. got: %v, want: %v\", got, want)\n\t}\n\n\td = -1 * (2*time.Hour + 2*time.Second)\n\tgot = formatRateReset(d)\n\twant = \"[rate limit was reset 120m02s ago]\"\n\tif got != want {\n\t\tt.Errorf(\"Format is wrong. got: %v, want: %v\", got, want)\n\t}\n}\n\nfunc TestNestedStructAccessorNoPanic(t *testing.T) {\n\tt.Parallel()\n\tissue := &Issue{User: nil}\n\tgot := issue.GetUser().GetPlan().GetName()\n\twant := \"\"\n\tif got != want {\n\t\tt.Errorf(\"Issues.Get.GetUser().GetPlan().GetName() returned %+v, want %+v\", got, want)\n\t}\n}\n\nfunc TestTwoFactorAuthError(t *testing.T) {\n\tt.Parallel()\n\tu, err := url.Parse(\"https://example.com\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\te := &TwoFactorAuthError{\n\t\tResponse: &http.Response{\n\t\t\tRequest:    &http.Request{Method: \"PUT\", URL: u},\n\t\t\tStatusCode: http.StatusTooManyRequests,\n\t\t},\n\t\tMessage: \"<msg>\",\n\t}\n\tif got, want := e.Error(), \"PUT https://example.com: 429 <msg> []\"; got != want {\n\t\tt.Errorf(\"TwoFactorAuthError = %q, want %q\", got, want)\n\t}\n}\n\nfunc TestRateLimitError(t *testing.T) {\n\tt.Parallel()\n\tu, err := url.Parse(\"https://example.com\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tr := &RateLimitError{\n\t\tResponse: &http.Response{\n\t\t\tRequest:    &http.Request{Method: \"PUT\", URL: u},\n\t\t\tStatusCode: http.StatusTooManyRequests,\n\t\t},\n\t\tMessage: \"<msg>\",\n\t}\n\tif got, want := r.Error(), \"PUT https://example.com: 429 <msg> [rate limit was reset\"; !strings.Contains(got, want) {\n\t\tt.Errorf(\"RateLimitError = %q, want %q\", got, want)\n\t}\n}\n\nfunc TestAcceptedError(t *testing.T) {\n\tt.Parallel()\n\ta := &AcceptedError{}\n\tif got, want := a.Error(), \"try again later\"; !strings.Contains(got, want) {\n\t\tt.Errorf(\"AcceptedError = %q, want %q\", got, want)\n\t}\n}\n\nfunc TestAbuseRateLimitError(t *testing.T) {\n\tt.Parallel()\n\tu, err := url.Parse(\"https://example.com\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tr := &AbuseRateLimitError{\n\t\tResponse: &http.Response{\n\t\t\tRequest:    &http.Request{Method: \"PUT\", URL: u},\n\t\t\tStatusCode: http.StatusTooManyRequests,\n\t\t},\n\t\tMessage: \"<msg>\",\n\t}\n\tif got, want := r.Error(), \"PUT https://example.com: 429 <msg>\"; got != want {\n\t\tt.Errorf(\"AbuseRateLimitError = %q, want %q\", got, want)\n\t}\n}\n\nfunc TestBareDo_returnsOpenBody(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\texpectedBody := \"Hello from the other side !\"\n\n\tmux.HandleFunc(\"/test-url\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, expectedBody)\n\t})\n\n\treq, err := client.NewRequest(\"GET\", \"test-url\", nil)\n\tif err != nil {\n\t\tt.Fatalf(\"client.NewRequest returned error: %v\", err)\n\t}\n\n\tresp, err := client.BareDo(t.Context(), req)\n\tif err != nil {\n\t\tt.Fatalf(\"client.BareDo returned error: %v\", err)\n\t}\n\n\tgot, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\tt.Fatalf(\"io.ReadAll returned error: %v\", err)\n\t}\n\tif string(got) != expectedBody {\n\t\tt.Fatalf(\"Expected %q, got %q\", expectedBody, string(got))\n\t}\n\tif err := resp.Body.Close(); err != nil {\n\t\tt.Fatalf(\"resp.Body.Close() returned error: %v\", err)\n\t}\n}\n\nfunc TestErrorResponse_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ErrorResponse{}, `{\n\t\t\"message\": \"\",\n\t\t\"errors\": null\n\t}`)\n\n\tu := &ErrorResponse{\n\t\tMessage: \"msg\",\n\t\tErrors: []Error{\n\t\t\t{\n\t\t\t\tResource: \"res\",\n\t\t\t\tField:    \"f\",\n\t\t\t\tCode:     \"c\",\n\t\t\t\tMessage:  \"msg\",\n\t\t\t},\n\t\t},\n\t\tBlock: &ErrorBlock{\n\t\t\tReason:    \"reason\",\n\t\t\tCreatedAt: &Timestamp{referenceTime},\n\t\t},\n\t\tDocumentationURL: \"doc\",\n\t}\n\n\twant := `{\n\t\t\"message\": \"msg\",\n\t\t\"errors\": [\n\t\t\t{\n\t\t\t\t\"resource\": \"res\",\n\t\t\t\t\"field\": \"f\",\n\t\t\t\t\"code\": \"c\",\n\t\t\t\t\"message\": \"msg\"\n\t\t\t}\n\t\t],\n\t\t\"block\": {\n\t\t\t\"reason\": \"reason\",\n\t\t\t\"created_at\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"documentation_url\": \"doc\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestErrorBlock_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ErrorBlock{}, \"{}\")\n\n\tu := &ErrorBlock{\n\t\tReason:    \"reason\",\n\t\tCreatedAt: &Timestamp{referenceTime},\n\t}\n\n\twant := `{\n\t\t\"reason\": \"reason\",\n\t\t\"created_at\": ` + referenceTimeStr + `\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestRateLimitError_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RateLimitError{}, `{\n\t\t\"Rate\": {\n\t\t\t\"limit\": 0,\n\t\t\t\"remaining\": 0,\n\t\t\t\"reset\": `+emptyTimeStr+`,\n\t\t\t\"used\": 0\n\t\t},\n\t\t\"Response\": null,\n\t\t\"message\": \"\"\n\t}`)\n\n\tu := &RateLimitError{\n\t\tRate: Rate{\n\t\t\tLimit:     1,\n\t\t\tRemaining: 1,\n\t\t\tReset:     Timestamp{referenceTime},\n\t\t},\n\t\tMessage: \"msg\",\n\t}\n\n\twant := `{\n\t\t\"Rate\": {\n\t\t\t\"limit\": 1,\n\t\t\t\"remaining\": 1,\n\t\t\t\"reset\": ` + referenceTimeStr + `,\n\t\t\t\"used\": 0\n\t\t},\n\t\t\"Response\": null,\n\t\t\"message\": \"msg\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestAbuseRateLimitError_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &AbuseRateLimitError{}, `{\n\t\t\"Response\": null,\n\t\t\"message\": \"\",\n\t\t\"RetryAfter\": null\n\t}`)\n\n\tu := &AbuseRateLimitError{\n\t\tMessage: \"msg\",\n\t}\n\n\twant := `{\n\t\t\"Response\": null,\n\t\t\"message\": \"msg\",\n\t\t\"RetryAfter\": null\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestError_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Error{}, `{\n\t\t\"resource\": \"\",\n\t\t\"field\": \"\",\n\t\t\"code\": \"\",\n\t\t\"message\": \"\"\n\t}`)\n\n\tu := &Error{\n\t\tResource: \"res\",\n\t\tField:    \"field\",\n\t\tCode:     \"code\",\n\t\tMessage:  \"msg\",\n\t}\n\n\twant := `{\n\t\t\"resource\": \"res\",\n\t\t\"field\": \"field\",\n\t\t\"code\": \"code\",\n\t\t\"message\": \"msg\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestParseTokenExpiration(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\theader string\n\t\twant   Timestamp\n\t}{\n\t\t{\n\t\t\theader: \"\",\n\t\t\twant:   Timestamp{},\n\t\t},\n\t\t{\n\t\t\theader: \"this is a garbage\",\n\t\t\twant:   Timestamp{},\n\t\t},\n\t\t{\n\t\t\theader: \"2021-09-03 02:34:04 UTC\",\n\t\t\twant:   Timestamp{time.Date(2021, time.September, 3, 2, 34, 4, 0, time.UTC)},\n\t\t},\n\t\t{\n\t\t\theader: \"2021-09-03 14:34:04 UTC\",\n\t\t\twant:   Timestamp{time.Date(2021, time.September, 3, 14, 34, 4, 0, time.UTC)},\n\t\t},\n\t\t// Some tokens include the timezone offset instead of the timezone.\n\t\t// https://github.com/google/go-github/issues/2649\n\t\t{\n\t\t\theader: \"2023-04-26 20:23:26 +0200\",\n\t\t\twant:   Timestamp{time.Date(2023, time.April, 26, 18, 23, 26, 0, time.UTC)},\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tres := &http.Response{\n\t\t\tRequest: &http.Request{},\n\t\t\tHeader:  http.Header{},\n\t\t}\n\n\t\tres.Header.Set(headerTokenExpiration, tt.header)\n\t\texp := parseTokenExpiration(res)\n\t\tif !exp.Equal(tt.want) {\n\t\t\tt.Errorf(\"parseTokenExpiration of %q\\nreturned %#v\\n    want %#v\", tt.header, exp, tt.want)\n\t\t}\n\t}\n}\n\nfunc TestClientCopy_leak_transport(t *testing.T) {\n\tt.Parallel()\n\tsrv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\taccessToken := r.Header.Get(\"Authorization\")\n\t\t_, _ = fmt.Fprintf(w, `{\"login\": \"%v\"}`, accessToken)\n\t}))\n\tclientPreconfiguredWithURLs, err := NewClient(nil).WithEnterpriseURLs(srv.URL, srv.URL)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\taliceClient := clientPreconfiguredWithURLs.WithAuthToken(\"alice\")\n\tbobClient := clientPreconfiguredWithURLs.WithAuthToken(\"bob\")\n\n\talice, _, err := aliceClient.Users.Get(t.Context(), \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tassertNoDiff(t, \"Bearer alice\", alice.GetLogin())\n\n\tbob, _, err := bobClient.Users.Get(t.Context(), \"\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tassertNoDiff(t, \"Bearer bob\", bob.GetLogin())\n}\n\nfunc TestPtr(t *testing.T) {\n\tt.Parallel()\n\tequal := func(t *testing.T, want, got any) {\n\t\tt.Helper()\n\t\tif !cmp.Equal(want, got) {\n\t\t\tt.Errorf(\"want %#v, got %#v\", want, got)\n\t\t}\n\t}\n\n\tequal(t, true, *Ptr(true))\n\tequal(t, int(10), *Ptr(int(10)))\n\tequal(t, int64(-10), *Ptr(int64(-10)))\n\tequal(t, \"str\", *Ptr(\"str\"))\n}\n\nfunc TestDeploymentProtectionRuleEvent_GetRunID(t *testing.T) {\n\tt.Parallel()\n\n\tvar want int64 = 123456789\n\turl := \"https://api.github.com/repos/dummy-org/dummy-repo/actions/runs/123456789/deployment_protection_rule\"\n\n\te := DeploymentProtectionRuleEvent{\n\t\tDeploymentCallbackURL: &url,\n\t}\n\n\tgot, _ := e.GetRunID()\n\tif got != want {\n\t\tt.Errorf(\"want %#v, got %#v\", want, got)\n\t}\n\n\twant = 123456789\n\turl = \"repos/dummy-org/dummy-repo/actions/runs/123456789/deployment_protection_rule\"\n\n\te = DeploymentProtectionRuleEvent{\n\t\tDeploymentCallbackURL: &url,\n\t}\n\n\tgot, _ = e.GetRunID()\n\tif got != want {\n\t\tt.Errorf(\"want %#v, got %#v\", want, got)\n\t}\n\n\twant = -1\n\turl = \"https://api.github.com/repos/dummy-org/dummy-repo/actions/runs/abc123/deployment_protection_rule\"\n\tgot, err := e.GetRunID()\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned\")\n\t}\n\n\tif got != want {\n\t\tt.Errorf(\"want %#v, got %#v\", want, got)\n\t}\n}\n"
  },
  {
    "path": "github/gitignore.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// GitignoresService provides access to the gitignore related functions in the\n// GitHub API.\n//\n// GitHub API docs: https://docs.github.com/rest/gitignore/\ntype GitignoresService service\n\n// Gitignore represents a .gitignore file as returned by the GitHub API.\ntype Gitignore struct {\n\tName   *string `json:\"name,omitempty\"`\n\tSource *string `json:\"source,omitempty\"`\n}\n\nfunc (g Gitignore) String() string {\n\treturn Stringify(g)\n}\n\n// List all available Gitignore templates.\n//\n// GitHub API docs: https://docs.github.com/rest/gitignore/gitignore#get-all-gitignore-templates\n//\n//meta:operation GET /gitignore/templates\nfunc (s *GitignoresService) List(ctx context.Context) ([]string, *Response, error) {\n\treq, err := s.client.NewRequest(\"GET\", \"gitignore/templates\", nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar availableTemplates []string\n\tresp, err := s.client.Do(ctx, req, &availableTemplates)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn availableTemplates, resp, nil\n}\n\n// Get a Gitignore by name.\n//\n// GitHub API docs: https://docs.github.com/rest/gitignore/gitignore#get-a-gitignore-template\n//\n//meta:operation GET /gitignore/templates/{name}\nfunc (s *GitignoresService) Get(ctx context.Context, name string) (*Gitignore, *Response, error) {\n\tu := fmt.Sprintf(\"gitignore/templates/%v\", name)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar gitignore *Gitignore\n\tresp, err := s.client.Do(ctx, req, &gitignore)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn gitignore, resp, nil\n}\n"
  },
  {
    "path": "github/gitignore_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestGitignoresService_List(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/gitignore/templates\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[\"C\", \"Go\"]`)\n\t})\n\n\tctx := t.Context()\n\tavailable, _, err := client.Gitignores.List(ctx)\n\tif err != nil {\n\t\tt.Errorf(\"Gitignores.List returned error: %v\", err)\n\t}\n\n\twant := []string{\"C\", \"Go\"}\n\tif !cmp.Equal(available, want) {\n\t\tt.Errorf(\"Gitignores.List returned %+v, want %+v\", available, want)\n\t}\n\n\tconst methodName = \"List\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Gitignores.List(ctx)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGitignoresService_Get(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/gitignore/templates/name\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"name\":\"Name\",\"source\":\"template source\"}`)\n\t})\n\n\tctx := t.Context()\n\tgitignore, _, err := client.Gitignores.Get(ctx, \"name\")\n\tif err != nil {\n\t\tt.Errorf(\"Gitignores.List returned error: %v\", err)\n\t}\n\n\twant := &Gitignore{Name: Ptr(\"Name\"), Source: Ptr(\"template source\")}\n\tif !cmp.Equal(gitignore, want) {\n\t\tt.Errorf(\"Gitignores.Get returned %+v, want %+v\", gitignore, want)\n\t}\n\n\tconst methodName = \"Get\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Gitignores.Get(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Gitignores.Get(ctx, \"name\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGitignoresService_Get_invalidTemplate(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Gitignores.Get(ctx, \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestGitignore_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Gitignore{}, \"{}\")\n\n\tu := &Gitignore{\n\t\tName:   Ptr(\"name\"),\n\t\tSource: Ptr(\"source\"),\n\t}\n\n\twant := `{\n\t\t\"name\": \"name\",\n\t\t\"source\": \"source\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/interactions.go",
    "content": "// Copyright 2018 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\n// InteractionsService handles communication with the repository and organization related\n// methods of the GitHub API.\n//\n// GitHub API docs: https://docs.github.com/rest/interactions/\ntype InteractionsService service\n\n// InteractionRestriction represents the interaction restrictions for repository and organization.\ntype InteractionRestriction struct {\n\t// Specifies the group of GitHub users who can\n\t// comment, open issues, or create pull requests for the given repository.\n\t// Possible values are: \"existing_users\", \"contributors_only\" and \"collaborators_only\".\n\tLimit *string `json:\"limit,omitempty\"`\n\n\t// Origin specifies the type of the resource to interact with.\n\t// Possible values are: \"repository\" and \"organization\".\n\tOrigin *string `json:\"origin,omitempty\"`\n\n\t// ExpiresAt specifies the time after which the interaction restrictions expire.\n\t// The default expiry time is 24 hours from the time restriction is created.\n\tExpiresAt *Timestamp `json:\"expires_at,omitempty\"`\n}\n"
  },
  {
    "path": "github/interactions_orgs.go",
    "content": "// Copyright 2019 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// GetRestrictionsForOrg fetches the interaction restrictions for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/interactions/orgs#get-interaction-restrictions-for-an-organization\n//\n//meta:operation GET /orgs/{org}/interaction-limits\nfunc (s *InteractionsService) GetRestrictionsForOrg(ctx context.Context, organization string) (*InteractionRestriction, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/interaction-limits\", organization)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeInteractionRestrictionsPreview)\n\n\tvar organizationInteractions *InteractionRestriction\n\tresp, err := s.client.Do(ctx, req, &organizationInteractions)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn organizationInteractions, resp, nil\n}\n\n// UpdateRestrictionsForOrg adds or updates the interaction restrictions for an organization.\n//\n// limit specifies the group of GitHub users who can comment, open issues, or create pull requests\n// in public repositories for the given organization.\n// Possible values are: \"existing_users\", \"contributors_only\", \"collaborators_only\".\n//\n// GitHub API docs: https://docs.github.com/rest/interactions/orgs#set-interaction-restrictions-for-an-organization\n//\n//meta:operation PUT /orgs/{org}/interaction-limits\nfunc (s *InteractionsService) UpdateRestrictionsForOrg(ctx context.Context, organization, limit string) (*InteractionRestriction, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/interaction-limits\", organization)\n\n\tinteraction := &InteractionRestriction{Limit: Ptr(limit)}\n\n\treq, err := s.client.NewRequest(\"PUT\", u, interaction)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeInteractionRestrictionsPreview)\n\n\tvar organizationInteractions *InteractionRestriction\n\tresp, err := s.client.Do(ctx, req, &organizationInteractions)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn organizationInteractions, resp, nil\n}\n\n// RemoveRestrictionsFromOrg removes the interaction restrictions for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/interactions/orgs#remove-interaction-restrictions-for-an-organization\n//\n//meta:operation DELETE /orgs/{org}/interaction-limits\nfunc (s *InteractionsService) RemoveRestrictionsFromOrg(ctx context.Context, organization string) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/interaction-limits\", organization)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeInteractionRestrictionsPreview)\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/interactions_orgs_test.go",
    "content": "// Copyright 2019 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestInteractionsService_GetRestrictionsForOrgs(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/interaction-limits\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeInteractionRestrictionsPreview)\n\t\tfmt.Fprint(w, `{\"origin\":\"organization\"}`)\n\t})\n\n\tctx := t.Context()\n\torganizationInteractions, _, err := client.Interactions.GetRestrictionsForOrg(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Interactions.GetRestrictionsForOrg returned error: %v\", err)\n\t}\n\n\twant := &InteractionRestriction{Origin: Ptr(\"organization\")}\n\tif !cmp.Equal(organizationInteractions, want) {\n\t\tt.Errorf(\"Interactions.GetRestrictionsForOrg returned %+v, want %+v\", organizationInteractions, want)\n\t}\n\n\tconst methodName = \"GetRestrictionsForOrg\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Interactions.GetRestrictionsForOrg(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Interactions.GetRestrictionsForOrg(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestInteractionsService_UpdateRestrictionsForOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &InteractionRestriction{Limit: Ptr(\"existing_users\")}\n\n\tmux.HandleFunc(\"/orgs/o/interaction-limits\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *InteractionRestriction\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeInteractionRestrictionsPreview)\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\t\tfmt.Fprint(w, `{\"origin\":\"organization\"}`)\n\t})\n\n\tctx := t.Context()\n\torganizationInteractions, _, err := client.Interactions.UpdateRestrictionsForOrg(ctx, \"o\", input.GetLimit())\n\tif err != nil {\n\t\tt.Errorf(\"Interactions.UpdateRestrictionsForOrg returned error: %v\", err)\n\t}\n\n\twant := &InteractionRestriction{Origin: Ptr(\"organization\")}\n\tif !cmp.Equal(organizationInteractions, want) {\n\t\tt.Errorf(\"Interactions.UpdateRestrictionsForOrg returned %+v, want %+v\", organizationInteractions, want)\n\t}\n\n\tconst methodName = \"UpdateRestrictionsForOrg\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Interactions.UpdateRestrictionsForOrg(ctx, \"\\n\", input.GetLimit())\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Interactions.UpdateRestrictionsForOrg(ctx, \"o\", input.GetLimit())\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestInteractionsService_RemoveRestrictionsFromOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/interaction-limits\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeInteractionRestrictionsPreview)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Interactions.RemoveRestrictionsFromOrg(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Interactions.RemoveRestrictionsFromOrg returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveRestrictionsFromOrg\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Interactions.RemoveRestrictionsFromOrg(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Interactions.RemoveRestrictionsFromOrg(ctx, \"o\")\n\t})\n}\n"
  },
  {
    "path": "github/interactions_repos.go",
    "content": "// Copyright 2018 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// GetRestrictionsForRepo fetches the interaction restrictions for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/interactions/repos#get-interaction-restrictions-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/interaction-limits\nfunc (s *InteractionsService) GetRestrictionsForRepo(ctx context.Context, owner, repo string) (*InteractionRestriction, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/interaction-limits\", owner, repo)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeInteractionRestrictionsPreview)\n\n\tvar repositoryInteractions *InteractionRestriction\n\tresp, err := s.client.Do(ctx, req, &repositoryInteractions)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn repositoryInteractions, resp, nil\n}\n\n// UpdateRestrictionsForRepo adds or updates the interaction restrictions for a repository.\n//\n// limit specifies the group of GitHub users who can comment, open issues, or create pull requests\n// for the given repository.\n// Possible values are: \"existing_users\", \"contributors_only\", \"collaborators_only\".\n//\n// GitHub API docs: https://docs.github.com/rest/interactions/repos#set-interaction-restrictions-for-a-repository\n//\n//meta:operation PUT /repos/{owner}/{repo}/interaction-limits\nfunc (s *InteractionsService) UpdateRestrictionsForRepo(ctx context.Context, owner, repo, limit string) (*InteractionRestriction, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/interaction-limits\", owner, repo)\n\n\tinteraction := &InteractionRestriction{Limit: Ptr(limit)}\n\n\treq, err := s.client.NewRequest(\"PUT\", u, interaction)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeInteractionRestrictionsPreview)\n\n\tvar repositoryInteractions *InteractionRestriction\n\tresp, err := s.client.Do(ctx, req, &repositoryInteractions)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn repositoryInteractions, resp, nil\n}\n\n// RemoveRestrictionsFromRepo removes the interaction restrictions for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/interactions/repos#remove-interaction-restrictions-for-a-repository\n//\n//meta:operation DELETE /repos/{owner}/{repo}/interaction-limits\nfunc (s *InteractionsService) RemoveRestrictionsFromRepo(ctx context.Context, owner, repo string) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/interaction-limits\", owner, repo)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeInteractionRestrictionsPreview)\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/interactions_repos_test.go",
    "content": "// Copyright 2018 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestInteractionsService_GetRestrictionsForRepo(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/interaction-limits\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeInteractionRestrictionsPreview)\n\t\tfmt.Fprint(w, `{\"origin\":\"repository\"}`)\n\t})\n\n\tctx := t.Context()\n\trepoInteractions, _, err := client.Interactions.GetRestrictionsForRepo(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Interactions.GetRestrictionsForRepo returned error: %v\", err)\n\t}\n\n\twant := &InteractionRestriction{Origin: Ptr(\"repository\")}\n\tif !cmp.Equal(repoInteractions, want) {\n\t\tt.Errorf(\"Interactions.GetRestrictionsForRepo returned %+v, want %+v\", repoInteractions, want)\n\t}\n\n\tconst methodName = \"GetRestrictionsForRepo\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Interactions.GetRestrictionsForRepo(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Interactions.GetRestrictionsForRepo(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestInteractionsService_UpdateRestrictionsForRepo(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &InteractionRestriction{Limit: Ptr(\"existing_users\")}\n\n\tmux.HandleFunc(\"/repos/o/r/interaction-limits\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *InteractionRestriction\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeInteractionRestrictionsPreview)\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\t\tfmt.Fprint(w, `{\"origin\":\"repository\"}`)\n\t})\n\n\tctx := t.Context()\n\trepoInteractions, _, err := client.Interactions.UpdateRestrictionsForRepo(ctx, \"o\", \"r\", input.GetLimit())\n\tif err != nil {\n\t\tt.Errorf(\"Interactions.UpdateRestrictionsForRepo returned error: %v\", err)\n\t}\n\n\twant := &InteractionRestriction{Origin: Ptr(\"repository\")}\n\tif !cmp.Equal(repoInteractions, want) {\n\t\tt.Errorf(\"Interactions.UpdateRestrictionsForRepo returned %+v, want %+v\", repoInteractions, want)\n\t}\n\n\tconst methodName = \"UpdateRestrictionsForRepo\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Interactions.UpdateRestrictionsForRepo(ctx, \"\\n\", \"\\n\", input.GetLimit())\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Interactions.UpdateRestrictionsForRepo(ctx, \"o\", \"r\", input.GetLimit())\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestInteractionsService_RemoveRestrictionsFromRepo(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/interaction-limits\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeInteractionRestrictionsPreview)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Interactions.RemoveRestrictionsFromRepo(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Interactions.RemoveRestrictionsFromRepo returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveRestrictionsFromRepo\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Interactions.RemoveRestrictionsFromRepo(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Interactions.RemoveRestrictionsFromRepo(ctx, \"o\", \"r\")\n\t})\n}\n"
  },
  {
    "path": "github/interactions_test.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport \"testing\"\n\nfunc TestInteractionRestriction_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &InteractionRestriction{}, \"{}\")\n\n\tu := &InteractionRestriction{\n\t\tLimit:     Ptr(\"limit\"),\n\t\tOrigin:    Ptr(\"origin\"),\n\t\tExpiresAt: &Timestamp{referenceTime},\n\t}\n\n\twant := `{\n\t\t\"limit\": \"limit\",\n\t\t\"origin\": \"origin\",\n\t\t\"expires_at\": ` + referenceTimeStr + `\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/issue_import.go",
    "content": "// Copyright 2020 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n)\n\n// IssueImportService handles communication with the issue import related\n// methods of the Issue Import GitHub API.\ntype IssueImportService service\n\n// IssueImportRequest represents a request to create an issue.\n//\n// https://gist.github.com/jonmagic/5282384165e0f86ef105#supported-issue-and-comment-fields\ntype IssueImportRequest struct {\n\tIssueImport IssueImport `json:\"issue\"`\n\tComments    []*Comment  `json:\"comments,omitempty\"`\n}\n\n// IssueImport represents body of issue to import.\ntype IssueImport struct {\n\tTitle     string     `json:\"title\"`\n\tBody      string     `json:\"body\"`\n\tCreatedAt *Timestamp `json:\"created_at,omitempty\"`\n\tClosedAt  *Timestamp `json:\"closed_at,omitempty\"`\n\tUpdatedAt *Timestamp `json:\"updated_at,omitempty\"`\n\tAssignee  *string    `json:\"assignee,omitempty\"`\n\tMilestone *int       `json:\"milestone,omitempty\"`\n\tClosed    *bool      `json:\"closed,omitempty\"`\n\tLabels    []string   `json:\"labels,omitempty\"`\n}\n\n// Comment represents comments of issue to import.\ntype Comment struct {\n\tCreatedAt *Timestamp `json:\"created_at,omitempty\"`\n\tBody      string     `json:\"body\"`\n}\n\n// IssueImportResponse represents the response of an issue import create request.\n//\n// https://gist.github.com/jonmagic/5282384165e0f86ef105#import-issue-response\ntype IssueImportResponse struct {\n\tID               *int                `json:\"id,omitempty\"`\n\tStatus           *string             `json:\"status,omitempty\"`\n\tURL              *string             `json:\"url,omitempty\"`\n\tImportIssuesURL  *string             `json:\"import_issues_url,omitempty\"`\n\tRepositoryURL    *string             `json:\"repository_url,omitempty\"`\n\tCreatedAt        *Timestamp          `json:\"created_at,omitempty\"`\n\tUpdatedAt        *Timestamp          `json:\"updated_at,omitempty\"`\n\tMessage          *string             `json:\"message,omitempty\"`\n\tDocumentationURL *string             `json:\"documentation_url,omitempty\"`\n\tErrors           []*IssueImportError `json:\"errors,omitempty\"`\n}\n\n// IssueImportError represents errors of an issue import create request.\ntype IssueImportError struct {\n\tLocation *string `json:\"location,omitempty\"`\n\tResource *string `json:\"resource,omitempty\"`\n\tField    *string `json:\"field,omitempty\"`\n\tValue    *string `json:\"value,omitempty\"`\n\tCode     *string `json:\"code,omitempty\"`\n}\n\n// Create a new imported issue on the specified repository.\n//\n// GitHub API docs: https://gist.github.com/jonmagic/5282384165e0f86ef105#start-an-issue-import\n//\n//meta:operation POST /repos/{owner}/{repo}/import/issues\nfunc (s *IssueImportService) Create(ctx context.Context, owner, repo string, issue *IssueImportRequest) (*IssueImportResponse, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/import/issues\", owner, repo)\n\treq, err := s.client.NewRequest(\"POST\", u, issue)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeIssueImportAPI)\n\n\tvar i IssueImportResponse\n\tresp, err := s.client.Do(ctx, req, &i)\n\tif err != nil {\n\t\tvar aerr *AcceptedError\n\t\tif errors.As(err, &aerr) {\n\t\t\tif err := json.Unmarshal(aerr.Raw, &i); err != nil {\n\t\t\t\treturn &i, resp, err\n\t\t\t}\n\t\t\treturn &i, resp, err\n\t\t}\n\t\treturn nil, resp, err\n\t}\n\n\treturn &i, resp, nil\n}\n\n// CheckStatus checks the status of an imported issue.\n//\n// GitHub API docs: https://gist.github.com/jonmagic/5282384165e0f86ef105#import-status-request\n//\n//meta:operation GET /repos/{owner}/{repo}/import/issues/{issue_number}\nfunc (s *IssueImportService) CheckStatus(ctx context.Context, owner, repo string, issueID int64) (*IssueImportResponse, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/import/issues/%v\", owner, repo, issueID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeIssueImportAPI)\n\n\tvar i *IssueImportResponse\n\tresp, err := s.client.Do(ctx, req, &i)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn i, resp, nil\n}\n\n// CheckStatusSince checks the status of multiple imported issues since a given date.\n//\n// GitHub API docs: https://gist.github.com/jonmagic/5282384165e0f86ef105#check-status-of-multiple-issues\n//\n//meta:operation GET /repos/{owner}/{repo}/import/issues\nfunc (s *IssueImportService) CheckStatusSince(ctx context.Context, owner, repo string, since Timestamp) ([]*IssueImportResponse, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/import/issues?since=%v\", owner, repo, since.Format(\"2006-01-02\"))\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeIssueImportAPI)\n\n\tvar b bytes.Buffer\n\tresp, err := s.client.Do(ctx, req, &b)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\tvar i []*IssueImportResponse\n\terr = json.Unmarshal(b.Bytes(), &i)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn i, resp, nil\n}\n"
  },
  {
    "path": "github/issue_import_test.go",
    "content": "// Copyright 2020 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestIssueImportService_Create(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tcreatedAt := time.Date(2020, time.August, 11, 15, 30, 0, 0, time.UTC)\n\tinput := &IssueImportRequest{\n\t\tIssueImport: IssueImport{\n\t\t\tAssignee:  Ptr(\"developer\"),\n\t\t\tBody:      \"Dummy description\",\n\t\t\tCreatedAt: &Timestamp{createdAt},\n\t\t\tLabels:    []string{\"l1\", \"l2\"},\n\t\t\tMilestone: Ptr(1),\n\t\t\tTitle:     \"Dummy Issue\",\n\t\t},\n\t\tComments: []*Comment{{\n\t\t\tCreatedAt: &Timestamp{createdAt},\n\t\t\tBody:      \"Comment body\",\n\t\t}},\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/import/issues\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *IssueImportRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeIssueImportAPI)\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tassertWrite(t, w, issueImportResponseJSON)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.IssueImport.Create(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Create returned error: %v\", err)\n\t}\n\n\twant := wantIssueImportResponse\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Create = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"Create\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.IssueImport.Create(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.IssueImport.Create(ctx, \"o\", \"r\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssueImportService_Create_deferred(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tcreatedAt := time.Date(2020, time.August, 11, 15, 30, 0, 0, time.UTC)\n\tinput := &IssueImportRequest{\n\t\tIssueImport: IssueImport{\n\t\t\tAssignee:  Ptr(\"developer\"),\n\t\t\tBody:      \"Dummy description\",\n\t\t\tCreatedAt: &Timestamp{createdAt},\n\t\t\tLabels:    []string{\"l1\", \"l2\"},\n\t\t\tMilestone: Ptr(1),\n\t\t\tTitle:     \"Dummy Issue\",\n\t\t},\n\t\tComments: []*Comment{{\n\t\t\tCreatedAt: &Timestamp{createdAt},\n\t\t\tBody:      \"Comment body\",\n\t\t}},\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/import/issues\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *IssueImportRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeIssueImportAPI)\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tw.WriteHeader(http.StatusAccepted)\n\t\tassertWrite(t, w, issueImportResponseJSON)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.IssueImport.Create(ctx, \"o\", \"r\", input)\n\n\tif !errors.As(err, new(*AcceptedError)) {\n\t\tt.Errorf(\"Create returned error: %v (want AcceptedError)\", err)\n\t}\n\n\twant := wantIssueImportResponse\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Create = %+v, want %+v\", got, want)\n\t}\n}\n\nfunc TestIssueImportService_Create_badResponse(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tcreatedAt := time.Date(2020, time.August, 11, 15, 30, 0, 0, time.UTC)\n\tinput := &IssueImportRequest{\n\t\tIssueImport: IssueImport{\n\t\t\tAssignee:  Ptr(\"developer\"),\n\t\t\tBody:      \"Dummy description\",\n\t\t\tCreatedAt: &Timestamp{createdAt},\n\t\t\tLabels:    []string{\"l1\", \"l2\"},\n\t\t\tMilestone: Ptr(1),\n\t\t\tTitle:     \"Dummy Issue\",\n\t\t},\n\t\tComments: []*Comment{{\n\t\t\tCreatedAt: &Timestamp{createdAt},\n\t\t\tBody:      \"Comment body\",\n\t\t}},\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/import/issues\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *IssueImportRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeIssueImportAPI)\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tw.WriteHeader(http.StatusAccepted)\n\t\tassertWrite(t, w, []byte(\"{[}\"))\n\t})\n\n\tctx := t.Context()\n\t_, _, err := client.IssueImport.Create(ctx, \"o\", \"r\", input)\n\n\tif err == nil || err.Error() != \"invalid character '[' looking for beginning of object key string\" {\n\t\tt.Errorf(\"unexpected error: %v\", err)\n\t}\n}\n\nfunc TestIssueImportService_Create_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.IssueImport.Create(ctx, \"%\", \"r\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestIssueImportService_CheckStatus(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/import/issues/3\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeIssueImportAPI)\n\t\tw.WriteHeader(http.StatusOK)\n\t\tassertWrite(t, w, issueImportResponseJSON)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.IssueImport.CheckStatus(ctx, \"o\", \"r\", 3)\n\tif err != nil {\n\t\tt.Errorf(\"CheckStatus returned error: %v\", err)\n\t}\n\n\twant := wantIssueImportResponse\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"CheckStatus = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"CheckStatus\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.IssueImport.CheckStatus(ctx, \"\\n\", \"\\n\", -3)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.IssueImport.CheckStatus(ctx, \"o\", \"r\", 3)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssueImportService_CheckStatus_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.IssueImport.CheckStatus(ctx, \"%\", \"r\", 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestIssueImportService_CheckStatusSince(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/import/issues\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeIssueImportAPI)\n\t\tw.WriteHeader(http.StatusOK)\n\t\tassertWrite(t, w, fmt.Appendf(nil, \"[%s]\", issueImportResponseJSON))\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.IssueImport.CheckStatusSince(ctx, \"o\", \"r\", Timestamp{time.Now()})\n\tif err != nil {\n\t\tt.Errorf(\"CheckStatusSince returned error: %v\", err)\n\t}\n\n\twant := []*IssueImportResponse{wantIssueImportResponse}\n\tif !cmp.Equal(want, got) {\n\t\tt.Errorf(\"CheckStatusSince = %v, want = %v\", got, want)\n\t}\n\n\tconst methodName = \"CheckStatusSince\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.IssueImport.CheckStatusSince(ctx, \"\\n\", \"\\n\", Timestamp{time.Now()})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.IssueImport.CheckStatusSince(ctx, \"o\", \"r\", Timestamp{time.Now()})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssueImportService_CheckStatusSince_badResponse(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/import/issues\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeIssueImportAPI)\n\t\tw.WriteHeader(http.StatusOK)\n\t\tassertWrite(t, w, []byte(\"{badly-formed JSON\"))\n\t})\n\n\tctx := t.Context()\n\tif _, _, err := client.IssueImport.CheckStatusSince(ctx, \"o\", \"r\", Timestamp{time.Now()}); err == nil {\n\t\tt.Error(\"CheckStatusSince returned no error, want JSON err\")\n\t}\n}\n\nfunc TestIssueImportService_CheckStatusSince_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.IssueImport.CheckStatusSince(ctx, \"%\", \"r\", Timestamp{time.Now()})\n\ttestURLParseError(t, err)\n}\n\nvar issueImportResponseJSON = []byte(`{\n\t\"id\": 3,\n\t\"status\": \"pending\",\n\t\"url\": \"https://api.github.com/repos/o/r/import/issues/3\",\n\t\"import_issues_url\": \"https://api.github.com/repos/o/r/import/issues\",\n\t\"repository_url\": \"https://api.github.com/repos/o/r\"\n}`)\n\nvar wantIssueImportResponse = &IssueImportResponse{\n\tID:              Ptr(3),\n\tStatus:          Ptr(\"pending\"),\n\tURL:             Ptr(\"https://api.github.com/repos/o/r/import/issues/3\"),\n\tImportIssuesURL: Ptr(\"https://api.github.com/repos/o/r/import/issues\"),\n\tRepositoryURL:   Ptr(\"https://api.github.com/repos/o/r\"),\n}\n\nfunc TestIssueImportError_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &IssueImportError{}, \"{}\")\n\n\tu := &IssueImportError{\n\t\tLocation: Ptr(\"loc\"),\n\t\tResource: Ptr(\"res\"),\n\t\tField:    Ptr(\"field\"),\n\t\tValue:    Ptr(\"value\"),\n\t\tCode:     Ptr(\"code\"),\n\t}\n\n\twant := `{\n\t\t\"location\": \"loc\",\n\t\t\"resource\": \"res\",\n\t\t\"field\": \"field\",\n\t\t\"value\": \"value\",\n\t\t\"code\": \"code\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestIssueImportResponse_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &IssueImportResponse{}, \"{}\")\n\n\tu := &IssueImportResponse{\n\t\tID:               Ptr(1),\n\t\tStatus:           Ptr(\"status\"),\n\t\tURL:              Ptr(\"url\"),\n\t\tImportIssuesURL:  Ptr(\"iiu\"),\n\t\tRepositoryURL:    Ptr(\"ru\"),\n\t\tCreatedAt:        &Timestamp{referenceTime},\n\t\tUpdatedAt:        &Timestamp{referenceTime},\n\t\tMessage:          Ptr(\"msg\"),\n\t\tDocumentationURL: Ptr(\"durl\"),\n\t\tErrors: []*IssueImportError{\n\t\t\t{\n\t\t\t\tLocation: Ptr(\"loc\"),\n\t\t\t\tResource: Ptr(\"res\"),\n\t\t\t\tField:    Ptr(\"field\"),\n\t\t\t\tValue:    Ptr(\"value\"),\n\t\t\t\tCode:     Ptr(\"code\"),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"status\": \"status\",\n\t\t\"url\": \"url\",\n\t\t\"import_issues_url\": \"iiu\",\n\t\t\"repository_url\": \"ru\",\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"message\": \"msg\",\n\t\t\"documentation_url\": \"durl\",\n\t\t\"errors\": [\n\t\t\t{\n\t\t\t\t\"location\": \"loc\",\n\t\t\t\t\"resource\": \"res\",\n\t\t\t\t\"field\": \"field\",\n\t\t\t\t\"value\": \"value\",\n\t\t\t\t\"code\": \"code\"\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestComment_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Comment{}, `{\"body\": \"\"}`)\n\n\tu := &Comment{\n\t\tCreatedAt: &Timestamp{referenceTime},\n\t\tBody:      \"body\",\n\t}\n\n\twant := `{\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"body\": \"body\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestIssueImport_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &IssueImport{}, `{\n\t\t\"title\": \"\",\n\t\t\"body\": \"\"\n\t}`)\n\n\tu := &IssueImport{\n\t\tTitle:     \"title\",\n\t\tBody:      \"body\",\n\t\tCreatedAt: &Timestamp{referenceTime},\n\t\tClosedAt:  &Timestamp{referenceTime},\n\t\tUpdatedAt: &Timestamp{referenceTime},\n\t\tAssignee:  Ptr(\"a\"),\n\t\tMilestone: Ptr(1),\n\t\tClosed:    Ptr(false),\n\t\tLabels:    []string{\"l\"},\n\t}\n\n\twant := `{\n\t\t\"title\": \"title\",\n\t\t\"body\": \"body\",\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"closed_at\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"assignee\": \"a\",\n\t\t\"milestone\": 1,\n\t\t\"closed\": false,\n\t\t\"labels\": [\n\t\t\t\"l\"\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestIssueImportRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &IssueImportRequest{}, `{\n\t\t\"issue\": {\n\t\t\t\"title\": \"\",\n\t\t\t\"body\": \"\"\n\t\t}\n\t}`)\n\n\tu := &IssueImportRequest{\n\t\tIssueImport: IssueImport{\n\t\t\tTitle:     \"title\",\n\t\t\tBody:      \"body\",\n\t\t\tCreatedAt: &Timestamp{referenceTime},\n\t\t\tClosedAt:  &Timestamp{referenceTime},\n\t\t\tUpdatedAt: &Timestamp{referenceTime},\n\t\t\tAssignee:  Ptr(\"a\"),\n\t\t\tMilestone: Ptr(1),\n\t\t\tClosed:    Ptr(false),\n\t\t\tLabels:    []string{\"l\"},\n\t\t},\n\t\tComments: []*Comment{\n\t\t\t{\n\t\t\t\tCreatedAt: &Timestamp{referenceTime},\n\t\t\t\tBody:      \"body\",\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"issue\": {\n\t\t\t\"title\": \"title\",\n\t\t\t\"body\": \"body\",\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"closed_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"assignee\": \"a\",\n\t\t\t\"milestone\": 1,\n\t\t\t\"closed\": false,\n\t\t\t\"labels\": [\n\t\t\t\t\"l\"\n\t\t\t]\n\t\t},\n\t\t\"comments\": [\n\t\t\t{\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"body\": \"body\"\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/issues.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n)\n\n// IssuesService handles communication with the issue related\n// methods of the GitHub API.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/\ntype IssuesService service\n\n// Issue represents a GitHub issue on a repository.\n//\n// Note: As far as the GitHub API is concerned, every pull request is an issue,\n// but not every issue is a pull request. Some endpoints, events, and webhooks\n// may also return pull requests via this struct. If PullRequestLinks is nil,\n// this is an issue, and if PullRequestLinks is not nil, this is a pull request.\n// The IsPullRequest helper method can be used to check that.\ntype Issue struct {\n\tID     *int64  `json:\"id,omitempty\"`\n\tNumber *int    `json:\"number,omitempty\"`\n\tState  *string `json:\"state,omitempty\"`\n\t// StateReason can be one of: \"completed\", \"not_planned\", \"reopened\".\n\tStateReason *string `json:\"state_reason,omitempty\"`\n\tLocked      *bool   `json:\"locked,omitempty\"`\n\tTitle       *string `json:\"title,omitempty\"`\n\tBody        *string `json:\"body,omitempty\"`\n\t// AuthorAssociation is the issue author's relationship to the repository.\n\t// Possible values are \"COLLABORATOR\", \"CONTRIBUTOR\", \"FIRST_TIMER\", \"FIRST_TIME_CONTRIBUTOR\", \"MEMBER\", \"OWNER\", or \"NONE\".\n\t//\n\t// Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025.\n\t// Use the Issues REST API endpoint to retrieve this information.\n\t// See: https://docs.github.com/rest/issues/issues#get-an-issue\n\tAuthorAssociation *string           `json:\"author_association,omitempty\"`\n\tUser              *User             `json:\"user,omitempty\"`\n\tLabels            []*Label          `json:\"labels,omitempty\"`\n\tAssignee          *User             `json:\"assignee,omitempty\"`\n\tComments          *int              `json:\"comments,omitempty\"`\n\tClosedAt          *Timestamp        `json:\"closed_at,omitempty\"`\n\tCreatedAt         *Timestamp        `json:\"created_at,omitempty\"`\n\tUpdatedAt         *Timestamp        `json:\"updated_at,omitempty\"`\n\tClosedBy          *User             `json:\"closed_by,omitempty\"`\n\tURL               *string           `json:\"url,omitempty\"`\n\tHTMLURL           *string           `json:\"html_url,omitempty\"`\n\tCommentsURL       *string           `json:\"comments_url,omitempty\"`\n\tEventsURL         *string           `json:\"events_url,omitempty\"`\n\tLabelsURL         *string           `json:\"labels_url,omitempty\"`\n\tRepositoryURL     *string           `json:\"repository_url,omitempty\"`\n\tParentIssueURL    *string           `json:\"parent_issue_url,omitempty\"`\n\tMilestone         *Milestone        `json:\"milestone,omitempty\"`\n\tPullRequestLinks  *PullRequestLinks `json:\"pull_request,omitempty\"`\n\tRepository        *Repository       `json:\"repository,omitempty\"`\n\tReactions         *Reactions        `json:\"reactions,omitempty\"`\n\tAssignees         []*User           `json:\"assignees,omitempty\"`\n\tNodeID            *string           `json:\"node_id,omitempty\"`\n\tDraft             *bool             `json:\"draft,omitempty\"`\n\tType              *IssueType        `json:\"type,omitempty\"`\n\n\t// TextMatches is only populated from search results that request text matches\n\t// See: search.go and https://docs.github.com/rest/search/#text-match-metadata\n\tTextMatches []*TextMatch `json:\"text_matches,omitempty\"`\n\n\t// ActiveLockReason is populated only when LockReason is provided while locking the issue.\n\t// Possible values are: \"off-topic\", \"too heated\", \"resolved\", and \"spam\".\n\tActiveLockReason *string `json:\"active_lock_reason,omitempty\"`\n}\n\nfunc (i Issue) String() string {\n\treturn Stringify(i)\n}\n\n// IsPullRequest reports whether the issue is also a pull request. It uses the\n// method recommended by GitHub's API documentation, which is to check whether\n// PullRequestLinks is non-nil.\nfunc (i Issue) IsPullRequest() bool {\n\treturn i.PullRequestLinks != nil\n}\n\n// IssueRequest represents a request to create/edit an issue.\n// It is separate from Issue above because otherwise Labels\n// and Assignee fail to serialize to the correct JSON.\ntype IssueRequest struct {\n\tTitle    *string   `json:\"title,omitempty\"`\n\tBody     *string   `json:\"body,omitempty\"`\n\tLabels   *[]string `json:\"labels,omitempty\"`\n\tAssignee *string   `json:\"assignee,omitempty\"`\n\tState    *string   `json:\"state,omitempty\"`\n\t// StateReason can be 'completed' or 'not_planned'.\n\tStateReason *string   `json:\"state_reason,omitempty\"`\n\tMilestone   *int      `json:\"milestone,omitempty\"`\n\tAssignees   *[]string `json:\"assignees,omitempty\"`\n\tType        *string   `json:\"type,omitempty\"`\n}\n\n// PullRequestLinks object is added to the Issue object when it's an issue included\n// in the IssueCommentEvent webhook payload, if the webhook is fired by a comment on a PR.\ntype PullRequestLinks struct {\n\tURL      *string    `json:\"url,omitempty\"`\n\tHTMLURL  *string    `json:\"html_url,omitempty\"`\n\tDiffURL  *string    `json:\"diff_url,omitempty\"`\n\tPatchURL *string    `json:\"patch_url,omitempty\"`\n\tMergedAt *Timestamp `json:\"merged_at,omitempty\"`\n}\n\n// IssueType represents the type of issue.\n// For now it shows up when receiving an Issue event.\ntype IssueType struct {\n\tID          *int64     `json:\"id,omitempty\"`\n\tNodeID      *string    `json:\"node_id,omitempty\"`\n\tName        *string    `json:\"name,omitempty\"`\n\tDescription *string    `json:\"description,omitempty\"`\n\tColor       *string    `json:\"color,omitempty\"`\n\tCreatedAt   *Timestamp `json:\"created_at,omitempty\"`\n\tUpdatedAt   *Timestamp `json:\"updated_at,omitempty\"`\n}\n\n// ListAllIssuesOptions specifies the optional parameters to the\n// IssuesService.ListAllIssues method.\ntype ListAllIssuesOptions struct {\n\t// Filter specifies which issues to list. Possible values are: assigned,\n\t// created, mentioned, subscribed, repos, all. Default is \"assigned\".\n\tFilter string `url:\"filter,omitempty\"`\n\n\t// State filters issues based on their state. Possible values are: open,\n\t// closed, all. Default is \"open\".\n\tState string `url:\"state,omitempty\"`\n\n\t// Labels filters issues based on their label.\n\tLabels []string `url:\"labels,comma,omitempty\"`\n\n\t// Sort specifies how to sort issues. Possible values are: created, updated,\n\t// and comments. Default value is \"created\".\n\tSort string `url:\"sort,omitempty\"`\n\n\t// Direction in which to sort issues. Possible values are: asc, desc.\n\t// Default is \"desc\".\n\tDirection string `url:\"direction,omitempty\"`\n\n\t// Since filters issues by time.\n\tSince time.Time `url:\"since,omitempty\"`\n\n\tCollab bool `url:\"collab,omitempty\"`\n\tOrgs   bool `url:\"orgs,omitempty\"`\n\tOwned  bool `url:\"owned,omitempty\"`\n\tPulls  bool `url:\"pulls,omitempty\"`\n\n\tListOptions\n}\n\n// ListAllIssues gets issues assigned to the authenticated user across all visible repositories including owned repositories,\n// member repositories, and organization repositories.\n// You can use the filter query parameter to fetch issues that are not necessarily assigned to you.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/issues#list-issues-assigned-to-the-authenticated-user\n//\n//meta:operation GET /issues\nfunc (s *IssuesService) ListAllIssues(ctx context.Context, opts *ListAllIssuesOptions) ([]*Issue, *Response, error) {\n\tu := \"issues\"\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeReactionsPreview)\n\n\tvar issues []*Issue\n\tresp, err := s.client.Do(ctx, req, &issues)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn issues, resp, nil\n}\n\n// ListUserIssuesOptions specifies the optional parameters to the\n// IssuesService.ListUserIssues method.\ntype ListUserIssuesOptions struct {\n\t// Filter specifies which issues to list. Possible values are: assigned,\n\t// created, mentioned, subscribed, repos, all. Default is \"assigned\".\n\tFilter string `url:\"filter,omitempty\"`\n\n\t// State filters issues based on their state. Possible values are: open,\n\t// closed, all. Default is \"open\".\n\tState string `url:\"state,omitempty\"`\n\n\t// Labels filters issues based on their label.\n\tLabels []string `url:\"labels,comma,omitempty\"`\n\n\t// Sort specifies how to sort issues. Possible values are: created, updated,\n\t// and comments. Default value is \"created\".\n\tSort string `url:\"sort,omitempty\"`\n\n\t// Direction in which to sort issues. Possible values are: asc, desc.\n\t// Default is \"desc\".\n\tDirection string `url:\"direction,omitempty\"`\n\n\t// Since filters issues by time.\n\tSince time.Time `url:\"since,omitempty\"`\n\n\tListOptions\n}\n\n// ListUserIssues gets issues across owned and member repositories assigned to the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/issues#list-user-account-issues-assigned-to-the-authenticated-user\n//\n//meta:operation GET /user/issues\nfunc (s *IssuesService) ListUserIssues(ctx context.Context, opts *ListUserIssuesOptions) ([]*Issue, *Response, error) {\n\tu := \"user/issues\"\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeReactionsPreview)\n\n\tvar issues []*Issue\n\tresp, err := s.client.Do(ctx, req, &issues)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn issues, resp, nil\n}\n\n// IssueListByOrgOptions specifies the optional parameters to the\n// IssuesService.ListByOrg method.\ntype IssueListByOrgOptions struct {\n\t// Filter specifies which issues to list. Possible values are: assigned,\n\t// created, mentioned, subscribed, repos, all. Default is \"assigned\".\n\tFilter string `url:\"filter,omitempty\"`\n\n\t// State filters issues based on their state. Possible values are: open,\n\t// closed, all. Default is \"open\".\n\tState string `url:\"state,omitempty\"`\n\n\t// Labels filters issues based on their label.\n\tLabels []string `url:\"labels,comma,omitempty\"`\n\n\t// Type can be the name of an issue type.\n\tType string `url:\"type,omitempty\"`\n\n\t// Sort specifies how to sort issues. Possible values are: created, updated,\n\t// and comments. Default value is \"created\".\n\tSort string `url:\"sort,omitempty\"`\n\n\t// Direction in which to sort issues. Possible values are: asc, desc.\n\t// Default is \"desc\".\n\tDirection string `url:\"direction,omitempty\"`\n\n\t// Since filters issues by time.\n\tSince time.Time `url:\"since,omitempty\"`\n\n\tListOptions\n}\n\n// ListByOrg fetches the issues in the specified organization for the\n// authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/issues#list-organization-issues-assigned-to-the-authenticated-user\n//\n//meta:operation GET /orgs/{org}/issues\nfunc (s *IssuesService) ListByOrg(ctx context.Context, org string, opts *IssueListByOrgOptions) ([]*Issue, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/issues\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeReactionsPreview)\n\n\tvar issues []*Issue\n\tresp, err := s.client.Do(ctx, req, &issues)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn issues, resp, nil\n}\n\n// IssueListByRepoOptions specifies the optional parameters to the\n// IssuesService.ListByRepo method.\ntype IssueListByRepoOptions struct {\n\t// Milestone limits issues for the specified milestone. Possible values are\n\t// a milestone number, \"none\" for issues with no milestone, \"*\" for issues\n\t// with any milestone.\n\tMilestone string `url:\"milestone,omitempty\"`\n\n\t// State filters issues based on their state. Possible values are: open,\n\t// closed, all. Default is \"open\".\n\tState string `url:\"state,omitempty\"`\n\n\t// Assignee filters issues based on their assignee. Possible values are a\n\t// user name, \"none\" for issues that are not assigned, \"*\" for issues with\n\t// any assigned user.\n\tAssignee string `url:\"assignee,omitempty\"`\n\n\t// Type can be the name of an issue type.\n\t// If the string * is passed, issues with any type are accepted.\n\t// If the string none is passed, issues without type are returned.\n\tType string `url:\"type,omitempty\"`\n\n\t// Creator filters issues based on their creator.\n\tCreator string `url:\"creator,omitempty\"`\n\n\t// Mentioned filters issues to those mentioned a specific user.\n\tMentioned string `url:\"mentioned,omitempty\"`\n\n\t// Labels filters issues based on their label.\n\tLabels []string `url:\"labels,omitempty,comma\"`\n\n\t// Sort specifies how to sort issues. Possible values are: created, updated,\n\t// and comments. Default value is \"created\".\n\tSort string `url:\"sort,omitempty\"`\n\n\t// Direction in which to sort issues. Possible values are: asc, desc.\n\t// Default is \"desc\".\n\tDirection string `url:\"direction,omitempty\"`\n\n\t// Since filters issues by time.\n\tSince time.Time `url:\"since,omitempty\"`\n\n\t// ListCursorOptions specifies the optional parameters for cursor pagination.\n\tListCursorOptions\n\n\t// Add ListOptions so offset pagination with integer type \"page\" query parameter is accepted\n\t// since ListCursorOptions accepts \"page\" as string only.\n\tListOptions\n}\n\n// ListByRepo lists the issues for the specified repository.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/issues#list-repository-issues\n//\n//meta:operation GET /repos/{owner}/{repo}/issues\nfunc (s *IssuesService) ListByRepo(ctx context.Context, owner, repo string, opts *IssueListByRepoOptions) ([]*Issue, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/issues\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeReactionsPreview)\n\n\tvar issues []*Issue\n\tresp, err := s.client.Do(ctx, req, &issues)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn issues, resp, nil\n}\n\n// Get a single issue.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/issues#get-an-issue\n//\n//meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}\nfunc (s *IssuesService) Get(ctx context.Context, owner, repo string, number int) (*Issue, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/issues/%v\", owner, repo, number)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeReactionsPreview)\n\n\tvar issue *Issue\n\tresp, err := s.client.Do(ctx, req, &issue)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn issue, resp, nil\n}\n\n// Create a new issue on the specified repository.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/issues#create-an-issue\n//\n//meta:operation POST /repos/{owner}/{repo}/issues\nfunc (s *IssuesService) Create(ctx context.Context, owner, repo string, issue *IssueRequest) (*Issue, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/issues\", owner, repo)\n\treq, err := s.client.NewRequest(\"POST\", u, issue)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar i *Issue\n\tresp, err := s.client.Do(ctx, req, &i)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn i, resp, nil\n}\n\n// Edit (update) an issue.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/issues#update-an-issue\n//\n//meta:operation PATCH /repos/{owner}/{repo}/issues/{issue_number}\nfunc (s *IssuesService) Edit(ctx context.Context, owner, repo string, number int, issue *IssueRequest) (*Issue, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/issues/%v\", owner, repo, number)\n\treq, err := s.client.NewRequest(\"PATCH\", u, issue)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar i *Issue\n\tresp, err := s.client.Do(ctx, req, &i)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn i, resp, nil\n}\n\n// RemoveMilestone removes a milestone from an issue.\n//\n// This is a helper method to explicitly update an issue with a `null` milestone, thereby removing it.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/issues#update-an-issue\n//\n//meta:operation PATCH /repos/{owner}/{repo}/issues/{issue_number}\nfunc (s *IssuesService) RemoveMilestone(ctx context.Context, owner, repo string, issueNumber int) (*Issue, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/issues/%v\", owner, repo, issueNumber)\n\treq, err := s.client.NewRequest(\"PATCH\", u, &struct {\n\t\tMilestone *Milestone `json:\"milestone\"`\n\t}{})\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar i *Issue\n\tresp, err := s.client.Do(ctx, req, &i)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn i, resp, nil\n}\n\n// LockIssueOptions specifies the optional parameters to the\n// IssuesService.Lock method.\ntype LockIssueOptions struct {\n\t// LockReason specifies the reason to lock this issue.\n\t// Providing a lock reason can help make it clearer to contributors why an issue\n\t// was locked. Possible values are: \"off-topic\", \"too heated\", \"resolved\", and \"spam\".\n\tLockReason string `json:\"lock_reason,omitempty\"`\n}\n\n// Lock an issue's conversation.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/issues#lock-an-issue\n//\n//meta:operation PUT /repos/{owner}/{repo}/issues/{issue_number}/lock\nfunc (s *IssuesService) Lock(ctx context.Context, owner, repo string, number int, opts *LockIssueOptions) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/issues/%v/lock\", owner, repo, number)\n\treq, err := s.client.NewRequest(\"PUT\", u, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// Unlock an issue's conversation.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/issues#unlock-an-issue\n//\n//meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock\nfunc (s *IssuesService) Unlock(ctx context.Context, owner, repo string, number int) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/issues/%v/lock\", owner, repo, number)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/issues_assignees.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// ListAssignees fetches all available assignees (owners and collaborators) to\n// which issues may be assigned.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/assignees#list-assignees\n//\n//meta:operation GET /repos/{owner}/{repo}/assignees\nfunc (s *IssuesService) ListAssignees(ctx context.Context, owner, repo string, opts *ListOptions) ([]*User, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/assignees\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar assignees []*User\n\tresp, err := s.client.Do(ctx, req, &assignees)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn assignees, resp, nil\n}\n\n// IsAssignee checks if a user is an assignee for the specified repository.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned\n//\n//meta:operation GET /repos/{owner}/{repo}/assignees/{assignee}\nfunc (s *IssuesService) IsAssignee(ctx context.Context, owner, repo, user string) (bool, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/assignees/%v\", owner, repo, user)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn false, nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tassignee, err := parseBoolResponse(err)\n\treturn assignee, resp, err\n}\n\n// AddAssignees adds the provided GitHub users as assignees to the issue.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/assignees#add-assignees-to-an-issue\n//\n//meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/assignees\nfunc (s *IssuesService) AddAssignees(ctx context.Context, owner, repo string, number int, assignees []string) (*Issue, *Response, error) {\n\tusers := &struct {\n\t\tAssignees []string `json:\"assignees,omitempty\"`\n\t}{Assignees: assignees}\n\tu := fmt.Sprintf(\"repos/%v/%v/issues/%v/assignees\", owner, repo, number)\n\treq, err := s.client.NewRequest(\"POST\", u, users)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar issue *Issue\n\tresp, err := s.client.Do(ctx, req, &issue)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn issue, resp, nil\n}\n\n// RemoveAssignees removes the provided GitHub users as assignees from the issue.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/assignees#remove-assignees-from-an-issue\n//\n//meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees\nfunc (s *IssuesService) RemoveAssignees(ctx context.Context, owner, repo string, number int, assignees []string) (*Issue, *Response, error) {\n\tusers := &struct {\n\t\tAssignees []string `json:\"assignees,omitempty\"`\n\t}{Assignees: assignees}\n\tu := fmt.Sprintf(\"repos/%v/%v/issues/%v/assignees\", owner, repo, number)\n\treq, err := s.client.NewRequest(\"DELETE\", u, users)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar issue *Issue\n\tresp, err := s.client.Do(ctx, req, &issue)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn issue, resp, nil\n}\n"
  },
  {
    "path": "github/issues_assignees_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestIssuesService_ListAssignees(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/assignees\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tassignees, _, err := client.Issues.ListAssignees(ctx, \"o\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Issues.ListAssignees returned error: %v\", err)\n\t}\n\n\twant := []*User{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(assignees, want) {\n\t\tt.Errorf(\"Issues.ListAssignees returned %+v, want %+v\", assignees, want)\n\t}\n\n\tconst methodName = \"ListAssignees\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.ListAssignees(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.ListAssignees(ctx, \"o\", \"r\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_ListAssignees_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Issues.ListAssignees(ctx, \"%\", \"r\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestIssuesService_IsAssignee_true(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/assignees/u\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t})\n\n\tctx := t.Context()\n\tassignee, _, err := client.Issues.IsAssignee(ctx, \"o\", \"r\", \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Issues.IsAssignee returned error: %v\", err)\n\t}\n\tif want := true; assignee != want {\n\t\tt.Errorf(\"Issues.IsAssignee returned %+v, want %+v\", assignee, want)\n\t}\n\n\tconst methodName = \"IsAssignee\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.IsAssignee(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.IsAssignee(ctx, \"o\", \"r\", \"u\")\n\t\tif got {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want false\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_IsAssignee_false(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/assignees/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tassignee, _, err := client.Issues.IsAssignee(ctx, \"o\", \"r\", \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Issues.IsAssignee returned error: %v\", err)\n\t}\n\tif want := false; assignee != want {\n\t\tt.Errorf(\"Issues.IsAssignee returned %+v, want %+v\", assignee, want)\n\t}\n\n\tconst methodName = \"IsAssignee\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.IsAssignee(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.IsAssignee(ctx, \"o\", \"r\", \"u\")\n\t\tif got {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want false\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_IsAssignee_error(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/assignees/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\thttp.Error(w, \"BadRequest\", http.StatusBadRequest)\n\t})\n\n\tctx := t.Context()\n\tassignee, _, err := client.Issues.IsAssignee(ctx, \"o\", \"r\", \"u\")\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 400 response\")\n\t}\n\tif want := false; assignee != want {\n\t\tt.Errorf(\"Issues.IsAssignee returned %+v, want %+v\", assignee, want)\n\t}\n\n\tconst methodName = \"IsAssignee\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.IsAssignee(ctx, \"o\", \"r\", \"u\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.IsAssignee(ctx, \"o\", \"r\", \"u\")\n\t\tif got {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want false\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_IsAssignee_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Issues.IsAssignee(ctx, \"%\", \"r\", \"u\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestIssuesService_AddAssignees(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/issues/1/assignees\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar assignees struct {\n\t\t\tAssignees []string `json:\"assignees,omitempty\"`\n\t\t}\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&assignees))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\twant := []string{\"user1\", \"user2\"}\n\t\tif !cmp.Equal(assignees.Assignees, want) {\n\t\t\tt.Errorf(\"assignees = %+v, want %+v\", assignees, want)\n\t\t}\n\t\tfmt.Fprint(w, `{\"number\":1,\"assignees\":[{\"login\":\"user1\"},{\"login\":\"user2\"}]}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Issues.AddAssignees(ctx, \"o\", \"r\", 1, []string{\"user1\", \"user2\"})\n\tif err != nil {\n\t\tt.Errorf(\"Issues.AddAssignees returned error: %v\", err)\n\t}\n\n\twant := &Issue{Number: Ptr(1), Assignees: []*User{{Login: Ptr(\"user1\")}, {Login: Ptr(\"user2\")}}}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Issues.AddAssignees = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"AddAssignees\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.AddAssignees(ctx, \"\\n\", \"\\n\", -1, []string{\"\\n\", \"\\n\"})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.AddAssignees(ctx, \"o\", \"r\", 1, []string{\"user1\", \"user2\"})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_RemoveAssignees(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/issues/1/assignees\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar assignees struct {\n\t\t\tAssignees []string `json:\"assignees,omitempty\"`\n\t\t}\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&assignees))\n\n\t\ttestMethod(t, r, \"DELETE\")\n\t\twant := []string{\"user1\", \"user2\"}\n\t\tif !cmp.Equal(assignees.Assignees, want) {\n\t\t\tt.Errorf(\"assignees = %+v, want %+v\", assignees, want)\n\t\t}\n\t\tfmt.Fprint(w, `{\"number\":1,\"assignees\":[]}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Issues.RemoveAssignees(ctx, \"o\", \"r\", 1, []string{\"user1\", \"user2\"})\n\tif err != nil {\n\t\tt.Errorf(\"Issues.RemoveAssignees returned error: %v\", err)\n\t}\n\n\twant := &Issue{Number: Ptr(1), Assignees: []*User{}}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Issues.RemoveAssignees = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"RemoveAssignees\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.RemoveAssignees(ctx, \"\\n\", \"\\n\", -1, []string{\"\\n\", \"\\n\"})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.RemoveAssignees(ctx, \"o\", \"r\", 1, []string{\"user1\", \"user2\"})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/issues_comments.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n)\n\n// IssueComment represents a comment left on an issue.\ntype IssueComment struct {\n\tID        *int64     `json:\"id,omitempty\"`\n\tNodeID    *string    `json:\"node_id,omitempty\"`\n\tBody      *string    `json:\"body,omitempty\"`\n\tUser      *User      `json:\"user,omitempty\"`\n\tReactions *Reactions `json:\"reactions,omitempty\"`\n\tCreatedAt *Timestamp `json:\"created_at,omitempty\"`\n\tUpdatedAt *Timestamp `json:\"updated_at,omitempty\"`\n\t// AuthorAssociation is the comment author's relationship to the issue's repository.\n\t// Possible values are \"COLLABORATOR\", \"CONTRIBUTOR\", \"FIRST_TIMER\", \"FIRST_TIME_CONTRIBUTOR\", \"MEMBER\", \"OWNER\", or \"NONE\".\n\t//\n\t// Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025.\n\t// Use the Issue Comments REST API endpoint to retrieve this information.\n\t// See: https://docs.github.com/rest/issues/comments#get-an-issue-comment\n\tAuthorAssociation *string `json:\"author_association,omitempty\"`\n\tURL               *string `json:\"url,omitempty\"`\n\tHTMLURL           *string `json:\"html_url,omitempty\"`\n\tIssueURL          *string `json:\"issue_url,omitempty\"`\n}\n\nfunc (i IssueComment) String() string {\n\treturn Stringify(i)\n}\n\n// IssueListCommentsOptions specifies the optional parameters to the\n// IssuesService.ListComments method.\ntype IssueListCommentsOptions struct {\n\t// Sort specifies how to sort comments. Possible values are: created, updated.\n\tSort *string `url:\"sort,omitempty\"`\n\n\t// Direction in which to sort comments. Possible values are: asc, desc.\n\tDirection *string `url:\"direction,omitempty\"`\n\n\t// Since filters comments by time.\n\tSince *time.Time `url:\"since,omitempty\"`\n\n\tListOptions\n}\n\n// ListComments lists all comments on the specified issue. Specifying an issue\n// number of 0 will return all comments on all issues for the repository.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/comments#list-issue-comments\n//\n// GitHub API docs: https://docs.github.com/rest/issues/comments#list-issue-comments-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/issues/comments\n//meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/comments\nfunc (s *IssuesService) ListComments(ctx context.Context, owner, repo string, number int, opts *IssueListCommentsOptions) ([]*IssueComment, *Response, error) {\n\tvar u string\n\tif number == 0 {\n\t\tu = fmt.Sprintf(\"repos/%v/%v/issues/comments\", owner, repo)\n\t} else {\n\t\tu = fmt.Sprintf(\"repos/%v/%v/issues/%v/comments\", owner, repo, number)\n\t}\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeReactionsPreview)\n\n\tvar comments []*IssueComment\n\tresp, err := s.client.Do(ctx, req, &comments)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn comments, resp, nil\n}\n\n// GetComment fetches the specified issue comment.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/comments#get-an-issue-comment\n//\n//meta:operation GET /repos/{owner}/{repo}/issues/comments/{comment_id}\nfunc (s *IssuesService) GetComment(ctx context.Context, owner, repo string, commentID int64) (*IssueComment, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/issues/comments/%v\", owner, repo, commentID)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeReactionsPreview)\n\n\tvar comment *IssueComment\n\tresp, err := s.client.Do(ctx, req, &comment)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn comment, resp, nil\n}\n\n// CreateComment creates a new comment on the specified issue.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/comments#create-an-issue-comment\n//\n//meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/comments\nfunc (s *IssuesService) CreateComment(ctx context.Context, owner, repo string, number int, comment *IssueComment) (*IssueComment, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/issues/%v/comments\", owner, repo, number)\n\treq, err := s.client.NewRequest(\"POST\", u, comment)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tvar c *IssueComment\n\tresp, err := s.client.Do(ctx, req, &c)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn c, resp, nil\n}\n\n// EditComment updates an issue comment.\n// A non-nil comment.Body must be provided. Other comment fields should be left nil.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/comments#update-an-issue-comment\n//\n//meta:operation PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}\nfunc (s *IssuesService) EditComment(ctx context.Context, owner, repo string, commentID int64, comment *IssueComment) (*IssueComment, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/issues/comments/%v\", owner, repo, commentID)\n\treq, err := s.client.NewRequest(\"PATCH\", u, comment)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tvar c *IssueComment\n\tresp, err := s.client.Do(ctx, req, &c)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn c, resp, nil\n}\n\n// DeleteComment deletes an issue comment.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/comments#delete-an-issue-comment\n//\n//meta:operation DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}\nfunc (s *IssuesService) DeleteComment(ctx context.Context, owner, repo string, commentID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/issues/comments/%v\", owner, repo, commentID)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/issues_comments_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestIssuesService_ListComments_allIssues(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/issues/comments\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\t\ttestFormValues(t, r, values{\n\t\t\t\"sort\":      \"updated\",\n\t\t\t\"direction\": \"desc\",\n\t\t\t\"since\":     \"2002-02-10T15:30:00Z\",\n\t\t\t\"page\":      \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\tsince := time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC)\n\topt := &IssueListCommentsOptions{\n\t\tSort:        Ptr(\"updated\"),\n\t\tDirection:   Ptr(\"desc\"),\n\t\tSince:       &since,\n\t\tListOptions: ListOptions{Page: 2},\n\t}\n\tctx := t.Context()\n\tcomments, _, err := client.Issues.ListComments(ctx, \"o\", \"r\", 0, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Issues.ListComments returned error: %v\", err)\n\t}\n\n\twant := []*IssueComment{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(comments, want) {\n\t\tt.Errorf(\"Issues.ListComments returned %+v, want %+v\", comments, want)\n\t}\n\n\tconst methodName = \"ListComments\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.ListComments(ctx, \"\\n\", \"\\n\", -1, opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.ListComments(ctx, \"o\", \"r\", 0, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_ListComments_specificIssue(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/issues/1/comments\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\tctx := t.Context()\n\tcomments, _, err := client.Issues.ListComments(ctx, \"o\", \"r\", 1, nil)\n\tif err != nil {\n\t\tt.Errorf(\"Issues.ListComments returned error: %v\", err)\n\t}\n\n\twant := []*IssueComment{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(comments, want) {\n\t\tt.Errorf(\"Issues.ListComments returned %+v, want %+v\", comments, want)\n\t}\n\n\tconst methodName = \"ListComments\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.ListComments(ctx, \"\\n\", \"\\n\", -1, nil)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.ListComments(ctx, \"o\", \"r\", 1, nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_ListComments_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Issues.ListComments(ctx, \"%\", \"r\", 1, nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestIssuesService_GetComment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/issues/comments/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tcomment, _, err := client.Issues.GetComment(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Issues.GetComment returned error: %v\", err)\n\t}\n\n\twant := &IssueComment{ID: Ptr(int64(1))}\n\tif !cmp.Equal(comment, want) {\n\t\tt.Errorf(\"Issues.GetComment returned %+v, want %+v\", comment, want)\n\t}\n\n\tconst methodName = \"GetComment\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.GetComment(ctx, \"\\n\", \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.GetComment(ctx, \"o\", \"r\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_GetComment_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Issues.GetComment(ctx, \"%\", \"r\", 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestIssuesService_CreateComment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &IssueComment{Body: Ptr(\"b\")}\n\n\tmux.HandleFunc(\"/repos/o/r/issues/1/comments\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *IssueComment\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tcomment, _, err := client.Issues.CreateComment(ctx, \"o\", \"r\", 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"Issues.CreateComment returned error: %v\", err)\n\t}\n\n\twant := &IssueComment{ID: Ptr(int64(1))}\n\tif !cmp.Equal(comment, want) {\n\t\tt.Errorf(\"Issues.CreateComment returned %+v, want %+v\", comment, want)\n\t}\n\n\tconst methodName = \"CreateComment\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.CreateComment(ctx, \"\\n\", \"\\n\", -1, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.CreateComment(ctx, \"o\", \"r\", 1, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_CreateComment_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Issues.CreateComment(ctx, \"%\", \"r\", 1, nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestIssuesService_EditComment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &IssueComment{Body: Ptr(\"b\")}\n\n\tmux.HandleFunc(\"/repos/o/r/issues/comments/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *IssueComment\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tcomment, _, err := client.Issues.EditComment(ctx, \"o\", \"r\", 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"Issues.EditComment returned error: %v\", err)\n\t}\n\n\twant := &IssueComment{ID: Ptr(int64(1))}\n\tif !cmp.Equal(comment, want) {\n\t\tt.Errorf(\"Issues.EditComment returned %+v, want %+v\", comment, want)\n\t}\n\n\tconst methodName = \"EditComment\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.EditComment(ctx, \"\\n\", \"\\n\", -1, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.EditComment(ctx, \"o\", \"r\", 1, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_EditComment_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Issues.EditComment(ctx, \"%\", \"r\", 1, nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestIssuesService_DeleteComment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/issues/comments/1\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Issues.DeleteComment(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Issues.DeleteComments returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteComment\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Issues.DeleteComment(ctx, \"\\n\", \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Issues.DeleteComment(ctx, \"o\", \"r\", 1)\n\t})\n}\n\nfunc TestIssuesService_DeleteComment_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Issues.DeleteComment(ctx, \"%\", \"r\", 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestIssueComment_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &IssueComment{}, \"{}\")\n\n\tu := &IssueComment{\n\t\tID:     Ptr(int64(1)),\n\t\tNodeID: Ptr(\"nid\"),\n\t\tBody:   Ptr(\"body\"),\n\t\tUser: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t\tReactions:         &Reactions{TotalCount: Ptr(1)},\n\t\tCreatedAt:         &Timestamp{referenceTime},\n\t\tUpdatedAt:         &Timestamp{referenceTime},\n\t\tAuthorAssociation: Ptr(\"aa\"),\n\t\tURL:               Ptr(\"url\"),\n\t\tHTMLURL:           Ptr(\"hurl\"),\n\t\tIssueURL:          Ptr(\"iurl\"),\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"node_id\": \"nid\",\n\t\t\"body\": \"body\",\n\t\t\"user\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"reactions\": {\n\t\t\t\"total_count\": 1\n\t\t},\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"author_association\": \"aa\",\n\t\t\"url\": \"url\",\n\t\t\"html_url\": \"hurl\",\n\t\t\"issue_url\": \"iurl\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/issues_events.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// IssueEvent represents an event that occurred around an Issue or Pull Request.\ntype IssueEvent struct {\n\tID  *int64  `json:\"id,omitempty\"`\n\tURL *string `json:\"url,omitempty\"`\n\n\t// The User that generated this event.\n\tActor *User `json:\"actor,omitempty\"`\n\n\t// The action corresponding to the event.\n\tAction string `json:\"action,omitempty\"`\n\n\t// Event identifies the actual type of Event that occurred. Possible\n\t// values are:\n\t//\n\t//     closed\n\t//       The Actor closed the issue.\n\t//       If the issue was closed by commit message, CommitID holds the SHA1 hash of the commit.\n\t//\n\t//     merged\n\t//       The Actor merged into master a branch containing a commit mentioning the issue.\n\t//       CommitID holds the SHA1 of the merge commit.\n\t//\n\t//     referenced\n\t//       The Actor committed to master a commit mentioning the issue in its commit message.\n\t//       CommitID holds the SHA1 of the commit.\n\t//\n\t//     reopened, unlocked\n\t//       The Actor did that to the issue.\n\t//\n\t//     locked\n\t//       The Actor locked the issue.\n\t//       LockReason holds the reason of locking the issue (if provided while locking).\n\t//\n\t//     renamed\n\t//       The Actor changed the issue title from Rename.From to Rename.To.\n\t//\n\t//     mentioned\n\t//       Someone unspecified @mentioned the Actor [sic] in an issue comment body.\n\t//\n\t//     assigned, unassigned\n\t//       The Assigner assigned the issue to or removed the assignment from the Assignee.\n\t//\n\t//     labeled, unlabeled\n\t//       The Actor added or removed the Label from the issue.\n\t//\n\t//     milestoned, demilestoned\n\t//       The Actor added or removed the issue from the Milestone.\n\t//\n\t//     subscribed, unsubscribed\n\t//       The Actor subscribed to or unsubscribed from notifications for an issue.\n\t//\n\t//     head_ref_deleted, head_ref_restored\n\t//       The pull request’s branch was deleted or restored.\n\t//\n\t//    review_dismissed\n\t//       The review was dismissed and `DismissedReview` will be populated below.\n\t//\n\t//    review_requested, review_request_removed\n\t//       The Actor requested or removed the request for a review.\n\t//       RequestedReviewer or RequestedTeam, and ReviewRequester will be populated below.\n\t//\n\tEvent *string `json:\"event,omitempty\"`\n\n\tCreatedAt *Timestamp `json:\"created_at,omitempty\"`\n\tIssue     *Issue     `json:\"issue,omitempty\"`\n\n\t// Only present on certain events; see above.\n\tRepository            *Repository      `json:\"repository,omitempty\"`\n\tAssignee              *User            `json:\"assignee,omitempty\"`\n\tAssigner              *User            `json:\"assigner,omitempty\"`\n\tCommitID              *string          `json:\"commit_id,omitempty\"`\n\tMilestone             *Milestone       `json:\"milestone,omitempty\"`\n\tLabel                 *Label           `json:\"label,omitempty\"`\n\tRename                *Rename          `json:\"rename,omitempty\"`\n\tLockReason            *string          `json:\"lock_reason,omitempty\"`\n\tDismissedReview       *DismissedReview `json:\"dismissed_review,omitempty\"`\n\tRequestedReviewer     *User            `json:\"requested_reviewer,omitempty\"`\n\tRequestedTeam         *Team            `json:\"requested_team,omitempty\"`\n\tReviewRequester       *User            `json:\"review_requester,omitempty\"`\n\tPerformedViaGithubApp *App             `json:\"performed_via_github_app,omitempty\"`\n}\n\n// DismissedReview represents details for 'dismissed_review' events.\ntype DismissedReview struct {\n\t// State represents the state of the dismissed review.\n\t// Possible values are: \"commented\", \"approved\", and \"changes_requested\".\n\tState             *string `json:\"state,omitempty\"`\n\tReviewID          *int64  `json:\"review_id,omitempty\"`\n\tDismissalMessage  *string `json:\"dismissal_message,omitempty\"`\n\tDismissalCommitID *string `json:\"dismissal_commit_id,omitempty\"`\n}\n\n// ListIssueEvents lists events for the specified issue.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/events#list-issue-events\n//\n//meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/events\nfunc (s *IssuesService) ListIssueEvents(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*IssueEvent, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/issues/%v/events\", owner, repo, number)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeProjectCardDetailsPreview)\n\n\tvar events []*IssueEvent\n\tresp, err := s.client.Do(ctx, req, &events)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn events, resp, nil\n}\n\n// ListRepositoryEvents lists events for the specified repository.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/events#list-issue-events-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/issues/events\nfunc (s *IssuesService) ListRepositoryEvents(ctx context.Context, owner, repo string, opts *ListOptions) ([]*IssueEvent, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/issues/events\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar events []*IssueEvent\n\tresp, err := s.client.Do(ctx, req, &events)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn events, resp, nil\n}\n\n// GetEvent returns the specified issue event.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/events#get-an-issue-event\n//\n//meta:operation GET /repos/{owner}/{repo}/issues/events/{event_id}\nfunc (s *IssuesService) GetEvent(ctx context.Context, owner, repo string, id int64) (*IssueEvent, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/issues/events/%v\", owner, repo, id)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar event *IssueEvent\n\tresp, err := s.client.Do(ctx, req, &event)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn event, resp, nil\n}\n\n// Rename contains details for 'renamed' events.\ntype Rename struct {\n\tFrom *string `json:\"from,omitempty\"`\n\tTo   *string `json:\"to,omitempty\"`\n}\n\nfunc (r Rename) String() string {\n\treturn Stringify(r)\n}\n"
  },
  {
    "path": "github/issues_events_test.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestIssuesService_ListIssueEvents(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/issues/1/events\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeProjectCardDetailsPreview)\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\":     \"1\",\n\t\t\t\"per_page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &ListOptions{Page: 1, PerPage: 2}\n\tctx := t.Context()\n\tevents, _, err := client.Issues.ListIssueEvents(ctx, \"o\", \"r\", 1, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Issues.ListIssueEvents returned error: %v\", err)\n\t}\n\n\twant := []*IssueEvent{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(events, want) {\n\t\tt.Errorf(\"Issues.ListIssueEvents returned %+v, want %+v\", events, want)\n\t}\n\n\tconst methodName = \"ListIssueEvents\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.ListIssueEvents(ctx, \"\\n\", \"\\n\", -1, &ListOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.ListIssueEvents(ctx, \"o\", \"r\", 1, nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_ListRepositoryEvents(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/issues/events\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\":     \"1\",\n\t\t\t\"per_page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &ListOptions{Page: 1, PerPage: 2}\n\tctx := t.Context()\n\tevents, _, err := client.Issues.ListRepositoryEvents(ctx, \"o\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Issues.ListRepositoryEvents returned error: %v\", err)\n\t}\n\n\twant := []*IssueEvent{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(events, want) {\n\t\tt.Errorf(\"Issues.ListRepositoryEvents returned %+v, want %+v\", events, want)\n\t}\n\n\tconst methodName = \"ListRepositoryEvents\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.ListRepositoryEvents(ctx, \"\\n\", \"\\n\", &ListOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.ListRepositoryEvents(ctx, \"o\", \"r\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_GetEvent(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/issues/events/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tevent, _, err := client.Issues.GetEvent(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Issues.GetEvent returned error: %v\", err)\n\t}\n\n\twant := &IssueEvent{ID: Ptr(int64(1))}\n\tif !cmp.Equal(event, want) {\n\t\tt.Errorf(\"Issues.GetEvent returned %+v, want %+v\", event, want)\n\t}\n\n\tconst methodName = \"GetEvent\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.GetEvent(ctx, \"\\n\", \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.GetEvent(ctx, \"o\", \"r\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRename_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Rename{}, \"{}\")\n\n\tu := &Rename{\n\t\tFrom: Ptr(\"from\"),\n\t\tTo:   Ptr(\"to\"),\n\t}\n\n\twant := `{\n\t\t\"from\": \"from\",\n\t\t\"to\": \"to\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestDismissedReview_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &DismissedReview{}, \"{}\")\n\n\tu := &DismissedReview{\n\t\tState:             Ptr(\"state\"),\n\t\tReviewID:          Ptr(int64(1)),\n\t\tDismissalMessage:  Ptr(\"dm\"),\n\t\tDismissalCommitID: Ptr(\"dcid\"),\n\t}\n\n\twant := `{\n\t\t\"state\": \"state\",\n\t\t\"review_id\": 1,\n\t\t\"dismissal_message\": \"dm\",\n\t\t\"dismissal_commit_id\": \"dcid\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestIssueEvent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &IssueEvent{}, \"{}\")\n\n\tu := &IssueEvent{\n\t\tID:  Ptr(int64(1)),\n\t\tURL: Ptr(\"url\"),\n\t\tActor: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t\tEvent:     Ptr(\"event\"),\n\t\tCreatedAt: &Timestamp{referenceTime},\n\t\tIssue:     &Issue{ID: Ptr(int64(1))},\n\t\tAssignee: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t\tAssigner: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t\tCommitID:  Ptr(\"cid\"),\n\t\tMilestone: &Milestone{ID: Ptr(int64(1))},\n\t\tLabel:     &Label{ID: Ptr(int64(1))},\n\t\tRename: &Rename{\n\t\t\tFrom: Ptr(\"from\"),\n\t\t\tTo:   Ptr(\"to\"),\n\t\t},\n\t\tLockReason: Ptr(\"lr\"),\n\t\tDismissedReview: &DismissedReview{\n\t\t\tState:             Ptr(\"state\"),\n\t\t\tReviewID:          Ptr(int64(1)),\n\t\t\tDismissalMessage:  Ptr(\"dm\"),\n\t\t\tDismissalCommitID: Ptr(\"dcid\"),\n\t\t},\n\t\tRequestedReviewer: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t\tRequestedTeam: &Team{\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tNodeID:          Ptr(\"n\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tDescription:     Ptr(\"d\"),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tSlug:            Ptr(\"s\"),\n\t\t\tPermission:      Ptr(\"p\"),\n\t\t\tPrivacy:         Ptr(\"p\"),\n\t\t\tMembersCount:    Ptr(1),\n\t\t\tReposCount:      Ptr(1),\n\t\t\tMembersURL:      Ptr(\"m\"),\n\t\t\tRepositoriesURL: Ptr(\"r\"),\n\t\t\tOrganization: &Organization{\n\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t\tHTMLURL:   Ptr(\"h\"),\n\t\t\t\tName:      Ptr(\"n\"),\n\t\t\t\tCompany:   Ptr(\"c\"),\n\t\t\t\tBlog:      Ptr(\"b\"),\n\t\t\t\tLocation:  Ptr(\"l\"),\n\t\t\t\tEmail:     Ptr(\"e\"),\n\t\t\t},\n\t\t\tParent: &Team{\n\t\t\t\tID:           Ptr(int64(1)),\n\t\t\t\tNodeID:       Ptr(\"n\"),\n\t\t\t\tName:         Ptr(\"n\"),\n\t\t\t\tDescription:  Ptr(\"d\"),\n\t\t\t\tURL:          Ptr(\"u\"),\n\t\t\t\tSlug:         Ptr(\"s\"),\n\t\t\t\tPermission:   Ptr(\"p\"),\n\t\t\t\tPrivacy:      Ptr(\"p\"),\n\t\t\t\tMembersCount: Ptr(1),\n\t\t\t\tReposCount:   Ptr(1),\n\t\t\t},\n\t\t\tLDAPDN: Ptr(\"l\"),\n\t\t},\n\t\tPerformedViaGithubApp: &App{\n\t\t\tID:     Ptr(int64(1)),\n\t\t\tNodeID: Ptr(\"n\"),\n\t\t\tOwner: &User{\n\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t},\n\t\t\tName:        Ptr(\"n\"),\n\t\t\tDescription: Ptr(\"d\"),\n\t\t\tHTMLURL:     Ptr(\"h\"),\n\t\t\tExternalURL: Ptr(\"u\"),\n\t\t},\n\t\tReviewRequester: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"url\": \"url\",\n\t\t\"actor\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"event\": \"event\",\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"issue\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"assignee\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"assigner\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"commit_id\": \"cid\",\n\t\t\"milestone\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"label\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"rename\": {\n\t\t\t\"from\": \"from\",\n\t\t\t\"to\": \"to\"\n\t\t},\n\t\t\"lock_reason\": \"lr\",\n\t\t\"dismissed_review\": {\n\t\t\t\"state\": \"state\",\n\t\t\t\"review_id\": 1,\n\t\t\t\"dismissal_message\": \"dm\",\n\t\t\t\"dismissal_commit_id\": \"dcid\"\n\t\t},\n\t\t\"requested_reviewer\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"requested_team\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"slug\": \"s\",\n\t\t\t\"permission\": \"p\",\n\t\t\t\"privacy\": \"p\",\n\t\t\t\"members_count\": 1,\n\t\t\t\"repos_count\": 1,\n\t\t\t\"members_url\": \"m\",\n\t\t\t\"repositories_url\": \"r\",\n\t\t\t\"organization\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"html_url\": \"h\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\"\n\t\t\t},\n\t\t\t\"parent\": {\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"description\": \"d\",\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"slug\": \"s\",\n\t\t\t\t\"permission\": \"p\",\n\t\t\t\t\"privacy\": \"p\",\n\t\t\t\t\"members_count\": 1,\n\t\t\t\t\"repos_count\": 1\n\t\t\t},\n\t\t\t\"ldap_dn\": \"l\"\n\t\t},\n\t\t\"performed_via_github_app\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"owner\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"repos_url\": \"r\",\n\t\t\t\t\"events_url\": \"e\",\n\t\t\t\t\"avatar_url\": \"a\"\n\t\t\t},\n\t\t\t\"name\": \"n\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"html_url\": \"h\",\n\t\t\t\"external_url\": \"u\"\n\t\t},\n\t\t\"review_requester\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/issues_labels.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// Label represents a GitHub label on an Issue.\ntype Label struct {\n\tID          *int64  `json:\"id,omitempty\"`\n\tURL         *string `json:\"url,omitempty\"`\n\tName        *string `json:\"name,omitempty\"`\n\tColor       *string `json:\"color,omitempty\"`\n\tDescription *string `json:\"description,omitempty\"`\n\tDefault     *bool   `json:\"default,omitempty\"`\n\tNodeID      *string `json:\"node_id,omitempty\"`\n}\n\nfunc (l Label) String() string {\n\treturn Stringify(l)\n}\n\n// ListLabels lists all labels for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/labels#list-labels-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/labels\nfunc (s *IssuesService) ListLabels(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Label, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/labels\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar labels []*Label\n\tresp, err := s.client.Do(ctx, req, &labels)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn labels, resp, nil\n}\n\n// GetLabel gets a single label.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/labels#get-a-label\n//\n//meta:operation GET /repos/{owner}/{repo}/labels/{name}\nfunc (s *IssuesService) GetLabel(ctx context.Context, owner, repo, name string) (*Label, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/labels/%v\", owner, repo, name)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar label *Label\n\tresp, err := s.client.Do(ctx, req, &label)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn label, resp, nil\n}\n\n// CreateLabel creates a new label on the specified repository.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/labels#create-a-label\n//\n//meta:operation POST /repos/{owner}/{repo}/labels\nfunc (s *IssuesService) CreateLabel(ctx context.Context, owner, repo string, label *Label) (*Label, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/labels\", owner, repo)\n\treq, err := s.client.NewRequest(\"POST\", u, label)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar l *Label\n\tresp, err := s.client.Do(ctx, req, &l)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn l, resp, nil\n}\n\n// EditLabel edits a label.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/labels#update-a-label\n//\n//meta:operation PATCH /repos/{owner}/{repo}/labels/{name}\nfunc (s *IssuesService) EditLabel(ctx context.Context, owner, repo, name string, label *Label) (*Label, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/labels/%v\", owner, repo, name)\n\treq, err := s.client.NewRequest(\"PATCH\", u, label)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar l *Label\n\tresp, err := s.client.Do(ctx, req, &l)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn l, resp, nil\n}\n\n// DeleteLabel deletes a label.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/labels#delete-a-label\n//\n//meta:operation DELETE /repos/{owner}/{repo}/labels/{name}\nfunc (s *IssuesService) DeleteLabel(ctx context.Context, owner, repo, name string) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/labels/%v\", owner, repo, name)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// ListLabelsByIssue lists all labels for an issue.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/labels#list-labels-for-an-issue\n//\n//meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/labels\nfunc (s *IssuesService) ListLabelsByIssue(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Label, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/issues/%v/labels\", owner, repo, number)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar labels []*Label\n\tresp, err := s.client.Do(ctx, req, &labels)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn labels, resp, nil\n}\n\n// AddLabelsToIssue adds labels to an issue.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/labels#add-labels-to-an-issue\n//\n//meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/labels\nfunc (s *IssuesService) AddLabelsToIssue(ctx context.Context, owner, repo string, number int, labels []string) ([]*Label, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/issues/%v/labels\", owner, repo, number)\n\treq, err := s.client.NewRequest(\"POST\", u, labels)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar l []*Label\n\tresp, err := s.client.Do(ctx, req, &l)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn l, resp, nil\n}\n\n// RemoveLabelForIssue removes a label for an issue.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/labels#remove-a-label-from-an-issue\n//\n//meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}\nfunc (s *IssuesService) RemoveLabelForIssue(ctx context.Context, owner, repo string, number int, label string) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/issues/%v/labels/%v\", owner, repo, number, label)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// ReplaceLabelsForIssue replaces all labels for an issue.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/labels#set-labels-for-an-issue\n//\n//meta:operation PUT /repos/{owner}/{repo}/issues/{issue_number}/labels\nfunc (s *IssuesService) ReplaceLabelsForIssue(ctx context.Context, owner, repo string, number int, labels []string) ([]*Label, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/issues/%v/labels\", owner, repo, number)\n\treq, err := s.client.NewRequest(\"PUT\", u, labels)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar l []*Label\n\tresp, err := s.client.Do(ctx, req, &l)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn l, resp, nil\n}\n\n// RemoveLabelsForIssue removes all labels for an issue.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/labels#remove-all-labels-from-an-issue\n//\n//meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels\nfunc (s *IssuesService) RemoveLabelsForIssue(ctx context.Context, owner, repo string, number int) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/issues/%v/labels\", owner, repo, number)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// ListLabelsForMilestone lists labels for every issue in a milestone.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/labels#list-labels-for-issues-in-a-milestone\n//\n//meta:operation GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels\nfunc (s *IssuesService) ListLabelsForMilestone(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Label, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/milestones/%v/labels\", owner, repo, number)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar labels []*Label\n\tresp, err := s.client.Do(ctx, req, &labels)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn labels, resp, nil\n}\n"
  },
  {
    "path": "github/issues_labels_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestIssuesService_ListLabels(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/labels\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"name\": \"a\"},{\"name\": \"b\"}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tlabels, _, err := client.Issues.ListLabels(ctx, \"o\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Issues.ListLabels returned error: %v\", err)\n\t}\n\n\twant := []*Label{{Name: Ptr(\"a\")}, {Name: Ptr(\"b\")}}\n\tif !cmp.Equal(labels, want) {\n\t\tt.Errorf(\"Issues.ListLabels returned %+v, want %+v\", labels, want)\n\t}\n\n\tconst methodName = \"ListLabels\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.ListLabels(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.ListLabels(ctx, \"o\", \"r\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_ListLabels_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Issues.ListLabels(ctx, \"%\", \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestIssuesService_GetLabel(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/labels/n\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"url\":\"u\", \"name\": \"n\", \"color\": \"c\", \"description\": \"d\"}`)\n\t})\n\n\tctx := t.Context()\n\tlabel, _, err := client.Issues.GetLabel(ctx, \"o\", \"r\", \"n\")\n\tif err != nil {\n\t\tt.Errorf(\"Issues.GetLabel returned error: %v\", err)\n\t}\n\n\twant := &Label{URL: Ptr(\"u\"), Name: Ptr(\"n\"), Color: Ptr(\"c\"), Description: Ptr(\"d\")}\n\tif !cmp.Equal(label, want) {\n\t\tt.Errorf(\"Issues.GetLabel returned %+v, want %+v\", label, want)\n\t}\n\n\tconst methodName = \"GetLabel\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.GetLabel(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.GetLabel(ctx, \"o\", \"r\", \"n\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_GetLabel_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Issues.GetLabel(ctx, \"%\", \"%\", \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestIssuesService_CreateLabel(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &Label{Name: Ptr(\"n\")}\n\n\tmux.HandleFunc(\"/repos/o/r/labels\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *Label\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"url\":\"u\"}`)\n\t})\n\n\tctx := t.Context()\n\tlabel, _, err := client.Issues.CreateLabel(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Issues.CreateLabel returned error: %v\", err)\n\t}\n\n\twant := &Label{URL: Ptr(\"u\")}\n\tif !cmp.Equal(label, want) {\n\t\tt.Errorf(\"Issues.CreateLabel returned %+v, want %+v\", label, want)\n\t}\n\n\tconst methodName = \"CreateLabel\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.CreateLabel(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.CreateLabel(ctx, \"o\", \"r\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_CreateLabel_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Issues.CreateLabel(ctx, \"%\", \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestIssuesService_EditLabel(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &Label{Name: Ptr(\"z\")}\n\n\tmux.HandleFunc(\"/repos/o/r/labels/n\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *Label\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"url\":\"u\"}`)\n\t})\n\n\tctx := t.Context()\n\tlabel, _, err := client.Issues.EditLabel(ctx, \"o\", \"r\", \"n\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Issues.EditLabel returned error: %v\", err)\n\t}\n\n\twant := &Label{URL: Ptr(\"u\")}\n\tif !cmp.Equal(label, want) {\n\t\tt.Errorf(\"Issues.EditLabel returned %+v, want %+v\", label, want)\n\t}\n\n\tconst methodName = \"EditLabel\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.EditLabel(ctx, \"\\n\", \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.EditLabel(ctx, \"o\", \"r\", \"n\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_EditLabel_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Issues.EditLabel(ctx, \"%\", \"%\", \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestIssuesService_DeleteLabel(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/labels/n\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Issues.DeleteLabel(ctx, \"o\", \"r\", \"n\")\n\tif err != nil {\n\t\tt.Errorf(\"Issues.DeleteLabel returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteLabel\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Issues.DeleteLabel(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Issues.DeleteLabel(ctx, \"o\", \"r\", \"n\")\n\t})\n}\n\nfunc TestIssuesService_DeleteLabel_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Issues.DeleteLabel(ctx, \"%\", \"%\", \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestIssuesService_ListLabelsByIssue(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/issues/1/labels\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"name\":\"a\",\"id\":1},{\"name\":\"b\",\"id\":2}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tlabels, _, err := client.Issues.ListLabelsByIssue(ctx, \"o\", \"r\", 1, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Issues.ListLabelsByIssue returned error: %v\", err)\n\t}\n\n\twant := []*Label{\n\t\t{Name: Ptr(\"a\"), ID: Ptr(int64(1))},\n\t\t{Name: Ptr(\"b\"), ID: Ptr(int64(2))},\n\t}\n\tif !cmp.Equal(labels, want) {\n\t\tt.Errorf(\"Issues.ListLabelsByIssue returned %+v, want %+v\", labels, want)\n\t}\n\n\tconst methodName = \"ListLabelsByIssue\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.ListLabelsByIssue(ctx, \"\\n\", \"\\n\", -1, opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.ListLabelsByIssue(ctx, \"o\", \"r\", 1, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_ListLabelsByIssue_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Issues.ListLabelsByIssue(ctx, \"%\", \"%\", 1, nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestIssuesService_AddLabelsToIssue(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := []string{\"a\", \"b\"}\n\n\tmux.HandleFunc(\"/repos/o/r/issues/1/labels\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v []string\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `[{\"url\":\"u\"}]`)\n\t})\n\n\tctx := t.Context()\n\tlabels, _, err := client.Issues.AddLabelsToIssue(ctx, \"o\", \"r\", 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"Issues.AddLabelsToIssue returned error: %v\", err)\n\t}\n\n\twant := []*Label{{URL: Ptr(\"u\")}}\n\tif !cmp.Equal(labels, want) {\n\t\tt.Errorf(\"Issues.AddLabelsToIssue returned %+v, want %+v\", labels, want)\n\t}\n\n\tconst methodName = \"AddLabelsToIssue\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.AddLabelsToIssue(ctx, \"\\n\", \"\\n\", -1, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.AddLabelsToIssue(ctx, \"o\", \"r\", 1, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_AddLabelsToIssue_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Issues.AddLabelsToIssue(ctx, \"%\", \"%\", 1, nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestIssuesService_RemoveLabelForIssue(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/issues/1/labels/l\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Issues.RemoveLabelForIssue(ctx, \"o\", \"r\", 1, \"l\")\n\tif err != nil {\n\t\tt.Errorf(\"Issues.RemoveLabelForIssue returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveLabelForIssue\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Issues.RemoveLabelForIssue(ctx, \"\\n\", \"\\n\", -1, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Issues.RemoveLabelForIssue(ctx, \"o\", \"r\", 1, \"l\")\n\t})\n}\n\nfunc TestIssuesService_RemoveLabelForIssue_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Issues.RemoveLabelForIssue(ctx, \"%\", \"%\", 1, \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestIssuesService_ReplaceLabelsForIssue(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := []string{\"a\", \"b\"}\n\n\tmux.HandleFunc(\"/repos/o/r/issues/1/labels\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v []string\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `[{\"url\":\"u\"}]`)\n\t})\n\n\tctx := t.Context()\n\tlabels, _, err := client.Issues.ReplaceLabelsForIssue(ctx, \"o\", \"r\", 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"Issues.ReplaceLabelsForIssue returned error: %v\", err)\n\t}\n\n\twant := []*Label{{URL: Ptr(\"u\")}}\n\tif !cmp.Equal(labels, want) {\n\t\tt.Errorf(\"Issues.ReplaceLabelsForIssue returned %+v, want %+v\", labels, want)\n\t}\n\n\tconst methodName = \"ReplaceLabelsForIssue\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.ReplaceLabelsForIssue(ctx, \"\\n\", \"\\n\", -1, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.ReplaceLabelsForIssue(ctx, \"o\", \"r\", 1, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_ReplaceLabelsForIssue_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Issues.ReplaceLabelsForIssue(ctx, \"%\", \"%\", 1, nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestIssuesService_RemoveLabelsForIssue(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/issues/1/labels\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Issues.RemoveLabelsForIssue(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Issues.RemoveLabelsForIssue returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveLabelsForIssue\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Issues.RemoveLabelsForIssue(ctx, \"\\n\", \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Issues.RemoveLabelsForIssue(ctx, \"o\", \"r\", 1)\n\t})\n}\n\nfunc TestIssuesService_RemoveLabelsForIssue_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Issues.RemoveLabelsForIssue(ctx, \"%\", \"%\", 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestIssuesService_ListLabelsForMilestone(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/milestones/1/labels\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"name\": \"a\"},{\"name\": \"b\"}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tlabels, _, err := client.Issues.ListLabelsForMilestone(ctx, \"o\", \"r\", 1, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Issues.ListLabelsForMilestone returned error: %v\", err)\n\t}\n\n\twant := []*Label{{Name: Ptr(\"a\")}, {Name: Ptr(\"b\")}}\n\tif !cmp.Equal(labels, want) {\n\t\tt.Errorf(\"Issues.ListLabelsForMilestone returned %+v, want %+v\", labels, want)\n\t}\n\n\tconst methodName = \"ListLabelsForMilestone\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.ListLabelsForMilestone(ctx, \"\\n\", \"\\n\", -1, opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.ListLabelsForMilestone(ctx, \"o\", \"r\", 1, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_ListLabelsForMilestone_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Issues.ListLabelsForMilestone(ctx, \"%\", \"%\", 1, nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestLabel_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Label{}, \"{}\")\n\n\tu := &Label{\n\t\tID:          Ptr(int64(1)),\n\t\tURL:         Ptr(\"url\"),\n\t\tName:        Ptr(\"name\"),\n\t\tColor:       Ptr(\"color\"),\n\t\tDescription: Ptr(\"desc\"),\n\t\tDefault:     Ptr(false),\n\t\tNodeID:      Ptr(\"nid\"),\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"url\": \"url\",\n\t\t\"name\": \"name\",\n\t\t\"color\": \"color\",\n\t\t\"description\": \"desc\",\n\t\t\"default\": false,\n\t\t\"node_id\": \"nid\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/issues_milestones.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// Milestone represents a GitHub repository milestone.\ntype Milestone struct {\n\tURL          *string    `json:\"url,omitempty\"`\n\tHTMLURL      *string    `json:\"html_url,omitempty\"`\n\tLabelsURL    *string    `json:\"labels_url,omitempty\"`\n\tID           *int64     `json:\"id,omitempty\"`\n\tNumber       *int       `json:\"number,omitempty\"`\n\tState        *string    `json:\"state,omitempty\"`\n\tTitle        *string    `json:\"title,omitempty\"`\n\tDescription  *string    `json:\"description,omitempty\"`\n\tCreator      *User      `json:\"creator,omitempty\"`\n\tOpenIssues   *int       `json:\"open_issues,omitempty\"`\n\tClosedIssues *int       `json:\"closed_issues,omitempty\"`\n\tCreatedAt    *Timestamp `json:\"created_at,omitempty\"`\n\tUpdatedAt    *Timestamp `json:\"updated_at,omitempty\"`\n\tClosedAt     *Timestamp `json:\"closed_at,omitempty\"`\n\tDueOn        *Timestamp `json:\"due_on,omitempty\"`\n\tNodeID       *string    `json:\"node_id,omitempty\"`\n}\n\nfunc (m Milestone) String() string {\n\treturn Stringify(m)\n}\n\n// MilestoneListOptions specifies the optional parameters to the\n// IssuesService.ListMilestones method.\ntype MilestoneListOptions struct {\n\t// State filters milestones based on their state. Possible values are:\n\t// open, closed, all. Default is \"open\".\n\tState string `url:\"state,omitempty\"`\n\n\t// Sort specifies how to sort milestones. Possible values are: due_on, completeness.\n\t// Default value is \"due_on\".\n\tSort string `url:\"sort,omitempty\"`\n\n\t// Direction in which to sort milestones. Possible values are: asc, desc.\n\t// Default is \"asc\".\n\tDirection string `url:\"direction,omitempty\"`\n\n\tListOptions\n}\n\n// ListMilestones lists all milestones for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/milestones#list-milestones\n//\n//meta:operation GET /repos/{owner}/{repo}/milestones\nfunc (s *IssuesService) ListMilestones(ctx context.Context, owner, repo string, opts *MilestoneListOptions) ([]*Milestone, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/milestones\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar milestones []*Milestone\n\tresp, err := s.client.Do(ctx, req, &milestones)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn milestones, resp, nil\n}\n\n// GetMilestone gets a single milestone.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/milestones#get-a-milestone\n//\n//meta:operation GET /repos/{owner}/{repo}/milestones/{milestone_number}\nfunc (s *IssuesService) GetMilestone(ctx context.Context, owner, repo string, number int) (*Milestone, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/milestones/%v\", owner, repo, number)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar milestone *Milestone\n\tresp, err := s.client.Do(ctx, req, &milestone)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn milestone, resp, nil\n}\n\n// CreateMilestone creates a new milestone on the specified repository.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/milestones#create-a-milestone\n//\n//meta:operation POST /repos/{owner}/{repo}/milestones\nfunc (s *IssuesService) CreateMilestone(ctx context.Context, owner, repo string, milestone *Milestone) (*Milestone, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/milestones\", owner, repo)\n\treq, err := s.client.NewRequest(\"POST\", u, milestone)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar m *Milestone\n\tresp, err := s.client.Do(ctx, req, &m)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn m, resp, nil\n}\n\n// EditMilestone edits a milestone.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/milestones#update-a-milestone\n//\n//meta:operation PATCH /repos/{owner}/{repo}/milestones/{milestone_number}\nfunc (s *IssuesService) EditMilestone(ctx context.Context, owner, repo string, number int, milestone *Milestone) (*Milestone, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/milestones/%v\", owner, repo, number)\n\treq, err := s.client.NewRequest(\"PATCH\", u, milestone)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar m *Milestone\n\tresp, err := s.client.Do(ctx, req, &m)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn m, resp, nil\n}\n\n// DeleteMilestone deletes a milestone.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/milestones#delete-a-milestone\n//\n//meta:operation DELETE /repos/{owner}/{repo}/milestones/{milestone_number}\nfunc (s *IssuesService) DeleteMilestone(ctx context.Context, owner, repo string, number int) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/milestones/%v\", owner, repo, number)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/issues_milestones_test.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestIssuesService_ListMilestones(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/milestones\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"state\":     \"closed\",\n\t\t\t\"sort\":      \"due_date\",\n\t\t\t\"direction\": \"asc\",\n\t\t\t\"page\":      \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"number\":1}]`)\n\t})\n\n\topt := &MilestoneListOptions{\"closed\", \"due_date\", \"asc\", ListOptions{Page: 2}}\n\tctx := t.Context()\n\tmilestones, _, err := client.Issues.ListMilestones(ctx, \"o\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"IssuesService.ListMilestones returned error: %v\", err)\n\t}\n\n\twant := []*Milestone{{Number: Ptr(1)}}\n\tif !cmp.Equal(milestones, want) {\n\t\tt.Errorf(\"IssuesService.ListMilestones returned %+v, want %+v\", milestones, want)\n\t}\n\n\tconst methodName = \"ListMilestones\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.ListMilestones(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.ListMilestones(ctx, \"o\", \"r\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_ListMilestones_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Issues.ListMilestones(ctx, \"%\", \"r\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestIssuesService_GetMilestone(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/milestones/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"number\":1}`)\n\t})\n\n\tctx := t.Context()\n\tmilestone, _, err := client.Issues.GetMilestone(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"IssuesService.GetMilestone returned error: %v\", err)\n\t}\n\n\twant := &Milestone{Number: Ptr(1)}\n\tif !cmp.Equal(milestone, want) {\n\t\tt.Errorf(\"IssuesService.GetMilestone returned %+v, want %+v\", milestone, want)\n\t}\n\n\tconst methodName = \"GetMilestone\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.GetMilestone(ctx, \"\\n\", \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.GetMilestone(ctx, \"o\", \"r\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_GetMilestone_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Issues.GetMilestone(ctx, \"%\", \"r\", 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestIssuesService_CreateMilestone(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &Milestone{Title: Ptr(\"t\")}\n\n\tmux.HandleFunc(\"/repos/o/r/milestones\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *Milestone\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"number\":1}`)\n\t})\n\n\tctx := t.Context()\n\tmilestone, _, err := client.Issues.CreateMilestone(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"IssuesService.CreateMilestone returned error: %v\", err)\n\t}\n\n\twant := &Milestone{Number: Ptr(1)}\n\tif !cmp.Equal(milestone, want) {\n\t\tt.Errorf(\"IssuesService.CreateMilestone returned %+v, want %+v\", milestone, want)\n\t}\n\n\tconst methodName = \"CreateMilestone\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.CreateMilestone(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.CreateMilestone(ctx, \"o\", \"r\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_CreateMilestone_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Issues.CreateMilestone(ctx, \"%\", \"r\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestIssuesService_EditMilestone(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &Milestone{Title: Ptr(\"t\")}\n\n\tmux.HandleFunc(\"/repos/o/r/milestones/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *Milestone\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"number\":1}`)\n\t})\n\n\tctx := t.Context()\n\tmilestone, _, err := client.Issues.EditMilestone(ctx, \"o\", \"r\", 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"IssuesService.EditMilestone returned error: %v\", err)\n\t}\n\n\twant := &Milestone{Number: Ptr(1)}\n\tif !cmp.Equal(milestone, want) {\n\t\tt.Errorf(\"IssuesService.EditMilestone returned %+v, want %+v\", milestone, want)\n\t}\n\n\tconst methodName = \"EditMilestone\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.EditMilestone(ctx, \"\\n\", \"\\n\", -1, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.EditMilestone(ctx, \"o\", \"r\", 1, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_EditMilestone_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Issues.EditMilestone(ctx, \"%\", \"r\", 1, nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestIssuesService_DeleteMilestone(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/milestones/1\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Issues.DeleteMilestone(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"IssuesService.DeleteMilestone returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteMilestone\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Issues.DeleteMilestone(ctx, \"\\n\", \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Issues.DeleteMilestone(ctx, \"o\", \"r\", 1)\n\t})\n}\n\nfunc TestIssuesService_DeleteMilestone_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Issues.DeleteMilestone(ctx, \"%\", \"r\", 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestMilestone_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Milestone{}, \"{}\")\n\n\tu := &Milestone{\n\t\tURL:         Ptr(\"url\"),\n\t\tHTMLURL:     Ptr(\"hurl\"),\n\t\tLabelsURL:   Ptr(\"lurl\"),\n\t\tID:          Ptr(int64(1)),\n\t\tNumber:      Ptr(1),\n\t\tState:       Ptr(\"state\"),\n\t\tTitle:       Ptr(\"title\"),\n\t\tDescription: Ptr(\"desc\"),\n\t\tCreator: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"tu\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t\tOpenIssues:   Ptr(1),\n\t\tClosedIssues: Ptr(1),\n\t\tCreatedAt:    &Timestamp{referenceTime},\n\t\tUpdatedAt:    &Timestamp{referenceTime},\n\t\tClosedAt:     &Timestamp{referenceTime},\n\t\tDueOn:        &Timestamp{referenceTime},\n\t\tNodeID:       Ptr(\"nid\"),\n\t}\n\n\twant := `{\n\t\t\"url\": \"url\",\n\t\t\"html_url\": \"hurl\",\n\t\t\"labels_url\": \"lurl\",\n\t\t\"id\": 1,\n\t\t\"number\": 1,\n\t\t\"state\": \"state\",\n\t\t\"title\": \"title\",\n\t\t\"description\": \"desc\",\n\t\t\"creator\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"open_issues\": 1,\n\t\t\"closed_issues\": 1,\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"closed_at\": ` + referenceTimeStr + `,\n\t\t\"due_on\": ` + referenceTimeStr + `,\n\t\t\"node_id\": \"nid\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/issues_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestIssuesService_ListAllIssues(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/issues\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\t\ttestFormValues(t, r, values{\n\t\t\t\"filter\":    \"all\",\n\t\t\t\"state\":     \"closed\",\n\t\t\t\"labels\":    \"a,b\",\n\t\t\t\"sort\":      \"updated\",\n\t\t\t\"direction\": \"asc\",\n\t\t\t\"since\":     \"2026-01-02T00:00:00Z\",\n\t\t\t\"collab\":    \"true\",\n\t\t\t\"orgs\":      \"true\",\n\t\t\t\"owned\":     \"true\",\n\t\t\t\"pulls\":     \"true\",\n\t\t\t\"page\":      \"5\",\n\t\t\t\"per_page\":  \"10\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"number\":1}]`)\n\t})\n\n\topt := &ListAllIssuesOptions{\n\t\tFilter:      \"all\",\n\t\tState:       \"closed\",\n\t\tLabels:      []string{\"a\", \"b\"},\n\t\tSort:        \"updated\",\n\t\tDirection:   \"asc\",\n\t\tSince:       time.Date(2026, time.January, 2, 0, 0, 0, 0, time.UTC),\n\t\tCollab:      true,\n\t\tOrgs:        true,\n\t\tOwned:       true,\n\t\tPulls:       true,\n\t\tListOptions: ListOptions{Page: 5, PerPage: 10},\n\t}\n\tctx := t.Context()\n\tissues, _, err := client.Issues.ListAllIssues(ctx, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Issues.ListAllIssues returned error: %v\", err)\n\t}\n\n\twant := []*Issue{{Number: Ptr(1)}}\n\tif !cmp.Equal(issues, want) {\n\t\tt.Errorf(\"Issues.ListAllIssues = %+v, want %+v\", issues, want)\n\t}\n\n\tconst methodName = \"ListAllIssues\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.ListAllIssues(ctx, nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_ListUserIssues(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/issues\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\t\ttestFormValues(t, r, values{\n\t\t\t\"filter\":    \"all\",\n\t\t\t\"state\":     \"closed\",\n\t\t\t\"labels\":    \"a,b\",\n\t\t\t\"sort\":      \"updated\",\n\t\t\t\"direction\": \"asc\",\n\t\t\t\"since\":     \"2026-01-02T00:00:00Z\",\n\t\t\t\"per_page\":  \"4\",\n\t\t\t\"page\":      \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"number\":1}]`)\n\t})\n\n\tctx := t.Context()\n\topts := &ListUserIssuesOptions{\n\t\tFilter:      \"all\",\n\t\tState:       \"closed\",\n\t\tLabels:      []string{\"a\", \"b\"},\n\t\tSort:        \"updated\",\n\t\tDirection:   \"asc\",\n\t\tSince:       time.Date(2026, time.January, 2, 0, 0, 0, 0, time.UTC),\n\t\tListOptions: ListOptions{Page: 2, PerPage: 4},\n\t}\n\tissues, _, err := client.Issues.ListUserIssues(ctx, opts)\n\tif err != nil {\n\t\tt.Errorf(\"Issues.ListUserIssues returned error: %v\", err)\n\t}\n\n\twant := []*Issue{{Number: Ptr(1)}}\n\tif !cmp.Equal(issues, want) {\n\t\tt.Errorf(\"Issues.ListUserIssues = %+v, want %+v\", issues, want)\n\t}\n\n\tconst methodName = \"ListUserIssues\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.ListUserIssues(ctx, nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, nil)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_ListByOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/issues\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"filter\":    \"all\",\n\t\t\t\"state\":     \"closed\",\n\t\t\t\"labels\":    \"a,b\",\n\t\t\t\"type\":      \"bug\",\n\t\t\t\"sort\":      \"updated\",\n\t\t\t\"direction\": \"asc\",\n\t\t\t\"since\":     \"2026-01-02T00:00:00Z\",\n\t\t\t\"per_page\":  \"4\",\n\t\t\t\"page\":      \"2\",\n\t\t})\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\t\tfmt.Fprint(w, `[{\"number\":1}]`)\n\t})\n\n\tctx := t.Context()\n\topts := &IssueListByOrgOptions{\n\t\tFilter:      \"all\",\n\t\tState:       \"closed\",\n\t\tLabels:      []string{\"a\", \"b\"},\n\t\tType:        \"bug\",\n\t\tSort:        \"updated\",\n\t\tDirection:   \"asc\",\n\t\tSince:       time.Date(2026, time.January, 2, 0, 0, 0, 0, time.UTC),\n\t\tListOptions: ListOptions{Page: 2, PerPage: 4},\n\t}\n\tissues, _, err := client.Issues.ListByOrg(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Issues.ListByOrg returned error: %v\", err)\n\t}\n\n\twant := []*Issue{{Number: Ptr(1)}}\n\tif !cmp.Equal(issues, want) {\n\t\tt.Errorf(\"Issues.ListByOrg returned %+v, want %+v\", issues, want)\n\t}\n\n\tconst methodName = \"ListByOrg\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.ListByOrg(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.ListByOrg(ctx, \"o\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_ListByRepo(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/issues\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\t\ttestFormValues(t, r, values{\n\t\t\t\"milestone\": \"*\",\n\t\t\t\"state\":     \"closed\",\n\t\t\t\"assignee\":  \"a\",\n\t\t\t\"creator\":   \"c\",\n\t\t\t\"mentioned\": \"m\",\n\t\t\t\"labels\":    \"a,b\",\n\t\t\t\"sort\":      \"updated\",\n\t\t\t\"direction\": \"asc\",\n\t\t\t\"since\":     referenceTime.Format(time.RFC3339),\n\t\t\t\"per_page\":  \"1\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"number\":1}]`)\n\t})\n\n\t// IssueListByRepoOptions uses standard strings (not pointers) and ListCursorOptions\n\topt := &IssueListByRepoOptions{\n\t\tMilestone:         \"*\",\n\t\tState:             \"closed\",\n\t\tAssignee:          \"a\",\n\t\tCreator:           \"c\",\n\t\tMentioned:         \"m\",\n\t\tLabels:            []string{\"a\", \"b\"},\n\t\tSort:              \"updated\",\n\t\tDirection:         \"asc\",\n\t\tSince:             referenceTime,\n\t\tListCursorOptions: ListCursorOptions{PerPage: 1},\n\t}\n\n\tctx := t.Context()\n\tissues, _, err := client.Issues.ListByRepo(ctx, \"o\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Issues.ListByRepo returned error: %v\", err)\n\t}\n\n\twant := []*Issue{{Number: Ptr(1)}}\n\tif !cmp.Equal(issues, want) {\n\t\tt.Errorf(\"Issues.ListByRepo returned %+v, want %+v\", issues, want)\n\t}\n\n\tconst methodName = \"ListByRepo\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.ListByRepo(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.ListByRepo(ctx, \"o\", \"r\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_Get(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/issues/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\t\tfmt.Fprint(w, `{\"number\":1, \"author_association\": \"MEMBER\",\"labels\": [{\"url\": \"u\", \"name\": \"n\", \"color\": \"c\"}]}`)\n\t})\n\n\tctx := t.Context()\n\tissue, _, err := client.Issues.Get(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Issues.Get returned error: %v\", err)\n\t}\n\n\twant := &Issue{\n\t\tNumber:            Ptr(1),\n\t\tAuthorAssociation: Ptr(\"MEMBER\"),\n\t\tLabels: []*Label{{\n\t\t\tURL:   Ptr(\"u\"),\n\t\t\tName:  Ptr(\"n\"),\n\t\t\tColor: Ptr(\"c\"),\n\t\t}},\n\t}\n\tif !cmp.Equal(issue, want) {\n\t\tt.Errorf(\"Issues.Get returned %+v, want %+v\", issue, want)\n\t}\n\n\tconst methodName = \"Get\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.Get(ctx, \"\\n\", \"\\n\", 1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.Get(ctx, \"o\", \"r\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_Get_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Issues.Get(ctx, \"%\", \"r\", 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestIssuesService_Create(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &IssueRequest{\n\t\tTitle:    Ptr(\"t\"),\n\t\tBody:     Ptr(\"b\"),\n\t\tAssignee: Ptr(\"a\"),\n\t\tLabels:   &[]string{\"l1\", \"l2\"},\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/issues\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *IssueRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"number\":1}`)\n\t})\n\n\tctx := t.Context()\n\tissue, _, err := client.Issues.Create(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Issues.Create returned error: %v\", err)\n\t}\n\n\twant := &Issue{Number: Ptr(1)}\n\tif !cmp.Equal(issue, want) {\n\t\tt.Errorf(\"Issues.Create returned %+v, want %+v\", issue, want)\n\t}\n\n\tconst methodName = \"Create\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.Create(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.Create(ctx, \"o\", \"r\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_Create_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Issues.Create(ctx, \"%\", \"r\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestIssuesService_Edit(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &IssueRequest{Title: Ptr(\"t\"), Type: Ptr(\"bug\")}\n\n\tmux.HandleFunc(\"/repos/o/r/issues/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *IssueRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"number\":1, \"type\": {\"name\": \"bug\"}}`)\n\t})\n\n\tctx := t.Context()\n\tissue, _, err := client.Issues.Edit(ctx, \"o\", \"r\", 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"Issues.Edit returned error: %v\", err)\n\t}\n\n\twant := &Issue{Number: Ptr(1), Type: &IssueType{Name: Ptr(\"bug\")}}\n\tif !cmp.Equal(issue, want) {\n\t\tt.Errorf(\"Issues.Edit returned %+v, want %+v\", issue, want)\n\t}\n\n\tconst methodName = \"Edit\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.Edit(ctx, \"\\n\", \"\\n\", -1, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.Edit(ctx, \"o\", \"r\", 1, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_RemoveMilestone(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/issues/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tfmt.Fprint(w, `{\"number\":1}`)\n\t})\n\n\tctx := t.Context()\n\tissue, _, err := client.Issues.RemoveMilestone(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Issues.RemoveMilestone returned error: %v\", err)\n\t}\n\n\twant := &Issue{Number: Ptr(1)}\n\tif !cmp.Equal(issue, want) {\n\t\tt.Errorf(\"Issues.RemoveMilestone returned %+v, want %+v\", issue, want)\n\t}\n\n\tconst methodName = \"RemoveMilestone\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.RemoveMilestone(ctx, \"\\n\", \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.RemoveMilestone(ctx, \"o\", \"r\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestIssuesService_Edit_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Issues.Edit(ctx, \"%\", \"r\", 1, nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestIssuesService_Lock(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/issues/1/lock\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Issues.Lock(ctx, \"o\", \"r\", 1, nil); err != nil {\n\t\tt.Errorf(\"Issues.Lock returned error: %v\", err)\n\t}\n\n\tconst methodName = \"Lock\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Issues.Lock(ctx, \"\\n\", \"\\n\", -1, nil)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Issues.Lock(ctx, \"o\", \"r\", 1, nil)\n\t})\n}\n\nfunc TestIssuesService_LockWithReason(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/issues/1/lock\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\topt := &LockIssueOptions{LockReason: \"off-topic\"}\n\n\tctx := t.Context()\n\tif _, err := client.Issues.Lock(ctx, \"o\", \"r\", 1, opt); err != nil {\n\t\tt.Errorf(\"Issues.Lock returned error: %v\", err)\n\t}\n}\n\nfunc TestIssuesService_Unlock(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/issues/1/lock\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Issues.Unlock(ctx, \"o\", \"r\", 1); err != nil {\n\t\tt.Errorf(\"Issues.Unlock returned error: %v\", err)\n\t}\n\n\tconst methodName = \"Unlock\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Issues.Unlock(ctx, \"\\n\", \"\\n\", 1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Issues.Unlock(ctx, \"o\", \"r\", 1)\n\t})\n}\n\nfunc TestIsPullRequest(t *testing.T) {\n\tt.Parallel()\n\tvar i Issue\n\tif i.IsPullRequest() {\n\t\tt.Errorf(\"expected i.IsPullRequest (%v) to return false, got true\", i)\n\t}\n\ti.PullRequestLinks = &PullRequestLinks{URL: Ptr(\"http://example.com\")}\n\tif !i.IsPullRequest() {\n\t\tt.Errorf(\"expected i.IsPullRequest (%v) to return true, got false\", i)\n\t}\n}\n\nfunc TestLockIssueOptions_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &LockIssueOptions{}, \"{}\")\n\n\tu := &LockIssueOptions{\n\t\tLockReason: \"lr\",\n\t}\n\n\twant := `{\n\t\t\"lock_reason\": \"lr\"\n\t\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPullRequestLinks_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PullRequestLinks{}, \"{}\")\n\n\tu := &PullRequestLinks{\n\t\tURL:      Ptr(\"url\"),\n\t\tHTMLURL:  Ptr(\"hurl\"),\n\t\tDiffURL:  Ptr(\"durl\"),\n\t\tPatchURL: Ptr(\"purl\"),\n\t\tMergedAt: &Timestamp{referenceTime},\n\t}\n\n\twant := `{\n\t\t\"url\": \"url\",\n\t\t\"html_url\": \"hurl\",\n\t\t\"diff_url\": \"durl\",\n\t\t\"patch_url\": \"purl\",\n\t\t\"merged_at\": ` + referenceTimeStr + `\n\t\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestIssueRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &IssueRequest{}, \"{}\")\n\n\tu := &IssueRequest{\n\t\tTitle:     Ptr(\"url\"),\n\t\tBody:      Ptr(\"url\"),\n\t\tLabels:    &[]string{\"l\"},\n\t\tAssignee:  Ptr(\"url\"),\n\t\tState:     Ptr(\"url\"),\n\t\tMilestone: Ptr(1),\n\t\tAssignees: &[]string{\"a\"},\n\t\tType:      Ptr(\"issue_type\"),\n\t}\n\n\twant := `{\n\t\t\"title\": \"url\",\n\t\t\"body\": \"url\",\n\t\t\"labels\": [\n\t\t\t\"l\"\n\t\t],\n\t\t\"assignee\": \"url\",\n\t\t\"state\": \"url\",\n\t\t\"milestone\": 1,\n\t\t\"assignees\": [\n\t\t\t\"a\"\n\t\t],\n\t\t\"type\": \"issue_type\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestIssue_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Issue{}, \"{}\")\n\n\tu := &Issue{\n\t\tID:                Ptr(int64(1)),\n\t\tNumber:            Ptr(1),\n\t\tState:             Ptr(\"s\"),\n\t\tLocked:            Ptr(false),\n\t\tTitle:             Ptr(\"title\"),\n\t\tBody:              Ptr(\"body\"),\n\t\tAuthorAssociation: Ptr(\"aa\"),\n\t\tUser:              &User{ID: Ptr(int64(1))},\n\t\tLabels:            []*Label{{ID: Ptr(int64(1))}},\n\t\tAssignee:          &User{ID: Ptr(int64(1))},\n\t\tComments:          Ptr(1),\n\t\tClosedAt:          &Timestamp{referenceTime},\n\t\tCreatedAt:         &Timestamp{referenceTime},\n\t\tUpdatedAt:         &Timestamp{referenceTime},\n\t\tClosedBy:          &User{ID: Ptr(int64(1))},\n\t\tURL:               Ptr(\"url\"),\n\t\tHTMLURL:           Ptr(\"hurl\"),\n\t\tCommentsURL:       Ptr(\"curl\"),\n\t\tEventsURL:         Ptr(\"eurl\"),\n\t\tLabelsURL:         Ptr(\"lurl\"),\n\t\tRepositoryURL:     Ptr(\"rurl\"),\n\t\tParentIssueURL:    Ptr(\"piurl\"),\n\t\tMilestone:         &Milestone{ID: Ptr(int64(1))},\n\t\tPullRequestLinks:  &PullRequestLinks{URL: Ptr(\"url\")},\n\t\tRepository:        &Repository{ID: Ptr(int64(1))},\n\t\tReactions:         &Reactions{TotalCount: Ptr(1)},\n\t\tAssignees:         []*User{{ID: Ptr(int64(1))}},\n\t\tNodeID:            Ptr(\"nid\"),\n\t\tTextMatches:       []*TextMatch{{ObjectURL: Ptr(\"ourl\")}},\n\t\tActiveLockReason:  Ptr(\"alr\"),\n\t\tType:              &IssueType{Name: Ptr(\"bug\")},\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"number\": 1,\n\t\t\"state\": \"s\",\n\t\t\"locked\": false,\n\t\t\"title\": \"title\",\n\t\t\"body\": \"body\",\n\t\t\"author_association\": \"aa\",\n\t\t\"user\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"labels\": [\n\t\t\t{\n\t\t\t\t\"id\": 1\n\t\t\t}\n\t\t],\n\t\t\"assignee\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"comments\": 1,\n\t\t\"closed_at\": ` + referenceTimeStr + `,\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"closed_by\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"url\": \"url\",\n\t\t\"html_url\": \"hurl\",\n\t\t\"comments_url\": \"curl\",\n\t\t\"events_url\": \"eurl\",\n\t\t\"labels_url\": \"lurl\",\n\t\t\"repository_url\": \"rurl\",\n\t\t\"parent_issue_url\": \"piurl\",\n\t\t\"milestone\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"pull_request\": {\n\t\t\t\"url\": \"url\"\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"reactions\": {\n\t\t\t\"total_count\": 1\n\t\t},\n\t\t\"assignees\": [\n\t\t\t{\n\t\t\t\t\"id\": 1\n\t\t\t}\n\t\t],\n\t\t\"node_id\": \"nid\",\n\t\t\"text_matches\": [\n\t\t\t{\n\t\t\t\t\"object_url\": \"ourl\"\n\t\t\t}\n\t\t],\n\t\t\"active_lock_reason\": \"alr\",\n\t\t\"type\": {\n\t\t\t\"name\": \"bug\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/issues_timeline.go",
    "content": "// Copyright 2016 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strings\"\n)\n\n// Timeline represents an event that occurred around an Issue or Pull Request.\n//\n// It is similar to an IssueEvent but may contain more information.\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/events/issue-event-types\ntype Timeline struct {\n\tID        *int64  `json:\"id,omitempty\"`\n\tURL       *string `json:\"url,omitempty\"`\n\tCommitURL *string `json:\"commit_url,omitempty\"`\n\n\t// The User object that generated the event.\n\tActor *User `json:\"actor,omitempty\"`\n\n\t// The person who commented on the issue.\n\tUser *User `json:\"user,omitempty\"`\n\n\t// The person who authored the commit.\n\tAuthor *CommitAuthor `json:\"author,omitempty\"`\n\t// The person who committed the commit on behalf of the author.\n\tCommitter *CommitAuthor `json:\"committer,omitempty\"`\n\t// The SHA of the commit in the pull request.\n\tSHA *string `json:\"sha,omitempty\"`\n\t// The commit message.\n\tMessage *string `json:\"message,omitempty\"`\n\t// A list of parent commits.\n\tParents []*Commit `json:\"parents,omitempty\"`\n\n\t// Event identifies the actual type of Event that occurred. Possible values\n\t// are:\n\t//\n\t//     assigned\n\t//       The issue was assigned to the assignee.\n\t//\n\t//     closed\n\t//       The issue was closed by the actor. When the commit_id is present, it\n\t//       identifies the commit that closed the issue using \"closes / fixes #NN\"\n\t//       syntax.\n\t//\n\t//     commented\n\t//       A comment was added to the issue.\n\t//\n\t//     committed\n\t//       A commit was added to the pull request's 'HEAD' branch. Only provided\n\t//       for pull requests.\n\t//\n\t//     cross-referenced\n\t//       The issue was referenced from another issue. The 'source' attribute\n\t//       contains the 'id', 'actor', and 'url' of the reference's source.\n\t//\n\t//     demilestoned\n\t//       The issue was removed from a milestone.\n\t//\n\t//     head_ref_deleted\n\t//       The pull request's branch was deleted.\n\t//\n\t//     head_ref_restored\n\t//       The pull request's branch was restored.\n\t//\n\t//     labeled\n\t//       A label was added to the issue.\n\t//\n\t//     locked\n\t//       The issue was locked by the actor.\n\t//\n\t//     mentioned\n\t//       The actor was @mentioned in an issue body.\n\t//\n\t//     merged\n\t//       The issue was merged by the actor. The 'commit_id' attribute is the\n\t//       SHA1 of the HEAD commit that was merged.\n\t//\n\t//     milestoned\n\t//       The issue was added to a milestone.\n\t//\n\t//     referenced\n\t//       The issue was referenced from a commit message. The 'commit_id'\n\t//       attribute is the commit SHA1 of where that happened.\n\t//\n\t//     renamed\n\t//       The issue title was changed.\n\t//\n\t//     reopened\n\t//       The issue was reopened by the actor.\n\t//\n\t//     reviewed\n\t//       The pull request was reviewed.\n\t//\n\t//     review_requested\n\t//       The actor requested a review from a user or team.\n\t//       Reviewer and Requester/RequestedTeam will be populated.\n\t//\n\t//     review_request_removed\n\t//       The actor removed a review request from a user or team.\n\t//       Reviewer and Requester/RequestedTeam will be populated.\n\t//\n\t//     subscribed\n\t//       The actor subscribed to receive notifications for an issue.\n\t//\n\t//     unassigned\n\t//       The assignee was unassigned from the issue.\n\t//\n\t//     unlabeled\n\t//       A label was removed from the issue.\n\t//\n\t//     unlocked\n\t//       The issue was unlocked by the actor.\n\t//\n\t//     unsubscribed\n\t//       The actor unsubscribed to stop receiving notifications for an issue.\n\t//\n\tEvent *string `json:\"event,omitempty\"`\n\n\t// The string SHA of a commit that referenced this Issue or Pull Request.\n\tCommitID *string `json:\"commit_id,omitempty\"`\n\t// The timestamp indicating when the event occurred.\n\tCreatedAt *Timestamp `json:\"created_at,omitempty\"`\n\t// The Label object including `name` and `color` attributes. Only provided for\n\t// 'labeled' and 'unlabeled' events.\n\tLabel *Label `json:\"label,omitempty\"`\n\t// The User object which was assigned to (or unassigned from) this Issue or\n\t// Pull Request. Only provided for 'assigned' and 'unassigned' events.\n\tAssignee *User `json:\"assignee,omitempty\"`\n\tAssigner *User `json:\"assigner,omitempty\"`\n\n\t// The Milestone object including a 'title' attribute.\n\t// Only provided for 'milestoned' and 'demilestoned' events.\n\tMilestone *Milestone `json:\"milestone,omitempty\"`\n\t// The 'id', 'actor', and 'url' for the source of a reference from another issue.\n\t// Only provided for 'cross-referenced' events.\n\tSource *Source `json:\"source,omitempty\"`\n\t// An object containing rename details including 'from' and 'to' attributes.\n\t// Only provided for 'renamed' events.\n\tRename *Rename `json:\"rename,omitempty\"`\n\t// The state of a submitted review. Can be one of: 'commented',\n\t// 'changes_requested' or 'approved'.\n\t// Only provided for 'reviewed' events.\n\tState *string `json:\"state,omitempty\"`\n\n\t// The person requested to review the pull request.\n\tReviewer *User `json:\"requested_reviewer,omitempty\"`\n\t// RequestedTeam contains the team requested to review the pull request.\n\tRequestedTeam *Team `json:\"requested_team,omitempty\"`\n\t// The person who requested a review.\n\tRequester *User `json:\"review_requester,omitempty\"`\n\n\t// The review summary text.\n\tBody        *string    `json:\"body,omitempty\"`\n\tSubmittedAt *Timestamp `json:\"submitted_at,omitempty\"`\n\n\tPerformedViaGithubApp *App `json:\"performed_via_github_app,omitempty\"`\n}\n\n// Source represents a reference's source.\ntype Source struct {\n\tID    *int64  `json:\"id,omitempty\"`\n\tURL   *string `json:\"url,omitempty\"`\n\tActor *User   `json:\"actor,omitempty\"`\n\tType  *string `json:\"type,omitempty\"`\n\tIssue *Issue  `json:\"issue,omitempty\"`\n}\n\n// ListIssueTimeline lists events for the specified issue.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/timeline#list-timeline-events-for-an-issue\n//\n//meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/timeline\nfunc (s *IssuesService) ListIssueTimeline(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*Timeline, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/issues/%v/timeline\", owner, repo, number)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tacceptHeaders := []string{mediaTypeTimelinePreview, mediaTypeProjectCardDetailsPreview}\n\treq.Header.Set(\"Accept\", strings.Join(acceptHeaders, \", \"))\n\n\tvar events []*Timeline\n\tresp, err := s.client.Do(ctx, req, &events)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn events, resp, nil\n}\n"
  },
  {
    "path": "github/issues_timeline_test.go",
    "content": "// Copyright 2016 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestIssuesService_ListIssueTimeline(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\twantAcceptHeaders := []string{mediaTypeTimelinePreview, mediaTypeProjectCardDetailsPreview}\n\tmux.HandleFunc(\"/repos/o/r/issues/1/timeline\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", strings.Join(wantAcceptHeaders, \", \"))\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\":     \"1\",\n\t\t\t\"per_page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &ListOptions{Page: 1, PerPage: 2}\n\tctx := t.Context()\n\tevents, _, err := client.Issues.ListIssueTimeline(ctx, \"o\", \"r\", 1, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Issues.ListIssueTimeline returned error: %v\", err)\n\t}\n\n\twant := []*Timeline{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(events, want) {\n\t\tt.Errorf(\"Issues.ListIssueTimeline = %+v, want %+v\", events, want)\n\t}\n\n\tconst methodName = \"ListIssueTimeline\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Issues.ListIssueTimeline(ctx, \"\\n\", \"\\n\", -1, opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Issues.ListIssueTimeline(ctx, \"o\", \"r\", 1, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestSource_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Source{}, \"{}\")\n\n\tu := &Source{\n\t\tID:  Ptr(int64(1)),\n\t\tURL: Ptr(\"url\"),\n\t\tActor: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t\tType:  Ptr(\"type\"),\n\t\tIssue: &Issue{ID: Ptr(int64(1))},\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"url\": \"url\",\n\t\t\"actor\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t},\n\t\t\"type\": \"type\",\n\t\t\"issue\": {\n\t\t\t\"id\": 1\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestTimeline_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Timeline{}, \"{}\")\n\n\tu := &Timeline{\n\t\tID:        Ptr(int64(1)),\n\t\tURL:       Ptr(\"url\"),\n\t\tCommitURL: Ptr(\"curl\"),\n\t\tActor: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t\tEvent:     Ptr(\"event\"),\n\t\tCommitID:  Ptr(\"cid\"),\n\t\tCreatedAt: &Timestamp{referenceTime},\n\t\tLabel:     &Label{ID: Ptr(int64(1))},\n\t\tAssignee: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t\tMilestone: &Milestone{ID: Ptr(int64(1))},\n\t\tSource: &Source{\n\t\t\tID:  Ptr(int64(1)),\n\t\t\tURL: Ptr(\"url\"),\n\t\t\tActor: &User{\n\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\tURL:       Ptr(\"u\"),\n\t\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t},\n\t\t\tType:  Ptr(\"type\"),\n\t\t\tIssue: &Issue{ID: Ptr(int64(1))},\n\t\t},\n\t\tRename: &Rename{\n\t\t\tFrom: Ptr(\"from\"),\n\t\t\tTo:   Ptr(\"to\"),\n\t\t},\n\t\tState: Ptr(\"state\"),\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"url\": \"url\",\n\t\t\"commit_url\": \"curl\",\n\t\t\"actor\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"event\": \"event\",\n\t\t\"commit_id\": \"cid\",\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"label\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"assignee\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"milestone\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"source\": {\n\t\t\t\"id\": 1,\n\t\t\t\"url\": \"url\",\n\t\t\t\"actor\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"events_url\": \"e\",\n\t\t\t\t\"repos_url\": \"r\"\n\t\t\t},\n\t\t\t\"type\": \"type\",\n\t\t\t\"issue\": {\n\t\t\t\t\"id\": 1\n\t\t\t}\n\t\t},\n\t\t\"rename\": {\n\t\t\t\"from\": \"from\",\n\t\t\t\"to\": \"to\"\n\t\t},\n\t\t\"state\": \"state\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestTimeline_ReviewRequests(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/example-org/example-repo/issues/3/timeline\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\n\t\t    \"id\": 1234567890,\n\t\t    \"url\": \"http://example.com/timeline/1\",\n\t\t    \"actor\": {\n\t\t\t\"login\": \"actor-user\",\n\t\t\t\"id\": 1\n\t\t    },\n\t\t    \"event\": \"review_requested\",\n\t\t    \"created_at\": \"2006-01-02T15:04:05Z\",\n\t\t    \"requested_reviewer\": {\n\t\t\t\"login\": \"reviewer-user\",\n\t\t\t\"id\": 2\n\t\t    },\n\t\t    \"review_requester\": {\n\t\t\t\"login\": \"requester-user\",\n\t\t\t\"id\": 1\n\t\t    }\n\t\t},\n\t\t{\n\t\t    \"id\": 1234567891,\n\t\t    \"url\": \"http://example.com/timeline/2\",\n\t\t    \"actor\": {\n\t\t\t\"login\": \"actor-user\",\n\t\t\t\"id\": 1\n\t\t    },\n\t\t    \"event\": \"review_request_removed\",\n\t\t    \"created_at\": \"2006-01-02T15:04:05Z\",\n\t\t    \"requested_reviewer\": {\n\t\t\t\"login\": \"reviewer-user\",\n\t\t\t\"id\": 2\n\t\t    }\n\t\t}]`)\n\t})\n\n\tctx := t.Context()\n\tevents, _, err := client.Issues.ListIssueTimeline(ctx, \"example-org\", \"example-repo\", 3, nil)\n\tif err != nil {\n\t\tt.Errorf(\"Issues.ListIssueTimeline returned error: %v\", err)\n\t}\n\n\twant := []*Timeline{\n\t\t{\n\t\t\tID:  Ptr(int64(1234567890)),\n\t\t\tURL: Ptr(\"http://example.com/timeline/1\"),\n\t\t\tActor: &User{\n\t\t\t\tLogin: Ptr(\"actor-user\"),\n\t\t\t\tID:    Ptr(int64(1)),\n\t\t\t},\n\t\t\tEvent:     Ptr(\"review_requested\"),\n\t\t\tCreatedAt: &Timestamp{referenceTime},\n\t\t\tReviewer: &User{\n\t\t\t\tLogin: Ptr(\"reviewer-user\"),\n\t\t\t\tID:    Ptr(int64(2)),\n\t\t\t},\n\t\t\tRequester: &User{\n\t\t\t\tLogin: Ptr(\"requester-user\"),\n\t\t\t\tID:    Ptr(int64(1)),\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tID:  Ptr(int64(1234567891)),\n\t\t\tURL: Ptr(\"http://example.com/timeline/2\"),\n\t\t\tActor: &User{\n\t\t\t\tLogin: Ptr(\"actor-user\"),\n\t\t\t\tID:    Ptr(int64(1)),\n\t\t\t},\n\t\t\tEvent:     Ptr(\"review_request_removed\"),\n\t\t\tCreatedAt: &Timestamp{referenceTime},\n\t\t\tReviewer: &User{\n\t\t\t\tLogin: Ptr(\"reviewer-user\"),\n\t\t\t\tID:    Ptr(int64(2)),\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(events, want) {\n\t\tt.Errorf(\"Issues.ListIssueTimeline review request events = %+v, want %+v\", events, want)\n\t\tdiff := cmp.Diff(events, want)\n\t\tt.Errorf(\"Difference: %v\", diff)\n\t}\n}\n"
  },
  {
    "path": "github/licenses.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// LicensesService handles communication with the license related\n// methods of the GitHub API.\n//\n// GitHub API docs: https://docs.github.com/rest/licenses/\ntype LicensesService service\n\n// RepositoryLicense represents the license for a repository.\ntype RepositoryLicense struct {\n\tName *string `json:\"name,omitempty\"`\n\tPath *string `json:\"path,omitempty\"`\n\n\tSHA         *string  `json:\"sha,omitempty\"`\n\tSize        *int     `json:\"size,omitempty\"`\n\tURL         *string  `json:\"url,omitempty\"`\n\tHTMLURL     *string  `json:\"html_url,omitempty\"`\n\tGitURL      *string  `json:\"git_url,omitempty\"`\n\tDownloadURL *string  `json:\"download_url,omitempty\"`\n\tType        *string  `json:\"type,omitempty\"`\n\tContent     *string  `json:\"content,omitempty\"`\n\tEncoding    *string  `json:\"encoding,omitempty\"`\n\tLicense     *License `json:\"license,omitempty\"`\n}\n\nfunc (l RepositoryLicense) String() string {\n\treturn Stringify(l)\n}\n\n// License represents an open source license.\ntype License struct {\n\tKey  *string `json:\"key,omitempty\"`\n\tName *string `json:\"name,omitempty\"`\n\tURL  *string `json:\"url,omitempty\"`\n\n\tSPDXID         *string   `json:\"spdx_id,omitempty\"`\n\tHTMLURL        *string   `json:\"html_url,omitempty\"`\n\tFeatured       *bool     `json:\"featured,omitempty\"`\n\tDescription    *string   `json:\"description,omitempty\"`\n\tImplementation *string   `json:\"implementation,omitempty\"`\n\tPermissions    *[]string `json:\"permissions,omitempty\"`\n\tConditions     *[]string `json:\"conditions,omitempty\"`\n\tLimitations    *[]string `json:\"limitations,omitempty\"`\n\tBody           *string   `json:\"body,omitempty\"`\n}\n\nfunc (l License) String() string {\n\treturn Stringify(l)\n}\n\n// ListLicensesOptions specifies the optional parameters to the LicensesService.List method.\ntype ListLicensesOptions struct {\n\tFeatured *bool `url:\"featured,omitempty\"`\n\n\tListOptions\n}\n\n// List popular open source licenses.\n//\n// GitHub API docs: https://docs.github.com/rest/licenses/licenses#get-all-commonly-used-licenses\n//\n//meta:operation GET /licenses\nfunc (s *LicensesService) List(ctx context.Context, opts *ListLicensesOptions) ([]*License, *Response, error) {\n\tu := \"licenses\"\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar licenses []*License\n\tresp, err := s.client.Do(ctx, req, &licenses)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn licenses, resp, nil\n}\n\n// Get extended metadata for one license.\n//\n// GitHub API docs: https://docs.github.com/rest/licenses/licenses#get-a-license\n//\n//meta:operation GET /licenses/{license}\nfunc (s *LicensesService) Get(ctx context.Context, licenseName string) (*License, *Response, error) {\n\tu := fmt.Sprintf(\"licenses/%v\", licenseName)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar license *License\n\tresp, err := s.client.Do(ctx, req, &license)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn license, resp, nil\n}\n"
  },
  {
    "path": "github/licenses_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoryLicense_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RepositoryLicense{}, \"{}\")\n\n\trl := &RepositoryLicense{\n\t\tName:        Ptr(\"n\"),\n\t\tPath:        Ptr(\"p\"),\n\t\tSHA:         Ptr(\"s\"),\n\t\tSize:        Ptr(1),\n\t\tURL:         Ptr(\"u\"),\n\t\tHTMLURL:     Ptr(\"h\"),\n\t\tGitURL:      Ptr(\"g\"),\n\t\tDownloadURL: Ptr(\"d\"),\n\t\tType:        Ptr(\"t\"),\n\t\tContent:     Ptr(\"c\"),\n\t\tEncoding:    Ptr(\"e\"),\n\t\tLicense: &License{\n\t\t\tKey:            Ptr(\"k\"),\n\t\t\tName:           Ptr(\"n\"),\n\t\t\tURL:            Ptr(\"u\"),\n\t\t\tSPDXID:         Ptr(\"s\"),\n\t\t\tHTMLURL:        Ptr(\"h\"),\n\t\t\tFeatured:       Ptr(true),\n\t\t\tDescription:    Ptr(\"d\"),\n\t\t\tImplementation: Ptr(\"i\"),\n\t\t\tPermissions:    &[]string{\"p\"},\n\t\t\tConditions:     &[]string{\"c\"},\n\t\t\tLimitations:    &[]string{\"l\"},\n\t\t\tBody:           Ptr(\"b\"),\n\t\t},\n\t}\n\twant := `{\n\t\t\"name\": \"n\",\n\t\t\"path\": \"p\",\n\t\t\"sha\": \"s\",\n\t\t\"size\": 1,\n\t\t\"url\": \"u\",\n\t\t\"html_url\": \"h\",\n\t\t\"git_url\": \"g\",\n\t\t\"download_url\": \"d\",\n\t\t\"type\": \"t\",\n\t\t\"content\": \"c\",\n\t\t\"encoding\": \"e\",\n\t\t\"license\": {\n\t\t\t\"key\": \"k\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"spdx_id\": \"s\",\n\t\t\t\"html_url\": \"h\",\n\t\t\t\"featured\": true,\n\t\t\t\"description\": \"d\",\n\t\t\t\"implementation\": \"i\",\n\t\t\t\"permissions\": [\"p\"],\n\t\t\t\"conditions\": [\"c\"],\n\t\t\t\"limitations\": [\"l\"],\n\t\t\t\"body\": \"b\"\n\t\t}\n\t}`\n\ttestJSONMarshal(t, rl, want)\n}\n\nfunc TestLicense_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &License{}, \"{}\")\n\n\tl := &License{\n\t\tKey:            Ptr(\"k\"),\n\t\tName:           Ptr(\"n\"),\n\t\tURL:            Ptr(\"u\"),\n\t\tSPDXID:         Ptr(\"s\"),\n\t\tHTMLURL:        Ptr(\"h\"),\n\t\tFeatured:       Ptr(true),\n\t\tDescription:    Ptr(\"d\"),\n\t\tImplementation: Ptr(\"i\"),\n\t\tPermissions:    &[]string{\"p\"},\n\t\tConditions:     &[]string{\"c\"},\n\t\tLimitations:    &[]string{\"l\"},\n\t\tBody:           Ptr(\"b\"),\n\t}\n\twant := `{\n\t\t\"key\": \"k\",\n\t\t\"name\": \"n\",\n\t\t\"url\": \"u\",\n\t\t\"spdx_id\": \"s\",\n\t\t\"html_url\": \"h\",\n\t\t\"featured\": true,\n\t\t\"description\": \"d\",\n\t\t\"implementation\": \"i\",\n\t\t\"permissions\": [\"p\"],\n\t\t\"conditions\": [\"c\"],\n\t\t\"limitations\": [\"l\"],\n\t\t\"body\": \"b\"\n\t}`\n\ttestJSONMarshal(t, l, want)\n}\n\nfunc TestLicensesService_List(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/licenses\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"featured\": \"true\", \"page\": \"2\", \"per_page\": \"20\"})\n\t\tfmt.Fprint(w, `[{\"key\":\"mit\",\"name\":\"MIT\",\"spdx_id\":\"MIT\",\"url\":\"https://api.github.com/licenses/mit\",\"featured\":true}]`)\n\t})\n\n\topts := &ListLicensesOptions{Featured: Ptr(true), ListOptions: ListOptions{Page: 2, PerPage: 20}}\n\tctx := t.Context()\n\tlicenses, _, err := client.Licenses.List(ctx, opts)\n\tif err != nil {\n\t\tt.Errorf(\"Licenses.List returned error: %v\", err)\n\t}\n\n\twant := []*License{{\n\t\tKey:      Ptr(\"mit\"),\n\t\tName:     Ptr(\"MIT\"),\n\t\tSPDXID:   Ptr(\"MIT\"),\n\t\tURL:      Ptr(\"https://api.github.com/licenses/mit\"),\n\t\tFeatured: Ptr(true),\n\t}}\n\tif !cmp.Equal(licenses, want) {\n\t\tt.Errorf(\"Licenses.List returned %+v, want %+v\", licenses, want)\n\t}\n\n\tconst methodName = \"List\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Licenses.List(ctx, opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestLicensesService_Get(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/licenses/mit\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"key\":\"mit\",\"name\":\"MIT\"}`)\n\t})\n\n\tctx := t.Context()\n\tlicense, _, err := client.Licenses.Get(ctx, \"mit\")\n\tif err != nil {\n\t\tt.Errorf(\"Licenses.Get returned error: %v\", err)\n\t}\n\n\twant := &License{Key: Ptr(\"mit\"), Name: Ptr(\"MIT\")}\n\tif !cmp.Equal(license, want) {\n\t\tt.Errorf(\"Licenses.Get returned %+v, want %+v\", license, want)\n\t}\n\n\tconst methodName = \"Get\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Licenses.Get(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Licenses.Get(ctx, \"mit\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestLicensesService_Get_invalidTemplate(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Licenses.Get(ctx, \"%\")\n\ttestURLParseError(t, err)\n}\n"
  },
  {
    "path": "github/markdown.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"bytes\"\n\t\"context\"\n)\n\n// MarkdownService provides access to markdown-related functions in the GitHub API.\ntype MarkdownService service\n\n// MarkdownOptions specifies optional parameters to the Render method.\ntype MarkdownOptions struct {\n\t// Mode identifies the rendering mode. Possible values are:\n\t//   markdown - render a document as plain Render, just like\n\t//   README files are rendered.\n\t//\n\t//   gfm - to render a document as user-content, e.g. like user\n\t//   comments or issues are rendered. In GFM mode, hard line breaks are\n\t//   always taken into account, and issue and user mentions are linked\n\t//   accordingly.\n\t//\n\t// Default is \"markdown\".\n\tMode string\n\n\t// Context identifies the repository context. Only taken into account\n\t// when rendering as \"gfm\".\n\tContext string\n}\n\ntype markdownRenderRequest struct {\n\tText    *string `json:\"text,omitempty\"`\n\tMode    *string `json:\"mode,omitempty\"`\n\tContext *string `json:\"context,omitempty\"`\n}\n\n// Render renders an arbitrary Render document.\n//\n// GitHub API docs: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document\n//\n//meta:operation POST /markdown\nfunc (s *MarkdownService) Render(ctx context.Context, text string, opts *MarkdownOptions) (string, *Response, error) {\n\trequest := &markdownRenderRequest{Text: Ptr(text)}\n\tif opts != nil {\n\t\tif opts.Mode != \"\" {\n\t\t\trequest.Mode = Ptr(opts.Mode)\n\t\t}\n\t\tif opts.Context != \"\" {\n\t\t\trequest.Context = Ptr(opts.Context)\n\t\t}\n\t}\n\n\treq, err := s.client.NewRequest(\"POST\", \"markdown\", request)\n\tif err != nil {\n\t\treturn \"\", nil, err\n\t}\n\n\tvar buf bytes.Buffer\n\tresp, err := s.client.Do(ctx, req, &buf)\n\tif err != nil {\n\t\treturn \"\", resp, err\n\t}\n\n\treturn buf.String(), resp, nil\n}\n"
  },
  {
    "path": "github/markdown_test.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestMarkdownService_Markdown(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &markdownRenderRequest{\n\t\tText:    Ptr(\"# text #\"),\n\t\tMode:    Ptr(\"gfm\"),\n\t\tContext: Ptr(\"google/go-github\"),\n\t}\n\tmux.HandleFunc(\"/markdown\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *markdownRenderRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\t\tfmt.Fprint(w, `<h1>text</h1>`)\n\t})\n\n\tctx := t.Context()\n\tmd, _, err := client.Markdown.Render(ctx, \"# text #\", &MarkdownOptions{\n\t\tMode:    \"gfm\",\n\t\tContext: \"google/go-github\",\n\t})\n\tif err != nil {\n\t\tt.Errorf(\"Render returned error: %v\", err)\n\t}\n\n\tif want := \"<h1>text</h1>\"; want != md {\n\t\tt.Errorf(\"Render returned %+v, want %+v\", md, want)\n\t}\n\n\tconst methodName = \"Render\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Markdown.Render(ctx, \"# text #\", &MarkdownOptions{\n\t\t\tMode:    \"gfm\",\n\t\t\tContext: \"google/go-github\",\n\t\t})\n\t\tif got != \"\" {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestMarkdownRenderRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &markdownRenderRequest{}, \"{}\")\n\n\ta := &markdownRenderRequest{\n\t\tText:    Ptr(\"txt\"),\n\t\tMode:    Ptr(\"mode\"),\n\t\tContext: Ptr(\"ctx\"),\n\t}\n\n\twant := `{\n\t\t\"text\": \"txt\",\n\t\t\"mode\": \"mode\",\n\t\t\"context\": \"ctx\"\n\t}`\n\n\ttestJSONMarshal(t, a, want)\n}\n"
  },
  {
    "path": "github/messages.go",
    "content": "// Copyright 2016 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// This file provides functions for validating payloads from GitHub Webhooks.\n// GitHub API docs: https://developer.github.com/webhooks/securing/#validating-payloads-from-github\n\npackage github\n\nimport (\n\t\"crypto/hmac\"\n\t\"crypto/sha1\"\n\t\"crypto/sha256\"\n\t\"crypto/sha512\"\n\t\"encoding/hex\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"hash\"\n\t\"io\"\n\t\"maps\"\n\t\"mime\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"reflect\"\n\t\"slices\"\n\t\"strings\"\n)\n\nconst (\n\t// sha1Prefix is the prefix used by GitHub before the HMAC hexdigest.\n\tsha1Prefix = \"sha1\"\n\t// sha256Prefix and sha512Prefix are provided for future compatibility.\n\tsha256Prefix = \"sha256\"\n\tsha512Prefix = \"sha512\"\n\t// SHA1SignatureHeader is the GitHub header key used to pass the HMAC-SHA1 hexdigest.\n\tSHA1SignatureHeader = \"X-Hub-Signature\"\n\t// SHA256SignatureHeader is the GitHub header key used to pass the HMAC-SHA256 hexdigest.\n\tSHA256SignatureHeader = \"X-Hub-Signature-256\"\n\t// EventTypeHeader is the GitHub header key used to pass the event type.\n\tEventTypeHeader = \"X-Github-Event\"\n\t// DeliveryIDHeader is the GitHub header key used to pass the unique ID for the webhook event.\n\tDeliveryIDHeader = \"X-Github-Delivery\"\n)\n\nvar (\n\t// eventTypeMapping maps webhooks types to their corresponding go-github struct types.\n\teventTypeMapping = map[string]any{\n\t\t\"branch_protection_configuration\": &BranchProtectionConfigurationEvent{},\n\t\t\"branch_protection_rule\":          &BranchProtectionRuleEvent{},\n\t\t\"check_run\":                       &CheckRunEvent{},\n\t\t\"check_suite\":                     &CheckSuiteEvent{},\n\t\t\"code_scanning_alert\":             &CodeScanningAlertEvent{},\n\t\t\"commit_comment\":                  &CommitCommentEvent{},\n\t\t\"content_reference\":               &ContentReferenceEvent{},\n\t\t\"create\":                          &CreateEvent{},\n\t\t\"custom_property\":                 &CustomPropertyEvent{},\n\t\t\"custom_property_values\":          &CustomPropertyValuesEvent{},\n\t\t\"delete\":                          &DeleteEvent{},\n\t\t\"dependabot_alert\":                &DependabotAlertEvent{},\n\t\t\"deploy_key\":                      &DeployKeyEvent{},\n\t\t\"deployment\":                      &DeploymentEvent{},\n\t\t\"deployment_review\":               &DeploymentReviewEvent{},\n\t\t\"deployment_status\":               &DeploymentStatusEvent{},\n\t\t\"deployment_protection_rule\":      &DeploymentProtectionRuleEvent{},\n\t\t\"discussion\":                      &DiscussionEvent{},\n\t\t\"discussion_comment\":              &DiscussionCommentEvent{},\n\t\t\"fork\":                            &ForkEvent{},\n\t\t\"github_app_authorization\":        &GitHubAppAuthorizationEvent{},\n\t\t\"gollum\":                          &GollumEvent{},\n\t\t\"installation\":                    &InstallationEvent{},\n\t\t\"installation_repositories\":       &InstallationRepositoriesEvent{},\n\t\t\"installation_target\":             &InstallationTargetEvent{},\n\t\t\"issue_comment\":                   &IssueCommentEvent{},\n\t\t\"issues\":                          &IssuesEvent{},\n\t\t\"label\":                           &LabelEvent{},\n\t\t\"marketplace_purchase\":            &MarketplacePurchaseEvent{},\n\t\t\"member\":                          &MemberEvent{},\n\t\t\"membership\":                      &MembershipEvent{},\n\t\t\"merge_group\":                     &MergeGroupEvent{},\n\t\t\"meta\":                            &MetaEvent{},\n\t\t\"milestone\":                       &MilestoneEvent{},\n\t\t\"organization\":                    &OrganizationEvent{},\n\t\t\"org_block\":                       &OrgBlockEvent{},\n\t\t\"package\":                         &PackageEvent{},\n\t\t\"page_build\":                      &PageBuildEvent{},\n\t\t\"personal_access_token_request\":   &PersonalAccessTokenRequestEvent{},\n\t\t\"ping\":                            &PingEvent{},\n\t\t\"projects_v2\":                     &ProjectV2Event{},\n\t\t\"projects_v2_item\":                &ProjectV2ItemEvent{},\n\t\t\"public\":                          &PublicEvent{},\n\t\t\"pull_request\":                    &PullRequestEvent{},\n\t\t\"pull_request_review\":             &PullRequestReviewEvent{},\n\t\t\"pull_request_review_comment\":     &PullRequestReviewCommentEvent{},\n\t\t\"pull_request_review_thread\":      &PullRequestReviewThreadEvent{},\n\t\t\"pull_request_target\":             &PullRequestTargetEvent{},\n\t\t\"push\":                            &PushEvent{},\n\t\t\"registry_package\":                &RegistryPackageEvent{},\n\t\t\"repository\":                      &RepositoryEvent{},\n\t\t\"repository_dispatch\":             &RepositoryDispatchEvent{},\n\t\t\"repository_import\":               &RepositoryImportEvent{},\n\t\t\"repository_ruleset\":              &RepositoryRulesetEvent{},\n\t\t\"repository_vulnerability_alert\":  &RepositoryVulnerabilityAlertEvent{},\n\t\t\"release\":                         &ReleaseEvent{},\n\t\t\"secret_scanning_alert\":           &SecretScanningAlertEvent{},\n\t\t\"secret_scanning_alert_location\":  &SecretScanningAlertLocationEvent{},\n\t\t\"security_advisory\":               &SecurityAdvisoryEvent{},\n\t\t\"security_and_analysis\":           &SecurityAndAnalysisEvent{},\n\t\t\"sponsorship\":                     &SponsorshipEvent{},\n\t\t\"star\":                            &StarEvent{},\n\t\t\"status\":                          &StatusEvent{},\n\t\t\"team\":                            &TeamEvent{},\n\t\t\"team_add\":                        &TeamAddEvent{},\n\t\t\"user\":                            &UserEvent{},\n\t\t\"watch\":                           &WatchEvent{},\n\t\t\"workflow_dispatch\":               &WorkflowDispatchEvent{},\n\t\t\"workflow_job\":                    &WorkflowJobEvent{},\n\t\t\"workflow_run\":                    &WorkflowRunEvent{},\n\t}\n\t// Forward mapping of event types to the string names of the structs.\n\tmessageToTypeName = make(map[string]string, len(eventTypeMapping))\n\t// Inverse map of the above.\n\ttypeToMessageMapping = make(map[string]string, len(eventTypeMapping))\n)\n\nfunc init() {\n\tfor k, v := range eventTypeMapping {\n\t\ttypename := reflect.TypeOf(v).Elem().Name()\n\t\tmessageToTypeName[k] = typename\n\t\ttypeToMessageMapping[typename] = k\n\t}\n}\n\n// genMAC generates the HMAC signature for a message provided the secret key\n// and hashFunc.\nfunc genMAC(message, key []byte, hashFunc func() hash.Hash) []byte {\n\tmac := hmac.New(hashFunc, key)\n\tmac.Write(message)\n\treturn mac.Sum(nil)\n}\n\n// checkMAC reports whether messageMAC is a valid HMAC tag for message.\nfunc checkMAC(message, messageMAC, key []byte, hashFunc func() hash.Hash) bool {\n\texpectedMAC := genMAC(message, key, hashFunc)\n\treturn hmac.Equal(messageMAC, expectedMAC)\n}\n\n// messageMAC returns the hex-decoded HMAC tag from the signature and its\n// corresponding hash function.\nfunc messageMAC(signature string) ([]byte, func() hash.Hash, error) {\n\tif signature == \"\" {\n\t\treturn nil, nil, errors.New(\"missing signature\")\n\t}\n\tsigParts := strings.SplitN(signature, \"=\", 2)\n\tif len(sigParts) != 2 {\n\t\treturn nil, nil, fmt.Errorf(\"error parsing signature %q\", signature)\n\t}\n\n\tvar hashFunc func() hash.Hash\n\tswitch sigParts[0] {\n\tcase sha1Prefix:\n\t\thashFunc = sha1.New\n\tcase sha256Prefix:\n\t\thashFunc = sha256.New\n\tcase sha512Prefix:\n\t\thashFunc = sha512.New\n\tdefault:\n\t\treturn nil, nil, fmt.Errorf(\"unknown hash type prefix: %q\", sigParts[0])\n\t}\n\n\tbuf, err := hex.DecodeString(sigParts[1])\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"error decoding signature %q: %v\", signature, err)\n\t}\n\treturn buf, hashFunc, nil\n}\n\n// ValidatePayloadFromBody validates an incoming GitHub Webhook event request body\n// and returns the (JSON) payload.\n// The Content-Type header of the payload can be \"application/json\" or \"application/x-www-form-urlencoded\".\n// If the Content-Type is neither then an error is returned.\n// secretToken is the GitHub Webhook secret token.\n// If your webhook does not contain a secret token, you can pass an empty secretToken.\n// Webhooks without a secret token are not secure and should be avoided.\n//\n// Example usage:\n//\n//\tfunc (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n//\t\t// read signature from request\n//\t\tsignature := \"\"\n//\t\tpayload, err := github.ValidatePayloadFromBody(r.Header.Get(\"Content-Type\"), r.Body, signature, s.webhookSecretKey)\n//\t\tif err != nil { ... }\n//\t\t// Process payload...\n//\t}\nfunc ValidatePayloadFromBody(contentType string, readable io.Reader, signature string, secretToken []byte) (payload []byte, err error) {\n\tvar body []byte // Raw body that GitHub uses to calculate the signature.\n\n\tswitch contentType {\n\tcase \"application/json\":\n\t\tvar err error\n\t\tif body, err = io.ReadAll(readable); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// If the content type is application/json,\n\t\t// the JSON payload is just the original body.\n\t\tpayload = body\n\n\tcase \"application/x-www-form-urlencoded\":\n\t\t// payloadFormParam is the name of the form parameter that the JSON payload\n\t\t// will be in if a webhook has its content type set to application/x-www-form-urlencoded.\n\t\tconst payloadFormParam = \"payload\"\n\n\t\tvar err error\n\t\tif body, err = io.ReadAll(readable); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// If the content type is application/x-www-form-urlencoded,\n\t\t// the JSON payload will be under the \"payload\" form param.\n\t\tform, err := url.ParseQuery(string(body))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tpayload = []byte(form.Get(payloadFormParam))\n\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"webhook request has unsupported Content-Type %q\", contentType)\n\t}\n\n\t// Validate the signature if present or if one is expected (secretToken is non-empty).\n\tif len(secretToken) > 0 || len(signature) > 0 {\n\t\tif err := ValidateSignature(signature, body, secretToken); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn payload, nil\n}\n\n// ValidatePayload validates an incoming GitHub Webhook event request\n// and returns the (JSON) payload.\n// The Content-Type header of the payload can be \"application/json\" or \"application/x-www-form-urlencoded\".\n// If the Content-Type is neither then an error is returned.\n// secretToken is the GitHub Webhook secret token.\n// If your webhook does not contain a secret token, you can pass nil or an empty slice.\n// This is intended for local development purposes only and all webhooks should ideally set up a secret token.\n//\n// Example usage:\n//\n//\tfunc (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n//\t\tpayload, err := github.ValidatePayload(r, s.webhookSecretKey)\n//\t\tif err != nil { ... }\n//\t\t// Process payload...\n//\t}\nfunc ValidatePayload(r *http.Request, secretToken []byte) (payload []byte, err error) {\n\tsignature := r.Header.Get(SHA256SignatureHeader)\n\tif signature == \"\" {\n\t\tsignature = r.Header.Get(SHA1SignatureHeader)\n\t}\n\n\tcontentType, _, err := mime.ParseMediaType(r.Header.Get(\"Content-Type\"))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ValidatePayloadFromBody(contentType, r.Body, signature, secretToken)\n}\n\n// ValidateSignature validates the signature for the given payload.\n// signature is the GitHub hash signature delivered in the X-Hub-Signature header.\n// payload is the JSON payload sent by GitHub Webhooks.\n// secretToken is the GitHub Webhook secret token.\n//\n// GitHub API docs: https://developer.github.com/webhooks/securing/#validating-payloads-from-github\nfunc ValidateSignature(signature string, payload, secretToken []byte) error {\n\tmessageMAC, hashFunc, err := messageMAC(signature)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !checkMAC(payload, messageMAC, secretToken, hashFunc) {\n\t\treturn errors.New(\"payload signature check failed\")\n\t}\n\treturn nil\n}\n\n// WebHookType returns the event type of webhook request r.\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/events/github-event-types\nfunc WebHookType(r *http.Request) string {\n\treturn r.Header.Get(EventTypeHeader)\n}\n\n// DeliveryID returns the unique delivery ID of webhook request r.\n//\n// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/events/github-event-types\nfunc DeliveryID(r *http.Request) string {\n\treturn r.Header.Get(DeliveryIDHeader)\n}\n\n// ParseWebHook parses the event payload. For recognized event types, a\n// value of the corresponding struct type will be returned (as returned\n// by [Event.ParsePayload]). An error will be returned for unrecognized event\n// types.\n//\n// Example usage:\n//\n//\tfunc (s *GitHubEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n//\t\tpayload, err := github.ValidatePayload(r, s.webhookSecretKey)\n//\t\tif err != nil { ... }\n//\t\tevent, err := github.ParseWebHook(github.WebHookType(r), payload)\n//\t\tif err != nil { ... }\n//\t\tswitch event := event.(type) {\n//\t\tcase *github.CommitCommentEvent:\n//\t\t\tprocessCommitCommentEvent(event)\n//\t\tcase *github.CreateEvent:\n//\t\t\tprocessCreateEvent(event)\n//\t\t...\n//\t\t}\n//\t}\nfunc ParseWebHook(messageType string, payload []byte) (any, error) {\n\teventType, ok := messageToTypeName[messageType]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"unknown X-Github-Event in message: %v\", messageType)\n\t}\n\n\tevent := Event{\n\t\tType:       &eventType,\n\t\tRawPayload: (*json.RawMessage)(&payload),\n\t}\n\treturn event.ParsePayload()\n}\n\n// MessageTypes returns a sorted list of all the known GitHub event type strings\n// supported by go-github.\nfunc MessageTypes() []string {\n\treturn slices.Sorted(maps.Keys(eventTypeMapping))\n}\n\n// EventForType returns an empty struct matching the specified GitHub event type.\n// If messageType does not match any known event types, it returns nil.\nfunc EventForType(messageType string) any {\n\tprototype := eventTypeMapping[messageType]\n\tif prototype == nil {\n\t\treturn nil\n\t}\n\t// return a _copy_ of the pointed-to-object.  Unfortunately, for this we\n\t// need to use reflection.  If we store the actual objects in the map,\n\t// we still need to use reflection to convert from `any` to the actual\n\t// type, so this was deemed the lesser of two evils. (#2865)\n\treturn reflect.New(reflect.TypeOf(prototype).Elem()).Interface()\n}\n"
  },
  {
    "path": "github/messages_test.go",
    "content": "// Copyright 2016 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestMessageMAC_BadHashTypePrefix(t *testing.T) {\n\tt.Parallel()\n\tconst signature = \"bogus1=1234567\"\n\tif _, _, err := messageMAC(signature); err == nil {\n\t\tt.Fatal(\"messageMAC returned nil; wanted error\")\n\t}\n}\n\nfunc TestValidatePayload(t *testing.T) {\n\tt.Parallel()\n\tconst defaultBody = `{\"yo\":true}` // All tests below use the default request body and signature.\n\tconst defaultSignature = \"sha1=126f2c800419c60137ce748d7672e77b65cf16d6\"\n\tsecretKey := []byte(\"0123456789abcdef\")\n\ttests := []struct {\n\t\tsecretKey       []byte\n\t\tsignature       string\n\t\tsignatureHeader string\n\t\twantPayload     string\n\t}{\n\t\t// The following tests generate expected errors:\n\t\t{secretKey: secretKey},                           // Missing signature\n\t\t{secretKey: secretKey, signature: \"yo\"},          // Missing signature prefix\n\t\t{secretKey: secretKey, signature: \"sha1=yo\"},     // Signature not hex string\n\t\t{secretKey: secretKey, signature: \"sha1=012345\"}, // Invalid signature\n\t\t{signature: defaultSignature},                    // signature without secretKey\n\n\t\t// The following tests expect err=nil:\n\t\t{\n\t\t\t// no secretKey and no signature still passes validation\n\t\t\twantPayload: defaultBody,\n\t\t},\n\t\t{\n\t\t\tsecretKey:   secretKey,\n\t\t\tsignature:   defaultSignature,\n\t\t\twantPayload: defaultBody,\n\t\t},\n\t\t{\n\t\t\tsecretKey:   secretKey,\n\t\t\tsignature:   \"sha256=b1f8020f5b4cd42042f807dd939015c4a418bc1ff7f604dd55b0a19b5d953d9b\",\n\t\t\twantPayload: defaultBody,\n\t\t},\n\t\t{\n\t\t\tsecretKey:       secretKey,\n\t\t\tsignature:       \"sha256=b1f8020f5b4cd42042f807dd939015c4a418bc1ff7f604dd55b0a19b5d953d9b\",\n\t\t\tsignatureHeader: SHA256SignatureHeader,\n\t\t\twantPayload:     defaultBody,\n\t\t},\n\t\t{\n\t\t\tsecretKey:   secretKey,\n\t\t\tsignature:   \"sha512=8456767023c1195682e182a23b3f5d19150ecea598fde8cb85918f7281b16079471b1329f92b912c4d8bd7455cb159777db8f29608b20c7c87323ba65ae62e1f\",\n\t\t\twantPayload: defaultBody,\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\tbuf := bytes.NewBufferString(defaultBody)\n\t\treq, err := http.NewRequest(\"GET\", \"http://localhost/event\", buf)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"NewRequest: %v\", err)\n\t\t}\n\t\tif test.signature != \"\" {\n\t\t\tif test.signatureHeader != \"\" {\n\t\t\t\treq.Header.Set(test.signatureHeader, test.signature)\n\t\t\t} else {\n\t\t\t\treq.Header.Set(SHA1SignatureHeader, test.signature)\n\t\t\t}\n\t\t}\n\t\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\t\tgot, err := ValidatePayload(req, test.secretKey)\n\t\tif err != nil {\n\t\t\tif test.wantPayload != \"\" {\n\t\t\t\tt.Errorf(\"ValidatePayload(%#v): err = %v, want nil\", test, err)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif string(got) != test.wantPayload {\n\t\t\tt.Errorf(\"ValidatePayload = %q, want %q\", got, test.wantPayload)\n\t\t}\n\t}\n}\n\nfunc TestValidatePayload_FormGet(t *testing.T) {\n\tt.Parallel()\n\tpayload := `{\"yo\":true}`\n\tsignature := \"sha1=3374ef144403e8035423b23b02e2c9d7a4c50368\"\n\tsecretKey := []byte(\"0123456789abcdef\")\n\n\tform := url.Values{}\n\tform.Add(\"payload\", payload)\n\treq, err := http.NewRequest(\"POST\", \"http://localhost/event\", strings.NewReader(form.Encode()))\n\tif err != nil {\n\t\tt.Fatalf(\"NewRequest: %v\", err)\n\t}\n\treq.PostForm = form\n\treq.Header.Set(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\treq.Header.Set(SHA1SignatureHeader, signature)\n\n\tgot, err := ValidatePayload(req, secretKey)\n\tif err != nil {\n\t\tt.Errorf(\"ValidatePayload(%#v): err = %v, want nil\", payload, err)\n\t}\n\tif string(got) != payload {\n\t\tt.Errorf(\"ValidatePayload = %q, want %q\", got, payload)\n\t}\n\n\t// check that if payload is invalid we get error\n\treq.Header.Set(SHA1SignatureHeader, \"invalid signature\")\n\tif _, err = ValidatePayload(req, []byte{0}); err == nil {\n\t\tt.Error(\"ValidatePayload = nil, want err\")\n\t}\n}\n\nfunc TestValidatePayload_FormPost(t *testing.T) {\n\tt.Parallel()\n\tpayload := `{\"yo\":true}`\n\tsignature := \"sha1=3374ef144403e8035423b23b02e2c9d7a4c50368\"\n\tsecretKey := []byte(\"0123456789abcdef\")\n\n\tform := url.Values{}\n\tform.Set(\"payload\", payload)\n\tbuf := bytes.NewBufferString(form.Encode())\n\treq, err := http.NewRequest(\"POST\", \"http://localhost/event\", buf)\n\tif err != nil {\n\t\tt.Fatalf(\"NewRequest: %v\", err)\n\t}\n\treq.Header.Set(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\treq.Header.Set(SHA1SignatureHeader, signature)\n\n\tgot, err := ValidatePayload(req, secretKey)\n\tif err != nil {\n\t\tt.Errorf(\"ValidatePayload(%#v): err = %v, want nil\", payload, err)\n\t}\n\tif string(got) != payload {\n\t\tt.Errorf(\"ValidatePayload = %q, want %q\", got, payload)\n\t}\n\n\t// check that if payload is invalid we get error\n\treq.Header.Set(SHA1SignatureHeader, \"invalid signature\")\n\tif _, err = ValidatePayload(req, []byte{0}); err == nil {\n\t\tt.Error(\"ValidatePayload = nil, want err\")\n\t}\n}\n\nfunc TestValidatePayload_InvalidContentType(t *testing.T) {\n\tt.Parallel()\n\treq, err := http.NewRequest(\"POST\", \"http://localhost/event\", nil)\n\tif err != nil {\n\t\tt.Fatalf(\"NewRequest: %v\", err)\n\t}\n\treq.Header.Set(\"Content-Type\", \"invalid content type\")\n\tif _, err = ValidatePayload(req, nil); err == nil {\n\t\tt.Error(\"ValidatePayload = nil, want err\")\n\t}\n}\n\nfunc TestValidatePayload_NoSecretKey(t *testing.T) {\n\tt.Parallel()\n\tpayload := `{\"yo\":true}`\n\n\tform := url.Values{}\n\tform.Set(\"payload\", payload)\n\tbuf := bytes.NewBufferString(form.Encode())\n\treq, err := http.NewRequest(\"POST\", \"http://localhost/event\", buf)\n\tif err != nil {\n\t\tt.Fatalf(\"NewRequest: %v\", err)\n\t}\n\treq.Header.Set(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\n\tgot, err := ValidatePayload(req, nil)\n\tif err != nil {\n\t\tt.Errorf(\"ValidatePayload(%#v): err = %v, want nil\", payload, err)\n\t}\n\tif string(got) != payload {\n\t\tt.Errorf(\"ValidatePayload = %q, want %q\", got, payload)\n\t}\n}\n\n// badReader satisfies io.Reader but always returns an error.\ntype badReader struct{}\n\nfunc (b *badReader) Read([]byte) (int, error) {\n\treturn 0, errors.New(\"bad reader\")\n}\n\nfunc (b *badReader) Close() error { return errors.New(\"bad reader\") }\n\nfunc TestValidatePayload_BadRequestBody(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tcontentType string\n\t}{\n\t\t{contentType: \"application/json\"},\n\t\t{contentType: \"application/x-www-form-urlencoded\"},\n\t}\n\n\tfor i, tt := range tests {\n\t\tt.Run(fmt.Sprintf(\"test #%v\", i), func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\treq := &http.Request{\n\t\t\t\tHeader: http.Header{\"Content-Type\": []string{tt.contentType}},\n\t\t\t\tBody:   &badReader{},\n\t\t\t}\n\t\t\tif _, err := ValidatePayload(req, nil); err == nil {\n\t\t\t\tt.Fatal(\"ValidatePayload returned nil; want error\")\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestValidatePayload_InvalidContentTypeParams(t *testing.T) {\n\tt.Parallel()\n\treq, err := http.NewRequest(\"POST\", \"http://localhost/event\", nil)\n\tif err != nil {\n\t\tt.Fatalf(\"NewRequest: %v\", err)\n\t}\n\treq.Header.Set(\"Content-Type\", \"application/json; charset=\")\n\tif _, err = ValidatePayload(req, nil); err == nil {\n\t\tt.Error(\"ValidatePayload = nil, want err\")\n\t}\n}\n\nfunc TestValidatePayload_ValidContentTypeParams(t *testing.T) {\n\tt.Parallel()\n\trequestBody := `{\"yo\":true}`\n\tbuf := bytes.NewBufferString(requestBody)\n\n\treq, err := http.NewRequest(\"POST\", \"http://localhost/event\", buf)\n\tif err != nil {\n\t\tt.Fatalf(\"NewRequest: %v\", err)\n\t}\n\treq.Header.Set(\"Content-Type\", \"application/json; charset=UTF-8\")\n\n\t_, err = ValidatePayload(req, nil)\n\tif err != nil {\n\t\tt.Error(\"ValidatePayload = nil, want err\")\n\t}\n}\n\nfunc TestParseWebHook(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tpayload     any\n\t\tmessageType string\n\t}{\n\t\t{\n\t\t\tpayload:     &BranchProtectionConfigurationEvent{},\n\t\t\tmessageType: \"branch_protection_configuration\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &BranchProtectionRuleEvent{},\n\t\t\tmessageType: \"branch_protection_rule\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &CheckRunEvent{},\n\t\t\tmessageType: \"check_run\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &CheckSuiteEvent{},\n\t\t\tmessageType: \"check_suite\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &CodeScanningAlertEvent{},\n\t\t\tmessageType: \"code_scanning_alert\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &CommitCommentEvent{},\n\t\t\tmessageType: \"commit_comment\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &ContentReferenceEvent{},\n\t\t\tmessageType: \"content_reference\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &CreateEvent{},\n\t\t\tmessageType: \"create\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &CustomPropertyEvent{},\n\t\t\tmessageType: \"custom_property\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &CustomPropertyValuesEvent{},\n\t\t\tmessageType: \"custom_property_values\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &DeleteEvent{},\n\t\t\tmessageType: \"delete\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &DependabotAlertEvent{},\n\t\t\tmessageType: \"dependabot_alert\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &DeployKeyEvent{},\n\t\t\tmessageType: \"deploy_key\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &DeploymentEvent{},\n\t\t\tmessageType: \"deployment\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &DeploymentProtectionRuleEvent{},\n\t\t\tmessageType: \"deployment_protection_rule\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &DeploymentReviewEvent{},\n\t\t\tmessageType: \"deployment_review\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &DeploymentStatusEvent{},\n\t\t\tmessageType: \"deployment_status\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &DiscussionCommentEvent{},\n\t\t\tmessageType: \"discussion_comment\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &DiscussionEvent{},\n\t\t\tmessageType: \"discussion\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &ForkEvent{},\n\t\t\tmessageType: \"fork\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &GitHubAppAuthorizationEvent{},\n\t\t\tmessageType: \"github_app_authorization\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &GollumEvent{},\n\t\t\tmessageType: \"gollum\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &InstallationEvent{},\n\t\t\tmessageType: \"installation\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &InstallationRepositoriesEvent{},\n\t\t\tmessageType: \"installation_repositories\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &InstallationTargetEvent{},\n\t\t\tmessageType: \"installation_target\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &IssueCommentEvent{},\n\t\t\tmessageType: \"issue_comment\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &IssuesEvent{},\n\t\t\tmessageType: \"issues\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &LabelEvent{},\n\t\t\tmessageType: \"label\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &MarketplacePurchaseEvent{},\n\t\t\tmessageType: \"marketplace_purchase\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &MemberEvent{},\n\t\t\tmessageType: \"member\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &MembershipEvent{},\n\t\t\tmessageType: \"membership\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &MergeGroupEvent{},\n\t\t\tmessageType: \"merge_group\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &MetaEvent{},\n\t\t\tmessageType: \"meta\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &MilestoneEvent{},\n\t\t\tmessageType: \"milestone\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &OrganizationEvent{},\n\t\t\tmessageType: \"organization\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &OrgBlockEvent{},\n\t\t\tmessageType: \"org_block\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &PackageEvent{},\n\t\t\tmessageType: \"package\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &PageBuildEvent{},\n\t\t\tmessageType: \"page_build\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &PersonalAccessTokenRequestEvent{},\n\t\t\tmessageType: \"personal_access_token_request\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &PingEvent{},\n\t\t\tmessageType: \"ping\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &ProjectV2Event{},\n\t\t\tmessageType: \"projects_v2\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &ProjectV2ItemEvent{},\n\t\t\tmessageType: \"projects_v2_item\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &PublicEvent{},\n\t\t\tmessageType: \"public\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &PullRequestEvent{},\n\t\t\tmessageType: \"pull_request\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &PullRequestReviewEvent{},\n\t\t\tmessageType: \"pull_request_review\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &PullRequestReviewCommentEvent{},\n\t\t\tmessageType: \"pull_request_review_comment\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &PullRequestReviewThreadEvent{},\n\t\t\tmessageType: \"pull_request_review_thread\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &PullRequestTargetEvent{},\n\t\t\tmessageType: \"pull_request_target\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &PushEvent{},\n\t\t\tmessageType: \"push\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &RegistryPackageEvent{},\n\t\t\tmessageType: \"registry_package\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &ReleaseEvent{},\n\t\t\tmessageType: \"release\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &RepositoryEvent{},\n\t\t\tmessageType: \"repository\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &RepositoryRulesetEvent{},\n\t\t\tmessageType: \"repository_ruleset\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &RepositoryVulnerabilityAlertEvent{},\n\t\t\tmessageType: \"repository_vulnerability_alert\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &SecretScanningAlertEvent{},\n\t\t\tmessageType: \"secret_scanning_alert\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &SecretScanningAlertLocationEvent{},\n\t\t\tmessageType: \"secret_scanning_alert_location\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &SecurityAdvisoryEvent{},\n\t\t\tmessageType: \"security_advisory\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &SecurityAndAnalysisEvent{},\n\t\t\tmessageType: \"security_and_analysis\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &SponsorshipEvent{},\n\t\t\tmessageType: \"sponsorship\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &StarEvent{},\n\t\t\tmessageType: \"star\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &StatusEvent{},\n\t\t\tmessageType: \"status\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &TeamEvent{},\n\t\t\tmessageType: \"team\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &TeamAddEvent{},\n\t\t\tmessageType: \"team_add\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &UserEvent{},\n\t\t\tmessageType: \"user\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &WatchEvent{},\n\t\t\tmessageType: \"watch\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &RepositoryImportEvent{},\n\t\t\tmessageType: \"repository_import\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &RepositoryDispatchEvent{},\n\t\t\tmessageType: \"repository_dispatch\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &WorkflowDispatchEvent{},\n\t\t\tmessageType: \"workflow_dispatch\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &WorkflowJobEvent{},\n\t\t\tmessageType: \"workflow_job\",\n\t\t},\n\t\t{\n\t\t\tpayload:     &WorkflowRunEvent{},\n\t\t\tmessageType: \"workflow_run\",\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\tp, err := json.Marshal(test.payload)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Marshal(%#v): %v\", test.payload, err)\n\t\t}\n\t\tgot, err := ParseWebHook(test.messageType, p)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"ParseWebHook: %v\", err)\n\t\t}\n\t\tif want := test.payload; !cmp.Equal(got, want) {\n\t\t\tt.Errorf(\"ParseWebHook(%#v, %#v) = %#v, want %#v\", test.messageType, p, got, want)\n\t\t}\n\t}\n}\n\nfunc TestAllMessageTypesMapped(t *testing.T) {\n\tt.Parallel()\n\tfor _, mt := range MessageTypes() {\n\t\tif obj := EventForType(mt); obj == nil {\n\t\t\tt.Errorf(\"messageMap missing message type %q\", mt)\n\t\t}\n\t}\n}\n\nfunc TestUnknownMessageType(t *testing.T) {\n\tt.Parallel()\n\tif obj := EventForType(\"unknown\"); obj != nil {\n\t\tt.Errorf(\"EventForType(unknown) = %#v, want nil\", obj)\n\t}\n\tif obj := EventForType(\"\"); obj != nil {\n\t\tt.Errorf(`EventForType(\"\") = %#v, want nil`, obj)\n\t}\n}\n\nfunc TestParseWebHook_BadMessageType(t *testing.T) {\n\tt.Parallel()\n\tif _, err := ParseWebHook(\"bogus message type\", []byte(\"{}\")); err == nil {\n\t\tt.Fatal(\"ParseWebHook returned nil; wanted error\")\n\t}\n}\n\nfunc TestValidatePayloadFromBody_UnableToParseBody(t *testing.T) {\n\tt.Parallel()\n\tif _, err := ValidatePayloadFromBody(\"application/x-www-form-urlencoded\", bytes.NewReader([]byte(`%`)), \"sha1=\", []byte{}); err == nil {\n\t\tt.Error(\"ValidatePayloadFromBody returned nil; wanted error\")\n\t}\n}\n\nfunc TestValidatePayloadFromBody_UnsupportedContentType(t *testing.T) {\n\tt.Parallel()\n\tif _, err := ValidatePayloadFromBody(\"invalid\", bytes.NewReader([]byte(`{}`)), \"sha1=\", []byte{}); err == nil {\n\t\tt.Error(\"ValidatePayloadFromBody returned nil; wanted error\")\n\t}\n}\n\nfunc TestDeliveryID(t *testing.T) {\n\tt.Parallel()\n\tid := \"8970a780-244e-11e7-91ca-da3aabcb9793\"\n\treq, err := http.NewRequest(\"POST\", \"http://localhost\", nil)\n\tif err != nil {\n\t\tt.Fatalf(\"DeliveryID: %v\", err)\n\t}\n\treq.Header.Set(\"X-Github-Delivery\", id)\n\n\tgot := DeliveryID(req)\n\tif got != id {\n\t\tt.Errorf(\"DeliveryID(%#v) = %q, want %q\", req, got, id)\n\t}\n}\n\nfunc TestWebHookType(t *testing.T) {\n\tt.Parallel()\n\twant := \"yo\"\n\treq := &http.Request{\n\t\tHeader: http.Header{EventTypeHeader: []string{want}},\n\t}\n\tif got := WebHookType(req); got != want {\n\t\tt.Errorf(\"WebHookType = %q, want %q\", got, want)\n\t}\n}\n"
  },
  {
    "path": "github/meta.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"net/url\"\n)\n\n// MetaService provides access to functions in the GitHub API that GitHub categorizes as \"meta\".\ntype MetaService service\n\n// APIMeta represents metadata about the GitHub API.\ntype APIMeta struct {\n\t// An array of IP addresses in CIDR format specifying the addresses\n\t// that incoming service hooks will originate from on GitHub.com.\n\tHooks []string `json:\"hooks,omitempty\"`\n\n\t// An array of IP addresses in CIDR format specifying the Git servers\n\t// for GitHub.com.\n\tGit []string `json:\"git,omitempty\"`\n\n\t// Whether authentication with username and password is supported.\n\t// (GitHub Enterprise instances using CAS or OAuth for authentication\n\t// will return false. Features like Basic Authentication with a\n\t// username and password, sudo mode, and two-factor authentication are\n\t// not supported on these servers.)\n\tVerifiablePasswordAuthentication *bool `json:\"verifiable_password_authentication,omitempty\"`\n\n\t// An array of IP addresses in CIDR format specifying the addresses\n\t// which serve GitHub Packages.\n\tPackages []string `json:\"packages,omitempty\"`\n\n\t// An array of IP addresses in CIDR format specifying the addresses\n\t// which serve GitHub Pages websites.\n\tPages []string `json:\"pages,omitempty\"`\n\n\t// An array of IP addresses specifying the addresses that source imports\n\t// will originate from on GitHub.com.\n\tImporter []string `json:\"importer,omitempty\"`\n\n\t// An array of IP addresses specifying the addresses that source imports\n\t// will originate from on GitHub Enterprise Cloud.\n\tGithubEnterpriseImporter []string `json:\"github_enterprise_importer,omitempty\"`\n\n\t// An array of IP addresses in CIDR format specifying the IP addresses\n\t// GitHub Actions will originate from.\n\tActions []string `json:\"actions,omitempty\"`\n\n\t// An array of IP addresses in CIDR format specifying the IP addresses\n\t// GitHub Action macOS runner will originate from.\n\tActionsMacos []string `json:\"actions_macos,omitempty\"`\n\n\t// An array of IP addresses in CIDR format specifying the IP addresses\n\t// GitHub Codespaces will originate from.\n\tCodespaces []string `json:\"codespaces,omitempty\"`\n\n\t// An array of IP addresses in CIDR format specifying the IP addresses\n\t// GitHub Copilot will originate from.\n\tCopilot []string `json:\"copilot,omitempty\"`\n\n\t// An array of IP addresses in CIDR format specifying the IP addresses\n\t// Dependabot will originate from.\n\tDependabot []string `json:\"dependabot,omitempty\"`\n\n\t// A map of algorithms to SSH key fingerprints.\n\tSSHKeyFingerprints map[string]string `json:\"ssh_key_fingerprints,omitempty\"`\n\n\t// An array of SSH keys.\n\tSSHKeys []string `json:\"ssh_keys,omitempty\"`\n\n\t// An array of IP addresses in CIDR format specifying the addresses\n\t// which serve GitHub websites.\n\tWeb []string `json:\"web,omitempty\"`\n\n\t// An array of IP addresses in CIDR format specifying the addresses\n\t// which serve GitHub APIs.\n\tAPI []string `json:\"api,omitempty\"`\n\n\t// GitHub services and their associated domains. Note that many of these domains\n\t// are represented as wildcards (e.g. \"*.github.com\").\n\tDomains *APIMetaDomains `json:\"domains,omitempty\"`\n}\n\n// APIMetaDomains represents the domains associated with GitHub services.\ntype APIMetaDomains struct {\n\tWebsite              []string                     `json:\"website,omitempty\"`\n\tCodespaces           []string                     `json:\"codespaces,omitempty\"`\n\tCopilot              []string                     `json:\"copilot,omitempty\"`\n\tPackages             []string                     `json:\"packages,omitempty\"`\n\tActions              []string                     `json:\"actions,omitempty\"`\n\tActionsInbound       *ActionsInboundDomains       `json:\"actions_inbound,omitempty\"`\n\tArtifactAttestations *APIMetaArtifactAttestations `json:\"artifact_attestations,omitempty\"`\n}\n\n// ActionsInboundDomains represents the domains associated with GitHub Actions inbound traffic.\ntype ActionsInboundDomains struct {\n\tFullDomains     []string `json:\"full_domains,omitempty\"`\n\tWildcardDomains []string `json:\"wildcard_domains,omitempty\"`\n}\n\n// APIMetaArtifactAttestations represents the artifact attestation services domains.\ntype APIMetaArtifactAttestations struct {\n\tTrustDomain string   `json:\"trust_domain,omitempty\"`\n\tServices    []string `json:\"services,omitempty\"`\n}\n\n// Get returns information about GitHub.com, the service. Or, if you access\n// this endpoint on your organization’s GitHub Enterprise installation, this\n// endpoint provides information about that installation.\n//\n// GitHub API docs: https://docs.github.com/rest/meta/meta#get-github-meta-information\n//\n//meta:operation GET /meta\nfunc (s *MetaService) Get(ctx context.Context) (*APIMeta, *Response, error) {\n\treq, err := s.client.NewRequest(\"GET\", \"meta\", nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar meta *APIMeta\n\tresp, err := s.client.Do(ctx, req, &meta)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn meta, resp, nil\n}\n\n// APIMeta returns information about GitHub.com.\n//\n// Deprecated: Use MetaService.Get instead.\nfunc (c *Client) APIMeta(ctx context.Context) (*APIMeta, *Response, error) {\n\treturn c.Meta.Get(ctx)\n}\n\n// Octocat returns an ASCII art octocat with the specified message in a speech\n// bubble. If message is empty, a random zen phrase is used.\n//\n// GitHub API docs: https://docs.github.com/rest/meta/meta#get-octocat\n//\n//meta:operation GET /octocat\nfunc (s *MetaService) Octocat(ctx context.Context, message string) (string, *Response, error) {\n\tu := \"octocat\"\n\tif message != \"\" {\n\t\tu = fmt.Sprintf(\"%v?s=%v\", u, url.QueryEscape(message))\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn \"\", nil, err\n\t}\n\n\tvar buf bytes.Buffer\n\tresp, err := s.client.Do(ctx, req, &buf)\n\tif err != nil {\n\t\treturn \"\", resp, err\n\t}\n\n\treturn buf.String(), resp, nil\n}\n\n// Octocat returns an ASCII art octocat with the specified message in a speech\n// bubble. If message is empty, a random zen phrase is used.\n//\n// Deprecated: Use MetaService.Octocat instead.\nfunc (c *Client) Octocat(ctx context.Context, message string) (string, *Response, error) {\n\treturn c.Meta.Octocat(ctx, message)\n}\n\n// Zen returns a random line from The Zen of GitHub.\n//\n// See also: https://warpspire.com/posts/taste/\n//\n// GitHub API docs: https://docs.github.com/rest/meta/meta#get-the-zen-of-github\n//\n//meta:operation GET /zen\nfunc (s *MetaService) Zen(ctx context.Context) (string, *Response, error) {\n\treq, err := s.client.NewRequest(\"GET\", \"zen\", nil)\n\tif err != nil {\n\t\treturn \"\", nil, err\n\t}\n\n\tvar buf bytes.Buffer\n\tresp, err := s.client.Do(ctx, req, &buf)\n\tif err != nil {\n\t\treturn \"\", resp, err\n\t}\n\n\treturn buf.String(), resp, nil\n}\n\n// Zen returns a random line from The Zen of GitHub.\n//\n// Deprecated: Use MetaService.Zen instead.\nfunc (c *Client) Zen(ctx context.Context) (string, *Response, error) {\n\treturn c.Meta.Zen(ctx)\n}\n"
  },
  {
    "path": "github/meta_test.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestAPIMeta_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &APIMeta{}, \"{}\")\n\n\ta := &APIMeta{\n\t\tHooks:                            []string{\"h\"},\n\t\tGit:                              []string{\"g\"},\n\t\tVerifiablePasswordAuthentication: Ptr(true),\n\t\tPages:                            []string{\"p\"},\n\t\tImporter:                         []string{\"i\"},\n\t\tGithubEnterpriseImporter:         []string{\"gei\"},\n\t\tActions:                          []string{\"a\"},\n\t\tActionsMacos:                     []string{\"example.com/1\", \"example.com/2\"},\n\t\tDependabot:                       []string{\"d\"},\n\t\tSSHKeyFingerprints:               map[string]string{\"a\": \"f\"},\n\t\tSSHKeys:                          []string{\"k\"},\n\t\tAPI:                              []string{\"a\"},\n\t\tWeb:                              []string{\"w\"},\n\t\tDomains: &APIMetaDomains{\n\t\t\tWebsite: []string{\n\t\t\t\t\"*.github.com\",\n\t\t\t\t\"*.example.com/assets\",\n\t\t\t\t\"*.example.com\",\n\t\t\t},\n\t\t\tArtifactAttestations: &APIMetaArtifactAttestations{\n\t\t\t\tTrustDomain: \"\",\n\t\t\t\tServices: []string{\n\t\t\t\t\t\"*.actions.example.com\",\n\t\t\t\t\t\"timestamp.example.com\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\twant := `{\n\t\t\"hooks\":[\"h\"],\n\t\t\"git\":[\"g\"],\n\t\t\"verifiable_password_authentication\":true,\n\t\t\"pages\":[\"p\"],\n\t\t\"importer\":[\"i\"],\n\t\t\"github_enterprise_importer\":[\"gei\"],\n\t\t\"actions\":[\"a\"],\n\t\t\"actions_macos\":[\"example.com/1\", \"example.com/2\"],\n\t\t\"dependabot\":[\"d\"],\n\t\t\"ssh_key_fingerprints\":{\"a\":\"f\"},\n\t\t\"ssh_keys\":[\"k\"],\n\t\t\"api\":[\"a\"],\n\t\t\"web\":[\"w\"],\n\t\t\"domains\":{\"website\":[\"*.github.com\",\"*.example.com/assets\",\"*.example.com\"],\"artifact_attestations\":{\"services\":[\"*.actions.example.com\",\"timestamp.example.com\"]}}\n\t}`\n\n\ttestJSONMarshal(t, a, want)\n}\n\nfunc TestMetaService_Get(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/meta\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"web\":[\"w\"],\"api\":[\"a\"],\"hooks\":[\"h\"], \"git\":[\"g\"], \"pages\":[\"p\"], \"importer\":[\"i\"], \"github_enterprise_importer\": [\"gei\"], \"actions\":[\"a\"], \"actions_macos\": [\"example.com/1\", \"example.com/2\"], \"codespaces\": [\"cs\"], \"copilot\": [\"c\"], \"dependabot\":[\"d\"], \"verifiable_password_authentication\": true, \"domains\":{\"actions_inbound\": { \"full_domains\": [\"github.com\"], \"wildcard_domains\": [\"*.github.com\"]},\"website\":[\"*.github.com\",\"*.github.dev\",\"*.github.io\",\"*.example.com/assets\",\"*.example.com\"],\"artifact_attestations\":{\"trust_domain\":\"\",\"services\":[\"*.actions.github.com\",\"tuf-repo.github.com\",\"fulcio.github.com\",\"timestamp.github.com\"]}}}`)\n\t})\n\n\tctx := t.Context()\n\tmeta, _, err := client.Meta.Get(ctx)\n\tif err != nil {\n\t\tt.Errorf(\"Get returned error: %v\", err)\n\t}\n\n\twant := &APIMeta{\n\t\tHooks:                    []string{\"h\"},\n\t\tGit:                      []string{\"g\"},\n\t\tPages:                    []string{\"p\"},\n\t\tImporter:                 []string{\"i\"},\n\t\tGithubEnterpriseImporter: []string{\"gei\"},\n\t\tActions:                  []string{\"a\"},\n\t\tActionsMacos:             []string{\"example.com/1\", \"example.com/2\"},\n\t\tCodespaces:               []string{\"cs\"},\n\t\tCopilot:                  []string{\"c\"},\n\t\tDependabot:               []string{\"d\"},\n\t\tAPI:                      []string{\"a\"},\n\t\tWeb:                      []string{\"w\"},\n\t\tDomains: &APIMetaDomains{\n\t\t\tWebsite: []string{\n\t\t\t\t\"*.github.com\",\n\t\t\t\t\"*.github.dev\",\n\t\t\t\t\"*.github.io\",\n\t\t\t\t\"*.example.com/assets\",\n\t\t\t\t\"*.example.com\",\n\t\t\t},\n\t\t\tArtifactAttestations: &APIMetaArtifactAttestations{\n\t\t\t\tTrustDomain: \"\",\n\t\t\t\tServices: []string{\n\t\t\t\t\t\"*.actions.github.com\",\n\t\t\t\t\t\"tuf-repo.github.com\",\n\t\t\t\t\t\"fulcio.github.com\",\n\t\t\t\t\t\"timestamp.github.com\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tActionsInbound: &ActionsInboundDomains{\n\t\t\t\tFullDomains:     []string{\"github.com\"},\n\t\t\t\tWildcardDomains: []string{\"*.github.com\"},\n\t\t\t},\n\t\t},\n\n\t\tVerifiablePasswordAuthentication: Ptr(true),\n\t}\n\tif !cmp.Equal(want, meta) {\n\t\tt.Errorf(\"Get returned %+v, want %+v\", meta, want)\n\t}\n\n\tconst methodName = \"Get\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Meta.Get(ctx)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestMetaService_Octocat(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := \"input\"\n\toutput := \"sample text\"\n\n\tmux.HandleFunc(\"/octocat\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"s\": input})\n\t\tw.Header().Set(\"Content-Type\", \"application/octocat-stream\")\n\t\tfmt.Fprint(w, output)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Meta.Octocat(ctx, input)\n\tif err != nil {\n\t\tt.Errorf(\"Octocat returned error: %v\", err)\n\t}\n\n\tif want := output; got != want {\n\t\tt.Errorf(\"Octocat returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"Octocat\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Meta.Octocat(ctx, input)\n\t\tif got != \"\" {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestMetaService_Zen(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\toutput := \"sample text\"\n\n\tmux.HandleFunc(\"/zen\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.Header().Set(\"Content-Type\", \"text/plain;charset=utf-8\")\n\t\tfmt.Fprint(w, output)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Meta.Zen(ctx)\n\tif err != nil {\n\t\tt.Errorf(\"Zen returned error: %v\", err)\n\t}\n\n\tif want := output; got != want {\n\t\tt.Errorf(\"Zen returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"Zen\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Meta.Zen(ctx)\n\t\tif got != \"\" {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/migrations.go",
    "content": "// Copyright 2016 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n)\n\n// MigrationService provides access to the migration related functions\n// in the GitHub API.\n//\n// GitHub API docs: https://docs.github.com/rest/migration/\ntype MigrationService service\n\n// Migration represents a GitHub migration (archival).\ntype Migration struct {\n\tID   *int64  `json:\"id,omitempty\"`\n\tGUID *string `json:\"guid,omitempty\"`\n\t// State is the current state of a migration.\n\t// Possible values are:\n\t//     \"pending\" which means the migration hasn't started yet,\n\t//     \"exporting\" which means the migration is in progress,\n\t//     \"exported\" which means the migration finished successfully, or\n\t//     \"failed\" which means the migration failed.\n\tState *string `json:\"state,omitempty\"`\n\t// LockRepositories indicates whether repositories are locked (to prevent\n\t// manipulation) while migrating data.\n\tLockRepositories *bool `json:\"lock_repositories,omitempty\"`\n\t// ExcludeAttachments indicates whether attachments should be excluded from\n\t// the migration (to reduce migration archive file size).\n\tExcludeAttachments *bool         `json:\"exclude_attachments,omitempty\"`\n\tURL                *string       `json:\"url,omitempty\"`\n\tCreatedAt          *string       `json:\"created_at,omitempty\"`\n\tUpdatedAt          *string       `json:\"updated_at,omitempty\"`\n\tRepositories       []*Repository `json:\"repositories,omitempty\"`\n}\n\nfunc (m Migration) String() string {\n\treturn Stringify(m)\n}\n\n// MigrationOptions specifies the optional parameters to Migration methods.\ntype MigrationOptions struct {\n\t// LockRepositories indicates whether repositories should be locked (to prevent\n\t// manipulation) while migrating data.\n\tLockRepositories bool\n\n\t// ExcludeAttachments indicates whether attachments should be excluded from\n\t// the migration (to reduce migration archive file size).\n\tExcludeAttachments bool\n\n\t// ExcludeReleases indicates whether releases should be excluded from\n\t// the migration (to reduce migration archive file size).\n\tExcludeReleases bool\n\n\t// Exclude is a slice of related items to exclude from the response in order\n\t// to improve performance of the request. Supported values are: \"repositories\"\n\tExclude []string\n}\n\n// startMigration represents the body of a StartMigration request.\ntype startMigration struct {\n\t// Repositories is a slice of repository names to migrate.\n\tRepositories []string `json:\"repositories,omitempty\"`\n\n\t// LockRepositories indicates whether repositories should be locked (to prevent\n\t// manipulation) while migrating data.\n\tLockRepositories *bool `json:\"lock_repositories,omitempty\"`\n\n\t// ExcludeAttachments indicates whether attachments should be excluded from\n\t// the migration (to reduce migration archive file size).\n\tExcludeAttachments *bool `json:\"exclude_attachments,omitempty\"`\n\n\t// ExcludeReleases indicates whether releases should be excluded from\n\t// the migration (to reduce migration archive file size).\n\tExcludeReleases *bool `json:\"exclude_releases,omitempty\"`\n\n\t// Exclude is a slice of related items to exclude from the response in order\n\t// to improve performance of the request. Supported values are: \"repositories\"\n\tExclude []string `json:\"exclude,omitempty\"`\n}\n\n// StartMigration starts the generation of a migration archive.\n// repos is a slice of repository names to migrate.\n//\n// GitHub API docs: https://docs.github.com/rest/migrations/orgs#start-an-organization-migration\n//\n//meta:operation POST /orgs/{org}/migrations\nfunc (s *MigrationService) StartMigration(ctx context.Context, org string, repos []string, opts *MigrationOptions) (*Migration, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/migrations\", org)\n\n\tbody := &startMigration{Repositories: repos}\n\tif opts != nil {\n\t\tbody.LockRepositories = Ptr(opts.LockRepositories)\n\t\tbody.ExcludeAttachments = Ptr(opts.ExcludeAttachments)\n\t\tbody.ExcludeReleases = Ptr(opts.ExcludeReleases)\n\t\tbody.Exclude = append(body.Exclude, opts.Exclude...)\n\t}\n\n\treq, err := s.client.NewRequest(\"POST\", u, body)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeMigrationsPreview)\n\n\tvar m *Migration\n\tresp, err := s.client.Do(ctx, req, &m)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn m, resp, nil\n}\n\n// ListMigrations lists the most recent migrations.\n//\n// GitHub API docs: https://docs.github.com/rest/migrations/orgs#list-organization-migrations\n//\n//meta:operation GET /orgs/{org}/migrations\nfunc (s *MigrationService) ListMigrations(ctx context.Context, org string, opts *ListOptions) ([]*Migration, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/migrations\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeMigrationsPreview)\n\n\tvar m []*Migration\n\tresp, err := s.client.Do(ctx, req, &m)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn m, resp, nil\n}\n\n// MigrationStatus gets the status of a specific migration archive.\n// id is the migration ID.\n//\n// GitHub API docs: https://docs.github.com/rest/migrations/orgs#get-an-organization-migration-status\n//\n//meta:operation GET /orgs/{org}/migrations/{migration_id}\nfunc (s *MigrationService) MigrationStatus(ctx context.Context, org string, id int64) (*Migration, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/migrations/%v\", org, id)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeMigrationsPreview)\n\n\tvar m *Migration\n\tresp, err := s.client.Do(ctx, req, &m)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn m, resp, nil\n}\n\n// MigrationArchiveURL fetches a migration archive URL.\n// id is the migration ID.\n//\n// GitHub API docs: https://docs.github.com/rest/migrations/orgs#download-an-organization-migration-archive\n//\n//meta:operation GET /orgs/{org}/migrations/{migration_id}/archive\nfunc (s *MigrationService) MigrationArchiveURL(ctx context.Context, org string, id int64) (url string, err error) {\n\tu := fmt.Sprintf(\"orgs/%v/migrations/%v/archive\", org, id)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeMigrationsPreview)\n\n\ts.client.clientMu.Lock()\n\tdefer s.client.clientMu.Unlock()\n\n\t// Disable the redirect mechanism because AWS fails if the GitHub auth token is provided.\n\tvar loc string\n\tsaveRedirect := s.client.client.CheckRedirect\n\ts.client.client.CheckRedirect = func(req *http.Request, _ []*http.Request) error {\n\t\tloc = req.URL.String()\n\t\treturn errors.New(\"disable redirect\")\n\t}\n\tdefer func() { s.client.client.CheckRedirect = saveRedirect }()\n\n\t_, err = s.client.Do(ctx, req, nil) // expect error from disable redirect\n\tif err == nil {\n\t\treturn \"\", errors.New(\"expected redirect, none provided\")\n\t}\n\tif !strings.Contains(err.Error(), \"disable redirect\") {\n\t\treturn \"\", err\n\t}\n\treturn loc, nil\n}\n\n// DeleteMigration deletes a previous migration archive.\n// id is the migration ID.\n//\n// GitHub API docs: https://docs.github.com/rest/migrations/orgs#delete-an-organization-migration-archive\n//\n//meta:operation DELETE /orgs/{org}/migrations/{migration_id}/archive\nfunc (s *MigrationService) DeleteMigration(ctx context.Context, org string, id int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/migrations/%v/archive\", org, id)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeMigrationsPreview)\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// UnlockRepo unlocks a repository that was locked for migration.\n// id is the migration ID.\n// You should unlock each migrated repository and delete them when the migration\n// is complete and you no longer need the source data.\n//\n// GitHub API docs: https://docs.github.com/rest/migrations/orgs#unlock-an-organization-repository\n//\n//meta:operation DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock\nfunc (s *MigrationService) UnlockRepo(ctx context.Context, org string, id int64, repo string) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/migrations/%v/repos/%v/lock\", org, id, repo)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeMigrationsPreview)\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/migrations_source_import.go",
    "content": "// Copyright 2016 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// Import represents a repository import request.\ntype Import struct {\n\t// The URL of the originating repository.\n\tVCSURL *string `json:\"vcs_url,omitempty\"`\n\t// The originating VCS type. Can be one of 'subversion', 'git',\n\t// 'mercurial', or 'tfvc'. Without this parameter, the import job will\n\t// take additional time to detect the VCS type before beginning the\n\t// import. This detection step will be reflected in the response.\n\tVCS *string `json:\"vcs,omitempty\"`\n\t// VCSUsername and VCSPassword are only used for StartImport calls that\n\t// are importing a password-protected repository.\n\tVCSUsername *string `json:\"vcs_username,omitempty\"`\n\tVCSPassword *string `json:\"vcs_password,omitempty\"`\n\t// For a tfvc import, the name of the project that is being imported.\n\tTFVCProject *string `json:\"tfvc_project,omitempty\"`\n\n\t// LFS related fields that may be preset in the Import Progress response\n\n\t// Describes whether the import has been opted in or out of using Git\n\t// LFS. The value can be 'opt_in', 'opt_out', or 'undecided' if no\n\t// action has been taken.\n\tUseLFS *string `json:\"use_lfs,omitempty\"`\n\t// Describes whether files larger than 100MB were found during the\n\t// importing step.\n\tHasLargeFiles *bool `json:\"has_large_files,omitempty\"`\n\t// The total size in gigabytes of files larger than 100MB found in the\n\t// originating repository.\n\tLargeFilesSize *int `json:\"large_files_size,omitempty\"`\n\t// The total number of files larger than 100MB found in the originating\n\t// repository. To see a list of these files, call LargeFiles.\n\tLargeFilesCount *int `json:\"large_files_count,omitempty\"`\n\n\t// Identifies the current status of an import. An import that does not\n\t// have errors will progress through these steps:\n\t//\n\t//     detecting - the \"detection\" step of the import is in progress\n\t//         because the request did not include a VCS parameter. The\n\t//         import is identifying the type of source control present at\n\t//         the URL.\n\t//     importing - the \"raw\" step of the import is in progress. This is\n\t//         where commit data is fetched from the original repository.\n\t//         The import progress response will include CommitCount (the\n\t//         total number of raw commits that will be imported) and\n\t//         Percent (0 - 100, the current progress through the import).\n\t//     mapping - the \"rewrite\" step of the import is in progress. This\n\t//         is where SVN branches are converted to Git branches, and\n\t//         where author updates are applied. The import progress\n\t//         response does not include progress information.\n\t//     pushing - the \"push\" step of the import is in progress. This is\n\t//         where the importer updates the repository on GitHub. The\n\t//         import progress response will include PushPercent, which is\n\t//         the percent value reported by git push when it is \"Writing\n\t//         objects\".\n\t//     complete - the import is complete, and the repository is ready\n\t//         on GitHub.\n\t//\n\t// If there are problems, you will see one of these in the status field:\n\t//\n\t//     auth_failed - the import requires authentication in order to\n\t//         connect to the original repository. Make an UpdateImport\n\t//         request, and include VCSUsername and VCSPassword.\n\t//     error - the import encountered an error. The import progress\n\t//         response will include the FailedStep and an error message.\n\t//         Contact GitHub support for more information.\n\t//     detection_needs_auth - the importer requires authentication for\n\t//         the originating repository to continue detection. Make an\n\t//         UpdateImport request, and include VCSUsername and\n\t//         VCSPassword.\n\t//     detection_found_nothing - the importer didn't recognize any\n\t//         source control at the URL.\n\t//     detection_found_multiple - the importer found several projects\n\t//         or repositories at the provided URL. When this is the case,\n\t//         the Import Progress response will also include a\n\t//         ProjectChoices field with the possible project choices as\n\t//         values. Make an UpdateImport request, and include VCS and\n\t//         (if applicable) TFVCProject.\n\tStatus        *string `json:\"status,omitempty\"`\n\tCommitCount   *int    `json:\"commit_count,omitempty\"`\n\tStatusText    *string `json:\"status_text,omitempty\"`\n\tAuthorsCount  *int    `json:\"authors_count,omitempty\"`\n\tPercent       *int    `json:\"percent,omitempty\"`\n\tPushPercent   *int    `json:\"push_percent,omitempty\"`\n\tURL           *string `json:\"url,omitempty\"`\n\tHTMLURL       *string `json:\"html_url,omitempty\"`\n\tAuthorsURL    *string `json:\"authors_url,omitempty\"`\n\tRepositoryURL *string `json:\"repository_url,omitempty\"`\n\tMessage       *string `json:\"message,omitempty\"`\n\tFailedStep    *string `json:\"failed_step,omitempty\"`\n\n\t// Human readable display name, provided when the Import appears as\n\t// part of ProjectChoices.\n\tHumanName *string `json:\"human_name,omitempty\"`\n\n\t// When the importer finds several projects or repositories at the\n\t// provided URLs, this will identify the available choices. Call\n\t// UpdateImport with the selected Import value.\n\tProjectChoices []*Import `json:\"project_choices,omitempty\"`\n}\n\nfunc (i Import) String() string {\n\treturn Stringify(i)\n}\n\n// SourceImportAuthor identifies an author imported from a source repository.\n//\n// GitHub API docs: https://docs.github.com/rest/migration/source_imports/#get-commit-authors\ntype SourceImportAuthor struct {\n\tID         *int64  `json:\"id,omitempty\"`\n\tRemoteID   *string `json:\"remote_id,omitempty\"`\n\tRemoteName *string `json:\"remote_name,omitempty\"`\n\tEmail      *string `json:\"email,omitempty\"`\n\tName       *string `json:\"name,omitempty\"`\n\tURL        *string `json:\"url,omitempty\"`\n\tImportURL  *string `json:\"import_url,omitempty\"`\n}\n\nfunc (a SourceImportAuthor) String() string {\n\treturn Stringify(a)\n}\n\n// LargeFile identifies a file larger than 100MB found during a repository import.\n//\n// GitHub API docs: https://docs.github.com/rest/migration/source_imports/#get-large-files\ntype LargeFile struct {\n\tRefName *string `json:\"ref_name,omitempty\"`\n\tPath    *string `json:\"path,omitempty\"`\n\tOID     *string `json:\"oid,omitempty\"`\n\tSize    *int    `json:\"size,omitempty\"`\n}\n\nfunc (f LargeFile) String() string {\n\treturn Stringify(f)\n}\n\n// StartImport initiates a repository import.\n//\n// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#start-an-import\n//\n//meta:operation PUT /repos/{owner}/{repo}/import\nfunc (s *MigrationService) StartImport(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/import\", owner, repo)\n\treq, err := s.client.NewRequest(\"PUT\", u, in)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar out *Import\n\tresp, err := s.client.Do(ctx, req, &out)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn out, resp, nil\n}\n\n// ImportProgress queries for the status and progress of an ongoing repository import.\n//\n// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#get-an-import-status\n//\n//meta:operation GET /repos/{owner}/{repo}/import\nfunc (s *MigrationService) ImportProgress(ctx context.Context, owner, repo string) (*Import, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/import\", owner, repo)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar out *Import\n\tresp, err := s.client.Do(ctx, req, &out)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn out, resp, nil\n}\n\n// UpdateImport initiates a repository import.\n//\n// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#update-an-import\n//\n//meta:operation PATCH /repos/{owner}/{repo}/import\nfunc (s *MigrationService) UpdateImport(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/import\", owner, repo)\n\treq, err := s.client.NewRequest(\"PATCH\", u, in)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar out *Import\n\tresp, err := s.client.Do(ctx, req, &out)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn out, resp, nil\n}\n\n// CommitAuthors gets the authors mapped from the original repository.\n//\n// Each type of source control system represents authors in a different way.\n// For example, a Git commit author has a display name and an email address,\n// but a Subversion commit author just has a username. The GitHub Importer will\n// make the author information valid, but the author might not be correct. For\n// example, it will change the bare Subversion username \"hubot\" into something\n// like \"hubot <hubot@12341234-abab-fefe-8787-fedcba987654>\".\n//\n// This method and MapCommitAuthor allow you to provide correct Git author\n// information.\n//\n// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#get-commit-authors\n//\n//meta:operation GET /repos/{owner}/{repo}/import/authors\nfunc (s *MigrationService) CommitAuthors(ctx context.Context, owner, repo string) ([]*SourceImportAuthor, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/import/authors\", owner, repo)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar authors []*SourceImportAuthor\n\tresp, err := s.client.Do(ctx, req, &authors)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn authors, resp, nil\n}\n\n// MapCommitAuthor updates an author's identity for the import. Your\n// application can continue updating authors any time before you push new\n// commits to the repository.\n//\n// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#map-a-commit-author\n//\n//meta:operation PATCH /repos/{owner}/{repo}/import/authors/{author_id}\nfunc (s *MigrationService) MapCommitAuthor(ctx context.Context, owner, repo string, id int64, author *SourceImportAuthor) (*SourceImportAuthor, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/import/authors/%v\", owner, repo, id)\n\treq, err := s.client.NewRequest(\"PATCH\", u, author)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar out *SourceImportAuthor\n\tresp, err := s.client.Do(ctx, req, &out)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn out, resp, nil\n}\n\n// SetLFSPreference sets whether imported repositories should use Git LFS for\n// files larger than 100MB. Only the UseLFS field on the provided Import is\n// used.\n//\n// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference\n//\n//meta:operation PATCH /repos/{owner}/{repo}/import/lfs\nfunc (s *MigrationService) SetLFSPreference(ctx context.Context, owner, repo string, in *Import) (*Import, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/import/lfs\", owner, repo)\n\treq, err := s.client.NewRequest(\"PATCH\", u, in)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar out *Import\n\tresp, err := s.client.Do(ctx, req, &out)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn out, resp, nil\n}\n\n// LargeFiles lists files larger than 100MB found during the import.\n//\n// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#get-large-files\n//\n//meta:operation GET /repos/{owner}/{repo}/import/large_files\nfunc (s *MigrationService) LargeFiles(ctx context.Context, owner, repo string) ([]*LargeFile, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/import/large_files\", owner, repo)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar files []*LargeFile\n\tresp, err := s.client.Do(ctx, req, &files)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn files, resp, nil\n}\n\n// CancelImport stops an import for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/migrations/source-imports#cancel-an-import\n//\n//meta:operation DELETE /repos/{owner}/{repo}/import\nfunc (s *MigrationService) CancelImport(ctx context.Context, owner, repo string) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/import\", owner, repo)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/migrations_source_import_test.go",
    "content": "// Copyright 2016 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestMigrationService_StartImport(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &Import{\n\t\tVCS:         Ptr(\"git\"),\n\t\tVCSURL:      Ptr(\"url\"),\n\t\tVCSUsername: Ptr(\"u\"),\n\t\tVCSPassword: Ptr(\"p\"),\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/import\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *Import\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tw.WriteHeader(http.StatusCreated)\n\t\tfmt.Fprint(w, `{\"status\":\"importing\"}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Migrations.StartImport(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"StartImport returned error: %v\", err)\n\t}\n\twant := &Import{Status: Ptr(\"importing\")}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"StartImport = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"StartImport\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Migrations.StartImport(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Migrations.StartImport(ctx, \"o\", \"r\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestMigrationService_ImportProgress(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/import\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"status\":\"complete\"}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Migrations.ImportProgress(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"ImportProgress returned error: %v\", err)\n\t}\n\twant := &Import{Status: Ptr(\"complete\")}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"ImportProgress = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ImportProgress\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Migrations.ImportProgress(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Migrations.ImportProgress(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestMigrationService_UpdateImport(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &Import{\n\t\tVCS:         Ptr(\"git\"),\n\t\tVCSURL:      Ptr(\"url\"),\n\t\tVCSUsername: Ptr(\"u\"),\n\t\tVCSPassword: Ptr(\"p\"),\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/import\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *Import\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tw.WriteHeader(http.StatusCreated)\n\t\tfmt.Fprint(w, `{\"status\":\"importing\"}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Migrations.UpdateImport(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"UpdateImport returned error: %v\", err)\n\t}\n\twant := &Import{Status: Ptr(\"importing\")}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"UpdateImport = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"UpdateImport\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Migrations.UpdateImport(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Migrations.UpdateImport(ctx, \"o\", \"r\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestMigrationService_CommitAuthors(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/import/authors\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"id\":1,\"name\":\"a\"},{\"id\":2,\"name\":\"b\"}]`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Migrations.CommitAuthors(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"CommitAuthors returned error: %v\", err)\n\t}\n\twant := []*SourceImportAuthor{\n\t\t{ID: Ptr(int64(1)), Name: Ptr(\"a\")},\n\t\t{ID: Ptr(int64(2)), Name: Ptr(\"b\")},\n\t}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"CommitAuthors = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"CommitAuthors\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Migrations.CommitAuthors(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Migrations.CommitAuthors(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestMigrationService_MapCommitAuthor(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &SourceImportAuthor{Name: Ptr(\"n\"), Email: Ptr(\"e\")}\n\n\tmux.HandleFunc(\"/repos/o/r/import/authors/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *SourceImportAuthor\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\": 1}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Migrations.MapCommitAuthor(ctx, \"o\", \"r\", 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"MapCommitAuthor returned error: %v\", err)\n\t}\n\twant := &SourceImportAuthor{ID: Ptr(int64(1))}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"MapCommitAuthor = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"MapCommitAuthor\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Migrations.MapCommitAuthor(ctx, \"\\n\", \"\\n\", 1, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Migrations.MapCommitAuthor(ctx, \"o\", \"r\", 1, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestMigrationService_SetLFSPreference(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &Import{UseLFS: Ptr(\"opt_in\")}\n\n\tmux.HandleFunc(\"/repos/o/r/import/lfs\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *Import\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tw.WriteHeader(http.StatusCreated)\n\t\tfmt.Fprint(w, `{\"status\":\"importing\"}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Migrations.SetLFSPreference(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"SetLFSPreference returned error: %v\", err)\n\t}\n\twant := &Import{Status: Ptr(\"importing\")}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"SetLFSPreference = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"SetLFSPreference\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Migrations.SetLFSPreference(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Migrations.SetLFSPreference(ctx, \"o\", \"r\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestMigrationService_LargeFiles(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/import/large_files\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"oid\":\"a\"},{\"oid\":\"b\"}]`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Migrations.LargeFiles(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"LargeFiles returned error: %v\", err)\n\t}\n\twant := []*LargeFile{\n\t\t{OID: Ptr(\"a\")},\n\t\t{OID: Ptr(\"b\")},\n\t}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"LargeFiles = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"LargeFiles\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Migrations.LargeFiles(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Migrations.LargeFiles(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestMigrationService_CancelImport(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/import\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Migrations.CancelImport(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"CancelImport returned error: %v\", err)\n\t}\n\n\tconst methodName = \"CancelImport\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Migrations.CancelImport(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Migrations.CancelImport(ctx, \"o\", \"r\")\n\t})\n}\n\nfunc TestLargeFile_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &LargeFile{}, \"{}\")\n\n\tu := &LargeFile{\n\t\tRefName: Ptr(\"rn\"),\n\t\tPath:    Ptr(\"p\"),\n\t\tOID:     Ptr(\"oid\"),\n\t\tSize:    Ptr(1),\n\t}\n\n\twant := `{\n\t\t\"ref_name\": \"rn\",\n\t\t\"path\": \"p\",\n\t\t\"oid\": \"oid\",\n\t\t\"size\": 1\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestSourceImportAuthor_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SourceImportAuthor{}, \"{}\")\n\n\tu := &SourceImportAuthor{\n\t\tID:         Ptr(int64(1)),\n\t\tRemoteID:   Ptr(\"rid\"),\n\t\tRemoteName: Ptr(\"rn\"),\n\t\tEmail:      Ptr(\"e\"),\n\t\tName:       Ptr(\"n\"),\n\t\tURL:        Ptr(\"url\"),\n\t\tImportURL:  Ptr(\"iurl\"),\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"remote_id\": \"rid\",\n\t\t\"remote_name\": \"rn\",\n\t\t\"email\": \"e\",\n\t\t\"name\": \"n\",\n\t\t\"url\": \"url\",\n\t\t\"import_url\": \"iurl\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestImport_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Import{}, \"{}\")\n\n\tu := &Import{\n\t\tVCSURL:          Ptr(\"vcsurl\"),\n\t\tVCS:             Ptr(\"vcs\"),\n\t\tVCSUsername:     Ptr(\"vcsusr\"),\n\t\tVCSPassword:     Ptr(\"vcspass\"),\n\t\tTFVCProject:     Ptr(\"tfvcp\"),\n\t\tUseLFS:          Ptr(\"uselfs\"),\n\t\tHasLargeFiles:   Ptr(false),\n\t\tLargeFilesSize:  Ptr(1),\n\t\tLargeFilesCount: Ptr(1),\n\t\tStatus:          Ptr(\"status\"),\n\t\tCommitCount:     Ptr(1),\n\t\tStatusText:      Ptr(\"statustxt\"),\n\t\tAuthorsCount:    Ptr(1),\n\t\tPercent:         Ptr(1),\n\t\tPushPercent:     Ptr(1),\n\t\tURL:             Ptr(\"url\"),\n\t\tHTMLURL:         Ptr(\"hurl\"),\n\t\tAuthorsURL:      Ptr(\"aurl\"),\n\t\tRepositoryURL:   Ptr(\"rurl\"),\n\t\tMessage:         Ptr(\"msg\"),\n\t\tFailedStep:      Ptr(\"fs\"),\n\t\tHumanName:       Ptr(\"hn\"),\n\t\tProjectChoices:  []*Import{{VCSURL: Ptr(\"vcsurl\")}},\n\t}\n\n\twant := `{\n\t\t\"vcs_url\": \"vcsurl\",\n\t\t\"vcs\": \"vcs\",\n\t\t\"vcs_username\": \"vcsusr\",\n\t\t\"vcs_password\": \"vcspass\",\n\t\t\"tfvc_project\": \"tfvcp\",\n\t\t\"use_lfs\": \"uselfs\",\n\t\t\"has_large_files\": false,\n\t\t\"large_files_size\": 1,\n\t\t\"large_files_count\": 1,\n\t\t\"status\": \"status\",\n\t\t\"commit_count\": 1,\n\t\t\"status_text\": \"statustxt\",\n\t\t\"authors_count\": 1,\n\t\t\"percent\": 1,\n\t\t\"push_percent\": 1,\n\t\t\"url\": \"url\",\n\t\t\"html_url\": \"hurl\",\n\t\t\"authors_url\": \"aurl\",\n\t\t\"repository_url\": \"rurl\",\n\t\t\"message\": \"msg\",\n\t\t\"failed_step\": \"fs\",\n\t\t\"human_name\": \"hn\",\n\t\t\"project_choices\": [\n\t\t\t{\n\t\t\t\t\"vcs_url\": \"vcsurl\"\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/migrations_test.go",
    "content": "// Copyright 2016 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestMigrationService_StartMigration(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/migrations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeMigrationsPreview)\n\n\t\tw.WriteHeader(http.StatusCreated)\n\t\tassertWrite(t, w, migrationJSON)\n\t})\n\n\topt := &MigrationOptions{\n\t\tLockRepositories:   true,\n\t\tExcludeAttachments: false,\n\t\tExcludeReleases:    true,\n\t\tExclude:            []string{\"repositories\"},\n\t}\n\tctx := t.Context()\n\tgot, _, err := client.Migrations.StartMigration(ctx, \"o\", []string{\"r\"}, opt)\n\tif err != nil {\n\t\tt.Errorf(\"StartMigration returned error: %v\", err)\n\t}\n\tif want := wantMigration; !cmp.Equal(got, want) {\n\t\tt.Errorf(\"StartMigration = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"StartMigration\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Migrations.StartMigration(ctx, \"\\n\", []string{\"\\n\"}, opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Migrations.StartMigration(ctx, \"o\", []string{\"r\"}, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestMigrationService_ListMigrations(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/migrations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeMigrationsPreview)\n\n\t\tw.WriteHeader(http.StatusOK)\n\t\tassertWrite(t, w, fmt.Appendf(nil, \"[%s]\", migrationJSON))\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Migrations.ListMigrations(ctx, \"o\", &ListOptions{Page: 1, PerPage: 2})\n\tif err != nil {\n\t\tt.Errorf(\"ListMigrations returned error: %v\", err)\n\t}\n\tif want := []*Migration{wantMigration}; !cmp.Equal(got, want) {\n\t\tt.Errorf(\"ListMigrations = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ListMigrations\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Migrations.ListMigrations(ctx, \"\\n\", &ListOptions{Page: 1, PerPage: 2})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Migrations.ListMigrations(ctx, \"o\", &ListOptions{Page: 1, PerPage: 2})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestMigrationService_MigrationStatus(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/migrations/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeMigrationsPreview)\n\n\t\tw.WriteHeader(http.StatusOK)\n\t\tassertWrite(t, w, migrationJSON)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Migrations.MigrationStatus(ctx, \"o\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"MigrationStatus returned error: %v\", err)\n\t}\n\tif want := wantMigration; !cmp.Equal(got, want) {\n\t\tt.Errorf(\"MigrationStatus = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"MigrationStatus\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Migrations.MigrationStatus(ctx, \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Migrations.MigrationStatus(ctx, \"o\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestMigrationService_MigrationArchiveURL(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/migrations/1/archive\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeMigrationsPreview)\n\n\t\thttp.Redirect(w, r, \"/yo\", http.StatusFound)\n\t})\n\tmux.HandleFunc(\"/yo\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\n\t\tw.WriteHeader(http.StatusOK)\n\t\tassertWrite(t, w, []byte(\"0123456789abcdef\"))\n\t})\n\n\tctx := t.Context()\n\tgot, err := client.Migrations.MigrationArchiveURL(ctx, \"o\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"MigrationStatus returned error: %v\", err)\n\t}\n\tif want := \"/yo\"; !strings.HasSuffix(got, want) {\n\t\tt.Errorf(\"MigrationArchiveURL = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"MigrationArchiveURL\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Migrations.MigrationArchiveURL(ctx, \"\\n\", -1)\n\t\treturn err\n\t})\n}\n\nfunc TestMigrationService_DeleteMigration(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/migrations/1/archive\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeMigrationsPreview)\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Migrations.DeleteMigration(ctx, \"o\", 1); err != nil {\n\t\tt.Errorf(\"DeleteMigration returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteMigration\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Migrations.DeleteMigration(ctx, \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Migrations.DeleteMigration(ctx, \"o\", 1)\n\t})\n}\n\nfunc TestMigrationService_UnlockRepo(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/migrations/1/repos/r/lock\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeMigrationsPreview)\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Migrations.UnlockRepo(ctx, \"o\", 1, \"r\"); err != nil {\n\t\tt.Errorf(\"UnlockRepo returned error: %v\", err)\n\t}\n\n\tconst methodName = \"UnlockRepo\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Migrations.UnlockRepo(ctx, \"\\n\", -1, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Migrations.UnlockRepo(ctx, \"o\", 1, \"r\")\n\t})\n}\n\nvar migrationJSON = []byte(`{\n  \"id\": 79,\n  \"guid\": \"0b989ba4-242f-11e5-81e1-c7b6966d2516\",\n  \"state\": \"pending\",\n  \"lock_repositories\": true,\n  \"exclude_attachments\": false,\n  \"url\": \"https://api.github.com/orgs/octo-org/migrations/79\",\n  \"created_at\": \"2015-07-06T15:33:38-07:00\",\n  \"updated_at\": \"2015-07-06T15:33:38-07:00\",\n  \"repositories\": [\n    {\n      \"id\": 1296269,\n      \"name\": \"Hello-World\",\n      \"full_name\": \"octocat/Hello-World\",\n      \"description\": \"This your first repo!\"\n    }\n  ]\n}`)\n\nvar wantMigration = &Migration{\n\tID:                 Ptr(int64(79)),\n\tGUID:               Ptr(\"0b989ba4-242f-11e5-81e1-c7b6966d2516\"),\n\tState:              Ptr(\"pending\"),\n\tLockRepositories:   Ptr(true),\n\tExcludeAttachments: Ptr(false),\n\tURL:                Ptr(\"https://api.github.com/orgs/octo-org/migrations/79\"),\n\tCreatedAt:          Ptr(\"2015-07-06T15:33:38-07:00\"),\n\tUpdatedAt:          Ptr(\"2015-07-06T15:33:38-07:00\"),\n\tRepositories: []*Repository{\n\t\t{\n\t\t\tID:          Ptr(int64(1296269)),\n\t\t\tName:        Ptr(\"Hello-World\"),\n\t\t\tFullName:    Ptr(\"octocat/Hello-World\"),\n\t\t\tDescription: Ptr(\"This your first repo!\"),\n\t\t},\n\t},\n}\n\nfunc TestMigration_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Migration{}, \"{}\")\n\n\tu := &Migration{\n\t\tID:                 Ptr(int64(1)),\n\t\tGUID:               Ptr(\"guid\"),\n\t\tState:              Ptr(\"state\"),\n\t\tLockRepositories:   Ptr(false),\n\t\tExcludeAttachments: Ptr(false),\n\t\tURL:                Ptr(\"url\"),\n\t\tCreatedAt:          Ptr(\"ca\"),\n\t\tUpdatedAt:          Ptr(\"ua\"),\n\t\tRepositories:       []*Repository{{ID: Ptr(int64(1))}},\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"guid\": \"guid\",\n\t\t\"state\": \"state\",\n\t\t\"lock_repositories\": false,\n\t\t\"exclude_attachments\": false,\n\t\t\"url\": \"url\",\n\t\t\"created_at\": \"ca\",\n\t\t\"updated_at\": \"ua\",\n\t\t\"repositories\": [\n\t\t\t{\n\t\t\t\t\"id\": 1\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestStartMigration_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &startMigration{}, \"{}\")\n\n\tu := &startMigration{\n\t\tRepositories:       []string{\"r\"},\n\t\tLockRepositories:   Ptr(false),\n\t\tExcludeAttachments: Ptr(false),\n\t}\n\n\twant := `{\n\t\t\"repositories\": [\n\t\t\t\"r\"\n\t\t],\n\t\t\"lock_repositories\": false,\n\t\t\"exclude_attachments\": false\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/migrations_user.go",
    "content": "// Copyright 2018 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n)\n\n// UserMigration represents a GitHub migration (archival).\ntype UserMigration struct {\n\tID   *int64  `json:\"id,omitempty\"`\n\tGUID *string `json:\"guid,omitempty\"`\n\t// State is the current state of a migration.\n\t// Possible values are:\n\t//     \"pending\" which means the migration hasn't started yet,\n\t//     \"exporting\" which means the migration is in progress,\n\t//     \"exported\" which means the migration finished successfully, or\n\t//     \"failed\" which means the migration failed.\n\tState *string `json:\"state,omitempty\"`\n\t// LockRepositories indicates whether repositories are locked (to prevent\n\t// manipulation) while migrating data.\n\tLockRepositories *bool `json:\"lock_repositories,omitempty\"`\n\t// ExcludeAttachments indicates whether attachments should be excluded from\n\t// the migration (to reduce migration archive file size).\n\tExcludeAttachments *bool         `json:\"exclude_attachments,omitempty\"`\n\tURL                *string       `json:\"url,omitempty\"`\n\tCreatedAt          *string       `json:\"created_at,omitempty\"`\n\tUpdatedAt          *string       `json:\"updated_at,omitempty\"`\n\tRepositories       []*Repository `json:\"repositories,omitempty\"`\n}\n\nfunc (m UserMigration) String() string {\n\treturn Stringify(m)\n}\n\n// UserMigrationOptions specifies the optional parameters to Migration methods.\ntype UserMigrationOptions struct {\n\t// LockRepositories indicates whether repositories should be locked (to prevent\n\t// manipulation) while migrating data.\n\tLockRepositories bool\n\n\t// ExcludeAttachments indicates whether attachments should be excluded from\n\t// the migration (to reduce migration archive file size).\n\tExcludeAttachments bool\n}\n\n// startUserMigration represents the body of a StartMigration request.\ntype startUserMigration struct {\n\t// Repositories is a slice of repository names to migrate.\n\tRepositories []string `json:\"repositories,omitempty\"`\n\n\t// LockRepositories indicates whether repositories should be locked (to prevent\n\t// manipulation) while migrating data.\n\tLockRepositories *bool `json:\"lock_repositories,omitempty\"`\n\n\t// ExcludeAttachments indicates whether attachments should be excluded from\n\t// the migration (to reduce migration archive file size).\n\tExcludeAttachments *bool `json:\"exclude_attachments,omitempty\"`\n}\n\n// StartUserMigration starts the generation of a migration archive.\n// repos is a slice of repository names to migrate.\n//\n// GitHub API docs: https://docs.github.com/rest/migrations/users#start-a-user-migration\n//\n//meta:operation POST /user/migrations\nfunc (s *MigrationService) StartUserMigration(ctx context.Context, repos []string, opts *UserMigrationOptions) (*UserMigration, *Response, error) {\n\tu := \"user/migrations\"\n\n\tbody := &startUserMigration{Repositories: repos}\n\tif opts != nil {\n\t\tbody.LockRepositories = Ptr(opts.LockRepositories)\n\t\tbody.ExcludeAttachments = Ptr(opts.ExcludeAttachments)\n\t}\n\n\treq, err := s.client.NewRequest(\"POST\", u, body)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeMigrationsPreview)\n\n\tvar m *UserMigration\n\tresp, err := s.client.Do(ctx, req, &m)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn m, resp, nil\n}\n\n// ListUserMigrations lists the most recent migrations.\n//\n// GitHub API docs: https://docs.github.com/rest/migrations/users#list-user-migrations\n//\n//meta:operation GET /user/migrations\nfunc (s *MigrationService) ListUserMigrations(ctx context.Context, opts *ListOptions) ([]*UserMigration, *Response, error) {\n\tu := \"user/migrations\"\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeMigrationsPreview)\n\n\tvar m []*UserMigration\n\tresp, err := s.client.Do(ctx, req, &m)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn m, resp, nil\n}\n\n// UserMigrationStatus gets the status of a specific migration archive.\n// id is the migration ID.\n//\n// GitHub API docs: https://docs.github.com/rest/migrations/users#get-a-user-migration-status\n//\n//meta:operation GET /user/migrations/{migration_id}\nfunc (s *MigrationService) UserMigrationStatus(ctx context.Context, id int64) (*UserMigration, *Response, error) {\n\tu := fmt.Sprintf(\"user/migrations/%v\", id)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeMigrationsPreview)\n\n\tvar m *UserMigration\n\tresp, err := s.client.Do(ctx, req, &m)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn m, resp, nil\n}\n\n// UserMigrationArchiveURL gets the URL for a specific migration archive.\n// id is the migration ID.\n//\n// GitHub API docs: https://docs.github.com/rest/migrations/users#download-a-user-migration-archive\n//\n//meta:operation GET /user/migrations/{migration_id}/archive\nfunc (s *MigrationService) UserMigrationArchiveURL(ctx context.Context, id int64) (string, error) {\n\turl := fmt.Sprintf(\"user/migrations/%v/archive\", id)\n\n\treq, err := s.client.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeMigrationsPreview)\n\n\tvar loc string\n\toriginalRedirect := s.client.client.CheckRedirect\n\ts.client.client.CheckRedirect = func(req *http.Request, _ []*http.Request) error {\n\t\tloc = req.URL.String()\n\t\treturn http.ErrUseLastResponse\n\t}\n\tdefer func() {\n\t\ts.client.client.CheckRedirect = originalRedirect\n\t}()\n\n\tvar m *UserMigration\n\tresp, err := s.client.Do(ctx, req, &m)\n\tif err == nil {\n\t\treturn \"\", errors.New(\"expected redirect, none provided\")\n\t}\n\n\tloc = resp.Header.Get(\"Location\")\n\treturn loc, nil\n}\n\n// DeleteUserMigration will delete a previous migration archive.\n// id is the migration ID.\n//\n// GitHub API docs: https://docs.github.com/rest/migrations/users#delete-a-user-migration-archive\n//\n//meta:operation DELETE /user/migrations/{migration_id}/archive\nfunc (s *MigrationService) DeleteUserMigration(ctx context.Context, id int64) (*Response, error) {\n\turl := fmt.Sprintf(\"user/migrations/%v/archive\", id)\n\n\treq, err := s.client.NewRequest(\"DELETE\", url, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeMigrationsPreview)\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// UnlockUserRepo will unlock a repo that was locked for migration.\n// id is migration ID.\n// You should unlock each migrated repository and delete them when the migration\n// is complete and you no longer need the source data.\n//\n// GitHub API docs: https://docs.github.com/rest/migrations/users#unlock-a-user-repository\n//\n//meta:operation DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock\nfunc (s *MigrationService) UnlockUserRepo(ctx context.Context, id int64, repo string) (*Response, error) {\n\turl := fmt.Sprintf(\"user/migrations/%v/repos/%v/lock\", id, repo)\n\n\treq, err := s.client.NewRequest(\"DELETE\", url, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeMigrationsPreview)\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/migrations_user_test.go",
    "content": "// Copyright 2018 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestMigrationService_StartUserMigration(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/migrations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeMigrationsPreview)\n\n\t\tw.WriteHeader(http.StatusCreated)\n\t\tassertWrite(t, w, userMigrationJSON)\n\t})\n\n\topt := &UserMigrationOptions{\n\t\tLockRepositories:   true,\n\t\tExcludeAttachments: false,\n\t}\n\n\tctx := t.Context()\n\tgot, _, err := client.Migrations.StartUserMigration(ctx, []string{\"r\"}, opt)\n\tif err != nil {\n\t\tt.Errorf(\"StartUserMigration returned error: %v\", err)\n\t}\n\n\twant := wantUserMigration\n\tif !cmp.Equal(want, got) {\n\t\tt.Errorf(\"StartUserMigration = %v, want = %v\", got, want)\n\t}\n\n\tconst methodName = \"StartUserMigration\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Migrations.StartUserMigration(ctx, []string{\"r\"}, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestMigrationService_ListUserMigrations(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/migrations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeMigrationsPreview)\n\n\t\tw.WriteHeader(http.StatusOK)\n\t\tassertWrite(t, w, fmt.Appendf(nil, \"[%s]\", userMigrationJSON))\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Migrations.ListUserMigrations(ctx, &ListOptions{Page: 1, PerPage: 2})\n\tif err != nil {\n\t\tt.Errorf(\"ListUserMigrations returned error %v\", err)\n\t}\n\n\twant := []*UserMigration{wantUserMigration}\n\tif !cmp.Equal(want, got) {\n\t\tt.Errorf(\"ListUserMigrations = %v, want = %v\", got, want)\n\t}\n\n\tconst methodName = \"ListUserMigrations\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Migrations.ListUserMigrations(ctx, &ListOptions{Page: 1, PerPage: 2})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestMigrationService_UserMigrationStatus(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/migrations/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeMigrationsPreview)\n\n\t\tw.WriteHeader(http.StatusOK)\n\t\tassertWrite(t, w, userMigrationJSON)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Migrations.UserMigrationStatus(ctx, 1)\n\tif err != nil {\n\t\tt.Errorf(\"UserMigrationStatus returned error %v\", err)\n\t}\n\n\twant := wantUserMigration\n\tif !cmp.Equal(want, got) {\n\t\tt.Errorf(\"UserMigrationStatus = %v, want = %v\", got, want)\n\t}\n\n\tconst methodName = \"UserMigrationStatus\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Migrations.UserMigrationStatus(ctx, 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestMigrationService_UserMigrationArchiveURL(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/migrations/1/archive\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeMigrationsPreview)\n\n\t\thttp.Redirect(w, r, \"/go-github\", http.StatusFound)\n\t})\n\n\tmux.HandleFunc(\"/go-github\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\n\t\tw.WriteHeader(http.StatusOK)\n\t})\n\n\tctx := t.Context()\n\tgot, err := client.Migrations.UserMigrationArchiveURL(ctx, 1)\n\tif err != nil {\n\t\tt.Errorf(\"UserMigrationArchiveURL returned error %v\", err)\n\t}\n\n\twant := \"/go-github\"\n\tif !strings.HasSuffix(got, want) {\n\t\tt.Errorf(\"UserMigrationArchiveURL = %v, want = %v\", got, want)\n\t}\n}\n\nfunc TestMigrationService_DeleteUserMigration(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/migrations/1/archive\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeMigrationsPreview)\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tgot, err := client.Migrations.DeleteUserMigration(ctx, 1)\n\tif err != nil {\n\t\tt.Errorf(\"DeleteUserMigration returned error %v\", err)\n\t}\n\n\tif got.StatusCode != http.StatusNoContent {\n\t\tt.Errorf(\"DeleteUserMigration returned status = %v, want = %v\", got.StatusCode, http.StatusNoContent)\n\t}\n\n\tconst methodName = \"DeleteUserMigration\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Migrations.DeleteUserMigration(ctx, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Migrations.DeleteUserMigration(ctx, 1)\n\t})\n}\n\nfunc TestMigrationService_UnlockUserRepo(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/migrations/1/repos/r/lock\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeMigrationsPreview)\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tgot, err := client.Migrations.UnlockUserRepo(ctx, 1, \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"UnlockUserRepo returned error %v\", err)\n\t}\n\n\tif got.StatusCode != http.StatusNoContent {\n\t\tt.Errorf(\"UnlockUserRepo returned status = %v, want = %v\", got.StatusCode, http.StatusNoContent)\n\t}\n\n\tconst methodName = \"UnlockUserRepo\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Migrations.UnlockUserRepo(ctx, -1, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Migrations.UnlockUserRepo(ctx, 1, \"r\")\n\t})\n}\n\nvar userMigrationJSON = []byte(`{\n  \"id\": 79,\n  \"guid\": \"0b989ba4-242f-11e5-81e1-c7b6966d2516\",\n  \"state\": \"pending\",\n  \"lock_repositories\": true,\n  \"exclude_attachments\": false,\n  \"url\": \"https://api.github.com/orgs/octo-org/migrations/79\",\n  \"created_at\": \"2015-07-06T15:33:38-07:00\",\n  \"updated_at\": \"2015-07-06T15:33:38-07:00\",\n  \"repositories\": [\n    {\n      \"id\": 1296269,\n      \"name\": \"Hello-World\",\n      \"full_name\": \"octocat/Hello-World\",\n      \"description\": \"This your first repo!\"\n    }\n  ]\n}`)\n\nvar wantUserMigration = &UserMigration{\n\tID:                 Ptr(int64(79)),\n\tGUID:               Ptr(\"0b989ba4-242f-11e5-81e1-c7b6966d2516\"),\n\tState:              Ptr(\"pending\"),\n\tLockRepositories:   Ptr(true),\n\tExcludeAttachments: Ptr(false),\n\tURL:                Ptr(\"https://api.github.com/orgs/octo-org/migrations/79\"),\n\tCreatedAt:          Ptr(\"2015-07-06T15:33:38-07:00\"),\n\tUpdatedAt:          Ptr(\"2015-07-06T15:33:38-07:00\"),\n\tRepositories: []*Repository{\n\t\t{\n\t\t\tID:          Ptr(int64(1296269)),\n\t\t\tName:        Ptr(\"Hello-World\"),\n\t\t\tFullName:    Ptr(\"octocat/Hello-World\"),\n\t\t\tDescription: Ptr(\"This your first repo!\"),\n\t\t},\n\t},\n}\n\nfunc TestUserMigration_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &UserMigration{}, \"{}\")\n\n\tu := &UserMigration{\n\t\tID:                 Ptr(int64(1)),\n\t\tGUID:               Ptr(\"guid\"),\n\t\tState:              Ptr(\"state\"),\n\t\tLockRepositories:   Ptr(false),\n\t\tExcludeAttachments: Ptr(false),\n\t\tURL:                Ptr(\"url\"),\n\t\tCreatedAt:          Ptr(\"ca\"),\n\t\tUpdatedAt:          Ptr(\"ua\"),\n\t\tRepositories:       []*Repository{{ID: Ptr(int64(1))}},\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"guid\": \"guid\",\n\t\t\"state\": \"state\",\n\t\t\"lock_repositories\": false,\n\t\t\"exclude_attachments\": false,\n\t\t\"url\": \"url\",\n\t\t\"created_at\": \"ca\",\n\t\t\"updated_at\": \"ua\",\n\t\t\"repositories\": [\n\t\t\t{\n\t\t\t\t\"id\": 1\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestStartUserMigration_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &startUserMigration{}, \"{}\")\n\n\tu := &startUserMigration{\n\t\tRepositories:       []string{\"r\"},\n\t\tLockRepositories:   Ptr(false),\n\t\tExcludeAttachments: Ptr(false),\n\t}\n\n\twant := `{\n\t\t\"repositories\": [\n\t\t\t\"r\"\n\t\t],\n\t\t\"lock_repositories\": false,\n\t\t\"exclude_attachments\": false\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/orgs.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// OrganizationsService provides access to the organization related functions\n// in the GitHub API.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/\ntype OrganizationsService service\n\n// Organization represents a GitHub organization account.\ntype Organization struct {\n\tLogin                       *string    `json:\"login,omitempty\"`\n\tID                          *int64     `json:\"id,omitempty\"`\n\tNodeID                      *string    `json:\"node_id,omitempty\"`\n\tAvatarURL                   *string    `json:\"avatar_url,omitempty\"`\n\tHTMLURL                     *string    `json:\"html_url,omitempty\"`\n\tName                        *string    `json:\"name,omitempty\"`\n\tCompany                     *string    `json:\"company,omitempty\"`\n\tBlog                        *string    `json:\"blog,omitempty\"`\n\tLocation                    *string    `json:\"location,omitempty\"`\n\tEmail                       *string    `json:\"email,omitempty\"`\n\tTwitterUsername             *string    `json:\"twitter_username,omitempty\"`\n\tDescription                 *string    `json:\"description,omitempty\"`\n\tPublicRepos                 *int       `json:\"public_repos,omitempty\"`\n\tPublicGists                 *int       `json:\"public_gists,omitempty\"`\n\tFollowers                   *int       `json:\"followers,omitempty\"`\n\tFollowing                   *int       `json:\"following,omitempty\"`\n\tCreatedAt                   *Timestamp `json:\"created_at,omitempty\"`\n\tUpdatedAt                   *Timestamp `json:\"updated_at,omitempty\"`\n\tTotalPrivateRepos           *int64     `json:\"total_private_repos,omitempty\"`\n\tOwnedPrivateRepos           *int64     `json:\"owned_private_repos,omitempty\"`\n\tPrivateGists                *int       `json:\"private_gists,omitempty\"`\n\tDiskUsage                   *int       `json:\"disk_usage,omitempty\"`\n\tCollaborators               *int       `json:\"collaborators,omitempty\"`\n\tBillingEmail                *string    `json:\"billing_email,omitempty\"`\n\tType                        *string    `json:\"type,omitempty\"`\n\tPlan                        *Plan      `json:\"plan,omitempty\"`\n\tTwoFactorRequirementEnabled *bool      `json:\"two_factor_requirement_enabled,omitempty\"`\n\tIsVerified                  *bool      `json:\"is_verified,omitempty\"`\n\tHasOrganizationProjects     *bool      `json:\"has_organization_projects,omitempty\"`\n\tHasRepositoryProjects       *bool      `json:\"has_repository_projects,omitempty\"`\n\n\t// DefaultRepoPermission can be one of: \"read\", \"write\", \"admin\", or \"none\". (Default: \"read\").\n\t// It is only used in OrganizationsService.Edit.\n\tDefaultRepoPermission *string `json:\"default_repository_permission,omitempty\"`\n\t// DefaultRepoSettings can be one of: \"read\", \"write\", \"admin\", or \"none\". (Default: \"read\").\n\t// It is only used in OrganizationsService.Get.\n\tDefaultRepoSettings *string `json:\"default_repository_settings,omitempty\"`\n\n\t// MembersCanCreateRepos default value is true and is only used in Organizations.Edit.\n\tMembersCanCreateRepos *bool `json:\"members_can_create_repositories,omitempty\"`\n\n\t// https://developer.github.com/changes/2019-12-03-internal-visibility-changes/#rest-v3-api\n\tMembersCanCreatePublicRepos   *bool `json:\"members_can_create_public_repositories,omitempty\"`\n\tMembersCanCreatePrivateRepos  *bool `json:\"members_can_create_private_repositories,omitempty\"`\n\tMembersCanCreateInternalRepos *bool `json:\"members_can_create_internal_repositories,omitempty\"`\n\n\t// MembersCanForkPrivateRepos toggles whether organization members can fork private organization repositories.\n\tMembersCanForkPrivateRepos *bool `json:\"members_can_fork_private_repositories,omitempty\"`\n\n\t// MembersAllowedRepositoryCreationType denotes if organization members can create repositories\n\t// and the type of repositories they can create. Possible values are: \"all\", \"private\", or \"none\".\n\t//\n\t// Deprecated: Use MembersCanCreatePublicRepos, MembersCanCreatePrivateRepos, MembersCanCreateInternalRepos\n\t// instead. The new fields overrides the existing MembersAllowedRepositoryCreationType during 'edit'\n\t// operation and does not consider 'internal' repositories during 'get' operation\n\tMembersAllowedRepositoryCreationType *string `json:\"members_allowed_repository_creation_type,omitempty\"`\n\n\t// MembersCanCreatePages toggles whether organization members can create GitHub Pages sites.\n\tMembersCanCreatePages *bool `json:\"members_can_create_pages,omitempty\"`\n\t// MembersCanCreatePublicPages toggles whether organization members can create public GitHub Pages sites.\n\tMembersCanCreatePublicPages *bool `json:\"members_can_create_public_pages,omitempty\"`\n\t// MembersCanCreatePrivatePages toggles whether organization members can create private GitHub Pages sites.\n\tMembersCanCreatePrivatePages *bool `json:\"members_can_create_private_pages,omitempty\"`\n\t// WebCommitSignoffRequire toggles\n\tWebCommitSignoffRequired *bool `json:\"web_commit_signoff_required,omitempty\"`\n\t// AdvancedSecurityAuditLogEnabled toggles whether the advanced security audit log is enabled.\n\tAdvancedSecurityEnabledForNewRepos *bool `json:\"advanced_security_enabled_for_new_repositories,omitempty\"`\n\t// DependabotAlertsEnabled toggles whether dependabot alerts are enabled.\n\tDependabotAlertsEnabledForNewRepos *bool `json:\"dependabot_alerts_enabled_for_new_repositories,omitempty\"`\n\t// DependabotSecurityUpdatesEnabled toggles whether dependabot security updates are enabled.\n\tDependabotSecurityUpdatesEnabledForNewRepos *bool `json:\"dependabot_security_updates_enabled_for_new_repositories,omitempty\"`\n\t// DependabotGraphEnabledForNewRepos toggles whether dependabot graph is enabled on new repositories.\n\tDependencyGraphEnabledForNewRepos *bool `json:\"dependency_graph_enabled_for_new_repositories,omitempty\"`\n\t// SecretScanningEnabled toggles whether secret scanning is enabled on new repositories.\n\tSecretScanningEnabledForNewRepos *bool `json:\"secret_scanning_enabled_for_new_repositories,omitempty\"`\n\t// SecretScanningPushProtectionEnabledForNewRepos toggles whether secret scanning push protection is enabled on new repositories.\n\tSecretScanningPushProtectionEnabledForNewRepos *bool `json:\"secret_scanning_push_protection_enabled_for_new_repositories,omitempty\"`\n\t// SecretScanningValidityChecksEnabled toggles whether secret scanning validity check is enabled.\n\tSecretScanningValidityChecksEnabled *bool `json:\"secret_scanning_validity_checks_enabled,omitempty\"`\n\t// MembersCanDeleteRepositories toggles whether members with admin permissions can delete a repository.\n\tMembersCanDeleteRepositories *bool `json:\"members_can_delete_repositories,omitempty\"`\n\t// MembersCanChangeRepoVisibility toggles whether members with admin permissions can change the visibility for a repository.\n\tMembersCanChangeRepoVisibility *bool `json:\"members_can_change_repo_visibility,omitempty\"`\n\t// MembersCanInviteOutsideCollaborators toggles whether members with admin permissions can invite outside collaborators.\n\tMembersCanInviteOutsideCollaborators *bool `json:\"members_can_invite_outside_collaborators,omitempty\"`\n\t// MembersCanDeleteIssues toggles whether members with admin permissions can delete issues.\n\tMembersCanDeleteIssues *bool `json:\"members_can_delete_issues,omitempty\"`\n\t// DisplayCommenterFullNameSettingEnabled toggles whether members can see the comment author's profile name in private repositories.\n\tDisplayCommenterFullNameSettingEnabled *bool `json:\"display_commenter_full_name_setting_enabled,omitempty\"`\n\t// ReadersCanCreateDiscussions toggles whether users with read access can create and comment on discussions.\n\tReadersCanCreateDiscussions *bool `json:\"readers_can_create_discussions,omitempty\"`\n\t// MembersCanCreateTeams toggles whether members of an organization can create new teams.\n\tMembersCanCreateTeams *bool `json:\"members_can_create_teams,omitempty\"`\n\t// MembersCanViewDependencyInsights toggles whether members may view dependency insights.\n\tMembersCanViewDependencyInsights *bool `json:\"members_can_view_dependency_insights,omitempty\"`\n\t// DefaultRepositoryBranch is the default branch for new repositories in the organization.\n\tDefaultRepositoryBranch *string `json:\"default_repository_branch,omitempty\"`\n\n\t// API URLs\n\tURL              *string `json:\"url,omitempty\"`\n\tEventsURL        *string `json:\"events_url,omitempty\"`\n\tHooksURL         *string `json:\"hooks_url,omitempty\"`\n\tIssuesURL        *string `json:\"issues_url,omitempty\"`\n\tMembersURL       *string `json:\"members_url,omitempty\"`\n\tPublicMembersURL *string `json:\"public_members_url,omitempty\"`\n\tReposURL         *string `json:\"repos_url,omitempty\"`\n}\n\n// OrganizationInstallations represents GitHub app installations for an organization.\ntype OrganizationInstallations struct {\n\tTotalCount    *int            `json:\"total_count,omitempty\"`\n\tInstallations []*Installation `json:\"installations,omitempty\"`\n}\n\nfunc (o Organization) String() string {\n\treturn Stringify(o)\n}\n\n// Plan represents the payment plan for an account. See plans at https://github.com/plans.\ntype Plan struct {\n\tName          *string `json:\"name,omitempty\"`\n\tSpace         *int    `json:\"space,omitempty\"`\n\tCollaborators *int    `json:\"collaborators,omitempty\"`\n\tPrivateRepos  *int64  `json:\"private_repos,omitempty\"`\n\tFilledSeats   *int    `json:\"filled_seats,omitempty\"`\n\tSeats         *int    `json:\"seats,omitempty\"`\n}\n\nfunc (p Plan) String() string {\n\treturn Stringify(p)\n}\n\n// OrganizationsListOptions specifies the optional parameters to the\n// OrganizationsService.ListAll method.\ntype OrganizationsListOptions struct {\n\t// An organization ID. Only return organizations with an ID greater than this ID.\n\tSince int64 `url:\"since,omitempty\"`\n\n\t// The number of results per page (max 100).\n\tPerPage int `url:\"per_page,omitempty\"`\n}\n\n// ListAll lists all organizations, in the order that they were created on GitHub.\n//\n// Note: Pagination is powered exclusively by the since parameter. To continue\n// listing the next set of organizations, use the ID of the last-returned organization\n// as the opts.Since parameter for the next call.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-organizations\n//\n//meta:operation GET /organizations\nfunc (s *OrganizationsService) ListAll(ctx context.Context, opts *OrganizationsListOptions) ([]*Organization, *Response, error) {\n\tu, err := addOptions(\"organizations\", opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\torgs := []*Organization{}\n\tresp, err := s.client.Do(ctx, req, &orgs)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn orgs, resp, nil\n}\n\n// List the organizations for a user. Passing the empty string will list\n// organizations for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-organizations-for-a-user\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user\n//\n//meta:operation GET /user/orgs\n//meta:operation GET /users/{username}/orgs\nfunc (s *OrganizationsService) List(ctx context.Context, user string, opts *ListOptions) ([]*Organization, *Response, error) {\n\tvar u string\n\tif user != \"\" {\n\t\tu = fmt.Sprintf(\"users/%v/orgs\", user)\n\t} else {\n\t\tu = \"user/orgs\"\n\t}\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar orgs []*Organization\n\tresp, err := s.client.Do(ctx, req, &orgs)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn orgs, resp, nil\n}\n\n// Get fetches an organization by name.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/orgs#get-an-organization\n//\n//meta:operation GET /orgs/{org}\nfunc (s *OrganizationsService) Get(ctx context.Context, org string) (*Organization, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v\", org)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeMemberAllowedRepoCreationTypePreview)\n\n\tvar o *Organization\n\tresp, err := s.client.Do(ctx, req, &o)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn o, resp, nil\n}\n\n// GetByID fetches an organization.\n//\n// Note: GetByID uses the undocumented GitHub API endpoint \"GET /organizations/{organization_id}\".\n//\n//meta:operation GET /organizations/{organization_id}\nfunc (s *OrganizationsService) GetByID(ctx context.Context, id int64) (*Organization, *Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v\", id)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar org *Organization\n\tresp, err := s.client.Do(ctx, req, &org)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn org, resp, nil\n}\n\n// Edit an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/orgs#update-an-organization\n//\n//meta:operation PATCH /orgs/{org}\nfunc (s *OrganizationsService) Edit(ctx context.Context, name string, org *Organization) (*Organization, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v\", name)\n\treq, err := s.client.NewRequest(\"PATCH\", u, org)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeMemberAllowedRepoCreationTypePreview)\n\n\tvar o *Organization\n\tresp, err := s.client.Do(ctx, req, &o)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn o, resp, nil\n}\n\n// Delete an organization by name.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/orgs#delete-an-organization\n//\n//meta:operation DELETE /orgs/{org}\nfunc (s *OrganizationsService) Delete(ctx context.Context, org string) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v\", org)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// ListInstallations lists installations for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-app-installations-for-an-organization\n//\n//meta:operation GET /orgs/{org}/installations\nfunc (s *OrganizationsService) ListInstallations(ctx context.Context, org string, opts *ListOptions) (*OrganizationInstallations, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/installations\", org)\n\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar result *OrganizationInstallations\n\tresp, err := s.client.Do(ctx, req, &result)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn result, resp, nil\n}\n"
  },
  {
    "path": "github/orgs_actions_allowed.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n)\n\n// GetActionsAllowed gets the actions that are allowed in an organization.\n//\n// Deprecated: please use `client.Actions.GetActionsAllowed` instead.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/permissions/selected-actions\nfunc (s *OrganizationsService) GetActionsAllowed(ctx context.Context, org string) (*ActionsAllowed, *Response, error) {\n\ts2 := (*ActionsService)(s)\n\treturn s2.GetActionsAllowed(ctx, org)\n}\n\n// UpdateActionsAllowed sets the actions that are allowed in an organization.\n//\n// Deprecated: please use `client.Actions.UpdateActionsAllowed` instead.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization\n//\n//meta:operation PUT /orgs/{org}/actions/permissions/selected-actions\nfunc (s *OrganizationsService) UpdateActionsAllowed(ctx context.Context, org string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error) {\n\ts2 := (*ActionsService)(s)\n\treturn s2.UpdateActionsAllowed(ctx, org, actionsAllowed)\n}\n"
  },
  {
    "path": "github/orgs_actions_allowed_test.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestOrganizationsService_GetActionsAllowed(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/permissions/selected-actions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"github_owned_allowed\":true, \"verified_allowed\":false, \"patterns_allowed\":[\"a/b\"]}`)\n\t})\n\n\tctx := t.Context()\n\torg, _, err := client.Organizations.GetActionsAllowed(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.GetActionsAllowed returned error: %v\", err)\n\t}\n\twant := &ActionsAllowed{GithubOwnedAllowed: Ptr(true), VerifiedAllowed: Ptr(false), PatternsAllowed: []string{\"a/b\"}}\n\tif !cmp.Equal(org, want) {\n\t\tt.Errorf(\"Organizations.GetActionsAllowed returned %+v, want %+v\", org, want)\n\t}\n\n\tconst methodName = \"GetActionsAllowed\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.GetActionsAllowed(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.GetActionsAllowed(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_UpdateActionsAllowed(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &ActionsAllowed{GithubOwnedAllowed: Ptr(true), VerifiedAllowed: Ptr(false), PatternsAllowed: []string{\"a/b\"}}\n\n\tmux.HandleFunc(\"/orgs/o/actions/permissions/selected-actions\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *ActionsAllowed\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"github_owned_allowed\":true, \"verified_allowed\":false, \"patterns_allowed\":[\"a/b\"]}`)\n\t})\n\n\tctx := t.Context()\n\torg, _, err := client.Organizations.UpdateActionsAllowed(ctx, \"o\", *input)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.UpdateActionsAllowed returned error: %v\", err)\n\t}\n\n\twant := &ActionsAllowed{GithubOwnedAllowed: Ptr(true), VerifiedAllowed: Ptr(false), PatternsAllowed: []string{\"a/b\"}}\n\tif !cmp.Equal(org, want) {\n\t\tt.Errorf(\"Organizations.UpdateActionsAllowed returned %+v, want %+v\", org, want)\n\t}\n\n\tconst methodName = \"UpdateActionsAllowed\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.UpdateActionsAllowed(ctx, \"\\n\", *input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.UpdateActionsAllowed(ctx, \"o\", *input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/orgs_actions_permissions.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n)\n\n// GetActionsPermissions gets the GitHub Actions permissions policy for repositories and allowed actions in an organization.\n//\n// Deprecated: please use `client.Actions.GetActionsPermissions` instead.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-an-organization\n//\n//meta:operation GET /orgs/{org}/actions/permissions\nfunc (s *OrganizationsService) GetActionsPermissions(ctx context.Context, org string) (*ActionsPermissions, *Response, error) {\n\ts2 := (*ActionsService)(s)\n\treturn s2.GetActionsPermissions(ctx, org)\n}\n\n// UpdateActionsPermissions sets the permissions policy for repositories and allowed actions in an organization.\n//\n// Deprecated: please use `client.Actions.UpdateActionsPermissions` instead.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-an-organization\n//\n//meta:operation PUT /orgs/{org}/actions/permissions\nfunc (s *OrganizationsService) UpdateActionsPermissions(ctx context.Context, org string, actionsPermissions ActionsPermissions) (*ActionsPermissions, *Response, error) {\n\ts2 := (*ActionsService)(s)\n\treturn s2.UpdateActionsPermissions(ctx, org, actionsPermissions)\n}\n"
  },
  {
    "path": "github/orgs_actions_permissions_test.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestOrganizationsService_GetActionsPermissions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/actions/permissions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"enabled_repositories\": \"all\", \"allowed_actions\": \"all\"}`)\n\t})\n\n\tctx := t.Context()\n\torg, _, err := client.Organizations.GetActionsPermissions(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.GetActionsPermissions returned error: %v\", err)\n\t}\n\twant := &ActionsPermissions{EnabledRepositories: Ptr(\"all\"), AllowedActions: Ptr(\"all\")}\n\tif !cmp.Equal(org, want) {\n\t\tt.Errorf(\"Organizations.GetActionsPermissions returned %+v, want %+v\", org, want)\n\t}\n\n\tconst methodName = \"GetActionsPermissions\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.GetActionsPermissions(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.GetActionsPermissions(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_UpdateActionsPermissions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &ActionsPermissions{EnabledRepositories: Ptr(\"all\"), AllowedActions: Ptr(\"selected\")}\n\n\tmux.HandleFunc(\"/orgs/o/actions/permissions\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *ActionsPermissions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"enabled_repositories\": \"all\", \"allowed_actions\": \"selected\"}`)\n\t})\n\n\tctx := t.Context()\n\torg, _, err := client.Organizations.UpdateActionsPermissions(ctx, \"o\", *input)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.UpdateActionsPermissions returned error: %v\", err)\n\t}\n\n\twant := &ActionsPermissions{EnabledRepositories: Ptr(\"all\"), AllowedActions: Ptr(\"selected\")}\n\tif !cmp.Equal(org, want) {\n\t\tt.Errorf(\"Organizations.UpdateActionsPermissions returned %+v, want %+v\", org, want)\n\t}\n\n\tconst methodName = \"UpdateActionsPermissions\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.UpdateActionsPermissions(ctx, \"\\n\", *input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.UpdateActionsPermissions(ctx, \"o\", *input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/orgs_artifacts.go",
    "content": "// Copyright 2026 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// DeploymentRuntimeRisk represents the runtime risk of a deployment.\ntype DeploymentRuntimeRisk string\n\nconst (\n\tDeploymentRuntimeRiskCriticalResource DeploymentRuntimeRisk = \"critical-resource\"\n\tDeploymentRuntimeRiskInternetExposed  DeploymentRuntimeRisk = \"internet-exposed\"\n\tDeploymentRuntimeRiskLateralMovement  DeploymentRuntimeRisk = \"lateral-movement\"\n\tDeploymentRuntimeRiskSensitiveData    DeploymentRuntimeRisk = \"sensitive-data\"\n)\n\n// ArtifactDeploymentRecord represents a GitHub artifact deployment record.\ntype ArtifactDeploymentRecord struct {\n\tID                  *int64                  `json:\"id,omitempty\"`\n\tDigest              *string                 `json:\"digest,omitempty\"`\n\tLogicalEnvironment  *string                 `json:\"logical_environment,omitempty\"`\n\tPhysicalEnvironment *string                 `json:\"physical_environment,omitempty\"`\n\tCluster             *string                 `json:\"cluster,omitempty\"`\n\tDeploymentName      *string                 `json:\"deployment_name,omitempty\"`\n\tTags                map[string]string       `json:\"tags,omitempty\"`\n\tRuntimeRisks        []DeploymentRuntimeRisk `json:\"runtime_risks,omitempty\"`\n\tAttestationID       *int64                  `json:\"attestation_id,omitempty\"`\n\tCreatedAt           *Timestamp              `json:\"created_at,omitempty\"`\n\tUpdatedAt           *Timestamp              `json:\"updated_at,omitempty\"`\n}\n\n// CreateArtifactDeploymentRequest represents the request body for creating a deployment record.\ntype CreateArtifactDeploymentRequest struct {\n\tName                string                  `json:\"name\"`\n\tDigest              string                  `json:\"digest\"`\n\tVersion             *string                 `json:\"version,omitempty\"`\n\tStatus              string                  `json:\"status\"`\n\tLogicalEnvironment  string                  `json:\"logical_environment\"`\n\tPhysicalEnvironment *string                 `json:\"physical_environment,omitempty\"`\n\tCluster             *string                 `json:\"cluster,omitempty\"`\n\tDeploymentName      string                  `json:\"deployment_name\"`\n\tTags                map[string]string       `json:\"tags,omitempty\"`\n\tRuntimeRisks        []DeploymentRuntimeRisk `json:\"runtime_risks,omitempty\"`\n\tGithubRepository    *string                 `json:\"github_repository,omitempty\"`\n}\n\n// ArtifactDeploymentResponse represents the response for deployment records.\ntype ArtifactDeploymentResponse struct {\n\tTotalCount        *int                        `json:\"total_count,omitempty\"`\n\tDeploymentRecords []*ArtifactDeploymentRecord `json:\"deployment_records,omitempty\"`\n}\n\n// ClusterArtifactDeployment represents a deployment within a cluster record request.\ntype ClusterArtifactDeployment struct {\n\tName             string                  `json:\"name\"`\n\tDigest           string                  `json:\"digest\"`\n\tVersion          *string                 `json:\"version,omitempty\"`\n\tStatus           string                  `json:\"status\"`\n\tDeploymentName   string                  `json:\"deployment_name\"`\n\tTags             map[string]string       `json:\"tags,omitempty\"`\n\tRuntimeRisks     []DeploymentRuntimeRisk `json:\"runtime_risks,omitempty\"`\n\tGithubRepository *string                 `json:\"github_repository,omitempty\"`\n}\n\n// ClusterDeploymentRecordsRequest represents the request body for setting cluster deployment records.\ntype ClusterDeploymentRecordsRequest struct {\n\tLogicalEnvironment  string                       `json:\"logical_environment\"`\n\tPhysicalEnvironment *string                      `json:\"physical_environment,omitempty\"`\n\tDeployments         []*ClusterArtifactDeployment `json:\"deployments\"`\n}\n\n// ArtifactStorageRecord represents a GitHub artifact storage record.\ntype ArtifactStorageRecord struct {\n\tID          *int64     `json:\"id,omitempty\"`\n\tName        *string    `json:\"name,omitempty\"`\n\tDigest      *string    `json:\"digest,omitempty\"`\n\tArtifactURL *string    `json:\"artifact_url,omitempty\"`\n\tRegistryURL *string    `json:\"registry_url,omitempty\"`\n\tRepository  *string    `json:\"repository,omitempty\"`\n\tStatus      *string    `json:\"status,omitempty\"`\n\tCreatedAt   *Timestamp `json:\"created_at,omitempty\"`\n\tUpdatedAt   *Timestamp `json:\"updated_at,omitempty\"`\n}\n\n// CreateArtifactStorageRequest represents the request body for creating a storage record.\ntype CreateArtifactStorageRequest struct {\n\tName             string  `json:\"name\"`\n\tDigest           string  `json:\"digest\"`\n\tVersion          *string `json:\"version,omitempty\"`\n\tArtifactURL      *string `json:\"artifact_url,omitempty\"`\n\tPath             *string `json:\"path,omitempty\"`\n\tRegistryURL      string  `json:\"registry_url\"`\n\tRepository       *string `json:\"repository,omitempty\"`\n\tStatus           *string `json:\"status,omitempty\"`\n\tGithubRepository *string `json:\"github_repository,omitempty\"`\n}\n\n// ArtifactStorageResponse represents the response for storage records.\ntype ArtifactStorageResponse struct {\n\tTotalCount     *int                     `json:\"total_count,omitempty\"`\n\tStorageRecords []*ArtifactStorageRecord `json:\"storage_records,omitempty\"`\n}\n\n// CreateArtifactDeploymentRecord creates or updates deployment records for an artifact associated with an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/artifact-metadata#create-an-artifact-deployment-record\n//\n//meta:operation POST /orgs/{org}/artifacts/metadata/deployment-record\nfunc (s *OrganizationsService) CreateArtifactDeploymentRecord(ctx context.Context, org string, record CreateArtifactDeploymentRequest) (*ArtifactDeploymentResponse, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/artifacts/metadata/deployment-record\", org)\n\treq, err := s.client.NewRequest(\"POST\", u, record)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar v *ArtifactDeploymentResponse\n\tresp, err := s.client.Do(ctx, req, &v)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn v, resp, nil\n}\n\n// SetClusterDeploymentRecords sets deployment records for a given cluster.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/artifact-metadata#set-cluster-deployment-records\n//\n//meta:operation POST /orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}\nfunc (s *OrganizationsService) SetClusterDeploymentRecords(ctx context.Context, org, cluster string, request ClusterDeploymentRecordsRequest) (*ArtifactDeploymentResponse, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/artifacts/metadata/deployment-record/cluster/%v\", org, cluster)\n\treq, err := s.client.NewRequest(\"POST\", u, request)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar v *ArtifactDeploymentResponse\n\tresp, err := s.client.Do(ctx, req, &v)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn v, resp, nil\n}\n\n// CreateArtifactStorageRecord creates metadata storage records for artifacts.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/artifact-metadata#create-artifact-metadata-storage-record\n//\n//meta:operation POST /orgs/{org}/artifacts/metadata/storage-record\nfunc (s *OrganizationsService) CreateArtifactStorageRecord(ctx context.Context, org string, record CreateArtifactStorageRequest) (*ArtifactStorageResponse, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/artifacts/metadata/storage-record\", org)\n\treq, err := s.client.NewRequest(\"POST\", u, record)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar v *ArtifactStorageResponse\n\tresp, err := s.client.Do(ctx, req, &v)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn v, resp, nil\n}\n\n// ListArtifactDeploymentRecords lists deployment records for an artifact metadata.\n//\n// subjectDigest is SHA256 digest of the artifact, in the form sha256:HEX_DIGEST.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/artifact-metadata#list-artifact-deployment-records\n//\n//meta:operation GET /orgs/{org}/artifacts/{subject_digest}/metadata/deployment-records\nfunc (s *OrganizationsService) ListArtifactDeploymentRecords(ctx context.Context, org, subjectDigest string) (*ArtifactDeploymentResponse, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/artifacts/%v/metadata/deployment-records\", org, subjectDigest)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar v *ArtifactDeploymentResponse\n\tresp, err := s.client.Do(ctx, req, &v)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn v, resp, nil\n}\n\n// ListArtifactStorageRecords lists artifact storage records with a given subject digest.\n//\n// subjectDigest is SHA256 digest of the artifact, in the form sha256:HEX_DIGEST.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/artifact-metadata#list-artifact-storage-records\n//\n//meta:operation GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records\nfunc (s *OrganizationsService) ListArtifactStorageRecords(ctx context.Context, org, subjectDigest string) (*ArtifactStorageResponse, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/artifacts/%v/metadata/storage-records\", org, subjectDigest)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar v *ArtifactStorageResponse\n\tresp, err := s.client.Do(ctx, req, &v)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn v, resp, nil\n}\n"
  },
  {
    "path": "github/orgs_artifacts_test.go",
    "content": "// Copyright 2026 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestOrganizationsService_CreateArtifactDeploymentRecord(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &CreateArtifactDeploymentRequest{\n\t\tName:               \"test-n\",\n\t\tDigest:             \"sha256:123\",\n\t\tVersion:            Ptr(\"v1.0.0\"),\n\t\tStatus:             \"deployed\",\n\t\tLogicalEnvironment: \"prod\",\n\t\tDeploymentName:     \"dep-1\",\n\t\tRuntimeRisks:       []DeploymentRuntimeRisk{DeploymentRuntimeRiskCriticalResource, DeploymentRuntimeRiskInternetExposed},\n\t\tGithubRepository:   Ptr(\"octo-org/octo-repo\"),\n\t\tTags: map[string]string{\n\t\t\t\"data-access\": \"sensitive\",\n\t\t},\n\t}\n\n\tmux.HandleFunc(\"/orgs/o/artifacts/metadata/deployment-record\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestJSONMarshal(t, input, `{\"name\":\"test-n\",\"digest\":\"sha256:123\",\"version\":\"v1.0.0\",\"status\":\"deployed\",\"logical_environment\":\"prod\",\"deployment_name\":\"dep-1\",\"tags\":{\"data-access\":\"sensitive\"},\"runtime_risks\":[\"critical-resource\",\"internet-exposed\"],\"github_repository\":\"octo-org/octo-repo\"}`)\n\t\tfmt.Fprint(w, `{\"total_count\":1,\"deployment_records\":[{\"id\":1}]}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Organizations.CreateArtifactDeploymentRecord(ctx, \"o\", *input)\n\tif err != nil {\n\t\tt.Errorf(\"CreateArtifactDeploymentRecord returned error: %v\", err)\n\t}\n\n\twant := &ArtifactDeploymentResponse{\n\t\tTotalCount:        Ptr(1),\n\t\tDeploymentRecords: []*ArtifactDeploymentRecord{{ID: Ptr(int64(1))}},\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"CreateArtifactDeploymentRecord returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"CreateArtifactDeploymentRecord\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.CreateArtifactDeploymentRecord(ctx, \"\\n\", *input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.CreateArtifactDeploymentRecord(ctx, \"o\", *input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_SetClusterDeploymentRecords(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &ClusterDeploymentRecordsRequest{\n\t\tLogicalEnvironment:  \"prod\",\n\t\tPhysicalEnvironment: Ptr(\"pacific-east\"),\n\t\tDeployments: []*ClusterArtifactDeployment{\n\t\t\t{\n\t\t\t\tName:           \"awesome-image\",\n\t\t\t\tDigest:         \"sha256:abc\",\n\t\t\t\tDeploymentName: \"dep-1\",\n\t\t\t\tVersion:        Ptr(\"v2.0\"),\n\t\t\t\tStatus:         \"deployed\",\n\t\t\t},\n\t\t},\n\t}\n\n\tmux.HandleFunc(\"/orgs/o/artifacts/metadata/deployment-record/cluster/c1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestJSONMarshal(t, input, `{\"logical_environment\":\"prod\",\"physical_environment\":\"pacific-east\",\"deployments\":[{\"name\":\"awesome-image\",\"digest\":\"sha256:abc\",\"version\":\"v2.0\",\"status\":\"deployed\",\"deployment_name\":\"dep-1\"}]}`)\n\t\tfmt.Fprint(w, `{\"total_count\":1,\"deployment_records\":[{\"id\":2}]}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Organizations.SetClusterDeploymentRecords(ctx, \"o\", \"c1\", *input)\n\tif err != nil {\n\t\tt.Errorf(\"SetClusterDeploymentRecords returned error: %v\", err)\n\t}\n\n\twant := &ArtifactDeploymentResponse{\n\t\tTotalCount:        Ptr(1),\n\t\tDeploymentRecords: []*ArtifactDeploymentRecord{{ID: Ptr(int64(2))}},\n\t}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"SetClusterDeploymentRecords returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"SetClusterDeploymentRecords\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.SetClusterDeploymentRecords(ctx, \"\\n\", \"\\n\", *input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.SetClusterDeploymentRecords(ctx, \"o\", \"c1\", *input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_CreateArtifactStorageRecord(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &CreateArtifactStorageRequest{\n\t\tName:             \"libfoo\",\n\t\tDigest:           \"sha256:123\",\n\t\tVersion:          Ptr(\"v1.2.3\"),\n\t\tPath:             Ptr(\"target/libs\"),\n\t\tGithubRepository: Ptr(\"org/repo\"),\n\t\tRegistryURL:      \"https://reg.example.com\",\n\t\tStatus:           Ptr(\"active\"),\n\t}\n\n\tmux.HandleFunc(\"/orgs/o/artifacts/metadata/storage-record\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestJSONMarshal(t, input, `{\"name\":\"libfoo\",\"digest\":\"sha256:123\",\"version\":\"v1.2.3\",\"path\":\"target/libs\",\"registry_url\":\"https://reg.example.com\",\"status\":\"active\",\"github_repository\":\"org/repo\"}`)\n\t\tfmt.Fprint(w, `{\"total_count\":1,\"storage_records\":[{\"name\":\"libfoo\"}]}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Organizations.CreateArtifactStorageRecord(ctx, \"o\", *input)\n\tif err != nil {\n\t\tt.Errorf(\"CreateArtifactStorageRecord returned error: %v\", err)\n\t}\n\n\twant := &ArtifactStorageResponse{\n\t\tTotalCount:     Ptr(1),\n\t\tStorageRecords: []*ArtifactStorageRecord{{Name: Ptr(\"libfoo\")}},\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"CreateArtifactStorageRecord returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"CreateArtifactStorageRecord\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.CreateArtifactStorageRecord(ctx, \"\\n\", *input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.CreateArtifactStorageRecord(ctx, \"o\", *input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_ListArtifactDeploymentRecords(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/artifacts/sha256:abc/metadata/deployment-records\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{})\n\t\tfmt.Fprint(w, `{\"total_count\":1,\"deployment_records\":[{\"id\":1, \"runtime_risks\": [\"sensitive-data\"]}]}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Organizations.ListArtifactDeploymentRecords(ctx, \"o\", \"sha256:abc\")\n\tif err != nil {\n\t\tt.Errorf(\"ListArtifactDeploymentRecords returned error: %v\", err)\n\t}\n\n\twant := &ArtifactDeploymentResponse{\n\t\tTotalCount: Ptr(1),\n\t\tDeploymentRecords: []*ArtifactDeploymentRecord{\n\t\t\t{ID: Ptr(int64(1)), RuntimeRisks: []DeploymentRuntimeRisk{DeploymentRuntimeRiskSensitiveData}},\n\t\t},\n\t}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"ListArtifactDeploymentRecords returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ListArtifactDeploymentRecords\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListArtifactDeploymentRecords(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListArtifactDeploymentRecords(ctx, \"o\", \"sha256:abc\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_ListArtifactStorageRecords(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/artifacts/sha256:abc/metadata/storage-records\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{})\n\t\tfmt.Fprint(w, `{\"total_count\":1,\"storage_records\":[{\"name\":\"libfoo\"}]}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Organizations.ListArtifactStorageRecords(ctx, \"o\", \"sha256:abc\")\n\tif err != nil {\n\t\tt.Errorf(\"ListArtifactStorageRecords returned error: %v\", err)\n\t}\n\n\twant := &ArtifactStorageResponse{\n\t\tTotalCount:     Ptr(1),\n\t\tStorageRecords: []*ArtifactStorageRecord{{Name: Ptr(\"libfoo\")}},\n\t}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"ListArtifactStorageRecords returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ListArtifactStorageRecords\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListArtifactStorageRecords(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListArtifactStorageRecords(ctx, \"o\", \"sha256:abc\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/orgs_attestations.go",
    "content": "// Copyright 2024 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// ListAttestations returns a collection of artifact attestations\n// with a given subject digest that are associated with repositories\n// owned by an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/attestations#list-attestations\n//\n//meta:operation GET /orgs/{org}/attestations/{subject_digest}\nfunc (s *OrganizationsService) ListAttestations(ctx context.Context, org, subjectDigest string, opts *ListOptions) (*AttestationsResponse, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/attestations/%v\", org, subjectDigest)\n\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar attestations *AttestationsResponse\n\tresp, err := s.client.Do(ctx, req, &attestations)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn attestations, resp, nil\n}\n"
  },
  {
    "path": "github/orgs_attestations_test.go",
    "content": "// Copyright 2024 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestOrganizationsService_ListAttestations(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/attestations/digest\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"attestations\": [\n\t\t\t\t{\n\t\t\t\t\t\"repository_id\": 1,\n\t\t\t\t\t\"bundle\": {}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"repository_id\": 2,\n\t\t\t\t\t\"bundle\": {}\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\tctx := t.Context()\n\tattestations, _, err := client.Organizations.ListAttestations(ctx, \"o\", \"digest\", &ListOptions{})\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListAttestations returned error: %v\", err)\n\t}\n\n\twant := &AttestationsResponse{\n\t\tAttestations: []*Attestation{\n\t\t\t{\n\t\t\t\tRepositoryID: 1,\n\t\t\t\tBundle:       []byte(`{}`),\n\t\t\t},\n\t\t\t{\n\t\t\t\tRepositoryID: 2,\n\t\t\t\tBundle:       []byte(`{}`),\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(attestations, want) {\n\t\tt.Errorf(\"Organizations.ListAttestations = %+v, want %+v\", attestations, want)\n\t}\n\tconst methodName = \"ListAttestations\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListAttestations(ctx, \"\\n\", \"\\n\", &ListOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListAttestations(ctx, \"o\", \"digest\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/orgs_audit_log.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n)\n\n// GetAuditLogOptions sets up optional parameters to query audit-log endpoint.\ntype GetAuditLogOptions struct {\n\tPhrase  *string `url:\"phrase,omitempty\"`  // A search phrase. (Optional.)\n\tInclude *string `url:\"include,omitempty\"` // Event type includes. Can be one of \"web\", \"git\", \"all\". Default: \"web\". (Optional.)\n\tOrder   *string `url:\"order,omitempty\"`   // The order of audit log events. Can be one of \"asc\" or \"desc\". Default: \"desc\". (Optional.)\n\n\tListCursorOptions\n}\n\n// ActorLocation contains information about reported location for an actor.\ntype ActorLocation struct {\n\tCountryCode *string `json:\"country_code,omitempty\"`\n}\n\n// AuditEntry describes the fields that may be represented by various audit-log \"action\" entries.\n// There are many other fields that may be present depending on the action. You can access those\n// in AdditionalFields.\n// For a list of actions see - https://docs.github.com/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#audit-log-actions\ntype AuditEntry struct {\n\tAction                   *string        `json:\"action,omitempty\"` // The name of the action that was performed, for example `user.login` or `repo.create`.\n\tActor                    *string        `json:\"actor,omitempty\"`  // The actor who performed the action.\n\tActorID                  *int64         `json:\"actor_id,omitempty\"`\n\tActorLocation            *ActorLocation `json:\"actor_location,omitempty\"`\n\tBusiness                 *string        `json:\"business,omitempty\"`\n\tBusinessID               *int64         `json:\"business_id,omitempty\"`\n\tCreatedAt                *Timestamp     `json:\"created_at,omitempty\"`\n\tDocumentID               *string        `json:\"_document_id,omitempty\"`\n\tExternalIdentityNameID   *string        `json:\"external_identity_nameid,omitempty\"`\n\tExternalIdentityUsername *string        `json:\"external_identity_username,omitempty\"`\n\tHashedToken              *string        `json:\"hashed_token,omitempty\"`\n\tOrg                      *string        `json:\"org,omitempty\"`\n\tOrgID                    *int64         `json:\"org_id,omitempty\"`\n\tTimestamp                *Timestamp     `json:\"@timestamp,omitempty\"` // The time the audit log event occurred, given as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time).\n\tTokenID                  *int64         `json:\"token_id,omitempty\"`\n\tTokenScopes              *string        `json:\"token_scopes,omitempty\"`\n\tUser                     *string        `json:\"user,omitempty\"` // The user that was affected by the action performed (if available).\n\tUserID                   *int64         `json:\"user_id,omitempty\"`\n\n\t// Some events types have a data field that contains additional information about the event.\n\tData map[string]any `json:\"data,omitempty\"`\n\n\t// All fields that are not explicitly defined in the struct are captured here.\n\tAdditionalFields map[string]any `json:\"-\"`\n}\n\n// UnmarshalJSON implements the json.Unmarshaler interface.\nfunc (a *AuditEntry) UnmarshalJSON(data []byte) error {\n\ttype entryAlias AuditEntry\n\tvar v entryAlias\n\tif err := json.Unmarshal(data, &v); err != nil {\n\t\treturn err\n\t}\n\n\trawDefinedFields, err := json.Marshal(v)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefinedFields := map[string]any{}\n\tif err := json.Unmarshal(rawDefinedFields, &definedFields); err != nil {\n\t\treturn err\n\t}\n\n\tif err := json.Unmarshal(data, &v.AdditionalFields); err != nil {\n\t\treturn err\n\t}\n\n\tfor key, val := range v.AdditionalFields {\n\t\tif _, ok := definedFields[key]; ok || val == nil {\n\t\t\tdelete(v.AdditionalFields, key)\n\t\t}\n\t}\n\n\t*a = AuditEntry(v)\n\tif len(v.AdditionalFields) == 0 {\n\t\ta.AdditionalFields = nil\n\t}\n\treturn nil\n}\n\n// MarshalJSON implements the json.Marshaler interface.\nfunc (a *AuditEntry) MarshalJSON() ([]byte, error) {\n\ttype entryAlias AuditEntry\n\tv := entryAlias(*a)\n\tdefBytes, err := json.Marshal(v)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(a.AdditionalFields) == 0 {\n\t\treturn defBytes, err\n\t}\n\tresMap := map[string]any{}\n\tif err := json.Unmarshal(defBytes, &resMap); err != nil {\n\t\treturn nil, err\n\t}\n\tfor key, val := range a.AdditionalFields {\n\t\tif val == nil {\n\t\t\tcontinue\n\t\t}\n\t\tif _, ok := resMap[key]; ok {\n\t\t\treturn nil, fmt.Errorf(\"unexpected field in AdditionalFields: %v\", key)\n\t\t}\n\t\tresMap[key] = val\n\t}\n\treturn json.Marshal(resMap)\n}\n\n// GetAuditLog gets the audit-log entries for an organization.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs#get-the-audit-log-for-an-organization\n//\n//meta:operation GET /orgs/{org}/audit-log\nfunc (s *OrganizationsService) GetAuditLog(ctx context.Context, org string, opts *GetAuditLogOptions) ([]*AuditEntry, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/audit-log\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar auditEntries []*AuditEntry\n\tresp, err := s.client.Do(ctx, req, &auditEntries)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn auditEntries, resp, nil\n}\n"
  },
  {
    "path": "github/orgs_audit_log_test.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestOrganizationService_GetAuditLog(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/audit-log\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"include\": \"all\", \"phrase\": \"action:workflows\", \"order\": \"asc\"})\n\n\t\tfmt.Fprint(w, `[\n\t{\n\t\t\"@timestamp\": 1615077308538,\n\t\t\"_document_id\": \"beeZYapIUe-wKg5-beadb33\",\n\t\t\"action\": \"workflows.completed_workflow_run\",\n\t\t\"active\": true,\n\t\t\"actor\": \"testactor\",\n\t\t\"actor_ip\": \"10.0.0.1\",\n\t\t\"actor_location\": {\n\t\t\t\"country_code\": \"US\"\n\t\t},\n\t\t\"cancelled_at\": \"2021-03-07T00:35:08.000Z\",\n\t\t\"completed_at\": \"2021-03-07T00:35:08.000Z\",\n\t\t\"conclusion\": \"success\",\n\t\t\"config\": {\n\t\t\t\"content_type\": \"json\",\n\t\t\t\"insecure_ssl\": \"0\",\n\t\t\t\"url\": \"https://example.com/deadbeef-new-hook\"\n\t\t},\n\t\t\"created_at\": 1615077308538,\n\t\t\"event\": \"schedule\",\n\t\t\"events\": [\"code_scanning_alert\"],\n\t\t\"hashed_token\": \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\",\n\t\t\"head_branch\": \"master\",\n\t\t\"head_sha\": \"5acdeadbeef64d1a62388e901e5cdc9358644b37\",\n\t\t\"job_workflow_ref\": \"testorg/testrepo/.github/workflows/testjob.yml@refs/pull/1/merge\",\n\t\t\"name\": \"Code scanning - action\",\n\t\t\"oauth_application_id\": 1,\n\t\t\"old_permission\": \"read\",\n\t\t\"org\": \"o\",\n\t\t\"org_id\": 1,\n\t\t\"overridden_codes\": [\n\t\t\t\"review_policy_not_satisfied\"\n\t\t],\n\t\t\"permission\": \"admin\",\n\t\t\"pull_request_id\": 1,\n\t\t\"pull_request_title\": \"a pr title\",\n\t\t\"pull_request_url\": \"https://github.com/testorg/testrepo/pull/1\",\n\t\t\"reasons\": [\n\t\t\t{\n\t\t\t\t\"code\": \"a code\",\n\t\t\t\t\"message\": \"a message\"\n\t\t\t}\n\t\t],\n\t\t\"programmatic_access_type\": \"GitHub App server-to-server token\",\n\t\t\"referrer\": \"a referrer\",\n\t\t\"repo\": \"o/blue-crayon-1\",\n\t\t\"run_attempt\": 1,\n\t\t\"run_number\": 1,\n\t\t\"started_at\": \"2021-03-07T00:33:04.000Z\",\n\t\t\"token_id\": 1,\n\t\t\"token_scopes\": \"gist,repo:read\",\n\t\t\"topic\": \"cp1-iad.ingest.github.actions.v0.WorkflowUpdate\",\n\t\t\"trigger_id\": null,\n\t\t\"user_agent\": \"a user agent\",\n\t\t\"workflow_id\": 123456,\n\t\t\"workflow_run_id\": 628312345\n\t}]`)\n\t})\n\tctx := t.Context()\n\tgetOpts := GetAuditLogOptions{\n\t\tInclude: Ptr(\"all\"),\n\t\tPhrase:  Ptr(\"action:workflows\"),\n\t\tOrder:   Ptr(\"asc\"),\n\t}\n\n\tauditEntries, _, err := client.Organizations.GetAuditLog(ctx, \"o\", &getOpts)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.GetAuditLog returned error: %v\", err)\n\t}\n\ttimestamp := time.Unix(0, 1615077308538*1e6)\n\n\twant := []*AuditEntry{\n\t\t{\n\t\t\tTimestamp:  &Timestamp{timestamp},\n\t\t\tDocumentID: Ptr(\"beeZYapIUe-wKg5-beadb33\"),\n\t\t\tAction:     Ptr(\"workflows.completed_workflow_run\"),\n\t\t\tActor:      Ptr(\"testactor\"),\n\t\t\tActorLocation: &ActorLocation{\n\t\t\t\tCountryCode: Ptr(\"US\"),\n\t\t\t},\n\t\t\tCreatedAt:   &Timestamp{timestamp},\n\t\t\tHashedToken: Ptr(\"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\"),\n\t\t\tOrg:         Ptr(\"o\"),\n\t\t\tOrgID:       Ptr(int64(1)),\n\t\t\tTokenID:     Ptr(int64(1)),\n\t\t\tTokenScopes: Ptr(\"gist,repo:read\"),\n\t\t\tAdditionalFields: map[string]any{\n\t\t\t\t\"actor_ip\":                 \"10.0.0.1\",\n\t\t\t\t\"active\":                   true,\n\t\t\t\t\"cancelled_at\":             \"2021-03-07T00:35:08.000Z\",\n\t\t\t\t\"completed_at\":             \"2021-03-07T00:35:08.000Z\",\n\t\t\t\t\"conclusion\":               \"success\",\n\t\t\t\t\"event\":                    \"schedule\",\n\t\t\t\t\"head_branch\":              \"master\",\n\t\t\t\t\"head_sha\":                 \"5acdeadbeef64d1a62388e901e5cdc9358644b37\",\n\t\t\t\t\"job_workflow_ref\":         \"testorg/testrepo/.github/workflows/testjob.yml@refs/pull/1/merge\",\n\t\t\t\t\"name\":                     \"Code scanning - action\",\n\t\t\t\t\"oauth_application_id\":     float64(1),\n\t\t\t\t\"old_permission\":           \"read\",\n\t\t\t\t\"overridden_codes\":         []any{\"review_policy_not_satisfied\"},\n\t\t\t\t\"permission\":               \"admin\",\n\t\t\t\t\"programmatic_access_type\": \"GitHub App server-to-server token\",\n\t\t\t\t\"pull_request_id\":          float64(1),\n\t\t\t\t\"pull_request_title\":       \"a pr title\",\n\t\t\t\t\"pull_request_url\":         \"https://github.com/testorg/testrepo/pull/1\",\n\t\t\t\t\"reasons\": []any{map[string]any{\n\t\t\t\t\t\"code\":    \"a code\",\n\t\t\t\t\t\"message\": \"a message\",\n\t\t\t\t}},\n\t\t\t\t\"referrer\":        \"a referrer\",\n\t\t\t\t\"repo\":            \"o/blue-crayon-1\",\n\t\t\t\t\"run_attempt\":     float64(1),\n\t\t\t\t\"run_number\":      float64(1),\n\t\t\t\t\"started_at\":      \"2021-03-07T00:33:04.000Z\",\n\t\t\t\t\"topic\":           \"cp1-iad.ingest.github.actions.v0.WorkflowUpdate\",\n\t\t\t\t\"user_agent\":      \"a user agent\",\n\t\t\t\t\"workflow_id\":     float64(123456),\n\t\t\t\t\"workflow_run_id\": float64(628312345),\n\t\t\t\t\"events\":          []any{\"code_scanning_alert\"},\n\t\t\t\t\"config\": map[string]any{\n\t\t\t\t\t\"content_type\": \"json\",\n\t\t\t\t\t\"insecure_ssl\": \"0\",\n\t\t\t\t\t\"url\":          \"https://example.com/deadbeef-new-hook\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tassertNoDiff(t, want, auditEntries)\n\n\tconst methodName = \"GetAuditLog\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.GetAuditLog(ctx, \"\\n\", &getOpts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailureCategory(t, methodName, client, AuditLogCategory, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.GetAuditLog(ctx, \"o\", &GetAuditLogOptions{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestHookConfig_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &HookConfig{}, \"{}\")\n\n\tu := &HookConfig{\n\t\tContentType: Ptr(\"ct\"),\n\t\tInsecureSSL: Ptr(\"ct\"),\n\t\tURL:         Ptr(\"url\"),\n\t}\n\n\twant := `{\n\t\t\"content_type\": \"ct\",\n\t\t\"insecure_ssl\": \"ct\",\n\t\t\"url\": \"url\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestAuditEntry_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &AuditEntry{}, \"{}\")\n\n\tu := &AuditEntry{\n\t\tAction:                   Ptr(\"a\"),\n\t\tActor:                    Ptr(\"ac\"),\n\t\tActorLocation:            &ActorLocation{CountryCode: Ptr(\"alcc\")},\n\t\tBusiness:                 Ptr(\"b\"),\n\t\tCreatedAt:                &Timestamp{referenceTime},\n\t\tDocumentID:               Ptr(\"did\"),\n\t\tExternalIdentityNameID:   Ptr(\"ein\"),\n\t\tExternalIdentityUsername: Ptr(\"eiu\"),\n\t\tHashedToken:              Ptr(\"ht\"),\n\t\tOrg:                      Ptr(\"o\"),\n\t\tOrgID:                    Ptr(int64(1)),\n\t\tTimestamp:                &Timestamp{referenceTime},\n\t\tTokenID:                  Ptr(int64(1)),\n\t\tTokenScopes:              Ptr(\"ts\"),\n\t\tUser:                     Ptr(\"u\"),\n\t\tData: map[string]any{\n\t\t\t\"old_name\":  \"on\",\n\t\t\t\"old_login\": \"ol\",\n\t\t},\n\t\tAdditionalFields: map[string]any{\n\t\t\t\"active\":       false,\n\t\t\t\"active_was\":   false,\n\t\t\t\"actor_ip\":     \"aip\",\n\t\t\t\"blocked_user\": \"bu\",\n\t\t\t\"cancelled_at\": \"2021-03-07T00:35:08.000Z\",\n\t\t\t\"completed_at\": \"2021-03-07T00:35:08.000Z\",\n\t\t\t\"conclusion\":   \"c\",\n\t\t\t\"config\": map[string]any{\n\t\t\t\t\"url\": \"s\",\n\t\t\t},\n\t\t\t\"config_was\": map[string]any{\n\t\t\t\t\"url\": \"s\",\n\t\t\t},\n\t\t\t\"content_type\":             \"ct\",\n\t\t\t\"deploy_key_fingerprint\":   \"dkf\",\n\t\t\t\"emoji\":                    \"e\",\n\t\t\t\"environment_name\":         \"en\",\n\t\t\t\"event\":                    \"e\",\n\t\t\t\"events\":                   []any{\"s\"},\n\t\t\t\"events_were\":              []any{\"s\"},\n\t\t\t\"explanation\":              \"e\",\n\t\t\t\"fingerprint\":              \"f\",\n\t\t\t\"head_branch\":              \"hb\",\n\t\t\t\"head_sha\":                 \"hsha\",\n\t\t\t\"hook_id\":                  float64(1),\n\t\t\t\"is_hosted_runner\":         false,\n\t\t\t\"job_name\":                 \"jn\",\n\t\t\t\"limited_availability\":     false,\n\t\t\t\"message\":                  \"m\",\n\t\t\t\"name\":                     \"n\",\n\t\t\t\"old_permission\":           \"op\",\n\t\t\t\"old_user\":                 \"ou\",\n\t\t\t\"openssh_public_key\":       \"osshpk\",\n\t\t\t\"permission\":               \"p\",\n\t\t\t\"previous_visibility\":      \"pv\",\n\t\t\t\"programmatic_access_type\": \"pat\",\n\t\t\t\"pull_request_id\":          float64(1),\n\t\t\t\"pull_request_title\":       \"prt\",\n\t\t\t\"pull_request_url\":         \"pru\",\n\t\t\t\"read_only\":                \"ro\",\n\t\t\t\"reasons\": []any{\n\t\t\t\tmap[string]any{\n\t\t\t\t\t\"code\":    \"c\",\n\t\t\t\t\t\"message\": \"m\",\n\t\t\t\t},\n\t\t\t},\n\t\t\t\"referrer\":                \"a referrer\",\n\t\t\t\"repo\":                    \"r\",\n\t\t\t\"repository\":              \"repo\",\n\t\t\t\"repository_public\":       false,\n\t\t\t\"run_attempt\":             1,\n\t\t\t\"runner_group_id\":         1,\n\t\t\t\"runner_group_name\":       \"rgn\",\n\t\t\t\"runner_id\":               1,\n\t\t\t\"runner_labels\":           []any{\"s\"},\n\t\t\t\"runner_name\":             \"rn\",\n\t\t\t\"secrets_passed\":          []any{\"s\"},\n\t\t\t\"source_version\":          \"sv\",\n\t\t\t\"started_at\":              \"2006-01-02T15:04:05Z\",\n\t\t\t\"target_login\":            \"tl\",\n\t\t\t\"target_version\":          \"tv\",\n\t\t\t\"team\":                    \"t\",\n\t\t\t\"topic\":                   \"cp1-iad.ingest.github.actions.v0.WorkflowUpdate\",\n\t\t\t\"transport_protocol\":      1,\n\t\t\t\"transport_protocol_name\": \"tpn\",\n\t\t\t\"trigger_id\":              1,\n\t\t\t\"user_agent\":              \"ua\",\n\t\t\t\"visibility\":              \"v\",\n\t\t\t\"workflow_id\":             1,\n\t\t\t\"workflow_run_id\":         1,\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"active\": false,\n\t\t\"active_was\": false,\n\t\t\"actor\": \"ac\",\n\t\t\"actor_ip\": \"aip\",\n\t\t\"actor_location\": {\n\t\t\t\"country_code\": \"alcc\"\n\t\t},\n\t\t\"blocked_user\": \"bu\",\n\t\t\"business\": \"b\",\n\t\t\"cancelled_at\": \"2021-03-07T00:35:08.000Z\",\n\t\t\"completed_at\": \"2021-03-07T00:35:08.000Z\",\n\t\t\"conclusion\": \"c\",\n\t\t\"config\": {\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"config_was\": {\n\t\t\t\"url\": \"s\"\n\t\t},\n\t\t\"content_type\": \"ct\",\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"deploy_key_fingerprint\": \"dkf\",\n\t\t\"_document_id\": \"did\",\n\t\t\"emoji\": \"e\",\n\t\t\"environment_name\": \"en\",\n\t\t\"event\": \"e\",\n\t\t\"events\": [\n\t\t\t\"s\"\n\t\t],\n\t\t\"events_were\": [\n\t\t\t\"s\"\n\t\t],\n\t\t\"explanation\": \"e\",\n\t\t\"external_identity_nameid\": \"ein\",\n\t\t\"external_identity_username\": \"eiu\",\n\t\t\"fingerprint\": \"f\",\n\t\t\"hashed_token\": \"ht\",\n\t\t\"head_branch\": \"hb\",\n\t\t\"head_sha\": \"hsha\",\n\t\t\"hook_id\": 1,\n\t\t\"is_hosted_runner\": false,\n\t\t\"job_name\": \"jn\",\n\t\t\"limited_availability\": false,\n\t\t\"message\": \"m\",\n\t\t\"name\": \"n\",\n\t\t\"old_permission\": \"op\",\n\t\t\"old_user\": \"ou\",\n\t\t\"openssh_public_key\": \"osshpk\",\n\t\t\"org\": \"o\",\n\t\t\"org_id\": 1,\n\t\t\"permission\": \"p\",\n\t\t\"previous_visibility\": \"pv\",\n\t\t\"programmatic_access_type\": \"pat\",\n\t\t\"pull_request_id\": 1,\n\t\t\"pull_request_title\": \"prt\",\n\t\t\"pull_request_url\": \"pru\",\n\t\t\"reasons\": [{\n\t\t\t\"code\": \"c\",\n\t\t\t\"message\": \"m\"\n\t\t}],\n\t\t\"referrer\": \"a referrer\",\n\t\t\"read_only\": \"ro\",\n\t\t\"repo\": \"r\",\n\t\t\"repository\": \"repo\",\n\t\t\"repository_public\": false,\n\t\t\"run_attempt\": 1,\n\t\t\"runner_group_id\": 1,\n\t\t\"runner_group_name\": \"rgn\",\n\t\t\"runner_id\": 1,\n\t\t\"runner_labels\": [\n\t\t\t\"s\"\n\t\t],\n\t\t\"runner_name\": \"rn\",\n\t\t\"secrets_passed\": [\n\t\t\t\"s\"\n\t\t],\n\t\t\"source_version\": \"sv\",\n\t\t\"started_at\": ` + referenceTimeStr + `,\n\t\t\"target_login\": \"tl\",\n\t\t\"target_version\": \"tv\",\n\t\t\"team\": \"t\",\n\t\t\"@timestamp\": ` + referenceTimeStr + `,\n\t\t\"token_id\": 1,\n\t\t\"token_scopes\": \"ts\",\n\t\t\"topic\": \"cp1-iad.ingest.github.actions.v0.WorkflowUpdate\",\n\t\t\"transport_protocol_name\": \"tpn\",\n\t\t\"transport_protocol\": 1,\n\t\t\"trigger_id\": 1,\n\t\t\"user\": \"u\",\n\t\t\"user_agent\": \"ua\",\n\t\t\"visibility\": \"v\",\n\t\t\"workflow_id\": 1,\n\t\t\"workflow_run_id\": 1,\n\t\t\"data\": {\n\t\t\t\"old_name\": \"on\",\n\t\t\t\"old_login\": \"ol\"\n\t\t}\n\t}`\n\n\ttestJSONMarshalOnly(t, u, want)\n\t// can't unmarshal AdditionalFields back into map[string]any, so skip testJSONUnmarshalOnly\n}\n"
  },
  {
    "path": "github/orgs_codesecurity_configurations.go",
    "content": "// Copyright 2024 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/http\"\n)\n\n// DependencyGraphAutosubmitActionOptions represents the options for the DependencyGraphAutosubmitAction.\ntype DependencyGraphAutosubmitActionOptions struct {\n\tLabeledRunners *bool `json:\"labeled_runners,omitempty\"`\n}\n\n// CodeScanningOptions represents the options for the Security Configuration code scanning feature.\ntype CodeScanningOptions struct {\n\tAllowAdvanced *bool `json:\"allow_advanced,omitempty\"`\n}\n\n// CodeScanningDefaultSetupOptions represents the feature options for the code scanning default options.\ntype CodeScanningDefaultSetupOptions struct {\n\tRunnerType  string  `json:\"runner_type\"`\n\tRunnerLabel *string `json:\"runner_label,omitempty\"`\n}\n\n// RepositoryAttachment represents a repository attachment to a code security configuration.\ntype RepositoryAttachment struct {\n\tStatus     *string     `json:\"status\"`\n\tRepository *Repository `json:\"repository\"`\n}\n\n// SecretScanningDelegatedBypassOptions represents the feature options for the secret scanning delegated bypass.\ntype SecretScanningDelegatedBypassOptions struct {\n\tReviewers []*BypassReviewer `json:\"reviewers,omitzero\"`\n}\n\n// BypassReviewer represents the bypass reviewers for the delegated bypass of a code security configuration.\n// SecurityConfigurationID is added by GitHub in responses.\ntype BypassReviewer struct {\n\tReviewerID              int64  `json:\"reviewer_id\"`\n\tReviewerType            string `json:\"reviewer_type\"`\n\tSecurityConfigurationID *int64 `json:\"security_configuration_id,omitempty\"`\n}\n\n// CodeSecurityConfiguration represents a code security configuration.\ntype CodeSecurityConfiguration struct {\n\tID                                     *int64                                  `json:\"id,omitempty\"`\n\tTargetType                             *string                                 `json:\"target_type,omitempty\"`\n\tName                                   string                                  `json:\"name\"`\n\tDescription                            string                                  `json:\"description\"`\n\tAdvancedSecurity                       *string                                 `json:\"advanced_security,omitempty\"`\n\tDependencyGraph                        *string                                 `json:\"dependency_graph,omitempty\"`\n\tDependencyGraphAutosubmitAction        *string                                 `json:\"dependency_graph_autosubmit_action,omitempty\"`\n\tDependencyGraphAutosubmitActionOptions *DependencyGraphAutosubmitActionOptions `json:\"dependency_graph_autosubmit_action_options,omitempty\"`\n\tDependabotAlerts                       *string                                 `json:\"dependabot_alerts,omitempty\"`\n\tDependabotSecurityUpdates              *string                                 `json:\"dependabot_security_updates,omitempty\"`\n\tCodeScanningDefaultSetup               *string                                 `json:\"code_scanning_default_setup,omitempty\"`\n\tCodeScanningDefaultSetupOptions        *CodeScanningDefaultSetupOptions        `json:\"code_scanning_default_setup_options,omitempty\"`\n\tCodeScanningDelegatedAlertDismissal    *string                                 `json:\"code_scanning_delegated_alert_dismissal,omitempty\"`\n\tCodeScanningOptions                    *CodeScanningOptions                    `json:\"code_scanning_options,omitempty\"`\n\tCodeSecurity                           *string                                 `json:\"code_security,omitempty\"`\n\tSecretScanning                         *string                                 `json:\"secret_scanning,omitempty\"`\n\tSecretScanningPushProtection           *string                                 `json:\"secret_scanning_push_protection,omitempty\"`\n\tSecretScanningDelegatedBypass          *string                                 `json:\"secret_scanning_delegated_bypass,omitempty\"`\n\tSecretScanningDelegatedBypassOptions   *SecretScanningDelegatedBypassOptions   `json:\"secret_scanning_delegated_bypass_options,omitempty\"`\n\tSecretScanningValidityChecks           *string                                 `json:\"secret_scanning_validity_checks,omitempty\"`\n\tSecretScanningNonProviderPatterns      *string                                 `json:\"secret_scanning_non_provider_patterns,omitempty\"`\n\tSecretScanningGenericSecrets           *string                                 `json:\"secret_scanning_generic_secrets,omitempty\"`\n\tSecretScanningDelegatedAlertDismissal  *string                                 `json:\"secret_scanning_delegated_alert_dismissal,omitempty\"`\n\tSecretProtection                       *string                                 `json:\"secret_protection,omitempty\"`\n\tPrivateVulnerabilityReporting          *string                                 `json:\"private_vulnerability_reporting,omitempty\"`\n\tEnforcement                            *string                                 `json:\"enforcement,omitempty\"`\n\tURL                                    *string                                 `json:\"url,omitempty\"`\n\tHTMLURL                                *string                                 `json:\"html_url,omitempty\"`\n\tCreatedAt                              *Timestamp                              `json:\"created_at,omitempty\"`\n\tUpdatedAt                              *Timestamp                              `json:\"updated_at,omitempty\"`\n}\n\n// CodeSecurityConfigurationWithDefaultForNewRepos represents a code security configuration with default for new repos param.\ntype CodeSecurityConfigurationWithDefaultForNewRepos struct {\n\tConfiguration      *CodeSecurityConfiguration `json:\"configuration\"`\n\tDefaultForNewRepos *string                    `json:\"default_for_new_repos,omitempty\"`\n}\n\n// RepositoryCodeSecurityConfiguration represents a code security configuration for a repository.\ntype RepositoryCodeSecurityConfiguration struct {\n\tState         *string                    `json:\"state,omitempty\"`\n\tConfiguration *CodeSecurityConfiguration `json:\"configuration,omitempty\"`\n}\n\n// ListOrgCodeSecurityConfigurationOptions specifies optional parameters to get security configurations for orgs.\n//\n// Note: Pagination is powered by before/after cursor-style pagination. After the initial call,\n// inspect the returned *Response. Use resp.After as the opts.After value to request\n// the next page, and resp.Before as the opts.Before value to request the previous\n// page. Set either Before or After for a request; if both are\n// supplied GitHub API will return an error. PerPage controls the number of items\n// per page (max 100 per GitHub API docs).\ntype ListOrgCodeSecurityConfigurationOptions struct {\n\t// A cursor, as given in the Link header. If specified, the query only searches for security configurations before this cursor.\n\tBefore string `url:\"before,omitempty\"`\n\n\t// A cursor, as given in the Link header. If specified, the query only searches for security configurations after this cursor.\n\tAfter string `url:\"after,omitempty\"`\n\n\t// For paginated result sets, the number of results to include per page.\n\tPerPage int `url:\"per_page,omitempty\"`\n\n\t// The target type of the code security configurations to get.\n\t//\n\t// `target_type` defaults to all, can be one of `global`, `all`\n\tTargetType string `url:\"target_type,omitempty\"`\n}\n\n// ListCodeSecurityConfigurationRepositoriesOptions specifies optional parameters to list repositories for security configurations for orgs and enterprises.\n//\n// Note: Pagination is powered by before/after cursor-style pagination. After the initial call,\n// inspect the returned *Response. Use resp.After as the opts.After value to request\n// the next page, and resp.Before as the opts.Before value to request the previous\n// page. Set either Before or After for a request; if both are\n// supplied GitHub API will return an error. PerPage controls the number of items\n// per page (max 100 per GitHub API docs).\ntype ListCodeSecurityConfigurationRepositoriesOptions struct {\n\t// A cursor, as given in the Link header. If specified, the query only searches for repositories before this cursor.\n\tBefore string `url:\"before,omitempty\"`\n\n\t// A cursor, as given in the Link header. If specified, the query only searches for repositories after this cursor.\n\tAfter string `url:\"after,omitempty\"`\n\n\t// For paginated result sets, the number of results to include per page.\n\tPerPage int `url:\"per_page,omitempty\"`\n\n\t// A comma-separated list of statuses. If specified, only repositories with these attachment statuses will be returned.\n\t//\n\t// `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.\n\tStatus string `url:\"status,omitempty\"`\n}\n\n// ListCodeSecurityConfigurations gets code security configurations for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-code-security-configurations-for-an-organization\n//\n//meta:operation GET /orgs/{org}/code-security/configurations\nfunc (s *OrganizationsService) ListCodeSecurityConfigurations(ctx context.Context, org string, opts *ListOrgCodeSecurityConfigurationOptions) ([]*CodeSecurityConfiguration, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/code-security/configurations\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar configurations []*CodeSecurityConfiguration\n\tresp, err := s.client.Do(ctx, req, &configurations)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn configurations, resp, nil\n}\n\n// CreateCodeSecurityConfiguration creates a code security configuration for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/code-security/configurations#create-a-code-security-configuration\n//\n//meta:operation POST /orgs/{org}/code-security/configurations\nfunc (s *OrganizationsService) CreateCodeSecurityConfiguration(ctx context.Context, org string, config CodeSecurityConfiguration) (*CodeSecurityConfiguration, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/code-security/configurations\", org)\n\n\treq, err := s.client.NewRequest(\"POST\", u, config)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar configuration *CodeSecurityConfiguration\n\tresp, err := s.client.Do(ctx, req, &configuration)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn configuration, resp, nil\n}\n\n// ListDefaultCodeSecurityConfigurations gets default code security configurations for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-default-code-security-configurations\n//\n//meta:operation GET /orgs/{org}/code-security/configurations/defaults\nfunc (s *OrganizationsService) ListDefaultCodeSecurityConfigurations(ctx context.Context, org string) ([]*CodeSecurityConfigurationWithDefaultForNewRepos, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/code-security/configurations/defaults\", org)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar configurations []*CodeSecurityConfigurationWithDefaultForNewRepos\n\tresp, err := s.client.Do(ctx, req, &configurations)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn configurations, resp, nil\n}\n\n// DetachCodeSecurityConfigurationsFromRepositories detaches code security configuration from an organization's repositories.\n//\n// GitHub API docs: https://docs.github.com/rest/code-security/configurations#detach-configurations-from-repositories\n//\n//meta:operation DELETE /orgs/{org}/code-security/configurations/detach\nfunc (s *OrganizationsService) DetachCodeSecurityConfigurationsFromRepositories(ctx context.Context, org string, repoIDs []int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/code-security/configurations/detach\", org)\n\ttype selectedRepoIDs struct {\n\t\tSelectedIDs []int64 `json:\"selected_repository_ids\"`\n\t}\n\treq, err := s.client.NewRequest(\"DELETE\", u, selectedRepoIDs{SelectedIDs: repoIDs})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\treturn resp, nil\n}\n\n// GetCodeSecurityConfiguration gets a code security configuration available in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-a-code-security-configuration\n//\n//meta:operation GET /orgs/{org}/code-security/configurations/{configuration_id}\nfunc (s *OrganizationsService) GetCodeSecurityConfiguration(ctx context.Context, org string, configurationID int64) (*CodeSecurityConfiguration, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/code-security/configurations/%v\", org, configurationID)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar configuration *CodeSecurityConfiguration\n\tresp, err := s.client.Do(ctx, req, &configuration)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn configuration, resp, nil\n}\n\n// UpdateCodeSecurityConfiguration updates a code security configuration for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/code-security/configurations#update-a-code-security-configuration\n//\n//meta:operation PATCH /orgs/{org}/code-security/configurations/{configuration_id}\nfunc (s *OrganizationsService) UpdateCodeSecurityConfiguration(ctx context.Context, org string, configurationID int64, config CodeSecurityConfiguration) (*CodeSecurityConfiguration, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/code-security/configurations/%v\", org, configurationID)\n\n\treq, err := s.client.NewRequest(\"PATCH\", u, config)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar configuration *CodeSecurityConfiguration\n\tresp, err := s.client.Do(ctx, req, &configuration)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn configuration, resp, nil\n}\n\n// DeleteCodeSecurityConfiguration deletes a code security configuration for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/code-security/configurations#delete-a-code-security-configuration\n//\n//meta:operation DELETE /orgs/{org}/code-security/configurations/{configuration_id}\nfunc (s *OrganizationsService) DeleteCodeSecurityConfiguration(ctx context.Context, org string, configurationID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/code-security/configurations/%v\", org, configurationID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\treturn resp, nil\n}\n\n// AttachCodeSecurityConfigurationToRepositories attaches code security configurations to repositories for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/code-security/configurations#attach-a-configuration-to-repositories\n//\n//meta:operation POST /orgs/{org}/code-security/configurations/{configuration_id}/attach\nfunc (s *OrganizationsService) AttachCodeSecurityConfigurationToRepositories(ctx context.Context, org string, configurationID int64, scope string, repoIDs []int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/code-security/configurations/%v/attach\", org, configurationID)\n\ttype selectedRepoIDs struct {\n\t\tScope       string  `json:\"scope\"`\n\t\tSelectedIDs []int64 `json:\"selected_repository_ids,omitempty\"`\n\t}\n\treq, err := s.client.NewRequest(\"POST\", u, selectedRepoIDs{Scope: scope, SelectedIDs: repoIDs})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil && resp.StatusCode != http.StatusAccepted { // StatusAccepted(202) is the expected status code as job is queued for processing\n\t\treturn resp, err\n\t}\n\treturn resp, nil\n}\n\n// SetDefaultCodeSecurityConfiguration sets a code security configuration as the default for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization\n//\n//meta:operation PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults\nfunc (s *OrganizationsService) SetDefaultCodeSecurityConfiguration(ctx context.Context, org string, configurationID int64, newReposParam string) (*CodeSecurityConfigurationWithDefaultForNewRepos, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/code-security/configurations/%v/defaults\", org, configurationID)\n\ttype configParam struct {\n\t\tDefaultForNewRepos string `json:\"default_for_new_repos\"`\n\t}\n\treq, err := s.client.NewRequest(\"PUT\", u, configParam{DefaultForNewRepos: newReposParam})\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tvar config *CodeSecurityConfigurationWithDefaultForNewRepos\n\tresp, err := s.client.Do(ctx, req, &config)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn config, resp, nil\n}\n\n// ListCodeSecurityConfigurationRepositories gets repositories associated with a code security configuration.\n//\n// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-repositories-associated-with-a-code-security-configuration\n//\n//meta:operation GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories\nfunc (s *OrganizationsService) ListCodeSecurityConfigurationRepositories(ctx context.Context, org string, configurationID int64, opts *ListCodeSecurityConfigurationRepositoriesOptions) ([]*RepositoryAttachment, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/code-security/configurations/%v/repositories\", org, configurationID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar attachments []*RepositoryAttachment\n\tresp, err := s.client.Do(ctx, req, &attachments)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn attachments, resp, nil\n}\n\n// GetCodeSecurityConfigurationForRepository gets code security configuration that manages a repository's code security settings.\n//\n// GitHub API docs: https://docs.github.com/rest/code-security/configurations#get-the-code-security-configuration-associated-with-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/code-security-configuration\nfunc (s *OrganizationsService) GetCodeSecurityConfigurationForRepository(ctx context.Context, org, repo string) (*RepositoryCodeSecurityConfiguration, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/code-security-configuration\", org, repo)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tvar repoConfig *RepositoryCodeSecurityConfiguration\n\tresp, err := s.client.Do(ctx, req, &repoConfig)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn repoConfig, resp, nil\n}\n"
  },
  {
    "path": "github/orgs_codesecurity_configurations_test.go",
    "content": "// Copyright 2024 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestOrganizationsService_ListCodeSecurityConfigurations(t *testing.T) {\n\tt.Parallel()\n\topts := &ListOrgCodeSecurityConfigurationOptions{Before: \"1\", After: \"2\", PerPage: 30, TargetType: \"all\"}\n\tctx := t.Context()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/code-security/configurations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"before\": \"1\", \"after\": \"2\", \"per_page\": \"30\", \"target_type\": \"all\"})\n\t\tfmt.Fprint(w, `[\n\t\t{\n\t\t\t\"id\":1,\n\t\t\t\"name\":\"config1\",\n\t\t\t\"description\":\"desc1\",\n\t\t\t\"code_scanning_default_setup\": \"enabled\"\n\t\t},\n\t\t{\n\t\t\t\"id\":2,\n\t\t\t\"name\":\"config2\",\n\t\t\t\"description\":\"desc2\",\n\t\t\t\"private_vulnerability_reporting\": \"enabled\"\n\t\t}]`)\n\t})\n\n\tconfigurations, _, err := client.Organizations.ListCodeSecurityConfigurations(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListCodeSecurityConfigurations returned error: %v\", err)\n\t}\n\n\twant := []*CodeSecurityConfiguration{\n\t\t{ID: Ptr(int64(1)), Name: \"config1\", Description: \"desc1\", CodeScanningDefaultSetup: Ptr(\"enabled\")},\n\t\t{ID: Ptr(int64(2)), Name: \"config2\", Description: \"desc2\", PrivateVulnerabilityReporting: Ptr(\"enabled\")},\n\t}\n\tif !cmp.Equal(configurations, want) {\n\t\tt.Errorf(\"Organizations.ListCodeSecurityConfigurations returned %+v, want %+v\", configurations, want)\n\t}\n\tconst methodName = \"ListCodeSecurityConfigurations\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListCodeSecurityConfigurations(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListCodeSecurityConfigurations(ctx, \"o\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_GetCodeSecurityConfiguration(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tctx := t.Context()\n\n\tmux.HandleFunc(\"/orgs/o/code-security/configurations/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\":1,\n\t\t\t\"name\":\"config1\",\n\t\t\t\"description\":\"desc1\",\n\t\t\t\"code_scanning_default_setup\": \"enabled\"\n\t\t}`)\n\t})\n\n\tconfiguration, _, err := client.Organizations.GetCodeSecurityConfiguration(ctx, \"o\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.GetCodeSecurityConfiguration returned error: %v\", err)\n\t}\n\n\twant := &CodeSecurityConfiguration{ID: Ptr(int64(1)), Name: \"config1\", Description: \"desc1\", CodeScanningDefaultSetup: Ptr(\"enabled\")}\n\tif !cmp.Equal(configuration, want) {\n\t\tt.Errorf(\"Organizations.GetCodeSecurityConfiguration returned %+v, want %+v\", configuration, want)\n\t}\n\n\tconst methodName = \"GetCodeSecurityConfiguration\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.GetCodeSecurityConfiguration(ctx, \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.GetCodeSecurityConfiguration(ctx, \"o\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_CreateCodeSecurityConfiguration(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tctx := t.Context()\n\n\tinput := CodeSecurityConfiguration{\n\t\tName:                     \"config1\",\n\t\tDescription:              \"desc1\",\n\t\tCodeScanningDefaultSetup: Ptr(\"enabled\"),\n\t}\n\n\tmux.HandleFunc(\"/orgs/o/code-security/configurations\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v CodeSecurityConfiguration\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Organizations.CreateCodeSecurityConfiguration request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\":1,\n\t\t\t\"name\":\"config1\",\n\t\t\t\"description\":\"desc1\",\n\t\t\t\"code_scanning_default_setup\": \"enabled\"\n\t\t}`)\n\t})\n\n\tconfiguration, _, err := client.Organizations.CreateCodeSecurityConfiguration(ctx, \"o\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.CreateCodeSecurityConfiguration returned error: %v\", err)\n\t}\n\n\twant := &CodeSecurityConfiguration{ID: Ptr(int64(1)), Name: \"config1\", Description: \"desc1\", CodeScanningDefaultSetup: Ptr(\"enabled\")}\n\tif !cmp.Equal(configuration, want) {\n\t\tt.Errorf(\"Organizations.CreateCodeSecurityConfiguration returned %+v, want %+v\", configuration, want)\n\t}\n\n\tconst methodName = \"CreateCodeSecurityConfiguration\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.CreateCodeSecurityConfiguration(ctx, \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.CreateCodeSecurityConfiguration(ctx, \"o\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_CreateCodeSecurityConfigurationWithDelegatedBypass(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tctx := t.Context()\n\n\tinput := CodeSecurityConfiguration{\n\t\tName:                          \"config1\",\n\t\tDescription:                   \"desc1\",\n\t\tSecretProtection:              Ptr(\"enabled\"), // required to configure bypass\n\t\tSecretScanning:                Ptr(\"enabled\"), // required to configure bypass\n\t\tSecretScanningPushProtection:  Ptr(\"enabled\"), // required to configure bypass\n\t\tSecretScanningDelegatedBypass: Ptr(\"enabled\"),\n\t\tSecretScanningDelegatedBypassOptions: &SecretScanningDelegatedBypassOptions{\n\t\t\tReviewers: []*BypassReviewer{\n\t\t\t\t{\n\t\t\t\t\tReviewerType: \"TEAM\",\n\t\t\t\t\tReviewerID:   456,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tReviewerType: \"ROLE\",\n\t\t\t\t\tReviewerID:   789,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tmux.HandleFunc(\"/orgs/o/code-security/configurations\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v CodeSecurityConfiguration\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Organizations.CreateCodeSecurityConfiguration with Bypass request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\":123,\n\t\t\t\"name\":\"config1\",\n\t\t\t\"description\":\"desc1\",\n\t\t\t\"secret_protection\": \"enabled\",\n\t\t\t\"secret_scanning\": \"enabled\",\n\t\t\t\"secret_scanning_push_protection\": \"enabled\",\n\t\t\t\"secret_scanning_delegated_bypass\": \"enabled\",\n\t\t\t\"secret_scanning_delegated_bypass_options\": {\n\t\t\t\t\"reviewers\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"security_configuration_id\": 123,\n\t\t\t\t\t\t\"reviewer_type\": \"TEAM\",\t\n\t\t\t\t\t\t\"reviewer_id\": 456\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"security_configuration_id\": 123,\n\t\t\t\t\t\t\"reviewer_type\": \"ROLE\",\t\n\t\t\t\t\t\t\"reviewer_id\": 789\n\t\t\t\t\t}\n\t\t\t\t]\t\t\t\n\t\t\t}\n\t\t}`)\n\t})\n\n\tconfiguration, _, err := client.Organizations.CreateCodeSecurityConfiguration(ctx, \"o\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.CreateCodeSecurityConfiguration with Bypass returned error: %v\", err)\n\t}\n\n\twant := &CodeSecurityConfiguration{\n\t\tID:                            Ptr(int64(123)),\n\t\tName:                          \"config1\",\n\t\tDescription:                   \"desc1\",\n\t\tSecretProtection:              Ptr(\"enabled\"),\n\t\tSecretScanning:                Ptr(\"enabled\"),\n\t\tSecretScanningPushProtection:  Ptr(\"enabled\"),\n\t\tSecretScanningDelegatedBypass: Ptr(\"enabled\"),\n\t\tSecretScanningDelegatedBypassOptions: &SecretScanningDelegatedBypassOptions{\n\t\t\tReviewers: []*BypassReviewer{\n\t\t\t\t{\n\t\t\t\t\tSecurityConfigurationID: Ptr(int64(123)),\n\t\t\t\t\tReviewerType:            \"TEAM\",\n\t\t\t\t\tReviewerID:              456,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tSecurityConfigurationID: Ptr(int64(123)),\n\t\t\t\t\tReviewerType:            \"ROLE\",\n\t\t\t\t\tReviewerID:              789,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(configuration, want) {\n\t\tt.Errorf(\"Organizations.CreateCodeSecurityConfiguration with Bypass returned %+v, want %+v\", configuration, want)\n\t}\n\n\tconst methodName = \"CreateCodeSecurityConfiguration\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.CreateCodeSecurityConfiguration(ctx, \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.CreateCodeSecurityConfiguration(ctx, \"o\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_ListDefaultCodeSecurityConfigurations(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tctx := t.Context()\n\n\tmux.HandleFunc(\"/orgs/o/code-security/configurations/defaults\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[\n\t\t{\n\t\t\t\"default_for_new_repos\": \"public\",\n\t\t\t\"configuration\": {\n\t\t\t\t\"id\":1,\n\t\t\t\t\"name\":\"config1\",\n\t\t\t\t\"description\":\"desc1\",\n\t\t\t\t\"code_scanning_default_setup\": \"enabled\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"default_for_new_repos\": \"private_and_internal\",\n\t\t\t\"configuration\": {\n\t\t\t\t\"id\":2,\n\t\t\t\t\"name\":\"config2\",\n\t\t\t\t\"description\":\"desc2\",\n\t\t\t\t\"private_vulnerability_reporting\": \"enabled\"\n\t\t\t}\n\t\t}\n\t]`)\n\t})\n\n\tconfigurations, _, err := client.Organizations.ListDefaultCodeSecurityConfigurations(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListDefaultCodeSecurityConfigurations returned error: %v\", err)\n\t}\n\n\twant := []*CodeSecurityConfigurationWithDefaultForNewRepos{\n\t\t{DefaultForNewRepos: Ptr(\"public\"), Configuration: &CodeSecurityConfiguration{ID: Ptr(int64(1)), Name: \"config1\", Description: \"desc1\", CodeScanningDefaultSetup: Ptr(\"enabled\")}},\n\t\t{DefaultForNewRepos: Ptr(\"private_and_internal\"), Configuration: &CodeSecurityConfiguration{ID: Ptr(int64(2)), Name: \"config2\", Description: \"desc2\", PrivateVulnerabilityReporting: Ptr(\"enabled\")}},\n\t}\n\tif !cmp.Equal(configurations, want) {\n\t\tt.Errorf(\"Organizations.ListDefaultCodeSecurityConfigurations returned %+v, want %+v\", configurations, want)\n\t}\n\n\tconst methodName = \"ListDefaultCodeSecurityConfigurations\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListDefaultCodeSecurityConfigurations(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListDefaultCodeSecurityConfigurations(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_DetachCodeSecurityConfigurationsFromRepositories(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tctx := t.Context()\n\n\tmux.HandleFunc(\"/orgs/o/code-security/configurations/detach\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tresp, err := client.Organizations.DetachCodeSecurityConfigurationsFromRepositories(ctx, \"o\", []int64{1})\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.DetachCodeSecurityConfigurationsFromRepositories returned error: %v\", err)\n\t}\n\n\twant := http.StatusNoContent\n\tif resp.StatusCode != want {\n\t\tt.Errorf(\"Organizations.DetachCodeSecurityConfigurationsFromRepositories returned status %v, want %v\", resp.StatusCode, want)\n\t}\n\n\tconst methodName = \"DetachCodeSecurityConfigurationsFromRepositories\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Organizations.DetachCodeSecurityConfigurationsFromRepositories(ctx, \"\\n\", []int64{1})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tresp, err := client.Organizations.DetachCodeSecurityConfigurationsFromRepositories(ctx, \"o\", []int64{1})\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_UpdateCodeSecurityConfiguration(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\tclient, mux, _ := setup(t)\n\n\tinput := CodeSecurityConfiguration{\n\t\tName:                     \"config1\",\n\t\tDescription:              \"desc1\",\n\t\tCodeScanningDefaultSetup: Ptr(\"enabled\"),\n\t}\n\n\tmux.HandleFunc(\"/orgs/o/code-security/configurations/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v CodeSecurityConfiguration\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Organizations.UpdateCodeSecurityConfiguration request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\":1,\n\t\t\t\"name\":\"config1\",\n\t\t\t\"description\":\"desc1\",\n\t\t\t\"code_scanning_default_setup\": \"enabled\"\n\t\t}`)\n\t})\n\n\tconfiguration, _, err := client.Organizations.UpdateCodeSecurityConfiguration(ctx, \"o\", 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.UpdateCodeSecurityConfiguration returned error: %v\", err)\n\t}\n\n\twant := &CodeSecurityConfiguration{ID: Ptr(int64(1)), Name: \"config1\", Description: \"desc1\", CodeScanningDefaultSetup: Ptr(\"enabled\")}\n\tif !cmp.Equal(configuration, want) {\n\t\tt.Errorf(\"Organizations.UpdateCodeSecurityConfiguration returned %+v, want %+v\", configuration, want)\n\t}\n\n\tconst methodName = \"UpdateCodeSecurityConfiguration\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.UpdateCodeSecurityConfiguration(ctx, \"\\n\", -1, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.UpdateCodeSecurityConfiguration(ctx, \"o\", 1, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_DeleteCodeSecurityConfiguration(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/code-security/configurations/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tresp, err := client.Organizations.DeleteCodeSecurityConfiguration(ctx, \"o\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.DeleteCodeSecurityConfiguration returned error: %v\", err)\n\t}\n\n\twant := http.StatusNoContent\n\tif resp.StatusCode != want {\n\t\tt.Errorf(\"Organizations.DeleteCodeSecurityConfiguration returned status %v, want %v\", resp.StatusCode, want)\n\t}\n\n\tconst methodName = \"DeleteCodeSecurityConfiguration\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Organizations.DeleteCodeSecurityConfiguration(ctx, \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tresp, err := client.Organizations.DeleteCodeSecurityConfiguration(ctx, \"o\", 1)\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_AttachCodeSecurityConfigurationToRepositories(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/code-security/configurations/1/attach\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttype request struct {\n\t\t\tScope                 string  `json:\"scope\"`\n\t\t\tSelectedRepositoryIDs []int64 `json:\"selected_repository_ids,omitempty\"`\n\t\t}\n\t\tvar v *request\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\t\tif v.Scope != \"selected\" {\n\t\t\tt.Errorf(\"Organizations.AttachCodeSecurityConfigurationToRepositories request body scope = %v, want selected\", v.Scope)\n\t\t}\n\t\tif !cmp.Equal(v.SelectedRepositoryIDs, []int64{5, 20}) {\n\t\t\tt.Errorf(\"Organizations.AttachCodeSecurityConfigurationToRepositories request body selected_repository_ids = %+v, want %+v\", v.SelectedRepositoryIDs, []int64{5, 20})\n\t\t}\n\t\tw.WriteHeader(http.StatusAccepted)\n\t})\n\n\tresp, err := client.Organizations.AttachCodeSecurityConfigurationToRepositories(ctx, \"o\", int64(1), \"selected\", []int64{5, 20})\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.AttachCodeSecurityConfigurationToRepositories returned error: %v\", err)\n\t}\n\n\twant := http.StatusAccepted\n\tif resp.StatusCode != want {\n\t\tt.Errorf(\"Organizations.AttachCodeSecurityConfigurationToRepositories returned status %v, want %v\", resp.StatusCode, want)\n\t}\n\n\tconst methodName = \"AttachCodeSecurityConfigurationToRepositories\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Organizations.AttachCodeSecurityConfigurationToRepositories(ctx, \"\\n\", -1, \"\", nil)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tresp, err := client.Organizations.AttachCodeSecurityConfigurationToRepositories(ctx, \"o\", 1, \"selected\", []int64{5, 20})\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_SetDefaultCodeSecurityConfiguration(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/code-security/configurations/1/defaults\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tfmt.Fprint(w, `\n\t\t{\n\t\t\t\"default_for_new_repos\": \"all\",\n\t\t\t\"configuration\":\n\t\t\t\t{\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"name\": \"config1\",\n\t\t\t\t\t\"description\": \"desc1\",\n\t\t\t\t\t\"code_scanning_default_setup\": \"enabled\"\n\t\t\t\t}\n\t\t}`)\n\t})\n\tgot, resp, err := client.Organizations.SetDefaultCodeSecurityConfiguration(ctx, \"o\", 1, \"all\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.SetDefaultCodeSecurityConfiguration returned error: %v\", err)\n\t}\n\twantStatus := http.StatusOK\n\tif resp.StatusCode != wantStatus {\n\t\tt.Errorf(\"Organizations.SetDefaultCodeSecurityConfiguration returned status %v, want %v\", resp.StatusCode, wantStatus)\n\t}\n\twant := &CodeSecurityConfigurationWithDefaultForNewRepos{\n\t\tDefaultForNewRepos: Ptr(\"all\"),\n\t\tConfiguration: &CodeSecurityConfiguration{\n\t\t\tID: Ptr(int64(1)), Name: \"config1\", Description: \"desc1\", CodeScanningDefaultSetup: Ptr(\"enabled\"),\n\t\t},\n\t}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Organizations.SetDefaultCodeSecurityConfiguration returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"SetDefaultCodeSecurityConfiguration\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.SetDefaultCodeSecurityConfiguration(ctx, \"\\n\", -1, \"\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.SetDefaultCodeSecurityConfiguration(ctx, \"o\", 1, \"all\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_ListCodeSecurityConfigurationRepositories(t *testing.T) {\n\tt.Parallel()\n\topts := &ListCodeSecurityConfigurationRepositoriesOptions{Before: \"1\", After: \"2\", PerPage: 30, Status: \"attached\"}\n\tctx := t.Context()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/code-security/configurations/1/repositories\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"before\": \"1\", \"after\": \"2\", \"per_page\": \"30\", \"status\": \"attached\"})\n\t\tfmt.Fprint(w, `[\n\t\t{\n\t\t\t\"status\": \"attached\",\n\t\t\t\"repository\": {\n\t\t\t\t\"id\":8,\n\t\t\t\t\"name\":\"repo8\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"status\": \"attached\",\n\t\t\t\"repository\": {\n\t\t\t\t\"id\":42,\n\t\t\t\t\"name\":\"repo42\"\n\t\t\t}\n\t\t}\n\t]`)\n\t})\n\n\tattachments, _, err := client.Organizations.ListCodeSecurityConfigurationRepositories(ctx, \"o\", 1, opts)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListCodeSecurityConfigurationRepositories returned error: %v\", err)\n\t}\n\twant := []*RepositoryAttachment{\n\t\t{Status: Ptr(\"attached\"), Repository: &Repository{ID: Ptr(int64(8)), Name: Ptr(\"repo8\")}},\n\t\t{Status: Ptr(\"attached\"), Repository: &Repository{ID: Ptr(int64(42)), Name: Ptr(\"repo42\")}},\n\t}\n\tif !cmp.Equal(attachments, want) {\n\t\tt.Errorf(\"Organizations.ListCodeSecurityConfigurationRepositories returned %+v, want %+v\", attachments, want)\n\t}\n\n\tconst methodName = \"ListCodeSecurityConfigurationRepositories\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListCodeSecurityConfigurationRepositories(ctx, \"\\n\", -1, opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListCodeSecurityConfigurationRepositories(ctx, \"o\", 1, opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_GetCodeSecurityConfigurationForRepository(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/repo8/code-security-configuration\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t    \"state\": \"attached\",\n\t\t\t\"configuration\": {\n\t\t\t\t\"id\":42,\n\t\t\t\t\"name\":\"config42\",\n\t\t\t\t\"description\":\"desc1\",\n\t\t\t\t\"code_scanning_default_setup\": \"enabled\"\n\t\t\t}\n\t\t}`)\n\t})\n\n\trc, _, err := client.Organizations.GetCodeSecurityConfigurationForRepository(ctx, \"o\", \"repo8\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.GetCodeSecurityConfigurationForRepository returned error: %v\", err)\n\t}\n\tc := &CodeSecurityConfiguration{ID: Ptr(int64(42)), Name: \"config42\", Description: \"desc1\", CodeScanningDefaultSetup: Ptr(\"enabled\")}\n\twant := &RepositoryCodeSecurityConfiguration{\n\t\tState:         Ptr(\"attached\"),\n\t\tConfiguration: c,\n\t}\n\tif !cmp.Equal(rc, want) {\n\t\tt.Errorf(\"Organizations.GetCodeSecurityConfigurationForRepository returned %+v, want %+v\", rc, want)\n\t}\n\n\tconst methodName = \"GetCodeSecurityConfigurationForRepository\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.GetCodeSecurityConfigurationForRepository(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.GetCodeSecurityConfigurationForRepository(ctx, \"o\", \"repo8\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/orgs_credential_authorizations.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// CredentialAuthorization represents a credential authorized through SAML SSO.\ntype CredentialAuthorization struct {\n\t// User login that owns the underlying credential.\n\tLogin *string `json:\"login,omitempty\"`\n\n\t// Unique identifier for the credential.\n\tCredentialID *int64 `json:\"credential_id,omitempty\"`\n\n\t// Human-readable description of the credential type.\n\tCredentialType *string `json:\"credential_type,omitempty\"`\n\n\t// Last eight characters of the credential.\n\t// Only included in responses with credential_type of personal access token.\n\tTokenLastEight *string `json:\"token_last_eight,omitempty\"`\n\n\t// Date when the credential was authorized for use.\n\tCredentialAuthorizedAt *Timestamp `json:\"credential_authorized_at,omitempty\"`\n\n\t// Date when the credential was last accessed.\n\t// May be null if it was never accessed.\n\tCredentialAccessedAt *Timestamp `json:\"credential_accessed_at,omitempty\"`\n\n\t// List of oauth scopes the token has been granted.\n\tScopes []string `json:\"scopes,omitempty\"`\n\n\t// Unique string to distinguish the credential.\n\t// Only included in responses with credential_type of SSH Key.\n\tFingerprint *string `json:\"fingerprint,omitempty\"`\n\n\tAuthorizedCredentialID *int64 `json:\"authorized_credential_id,omitempty\"`\n\n\t// The title given to the ssh key.\n\t// This will only be present when the credential is an ssh key.\n\tAuthorizedCredentialTitle *string `json:\"authorized_credential_title,omitempty\"`\n\n\t// The note given to the token.\n\t// This will only be present when the credential is a token.\n\tAuthorizedCredentialNote *string `json:\"authorized_credential_note,omitempty\"`\n\n\t// The expiry for the token.\n\t// This will only be present when the credential is a token.\n\tAuthorizedCredentialExpiresAt *Timestamp `json:\"authorized_credential_expires_at,omitempty\"`\n}\n\n// CredentialAuthorizationsListOptions adds the Login option as supported by the\n// list SAML SSO authorizations for organizations endpoint alongside paging options\n// such as Page and PerPage.\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs#list-saml-sso-authorizations-for-an-organization\ntype CredentialAuthorizationsListOptions struct {\n\tListOptions\n\t// For credentials authorizations for an organization, limit the list of authorizations to a specific login (aka github username)\n\tLogin string `url:\"login,omitempty\"`\n}\n\n// ListCredentialAuthorizations lists credentials authorized through SAML SSO\n// for a given organization. Only available with GitHub Enterprise Cloud.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs#list-saml-sso-authorizations-for-an-organization\n//\n//meta:operation GET /orgs/{org}/credential-authorizations\nfunc (s *OrganizationsService) ListCredentialAuthorizations(ctx context.Context, org string, opts *CredentialAuthorizationsListOptions) ([]*CredentialAuthorization, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/credential-authorizations\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar creds []*CredentialAuthorization\n\tresp, err := s.client.Do(ctx, req, &creds)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn creds, resp, nil\n}\n\n// RemoveCredentialAuthorization revokes the SAML SSO authorization for a given\n// credential within an organization. Only available with GitHub Enterprise Cloud.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/orgs#remove-a-saml-sso-authorization-for-an-organization\n//\n//meta:operation DELETE /orgs/{org}/credential-authorizations/{credential_id}\nfunc (s *OrganizationsService) RemoveCredentialAuthorization(ctx context.Context, org string, credentialID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/credential-authorizations/%v\", org, credentialID)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/orgs_credential_authorizations_test.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestOrganizationsService_ListCredentialAuthorizations(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/credential-authorizations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\", \"login\": \"l\"})\n\t\tfmt.Fprint(w, `[\n\t\t\t{\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"credential_id\": 1,\n\t\t\t\t\"credential_type\": \"t\",\n\t\t\t\t\"credential_authorized_at\": \"2017-01-21T00:00:00Z\",\n\t\t\t\t\"credential_accessed_at\": \"2017-01-21T00:00:00Z\",\n\t\t\t\t\"authorized_credential_id\": 1\n\t\t\t}\n\t\t]`)\n\t})\n\n\topts := &CredentialAuthorizationsListOptions{\n\t\tListOptions: ListOptions{Page: 2, PerPage: 2},\n\t\tLogin:       \"l\",\n\t}\n\n\tctx := t.Context()\n\tcreds, _, err := client.Organizations.ListCredentialAuthorizations(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListCredentialAuthorizations returned error: %v\", err)\n\t}\n\n\tts := time.Date(2017, time.January, 21, 0, 0, 0, 0, time.UTC)\n\twant := []*CredentialAuthorization{\n\t\t{\n\t\t\tLogin:                  Ptr(\"l\"),\n\t\t\tCredentialID:           Ptr(int64(1)),\n\t\t\tCredentialType:         Ptr(\"t\"),\n\t\t\tCredentialAuthorizedAt: &Timestamp{ts},\n\t\t\tCredentialAccessedAt:   &Timestamp{ts},\n\t\t\tAuthorizedCredentialID: Ptr(int64(1)),\n\t\t},\n\t}\n\tif !cmp.Equal(creds, want) {\n\t\tt.Errorf(\"Organizations.ListCredentialAuthorizations returned %+v, want %+v\", creds, want)\n\t}\n\n\tconst methodName = \"ListCredentialAuthorizations\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListCredentialAuthorizations(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t_, resp, err := client.Organizations.ListCredentialAuthorizations(ctx, \"o\", opts)\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_RemoveCredentialAuthorization(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/credential-authorizations/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Organizations.RemoveCredentialAuthorization(ctx, \"o\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.RemoveCredentialAuthorization returned error: %v\", err)\n\t}\n\n\tif resp.StatusCode != http.StatusNoContent {\n\t\tt.Errorf(\"Organizations.RemoveCredentialAuthorization returned %v, want %v\", resp.StatusCode, http.StatusNoContent)\n\t}\n\n\tconst methodName = \"RemoveCredentialAuthorization\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Organizations.RemoveCredentialAuthorization(ctx, \"\\n\", 0)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.RemoveCredentialAuthorization(ctx, \"o\", 1)\n\t})\n}\n"
  },
  {
    "path": "github/orgs_custom_repository_roles.go",
    "content": "// Copyright 2024 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// OrganizationCustomRepoRoles represents custom repository roles available in specified organization.\ntype OrganizationCustomRepoRoles struct {\n\tTotalCount      *int               `json:\"total_count,omitempty\"`\n\tCustomRepoRoles []*CustomRepoRoles `json:\"custom_roles,omitempty\"`\n}\n\n// CustomRepoRoles represents custom repository roles for an organization.\n// See https://docs.github.com/enterprise-cloud@latest/organizations/managing-peoples-access-to-your-organization-with-roles/managing-custom-repository-roles-for-an-organization\n// for more information.\ntype CustomRepoRoles struct {\n\tID          *int64        `json:\"id,omitempty\"`\n\tName        *string       `json:\"name,omitempty\"`\n\tDescription *string       `json:\"description,omitempty\"`\n\tBaseRole    *string       `json:\"base_role,omitempty\"`\n\tPermissions []string      `json:\"permissions,omitempty\"`\n\tOrg         *Organization `json:\"organization,omitempty\"`\n\tCreatedAt   *Timestamp    `json:\"created_at,omitempty\"`\n\tUpdatedAt   *Timestamp    `json:\"updated_at,omitempty\"`\n}\n\n// CreateOrUpdateCustomRepoRoleOptions represents options required to create or update a custom repository role.\ntype CreateOrUpdateCustomRepoRoleOptions struct {\n\tName        *string  `json:\"name,omitempty\"`\n\tDescription *string  `json:\"description,omitempty\"`\n\tBaseRole    *string  `json:\"base_role,omitempty\"`\n\tPermissions []string `json:\"permissions\"`\n}\n\n// RepoFineGrainedPermission represents a fine-grained permission that can be used in a custom repository role.\ntype RepoFineGrainedPermission struct {\n\tName        string `json:\"name\"`\n\tDescription string `json:\"description\"`\n}\n\n// ListCustomRepoRoles lists the custom repository roles available in this organization.\n// In order to see custom repository roles in an organization, the authenticated user must be an organization owner.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization\n//\n//meta:operation GET /orgs/{org}/custom-repository-roles\nfunc (s *OrganizationsService) ListCustomRepoRoles(ctx context.Context, org string) (*OrganizationCustomRepoRoles, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/custom-repository-roles\", org)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar customRepoRoles *OrganizationCustomRepoRoles\n\tresp, err := s.client.Do(ctx, req, &customRepoRoles)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn customRepoRoles, resp, nil\n}\n\n// GetCustomRepoRole gets a custom repository roles available in this organization.\n// In order to see custom repository roles in an organization, the authenticated user must be an organization owner.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#get-a-custom-repository-role\n//\n//meta:operation GET /orgs/{org}/custom-repository-roles/{role_id}\nfunc (s *OrganizationsService) GetCustomRepoRole(ctx context.Context, org string, roleID int64) (*CustomRepoRoles, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/custom-repository-roles/%v\", org, roleID)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar resultingRole *CustomRepoRoles\n\tresp, err := s.client.Do(ctx, req, &resultingRole)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn resultingRole, resp, nil\n}\n\n// CreateCustomRepoRole creates a custom repository role in this organization.\n// In order to create custom repository roles in an organization, the authenticated user must be an organization owner.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#create-a-custom-repository-role\n//\n//meta:operation POST /orgs/{org}/custom-repository-roles\nfunc (s *OrganizationsService) CreateCustomRepoRole(ctx context.Context, org string, opts *CreateOrUpdateCustomRepoRoleOptions) (*CustomRepoRoles, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/custom-repository-roles\", org)\n\n\treq, err := s.client.NewRequest(\"POST\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar resultingRole *CustomRepoRoles\n\tresp, err := s.client.Do(ctx, req, &resultingRole)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn resultingRole, resp, err\n}\n\n// UpdateCustomRepoRole updates a custom repository role in this organization.\n// In order to update custom repository roles in an organization, the authenticated user must be an organization owner.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#update-a-custom-repository-role\n//\n//meta:operation PATCH /orgs/{org}/custom-repository-roles/{role_id}\nfunc (s *OrganizationsService) UpdateCustomRepoRole(ctx context.Context, org string, roleID int64, opts *CreateOrUpdateCustomRepoRoleOptions) (*CustomRepoRoles, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/custom-repository-roles/%v\", org, roleID)\n\n\treq, err := s.client.NewRequest(\"PATCH\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar resultingRole *CustomRepoRoles\n\tresp, err := s.client.Do(ctx, req, &resultingRole)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn resultingRole, resp, err\n}\n\n// DeleteCustomRepoRole deletes an existing custom repository role in this organization.\n// In order to delete custom repository roles in an organization, the authenticated user must be an organization owner.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#delete-a-custom-repository-role\n//\n//meta:operation DELETE /orgs/{org}/custom-repository-roles/{role_id}\nfunc (s *OrganizationsService) DeleteCustomRepoRole(ctx context.Context, org string, roleID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/custom-repository-roles/%v\", org, roleID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar resultingRole *CustomRepoRoles\n\tresp, err := s.client.Do(ctx, req, &resultingRole)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// ListRepositoryFineGrainedPermissions lists the fine-grained permissions that can be used in custom repository roles for an organization.\n// The authenticated user must be an administrator of the organization or of a repository of the organization to use this endpoint.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-roles#list-repository-fine-grained-permissions-for-an-organization\n//\n//meta:operation GET /orgs/{org}/repository-fine-grained-permissions\nfunc (s *OrganizationsService) ListRepositoryFineGrainedPermissions(ctx context.Context, org string) ([]*RepoFineGrainedPermission, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/repository-fine-grained-permissions\", org)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar perms []*RepoFineGrainedPermission\n\tresp, err := s.client.Do(ctx, req, &perms)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn perms, resp, nil\n}\n"
  },
  {
    "path": "github/orgs_custom_repository_roles_test.go",
    "content": "// Copyright 2024 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestOrganizationsService_ListCustomRepoRoles(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/custom-repository-roles\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"total_count\": 1, \"custom_roles\": [\n\t\t\t{\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"name\": \"Developer\",\n\t\t\t\t\"base_role\": \"write\",\n\t\t\t\t\"permissions\": [\"delete_alerts_code_scanning\"],\n\t\t\t\t\"organization\": {\n\t\t\t\t\t\"login\": \"l\",\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\t\"html_url\": \"h\",\n\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\"company\": \"c\",\n\t\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\t\"location\": \"l\",\n\t\t\t\t\t\"email\": \"e\"\n\t\t\t\t},\n\t\t\t\t\"created_at\": \"2024-07-21T19:33:08Z\",\n\t\t\t\t\"updated_at\": \"2024-07-21T19:33:08Z\"\n\t\t\t}\n\t\t  ]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tapps, _, err := client.Organizations.ListCustomRepoRoles(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListCustomRepoRoles returned error: %v\", err)\n\t}\n\n\twant := &OrganizationCustomRepoRoles{\n\t\tTotalCount: Ptr(1),\n\t\tCustomRepoRoles: []*CustomRepoRoles{\n\t\t\t{\n\t\t\t\tID:          Ptr(int64(1)),\n\t\t\t\tName:        Ptr(\"Developer\"),\n\t\t\t\tBaseRole:    Ptr(\"write\"),\n\t\t\t\tPermissions: []string{\"delete_alerts_code_scanning\"},\n\t\t\t\tOrg: &Organization{\n\t\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t\t\tHTMLURL:   Ptr(\"h\"),\n\t\t\t\t\tName:      Ptr(\"n\"),\n\t\t\t\t\tCompany:   Ptr(\"c\"),\n\t\t\t\t\tBlog:      Ptr(\"b\"),\n\t\t\t\t\tLocation:  Ptr(\"l\"),\n\t\t\t\t\tEmail:     Ptr(\"e\"),\n\t\t\t\t},\n\t\t\t\tCreatedAt: &Timestamp{time.Date(2024, time.July, 21, 19, 33, 8, 0, time.UTC)},\n\t\t\t\tUpdatedAt: &Timestamp{time.Date(2024, time.July, 21, 19, 33, 8, 0, time.UTC)},\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(apps, want) {\n\t\tt.Errorf(\"Organizations.ListCustomRepoRoles returned %+v, want %+v\", apps, want)\n\t}\n\n\tconst methodName = \"ListCustomRepoRoles\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListCustomRepoRoles(ctx, \"\\no\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListCustomRepoRoles(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_GetCustomRepoRole(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/custom-repository-roles/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"name\": \"Developer\",\n\t\t\t\t\"base_role\": \"write\",\n\t\t\t\t\"permissions\": [\"delete_alerts_code_scanning\"],\n\t\t\t\t\"organization\": {\n\t\t\t\t\t\"login\": \"l\",\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\t\"html_url\": \"h\",\n\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\"company\": \"c\",\n\t\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\t\"location\": \"l\",\n\t\t\t\t\t\"email\": \"e\"\n\t\t\t\t},\n\t\t\t\t\"created_at\": \"2024-07-21T19:33:08Z\",\n\t\t\t\t\"updated_at\": \"2024-07-21T19:33:08Z\"\n\t\t\t}`)\n\t})\n\n\tctx := t.Context()\n\trole, _, err := client.Organizations.GetCustomRepoRole(ctx, \"o\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.GetCustomRepoRole returned error: %v\", err)\n\t}\n\n\twant := &CustomRepoRoles{\n\t\tID:          Ptr(int64(1)),\n\t\tName:        Ptr(\"Developer\"),\n\t\tBaseRole:    Ptr(\"write\"),\n\t\tPermissions: []string{\"delete_alerts_code_scanning\"},\n\t\tOrg: &Organization{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\tHTMLURL:   Ptr(\"h\"),\n\t\t\tName:      Ptr(\"n\"),\n\t\t\tCompany:   Ptr(\"c\"),\n\t\t\tBlog:      Ptr(\"b\"),\n\t\t\tLocation:  Ptr(\"l\"),\n\t\t\tEmail:     Ptr(\"e\"),\n\t\t},\n\t\tCreatedAt: &Timestamp{time.Date(2024, time.July, 21, 19, 33, 8, 0, time.UTC)},\n\t\tUpdatedAt: &Timestamp{time.Date(2024, time.July, 21, 19, 33, 8, 0, time.UTC)},\n\t}\n\tif !cmp.Equal(role, want) {\n\t\tt.Errorf(\"Organizations.GetCustomRepoRole returned %+v, want %+v\", role, want)\n\t}\n\n\tconst methodName = \"GetCustomRepoRole\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.GetCustomRepoRole(ctx, \"\\no\", 1)\n\t\treturn err\n\t})\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.GetCustomRepoRole(ctx, \"o\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.GetCustomRepoRole(ctx, \"o\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_CreateCustomRepoRole(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/custom-repository-roles\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\"id\":8030,\"name\":\"Labeler\",\"description\":\"A role for issue and PR labelers\",\"base_role\":\"read\",\"permissions\":[\"add_label\"]}`)\n\t})\n\n\tctx := t.Context()\n\n\topts := &CreateOrUpdateCustomRepoRoleOptions{\n\t\tName:        Ptr(\"Labeler\"),\n\t\tDescription: Ptr(\"A role for issue and PR labelers\"),\n\t\tBaseRole:    Ptr(\"read\"),\n\t\tPermissions: []string{\"add_label\"},\n\t}\n\tapps, _, err := client.Organizations.CreateCustomRepoRole(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.CreateCustomRepoRole returned error: %v\", err)\n\t}\n\n\twant := &CustomRepoRoles{ID: Ptr(int64(8030)), Name: Ptr(\"Labeler\"), BaseRole: Ptr(\"read\"), Permissions: []string{\"add_label\"}, Description: Ptr(\"A role for issue and PR labelers\")}\n\n\tif !cmp.Equal(apps, want) {\n\t\tt.Errorf(\"Organizations.CreateCustomRepoRole returned %+v, want %+v\", apps, want)\n\t}\n\n\tconst methodName = \"CreateCustomRepoRole\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.CreateCustomRepoRole(ctx, \"\\no\", nil)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.CreateCustomRepoRole(ctx, \"o\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_UpdateCustomRepoRole(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/custom-repository-roles/8030\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tfmt.Fprint(w, `{\"id\":8030,\"name\":\"Updated Name\",\"description\":\"Updated Description\",\"base_role\":\"read\",\"permissions\":[\"add_label\"]}`)\n\t})\n\n\tctx := t.Context()\n\n\topts := &CreateOrUpdateCustomRepoRoleOptions{\n\t\tName:        Ptr(\"Updated Name\"),\n\t\tDescription: Ptr(\"Updated Description\"),\n\t}\n\tapps, _, err := client.Organizations.UpdateCustomRepoRole(ctx, \"o\", 8030, opts)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.UpdateCustomRepoRole returned error: %v\", err)\n\t}\n\n\twant := &CustomRepoRoles{ID: Ptr(int64(8030)), Name: Ptr(\"Updated Name\"), BaseRole: Ptr(\"read\"), Permissions: []string{\"add_label\"}, Description: Ptr(\"Updated Description\")}\n\n\tif !cmp.Equal(apps, want) {\n\t\tt.Errorf(\"Organizations.UpdateCustomRepoRole returned %+v, want %+v\", apps, want)\n\t}\n\n\tconst methodName = \"UpdateCustomRepoRole\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.UpdateCustomRepoRole(ctx, \"\\no\", 8030, nil)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.UpdateCustomRepoRole(ctx, \"o\", 8030, nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_DeleteCustomRepoRole(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/custom-repository-roles/8030\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\n\tresp, err := client.Organizations.DeleteCustomRepoRole(ctx, \"o\", 8030)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.DeleteCustomRepoRole returned error: %v\", err)\n\t}\n\n\tif !cmp.Equal(resp.StatusCode, 204) {\n\t\tt.Errorf(\"Organizations.DeleteCustomRepoRole returned  status code %+v, want %+v\", resp.StatusCode, \"204\")\n\t}\n\n\tconst methodName = \"DeleteCustomRepoRole\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Organizations.DeleteCustomRepoRole(ctx, \"\\no\", 8030)\n\t\treturn err\n\t})\n}\n\nfunc TestOrganizationsService_ListRepositoryFineGrainedPermissions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/repository-fine-grained-permissions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[\n\t\t\t{\n\t\t\t\t\"name\": \"add_assignee\",\n\t\t\t\t\"description\": \"Assign or remove a user\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"name\": \"add_label\",\n\t\t\t\t\"description\": \"Add or remove a label\"\n\t\t\t}\n\t\t]`)\n\t})\n\n\tctx := t.Context()\n\tperms, _, err := client.Organizations.ListRepositoryFineGrainedPermissions(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListRepositoryFineGrainedPermissions returned error: %v\", err)\n\t}\n\n\twant := []*RepoFineGrainedPermission{\n\t\t{\n\t\t\tName:        \"add_assignee\",\n\t\t\tDescription: \"Assign or remove a user\",\n\t\t},\n\t\t{\n\t\t\tName:        \"add_label\",\n\t\t\tDescription: \"Add or remove a label\",\n\t\t},\n\t}\n\tif !cmp.Equal(perms, want) {\n\t\tt.Errorf(\"Organizations.ListRepositoryFineGrainedPermissions returned %+v, want %+v\", perms, want)\n\t}\n\n\tconst methodName = \"ListRepositoryFineGrainedPermissions\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListRepositoryFineGrainedPermissions(ctx, \"\\no\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListRepositoryFineGrainedPermissions(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/orgs_hooks.go",
    "content": "// Copyright 2015 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n)\n\n// ListHooks lists all Hooks for the specified organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#list-organization-webhooks\n//\n//meta:operation GET /orgs/{org}/hooks\nfunc (s *OrganizationsService) ListHooks(ctx context.Context, org string, opts *ListOptions) ([]*Hook, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/hooks\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar hooks []*Hook\n\tresp, err := s.client.Do(ctx, req, &hooks)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn hooks, resp, nil\n}\n\n// GetHook returns a single specified Hook.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#get-an-organization-webhook\n//\n//meta:operation GET /orgs/{org}/hooks/{hook_id}\nfunc (s *OrganizationsService) GetHook(ctx context.Context, org string, id int64) (*Hook, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/hooks/%v\", org, id)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar hook *Hook\n\tresp, err := s.client.Do(ctx, req, &hook)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn hook, resp, nil\n}\n\n// CreateHook creates a Hook for the specified org.\n// Config is a required field.\n//\n// Note that only a subset of the hook fields are used and hook must\n// not be nil.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#create-an-organization-webhook\n//\n//meta:operation POST /orgs/{org}/hooks\nfunc (s *OrganizationsService) CreateHook(ctx context.Context, org string, hook *Hook) (*Hook, *Response, error) {\n\tif hook == nil {\n\t\treturn nil, nil, errors.New(\"hook must be provided\")\n\t}\n\n\tu := fmt.Sprintf(\"orgs/%v/hooks\", org)\n\n\thookReq := &createHookRequest{\n\t\tName:   \"web\",\n\t\tEvents: hook.Events,\n\t\tActive: hook.Active,\n\t\tConfig: hook.Config,\n\t}\n\n\treq, err := s.client.NewRequest(\"POST\", u, hookReq)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar h *Hook\n\tresp, err := s.client.Do(ctx, req, &h)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn h, resp, nil\n}\n\n// EditHook updates a specified Hook.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#update-an-organization-webhook\n//\n//meta:operation PATCH /orgs/{org}/hooks/{hook_id}\nfunc (s *OrganizationsService) EditHook(ctx context.Context, org string, id int64, hook *Hook) (*Hook, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/hooks/%v\", org, id)\n\treq, err := s.client.NewRequest(\"PATCH\", u, hook)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar h *Hook\n\tresp, err := s.client.Do(ctx, req, &h)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn h, resp, nil\n}\n\n// PingHook triggers a 'ping' event to be sent to the Hook.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#ping-an-organization-webhook\n//\n//meta:operation POST /orgs/{org}/hooks/{hook_id}/pings\nfunc (s *OrganizationsService) PingHook(ctx context.Context, org string, id int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/hooks/%v/pings\", org, id)\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// DeleteHook deletes a specified Hook.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#delete-an-organization-webhook\n//\n//meta:operation DELETE /orgs/{org}/hooks/{hook_id}\nfunc (s *OrganizationsService) DeleteHook(ctx context.Context, org string, id int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/hooks/%v\", org, id)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/orgs_hooks_configuration.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// GetHookConfiguration returns the configuration for the specified organization webhook.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization\n//\n//meta:operation GET /orgs/{org}/hooks/{hook_id}/config\nfunc (s *OrganizationsService) GetHookConfiguration(ctx context.Context, org string, id int64) (*HookConfig, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/hooks/%v/config\", org, id)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar config *HookConfig\n\tresp, err := s.client.Do(ctx, req, &config)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn config, resp, nil\n}\n\n// EditHookConfiguration updates the configuration for the specified organization webhook.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization\n//\n//meta:operation PATCH /orgs/{org}/hooks/{hook_id}/config\nfunc (s *OrganizationsService) EditHookConfiguration(ctx context.Context, org string, id int64, config *HookConfig) (*HookConfig, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/hooks/%v/config\", org, id)\n\treq, err := s.client.NewRequest(\"PATCH\", u, config)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar c *HookConfig\n\tresp, err := s.client.Do(ctx, req, &c)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn c, resp, nil\n}\n"
  },
  {
    "path": "github/orgs_hooks_configuration_test.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestOrganizationsService_GetHookConfiguration(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/hooks/1/config\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"content_type\": \"json\", \"insecure_ssl\": \"0\", \"secret\": \"********\", \"url\": \"https://example.com/webhook\"}`)\n\t})\n\n\tctx := t.Context()\n\tconfig, _, err := client.Organizations.GetHookConfiguration(ctx, \"o\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.GetHookConfiguration returned error: %v\", err)\n\t}\n\n\twant := &HookConfig{\n\t\tContentType: Ptr(\"json\"),\n\t\tInsecureSSL: Ptr(\"0\"),\n\t\tSecret:      Ptr(\"********\"),\n\t\tURL:         Ptr(\"https://example.com/webhook\"),\n\t}\n\tif !cmp.Equal(config, want) {\n\t\tt.Errorf(\"Organizations.GetHookConfiguration returned %+v, want %+v\", config, want)\n\t}\n\n\tconst methodName = \"GetHookConfiguration\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.GetHookConfiguration(ctx, \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.GetHookConfiguration(ctx, \"o\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_GetHookConfiguration_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Organizations.GetHookConfiguration(ctx, \"%\", 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestOrganizationsService_EditHookConfiguration(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &HookConfig{}\n\n\tmux.HandleFunc(\"/orgs/o/hooks/1/config\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *HookConfig\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"content_type\": \"json\", \"insecure_ssl\": \"0\", \"secret\": \"********\", \"url\": \"https://example.com/webhook\"}`)\n\t})\n\n\tctx := t.Context()\n\tconfig, _, err := client.Organizations.EditHookConfiguration(ctx, \"o\", 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.EditHookConfiguration returned error: %v\", err)\n\t}\n\n\twant := &HookConfig{\n\t\tContentType: Ptr(\"json\"),\n\t\tInsecureSSL: Ptr(\"0\"),\n\t\tSecret:      Ptr(\"********\"),\n\t\tURL:         Ptr(\"https://example.com/webhook\"),\n\t}\n\tif !cmp.Equal(config, want) {\n\t\tt.Errorf(\"Organizations.EditHookConfiguration returned %+v, want %+v\", config, want)\n\t}\n\n\tconst methodName = \"EditHookConfiguration\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.EditHookConfiguration(ctx, \"\\n\", -1, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.EditHookConfiguration(ctx, \"o\", 1, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_EditHookConfiguration_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Organizations.EditHookConfiguration(ctx, \"%\", 1, nil)\n\ttestURLParseError(t, err)\n}\n"
  },
  {
    "path": "github/orgs_hooks_deliveries.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// ListHookDeliveries lists webhook deliveries for a webhook configured in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#list-deliveries-for-an-organization-webhook\n//\n//meta:operation GET /orgs/{org}/hooks/{hook_id}/deliveries\nfunc (s *OrganizationsService) ListHookDeliveries(ctx context.Context, org string, id int64, opts *ListCursorOptions) ([]*HookDelivery, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/hooks/%v/deliveries\", org, id)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tdeliveries := []*HookDelivery{}\n\tresp, err := s.client.Do(ctx, req, &deliveries)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn deliveries, resp, nil\n}\n\n// GetHookDelivery returns a delivery for a webhook configured in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-delivery-for-an-organization-webhook\n//\n//meta:operation GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}\nfunc (s *OrganizationsService) GetHookDelivery(ctx context.Context, owner string, hookID, deliveryID int64) (*HookDelivery, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/hooks/%v/deliveries/%v\", owner, hookID, deliveryID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar h *HookDelivery\n\tresp, err := s.client.Do(ctx, req, &h)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn h, resp, nil\n}\n\n// RedeliverHookDelivery redelivers a delivery for a webhook configured in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/webhooks#redeliver-a-delivery-for-an-organization-webhook\n//\n//meta:operation POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts\nfunc (s *OrganizationsService) RedeliverHookDelivery(ctx context.Context, owner string, hookID, deliveryID int64) (*HookDelivery, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/hooks/%v/deliveries/%v/attempts\", owner, hookID, deliveryID)\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar h *HookDelivery\n\tresp, err := s.client.Do(ctx, req, &h)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn h, resp, nil\n}\n"
  },
  {
    "path": "github/orgs_hooks_deliveries_test.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestOrganizationsService_ListHookDeliveries(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/hooks/1/deliveries\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"cursor\": \"v1_12077215967\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}, {\"id\":2}]`)\n\t})\n\n\topt := &ListCursorOptions{Cursor: \"v1_12077215967\"}\n\n\tctx := t.Context()\n\thooks, _, err := client.Organizations.ListHookDeliveries(ctx, \"o\", 1, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListHookDeliveries returned error: %v\", err)\n\t}\n\n\twant := []*HookDelivery{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}}\n\tif d := cmp.Diff(hooks, want); d != \"\" {\n\t\tt.Errorf(\"Organizations.ListHooks want (-), got (+):\\n%v\", d)\n\t}\n\n\tconst methodName = \"ListHookDeliveries\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListHookDeliveries(ctx, \"\\n\", -1, opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListHookDeliveries(ctx, \"o\", 1, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_ListHookDeliveries_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Organizations.ListHookDeliveries(ctx, \"%\", 1, nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestOrganizationsService_GetHookDelivery(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/hooks/1/deliveries/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\thook, _, err := client.Organizations.GetHookDelivery(ctx, \"o\", 1, 1)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.GetHookDelivery returned error: %v\", err)\n\t}\n\n\twant := &HookDelivery{ID: Ptr(int64(1))}\n\tif !cmp.Equal(hook, want) {\n\t\tt.Errorf(\"Organizations.GetHookDelivery returned %+v, want %+v\", hook, want)\n\t}\n\n\tconst methodName = \"GetHookDelivery\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.GetHookDelivery(ctx, \"\\n\", -1, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.GetHookDelivery(ctx, \"o\", 1, 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_GetHookDelivery_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Organizations.GetHookDelivery(ctx, \"%\", 1, 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestOrganizationsService_RedeliverHookDelivery(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/hooks/1/deliveries/1/attempts\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\thook, _, err := client.Organizations.RedeliverHookDelivery(ctx, \"o\", 1, 1)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.RedeliverHookDelivery returned error: %v\", err)\n\t}\n\n\twant := &HookDelivery{ID: Ptr(int64(1))}\n\tif !cmp.Equal(hook, want) {\n\t\tt.Errorf(\"Organizations.RedeliverHookDelivery returned %+v, want %+v\", hook, want)\n\t}\n\n\tconst methodName = \"Rede;overHookDelivery\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.RedeliverHookDelivery(ctx, \"\\n\", -1, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.RedeliverHookDelivery(ctx, \"o\", 1, 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_RedeliverHookDelivery_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Organizations.RedeliverHookDelivery(ctx, \"%\", 1, 1)\n\ttestURLParseError(t, err)\n}\n"
  },
  {
    "path": "github/orgs_hooks_test.go",
    "content": "// Copyright 2015 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestOrganizationsService_ListHooks(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/hooks\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}, {\"id\":2}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\n\tctx := t.Context()\n\thooks, _, err := client.Organizations.ListHooks(ctx, \"o\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListHooks returned error: %v\", err)\n\t}\n\n\twant := []*Hook{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}}\n\tif !cmp.Equal(hooks, want) {\n\t\tt.Errorf(\"Organizations.ListHooks returned %+v, want %+v\", hooks, want)\n\t}\n\n\tconst methodName = \"ListHooks\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListHooks(ctx, \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListHooks(ctx, \"o\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_ListHooks_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Organizations.ListHooks(ctx, \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestOrganizationsService_CreateHook(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &Hook{CreatedAt: &Timestamp{referenceTime}}\n\n\tmux.HandleFunc(\"/orgs/o/hooks\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *createHookRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\twant := &createHookRequest{Name: \"web\"}\n\t\tif !cmp.Equal(v, want) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, want)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\thook, _, err := client.Organizations.CreateHook(ctx, \"o\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.CreateHook returned error: %v\", err)\n\t}\n\n\twant := &Hook{ID: Ptr(int64(1))}\n\tif !cmp.Equal(hook, want) {\n\t\tt.Errorf(\"Organizations.CreateHook returned %+v, want %+v\", hook, want)\n\t}\n\n\tconst methodName = \"CreateHook\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.CreateHook(ctx, \"o\", nil)\n\t\treturn err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.CreateHook(ctx, \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.CreateHook(ctx, \"o\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_GetHook(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/hooks/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\thook, _, err := client.Organizations.GetHook(ctx, \"o\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.GetHook returned error: %v\", err)\n\t}\n\n\twant := &Hook{ID: Ptr(int64(1))}\n\tif !cmp.Equal(hook, want) {\n\t\tt.Errorf(\"Organizations.GetHook returned %+v, want %+v\", hook, want)\n\t}\n\n\tconst methodName = \"GetHook\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.GetHook(ctx, \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.GetHook(ctx, \"o\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_GetHook_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Organizations.GetHook(ctx, \"%\", 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestOrganizationsService_EditHook(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &Hook{}\n\n\tmux.HandleFunc(\"/orgs/o/hooks/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *Hook\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\thook, _, err := client.Organizations.EditHook(ctx, \"o\", 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.EditHook returned error: %v\", err)\n\t}\n\n\twant := &Hook{ID: Ptr(int64(1))}\n\tif !cmp.Equal(hook, want) {\n\t\tt.Errorf(\"Organizations.EditHook returned %+v, want %+v\", hook, want)\n\t}\n\n\tconst methodName = \"EditHook\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.EditHook(ctx, \"\\n\", -1, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.EditHook(ctx, \"o\", 1, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_EditHook_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Organizations.EditHook(ctx, \"%\", 1, nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestOrganizationsService_PingHook(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/hooks/1/pings\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Organizations.PingHook(ctx, \"o\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.PingHook returned error: %v\", err)\n\t}\n\n\tconst methodName = \"PingHook\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Organizations.PingHook(ctx, \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.PingHook(ctx, \"o\", 1)\n\t})\n}\n\nfunc TestOrganizationsService_DeleteHook(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/hooks/1\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Organizations.DeleteHook(ctx, \"o\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.DeleteHook returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteHook\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Organizations.DeleteHook(ctx, \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.DeleteHook(ctx, \"o\", 1)\n\t})\n}\n\nfunc TestOrganizationsService_DeleteHook_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Organizations.DeleteHook(ctx, \"%\", 1)\n\ttestURLParseError(t, err)\n}\n"
  },
  {
    "path": "github/orgs_immutable_releases.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// ImmutableReleaseSettings represents the response from the immutable releases settings endpoint.\ntype ImmutableReleaseSettings struct {\n\t// EnforcedRepositories specifies how immutable releases are enforced in the organization. Possible values include \"all\", \"none\", or \"selected\".\n\tEnforcedRepositories *string `json:\"enforced_repositories,omitempty\"`\n\t// SelectedRepositoriesURL provides the API URL for managing the repositories\n\t// selected for immutable releases enforcement when EnforcedRepositories is set to \"selected\".\n\tSelectedRepositoriesURL *string `json:\"selected_repositories_url,omitempty\"`\n}\n\n// ImmutableReleasePolicy is for setting the immutable releases policy for repositories in an organization.\ntype ImmutableReleasePolicy struct {\n\t// EnforcedRepositories specifies how immutable releases are enforced in the organization. Possible values include \"all\", \"none\", or \"selected\".\n\tEnforcedRepositories *string `json:\"enforced_repositories,omitempty\"`\n\t// An array of repository ids for which immutable releases enforcement should be applied.\n\t// You can only provide a list of repository ids when the enforced_repositories is set to \"selected\"\n\tSelectedRepositoryIDs []int64 `json:\"selected_repository_ids,omitempty\"`\n}\n\n// setImmutableReleasesRepositoriesOptions represents the request body for setting repositories.\ntype setImmutableReleasesRepositoriesOptions struct {\n\tSelectedRepositoryIDs []int64 `json:\"selected_repository_ids\"`\n}\n\n// GetImmutableReleasesSettings returns the immutable releases configuration that applies to repositories within the given organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/orgs#get-immutable-releases-settings-for-an-organization\n//\n//meta:operation GET /orgs/{org}/settings/immutable-releases\nfunc (s *OrganizationsService) GetImmutableReleasesSettings(ctx context.Context, org string) (*ImmutableReleaseSettings, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/settings/immutable-releases\", org)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar settings *ImmutableReleaseSettings\n\tresp, err := s.client.Do(ctx, req, &settings)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn settings, resp, nil\n}\n\n// UpdateImmutableReleasesSettings sets immutable releases settings for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/orgs#set-immutable-releases-settings-for-an-organization\n//\n//meta:operation PUT /orgs/{org}/settings/immutable-releases\nfunc (s *OrganizationsService) UpdateImmutableReleasesSettings(ctx context.Context, org string, opts ImmutableReleasePolicy) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/settings/immutable-releases\", org)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// ListImmutableReleaseRepositories lists selected repositories for immutable releases enforcement in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/orgs#list-selected-repositories-for-immutable-releases-enforcement\n//\n//meta:operation GET /orgs/{org}/settings/immutable-releases/repositories\nfunc (s *OrganizationsService) ListImmutableReleaseRepositories(ctx context.Context, org string, opts *ListOptions) (*ListRepositories, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/settings/immutable-releases/repositories\", org)\n\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar repositories *ListRepositories\n\tresp, err := s.client.Do(ctx, req, &repositories)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn repositories, resp, nil\n}\n\n// SetImmutableReleaseRepositories sets selected repositories for immutable releases enforcement.\n// It requires the organization's immutable releases policy for enforced_repositories to be set to \"selected\".\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/orgs#set-selected-repositories-for-immutable-releases-enforcement\n//\n//meta:operation PUT /orgs/{org}/settings/immutable-releases/repositories\nfunc (s *OrganizationsService) SetImmutableReleaseRepositories(ctx context.Context, org string, repositoryIDs []int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/settings/immutable-releases/repositories\", org)\n\n\tbody := &setImmutableReleasesRepositoriesOptions{\n\t\tSelectedRepositoryIDs: repositoryIDs,\n\t}\n\n\treq, err := s.client.NewRequest(\"PUT\", u, body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// EnableRepositoryForImmutableRelease enables a selected repository for immutable releases in an organization.\n// It requires enforced_repositories to be set to \"selected\".\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/orgs#enable-a-selected-repository-for-immutable-releases-in-an-organization\n//\n//meta:operation PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}\nfunc (s *OrganizationsService) EnableRepositoryForImmutableRelease(ctx context.Context, org string, repoID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/settings/immutable-releases/repositories/%v\", org, repoID)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// DisableRepositoryForImmutableRelease removes a repository from the organization's selected list for immutable releases enforcement.\n// It requires enforced_repositories to be set to \"selected\".\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/orgs#disable-a-selected-repository-for-immutable-releases-in-an-organization\n//\n//meta:operation DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}\nfunc (s *OrganizationsService) DisableRepositoryForImmutableRelease(ctx context.Context, org string, repoID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/settings/immutable-releases/repositories/%v\", org, repoID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n"
  },
  {
    "path": "github/orgs_immutable_releases_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestOrganizationsService_GetImmutableReleasesSettings(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/settings/immutable-releases\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"enforced_repositories\": \"selected\",\n\t\t\t\"selected_repositories_url\": \"https://api.github.com/orgs/o/r\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tsettings, _, err := client.Organizations.GetImmutableReleasesSettings(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.GetImmutableReleasesSettings returned error: %v\", err)\n\t}\n\n\twantURL := \"https://api.github.com/orgs/o/r\"\n\twant := &ImmutableReleaseSettings{\n\t\tEnforcedRepositories:    Ptr(\"selected\"),\n\t\tSelectedRepositoriesURL: &wantURL,\n\t}\n\n\tif !cmp.Equal(settings, want) {\n\t\tt.Errorf(\"Organizations.GetImmutableReleasesSettings returned %+v, want %+v\", settings, want)\n\t}\n\n\tconst methodName = \"GetImmutableReleasesSettings\"\n\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err := client.Organizations.GetImmutableReleasesSettings(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.GetImmutableReleasesSettings(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_UpdateImmutableReleasesSettings(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := ImmutableReleasePolicy{\n\t\tEnforcedRepositories: Ptr(\"selected\"),\n\t}\n\n\tmux.HandleFunc(\"/orgs/o/settings/immutable-releases\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\n\t\tvar gotBody map[string]any\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&gotBody))\n\n\t\twantBody := map[string]any{\n\t\t\t\"enforced_repositories\": \"selected\",\n\t\t}\n\n\t\tif !cmp.Equal(gotBody, wantBody) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", gotBody, wantBody)\n\t\t}\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t\tfmt.Fprint(w, `{\"enforced_repositories\":\"selected\"}`)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Organizations.UpdateImmutableReleasesSettings(ctx, \"o\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.UpdateImmutableReleasesSettings returned error: %v\", err)\n\t}\n\n\tif resp.StatusCode != http.StatusNoContent {\n\t\tt.Errorf(\"Expected status 204 No Content, got %v\", resp.StatusCode)\n\t}\n\n\tconst methodName = \"UpdateImmutableReleasesSettings\"\n\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, err := client.Organizations.UpdateImmutableReleasesSettings(ctx, \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tresp, err := client.Organizations.UpdateImmutableReleasesSettings(ctx, \"o\", input)\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_ListImmutableReleaseRepositories(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tresponseBody := `{\n\t\t\"total_count\": 2,\n\t\t\"repositories\": [\n\t\t\t{\"id\": 1, \"name\": \"repo1\"},\n\t\t\t{\"id\": 2, \"name\": \"repo2\"}\n\t\t]\n\t}`\n\n\tmux.HandleFunc(\"/orgs/o/settings/immutable-releases/repositories\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, responseBody)\n\t})\n\n\tctx := t.Context()\n\topts := &ListOptions{Page: 1, PerPage: 10}\n\trepos, _, err := client.Organizations.ListImmutableReleaseRepositories(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListImmutableReleaseRepositories returned error: %v\", err)\n\t}\n\n\twant := &ListRepositories{\n\t\tTotalCount: Ptr(2),\n\t\tRepositories: []*Repository{\n\t\t\t{ID: Ptr(int64(1)), Name: Ptr(\"repo1\")},\n\t\t\t{ID: Ptr(int64(2)), Name: Ptr(\"repo2\")},\n\t\t},\n\t}\n\n\tif !cmp.Equal(repos, want) {\n\t\tt.Errorf(\"Organizations.ListImmutableReleaseRepositories returned %+v, want %+v\", repos, want)\n\t}\n\n\tconst methodName = \"ListImmutableReleaseRepositories\"\n\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err := client.Organizations.ListImmutableReleaseRepositories(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListImmutableReleaseRepositories(ctx, \"o\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_SetImmutableReleaseRepositories(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := []int64{1, 2, 3}\n\tmux.HandleFunc(\"/orgs/o/settings/immutable-releases/repositories\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\n\t\tvar gotBody setImmutableReleasesRepositoriesOptions\n\t\tif err := json.NewDecoder(r.Body).Decode(&gotBody); err != nil {\n\t\t\tt.Fatalf(\"Failed to decode request body: %v\", err)\n\t\t}\n\n\t\tif !cmp.Equal(gotBody.SelectedRepositoryIDs, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", gotBody.SelectedRepositoryIDs, input)\n\t\t}\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Organizations.SetImmutableReleaseRepositories(ctx, \"o\", input)\n\tif err != nil {\n\t\tt.Fatalf(\"SetImmutableReleaseRepositories returned error: %v\", err)\n\t}\n\n\tif resp.StatusCode != http.StatusNoContent {\n\t\tt.Errorf(\"Expected status 204 No Content, got %v\", resp.StatusCode)\n\t}\n\n\tconst methodName = \"SetImmutableReleaseRepositories\"\n\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, err := client.Organizations.SetImmutableReleaseRepositories(ctx, \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.SetImmutableReleaseRepositories(ctx, \"o\", input)\n\t})\n}\n\nfunc TestOrganizationsService_EnableRepositoryForImmutableRelease(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\trepoID := int64(42)\n\n\tmux.HandleFunc(fmt.Sprintf(\"/orgs/o/settings/immutable-releases/repositories/%v\", repoID), func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Organizations.EnableRepositoryForImmutableRelease(ctx, \"o\", repoID)\n\tif err != nil {\n\t\tt.Errorf(\"EnableRepositoryForImmutableRelease returned error: %v\", err)\n\t}\n\tif resp.StatusCode != http.StatusNoContent {\n\t\tt.Errorf(\"Expected status 204 No Content, got %v\", resp.StatusCode)\n\t}\n\n\tconst methodName = \"EnableRepositoryForImmutableRelease\"\n\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, err := client.Organizations.EnableRepositoryForImmutableRelease(ctx, \"o\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.EnableRepositoryForImmutableRelease(ctx, \"o\", repoID)\n\t})\n}\n\nfunc TestOrganizationsService_DisableRepositoryForImmutableRelease(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\trepoID := int64(42)\n\n\tmux.HandleFunc(fmt.Sprintf(\"/orgs/o/settings/immutable-releases/repositories/%v\", repoID), func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Organizations.DisableRepositoryForImmutableRelease(ctx, \"o\", repoID)\n\tif err != nil {\n\t\tt.Errorf(\"DisableRepositoryForImmutableRelease returned error: %v\", err)\n\t}\n\tif resp.StatusCode != http.StatusNoContent {\n\t\tt.Errorf(\"Expected status 204 No Content, got %v\", resp.StatusCode)\n\t}\n\n\tconst methodName = \"DisableRepositoryForImmutableRelease\"\n\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, err := client.Organizations.DisableRepositoryForImmutableRelease(ctx, \"o\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.DisableRepositoryForImmutableRelease(ctx, \"o\", repoID)\n\t})\n}\n"
  },
  {
    "path": "github/orgs_issue_types.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// CreateOrUpdateIssueTypesOptions represents the parameters for creating or updating an issue type.\ntype CreateOrUpdateIssueTypesOptions struct {\n\tName        string  `json:\"name\"`                  // Name of the issue type. (Required.)\n\tIsEnabled   bool    `json:\"is_enabled\"`            // Whether or not the issue type is enabled at the organization level. (Required.)\n\tIsPrivate   *bool   `json:\"is_private,omitempty\"`  // Whether or not the issue type is restricted to issues in private repositories. (Optional.)\n\tDescription *string `json:\"description,omitempty\"` // Description of the issue type. (Optional.)\n\tColor       *string `json:\"color,omitempty\"`       // Color for the issue type. Can be one of \"gray\", \"blue\", green \"orange\", \"red\", \"pink\", \"purple\", \"null\". (Optional.)\n}\n\n// ListIssueTypes lists all issue types for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/issue-types#list-issue-types-for-an-organization\n//\n//meta:operation GET /orgs/{org}/issue-types\nfunc (s *OrganizationsService) ListIssueTypes(ctx context.Context, org string) ([]*IssueType, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/issue-types\", org)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar issueTypes []*IssueType\n\tresp, err := s.client.Do(ctx, req, &issueTypes)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn issueTypes, resp, nil\n}\n\n// CreateIssueType creates a new issue type for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/issue-types#create-issue-type-for-an-organization\n//\n//meta:operation POST /orgs/{org}/issue-types\nfunc (s *OrganizationsService) CreateIssueType(ctx context.Context, org string, opts *CreateOrUpdateIssueTypesOptions) (*IssueType, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/issue-types\", org)\n\treq, err := s.client.NewRequest(\"POST\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar issueType *IssueType\n\tresp, err := s.client.Do(ctx, req, &issueType)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn issueType, resp, nil\n}\n\n// UpdateIssueType updates GitHub Pages for the named repo.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/issue-types#update-issue-type-for-an-organization\n//\n//meta:operation PUT /orgs/{org}/issue-types/{issue_type_id}\nfunc (s *OrganizationsService) UpdateIssueType(ctx context.Context, org string, issueTypeID int64, opts *CreateOrUpdateIssueTypesOptions) (*IssueType, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/issue-types/%v\", org, issueTypeID)\n\treq, err := s.client.NewRequest(\"PUT\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar issueType *IssueType\n\tresp, err := s.client.Do(ctx, req, &issueType)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn issueType, resp, nil\n}\n\n// DeleteIssueType deletes an issue type for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/issue-types#delete-issue-type-for-an-organization\n//\n//meta:operation DELETE /orgs/{org}/issue-types/{issue_type_id}\nfunc (s *OrganizationsService) DeleteIssueType(ctx context.Context, org string, issueTypeID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/issue-types/%v\", org, issueTypeID)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/orgs_issue_types_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestOrganizationsService_ListIssueTypes(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/issue-types\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[\n\t\t\t{\n\t\t\t\t\"id\": 410,\n\t\t\t\t\"node_id\": \"IT_kwDNAd3NAZo\",\n\t\t\t\t\"name\": \"Task\",\n\t\t\t\t\"description\": \"A specific piece of work\",\n\t\t\t\t\"created_at\": \"2024-12-11T14:39:09Z\",\n\t\t\t\t\"updated_at\": \"2024-12-11T14:39:09Z\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"id\": 411,\n\t\t\t\t\"node_id\": \"IT_kwDNAd3NAZs\",\n\t\t\t\t\"name\": \"Bug\",\n\t\t\t\t\"description\": \"An unexpected problem or behavior\",\n\t\t\t\t\"created_at\": \"2024-12-11T14:39:09Z\",\n\t\t\t\t\"updated_at\": \"2024-12-11T14:39:09Z\"\n\t\t\t}\n\t\t]`)\n\t})\n\n\tctx := t.Context()\n\tissueTypes, _, err := client.Organizations.ListIssueTypes(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListIssueTypes returned error: %v\", err)\n\t}\n\n\twant := []*IssueType{\n\t\t{\n\t\t\tID:          Ptr(int64(410)),\n\t\t\tNodeID:      Ptr(\"IT_kwDNAd3NAZo\"),\n\t\t\tName:        Ptr(\"Task\"),\n\t\t\tDescription: Ptr(\"A specific piece of work\"),\n\t\t\tCreatedAt:   Ptr(Timestamp{time.Date(2024, 12, 11, 14, 39, 9, 0, time.UTC)}),\n\t\t\tUpdatedAt:   Ptr(Timestamp{time.Date(2024, 12, 11, 14, 39, 9, 0, time.UTC)}),\n\t\t},\n\t\t{\n\t\t\tID:          Ptr(int64(411)),\n\t\t\tNodeID:      Ptr(\"IT_kwDNAd3NAZs\"),\n\t\t\tName:        Ptr(\"Bug\"),\n\t\t\tDescription: Ptr(\"An unexpected problem or behavior\"),\n\t\t\tCreatedAt:   Ptr(Timestamp{time.Date(2024, 12, 11, 14, 39, 9, 0, time.UTC)}),\n\t\t\tUpdatedAt:   Ptr(Timestamp{time.Date(2024, 12, 11, 14, 39, 9, 0, time.UTC)}),\n\t\t},\n\t}\n\tif !cmp.Equal(issueTypes, want) {\n\t\tt.Errorf(\"Organizations.ListIssueTypes returned %+v, want %+v\", issueTypes, want)\n\t}\n\n\tconst methodName = \"ListIssueTypes\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListIssueTypes(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListIssueTypes(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_CreateIssueType(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &CreateOrUpdateIssueTypesOptions{\n\t\tName:        \"Epic\",\n\t\tDescription: Ptr(\"An issue type for a multi-week tracking of work\"),\n\t\tIsEnabled:   true,\n\t\tColor:       Ptr(\"green\"),\n\t\tIsPrivate:   Ptr(true),\n\t}\n\n\tmux.HandleFunc(\"/orgs/o/issue-types\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *CreateOrUpdateIssueTypesOptions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\n\t\t\t\t\"id\": 410,\n\t\t\t\t\"node_id\": \"IT_kwDNAd3NAZo\",\n\t\t\t\t\"name\": \"Epic\",\n\t\t\t\t\"description\": \"An issue type for a multi-week tracking of work\",\n\t\t\t\t\"created_at\": \"2024-12-11T14:39:09Z\",\n\t\t\t\t\"updated_at\": \"2024-12-11T14:39:09Z\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tissueType, _, err := client.Organizations.CreateIssueType(ctx, \"o\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.CreateIssueType returned error: %v\", err)\n\t}\n\twant := &IssueType{\n\t\tID:          Ptr(int64(410)),\n\t\tNodeID:      Ptr(\"IT_kwDNAd3NAZo\"),\n\t\tName:        Ptr(\"Epic\"),\n\t\tDescription: Ptr(\"An issue type for a multi-week tracking of work\"),\n\t\tCreatedAt:   Ptr(Timestamp{time.Date(2024, 12, 11, 14, 39, 9, 0, time.UTC)}),\n\t\tUpdatedAt:   Ptr(Timestamp{time.Date(2024, 12, 11, 14, 39, 9, 0, time.UTC)}),\n\t}\n\n\tif !cmp.Equal(issueType, want) {\n\t\tt.Errorf(\"Organizations.CreateIssueType returned %+v, want %+v\", issueType, want)\n\t}\n\n\tconst methodName = \"CreateIssueType\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.CreateIssueType(ctx, \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.CreateIssueType(ctx, \"o\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_UpdateIssueType(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &CreateOrUpdateIssueTypesOptions{\n\t\tName:        \"Epic\",\n\t\tDescription: Ptr(\"An issue type for a multi-week tracking of work\"),\n\t\tIsEnabled:   true,\n\t\tColor:       Ptr(\"green\"),\n\t\tIsPrivate:   Ptr(true),\n\t}\n\n\tmux.HandleFunc(\"/orgs/o/issue-types/410\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *CreateOrUpdateIssueTypesOptions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\n\t\t\t\t\"id\": 410,\n\t\t\t\t\"node_id\": \"IT_kwDNAd3NAZo\",\n\t\t\t\t\"name\": \"Epic\",\n\t\t\t\t\"description\": \"An issue type for a multi-week tracking of work\",\n\t\t\t\t\"created_at\": \"2024-12-11T14:39:09Z\",\n\t\t\t\t\"updated_at\": \"2024-12-11T14:39:09Z\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tissueType, _, err := client.Organizations.UpdateIssueType(ctx, \"o\", 410, input)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.UpdateIssueType returned error: %v\", err)\n\t}\n\twant := &IssueType{\n\t\tID:          Ptr(int64(410)),\n\t\tNodeID:      Ptr(\"IT_kwDNAd3NAZo\"),\n\t\tName:        Ptr(\"Epic\"),\n\t\tDescription: Ptr(\"An issue type for a multi-week tracking of work\"),\n\t\tCreatedAt:   Ptr(Timestamp{time.Date(2024, 12, 11, 14, 39, 9, 0, time.UTC)}),\n\t\tUpdatedAt:   Ptr(Timestamp{time.Date(2024, 12, 11, 14, 39, 9, 0, time.UTC)}),\n\t}\n\n\tif !cmp.Equal(issueType, want) {\n\t\tt.Errorf(\"Organizations.UpdateIssueType returned %+v, want %+v\", issueType, want)\n\t}\n\n\tconst methodName = \"UpdateIssueType\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.UpdateIssueType(ctx, \"\\n\", -1, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.UpdateIssueType(ctx, \"o\", 410, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_DeleteIssueType(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/issue-types/410\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Organizations.DeleteIssueType(ctx, \"o\", 410)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.DeleteIssueType returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteIssueType\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Organizations.DeleteIssueType(ctx, \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.DeleteIssueType(ctx, \"o\", 410)\n\t})\n}\n"
  },
  {
    "path": "github/orgs_members.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// Membership represents the status of a user's membership in an organization or team.\ntype Membership struct {\n\tURL *string `json:\"url,omitempty\"`\n\n\t// State is the user's status within the organization or team.\n\t// Possible values are: \"active\", \"pending\"\n\tState *string `json:\"state,omitempty\"`\n\n\t// Role identifies the user's role within the organization or team.\n\t// Possible values for organization membership:\n\t//     member - non-owner organization member\n\t//     admin - organization owner\n\t//\n\t// Possible values for team membership are:\n\t//     member - a normal member of the team\n\t//     maintainer - a team maintainer. Able to add/remove other team\n\t//                  members, promote other team members to team\n\t//                  maintainer, and edit the team’s name and description\n\tRole *string `json:\"role,omitempty\"`\n\n\t// For organization membership, the API URL of the organization.\n\tOrganizationURL *string `json:\"organization_url,omitempty\"`\n\n\t// For organization membership, the organization the membership is for.\n\tOrganization *Organization `json:\"organization,omitempty\"`\n\n\t// For organization membership, the user the membership is for.\n\tUser *User `json:\"user,omitempty\"`\n}\n\nfunc (m Membership) String() string {\n\treturn Stringify(m)\n}\n\n// ListMembersOptions specifies optional parameters to the\n// OrganizationsService.ListMembers method.\ntype ListMembersOptions struct {\n\t// If true (or if the authenticated user is not an owner of the\n\t// organization), list only publicly visible members.\n\tPublicOnly bool `url:\"-\"`\n\n\t// Filter members returned in the list. Possible values are:\n\t// 2fa_disabled, all. Default is \"all\".\n\tFilter string `url:\"filter,omitempty\"`\n\n\t// Role filters members returned by their role in the organization.\n\t// Possible values are:\n\t//     all - all members of the organization, regardless of role\n\t//     admin - organization owners\n\t//     member - non-owner organization members\n\t//\n\t// Default is \"all\".\n\tRole string `url:\"role,omitempty\"`\n\n\tListOptions\n}\n\n// ListMembers lists the members for an organization. If the authenticated\n// user is an owner of the organization, this will return both concealed and\n// public members; otherwise, it will only return public members.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/members#list-organization-members\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/members#list-public-organization-members\n//\n//meta:operation GET /orgs/{org}/members\n//meta:operation GET /orgs/{org}/public_members\nfunc (s *OrganizationsService) ListMembers(ctx context.Context, org string, opts *ListMembersOptions) ([]*User, *Response, error) {\n\tvar u string\n\tif opts != nil && opts.PublicOnly {\n\t\tu = fmt.Sprintf(\"orgs/%v/public_members\", org)\n\t} else {\n\t\tu = fmt.Sprintf(\"orgs/%v/members\", org)\n\t}\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar members []*User\n\tresp, err := s.client.Do(ctx, req, &members)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn members, resp, nil\n}\n\n// IsMember checks if a user is a member of an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/members#check-organization-membership-for-a-user\n//\n//meta:operation GET /orgs/{org}/members/{username}\nfunc (s *OrganizationsService) IsMember(ctx context.Context, org, user string) (bool, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/members/%v\", org, user)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn false, nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tmember, err := parseBoolResponse(err)\n\treturn member, resp, err\n}\n\n// IsPublicMember checks if a user is a public member of an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/members#check-public-organization-membership-for-a-user\n//\n//meta:operation GET /orgs/{org}/public_members/{username}\nfunc (s *OrganizationsService) IsPublicMember(ctx context.Context, org, user string) (bool, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/public_members/%v\", org, user)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn false, nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tmember, err := parseBoolResponse(err)\n\treturn member, resp, err\n}\n\n// RemoveMember removes a user from all teams of an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/members#remove-an-organization-member\n//\n//meta:operation DELETE /orgs/{org}/members/{username}\nfunc (s *OrganizationsService) RemoveMember(ctx context.Context, org, user string) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/members/%v\", org, user)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// CancelInvite cancels an organization invitation.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/members#cancel-an-organization-invitation\n//\n//meta:operation DELETE /orgs/{org}/invitations/{invitation_id}\nfunc (s *OrganizationsService) CancelInvite(ctx context.Context, org string, invitationID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/invitations/%v\", org, invitationID)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// PublicizeMembership publicizes a user's membership in an organization. (A\n// user cannot publicize the membership for another user.)\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/members#set-public-organization-membership-for-the-authenticated-user\n//\n//meta:operation PUT /orgs/{org}/public_members/{username}\nfunc (s *OrganizationsService) PublicizeMembership(ctx context.Context, org, user string) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/public_members/%v\", org, user)\n\treq, err := s.client.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// ConcealMembership conceals a user's membership in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/members#remove-public-organization-membership-for-the-authenticated-user\n//\n//meta:operation DELETE /orgs/{org}/public_members/{username}\nfunc (s *OrganizationsService) ConcealMembership(ctx context.Context, org, user string) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/public_members/%v\", org, user)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// ListOrgMembershipsOptions specifies optional parameters to the\n// OrganizationsService.ListOrgMemberships method.\ntype ListOrgMembershipsOptions struct {\n\t// Filter memberships to include only those with the specified state.\n\t// Possible values are: \"active\", \"pending\".\n\tState string `url:\"state,omitempty\"`\n\n\tListOptions\n}\n\n// ListOrgMemberships lists the organization memberships for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/members#list-organization-memberships-for-the-authenticated-user\n//\n//meta:operation GET /user/memberships/orgs\nfunc (s *OrganizationsService) ListOrgMemberships(ctx context.Context, opts *ListOrgMembershipsOptions) ([]*Membership, *Response, error) {\n\tu := \"user/memberships/orgs\"\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar memberships []*Membership\n\tresp, err := s.client.Do(ctx, req, &memberships)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn memberships, resp, nil\n}\n\n// GetOrgMembership gets the membership for a user in a specified organization.\n// Passing an empty string for user will get the membership for the\n// authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user\n//\n//meta:operation GET /orgs/{org}/memberships/{username}\n//meta:operation GET /user/memberships/orgs/{org}\nfunc (s *OrganizationsService) GetOrgMembership(ctx context.Context, user, org string) (*Membership, *Response, error) {\n\tvar u string\n\tif user != \"\" {\n\t\tu = fmt.Sprintf(\"orgs/%v/memberships/%v\", org, user)\n\t} else {\n\t\tu = fmt.Sprintf(\"user/memberships/orgs/%v\", org)\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar membership *Membership\n\tresp, err := s.client.Do(ctx, req, &membership)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn membership, resp, nil\n}\n\n// EditOrgMembership edits the membership for user in specified organization.\n// Passing an empty string for user will edit the membership for the\n// authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/members#set-organization-membership-for-a-user\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/members#update-an-organization-membership-for-the-authenticated-user\n//\n//meta:operation PUT /orgs/{org}/memberships/{username}\n//meta:operation PATCH /user/memberships/orgs/{org}\nfunc (s *OrganizationsService) EditOrgMembership(ctx context.Context, user, org string, membership *Membership) (*Membership, *Response, error) {\n\tvar u, method string\n\tif user != \"\" {\n\t\tu = fmt.Sprintf(\"orgs/%v/memberships/%v\", org, user)\n\t\tmethod = \"PUT\"\n\t} else {\n\t\tu = fmt.Sprintf(\"user/memberships/orgs/%v\", org)\n\t\tmethod = \"PATCH\"\n\t}\n\n\treq, err := s.client.NewRequest(method, u, membership)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar m *Membership\n\tresp, err := s.client.Do(ctx, req, &m)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn m, resp, nil\n}\n\n// RemoveOrgMembership removes user from the specified organization. If the\n// user has been invited to the organization, this will cancel their invitation.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/members#remove-organization-membership-for-a-user\n//\n//meta:operation DELETE /orgs/{org}/memberships/{username}\nfunc (s *OrganizationsService) RemoveOrgMembership(ctx context.Context, user, org string) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/memberships/%v\", org, user)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// ListPendingOrgInvitations returns a list of pending invitations.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/members#list-pending-organization-invitations\n//\n//meta:operation GET /orgs/{org}/invitations\nfunc (s *OrganizationsService) ListPendingOrgInvitations(ctx context.Context, org string, opts *ListOptions) ([]*Invitation, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/invitations\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar pendingInvitations []*Invitation\n\tresp, err := s.client.Do(ctx, req, &pendingInvitations)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn pendingInvitations, resp, nil\n}\n\n// CreateOrgInvitationOptions specifies the parameters to the OrganizationService.Invite\n// method.\ntype CreateOrgInvitationOptions struct {\n\t// GitHub user ID for the person you are inviting. Not required if you provide Email.\n\tInviteeID *int64 `json:\"invitee_id,omitempty\"`\n\t// Email address of the person you are inviting, which can be an existing GitHub user.\n\t// Not required if you provide InviteeID\n\tEmail *string `json:\"email,omitempty\"`\n\t// Specify role for new member. Can be one of:\n\t// * admin - Organization owners with full administrative rights to the\n\t// \t organization and complete access to all repositories and teams.\n\t// * direct_member - Non-owner organization members with ability to see\n\t//   other members and join teams by invitation.\n\t// * billing_manager - Non-owner organization members with ability to\n\t//   manage the billing settings of your organization.\n\t// Default is \"direct_member\".\n\tRole   *string `json:\"role,omitempty\"`\n\tTeamID []int64 `json:\"team_ids,omitempty\"`\n}\n\n// CreateOrgInvitation invites people to an organization by using their GitHub user ID or their email address.\n// In order to create invitations in an organization,\n// the authenticated user must be an organization owner.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/members#create-an-organization-invitation\n//\n//meta:operation POST /orgs/{org}/invitations\nfunc (s *OrganizationsService) CreateOrgInvitation(ctx context.Context, org string, opts *CreateOrgInvitationOptions) (*Invitation, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/invitations\", org)\n\n\treq, err := s.client.NewRequest(\"POST\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar invitation *Invitation\n\tresp, err := s.client.Do(ctx, req, &invitation)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn invitation, resp, nil\n}\n\n// ListOrgInvitationTeams lists all teams associated with an invitation. In order to see invitations in an organization,\n// the authenticated user must be an organization owner.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/members#list-organization-invitation-teams\n//\n//meta:operation GET /orgs/{org}/invitations/{invitation_id}/teams\nfunc (s *OrganizationsService) ListOrgInvitationTeams(ctx context.Context, org, invitationID string, opts *ListOptions) ([]*Team, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/invitations/%v/teams\", org, invitationID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar orgInvitationTeams []*Team\n\tresp, err := s.client.Do(ctx, req, &orgInvitationTeams)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn orgInvitationTeams, resp, nil\n}\n\n// ListFailedOrgInvitations returns a list of failed invitations.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/members#list-failed-organization-invitations\n//\n//meta:operation GET /orgs/{org}/failed_invitations\nfunc (s *OrganizationsService) ListFailedOrgInvitations(ctx context.Context, org string, opts *ListOptions) ([]*Invitation, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/failed_invitations\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar failedInvitations []*Invitation\n\tresp, err := s.client.Do(ctx, req, &failedInvitations)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn failedInvitations, resp, nil\n}\n"
  },
  {
    "path": "github/orgs_members_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestOrganizationsService_ListMembers(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/members\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"filter\": \"2fa_disabled\",\n\t\t\t\"role\":   \"admin\",\n\t\t\t\"page\":   \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &ListMembersOptions{\n\t\tPublicOnly:  false,\n\t\tFilter:      \"2fa_disabled\",\n\t\tRole:        \"admin\",\n\t\tListOptions: ListOptions{Page: 2},\n\t}\n\tctx := t.Context()\n\tmembers, _, err := client.Organizations.ListMembers(ctx, \"o\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListMembers returned error: %v\", err)\n\t}\n\n\twant := []*User{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(members, want) {\n\t\tt.Errorf(\"Organizations.ListMembers returned %+v, want %+v\", members, want)\n\t}\n\n\tconst methodName = \"ListMembers\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListMembers(ctx, \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListMembers(ctx, \"o\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_ListMembers_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Organizations.ListMembers(ctx, \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestOrganizationsService_ListMembers_public(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/public_members\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &ListMembersOptions{PublicOnly: true}\n\tctx := t.Context()\n\tmembers, _, err := client.Organizations.ListMembers(ctx, \"o\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListMembers returned error: %v\", err)\n\t}\n\n\twant := []*User{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(members, want) {\n\t\tt.Errorf(\"Organizations.ListMembers returned %+v, want %+v\", members, want)\n\t}\n}\n\nfunc TestOrganizationsService_IsMember(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/members/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tmember, _, err := client.Organizations.IsMember(ctx, \"o\", \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.IsMember returned error: %v\", err)\n\t}\n\tif want := true; member != want {\n\t\tt.Errorf(\"Organizations.IsMember returned %+v, want %+v\", member, want)\n\t}\n\n\tconst methodName = \"IsMember\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.IsMember(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.IsMember(ctx, \"o\", \"u\")\n\t\tif got {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\n// Ensure that a 404 response is interpreted as \"false\" and not an error.\nfunc TestOrganizationsService_IsMember_notMember(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/members/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tmember, _, err := client.Organizations.IsMember(ctx, \"o\", \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.IsMember returned error: %+v\", err)\n\t}\n\tif want := false; member != want {\n\t\tt.Errorf(\"Organizations.IsMember returned %+v, want %+v\", member, want)\n\t}\n}\n\n// Ensure that a 400 response is interpreted as an actual error, and not simply\n// as \"false\" like the above case of a 404.\nfunc TestOrganizationsService_IsMember_error(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/members/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\thttp.Error(w, \"BadRequest\", http.StatusBadRequest)\n\t})\n\n\tctx := t.Context()\n\tmember, _, err := client.Organizations.IsMember(ctx, \"o\", \"u\")\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 400 response\")\n\t}\n\tif want := false; member != want {\n\t\tt.Errorf(\"Organizations.IsMember returned %+v, want %+v\", member, want)\n\t}\n}\n\nfunc TestOrganizationsService_IsMember_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Organizations.IsMember(ctx, \"%\", \"u\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestOrganizationsService_IsPublicMember(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/public_members/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tmember, _, err := client.Organizations.IsPublicMember(ctx, \"o\", \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.IsPublicMember returned error: %v\", err)\n\t}\n\tif want := true; member != want {\n\t\tt.Errorf(\"Organizations.IsPublicMember returned %+v, want %+v\", member, want)\n\t}\n\n\tconst methodName = \"IsPublicMember\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.IsPublicMember(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.IsPublicMember(ctx, \"o\", \"u\")\n\t\tif got {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\n// Ensure that a 404 response is interpreted as \"false\" and not an error.\nfunc TestOrganizationsService_IsPublicMember_notMember(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/public_members/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tmember, _, err := client.Organizations.IsPublicMember(ctx, \"o\", \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.IsPublicMember returned error: %v\", err)\n\t}\n\tif want := false; member != want {\n\t\tt.Errorf(\"Organizations.IsPublicMember returned %+v, want %+v\", member, want)\n\t}\n}\n\n// Ensure that a 400 response is interpreted as an actual error, and not simply\n// as \"false\" like the above case of a 404.\nfunc TestOrganizationsService_IsPublicMember_error(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/public_members/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\thttp.Error(w, \"BadRequest\", http.StatusBadRequest)\n\t})\n\n\tctx := t.Context()\n\tmember, _, err := client.Organizations.IsPublicMember(ctx, \"o\", \"u\")\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 400 response\")\n\t}\n\tif want := false; member != want {\n\t\tt.Errorf(\"Organizations.IsPublicMember returned %+v, want %+v\", member, want)\n\t}\n}\n\nfunc TestOrganizationsService_IsPublicMember_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Organizations.IsPublicMember(ctx, \"%\", \"u\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestOrganizationsService_RemoveMember(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/members/u\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Organizations.RemoveMember(ctx, \"o\", \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.RemoveMember returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveMember\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Organizations.RemoveMember(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.RemoveMember(ctx, \"o\", \"u\")\n\t})\n}\n\nfunc TestOrganizationsService_CancelInvite(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/invitations/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Organizations.CancelInvite(ctx, \"o\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.CancelInvite returned error: %v\", err)\n\t}\n\n\tconst methodName = \"CancelInvite\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Organizations.CancelInvite(ctx, \"\\n\", 1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.CancelInvite(ctx, \"o\", 1)\n\t})\n}\n\nfunc TestOrganizationsService_RemoveMember_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Organizations.RemoveMember(ctx, \"%\", \"u\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestOrganizationsService_PublicizeMembership(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/public_members/u\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Organizations.PublicizeMembership(ctx, \"o\", \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.PublicizeMembership returned error: %v\", err)\n\t}\n\n\tconst methodName = \"PublicizeMembership\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Organizations.PublicizeMembership(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.PublicizeMembership(ctx, \"o\", \"u\")\n\t})\n}\n\nfunc TestOrganizationsService_ConcealMembership(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/public_members/u\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Organizations.ConcealMembership(ctx, \"o\", \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ConcealMembership returned error: %v\", err)\n\t}\n\n\tconst methodName = \"ConcealMembership\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Organizations.ConcealMembership(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.ConcealMembership(ctx, \"o\", \"u\")\n\t})\n}\n\nfunc TestOrganizationsService_ListOrgMemberships(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/memberships/orgs\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"state\": \"active\",\n\t\t\t\"page\":  \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"url\":\"u\"}]`)\n\t})\n\n\topt := &ListOrgMembershipsOptions{\n\t\tState:       \"active\",\n\t\tListOptions: ListOptions{Page: 2},\n\t}\n\tctx := t.Context()\n\tmemberships, _, err := client.Organizations.ListOrgMemberships(ctx, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListOrgMemberships returned error: %v\", err)\n\t}\n\n\twant := []*Membership{{URL: Ptr(\"u\")}}\n\tif !cmp.Equal(memberships, want) {\n\t\tt.Errorf(\"Organizations.ListOrgMemberships returned %+v, want %+v\", memberships, want)\n\t}\n\n\tconst methodName = \"ListOrgMemberships\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListOrgMemberships(ctx, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_GetOrgMembership_AuthenticatedUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/memberships/orgs/o\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"url\":\"u\"}`)\n\t})\n\n\tctx := t.Context()\n\tmembership, _, err := client.Organizations.GetOrgMembership(ctx, \"\", \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.GetOrgMembership returned error: %v\", err)\n\t}\n\n\twant := &Membership{URL: Ptr(\"u\")}\n\tif !cmp.Equal(membership, want) {\n\t\tt.Errorf(\"Organizations.GetOrgMembership returned %+v, want %+v\", membership, want)\n\t}\n\n\tconst methodName = \"GetOrgMembership\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.GetOrgMembership(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.GetOrgMembership(ctx, \"\", \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_GetOrgMembership_SpecifiedUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/memberships/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"url\":\"u\"}`)\n\t})\n\n\tctx := t.Context()\n\tmembership, _, err := client.Organizations.GetOrgMembership(ctx, \"u\", \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.GetOrgMembership returned error: %v\", err)\n\t}\n\n\twant := &Membership{URL: Ptr(\"u\")}\n\tif !cmp.Equal(membership, want) {\n\t\tt.Errorf(\"Organizations.GetOrgMembership returned %+v, want %+v\", membership, want)\n\t}\n}\n\nfunc TestOrganizationsService_EditOrgMembership_AuthenticatedUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &Membership{State: Ptr(\"active\")}\n\n\tmux.HandleFunc(\"/user/memberships/orgs/o\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *Membership\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"url\":\"u\"}`)\n\t})\n\n\tctx := t.Context()\n\tmembership, _, err := client.Organizations.EditOrgMembership(ctx, \"\", \"o\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.EditOrgMembership returned error: %v\", err)\n\t}\n\n\twant := &Membership{URL: Ptr(\"u\")}\n\tif !cmp.Equal(membership, want) {\n\t\tt.Errorf(\"Organizations.EditOrgMembership returned %+v, want %+v\", membership, want)\n\t}\n\n\tconst methodName = \"EditOrgMembership\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.EditOrgMembership(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.EditOrgMembership(ctx, \"\", \"o\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_EditOrgMembership_SpecifiedUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &Membership{State: Ptr(\"active\")}\n\n\tmux.HandleFunc(\"/orgs/o/memberships/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *Membership\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"url\":\"u\"}`)\n\t})\n\n\tctx := t.Context()\n\tmembership, _, err := client.Organizations.EditOrgMembership(ctx, \"u\", \"o\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.EditOrgMembership returned error: %v\", err)\n\t}\n\n\twant := &Membership{URL: Ptr(\"u\")}\n\tif !cmp.Equal(membership, want) {\n\t\tt.Errorf(\"Organizations.EditOrgMembership returned %+v, want %+v\", membership, want)\n\t}\n}\n\nfunc TestOrganizationsService_RemoveOrgMembership(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/memberships/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Organizations.RemoveOrgMembership(ctx, \"u\", \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.RemoveOrgMembership returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveOrgMembership\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Organizations.RemoveOrgMembership(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.RemoveOrgMembership(ctx, \"u\", \"o\")\n\t})\n}\n\nfunc TestOrganizationsService_ListPendingOrgInvitations(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/invitations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"1\"})\n\t\tfmt.Fprint(w, `[\n\t\t\t\t{\n    \t\t\t\t\t\"id\": 1,\n    \t\t\t\t\t\"login\": \"monalisa\",\n    \t\t\t\t\t\"email\": \"octocat@github.com\",\n    \t\t\t\t\t\"role\": \"direct_member\",\n\t\t\t\t\t\"created_at\": \"2017-01-21T00:00:00Z\",\n    \t\t\t\t\t\"inviter\": {\n      \t\t\t\t\t\t\"login\": \"other_user\",\n      \t\t\t\t\t\t\"id\": 1,\n      \t\t\t\t\t\t\"avatar_url\": \"https://github.com/images/error/other_user_happy.gif\",\n      \t\t\t\t\t\t\"gravatar_id\": \"\",\n      \t\t\t\t\t\t\"url\": \"https://api.github.com/users/other_user\",\n      \t\t\t\t\t\t\"html_url\": \"https://github.com/other_user\",\n      \t\t\t\t\t\t\"followers_url\": \"https://api.github.com/users/other_user/followers\",\n      \t\t\t\t\t\t\"following_url\": \"https://api.github.com/users/other_user/following/other_user\",\n      \t\t\t\t\t\t\"gists_url\": \"https://api.github.com/users/other_user/gists/gist_id\",\n      \t\t\t\t\t\t\"starred_url\": \"https://api.github.com/users/other_user/starred/owner/repo\",\n      \t\t\t\t\t\t\"subscriptions_url\": \"https://api.github.com/users/other_user/subscriptions\",\n      \t\t\t\t\t\t\"organizations_url\": \"https://api.github.com/users/other_user/orgs\",\n      \t\t\t\t\t\t\"repos_url\": \"https://api.github.com/users/other_user/repos\",\n      \t\t\t\t\t\t\"events_url\": \"https://api.github.com/users/other_user/events/privacy\",\n      \t\t\t\t\t\t\"received_events_url\": \"https://api.github.com/users/other_user/received_events/privacy\",\n      \t\t\t\t\t\t\"type\": \"User\",\n      \t\t\t\t\t\t\"site_admin\": false\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"team_count\": 2,\n\t\t\t\t\t\t\"invitation_team_url\": \"https://api.github.com/organizations/2/invitations/1/teams\"\n  \t\t\t\t}\n\t\t\t]`)\n\t})\n\n\topt := &ListOptions{Page: 1}\n\tctx := t.Context()\n\tinvitations, _, err := client.Organizations.ListPendingOrgInvitations(ctx, \"o\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListPendingOrgInvitations returned error: %v\", err)\n\t}\n\n\tcreatedAt := time.Date(2017, time.January, 21, 0, 0, 0, 0, time.UTC)\n\twant := []*Invitation{\n\t\t{\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tLogin:     Ptr(\"monalisa\"),\n\t\t\tEmail:     Ptr(\"octocat@github.com\"),\n\t\t\tRole:      Ptr(\"direct_member\"),\n\t\t\tCreatedAt: &Timestamp{createdAt},\n\t\t\tInviter: &User{\n\t\t\t\tLogin:             Ptr(\"other_user\"),\n\t\t\t\tID:                Ptr(int64(1)),\n\t\t\t\tAvatarURL:         Ptr(\"https://github.com/images/error/other_user_happy.gif\"),\n\t\t\t\tGravatarID:        Ptr(\"\"),\n\t\t\t\tURL:               Ptr(\"https://api.github.com/users/other_user\"),\n\t\t\t\tHTMLURL:           Ptr(\"https://github.com/other_user\"),\n\t\t\t\tFollowersURL:      Ptr(\"https://api.github.com/users/other_user/followers\"),\n\t\t\t\tFollowingURL:      Ptr(\"https://api.github.com/users/other_user/following/other_user\"),\n\t\t\t\tGistsURL:          Ptr(\"https://api.github.com/users/other_user/gists/gist_id\"),\n\t\t\t\tStarredURL:        Ptr(\"https://api.github.com/users/other_user/starred/owner/repo\"),\n\t\t\t\tSubscriptionsURL:  Ptr(\"https://api.github.com/users/other_user/subscriptions\"),\n\t\t\t\tOrganizationsURL:  Ptr(\"https://api.github.com/users/other_user/orgs\"),\n\t\t\t\tReposURL:          Ptr(\"https://api.github.com/users/other_user/repos\"),\n\t\t\t\tEventsURL:         Ptr(\"https://api.github.com/users/other_user/events/privacy\"),\n\t\t\t\tReceivedEventsURL: Ptr(\"https://api.github.com/users/other_user/received_events/privacy\"),\n\t\t\t\tType:              Ptr(\"User\"),\n\t\t\t\tSiteAdmin:         Ptr(false),\n\t\t\t},\n\t\t\tTeamCount:         Ptr(2),\n\t\t\tInvitationTeamURL: Ptr(\"https://api.github.com/organizations/2/invitations/1/teams\"),\n\t\t},\n\t}\n\n\tif !cmp.Equal(invitations, want) {\n\t\tt.Errorf(\"Organizations.ListPendingOrgInvitations returned %+v, want %+v\", invitations, want)\n\t}\n\n\tconst methodName = \"ListPendingOrgInvitations\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListPendingOrgInvitations(ctx, \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListPendingOrgInvitations(ctx, \"o\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_CreateOrgInvitation(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &CreateOrgInvitationOptions{\n\t\tEmail: Ptr(\"octocat@github.com\"),\n\t\tRole:  Ptr(\"direct_member\"),\n\t\tTeamID: []int64{\n\t\t\t12,\n\t\t\t26,\n\t\t},\n\t}\n\n\tmux.HandleFunc(\"/orgs/o/invitations\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *CreateOrgInvitationOptions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprintln(w, `{\"email\": \"octocat@github.com\"}`)\n\t})\n\n\tctx := t.Context()\n\tinvitations, _, err := client.Organizations.CreateOrgInvitation(ctx, \"o\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.CreateOrgInvitation returned error: %v\", err)\n\t}\n\n\twant := &Invitation{Email: Ptr(\"octocat@github.com\")}\n\tif !cmp.Equal(invitations, want) {\n\t\tt.Errorf(\"Organizations.ListPendingOrgInvitations returned %+v, want %+v\", invitations, want)\n\t}\n\n\tconst methodName = \"CreateOrgInvitation\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.CreateOrgInvitation(ctx, \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.CreateOrgInvitation(ctx, \"o\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_ListOrgInvitationTeams(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/invitations/22/teams\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"1\"})\n\t\tfmt.Fprint(w, `[\n\t\t\t{\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"url\": \"https://api.github.com/teams/1\",\n\t\t\t\t\"name\": \"Justice League\",\n\t\t\t\t\"slug\": \"justice-league\",\n\t\t\t\t\"description\": \"A great team.\",\n\t\t\t\t\"privacy\": \"closed\",\n\t\t\t\t\"permission\": \"admin\",\n\t\t\t\t\"members_url\": \"https://api.github.com/teams/1/members{/member}\",\n\t\t\t\t\"repositories_url\": \"https://api.github.com/teams/1/repos\"\n\t\t\t  }\n\t\t\t]`)\n\t})\n\n\topt := &ListOptions{Page: 1}\n\tctx := t.Context()\n\tinvitations, _, err := client.Organizations.ListOrgInvitationTeams(ctx, \"o\", \"22\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListOrgInvitationTeams returned error: %v\", err)\n\t}\n\n\twant := []*Team{\n\t\t{\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"https://api.github.com/teams/1\"),\n\t\t\tName:            Ptr(\"Justice League\"),\n\t\t\tSlug:            Ptr(\"justice-league\"),\n\t\t\tDescription:     Ptr(\"A great team.\"),\n\t\t\tPrivacy:         Ptr(\"closed\"),\n\t\t\tPermission:      Ptr(\"admin\"),\n\t\t\tMembersURL:      Ptr(\"https://api.github.com/teams/1/members{/member}\"),\n\t\t\tRepositoriesURL: Ptr(\"https://api.github.com/teams/1/repos\"),\n\t\t},\n\t}\n\n\tif !cmp.Equal(invitations, want) {\n\t\tt.Errorf(\"Organizations.ListOrgInvitationTeams returned %+v, want %+v\", invitations, want)\n\t}\n\n\tconst methodName = \"ListOrgInvitationTeams\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListOrgInvitationTeams(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListOrgInvitationTeams(ctx, \"o\", \"22\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_ListFailedOrgInvitations(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/failed_invitations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\", \"per_page\": \"1\"})\n\t\tfmt.Fprint(w, `[\n\t\t\t{\n\t\t\t   \"id\":1,\n\t\t\t   \"login\":\"monalisa\",\n\t\t\t   \"node_id\":\"MDQ6VXNlcjE=\",\n\t\t\t   \"email\":\"octocat@github.com\",\n\t\t\t   \"role\":\"direct_member\",\n\t\t\t   \"created_at\":\"2016-11-30T06:46:10Z\",\n\t\t\t   \"failed_at\":\"2017-01-02T01:10:00Z\",\n\t\t\t   \"failed_reason\":\"the reason\",\n\t\t\t   \"inviter\":{\n\t\t\t\t  \"login\":\"other_user\",\n\t\t\t\t  \"id\":1,\n\t\t\t\t  \"node_id\":\"MDQ6VXNlcjE=\",\n\t\t\t\t  \"avatar_url\":\"https://github.com/images/error/other_user_happy.gif\",\n\t\t\t\t  \"gravatar_id\":\"\",\n\t\t\t\t  \"url\":\"https://api.github.com/users/other_user\",\n\t\t\t\t  \"html_url\":\"https://github.com/other_user\",\n\t\t\t\t  \"followers_url\":\"https://api.github.com/users/other_user/followers\",\n\t\t\t\t  \"following_url\":\"https://api.github.com/users/other_user/following{/other_user}\",\n\t\t\t\t  \"gists_url\":\"https://api.github.com/users/other_user/gists{/gist_id}\",\n\t\t\t\t  \"starred_url\":\"https://api.github.com/users/other_user/starred{/owner}{/repo}\",\n\t\t\t\t  \"subscriptions_url\":\"https://api.github.com/users/other_user/subscriptions\",\n\t\t\t\t  \"organizations_url\":\"https://api.github.com/users/other_user/orgs\",\n\t\t\t\t  \"repos_url\":\"https://api.github.com/users/other_user/repos\",\n\t\t\t\t  \"events_url\":\"https://api.github.com/users/other_user/events{/privacy}\",\n\t\t\t\t  \"received_events_url\":\"https://api.github.com/users/other_user/received_events\",\n\t\t\t\t  \"type\":\"User\",\n\t\t\t\t  \"site_admin\":false\n\t\t\t   },\n\t\t\t   \"team_count\":2,\n\t\t\t   \"invitation_team_url\":\"https://api.github.com/organizations/2/invitations/1/teams\"\n\t\t\t}\n\t\t]`)\n\t})\n\n\topts := &ListOptions{Page: 2, PerPage: 1}\n\tctx := t.Context()\n\tfailedInvitations, _, err := client.Organizations.ListFailedOrgInvitations(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListFailedOrgInvitations returned error: %v\", err)\n\t}\n\n\tcreatedAt := time.Date(2016, time.November, 30, 6, 46, 10, 0, time.UTC)\n\twant := []*Invitation{\n\t\t{\n\t\t\tID:           Ptr(int64(1)),\n\t\t\tLogin:        Ptr(\"monalisa\"),\n\t\t\tNodeID:       Ptr(\"MDQ6VXNlcjE=\"),\n\t\t\tEmail:        Ptr(\"octocat@github.com\"),\n\t\t\tRole:         Ptr(\"direct_member\"),\n\t\t\tFailedAt:     &Timestamp{time.Date(2017, time.January, 2, 1, 10, 0, 0, time.UTC)},\n\t\t\tFailedReason: Ptr(\"the reason\"),\n\t\t\tCreatedAt:    &Timestamp{createdAt},\n\t\t\tInviter: &User{\n\t\t\t\tLogin:             Ptr(\"other_user\"),\n\t\t\t\tID:                Ptr(int64(1)),\n\t\t\t\tNodeID:            Ptr(\"MDQ6VXNlcjE=\"),\n\t\t\t\tAvatarURL:         Ptr(\"https://github.com/images/error/other_user_happy.gif\"),\n\t\t\t\tGravatarID:        Ptr(\"\"),\n\t\t\t\tURL:               Ptr(\"https://api.github.com/users/other_user\"),\n\t\t\t\tHTMLURL:           Ptr(\"https://github.com/other_user\"),\n\t\t\t\tFollowersURL:      Ptr(\"https://api.github.com/users/other_user/followers\"),\n\t\t\t\tFollowingURL:      Ptr(\"https://api.github.com/users/other_user/following{/other_user}\"),\n\t\t\t\tGistsURL:          Ptr(\"https://api.github.com/users/other_user/gists{/gist_id}\"),\n\t\t\t\tStarredURL:        Ptr(\"https://api.github.com/users/other_user/starred{/owner}{/repo}\"),\n\t\t\t\tSubscriptionsURL:  Ptr(\"https://api.github.com/users/other_user/subscriptions\"),\n\t\t\t\tOrganizationsURL:  Ptr(\"https://api.github.com/users/other_user/orgs\"),\n\t\t\t\tReposURL:          Ptr(\"https://api.github.com/users/other_user/repos\"),\n\t\t\t\tEventsURL:         Ptr(\"https://api.github.com/users/other_user/events{/privacy}\"),\n\t\t\t\tReceivedEventsURL: Ptr(\"https://api.github.com/users/other_user/received_events\"),\n\t\t\t\tType:              Ptr(\"User\"),\n\t\t\t\tSiteAdmin:         Ptr(false),\n\t\t\t},\n\t\t\tTeamCount:         Ptr(2),\n\t\t\tInvitationTeamURL: Ptr(\"https://api.github.com/organizations/2/invitations/1/teams\"),\n\t\t},\n\t}\n\n\tif !cmp.Equal(failedInvitations, want) {\n\t\tt.Errorf(\"Organizations.ListFailedOrgInvitations returned %+v, want %+v\", failedInvitations, want)\n\t}\n\n\tconst methodName = \"ListFailedOrgInvitations\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err := client.Organizations.ListFailedOrgInvitations(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListFailedOrgInvitations(ctx, \"o\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestMembership_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Membership{}, \"{}\")\n\n\tu := &Membership{\n\t\tURL:             Ptr(\"url\"),\n\t\tState:           Ptr(\"state\"),\n\t\tRole:            Ptr(\"email\"),\n\t\tOrganizationURL: Ptr(\"orgurl\"),\n\t\tOrganization: &Organization{\n\t\t\tBillingEmail:                         Ptr(\"be\"),\n\t\t\tBlog:                                 Ptr(\"b\"),\n\t\t\tCompany:                              Ptr(\"c\"),\n\t\t\tEmail:                                Ptr(\"e\"),\n\t\t\tTwitterUsername:                      Ptr(\"tu\"),\n\t\t\tLocation:                             Ptr(\"loc\"),\n\t\t\tName:                                 Ptr(\"n\"),\n\t\t\tDescription:                          Ptr(\"d\"),\n\t\t\tIsVerified:                           Ptr(true),\n\t\t\tHasOrganizationProjects:              Ptr(true),\n\t\t\tHasRepositoryProjects:                Ptr(true),\n\t\t\tDefaultRepoPermission:                Ptr(\"drp\"),\n\t\t\tMembersCanCreateRepos:                Ptr(true),\n\t\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\t\tMembersAllowedRepositoryCreationType: Ptr(\"marct\"),\n\t\t\tMembersCanCreatePages:                Ptr(true),\n\t\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t\t},\n\t\tUser: &User{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tURL:       Ptr(\"u\"),\n\t\t\tReposURL:  Ptr(\"r\"),\n\t\t\tEventsURL: Ptr(\"e\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"url\": \"url\",\n\t\t\"state\": \"state\",\n\t\t\"role\": \"email\",\n\t\t\"organization_url\": \"orgurl\",\n\t\t\"organization\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"loc\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"billing_email\": \"be\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"drp\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"marct\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t},\n\t\t\"user\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"repos_url\": \"r\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestCreateOrgInvitationOptions_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CreateOrgInvitationOptions{}, \"{}\")\n\n\tu := &CreateOrgInvitationOptions{\n\t\tInviteeID: Ptr(int64(1)),\n\t\tEmail:     Ptr(\"email\"),\n\t\tRole:      Ptr(\"role\"),\n\t\tTeamID:    []int64{1},\n\t}\n\n\twant := `{\n\t\t\"invitee_id\": 1,\n\t\t\"email\": \"email\",\n\t\t\"role\": \"role\",\n\t\t\"team_ids\": [\n\t\t\t1\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/orgs_network_configurations.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"regexp\"\n)\n\n// ComputeService represents a hosted compute service the network configuration supports.\ntype ComputeService string\n\nconst (\n\tComputeServiceNone       ComputeService = \"none\"\n\tComputeServiceActions    ComputeService = \"actions\"\n\tComputeServiceCodespaces ComputeService = \"codespaces\"\n)\n\n// NetworkConfigurations represents a hosted compute network configuration. This type is identical\n// for enterprise and organization endpoints.\ntype NetworkConfigurations struct {\n\tTotalCount            *int64                  `json:\"total_count,omitempty\"`\n\tNetworkConfigurations []*NetworkConfiguration `json:\"network_configurations,omitempty\"`\n}\n\n// NetworkConfiguration represents a hosted compute network configurations. This type is identical\n// for enterprise and organization endpoints.\ntype NetworkConfiguration struct {\n\tID                 *string         `json:\"id,omitempty\"`\n\tName               *string         `json:\"name,omitempty\"`\n\tComputeService     *ComputeService `json:\"compute_service,omitempty\"`\n\tNetworkSettingsIDs []string        `json:\"network_settings_ids,omitempty\"`\n\tCreatedOn          *Timestamp      `json:\"created_on\"`\n}\n\n// NetworkSettingsResource represents a hosted compute network settings resource. This type is identical\n// for enterprise and organization endpoints.\ntype NetworkSettingsResource struct {\n\tID                     *string `json:\"id,omitempty\"`\n\tNetworkConfigurationID *string `json:\"network_configuration_id,omitempty\"`\n\tName                   *string `json:\"name,omitempty\"`\n\tSubnetID               *string `json:\"subnet_id,omitempty\"`\n\tRegion                 *string `json:\"region,omitempty\"`\n}\n\nfunc validateComputeService(compute *ComputeService) error {\n\tif compute == nil {\n\t\treturn nil\n\t}\n\tif *compute != ComputeServiceNone && *compute != ComputeServiceActions {\n\t\treturn errors.New(\"compute service can only be one of: none, actions\")\n\t}\n\treturn nil\n}\n\nvar validNetworkNameRE = regexp.MustCompile(`^[a-zA-Z0-9._-]+$`)\n\nfunc validateNetworkName(name string) error {\n\tif len(name) < 1 || len(name) > 100 {\n\t\treturn errors.New(\"must be between 1 and 100 characters\")\n\t}\n\tif !validNetworkNameRE.MatchString(name) {\n\t\treturn errors.New(\"may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'\")\n\t}\n\treturn nil\n}\n\nfunc validateNetworkSettingsID(settingsID []string) error {\n\tif len(settingsID) != 1 {\n\t\treturn errors.New(\"exactly one network settings id must be specified\")\n\t}\n\treturn nil\n}\n\nfunc validateNetworkConfigurationRequest(req NetworkConfigurationRequest) error {\n\tnetworkName := req.GetName()\n\tif err := validateNetworkName(networkName); err != nil {\n\t\treturn err\n\t}\n\n\tcomputeService := req.GetComputeService()\n\tif err := validateComputeService(computeService); err != nil {\n\t\treturn err\n\t}\n\n\tnetworkIDs := req.NetworkSettingsIDs\n\treturn validateNetworkSettingsID(networkIDs)\n}\n\n// NetworkConfigurationRequest represents a request to create or update a network configuration for an organization.\ntype NetworkConfigurationRequest struct {\n\tName               *string         `json:\"name,omitempty\"`\n\tComputeService     *ComputeService `json:\"compute_service,omitempty\"`\n\tNetworkSettingsIDs []string        `json:\"network_settings_ids,omitempty\"`\n}\n\n// ListNetworkConfigurations lists all hosted compute network configurations configured in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#list-hosted-compute-network-configurations-for-an-organization\n//\n//meta:operation GET /orgs/{org}/settings/network-configurations\nfunc (s *OrganizationsService) ListNetworkConfigurations(ctx context.Context, org string, opts *ListOptions) (*NetworkConfigurations, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/settings/network-configurations\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar configurations *NetworkConfigurations\n\tresp, err := s.client.Do(ctx, req, &configurations)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn configurations, resp, nil\n}\n\n// CreateNetworkConfiguration creates a hosted compute network configuration for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#create-a-hosted-compute-network-configuration-for-an-organization\n//\n//meta:operation POST /orgs/{org}/settings/network-configurations\nfunc (s *OrganizationsService) CreateNetworkConfiguration(ctx context.Context, org string, createReq NetworkConfigurationRequest) (*NetworkConfiguration, *Response, error) {\n\tif err := validateNetworkConfigurationRequest(createReq); err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"validation failed: %w\", err)\n\t}\n\n\tu := fmt.Sprintf(\"orgs/%v/settings/network-configurations\", org)\n\treq, err := s.client.NewRequest(\"POST\", u, createReq)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar configuration *NetworkConfiguration\n\tresp, err := s.client.Do(ctx, req, &configuration)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn configuration, resp, nil\n}\n\n// GetNetworkConfiguration gets a hosted compute network configuration configured in an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#get-a-hosted-compute-network-configuration-for-an-organization\n//\n//meta:operation GET /orgs/{org}/settings/network-configurations/{network_configuration_id}\nfunc (s *OrganizationsService) GetNetworkConfiguration(ctx context.Context, org, networkID string) (*NetworkConfiguration, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/settings/network-configurations/%v\", org, networkID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar configuration *NetworkConfiguration\n\tresp, err := s.client.Do(ctx, req, &configuration)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn configuration, resp, nil\n}\n\n// UpdateNetworkConfiguration updates a hosted compute network configuration for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#update-a-hosted-compute-network-configuration-for-an-organization\n//\n//meta:operation PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id}\nfunc (s *OrganizationsService) UpdateNetworkConfiguration(ctx context.Context, org, networkID string, updateReq NetworkConfigurationRequest) (*NetworkConfiguration, *Response, error) {\n\tif err := validateNetworkConfigurationRequest(updateReq); err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"validation failed: %w\", err)\n\t}\n\n\tu := fmt.Sprintf(\"orgs/%v/settings/network-configurations/%v\", org, networkID)\n\treq, err := s.client.NewRequest(\"PATCH\", u, updateReq)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar configuration *NetworkConfiguration\n\tresp, err := s.client.Do(ctx, req, &configuration)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn configuration, resp, nil\n}\n\n// DeleteNetworkConfigurations deletes a hosted compute network configuration from an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#delete-a-hosted-compute-network-configuration-from-an-organization\n//\n//meta:operation DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id}\nfunc (s *OrganizationsService) DeleteNetworkConfigurations(ctx context.Context, org, networkID string) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/settings/network-configurations/%v\", org, networkID)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar configuration *NetworkConfiguration\n\tresp, err := s.client.Do(ctx, req, &configuration)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// GetNetworkConfigurationResource gets a hosted compute network settings resource configured for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/network-configurations#get-a-hosted-compute-network-settings-resource-for-an-organization\n//\n//meta:operation GET /orgs/{org}/settings/network-settings/{network_settings_id}\nfunc (s *OrganizationsService) GetNetworkConfigurationResource(ctx context.Context, org, networkID string) (*NetworkSettingsResource, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/settings/network-settings/%v\", org, networkID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar resource *NetworkSettingsResource\n\tresp, err := s.client.Do(ctx, req, &resource)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn resource, resp, nil\n}\n"
  },
  {
    "path": "github/orgs_network_configurations_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestOrganizationsService_ListOrgsNetworkConfigurations(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/settings/network-configurations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"1\", \"per_page\": \"3\"})\n\t\tfmt.Fprint(w, `{\n\t\t  \"total_count\": 3,\n\t\t  \"network_configurations\": [\n\t\t\t{\n\t\t\t  \"id\": \"123456789ABCDEF\",\n\t\t\t  \"name\": \"Network Configuration One\",\n\t\t\t  \"compute_service\": \"actions\",\n\t\t\t  \"network_settings_ids\": [\n\t\t\t\t\"23456789ABDCEF1\",\n\t\t\t\t\"3456789ABDCEF12\"\n\t\t\t  ],\n\t\t\t  \"created_on\": \"2024-04-09T17:30:15Z\"\n\t\t\t},\n\t\t\t{\n\t\t\t  \"id\": \"456789ABDCEF123\",\n\t\t\t  \"name\": \"Network Configuration Two\",\n\t\t\t  \"compute_service\": \"none\",\n\t\t\t  \"network_settings_ids\": [\n\t\t\t\t\"56789ABDCEF1234\",\n\t\t\t\t\"6789ABDCEF12345\"\n\t\t\t  ],\n\t\t\t  \"created_on\": \"2024-11-02T4:30:30Z\"\n\t\t\t},\n\t\t\t{\n\t\t\t  \"id\": \"789ABDCEF123456\",\n\t\t\t  \"name\": \"Network Configuration Three\",\n\t\t\t  \"compute_service\": \"codespaces\",\n\t\t\t  \"network_settings_ids\": [\n\t\t\t\t\"56789ABDCEF1234\",\n\t\t\t\t\"6789ABDCEF12345\"\n\t\t\t  ],\n\t\t\t  \"created_on\": \"2024-12-10T19:30:45Z\"\n\t\t\t}\n\t\t  ]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\n\topts := &ListOptions{Page: 1, PerPage: 3}\n\tconfigurations, _, err := client.Organizations.ListNetworkConfigurations(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListNetworkConfigurations returned error %v\", err)\n\t}\n\twant := &NetworkConfigurations{\n\t\tTotalCount: Ptr(int64(3)),\n\t\tNetworkConfigurations: []*NetworkConfiguration{\n\t\t\t{\n\t\t\t\tID:             Ptr(\"123456789ABCDEF\"),\n\t\t\t\tName:           Ptr(\"Network Configuration One\"),\n\t\t\t\tComputeService: Ptr(ComputeService(\"actions\")),\n\t\t\t\tNetworkSettingsIDs: []string{\n\t\t\t\t\t\"23456789ABDCEF1\",\n\t\t\t\t\t\"3456789ABDCEF12\",\n\t\t\t\t},\n\t\t\t\tCreatedOn: &Timestamp{time.Date(2024, 4, 9, 17, 30, 15, 0, time.UTC)},\n\t\t\t},\n\t\t\t{\n\t\t\t\tID:             Ptr(\"456789ABDCEF123\"),\n\t\t\t\tName:           Ptr(\"Network Configuration Two\"),\n\t\t\t\tComputeService: Ptr(ComputeService(\"none\")),\n\t\t\t\tNetworkSettingsIDs: []string{\n\t\t\t\t\t\"56789ABDCEF1234\",\n\t\t\t\t\t\"6789ABDCEF12345\",\n\t\t\t\t},\n\t\t\t\tCreatedOn: &Timestamp{time.Date(2024, 11, 2, 4, 30, 30, 0, time.UTC)},\n\t\t\t},\n\t\t\t{\n\t\t\t\tID:             Ptr(\"789ABDCEF123456\"),\n\t\t\t\tName:           Ptr(\"Network Configuration Three\"),\n\t\t\t\tComputeService: Ptr(ComputeService(\"codespaces\")),\n\t\t\t\tNetworkSettingsIDs: []string{\n\t\t\t\t\t\"56789ABDCEF1234\",\n\t\t\t\t\t\"6789ABDCEF12345\",\n\t\t\t\t},\n\t\t\t\tCreatedOn: &Timestamp{time.Date(2024, 12, 10, 19, 30, 45, 0, time.UTC)},\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(want, configurations) {\n\t\tt.Errorf(\"Organizations.ListNetworkConfigurations mismatch (-want +got):\\n%v\", cmp.Diff(want, configurations))\n\t}\n\n\tconst methodName = \"ListNetworkConfigurations\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListNetworkConfigurations(ctx, \"\\no\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListNetworkConfigurations(ctx, \"o\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_CreateOrgsNetworkConfiguration(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/settings/network-configurations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\n\t\t  \"id\": \"456789ABDCEF123\",\n\t\t  \"name\": \"network-configuration-two\",\n\t\t  \"compute_service\": \"none\",\n\t\t  \"network_settings_ids\": [\n\t\t\t\"56789ABDCEF1234\"\n\t\t  ],\n\t\t  \"created_on\": \"2024-11-02T4:30:30Z\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\n\treq := NetworkConfigurationRequest{\n\t\tName:           Ptr(\"network-configuration-two\"),\n\t\tComputeService: Ptr(ComputeService(\"none\")),\n\t\tNetworkSettingsIDs: []string{\n\t\t\t\"56789ABDCEF1234\",\n\t\t},\n\t}\n\n\tconfiguration, _, err := client.Organizations.CreateNetworkConfiguration(ctx, \"o\", req)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.CreateNetworkConfiguration returned error %v\", err)\n\t}\n\n\twant := &NetworkConfiguration{\n\t\tID:             Ptr(\"456789ABDCEF123\"),\n\t\tName:           Ptr(\"network-configuration-two\"),\n\t\tComputeService: Ptr(ComputeService(\"none\")),\n\t\tNetworkSettingsIDs: []string{\n\t\t\t\"56789ABDCEF1234\",\n\t\t},\n\t\tCreatedOn: &Timestamp{time.Date(2024, 11, 2, 4, 30, 30, 0, time.UTC)},\n\t}\n\n\tif !cmp.Equal(want, configuration) {\n\t\tt.Errorf(\"Organizations.CreateNetworkConfiguration mismatch (-want +got):\\n%v\", cmp.Diff(want, configuration))\n\t}\n\n\tvalidationTests := []struct {\n\t\tname    string\n\t\trequest NetworkConfigurationRequest\n\t\twant    string\n\t}{\n\t\t{\n\t\t\tname: \"invalid network configuration name length\",\n\t\t\trequest: NetworkConfigurationRequest{\n\t\t\t\tName:           Ptr(\"\"),\n\t\t\t\tComputeService: Ptr(ComputeService(\"none\")),\n\t\t\t\tNetworkSettingsIDs: []string{\n\t\t\t\t\t\"56789ABDCEF1234\",\n\t\t\t\t},\n\t\t\t},\n\t\t\twant: \"validation failed: must be between 1 and 100 characters\",\n\t\t},\n\t\t{\n\t\t\tname: \"invalid network configuration name\",\n\t\t\t// may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'.\n\t\t\trequest: NetworkConfigurationRequest{\n\t\t\t\tName: Ptr(\"network configuration two\"),\n\t\t\t\tNetworkSettingsIDs: []string{\n\t\t\t\t\t\"56789ABDCEF1234\",\n\t\t\t\t},\n\t\t\t},\n\t\t\twant: \"validation failed: may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'\",\n\t\t},\n\t\t{\n\t\t\tname: \"invalid network settings ids\",\n\t\t\trequest: NetworkConfigurationRequest{\n\t\t\t\tName:           Ptr(\"network-configuration-two\"),\n\t\t\t\tComputeService: Ptr(ComputeService(\"none\")),\n\t\t\t\tNetworkSettingsIDs: []string{\n\t\t\t\t\t\"56789ABDCEF1234\",\n\t\t\t\t\t\"3456789ABDCEF12\",\n\t\t\t\t},\n\t\t\t},\n\t\t\twant: \"validation failed: exactly one network settings id must be specified\",\n\t\t},\n\t\t{\n\t\t\tname: \"invalid compute service\",\n\t\t\trequest: NetworkConfigurationRequest{\n\t\t\t\tName:           Ptr(\"network-configuration-two\"),\n\t\t\t\tComputeService: Ptr(ComputeService(\"codespaces\")),\n\t\t\t\tNetworkSettingsIDs: []string{\n\t\t\t\t\t\"56789ABDCEF1234\",\n\t\t\t\t},\n\t\t\t},\n\t\t\twant: \"validation failed: compute service can only be one of: none, actions\",\n\t\t},\n\t}\n\n\tfor _, tc := range validationTests {\n\t\t_, _, err := client.Organizations.CreateNetworkConfiguration(ctx, \"o\", tc.request)\n\t\tif err == nil || err.Error() != tc.want {\n\t\t\tt.Errorf(\"expected error to be %v, got %v\", tc.want, err)\n\t\t}\n\t}\n\n\tconst methodName = \"CreateNetworkConfiguration\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.CreateNetworkConfiguration(ctx, \"\\no\", req)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.CreateNetworkConfiguration(ctx, \"o\", req)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_GetOrgsNetworkConfiguration(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/settings/network-configurations/789ABDCEF123456\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t \"id\": \"789ABDCEF123456\",\n\t\t\t  \"name\": \"Network Configuration Three\",\n\t\t\t  \"compute_service\": \"codespaces\",\n\t\t\t  \"network_settings_ids\": [\n\t\t\t\t\"56789ABDCEF1234\",\n\t\t\t\t\"6789ABDCEF12345\"\n\t\t\t  ],\n\t\t\t  \"created_on\": \"2024-12-10T19:30:45Z\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\n\tconfiguration, _, err := client.Organizations.GetNetworkConfiguration(ctx, \"o\", \"789ABDCEF123456\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.GetNetworkConfiguration returned error: %v\", err)\n\t}\n\twant := &NetworkConfiguration{\n\t\tID:             Ptr(\"789ABDCEF123456\"),\n\t\tName:           Ptr(\"Network Configuration Three\"),\n\t\tComputeService: Ptr(ComputeService(\"codespaces\")),\n\t\tNetworkSettingsIDs: []string{\n\t\t\t\"56789ABDCEF1234\",\n\t\t\t\"6789ABDCEF12345\",\n\t\t},\n\t\tCreatedOn: &Timestamp{time.Date(2024, 12, 10, 19, 30, 45, 0, time.UTC)},\n\t}\n\tif !cmp.Equal(want, configuration) {\n\t\tt.Errorf(\"Organizations.GetNetworkConfiguration mismatch (-want +got):\\n%v\", cmp.Diff(want, configuration))\n\t}\n\n\tconst methodName = \"GetNetworkConfiguration\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.GetNetworkConfiguration(ctx, \"\\no\", \"789ABDCEF123456\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.GetNetworkConfiguration(ctx, \"o\", \"789ABDCEF123456\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_UpdateOrgsNetworkConfiguration(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/settings/network-configurations/789ABDCEF123456\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tfmt.Fprint(w, `{\n\t\t  \"id\": \"789ABDCEF123456\",\n\t\t  \"name\": \"Network Configuration Three Update\",\n\t\t  \"compute_service\": \"actions\",\n\t\t  \"network_settings_ids\": [\n\t\t\t\"56789ABDCEF1234\",\n\t\t\t\"6789ABDCEF12345\"\n\t\t  ],\n\t\t  \"created_on\": \"2024-12-10T19:30:45Z\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\n\treq := NetworkConfigurationRequest{\n\t\tName:           Ptr(\"network-configuration-three-update\"),\n\t\tComputeService: Ptr(ComputeService(\"actions\")),\n\t\tNetworkSettingsIDs: []string{\n\t\t\t\"56789ABDCEF1234\",\n\t\t},\n\t}\n\tconfiguration, _, err := client.Organizations.UpdateNetworkConfiguration(ctx, \"o\", \"789ABDCEF123456\", req)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.UpdateNetworkConfiguration returned error: %v\", err)\n\t}\n\n\twant := &NetworkConfiguration{\n\t\tID:             Ptr(\"789ABDCEF123456\"),\n\t\tName:           Ptr(\"Network Configuration Three Update\"),\n\t\tComputeService: Ptr(ComputeService(\"actions\")),\n\t\tNetworkSettingsIDs: []string{\n\t\t\t\"56789ABDCEF1234\",\n\t\t\t\"6789ABDCEF12345\",\n\t\t},\n\t\tCreatedOn: &Timestamp{time.Date(2024, 12, 10, 19, 30, 45, 0, time.UTC)},\n\t}\n\tif !cmp.Equal(want, configuration) {\n\t\tt.Errorf(\"Organizations.UpdateNetworkConfiguration mismatch (-want +got):\\n%v\", cmp.Diff(want, configuration))\n\t}\n\n\tvalidationTests := []struct {\n\t\tname    string\n\t\trequest NetworkConfigurationRequest\n\t\twant    string\n\t}{\n\t\t{\n\t\t\tname: \"invalid network configuration name length\",\n\t\t\trequest: NetworkConfigurationRequest{\n\t\t\t\tName:           Ptr(\"\"),\n\t\t\t\tComputeService: Ptr(ComputeService(\"none\")),\n\t\t\t\tNetworkSettingsIDs: []string{\n\t\t\t\t\t\"56789ABDCEF1234\",\n\t\t\t\t},\n\t\t\t},\n\t\t\twant: \"validation failed: must be between 1 and 100 characters\",\n\t\t},\n\t\t{\n\t\t\tname: \"invalid network configuration name\",\n\t\t\t// may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'.\n\t\t\trequest: NetworkConfigurationRequest{\n\t\t\t\tName: Ptr(\"network configuration three update\"),\n\t\t\t\tNetworkSettingsIDs: []string{\n\t\t\t\t\t\"56789ABDCEF1234\",\n\t\t\t\t},\n\t\t\t},\n\t\t\twant: \"validation failed: may only contain upper and lowercase letters a-z, numbers 0-9, '.', '-', and '_'\",\n\t\t},\n\t\t{\n\t\t\tname: \"invalid network settings ids\",\n\t\t\trequest: NetworkConfigurationRequest{\n\t\t\t\tName:           Ptr(\"network-configuration-three-update\"),\n\t\t\t\tComputeService: Ptr(ComputeService(\"none\")),\n\t\t\t\tNetworkSettingsIDs: []string{\n\t\t\t\t\t\"56789ABDCEF1234\",\n\t\t\t\t\t\"3456789ABDCEF12\",\n\t\t\t\t},\n\t\t\t},\n\t\t\twant: \"validation failed: exactly one network settings id must be specified\",\n\t\t},\n\t\t{\n\t\t\tname: \"invalid compute service\",\n\t\t\trequest: NetworkConfigurationRequest{\n\t\t\t\tName:           Ptr(\"network-configuration-three-update\"),\n\t\t\t\tComputeService: Ptr(ComputeService(\"codespaces\")),\n\t\t\t\tNetworkSettingsIDs: []string{\n\t\t\t\t\t\"56789ABDCEF1234\",\n\t\t\t\t},\n\t\t\t},\n\t\t\twant: \"validation failed: compute service can only be one of: none, actions\",\n\t\t},\n\t}\n\n\tfor _, tc := range validationTests {\n\t\t_, _, err := client.Organizations.UpdateNetworkConfiguration(ctx, \"o\", \"789ABDCEF123456\", tc.request)\n\t\tif err == nil || err.Error() != tc.want {\n\t\t\tt.Errorf(\"expected error to be %v, got %v\", tc.want, err)\n\t\t}\n\t}\n\n\tconst methodName = \"UpdateNetworkConfiguration\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.UpdateNetworkConfiguration(ctx, \"\\no\", \"789ABDCEF123456\", req)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.UpdateNetworkConfiguration(ctx, \"o\", \"789ABDCEF123456\", req)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_DeleteOrgsNetworkConfiguration(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/settings/network-configurations/789ABDCEF123456\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Organizations.DeleteNetworkConfigurations(ctx, \"o\", \"789ABDCEF123456\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.DeleteNetworkConfigurations returned error %v\", err)\n\t}\n\n\tconst methodName = \"DeleteNetworkConfigurations\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, err = client.Organizations.DeleteNetworkConfigurations(ctx, \"\\ne\", \"123456789ABCDEF\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.DeleteNetworkConfigurations(ctx, \"e\", \"123456789ABCDEF\")\n\t})\n}\n\nfunc TestOrganizationsService_GetOrgsNetworkConfigurationResource(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/settings/network-settings/789ABDCEF123456\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t  \"id\": \"220F78DACB92BBFBC5E6F22DE1CCF52309D\",\n\t\t  \"network_configuration_id\": \"934E208B3EE0BD60CF5F752C426BFB53562\",\n\t\t  \"name\": \"my_network_settings\",\n\t\t  \"subnet_id\": \"/subscriptions/14839728-3ad9-43ab-bd2b-fa6ad0f75e2a/resourceGroups/my-rg/providers/Microsoft.Network/virtualNetworks/my-vnet/subnets/my-subnet\",\n\t\t  \"region\": \"germanywestcentral\"\n\t\t}\n\t\t`)\n\t})\n\n\tctx := t.Context()\n\n\tresource, _, err := client.Organizations.GetNetworkConfigurationResource(ctx, \"o\", \"789ABDCEF123456\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.GetNetworkConfigurationResource returned error %v\", err)\n\t}\n\n\twant := &NetworkSettingsResource{\n\t\tID:                     Ptr(\"220F78DACB92BBFBC5E6F22DE1CCF52309D\"),\n\t\tName:                   Ptr(\"my_network_settings\"),\n\t\tNetworkConfigurationID: Ptr(\"934E208B3EE0BD60CF5F752C426BFB53562\"),\n\t\tSubnetID:               Ptr(\"/subscriptions/14839728-3ad9-43ab-bd2b-fa6ad0f75e2a/resourceGroups/my-rg/providers/Microsoft.Network/virtualNetworks/my-vnet/subnets/my-subnet\"),\n\t\tRegion:                 Ptr(\"germanywestcentral\"),\n\t}\n\n\tif !cmp.Equal(want, resource) {\n\t\tt.Errorf(\"Organizations.GetNetworkConfigurationResource mismatch (-want +got):\\n%v\", cmp.Diff(want, resource))\n\t}\n\n\tconst methodName = \"GetNetworkConfiguration\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.GetNetworkConfigurationResource(ctx, \"\\no\", \"789ABDCEF123456\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.GetNetworkConfigurationResource(ctx, \"o\", \"789ABDCEF123456\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/orgs_organization_properties.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// OrganizationCustomPropertyValues represents the custom property values for an organization.\ntype OrganizationCustomPropertyValues struct {\n\t// List of custom property names and associated values to apply to the organization.\n\tProperties []*CustomPropertyValue `json:\"properties,omitempty\"`\n}\n\n// GetOrganizationCustomPropertyValues returns all custom property names and their values for an organization.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/custom-properties-for-orgs#get-all-custom-property-values-for-an-organization\n//\n//meta:operation GET /organizations/{org}/org-properties/values\nfunc (s *OrganizationsService) GetOrganizationCustomPropertyValues(ctx context.Context, org string) ([]*CustomPropertyValue, *Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/org-properties/values\", org)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar values []*CustomPropertyValue\n\tresp, err := s.client.Do(ctx, req, &values)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn values, resp, nil\n}\n\n// CreateOrUpdateOrganizationCustomPropertyValues creates or updates custom property values for an organization.\n// To remove a custom property value from an organization, set the property value to null.\n//\n// 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\n//\n//meta:operation PATCH /organizations/{org}/org-properties/values\nfunc (s *OrganizationsService) CreateOrUpdateOrganizationCustomPropertyValues(ctx context.Context, org string, values OrganizationCustomPropertyValues) (*Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/org-properties/values\", org)\n\treq, err := s.client.NewRequest(\"PATCH\", u, values)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n"
  },
  {
    "path": "github/orgs_organization_properties_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestOrganizationsService_GetOrganizationCustomPropertyValues(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/o/org-properties/values\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"property_name\": \"team\",\n\t\t\t\"value\": \"core\"\n\t\t},\n\t\t{\n\t\t\t\"property_name\": \"level\",\n\t\t\t\"value\": \"gold\"\n\t\t}]`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Organizations.GetOrganizationCustomPropertyValues(ctx, \"o\")\n\tif err != nil {\n\t\tt.Fatalf(\"Organizations.GetOrganizationCustomPropertyValues returned error: %v\", err)\n\t}\n\n\twant := []*CustomPropertyValue{\n\t\t{PropertyName: \"team\", Value: \"core\"},\n\t\t{PropertyName: \"level\", Value: \"gold\"},\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Organizations.GetOrganizationCustomPropertyValues = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"GetOrganizationCustomPropertyValues\"\n\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err := client.Organizations.GetOrganizationCustomPropertyValues(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.GetOrganizationCustomPropertyValues(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_CreateOrUpdateOrganizationCustomPropertyValues(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/o/org-properties/values\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tfmt.Fprint(w, `{}`)\n\t})\n\n\tctx := t.Context()\n\tvalues := []*CustomPropertyValue{\n\t\t{PropertyName: \"team\", Value: Ptr(\"core\")},\n\t\t{PropertyName: \"level\", Value: Ptr(\"gold\")},\n\t}\n\n\tprops := OrganizationCustomPropertyValues{\n\t\tProperties: values,\n\t}\n\t_, err := client.Organizations.CreateOrUpdateOrganizationCustomPropertyValues(ctx, \"o\", props)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.CreateOrUpdateOrganizationCustomPropertyValues returned error: %v\", err)\n\t}\n\n\tconst methodName = \"CreateOrUpdateOrganizationCustomPropertyValues\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, err := client.Organizations.CreateOrUpdateOrganizationCustomPropertyValues(ctx, \"\\n\", props)\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.CreateOrUpdateOrganizationCustomPropertyValues(ctx, \"o\", props)\n\t})\n}\n"
  },
  {
    "path": "github/orgs_organization_roles.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// OrganizationCustomRoles represents custom organization roles available in specified organization.\ntype OrganizationCustomRoles struct {\n\tTotalCount      *int             `json:\"total_count,omitempty\"`\n\tCustomRepoRoles []*CustomOrgRole `json:\"roles,omitempty\"`\n}\n\n// CustomOrgRole represents custom organization role available in specified organization.\ntype CustomOrgRole struct {\n\tID          *int64        `json:\"id,omitempty\"`\n\tName        *string       `json:\"name,omitempty\"`\n\tDescription *string       `json:\"description,omitempty\"`\n\tPermissions []string      `json:\"permissions,omitempty\"`\n\tOrg         *Organization `json:\"organization,omitempty\"`\n\tCreatedAt   *Timestamp    `json:\"created_at,omitempty\"`\n\tUpdatedAt   *Timestamp    `json:\"updated_at,omitempty\"`\n\tSource      *string       `json:\"source,omitempty\"`\n\tBaseRole    *string       `json:\"base_role,omitempty\"`\n}\n\n// CreateCustomOrgRoleRequest represents body parameters required to create a custom organization role.\ntype CreateCustomOrgRoleRequest struct {\n\tName        string   `json:\"name\"`\n\tDescription *string  `json:\"description,omitempty\"`\n\tPermissions []string `json:\"permissions\"`\n\tBaseRole    *string  `json:\"base_role,omitempty\"` // Can be one of: read, triage, write, maintain, admin\n}\n\n// UpdateCustomOrgRoleRequest represents body parameters to update a custom organization role.\ntype UpdateCustomOrgRoleRequest struct {\n\tName        *string  `json:\"name,omitempty\"`\n\tDescription *string  `json:\"description,omitempty\"`\n\tPermissions []string `json:\"permissions,omitempty\"`\n\tBaseRole    *string  `json:\"base_role,omitempty\"` // Can be one of: none, read, triage, write, maintain, admin\n}\n\n// OrganizationFineGrainedPermission represents a fine-grained permission that protects organization resources.\ntype OrganizationFineGrainedPermission struct {\n\tName        string `json:\"name\"`\n\tDescription string `json:\"description\"`\n}\n\n// ListRoles lists the custom roles available in this organization.\n// In order to see custom roles in an organization, the authenticated user must be an organization owner.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#get-all-organization-roles-for-an-organization\n//\n//meta:operation GET /orgs/{org}/organization-roles\nfunc (s *OrganizationsService) ListRoles(ctx context.Context, org string) (*OrganizationCustomRoles, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/organization-roles\", org)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar customRepoRoles *OrganizationCustomRoles\n\tresp, err := s.client.Do(ctx, req, &customRepoRoles)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn customRepoRoles, resp, nil\n}\n\n// GetOrgRole gets an organization role in this organization.\n// In order to get organization roles in an organization, the authenticated user must be an organization owner, or have access via an organization role.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#get-an-organization-role\n//\n//meta:operation GET /orgs/{org}/organization-roles/{role_id}\nfunc (s *OrganizationsService) GetOrgRole(ctx context.Context, org string, roleID int64) (*CustomOrgRole, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/organization-roles/%v\", org, roleID)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar resultingRole *CustomOrgRole\n\tresp, err := s.client.Do(ctx, req, &resultingRole)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn resultingRole, resp, err\n}\n\n// CreateCustomOrgRole creates a custom role in this organization.\n// In order to create custom roles in an organization, the authenticated user must be an organization owner.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/organization-roles#create-a-custom-organization-role\n//\n//meta:operation POST /orgs/{org}/organization-roles\nfunc (s *OrganizationsService) CreateCustomOrgRole(ctx context.Context, org string, request CreateCustomOrgRoleRequest) (*CustomOrgRole, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/organization-roles\", org)\n\n\treq, err := s.client.NewRequest(\"POST\", u, request)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar resultingRole *CustomOrgRole\n\tresp, err := s.client.Do(ctx, req, &resultingRole)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn resultingRole, resp, err\n}\n\n// UpdateCustomOrgRole updates a custom role in this organization.\n// In order to update custom roles in an organization, the authenticated user must be an organization owner.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/organization-roles#update-a-custom-organization-role\n//\n//meta:operation PATCH /orgs/{org}/organization-roles/{role_id}\nfunc (s *OrganizationsService) UpdateCustomOrgRole(ctx context.Context, org string, roleID int64, request UpdateCustomOrgRoleRequest) (*CustomOrgRole, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/organization-roles/%v\", org, roleID)\n\n\treq, err := s.client.NewRequest(\"PATCH\", u, request)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar resultingRole *CustomOrgRole\n\tresp, err := s.client.Do(ctx, req, &resultingRole)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn resultingRole, resp, err\n}\n\n// DeleteCustomOrgRole deletes an existing custom role in this organization.\n// In order to delete custom roles in an organization, the authenticated user must be an organization owner.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/organization-roles#delete-a-custom-organization-role\n//\n//meta:operation DELETE /orgs/{org}/organization-roles/{role_id}\nfunc (s *OrganizationsService) DeleteCustomOrgRole(ctx context.Context, org string, roleID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/organization-roles/%v\", org, roleID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar resultingRole *CustomOrgRole\n\tresp, err := s.client.Do(ctx, req, &resultingRole)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// AssignOrgRoleToTeam assigns an existing organization role to a team in this organization.\n// In order to assign organization roles in an organization, the authenticated user must be an organization owner.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-team\n//\n//meta:operation PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}\nfunc (s *OrganizationsService) AssignOrgRoleToTeam(ctx context.Context, org, teamSlug string, roleID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/organization-roles/teams/%v/%v\", org, teamSlug, roleID)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// RemoveOrgRoleFromTeam removes an existing organization role assignment from a team in this organization.\n// In order to remove organization role assignments in an organization, the authenticated user must be an organization owner.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-team\n//\n//meta:operation DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}\nfunc (s *OrganizationsService) RemoveOrgRoleFromTeam(ctx context.Context, org, teamSlug string, roleID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/organization-roles/teams/%v/%v\", org, teamSlug, roleID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// AssignOrgRoleToUser assigns an existing organization role to a user in this organization.\n// In order to assign organization roles in an organization, the authenticated user must be an organization owner.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-user\n//\n//meta:operation PUT /orgs/{org}/organization-roles/users/{username}/{role_id}\nfunc (s *OrganizationsService) AssignOrgRoleToUser(ctx context.Context, org, username string, roleID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/organization-roles/users/%v/%v\", org, username, roleID)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// RemoveOrgRoleFromUser removes an existing organization role assignment from a user in this organization.\n// In order to remove organization role assignments in an organization, the authenticated user must be an organization owner.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-user\n//\n//meta:operation DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}\nfunc (s *OrganizationsService) RemoveOrgRoleFromUser(ctx context.Context, org, username string, roleID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/organization-roles/users/%v/%v\", org, username, roleID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// ListTeamsAssignedToOrgRole returns all teams assigned to a specific organization role.\n// In order to list teams assigned to an organization role, the authenticated user must be an organization owner.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#list-teams-that-are-assigned-to-an-organization-role\n//\n//meta:operation GET /orgs/{org}/organization-roles/{role_id}/teams\nfunc (s *OrganizationsService) ListTeamsAssignedToOrgRole(ctx context.Context, org string, roleID int64, opts *ListOptions) ([]*Team, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/organization-roles/%v/teams\", org, roleID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar teams []*Team\n\tresp, err := s.client.Do(ctx, req, &teams)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn teams, resp, nil\n}\n\n// ListUsersAssignedToOrgRole returns all users assigned to a specific organization role.\n// In order to list users assigned to an organization role, the authenticated user must be an organization owner.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/organization-roles#list-users-that-are-assigned-to-an-organization-role\n//\n//meta:operation GET /orgs/{org}/organization-roles/{role_id}/users\nfunc (s *OrganizationsService) ListUsersAssignedToOrgRole(ctx context.Context, org string, roleID int64, opts *ListOptions) ([]*User, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/organization-roles/%v/users\", org, roleID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar users []*User\n\tresp, err := s.client.Do(ctx, req, &users)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn users, resp, nil\n}\n\n// ListFineGrainedPermissions lists the fine-grained permissions that can be used in custom organization roles for an organization.\n//\n// To use this endpoint, the authenticated user must be one of:\n//   - An administrator for the organization.\n//   - A user, or a user on a team, with the fine-grained permissions of `read_organization_custom_org_role` in the organization.\n//\n// OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/orgs/organization-roles#list-organization-fine-grained-permissions-for-an-organization\n//\n//meta:operation GET /orgs/{org}/organization-fine-grained-permissions\nfunc (s *OrganizationsService) ListFineGrainedPermissions(ctx context.Context, org string) ([]*OrganizationFineGrainedPermission, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/organization-fine-grained-permissions\", org)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar permissions []*OrganizationFineGrainedPermission\n\tresp, err := s.client.Do(ctx, req, &permissions)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn permissions, resp, nil\n}\n"
  },
  {
    "path": "github/orgs_organization_roles_test.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestOrganizationsService_ListRoles(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/organization-roles\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"total_count\": 1, \"roles\": [\n\t\t\t{\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"name\": \"Auditor\",\n\t\t\t\t\"permissions\": [\"read_audit_logs\"],\n\t\t\t\t\"organization\": {\n\t\t\t\t\t\"login\": \"l\",\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"node_id\": \"n\",\n\t\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\t\"html_url\": \"h\",\n\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\"company\": \"c\",\n\t\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\t\"location\": \"l\",\n\t\t\t\t\t\"email\": \"e\"\n\t\t\t\t},\n\t\t\t\t\"created_at\": \"2024-07-21T19:33:08Z\",\n\t\t\t\t\"updated_at\": \"2024-07-21T19:33:08Z\",\n\t\t\t\t\"source\": \"Organization\",\n\t\t\t\t\"base_role\": \"admin\"\n\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tapps, _, err := client.Organizations.ListRoles(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListRoles returned error: %v\", err)\n\t}\n\n\twant := &OrganizationCustomRoles{\n\t\tTotalCount: Ptr(1),\n\t\tCustomRepoRoles: []*CustomOrgRole{\n\t\t\t{\n\t\t\t\tID:          Ptr(int64(1)),\n\t\t\t\tName:        Ptr(\"Auditor\"),\n\t\t\t\tPermissions: []string{\"read_audit_logs\"},\n\t\t\t\tOrg: &Organization{\n\t\t\t\t\tLogin:     Ptr(\"l\"),\n\t\t\t\t\tID:        Ptr(int64(1)),\n\t\t\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\t\t\tHTMLURL:   Ptr(\"h\"),\n\t\t\t\t\tName:      Ptr(\"n\"),\n\t\t\t\t\tCompany:   Ptr(\"c\"),\n\t\t\t\t\tBlog:      Ptr(\"b\"),\n\t\t\t\t\tLocation:  Ptr(\"l\"),\n\t\t\t\t\tEmail:     Ptr(\"e\"),\n\t\t\t\t},\n\t\t\t\tCreatedAt: &Timestamp{time.Date(2024, time.July, 21, 19, 33, 8, 0, time.UTC)},\n\t\t\t\tUpdatedAt: &Timestamp{time.Date(2024, time.July, 21, 19, 33, 8, 0, time.UTC)},\n\t\t\t\tSource:    Ptr(\"Organization\"),\n\t\t\t\tBaseRole:  Ptr(\"admin\"),\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(apps, want) {\n\t\tt.Errorf(\"Organizations.ListRoles returned %+v, want %+v\", apps, want)\n\t}\n\n\tconst methodName = \"ListRoles\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListRoles(ctx, \"\\no\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListRoles(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_GetOrgRole(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\t// Test built-in org role\n\tmux.HandleFunc(\"/orgs/o/organization-roles/8132\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 8132,\n\t\t\t\"name\": \"all_repo_read\",\n\t\t\t\"description\": \"Grants read access to all repositories in the organization.\",\n\t\t\t\"permissions\": [],\n\t\t\t\"created_at\": `+referenceTimeStr+`,\n\t\t\t\"updated_at\": `+referenceTimeStr+`,\n\t\t\t\"source\": \"Predefined\",\n\t\t\t\"base_role\": \"read\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\n\tgotBuiltInRole, _, err := client.Organizations.GetOrgRole(ctx, \"o\", 8132)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.GetOrgRole returned error: %v\", err)\n\t}\n\n\twantBuiltInRole := &CustomOrgRole{\n\t\tID:          Ptr(int64(8132)),\n\t\tName:        Ptr(\"all_repo_read\"),\n\t\tDescription: Ptr(\"Grants read access to all repositories in the organization.\"),\n\t\tPermissions: []string{},\n\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\tUpdatedAt:   &Timestamp{referenceTime},\n\t\tSource:      Ptr(\"Predefined\"),\n\t\tBaseRole:    Ptr(\"read\"),\n\t}\n\n\tif !cmp.Equal(gotBuiltInRole, wantBuiltInRole) {\n\t\tt.Errorf(\"Organizations.GetOrgRole returned %+v, want %+v\", gotBuiltInRole, wantBuiltInRole)\n\t}\n\n\t// Test custom org role\n\tmux.HandleFunc(\"/orgs/o/organization-roles/123456\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 123456,\n\t\t\t\"name\": \"test-role\",\n\t\t\t\"description\": \"test-role\",\n\t\t\t\"permissions\": [\n\t\t\t\t\"read_organization_custom_org_role\",\n\t\t\t\t\"read_organization_custom_repo_role\",\n\t\t\t\t\"write_organization_custom_org_role\"\n\t\t\t],\n\t\t\t\"created_at\": `+referenceTimeStr+`,\n\t\t\t\"updated_at\": `+referenceTimeStr+`,\n\t\t\t\"source\": \"Organization\",\n\t\t\t\"base_role\": null\n\t\t\t}`)\n\t})\n\n\tgotCustomRole, _, err := client.Organizations.GetOrgRole(ctx, \"o\", 123456)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.GetOrgRole returned error: %v\", err)\n\t}\n\n\twantCustomRole := &CustomOrgRole{\n\t\tID:          Ptr(int64(123456)),\n\t\tName:        Ptr(\"test-role\"),\n\t\tDescription: Ptr(\"test-role\"),\n\t\tPermissions: []string{\n\t\t\t\"read_organization_custom_org_role\",\n\t\t\t\"read_organization_custom_repo_role\",\n\t\t\t\"write_organization_custom_org_role\",\n\t\t},\n\t\tCreatedAt: &Timestamp{referenceTime},\n\t\tUpdatedAt: &Timestamp{referenceTime},\n\t\tSource:    Ptr(\"Organization\"),\n\t\tBaseRole:  nil,\n\t}\n\n\tif !cmp.Equal(gotCustomRole, wantCustomRole) {\n\t\tt.Errorf(\"Organizations.GetOrgRole returned %+v, want %+v\", gotCustomRole, wantCustomRole)\n\t}\n\n\tconst methodName = \"GetOrgRole\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.GetOrgRole(ctx, \"\\no\", -8132)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.GetOrgRole(ctx, \"o\", 8132)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_CreateCustomOrgRole(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/organization-roles\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\"id\":8030,\"name\":\"Reader\",\"description\":\"A role for reading custom org roles\",\"permissions\":[\"read_organization_custom_org_role\"]}`)\n\t})\n\n\tctx := t.Context()\n\n\topts := CreateCustomOrgRoleRequest{\n\t\tName:        \"Reader\",\n\t\tPermissions: []string{\"read_organization_custom_org_role\"},\n\t\tDescription: Ptr(\"A role for reading custom org roles\"),\n\t}\n\tgotRoles, _, err := client.Organizations.CreateCustomOrgRole(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.CreateCustomOrgRole returned error: %v\", err)\n\t}\n\n\twant := &CustomOrgRole{ID: Ptr(int64(8030)), Name: Ptr(\"Reader\"), Permissions: []string{\"read_organization_custom_org_role\"}, Description: Ptr(\"A role for reading custom org roles\")}\n\n\tif !cmp.Equal(gotRoles, want) {\n\t\tt.Errorf(\"Organizations.CreateCustomOrgRole returned %+v, want %+v\", gotRoles, want)\n\t}\n\n\tconst methodName = \"CreateCustomOrgRole\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.CreateCustomOrgRole(ctx, \"\\no\", CreateCustomOrgRoleRequest{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.CreateCustomOrgRole(ctx, \"o\", CreateCustomOrgRoleRequest{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_UpdateCustomOrgRole(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/organization-roles/8030\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tfmt.Fprint(w, `{\"id\":8030,\"name\":\"Updated Name\",\"description\":\"Updated Description\",\"permissions\":[\"read_organization_custom_org_role\"]}`)\n\t})\n\n\tctx := t.Context()\n\n\topts := UpdateCustomOrgRoleRequest{\n\t\tName:        Ptr(\"Updated Name\"),\n\t\tDescription: Ptr(\"Updated Description\"),\n\t}\n\tgotRoles, _, err := client.Organizations.UpdateCustomOrgRole(ctx, \"o\", 8030, opts)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.UpdateCustomOrgRole returned error: %v\", err)\n\t}\n\n\twant := &CustomOrgRole{ID: Ptr(int64(8030)), Name: Ptr(\"Updated Name\"), Permissions: []string{\"read_organization_custom_org_role\"}, Description: Ptr(\"Updated Description\")}\n\n\tif !cmp.Equal(gotRoles, want) {\n\t\tt.Errorf(\"Organizations.UpdateCustomOrgRole returned %+v, want %+v\", gotRoles, want)\n\t}\n\n\tconst methodName = \"UpdateCustomOrgRole\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.UpdateCustomOrgRole(ctx, \"\\no\", 8030, UpdateCustomOrgRoleRequest{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.UpdateCustomOrgRole(ctx, \"o\", 8030, UpdateCustomOrgRoleRequest{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_DeleteCustomOrgRole(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/organization-roles/8030\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\n\tresp, err := client.Organizations.DeleteCustomOrgRole(ctx, \"o\", 8030)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.DeleteCustomOrgRole returned error: %v\", err)\n\t}\n\n\tif !cmp.Equal(resp.StatusCode, 204) {\n\t\tt.Errorf(\"Organizations.DeleteCustomOrgRole returned  status code %+v, want %+v\", resp.StatusCode, \"204\")\n\t}\n\n\tconst methodName = \"DeleteCustomOrgRole\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Organizations.DeleteCustomOrgRole(ctx, \"\\no\", 8030)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.DeleteCustomOrgRole(ctx, \"o\", 8030)\n\t})\n}\n\nfunc TestOrganizationsService_AssignOrgRoleToTeam(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/organization-roles/teams/t/8030\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Organizations.AssignOrgRoleToTeam(ctx, \"o\", \"t\", 8030)\n\tif err != nil {\n\t\tt.Errorf(\"Organization.AssignOrgRoleToTeam return error: %v\", err)\n\t}\n\tif !cmp.Equal(resp.StatusCode, http.StatusNoContent) {\n\t\tt.Errorf(\"Organizations.AssignOrgRoleToTeam returned status code %+v, want %+v\", resp.StatusCode, http.StatusNoContent)\n\t}\n\n\tconst methodName = \"AssignOrgRoleToTeam\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Organizations.AssignOrgRoleToTeam(ctx, \"\\no\", \"\\nt\", -8030)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.AssignOrgRoleToTeam(ctx, \"o\", \"t\", 8030)\n\t})\n}\n\nfunc TestOrganizationsService_RemoveOrgRoleFromTeam(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/organization-roles/teams/t/8030\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Organizations.RemoveOrgRoleFromTeam(ctx, \"o\", \"t\", 8030)\n\tif err != nil {\n\t\tt.Errorf(\"Organization.RemoveOrgRoleFromTeam return error: %v\", err)\n\t}\n\tif !cmp.Equal(resp.StatusCode, http.StatusNoContent) {\n\t\tt.Errorf(\"Organizations.RemoveOrgRoleFromTeam returned status code %+v, want %+v\", resp.StatusCode, http.StatusNoContent)\n\t}\n\n\tconst methodName = \"RemoveOrgRoleFromTeam\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Organizations.RemoveOrgRoleFromTeam(ctx, \"\\no\", \"\\nt\", -8030)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.RemoveOrgRoleFromTeam(ctx, \"o\", \"t\", 8030)\n\t})\n}\n\nfunc TestOrganizationsService_AssignOrgRoleToUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/organization-roles/users/t/8030\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Organizations.AssignOrgRoleToUser(ctx, \"o\", \"t\", 8030)\n\tif err != nil {\n\t\tt.Errorf(\"Organization.AssignOrgRoleToUser return error: %v\", err)\n\t}\n\tif !cmp.Equal(resp.StatusCode, http.StatusNoContent) {\n\t\tt.Errorf(\"Organizations.AssignOrgRoleToUser returned status code %+v, want %+v\", resp.StatusCode, http.StatusNoContent)\n\t}\n\n\tconst methodName = \"AssignOrgRoleToUser\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Organizations.AssignOrgRoleToUser(ctx, \"\\no\", \"\\nt\", -8030)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.AssignOrgRoleToUser(ctx, \"o\", \"t\", 8030)\n\t})\n}\n\nfunc TestOrganizationsService_RemoveOrgRoleFromUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/organization-roles/users/t/8030\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Organizations.RemoveOrgRoleFromUser(ctx, \"o\", \"t\", 8030)\n\tif err != nil {\n\t\tt.Errorf(\"Organization.RemoveOrgRoleFromUser return error: %v\", err)\n\t}\n\tif !cmp.Equal(resp.StatusCode, http.StatusNoContent) {\n\t\tt.Errorf(\"Organizations.RemoveOrgRoleFromUser returned status code %+v, want %+v\", resp.StatusCode, http.StatusNoContent)\n\t}\n\n\tconst methodName = \"RemoveOrgRoleFromUser\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Organizations.RemoveOrgRoleFromUser(ctx, \"\\no\", \"\\nt\", -8030)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.RemoveOrgRoleFromUser(ctx, \"o\", \"t\", 8030)\n\t})\n}\n\nfunc TestOrganizationsService_ListTeamsAssignedToOrgRole(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/organization-roles/1729/teams\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tapps, _, err := client.Organizations.ListTeamsAssignedToOrgRole(ctx, \"o\", 1729, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListTeamsAssignedToOrgRole returned error: %v\", err)\n\t}\n\n\twant := []*Team{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(apps, want) {\n\t\tt.Errorf(\"Organizations.ListTeamsAssignedToOrgRole returned %+v, want %+v\", apps, want)\n\t}\n\n\tconst methodName = \"ListTeamsAssignedToOrgRole\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListTeamsAssignedToOrgRole(ctx, \"\\no\", 1729, opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListTeamsAssignedToOrgRole(ctx, \"o\", 1729, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_ListUsersAssignedToOrgRole(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/organization-roles/1729/users\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tapps, _, err := client.Organizations.ListUsersAssignedToOrgRole(ctx, \"o\", 1729, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListUsersAssignedToOrgRole returned error: %v\", err)\n\t}\n\n\twant := []*User{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(apps, want) {\n\t\tt.Errorf(\"Organizations.ListUsersAssignedToOrgRole returned %+v, want %+v\", apps, want)\n\t}\n\n\tconst methodName = \"ListUsersAssignedToOrgRole\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListUsersAssignedToOrgRole(ctx, \"\\no\", 1729, opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListUsersAssignedToOrgRole(ctx, \"o\", 1729, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_ListFineGrainedPermissions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/organization-fine-grained-permissions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"name\":\"p1\", \"description\":\"d1\"}]`)\n\t})\n\n\tctx := t.Context()\n\tpermissions, _, err := client.Organizations.ListFineGrainedPermissions(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListFineGrainedPermissions returned error: %v\", err)\n\t}\n\n\twant := []*OrganizationFineGrainedPermission{{Name: \"p1\", Description: \"d1\"}}\n\tif !cmp.Equal(permissions, want) {\n\t\tt.Errorf(\"Organizations.ListFineGrainedPermissions returned %+v, want %+v\", permissions, want)\n\t}\n\n\tconst methodName = \"ListFineGrainedPermissions\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListFineGrainedPermissions(ctx, \"\\no\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListFineGrainedPermissions(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/orgs_outside_collaborators.go",
    "content": "// Copyright 2017 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// ListOutsideCollaboratorsOptions specifies optional parameters to the\n// OrganizationsService.ListOutsideCollaborators method.\ntype ListOutsideCollaboratorsOptions struct {\n\t// Filter outside collaborators returned in the list. Possible values are:\n\t// 2fa_disabled, all.  Default is \"all\".\n\tFilter string `url:\"filter,omitempty\"`\n\n\tListOptions\n}\n\n// ListOutsideCollaborators lists outside collaborators of organization's repositories.\n// This will only work if the authenticated\n// user is an owner of the organization.\n//\n// Warning: The API may change without advance notice during the preview period.\n// Preview features are not supported for production use.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/outside-collaborators#list-outside-collaborators-for-an-organization\n//\n//meta:operation GET /orgs/{org}/outside_collaborators\nfunc (s *OrganizationsService) ListOutsideCollaborators(ctx context.Context, org string, opts *ListOutsideCollaboratorsOptions) ([]*User, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/outside_collaborators\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar members []*User\n\tresp, err := s.client.Do(ctx, req, &members)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn members, resp, nil\n}\n\n// RemoveOutsideCollaborator removes a user from the list of outside collaborators;\n// consequently, removing them from all the organization's repositories.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization\n//\n//meta:operation DELETE /orgs/{org}/outside_collaborators/{username}\nfunc (s *OrganizationsService) RemoveOutsideCollaborator(ctx context.Context, org, user string) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/outside_collaborators/%v\", org, user)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// ConvertMemberToOutsideCollaborator reduces the permission level of a member of the\n// organization to that of an outside collaborator. Therefore, they will only\n// have access to the repositories that their current team membership allows.\n// Responses for converting a non-member or the last owner to an outside collaborator\n// are listed in GitHub API docs.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator\n//\n//meta:operation PUT /orgs/{org}/outside_collaborators/{username}\nfunc (s *OrganizationsService) ConvertMemberToOutsideCollaborator(ctx context.Context, org, user string) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/outside_collaborators/%v\", org, user)\n\treq, err := s.client.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/orgs_outside_collaborators_test.go",
    "content": "// Copyright 2017 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestOrganizationsService_ListOutsideCollaborators(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/outside_collaborators\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"filter\": \"2fa_disabled\",\n\t\t\t\"page\":   \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &ListOutsideCollaboratorsOptions{\n\t\tFilter:      \"2fa_disabled\",\n\t\tListOptions: ListOptions{Page: 2},\n\t}\n\tctx := t.Context()\n\tmembers, _, err := client.Organizations.ListOutsideCollaborators(ctx, \"o\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListOutsideCollaborators returned error: %v\", err)\n\t}\n\n\twant := []*User{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(members, want) {\n\t\tt.Errorf(\"Organizations.ListOutsideCollaborators returned %+v, want %+v\", members, want)\n\t}\n\n\tconst methodName = \"ListOutsideCollaborators\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListOutsideCollaborators(ctx, \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListOutsideCollaborators(ctx, \"o\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_ListOutsideCollaborators_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Organizations.ListOutsideCollaborators(ctx, \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestOrganizationsService_RemoveOutsideCollaborator(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\thandler := func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t}\n\tmux.HandleFunc(\"/orgs/o/outside_collaborators/u\", handler)\n\n\tctx := t.Context()\n\t_, err := client.Organizations.RemoveOutsideCollaborator(ctx, \"o\", \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.RemoveOutsideCollaborator returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveOutsideCollaborator\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Organizations.RemoveOutsideCollaborator(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.RemoveOutsideCollaborator(ctx, \"o\", \"u\")\n\t})\n}\n\nfunc TestOrganizationsService_RemoveOutsideCollaborator_NonMember(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\thandler := func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t}\n\tmux.HandleFunc(\"/orgs/o/outside_collaborators/u\", handler)\n\n\tctx := t.Context()\n\t_, err := client.Organizations.RemoveOutsideCollaborator(ctx, \"o\", \"u\")\n\tvar rerr *ErrorResponse\n\tif !errors.As(err, &rerr) {\n\t\tt.Error(\"Organizations.RemoveOutsideCollaborator did not return an error\")\n\t} else if rerr.Response.StatusCode != http.StatusNotFound {\n\t\tt.Error(\"Organizations.RemoveOutsideCollaborator did not return 404 status code\")\n\t}\n}\n\nfunc TestOrganizationsService_RemoveOutsideCollaborator_Member(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\thandler := func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusUnprocessableEntity)\n\t}\n\tmux.HandleFunc(\"/orgs/o/outside_collaborators/u\", handler)\n\n\tctx := t.Context()\n\t_, err := client.Organizations.RemoveOutsideCollaborator(ctx, \"o\", \"u\")\n\tvar rerr *ErrorResponse\n\tif !errors.As(err, &rerr) {\n\t\tt.Error(\"Organizations.RemoveOutsideCollaborator did not return an error\")\n\t} else if rerr.Response.StatusCode != http.StatusUnprocessableEntity {\n\t\tt.Error(\"Organizations.RemoveOutsideCollaborator did not return 422 status code\")\n\t}\n}\n\nfunc TestOrganizationsService_ConvertMemberToOutsideCollaborator(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\thandler := func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t}\n\tmux.HandleFunc(\"/orgs/o/outside_collaborators/u\", handler)\n\n\tctx := t.Context()\n\t_, err := client.Organizations.ConvertMemberToOutsideCollaborator(ctx, \"o\", \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ConvertMemberToOutsideCollaborator returned error: %v\", err)\n\t}\n\n\tconst methodName = \"ConvertMemberToOutsideCollaborator\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Organizations.ConvertMemberToOutsideCollaborator(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.ConvertMemberToOutsideCollaborator(ctx, \"o\", \"u\")\n\t})\n}\n\nfunc TestOrganizationsService_ConvertMemberToOutsideCollaborator_NonMemberOrLastOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\thandler := func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tw.WriteHeader(http.StatusForbidden)\n\t}\n\tmux.HandleFunc(\"/orgs/o/outside_collaborators/u\", handler)\n\n\tctx := t.Context()\n\t_, err := client.Organizations.ConvertMemberToOutsideCollaborator(ctx, \"o\", \"u\")\n\tvar rerr *ErrorResponse\n\tif !errors.As(err, &rerr) {\n\t\tt.Error(\"Organizations.ConvertMemberToOutsideCollaborator did not return an error\")\n\t} else if rerr.Response.StatusCode != http.StatusForbidden {\n\t\tt.Error(\"Organizations.ConvertMemberToOutsideCollaborator did not return 403 status code\")\n\t}\n}\n"
  },
  {
    "path": "github/orgs_packages.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/url\"\n)\n\n// ListPackages lists the packages for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/packages/packages#list-packages-for-an-organization\n//\n//meta:operation GET /orgs/{org}/packages\nfunc (s *OrganizationsService) ListPackages(ctx context.Context, org string, opts *PackageListOptions) ([]*Package, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/packages\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar packages []*Package\n\tresp, err := s.client.Do(ctx, req, &packages)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn packages, resp, nil\n}\n\n// GetPackage gets a package by name from an organization.\n//\n// Note that packageName is escaped for the URL path so that you don't need to.\n//\n// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-for-an-organization\n//\n//meta:operation GET /orgs/{org}/packages/{package_type}/{package_name}\nfunc (s *OrganizationsService) GetPackage(ctx context.Context, org, packageType, packageName string) (*Package, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/packages/%v/%v\", org, packageType, url.PathEscape(packageName))\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar pack *Package\n\tresp, err := s.client.Do(ctx, req, &pack)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn pack, resp, nil\n}\n\n// DeletePackage deletes a package from an organization.\n//\n// Note that packageName is escaped for the URL path so that you don't need to.\n//\n// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-for-an-organization\n//\n//meta:operation DELETE /orgs/{org}/packages/{package_type}/{package_name}\nfunc (s *OrganizationsService) DeletePackage(ctx context.Context, org, packageType, packageName string) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/packages/%v/%v\", org, packageType, url.PathEscape(packageName))\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// RestorePackage restores a package to an organization.\n//\n// Note that packageName is escaped for the URL path so that you don't need to.\n//\n// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-for-an-organization\n//\n//meta:operation POST /orgs/{org}/packages/{package_type}/{package_name}/restore\nfunc (s *OrganizationsService) RestorePackage(ctx context.Context, org, packageType, packageName string) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/packages/%v/%v/restore\", org, packageType, url.PathEscape(packageName))\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// PackageGetAllVersions gets all versions of a package in an organization.\n//\n// Note that packageName is escaped for the URL path so that you don't need to.\n//\n// GitHub API docs: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-an-organization\n//\n//meta:operation GET /orgs/{org}/packages/{package_type}/{package_name}/versions\nfunc (s *OrganizationsService) PackageGetAllVersions(ctx context.Context, org, packageType, packageName string, opts *PackageListOptions) ([]*PackageVersion, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/packages/%v/%v/versions\", org, packageType, url.PathEscape(packageName))\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar versions []*PackageVersion\n\tresp, err := s.client.Do(ctx, req, &versions)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn versions, resp, nil\n}\n\n// PackageGetVersion gets a specific version of a package in an organization.\n//\n// Note that packageName is escaped for the URL path so that you don't need to.\n//\n// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-version-for-an-organization\n//\n//meta:operation GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}\nfunc (s *OrganizationsService) PackageGetVersion(ctx context.Context, org, packageType, packageName string, packageVersionID int64) (*PackageVersion, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/packages/%v/%v/versions/%v\", org, packageType, url.PathEscape(packageName), packageVersionID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar version *PackageVersion\n\tresp, err := s.client.Do(ctx, req, &version)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn version, resp, nil\n}\n\n// PackageDeleteVersion deletes a package version from an organization.\n//\n// Note that packageName is escaped for the URL path so that you don't need to.\n//\n// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-package-version-for-an-organization\n//\n//meta:operation DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}\nfunc (s *OrganizationsService) PackageDeleteVersion(ctx context.Context, org, packageType, packageName string, packageVersionID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/packages/%v/%v/versions/%v\", org, packageType, url.PathEscape(packageName), packageVersionID)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// PackageRestoreVersion restores a package version to an organization.\n//\n// Note that packageName is escaped for the URL path so that you don't need to.\n//\n// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-package-version-for-an-organization\n//\n//meta:operation POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\nfunc (s *OrganizationsService) PackageRestoreVersion(ctx context.Context, org, packageType, packageName string, packageVersionID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/packages/%v/%v/versions/%v/restore\", org, packageType, url.PathEscape(packageName), packageVersionID)\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/orgs_packages_test.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"io\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestOrganizationsService_ListPackages(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/packages\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\t_, err := io.WriteString(w, `[{\n\t\t\t\"id\": 197,\n\t\t\t\"name\": \"hello_docker\",\n\t\t\t\"package_type\": \"container\",\n\t\t\t\"owner\": {\n\t\t\t  \"login\": \"github\",\n\t\t\t  \"id\": 9919,\n\t\t\t  \"node_id\": \"MDEyOk9yZ2FuaXphdGlvbjk5MTk=\",\n\t\t\t  \"avatar_url\": \"https://avatars.githubusercontent.com/u/9919?v=4\",\n\t\t\t  \"gravatar_id\": \"\",\n\t\t\t  \"url\": \"https://api.github.com/users/github\",\n\t\t\t  \"html_url\": \"https://github.com/github\",\n\t\t\t  \"followers_url\": \"https://api.github.com/users/github/followers\",\n\t\t\t  \"following_url\": \"https://api.github.com/users/github/following{/other_user}\",\n\t\t\t  \"gists_url\": \"https://api.github.com/users/github/gists{/gist_id}\",\n\t\t\t  \"starred_url\": \"https://api.github.com/users/github/starred{/owner}{/repo}\",\n\t\t\t  \"subscriptions_url\": \"https://api.github.com/users/github/subscriptions\",\n\t\t\t  \"organizations_url\": \"https://api.github.com/users/github/orgs\",\n\t\t\t  \"repos_url\": \"https://api.github.com/users/github/repos\",\n\t\t\t  \"events_url\": \"https://api.github.com/users/github/events{/privacy}\",\n\t\t\t  \"received_events_url\": \"https://api.github.com/users/github/received_events\",\n\t\t\t  \"type\": \"Organization\",\n\t\t\t  \"site_admin\": false\n\t\t\t},\n\t\t\t\"version_count\": 1,\n\t\t\t\"visibility\": \"private\",\n\t\t\t\"url\": \"https://api.github.com/orgs/github/packages/container/hello_docker\",\n\t\t\t\"created_at\": `+referenceTimeStr+`,\n\t\t\t\"updated_at\": `+referenceTimeStr+`,\n\t\t\t\"html_url\": \"https://github.com/orgs/github/packages/container/package/hello_docker\"\n\t\t  }\n\t\t  ]`)\n\t\tif err != nil {\n\t\t\tt.Fatal(\"Failed to write test response: \", err)\n\t\t}\n\t})\n\n\tctx := t.Context()\n\tpackages, _, err := client.Organizations.ListPackages(ctx, \"o\", &PackageListOptions{})\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListPackages returned error: %v\", err)\n\t}\n\n\twant := []*Package{{\n\t\tID:           Ptr(int64(197)),\n\t\tName:         Ptr(\"hello_docker\"),\n\t\tPackageType:  Ptr(\"container\"),\n\t\tVersionCount: Ptr(int64(1)),\n\t\tVisibility:   Ptr(\"private\"),\n\t\tURL:          Ptr(\"https://api.github.com/orgs/github/packages/container/hello_docker\"),\n\t\tHTMLURL:      Ptr(\"https://github.com/orgs/github/packages/container/package/hello_docker\"),\n\t\tCreatedAt:    &Timestamp{referenceTime},\n\t\tUpdatedAt:    &Timestamp{referenceTime},\n\t\tOwner: &User{\n\t\t\tLogin:             Ptr(\"github\"),\n\t\t\tID:                Ptr(int64(9919)),\n\t\t\tNodeID:            Ptr(\"MDEyOk9yZ2FuaXphdGlvbjk5MTk=\"),\n\t\t\tAvatarURL:         Ptr(\"https://avatars.githubusercontent.com/u/9919?v=4\"),\n\t\t\tGravatarID:        Ptr(\"\"),\n\t\t\tURL:               Ptr(\"https://api.github.com/users/github\"),\n\t\t\tHTMLURL:           Ptr(\"https://github.com/github\"),\n\t\t\tFollowersURL:      Ptr(\"https://api.github.com/users/github/followers\"),\n\t\t\tFollowingURL:      Ptr(\"https://api.github.com/users/github/following{/other_user}\"),\n\t\t\tGistsURL:          Ptr(\"https://api.github.com/users/github/gists{/gist_id}\"),\n\t\t\tStarredURL:        Ptr(\"https://api.github.com/users/github/starred{/owner}{/repo}\"),\n\t\t\tSubscriptionsURL:  Ptr(\"https://api.github.com/users/github/subscriptions\"),\n\t\t\tOrganizationsURL:  Ptr(\"https://api.github.com/users/github/orgs\"),\n\t\t\tReposURL:          Ptr(\"https://api.github.com/users/github/repos\"),\n\t\t\tEventsURL:         Ptr(\"https://api.github.com/users/github/events{/privacy}\"),\n\t\t\tReceivedEventsURL: Ptr(\"https://api.github.com/users/github/received_events\"),\n\t\t\tType:              Ptr(\"Organization\"),\n\t\t\tSiteAdmin:         Ptr(false),\n\t\t},\n\t}}\n\tif !cmp.Equal(packages, want) {\n\t\tt.Errorf(\"Organizations.ListPackages returned %+v, want %+v\", packages, want)\n\t}\n\n\tconst methodName = \"ListPackages\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListPackages(ctx, \"\\n\", &PackageListOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListPackages(ctx, \"o\", &PackageListOptions{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_GetPackage(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\t// don't url escape the package name here since mux will convert it to a slash automatically\n\tmux.HandleFunc(\"/orgs/o/packages/container/hello%2fhello_docker\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\t_, err := io.WriteString(w, `{\n\t\t\t\"id\": 197,\n\t\t\t\"name\": \"hello/hello_docker\",\n\t\t\t\"package_type\": \"container\",\n\t\t\t\"version_count\": 1,\n\t\t\t\"visibility\": \"private\",\n\t\t\t\"url\": \"https://api.github.com/orgs/github/packages/container/hello%2Fhello_docker\",\n\t\t\t\"created_at\": `+referenceTimeStr+`,\n\t\t\t\"updated_at\": `+referenceTimeStr+`,\n\t\t\t\"html_url\": \"https://github.com/orgs/github/packages/container/package/hello%2Fhello_docker\"\n\t\t  }`)\n\t\tif err != nil {\n\t\t\tt.Fatal(\"Failed to write test response: \", err)\n\t\t}\n\t})\n\n\tctx := t.Context()\n\tpackages, _, err := client.Organizations.GetPackage(ctx, \"o\", \"container\", \"hello/hello_docker\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.GetPackage returned error: %v\", err)\n\t}\n\n\twant := &Package{\n\t\tID:           Ptr(int64(197)),\n\t\tName:         Ptr(\"hello/hello_docker\"),\n\t\tPackageType:  Ptr(\"container\"),\n\t\tVersionCount: Ptr(int64(1)),\n\t\tVisibility:   Ptr(\"private\"),\n\t\tURL:          Ptr(\"https://api.github.com/orgs/github/packages/container/hello%2Fhello_docker\"),\n\t\tHTMLURL:      Ptr(\"https://github.com/orgs/github/packages/container/package/hello%2Fhello_docker\"),\n\t\tCreatedAt:    &Timestamp{referenceTime},\n\t\tUpdatedAt:    &Timestamp{referenceTime},\n\t}\n\tif !cmp.Equal(packages, want) {\n\t\tt.Errorf(\"Organizations.GetPackage returned %+v, want %+v\", packages, want)\n\t}\n\n\tconst methodName = \"GetPackage\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.GetPackage(ctx, \"\\n\", \"\", \"\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.GetPackage(ctx, \"\", \"\", \"\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_DeletePackage(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\t// don't url escape the package name here since mux will convert it to a slash automatically\n\tmux.HandleFunc(\"/orgs/o/packages/container/hello%2fhello_docker\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Organizations.DeletePackage(ctx, \"o\", \"container\", \"hello/hello_docker\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.DeletePackage returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeletePackage\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.GetPackage(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.GetPackage(ctx, \"\", \"\", \"\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_RestorePackage(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\t// don't url escape the package name here since mux will convert it to a slash automatically\n\tmux.HandleFunc(\"/orgs/o/packages/container/hello%2Fhello_docker/restore\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Organizations.RestorePackage(ctx, \"o\", \"container\", \"hello/hello_docker\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.RestorePackage returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RestorePackage\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Organizations.RestorePackage(ctx, \"\\n\", \"\", \"\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.RestorePackage(ctx, \"\", \"container\", \"hello/hello_docker\")\n\t})\n}\n\nfunc TestOrganizationsService_ListPackagesVersions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tm := `{\n\t\t\"package_type\": \"container\",\n\t\t\"container\": {\n\t\t\t\"tags\": [\n\t\t\t\"latest\"\n\t\t\t]\n\t\t}\n\t}`\n\n\t// don't url escape the package name here since mux will convert it to a slash automatically\n\tmux.HandleFunc(\"/orgs/o/packages/container/hello%2Fhello_docker/versions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"1\", \"state\": \"deleted\", \"visibility\": \"internal\", \"package_type\": \"container\"})\n\t\t_, err := io.WriteString(w, `[\n\t\t\t{\n\t\t\t  \"id\": 45763,\n\t\t\t  \"name\": \"sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9\",\n\t\t\t  \"url\": \"https://api.github.com/users/octocat/packages/container/hello%2Fhello_docker/versions/45763\",\n\t\t\t  \"package_html_url\": \"https://github.com/users/octocat/packages/container/package/hello%2Fhello_docker\",\n\t\t\t  \"created_at\": `+referenceTimeStr+`,\n\t\t\t  \"updated_at\": `+referenceTimeStr+`,\n\t\t\t  \"html_url\": \"https://github.com/users/octocat/packages/container/hello%2Fhello_docker/45763\",\n\t\t\t  \"metadata\": `+m+`\n\t\t\t}]`)\n\t\tif err != nil {\n\t\t\tt.Fatal(\"Failed to write test response: \", err)\n\t\t}\n\t})\n\n\tctx := t.Context()\n\topts := &PackageListOptions{\n\t\tPtr(\"internal\"), Ptr(\"container\"), Ptr(\"deleted\"), ListOptions{Page: 1, PerPage: 2},\n\t}\n\tpackages, _, err := client.Organizations.PackageGetAllVersions(ctx, \"o\", \"container\", \"hello/hello_docker\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.PackageGetAllVersions returned error: %v\", err)\n\t}\n\n\twant := []*PackageVersion{{\n\t\tID:             Ptr(int64(45763)),\n\t\tName:           Ptr(\"sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9\"),\n\t\tURL:            Ptr(\"https://api.github.com/users/octocat/packages/container/hello%2Fhello_docker/versions/45763\"),\n\t\tPackageHTMLURL: Ptr(\"https://github.com/users/octocat/packages/container/package/hello%2Fhello_docker\"),\n\t\tCreatedAt:      &Timestamp{referenceTime},\n\t\tUpdatedAt:      &Timestamp{referenceTime},\n\t\tHTMLURL:        Ptr(\"https://github.com/users/octocat/packages/container/hello%2Fhello_docker/45763\"),\n\t\tMetadata:       json.RawMessage(m),\n\t}}\n\tif !cmp.Equal(packages, want) {\n\t\tt.Errorf(\"Organizations.PackageGetAllVersions returned %+v, want %+v\", packages, want)\n\t}\n\n\tconst methodName = \"PackageGetAllVersions\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.PackageGetAllVersions(ctx, \"\\n\", \"\", \"\", &PackageListOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.PackageGetAllVersions(ctx, \"\", \"\", \"\", &PackageListOptions{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_PackageGetVersion(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tm := `{\n\t\t\"package_type\": \"container\",\n\t\t\"container\": {\n\t\t\t\"tags\": [\n\t\t\t\"latest\"\n\t\t\t]\n\t\t}\n\t}`\n\n\t// don't url escape the package name here since mux will convert it to a slash automatically\n\tmux.HandleFunc(\"/orgs/o/packages/container/hello%2Fhello_docker/versions/45763\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\t_, err := io.WriteString(w, `\n\t\t\t{\n\t\t\t  \"id\": 45763,\n\t\t\t  \"name\": \"sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9\",\n\t\t\t  \"url\": \"https://api.github.com/users/octocat/packages/container/hello%2Fhello_docker/versions/45763\",\n\t\t\t  \"package_html_url\": \"https://github.com/users/octocat/packages/container/package/hello%2Fhello_docker\",\n\t\t\t  \"created_at\": `+referenceTimeStr+`,\n\t\t\t  \"updated_at\": `+referenceTimeStr+`,\n\t\t\t  \"html_url\": \"https://github.com/users/octocat/packages/container/hello%2Fhello_docker/45763\",\n\t\t\t  \"metadata\": `+m+`\n\t\t\t}`)\n\t\tif err != nil {\n\t\t\tt.Fatal(\"Failed to write test response: \", err)\n\t\t}\n\t})\n\n\tctx := t.Context()\n\tpackages, _, err := client.Organizations.PackageGetVersion(ctx, \"o\", \"container\", \"hello/hello_docker\", 45763)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.PackageGetVersion returned error: %v\", err)\n\t}\n\n\twant := &PackageVersion{\n\t\tID:             Ptr(int64(45763)),\n\t\tName:           Ptr(\"sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9\"),\n\t\tURL:            Ptr(\"https://api.github.com/users/octocat/packages/container/hello%2Fhello_docker/versions/45763\"),\n\t\tPackageHTMLURL: Ptr(\"https://github.com/users/octocat/packages/container/package/hello%2Fhello_docker\"),\n\t\tCreatedAt:      &Timestamp{referenceTime},\n\t\tUpdatedAt:      &Timestamp{referenceTime},\n\t\tHTMLURL:        Ptr(\"https://github.com/users/octocat/packages/container/hello%2Fhello_docker/45763\"),\n\t\tMetadata:       json.RawMessage(m),\n\t}\n\tif !cmp.Equal(packages, want) {\n\t\tt.Errorf(\"Organizations.PackageGetVersion returned %+v, want %+v\", packages, want)\n\t}\n\n\tconst methodName = \"PackageGetVersion\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.PackageGetVersion(ctx, \"\\n\", \"\", \"\", 0)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.PackageGetVersion(ctx, \"\", \"\", \"\", 45763)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_PackageDeleteVersion(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\t// don't url escape the package name here since mux will convert it to a slash automatically\n\tmux.HandleFunc(\"/orgs/o/packages/container/hello%2Fhello_docker/versions/45763\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Organizations.PackageDeleteVersion(ctx, \"o\", \"container\", \"hello/hello_docker\", 45763)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.PackageDeleteVersion returned error: %v\", err)\n\t}\n\n\tconst methodName = \"PackageDeleteVersion\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Organizations.PackageDeleteVersion(ctx, \"\\n\", \"\", \"\", 0)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.PackageDeleteVersion(ctx, \"\", \"\", \"\", 45763)\n\t})\n}\n\nfunc TestOrganizationsService_PackageRestoreVersion(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\t// don't url escape the package name here since mux will convert it to a slash automatically\n\tmux.HandleFunc(\"/orgs/o/packages/container/hello%2Fhello_docker/versions/45763/restore\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Organizations.PackageRestoreVersion(ctx, \"o\", \"container\", \"hello/hello_docker\", 45763)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.PackageRestoreVersion returned error: %v\", err)\n\t}\n\n\tconst methodName = \"PackageRestoreVersion\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Organizations.PackageRestoreVersion(ctx, \"\\n\", \"\", \"\", 0)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.PackageRestoreVersion(ctx, \"\", \"\", \"\", 45763)\n\t})\n}\n"
  },
  {
    "path": "github/orgs_personal_access_tokens.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net/url\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// PersonalAccessToken represents the minimal representation of an organization programmatic access grant.\n//\n// GitHub API docs: https://docs.github.com/en/rest/orgs/personal-access-tokens?apiVersion=2022-11-28\ntype PersonalAccessToken struct {\n\t// \"Unique identifier of the fine-grained personal access token.\n\t// The `pat_id` used to get details about an approved fine-grained personal access token.\n\tID *int64 `json:\"id\"`\n\n\t// Owner is the GitHub user associated with the token.\n\tOwner *User `json:\"owner\"`\n\n\t// RepositorySelection is the type of repository selection requested.\n\t// Possible values are: \"none\", \"all\", \"subset\".\n\tRepositorySelection *string `json:\"repository_selection\"`\n\n\t// URL to the list of repositories the fine-grained personal access token can access.\n\t// Only follow when `repository_selection` is `subset`.\n\tRepositoriesURL *string `json:\"repositories_url\"`\n\n\t// Permissions are the permissions requested, categorized by type.\n\tPermissions *PersonalAccessTokenPermissions `json:\"permissions\"`\n\n\t// Date and time when the fine-grained personal access token was approved to access the organization.\n\tAccessGrantedAt *Timestamp `json:\"access_granted_at\"`\n\n\t// Whether the associated fine-grained personal access token has expired.\n\tTokenExpired *bool `json:\"token_expired\"`\n\n\t// Date and time when the associated fine-grained personal access token expires.\n\tTokenExpiresAt *Timestamp `json:\"token_expires_at\"`\n\n\t// TokenID\n\tTokenID *int64 `json:\"token_id\"`\n\n\t// TokenName\n\tTokenName *string `json:\"token_name\"`\n\n\t// Date and time when the associated fine-grained personal access token was last used for authentication.\n\tTokenLastUsedAt *Timestamp `json:\"token_last_used_at\"`\n}\n\n// ListFineGrainedPATOptions specifies optional parameters to ListFineGrainedPersonalAccessTokens.\ntype ListFineGrainedPATOptions struct {\n\t// The property by which to sort the results.\n\t// Default: created_at\n\t// Value: created_at\n\tSort string `url:\"sort,omitempty\"`\n\n\t// The direction to sort the results by.\n\t// Default: desc\n\t// Value: asc, desc\n\tDirection string `url:\"direction,omitempty\"`\n\n\t// A list of owner usernames to use to filter the results.\n\tOwner []string `url:\"-\"`\n\n\t// The name of the repository to use to filter the results.\n\tRepository string `url:\"repository,omitempty\"`\n\n\t// The permission to use to filter the results.\n\tPermission string `url:\"permission,omitempty\"`\n\n\t// Only show fine-grained personal access tokens used before the given time.\n\t// This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.\n\tLastUsedBefore string `url:\"last_used_before,omitempty\"`\n\n\t// Only show fine-grained personal access tokens used after the given time.\n\t// This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.\n\tLastUsedAfter string `url:\"last_used_after,omitempty\"`\n\n\t// TokenID filters results by the given fine-grained personal access token IDs.\n\tTokenID []int64 `url:\"-\"`\n\n\tListOptions\n}\n\n// ListFineGrainedPersonalAccessTokens lists approved fine-grained personal access tokens owned by organization members that can access organization resources.\n// Only GitHub Apps can call this API, using the `Personal access tokens` organization permissions (read).\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/personal-access-tokens#list-fine-grained-personal-access-tokens-with-access-to-organization-resources\n//\n//meta:operation GET /orgs/{org}/personal-access-tokens\nfunc (s *OrganizationsService) ListFineGrainedPersonalAccessTokens(ctx context.Context, org string, opts *ListFineGrainedPATOptions) ([]*PersonalAccessToken, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/personal-access-tokens\", org)\n\t// The `owner` parameter is a special case that uses the `owner[]=...` format and needs a custom function to format it correctly.\n\tu, err := addListFineGrainedPATOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar pats []*PersonalAccessToken\n\n\tresp, err := s.client.Do(ctx, req, &pats)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn pats, resp, nil\n}\n\n// FineGrainedPersonalAccessTokenRequest represents the details of a request to access organization resources via a fine-grained personal access token.\ntype FineGrainedPersonalAccessTokenRequest struct {\n\t// Unique identifier of the request for access via fine-grained personal access token.\n\tID int64 `json:\"id\"`\n\n\t// Reason is the reason for the request.\n\tReason string `json:\"reason\"`\n\n\t// Owner is the GitHub user associated with the token.\n\tOwner User `json:\"owner\"`\n\n\t// RepositorySelection is the type of repository selection requested.\n\t// Possible values are: \"none\", \"all\", \"subset\".\n\tRepositorySelection string `json:\"repository_selection\"`\n\n\t// URL to the list of repositories the fine-grained personal access token can access.\n\t// Only follow when `repository_selection` is `subset`.\n\tRepositoriesURL string `json:\"repositories_url\"`\n\n\t// Permissions are the permissions requested, categorized by type.\n\tPermissions PersonalAccessTokenPermissions `json:\"permissions\"`\n\n\t// Date and time when the request was created.\n\tCreatedAt *Timestamp `json:\"created_at\"`\n\n\t// Whether the associated fine-grained personal access token has expired.\n\tTokenExpired bool `json:\"token_expired\"`\n\n\t// Date and time when the associated fine-grained personal access token expires.\n\tTokenExpiresAt *Timestamp `json:\"token_expires_at\"`\n\n\t// TokenID\n\tTokenID int64 `json:\"token_id\"`\n\n\t// TokenName\n\tTokenName string `json:\"token_name\"`\n\n\t// Date and time when the associated fine-grained personal access token was last used for authentication.\n\tTokenLastUsedAt *Timestamp `json:\"token_last_used_at\"`\n}\n\n// ListFineGrainedPersonalAccessTokenRequests lists requests to access organization resources via fine-grained personal access tokens.\n// Only GitHub Apps can call this API, using the `Personal access tokens` organization permissions (read).\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/personal-access-tokens#list-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens\n//\n//meta:operation GET /orgs/{org}/personal-access-token-requests\nfunc (s *OrganizationsService) ListFineGrainedPersonalAccessTokenRequests(ctx context.Context, org string, opts *ListFineGrainedPATOptions) ([]*FineGrainedPersonalAccessTokenRequest, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/personal-access-token-requests\", org)\n\t// The `owner` parameter is a special case that uses the `owner[]=...` format and needs a custom function to format it correctly.\n\tu, err := addListFineGrainedPATOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar pats []*FineGrainedPersonalAccessTokenRequest\n\tresp, err := s.client.Do(ctx, req, &pats)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn pats, resp, nil\n}\n\n// ReviewPersonalAccessTokenRequestOptions specifies the parameters to the ReviewPersonalAccessTokenRequest method.\ntype ReviewPersonalAccessTokenRequestOptions struct {\n\tAction string  `json:\"action\"`\n\tReason *string `json:\"reason,omitempty\"`\n}\n\n// ReviewPersonalAccessTokenRequest approves or denies a pending request to access organization resources via a fine-grained personal access token.\n// Only GitHub Apps can call this API, using the `organization_personal_access_token_requests: write` permission.\n// `action` can be one of `approve` or `deny`.\n//\n// 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\n//\n//meta:operation POST /orgs/{org}/personal-access-token-requests/{pat_request_id}\nfunc (s *OrganizationsService) ReviewPersonalAccessTokenRequest(ctx context.Context, org string, requestID int64, opts ReviewPersonalAccessTokenRequestOptions) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/personal-access-token-requests/%v\", org, requestID)\n\n\treq, err := s.client.NewRequest(\"POST\", u, &opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// addListFineGrainedPATOptions adds the owner and token_id parameters to the URL query string with the correct format if they are set.\n//\n// GitHub API expects the owner parameter to be a list of strings in the `owner[]=...` format.\n// For multiple owner and token_id values, the owner and token_id parameters are repeated in the query string.\n//\n// Example:\n// owner[]=user1&owner[]=user2&token_id[]=123&token_id[]=456\n// 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`.\n//\n// This function ensures the owner and token_id parameters are formatted correctly in the URL query string.\nfunc addListFineGrainedPATOptions(s string, opts *ListFineGrainedPATOptions) (string, error) {\n\tu, err := addOptions(s, opts)\n\tif err != nil {\n\t\treturn s, err\n\t}\n\n\tif opts == nil {\n\t\treturn \"\", errors.New(\"opts must be provided\")\n\t}\n\n\tif len(opts.Owner) > 0 {\n\t\townerVals := make([]string, len(opts.Owner))\n\t\tfor i, owner := range opts.Owner {\n\t\t\townerVals[i] = fmt.Sprintf(\"owner[]=%v\", url.QueryEscape(owner))\n\t\t}\n\t\townerQuery := strings.Join(ownerVals, \"&\")\n\n\t\tif strings.Contains(u, \"?\") {\n\t\t\tu += \"&\" + ownerQuery\n\t\t} else {\n\t\t\tu += \"?\" + ownerQuery\n\t\t}\n\t}\n\tif len(opts.TokenID) > 0 {\n\t\ttokenIDVals := make([]string, len(opts.TokenID))\n\t\tfor i, tokenID := range opts.TokenID {\n\t\t\ttokenIDVals[i] = fmt.Sprintf(\"token_id[]=%v\", url.QueryEscape(strconv.FormatInt(tokenID, 10)))\n\t\t}\n\t\ttokenIDQuery := strings.Join(tokenIDVals, \"&\")\n\n\t\tif strings.Contains(u, \"?\") {\n\t\t\tu += \"&\" + tokenIDQuery\n\t\t} else {\n\t\t\tu += \"?\" + tokenIDQuery\n\t\t}\n\t\treturn u, nil\n\t}\n\n\treturn u, nil\n}\n"
  },
  {
    "path": "github/orgs_personal_access_tokens_test.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestOrganizationsService_ListFineGrainedPersonalAccessTokens(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/personal-access-tokens\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValuesList(t, r, url.Values{\n\t\t\t\"per_page\":  {\"2\"},\n\t\t\t\"page\":      {\"2\"},\n\t\t\t\"sort\":      {\"created_at\"},\n\t\t\t\"direction\": {\"desc\"},\n\t\t\t\"owner[]\":   {\"octocat\", \"octodog\", \"otherbot\"},\n\t\t})\n\n\t\tfmt.Fprint(w, `\n\t\t[\n\t\t\t{\n\t\t\t\t\"id\": 25381,\n\t\t\t\t\"owner\": {\n\t\t\t\t\t\"login\": \"octocat\",\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"node_id\": \"MDQ6VXNlcjE=\",\n\t\t\t\t\t\"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n\t\t\t\t\t\"gravatar_id\": \"\",\n\t\t\t\t\t\"url\": \"https://api.github.com/users/octocat\",\n\t\t\t\t\t\"html_url\": \"https://github.com/octocat\",\n\t\t\t\t\t\"followers_url\": \"https://api.github.com/users/octocat/followers\",\n\t\t\t\t\t\"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n\t\t\t\t\t\"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n\t\t\t\t\t\"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n\t\t\t\t\t\"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n\t\t\t\t\t\"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n\t\t\t\t\t\"repos_url\": \"https://api.github.com/users/octocat/repos\",\n\t\t\t\t\t\"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n\t\t\t\t\t\"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n\t\t\t\t\t\"type\": \"User\",\n\t\t\t\t\t\"site_admin\": false\n\t\t\t\t},\n\t\t\t\t\"repository_selection\": \"all\",\n\t\t\t\t\"repositories_url\": \"https://api.github.com/organizations/652551/personal-access-tokens/25381/repositories\",\n\t\t\t\t\"permissions\": {\n\t\t\t\t\t\"organization\": {\n\t\t\t\t\t\t\"members\": \"read\"\n\t\t\t\t\t},\n\t\t\t\t\t\"repository\": {\n\t\t\t\t\t\t\"metadata\": \"read\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"access_granted_at\": \"2023-05-16T08:47:09.000-07:00\",\n\t\t\t\t\"token_expired\": false,\n\t\t\t\t\"token_expires_at\": \"2023-11-16T08:47:09.000-07:00\",\n\t\t\t\t\"token_last_used_at\": null\n\t\t\t}\n\t\t]`)\n\t})\n\n\topts := &ListFineGrainedPATOptions{\n\t\tListOptions: ListOptions{Page: 2, PerPage: 2},\n\t\tSort:        \"created_at\",\n\t\tDirection:   \"desc\",\n\t\tOwner:       []string{\"octocat\", \"octodog\", \"otherbot\"},\n\t}\n\tctx := t.Context()\n\ttokens, resp, err := client.Organizations.ListFineGrainedPersonalAccessTokens(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListFineGrainedPersonalAccessTokens returned error: %v\", err)\n\t}\n\n\twant := []*PersonalAccessToken{\n\t\t{\n\t\t\tID: Ptr(int64(25381)),\n\t\t\tOwner: &User{\n\t\t\t\tLogin:             Ptr(\"octocat\"),\n\t\t\t\tID:                Ptr(int64(1)),\n\t\t\t\tNodeID:            Ptr(\"MDQ6VXNlcjE=\"),\n\t\t\t\tAvatarURL:         Ptr(\"https://github.com/images/error/octocat_happy.gif\"),\n\t\t\t\tGravatarID:        Ptr(\"\"),\n\t\t\t\tURL:               Ptr(\"https://api.github.com/users/octocat\"),\n\t\t\t\tHTMLURL:           Ptr(\"https://github.com/octocat\"),\n\t\t\t\tFollowersURL:      Ptr(\"https://api.github.com/users/octocat/followers\"),\n\t\t\t\tFollowingURL:      Ptr(\"https://api.github.com/users/octocat/following{/other_user}\"),\n\t\t\t\tGistsURL:          Ptr(\"https://api.github.com/users/octocat/gists{/gist_id}\"),\n\t\t\t\tStarredURL:        Ptr(\"https://api.github.com/users/octocat/starred{/owner}{/repo}\"),\n\t\t\t\tSubscriptionsURL:  Ptr(\"https://api.github.com/users/octocat/subscriptions\"),\n\t\t\t\tOrganizationsURL:  Ptr(\"https://api.github.com/users/octocat/orgs\"),\n\t\t\t\tReposURL:          Ptr(\"https://api.github.com/users/octocat/repos\"),\n\t\t\t\tEventsURL:         Ptr(\"https://api.github.com/users/octocat/events{/privacy}\"),\n\t\t\t\tReceivedEventsURL: Ptr(\"https://api.github.com/users/octocat/received_events\"),\n\t\t\t\tType:              Ptr(\"User\"),\n\t\t\t\tSiteAdmin:         Ptr(false),\n\t\t\t},\n\t\t\tRepositorySelection: Ptr(\"all\"),\n\t\t\tRepositoriesURL:     Ptr(\"https://api.github.com/organizations/652551/personal-access-tokens/25381/repositories\"),\n\t\t\tPermissions: &PersonalAccessTokenPermissions{\n\t\t\t\tOrg:  map[string]string{\"members\": \"read\"},\n\t\t\t\tRepo: map[string]string{\"metadata\": \"read\"},\n\t\t\t},\n\t\t\tAccessGrantedAt: &Timestamp{time.Date(2023, time.May, 16, 8, 47, 9, 0, time.FixedZone(\"PDT\", -7*60*60))},\n\t\t\tTokenExpired:    Ptr(false),\n\t\t\tTokenExpiresAt:  &Timestamp{time.Date(2023, time.November, 16, 8, 47, 9, 0, time.FixedZone(\"PDT\", -7*60*60))},\n\t\t\tTokenLastUsedAt: nil,\n\t\t},\n\t}\n\tif !cmp.Equal(tokens, want) {\n\t\tt.Errorf(\"Organizations.ListFineGrainedPersonalAccessTokens returned %+v, want %+v\", tokens, want)\n\t}\n\n\tif resp == nil {\n\t\tt.Error(\"Organizations.ListFineGrainedPersonalAccessTokens returned nil response\")\n\t}\n\n\tconst methodName = \"ListFineGrainedPersonalAccessTokens\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListFineGrainedPersonalAccessTokens(ctx, \"o\", nil)\n\t\treturn err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListFineGrainedPersonalAccessTokens(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListFineGrainedPersonalAccessTokens(ctx, \"o\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_ListFineGrainedPersonalAccessTokens_ownerOnly(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/personal-access-tokens\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"owner[]\": \"octocat\"})\n\n\t\tfmt.Fprint(w, \"[]\")\n\t})\n\n\topts := &ListFineGrainedPATOptions{Owner: []string{\"octocat\"}}\n\tctx := t.Context()\n\t_, _, err := client.Organizations.ListFineGrainedPersonalAccessTokens(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListFineGrainedPersonalAccessTokens returned error: %v\", err)\n\t}\n}\n\nfunc TestOrganizationsService_ListFineGrainedPersonalAccessTokenRequests(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/personal-access-token-requests\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValuesList(t, r, url.Values{\n\t\t\t\"per_page\":   {\"2\"},\n\t\t\t\"page\":       {\"2\"},\n\t\t\t\"sort\":       {\"created_at\"},\n\t\t\t\"direction\":  {\"desc\"},\n\t\t\t\"owner[]\":    {\"octocat\", \"octodog\"},\n\t\t\t\"token_id[]\": {\"11579703\", \"11579704\"},\n\t\t})\n\n\t\tfmt.Fprint(w, `[\n\t\t\t{\n\t\t\t\t\"id\": 1848980,\n\t\t\t\t\"reason\": null,\n\t\t\t\t\"owner\": {\n\t\t\t\t\t\"login\": \"octocat\",\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"node_id\": \"MDQ6VXNlcjE=\",\n\t\t\t\t\t\"avatar_url\": \"https://github.com/images/error/octocat_happy.gif\",\n\t\t\t\t\t\"gravatar_id\": \"\",\n\t\t\t\t\t\"url\": \"https://api.github.com/users/octocat\",\n\t\t\t\t\t\"html_url\": \"https://github.com/octocat\",\n\t\t\t\t\t\"followers_url\": \"https://api.github.com/users/octocat/followers\",\n\t\t\t\t\t\"following_url\": \"https://api.github.com/users/octocat/following{/other_user}\",\n\t\t\t\t\t\"gists_url\": \"https://api.github.com/users/octocat/gists{/gist_id}\",\n\t\t\t\t\t\"starred_url\": \"https://api.github.com/users/octocat/starred{/owner}{/repo}\",\n\t\t\t\t\t\"subscriptions_url\": \"https://api.github.com/users/octocat/subscriptions\",\n\t\t\t\t\t\"organizations_url\": \"https://api.github.com/users/octocat/orgs\",\n\t\t\t\t\t\"repos_url\": \"https://api.github.com/users/octocat/repos\",\n\t\t\t\t\t\"events_url\": \"https://api.github.com/users/octocat/events{/privacy}\",\n\t\t\t\t\t\"received_events_url\": \"https://api.github.com/users/octocat/received_events\",\n\t\t\t\t\t\"type\": \"User\",\n\t\t\t\t\t\"site_admin\": false\n\t\t\t\t},\n\t\t\t\t\"repository_selection\": \"all\",\n\t\t\t\t\"repositories_url\": \"https://api.github.com/organizations/135028681/personal-access-token-requests/1848980/repositories\",\n\t\t\t\t\"permissions\": {\n\t\t\t\t\t\"repository\": {\n\t\t\t\t\t\t\"metadata\": \"read\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"created_at\": \"2026-02-17T06:49:30Z\",\n\t\t\t\t\"token_id\": 11579703,\n\t\t\t\t\"token_name\": \"testFineGrained\",\n\t\t\t\t\"token_expired\": false,\n\t\t\t\t\"token_expires_at\": \"2026-04-18T06:49:30Z\",\n\t\t\t\t\"token_last_used_at\": null\n\t\t\t}\n\t\t]`)\n\t})\n\n\topts := &ListFineGrainedPATOptions{\n\t\tListOptions: ListOptions{Page: 2, PerPage: 2},\n\t\tSort:        \"created_at\",\n\t\tDirection:   \"desc\",\n\t\tOwner:       []string{\"octocat\", \"octodog\"},\n\t\tTokenID:     []int64{11579703, 11579704},\n\t}\n\tctx := t.Context()\n\trequests, resp, err := client.Organizations.ListFineGrainedPersonalAccessTokenRequests(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListFineGrainedPersonalAccessTokenRequests returned error: %v\", err)\n\t}\n\n\twant := []*FineGrainedPersonalAccessTokenRequest{\n\t\t{\n\t\t\tID:     1848980,\n\t\t\tReason: \"\",\n\t\t\tOwner: User{\n\t\t\t\tLogin:             Ptr(\"octocat\"),\n\t\t\t\tID:                Ptr(int64(1)),\n\t\t\t\tNodeID:            Ptr(\"MDQ6VXNlcjE=\"),\n\t\t\t\tAvatarURL:         Ptr(\"https://github.com/images/error/octocat_happy.gif\"),\n\t\t\t\tGravatarID:        Ptr(\"\"),\n\t\t\t\tURL:               Ptr(\"https://api.github.com/users/octocat\"),\n\t\t\t\tHTMLURL:           Ptr(\"https://github.com/octocat\"),\n\t\t\t\tFollowersURL:      Ptr(\"https://api.github.com/users/octocat/followers\"),\n\t\t\t\tFollowingURL:      Ptr(\"https://api.github.com/users/octocat/following{/other_user}\"),\n\t\t\t\tGistsURL:          Ptr(\"https://api.github.com/users/octocat/gists{/gist_id}\"),\n\t\t\t\tStarredURL:        Ptr(\"https://api.github.com/users/octocat/starred{/owner}{/repo}\"),\n\t\t\t\tSubscriptionsURL:  Ptr(\"https://api.github.com/users/octocat/subscriptions\"),\n\t\t\t\tOrganizationsURL:  Ptr(\"https://api.github.com/users/octocat/orgs\"),\n\t\t\t\tReposURL:          Ptr(\"https://api.github.com/users/octocat/repos\"),\n\t\t\t\tEventsURL:         Ptr(\"https://api.github.com/users/octocat/events{/privacy}\"),\n\t\t\t\tReceivedEventsURL: Ptr(\"https://api.github.com/users/octocat/received_events\"),\n\t\t\t\tType:              Ptr(\"User\"),\n\t\t\t\tSiteAdmin:         Ptr(false),\n\t\t\t},\n\t\t\tRepositorySelection: \"all\",\n\t\t\tRepositoriesURL:     \"https://api.github.com/organizations/135028681/personal-access-token-requests/1848980/repositories\",\n\t\t\tPermissions: PersonalAccessTokenPermissions{\n\t\t\t\tRepo: map[string]string{\"metadata\": \"read\"},\n\t\t\t},\n\t\t\tCreatedAt:       &Timestamp{time.Date(2026, time.February, 17, 6, 49, 30, 0, time.UTC)},\n\t\t\tTokenID:         11579703,\n\t\t\tTokenName:       \"testFineGrained\",\n\t\t\tTokenExpired:    false,\n\t\t\tTokenExpiresAt:  &Timestamp{time.Date(2026, time.April, 18, 6, 49, 30, 0, time.UTC)},\n\t\t\tTokenLastUsedAt: nil,\n\t\t},\n\t}\n\tif !cmp.Equal(requests, want) {\n\t\tt.Errorf(\"Organizations.ListFineGrainedPersonalAccessTokenRequests returned %+v, want %+v\", requests, want)\n\t}\n\n\tif resp == nil {\n\t\tt.Error(\"Organizations.ListFineGrainedPersonalAccessTokenRequests returned nil response\")\n\t}\n\n\tconst methodName = \"ListFineGrainedPersonalAccessTokenRequests\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListFineGrainedPersonalAccessTokenRequests(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListFineGrainedPersonalAccessTokenRequests(ctx, \"o\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_ListFineGrainedPersonalAccessTokenRequests_ownerOnly(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/personal-access-token-requests\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"owner[]\": \"octocat\"})\n\t\tfmt.Fprint(w, \"[]\")\n\t})\n\n\topts := &ListFineGrainedPATOptions{\n\t\tOwner: []string{\"octocat\"},\n\t}\n\tctx := t.Context()\n\t_, _, err := client.Organizations.ListFineGrainedPersonalAccessTokenRequests(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListFineGrainedPersonalAccessTokenRequests returned error: %v\", err)\n\t}\n}\n\nfunc TestOrganizationsService_ListFineGrainedPersonalAccessTokenRequests_tokenIDOnly(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/personal-access-token-requests\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"token_id[]\": \"11579703\"})\n\t\tfmt.Fprint(w, \"[]\")\n\t})\n\n\topts := &ListFineGrainedPATOptions{\n\t\tTokenID: []int64{11579703},\n\t}\n\tctx := t.Context()\n\t_, _, err := client.Organizations.ListFineGrainedPersonalAccessTokenRequests(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListFineGrainedPersonalAccessTokenRequests returned error: %v\", err)\n\t}\n}\n\nfunc TestOrganizationsService_ReviewPersonalAccessTokenRequest(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := ReviewPersonalAccessTokenRequestOptions{\n\t\tAction: \"a\",\n\t\tReason: Ptr(\"r\"),\n\t}\n\n\tmux.HandleFunc(\"/orgs/o/personal-access-token-requests/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *ReviewPersonalAccessTokenRequestOptions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, &input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tres, err := client.Organizations.ReviewPersonalAccessTokenRequest(ctx, \"o\", 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ReviewPersonalAccessTokenRequest returned error: %v\", err)\n\t}\n\n\tif res.StatusCode != http.StatusNoContent {\n\t\tt.Errorf(\"Organizations.ReviewPersonalAccessTokenRequest returned %v, want %v\", res.StatusCode, http.StatusNoContent)\n\t}\n\n\tconst methodName = \"ReviewPersonalAccessTokenRequest\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Organizations.ReviewPersonalAccessTokenRequest(ctx, \"\\n\", 0, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.ReviewPersonalAccessTokenRequest(ctx, \"o\", 1, input)\n\t})\n}\n\nfunc TestReviewPersonalAccessTokenRequestOptions_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ReviewPersonalAccessTokenRequestOptions{}, `{\"action\": \"\"}`)\n\n\tu := &ReviewPersonalAccessTokenRequestOptions{\n\t\tAction: \"a\",\n\t\tReason: Ptr(\"r\"),\n\t}\n\n\twant := `{\n\t\t\"action\": \"a\",\n\t\t\"reason\": \"r\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/orgs_properties.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"strconv\"\n)\n\n// PropertyValueType represents the type of a custom property value.\ntype PropertyValueType string\n\n// Valid values for CustomProperty.ValueType.\nconst (\n\tPropertyValueTypeString       PropertyValueType = \"string\"\n\tPropertyValueTypeSingleSelect PropertyValueType = \"single_select\"\n\tPropertyValueTypeMultiSelect  PropertyValueType = \"multi_select\"\n\tPropertyValueTypeTrueFalse    PropertyValueType = \"true_false\"\n\tPropertyValueTypeURL          PropertyValueType = \"url\"\n)\n\n// CustomProperty represents an organization custom property object.\ntype CustomProperty struct {\n\t// PropertyName is required for most endpoints except when calling CreateOrUpdateCustomProperty;\n\t// where this is sent in the path and thus can be omitted.\n\tPropertyName *string `json:\"property_name,omitempty\"`\n\t// The URL that can be used to fetch, update, or delete info about this property via the API.\n\tURL *string `json:\"url,omitempty\"`\n\t// SourceType is the source type of the property where it has been created. Can be one of: organization, enterprise.\n\tSourceType *string `json:\"source_type,omitempty\"`\n\t// The type of the value for the property. Can be one of: string, single_select, multi_select, true_false, url.\n\tValueType PropertyValueType `json:\"value_type\"`\n\t// Whether the property is required.\n\tRequired *bool `json:\"required,omitempty\"`\n\t// Default value of the property.\n\tDefaultValue any `json:\"default_value,omitempty\"`\n\t// Short description of the property.\n\tDescription *string `json:\"description,omitempty\"`\n\t// An ordered list of the allowed values of the property. The property can have up to 200\n\t// allowed values.\n\tAllowedValues []string `json:\"allowed_values,omitempty\"`\n\t// Who can edit the values of the property. Can be one of: org_actors, org_and_repo_actors, nil (null).\n\tValuesEditableBy *string `json:\"values_editable_by,omitempty\"`\n}\n\n// DefaultValueString returns the DefaultValue as a string if the ValueType is string or single_select or url.\nfunc (cp CustomProperty) DefaultValueString() (string, bool) {\n\tswitch cp.ValueType {\n\tcase PropertyValueTypeString, PropertyValueTypeSingleSelect, PropertyValueTypeURL:\n\t\ts, ok := cp.DefaultValue.(string)\n\t\treturn s, ok\n\tdefault:\n\t\treturn \"\", false\n\t}\n}\n\n// DefaultValueStrings returns the DefaultValue as a slice of string if the ValueType is multi_select.\nfunc (cp CustomProperty) DefaultValueStrings() ([]string, bool) {\n\tswitch cp.ValueType {\n\tcase PropertyValueTypeMultiSelect:\n\t\tswitch v := cp.DefaultValue.(type) {\n\t\tcase []string:\n\t\t\treturn v, true\n\t\tcase []any:\n\t\t\tvals := make([]string, len(v))\n\t\t\tfor i, item := range v {\n\t\t\t\ts, ok := item.(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, false\n\t\t\t\t}\n\t\t\t\tvals[i] = s\n\t\t\t}\n\t\t\treturn vals, true\n\t\tdefault:\n\t\t\treturn nil, false\n\t\t}\n\tdefault:\n\t\treturn nil, false\n\t}\n}\n\n// DefaultValueBool returns the DefaultValue as a string if the ValueType is true_false.\nfunc (cp CustomProperty) DefaultValueBool() (bool, bool) {\n\tswitch cp.ValueType {\n\tcase PropertyValueTypeTrueFalse:\n\t\tif s, ok := cp.DefaultValue.(string); ok {\n\t\t\tb, err := strconv.ParseBool(s)\n\t\t\treturn b, err == nil\n\t\t}\n\t\treturn false, false\n\tdefault:\n\t\treturn false, false\n\t}\n}\n\n// RepoCustomPropertyValue represents a repository custom property value.\ntype RepoCustomPropertyValue struct {\n\tRepositoryID       int64                  `json:\"repository_id\"`\n\tRepositoryName     string                 `json:\"repository_name\"`\n\tRepositoryFullName string                 `json:\"repository_full_name\"`\n\tProperties         []*CustomPropertyValue `json:\"properties\"`\n}\n\n// CustomPropertyValue represents a custom property value.\ntype CustomPropertyValue struct {\n\tPropertyName string `json:\"property_name\"`\n\tValue        any    `json:\"value\"`\n}\n\n// ListCustomPropertyValuesOptions specifies the optional parameters to the\n// OrganizationsService.ListCustomPropertyValues method.\ntype ListCustomPropertyValuesOptions struct {\n\tRepositoryQuery string `url:\"repository_query,omitempty\"`\n\tListOptions\n}\n\n// UnmarshalJSON implements the json.Unmarshaler interface.\n// This helps us handle the fact that Value can be either a string, []string, or nil.\nfunc (cpv *CustomPropertyValue) UnmarshalJSON(data []byte) error {\n\ttype aliasCustomPropertyValue CustomPropertyValue\n\taux := &struct {\n\t\t*aliasCustomPropertyValue\n\t}{\n\t\taliasCustomPropertyValue: (*aliasCustomPropertyValue)(cpv),\n\t}\n\tif err := json.Unmarshal(data, &aux); err != nil {\n\t\treturn err\n\t}\n\n\tswitch v := aux.Value.(type) {\n\tcase nil:\n\t\tcpv.Value = nil\n\tcase string:\n\t\tcpv.Value = v\n\tcase []any:\n\t\tstrSlice := make([]string, len(v))\n\t\tfor i, item := range v {\n\t\t\tstr, ok := item.(string)\n\t\t\tif !ok {\n\t\t\t\treturn errors.New(\"non-string value in string array\")\n\t\t\t}\n\t\t\tstrSlice[i] = str\n\t\t}\n\t\tcpv.Value = strSlice\n\tdefault:\n\t\treturn fmt.Errorf(\"unexpected value type: %T\", v)\n\t}\n\treturn nil\n}\n\n// GetAllCustomProperties gets all custom properties that are defined for the specified organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#get-all-custom-properties-for-an-organization\n//\n//meta:operation GET /orgs/{org}/properties/schema\nfunc (s *OrganizationsService) GetAllCustomProperties(ctx context.Context, org string) ([]*CustomProperty, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/properties/schema\", org)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar customProperties []*CustomProperty\n\tresp, err := s.client.Do(ctx, req, &customProperties)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn customProperties, resp, nil\n}\n\n// CreateOrUpdateCustomProperties creates new or updates existing custom properties that are defined for the specified organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-properties-for-an-organization\n//\n//meta:operation PATCH /orgs/{org}/properties/schema\nfunc (s *OrganizationsService) CreateOrUpdateCustomProperties(ctx context.Context, org string, properties []*CustomProperty) ([]*CustomProperty, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/properties/schema\", org)\n\n\tparams := struct {\n\t\tProperties []*CustomProperty `json:\"properties\"`\n\t}{\n\t\tProperties: properties,\n\t}\n\n\treq, err := s.client.NewRequest(\"PATCH\", u, params)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar customProperties []*CustomProperty\n\tresp, err := s.client.Do(ctx, req, &customProperties)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn customProperties, resp, nil\n}\n\n// GetCustomProperty gets a custom property that is defined for the specified organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#get-a-custom-property-for-an-organization\n//\n//meta:operation GET /orgs/{org}/properties/schema/{custom_property_name}\nfunc (s *OrganizationsService) GetCustomProperty(ctx context.Context, org, name string) (*CustomProperty, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/properties/schema/%v\", org, name)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar customProperty *CustomProperty\n\tresp, err := s.client.Do(ctx, req, &customProperty)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn customProperty, resp, nil\n}\n\n// CreateOrUpdateCustomProperty creates a new or updates an existing custom property that is defined for the specified organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#create-or-update-a-custom-property-for-an-organization\n//\n//meta:operation PUT /orgs/{org}/properties/schema/{custom_property_name}\nfunc (s *OrganizationsService) CreateOrUpdateCustomProperty(ctx context.Context, org, customPropertyName string, property *CustomProperty) (*CustomProperty, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/properties/schema/%v\", org, customPropertyName)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, property)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar customProperty *CustomProperty\n\tresp, err := s.client.Do(ctx, req, &customProperty)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn customProperty, resp, nil\n}\n\n// RemoveCustomProperty removes a custom property that is defined for the specified organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#remove-a-custom-property-for-an-organization\n//\n//meta:operation DELETE /orgs/{org}/properties/schema/{custom_property_name}\nfunc (s *OrganizationsService) RemoveCustomProperty(ctx context.Context, org, customPropertyName string) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/properties/schema/%v\", org, customPropertyName)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// ListCustomPropertyValues lists all custom property values for repositories in the specified organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#list-custom-property-values-for-organization-repositories\n//\n//meta:operation GET /orgs/{org}/properties/values\nfunc (s *OrganizationsService) ListCustomPropertyValues(ctx context.Context, org string, opts *ListCustomPropertyValuesOptions) ([]*RepoCustomPropertyValue, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/properties/values\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar repoCustomPropertyValues []*RepoCustomPropertyValue\n\tresp, err := s.client.Do(ctx, req, &repoCustomPropertyValues)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn repoCustomPropertyValues, resp, nil\n}\n\n// CreateOrUpdateRepoCustomPropertyValues creates new or updates existing custom property values across multiple repositories for the specified organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-property-values-for-organization-repositories\n//\n//meta:operation PATCH /orgs/{org}/properties/values\nfunc (s *OrganizationsService) CreateOrUpdateRepoCustomPropertyValues(ctx context.Context, org string, repoNames []string, properties []*CustomPropertyValue) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/properties/values\", org)\n\n\tparams := struct {\n\t\tRepositoryNames []string               `json:\"repository_names\"`\n\t\tProperties      []*CustomPropertyValue `json:\"properties\"`\n\t}{\n\t\tRepositoryNames: repoNames,\n\t\tProperties:      properties,\n\t}\n\n\treq, err := s.client.NewRequest(\"PATCH\", u, params)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/orgs_properties_test.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n\t\"github.com/google/go-cmp/cmp/cmpopts\"\n)\n\nfunc TestOrganizationsService_GetAllCustomProperties(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/properties/schema\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[\n  {\n    \"property_name\": \"name\",\n    \"value_type\": \"single_select\",\n    \"required\": true,\n    \"default_value\": \"production\",\n    \"description\": \"Prod or dev environment\",\n    \"allowed_values\":[\n      \"production\",\n      \"development\"\n    ],\n    \"values_editable_by\": \"org_actors\"\n  },\n  {\n    \"property_name\": \"test\",\n    \"value_type\": \"multi_select\",\n    \"required\": true,\n    \"default_value\": [\n      \"foo\",\n      \"baz\"\n    ],\n    \"description\": \"Prod or dev environment\",\n    \"allowed_values\":[\n      \"foo\",\n      \"bar\",\n\t\t\t\"baz\"\n    ],\n    \"values_editable_by\": \"org_actors\"\n  },\n  {\n    \"property_name\": \"service\",\n    \"value_type\": \"string\"\n  },\n  {\n    \"property_name\": \"team\",\n    \"value_type\": \"string\",\n    \"description\": \"Team owning the repository\"\n  },\n  {\n    \"property_name\": \"documentation\",\n    \"value_type\": \"url\",\n    \"required\": true,\n    \"description\": \"Link to the documentation\",\n    \"default_value\": \"https://example.com/docs\"\n  }\n]`)\n\t})\n\n\tctx := t.Context()\n\tproperties, _, err := client.Organizations.GetAllCustomProperties(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.GetAllCustomProperties returned error: %v\", err)\n\t}\n\n\twant := []*CustomProperty{\n\t\t{\n\t\t\tPropertyName:     Ptr(\"name\"),\n\t\t\tValueType:        PropertyValueTypeSingleSelect,\n\t\t\tRequired:         Ptr(true),\n\t\t\tDefaultValue:     \"production\",\n\t\t\tDescription:      Ptr(\"Prod or dev environment\"),\n\t\t\tAllowedValues:    []string{\"production\", \"development\"},\n\t\t\tValuesEditableBy: Ptr(\"org_actors\"),\n\t\t},\n\t\t{\n\t\t\tPropertyName:     Ptr(\"test\"),\n\t\t\tValueType:        PropertyValueTypeMultiSelect,\n\t\t\tRequired:         Ptr(true),\n\t\t\tDefaultValue:     []any{\"foo\", \"baz\"},\n\t\t\tDescription:      Ptr(\"Prod or dev environment\"),\n\t\t\tAllowedValues:    []string{\"foo\", \"bar\", \"baz\"},\n\t\t\tValuesEditableBy: Ptr(\"org_actors\"),\n\t\t},\n\t\t{\n\t\t\tPropertyName: Ptr(\"service\"),\n\t\t\tValueType:    PropertyValueTypeString,\n\t\t},\n\t\t{\n\t\t\tPropertyName: Ptr(\"team\"),\n\t\t\tValueType:    PropertyValueTypeString,\n\t\t\tDescription:  Ptr(\"Team owning the repository\"),\n\t\t},\n\t\t{\n\t\t\tPropertyName: Ptr(\"documentation\"),\n\t\t\tValueType:    PropertyValueTypeURL,\n\t\t\tRequired:     Ptr(true),\n\t\t\tDescription:  Ptr(\"Link to the documentation\"),\n\t\t\tDefaultValue: \"https://example.com/docs\",\n\t\t},\n\t}\n\n\tconst methodName = \"GetAllCustomProperties\"\n\n\tif diff := cmp.Diff(want, properties); diff != \"\" {\n\t\tt.Errorf(\"Organizations.%v diff mismatch (-want +got):\\n%v\", methodName, diff)\n\t}\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.GetAllCustomProperties(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_CreateOrUpdateCustomProperties(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/properties/schema\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\ttestBody(t, r, `{\"properties\":[{\"property_name\":\"name\",\"value_type\":\"single_select\",\"required\":true},{\"property_name\":\"service\",\"value_type\":\"string\"}]}`+\"\\n\")\n\t\tfmt.Fprint(w, `[\n\t\t{\n          \"property_name\": \"name\",\n          \"value_type\": \"single_select\",\n          \"required\": true\n        },\n        {\n          \"property_name\": \"service\",\n          \"value_type\": \"string\"\n        }\n        ]`)\n\t})\n\n\tctx := t.Context()\n\tproperties, _, err := client.Organizations.CreateOrUpdateCustomProperties(ctx, \"o\", []*CustomProperty{\n\t\t{\n\t\t\tPropertyName: Ptr(\"name\"),\n\t\t\tValueType:    PropertyValueTypeSingleSelect,\n\t\t\tRequired:     Ptr(true),\n\t\t},\n\t\t{\n\t\t\tPropertyName: Ptr(\"service\"),\n\t\t\tValueType:    PropertyValueTypeString,\n\t\t},\n\t})\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.CreateOrUpdateCustomProperties returned error: %v\", err)\n\t}\n\n\twant := []*CustomProperty{\n\t\t{\n\t\t\tPropertyName: Ptr(\"name\"),\n\t\t\tValueType:    PropertyValueTypeSingleSelect,\n\t\t\tRequired:     Ptr(true),\n\t\t},\n\t\t{\n\t\t\tPropertyName: Ptr(\"service\"),\n\t\t\tValueType:    PropertyValueTypeString,\n\t\t},\n\t}\n\n\tif !cmp.Equal(properties, want) {\n\t\tt.Errorf(\"Organizations.CreateOrUpdateCustomProperties returned %+v, want %+v\", properties, want)\n\t}\n\n\tconst methodName = \"CreateOrUpdateCustomProperties\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.CreateOrUpdateCustomProperties(ctx, \"o\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_GetCustomProperty(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/properties/schema/name\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\"property_name\": \"name\",\n\t\t\"value_type\": \"single_select\",\n\t\t\"required\": true,\n\t\t\"default_value\": \"production\",\n\t\t\"description\": \"Prod or dev environment\",\n\t\t\"allowed_values\":[\n\t\t  \"production\",\n\t\t  \"development\"\n\t\t],\n\t\t\"values_editable_by\": \"org_actors\"\n\t  }`)\n\t})\n\n\tctx := t.Context()\n\tproperty, _, err := client.Organizations.GetCustomProperty(ctx, \"o\", \"name\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.GetCustomProperty returned error: %v\", err)\n\t}\n\n\twant := &CustomProperty{\n\t\tPropertyName:     Ptr(\"name\"),\n\t\tValueType:        PropertyValueTypeSingleSelect,\n\t\tRequired:         Ptr(true),\n\t\tDefaultValue:     \"production\",\n\t\tDescription:      Ptr(\"Prod or dev environment\"),\n\t\tAllowedValues:    []string{\"production\", \"development\"},\n\t\tValuesEditableBy: Ptr(\"org_actors\"),\n\t}\n\tif !cmp.Equal(property, want) {\n\t\tt.Errorf(\"Organizations.GetCustomProperty returned %+v, want %+v\", property, want)\n\t}\n\n\tconst methodName = \"GetCustomProperty\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.GetCustomProperty(ctx, \"o\", \"name\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_CreateOrUpdateCustomProperty(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/properties/schema/name\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tfmt.Fprint(w, `{\n\t\t\"property_name\": \"name\",\n\t\t\"value_type\": \"single_select\",\n\t\t\"required\": true,\n\t\t\"default_value\": \"production\",\n\t\t\"description\": \"Prod or dev environment\",\n\t\t\"allowed_values\":[\n\t\t  \"production\",\n\t\t  \"development\"\n\t\t],\n\t\t\"values_editable_by\": \"org_actors\"\n\t  }`)\n\t})\n\n\tctx := t.Context()\n\tproperty, _, err := client.Organizations.CreateOrUpdateCustomProperty(ctx, \"o\", \"name\", &CustomProperty{\n\t\tValueType:        PropertyValueTypeSingleSelect,\n\t\tRequired:         Ptr(true),\n\t\tDefaultValue:     \"production\",\n\t\tDescription:      Ptr(\"Prod or dev environment\"),\n\t\tAllowedValues:    []string{\"production\", \"development\"},\n\t\tValuesEditableBy: Ptr(\"org_actors\"),\n\t})\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.CreateOrUpdateCustomProperty returned error: %v\", err)\n\t}\n\n\twant := &CustomProperty{\n\t\tPropertyName:     Ptr(\"name\"),\n\t\tValueType:        PropertyValueTypeSingleSelect,\n\t\tRequired:         Ptr(true),\n\t\tDefaultValue:     \"production\",\n\t\tDescription:      Ptr(\"Prod or dev environment\"),\n\t\tAllowedValues:    []string{\"production\", \"development\"},\n\t\tValuesEditableBy: Ptr(\"org_actors\"),\n\t}\n\tif !cmp.Equal(property, want) {\n\t\tt.Errorf(\"Organizations.CreateOrUpdateCustomProperty returned %+v, want %+v\", property, want)\n\t}\n\n\tconst methodName = \"CreateOrUpdateCustomProperty\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.CreateOrUpdateCustomProperty(ctx, \"o\", \"name\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_RemoveCustomProperty(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/properties/schema/name\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Organizations.RemoveCustomProperty(ctx, \"o\", \"name\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.RemoveCustomProperty returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveCustomProperty\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.RemoveCustomProperty(ctx, \"0\", \"name\")\n\t})\n}\n\nfunc TestOrganizationsService_ListCustomPropertyValues(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/properties/values\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\":             \"1\",\n\t\t\t\"per_page\":         \"100\",\n\t\t\t\"repository_query\": \"repo:octocat/Hello-World\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\n\t\t\"repository_id\": 1296269,\n\t\t\"repository_name\": \"Hello-World\",\n\t\t\"repository_full_name\": \"octocat/Hello-World\",\n\t\t\"properties\": [\n\t\t{\n          \"property_name\": \"environment\",\n          \"value\": \"production\"\n        },\n        {\n          \"property_name\": \"service\",\n          \"value\": \"web\"\n        },\n        {\n          \"property_name\": \"languages\",\n          \"value\": [\"Go\", \"JavaScript\"]\n        },\n        {\n          \"property_name\": \"null_property\",\n          \"value\": null\n        }\n\t\t]\n        }]`)\n\t})\n\n\tctx := t.Context()\n\trepoPropertyValues, _, err := client.Organizations.ListCustomPropertyValues(ctx, \"o\", &ListCustomPropertyValuesOptions{\n\t\tListOptions: ListOptions{\n\t\t\tPage:    1,\n\t\t\tPerPage: 100,\n\t\t},\n\t\tRepositoryQuery: \"repo:octocat/Hello-World\",\n\t})\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListCustomPropertyValues returned error: %v\", err)\n\t}\n\n\twant := []*RepoCustomPropertyValue{\n\t\t{\n\t\t\tRepositoryID:       1296269,\n\t\t\tRepositoryName:     \"Hello-World\",\n\t\t\tRepositoryFullName: \"octocat/Hello-World\",\n\t\t\tProperties: []*CustomPropertyValue{\n\t\t\t\t{\n\t\t\t\t\tPropertyName: \"environment\",\n\t\t\t\t\tValue:        \"production\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tPropertyName: \"service\",\n\t\t\t\t\tValue:        \"web\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tPropertyName: \"languages\",\n\t\t\t\t\tValue:        []string{\"Go\", \"JavaScript\"},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tPropertyName: \"null_property\",\n\t\t\t\t\tValue:        nil,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(repoPropertyValues, want) {\n\t\tt.Errorf(\"Organizations.ListCustomPropertyValues returned %+v, want %+v\", repoPropertyValues, want)\n\t}\n\n\tconst methodName = \"ListCustomPropertyValues\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListCustomPropertyValues(ctx, \"\\n\", &ListCustomPropertyValuesOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListCustomPropertyValues(ctx, \"o\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCustomPropertyValue_UnmarshalJSON(t *testing.T) {\n\tt.Parallel()\n\ttests := map[string]struct {\n\t\tdata    string\n\t\twant    *CustomPropertyValue\n\t\twantErr bool\n\t}{\n\t\t\"Invalid JSON\": {\n\t\t\tdata:    `{`,\n\t\t\twant:    &CustomPropertyValue{},\n\t\t\twantErr: true,\n\t\t},\n\t\t\"String value\": {\n\t\t\tdata: `{\n\t\t\t\t\"property_name\": \"environment\",\n\t\t\t\t\"value\": \"production\"\n\t\t\t}`,\n\t\t\twant: &CustomPropertyValue{\n\t\t\t\tPropertyName: \"environment\",\n\t\t\t\tValue:        \"production\",\n\t\t\t},\n\t\t\twantErr: false,\n\t\t},\n\t\t\"Array of strings value\": {\n\t\t\tdata: `{\n\t\t\t\t\"property_name\": \"languages\",\n\t\t\t\t\"value\": [\"Go\", \"JavaScript\"]\n\t\t\t}`,\n\t\t\twant: &CustomPropertyValue{\n\t\t\t\tPropertyName: \"languages\",\n\t\t\t\tValue:        []string{\"Go\", \"JavaScript\"},\n\t\t\t},\n\t\t\twantErr: false,\n\t\t},\n\t\t\"Non-string value in array\": {\n\t\t\tdata: `{\n\t\t\t\t\"property_name\": \"languages\",\n\t\t\t\t\"value\": [\"Go\", 42]\n\t\t\t}`,\n\t\t\twant: &CustomPropertyValue{\n\t\t\t\tPropertyName: \"languages\",\n\t\t\t\tValue:        nil,\n\t\t\t},\n\t\t\twantErr: true,\n\t\t},\n\t\t\"Unexpected value type\": {\n\t\t\tdata: `{\n\t\t\t\t\"property_name\": \"environment\",\n\t\t\t\t\"value\": {\"invalid\": \"type\"}\n\t\t\t}`,\n\t\t\twant: &CustomPropertyValue{\n\t\t\t\tPropertyName: \"environment\",\n\t\t\t\tValue:        nil,\n\t\t\t},\n\t\t\twantErr: true,\n\t\t},\n\t}\n\n\tfor name, tc := range tests {\n\t\tt.Run(name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tcpv := &CustomPropertyValue{}\n\t\t\terr := cpv.UnmarshalJSON([]byte(tc.data))\n\t\t\tif (err != nil) != tc.wantErr {\n\t\t\t\tt.Errorf(\"CustomPropertyValue.UnmarshalJSON error = %v, wantErr %v\", err, tc.wantErr)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif !tc.wantErr && !cmp.Equal(tc.want, cpv) {\n\t\t\t\tt.Errorf(\"CustomPropertyValue.UnmarshalJSON expected %+v, got %+v\", tc.want, cpv)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestOrganizationsService_CreateOrUpdateRepoCustomPropertyValues(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/properties/values\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\ttestBody(t, r, `{\"repository_names\":[\"repo\"],\"properties\":[{\"property_name\":\"service\",\"value\":\"string\"}]}`+\"\\n\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Organizations.CreateOrUpdateRepoCustomPropertyValues(ctx, \"o\", []string{\"repo\"}, []*CustomPropertyValue{\n\t\t{\n\t\t\tPropertyName: \"service\",\n\t\t\tValue:        Ptr(\"string\"),\n\t\t},\n\t})\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.CreateOrUpdateCustomPropertyValuesForRepos returned error: %v\", err)\n\t}\n\n\tconst methodName = \"CreateOrUpdateCustomPropertyValuesForRepos\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.CreateOrUpdateRepoCustomPropertyValues(ctx, \"o\", nil, nil)\n\t})\n}\n\nfunc TestCustomPropertyDefaultValueString(t *testing.T) {\n\tt.Parallel()\n\tfor _, d := range []struct {\n\t\ttestName string\n\t\tproperty *CustomProperty\n\t\tok       bool\n\t\twant     string\n\t}{\n\t\t{\n\t\t\ttestName: \"invalid_type\",\n\t\t\tproperty: &CustomProperty{\n\t\t\t\tValueType:    PropertyValueTypeMultiSelect,\n\t\t\t\tDefaultValue: []string{\"a\", \"b\"},\n\t\t\t},\n\t\t\tok:   false,\n\t\t\twant: \"\",\n\t\t},\n\t\t{\n\t\t\ttestName: \"string_invalid_value\",\n\t\t\tproperty: &CustomProperty{\n\t\t\t\tValueType:    PropertyValueTypeString,\n\t\t\t\tDefaultValue: []string{\"a\", \"b\"},\n\t\t\t},\n\t\t\tok:   false,\n\t\t\twant: \"\",\n\t\t},\n\t\t{\n\t\t\ttestName: \"string_nil_value\",\n\t\t\tproperty: &CustomProperty{\n\t\t\t\tValueType:    PropertyValueTypeString,\n\t\t\t\tDefaultValue: nil,\n\t\t\t},\n\t\t\tok:   false,\n\t\t\twant: \"\",\n\t\t},\n\t\t{\n\t\t\ttestName: \"string_value\",\n\t\t\tproperty: &CustomProperty{\n\t\t\t\tValueType:    PropertyValueTypeString,\n\t\t\t\tDefaultValue: \"test-string\",\n\t\t\t},\n\t\t\tok:   true,\n\t\t\twant: \"test-string\",\n\t\t},\n\t\t{\n\t\t\ttestName: \"single_select_invalid_value\",\n\t\t\tproperty: &CustomProperty{\n\t\t\t\tValueType:    PropertyValueTypeSingleSelect,\n\t\t\t\tDefaultValue: []string{\"a\", \"b\"},\n\t\t\t},\n\t\t\tok:   false,\n\t\t\twant: \"\",\n\t\t},\n\t\t{\n\t\t\ttestName: \"single_select_nil_value\",\n\t\t\tproperty: &CustomProperty{\n\t\t\t\tValueType:    PropertyValueTypeSingleSelect,\n\t\t\t\tDefaultValue: nil,\n\t\t\t},\n\t\t\tok:   false,\n\t\t\twant: \"\",\n\t\t},\n\t\t{\n\t\t\ttestName: \"single_select_value\",\n\t\t\tproperty: &CustomProperty{\n\t\t\t\tValueType:    PropertyValueTypeSingleSelect,\n\t\t\t\tDefaultValue: \"test-string\",\n\t\t\t},\n\t\t\tok:   true,\n\t\t\twant: \"test-string\",\n\t\t},\n\t\t{\n\t\t\ttestName: \"url_invalid_value\",\n\t\t\tproperty: &CustomProperty{\n\t\t\t\tValueType:    PropertyValueTypeURL,\n\t\t\t\tDefaultValue: []string{\"a\", \"b\"},\n\t\t\t},\n\t\t\tok:   false,\n\t\t\twant: \"\",\n\t\t},\n\t\t{\n\t\t\ttestName: \"url_nil_value\",\n\t\t\tproperty: &CustomProperty{\n\t\t\t\tValueType:    PropertyValueTypeURL,\n\t\t\t\tDefaultValue: nil,\n\t\t\t},\n\t\t\tok:   false,\n\t\t\twant: \"\",\n\t\t},\n\t\t{\n\t\t\ttestName: \"url_value\",\n\t\t\tproperty: &CustomProperty{\n\t\t\t\tValueType:    PropertyValueTypeURL,\n\t\t\t\tDefaultValue: \"http://example.com\",\n\t\t\t},\n\t\t\tok:   true,\n\t\t\twant: \"http://example.com\",\n\t\t},\n\t} {\n\t\tt.Run(d.testName, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tgot, ok := d.property.DefaultValueString()\n\n\t\t\tif ok != d.ok {\n\t\t\t\tt.Fatalf(\"CustomProperty.DefaultValueString set ok to %+v, want %+v\", ok, d.ok)\n\t\t\t}\n\n\t\t\tif got != d.want {\n\t\t\t\tt.Fatalf(\"CustomProperty.DefaultValueString returned %+v, want %+v\", got, d.want)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestCustomPropertyDefaultValueStrings(t *testing.T) {\n\tt.Parallel()\n\tfor _, d := range []struct {\n\t\ttestName string\n\t\tproperty *CustomProperty\n\t\tok       bool\n\t\twant     []string\n\t}{\n\t\t{\n\t\t\ttestName: \"invalid_type\",\n\t\t\tproperty: &CustomProperty{\n\t\t\t\tValueType:    PropertyValueTypeString,\n\t\t\t\tDefaultValue: \"test\",\n\t\t\t},\n\t\t\tok:   false,\n\t\t\twant: []string{},\n\t\t},\n\t\t{\n\t\t\ttestName: \"invalid_slice\",\n\t\t\tproperty: &CustomProperty{\n\t\t\t\tValueType:    PropertyValueTypeString,\n\t\t\t\tDefaultValue: []any{1, 2, 3},\n\t\t\t},\n\t\t\tok:   false,\n\t\t\twant: []string{},\n\t\t},\n\t\t{\n\t\t\ttestName: \"multi_select_invalid_value\",\n\t\t\tproperty: &CustomProperty{\n\t\t\t\tValueType:    PropertyValueTypeMultiSelect,\n\t\t\t\tDefaultValue: \"test\",\n\t\t\t},\n\t\t\tok:   false,\n\t\t\twant: []string{},\n\t\t},\n\t\t{\n\t\t\ttestName: \"multi_select_nil_value\",\n\t\t\tproperty: &CustomProperty{\n\t\t\t\tValueType:    PropertyValueTypeMultiSelect,\n\t\t\t\tDefaultValue: nil,\n\t\t\t},\n\t\t\tok:   false,\n\t\t\twant: []string{},\n\t\t},\n\t\t{\n\t\t\ttestName: \"multi_select_any_slice_single_value\",\n\t\t\tproperty: &CustomProperty{\n\t\t\t\tValueType:    PropertyValueTypeMultiSelect,\n\t\t\t\tDefaultValue: []any{\"a\"},\n\t\t\t},\n\t\t\tok:   true,\n\t\t\twant: []string{\"a\"},\n\t\t},\n\t\t{\n\t\t\ttestName: \"multi_select_string_slice_single_value\",\n\t\t\tproperty: &CustomProperty{\n\t\t\t\tValueType:    PropertyValueTypeMultiSelect,\n\t\t\t\tDefaultValue: []string{\"a\"},\n\t\t\t},\n\t\t\tok:   true,\n\t\t\twant: []string{\"a\"},\n\t\t},\n\t\t{\n\t\t\ttestName: \"multi_select_any_slice_multi_value\",\n\t\t\tproperty: &CustomProperty{\n\t\t\t\tValueType:    PropertyValueTypeMultiSelect,\n\t\t\t\tDefaultValue: []any{\"a\", \"b\"},\n\t\t\t},\n\t\t\tok:   true,\n\t\t\twant: []string{\"a\", \"b\"},\n\t\t},\n\t\t{\n\t\t\ttestName: \"multi_select_string_slice_multi_value\",\n\t\t\tproperty: &CustomProperty{\n\t\t\t\tValueType:    PropertyValueTypeMultiSelect,\n\t\t\t\tDefaultValue: []string{\"a\", \"b\"},\n\t\t\t},\n\t\t\tok:   true,\n\t\t\twant: []string{\"a\", \"b\"},\n\t\t},\n\t} {\n\t\tt.Run(d.testName, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tgot, ok := d.property.DefaultValueStrings()\n\n\t\t\tif ok != d.ok {\n\t\t\t\tt.Fatalf(\"CustomProperty.DefaultValueStrings set ok to %+v, want %+v\", ok, d.ok)\n\t\t\t}\n\n\t\t\tif !cmp.Equal(got, d.want, cmpopts.EquateEmpty()) {\n\t\t\t\tt.Fatalf(\"CustomProperty.DefaultValueStrings returned %+v, want %+v\", got, d.want)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestCustomPropertyDefaultValueBool(t *testing.T) {\n\tt.Parallel()\n\tfor _, d := range []struct {\n\t\ttestName string\n\t\tproperty *CustomProperty\n\t\tok       bool\n\t\twant     bool\n\t}{\n\t\t{\n\t\t\ttestName: \"invalid_type\",\n\t\t\tproperty: &CustomProperty{\n\t\t\t\tValueType:    PropertyValueTypeString,\n\t\t\t\tDefaultValue: \"test\",\n\t\t\t},\n\t\t\tok:   false,\n\t\t\twant: false,\n\t\t},\n\t\t{\n\t\t\ttestName: \"true_false_invalid_value\",\n\t\t\tproperty: &CustomProperty{\n\t\t\t\tValueType:    PropertyValueTypeTrueFalse,\n\t\t\t\tDefaultValue: \"test\",\n\t\t\t},\n\t\t\tok:   false,\n\t\t\twant: false,\n\t\t},\n\t\t{\n\t\t\ttestName: \"true_false_nil_value\",\n\t\t\tproperty: &CustomProperty{\n\t\t\t\tValueType:    PropertyValueTypeTrueFalse,\n\t\t\t\tDefaultValue: nil,\n\t\t\t},\n\t\t\tok:   false,\n\t\t\twant: false,\n\t\t},\n\t\t{\n\t\t\ttestName: \"true_false_true_value\",\n\t\t\tproperty: &CustomProperty{\n\t\t\t\tValueType:    PropertyValueTypeTrueFalse,\n\t\t\t\tDefaultValue: \"true\",\n\t\t\t},\n\t\t\tok:   true,\n\t\t\twant: true,\n\t\t},\n\t\t{\n\t\t\ttestName: \"true_false_false_value\",\n\t\t\tproperty: &CustomProperty{\n\t\t\t\tValueType:    PropertyValueTypeTrueFalse,\n\t\t\t\tDefaultValue: \"false\",\n\t\t\t},\n\t\t\tok:   true,\n\t\t\twant: false,\n\t\t},\n\t} {\n\t\tt.Run(d.testName, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tgot, ok := d.property.DefaultValueBool()\n\n\t\t\tif ok != d.ok {\n\t\t\t\tt.Fatalf(\"CustomProperty.DefaultValueBool set ok to %+v, want %+v\", ok, d.ok)\n\t\t\t}\n\n\t\t\tif ok != d.ok {\n\t\t\t\tt.Fatalf(\"CustomProperty.DefaultValueBool returned %+v, want %+v\", got, d.want)\n\t\t\t}\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "github/orgs_rules.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// GetAllRepositoryRulesets gets all the repository rulesets for the specified organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/rules#get-all-organization-repository-rulesets\n//\n//meta:operation GET /orgs/{org}/rulesets\nfunc (s *OrganizationsService) GetAllRepositoryRulesets(ctx context.Context, org string, opts *ListOptions) ([]*RepositoryRuleset, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/rulesets\", org)\n\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar rulesets []*RepositoryRuleset\n\tresp, err := s.client.Do(ctx, req, &rulesets)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn rulesets, resp, nil\n}\n\n// CreateRepositoryRuleset creates a repository ruleset for the specified organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/rules#create-an-organization-repository-ruleset\n//\n//meta:operation POST /orgs/{org}/rulesets\nfunc (s *OrganizationsService) CreateRepositoryRuleset(ctx context.Context, org string, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/rulesets\", org)\n\n\treq, err := s.client.NewRequest(\"POST\", u, ruleset)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar rs *RepositoryRuleset\n\tresp, err := s.client.Do(ctx, req, &rs)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn rs, resp, nil\n}\n\n// GetRepositoryRuleset gets a repository ruleset for the specified organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/rules#get-an-organization-repository-ruleset\n//\n//meta:operation GET /orgs/{org}/rulesets/{ruleset_id}\nfunc (s *OrganizationsService) GetRepositoryRuleset(ctx context.Context, org string, rulesetID int64) (*RepositoryRuleset, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/rulesets/%v\", org, rulesetID)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar ruleset *RepositoryRuleset\n\tresp, err := s.client.Do(ctx, req, &ruleset)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn ruleset, resp, nil\n}\n\n// UpdateRepositoryRuleset updates a repository ruleset for the specified organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/rules#update-an-organization-repository-ruleset\n//\n//meta:operation PUT /orgs/{org}/rulesets/{ruleset_id}\nfunc (s *OrganizationsService) UpdateRepositoryRuleset(ctx context.Context, org string, rulesetID int64, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/rulesets/%v\", org, rulesetID)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, ruleset)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar rs *RepositoryRuleset\n\tresp, err := s.client.Do(ctx, req, &rs)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn rs, resp, nil\n}\n\n// DeleteRepositoryRuleset deletes a repository ruleset from the specified organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/rules#delete-an-organization-repository-ruleset\n//\n//meta:operation DELETE /orgs/{org}/rulesets/{ruleset_id}\nfunc (s *OrganizationsService) DeleteRepositoryRuleset(ctx context.Context, org string, rulesetID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/rulesets/%v\", org, rulesetID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/orgs_rules_test.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestOrganizationsService_GetAllRepositoryRulesets(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/rulesets\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"id\": 21,\n\t\t\t\"name\": \"test ruleset\",\n\t\t\t\"target\": \"branch\",\n\t\t\t\"source_type\": \"Organization\",\n\t\t\t\"source\": \"o\",\n\t\t\t\"enforcement\": \"active\",\n\t\t\t\"bypass_mode\": \"none\",\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"_links\": {\n\t\t\t  \"self\": {\n\t\t\t\t\"href\": \"https://api.github.com/orgs/o/rulesets/21\"\n\t\t\t  }\n\t\t\t}\n\t\t}]`)\n\t})\n\n\tctx := t.Context()\n\trulesets, _, err := client.Organizations.GetAllRepositoryRulesets(ctx, \"o\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.GetAllRepositoryRulesets returned error: %v\", err)\n\t}\n\n\twant := []*RepositoryRuleset{{\n\t\tID:          Ptr(int64(21)),\n\t\tName:        \"test ruleset\",\n\t\tTarget:      Ptr(RulesetTargetBranch),\n\t\tSourceType:  Ptr(RulesetSourceTypeOrganization),\n\t\tSource:      \"o\",\n\t\tEnforcement: \"active\",\n\t\tNodeID:      Ptr(\"nid\"),\n\t\tLinks: &RepositoryRulesetLinks{\n\t\t\tSelf: &RepositoryRulesetLink{HRef: Ptr(\"https://api.github.com/orgs/o/rulesets/21\")},\n\t\t},\n\t}}\n\tif !cmp.Equal(rulesets, want) {\n\t\tt.Errorf(\"Organizations.GetAllRepositoryRulesets returned %+v, want %+v\", rulesets, want)\n\t}\n\n\tconst methodName = \"GetAllRepositoryRulesets\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.GetAllRepositoryRulesets(ctx, \"o\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_GetAllRepositoryRulesets_ListOptions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/rulesets\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\":     \"2\",\n\t\t\t\"per_page\": \"35\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"id\": 21\n\t\t}]`)\n\t})\n\n\topts := &ListOptions{Page: 2, PerPage: 35}\n\tctx := t.Context()\n\trulesets, _, err := client.Organizations.GetAllRepositoryRulesets(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.GetAllRepositoryRulesets returned error: %v\", err)\n\t}\n\n\twant := []*RepositoryRuleset{{\n\t\tID: Ptr(int64(21)),\n\t}}\n\tif !cmp.Equal(rulesets, want) {\n\t\tt.Errorf(\"Organizations.GetAllRepositoryRulesets returned %+v, want %+v\", rulesets, want)\n\t}\n\n\tconst methodName = \"GetAllRepositoryRulesets\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.GetAllRepositoryRulesets(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.GetAllRepositoryRulesets(ctx, \"o\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_CreateRepositoryRuleset_RepoNames(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/rulesets\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 21,\n\t\t\t\"name\": \"ruleset\",\n\t\t\t\"target\": \"branch\",\n\t\t\t\"source_type\": \"Organization\",\n\t\t\t\"source\": \"o\",\n\t\t\t\"enforcement\": \"active\",\n\t\t\t\"bypass_actors\": [\n\t\t\t  {\n\t\t\t\t\"actor_id\": 234,\n\t\t\t\t\"actor_type\": \"Team\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t  \t\"actor_id\": 345,\n\t\t\t\t\"actor_type\": \"Team\",\n\t\t\t\t\"bypass_mode\": \"exempt\"\n\t\t\t  }\n\t\t\t],\n\t\t\t\"conditions\": {\n\t\t\t  \"ref_name\": {\n\t\t\t\t\"include\": [\n\t\t\t\t  \"refs/heads/main\",\n\t\t\t\t  \"refs/heads/master\"\n\t\t\t\t],\n\t\t\t\t\"exclude\": [\n\t\t\t\t  \"refs/heads/dev*\"\n\t\t\t\t]\n\t\t\t  },\n\t\t\t  \"repository_name\": {\n\t\t\t\t\"include\": [\n\t\t\t\t  \"important_repository\",\n\t\t\t\t  \"another_important_repository\"\n\t\t\t\t],\n\t\t\t\t\"exclude\": [\n\t\t\t\t  \"unimportant_repository\"\n\t\t\t\t],\n\t\t\t\t\"protected\": true\n\t\t\t  }\n\t\t\t},\n\t\t\t\"rules\": [\n\t\t\t  {\n\t\t\t\t\"type\": \"creation\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"update\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"update_allows_fetch_and_merge\": true\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"deletion\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"required_linear_history\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"required_deployments\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"required_deployment_environments\": [\"test\"]\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"required_signatures\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"pull_request\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t\"allowed_merge_methods\": [\"rebase\",\"squash\"],\n\t\t\t\t  \"dismiss_stale_reviews_on_push\": true,\n\t\t\t\t  \"require_code_owner_review\": true,\n\t\t\t\t  \"require_last_push_approval\": true,\n\t\t\t\t  \"required_approving_review_count\": 1,\n\t\t\t\t  \"required_review_thread_resolution\": true\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"required_status_checks\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t\t\"do_not_enforce_on_create\": true,\n\t\t\t\t  \"required_status_checks\": [\n\t\t\t\t\t{\n\t\t\t\t\t  \"context\": \"test\",\n\t\t\t\t\t  \"integration_id\": 1\n\t\t\t\t\t}\n\t\t\t\t  ],\n\t\t\t\t  \"strict_required_status_checks_policy\": true\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"non_fast_forward\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"commit_message_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"name\": \"avoid test commits\",\n\t\t\t\t  \"negate\": true,\n\t\t\t\t  \"operator\": \"starts_with\",\n\t\t\t\t  \"pattern\": \"[test]\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"commit_author_email_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"operator\": \"contains\",\n\t\t\t\t  \"pattern\": \"github\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"committer_email_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"name\": \"avoid commit emails\",\n\t\t\t\t  \"negate\": true,\n\t\t\t\t  \"operator\": \"ends_with\",\n\t\t\t\t  \"pattern\": \"abc\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"branch_name_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"name\": \"avoid branch names\",\n\t\t\t\t  \"negate\": true,\n\t\t\t\t  \"operator\": \"regex\",\n\t\t\t\t  \"pattern\": \"github$\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"tag_name_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"name\": \"avoid tag names\",\n\t\t\t\t  \"negate\": true,\n\t\t\t\t  \"operator\": \"contains\",\n\t\t\t\t  \"pattern\": \"github\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t    \"type\": \"code_scanning\",\n\t\t\t    \"parameters\": {\n\t\t\t\t  \"code_scanning_tools\": [\n\t\t\t\t    {\n\t\t\t\t\t  \"tool\": \"CodeQL\",\n\t\t\t\t\t  \"security_alerts_threshold\": \"high_or_higher\",\n\t\t\t\t\t  \"alerts_threshold\": \"errors\"\n\t\t\t\t    }\n\t\t\t\t  ]\n\t\t\t    }\n\t\t\t  }\n\t\t\t]\n\t\t  }`)\n\t})\n\n\tctx := t.Context()\n\truleset, _, err := client.Organizations.CreateRepositoryRuleset(ctx, \"o\", RepositoryRuleset{\n\t\tName:        \"ruleset\",\n\t\tTarget:      Ptr(RulesetTargetBranch),\n\t\tEnforcement: \"active\",\n\t\tBypassActors: []*BypassActor{\n\t\t\t{\n\t\t\t\tActorID:   Ptr(int64(234)),\n\t\t\t\tActorType: Ptr(BypassActorTypeTeam),\n\t\t\t},\n\t\t\t{\n\t\t\t\tActorID:    Ptr(int64(345)),\n\t\t\t\tActorType:  Ptr(BypassActorTypeTeam),\n\t\t\t\tBypassMode: Ptr(BypassModeExempt),\n\t\t\t},\n\t\t},\n\t\tConditions: &RepositoryRulesetConditions{\n\t\t\tRefName: &RepositoryRulesetRefConditionParameters{\n\t\t\t\tInclude: []string{\"refs/heads/main\", \"refs/heads/master\"},\n\t\t\t\tExclude: []string{\"refs/heads/dev*\"},\n\t\t\t},\n\t\t\tRepositoryName: &RepositoryRulesetRepositoryNamesConditionParameters{\n\t\t\t\tInclude:   []string{\"important_repository\", \"another_important_repository\"},\n\t\t\t\tExclude:   []string{\"unimportant_repository\"},\n\t\t\t\tProtected: Ptr(true),\n\t\t\t},\n\t\t},\n\t\tRules: &RepositoryRulesetRules{\n\t\t\tCreation: &EmptyRuleParameters{},\n\t\t\tUpdate: &UpdateRuleParameters{\n\t\t\t\tUpdateAllowsFetchAndMerge: true,\n\t\t\t},\n\t\t\tDeletion:              &EmptyRuleParameters{},\n\t\t\tRequiredLinearHistory: &EmptyRuleParameters{},\n\t\t\tRequiredDeployments: &RequiredDeploymentsRuleParameters{\n\t\t\t\tRequiredDeploymentEnvironments: []string{\"test\"},\n\t\t\t},\n\t\t\tRequiredSignatures: &EmptyRuleParameters{},\n\t\t\tPullRequest: &PullRequestRuleParameters{\n\t\t\t\tAllowedMergeMethods:            []PullRequestMergeMethod{PullRequestMergeMethodRebase, PullRequestMergeMethodSquash},\n\t\t\t\tDismissStaleReviewsOnPush:      true,\n\t\t\t\tRequireCodeOwnerReview:         true,\n\t\t\t\tRequireLastPushApproval:        true,\n\t\t\t\tRequiredApprovingReviewCount:   1,\n\t\t\t\tRequiredReviewThreadResolution: true,\n\t\t\t},\n\t\t\tRequiredStatusChecks: &RequiredStatusChecksRuleParameters{\n\t\t\t\tDoNotEnforceOnCreate: Ptr(true),\n\t\t\t\tRequiredStatusChecks: []*RuleStatusCheck{\n\t\t\t\t\t{\n\t\t\t\t\t\tContext:       \"test\",\n\t\t\t\t\t\tIntegrationID: Ptr(int64(1)),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tStrictRequiredStatusChecksPolicy: true,\n\t\t\t},\n\t\t\tNonFastForward: &EmptyRuleParameters{},\n\t\t\tCommitMessagePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid test commits\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"starts_with\",\n\t\t\t\tPattern:  \"[test]\",\n\t\t\t},\n\t\t\tCommitAuthorEmailPattern: &PatternRuleParameters{\n\t\t\t\tOperator: \"contains\",\n\t\t\t\tPattern:  \"github\",\n\t\t\t},\n\t\t\tCommitterEmailPattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid commit emails\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"ends_with\",\n\t\t\t\tPattern:  \"abc\",\n\t\t\t},\n\t\t\tBranchNamePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid branch names\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"regex\",\n\t\t\t\tPattern:  \"github$\",\n\t\t\t},\n\t\t\tTagNamePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid tag names\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"contains\",\n\t\t\t\tPattern:  \"github\",\n\t\t\t},\n\t\t\tCodeScanning: &CodeScanningRuleParameters{\n\t\t\t\tCodeScanningTools: []*RuleCodeScanningTool{\n\t\t\t\t\t{\n\t\t\t\t\t\tAlertsThreshold:         CodeScanningAlertsThresholdErrors,\n\t\t\t\t\t\tSecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher,\n\t\t\t\t\t\tTool:                    \"CodeQL\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.CreateRepositoryRuleset returned error: %v\", err)\n\t}\n\n\twant := &RepositoryRuleset{\n\t\tID:          Ptr(int64(21)),\n\t\tName:        \"ruleset\",\n\t\tTarget:      Ptr(RulesetTargetBranch),\n\t\tSourceType:  Ptr(RulesetSourceTypeOrganization),\n\t\tSource:      \"o\",\n\t\tEnforcement: \"active\",\n\t\tBypassActors: []*BypassActor{\n\t\t\t{\n\t\t\t\tActorID:   Ptr(int64(234)),\n\t\t\t\tActorType: Ptr(BypassActorTypeTeam),\n\t\t\t},\n\t\t\t{\n\t\t\t\tActorID:    Ptr(int64(345)),\n\t\t\t\tActorType:  Ptr(BypassActorTypeTeam),\n\t\t\t\tBypassMode: Ptr(BypassModeExempt),\n\t\t\t},\n\t\t},\n\t\tConditions: &RepositoryRulesetConditions{\n\t\t\tRefName: &RepositoryRulesetRefConditionParameters{\n\t\t\t\tInclude: []string{\"refs/heads/main\", \"refs/heads/master\"},\n\t\t\t\tExclude: []string{\"refs/heads/dev*\"},\n\t\t\t},\n\t\t\tRepositoryName: &RepositoryRulesetRepositoryNamesConditionParameters{\n\t\t\t\tInclude:   []string{\"important_repository\", \"another_important_repository\"},\n\t\t\t\tExclude:   []string{\"unimportant_repository\"},\n\t\t\t\tProtected: Ptr(true),\n\t\t\t},\n\t\t},\n\t\tRules: &RepositoryRulesetRules{\n\t\t\tCreation: &EmptyRuleParameters{},\n\t\t\tUpdate: &UpdateRuleParameters{\n\t\t\t\tUpdateAllowsFetchAndMerge: true,\n\t\t\t},\n\t\t\tDeletion:              &EmptyRuleParameters{},\n\t\t\tRequiredLinearHistory: &EmptyRuleParameters{},\n\t\t\tRequiredDeployments: &RequiredDeploymentsRuleParameters{\n\t\t\t\tRequiredDeploymentEnvironments: []string{\"test\"},\n\t\t\t},\n\t\t\tRequiredSignatures: &EmptyRuleParameters{},\n\t\t\tPullRequest: &PullRequestRuleParameters{\n\t\t\t\tAllowedMergeMethods:            []PullRequestMergeMethod{PullRequestMergeMethodRebase, PullRequestMergeMethodSquash},\n\t\t\t\tDismissStaleReviewsOnPush:      true,\n\t\t\t\tRequireCodeOwnerReview:         true,\n\t\t\t\tRequireLastPushApproval:        true,\n\t\t\t\tRequiredApprovingReviewCount:   1,\n\t\t\t\tRequiredReviewThreadResolution: true,\n\t\t\t},\n\t\t\tRequiredStatusChecks: &RequiredStatusChecksRuleParameters{\n\t\t\t\tDoNotEnforceOnCreate: Ptr(true),\n\t\t\t\tRequiredStatusChecks: []*RuleStatusCheck{\n\t\t\t\t\t{\n\t\t\t\t\t\tContext:       \"test\",\n\t\t\t\t\t\tIntegrationID: Ptr(int64(1)),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tStrictRequiredStatusChecksPolicy: true,\n\t\t\t},\n\t\t\tNonFastForward: &EmptyRuleParameters{},\n\t\t\tCommitMessagePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid test commits\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"starts_with\",\n\t\t\t\tPattern:  \"[test]\",\n\t\t\t},\n\t\t\tCommitAuthorEmailPattern: &PatternRuleParameters{\n\t\t\t\tOperator: \"contains\",\n\t\t\t\tPattern:  \"github\",\n\t\t\t},\n\t\t\tCommitterEmailPattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid commit emails\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"ends_with\",\n\t\t\t\tPattern:  \"abc\",\n\t\t\t},\n\t\t\tBranchNamePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid branch names\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"regex\",\n\t\t\t\tPattern:  \"github$\",\n\t\t\t},\n\t\t\tTagNamePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid tag names\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"contains\",\n\t\t\t\tPattern:  \"github\",\n\t\t\t},\n\t\t\tCodeScanning: &CodeScanningRuleParameters{\n\t\t\t\tCodeScanningTools: []*RuleCodeScanningTool{\n\t\t\t\t\t{\n\t\t\t\t\t\tAlertsThreshold:         CodeScanningAlertsThresholdErrors,\n\t\t\t\t\t\tSecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher,\n\t\t\t\t\t\tTool:                    \"CodeQL\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(ruleset, want) {\n\t\tt.Errorf(\"Organizations.CreateRepositoryRuleset returned %+v, want %+v\", ruleset, want)\n\t}\n\n\tconst methodName = \"CreateRepositoryRuleset\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.CreateRepositoryRuleset(ctx, \"o\", RepositoryRuleset{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_CreateRepositoryRuleset_RepoProperty(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/rulesets\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 21,\n\t\t\t\"name\": \"ruleset\",\n\t\t\t\"target\": \"branch\",\n\t\t\t\"source_type\": \"Organization\",\n\t\t\t\"source\": \"o\",\n\t\t\t\"enforcement\": \"active\",\n\t\t\t\"bypass_actors\": [\n\t\t\t  {\n\t\t\t\t\"actor_id\": 234,\n\t\t\t\t\"actor_type\": \"Team\"\n\t\t\t  }\n\t\t\t],\n\t\t\t\"conditions\": {\n\t\t\t  \"repository_property\": {\n\t\t\t\t\"include\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"name\": \"testIncludeProp\",\n\t\t\t\t\t\t\"source\": \"custom\",\n\t\t\t\t\t\t\"property_values\": [\n\t\t\t\t\t\t\t\"true\"\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"exclude\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"name\": \"testExcludeProp\",\n\t\t\t\t\t\t\"property_values\": [\n\t\t\t\t\t\t\t\"false\"\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t  }\n\t\t\t},\n\t\t\t\"rules\": [\n\t\t\t  {\n\t\t\t\t\"type\": \"creation\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"update\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"update_allows_fetch_and_merge\": true\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"deletion\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"required_linear_history\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"required_deployments\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"required_deployment_environments\": [\"test\"]\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"required_signatures\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"pull_request\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t\"allowed_merge_methods\": [\"rebase\",\"squash\"],\n\t\t\t\t  \"dismiss_stale_reviews_on_push\": true,\n\t\t\t\t  \"require_code_owner_review\": true,\n\t\t\t\t  \"require_last_push_approval\": true,\n\t\t\t\t  \"required_approving_review_count\": 1,\n\t\t\t\t  \"required_review_thread_resolution\": true\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"required_status_checks\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t\t\"do_not_enforce_on_create\": true,\n\t\t\t\t  \"required_status_checks\": [\n\t\t\t\t\t{\n\t\t\t\t\t  \"context\": \"test\",\n\t\t\t\t\t  \"integration_id\": 1\n\t\t\t\t\t}\n\t\t\t\t  ],\n\t\t\t\t  \"strict_required_status_checks_policy\": true\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"non_fast_forward\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"commit_message_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"name\": \"avoid test commits\",\n\t\t\t\t  \"negate\": true,\n\t\t\t\t  \"operator\": \"starts_with\",\n\t\t\t\t  \"pattern\": \"[test]\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"commit_author_email_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"operator\": \"contains\",\n\t\t\t\t  \"pattern\": \"github\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"committer_email_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"name\": \"avoid commit emails\",\n\t\t\t\t  \"negate\": true,\n\t\t\t\t  \"operator\": \"ends_with\",\n\t\t\t\t  \"pattern\": \"abc\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"branch_name_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"name\": \"avoid branch names\",\n\t\t\t\t  \"negate\": true,\n\t\t\t\t  \"operator\": \"regex\",\n\t\t\t\t  \"pattern\": \"github$\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"tag_name_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"name\": \"avoid tag names\",\n\t\t\t\t  \"negate\": true,\n\t\t\t\t  \"operator\": \"contains\",\n\t\t\t\t  \"pattern\": \"github\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t    \"type\": \"code_scanning\",\n\t\t\t    \"parameters\": {\n\t\t\t\t  \"code_scanning_tools\": [\n\t\t\t\t    {\n\t\t\t\t\t  \"tool\": \"CodeQL\",\n\t\t\t\t\t  \"security_alerts_threshold\": \"high_or_higher\",\n\t\t\t\t\t  \"alerts_threshold\": \"errors\"\n\t\t\t\t    }\n\t\t\t\t  ]\n\t\t\t    }\n\t\t\t  }\n\t\t\t]\n\t\t  }`)\n\t})\n\n\tctx := t.Context()\n\truleset, _, err := client.Organizations.CreateRepositoryRuleset(ctx, \"o\", RepositoryRuleset{\n\t\tName:        \"ruleset\",\n\t\tTarget:      Ptr(RulesetTargetBranch),\n\t\tEnforcement: \"active\",\n\t\tBypassActors: []*BypassActor{\n\t\t\t{\n\t\t\t\tActorID:   Ptr(int64(234)),\n\t\t\t\tActorType: Ptr(BypassActorTypeTeam),\n\t\t\t},\n\t\t},\n\t\tConditions: &RepositoryRulesetConditions{\n\t\t\tRepositoryProperty: &RepositoryRulesetRepositoryPropertyConditionParameters{\n\t\t\t\tInclude: []*RepositoryRulesetRepositoryPropertyTargetParameters{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:           \"testIncludeProp\",\n\t\t\t\t\t\tSource:         Ptr(\"custom\"),\n\t\t\t\t\t\tPropertyValues: []string{\"true\"},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tExclude: []*RepositoryRulesetRepositoryPropertyTargetParameters{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:           \"testExcludeProp\",\n\t\t\t\t\t\tPropertyValues: []string{\"false\"},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tRules: &RepositoryRulesetRules{\n\t\t\tCreation: &EmptyRuleParameters{},\n\t\t\tUpdate: &UpdateRuleParameters{\n\t\t\t\tUpdateAllowsFetchAndMerge: true,\n\t\t\t},\n\t\t\tDeletion:              &EmptyRuleParameters{},\n\t\t\tRequiredLinearHistory: &EmptyRuleParameters{},\n\t\t\tRequiredDeployments: &RequiredDeploymentsRuleParameters{\n\t\t\t\tRequiredDeploymentEnvironments: []string{\"test\"},\n\t\t\t},\n\t\t\tRequiredSignatures: &EmptyRuleParameters{},\n\t\t\tPullRequest: &PullRequestRuleParameters{\n\t\t\t\tAllowedMergeMethods:            []PullRequestMergeMethod{PullRequestMergeMethodRebase, PullRequestMergeMethodSquash},\n\t\t\t\tDismissStaleReviewsOnPush:      true,\n\t\t\t\tRequireCodeOwnerReview:         true,\n\t\t\t\tRequireLastPushApproval:        true,\n\t\t\t\tRequiredApprovingReviewCount:   1,\n\t\t\t\tRequiredReviewThreadResolution: true,\n\t\t\t},\n\t\t\tRequiredStatusChecks: &RequiredStatusChecksRuleParameters{\n\t\t\t\tDoNotEnforceOnCreate: Ptr(true),\n\t\t\t\tRequiredStatusChecks: []*RuleStatusCheck{\n\t\t\t\t\t{\n\t\t\t\t\t\tContext:       \"test\",\n\t\t\t\t\t\tIntegrationID: Ptr(int64(1)),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tStrictRequiredStatusChecksPolicy: true,\n\t\t\t},\n\t\t\tNonFastForward: &EmptyRuleParameters{},\n\t\t\tCommitMessagePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid test commits\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"starts_with\",\n\t\t\t\tPattern:  \"[test]\",\n\t\t\t},\n\t\t\tCommitAuthorEmailPattern: &PatternRuleParameters{\n\t\t\t\tOperator: \"contains\",\n\t\t\t\tPattern:  \"github\",\n\t\t\t},\n\t\t\tCommitterEmailPattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid commit emails\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"ends_with\",\n\t\t\t\tPattern:  \"abc\",\n\t\t\t},\n\t\t\tBranchNamePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid branch names\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"regex\",\n\t\t\t\tPattern:  \"github$\",\n\t\t\t},\n\t\t\tTagNamePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid tag names\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"contains\",\n\t\t\t\tPattern:  \"github\",\n\t\t\t},\n\t\t\tCodeScanning: &CodeScanningRuleParameters{\n\t\t\t\tCodeScanningTools: []*RuleCodeScanningTool{\n\t\t\t\t\t{\n\t\t\t\t\t\tAlertsThreshold:         CodeScanningAlertsThresholdErrors,\n\t\t\t\t\t\tSecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher,\n\t\t\t\t\t\tTool:                    \"CodeQL\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.CreateRepositoryRuleset returned error: %v\", err)\n\t}\n\n\twant := &RepositoryRuleset{\n\t\tID:          Ptr(int64(21)),\n\t\tName:        \"ruleset\",\n\t\tTarget:      Ptr(RulesetTargetBranch),\n\t\tSourceType:  Ptr(RulesetSourceTypeOrganization),\n\t\tSource:      \"o\",\n\t\tEnforcement: \"active\",\n\t\tBypassActors: []*BypassActor{\n\t\t\t{\n\t\t\t\tActorID:   Ptr(int64(234)),\n\t\t\t\tActorType: Ptr(BypassActorTypeTeam),\n\t\t\t},\n\t\t},\n\t\tConditions: &RepositoryRulesetConditions{\n\t\t\tRepositoryProperty: &RepositoryRulesetRepositoryPropertyConditionParameters{\n\t\t\t\tInclude: []*RepositoryRulesetRepositoryPropertyTargetParameters{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:           \"testIncludeProp\",\n\t\t\t\t\t\tSource:         Ptr(\"custom\"),\n\t\t\t\t\t\tPropertyValues: []string{\"true\"},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tExclude: []*RepositoryRulesetRepositoryPropertyTargetParameters{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:           \"testExcludeProp\",\n\t\t\t\t\t\tPropertyValues: []string{\"false\"},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tRules: &RepositoryRulesetRules{\n\t\t\tCreation: &EmptyRuleParameters{},\n\t\t\tUpdate: &UpdateRuleParameters{\n\t\t\t\tUpdateAllowsFetchAndMerge: true,\n\t\t\t},\n\t\t\tDeletion:              &EmptyRuleParameters{},\n\t\t\tRequiredLinearHistory: &EmptyRuleParameters{},\n\t\t\tRequiredDeployments: &RequiredDeploymentsRuleParameters{\n\t\t\t\tRequiredDeploymentEnvironments: []string{\"test\"},\n\t\t\t},\n\t\t\tRequiredSignatures: &EmptyRuleParameters{},\n\t\t\tPullRequest: &PullRequestRuleParameters{\n\t\t\t\tAllowedMergeMethods:            []PullRequestMergeMethod{PullRequestMergeMethodRebase, PullRequestMergeMethodSquash},\n\t\t\t\tDismissStaleReviewsOnPush:      true,\n\t\t\t\tRequireCodeOwnerReview:         true,\n\t\t\t\tRequireLastPushApproval:        true,\n\t\t\t\tRequiredApprovingReviewCount:   1,\n\t\t\t\tRequiredReviewThreadResolution: true,\n\t\t\t},\n\t\t\tRequiredStatusChecks: &RequiredStatusChecksRuleParameters{\n\t\t\t\tDoNotEnforceOnCreate: Ptr(true),\n\t\t\t\tRequiredStatusChecks: []*RuleStatusCheck{\n\t\t\t\t\t{\n\t\t\t\t\t\tContext:       \"test\",\n\t\t\t\t\t\tIntegrationID: Ptr(int64(1)),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tStrictRequiredStatusChecksPolicy: true,\n\t\t\t},\n\t\t\tNonFastForward: &EmptyRuleParameters{},\n\t\t\tCommitMessagePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid test commits\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"starts_with\",\n\t\t\t\tPattern:  \"[test]\",\n\t\t\t},\n\t\t\tCommitAuthorEmailPattern: &PatternRuleParameters{\n\t\t\t\tOperator: \"contains\",\n\t\t\t\tPattern:  \"github\",\n\t\t\t},\n\t\t\tCommitterEmailPattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid commit emails\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"ends_with\",\n\t\t\t\tPattern:  \"abc\",\n\t\t\t},\n\t\t\tBranchNamePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid branch names\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"regex\",\n\t\t\t\tPattern:  \"github$\",\n\t\t\t},\n\t\t\tTagNamePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid tag names\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"contains\",\n\t\t\t\tPattern:  \"github\",\n\t\t\t},\n\t\t\tCodeScanning: &CodeScanningRuleParameters{\n\t\t\t\tCodeScanningTools: []*RuleCodeScanningTool{\n\t\t\t\t\t{\n\t\t\t\t\t\tAlertsThreshold:         CodeScanningAlertsThresholdErrors,\n\t\t\t\t\t\tSecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher,\n\t\t\t\t\t\tTool:                    \"CodeQL\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(ruleset, want) {\n\t\tt.Errorf(\"Organizations.CreateRepositoryRuleset returned %+v, want %+v\", ruleset, want)\n\t}\n\n\tconst methodName = \"CreateRepositoryRuleset\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.CreateRepositoryRuleset(ctx, \"o\", RepositoryRuleset{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_CreateRepositoryRuleset_RepoIDs(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/rulesets\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 21,\n\t\t\t\"name\": \"ruleset\",\n\t\t\t\"target\": \"branch\",\n\t\t\t\"source_type\": \"Organization\",\n\t\t\t\"source\": \"o\",\n\t\t\t\"enforcement\": \"active\",\n\t\t\t\"bypass_actors\": [\n\t\t\t  {\n\t\t\t\t\"actor_id\": 234,\n\t\t\t\t\"actor_type\": \"Team\"\n\t\t\t  }\n\t\t\t],\n\t\t\t\"conditions\": {\n\t\t\t  \"ref_name\": {\n\t\t\t\t\"include\": [\n\t\t\t\t  \"refs/heads/main\",\n\t\t\t\t  \"refs/heads/master\"\n\t\t\t\t],\n\t\t\t\t\"exclude\": [\n\t\t\t\t  \"refs/heads/dev*\"\n\t\t\t\t]\n\t\t\t  },\n\t\t\t  \"repository_id\": {\n\t\t\t\t\t\"repository_ids\": [ 123, 456 ]\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"rules\": [\n\t\t\t  {\n\t\t\t\t\"type\": \"creation\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"update\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"update_allows_fetch_and_merge\": true\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"deletion\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"required_linear_history\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"required_deployments\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"required_deployment_environments\": [\"test\"]\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"required_signatures\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"pull_request\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t\t\"allowed_merge_methods\": [\"rebase\",\"squash\"],\n\t\t\t\t  \"dismiss_stale_reviews_on_push\": true,\n\t\t\t\t  \"require_code_owner_review\": true,\n\t\t\t\t  \"require_last_push_approval\": true,\n\t\t\t\t  \"required_approving_review_count\": 1,\n\t\t\t\t  \"required_review_thread_resolution\": true\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"required_status_checks\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t\t\"do_not_enforce_on_create\": true,\n\t\t\t\t  \"required_status_checks\": [\n\t\t\t\t\t{\n\t\t\t\t\t  \"context\": \"test\",\n\t\t\t\t\t  \"integration_id\": 1\n\t\t\t\t\t}\n\t\t\t\t  ],\n\t\t\t\t  \"strict_required_status_checks_policy\": true\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"non_fast_forward\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"commit_message_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"name\": \"avoid test commits\",\n\t\t\t\t  \"negate\": true,\n\t\t\t\t  \"operator\": \"starts_with\",\n\t\t\t\t  \"pattern\": \"[test]\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"commit_author_email_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"operator\": \"contains\",\n\t\t\t\t  \"pattern\": \"github\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"committer_email_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"name\": \"avoid commit emails\",\n\t\t\t\t  \"negate\": true,\n\t\t\t\t  \"operator\": \"ends_with\",\n\t\t\t\t  \"pattern\": \"abc\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"branch_name_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"name\": \"avoid branch names\",\n\t\t\t\t  \"negate\": true,\n\t\t\t\t  \"operator\": \"regex\",\n\t\t\t\t  \"pattern\": \"github$\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"type\": \"tag_name_pattern\",\n\t\t\t\t\"parameters\": {\n\t\t\t\t  \"name\": \"avoid tag names\",\n\t\t\t\t  \"negate\": true,\n\t\t\t\t  \"operator\": \"contains\",\n\t\t\t\t  \"pattern\": \"github\"\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  {\n\t\t\t    \"type\": \"code_scanning\",\n\t\t\t    \"parameters\": {\n\t\t\t\t  \"code_scanning_tools\": [\n\t\t\t\t    {\n\t\t\t\t\t  \"tool\": \"CodeQL\",\n\t\t\t\t\t  \"security_alerts_threshold\": \"high_or_higher\",\n\t\t\t\t\t  \"alerts_threshold\": \"errors\"\n\t\t\t\t    }\n\t\t\t\t  ]\n\t\t\t    }\n\t\t\t  }\n\t\t\t]\n\t\t  }`)\n\t})\n\n\tctx := t.Context()\n\truleset, _, err := client.Organizations.CreateRepositoryRuleset(ctx, \"o\", RepositoryRuleset{\n\t\tName:        \"ruleset\",\n\t\tTarget:      Ptr(RulesetTargetBranch),\n\t\tEnforcement: \"active\",\n\t\tBypassActors: []*BypassActor{\n\t\t\t{\n\t\t\t\tActorID:   Ptr(int64(234)),\n\t\t\t\tActorType: Ptr(BypassActorTypeTeam),\n\t\t\t},\n\t\t},\n\t\tConditions: &RepositoryRulesetConditions{\n\t\t\tRefName: &RepositoryRulesetRefConditionParameters{\n\t\t\t\tInclude: []string{\"refs/heads/main\", \"refs/heads/master\"},\n\t\t\t\tExclude: []string{\"refs/heads/dev*\"},\n\t\t\t},\n\t\t\tRepositoryID: &RepositoryRulesetRepositoryIDsConditionParameters{\n\t\t\t\tRepositoryIDs: []int64{123, 456},\n\t\t\t},\n\t\t},\n\t\tRules: &RepositoryRulesetRules{\n\t\t\tCreation: &EmptyRuleParameters{},\n\t\t\tUpdate: &UpdateRuleParameters{\n\t\t\t\tUpdateAllowsFetchAndMerge: true,\n\t\t\t},\n\t\t\tDeletion:              &EmptyRuleParameters{},\n\t\t\tRequiredLinearHistory: &EmptyRuleParameters{},\n\t\t\tRequiredDeployments: &RequiredDeploymentsRuleParameters{\n\t\t\t\tRequiredDeploymentEnvironments: []string{\"test\"},\n\t\t\t},\n\t\t\tRequiredSignatures: &EmptyRuleParameters{},\n\t\t\tPullRequest: &PullRequestRuleParameters{\n\t\t\t\tAllowedMergeMethods:            []PullRequestMergeMethod{PullRequestMergeMethodRebase, PullRequestMergeMethodSquash},\n\t\t\t\tDismissStaleReviewsOnPush:      true,\n\t\t\t\tRequireCodeOwnerReview:         true,\n\t\t\t\tRequireLastPushApproval:        true,\n\t\t\t\tRequiredApprovingReviewCount:   1,\n\t\t\t\tRequiredReviewThreadResolution: true,\n\t\t\t},\n\t\t\tRequiredStatusChecks: &RequiredStatusChecksRuleParameters{\n\t\t\t\tDoNotEnforceOnCreate: Ptr(true),\n\t\t\t\tRequiredStatusChecks: []*RuleStatusCheck{\n\t\t\t\t\t{\n\t\t\t\t\t\tContext:       \"test\",\n\t\t\t\t\t\tIntegrationID: Ptr(int64(1)),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tStrictRequiredStatusChecksPolicy: true,\n\t\t\t},\n\t\t\tNonFastForward: &EmptyRuleParameters{},\n\t\t\tCommitMessagePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid test commits\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"starts_with\",\n\t\t\t\tPattern:  \"[test]\",\n\t\t\t},\n\t\t\tCommitAuthorEmailPattern: &PatternRuleParameters{\n\t\t\t\tOperator: \"contains\",\n\t\t\t\tPattern:  \"github\",\n\t\t\t},\n\t\t\tCommitterEmailPattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid commit emails\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"ends_with\",\n\t\t\t\tPattern:  \"abc\",\n\t\t\t},\n\t\t\tBranchNamePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid branch names\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"regex\",\n\t\t\t\tPattern:  \"github$\",\n\t\t\t},\n\t\t\tTagNamePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid tag names\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"contains\",\n\t\t\t\tPattern:  \"github\",\n\t\t\t},\n\t\t\tCodeScanning: &CodeScanningRuleParameters{\n\t\t\t\tCodeScanningTools: []*RuleCodeScanningTool{\n\t\t\t\t\t{\n\t\t\t\t\t\tAlertsThreshold:         CodeScanningAlertsThresholdErrors,\n\t\t\t\t\t\tSecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher,\n\t\t\t\t\t\tTool:                    \"CodeQL\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t})\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.CreateRepositoryRuleset returned error: %v\", err)\n\t}\n\n\twant := &RepositoryRuleset{\n\t\tID:          Ptr(int64(21)),\n\t\tName:        \"ruleset\",\n\t\tTarget:      Ptr(RulesetTargetBranch),\n\t\tSourceType:  Ptr(RulesetSourceTypeOrganization),\n\t\tSource:      \"o\",\n\t\tEnforcement: \"active\",\n\t\tBypassActors: []*BypassActor{\n\t\t\t{\n\t\t\t\tActorID:   Ptr(int64(234)),\n\t\t\t\tActorType: Ptr(BypassActorTypeTeam),\n\t\t\t},\n\t\t},\n\t\tConditions: &RepositoryRulesetConditions{\n\t\t\tRefName: &RepositoryRulesetRefConditionParameters{\n\t\t\t\tInclude: []string{\"refs/heads/main\", \"refs/heads/master\"},\n\t\t\t\tExclude: []string{\"refs/heads/dev*\"},\n\t\t\t},\n\t\t\tRepositoryID: &RepositoryRulesetRepositoryIDsConditionParameters{\n\t\t\t\tRepositoryIDs: []int64{123, 456},\n\t\t\t},\n\t\t},\n\t\tRules: &RepositoryRulesetRules{\n\t\t\tCreation: &EmptyRuleParameters{},\n\t\t\tUpdate: &UpdateRuleParameters{\n\t\t\t\tUpdateAllowsFetchAndMerge: true,\n\t\t\t},\n\t\t\tDeletion:              &EmptyRuleParameters{},\n\t\t\tRequiredLinearHistory: &EmptyRuleParameters{},\n\t\t\tRequiredDeployments: &RequiredDeploymentsRuleParameters{\n\t\t\t\tRequiredDeploymentEnvironments: []string{\"test\"},\n\t\t\t},\n\t\t\tRequiredSignatures: &EmptyRuleParameters{},\n\t\t\tPullRequest: &PullRequestRuleParameters{\n\t\t\t\tAllowedMergeMethods:            []PullRequestMergeMethod{PullRequestMergeMethodRebase, PullRequestMergeMethodSquash},\n\t\t\t\tDismissStaleReviewsOnPush:      true,\n\t\t\t\tRequireCodeOwnerReview:         true,\n\t\t\t\tRequireLastPushApproval:        true,\n\t\t\t\tRequiredApprovingReviewCount:   1,\n\t\t\t\tRequiredReviewThreadResolution: true,\n\t\t\t},\n\t\t\tRequiredStatusChecks: &RequiredStatusChecksRuleParameters{\n\t\t\t\tDoNotEnforceOnCreate: Ptr(true),\n\t\t\t\tRequiredStatusChecks: []*RuleStatusCheck{\n\t\t\t\t\t{\n\t\t\t\t\t\tContext:       \"test\",\n\t\t\t\t\t\tIntegrationID: Ptr(int64(1)),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tStrictRequiredStatusChecksPolicy: true,\n\t\t\t},\n\t\t\tNonFastForward: &EmptyRuleParameters{},\n\t\t\tCommitMessagePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid test commits\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"starts_with\",\n\t\t\t\tPattern:  \"[test]\",\n\t\t\t},\n\t\t\tCommitAuthorEmailPattern: &PatternRuleParameters{\n\t\t\t\tOperator: \"contains\",\n\t\t\t\tPattern:  \"github\",\n\t\t\t},\n\t\t\tCommitterEmailPattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid commit emails\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"ends_with\",\n\t\t\t\tPattern:  \"abc\",\n\t\t\t},\n\t\t\tBranchNamePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid branch names\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"regex\",\n\t\t\t\tPattern:  \"github$\",\n\t\t\t},\n\t\t\tTagNamePattern: &PatternRuleParameters{\n\t\t\t\tName:     Ptr(\"avoid tag names\"),\n\t\t\t\tNegate:   Ptr(true),\n\t\t\t\tOperator: \"contains\",\n\t\t\t\tPattern:  \"github\",\n\t\t\t},\n\t\t\tCodeScanning: &CodeScanningRuleParameters{\n\t\t\t\tCodeScanningTools: []*RuleCodeScanningTool{\n\t\t\t\t\t{\n\t\t\t\t\t\tAlertsThreshold:         CodeScanningAlertsThresholdErrors,\n\t\t\t\t\t\tSecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdHighOrHigher,\n\t\t\t\t\t\tTool:                    \"CodeQL\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(ruleset, want) {\n\t\tt.Errorf(\"Organizations.CreateRepositoryRuleset returned %+v, want %+v\", ruleset, want)\n\t}\n\n\tconst methodName = \"CreateRepositoryRuleset\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.CreateRepositoryRuleset(ctx, \"o\", RepositoryRuleset{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_GetRepositoryRuleset(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/rulesets/21\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 21,\n\t\t\t\"name\": \"test ruleset\",\n\t\t\t\"target\": \"branch\",\n\t\t\t\"source_type\": \"Organization\",\n\t\t\t\"source\": \"o\",\n\t\t\t\"enforcement\": \"active\",\n\t\t\t\"bypass_mode\": \"none\",\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"_links\": {\n\t\t\t  \"self\": {\n\t\t\t\t\"href\": \"https://api.github.com/orgs/o/rulesets/21\"\n\t\t\t  }\n\t\t\t},\n\t\t\t\"conditions\": {\n\t\t\t\t\"ref_name\": {\n\t\t\t\t  \"include\": [\n\t\t\t\t\t\"refs/heads/main\",\n\t\t\t\t\t\"refs/heads/master\"\n\t\t\t\t  ],\n\t\t\t\t  \"exclude\": [\n\t\t\t\t\t\"refs/heads/dev*\"\n\t\t\t\t  ]\n\t\t\t\t},\n\t\t\t\t\"repository_name\": {\n\t\t\t\t  \"include\": [\n\t\t\t\t\t\"important_repository\",\n\t\t\t\t\t\"another_important_repository\"\n\t\t\t\t  ],\n\t\t\t\t  \"exclude\": [\n\t\t\t\t\t\"unimportant_repository\"\n\t\t\t\t  ],\n\t\t\t\t  \"protected\": true\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  \"rules\": [\n\t\t\t\t{\n\t\t\t\t  \"type\": \"creation\"\n\t\t\t\t}\n\t\t\t  ]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\trulesets, _, err := client.Organizations.GetRepositoryRuleset(ctx, \"o\", 21)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.GetOrganizationRepositoryRuleset returned error: %v\", err)\n\t}\n\n\twant := &RepositoryRuleset{\n\t\tID:          Ptr(int64(21)),\n\t\tName:        \"test ruleset\",\n\t\tTarget:      Ptr(RulesetTargetBranch),\n\t\tSourceType:  Ptr(RulesetSourceTypeOrganization),\n\t\tSource:      \"o\",\n\t\tEnforcement: \"active\",\n\t\tNodeID:      Ptr(\"nid\"),\n\t\tLinks: &RepositoryRulesetLinks{\n\t\t\tSelf: &RepositoryRulesetLink{HRef: Ptr(\"https://api.github.com/orgs/o/rulesets/21\")},\n\t\t},\n\t\tConditions: &RepositoryRulesetConditions{\n\t\t\tRefName: &RepositoryRulesetRefConditionParameters{\n\t\t\t\tInclude: []string{\"refs/heads/main\", \"refs/heads/master\"},\n\t\t\t\tExclude: []string{\"refs/heads/dev*\"},\n\t\t\t},\n\t\t\tRepositoryName: &RepositoryRulesetRepositoryNamesConditionParameters{\n\t\t\t\tInclude:   []string{\"important_repository\", \"another_important_repository\"},\n\t\t\t\tExclude:   []string{\"unimportant_repository\"},\n\t\t\t\tProtected: Ptr(true),\n\t\t\t},\n\t\t},\n\t\tRules: &RepositoryRulesetRules{Creation: &EmptyRuleParameters{}},\n\t}\n\tif !cmp.Equal(rulesets, want) {\n\t\tt.Errorf(\"Organizations.GetRepositoryRuleset returned %+v, want %+v\", rulesets, want)\n\t}\n\n\tconst methodName = \"GetRepositoryRuleset\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.GetRepositoryRuleset(ctx, \"o\", 21)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_GetRepositoryRulesetWithRepoPropCondition(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/rulesets/21\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 21,\n\t\t\t\"name\": \"test ruleset\",\n\t\t\t\"target\": \"branch\",\n\t\t\t\"source_type\": \"Organization\",\n\t\t\t\"source\": \"o\",\n\t\t\t\"enforcement\": \"active\",\n\t\t\t\"bypass_mode\": \"none\",\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"_links\": {\n\t\t\t  \"self\": {\n\t\t\t\t\"href\": \"https://api.github.com/orgs/o/rulesets/21\"\n\t\t\t  }\n\t\t\t},\n\t\t\t\"conditions\": {\n\t\t\t  \"repository_property\": {\n\t\t\t\t\"exclude\": [],\n\t\t\t\t\"include\": [\n\t\t\t\t  {\n\t\t\t\t\t\"name\": \"testIncludeProp\",\n\t\t\t\t\t\"source\": \"custom\",\n\t\t\t\t\t\"property_values\": [\n\t\t\t\t\t  \"true\"\n\t\t\t\t\t]\n\t\t\t\t  }\n\t\t\t\t]\n\t\t\t  }\n\t\t\t},\n\t\t\t\"rules\": [\n\t\t\t{\n\t\t\t\t\"type\": \"creation\"\n\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\trulesets, _, err := client.Organizations.GetRepositoryRuleset(ctx, \"o\", 21)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.GetOrganizationRepositoryRuleset returned error: %v\", err)\n\t}\n\n\twant := &RepositoryRuleset{\n\t\tID:          Ptr(int64(21)),\n\t\tName:        \"test ruleset\",\n\t\tTarget:      Ptr(RulesetTargetBranch),\n\t\tSourceType:  Ptr(RulesetSourceTypeOrganization),\n\t\tSource:      \"o\",\n\t\tEnforcement: \"active\",\n\t\tNodeID:      Ptr(\"nid\"),\n\t\tLinks: &RepositoryRulesetLinks{\n\t\t\tSelf: &RepositoryRulesetLink{HRef: Ptr(\"https://api.github.com/orgs/o/rulesets/21\")},\n\t\t},\n\t\tConditions: &RepositoryRulesetConditions{\n\t\t\tRepositoryProperty: &RepositoryRulesetRepositoryPropertyConditionParameters{\n\t\t\t\tInclude: []*RepositoryRulesetRepositoryPropertyTargetParameters{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:           \"testIncludeProp\",\n\t\t\t\t\t\tSource:         Ptr(\"custom\"),\n\t\t\t\t\t\tPropertyValues: []string{\"true\"},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tExclude: []*RepositoryRulesetRepositoryPropertyTargetParameters{},\n\t\t\t},\n\t\t},\n\t\tRules: &RepositoryRulesetRules{Creation: &EmptyRuleParameters{}},\n\t}\n\tif !cmp.Equal(rulesets, want) {\n\t\tt.Errorf(\"Organizations.GetRepositoryRuleset returned %+v, want %+v\", rulesets, want)\n\t}\n\n\tconst methodName = \"GetRepositoryRuleset\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.GetRepositoryRuleset(ctx, \"o\", 21)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_UpdateRepositoryRuleset(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/rulesets/21\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 21,\n\t\t\t\"name\": \"test ruleset\",\n\t\t\t\"target\": \"branch\",\n\t\t\t\"source_type\": \"Organization\",\n\t\t\t\"source\": \"o\",\n\t\t\t\"enforcement\": \"active\",\n\t\t\t\"bypass_mode\": \"none\",\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"_links\": {\n\t\t\t  \"self\": {\n\t\t\t\t\"href\": \"https://api.github.com/orgs/o/rulesets/21\"\n\t\t\t  }\n\t\t\t},\n\t\t\t\"conditions\": {\n\t\t\t\t\"ref_name\": {\n\t\t\t\t  \"include\": [\n\t\t\t\t\t\"refs/heads/main\",\n\t\t\t\t\t\"refs/heads/master\"\n\t\t\t\t  ],\n\t\t\t\t  \"exclude\": [\n\t\t\t\t\t\"refs/heads/dev*\"\n\t\t\t\t  ]\n\t\t\t\t},\n\t\t\t\t\"repository_name\": {\n\t\t\t\t  \"include\": [\n\t\t\t\t\t\"important_repository\",\n\t\t\t\t\t\"another_important_repository\"\n\t\t\t\t  ],\n\t\t\t\t  \"exclude\": [\n\t\t\t\t\t\"unimportant_repository\"\n\t\t\t\t  ],\n\t\t\t\t  \"protected\": true\n\t\t\t\t}\n\t\t\t  },\n\t\t\t  \"rules\": [\n\t\t\t\t{\n\t\t\t\t  \"type\": \"creation\"\n\t\t\t\t}\n\t\t\t  ]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\trulesets, _, err := client.Organizations.UpdateRepositoryRuleset(ctx, \"o\", 21, RepositoryRuleset{\n\t\tName:        \"test ruleset\",\n\t\tTarget:      Ptr(RulesetTargetBranch),\n\t\tEnforcement: \"active\",\n\t\tConditions: &RepositoryRulesetConditions{\n\t\t\tRefName: &RepositoryRulesetRefConditionParameters{\n\t\t\t\tInclude: []string{\"refs/heads/main\", \"refs/heads/master\"},\n\t\t\t\tExclude: []string{\"refs/heads/dev*\"},\n\t\t\t},\n\t\t\tRepositoryName: &RepositoryRulesetRepositoryNamesConditionParameters{\n\t\t\t\tInclude:   []string{\"important_repository\", \"another_important_repository\"},\n\t\t\t\tExclude:   []string{\"unimportant_repository\"},\n\t\t\t\tProtected: Ptr(true),\n\t\t\t},\n\t\t},\n\t\tRules: &RepositoryRulesetRules{Creation: &EmptyRuleParameters{}},\n\t})\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.UpdateRepositoryRuleset returned error: %v\", err)\n\t}\n\n\twant := &RepositoryRuleset{\n\t\tID:          Ptr(int64(21)),\n\t\tName:        \"test ruleset\",\n\t\tTarget:      Ptr(RulesetTargetBranch),\n\t\tSourceType:  Ptr(RulesetSourceTypeOrganization),\n\t\tSource:      \"o\",\n\t\tEnforcement: \"active\",\n\t\tNodeID:      Ptr(\"nid\"),\n\t\tLinks: &RepositoryRulesetLinks{\n\t\t\tSelf: &RepositoryRulesetLink{HRef: Ptr(\"https://api.github.com/orgs/o/rulesets/21\")},\n\t\t},\n\t\tConditions: &RepositoryRulesetConditions{\n\t\t\tRefName: &RepositoryRulesetRefConditionParameters{\n\t\t\t\tInclude: []string{\"refs/heads/main\", \"refs/heads/master\"},\n\t\t\t\tExclude: []string{\"refs/heads/dev*\"},\n\t\t\t},\n\t\t\tRepositoryName: &RepositoryRulesetRepositoryNamesConditionParameters{\n\t\t\t\tInclude:   []string{\"important_repository\", \"another_important_repository\"},\n\t\t\t\tExclude:   []string{\"unimportant_repository\"},\n\t\t\t\tProtected: Ptr(true),\n\t\t\t},\n\t\t},\n\t\tRules: &RepositoryRulesetRules{Creation: &EmptyRuleParameters{}},\n\t}\n\tif !cmp.Equal(rulesets, want) {\n\t\tt.Errorf(\"Organizations.UpdateRepositoryRuleset returned %+v, want %+v\", rulesets, want)\n\t}\n\n\tconst methodName = \"UpdateRepositoryRuleset\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.UpdateRepositoryRuleset(ctx, \"o\", 21, RepositoryRuleset{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_UpdateRepositoryRulesetWithRepoProp(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/rulesets/21\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 21,\n\t\t\t\"name\": \"test ruleset\",\n\t\t\t\"target\": \"branch\",\n\t\t\t\"source_type\": \"Organization\",\n\t\t\t\"source\": \"o\",\n\t\t\t\"enforcement\": \"active\",\n\t\t\t\"bypass_mode\": \"none\",\n\t\t\t\"node_id\": \"nid\",\n\t\t\t\"_links\": {\n\t\t\t  \"self\": {\n\t\t\t\t\"href\": \"https://api.github.com/orgs/o/rulesets/21\"\n\t\t\t  }\n\t\t\t},\n\t\t\t\"conditions\": {\n\t\t\t  \"repository_property\": {\n\t\t\t\t\"exclude\": [],\n\t\t\t\t\"include\": [\n\t\t\t\t  {\n\t\t\t\t\t\"name\": \"testIncludeProp\",\n\t\t\t\t\t\"source\": \"custom\",\n\t\t\t\t\t\"property_values\": [\n\t\t\t\t\t  \"true\"\n\t\t\t\t\t]\n\t\t\t\t  }\n\t\t\t\t]\n\t\t\t  }\n\t\t\t  },\n\t\t\t  \"rules\": [\n\t\t\t\t{\n\t\t\t\t  \"type\": \"creation\"\n\t\t\t\t}\n\t\t\t  ]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\trulesets, _, err := client.Organizations.UpdateRepositoryRuleset(ctx, \"o\", 21, RepositoryRuleset{\n\t\tName:        \"test ruleset\",\n\t\tTarget:      Ptr(RulesetTargetBranch),\n\t\tEnforcement: \"active\",\n\t\tConditions: &RepositoryRulesetConditions{\n\t\t\tRepositoryProperty: &RepositoryRulesetRepositoryPropertyConditionParameters{\n\t\t\t\tInclude: []*RepositoryRulesetRepositoryPropertyTargetParameters{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:           \"testIncludeProp\",\n\t\t\t\t\t\tSource:         Ptr(\"custom\"),\n\t\t\t\t\t\tPropertyValues: []string{\"true\"},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tExclude: []*RepositoryRulesetRepositoryPropertyTargetParameters{},\n\t\t\t},\n\t\t},\n\t\tRules: &RepositoryRulesetRules{Creation: &EmptyRuleParameters{}},\n\t})\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.UpdateRepositoryRuleset returned error: %v\", err)\n\t}\n\n\twant := &RepositoryRuleset{\n\t\tID:          Ptr(int64(21)),\n\t\tName:        \"test ruleset\",\n\t\tTarget:      Ptr(RulesetTargetBranch),\n\t\tSourceType:  Ptr(RulesetSourceTypeOrganization),\n\t\tSource:      \"o\",\n\t\tEnforcement: \"active\",\n\t\tNodeID:      Ptr(\"nid\"),\n\t\tLinks: &RepositoryRulesetLinks{\n\t\t\tSelf: &RepositoryRulesetLink{HRef: Ptr(\"https://api.github.com/orgs/o/rulesets/21\")},\n\t\t},\n\t\tConditions: &RepositoryRulesetConditions{\n\t\t\tRepositoryProperty: &RepositoryRulesetRepositoryPropertyConditionParameters{\n\t\t\t\tInclude: []*RepositoryRulesetRepositoryPropertyTargetParameters{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:           \"testIncludeProp\",\n\t\t\t\t\t\tSource:         Ptr(\"custom\"),\n\t\t\t\t\t\tPropertyValues: []string{\"true\"},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tExclude: []*RepositoryRulesetRepositoryPropertyTargetParameters{},\n\t\t\t},\n\t\t},\n\t\tRules: &RepositoryRulesetRules{Creation: &EmptyRuleParameters{}},\n\t}\n\tif !cmp.Equal(rulesets, want) {\n\t\tt.Errorf(\"Organizations.UpdateRepositoryRuleset returned %+v, want %+v\", rulesets, want)\n\t}\n\n\tconst methodName = \"UpdateRepositoryRuleset\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.UpdateRepositoryRuleset(ctx, \"o\", 21, RepositoryRuleset{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_UpdateRepositoryRuleset_OmitZero_Nil(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/rulesets/21\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\n\t\tvar v map[string]any\n\t\tif err := json.NewDecoder(r.Body).Decode(&v); err != nil {\n\t\t\tt.Errorf(\"could not decode body: %v\", err)\n\t\t}\n\n\t\tif _, ok := v[\"bypass_actors\"]; ok {\n\t\t\tt.Error(\"Request body contained 'bypass_actors', expected it to be omitted for nil input\")\n\t\t}\n\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 21,\n\t\t\t\"name\": \"test ruleset\",\n\t\t\t\"source_type\": \"Organization\",\n\t\t\t\"source\": \"o\",\n\t\t\t\"enforcement\": \"active\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tinput := RepositoryRuleset{\n\t\tName:         \"test ruleset\",\n\t\tEnforcement:  RulesetEnforcementActive,\n\t\tBypassActors: nil,\n\t}\n\n\t_, _, err := client.Organizations.UpdateRepositoryRuleset(ctx, \"o\", 21, input)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.UpdateRepositoryRuleset returned error: %v\", err)\n\t}\n}\n\nfunc TestOrganizationsService_UpdateRepositoryRuleset_OmitZero_EmptySlice(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/rulesets/21\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\n\t\ttestBody(t, r, `{\"name\":\"test ruleset\",\"source\":\"\",\"enforcement\":\"active\",\"bypass_actors\":[]}`+\"\\n\")\n\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 21,\n\t\t\t\"name\": \"test ruleset\",\n\t\t\t\"source_type\": \"Organization\",\n\t\t\t\"source\": \"o\",\n\t\t\t\"enforcement\": \"active\",\n\t\t\t\"bypass_actors\": []\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tinput := RepositoryRuleset{\n\t\tName:         \"test ruleset\",\n\t\tEnforcement:  RulesetEnforcementActive,\n\t\tBypassActors: []*BypassActor{},\n\t}\n\n\t_, _, err := client.Organizations.UpdateRepositoryRuleset(ctx, \"o\", 21, input)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.UpdateRepositoryRuleset returned error: %v\", err)\n\t}\n}\n\nfunc TestOrganizationsService_DeleteRepositoryRuleset(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/rulesets/21\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Organizations.DeleteRepositoryRuleset(ctx, \"o\", 21)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.DeleteRepositoryRuleset returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteRepositoryRuleset\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.DeleteRepositoryRuleset(ctx, \"0\", 21)\n\t})\n}\n"
  },
  {
    "path": "github/orgs_security_managers.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// ListSecurityManagerTeams lists all security manager teams for an organization.\n//\n// Deprecated: Please use `client.Organizations.ListTeamsAssignedToOrgRole` instead.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams\n//\n//meta:operation GET /orgs/{org}/security-managers\nfunc (s *OrganizationsService) ListSecurityManagerTeams(ctx context.Context, org string) ([]*Team, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/security-managers\", org)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar teams []*Team\n\tresp, err := s.client.Do(ctx, req, &teams)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn teams, resp, nil\n}\n\n// AddSecurityManagerTeam adds a team to the list of security managers for an organization.\n//\n// Deprecated: Please use `client.Organizations.AssignOrgRoleToTeam` instead.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team\n//\n//meta:operation PUT /orgs/{org}/security-managers/teams/{team_slug}\nfunc (s *OrganizationsService) AddSecurityManagerTeam(ctx context.Context, org, team string) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/security-managers/teams/%v\", org, team)\n\treq, err := s.client.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// RemoveSecurityManagerTeam removes a team from the list of security managers for an organization.\n//\n// Deprecated: Please use `client.Organizations.RemoveOrgRoleFromTeam` instead.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team\n//\n//meta:operation DELETE /orgs/{org}/security-managers/teams/{team_slug}\nfunc (s *OrganizationsService) RemoveSecurityManagerTeam(ctx context.Context, org, team string) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/security-managers/teams/%v\", org, team)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/orgs_security_managers_test.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestOrganizationsService_ListSecurityManagerTeams(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/security-managers\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\tctx := t.Context()\n\tteams, _, err := client.Organizations.ListSecurityManagerTeams(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListSecurityManagerTeams returned error: %v\", err)\n\t}\n\n\twant := []*Team{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(teams, want) {\n\t\tt.Errorf(\"Organizations.ListSecurityManagerTeams returned %+v, want %+v\", teams, want)\n\t}\n\n\tconst methodName = \"ListSecurityManagerTeams\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListSecurityManagerTeams(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListSecurityManagerTeams(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_ListSecurityManagerTeams_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Organizations.ListSecurityManagerTeams(ctx, \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestOrganizationsService_AddSecurityManagerTeam(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/security-managers/teams/t\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Organizations.AddSecurityManagerTeam(ctx, \"o\", \"t\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.AddSecurityManagerTeam returned error: %v\", err)\n\t}\n\n\tconst methodName = \"AddSecurityManagerTeam\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Organizations.AddSecurityManagerTeam(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.AddSecurityManagerTeam(ctx, \"o\", \"t\")\n\t})\n}\n\nfunc TestOrganizationsService_AddSecurityManagerTeam_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Organizations.AddSecurityManagerTeam(ctx, \"%\", \"t\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestOrganizationsService_AddSecurityManagerTeam_invalidTeam(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Organizations.AddSecurityManagerTeam(ctx, \"%\", \"t\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestOrganizationsService_RemoveSecurityManagerTeam(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/security-managers/teams/t\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Organizations.RemoveSecurityManagerTeam(ctx, \"o\", \"t\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.RemoveSecurityManagerTeam returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveSecurityManagerTeam\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Organizations.RemoveSecurityManagerTeam(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.RemoveSecurityManagerTeam(ctx, \"o\", \"t\")\n\t})\n}\n\nfunc TestOrganizationsService_RemoveSecurityManagerTeam_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Organizations.RemoveSecurityManagerTeam(ctx, \"%\", \"t\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestOrganizationsService_RemoveSecurityManagerTeam_invalidTeam(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Organizations.RemoveSecurityManagerTeam(ctx, \"%\", \"t\")\n\ttestURLParseError(t, err)\n}\n"
  },
  {
    "path": "github/orgs_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestOrganization_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Organization{}, \"{}\")\n\n\to := &Organization{\n\t\tBillingEmail:                         Ptr(\"support@github.com\"),\n\t\tBlog:                                 Ptr(\"https://github.com/blog\"),\n\t\tCompany:                              Ptr(\"GitHub\"),\n\t\tEmail:                                Ptr(\"support@github.com\"),\n\t\tTwitterUsername:                      Ptr(\"github\"),\n\t\tLocation:                             Ptr(\"San Francisco\"),\n\t\tName:                                 Ptr(\"github\"),\n\t\tDescription:                          Ptr(\"GitHub, the company.\"),\n\t\tIsVerified:                           Ptr(true),\n\t\tHasOrganizationProjects:              Ptr(true),\n\t\tHasRepositoryProjects:                Ptr(true),\n\t\tDefaultRepoPermission:                Ptr(\"read\"),\n\t\tMembersCanCreateRepos:                Ptr(true),\n\t\tMembersCanCreateInternalRepos:        Ptr(true),\n\t\tMembersCanCreatePrivateRepos:         Ptr(true),\n\t\tMembersCanCreatePublicRepos:          Ptr(false),\n\t\tMembersAllowedRepositoryCreationType: Ptr(\"all\"),\n\t\tMembersCanCreatePages:                Ptr(true),\n\t\tMembersCanCreatePublicPages:          Ptr(false),\n\t\tMembersCanCreatePrivatePages:         Ptr(true),\n\t}\n\twant := `\n\t\t{\n\t\t\t\"billing_email\": \"support@github.com\",\n\t\t\t\"blog\": \"https://github.com/blog\",\n\t\t\t\"company\": \"GitHub\",\n\t\t\t\"email\": \"support@github.com\",\n\t\t\t\"twitter_username\": \"github\",\n\t\t\t\"location\": \"San Francisco\",\n\t\t\t\"name\": \"github\",\n\t\t\t\"description\": \"GitHub, the company.\",\n\t\t\t\"is_verified\": true,\n\t\t\t\"has_organization_projects\": true,\n\t\t\t\"has_repository_projects\": true,\n\t\t\t\"default_repository_permission\": \"read\",\n\t\t\t\"members_can_create_repositories\": true,\n\t\t\t\"members_can_create_public_repositories\": false,\n\t\t\t\"members_can_create_private_repositories\": true,\n\t\t\t\"members_can_create_internal_repositories\": true,\n\t\t\t\"members_allowed_repository_creation_type\": \"all\",\n\t\t\t\"members_can_create_pages\": true,\n\t\t\t\"members_can_create_public_pages\": false,\n\t\t\t\"members_can_create_private_pages\": true\n\t\t}\n\t`\n\ttestJSONMarshal(t, o, want)\n}\n\nfunc TestOrganizationsService_ListAll(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"since\": \"1342004\", \"per_page\": \"30\"})\n\t\tfmt.Fprint(w, `[{\"id\":4314092}]`)\n\t})\n\n\topt := &OrganizationsListOptions{Since: int64(1342004), PerPage: 30}\n\tctx := t.Context()\n\torgs, _, err := client.Organizations.ListAll(ctx, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListAll returned error: %v\", err)\n\t}\n\n\twant := []*Organization{{ID: Ptr(int64(4314092))}}\n\tif !cmp.Equal(orgs, want) {\n\t\tt.Errorf(\"Organizations.ListAll returned %+v, want %+v\", orgs, want)\n\t}\n\n\tconst methodName = \"ListAll\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListAll(ctx, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_List_authenticatedUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/orgs\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"id\":1},{\"id\":2}]`)\n\t})\n\n\tctx := t.Context()\n\torgs, _, err := client.Organizations.List(ctx, \"\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.List returned error: %v\", err)\n\t}\n\n\twant := []*Organization{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}}\n\tif !cmp.Equal(orgs, want) {\n\t\tt.Errorf(\"Organizations.List returned %+v, want %+v\", orgs, want)\n\t}\n\n\tconst methodName = \"List\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.List(ctx, \"\\n\", nil)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.List(ctx, \"\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_List_specifiedUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/orgs\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":1},{\"id\":2}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\torgs, _, err := client.Organizations.List(ctx, \"u\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.List returned error: %v\", err)\n\t}\n\n\twant := []*Organization{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}}\n\tif !cmp.Equal(orgs, want) {\n\t\tt.Errorf(\"Organizations.List returned %+v, want %+v\", orgs, want)\n\t}\n\n\tconst methodName = \"List\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.List(ctx, \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.List(ctx, \"u\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_List_invalidUser(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Organizations.List(ctx, \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestOrganizationsService_Get(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeMemberAllowedRepoCreationTypePreview)\n\t\tfmt.Fprint(w, `{\"id\":1, \"login\":\"l\", \"url\":\"u\", \"avatar_url\": \"a\", \"location\":\"l\"}`)\n\t})\n\n\tctx := t.Context()\n\torg, _, err := client.Organizations.Get(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.Get returned error: %v\", err)\n\t}\n\n\twant := &Organization{ID: Ptr(int64(1)), Login: Ptr(\"l\"), URL: Ptr(\"u\"), AvatarURL: Ptr(\"a\"), Location: Ptr(\"l\")}\n\tif !cmp.Equal(org, want) {\n\t\tt.Errorf(\"Organizations.Get returned %+v, want %+v\", org, want)\n\t}\n\n\tconst methodName = \"Get\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.Get(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.Get(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_Get_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Organizations.Get(ctx, \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestOrganizationsService_GetByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1, \"login\":\"l\", \"url\":\"u\", \"avatar_url\": \"a\", \"location\":\"l\"}`)\n\t})\n\n\tctx := t.Context()\n\torg, _, err := client.Organizations.GetByID(ctx, 1)\n\tif err != nil {\n\t\tt.Fatalf(\"Organizations.GetByID returned error: %v\", err)\n\t}\n\n\twant := &Organization{ID: Ptr(int64(1)), Login: Ptr(\"l\"), URL: Ptr(\"u\"), AvatarURL: Ptr(\"a\"), Location: Ptr(\"l\")}\n\tif !cmp.Equal(org, want) {\n\t\tt.Errorf(\"Organizations.GetByID returned %+v, want %+v\", org, want)\n\t}\n\n\tconst methodName = \"GetByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.GetByID(ctx, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.GetByID(ctx, 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_Edit(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &Organization{Login: Ptr(\"l\")}\n\n\tmux.HandleFunc(\"/orgs/o\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *Organization\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestHeader(t, r, \"Accept\", mediaTypeMemberAllowedRepoCreationTypePreview)\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\torg, _, err := client.Organizations.Edit(ctx, \"o\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.Edit returned error: %v\", err)\n\t}\n\n\twant := &Organization{ID: Ptr(int64(1))}\n\tif !cmp.Equal(org, want) {\n\t\tt.Errorf(\"Organizations.Edit returned %+v, want %+v\", org, want)\n\t}\n\n\tconst methodName = \"Edit\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.Edit(ctx, \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.Edit(ctx, \"o\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_Edit_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Organizations.Edit(ctx, \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestOrganizationsService_Delete(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Organizations.Delete(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.Delete returned error: %v\", err)\n\t}\n\n\tconst methodName = \"Delete\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Organizations.Delete(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.Delete(ctx, \"o\")\n\t})\n}\n\nfunc TestOrganizationsService_ListInstallations(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/installations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"total_count\": 1, \"installations\": [{ \"id\": 1, \"app_id\": 5}]}`)\n\t})\n\n\tctx := t.Context()\n\tapps, _, err := client.Organizations.ListInstallations(ctx, \"o\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListInstallations returned error: %v\", err)\n\t}\n\n\twant := &OrganizationInstallations{TotalCount: Ptr(1), Installations: []*Installation{{ID: Ptr(int64(1)), AppID: Ptr(int64(5))}}}\n\tif !cmp.Equal(apps, want) {\n\t\tt.Errorf(\"Organizations.ListInstallations returned %+v, want %+v\", apps, want)\n\t}\n\n\tconst methodName = \"ListInstallations\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListInstallations(ctx, \"\\no\", nil)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListInstallations(ctx, \"o\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_ListInstallations_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Organizations.ListInstallations(ctx, \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestOrganizationsService_ListInstallations_withListOptions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/installations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `{\"total_count\": 2, \"installations\": [{ \"id\": 2, \"app_id\": 10}]}`)\n\t})\n\n\tctx := t.Context()\n\tapps, _, err := client.Organizations.ListInstallations(ctx, \"o\", &ListOptions{Page: 2})\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListInstallations returned error: %v\", err)\n\t}\n\n\twant := &OrganizationInstallations{TotalCount: Ptr(2), Installations: []*Installation{{ID: Ptr(int64(2)), AppID: Ptr(int64(10))}}}\n\tif !cmp.Equal(apps, want) {\n\t\tt.Errorf(\"Organizations.ListInstallations returned %+v, want %+v\", apps, want)\n\t}\n\n\t// Test ListOptions failure\n\t_, _, err = client.Organizations.ListInstallations(ctx, \"%\", &ListOptions{})\n\tif err == nil {\n\t\tt.Error(\"Organizations.ListInstallations returned error: nil\")\n\t}\n\n\tconst methodName = \"ListInstallations\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListInstallations(ctx, \"\\n\", &ListOptions{Page: 2})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListInstallations(ctx, \"o\", &ListOptions{Page: 2})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationInstallations_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &OrganizationInstallations{}, \"{}\")\n\n\to := &OrganizationInstallations{\n\t\tTotalCount:    Ptr(1),\n\t\tInstallations: []*Installation{{ID: Ptr(int64(1))}},\n\t}\n\twant := `{\n\t\t\"total_count\": 1,\n\t\t\"installations\": [\n\t\t\t{\n\t\t\t\t\"id\": 1\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, o, want)\n}\n\nfunc TestPlan_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Plan{}, \"{}\")\n\n\to := &Plan{\n\t\tName:          Ptr(\"name\"),\n\t\tSpace:         Ptr(1),\n\t\tCollaborators: Ptr(1),\n\t\tPrivateRepos:  Ptr(int64(1)),\n\t\tFilledSeats:   Ptr(1),\n\t\tSeats:         Ptr(1),\n\t}\n\twant := `{\n\t\t\"name\": \"name\",\n\t\t\"space\": 1,\n\t\t\"collaborators\": 1,\n\t\t\"private_repos\": 1,\n\t\t\"filled_seats\": 1,\n\t\t\"seats\": 1\n\t}`\n\n\ttestJSONMarshal(t, o, want)\n}\n"
  },
  {
    "path": "github/orgs_users_blocking.go",
    "content": "// Copyright 2017 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// ListBlockedUsers lists all the users blocked by an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/blocking#list-users-blocked-by-an-organization\n//\n//meta:operation GET /orgs/{org}/blocks\nfunc (s *OrganizationsService) ListBlockedUsers(ctx context.Context, org string, opts *ListOptions) ([]*User, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/blocks\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeBlockUsersPreview)\n\n\tvar blockedUsers []*User\n\tresp, err := s.client.Do(ctx, req, &blockedUsers)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn blockedUsers, resp, nil\n}\n\n// IsBlocked reports whether specified user is blocked from an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/blocking#check-if-a-user-is-blocked-by-an-organization\n//\n//meta:operation GET /orgs/{org}/blocks/{username}\nfunc (s *OrganizationsService) IsBlocked(ctx context.Context, org, user string) (bool, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/blocks/%v\", org, user)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn false, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeBlockUsersPreview)\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tisBlocked, err := parseBoolResponse(err)\n\treturn isBlocked, resp, err\n}\n\n// BlockUser blocks specified user from an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/blocking#block-a-user-from-an-organization\n//\n//meta:operation PUT /orgs/{org}/blocks/{username}\nfunc (s *OrganizationsService) BlockUser(ctx context.Context, org, user string) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/blocks/%v\", org, user)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeBlockUsersPreview)\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// UnblockUser unblocks specified user from an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/orgs/blocking#unblock-a-user-from-an-organization\n//\n//meta:operation DELETE /orgs/{org}/blocks/{username}\nfunc (s *OrganizationsService) UnblockUser(ctx context.Context, org, user string) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/blocks/%v\", org, user)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeBlockUsersPreview)\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/orgs_users_blocking_test.go",
    "content": "// Copyright 2017 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestOrganizationsService_ListBlockedUsers(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/blocks\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeBlockUsersPreview)\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"login\": \"octocat\"\n\t\t}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tblockedUsers, _, err := client.Organizations.ListBlockedUsers(ctx, \"o\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.ListBlockedUsers returned error: %v\", err)\n\t}\n\n\twant := []*User{{Login: Ptr(\"octocat\")}}\n\tif !cmp.Equal(blockedUsers, want) {\n\t\tt.Errorf(\"Organizations.ListBlockedUsers returned %+v, want %+v\", blockedUsers, want)\n\t}\n\n\tconst methodName = \"ListBlockedUsers\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.ListBlockedUsers(ctx, \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.ListBlockedUsers(ctx, \"o\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_IsBlocked(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/blocks/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeBlockUsersPreview)\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tisBlocked, _, err := client.Organizations.IsBlocked(ctx, \"o\", \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.IsBlocked returned error: %v\", err)\n\t}\n\tif want := true; isBlocked != want {\n\t\tt.Errorf(\"Organizations.IsBlocked returned %+v, want %+v\", isBlocked, want)\n\t}\n\n\tconst methodName = \"IsBlocked\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Organizations.IsBlocked(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Organizations.IsBlocked(ctx, \"o\", \"u\")\n\t\tif got {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestOrganizationsService_BlockUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/blocks/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeBlockUsersPreview)\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Organizations.BlockUser(ctx, \"o\", \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.BlockUser returned error: %v\", err)\n\t}\n\n\tconst methodName = \"BlockUser\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Organizations.BlockUser(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.BlockUser(ctx, \"o\", \"u\")\n\t})\n}\n\nfunc TestOrganizationsService_UnblockUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/blocks/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeBlockUsersPreview)\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Organizations.UnblockUser(ctx, \"o\", \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Organizations.UnblockUser returned error: %v\", err)\n\t}\n\n\tconst methodName = \"UnblockUser\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Organizations.UnblockUser(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Organizations.UnblockUser(ctx, \"o\", \"u\")\n\t})\n}\n"
  },
  {
    "path": "github/packages.go",
    "content": "// Copyright 2020 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n)\n\n// Package represents a GitHub package.\ntype Package struct {\n\tID          *int64      `json:\"id,omitempty\"`\n\tName        *string     `json:\"name,omitempty\"`\n\tPackageType *string     `json:\"package_type,omitempty\"` // One of \"npm\", \"maven\", \"rubygems\", \"docker\", \"nuget\", \"container\". For webhook events \"container\" is \"CONTAINER\"\n\tHTMLURL     *string     `json:\"html_url,omitempty\"`\n\tVisibility  *string     `json:\"visibility,omitempty\"`\n\tOwner       *User       `json:\"owner,omitempty\"`\n\tRepository  *Repository `json:\"repository,omitempty\"`\n\tCreatedAt   *Timestamp  `json:\"created_at,omitempty\"`\n\tUpdatedAt   *Timestamp  `json:\"updated_at,omitempty\"`\n\n\t// The following are only populated for webhook events\n\tNamespace      *string          `json:\"namespace,omitempty\"`\n\tDescription    *string          `json:\"description,omitempty\"`\n\tEcosystem      *string          `json:\"ecosystem,omitempty\"`\n\tPackageVersion *PackageVersion  `json:\"package_version,omitempty\"`\n\tRegistry       *PackageRegistry `json:\"registry,omitempty\"`\n\n\t// The following are NOT populated for webhook events\n\tURL          *string `json:\"url,omitempty\"`\n\tVersionCount *int64  `json:\"version_count,omitempty\"`\n}\n\nfunc (p Package) String() string {\n\treturn Stringify(p)\n}\n\n// PackageVersion represents a GitHub package version.\ntype PackageVersion struct {\n\tID             *int64          `json:\"id,omitempty\"`\n\tName           *string         `json:\"name,omitempty\"`\n\tURL            *string         `json:\"url,omitempty\"`\n\tPackageHTMLURL *string         `json:\"package_html_url,omitempty\"`\n\tLicense        *string         `json:\"license,omitempty\"`\n\tDescription    *string         `json:\"description,omitempty\"`\n\tCreatedAt      *Timestamp      `json:\"created_at,omitempty\"`\n\tUpdatedAt      *Timestamp      `json:\"updated_at,omitempty\"`\n\tMetadata       json.RawMessage `json:\"metadata,omitempty\"` // For webhook events this will be []interface, else it will be of type PackageMetadata\n\n\t// The following are only populated for webhook events\n\tVersion             *string                        `json:\"version,omitempty\"`\n\tSummary             *string                        `json:\"summary,omitempty\"`\n\tBody                json.RawMessage                `json:\"body,omitempty\"` // Can either be a string or of type PackageVersionBody\n\tBodyHTML            *string                        `json:\"body_html,omitempty\"`\n\tRelease             *PackageRelease                `json:\"release,omitempty\"`\n\tManifest            *string                        `json:\"manifest,omitempty\"`\n\tHTMLURL             *string                        `json:\"html_url,omitempty\"`\n\tTagName             *string                        `json:\"tag_name,omitempty\"`\n\tTargetCommitish     *string                        `json:\"target_commitish,omitempty\"`\n\tTargetOID           *string                        `json:\"target_oid,omitempty\"`\n\tDraft               *bool                          `json:\"draft,omitempty\"`\n\tPrerelease          *bool                          `json:\"prerelease,omitempty\"`\n\tContainerMetadata   *PackageEventContainerMetadata `json:\"container_metadata,omitempty\"`\n\tDockerMetadata      []any                          `json:\"docker_metadata,omitempty\"`\n\tNPMMetadata         *PackageNPMMetadata            `json:\"npm_metadata,omitempty\"`\n\tNugetMetadata       []*PackageNugetMetadata        `json:\"nuget_metadata,omitempty\"`\n\tRubyMetadata        map[string]any                 `json:\"ruby_metadata,omitempty\"`\n\tPackageFiles        []*PackageFile                 `json:\"package_files,omitempty\"`\n\tPackageURL          *string                        `json:\"package_url,omitempty\"`\n\tAuthor              *User                          `json:\"author,omitempty\"`\n\tSourceURL           *string                        `json:\"source_url,omitempty\"`\n\tInstallationCommand *string                        `json:\"installation_command,omitempty\"`\n\n\t// The following are NOT populated for webhook events\n\tDeletedAt *Timestamp `json:\"deleted_at,omitempty\"`\n}\n\n// GetBody returns the body field as a string if it's valid.\nfunc (pv *PackageVersion) GetBody() (body string, ok bool) {\n\tif pv == nil || pv.Body == nil {\n\t\treturn \"\", false\n\t}\n\n\tif err := json.Unmarshal(pv.Body, &body); err != nil {\n\t\treturn \"\", false\n\t}\n\n\treturn body, true\n}\n\n// GetBodyAsPackageVersionBody returns the body field as a PackageVersionBody if it's valid.\nfunc (pv *PackageVersion) GetBodyAsPackageVersionBody() (body *PackageVersionBody, ok bool) {\n\tif pv == nil || pv.Body == nil {\n\t\treturn nil, false\n\t}\n\n\tif err := json.Unmarshal(pv.Body, &body); err != nil {\n\t\treturn nil, false\n\t}\n\n\treturn body, true\n}\n\n// GetMetadata returns the metadata field as PackageMetadata if it's valid.\nfunc (pv *PackageVersion) GetMetadata() (metadata *PackageMetadata, ok bool) {\n\tif pv == nil || pv.Metadata == nil {\n\t\treturn nil, false\n\t}\n\n\tif err := json.Unmarshal(pv.Metadata, &metadata); err != nil {\n\t\treturn nil, false\n\t}\n\n\treturn metadata, true\n}\n\n// GetRawMetadata returns the metadata field as a json.RawMessage.\nfunc (pv *PackageVersion) GetRawMetadata() json.RawMessage {\n\tif pv == nil || pv.Metadata == nil {\n\t\treturn json.RawMessage{}\n\t}\n\n\treturn pv.Metadata\n}\n\nfunc (pv PackageVersion) String() string {\n\treturn Stringify(pv)\n}\n\n// PackageRelease represents a GitHub package version release.\ntype PackageRelease struct {\n\tURL             *string    `json:\"url,omitempty\"`\n\tHTMLURL         *string    `json:\"html_url,omitempty\"`\n\tID              *int64     `json:\"id,omitempty\"`\n\tTagName         *string    `json:\"tag_name,omitempty\"`\n\tTargetCommitish *string    `json:\"target_commitish,omitempty\"`\n\tName            *string    `json:\"name,omitempty\"`\n\tDraft           *bool      `json:\"draft,omitempty\"`\n\tAuthor          *User      `json:\"author,omitempty\"`\n\tPrerelease      *bool      `json:\"prerelease,omitempty\"`\n\tCreatedAt       *Timestamp `json:\"created_at,omitempty\"`\n\tPublishedAt     *Timestamp `json:\"published_at,omitempty\"`\n}\n\nfunc (r PackageRelease) String() string {\n\treturn Stringify(r)\n}\n\n// PackageFile represents a GitHub package version release file.\ntype PackageFile struct {\n\tDownloadURL *string    `json:\"download_url,omitempty\"`\n\tID          *int64     `json:\"id,omitempty\"`\n\tName        *string    `json:\"name,omitempty\"`\n\tSHA256      *string    `json:\"sha256,omitempty\"`\n\tSHA1        *string    `json:\"sha1,omitempty\"`\n\tMD5         *string    `json:\"md5,omitempty\"`\n\tContentType *string    `json:\"content_type,omitempty\"`\n\tState       *string    `json:\"state,omitempty\"`\n\tAuthor      *User      `json:\"author,omitempty\"`\n\tSize        *int64     `json:\"size,omitempty\"`\n\tCreatedAt   *Timestamp `json:\"created_at,omitempty\"`\n\tUpdatedAt   *Timestamp `json:\"updated_at,omitempty\"`\n}\n\nfunc (pf PackageFile) String() string {\n\treturn Stringify(pf)\n}\n\n// PackageRegistry represents a GitHub package registry.\ntype PackageRegistry struct {\n\tAboutURL *string `json:\"about_url,omitempty\"`\n\tName     *string `json:\"name,omitempty\"`\n\tType     *string `json:\"type,omitempty\"`\n\tURL      *string `json:\"url,omitempty\"`\n\tVendor   *string `json:\"vendor,omitempty\"`\n}\n\nfunc (r PackageRegistry) String() string {\n\treturn Stringify(r)\n}\n\n// PackageListOptions represents the optional list options for a package.\ntype PackageListOptions struct {\n\t// Visibility of packages \"public\", \"internal\" or \"private\".\n\tVisibility *string `url:\"visibility,omitempty\"`\n\n\t// PackageType represents the type of package.\n\t// It can be one of \"npm\", \"maven\", \"rubygems\", \"nuget\", \"docker\", or \"container\".\n\tPackageType *string `url:\"package_type,omitempty\"`\n\n\t// State of package either \"active\" or \"deleted\".\n\tState *string `url:\"state,omitempty\"`\n\n\tListOptions\n}\n\n// PackageMetadata represents metadata from a package.\ntype PackageMetadata struct {\n\tPackageType *string                   `json:\"package_type,omitempty\"`\n\tContainer   *PackageContainerMetadata `json:\"container,omitempty\"`\n}\n\nfunc (r PackageMetadata) String() string {\n\treturn Stringify(r)\n}\n\n// PackageContainerMetadata represents container metadata for docker container packages.\ntype PackageContainerMetadata struct {\n\tTags []string `json:\"tags,omitempty\"`\n}\n\nfunc (r PackageContainerMetadata) String() string {\n\treturn Stringify(r)\n}\n\n// PackageVersionBody represents the body field of a package version.\ntype PackageVersionBody struct {\n\tRepo *Repository             `json:\"repository,omitempty\"`\n\tInfo *PackageVersionBodyInfo `json:\"info,omitempty\"`\n}\n\nfunc (b PackageVersionBody) String() string {\n\treturn Stringify(b)\n}\n\n// PackageVersionBodyInfo represents the info field of a PackageVersionBody.\ntype PackageVersionBodyInfo struct {\n\tType       *string `json:\"type,omitempty\"`\n\tOID        *string `json:\"oid,omitempty\"`\n\tMode       *int64  `json:\"mode,omitempty\"`\n\tName       *string `json:\"name,omitempty\"`\n\tPath       *string `json:\"path,omitempty\"`\n\tSize       *int64  `json:\"size,omitempty\"`\n\tCollection *bool   `json:\"collection,omitempty\"`\n}\n\nfunc (bi PackageVersionBodyInfo) String() string {\n\treturn Stringify(bi)\n}\n\n// PackageEventContainerMetadata represents metadata for container packages as part of a webhook event.\n// See also PackageContainerMetadata.\ntype PackageEventContainerMetadata struct {\n\tLabels   map[string]any                    `json:\"labels,omitempty\"`\n\tManifest map[string]any                    `json:\"manifest,omitempty\"`\n\tTag      *PackageEventContainerMetadataTag `json:\"tag,omitempty\"`\n}\n\nfunc (m PackageEventContainerMetadata) String() string {\n\treturn Stringify(m)\n}\n\n// PackageEventContainerMetadataTag represents a tag of a GitHub container package.\ntype PackageEventContainerMetadataTag struct {\n\tName   *string `json:\"name,omitempty\"`\n\tDigest *string `json:\"digest,omitempty\"`\n}\n\nfunc (mt PackageEventContainerMetadataTag) String() string {\n\treturn Stringify(mt)\n}\n\n// PackageNugetMetadata represents nuget metadata for a GitHub package.\ntype PackageNugetMetadata struct {\n\tID    json.RawMessage `json:\"id,omitempty\"` // Can either be an int64 or string\n\tName  *string         `json:\"name,omitempty\"`\n\tValue json.RawMessage `json:\"value,omitempty\"` // Can either be a bool, string, integer or object\n}\n\nfunc (nm PackageNugetMetadata) String() string {\n\treturn Stringify(nm)\n}\n\n// PackageNPMMetadata represents NPM metadata for a GitHub package.\ntype PackageNPMMetadata struct {\n\tName                 *string           `json:\"name,omitempty\"`\n\tVersion              *string           `json:\"version,omitempty\"`\n\tNPMUser              *string           `json:\"npm_user,omitempty\"`\n\tAuthor               map[string]string `json:\"author,omitempty\"`\n\tBugs                 map[string]string `json:\"bugs,omitempty\"`\n\tDependencies         map[string]string `json:\"dependencies,omitempty\"`\n\tDevDependencies      map[string]string `json:\"dev_dependencies,omitempty\"`\n\tPeerDependencies     map[string]string `json:\"peer_dependencies,omitempty\"`\n\tOptionalDependencies map[string]string `json:\"optional_dependencies,omitempty\"`\n\tDescription          *string           `json:\"description,omitempty\"`\n\tDist                 map[string]string `json:\"dist,omitempty\"`\n\tGitHead              *string           `json:\"git_head,omitempty\"`\n\tHomepage             *string           `json:\"homepage,omitempty\"`\n\tLicense              *string           `json:\"license,omitempty\"`\n\tMain                 *string           `json:\"main,omitempty\"`\n\tRepository           map[string]string `json:\"repository,omitempty\"`\n\tScripts              map[string]any    `json:\"scripts,omitempty\"`\n\tID                   *string           `json:\"id,omitempty\"`\n\tNodeVersion          *string           `json:\"node_version,omitempty\"`\n\tNPMVersion           *string           `json:\"npm_version,omitempty\"`\n\tHasShrinkwrap        *bool             `json:\"has_shrinkwrap,omitempty\"`\n\tMaintainers          []any             `json:\"maintainers,omitempty\"`\n\tContributors         []any             `json:\"contributors,omitempty\"`\n\tEngines              map[string]string `json:\"engines,omitempty\"`\n\tKeywords             []string          `json:\"keywords,omitempty\"`\n\tFiles                []string          `json:\"files,omitempty\"`\n\tBin                  map[string]any    `json:\"bin,omitempty\"`\n\tMan                  map[string]any    `json:\"man,omitempty\"`\n\tDirectories          map[string]string `json:\"directories,omitempty\"`\n\tOS                   []string          `json:\"os,omitempty\"`\n\tCPU                  []string          `json:\"cpu,omitempty\"`\n\tReadme               *string           `json:\"readme,omitempty\"`\n\tInstallationCommand  *string           `json:\"installation_command,omitempty\"`\n\tReleaseID            *int64            `json:\"release_id,omitempty\"`\n\tCommitOID            *string           `json:\"commit_oid,omitempty\"`\n\tPublishedViaActions  *bool             `json:\"published_via_actions,omitempty\"`\n\tDeletedByID          *int64            `json:\"deleted_by_id,omitempty\"`\n}\n\nfunc (nm PackageNPMMetadata) String() string {\n\treturn Stringify(nm)\n}\n"
  },
  {
    "path": "github/packages_test.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestPackageRegistry_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PackageRegistry{}, \"{}\")\n\n\to := &PackageRegistry{\n\t\tAboutURL: Ptr(\"aurl\"),\n\t\tName:     Ptr(\"name\"),\n\t\tType:     Ptr(\"type\"),\n\t\tURL:      Ptr(\"url\"),\n\t\tVendor:   Ptr(\"vendor\"),\n\t}\n\twant := `{\n\t\t\"about_url\": \"aurl\",\n\t\t\"name\": \"name\",\n\t\t\"type\": \"type\",\n\t\t\"url\": \"url\",\n\t\t\"vendor\": \"vendor\"\n\t}`\n\n\ttestJSONMarshal(t, o, want)\n}\n\nfunc TestPackageFile_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PackageFile{}, \"{}\")\n\n\to := &PackageFile{\n\t\tDownloadURL: Ptr(\"durl\"),\n\t\tID:          Ptr(int64(1)),\n\t\tName:        Ptr(\"name\"),\n\t\tSHA256:      Ptr(\"sha256\"),\n\t\tSHA1:        Ptr(\"sha1\"),\n\t\tMD5:         Ptr(\"md5\"),\n\t\tContentType: Ptr(\"ct\"),\n\t\tState:       Ptr(\"state\"),\n\t\tAuthor: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t\tSize:      Ptr(int64(1)),\n\t\tCreatedAt: &Timestamp{referenceTime},\n\t\tUpdatedAt: &Timestamp{referenceTime},\n\t}\n\n\twant := `{\n\t\t\"download_url\": \"durl\",\n\t\t\"id\": 1,\n\t\t\"name\": \"name\",\n\t\t\"sha256\": \"sha256\",\n\t\t\"sha1\": \"sha1\",\n\t\t\"md5\": \"md5\",\n\t\t\"content_type\": \"ct\",\n\t\t\"state\": \"state\",\n\t\t\"author\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"size\": 1,\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `\n\t}`\n\n\ttestJSONMarshal(t, o, want)\n}\n\nfunc TestPackageRelease_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PackageRelease{}, \"{}\")\n\n\to := &PackageRelease{\n\t\tURL:             Ptr(\"url\"),\n\t\tHTMLURL:         Ptr(\"hurl\"),\n\t\tID:              Ptr(int64(1)),\n\t\tTagName:         Ptr(\"tn\"),\n\t\tTargetCommitish: Ptr(\"tcs\"),\n\t\tName:            Ptr(\"name\"),\n\t\tDraft:           Ptr(true),\n\t\tAuthor: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t\tPrerelease:  Ptr(true),\n\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\tPublishedAt: &Timestamp{referenceTime},\n\t}\n\n\twant := `{\n\t\t\"url\": \"url\",\n\t\t\"html_url\": \"hurl\",\n\t\t\"id\": 1,\n\t\t\"tag_name\": \"tn\",\n\t\t\"target_commitish\": \"tcs\",\n\t\t\"name\": \"name\",\n\t\t\"draft\": true,\n\t\t\"author\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"prerelease\": true,\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"published_at\": ` + referenceTimeStr + `\n\t}`\n\n\ttestJSONMarshal(t, o, want)\n}\n\nfunc TestPackageVersion_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PackageVersion{}, \"{}\")\n\n\tmetadata, _ := json.Marshal([]string{\"a\", \"b\"})\n\n\to := &PackageVersion{\n\t\tID:             Ptr(int64(1)),\n\t\tName:           Ptr(\"n\"),\n\t\tURL:            Ptr(\"url\"),\n\t\tPackageHTMLURL: Ptr(\"phurl\"),\n\t\tLicense:        Ptr(\"l\"),\n\t\tDescription:    Ptr(\"d\"),\n\t\tCreatedAt:      &Timestamp{referenceTime},\n\t\tUpdatedAt:      &Timestamp{referenceTime},\n\t\tMetadata:       metadata,\n\t\tVersion:        Ptr(\"ver\"),\n\t\tSummary:        Ptr(\"sum\"),\n\t\tBody:           json.RawMessage(`\"body\"`),\n\t\tBodyHTML:       Ptr(\"btnhtml\"),\n\t\tRelease: &PackageRelease{\n\t\t\tURL:             Ptr(\"url\"),\n\t\t\tHTMLURL:         Ptr(\"hurl\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tTagName:         Ptr(\"tn\"),\n\t\t\tTargetCommitish: Ptr(\"tcs\"),\n\t\t\tName:            Ptr(\"name\"),\n\t\t\tDraft:           Ptr(true),\n\t\t\tAuthor: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tPrerelease:  Ptr(true),\n\t\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\t\tPublishedAt: &Timestamp{referenceTime},\n\t\t},\n\t\tManifest:        Ptr(\"mani\"),\n\t\tHTMLURL:         Ptr(\"hurl\"),\n\t\tTagName:         Ptr(\"tn\"),\n\t\tTargetCommitish: Ptr(\"tcs\"),\n\t\tTargetOID:       Ptr(\"tid\"),\n\t\tDraft:           Ptr(true),\n\t\tPrerelease:      Ptr(true),\n\t\tContainerMetadata: &PackageEventContainerMetadata{\n\t\t\tLabels: map[string]any{\"l1\": true, \"l2\": \"a\"},\n\t\t},\n\t\tDockerMetadata: []any{\"a\", \"b\"},\n\t\tNPMMetadata: Ptr(PackageNPMMetadata{\n\t\t\tName: Ptr(\"n\"),\n\t\t}),\n\t\tNugetMetadata: []*PackageNugetMetadata{\n\t\t\t{Name: Ptr(\"n\")},\n\t\t},\n\t\tRubyMetadata: map[string]any{\"k1\": \"v1\", \"k2\": \"v2\"},\n\t\tPackageFiles: []*PackageFile{\n\t\t\t{\n\t\t\t\tDownloadURL: Ptr(\"durl\"),\n\t\t\t\tID:          Ptr(int64(1)),\n\t\t\t\tName:        Ptr(\"name\"),\n\t\t\t\tSHA256:      Ptr(\"sha256\"),\n\t\t\t\tSHA1:        Ptr(\"sha1\"),\n\t\t\t\tMD5:         Ptr(\"md5\"),\n\t\t\t\tContentType: Ptr(\"ct\"),\n\t\t\t\tState:       Ptr(\"state\"),\n\t\t\t\tAuthor: &User{\n\t\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\t\tHireable:        Ptr(true),\n\t\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t\t},\n\t\t\t\tSize:      Ptr(int64(1)),\n\t\t\t\tCreatedAt: &Timestamp{referenceTime},\n\t\t\t\tUpdatedAt: &Timestamp{referenceTime},\n\t\t\t},\n\t\t},\n\t\tPackageURL: Ptr(\"purl\"),\n\t\tAuthor: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t\tSourceURL:           Ptr(\"surl\"),\n\t\tInstallationCommand: Ptr(\"ic\"),\n\t\tDeletedAt:           &Timestamp{referenceTime},\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"name\": \"n\",\n\t\t\"url\": \"url\",\n\t\t\"package_html_url\": \"phurl\",\n\t\t\"license\": \"l\",\n\t\t\"description\": \"d\",\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"metadata\": [\"a\", \"b\"],\n\t\t\"version\": \"ver\",\n\t\t\"summary\": \"sum\",\n\t\t\"body\": \"body\",\n\t\t\"body_html\": \"btnhtml\",\n\t\t\"release\": {\n\t\t\t\"url\": \"url\",\n\t\t\t\"html_url\": \"hurl\",\n\t\t\t\"id\": 1,\n\t\t\t\"tag_name\": \"tn\",\n\t\t\t\"target_commitish\": \"tcs\",\n\t\t\t\"name\": \"name\",\n\t\t\t\"draft\": true,\n\t\t\t\"author\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"prerelease\": true,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"published_at\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"manifest\": \"mani\",\n\t\t\"html_url\": \"hurl\",\n\t\t\"tag_name\": \"tn\",\n\t\t\"target_commitish\": \"tcs\",\n\t\t\"target_oid\": \"tid\",\n\t\t\"draft\": true,\n\t\t\"prerelease\": true,\n\t\t\"container_metadata\": {\n\t\t\t\"labels\": {\n\t\t\t\t\"l1\": true,\n\t\t\t\t\"l2\": \"a\"\n\t\t\t}\n\t\t},\n\t\t\"docker_metadata\": [\"a\", \"b\"],\n\t\t\"npm_metadata\": {\n\t\t\t\"name\": \"n\"\n\t\t},\n\t\t\"nuget_metadata\": [{\"name\": \"n\"}],\n\t\t\"ruby_metadata\": {\n\t\t\t\"k1\": \"v1\",\n\t\t\t\"k2\": \"v2\"\n\t\t},\n\t\t\"package_files\": [\n\t\t\t{\n\t\t\t\t\"download_url\": \"durl\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"name\": \"name\",\n\t\t\t\t\"sha256\": \"sha256\",\n\t\t\t\t\"sha1\": \"sha1\",\n\t\t\t\t\"md5\": \"md5\",\n\t\t\t\t\"content_type\": \"ct\",\n\t\t\t\t\"state\": \"state\",\n\t\t\t\t\"author\": {\n\t\t\t\t\t\"login\": \"l\",\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\"company\": \"c\",\n\t\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\t\"location\": \"l\",\n\t\t\t\t\t\"email\": \"e\",\n\t\t\t\t\t\"hireable\": true,\n\t\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\t\"followers\": 1,\n\t\t\t\t\t\"following\": 1,\n\t\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\t\"url\": \"u\"\n\t\t\t\t},\n\t\t\t\t\"size\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"updated_at\": ` + referenceTimeStr + `\n\t\t\t}\n\t\t],\n\t\t\"package_url\": \"purl\",\n\t\t\"author\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"source_url\": \"surl\",\n\t\t\"installation_command\": \"ic\",\n\t\t\"deleted_at\": ` + referenceTimeStr + `\n\t}`\n\n\ttestJSONMarshal(t, o, want, cmpJSONRawMessageComparator())\n}\n\nfunc TestPackageVersion_GetBody(t *testing.T) {\n\tt.Parallel()\n\n\ttests := map[string]struct {\n\t\tpv        *PackageVersion\n\t\twantValue string\n\t\twantOk    bool\n\t}{\n\t\t\"pv nil\": {\n\t\t\tpv:        nil,\n\t\t\twantValue: \"\",\n\t\t\twantOk:    false,\n\t\t},\n\t\t\"body nil\": {\n\t\t\tpv: &PackageVersion{\n\t\t\t\tBody: nil,\n\t\t\t},\n\t\t\twantValue: \"\",\n\t\t\twantOk:    false,\n\t\t},\n\t\t\"invalid body\": {\n\t\t\tpv: &PackageVersion{\n\t\t\t\tBody: json.RawMessage(`{\n\t\t\t\t\t\"repository\": {\n\t\t\t\t\t\t\"name\": \"n\"\n\t\t\t\t\t},\n\t\t\t\t\t\"info\": {\n\t\t\t\t\t\t\"type\": \"t\"\n\t\t\t\t\t}\n\t\t\t\t}`),\n\t\t\t},\n\t\t\twantValue: \"\",\n\t\t\twantOk:    false,\n\t\t},\n\t\t\"valid body\": {\n\t\t\tpv: &PackageVersion{\n\t\t\t\tBody: json.RawMessage(`\"body\"`),\n\t\t\t},\n\t\t\twantValue: \"body\",\n\t\t\twantOk:    true,\n\t\t},\n\t}\n\n\tfor name, test := range tests {\n\t\tt.Run(name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\n\t\t\tresValue, resOk := test.pv.GetBody()\n\n\t\t\tif resValue != test.wantValue || resOk != test.wantOk {\n\t\t\t\tt.Errorf(\"PackageVersion.GetBody() - got: %v, %v; want: %v, %v\", resValue, resOk, test.wantValue, test.wantOk)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestPackageVersion_GetBodyAsPackageVersionBody(t *testing.T) {\n\tt.Parallel()\n\n\ttests := map[string]struct {\n\t\tpv        *PackageVersion\n\t\twantValue *PackageVersionBody\n\t\twantOk    bool\n\t}{\n\t\t\"pv nil\": {\n\t\t\tpv:        nil,\n\t\t\twantValue: nil,\n\t\t\twantOk:    false,\n\t\t},\n\t\t\"body nil\": {\n\t\t\tpv: &PackageVersion{\n\t\t\t\tBody: nil,\n\t\t\t},\n\t\t\twantValue: nil,\n\t\t\twantOk:    false,\n\t\t},\n\t\t\"invalid body\": {\n\t\t\tpv: &PackageVersion{\n\t\t\t\tBody: json.RawMessage(`\"body\"`),\n\t\t\t},\n\t\t\twantValue: nil,\n\t\t\twantOk:    false,\n\t\t},\n\t\t\"valid body\": {\n\t\t\tpv: &PackageVersion{\n\t\t\t\tBody: json.RawMessage(`{\n\t\t\t\t\t\"repository\": {\n\t\t\t\t\t\t\"name\": \"n\"\n\t\t\t\t\t},\n\t\t\t\t\t\"info\": {\n\t\t\t\t\t\t\"type\": \"t\"\n\t\t\t\t\t}\n\t\t\t\t}`),\n\t\t\t},\n\t\t\twantValue: &PackageVersionBody{\n\t\t\t\tRepo: &Repository{\n\t\t\t\t\tName: Ptr(\"n\"),\n\t\t\t\t},\n\t\t\t\tInfo: &PackageVersionBodyInfo{\n\t\t\t\t\tType: Ptr(\"t\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\twantOk: true,\n\t\t},\n\t}\n\n\tfor name, test := range tests {\n\t\tt.Run(name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\n\t\t\tresValue, resOk := test.pv.GetBodyAsPackageVersionBody()\n\n\t\t\tif !cmp.Equal(resValue, test.wantValue) || resOk != test.wantOk {\n\t\t\t\tt.Errorf(\"PackageVersion.GetBodyAsPackageVersionBody() - got: %v, %v; want: %v, %v\", resValue, resOk, test.wantValue, test.wantOk)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestPackageVersion_GetMetadata(t *testing.T) {\n\tt.Parallel()\n\n\ttests := map[string]struct {\n\t\tpv        *PackageVersion\n\t\twantValue *PackageMetadata\n\t\twantOk    bool\n\t}{\n\t\t\"pv nil\": {\n\t\t\tpv:        nil,\n\t\t\twantValue: nil,\n\t\t\twantOk:    false,\n\t\t},\n\t\t\"metadata nil\": {\n\t\t\tpv: &PackageVersion{\n\t\t\t\tMetadata: nil,\n\t\t\t},\n\t\t\twantValue: nil,\n\t\t\twantOk:    false,\n\t\t},\n\t\t\"invalid metadata\": {\n\t\t\tpv: &PackageVersion{\n\t\t\t\tMetadata: json.RawMessage(`[]`),\n\t\t\t},\n\t\t\twantValue: nil,\n\t\t\twantOk:    false,\n\t\t},\n\t\t\"valid metadata\": {\n\t\t\tpv: &PackageVersion{\n\t\t\t\tMetadata: json.RawMessage(`{\n\t\t\t\t\t\"package_type\": \"container\",\n\t\t\t\t\t\"container\": {\n\t\t\t\t\t\t\"tags\": [\"a\"]\n\t\t\t\t\t}\n\t\t\t\t}`),\n\t\t\t},\n\t\t\twantValue: &PackageMetadata{\n\t\t\t\tPackageType: Ptr(\"container\"),\n\t\t\t\tContainer: &PackageContainerMetadata{\n\t\t\t\t\tTags: []string{\"a\"},\n\t\t\t\t},\n\t\t\t},\n\t\t\twantOk: true,\n\t\t},\n\t}\n\n\tfor name, test := range tests {\n\t\tt.Run(name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\n\t\t\tresValue, resOk := test.pv.GetMetadata()\n\n\t\t\tif !cmp.Equal(resValue, test.wantValue) || resOk != test.wantOk {\n\t\t\t\tt.Errorf(\"PackageVersion.GetMetadata() - got: %v, %v; want: %v, %v\", resValue, resOk, test.wantValue, test.wantOk)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestPackageVersion_GetRawMetadata(t *testing.T) {\n\tt.Parallel()\n\n\ttests := map[string]struct {\n\t\tpv   *PackageVersion\n\t\twant json.RawMessage\n\t}{\n\t\t\"pv nil\": {\n\t\t\tpv:   nil,\n\t\t\twant: nil,\n\t\t},\n\t\t\"metadata nil\": {\n\t\t\tpv: &PackageVersion{\n\t\t\t\tMetadata: nil,\n\t\t\t},\n\t\t\twant: json.RawMessage{},\n\t\t},\n\t\t\"valid metadata\": {\n\t\t\tpv: &PackageVersion{\n\t\t\t\tMetadata: json.RawMessage(`\"a\"`),\n\t\t\t},\n\t\t\twant: json.RawMessage(`\"a\"`),\n\t\t},\n\t}\n\n\tfor name, test := range tests {\n\t\tt.Run(name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\n\t\t\tres := test.pv.GetRawMetadata()\n\n\t\t\tif string(res) != string(test.want) {\n\t\t\t\tt.Errorf(\"PackageVersion.GetRawMetadata() - got: %v; want: %v\", res, test.want)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestPackage_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Package{}, \"{}\")\n\n\to := &Package{\n\t\tID:          Ptr(int64(1)),\n\t\tName:        Ptr(\"name\"),\n\t\tPackageType: Ptr(\"pt\"),\n\t\tHTMLURL:     Ptr(\"hurl\"),\n\t\tVisibility:  Ptr(\"private\"),\n\t\tOwner: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t\tRepository:  &Repository{ID: Ptr(int64(1))},\n\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\tUpdatedAt:   &Timestamp{referenceTime},\n\t\tNamespace:   Ptr(\"n\"),\n\t\tDescription: Ptr(\"d\"),\n\t\tEcosystem:   Ptr(\"e\"),\n\t\tPackageVersion: &PackageVersion{\n\t\t\tID:       Ptr(int64(1)),\n\t\t\tVersion:  Ptr(\"ver\"),\n\t\t\tSummary:  Ptr(\"sum\"),\n\t\t\tBody:     json.RawMessage(`\"body\"`),\n\t\t\tBodyHTML: Ptr(\"btnhtml\"),\n\t\t\tRelease: &PackageRelease{\n\t\t\t\tURL:             Ptr(\"url\"),\n\t\t\t\tHTMLURL:         Ptr(\"hurl\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tTagName:         Ptr(\"tn\"),\n\t\t\t\tTargetCommitish: Ptr(\"tcs\"),\n\t\t\t\tName:            Ptr(\"name\"),\n\t\t\t\tDraft:           Ptr(true),\n\t\t\t\tAuthor: &User{\n\t\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\t\tHireable:        Ptr(true),\n\t\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t\t},\n\t\t\t\tPrerelease:  Ptr(true),\n\t\t\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\t\t\tPublishedAt: &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tManifest:        Ptr(\"mani\"),\n\t\t\tHTMLURL:         Ptr(\"hurl\"),\n\t\t\tTagName:         Ptr(\"tn\"),\n\t\t\tTargetCommitish: Ptr(\"tcs\"),\n\t\t\tTargetOID:       Ptr(\"tid\"),\n\t\t\tDraft:           Ptr(true),\n\t\t\tPrerelease:      Ptr(true),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tUpdatedAt:       &Timestamp{referenceTime},\n\t\t\tPackageFiles: []*PackageFile{\n\t\t\t\t{\n\t\t\t\t\tDownloadURL: Ptr(\"durl\"),\n\t\t\t\t\tID:          Ptr(int64(1)),\n\t\t\t\t\tName:        Ptr(\"name\"),\n\t\t\t\t\tSHA256:      Ptr(\"sha256\"),\n\t\t\t\t\tSHA1:        Ptr(\"sha1\"),\n\t\t\t\t\tMD5:         Ptr(\"md5\"),\n\t\t\t\t\tContentType: Ptr(\"ct\"),\n\t\t\t\t\tState:       Ptr(\"state\"),\n\t\t\t\t\tAuthor: &User{\n\t\t\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\t\t\tHireable:        Ptr(true),\n\t\t\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t\t\t},\n\t\t\t\t\tSize:      Ptr(int64(1)),\n\t\t\t\t\tCreatedAt: &Timestamp{referenceTime},\n\t\t\t\t\tUpdatedAt: &Timestamp{referenceTime},\n\t\t\t\t},\n\t\t\t},\n\t\t\tAuthor: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tInstallationCommand: Ptr(\"ic\"),\n\t\t},\n\t\tRegistry: &PackageRegistry{\n\t\t\tAboutURL: Ptr(\"aurl\"),\n\t\t\tName:     Ptr(\"name\"),\n\t\t\tType:     Ptr(\"type\"),\n\t\t\tURL:      Ptr(\"url\"),\n\t\t\tVendor:   Ptr(\"vendor\"),\n\t\t},\n\t\tURL:          Ptr(\"url\"),\n\t\tVersionCount: Ptr(int64(1)),\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"name\": \"name\",\n\t\t\"package_type\": \"pt\",\n\t\t\"html_url\": \"hurl\",\n\t\t\"visibility\": \"private\",\n\t\t\"owner\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"repository\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"namespace\": \"n\",\n\t\t\"description\": \"d\",\n\t\t\"ecosystem\": \"e\",\n\t\t\"package_version\": {\n\t\t\t\"id\": 1,\n\t\t\t\"version\": \"ver\",\n\t\t\t\"summary\": \"sum\",\n\t\t\t\"body\": \"body\",\n\t\t\t\"body_html\": \"btnhtml\",\n\t\t\t\"release\": {\n\t\t\t\t\"url\": \"url\",\n\t\t\t\t\"html_url\": \"hurl\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"tag_name\": \"tn\",\n\t\t\t\t\"target_commitish\": \"tcs\",\n\t\t\t\t\"name\": \"name\",\n\t\t\t\t\"draft\": true,\n\t\t\t\t\"author\": {\n\t\t\t\t\t\"login\": \"l\",\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\"company\": \"c\",\n\t\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\t\"location\": \"l\",\n\t\t\t\t\t\"email\": \"e\",\n\t\t\t\t\t\"hireable\": true,\n\t\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\t\"followers\": 1,\n\t\t\t\t\t\"following\": 1,\n\t\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\t\"url\": \"u\"\n\t\t\t\t},\n\t\t\t\t\"prerelease\": true,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"published_at\": ` + referenceTimeStr + `\n\t\t\t},\n\t\t\t\"manifest\": \"mani\",\n\t\t\t\"html_url\": \"hurl\",\n\t\t\t\"tag_name\": \"tn\",\n\t\t\t\"target_commitish\": \"tcs\",\n\t\t\t\"target_oid\": \"tid\",\n\t\t\t\"draft\": true,\n\t\t\t\"prerelease\": true,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\"package_files\": [\n\t\t\t\t{\n\t\t\t\t\t\"download_url\": \"durl\",\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"name\": \"name\",\n\t\t\t\t\t\"sha256\": \"sha256\",\n\t\t\t\t\t\"sha1\": \"sha1\",\n\t\t\t\t\t\"md5\": \"md5\",\n\t\t\t\t\t\"content_type\": \"ct\",\n\t\t\t\t\t\"state\": \"state\",\n\t\t\t\t\t\"author\": {\n\t\t\t\t\t\t\"login\": \"l\",\n\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\t\"company\": \"c\",\n\t\t\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\t\t\"location\": \"l\",\n\t\t\t\t\t\t\"email\": \"e\",\n\t\t\t\t\t\t\"hireable\": true,\n\t\t\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\t\t\"followers\": 1,\n\t\t\t\t\t\t\"following\": 1,\n\t\t\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\t\t\"url\": \"u\"\n\t\t\t\t\t},\n\t\t\t\t\t\"size\": 1,\n\t\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\t\"updated_at\": ` + referenceTimeStr + `\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"author\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"installation_command\": \"ic\"\n\t\t},\n\t\t\"registry\": {\n\t\t\t\"about_url\": \"aurl\",\n\t\t\t\"name\": \"name\",\n\t\t\t\"type\": \"type\",\n\t\t\t\"url\": \"url\",\n\t\t\t\"vendor\": \"vendor\"\n\t\t},\n\t\t\"url\": \"url\",\n\t\t\"version_count\": 1\n\t}`\n\n\ttestJSONMarshal(t, o, want)\n}\n\nfunc TestPackageMetadata_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PackageMetadata{}, \"{}\")\n\n\to := &PackageMetadata{\n\t\tPackageType: Ptr(\"pt\"),\n\t\tContainer: Ptr(PackageContainerMetadata{\n\t\t\tTags: []string{\"a\"},\n\t\t}),\n\t}\n\n\twant := `{\n\t\t\"package_type\": \"pt\",\n\t\t\"container\": {\n\t\t\t\"tags\": [\"a\"]\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, o, want)\n}\n\nfunc TestPackageContainerMetadata_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PackageContainerMetadata{}, \"{}\")\n\n\to := &PackageContainerMetadata{\n\t\tTags: []string{\"a\", \"b\"},\n\t}\n\n\twant := `{\n\t\t\"tags\": [\"a\",\"b\"]\n\t}`\n\n\ttestJSONMarshal(t, o, want)\n}\n\nfunc TestPackageVersionBody_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PackageVersionBody{}, \"{}\")\n\n\to := &PackageVersionBody{\n\t\tRepo: Ptr(Repository{\n\t\t\tID: Ptr(int64(1)),\n\t\t}),\n\t\tInfo: Ptr(PackageVersionBodyInfo{\n\t\t\tType: Ptr(\"t\"),\n\t\t}),\n\t}\n\n\twant := `{\n\t\t\"repository\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"info\": {\n\t\t\t\"type\": \"t\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, o, want)\n}\n\nfunc TestPackageVersionBodyInfo_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PackageVersionBodyInfo{}, \"{}\")\n\n\to := &PackageVersionBodyInfo{\n\t\tType:       Ptr(\"t\"),\n\t\tOID:        Ptr(\"o\"),\n\t\tMode:       Ptr(int64(1)),\n\t\tName:       Ptr(\"n\"),\n\t\tPath:       Ptr(\"p\"),\n\t\tSize:       Ptr(int64(1)),\n\t\tCollection: Ptr(true),\n\t}\n\n\twant := `{\n\t\t\"type\": \"t\",\n\t\t\"oid\": \"o\",\n\t\t\"mode\": 1,\n\t\t\"name\": \"n\",\n\t\t\"path\": \"p\",\n\t\t\"size\": 1,\n\t\t\"collection\": true\n\t}`\n\n\ttestJSONMarshal(t, o, want)\n}\n\nfunc TestPackageEventContainerMetadata_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PackageEventContainerMetadata{}, \"{}\")\n\n\to := &PackageEventContainerMetadata{\n\t\tLabels: map[string]any{\n\t\t\t\"k\": \"v\",\n\t\t},\n\t\tManifest: map[string]any{\n\t\t\t\"k\": float64(1),\n\t\t},\n\t\tTag: &PackageEventContainerMetadataTag{\n\t\t\tName:   Ptr(\"n\"),\n\t\t\tDigest: Ptr(\"d\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"labels\": {\n\t\t\t\"k\": \"v\"\n\t\t},\n\t\t\"manifest\": {\n\t\t\t\"k\": 1\n\t\t},\n\t\t\"tag\": {\n\t\t\t\"name\": \"n\",\n\t\t\t\"digest\": \"d\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, o, want)\n}\n\nfunc TestPackageEventContainerMetadataTag_Marshal(t *testing.T) {\n\tt.Parallel()\n\n\ttestJSONMarshal(t, &PackageEventContainerMetadataTag{}, \"{}\")\n\n\to := &PackageEventContainerMetadataTag{\n\t\tName:   Ptr(\"n\"),\n\t\tDigest: Ptr(\"d\"),\n\t}\n\n\twant := `{\n\t\t\"name\": \"n\",\n\t\t\"digest\": \"d\"\n\t}`\n\n\ttestJSONMarshal(t, o, want)\n}\n\nfunc TestPackageNugetMetadata_Marshal(t *testing.T) {\n\tt.Parallel()\n\n\to, _ := json.Marshal(map[string]string{\n\t\t\"k1\": \"v1\",\n\t\t\"k2\": \"v2\",\n\t})\n\n\ttests := map[string]struct {\n\t\tinput *PackageNugetMetadata\n\t\twant  string\n\t}{\n\t\t\"zero\": {\n\t\t\tinput: &PackageNugetMetadata{},\n\t\t\twant:  \"{}\",\n\t\t},\n\t\t\"string\": {\n\t\t\tinput: &PackageNugetMetadata{\n\t\t\t\tID:    json.RawMessage(`1`),\n\t\t\t\tName:  Ptr(\"n\"),\n\t\t\t\tValue: json.RawMessage(`\"s\"`),\n\t\t\t},\n\t\t\twant: `{\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"value\": \"s\"\n\t\t\t}`,\n\t\t},\n\t\t\"int\": {\n\t\t\tinput: &PackageNugetMetadata{\n\t\t\t\tID:    json.RawMessage(`1`),\n\t\t\t\tName:  Ptr(\"n\"),\n\t\t\t\tValue: json.RawMessage(`1`),\n\t\t\t},\n\t\t\twant: `{\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"value\": 1\n\t\t\t}`,\n\t\t},\n\t\t\"object\": {\n\t\t\tinput: &PackageNugetMetadata{\n\t\t\t\tID:    json.RawMessage(`1`),\n\t\t\t\tName:  Ptr(\"n\"),\n\t\t\t\tValue: o,\n\t\t\t},\n\t\t\twant: `{\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"value\": {\n\t\t\t\t\t\"k1\": \"v1\",\n\t\t\t\t\t\"k2\": \"v2\"\n\t\t\t\t}\n\t\t\t}`,\n\t\t},\n\t}\n\n\tfor name, test := range tests {\n\t\tt.Run(name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\ttestJSONMarshal(t, test.input, test.want, cmpJSONRawMessageComparator())\n\t\t})\n\t}\n}\n\nfunc TestPackageNPMMetadata_Marshal(t *testing.T) {\n\tt.Parallel()\n\n\ttests := map[string]struct {\n\t\tinput *PackageNPMMetadata\n\t\twant  string\n\t}{\n\t\t\"zero\": {\n\t\t\tinput: &PackageNPMMetadata{},\n\t\t\twant:  \"{}\",\n\t\t},\n\t\t\"string\": {\n\t\t\tinput: &PackageNPMMetadata{\n\t\t\t\tName:                 Ptr(\"n\"),\n\t\t\t\tVersion:              Ptr(\"v\"),\n\t\t\t\tNPMUser:              Ptr(\"nu\"),\n\t\t\t\tDescription:          Ptr(\"d\"),\n\t\t\t\tGitHead:              Ptr(\"gh\"),\n\t\t\t\tHomepage:             Ptr(\"h\"),\n\t\t\t\tLicense:              Ptr(\"l\"),\n\t\t\t\tMain:                 Ptr(\"m\"),\n\t\t\t\tID:                   Ptr(\"id\"),\n\t\t\t\tNodeVersion:          Ptr(\"nv\"),\n\t\t\t\tNPMVersion:           Ptr(\"npmv\"),\n\t\t\t\tReadme:               Ptr(\"r\"),\n\t\t\t\tInstallationCommand:  Ptr(\"ic\"),\n\t\t\t\tCommitOID:            Ptr(\"coid\"),\n\t\t\t\tHasShrinkwrap:        Ptr(true),\n\t\t\t\tPublishedViaActions:  Ptr(true),\n\t\t\t\tReleaseID:            Ptr(int64(1)),\n\t\t\t\tDeletedByID:          Ptr(int64(1)),\n\t\t\t\tAuthor:               map[string]string{\"k1\": \"v1\"},\n\t\t\t\tBugs:                 map[string]string{\"k1\": \"v1\"},\n\t\t\t\tDependencies:         map[string]string{\"k1\": \"v1\"},\n\t\t\t\tDevDependencies:      map[string]string{\"k1\": \"v1\"},\n\t\t\t\tPeerDependencies:     map[string]string{\"k1\": \"v1\"},\n\t\t\t\tOptionalDependencies: map[string]string{\"k1\": \"v1\"},\n\t\t\t\tDist:                 map[string]string{\"k1\": \"v1\"},\n\t\t\t\tRepository:           map[string]string{\"k1\": \"v1\"},\n\t\t\t\tEngines:              map[string]string{\"k1\": \"v1\"},\n\t\t\t\tDirectories:          map[string]string{\"k1\": \"v1\"},\n\t\t\t\tScripts:              map[string]any{\"k1\": float64(1)},\n\t\t\t\tBin:                  map[string]any{\"k1\": true},\n\t\t\t\tMan:                  map[string]any{\"k1\": \"v1\"},\n\t\t\t\tKeywords:             []string{\"kw1\", \"kw2\"},\n\t\t\t\tFiles:                []string{\"f1\", \"f2\"},\n\t\t\t\tOS:                   []string{\"os1\", \"os2\"},\n\t\t\t\tCPU:                  []string{\"cpu1\", \"cpu2\"},\n\t\t\t\tMaintainers:          []any{\"m1\", \"m2\"},\n\t\t\t\tContributors:         []any{\"c1\", \"c2\"},\n\t\t\t},\n\t\t\twant: `{\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"version\": \"v\",\n\t\t\t\t\"npm_user\": \"nu\",\n\t\t\t\t\"description\": \"d\",\n\t\t\t\t\"git_head\": \"gh\",\n\t\t\t\t\"homepage\": \"h\",\n\t\t\t\t\"license\": \"l\",\n\t\t\t\t\"main\": \"m\",\n\t\t\t\t\"id\": \"id\",\n\t\t\t\t\"node_version\": \"nv\",\n\t\t\t\t\"npm_version\": \"npmv\",\n\t\t\t\t\"readme\": \"r\",\n\t\t\t\t\"installation_command\": \"ic\",\n\t\t\t\t\"commit_oid\": \"coid\",\n\t\t\t\t\"has_shrinkwrap\": true,\n\t\t\t\t\"published_via_actions\": true,\n\t\t\t\t\"release_id\": 1,\n\t\t\t\t\"deleted_by_id\": 1,\n\t\t\t\t\"author\": {\n\t\t\t\t\t\"k1\": \"v1\"\n\t\t\t\t},\n\t\t\t\t\"bugs\": {\n\t\t\t\t\t\"k1\": \"v1\"\n\t\t\t\t},\n\t\t\t\t\"dependencies\": {\n\t\t\t\t\t\"k1\": \"v1\"\n\t\t\t\t},\n\t\t\t\t\"dev_dependencies\": {\n\t\t\t\t\t\"k1\": \"v1\"\n\t\t\t\t},\n\t\t\t\t\"peer_dependencies\": {\n\t\t\t\t\t\"k1\": \"v1\"\n\t\t\t\t},\n\t\t\t\t\"optional_dependencies\": {\n\t\t\t\t\t\"k1\": \"v1\"\n\t\t\t\t},\n\t\t\t\t\"dist\": {\n\t\t\t\t\t\"k1\": \"v1\"\n\t\t\t\t},\n\t\t\t\t\"repository\": {\n\t\t\t\t\t\"k1\": \"v1\"\n\t\t\t\t},\n\t\t\t\t\"engines\": {\n\t\t\t\t\t\"k1\": \"v1\"\n\t\t\t\t},\n\t\t\t\t\"directories\": {\n\t\t\t\t\t\"k1\": \"v1\"\n\t\t\t\t},\n\t\t\t\t\"scripts\": {\n\t\t\t\t\t\"k1\": 1\n\t\t\t\t},\n\t\t\t\t\"bin\": {\n\t\t\t\t\t\"k1\": true\n\t\t\t\t},\n\t\t\t\t\"man\": {\n\t\t\t\t\t\"k1\": \"v1\"\n\t\t\t\t},\n\t\t\t\t\"keywords\": [\"kw1\", \"kw2\"],\n\t\t\t\t\"files\": [\"f1\", \"f2\"],\n\t\t\t\t\"os\": [\"os1\", \"os2\"],\n\t\t\t\t\"cpu\": [\"cpu1\", \"cpu2\"],\n\t\t\t\t\"maintainers\": [\"m1\", \"m2\"],\n\t\t\t\t\"contributors\": [\"c1\", \"c2\"]\n\t\t\t}`,\n\t\t},\n\t}\n\n\tfor name, test := range tests {\n\t\tt.Run(name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\ttestJSONMarshal(t, test.input, test.want)\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "github/private_registries.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// PrivateRegistriesService handles communication with the private registries\n// methods of the GitHub API.\n//\n// GitHub API docs: https://docs.github.com/rest/private-registries\ntype PrivateRegistriesService service\n\n// PrivateRegistryType represents the type of private registry.\ntype PrivateRegistryType string\n\nconst (\n\tPrivateRegistryTypeMavenRepository    PrivateRegistryType = \"maven_repository\"\n\tPrivateRegistryTypeNugetFeed          PrivateRegistryType = \"nuget_feed\"\n\tPrivateRegistryTypeGoProxyServer      PrivateRegistryType = \"goproxy_server\"\n\tPrivateRegistryTypeNpmRegistry        PrivateRegistryType = \"npm_registry\"\n\tPrivateRegistryTypeRubygemsServer     PrivateRegistryType = \"rubygems_server\"\n\tPrivateRegistryTypeCargoRegistry      PrivateRegistryType = \"cargo_registry\"\n\tPrivateRegistryTypeComposerRepository PrivateRegistryType = \"composer_repository\"\n\tPrivateRegistryTypeDockerRegistry     PrivateRegistryType = \"docker_registry\"\n\tPrivateRegistryTypeGitSource          PrivateRegistryType = \"git_source\"\n\tPrivateRegistryTypeHelmRegistry       PrivateRegistryType = \"helm_registry\"\n\tPrivateRegistryTypeHexOrganization    PrivateRegistryType = \"hex_organization\"\n\tPrivateRegistryTypeHexRepository      PrivateRegistryType = \"hex_repository\"\n\tPrivateRegistryTypePubRepository      PrivateRegistryType = \"pub_repository\"\n\tPrivateRegistryTypePythonIndex        PrivateRegistryType = \"python_index\"\n\tPrivateRegistryTypeTerraformRegistry  PrivateRegistryType = \"terraform_registry\"\n)\n\n// PrivateRegistryVisibility represents the visibility of a private registry.\ntype PrivateRegistryVisibility string\n\nconst (\n\tPrivateRegistryVisibilityPrivate  PrivateRegistryVisibility = \"private\"\n\tPrivateRegistryVisibilityAll      PrivateRegistryVisibility = \"all\"\n\tPrivateRegistryVisibilitySelected PrivateRegistryVisibility = \"selected\"\n)\n\n// PrivateRegistry represents a private registry configuration.\ntype PrivateRegistry struct {\n\t// Name of the private registry.\n\tName *string `json:\"name,omitempty\"`\n\t// RegistryType is the type of private registry. You can find the list of supported types in PrivateRegistryType.\n\tRegistryType *string `json:\"registry_type,omitempty\"`\n\t// Username to use when authenticating with the private registry.\n\t// This field is omitted if the private registry does not require a username for authentication.\n\tUsername *string `json:\"username,omitempty\"`\n\t// CreatedAt is the timestamp when the private registry was created.\n\tCreatedAt *Timestamp `json:\"created_at,omitempty\"`\n\t// UpdatedAt is the timestamp when the private registry was last updated.\n\tUpdatedAt *Timestamp `json:\"updated_at,omitempty\"`\n\t// Visibility is the visibility of the private registry. Possible values are: \"private\", \"all\", and \"selected\".\n\tVisibility *PrivateRegistryVisibility `json:\"visibility,omitempty\"`\n}\n\n// PrivateRegistries represents a list of private registries.\ntype PrivateRegistries struct {\n\t// TotalCount is the total number of private registries.\n\tTotalCount *int `json:\"total_count,omitempty\"`\n\t// Configurations is the list of private registry configurations.\n\tConfigurations []*PrivateRegistry `json:\"configurations,omitempty\"`\n}\n\n// CreateOrganizationPrivateRegistry represents the payload to create a private registry.\ntype CreateOrganizationPrivateRegistry struct {\n\t// RegistryType is the type of private registry.\n\t// You can find the list of supported types in PrivateRegistryType.\n\tRegistryType string `json:\"registry_type\"`\n\n\t// URL is the URL of the private registry.\n\tURL string `json:\"url\"`\n\n\t// The username to use when authenticating with the private registry.\n\t// This field should be omitted if the private registry does not require a username for authentication.\n\tUsername *string `json:\"username,omitempty\"`\n\n\t// The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages)\n\t// using the public key retrieved from the PrivateRegistriesService.GetOrganizationPrivateRegistriesPublicKey.\n\tEncryptedValue string `json:\"encrypted_value\"`\n\t// KeyID is the ID of the public key used to encrypt the secret.\n\tKeyID string `json:\"key_id\"`\n\t// Visibility is the visibility of the private registry.\n\t// Possible values are: \"private\", \"all\", and \"selected\".\n\tVisibility PrivateRegistryVisibility `json:\"visibility\"`\n\n\t// An array of repository IDs that can access the organization private registry.\n\t// You can only provide a list of repository IDs when CreateOrganizationPrivateRegistry.Visibility is set to PrivateRegistryVisibilitySelected.\n\t// This field should be omitted if visibility is set to PrivateRegistryVisibilityAll or PrivateRegistryVisibilityPrivate.\n\tSelectedRepositoryIDs []int64 `json:\"selected_repository_ids,omitempty\"`\n}\n\n// UpdateOrganizationPrivateRegistry represents the payload to update a private registry.\ntype UpdateOrganizationPrivateRegistry struct {\n\t// RegistryType is the type of private registry.\n\t// You can find the list of supported types in PrivateRegistryType.\n\tRegistryType *string `json:\"registry_type,omitempty\"`\n\n\t// URL is the URL of the private registry.\n\tURL *string `json:\"url,omitempty\"`\n\n\t// The username to use when authenticating with the private registry.\n\t// This field should be omitted if the private registry does not require a username for authentication.\n\tUsername *string `json:\"username,omitempty\"`\n\n\t// The value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages)\n\t// using the public key retrieved from the PrivateRegistriesService.GetOrganizationPrivateRegistriesPublicKey.\n\tEncryptedValue *string `json:\"encrypted_value,omitempty\"`\n\t// KeyID is the ID of the public key used to encrypt the secret.\n\tKeyID *string `json:\"key_id,omitempty\"`\n\t// Visibility is the visibility of the private registry.\n\t// Possible values are: \"private\", \"all\", and \"selected\".\n\tVisibility *PrivateRegistryVisibility `json:\"visibility,omitempty\"`\n\n\t// An array of repository IDs that can access the organization private registry.\n\t// You can only provide a list of repository IDs when CreateOrganizationPrivateRegistry.Visibility is set to PrivateRegistryVisibilitySelected.\n\t// This field should be omitted if visibility is set to PrivateRegistryVisibilityAll or PrivateRegistryVisibilityPrivate.\n\tSelectedRepositoryIDs []int64 `json:\"selected_repository_ids,omitempty\"`\n}\n\n// ListOrganizationPrivateRegistries lists private registries for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations#list-private-registries-for-an-organization\n//\n//meta:operation GET /orgs/{org}/private-registries\nfunc (s *PrivateRegistriesService) ListOrganizationPrivateRegistries(ctx context.Context, org string, opts *ListOptions) (*PrivateRegistries, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/private-registries\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar privateRegistries PrivateRegistries\n\tresp, err := s.client.Do(ctx, req, &privateRegistries)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn &privateRegistries, resp, nil\n}\n\n// CreateOrganizationPrivateRegistry creates a private registry configuration with an encrypted value for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations#create-a-private-registry-for-an-organization\n//\n//meta:operation POST /orgs/{org}/private-registries\nfunc (s *PrivateRegistriesService) CreateOrganizationPrivateRegistry(ctx context.Context, org string, privateRegistry CreateOrganizationPrivateRegistry) (*PrivateRegistry, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/private-registries\", org)\n\n\treq, err := s.client.NewRequest(\"POST\", u, privateRegistry)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar result PrivateRegistry\n\tresp, err := s.client.Do(ctx, req, &result)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn &result, resp, nil\n}\n\n// GetOrganizationPrivateRegistriesPublicKey retrieves the public key for encrypting secrets for an organization's private registries.\n//\n// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization\n//\n//meta:operation GET /orgs/{org}/private-registries/public-key\nfunc (s *PrivateRegistriesService) GetOrganizationPrivateRegistriesPublicKey(ctx context.Context, org string) (*PublicKey, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/private-registries/public-key\", org)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar publicKey PublicKey\n\tresp, err := s.client.Do(ctx, req, &publicKey)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn &publicKey, resp, nil\n}\n\n// GetOrganizationPrivateRegistry gets a specific private registry for an organization.\n// The `name` parameter is the name of the private registry to retrieve. It is the same as PrivateRegistry.Name.\n//\n// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations#get-a-private-registry-for-an-organization\n//\n//meta:operation GET /orgs/{org}/private-registries/{secret_name}\nfunc (s *PrivateRegistriesService) GetOrganizationPrivateRegistry(ctx context.Context, org, secretName string) (*PrivateRegistry, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/private-registries/%v\", org, secretName)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar privateRegistry PrivateRegistry\n\tresp, err := s.client.Do(ctx, req, &privateRegistry)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn &privateRegistry, resp, nil\n}\n\n// UpdateOrganizationPrivateRegistry updates a specific private registry for an organization.\n// The `name` parameter is the name of the private registry to update. It is the same as PrivateRegistry.Name.\n//\n// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations#update-a-private-registry-for-an-organization\n//\n//meta:operation PATCH /orgs/{org}/private-registries/{secret_name}\nfunc (s *PrivateRegistriesService) UpdateOrganizationPrivateRegistry(ctx context.Context, org, secretName string, privateRegistry UpdateOrganizationPrivateRegistry) (*PrivateRegistry, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/private-registries/%v\", org, secretName)\n\n\treq, err := s.client.NewRequest(\"PATCH\", u, privateRegistry)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar updatedRegistry PrivateRegistry\n\tresp, err := s.client.Do(ctx, req, &updatedRegistry)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn &updatedRegistry, resp, nil\n}\n\n// DeleteOrganizationPrivateRegistry deletes a specific private registry for an organization.\n// The `name` parameter is the name of the private registry to delete. It is the same as PrivateRegistry.Name.\n//\n// GitHub API docs: https://docs.github.com/rest/private-registries/organization-configurations#delete-a-private-registry-for-an-organization\n//\n//meta:operation DELETE /orgs/{org}/private-registries/{secret_name}\nfunc (s *PrivateRegistriesService) DeleteOrganizationPrivateRegistry(ctx context.Context, org, secretName string) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/private-registries/%v\", org, secretName)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n"
  },
  {
    "path": "github/private_registries_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestPrivateRegistriesService_ListOrganizationPrivateRegistries(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/private-registries\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `{\n  \"total_count\": 1,\n  \"configurations\": [\n    {\n      \"name\": \"MAVEN_REPOSITORY_SECRET\",\n      \"registry_type\": \"maven_repository\",\n      \"username\": \"monalisa\",\n      \"created_at\": \"2019-08-10T14:59:22Z\",\n      \"updated_at\": \"2020-01-10T14:59:22Z\",\n      \"visibility\": \"selected\"\n    }\n  ]\n}`)\n\t})\n\n\topts := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tprivateRegistries, _, err := client.PrivateRegistries.ListOrganizationPrivateRegistries(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Fatalf(\"PrivateRegistries.ListOrganizationPrivateRegistries returned error: %v\", err)\n\t}\n\n\twant := &PrivateRegistries{\n\t\tTotalCount: Ptr(1),\n\t\tConfigurations: []*PrivateRegistry{\n\t\t\t{\n\t\t\t\tName:         Ptr(\"MAVEN_REPOSITORY_SECRET\"),\n\t\t\t\tRegistryType: Ptr(\"maven_repository\"),\n\t\t\t\tUsername:     Ptr(\"monalisa\"),\n\t\t\t\tCreatedAt:    &Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)},\n\t\t\t\tUpdatedAt:    &Timestamp{time.Date(2020, time.January, 10, 14, 59, 22, 0, time.UTC)},\n\t\t\t\tVisibility:   Ptr(PrivateRegistryVisibilitySelected),\n\t\t\t},\n\t\t},\n\t}\n\tif diff := cmp.Diff(want, privateRegistries); diff != \"\" {\n\t\tt.Errorf(\"PrivateRegistries.ListOrganizationPrivateRegistries mismatch (-want +got):\\\\n%v\", diff)\n\t}\n\n\tconst methodName = \"ListOrganizationPrivateRegistries\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.PrivateRegistries.ListOrganizationPrivateRegistries(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PrivateRegistries.ListOrganizationPrivateRegistries(ctx, \"o\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n\n\t// still allow both set (no validation enforced) – ensure it does not error\n\tctxBypass := context.WithValue(t.Context(), BypassRateLimitCheck, true)\n\tif _, _, err = client.PrivateRegistries.ListOrganizationPrivateRegistries(ctxBypass, \"o\", opts); err != nil {\n\t\tt.Fatalf(\"unexpected error when both before/after set: %v\", err)\n\t}\n}\n\nfunc TestPrivateRegistriesService_CreateOrganizationPrivateRegistry(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &CreateOrganizationPrivateRegistry{\n\t\tRegistryType:          \"maven_repository\",\n\t\tURL:                   \"https://maven.pkg.github.com/OWNER/REPOSITORY\",\n\t\tUsername:              Ptr(\"monalisa\"),\n\t\tEncryptedValue:        \"encrypted_value\",\n\t\tKeyID:                 \"key_id\",\n\t\tVisibility:            PrivateRegistryVisibilitySelected,\n\t\tSelectedRepositoryIDs: []int64{1, 2, 3},\n\t}\n\n\tmux.HandleFunc(\"/orgs/o/private-registries\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *CreateOrganizationPrivateRegistry\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\n  \"name\": \"MAVEN_REPOSITORY_SECRET\",\n  \"registry_type\": \"maven_repository\",\n  \"username\": \"monalisa\",\n  \"created_at\": \"2019-08-10T14:59:22Z\",\n  \"updated_at\": \"2020-01-10T14:59:22Z\",\n  \"visibility\": \"selected\"\n}`)\n\t})\n\n\tctx := t.Context()\n\tprivateRegistry, _, err := client.PrivateRegistries.CreateOrganizationPrivateRegistry(ctx, \"o\", *input)\n\tif err != nil {\n\t\tt.Fatalf(\"PrivateRegistries.CreateOrganizationPrivateRegistries returned error: %v\", err)\n\t}\n\n\twant := &PrivateRegistry{\n\t\tName:         Ptr(\"MAVEN_REPOSITORY_SECRET\"),\n\t\tRegistryType: Ptr(\"maven_repository\"),\n\t\tUsername:     Ptr(\"monalisa\"),\n\t\tCreatedAt:    &Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)},\n\t\tUpdatedAt:    &Timestamp{time.Date(2020, time.January, 10, 14, 59, 22, 0, time.UTC)},\n\t\tVisibility:   Ptr(PrivateRegistryVisibilitySelected),\n\t}\n\tif diff := cmp.Diff(want, privateRegistry); diff != \"\" {\n\t\tt.Errorf(\"PrivateRegistries.CreateOrganizationPrivateRegistries mismatch (-want +got):\\\\n%v\", diff)\n\t}\n\n\tconst methodName = \"CreateOrganizationPrivateRegistry\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.PrivateRegistries.CreateOrganizationPrivateRegistry(ctx, \"\\n\", *input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PrivateRegistries.CreateOrganizationPrivateRegistry(ctx, \"o\", *input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestPrivateRegistriesService_GetOrganizationPrivateRegistriesPublicKey(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/private-registries/public-key\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n  \"key_id\": \"0123456789\",\n  \"key\": \"public_key\"\n}`)\n\t})\n\tctx := t.Context()\n\tpublicKey, _, err := client.PrivateRegistries.GetOrganizationPrivateRegistriesPublicKey(ctx, \"o\")\n\tif err != nil {\n\t\tt.Fatalf(\"PrivateRegistries.GetOrganizationPrivateRegistriesPublicKey returned error: %v\", err)\n\t}\n\n\twant := &PublicKey{\n\t\tKeyID: Ptr(\"0123456789\"),\n\t\tKey:   Ptr(\"public_key\"),\n\t}\n\tif diff := cmp.Diff(want, publicKey); diff != \"\" {\n\t\tt.Errorf(\"PrivateRegistries.GetOrganizationPrivateRegistriesPublicKey mismatch (-want +got):\\\\n%v\", diff)\n\t}\n\n\tconst methodName = \"GetOrganizationPrivateRegistriesPublicKey\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.PrivateRegistries.GetOrganizationPrivateRegistriesPublicKey(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PrivateRegistries.GetOrganizationPrivateRegistriesPublicKey(ctx, \"o\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestPrivateRegistriesService_GetOrganizationPrivateRegistry(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/private-registries/MAVEN_REPOSITORY_SECRET\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n  \"name\": \"MAVEN_REPOSITORY_SECRET\",\n  \"registry_type\": \"maven_repository\",\n  \"username\": \"monalisa\",\n  \"created_at\": \"2019-08-10T14:59:22Z\",\n  \"updated_at\": \"2020-01-10T14:59:22Z\",\n  \"visibility\": \"selected\"\n}`)\n\t})\n\tctx := t.Context()\n\tprivateRegistry, _, err := client.PrivateRegistries.GetOrganizationPrivateRegistry(ctx, \"o\", \"MAVEN_REPOSITORY_SECRET\")\n\tif err != nil {\n\t\tt.Fatalf(\"PrivateRegistries.GetOrganizationPrivateRegistry returned error: %v\", err)\n\t}\n\n\twant := &PrivateRegistry{\n\t\tName:         Ptr(\"MAVEN_REPOSITORY_SECRET\"),\n\t\tRegistryType: Ptr(\"maven_repository\"),\n\t\tUsername:     Ptr(\"monalisa\"),\n\t\tCreatedAt:    &Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)},\n\t\tUpdatedAt:    &Timestamp{time.Date(2020, time.January, 10, 14, 59, 22, 0, time.UTC)},\n\t\tVisibility:   Ptr(PrivateRegistryVisibilitySelected),\n\t}\n\tif diff := cmp.Diff(want, privateRegistry); diff != \"\" {\n\t\tt.Errorf(\"PrivateRegistries.GetOrganizationPrivateRegistry mismatch (-want +got):\\\\n%v\", diff)\n\t}\n\n\tconst methodName = \"GetOrganizationPrivateRegistry\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.PrivateRegistries.GetOrganizationPrivateRegistry(ctx, \"\\n\", \"MAVEN_REPOSITORY_SECRET\")\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PrivateRegistries.GetOrganizationPrivateRegistry(ctx, \"o\", \"MAVEN_REPOSITORY_SECRET\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestPrivateRegistries_UpdateOrganizationPrivateRegistry(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &UpdateOrganizationPrivateRegistry{\n\t\tUsername:       Ptr(\"monalisa\"),\n\t\tEncryptedValue: Ptr(\"encrypted_value\"),\n\t\tKeyID:          Ptr(\"key_id\"),\n\t\tVisibility:     Ptr(PrivateRegistryVisibilitySelected),\n\t}\n\n\tmux.HandleFunc(\"/orgs/o/private-registries/MAVEN_REPOSITORY_SECRET\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *UpdateOrganizationPrivateRegistry\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\n  \"name\": \"MAVEN_REPOSITORY_SECRET\",\n  \"registry_type\": \"maven_repository\",\n  \"username\": \"monalisa\",\n  \"created_at\": \"2019-08-10T14:59:22Z\",\n  \"updated_at\": \"2020-01-10T14:59:22Z\",\n  \"visibility\": \"selected\"\n}`)\n\t})\n\n\tctx := t.Context()\n\tprivateRegistry, _, err := client.PrivateRegistries.UpdateOrganizationPrivateRegistry(ctx, \"o\", \"MAVEN_REPOSITORY_SECRET\", *input)\n\tif err != nil {\n\t\tt.Fatalf(\"PrivateRegistries.UpdateOrganizationPrivateRegistry returned error: %v\", err)\n\t}\n\n\twant := &PrivateRegistry{\n\t\tName:         Ptr(\"MAVEN_REPOSITORY_SECRET\"),\n\t\tRegistryType: Ptr(\"maven_repository\"),\n\t\tUsername:     Ptr(\"monalisa\"),\n\t\tCreatedAt:    &Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)},\n\t\tUpdatedAt:    &Timestamp{time.Date(2020, time.January, 10, 14, 59, 22, 0, time.UTC)},\n\t\tVisibility:   Ptr(PrivateRegistryVisibilitySelected),\n\t}\n\tif diff := cmp.Diff(want, privateRegistry); diff != \"\" {\n\t\tt.Errorf(\"PrivateRegistries.UpdateOrganizationPrivateRegistry mismatch (-want +got):\\\\n%v\", diff)\n\t}\n\n\tconst methodName = \"UpdateOrganizationPrivateRegistry\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.PrivateRegistries.UpdateOrganizationPrivateRegistry(ctx, \"\\n\", \"MAVEN_REPOSITORY_SECRET\", *input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PrivateRegistries.UpdateOrganizationPrivateRegistry(ctx, \"o\", \"MAVEN_REPOSITORY_SECRET\", *input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestPrivateRegistriesService_DeleteOrganizationPrivateRegistry(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/private-registries/MAVEN_REPOSITORY_SECRET\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\tctx := t.Context()\n\t_, err := client.PrivateRegistries.DeleteOrganizationPrivateRegistry(ctx, \"o\", \"MAVEN_REPOSITORY_SECRET\")\n\tif err != nil {\n\t\tt.Fatalf(\"PrivateRegistries.DeleteOrganizationPrivateRegistry returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteOrganizationPrivateRegistry\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.PrivateRegistries.DeleteOrganizationPrivateRegistry(ctx, \"\\n\", \"MAVEN_REPOSITORY_SECRET\")\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.PrivateRegistries.DeleteOrganizationPrivateRegistry(ctx, \"o\", \"MAVEN_REPOSITORY_SECRET\")\n\t})\n}\n"
  },
  {
    "path": "github/projects.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n)\n\n// ProjectsService handles communication with the project V2\n// methods of the GitHub API.\n//\n// GitHub API docs: https://docs.github.com/rest/projects/projects\ntype ProjectsService service\n\n// ProjectV2ItemContentType represents the type of content in a ProjectV2Item.\ntype ProjectV2ItemContentType string\n\n// This is the set of possible content types for a ProjectV2Item.\nconst (\n\tProjectV2ItemContentTypeDraftIssue  ProjectV2ItemContentType = \"DraftIssue\"\n\tProjectV2ItemContentTypeIssue       ProjectV2ItemContentType = \"Issue\"\n\tProjectV2ItemContentTypePullRequest ProjectV2ItemContentType = \"PullRequest\"\n)\n\n// ProjectV2StatusUpdate represents a status update for a project.\ntype ProjectV2StatusUpdate struct {\n\tID            *int64     `json:\"id,omitempty\"`\n\tNodeID        *string    `json:\"node_id,omitempty\"`\n\tProjectNodeID *string    `json:\"project_node_id,omitempty\"`\n\tCreator       *User      `json:\"creator,omitempty\"`\n\tCreatedAt     *Timestamp `json:\"created_at,omitempty\"`\n\tUpdatedAt     *Timestamp `json:\"updated_at,omitempty\"`\n\t// Status can be one of: \"INACTIVE\", \"ON_TRACK\", \"AT_RISK\", \"OFF_TRACK\", \"COMPLETE\".\n\tStatus     *string `json:\"status,omitempty\"`\n\tStartDate  *string `json:\"start_date,omitempty\"`\n\tTargetDate *string `json:\"target_date,omitempty\"`\n\tBody       *string `json:\"body,omitempty\"`\n}\n\n// ProjectV2DraftIssue represents a draft issue in a project.\ntype ProjectV2DraftIssue struct {\n\tID        *int64     `json:\"id,omitempty\"`\n\tNodeID    *string    `json:\"node_id,omitempty\"`\n\tTitle     *string    `json:\"title,omitempty\"`\n\tBody      *string    `json:\"body,omitempty\"`\n\tUser      *User      `json:\"user,omitempty\"`\n\tCreatedAt *Timestamp `json:\"created_at,omitempty\"`\n\tUpdatedAt *Timestamp `json:\"updated_at,omitempty\"`\n}\n\n// ProjectV2 represents a v2 project.\ntype ProjectV2 struct {\n\tID                 *int64                 `json:\"id,omitempty\"`\n\tNodeID             *string                `json:\"node_id,omitempty\"`\n\tOwner              *User                  `json:\"owner,omitempty\"`\n\tCreator            *User                  `json:\"creator,omitempty\"`\n\tTitle              *string                `json:\"title,omitempty\"`\n\tDescription        *string                `json:\"description,omitempty\"`\n\tPublic             *bool                  `json:\"public,omitempty\"`\n\tClosedAt           *Timestamp             `json:\"closed_at,omitempty\"`\n\tCreatedAt          *Timestamp             `json:\"created_at,omitempty\"`\n\tUpdatedAt          *Timestamp             `json:\"updated_at,omitempty\"`\n\tDeletedAt          *Timestamp             `json:\"deleted_at,omitempty\"`\n\tNumber             *int                   `json:\"number,omitempty\"`\n\tShortDescription   *string                `json:\"short_description,omitempty\"`\n\tDeletedBy          *User                  `json:\"deleted_by,omitempty\"`\n\tState              *string                `json:\"state,omitempty\"`\n\tLatestStatusUpdate *ProjectV2StatusUpdate `json:\"latest_status_update,omitempty\"`\n\tIsTemplate         *bool                  `json:\"is_template,omitempty\"`\n\n\t// Fields migrated from the Project (classic) struct:\n\tURL                    *string `json:\"url,omitempty\"`\n\tHTMLURL                *string `json:\"html_url,omitempty\"`\n\tColumnsURL             *string `json:\"columns_url,omitempty\"`\n\tOwnerURL               *string `json:\"owner_url,omitempty\"`\n\tName                   *string `json:\"name,omitempty\"`\n\tBody                   *string `json:\"body,omitempty\"`\n\tOrganizationPermission *string `json:\"organization_permission,omitempty\"`\n\tPrivate                *bool   `json:\"private,omitempty\"`\n}\n\nfunc (p ProjectV2) String() string { return Stringify(p) }\n\n// ListProjectsPaginationOptions specifies optional parameters to list projects for user / organization.\n//\n// Note: Pagination is powered by before/after cursor-style pagination. After the initial call,\n// inspect the returned *Response. Use resp.After as the opts.After value to request\n// the next page, and resp.Before as the opts.Before value to request the previous\n// page. Set either Before or After for a request; if both are\n// supplied GitHub API will return an error. PerPage controls the number of items\n// per page (max 100 per GitHub API docs).\ntype ListProjectsPaginationOptions struct {\n\t// A cursor, as given in the Link header. If specified, the query only searches for events before this cursor.\n\tBefore string `url:\"before,omitempty\"`\n\n\t// A cursor, as given in the Link header. If specified, the query only searches for events after this cursor.\n\tAfter string `url:\"after,omitempty\"`\n\n\t// For paginated result sets, the number of results to include per page.\n\tPerPage int `url:\"per_page,omitempty\"`\n}\n\n// ListProjectsOptions specifies optional parameters to list projects for user / organization.\ntype ListProjectsOptions struct {\n\tListProjectsPaginationOptions\n\n\t// Q is an optional query string to limit results to projects of the specified type.\n\tQuery string `url:\"q,omitempty\"`\n}\n\n// ProjectV2TextContent represents text content in a project field option or iteration.\n// It includes both HTML and raw text representations.\n//\n// GitHub API docs: https://docs.github.com/rest/projects/fields\ntype ProjectV2TextContent struct {\n\tHTML *string `json:\"html,omitempty\"`\n\tRaw  *string `json:\"raw,omitempty\"`\n}\n\n// ProjectV2FieldOption represents an option for a project field of type single_select or multi_select.\n// It defines the available choices that can be selected for dropdown-style fields.\n//\n// GitHub API docs: https://docs.github.com/rest/projects/fields\ntype ProjectV2FieldOption struct {\n\tID          *string               `json:\"id,omitempty\"`          // The unique identifier for this option.\n\tColor       *string               `json:\"color,omitempty\"`       // The color associated with this option (e.g., \"blue\", \"red\").\n\tDescription *ProjectV2TextContent `json:\"description,omitempty\"` // An optional description for this option.\n\tName        *ProjectV2TextContent `json:\"name,omitempty\"`        // The display name of the option.\n}\n\n// ProjectV2FieldIteration represents an iteration within a project field of type iteration.\n// It defines a specific time-bound period that can be associated with project items.\n//\n// GitHub API docs: https://docs.github.com/rest/projects/fields\ntype ProjectV2FieldIteration struct {\n\tID        *string               `json:\"id,omitempty\"`         // The unique identifier for the iteration.\n\tTitle     *ProjectV2TextContent `json:\"title,omitempty\"`      // The title of the iteration.\n\tStartDate *string               `json:\"start_date,omitempty\"` // The start date of the iteration in ISO 8601 format.\n\tDuration  *int                  `json:\"duration,omitempty\"`   // The duration of the iteration in seconds.\n}\n\n// ProjectV2FieldConfiguration represents the configuration for a project field of type iteration.\n// It defines settings such as duration and start day for iterations within the project.\n//\n// GitHub API docs: https://docs.github.com/rest/projects/fields\ntype ProjectV2FieldConfiguration struct {\n\tDuration   *int                       `json:\"duration,omitempty\"`   // The duration of the iteration field in seconds.\n\tStartDay   *int                       `json:\"start_day,omitempty\"`  // The start day for the iteration.\n\tIterations []*ProjectV2FieldIteration `json:\"iterations,omitempty\"` // The list of iterations associated with the configuration.\n}\n\n// ProjectV2ItemContent is a union type that holds the content of a ProjectV2Item.\n// The actual type depends on the ContentType field of the parent ProjectV2Item.\n// Only one of the fields will be populated after unmarshaling.\ntype ProjectV2ItemContent struct {\n\tIssue       *Issue               `json:\"-\"`\n\tPullRequest *PullRequest         `json:\"-\"`\n\tDraftIssue  *ProjectV2DraftIssue `json:\"-\"`\n}\n\n// MarshalJSON implements custom marshaling for ProjectV2ItemContent.\nfunc (c *ProjectV2ItemContent) MarshalJSON() ([]byte, error) {\n\tif c.Issue != nil {\n\t\treturn json.Marshal(c.Issue)\n\t}\n\tif c.PullRequest != nil {\n\t\treturn json.Marshal(c.PullRequest)\n\t}\n\tif c.DraftIssue != nil {\n\t\treturn json.Marshal(c.DraftIssue)\n\t}\n\treturn []byte(\"null\"), nil\n}\n\n// ProjectV2Item represents a full project item with field values.\n// This type is used by Get, List, and Update operations which return field values.\n// The Content field is automatically unmarshaled into the appropriate type based on ContentType.\ntype ProjectV2Item struct {\n\tArchivedAt  *Timestamp                 `json:\"archived_at,omitempty\"`\n\tContent     *ProjectV2ItemContent      `json:\"content,omitempty\"`\n\tContentType *ProjectV2ItemContentType  `json:\"content_type,omitempty\"`\n\tCreatedAt   *Timestamp                 `json:\"created_at,omitempty\"`\n\tCreator     *User                      `json:\"creator,omitempty\"`\n\tFields      []*ProjectV2ItemFieldValue `json:\"fields,omitempty\"`\n\tID          *int64                     `json:\"id,omitempty\"`\n\tItemURL     *string                    `json:\"item_url,omitempty\"`\n\tNodeID      *string                    `json:\"node_id,omitempty\"`\n\tProjectURL  *string                    `json:\"project_url,omitempty\"`\n\tUpdatedAt   *Timestamp                 `json:\"updated_at,omitempty\"`\n\n\t// ProjectNodeID and ContentNodeID are used in ProjectsV2Item Webhook payloads.\n\t// They may not be populated in all API responses, but are included here for completeness.\n\t// See: https://docs.github.com/en/webhooks/webhook-events-and-payloads#projects_v2_item\n\tProjectNodeID *string `json:\"project_node_id,omitempty\"`\n\tContentNodeID *string `json:\"content_node_id,omitempty\"`\n}\n\n// UnmarshalJSON implements custom unmarshaling for ProjectV2Item.\n// It uses the ContentType field to determine how to unmarshal the Content field.\nfunc (p *ProjectV2Item) UnmarshalJSON(data []byte) error {\n\ttype contentAlias ProjectV2Item\n\n\taux := &struct {\n\t\tContent json.RawMessage `json:\"content,omitempty\"`\n\t\t*contentAlias\n\t}{\n\t\tcontentAlias: (*contentAlias)(p),\n\t}\n\n\tif err := json.Unmarshal(data, aux); err != nil {\n\t\treturn err\n\t}\n\n\t// Now unmarshal the content based on ContentType\n\tif len(aux.Content) > 0 && string(aux.Content) != \"null\" && p.ContentType != nil {\n\t\tp.Content = &ProjectV2ItemContent{}\n\t\tswitch *p.ContentType {\n\t\tcase ProjectV2ItemContentTypeIssue:\n\t\t\tp.Content.Issue = &Issue{}\n\t\t\treturn json.Unmarshal(aux.Content, p.Content.Issue)\n\t\tcase ProjectV2ItemContentTypePullRequest:\n\t\t\tp.Content.PullRequest = &PullRequest{}\n\t\t\treturn json.Unmarshal(aux.Content, p.Content.PullRequest)\n\t\tcase ProjectV2ItemContentTypeDraftIssue:\n\t\t\tp.Content.DraftIssue = &ProjectV2DraftIssue{}\n\t\t\treturn json.Unmarshal(aux.Content, p.Content.DraftIssue)\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// ProjectV2Field represents a field in a GitHub Projects V2 project.\n// Fields define the structure and data types for project items.\n//\n// GitHub API docs: https://docs.github.com/rest/projects/fields\ntype ProjectV2Field struct {\n\tID            *int64                       `json:\"id,omitempty\"`\n\tNodeID        *string                      `json:\"node_id,omitempty\"`\n\tName          *string                      `json:\"name,omitempty\"`\n\tDataType      *string                      `json:\"data_type,omitempty\"`\n\tProjectURL    *string                      `json:\"project_url,omitempty\"`\n\tOptions       []*ProjectV2FieldOption      `json:\"options,omitempty\"`\n\tConfiguration *ProjectV2FieldConfiguration `json:\"configuration,omitempty\"`\n\tCreatedAt     *Timestamp                   `json:\"created_at,omitempty\"`\n\tUpdatedAt     *Timestamp                   `json:\"updated_at,omitempty\"`\n}\n\n// ProjectV2ItemFieldValue represents a field value of a project item.\ntype ProjectV2ItemFieldValue struct {\n\tID       *int64  `json:\"id,omitempty\"`\n\tName     *string `json:\"name,omitempty\"`\n\tDataType *string `json:\"data_type,omitempty\"`\n\t// Value set for the field. The type depends on the field type:\n\t//   - text: string\n\t//   - number: float64\n\t//   - date: string (ISO 8601 date format, e.g. \"2023-06-23\") or null\n\t//   - single_select: object with \"id\", \"name\", \"color\", \"description\" fields or null\n\t//   - iteration: object with \"id\", \"title\", \"start_date\", \"duration\" fields or null\n\t//   - title: object with \"text\" field (read-only, reflects the item's title) or null\n\t//   - assignees: array of user objects with \"login\", \"id\", etc. or null\n\t//   - labels: array of label objects with \"id\", \"name\", \"color\", etc. or null\n\t//   - linked_pull_requests: array of pull request objects or null\n\t//   - milestone: milestone object with \"id\", \"title\", \"description\", etc. or null\n\t//   - repository: repository object with \"id\", \"name\", \"full_name\", etc. or null\n\t//   - reviewers: array of user objects or null\n\t//   - status: object with \"id\", \"name\", \"color\", \"description\" fields (same structure as single_select) or null\n\tValue any `json:\"value,omitempty\"`\n}\n\n// ListOrganizationProjects lists Projects V2 for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/projects/projects#list-projects-for-organization\n//\n//meta:operation GET /orgs/{org}/projectsV2\nfunc (s *ProjectsService) ListOrganizationProjects(ctx context.Context, org string, opts *ListProjectsOptions) ([]*ProjectV2, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/projectsV2\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar projects []*ProjectV2\n\tresp, err := s.client.Do(ctx, req, &projects)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn projects, resp, nil\n}\n\n// GetOrganizationProject gets a Projects V2 project for an organization by ID.\n//\n// GitHub API docs: https://docs.github.com/rest/projects/projects#get-project-for-organization\n//\n//meta:operation GET /orgs/{org}/projectsV2/{project_number}\nfunc (s *ProjectsService) GetOrganizationProject(ctx context.Context, org string, projectNumber int) (*ProjectV2, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/projectsV2/%v\", org, projectNumber)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar project *ProjectV2\n\tresp, err := s.client.Do(ctx, req, &project)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn project, resp, nil\n}\n\n// ListUserProjects lists Projects V2 for a user.\n//\n// GitHub API docs: https://docs.github.com/rest/projects/projects#list-projects-for-user\n//\n//meta:operation GET /users/{username}/projectsV2\nfunc (s *ProjectsService) ListUserProjects(ctx context.Context, username string, opts *ListProjectsOptions) ([]*ProjectV2, *Response, error) {\n\tu := fmt.Sprintf(\"users/%v/projectsV2\", username)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar projects []*ProjectV2\n\tresp, err := s.client.Do(ctx, req, &projects)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn projects, resp, nil\n}\n\n// GetUserProject gets a Projects V2 project for a user by ID.\n//\n// GitHub API docs: https://docs.github.com/rest/projects/projects#get-project-for-user\n//\n//meta:operation GET /users/{username}/projectsV2/{project_number}\nfunc (s *ProjectsService) GetUserProject(ctx context.Context, username string, projectNumber int) (*ProjectV2, *Response, error) {\n\tu := fmt.Sprintf(\"users/%v/projectsV2/%v\", username, projectNumber)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar project *ProjectV2\n\tresp, err := s.client.Do(ctx, req, &project)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn project, resp, nil\n}\n\n// ListOrganizationProjectFields lists Projects V2 for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/projects/fields#list-project-fields-for-organization\n//\n//meta:operation GET /orgs/{org}/projectsV2/{project_number}/fields\nfunc (s *ProjectsService) ListOrganizationProjectFields(ctx context.Context, org string, projectNumber int, opts *ListProjectsOptions) ([]*ProjectV2Field, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/projectsV2/%v/fields\", org, projectNumber)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar fields []*ProjectV2Field\n\tresp, err := s.client.Do(ctx, req, &fields)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn fields, resp, nil\n}\n\n// ListUserProjectFields lists Projects V2 for a user.\n//\n// GitHub API docs: https://docs.github.com/rest/projects/fields#list-project-fields-for-user\n//\n//meta:operation GET /users/{username}/projectsV2/{project_number}/fields\nfunc (s *ProjectsService) ListUserProjectFields(ctx context.Context, user string, projectNumber int, opts *ListProjectsOptions) ([]*ProjectV2Field, *Response, error) {\n\tu := fmt.Sprintf(\"users/%v/projectsV2/%v/fields\", user, projectNumber)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar fields []*ProjectV2Field\n\tresp, err := s.client.Do(ctx, req, &fields)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn fields, resp, nil\n}\n\n// GetOrganizationProjectField gets a single project field from an organization owned project.\n//\n// GitHub API docs: https://docs.github.com/rest/projects/fields#get-project-field-for-organization\n//\n//meta:operation GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}\nfunc (s *ProjectsService) GetOrganizationProjectField(ctx context.Context, org string, projectNumber int, fieldID int64) (*ProjectV2Field, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/projectsV2/%v/fields/%v\", org, projectNumber, fieldID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar field *ProjectV2Field\n\tresp, err := s.client.Do(ctx, req, &field)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn field, resp, nil\n}\n\n// GetUserProjectField gets a single project field from a user owned project.\n//\n// GitHub API docs: https://docs.github.com/rest/projects/fields#get-project-field-for-user\n//\n//meta:operation GET /users/{username}/projectsV2/{project_number}/fields/{field_id}\nfunc (s *ProjectsService) GetUserProjectField(ctx context.Context, user string, projectNumber int, fieldID int64) (*ProjectV2Field, *Response, error) {\n\tu := fmt.Sprintf(\"users/%v/projectsV2/%v/fields/%v\", user, projectNumber, fieldID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar field *ProjectV2Field\n\tresp, err := s.client.Do(ctx, req, &field)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn field, resp, nil\n}\n\n// ListProjectItemsOptions specifies optional parameters when listing project items.\n// Note: Pagination uses before/after cursor-style pagination similar to ListProjectsOptions.\n// \"Fields\" can be used to restrict which field values are returned (by their numeric IDs).\ntype ListProjectItemsOptions struct {\n\t// Embed ListProjectsOptions to reuse pagination and query parameters.\n\tListProjectsOptions\n\t// Fields restricts which field values are returned by numeric field IDs.\n\tFields []int64 `url:\"fields,omitempty,comma\"`\n}\n\n// GetProjectItemOptions specifies optional parameters when getting a project item.\ntype GetProjectItemOptions struct {\n\t// Fields restricts which field values are returned by numeric field IDs.\n\tFields []int64 `url:\"fields,omitempty,comma\"`\n}\n\n// AddProjectItemOptions represents the payload to add an item (issue or pull request)\n// to a project. The Type must be either \"Issue\" or \"PullRequest\" (as per API docs) and\n// ID is the numerical ID of that issue or pull request.\ntype AddProjectItemOptions struct {\n\tType *ProjectV2ItemContentType `json:\"type,omitempty\"`\n\tID   *int64                    `json:\"id,omitempty\"`\n}\n\n// UpdateProjectV2Field represents a field update for a project item.\n//\n// GitHub API docs: https://docs.github.com/rest/projects/items#update-project-item-for-organization\ntype UpdateProjectV2Field struct {\n\t// ID is the field ID to update.\n\tID int64 `json:\"id\"`\n\t// Value is the new value to set for the field. The type depends on the field type.\n\t// For text fields: string\n\t// For number fields: float64 or int\n\t// For single_select fields: string (option ID)\n\t// For date fields: string (ISO 8601 date)\n\t// For iteration fields: string (iteration ID)\n\t// Note: Some field types (title, assignees, labels, etc.) are read-only or managed through other API endpoints.\n\tValue any `json:\"value\"`\n}\n\n// UpdateProjectItemOptions represents fields that can be modified for a project item.\n// The GitHub API expects either archived status updates or field value updates.\ntype UpdateProjectItemOptions struct {\n\t// Archived indicates whether the item should be archived (true) or unarchived (false).\n\t// This is used for archive/unarchive operations.\n\tArchived *bool `json:\"archived,omitempty\"`\n\t// Fields contains field updates to apply to the project item.\n\t// Each entry specifies a field ID and its new value.\n\tFields []*UpdateProjectV2Field `json:\"fields,omitempty\"`\n}\n\n// ListOrganizationProjectItems lists items for an organization owned project.\n//\n// GitHub API docs: https://docs.github.com/rest/projects/items#list-items-for-an-organization-owned-project\n//\n//meta:operation GET /orgs/{org}/projectsV2/{project_number}/items\nfunc (s *ProjectsService) ListOrganizationProjectItems(ctx context.Context, org string, projectNumber int, opts *ListProjectItemsOptions) ([]*ProjectV2Item, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/projectsV2/%v/items\", org, projectNumber)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar items []*ProjectV2Item\n\tresp, err := s.client.Do(ctx, req, &items)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn items, resp, nil\n}\n\n// AddOrganizationProjectItem adds an issue or pull request item to an organization owned project.\n//\n// GitHub API docs: https://docs.github.com/rest/projects/items#add-item-to-organization-owned-project\n//\n//meta:operation POST /orgs/{org}/projectsV2/{project_number}/items\nfunc (s *ProjectsService) AddOrganizationProjectItem(ctx context.Context, org string, projectNumber int, opts *AddProjectItemOptions) (*ProjectV2Item, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/projectsV2/%v/items\", org, projectNumber)\n\treq, err := s.client.NewRequest(\"POST\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar item *ProjectV2Item\n\tresp, err := s.client.Do(ctx, req, &item)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn item, resp, nil\n}\n\n// GetOrganizationProjectItem gets a single item from an organization owned project.\n//\n// GitHub API docs: https://docs.github.com/rest/projects/items#get-an-item-for-an-organization-owned-project\n//\n//meta:operation GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}\nfunc (s *ProjectsService) GetOrganizationProjectItem(ctx context.Context, org string, projectNumber int, itemID int64, opts *GetProjectItemOptions) (*ProjectV2Item, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/projectsV2/%v/items/%v\", org, projectNumber, itemID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar item *ProjectV2Item\n\tresp, err := s.client.Do(ctx, req, &item)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn item, resp, nil\n}\n\n// UpdateOrganizationProjectItem updates an item in an organization owned project.\n//\n// GitHub API docs: https://docs.github.com/rest/projects/items#update-project-item-for-organization\n//\n//meta:operation PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}\nfunc (s *ProjectsService) UpdateOrganizationProjectItem(ctx context.Context, org string, projectNumber int, itemID int64, opts *UpdateProjectItemOptions) (*ProjectV2Item, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/projectsV2/%v/items/%v\", org, projectNumber, itemID)\n\treq, err := s.client.NewRequest(\"PATCH\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar item *ProjectV2Item\n\tresp, err := s.client.Do(ctx, req, &item)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn item, resp, nil\n}\n\n// DeleteOrganizationProjectItem deletes an item from an organization owned project.\n//\n// GitHub API docs: https://docs.github.com/rest/projects/items#delete-project-item-for-organization\n//\n//meta:operation DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}\nfunc (s *ProjectsService) DeleteOrganizationProjectItem(ctx context.Context, org string, projectNumber int, itemID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/projectsV2/%v/items/%v\", org, projectNumber, itemID)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// ListUserProjectItems lists items for a user owned project.\n//\n// GitHub API docs: https://docs.github.com/rest/projects/items#list-items-for-a-user-owned-project\n//\n//meta:operation GET /users/{username}/projectsV2/{project_number}/items\nfunc (s *ProjectsService) ListUserProjectItems(ctx context.Context, username string, projectNumber int, opts *ListProjectItemsOptions) ([]*ProjectV2Item, *Response, error) {\n\tu := fmt.Sprintf(\"users/%v/projectsV2/%v/items\", username, projectNumber)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar items []*ProjectV2Item\n\tresp, err := s.client.Do(ctx, req, &items)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn items, resp, nil\n}\n\n// AddUserProjectItem adds an issue or pull request item to a user owned project.\n//\n// GitHub API docs: https://docs.github.com/rest/projects/items#add-item-to-user-owned-project\n//\n//meta:operation POST /users/{username}/projectsV2/{project_number}/items\nfunc (s *ProjectsService) AddUserProjectItem(ctx context.Context, username string, projectNumber int, opts *AddProjectItemOptions) (*ProjectV2Item, *Response, error) {\n\tu := fmt.Sprintf(\"users/%v/projectsV2/%v/items\", username, projectNumber)\n\treq, err := s.client.NewRequest(\"POST\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar item *ProjectV2Item\n\tresp, err := s.client.Do(ctx, req, &item)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn item, resp, nil\n}\n\n// GetUserProjectItem gets a single item from a user owned project.\n//\n// GitHub API docs: https://docs.github.com/rest/projects/items#get-an-item-for-a-user-owned-project\n//\n//meta:operation GET /users/{username}/projectsV2/{project_number}/items/{item_id}\nfunc (s *ProjectsService) GetUserProjectItem(ctx context.Context, username string, projectNumber int, itemID int64, opts *GetProjectItemOptions) (*ProjectV2Item, *Response, error) {\n\tu := fmt.Sprintf(\"users/%v/projectsV2/%v/items/%v\", username, projectNumber, itemID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar item *ProjectV2Item\n\tresp, err := s.client.Do(ctx, req, &item)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn item, resp, nil\n}\n\n// UpdateUserProjectItem updates an item in a user owned project.\n//\n// GitHub API docs: https://docs.github.com/rest/projects/items#update-project-item-for-user\n//\n//meta:operation PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}\nfunc (s *ProjectsService) UpdateUserProjectItem(ctx context.Context, username string, projectNumber int, itemID int64, opts *UpdateProjectItemOptions) (*ProjectV2Item, *Response, error) {\n\tu := fmt.Sprintf(\"users/%v/projectsV2/%v/items/%v\", username, projectNumber, itemID)\n\treq, err := s.client.NewRequest(\"PATCH\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar item *ProjectV2Item\n\tresp, err := s.client.Do(ctx, req, &item)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn item, resp, nil\n}\n\n// DeleteUserProjectItem deletes an item from a user owned project.\n//\n// GitHub API docs: https://docs.github.com/rest/projects/items#delete-project-item-for-user\n//\n//meta:operation DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}\nfunc (s *ProjectsService) DeleteUserProjectItem(ctx context.Context, username string, projectNumber int, itemID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"users/%v/projectsV2/%v/items/%v\", username, projectNumber, itemID)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/projects_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"testing\"\n)\n\nfunc TestProjectsService_ListOrganizationProjects(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\t// Combined handler: supports initial test case and dual before/after validation scenario.\n\tmux.HandleFunc(\"/orgs/o/projectsV2\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tq := r.URL.Query()\n\t\tif q.Get(\"before\") == \"b\" && q.Get(\"after\") == \"a\" {\n\t\t\tfmt.Fprint(w, `[]`)\n\t\t\treturn\n\t\t}\n\t\t// default expectation for main part of test\n\t\ttestFormValues(t, r, values{\"q\": \"alpha\", \"after\": \"2\", \"before\": \"1\"})\n\t\tfmt.Fprint(w, `[{\"id\":1,\"title\":\"T1\",\"created_at\":\"2011-01-02T15:04:05Z\",\"updated_at\":\"2012-01-02T15:04:05Z\"}]`)\n\t})\n\n\topts := &ListProjectsOptions{Query: \"alpha\", ListProjectsPaginationOptions: ListProjectsPaginationOptions{After: \"2\", Before: \"1\"}}\n\tctx := t.Context()\n\tprojects, _, err := client.Projects.ListOrganizationProjects(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Fatalf(\"Projects.ListOrganizationProjects returned error: %v\", err)\n\t}\n\tif len(projects) != 1 || projects[0].GetID() != 1 || projects[0].GetTitle() != \"T1\" {\n\t\tt.Fatalf(\"Projects.ListOrganizationProjects returned %+v\", projects)\n\t}\n\n\tconst methodName = \"ListOrganizationProjects\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Projects.ListOrganizationProjects(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Projects.ListOrganizationProjects(ctx, \"o\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n\n\t// still allow both set (no validation enforced) – ensure it does not error\n\tctxBypass := context.WithValue(t.Context(), BypassRateLimitCheck, true)\n\tif _, _, err = client.Projects.ListOrganizationProjects(ctxBypass, \"o\", &ListProjectsOptions{ListProjectsPaginationOptions: ListProjectsPaginationOptions{Before: \"b\", After: \"a\"}}); err != nil {\n\t\tt.Fatalf(\"unexpected error when both before/after set: %v\", err)\n\t}\n}\n\nfunc TestProjectsService_GetOrganizationProject(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/projectsV2/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1,\"title\":\"OrgProj\",\"created_at\":\"2011-01-02T15:04:05Z\",\"updated_at\":\"2012-01-02T15:04:05Z\"}`)\n\t})\n\n\tctx := t.Context()\n\tproject, _, err := client.Projects.GetOrganizationProject(ctx, \"o\", 1)\n\tif err != nil {\n\t\tt.Fatalf(\"Projects.GetOrganizationProject returned error: %v\", err)\n\t}\n\tif project.GetID() != 1 || project.GetTitle() != \"OrgProj\" {\n\t\tt.Fatalf(\"Projects.GetOrganizationProject returned %+v\", project)\n\t}\n\n\tconst methodName = \"GetOrganizationProject\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Projects.GetOrganizationProject(ctx, \"o\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestProjectsService_ListUserProjects(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\t// Combined handler: supports initial test case and dual before/after scenario.\n\tmux.HandleFunc(\"/users/u/projectsV2\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tq := r.URL.Query()\n\t\tif q.Get(\"before\") == \"b\" && q.Get(\"after\") == \"a\" {\n\t\t\tfmt.Fprint(w, `[]`)\n\t\t\treturn\n\t\t}\n\t\ttestFormValues(t, r, values{\"q\": \"beta\", \"before\": \"1\", \"after\": \"2\", \"per_page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":2,\"title\":\"UProj\",\"created_at\":\"2011-01-02T15:04:05Z\",\"updated_at\":\"2012-01-02T15:04:05Z\"}]`)\n\t})\n\n\topts := &ListProjectsOptions{Query: \"beta\", ListProjectsPaginationOptions: ListProjectsPaginationOptions{Before: \"1\", After: \"2\", PerPage: 2}}\n\tctx := t.Context()\n\tvar ctxBypass context.Context\n\tprojects, _, err := client.Projects.ListUserProjects(ctx, \"u\", opts)\n\tif err != nil {\n\t\tt.Fatalf(\"Projects.ListUserProjects returned error: %v\", err)\n\t}\n\tif len(projects) != 1 || projects[0].GetID() != 2 || projects[0].GetTitle() != \"UProj\" {\n\t\tt.Fatalf(\"Projects.ListUserProjects returned %+v\", projects)\n\t}\n\n\tconst methodName = \"ListUserProjects\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Projects.ListUserProjects(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Projects.ListUserProjects(ctx, \"u\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n\n\t// still allow both set (no validation enforced) – ensure it does not error\n\tctxBypass = context.WithValue(t.Context(), BypassRateLimitCheck, true)\n\tif _, _, err = client.Projects.ListUserProjects(ctxBypass, \"u\", &ListProjectsOptions{ListProjectsPaginationOptions: ListProjectsPaginationOptions{Before: \"b\", After: \"a\"}}); err != nil {\n\t\tt.Fatalf(\"unexpected error when both before/after set: %v\", err)\n\t}\n}\n\nfunc TestProjectsService_GetUserProject(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/projectsV2/3\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":3,\"title\":\"UserProj\",\"created_at\":\"2011-01-02T15:04:05Z\",\"updated_at\":\"2012-01-02T15:04:05Z\"}`)\n\t})\n\n\tctx := t.Context()\n\tproject, _, err := client.Projects.GetUserProject(ctx, \"u\", 3)\n\tif err != nil {\n\t\tt.Fatalf(\"Projects.GetUserProject returned error: %v\", err)\n\t}\n\tif project.GetID() != 3 || project.GetTitle() != \"UserProj\" {\n\t\tt.Fatalf(\"Projects.GetUserProject returned %+v\", project)\n\t}\n\n\tconst methodName = \"GetUserProject\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Projects.GetUserProject(ctx, \"u\", 3)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestProjectsService_ListOrganizationProjectFields(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/projectsV2/1/fields\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tq := r.URL.Query()\n\t\tif q.Get(\"before\") == \"b\" && q.Get(\"after\") == \"a\" { // bypass scenario\n\t\t\tfmt.Fprint(w, `[]`)\n\t\t\treturn\n\t\t}\n\t\ttestFormValues(t, r, values{\"after\": \"2\", \"before\": \"1\", \"q\": \"text\"})\n\t\tfmt.Fprint(w, `[\n\t\t{\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"node_1\",\n\t\t\t\"name\": \"Status\",\n\t\t\t\"data_type\": \"single_select\",\n\t\t\t\"url\": \"https://api.github.com/projects/1/fields/field1\",\n\t\t\t\"options\": [\n\t\t\t\t{\"id\": \"1\", \"name\": {\"raw\": \"Todo\", \"html\": \"Todo\"}, \"color\": \"blue\", \"description\": {\"raw\": \"Tasks to be done\", \"html\": \"Tasks to be done\"}},\n\t\t\t\t{\"id\": \"2\", \"name\": {\"raw\": \"In Progress\", \"html\": \"In Progress\"}, \"color\": \"yellow\"}\n\t\t\t],\n\t\t\t\"created_at\": \"2011-01-02T15:04:05Z\",\n\t\t\t\"updated_at\": \"2012-01-02T15:04:05Z\"\n\t\t},\n\t\t{\n\t\t\t\"id\": 2,\n\t\t\t\"node_id\": \"node_2\",\n\t\t\t\"name\": \"Priority\",\n\t\t\t\"data_type\": \"text\",\n\t\t\t\"url\": \"https://api.github.com/projects/1/fields/field2\",\n\t\t\t\"created_at\": \"2011-01-02T15:04:05Z\",\n\t\t\t\"updated_at\": \"2012-01-02T15:04:05Z\"\n\t\t}\n\t\t]`)\n\t})\n\n\topts := &ListProjectsOptions{Query: \"text\", ListProjectsPaginationOptions: ListProjectsPaginationOptions{After: \"2\", Before: \"1\"}}\n\tctx := t.Context()\n\tfields, _, err := client.Projects.ListOrganizationProjectFields(ctx, \"o\", 1, opts)\n\tif err != nil {\n\t\tt.Fatalf(\"Projects.ListOrganizationProjectFields returned error: %v\", err)\n\t}\n\tif len(fields) != 2 {\n\t\tt.Fatalf(\"Projects.ListOrganizationProjectFields returned %d fields, want 2\", len(fields))\n\t}\n\tif fields[0].ID == nil || *fields[0].ID != 1 || fields[1].ID == nil || *fields[1].ID != 2 {\n\t\tt.Fatalf(\"unexpected field IDs: %+v\", fields)\n\t}\n\n\tconst methodName = \"ListOrganizationProjectFields\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Projects.ListOrganizationProjectFields(ctx, \"\\n\", 1, opts)\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Projects.ListOrganizationProjectFields(ctx, \"o\", 1, opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n\tctxBypass := context.WithValue(ctx, BypassRateLimitCheck, true)\n\tif _, _, err = client.Projects.ListOrganizationProjectFields(ctxBypass, \"o\", 1, &ListProjectsOptions{ListProjectsPaginationOptions: ListProjectsPaginationOptions{Before: (\"b\"), After: (\"a\")}}); err != nil {\n\t\tt.Fatalf(\"unexpected error when both before/after set: %v\", err)\n\t}\n}\n\nfunc TestProjectsService_ListUserProjectFields(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/projectsV2/1/fields\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tq := r.URL.Query()\n\t\tif q.Get(\"before\") == \"b\" && q.Get(\"after\") == \"a\" { // bypass scenario\n\t\t\tfmt.Fprint(w, `[]`)\n\t\t\treturn\n\t\t}\n\t\ttestFormValues(t, r, values{\"after\": \"2\", \"before\": \"1\", \"q\": \"text\"})\n\t\tfmt.Fprint(w, `[\n\t\t{\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"node_1\",\n\t\t\t\"name\": \"Status\",\n\t\t\t\"data_type\": \"single_select\",\n\t\t\t\"url\": \"https://api.github.com/projects/1/fields/field1\",\n\t\t\t\"options\": [\n\t\t\t\t{\"id\": \"1\", \"name\": {\"raw\": \"Todo\", \"html\": \"Todo\"}, \"color\": \"blue\", \"description\": {\"raw\": \"Tasks to be done\", \"html\": \"Tasks to be done\"}},\n\t\t\t\t{\"id\": \"2\", \"name\": {\"raw\": \"In Progress\", \"html\": \"In Progress\"}, \"color\": \"yellow\"}\n\t\t\t],\n\t\t\t\"created_at\": \"2011-01-02T15:04:05Z\",\n\t\t\t\"updated_at\": \"2012-01-02T15:04:05Z\"\n\t\t},\n\t\t{\n\t\t\t\"id\": 2,\n\t\t\t\"node_id\": \"node_2\",\n\t\t\t\"name\": \"Priority\",\n\t\t\t\"data_type\": \"text\",\n\t\t\t\"url\": \"https://api.github.com/projects/1/fields/field2\",\n\t\t\t\"created_at\": \"2011-01-02T15:04:05Z\",\n\t\t\t\"updated_at\": \"2012-01-02T15:04:05Z\"\n\t\t}\n\t\t]`)\n\t})\n\n\topts := &ListProjectsOptions{Query: (\"text\"), ListProjectsPaginationOptions: ListProjectsPaginationOptions{After: (\"2\"), Before: (\"1\")}}\n\tctx := t.Context()\n\tfields, _, err := client.Projects.ListUserProjectFields(ctx, \"u\", 1, opts)\n\tif err != nil {\n\t\tt.Fatalf(\"Projects.ListUserProjectFields returned error: %v\", err)\n\t}\n\tif len(fields) != 2 {\n\t\tt.Fatalf(\"Projects.ListUserProjectFields returned %d fields, want 2\", len(fields))\n\t}\n\tif fields[0].ID == nil || *fields[0].ID != 1 || fields[1].ID == nil || *fields[1].ID != 2 {\n\t\tt.Fatalf(\"unexpected field IDs: %+v\", fields)\n\t}\n\n\tconst methodName = \"ListUserProjectFields\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Projects.ListUserProjectFields(ctx, \"\\n\", 1, opts)\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Projects.ListUserProjectFields(ctx, \"u\", 1, opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n\tctxBypass := context.WithValue(ctx, BypassRateLimitCheck, true)\n\tif _, _, err = client.Projects.ListUserProjectFields(ctxBypass, \"u\", 1, &ListProjectsOptions{ListProjectsPaginationOptions: ListProjectsPaginationOptions{Before: (\"b\"), After: (\"a\")}}); err != nil {\n\t\tt.Fatalf(\"unexpected error when both before/after set: %v\", err)\n\t}\n}\n\nfunc TestProjectsService_GetOrganizationProjectField(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/projectsV2/1/fields/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `\n\t\t{\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"node_1\",\n\t\t\t\"name\": \"Status\",\n\t\t\t\"data_type\": \"single_select\",\n\t\t\t\"url\": \"https://api.github.com/projects/1/fields/field1\",\n\t\t\t\"options\": [\n\t\t\t\t{\"id\": \"1\", \"name\": {\"raw\": \"Todo\", \"html\": \"Todo\"}, \"color\": \"blue\", \"description\": {\"raw\": \"Tasks to be done\", \"html\": \"Tasks to be done\"}},\n\t\t\t\t{\"id\": \"2\", \"name\": {\"raw\": \"In Progress\", \"html\": \"In Progress\"}, \"color\": \"yellow\"}\n\t\t\t],\n\t\t\t\"created_at\": \"2011-01-02T15:04:05Z\",\n\t\t\t\"updated_at\": \"2012-01-02T15:04:05Z\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tfield, _, err := client.Projects.GetOrganizationProjectField(ctx, \"o\", 1, 1)\n\tif err != nil {\n\t\tt.Fatalf(\"Projects.GetOrganizationProjectField returned error: %v\", err)\n\t}\n\tif field == nil || field.ID == nil || *field.ID != 1 {\n\t\tt.Fatalf(\"unexpected field: %+v\", field)\n\t}\n\n\tconst methodName = \"GetOrganizationProjectField\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Projects.GetOrganizationProjectField(ctx, \"o\", 1, 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestProjectsService_GetUserProjectField(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/projectsV2/1/fields/3\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `\n\t\t{\n\t\t\t\"id\": 3,\n\t\t\t\"node_id\": \"node_3\",\n\t\t\t\"name\": \"Status\",\n\t\t\t\"data_type\": \"single_select\",\n\t\t\t\"url\": \"https://api.github.com/projects/1/fields/field3\",\n\t\t\t\"options\": [\n\t\t\t\t{\"id\": \"1\", \"name\": {\"raw\": \"Done\", \"html\": \"Done\"}, \"color\": \"red\", \"description\": {\"raw\": \"Done task\", \"html\": \"Done task\"}},\n\t\t\t\t{\"id\": \"2\", \"name\": {\"raw\": \"In Progress\", \"html\": \"In Progress\"}, \"color\": \"yellow\"}\n\t\t\t],\n\t\t\t\"created_at\": \"2011-01-02T15:04:05Z\",\n\t\t\t\"updated_at\": \"2012-01-02T15:04:05Z\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tfield, _, err := client.Projects.GetUserProjectField(ctx, \"u\", 1, 3)\n\tif err != nil {\n\t\tt.Fatalf(\"Projects.GetUserProjectField returned error: %v\", err)\n\t}\n\tif field == nil || field.ID == nil || *field.ID != 3 {\n\t\tt.Fatalf(\"unexpected field: %+v\", field)\n\t}\n\n\tconst methodName = \"GetUserProjectField\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Projects.GetUserProjectField(ctx, \"u\", 1, 3)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestProjectsService_ListUserProjects_pagination(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tmux.HandleFunc(\"/users/u/projectsV2\", func(w http.ResponseWriter, r *http.Request) {\n\t\tq := r.URL.Query()\n\t\tafter := q.Get(\"after\")\n\t\tbefore := q.Get(\"before\")\n\t\tif after == \"\" && before == \"\" {\n\t\t\tw.Header().Set(\"Link\", \"<http://example.org/users/u/projectsV2?after=ucursor2>; rel=\\\"next\\\"\")\n\t\t\tfmt.Fprint(w, `[{\"id\":10,\"title\":\"UP1\",\"created_at\":\"2011-01-02T15:04:05Z\",\"updated_at\":\"2012-01-02T15:04:05Z\"}]`)\n\t\t\treturn\n\t\t}\n\t\tif after == \"ucursor2\" {\n\t\t\tw.Header().Set(\"Link\", \"<http://example.org/users/u/projectsV2?before=ucursor2>; rel=\\\"prev\\\"\")\n\t\t\tfmt.Fprint(w, `[{\"id\":11,\"title\":\"UP2\",\"created_at\":\"2011-01-02T15:04:05Z\",\"updated_at\":\"2012-01-02T15:04:05Z\"}]`)\n\t\t\treturn\n\t\t}\n\t\thttp.Error(w, \"unexpected query\", http.StatusBadRequest)\n\t})\n\tctx := t.Context()\n\tfirst, resp, err := client.Projects.ListUserProjects(ctx, \"u\", nil)\n\tif err != nil {\n\t\tt.Fatalf(\"first page error: %v\", err)\n\t}\n\tif len(first) != 1 || first[0].GetID() != 10 {\n\t\tt.Fatalf(\"unexpected first page %+v\", first)\n\t}\n\tif resp.After != \"ucursor2\" {\n\t\tt.Fatalf(\"expected resp.After=ucursor2 got %q\", resp.After)\n\t}\n\n\topts := &ListProjectsOptions{ListProjectsPaginationOptions: ListProjectsPaginationOptions{After: (resp.After)}}\n\tsecond, resp2, err := client.Projects.ListUserProjects(ctx, \"u\", opts)\n\tif err != nil {\n\t\tt.Fatalf(\"second page error: %v\", err)\n\t}\n\tif len(second) != 1 || second[0].GetID() != 11 {\n\t\tt.Fatalf(\"unexpected second page %+v\", second)\n\t}\n\tif resp2.Before != \"ucursor2\" {\n\t\tt.Fatalf(\"expected resp2.Before=ucursor2 got %q\", resp2.Before)\n\t}\n}\n\nfunc TestProjectsService_ListUserProjects_error(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tmux.HandleFunc(\"/users/u/projectsV2\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[]`)\n\t})\n\tctx := t.Context()\n\tconst methodName = \"ListUserProjects\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Projects.ListUserProjects(ctx, \"u\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n\t// bad options (bad username) should error\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Projects.ListUserProjects(ctx, \"\\n\", nil)\n\t\treturn err\n\t})\n}\n\nfunc TestProjectsService_ListOrganizationProjectFields_pagination(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\t// First page returns a Link header with rel=\"next\" containing an after cursor\n\tmux.HandleFunc(\"/orgs/o/projectsV2/1/fields\", func(w http.ResponseWriter, r *http.Request) {\n\t\tq := r.URL.Query()\n\t\tafter := q.Get(\"after\")\n\t\tbefore := q.Get(\"before\")\n\t\tif after == \"\" && before == \"\" {\n\t\t\t// first request\n\t\t\tw.Header().Set(\"Link\", \"<http://example.org/orgs/o/projectsV2/1/fields?after=cursor2>; rel=\\\"next\\\"\")\n\t\t\tfmt.Fprint(w, `[{\"id\":1,\"name\":\"Status\",\"data_type\":\"single_select\",\"created_at\":\"2011-01-02T15:04:05Z\",\"updated_at\":\"2012-01-02T15:04:05Z\"}]`)\n\t\t\treturn\n\t\t}\n\t\tif after == \"cursor2\" {\n\t\t\t// second request simulates a previous link\n\t\t\tw.Header().Set(\"Link\", \"<http://example.org/orgs/o/projectsV2/1/fields?before=cursor2>; rel=\\\"prev\\\"\")\n\t\t\tfmt.Fprint(w, `[{\"id\":2,\"name\":\"Priority\",\"data_type\":\"text\",\"created_at\":\"2011-01-02T15:04:05Z\",\"updated_at\":\"2012-01-02T15:04:05Z\"}]`)\n\t\t\treturn\n\t\t}\n\t\t// unexpected state\n\t\thttp.Error(w, \"unexpected query\", http.StatusBadRequest)\n\t})\n\n\tctx := t.Context()\n\tfirst, resp, err := client.Projects.ListOrganizationProjectFields(ctx, \"o\", 1, nil)\n\tif err != nil {\n\t\tt.Fatalf(\"first page error: %v\", err)\n\t}\n\tif len(first) != 1 || first[0].ID == nil || *first[0].ID != 1 {\n\t\tt.Fatalf(\"unexpected first page %+v\", first)\n\t}\n\tif resp.After != \"cursor2\" {\n\t\tt.Fatalf(\"expected resp.After=cursor2 got %q\", resp.After)\n\t}\n\n\topts := &ListProjectsOptions{ListProjectsPaginationOptions: ListProjectsPaginationOptions{After: (resp.After)}}\n\tsecond, resp2, err := client.Projects.ListOrganizationProjectFields(ctx, \"o\", 1, opts)\n\tif err != nil {\n\t\tt.Fatalf(\"second page error: %v\", err)\n\t}\n\tif len(second) != 1 || second[0].ID == nil || *second[0].ID != 2 {\n\t\tt.Fatalf(\"unexpected second page %+v\", second)\n\t}\n\tif resp2.Before != \"cursor2\" {\n\t\tt.Fatalf(\"expected resp2.Before=cursor2 got %q\", resp2.Before)\n\t}\n}\n\nfunc TestProjectsService_ListOrganizationProjects_pagination(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/projectsV2\", func(w http.ResponseWriter, r *http.Request) {\n\t\tq := r.URL.Query()\n\t\tafter := q.Get(\"after\")\n\t\tbefore := q.Get(\"before\")\n\t\tif after == \"\" && before == \"\" {\n\t\t\tw.Header().Set(\"Link\", \"<http://example.org/orgs/o/projectsV2?after=ocursor2>; rel=\\\"next\\\"\")\n\t\t\tfmt.Fprint(w, `[{\"id\":20,\"title\":\"OP1\",\"created_at\":\"2011-01-02T15:04:05Z\",\"updated_at\":\"2012-01-02T15:04:05Z\"}]`)\n\t\t\treturn\n\t\t}\n\t\tif after == \"ocursor2\" {\n\t\t\tw.Header().Set(\"Link\", \"<http://example.org/orgs/o/projectsV2?before=ocursor2>; rel=\\\"prev\\\"\")\n\t\t\tfmt.Fprint(w, `[{\"id\":21,\"title\":\"OP2\",\"created_at\":\"2011-01-02T15:04:05Z\",\"updated_at\":\"2012-01-02T15:04:05Z\"}]`)\n\t\t\treturn\n\t\t}\n\t\thttp.Error(w, \"unexpected query\", http.StatusBadRequest)\n\t})\n\n\tctx := t.Context()\n\tfirst, resp, err := client.Projects.ListOrganizationProjects(ctx, \"o\", nil)\n\tif err != nil {\n\t\tt.Fatalf(\"first page error: %v\", err)\n\t}\n\tif len(first) != 1 || first[0].GetID() != 20 {\n\t\tt.Fatalf(\"unexpected first page %+v\", first)\n\t}\n\tif resp.After != \"ocursor2\" {\n\t\tt.Fatalf(\"expected resp.After=ocursor2 got %q\", resp.After)\n\t}\n\n\topts := &ListProjectsOptions{ListProjectsPaginationOptions: ListProjectsPaginationOptions{After: (resp.After)}}\n\tsecond, resp2, err := client.Projects.ListOrganizationProjects(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Fatalf(\"second page error: %v\", err)\n\t}\n\tif len(second) != 1 || second[0].GetID() != 21 {\n\t\tt.Fatalf(\"unexpected second page %+v\", second)\n\t}\n\tif resp2.Before != \"ocursor2\" {\n\t\tt.Fatalf(\"expected resp2.Before=ocursor2 got %q\", resp2.Before)\n\t}\n}\n\n// Marshal test ensures V2 fields marshal correctly.\nfunc TestProjectV2_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ProjectV2{}, \"{}\")\n\n\tp := &ProjectV2{\n\t\tID:          Ptr(int64(10)),\n\t\tTitle:       Ptr(\"Title\"),\n\t\tDescription: Ptr(\"Desc\"),\n\t\tPublic:      Ptr(true),\n\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\tUpdatedAt:   &Timestamp{referenceTime},\n\t}\n\n\twant := `{\n        \"id\": 10,\n        \"title\": \"Title\",\n        \"description\": \"Desc\",\n        \"public\": true,\n        \"created_at\": ` + referenceTimeStr + `,\n        \"updated_at\": ` + referenceTimeStr + `\n    }`\n\n\ttestJSONMarshal(t, p, want)\n}\n\n// Marshal test ensures V2 field structures marshal correctly.\nfunc TestProjectV2Field_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ProjectV2Field{}, \"{}\")\n\ttestJSONMarshal(t, &ProjectV2FieldOption{}, \"{}\")\n\n\tfield := &ProjectV2Field{\n\t\tID:         Ptr(int64(2)),\n\t\tNodeID:     Ptr(\"node_1\"),\n\t\tName:       Ptr(\"Status\"),\n\t\tDataType:   Ptr(\"single_select\"),\n\t\tProjectURL: Ptr(\"https://api.github.com/projects/67890\"),\n\t\tOptions: []*ProjectV2FieldOption{\n\t\t\t{\n\t\t\t\tID:          Ptr(\"1\"),\n\t\t\t\tName:        &ProjectV2TextContent{Raw: Ptr(\"Todo\"), HTML: Ptr(\"Todo\")},\n\t\t\t\tColor:       Ptr(\"blue\"),\n\t\t\t\tDescription: &ProjectV2TextContent{Raw: Ptr(\"Tasks to be done\"), HTML: Ptr(\"Tasks to be done\")},\n\t\t\t},\n\t\t},\n\t\tCreatedAt: &Timestamp{referenceTime},\n\t\tUpdatedAt: &Timestamp{referenceTime},\n\t}\n\n\twant := `{\n        \"id\": 2,\n        \"node_id\": \"node_1\",\n        \"name\": \"Status\",\n        \"data_type\": \"single_select\",\n        \"project_url\": \"https://api.github.com/projects/67890\",\n        \"options\": [\n            {\n                \"id\": \"1\",\n                \"color\": \"blue\",\n                \"description\": {\n                    \"raw\": \"Tasks to be done\",\n                    \"html\": \"Tasks to be done\"\n                },\n                \"name\": {\n                    \"raw\": \"Todo\",\n                    \"html\": \"Todo\"\n                }\n            }\n        ],\n        \"created_at\": ` + referenceTimeStr + `,\n        \"updated_at\": ` + referenceTimeStr + `\n    }`\n\n\ttestJSONMarshal(t, field, want)\n}\n\n// Marshal test ensures ProjectV2FieldConfiguration marshals correctly.\nfunc TestProjectV2FieldConfiguration_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ProjectV2FieldConfiguration{}, \"{}\")\n\ttestJSONMarshal(t, &ProjectV2FieldIteration{}, \"{}\")\n\n\t// Test a field with configuration (iteration field)\n\tfieldWithConfiguration := &ProjectV2Field{\n\t\tID:         Ptr(int64(3)),\n\t\tNodeID:     Ptr(\"node_3\"),\n\t\tName:       Ptr(\"Sprint\"),\n\t\tDataType:   Ptr(\"iteration\"),\n\t\tProjectURL: Ptr(\"https://api.github.com/projects/67890\"),\n\t\tConfiguration: &ProjectV2FieldConfiguration{\n\t\t\tDuration: Ptr(1209600), // 2 weeks in seconds\n\t\t\tStartDay: Ptr(1),       // Monday\n\t\t\tIterations: []*ProjectV2FieldIteration{\n\t\t\t\t{\n\t\t\t\t\tID:        Ptr(\"iter_1\"),\n\t\t\t\t\tTitle:     &ProjectV2TextContent{Raw: Ptr(\"Sprint 1\"), HTML: Ptr(\"Sprint 1\")},\n\t\t\t\t\tStartDate: Ptr(\"2025-01-06\"),\n\t\t\t\t\tDuration:  Ptr(1209600),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tID:        Ptr(\"iter_2\"),\n\t\t\t\t\tTitle:     &ProjectV2TextContent{Raw: Ptr(\"Sprint 2\"), HTML: Ptr(\"Sprint 2\")},\n\t\t\t\t\tStartDate: Ptr(\"2025-01-20\"),\n\t\t\t\t\tDuration:  Ptr(1209600),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tCreatedAt: &Timestamp{referenceTime},\n\t\tUpdatedAt: &Timestamp{referenceTime},\n\t}\n\n\twant := `{\n        \"id\": 3,\n        \"node_id\": \"node_3\",\n        \"name\": \"Sprint\",\n        \"data_type\": \"iteration\",\n        \"project_url\": \"https://api.github.com/projects/67890\",\n        \"configuration\": {\n            \"duration\": 1209600,\n            \"start_day\": 1,\n            \"iterations\": [\n                {\n                    \"id\": \"iter_1\",\n                    \"title\": {\n                        \"raw\": \"Sprint 1\",\n                        \"html\": \"Sprint 1\"\n                    },\n                    \"start_date\": \"2025-01-06\",\n                    \"duration\": 1209600\n                },\n                {\n                    \"id\": \"iter_2\",\n                    \"title\": {\n                        \"raw\": \"Sprint 2\",\n                        \"html\": \"Sprint 2\"\n                    },\n                    \"start_date\": \"2025-01-20\",\n                    \"duration\": 1209600\n                }\n            ]\n        },\n        \"created_at\": ` + referenceTimeStr + `,\n        \"updated_at\": ` + referenceTimeStr + `\n    }`\n\n\ttestJSONMarshal(t, fieldWithConfiguration, want)\n\n\t// Test just the configuration struct by itself\n\tconfig := &ProjectV2FieldConfiguration{\n\t\tDuration: Ptr(604800), // 1 week in seconds\n\t\tStartDay: Ptr(0),      // Sunday\n\t\tIterations: []*ProjectV2FieldIteration{\n\t\t\t{\n\t\t\t\tID:        Ptr(\"config_iter_1\"),\n\t\t\t\tTitle:     &ProjectV2TextContent{Raw: Ptr(\"Week 1\"), HTML: Ptr(\"Week 1\")},\n\t\t\t\tStartDate: Ptr(\"2025-01-01\"),\n\t\t\t\tDuration:  Ptr(604800),\n\t\t\t},\n\t\t},\n\t}\n\n\tconfigWant := `{\n        \"duration\": 604800,\n        \"start_day\": 0,\n        \"iterations\": [\n            {\n                \"id\": \"config_iter_1\",\n                \"title\": {\n                    \"raw\": \"Week 1\",\n                    \"html\": \"Week 1\"\n                },\n                \"start_date\": \"2025-01-01\",\n                \"duration\": 604800\n            }\n        ]\n    }`\n\n\ttestJSONMarshal(t, config, configWant)\n\n\t// Test iteration struct by itself\n\titeration := &ProjectV2FieldIteration{\n\t\tID:        Ptr(\"single_iter\"),\n\t\tTitle:     &ProjectV2TextContent{Raw: Ptr(\"Test Iteration\"), HTML: Ptr(\"Test Iteration\")},\n\t\tStartDate: Ptr(\"2025-02-01\"),\n\t\tDuration:  Ptr(1209600),\n\t}\n\n\titerationWant := `{\n        \"id\": \"single_iter\",\n        \"title\": {\n            \"raw\": \"Test Iteration\",\n            \"html\": \"Test Iteration\"\n        },\n        \"start_date\": \"2025-02-01\",\n        \"duration\": 1209600\n    }`\n\n\ttestJSONMarshal(t, iteration, iterationWant)\n}\n\nfunc TestProjectsService_ListOrganizationProjectItems(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/projectsV2/1/items\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tq := r.URL.Query()\n\t\tif q.Get(\"before\") == \"b\" && q.Get(\"after\") == \"a\" { // bypass scenario\n\t\t\tfmt.Fprint(w, `[]`)\n\t\t\treturn\n\t\t}\n\t\ttestFormValues(t, r, values{\"after\": \"2\", \"before\": \"1\", \"per_page\": \"50\", \"fields\": \"10,11\", \"q\": \"status:open\"})\n\t\tfmt.Fprint(w, `[{\"id\":17,\"node_id\":\"PVTI_node\"}]`)\n\t})\n\n\topts := &ListProjectItemsOptions{ListProjectsOptions: ListProjectsOptions{ListProjectsPaginationOptions: ListProjectsPaginationOptions{After: (\"2\"), Before: (\"1\"), PerPage: (50)}, Query: (\"status:open\")}, Fields: []int64{10, 11}}\n\tctx := t.Context()\n\titems, _, err := client.Projects.ListOrganizationProjectItems(ctx, \"o\", 1, opts)\n\tif err != nil {\n\t\tt.Fatalf(\"Projects.ListOrganizationProjectItems returned error: %v\", err)\n\t}\n\tif len(items) != 1 || items[0].GetID() != 17 {\n\t\tt.Fatalf(\"Projects.ListOrganizationProjectItems returned %+v\", items)\n\t}\n\n\tconst methodName = \"ListOrganizationProjectItems\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Projects.ListOrganizationProjectItems(ctx, \"\\n\", 1, opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Projects.ListOrganizationProjectItems(ctx, \"o\", 1, opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n\n\tctxBypass := context.WithValue(ctx, BypassRateLimitCheck, true)\n\tif _, _, err = client.Projects.ListOrganizationProjectItems(ctxBypass, \"o\", 1, &ListProjectItemsOptions{ListProjectsOptions: ListProjectsOptions{ListProjectsPaginationOptions: ListProjectsPaginationOptions{Before: (\"b\"), After: (\"a\")}}}); err != nil {\n\t\tt.Fatalf(\"unexpected error when both before/after set: %v\", err)\n\t}\n}\n\nfunc TestProjectsService_AddOrganizationProjectItem(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/projectsV2/1/items\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tb, _ := io.ReadAll(r.Body)\n\t\tbody := string(b)\n\t\tif body != `{\"type\":\"Issue\",\"id\":99}`+\"\\n\" { // encoder adds newline\n\t\t\tt.Fatalf(\"unexpected body: %s\", body)\n\t\t}\n\t\tfmt.Fprint(w, `{\"id\":99,\"node_id\":\"PVTI_new\"}`)\n\t})\n\n\tctx := t.Context()\n\titem, _, err := client.Projects.AddOrganizationProjectItem(ctx, \"o\", 1, &AddProjectItemOptions{Type: Ptr(ProjectV2ItemContentType(\"Issue\")), ID: Ptr(int64(99))})\n\tif err != nil {\n\t\tt.Fatalf(\"Projects.AddOrganizationProjectItem returned error: %v\", err)\n\t}\n\tif item.GetID() != 99 {\n\t\tt.Fatalf(\"unexpected item: %+v\", item)\n\t}\n}\n\nfunc TestProjectsService_AddProjectItemForOrg_error(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tmux.HandleFunc(\"/orgs/o/projectsV2/1/items\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tw.WriteHeader(http.StatusCreated)\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\tctx := t.Context()\n\tconst methodName = \"AddOrganizationProjectItem\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Projects.AddOrganizationProjectItem(ctx, \"o\", 1, &AddProjectItemOptions{Type: Ptr(ProjectV2ItemContentType(\"Issue\")), ID: Ptr(int64(1))})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestProjectsService_GetOrganizationProjectItem(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tmux.HandleFunc(\"/orgs/o/projectsV2/1/items/17\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":17,\"node_id\":\"PVTI_node\"}`)\n\t})\n\tctx := t.Context()\n\topts := &GetProjectItemOptions{}\n\titem, _, err := client.Projects.GetOrganizationProjectItem(ctx, \"o\", 1, 17, opts)\n\tif err != nil {\n\t\tt.Fatalf(\"GetOrganizationProjectItem error: %v\", err)\n\t}\n\tif item.GetID() != 17 {\n\t\tt.Fatalf(\"unexpected item: %+v\", item)\n\t}\n}\n\nfunc TestProjectsService_GetOrganizationProjectItem_error(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tmux.HandleFunc(\"/orgs/o/projectsV2/1/items/17\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":17}`)\n\t})\n\tctx := t.Context()\n\tconst methodName = \"GetOrganizationProjectItem\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Projects.GetOrganizationProjectItem(ctx, \"o\", 1, 17, &GetProjectItemOptions{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestProjectsService_GetOrganizationProjectItem_WithFieldsOption(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tmux.HandleFunc(\"/orgs/o/projectsV2/1/items/17\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\t// Verify that fields option is properly added as comma-separated URL parameter\n\t\ttestFormValues(t, r, values{\"fields\": \"123,456,789\"})\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\":17,\n\t\t\t\"node_id\":\"PVTI_node_fields\",\n\t\t\t\"fields\":[\n\t\t\t\t{\"id\":123,\"name\":\"Status\",\"data_type\":\"single_select\"},\n\t\t\t\t{\"id\":456,\"name\":\"Priority\",\"data_type\":\"single_select\"},\n\t\t\t\t{\"id\":789,\"name\":\"Assignee\",\"data_type\":\"text\"}\n\t\t\t]\n\t\t}`)\n\t})\n\tctx := t.Context()\n\topts := &GetProjectItemOptions{\n\t\tFields: []int64{123, 456, 789}, // Request specific field IDs\n\t}\n\titem, _, err := client.Projects.GetOrganizationProjectItem(ctx, \"o\", 1, 17, opts)\n\tif err != nil {\n\t\tt.Fatalf(\"GetOrganizationProjectItem error: %v\", err)\n\t}\n\tif item.GetID() != 17 {\n\t\tt.Fatalf(\"unexpected item: %+v\", item)\n\t}\n\tconst methodName = \"GetOrganizationProjectItemWithFields\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Projects.GetOrganizationProjectItem(ctx, \"\\n\", 1, 17, opts)\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Projects.GetOrganizationProjectItem(ctx, \"o\", 1, 17, opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestProjectsService_UpdateOrganizationProjectItem(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tmux.HandleFunc(\"/orgs/o/projectsV2/1/items/17\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tb, _ := io.ReadAll(r.Body)\n\t\tbody := string(b)\n\t\tif body != `{\"archived\":true}`+\"\\n\" {\n\t\t\tt.Fatalf(\"unexpected body: %s\", body)\n\t\t}\n\t\tfmt.Fprint(w, `{\"id\":17}`)\n\t})\n\tarchived := true\n\tctx := t.Context()\n\titem, _, err := client.Projects.UpdateOrganizationProjectItem(ctx, \"o\", 1, 17, &UpdateProjectItemOptions{Archived: &archived})\n\tif err != nil {\n\t\tt.Fatalf(\"UpdateOrganizationProjectItem error: %v\", err)\n\t}\n\tif item.GetID() != 17 {\n\t\tt.Fatalf(\"unexpected item: %+v\", item)\n\t}\n}\n\nfunc TestProjectsService_UpdateOrganizationProjectItem_error(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tmux.HandleFunc(\"/orgs/o/projectsV2/1/items/17\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tfmt.Fprint(w, `{\"id\":17}`)\n\t})\n\tarchived := true\n\tctx := t.Context()\n\tconst methodName = \"UpdateProjectItemForOrg\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Projects.UpdateOrganizationProjectItem(ctx, \"o\", 1, 17, &UpdateProjectItemOptions{Archived: &archived})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestProjectsService_UpdateOrganizationProjectItem_WithFieldUpdates(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tmux.HandleFunc(\"/orgs/o/projectsV2/1/items/17\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tb, _ := io.ReadAll(r.Body)\n\t\tbody := string(b)\n\t\t// Verify the field updates are properly formatted in the request body\n\t\texpectedBody := `{\"fields\":[{\"id\":123,\"value\":\"Updated text value\"},{\"id\":456,\"value\":\"Done\"}]}`\n\t\tif body != expectedBody+\"\\n\" {\n\t\t\tt.Fatalf(\"unexpected body: %s, expected: %s\", body, expectedBody)\n\t\t}\n\t\tfmt.Fprint(w, `{\"id\":17,\"node_id\":\"PVTI_node_updated\"}`)\n\t})\n\n\tctx := t.Context()\n\topts := &UpdateProjectItemOptions{\n\t\tFields: []*UpdateProjectV2Field{\n\t\t\t{ID: 123, Value: \"Updated text value\"},\n\t\t\t{ID: 456, Value: \"Done\"},\n\t\t},\n\t}\n\titem, _, err := client.Projects.UpdateOrganizationProjectItem(ctx, \"o\", 1, 17, opts)\n\tif err != nil {\n\t\tt.Fatalf(\"UpdateOrganizationProjectItem error: %v\", err)\n\t}\n\tif item.GetID() != 17 {\n\t\tt.Fatalf(\"unexpected item: %+v\", item)\n\t}\n\n\tconst methodName = \"UpdateOrganizationProjectItemWithFields\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Projects.UpdateOrganizationProjectItem(ctx, \"\\n\", 1, 17, opts)\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Projects.UpdateOrganizationProjectItem(ctx, \"o\", 1, 17, opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestProjectsService_DeleteOrganizationProjectItem(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tmux.HandleFunc(\"/orgs/o/projectsV2/1/items/17\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\tctx := t.Context()\n\tif _, err := client.Projects.DeleteOrganizationProjectItem(ctx, \"o\", 1, 17); err != nil {\n\t\tt.Fatalf(\"DeleteOrganizationProjectItem error: %v\", err)\n\t}\n}\n\nfunc TestProjectsService_DeleteOrganizationProjectItem_error(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tmux.HandleFunc(\"/orgs/o/projectsV2/1/items/17\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\tctx := t.Context()\n\tconst methodName = \"DeleteOrganizationProjectItem\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Projects.DeleteOrganizationProjectItem(ctx, \"o\", 1, 17)\n\t})\n}\n\nfunc TestProjectsService_ListUserProjectItems(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tmux.HandleFunc(\"/users/u/projectsV2/2/items\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"20\", \"q\": \"type:issue\"})\n\t\tfmt.Fprint(w, `[{\"id\":7,\"node_id\":\"PVTI_user\"}]`)\n\t})\n\tctx := t.Context()\n\titems, _, err := client.Projects.ListUserProjectItems(ctx, \"u\", 2, &ListProjectItemsOptions{ListProjectsOptions: ListProjectsOptions{ListProjectsPaginationOptions: ListProjectsPaginationOptions{PerPage: (20)}, Query: (\"type:issue\")}})\n\tif err != nil {\n\t\tt.Fatalf(\"ListUserProjectItems error: %v\", err)\n\t}\n\tif len(items) != 1 || items[0].GetID() != 7 {\n\t\tt.Fatalf(\"unexpected items: %+v\", items)\n\t}\n}\n\nfunc TestProjectsService_ListUserProjectItems_error(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tmux.HandleFunc(\"/users/u/projectsV2/2/items\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[]`)\n\t})\n\tctx := t.Context()\n\tconst methodName = \"ListUserProjectItems\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Projects.ListUserProjectItems(ctx, \"u\", 2, nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Projects.ListUserProjectItems(ctx, \"\\n\", 2, nil)\n\t\treturn err\n\t})\n}\n\nfunc TestProjectsService_AddUserProjectItem(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tmux.HandleFunc(\"/users/u/projectsV2/2/items\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tb, _ := io.ReadAll(r.Body)\n\t\tbody := string(b)\n\t\tif body != `{\"type\":\"PullRequest\",\"id\":123}`+\"\\n\" {\n\t\t\tt.Fatalf(\"unexpected body: %s\", body)\n\t\t}\n\t\tfmt.Fprint(w, `{\"id\":123,\"node_id\":\"PVTI_new_user\"}`)\n\t})\n\tctx := t.Context()\n\titem, _, err := client.Projects.AddUserProjectItem(ctx, \"u\", 2, &AddProjectItemOptions{Type: Ptr(ProjectV2ItemContentType(\"PullRequest\")), ID: Ptr(int64(123))})\n\tif err != nil {\n\t\tt.Fatalf(\"AddUserProjectItem error: %v\", err)\n\t}\n\tif item.GetID() != 123 {\n\t\tt.Fatalf(\"unexpected item: %+v\", item)\n\t}\n}\n\nfunc TestProjectsService_AddUserProjectItem_error(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tmux.HandleFunc(\"/users/u/projectsV2/2/items\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\"id\":5}`)\n\t})\n\tctx := t.Context()\n\tconst methodName = \"AddUserProjectItem\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Projects.AddUserProjectItem(ctx, \"u\", 2, &AddProjectItemOptions{Type: Ptr(ProjectV2ItemContentType(\"Issue\")), ID: Ptr(int64(5))})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestProjectsService_GetUserProjectItem(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tmux.HandleFunc(\"/users/u/projectsV2/2/items/55\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":55,\"node_id\":\"PVTI_user_item\"}`)\n\t})\n\tctx := t.Context()\n\topts := &GetProjectItemOptions{}\n\titem, _, err := client.Projects.GetUserProjectItem(ctx, \"u\", 2, 55, opts)\n\tif err != nil {\n\t\tt.Fatalf(\"GetUserProjectItem error: %v\", err)\n\t}\n\tif item.GetID() != 55 {\n\t\tt.Fatalf(\"unexpected item: %+v\", item)\n\t}\n}\n\nfunc TestProjectsService_GetUserProjectItem_error(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tmux.HandleFunc(\"/users/u/projectsV2/2/items/55\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":55}`)\n\t})\n\tctx := t.Context()\n\tconst methodName = \"GetUserProjectItem\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Projects.GetUserProjectItem(ctx, \"u\", 2, 55, &GetProjectItemOptions{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestProjectsService_GetUserProjectItem_WithFieldsOption(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tmux.HandleFunc(\"/users/u/projectsV2/2/items/55\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\t// Verify that fields option is properly added as comma-separated URL parameter\n\t\ttestFormValues(t, r, values{\"fields\": \"100,200\"})\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\":55,\n\t\t\t\"node_id\":\"PVTI_user_item_fields\",\n\t\t\t\"fields\":[\n\t\t\t\t{\"id\":100,\"name\":\"Status\",\"data_type\":\"single_select\"},\n\t\t\t\t{\"id\":200,\"name\":\"Milestone\",\"data_type\":\"text\"}\n\t\t\t]\n\t\t}`)\n\t})\n\tctx := t.Context()\n\topts := &GetProjectItemOptions{\n\t\tFields: []int64{100, 200}, // Request specific field IDs\n\t}\n\titem, _, err := client.Projects.GetUserProjectItem(ctx, \"u\", 2, 55, opts)\n\tif err != nil {\n\t\tt.Fatalf(\"GetUserProjectItem error: %v\", err)\n\t}\n\tif item.GetID() != 55 {\n\t\tt.Fatalf(\"unexpected item: %+v\", item)\n\t}\n\n\tconst methodName = \"GetUserProjectItemWithFields\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Projects.GetUserProjectItem(ctx, \"\\n\", 2, 55, opts)\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Projects.GetUserProjectItem(ctx, \"u\", 2, 55, opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestProjectsService_UpdateUserProjectItem(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tmux.HandleFunc(\"/users/u/projectsV2/2/items/55\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tb, _ := io.ReadAll(r.Body)\n\t\tbody := string(b)\n\t\tif body != `{\"archived\":false}`+\"\\n\" {\n\t\t\tt.Fatalf(\"unexpected body: %s\", body)\n\t\t}\n\t\tfmt.Fprint(w, `{\"id\":55}`)\n\t})\n\tarchived := false\n\tctx := t.Context()\n\titem, _, err := client.Projects.UpdateUserProjectItem(ctx, \"u\", 2, 55, &UpdateProjectItemOptions{Archived: &archived})\n\tif err != nil {\n\t\tt.Fatalf(\"UpdateUserProjectItem error: %v\", err)\n\t}\n\tif item.GetID() != 55 {\n\t\tt.Fatalf(\"unexpected item: %+v\", item)\n\t}\n}\n\nfunc TestProjectsService_UpdateUserProjectItem_error(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tmux.HandleFunc(\"/users/u/projectsV2/2/items/55\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tfmt.Fprint(w, `{\"id\":55}`)\n\t})\n\tarchived := false\n\tctx := t.Context()\n\tconst methodName = \"UpdateUserProjectItem\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Projects.UpdateUserProjectItem(ctx, \"u\", 2, 55, &UpdateProjectItemOptions{Archived: &archived})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestProjectsService_UpdateUserProjectItem_WithFieldUpdates(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tmux.HandleFunc(\"/users/u/projectsV2/2/items/55\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tb, _ := io.ReadAll(r.Body)\n\t\tbody := string(b)\n\t\t// Verify the field updates are properly formatted in the request body\n\t\texpectedBody := `{\"fields\":[{\"id\":100,\"value\":\"In Progress\"},{\"id\":200,\"value\":5}]}`\n\t\tif body != expectedBody+\"\\n\" {\n\t\t\tt.Fatalf(\"unexpected body: %s, expected: %s\", body, expectedBody)\n\t\t}\n\t\tfmt.Fprint(w, `{\"id\":55,\"node_id\":\"PVTI_user_updated\"}`)\n\t})\n\n\tctx := t.Context()\n\topts := &UpdateProjectItemOptions{\n\t\tFields: []*UpdateProjectV2Field{\n\t\t\t{ID: 100, Value: \"In Progress\"},\n\t\t\t{ID: 200, Value: 5}, // number field\n\t\t},\n\t}\n\titem, _, err := client.Projects.UpdateUserProjectItem(ctx, \"u\", 2, 55, opts)\n\tif err != nil {\n\t\tt.Fatalf(\"UpdateUserProjectItem error: %v\", err)\n\t}\n\tif item.GetID() != 55 {\n\t\tt.Fatalf(\"unexpected item: %+v\", item)\n\t}\n\n\tconst methodName = \"UpdateUserProjectItemWithFields\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Projects.UpdateUserProjectItem(ctx, \"\\n\", 2, 55, opts)\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Projects.UpdateUserProjectItem(ctx, \"u\", 2, 55, opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestProjectsService_DeleteUserProjectItem(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tmux.HandleFunc(\"/users/u/projectsV2/2/items/55\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\tctx := t.Context()\n\tif _, err := client.Projects.DeleteUserProjectItem(ctx, \"u\", 2, 55); err != nil {\n\t\tt.Fatalf(\"DeleteUserProjectItem error: %v\", err)\n\t}\n}\n\nfunc TestProjectsService_DeleteUserProjectItem_error(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\tmux.HandleFunc(\"/users/u/projectsV2/2/items/55\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\tctx := t.Context()\n\tconst methodName = \"DeleteUserProjectItem\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Projects.DeleteUserProjectItem(ctx, \"u\", 2, 55)\n\t})\n}\n\nfunc TestProjectV2Item_UnmarshalJSON_Issue(t *testing.T) {\n\tt.Parallel()\n\n\t// Test unmarshaling an issue\n\tjsonData := `{\n\t\t\"id\": 123,\n\t\t\"node_id\": \"PVTI_test\",\n\t\t\"content_type\": \"Issue\",\n\t\t\"content\": {\n\t\t\t\"id\": 456,\n\t\t\t\"number\": 10,\n\t\t\t\"title\": \"Test Issue\",\n\t\t\t\"state\": \"open\",\n\t\t\t\"body\": \"Issue body\",\n\t\t\t\"repository\": {\n\t\t\t\t\"id\": 789,\n\t\t\t\t\"name\": \"test-repo\"\n\t\t\t}\n\t\t},\n\t\t\"created_at\": \"2023-01-01T00:00:00Z\"\n\t}`\n\n\tvar item ProjectV2Item\n\tif err := json.Unmarshal([]byte(jsonData), &item); err != nil {\n\t\tt.Fatalf(\"json.Unmarshal failed: %v\", err)\n\t}\n\n\t// Verify basic fields\n\tif item.GetID() != 123 {\n\t\tt.Errorf(\"ID = %v, want 123\", item.GetID())\n\t}\n\tif item.GetNodeID() != \"PVTI_test\" {\n\t\tt.Errorf(\"NodeID = %v, want PVTI_test\", item.GetNodeID())\n\t}\n\tif item.ContentType == nil || *item.ContentType != ProjectV2ItemContentTypeIssue {\n\t\tt.Errorf(\"ContentType = %v, want Issue\", item.ContentType)\n\t}\n\n\t// Verify content is unmarshaled as Issue\n\tif item.Content == nil {\n\t\tt.Fatal(\"Content is nil\")\n\t}\n\tif item.GetContent().GetIssue() == nil {\n\t\tt.Fatal(\"Content.Issue is nil\")\n\t}\n\tif item.GetContent().GetIssue().GetNumber() != 10 {\n\t\tt.Errorf(\"Issue.Number = %v, want 10\", item.GetContent().GetIssue().GetNumber())\n\t}\n\tif item.GetContent().GetIssue().GetTitle() != \"Test Issue\" {\n\t\tt.Errorf(\"Issue.Title = %v, want Test Issue\", item.GetContent().GetIssue().GetTitle())\n\t}\n\tif item.GetContent().GetIssue().GetState() != \"open\" {\n\t\tt.Errorf(\"Issue.State = %v, want open\", item.GetContent().GetIssue().GetState())\n\t}\n\n\t// Verify other content types are nil\n\tif item.GetContent().GetPullRequest() != nil {\n\t\tt.Error(\"Content.PullRequest should be nil for Issue content\")\n\t}\n\tif item.GetContent().GetDraftIssue() != nil {\n\t\tt.Error(\"Content.DraftIssue should be nil for Issue content\")\n\t}\n}\n\nfunc TestProjectV2Item_UnmarshalJSON_PullRequest(t *testing.T) {\n\tt.Parallel()\n\n\t// Test unmarshaling a pull request\n\tjsonData := `{\n\t\t\"id\": 124,\n\t\t\"node_id\": \"PVTI_pr\",\n\t\t\"content_type\": \"PullRequest\",\n\t\t\"content\": {\n\t\t\t\"id\": 457,\n\t\t\t\"number\": 20,\n\t\t\t\"title\": \"Test PR\",\n\t\t\t\"state\": \"closed\",\n\t\t\t\"merged\": true,\n\t\t\t\"merge_commit_sha\": \"abc123\",\n\t\t\t\"head\": {\n\t\t\t\t\"ref\": \"feature-branch\",\n\t\t\t\t\"sha\": \"def456\"\n\t\t\t},\n\t\t\t\"base\": {\n\t\t\t\t\"ref\": \"main\",\n\t\t\t\t\"sha\": \"ghi789\"\n\t\t\t}\n\t\t},\n\t\t\"created_at\": \"2023-01-02T00:00:00Z\"\n\t}`\n\n\tvar item ProjectV2Item\n\tif err := json.Unmarshal([]byte(jsonData), &item); err != nil {\n\t\tt.Fatalf(\"json.Unmarshal failed: %v\", err)\n\t}\n\n\t// Verify basic fields\n\tif item.GetID() != 124 {\n\t\tt.Errorf(\"ID = %v, want 124\", item.GetID())\n\t}\n\tif item.ContentType == nil || *item.ContentType != ProjectV2ItemContentTypePullRequest {\n\t\tt.Errorf(\"ContentType = %v, want PullRequest\", item.ContentType)\n\t}\n\n\t// Verify content is unmarshaled as PullRequest\n\tif item.Content == nil {\n\t\tt.Fatal(\"Content is nil\")\n\t}\n\tif item.GetContent().GetPullRequest() == nil {\n\t\tt.Fatal(\"Content.PullRequest is nil\")\n\t}\n\tif item.GetContent().GetPullRequest().GetNumber() != 20 {\n\t\tt.Errorf(\"PullRequest.Number = %v, want 20\", item.GetContent().GetPullRequest().GetNumber())\n\t}\n\tif item.GetContent().GetPullRequest().GetTitle() != \"Test PR\" {\n\t\tt.Errorf(\"PullRequest.Title = %v, want Test PR\", item.GetContent().GetPullRequest().GetTitle())\n\t}\n\tif !item.GetContent().GetPullRequest().GetMerged() {\n\t\tt.Errorf(\"PullRequest.Merged = %t, want true\", item.GetContent().GetPullRequest().GetMerged())\n\t}\n\tif item.GetContent().GetPullRequest().GetMergeCommitSHA() != \"abc123\" {\n\t\tt.Errorf(\"PullRequest.MergeCommitSHA = %v, want abc123\", item.GetContent().GetPullRequest().GetMergeCommitSHA())\n\t}\n\n\t// Verify other content types are nil\n\tif item.GetContent().GetIssue() != nil {\n\t\tt.Error(\"Content.Issue should be nil for PullRequest content\")\n\t}\n\tif item.GetContent().GetDraftIssue() != nil {\n\t\tt.Error(\"Content.DraftIssue should be nil for PullRequest content\")\n\t}\n}\n\nfunc TestProjectV2Item_UnmarshalJSON_DraftIssue(t *testing.T) {\n\tt.Parallel()\n\n\t// Test unmarshaling a draft issue\n\tjsonData := `{\n\t\t\"id\": 125,\n\t\t\"node_id\": \"PVTI_draft\",\n\t\t\"content_type\": \"DraftIssue\",\n\t\t\"content\": {\n\t\t\t\"id\": 458,\n\t\t\t\"node_id\": \"DI_test\",\n\t\t\t\"title\": \"Draft Issue Title\",\n\t\t\t\"body\": \"Draft issue body content\"\n\t\t},\n\t\t\"created_at\": \"2023-01-03T00:00:00Z\"\n\t}`\n\n\tvar item ProjectV2Item\n\tif err := json.Unmarshal([]byte(jsonData), &item); err != nil {\n\t\tt.Fatalf(\"json.Unmarshal failed: %v\", err)\n\t}\n\n\t// Verify basic fields\n\tif item.GetID() != 125 {\n\t\tt.Errorf(\"ID = %v, want 125\", item.GetID())\n\t}\n\tif item.ContentType == nil || *item.ContentType != ProjectV2ItemContentTypeDraftIssue {\n\t\tt.Errorf(\"ContentType = %v, want DraftIssue\", item.ContentType)\n\t}\n\n\t// Verify content is unmarshaled as DraftIssue\n\tif item.Content == nil {\n\t\tt.Fatal(\"Content is nil\")\n\t}\n\tif item.GetContent().GetDraftIssue() == nil {\n\t\tt.Fatal(\"Content.DraftIssue is nil\")\n\t}\n\tif item.GetContent().GetDraftIssue().GetID() != 458 {\n\t\tt.Errorf(\"DraftIssue.ID = %v, want 458\", item.GetContent().GetDraftIssue().GetID())\n\t}\n\tif item.GetContent().GetDraftIssue().GetTitle() != \"Draft Issue Title\" {\n\t\tt.Errorf(\"DraftIssue.Title = %v, want Draft Issue Title\", item.GetContent().GetDraftIssue().GetTitle())\n\t}\n\tif item.GetContent().GetDraftIssue().GetBody() != \"Draft issue body content\" {\n\t\tt.Errorf(\"DraftIssue.Body = %v, want Draft issue body content\", item.GetContent().GetDraftIssue().GetBody())\n\t}\n\n\t// Verify other content types are nil\n\tif item.GetContent().GetIssue() != nil {\n\t\tt.Error(\"Content.Issue should be nil for DraftIssue content\")\n\t}\n\tif item.GetContent().GetPullRequest() != nil {\n\t\tt.Error(\"Content.PullRequest should be nil for DraftIssue content\")\n\t}\n}\n\nfunc TestProjectV2Item_UnmarshalJSON_NullContent(t *testing.T) {\n\tt.Parallel()\n\n\t// Test with null content\n\tjsonData := `{\n\t\t\"id\": 126,\n\t\t\"node_id\": \"PVTI_null\",\n\t\t\"content_type\": \"Issue\",\n\t\t\"content\": null\n\t}`\n\n\tvar item ProjectV2Item\n\tif err := json.Unmarshal([]byte(jsonData), &item); err != nil {\n\t\tt.Fatalf(\"json.Unmarshal failed: %v\", err)\n\t}\n\n\t// Content should be nil\n\tif item.Content != nil {\n\t\tt.Error(\"Content should be nil when content is null in JSON\")\n\t}\n}\n\nfunc TestProjectV2Item_UnmarshalJSON_MissingContentType(t *testing.T) {\n\tt.Parallel()\n\n\t// Test without content_type field\n\tjsonData := `{\n\t\t\"id\": 127,\n\t\t\"node_id\": \"PVTI_no_type\",\n\t\t\"content\": {\n\t\t\t\"id\": 459,\n\t\t\t\"title\": \"Some content\"\n\t\t}\n\t}`\n\n\tvar item ProjectV2Item\n\tif err := json.Unmarshal([]byte(jsonData), &item); err != nil {\n\t\tt.Fatalf(\"json.Unmarshal failed: %v\", err)\n\t}\n\n\t// Should handle missing ContentType gracefully - content should be nil\n\t// since we can't determine the type\n\tif item.Content != nil {\n\t\tt.Error(\"Content should be nil when ContentType is missing\")\n\t}\n}\n\nfunc TestProjectV2Item_UnmarshalJSON_EmptyJSON(t *testing.T) {\n\tt.Parallel()\n\n\t// Test with null JSON\n\tvar item ProjectV2Item\n\tif err := json.Unmarshal([]byte(\"null\"), &item); err != nil {\n\t\tt.Fatalf(\"json.Unmarshal failed with null: %v\", err)\n\t}\n\n\t// Verify item is in zero state after unmarshaling null\n\tif item.Content != nil {\n\t\tt.Error(\"Content should be nil after unmarshaling null\")\n\t}\n}\n\nfunc TestProjectV2Item_UnmarshalJSON_InvalidJSON(t *testing.T) {\n\tt.Parallel()\n\n\t// Test with invalid JSON\n\tvar item ProjectV2Item\n\tif err := json.Unmarshal([]byte(\"~~~\"), &item); err == nil {\n\t\tt.Error(\"expected error for invalid JSON, got nil\")\n\t}\n}\n\nfunc TestProjectV2Item_Marshal_Issue(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ProjectV2Item{}, \"{}\")\n\n\titem := &ProjectV2Item{\n\t\tContentType: Ptr(ProjectV2ItemContentTypeIssue),\n\t\tContent: &ProjectV2ItemContent{\n\t\t\tIssue: &Issue{\n\t\t\t\tNumber: Ptr(42),\n\t\t\t\tTitle:  Ptr(\"Bug report\"),\n\t\t\t\tState:  Ptr(\"open\"),\n\t\t\t},\n\t\t},\n\t\tID: Ptr(int64(123)),\n\t}\n\n\twant := `{\n\t\t\"content_type\":\"Issue\",\n\t\t\"content\":{\n\t\t\t\"number\":42,\n\t\t\t\"state\":\"open\",\n\t\t\t\"title\":\"Bug report\"\n\t\t},\n\t\t\"id\":123\n\t}`\n\n\ttestJSONMarshal(t, item, want)\n}\n\nfunc TestProjectV2Item_Marshal_PullRequest(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ProjectV2Item{}, \"{}\")\n\n\titem := &ProjectV2Item{\n\t\tContentType: Ptr(ProjectV2ItemContentTypePullRequest),\n\t\tContent: &ProjectV2ItemContent{\n\t\t\tPullRequest: &PullRequest{\n\t\t\t\tNumber: Ptr(99),\n\t\t\t\tTitle:  Ptr(\"Feature addition\"),\n\t\t\t\tState:  Ptr(\"closed\"),\n\t\t\t},\n\t\t},\n\t\tID: Ptr(int64(456)),\n\t}\n\n\twant := `{\n\t\t\"content_type\":\"PullRequest\",\n\t\t\"content\":{\n\t\t\t\"number\":99,\n\t\t\t\"state\":\"closed\",\n\t\t\t\"title\":\"Feature addition\"\n\t\t},\n\t\t\"id\":456\n\t}`\n\n\ttestJSONMarshal(t, item, want)\n}\n\nfunc TestProjectV2Item_Marshal_DraftIssue(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ProjectV2Item{}, \"{}\")\n\n\titem := &ProjectV2Item{\n\t\tContentType: Ptr(ProjectV2ItemContentTypeDraftIssue),\n\t\tContent: &ProjectV2ItemContent{\n\t\t\tDraftIssue: &ProjectV2DraftIssue{\n\t\t\t\tTitle: Ptr(\"Draft task\"),\n\t\t\t\tBody:  Ptr(\"Work in progress\"),\n\t\t\t},\n\t\t},\n\t\tID: Ptr(int64(789)),\n\t}\n\n\twant := `{\n\t\t\"content_type\":\"DraftIssue\",\n\t\t\"content\":{\n\t\t\t\"body\":\"Work in progress\",\n\t\t\t\"title\":\"Draft task\"\n\t\t},\n\t\t\"id\":789\n\t}`\n\n\ttestJSONMarshal(t, item, want)\n}\n\nfunc TestProjectV2Item_Marshal_MissingContent(t *testing.T) {\n\tt.Parallel()\n\n\titem := &ProjectV2Item{\n\t\tContentType: Ptr(ProjectV2ItemContentTypeIssue),\n\t\tContent:     nil,\n\t\tID:          Ptr(int64(789)),\n\t}\n\n\twant := `{\n\t\t\"content_type\":\"Issue\",\n\t\t\"id\":789\n\t}`\n\n\ttestJSONMarshal(t, item, want)\n}\n"
  },
  {
    "path": "github/pulls.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n)\n\n// PullRequestsService handles communication with the pull request related\n// methods of the GitHub API.\n//\n// GitHub API docs: https://docs.github.com/rest/pulls/\ntype PullRequestsService service\n\n// PullRequestAutoMerge represents the \"auto_merge\" response for a PullRequest.\ntype PullRequestAutoMerge struct {\n\tEnabledBy     *User   `json:\"enabled_by,omitempty\"`\n\tMergeMethod   *string `json:\"merge_method,omitempty\"`\n\tCommitTitle   *string `json:\"commit_title,omitempty\"`\n\tCommitMessage *string `json:\"commit_message,omitempty\"`\n}\n\n// PullRequest represents a GitHub pull request on a repository.\ntype PullRequest struct {\n\tID                *int64     `json:\"id,omitempty\"`\n\tNumber            *int       `json:\"number,omitempty\"`\n\tState             *string    `json:\"state,omitempty\"`\n\tLocked            *bool      `json:\"locked,omitempty\"`\n\tTitle             *string    `json:\"title,omitempty\"`\n\tBody              *string    `json:\"body,omitempty\"`\n\tCreatedAt         *Timestamp `json:\"created_at,omitempty\"`\n\tUpdatedAt         *Timestamp `json:\"updated_at,omitempty\"`\n\tClosedAt          *Timestamp `json:\"closed_at,omitempty\"`\n\tMergedAt          *Timestamp `json:\"merged_at,omitempty\"`\n\tLabels            []*Label   `json:\"labels,omitempty\"`\n\tUser              *User      `json:\"user,omitempty\"`\n\tDraft             *bool      `json:\"draft,omitempty\"`\n\tURL               *string    `json:\"url,omitempty\"`\n\tHTMLURL           *string    `json:\"html_url,omitempty\"`\n\tIssueURL          *string    `json:\"issue_url,omitempty\"`\n\tStatusesURL       *string    `json:\"statuses_url,omitempty\"`\n\tDiffURL           *string    `json:\"diff_url,omitempty\"`\n\tPatchURL          *string    `json:\"patch_url,omitempty\"`\n\tCommitsURL        *string    `json:\"commits_url,omitempty\"`\n\tCommentsURL       *string    `json:\"comments_url,omitempty\"`\n\tReviewCommentsURL *string    `json:\"review_comments_url,omitempty\"`\n\tReviewCommentURL  *string    `json:\"review_comment_url,omitempty\"`\n\tAssignee          *User      `json:\"assignee,omitempty\"`\n\tAssignees         []*User    `json:\"assignees,omitempty\"`\n\tMilestone         *Milestone `json:\"milestone,omitempty\"`\n\t// AuthorAssociation is the pull request author's relationship to the repository.\n\t// Possible values are \"COLLABORATOR\", \"CONTRIBUTOR\", \"FIRST_TIMER\", \"FIRST_TIME_CONTRIBUTOR\", \"MEMBER\", \"OWNER\", or \"NONE\".\n\t//\n\t// Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025.\n\t// Use the Pull Requests REST API endpoint to retrieve this information.\n\t// See: https://docs.github.com/rest/pulls/pulls#get-a-pull-request\n\tAuthorAssociation  *string               `json:\"author_association,omitempty\"`\n\tNodeID             *string               `json:\"node_id,omitempty\"`\n\tRequestedReviewers []*User               `json:\"requested_reviewers,omitempty\"`\n\tAutoMerge          *PullRequestAutoMerge `json:\"auto_merge,omitempty\"`\n\n\t// These fields are not populated by the List operation.\n\tMerged              *bool   `json:\"merged,omitempty\"`\n\tMergeable           *bool   `json:\"mergeable,omitempty\"`\n\tMergeableState      *string `json:\"mergeable_state,omitempty\"`\n\tRebaseable          *bool   `json:\"rebaseable,omitempty\"`\n\tMergedBy            *User   `json:\"merged_by,omitempty\"`\n\tMergeCommitSHA      *string `json:\"merge_commit_sha,omitempty\"`\n\tComments            *int    `json:\"comments,omitempty\"`\n\tCommits             *int    `json:\"commits,omitempty\"`\n\tAdditions           *int    `json:\"additions,omitempty\"`\n\tDeletions           *int    `json:\"deletions,omitempty\"`\n\tChangedFiles        *int    `json:\"changed_files,omitempty\"`\n\tMaintainerCanModify *bool   `json:\"maintainer_can_modify,omitempty\"`\n\tReviewComments      *int    `json:\"review_comments,omitempty\"`\n\n\t// RequestedTeams is populated as part of the PullRequestEvent.\n\t// See, https://docs.github.com/developers/webhooks-and-events/github-event-types#pullrequestevent for an example.\n\tRequestedTeams []*Team `json:\"requested_teams,omitempty\"`\n\n\tLinks *PRLinks           `json:\"_links,omitempty\"`\n\tHead  *PullRequestBranch `json:\"head,omitempty\"`\n\tBase  *PullRequestBranch `json:\"base,omitempty\"`\n\n\t// ActiveLockReason is populated only when LockReason is provided while locking the pull request.\n\t// Possible values are: \"off-topic\", \"too heated\", \"resolved\", and \"spam\".\n\tActiveLockReason *string `json:\"active_lock_reason,omitempty\"`\n}\n\nfunc (p PullRequest) String() string {\n\treturn Stringify(p)\n}\n\n// PRLink represents a single link object from GitHub pull request _links.\ntype PRLink struct {\n\tHRef *string `json:\"href,omitempty\"`\n}\n\n// PRLinks represents the \"_links\" object in a GitHub pull request.\ntype PRLinks struct {\n\tSelf           *PRLink `json:\"self,omitempty\"`\n\tHTML           *PRLink `json:\"html,omitempty\"`\n\tIssue          *PRLink `json:\"issue,omitempty\"`\n\tComments       *PRLink `json:\"comments,omitempty\"`\n\tReviewComments *PRLink `json:\"review_comments,omitempty\"`\n\tReviewComment  *PRLink `json:\"review_comment,omitempty\"`\n\tCommits        *PRLink `json:\"commits,omitempty\"`\n\tStatuses       *PRLink `json:\"statuses,omitempty\"`\n}\n\n// PullRequestBranch represents a base or head branch in a GitHub pull request.\ntype PullRequestBranch struct {\n\tLabel *string     `json:\"label,omitempty\"`\n\tRef   *string     `json:\"ref,omitempty\"`\n\tSHA   *string     `json:\"sha,omitempty\"`\n\tRepo  *Repository `json:\"repo,omitempty\"`\n\tUser  *User       `json:\"user,omitempty\"`\n}\n\n// PullRequestListOptions specifies the optional parameters to the\n// PullRequestsService.List method.\ntype PullRequestListOptions struct {\n\t// State filters pull requests based on their state. Possible values are:\n\t// open, closed, all. Default is \"open\".\n\tState string `url:\"state,omitempty\"`\n\n\t// Head filters pull requests by head user and branch name in the format of:\n\t// \"user:ref-name\".\n\tHead string `url:\"head,omitempty\"`\n\n\t// Base filters pull requests by base branch name.\n\tBase string `url:\"base,omitempty\"`\n\n\t// Sort specifies how to sort pull requests. Possible values are: created,\n\t// updated, popularity, long-running. Default is \"created\".\n\tSort string `url:\"sort,omitempty\"`\n\n\t// Direction in which to sort pull requests. Possible values are: asc, desc.\n\t// If Sort is \"created\" or not specified, Default is \"desc\"; otherwise, Default\n\t// is \"asc\"\n\tDirection string `url:\"direction,omitempty\"`\n\n\tListOptions\n}\n\n// List the pull requests for the specified repository.\n//\n// GitHub API docs: https://docs.github.com/rest/pulls/pulls#list-pull-requests\n//\n//meta:operation GET /repos/{owner}/{repo}/pulls\nfunc (s *PullRequestsService) List(ctx context.Context, owner, repo string, opts *PullRequestListOptions) ([]*PullRequest, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pulls\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar pulls []*PullRequest\n\tresp, err := s.client.Do(ctx, req, &pulls)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn pulls, resp, nil\n}\n\n// ListPullRequestsWithCommit returns pull requests associated with a commit SHA\n// or branch name.\n//\n// The results may include open and closed pull requests. If the commit SHA is\n// not present in the repository's default branch, the result will only include\n// open pull requests.\n//\n// GitHub API docs: https://docs.github.com/rest/commits/commits#list-pull-requests-associated-with-a-commit\n//\n//meta:operation GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls\nfunc (s *PullRequestsService) ListPullRequestsWithCommit(ctx context.Context, owner, repo, sha string, opts *ListOptions) ([]*PullRequest, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/commits/%v/pulls\", owner, repo, sha)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeListPullsOrBranchesForCommitPreview)\n\tvar pulls []*PullRequest\n\tresp, err := s.client.Do(ctx, req, &pulls)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn pulls, resp, nil\n}\n\n// Get a single pull request.\n//\n// GitHub API docs: https://docs.github.com/rest/pulls/pulls#get-a-pull-request\n//\n//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}\nfunc (s *PullRequestsService) Get(ctx context.Context, owner, repo string, number int) (*PullRequest, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pulls/%v\", owner, repo, number)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar pull *PullRequest\n\tresp, err := s.client.Do(ctx, req, &pull)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn pull, resp, nil\n}\n\n// GetRaw gets a single pull request in raw (diff or patch) format.\n//\n// GitHub API docs: https://docs.github.com/rest/pulls/pulls#get-a-pull-request\n//\n//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}\nfunc (s *PullRequestsService) GetRaw(ctx context.Context, owner, repo string, number int, opts RawOptions) (string, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pulls/%v\", owner, repo, number)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn \"\", nil, err\n\t}\n\n\tswitch opts.Type {\n\tcase Diff:\n\t\treq.Header.Set(\"Accept\", mediaTypeV3Diff)\n\tcase Patch:\n\t\treq.Header.Set(\"Accept\", mediaTypeV3Patch)\n\tdefault:\n\t\treturn \"\", nil, fmt.Errorf(\"unsupported raw type %v\", opts.Type)\n\t}\n\n\tvar buf bytes.Buffer\n\tresp, err := s.client.Do(ctx, req, &buf)\n\tif err != nil {\n\t\treturn \"\", resp, err\n\t}\n\n\treturn buf.String(), resp, nil\n}\n\n// NewPullRequest represents a new pull request to be created.\ntype NewPullRequest struct {\n\tTitle *string `json:\"title,omitempty\"`\n\t// The name of the branch where your changes are implemented. For\n\t// cross-repository pull requests in the same network, namespace head with\n\t// a user like this: username:branch.\n\tHead     *string `json:\"head,omitempty\"`\n\tHeadRepo *string `json:\"head_repo,omitempty\"`\n\t// The name of the branch you want the changes pulled into. This should be\n\t// an existing branch on the current repository. You cannot submit a pull\n\t// request to one repository that requests a merge to a base of another\n\t// repository.\n\tBase                *string `json:\"base,omitempty\"`\n\tBody                *string `json:\"body,omitempty\"`\n\tIssue               *int    `json:\"issue,omitempty\"`\n\tMaintainerCanModify *bool   `json:\"maintainer_can_modify,omitempty\"`\n\tDraft               *bool   `json:\"draft,omitempty\"`\n}\n\n// Create a new pull request on the specified repository.\n//\n// GitHub API docs: https://docs.github.com/rest/pulls/pulls#create-a-pull-request\n//\n//meta:operation POST /repos/{owner}/{repo}/pulls\nfunc (s *PullRequestsService) Create(ctx context.Context, owner, repo string, pull *NewPullRequest) (*PullRequest, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pulls\", owner, repo)\n\treq, err := s.client.NewRequest(\"POST\", u, pull)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar p *PullRequest\n\tresp, err := s.client.Do(ctx, req, &p)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn p, resp, nil\n}\n\n// PullRequestBranchUpdateOptions specifies the optional parameters to the\n// PullRequestsService.UpdateBranch method.\ntype PullRequestBranchUpdateOptions struct {\n\t// ExpectedHeadSHA specifies the most recent commit on the pull request's branch.\n\t// Default value is the SHA of the pull request's current HEAD ref.\n\tExpectedHeadSHA *string `json:\"expected_head_sha,omitempty\"`\n}\n\n// PullRequestBranchUpdateResponse specifies the response of pull request branch update.\ntype PullRequestBranchUpdateResponse struct {\n\tMessage *string `json:\"message,omitempty\"`\n\tURL     *string `json:\"url,omitempty\"`\n}\n\n// UpdateBranch updates the pull request branch with latest upstream changes.\n//\n// This method might return an AcceptedError and a status code of\n// 202. This is because this is the status that GitHub returns to signify that\n// it has now scheduled the update of the pull request branch in a background task.\n// A follow up request, after a delay of a second or so, should result\n// in a successful request.\n//\n// GitHub API docs: https://docs.github.com/rest/pulls/pulls#update-a-pull-request-branch\n//\n//meta:operation PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch\nfunc (s *PullRequestsService) UpdateBranch(ctx context.Context, owner, repo string, number int, opts *PullRequestBranchUpdateOptions) (*PullRequestBranchUpdateResponse, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pulls/%v/update-branch\", owner, repo, number)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeUpdatePullRequestBranchPreview)\n\n\tvar p *PullRequestBranchUpdateResponse\n\tresp, err := s.client.Do(ctx, req, &p)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn p, resp, nil\n}\n\ntype pullRequestUpdate struct {\n\tTitle               *string `json:\"title,omitempty\"`\n\tBody                *string `json:\"body,omitempty\"`\n\tState               *string `json:\"state,omitempty\"`\n\tBase                *string `json:\"base,omitempty\"`\n\tMaintainerCanModify *bool   `json:\"maintainer_can_modify,omitempty\"`\n}\n\n// Edit a pull request.\n// pull must not be nil.\n//\n// The following fields are editable: Title, Body, State, Base.Ref and MaintainerCanModify.\n// Base.Ref updates the base branch of the pull request.\n//\n// GitHub API docs: https://docs.github.com/rest/pulls/pulls#update-a-pull-request\n//\n//meta:operation PATCH /repos/{owner}/{repo}/pulls/{pull_number}\nfunc (s *PullRequestsService) Edit(ctx context.Context, owner, repo string, number int, pull *PullRequest) (*PullRequest, *Response, error) {\n\tif pull == nil {\n\t\treturn nil, nil, errors.New(\"pull must be provided\")\n\t}\n\n\tu := fmt.Sprintf(\"repos/%v/%v/pulls/%v\", owner, repo, number)\n\n\tupdate := &pullRequestUpdate{\n\t\tTitle:               pull.Title,\n\t\tBody:                pull.Body,\n\t\tState:               pull.State,\n\t\tMaintainerCanModify: pull.MaintainerCanModify,\n\t}\n\t// avoid updating the base branch when closing the Pull Request\n\t// - otherwise the GitHub API server returns a \"Validation Failed\" error:\n\t// \"Cannot change base branch of closed pull request\".\n\tif pull.Base != nil && pull.GetState() != \"closed\" {\n\t\tupdate.Base = pull.Base.Ref\n\t}\n\n\treq, err := s.client.NewRequest(\"PATCH\", u, update)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar p *PullRequest\n\tresp, err := s.client.Do(ctx, req, &p)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn p, resp, nil\n}\n\n// ListCommits lists the commits in a pull request.\n//\n// GitHub API docs: https://docs.github.com/rest/pulls/pulls#list-commits-on-a-pull-request\n//\n//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/commits\nfunc (s *PullRequestsService) ListCommits(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*RepositoryCommit, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pulls/%v/commits\", owner, repo, number)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar commits []*RepositoryCommit\n\tresp, err := s.client.Do(ctx, req, &commits)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn commits, resp, nil\n}\n\n// ListFiles lists the files in a pull request.\n//\n// GitHub API docs: https://docs.github.com/rest/pulls/pulls#list-pull-requests-files\n//\n//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/files\nfunc (s *PullRequestsService) ListFiles(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*CommitFile, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pulls/%v/files\", owner, repo, number)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar commitFiles []*CommitFile\n\tresp, err := s.client.Do(ctx, req, &commitFiles)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn commitFiles, resp, nil\n}\n\n// IsMerged checks if a pull request has been merged.\n//\n// GitHub API docs: https://docs.github.com/rest/pulls/pulls#check-if-a-pull-request-has-been-merged\n//\n//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/merge\nfunc (s *PullRequestsService) IsMerged(ctx context.Context, owner, repo string, number int) (bool, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pulls/%v/merge\", owner, repo, number)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn false, nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tmerged, err := parseBoolResponse(err)\n\treturn merged, resp, err\n}\n\n// PullRequestMergeResult represents the result of merging a pull request.\ntype PullRequestMergeResult struct {\n\tSHA     *string `json:\"sha,omitempty\"`\n\tMerged  *bool   `json:\"merged,omitempty\"`\n\tMessage *string `json:\"message,omitempty\"`\n}\n\n// PullRequestOptions lets you define how a pull request will be merged.\ntype PullRequestOptions struct {\n\tCommitTitle string // Title for the automatic commit message. (Optional.)\n\tSHA         string // SHA that pull request head must match to allow merge. (Optional.)\n\n\t// The merge method to use. Possible values include: \"merge\", \"squash\", and \"rebase\" with the default being merge. (Optional.)\n\tMergeMethod string\n\n\t// If false, an empty string commit message will use the default commit message. If true, an empty string commit message will be used.\n\tDontDefaultIfBlank bool\n}\n\ntype pullRequestMergeRequest struct {\n\tCommitMessage *string `json:\"commit_message,omitempty\"`\n\tCommitTitle   string  `json:\"commit_title,omitempty\"`\n\tMergeMethod   string  `json:\"merge_method,omitempty\"`\n\tSHA           string  `json:\"sha,omitempty\"`\n}\n\n// Merge a pull request.\n// commitMessage is an extra detail to append to automatic commit message.\n//\n// GitHub API docs: https://docs.github.com/rest/pulls/pulls#merge-a-pull-request\n//\n//meta:operation PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge\nfunc (s *PullRequestsService) Merge(ctx context.Context, owner, repo string, number int, commitMessage string, options *PullRequestOptions) (*PullRequestMergeResult, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pulls/%v/merge\", owner, repo, number)\n\n\tvar pullRequestBody pullRequestMergeRequest\n\tif commitMessage != \"\" {\n\t\tpullRequestBody.CommitMessage = &commitMessage\n\t}\n\tif options != nil {\n\t\tpullRequestBody.CommitTitle = options.CommitTitle\n\t\tpullRequestBody.MergeMethod = options.MergeMethod\n\t\tpullRequestBody.SHA = options.SHA\n\t\tif options.DontDefaultIfBlank && commitMessage == \"\" {\n\t\t\tpullRequestBody.CommitMessage = &commitMessage\n\t\t}\n\t}\n\treq, err := s.client.NewRequest(\"PUT\", u, &pullRequestBody)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar mergeResult *PullRequestMergeResult\n\tresp, err := s.client.Do(ctx, req, &mergeResult)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn mergeResult, resp, nil\n}\n"
  },
  {
    "path": "github/pulls_comments.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strings\"\n\t\"time\"\n)\n\n// PullRequestComment represents a comment left on a pull request.\ntype PullRequestComment struct {\n\tID                  *int64     `json:\"id,omitempty\"`\n\tNodeID              *string    `json:\"node_id,omitempty\"`\n\tInReplyTo           *int64     `json:\"in_reply_to_id,omitempty\"`\n\tBody                *string    `json:\"body,omitempty\"`\n\tPath                *string    `json:\"path,omitempty\"`\n\tDiffHunk            *string    `json:\"diff_hunk,omitempty\"`\n\tPullRequestReviewID *int64     `json:\"pull_request_review_id,omitempty\"`\n\tPosition            *int       `json:\"position,omitempty\"`\n\tOriginalPosition    *int       `json:\"original_position,omitempty\"`\n\tStartLine           *int       `json:\"start_line,omitempty\"`\n\tLine                *int       `json:\"line,omitempty\"`\n\tOriginalLine        *int       `json:\"original_line,omitempty\"`\n\tOriginalStartLine   *int       `json:\"original_start_line,omitempty\"`\n\tSide                *string    `json:\"side,omitempty\"`\n\tStartSide           *string    `json:\"start_side,omitempty\"`\n\tCommitID            *string    `json:\"commit_id,omitempty\"`\n\tOriginalCommitID    *string    `json:\"original_commit_id,omitempty\"`\n\tUser                *User      `json:\"user,omitempty\"`\n\tReactions           *Reactions `json:\"reactions,omitempty\"`\n\tCreatedAt           *Timestamp `json:\"created_at,omitempty\"`\n\tUpdatedAt           *Timestamp `json:\"updated_at,omitempty\"`\n\t// AuthorAssociation is the comment author's relationship to the pull request's repository.\n\t// Possible values are \"COLLABORATOR\", \"CONTRIBUTOR\", \"FIRST_TIMER\", \"FIRST_TIME_CONTRIBUTOR\", \"MEMBER\", \"OWNER\", or \"NONE\".\n\t//\n\t// Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025.\n\t// Use the Pull Request Comments REST API endpoint to retrieve this information.\n\t// See: https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request\n\tAuthorAssociation *string `json:\"author_association,omitempty\"`\n\tURL               *string `json:\"url,omitempty\"`\n\tHTMLURL           *string `json:\"html_url,omitempty\"`\n\tPullRequestURL    *string `json:\"pull_request_url,omitempty\"`\n\t// Can be one of: LINE, FILE from https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request\n\tSubjectType *string `json:\"subject_type,omitempty\"`\n}\n\nfunc (p PullRequestComment) String() string {\n\treturn Stringify(p)\n}\n\n// PullRequestListCommentsOptions specifies the optional parameters to the\n// PullRequestsService.ListComments method.\ntype PullRequestListCommentsOptions struct {\n\t// Sort specifies how to sort comments. Possible values are: created, updated.\n\tSort string `url:\"sort,omitempty\"`\n\n\t// Direction in which to sort comments. Possible values are: asc, desc.\n\tDirection string `url:\"direction,omitempty\"`\n\n\t// Since filters comments by time.\n\tSince time.Time `url:\"since,omitempty\"`\n\n\tListOptions\n}\n\n// ListComments lists all comments on the specified pull request. Specifying a\n// pull request number of 0 will return all comments on all pull requests for\n// the repository.\n//\n// GitHub API docs: https://docs.github.com/rest/pulls/comments#list-review-comments-in-a-repository\n//\n// GitHub API docs: https://docs.github.com/rest/pulls/comments#list-review-comments-on-a-pull-request\n//\n//meta:operation GET /repos/{owner}/{repo}/pulls/comments\n//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/comments\nfunc (s *PullRequestsService) ListComments(ctx context.Context, owner, repo string, number int, opts *PullRequestListCommentsOptions) ([]*PullRequestComment, *Response, error) {\n\tvar u string\n\tif number == 0 {\n\t\tu = fmt.Sprintf(\"repos/%v/%v/pulls/comments\", owner, repo)\n\t} else {\n\t\tu = fmt.Sprintf(\"repos/%v/%v/pulls/%v/comments\", owner, repo, number)\n\t}\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tacceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeMultiLineCommentsPreview}\n\treq.Header.Set(\"Accept\", strings.Join(acceptHeaders, \", \"))\n\n\tvar comments []*PullRequestComment\n\tresp, err := s.client.Do(ctx, req, &comments)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn comments, resp, nil\n}\n\n// GetComment fetches the specified pull request comment.\n//\n// GitHub API docs: https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request\n//\n//meta:operation GET /repos/{owner}/{repo}/pulls/comments/{comment_id}\nfunc (s *PullRequestsService) GetComment(ctx context.Context, owner, repo string, commentID int64) (*PullRequestComment, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pulls/comments/%v\", owner, repo, commentID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tacceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeMultiLineCommentsPreview}\n\treq.Header.Set(\"Accept\", strings.Join(acceptHeaders, \", \"))\n\n\tvar comment *PullRequestComment\n\tresp, err := s.client.Do(ctx, req, &comment)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn comment, resp, nil\n}\n\n// CreateComment creates a new comment on the specified pull request.\n//\n// GitHub API docs: https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request\n//\n//meta:operation POST /repos/{owner}/{repo}/pulls/{pull_number}/comments\nfunc (s *PullRequestsService) CreateComment(ctx context.Context, owner, repo string, number int, comment *PullRequestComment) (*PullRequestComment, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pulls/%v/comments\", owner, repo, number)\n\treq, err := s.client.NewRequest(\"POST\", u, comment)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tacceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeMultiLineCommentsPreview}\n\treq.Header.Set(\"Accept\", strings.Join(acceptHeaders, \", \"))\n\n\tvar c *PullRequestComment\n\tresp, err := s.client.Do(ctx, req, &c)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn c, resp, nil\n}\n\n// CreateCommentInReplyTo creates a new comment as a reply to an existing pull request comment.\n//\n// GitHub API docs: https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request\n//\n//meta:operation POST /repos/{owner}/{repo}/pulls/{pull_number}/comments\nfunc (s *PullRequestsService) CreateCommentInReplyTo(ctx context.Context, owner, repo string, number int, body string, commentID int64) (*PullRequestComment, *Response, error) {\n\tcomment := &struct {\n\t\tBody      string `json:\"body,omitempty\"`\n\t\tInReplyTo int64  `json:\"in_reply_to,omitempty\"`\n\t}{\n\t\tBody:      body,\n\t\tInReplyTo: commentID,\n\t}\n\tu := fmt.Sprintf(\"repos/%v/%v/pulls/%v/comments\", owner, repo, number)\n\treq, err := s.client.NewRequest(\"POST\", u, comment)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar c *PullRequestComment\n\tresp, err := s.client.Do(ctx, req, &c)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn c, resp, nil\n}\n\n// EditComment updates a pull request comment.\n// A non-nil comment.Body must be provided. Other comment fields should be left nil.\n//\n// GitHub API docs: https://docs.github.com/rest/pulls/comments#update-a-review-comment-for-a-pull-request\n//\n//meta:operation PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}\nfunc (s *PullRequestsService) EditComment(ctx context.Context, owner, repo string, commentID int64, comment *PullRequestComment) (*PullRequestComment, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pulls/comments/%v\", owner, repo, commentID)\n\treq, err := s.client.NewRequest(\"PATCH\", u, comment)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar c *PullRequestComment\n\tresp, err := s.client.Do(ctx, req, &c)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn c, resp, nil\n}\n\n// DeleteComment deletes a pull request comment.\n//\n// GitHub API docs: https://docs.github.com/rest/pulls/comments#delete-a-review-comment-for-a-pull-request\n//\n//meta:operation DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}\nfunc (s *PullRequestsService) DeleteComment(ctx context.Context, owner, repo string, commentID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pulls/comments/%v\", owner, repo, commentID)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/pulls_comments_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestPullComments_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PullRequestComment{}, \"{}\")\n\n\tcreatedAt := Timestamp{time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC)}\n\tupdatedAt := Timestamp{time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC)}\n\treactions := &Reactions{\n\t\tTotalCount: Ptr(1),\n\t\tPlusOne:    Ptr(1),\n\t\tMinusOne:   Ptr(0),\n\t\tLaugh:      Ptr(0),\n\t\tConfused:   Ptr(0),\n\t\tHeart:      Ptr(0),\n\t\tHooray:     Ptr(0),\n\t\tRocket:     Ptr(0),\n\t\tEyes:       Ptr(0),\n\t\tURL:        Ptr(\"u\"),\n\t}\n\n\tu := &PullRequestComment{\n\t\tID:                  Ptr(int64(10)),\n\t\tInReplyTo:           Ptr(int64(8)),\n\t\tBody:                Ptr(\"Test comment\"),\n\t\tPath:                Ptr(\"file1.txt\"),\n\t\tDiffHunk:            Ptr(\"@@ -16,33 +16,40 @@ fmt.Println()\"),\n\t\tPullRequestReviewID: Ptr(int64(42)),\n\t\tPosition:            Ptr(1),\n\t\tOriginalPosition:    Ptr(4),\n\t\tStartLine:           Ptr(2),\n\t\tLine:                Ptr(3),\n\t\tOriginalLine:        Ptr(2),\n\t\tOriginalStartLine:   Ptr(2),\n\t\tSide:                Ptr(\"RIGHT\"),\n\t\tStartSide:           Ptr(\"LEFT\"),\n\t\tCommitID:            Ptr(\"ab\"),\n\t\tOriginalCommitID:    Ptr(\"9c\"),\n\t\tUser: &User{\n\t\t\tLogin:       Ptr(\"ll\"),\n\t\t\tID:          Ptr(int64(123)),\n\t\t\tAvatarURL:   Ptr(\"a\"),\n\t\t\tGravatarID:  Ptr(\"g\"),\n\t\t\tName:        Ptr(\"n\"),\n\t\t\tCompany:     Ptr(\"c\"),\n\t\t\tBlog:        Ptr(\"b\"),\n\t\t\tLocation:    Ptr(\"l\"),\n\t\t\tEmail:       Ptr(\"e\"),\n\t\t\tHireable:    Ptr(true),\n\t\t\tPublicRepos: Ptr(1),\n\t\t\tFollowers:   Ptr(1),\n\t\t\tFollowing:   Ptr(1),\n\t\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\t\tURL:         Ptr(\"u\"),\n\t\t},\n\t\tReactions:      reactions,\n\t\tCreatedAt:      &createdAt,\n\t\tUpdatedAt:      &updatedAt,\n\t\tURL:            Ptr(\"pullrequestcommentUrl\"),\n\t\tHTMLURL:        Ptr(\"pullrequestcommentHTMLUrl\"),\n\t\tPullRequestURL: Ptr(\"pullrequestcommentPullRequestURL\"),\n\t}\n\n\twant := `{\n\t\t\"id\": 10,\n\t\t\"in_reply_to_id\": 8,\n\t\t\"body\": \"Test comment\",\n\t\t\"path\": \"file1.txt\",\n\t\t\"diff_hunk\": \"@@ -16,33 +16,40 @@ fmt.Println()\",\n\t\t\"pull_request_review_id\": 42,\n\t\t\"position\": 1,\n\t\t\"original_position\": 4,\n\t\t\"start_line\": 2,\n\t\t\"line\": 3,\n\t\t\"original_line\": 2,\n\t\t\"original_start_line\": 2,\n\t\t\"side\": \"RIGHT\",\n\t\t\"start_side\": \"LEFT\",\n\t\t\"commit_id\": \"ab\",\n\t\t\"original_commit_id\": \"9c\",\n\t\t\"user\": {\n\t\t\t\"login\": \"ll\",\n\t\t\t\"id\": 123,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"reactions\": {\n\t\t\t\"total_count\": 1,\n\t\t\t\"+1\": 1,\n\t\t\t\"-1\": 0,\n\t\t\t\"laugh\": 0,\n\t\t\t\"confused\": 0,\n\t\t\t\"heart\": 0,\n\t\t\t\"hooray\": 0,\n\t\t\t\"rocket\": 0,\n\t\t\t\"eyes\": 0,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"created_at\": \"2002-02-10T15:30:00Z\",\n\t\t\"updated_at\": \"2002-02-10T15:30:00Z\",\n\t\t\"url\": \"pullrequestcommentUrl\",\n\t\t\"html_url\": \"pullrequestcommentHTMLUrl\",\n\t\t\"pull_request_url\": \"pullrequestcommentPullRequestURL\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPullRequestsService_ListComments_allPulls(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\twantAcceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeMultiLineCommentsPreview}\n\tmux.HandleFunc(\"/repos/o/r/pulls/comments\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", strings.Join(wantAcceptHeaders, \", \"))\n\t\ttestFormValues(t, r, values{\n\t\t\t\"sort\":      \"updated\",\n\t\t\t\"direction\": \"desc\",\n\t\t\t\"since\":     \"2002-02-10T15:30:00Z\",\n\t\t\t\"page\":      \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &PullRequestListCommentsOptions{\n\t\tSort:        \"updated\",\n\t\tDirection:   \"desc\",\n\t\tSince:       time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC),\n\t\tListOptions: ListOptions{Page: 2},\n\t}\n\tctx := t.Context()\n\tpulls, _, err := client.PullRequests.ListComments(ctx, \"o\", \"r\", 0, opt)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.ListComments returned error: %v\", err)\n\t}\n\n\twant := []*PullRequestComment{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(pulls, want) {\n\t\tt.Errorf(\"PullRequests.ListComments returned %+v, want %+v\", pulls, want)\n\t}\n\n\tconst methodName = \"ListComments\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.PullRequests.ListComments(ctx, \"\\n\", \"\\n\", -1, opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PullRequests.ListComments(ctx, \"o\", \"r\", 0, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestPullRequestsService_ListComments_specificPull(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\twantAcceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeMultiLineCommentsPreview}\n\tmux.HandleFunc(\"/repos/o/r/pulls/1/comments\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", strings.Join(wantAcceptHeaders, \", \"))\n\t\tfmt.Fprint(w, `[{\"id\":1, \"pull_request_review_id\":42}]`)\n\t})\n\n\tctx := t.Context()\n\tpulls, _, err := client.PullRequests.ListComments(ctx, \"o\", \"r\", 1, nil)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.ListComments returned error: %v\", err)\n\t}\n\n\twant := []*PullRequestComment{{ID: Ptr(int64(1)), PullRequestReviewID: Ptr(int64(42))}}\n\tif !cmp.Equal(pulls, want) {\n\t\tt.Errorf(\"PullRequests.ListComments returned %+v, want %+v\", pulls, want)\n\t}\n}\n\nfunc TestPullRequestsService_ListComments_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.PullRequests.ListComments(ctx, \"%\", \"r\", 1, nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestPullRequestsService_GetComment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\twantAcceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeMultiLineCommentsPreview}\n\tmux.HandleFunc(\"/repos/o/r/pulls/comments/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", strings.Join(wantAcceptHeaders, \", \"))\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tcomment, _, err := client.PullRequests.GetComment(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.GetComment returned error: %v\", err)\n\t}\n\n\twant := &PullRequestComment{ID: Ptr(int64(1))}\n\tif !cmp.Equal(comment, want) {\n\t\tt.Errorf(\"PullRequests.GetComment returned %+v, want %+v\", comment, want)\n\t}\n\n\tconst methodName = \"GetComment\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.PullRequests.GetComment(ctx, \"\\n\", \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PullRequests.GetComment(ctx, \"o\", \"r\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestPullRequestsService_GetComment_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.PullRequests.GetComment(ctx, \"%\", \"r\", 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestPullRequestsService_CreateComment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &PullRequestComment{Body: Ptr(\"b\")}\n\n\twantAcceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeMultiLineCommentsPreview}\n\tmux.HandleFunc(\"/repos/o/r/pulls/1/comments\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *PullRequestComment\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestHeader(t, r, \"Accept\", strings.Join(wantAcceptHeaders, \", \"))\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tcomment, _, err := client.PullRequests.CreateComment(ctx, \"o\", \"r\", 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.CreateComment returned error: %v\", err)\n\t}\n\n\twant := &PullRequestComment{ID: Ptr(int64(1))}\n\tif !cmp.Equal(comment, want) {\n\t\tt.Errorf(\"PullRequests.CreateComment returned %+v, want %+v\", comment, want)\n\t}\n\n\tconst methodName = \"CreateComment\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.PullRequests.CreateComment(ctx, \"\\n\", \"\\n\", -1, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PullRequests.CreateComment(ctx, \"o\", \"r\", 1, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestPullRequestsService_CreateComment_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.PullRequests.CreateComment(ctx, \"%\", \"r\", 1, nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestPullRequestsService_CreateCommentInReplyTo(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &PullRequestComment{Body: Ptr(\"b\")}\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/1/comments\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *PullRequestComment\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tcomment, _, err := client.PullRequests.CreateCommentInReplyTo(ctx, \"o\", \"r\", 1, \"b\", 2)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.CreateCommentInReplyTo returned error: %v\", err)\n\t}\n\n\twant := &PullRequestComment{ID: Ptr(int64(1))}\n\tif !cmp.Equal(comment, want) {\n\t\tt.Errorf(\"PullRequests.CreateCommentInReplyTo returned %+v, want %+v\", comment, want)\n\t}\n\n\tconst methodName = \"CreateCommentInReplyTo\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.PullRequests.CreateCommentInReplyTo(ctx, \"\\n\", \"\\n\", -1, \"\\n\", -2)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PullRequests.CreateCommentInReplyTo(ctx, \"o\", \"r\", 1, \"b\", 2)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestPullRequestsService_EditComment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &PullRequestComment{Body: Ptr(\"b\")}\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/comments/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *PullRequestComment\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tcomment, _, err := client.PullRequests.EditComment(ctx, \"o\", \"r\", 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.EditComment returned error: %v\", err)\n\t}\n\n\twant := &PullRequestComment{ID: Ptr(int64(1))}\n\tif !cmp.Equal(comment, want) {\n\t\tt.Errorf(\"PullRequests.EditComment returned %+v, want %+v\", comment, want)\n\t}\n\n\tconst methodName = \"EditComment\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.PullRequests.EditComment(ctx, \"\\n\", \"\\n\", -1, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PullRequests.EditComment(ctx, \"o\", \"r\", 1, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestPullRequestsService_EditComment_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.PullRequests.EditComment(ctx, \"%\", \"r\", 1, nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestPullRequestsService_DeleteComment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/comments/1\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.PullRequests.DeleteComment(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.DeleteComment returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteComment\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.PullRequests.DeleteComment(ctx, \"\\n\", \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.PullRequests.DeleteComment(ctx, \"o\", \"r\", 1)\n\t})\n}\n\nfunc TestPullRequestsService_DeleteComment_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.PullRequests.DeleteComment(ctx, \"%\", \"r\", 1)\n\ttestURLParseError(t, err)\n}\n"
  },
  {
    "path": "github/pulls_reviewers.go",
    "content": "// Copyright 2017 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// ReviewersRequest specifies users and teams for a pull request review request.\ntype ReviewersRequest struct {\n\tNodeID        *string  `json:\"node_id,omitempty\"`\n\tReviewers     []string `json:\"reviewers,omitempty\"`\n\tTeamReviewers []string `json:\"team_reviewers,omitempty\"`\n}\n\n// Reviewers represents reviewers of a pull request.\ntype Reviewers struct {\n\tUsers []*User `json:\"users,omitempty\"`\n\tTeams []*Team `json:\"teams,omitempty\"`\n}\n\ntype removeReviewersRequest struct {\n\tNodeID *string `json:\"node_id,omitempty\"`\n\t// Note the lack of omitempty! See comment in RemoveReviewers.\n\tReviewers     []string `json:\"reviewers\"`\n\tTeamReviewers []string `json:\"team_reviewers,omitempty\"`\n}\n\n// RequestReviewers creates a review request for the provided reviewers for the specified pull request.\n//\n// GitHub API docs: https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request\n//\n//meta:operation POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\nfunc (s *PullRequestsService) RequestReviewers(ctx context.Context, owner, repo string, number int, reviewers ReviewersRequest) (*PullRequest, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pulls/%v/requested_reviewers\", owner, repo, number)\n\treq, err := s.client.NewRequest(\"POST\", u, &reviewers)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar r *PullRequest\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}\n\n// ListReviewers lists reviewers whose reviews have been requested on the specified pull request.\n//\n// GitHub API docs: https://docs.github.com/rest/pulls/review-requests#get-all-requested-reviewers-for-a-pull-request\n//\n//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\nfunc (s *PullRequestsService) ListReviewers(ctx context.Context, owner, repo string, number int) (*Reviewers, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pulls/%v/requested_reviewers\", owner, repo, number)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar reviewers *Reviewers\n\tresp, err := s.client.Do(ctx, req, &reviewers)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn reviewers, resp, nil\n}\n\n// RemoveReviewers removes the review request for the provided reviewers for the specified pull request.\n//\n// GitHub API docs: https://docs.github.com/rest/pulls/review-requests#remove-requested-reviewers-from-a-pull-request\n//\n//meta:operation DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\nfunc (s *PullRequestsService) RemoveReviewers(ctx context.Context, owner, repo string, number int, reviewers ReviewersRequest) (*Response, error) {\n\t// reviewers.Reviewers may be empty if the caller wants to remove teams, but not users. Unlike AddReviewers,\n\t// \"reviewers\" is a required param here. Reference: https://github.com/google/go-github/issues/3336\n\t// The type `removeReviewersRequest` is required because the struct tags are different from `ReviewersRequest`.\n\tremoveRequest := removeReviewersRequest(reviewers)\n\n\tif removeRequest.Reviewers == nil {\n\t\t// GitHub accepts the empty list, but rejects null. Removing `omitempty` is not enough - we also have to promote nil to [].\n\t\tremoveRequest.Reviewers = []string{}\n\t}\n\n\tu := fmt.Sprintf(\"repos/%v/%v/pulls/%v/requested_reviewers\", owner, repo, number)\n\treq, err := s.client.NewRequest(\"DELETE\", u, &removeRequest)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/pulls_reviewers_test.go",
    "content": "// Copyright 2017 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestReviewersRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ReviewersRequest{}, \"{}\")\n\n\tu := &ReviewersRequest{\n\t\tNodeID:        Ptr(\"n\"),\n\t\tReviewers:     []string{\"r\"},\n\t\tTeamReviewers: []string{\"t\"},\n\t}\n\n\twant := `{\n\t\t\"node_id\": \"n\",\n\t\t\"reviewers\": [\n\t\t\t\"r\"\n\t\t],\n\t\t\"team_reviewers\" : [\n\t\t\t\"t\"\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestReviewers_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Reviewers{}, \"{}\")\n\n\tu := &Reviewers{\n\t\tUsers: []*User{{\n\t\t\tLogin:       Ptr(\"l\"),\n\t\t\tID:          Ptr(int64(1)),\n\t\t\tAvatarURL:   Ptr(\"a\"),\n\t\t\tGravatarID:  Ptr(\"g\"),\n\t\t\tName:        Ptr(\"n\"),\n\t\t\tCompany:     Ptr(\"c\"),\n\t\t\tBlog:        Ptr(\"b\"),\n\t\t\tLocation:    Ptr(\"l\"),\n\t\t\tEmail:       Ptr(\"e\"),\n\t\t\tHireable:    Ptr(true),\n\t\t\tPublicRepos: Ptr(1),\n\t\t\tFollowers:   Ptr(1),\n\t\t\tFollowing:   Ptr(1),\n\t\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\t\tURL:         Ptr(\"u\"),\n\t\t}},\n\t\tTeams: []*Team{{\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tNodeID:          Ptr(\"node\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tDescription:     Ptr(\"d\"),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tSlug:            Ptr(\"s\"),\n\t\t\tPermission:      Ptr(\"p\"),\n\t\t\tPrivacy:         Ptr(\"priv\"),\n\t\t\tMembersCount:    Ptr(1),\n\t\t\tReposCount:      Ptr(1),\n\t\t\tOrganization:    nil,\n\t\t\tMembersURL:      Ptr(\"m\"),\n\t\t\tRepositoriesURL: Ptr(\"r\"),\n\t\t\tParent:          nil,\n\t\t\tLDAPDN:          Ptr(\"l\"),\n\t\t}},\n\t}\n\n\twant := `{\n\t\t\"users\" : [\n\t\t\t{\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t}\n\t\t],\n\t\t\"teams\" : [\n\t\t\t{\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"node\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"description\": \"d\",\n\t\t\t\t\"url\": \"u\",\n\t\t\t\t\"slug\": \"s\",\n\t\t\t\t\"permission\": \"p\",\n\t\t\t\t\"privacy\": \"priv\",\n\t\t\t\t\"members_count\": 1,\n\t\t\t\t\"repos_count\": 1,\n\t\t\t\t\"members_url\": \"m\",\n\t\t\t\t\"repositories_url\": \"r\",\n\t\t\t\t\"ldap_dn\": \"l\"\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestRequestReviewers(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/1/requested_reviewers\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestBody(t, r, `{\"reviewers\":[\"octocat\",\"googlebot\"],\"team_reviewers\":[\"justice-league\",\"injustice-league\"]}`+\"\\n\")\n\t\tfmt.Fprint(w, `{\"number\":1}`)\n\t})\n\n\t// This returns a PR, unmarshaling of which is tested elsewhere\n\tctx := t.Context()\n\tgot, _, err := client.PullRequests.RequestReviewers(ctx, \"o\", \"r\", 1, ReviewersRequest{Reviewers: []string{\"octocat\", \"googlebot\"}, TeamReviewers: []string{\"justice-league\", \"injustice-league\"}})\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.RequestReviewers returned error: %v\", err)\n\t}\n\twant := &PullRequest{Number: Ptr(1)}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"PullRequests.RequestReviewers returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"RequestReviewers\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PullRequests.RequestReviewers(ctx, \"o\", \"r\", 1, ReviewersRequest{Reviewers: []string{\"octocat\", \"googlebot\"}, TeamReviewers: []string{\"justice-league\", \"injustice-league\"}})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRemoveReviewers(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/1/requested_reviewers\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestBody(t, r, `{\"reviewers\":[\"octocat\",\"googlebot\"],\"team_reviewers\":[\"justice-league\"]}`+\"\\n\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.PullRequests.RemoveReviewers(ctx, \"o\", \"r\", 1, ReviewersRequest{Reviewers: []string{\"octocat\", \"googlebot\"}, TeamReviewers: []string{\"justice-league\"}})\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.RemoveReviewers returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveReviewers\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.PullRequests.RemoveReviewers(ctx, \"o\", \"r\", 1, ReviewersRequest{Reviewers: []string{\"octocat\", \"googlebot\"}, TeamReviewers: []string{\"justice-league\"}})\n\t})\n}\n\nfunc TestRemoveReviewers_teamsOnly(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/1/requested_reviewers\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestBody(t, r, `{\"reviewers\":[],\"team_reviewers\":[\"justice-league\"]}`+\"\\n\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.PullRequests.RemoveReviewers(ctx, \"o\", \"r\", 1, ReviewersRequest{TeamReviewers: []string{\"justice-league\"}})\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.RemoveReviewers returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveReviewers\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.PullRequests.RemoveReviewers(ctx, \"o\", \"r\", 1, ReviewersRequest{TeamReviewers: []string{\"justice-league\"}})\n\t})\n}\n\nfunc TestListReviewers(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/1/requested_reviewers\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"users\":[{\"login\":\"octocat\",\"id\":1}],\"teams\":[{\"id\":1,\"name\":\"Justice League\"}]}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.PullRequests.ListReviewers(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.ListReviewers returned error: %v\", err)\n\t}\n\n\twant := &Reviewers{\n\t\tUsers: []*User{\n\t\t\t{\n\t\t\t\tLogin: Ptr(\"octocat\"),\n\t\t\t\tID:    Ptr(int64(1)),\n\t\t\t},\n\t\t},\n\t\tTeams: []*Team{\n\t\t\t{\n\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\tName: Ptr(\"Justice League\"),\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"PullRequests.ListReviewers returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ListReviewers\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PullRequests.ListReviewers(ctx, \"o\", \"r\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/pulls_reviews.go",
    "content": "// Copyright 2016 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n)\n\nvar ErrMixedCommentStyles = errors.New(\"cannot use both position and side/line form comments\")\n\n// PullRequestReview represents a review of a pull request.\ntype PullRequestReview struct {\n\tID             *int64     `json:\"id,omitempty\"`\n\tNodeID         *string    `json:\"node_id,omitempty\"`\n\tUser           *User      `json:\"user,omitempty\"`\n\tBody           *string    `json:\"body,omitempty\"`\n\tSubmittedAt    *Timestamp `json:\"submitted_at,omitempty\"`\n\tCommitID       *string    `json:\"commit_id,omitempty\"`\n\tHTMLURL        *string    `json:\"html_url,omitempty\"`\n\tPullRequestURL *string    `json:\"pull_request_url,omitempty\"`\n\tState          *string    `json:\"state,omitempty\"`\n\t// AuthorAssociation is the review author's relationship to the repository.\n\t// Possible values are \"COLLABORATOR\", \"CONTRIBUTOR\", \"FIRST_TIMER\", \"FIRST_TIME_CONTRIBUTOR\", \"MEMBER\", \"OWNER\", or \"NONE\".\n\t//\n\t// Deprecated: GitHub will remove this field from Events API payloads on October 7, 2025.\n\t// Use the Pull Request Reviews REST API endpoint to retrieve this information.\n\t// See: https://docs.github.com/rest/pulls/reviews#get-a-review-for-a-pull-request\n\tAuthorAssociation *string `json:\"author_association,omitempty\"`\n}\n\nfunc (p PullRequestReview) String() string {\n\treturn Stringify(p)\n}\n\n// DraftReviewComment represents a comment part of the review.\ntype DraftReviewComment struct {\n\tPath     *string `json:\"path,omitempty\"`\n\tPosition *int    `json:\"position,omitempty\"`\n\tBody     *string `json:\"body,omitempty\"`\n\n\t// The new comfort-fade-preview fields\n\tStartSide *string `json:\"start_side,omitempty\"`\n\tSide      *string `json:\"side,omitempty\"`\n\tStartLine *int    `json:\"start_line,omitempty\"`\n\tLine      *int    `json:\"line,omitempty\"`\n}\n\nfunc (c DraftReviewComment) String() string {\n\treturn Stringify(c)\n}\n\n// PullRequestReviewRequest represents a request to create a review.\ntype PullRequestReviewRequest struct {\n\tNodeID   *string               `json:\"node_id,omitempty\"`\n\tCommitID *string               `json:\"commit_id,omitempty\"`\n\tBody     *string               `json:\"body,omitempty\"`\n\tEvent    *string               `json:\"event,omitempty\"`\n\tComments []*DraftReviewComment `json:\"comments,omitempty\"`\n}\n\nfunc (r PullRequestReviewRequest) String() string {\n\treturn Stringify(r)\n}\n\nfunc (r *PullRequestReviewRequest) isComfortFadePreview() (bool, error) {\n\tvar isCF *bool\n\tfor _, comment := range r.Comments {\n\t\tif comment == nil {\n\t\t\tcontinue\n\t\t}\n\t\thasPos := comment.Position != nil\n\t\thasComfortFade := (comment.StartSide != nil) || (comment.Side != nil) ||\n\t\t\t(comment.StartLine != nil) || (comment.Line != nil)\n\n\t\tswitch {\n\t\tcase hasPos && hasComfortFade:\n\t\t\treturn false, ErrMixedCommentStyles\n\t\tcase hasPos && isCF != nil && *isCF:\n\t\t\treturn false, ErrMixedCommentStyles\n\t\tcase hasComfortFade && isCF != nil && !*isCF:\n\t\t\treturn false, ErrMixedCommentStyles\n\t\t}\n\t\tisCF = &hasComfortFade\n\t}\n\tif isCF != nil {\n\t\treturn *isCF, nil\n\t}\n\treturn false, nil\n}\n\n// PullRequestReviewDismissalRequest represents a request to dismiss a review.\ntype PullRequestReviewDismissalRequest struct {\n\tMessage *string `json:\"message,omitempty\"`\n}\n\nfunc (r PullRequestReviewDismissalRequest) String() string {\n\treturn Stringify(r)\n}\n\n// ListReviews lists all reviews on the specified pull request.\n//\n// GitHub API docs: https://docs.github.com/rest/pulls/reviews#list-reviews-for-a-pull-request\n//\n//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews\nfunc (s *PullRequestsService) ListReviews(ctx context.Context, owner, repo string, number int, opts *ListOptions) ([]*PullRequestReview, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pulls/%v/reviews\", owner, repo, number)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar reviews []*PullRequestReview\n\tresp, err := s.client.Do(ctx, req, &reviews)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn reviews, resp, nil\n}\n\n// GetReview fetches the specified pull request review.\n//\n// GitHub API docs: https://docs.github.com/rest/pulls/reviews#get-a-review-for-a-pull-request\n//\n//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\nfunc (s *PullRequestsService) GetReview(ctx context.Context, owner, repo string, number int, reviewID int64) (*PullRequestReview, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pulls/%v/reviews/%v\", owner, repo, number, reviewID)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar review *PullRequestReview\n\tresp, err := s.client.Do(ctx, req, &review)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn review, resp, nil\n}\n\n// DeletePendingReview deletes the specified pull request pending review.\n//\n// GitHub API docs: https://docs.github.com/rest/pulls/reviews#delete-a-pending-review-for-a-pull-request\n//\n//meta:operation DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\nfunc (s *PullRequestsService) DeletePendingReview(ctx context.Context, owner, repo string, number int, reviewID int64) (*PullRequestReview, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pulls/%v/reviews/%v\", owner, repo, number, reviewID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar review *PullRequestReview\n\tresp, err := s.client.Do(ctx, req, &review)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn review, resp, nil\n}\n\n// ListReviewComments lists all the comments for the specified review.\n//\n// GitHub API docs: https://docs.github.com/rest/pulls/reviews#list-comments-for-a-pull-request-review\n//\n//meta:operation GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\nfunc (s *PullRequestsService) ListReviewComments(ctx context.Context, owner, repo string, number int, reviewID int64, opts *ListOptions) ([]*PullRequestComment, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pulls/%v/reviews/%v/comments\", owner, repo, number, reviewID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar comments []*PullRequestComment\n\tresp, err := s.client.Do(ctx, req, &comments)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn comments, resp, nil\n}\n\n// CreateReview creates a new review on the specified pull request.\n//\n// In order to use multi-line comments, you must use the \"comfort fade\" preview.\n// This replaces the use of the \"Position\" field in comments with 4 new fields:\n//\n//\t[Start]Side, and [Start]Line.\n//\n// These new fields must be used for ALL comments (including single-line),\n// with the following restrictions (empirically observed, so subject to change).\n//\n// For single-line \"comfort fade\" comments, you must use:\n//\n//\tPath:  &path,  // as before\n//\tBody:  &body,  // as before\n//\tSide:  &\"RIGHT\" (or \"LEFT\")\n//\tLine:  &123,  // NOT THE SAME AS POSITION, this is an actual line number.\n//\n// If StartSide or StartLine is used with single-line comments, a 422 is returned.\n//\n// For multi-line \"comfort fade\" comments, you must use:\n//\n//\tPath:      &path,  // as before\n//\tBody:      &body,  // as before\n//\tStartSide: &\"RIGHT\" (or \"LEFT\")\n//\tSide:      &\"RIGHT\" (or \"LEFT\")\n//\tStartLine: &120,\n//\tLine:      &125,\n//\n// Suggested edits are made by commenting on the lines to replace, and including the\n// suggested edit in a block like this (it may be surrounded in non-suggestion markdown):\n//\n//\t```suggestion\n//\tUse this instead.\n//\tIt is waaaaaay better.\n//\t```\n//\n// GitHub API docs: https://docs.github.com/rest/pulls/reviews#create-a-review-for-a-pull-request\n//\n//meta:operation POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews\nfunc (s *PullRequestsService) CreateReview(ctx context.Context, owner, repo string, number int, review *PullRequestReviewRequest) (*PullRequestReview, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pulls/%v/reviews\", owner, repo, number)\n\n\treq, err := s.client.NewRequest(\"POST\", u, review)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\t// Detect which style of review comment is being used.\n\tif isCF, err := review.isComfortFadePreview(); err != nil {\n\t\treturn nil, nil, err\n\t} else if isCF {\n\t\t// If the review comments are using the comfort fade preview fields,\n\t\t// then pass the comfort fade header.\n\t\treq.Header.Set(\"Accept\", mediaTypeMultiLineCommentsPreview)\n\t}\n\n\tvar r *PullRequestReview\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}\n\n// UpdateReview updates the review summary on the specified pull request.\n//\n// GitHub API docs: https://docs.github.com/rest/pulls/reviews#update-a-review-for-a-pull-request\n//\n//meta:operation PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\nfunc (s *PullRequestsService) UpdateReview(ctx context.Context, owner, repo string, number int, reviewID int64, body string) (*PullRequestReview, *Response, error) {\n\topts := &struct {\n\t\tBody string `json:\"body\"`\n\t}{Body: body}\n\tu := fmt.Sprintf(\"repos/%v/%v/pulls/%v/reviews/%v\", owner, repo, number, reviewID)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar review *PullRequestReview\n\tresp, err := s.client.Do(ctx, req, &review)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn review, resp, nil\n}\n\n// SubmitReview submits a specified review on the specified pull request.\n//\n// GitHub API docs: https://docs.github.com/rest/pulls/reviews#submit-a-review-for-a-pull-request\n//\n//meta:operation POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events\nfunc (s *PullRequestsService) SubmitReview(ctx context.Context, owner, repo string, number int, reviewID int64, review *PullRequestReviewRequest) (*PullRequestReview, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pulls/%v/reviews/%v/events\", owner, repo, number, reviewID)\n\n\treq, err := s.client.NewRequest(\"POST\", u, review)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar r *PullRequestReview\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}\n\n// DismissReview dismisses a specified review on the specified pull request.\n//\n// GitHub API docs: https://docs.github.com/rest/pulls/reviews#dismiss-a-review-for-a-pull-request\n//\n//meta:operation PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals\nfunc (s *PullRequestsService) DismissReview(ctx context.Context, owner, repo string, number int, reviewID int64, review *PullRequestReviewDismissalRequest) (*PullRequestReview, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pulls/%v/reviews/%v/dismissals\", owner, repo, number, reviewID)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, review)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar r *PullRequestReview\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}\n"
  },
  {
    "path": "github/pulls_reviews_test.go",
    "content": "// Copyright 2016 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestPullRequestsService_ListReviews(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/1/reviews\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"id\":1},{\"id\":2}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\treviews, _, err := client.PullRequests.ListReviews(ctx, \"o\", \"r\", 1, opt)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.ListReviews returned error: %v\", err)\n\t}\n\n\twant := []*PullRequestReview{\n\t\t{ID: Ptr(int64(1))},\n\t\t{ID: Ptr(int64(2))},\n\t}\n\tif !cmp.Equal(reviews, want) {\n\t\tt.Errorf(\"PullRequests.ListReviews returned %+v, want %+v\", reviews, want)\n\t}\n\n\tconst methodName = \"ListReviews\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.PullRequests.ListReviews(ctx, \"\\n\", \"\\n\", -1, opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PullRequests.ListReviews(ctx, \"o\", \"r\", 1, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestPullRequestsService_ListReviews_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.PullRequests.ListReviews(ctx, \"%\", \"r\", 1, nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestPullRequestsService_GetReview(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/1/reviews/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\treview, _, err := client.PullRequests.GetReview(ctx, \"o\", \"r\", 1, 1)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.GetReview returned error: %v\", err)\n\t}\n\n\twant := &PullRequestReview{ID: Ptr(int64(1))}\n\tif !cmp.Equal(review, want) {\n\t\tt.Errorf(\"PullRequests.GetReview returned %+v, want %+v\", review, want)\n\t}\n\n\tconst methodName = \"GetReview\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.PullRequests.GetReview(ctx, \"\\n\", \"\\n\", -1, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PullRequests.GetReview(ctx, \"o\", \"r\", 1, 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestPullRequestsService_GetReview_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.PullRequests.GetReview(ctx, \"%\", \"r\", 1, 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestPullRequestsService_DeletePendingReview(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/1/reviews/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\treview, _, err := client.PullRequests.DeletePendingReview(ctx, \"o\", \"r\", 1, 1)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.DeletePendingReview returned error: %v\", err)\n\t}\n\n\twant := &PullRequestReview{ID: Ptr(int64(1))}\n\tif !cmp.Equal(review, want) {\n\t\tt.Errorf(\"PullRequests.DeletePendingReview returned %+v, want %+v\", review, want)\n\t}\n\n\tconst methodName = \"DeletePendingReview\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.PullRequests.DeletePendingReview(ctx, \"\\n\", \"\\n\", -1, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PullRequests.DeletePendingReview(ctx, \"o\", \"r\", 1, 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestPullRequestsService_DeletePendingReview_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.PullRequests.DeletePendingReview(ctx, \"%\", \"r\", 1, 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestPullRequestsService_ListReviewComments(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/1/reviews/1/comments\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"id\":1},{\"id\":2}]`)\n\t})\n\n\tctx := t.Context()\n\tcomments, _, err := client.PullRequests.ListReviewComments(ctx, \"o\", \"r\", 1, 1, nil)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.ListReviewComments returned error: %v\", err)\n\t}\n\n\twant := []*PullRequestComment{\n\t\t{ID: Ptr(int64(1))},\n\t\t{ID: Ptr(int64(2))},\n\t}\n\tif !cmp.Equal(comments, want) {\n\t\tt.Errorf(\"PullRequests.ListReviewComments returned %+v, want %+v\", comments, want)\n\t}\n\n\tconst methodName = \"ListReviewComments\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.PullRequests.ListReviewComments(ctx, \"\\n\", \"\\n\", -1, -1, nil)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PullRequests.ListReviewComments(ctx, \"o\", \"r\", 1, 1, nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestPullRequestsService_ListReviewComments_withOptions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/1/reviews/1/comments\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[]`)\n\t})\n\n\tctx := t.Context()\n\t_, _, err := client.PullRequests.ListReviewComments(ctx, \"o\", \"r\", 1, 1, &ListOptions{Page: 2})\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.ListReviewComments returned error: %v\", err)\n\t}\n\n\tconst methodName = \"ListReviewComments\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.PullRequests.ListReviewComments(ctx, \"\\n\", \"\\n\", -1, -1, &ListOptions{Page: 2})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PullRequests.ListReviewComments(ctx, \"o\", \"r\", 1, 1, &ListOptions{Page: 2})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestPullRequestReviewRequest_isComfortFadePreview(t *testing.T) {\n\tt.Parallel()\n\tpath := \"path/to/file.go\"\n\tbody := \"this is a comment body\"\n\tleft, right := \"LEFT\", \"RIGHT\"\n\tpos1, pos2, pos3 := 1, 2, 3\n\tline1, line2, line3 := 11, 22, 33\n\n\ttests := []struct {\n\t\tname     string\n\t\treview   *PullRequestReviewRequest\n\t\twantErr  error\n\t\twantBool bool\n\t}{{\n\t\tname:     \"empty review\",\n\t\treview:   &PullRequestReviewRequest{},\n\t\twantBool: false,\n\t}, {\n\t\tname:     \"nil comment\",\n\t\treview:   &PullRequestReviewRequest{Comments: []*DraftReviewComment{nil}},\n\t\twantBool: false,\n\t}, {\n\t\tname: \"old-style review\",\n\t\treview: &PullRequestReviewRequest{\n\t\t\tComments: []*DraftReviewComment{{\n\t\t\t\tPath:     &path,\n\t\t\t\tBody:     &body,\n\t\t\t\tPosition: &pos1,\n\t\t\t}, {\n\t\t\t\tPath:     &path,\n\t\t\t\tBody:     &body,\n\t\t\t\tPosition: &pos2,\n\t\t\t}, {\n\t\t\t\tPath:     &path,\n\t\t\t\tBody:     &body,\n\t\t\t\tPosition: &pos3,\n\t\t\t}},\n\t\t},\n\t\twantBool: false,\n\t}, {\n\t\tname: \"new-style review\",\n\t\treview: &PullRequestReviewRequest{\n\t\t\tComments: []*DraftReviewComment{{\n\t\t\t\tPath: &path,\n\t\t\t\tBody: &body,\n\t\t\t\tSide: &right,\n\t\t\t\tLine: &line1,\n\t\t\t}, {\n\t\t\t\tPath: &path,\n\t\t\t\tBody: &body,\n\t\t\t\tSide: &left,\n\t\t\t\tLine: &line2,\n\t\t\t}, {\n\t\t\t\tPath: &path,\n\t\t\t\tBody: &body,\n\t\t\t\tSide: &right,\n\t\t\t\tLine: &line3,\n\t\t\t}},\n\t\t},\n\t\twantBool: true,\n\t}, {\n\t\tname: \"blended comment\",\n\t\treview: &PullRequestReviewRequest{\n\t\t\tComments: []*DraftReviewComment{{\n\t\t\t\tPath:     &path,\n\t\t\t\tBody:     &body,\n\t\t\t\tPosition: &pos1, // can't have both styles.\n\t\t\t\tSide:     &right,\n\t\t\t\tLine:     &line1,\n\t\t\t}},\n\t\t},\n\t\twantErr: ErrMixedCommentStyles,\n\t}, {\n\t\tname: \"position then line\",\n\t\treview: &PullRequestReviewRequest{\n\t\t\tComments: []*DraftReviewComment{{\n\t\t\t\tPath:     &path,\n\t\t\t\tBody:     &body,\n\t\t\t\tPosition: &pos1,\n\t\t\t}, {\n\t\t\t\tPath: &path,\n\t\t\t\tBody: &body,\n\t\t\t\tSide: &right,\n\t\t\t\tLine: &line1,\n\t\t\t}},\n\t\t},\n\t\twantErr: ErrMixedCommentStyles,\n\t}, {\n\t\tname: \"line then position\",\n\t\treview: &PullRequestReviewRequest{\n\t\t\tComments: []*DraftReviewComment{{\n\t\t\t\tPath: &path,\n\t\t\t\tBody: &body,\n\t\t\t\tSide: &right,\n\t\t\t\tLine: &line1,\n\t\t\t}, {\n\t\t\t\tPath:     &path,\n\t\t\t\tBody:     &body,\n\t\t\t\tPosition: &pos1,\n\t\t\t}},\n\t\t},\n\t\twantErr: ErrMixedCommentStyles,\n\t}}\n\n\tfor _, tc := range tests {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tgotBool, gotErr := tc.review.isComfortFadePreview()\n\t\t\tif tc.wantErr != nil {\n\t\t\t\tif !errors.Is(gotErr, tc.wantErr) {\n\t\t\t\t\tt.Errorf(\"isComfortFadePreview() = %v, wanted %v\", gotErr, tc.wantErr)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif gotBool != tc.wantBool {\n\t\t\t\t\tt.Errorf(\"isComfortFadePreview() = %v, wanted %v\", gotBool, tc.wantBool)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestPullRequestsService_ListReviewComments_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.PullRequests.ListReviewComments(ctx, \"%\", \"r\", 1, 1, nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestPullRequestsService_CreateReview(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &PullRequestReviewRequest{\n\t\tCommitID: Ptr(\"commit_id\"),\n\t\tBody:     Ptr(\"b\"),\n\t\tEvent:    Ptr(\"APPROVE\"),\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/1/reviews\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *PullRequestReviewRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\treview, _, err := client.PullRequests.CreateReview(ctx, \"o\", \"r\", 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.CreateReview returned error: %v\", err)\n\t}\n\n\twant := &PullRequestReview{ID: Ptr(int64(1))}\n\tif !cmp.Equal(review, want) {\n\t\tt.Errorf(\"PullRequests.CreateReview returned %+v, want %+v\", review, want)\n\t}\n\n\tconst methodName = \"CreateReview\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.PullRequests.CreateReview(ctx, \"\\n\", \"\\n\", -1, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PullRequests.CreateReview(ctx, \"o\", \"r\", 1, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestPullRequestsService_CreateReview_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.PullRequests.CreateReview(ctx, \"%\", \"r\", 1, &PullRequestReviewRequest{})\n\ttestURLParseError(t, err)\n}\n\nfunc TestPullRequestsService_CreateReview_badReview(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\n\tpath := \"path/to/file.go\"\n\tbody := \"this is a comment body\"\n\tright := \"RIGHT\"\n\tpos1 := 1\n\tline1 := 11\n\tbadReview := &PullRequestReviewRequest{\n\t\tComments: []*DraftReviewComment{{\n\t\t\tPath: &path,\n\t\t\tBody: &body,\n\t\t\tSide: &right,\n\t\t\tLine: &line1,\n\t\t}, {\n\t\t\tPath:     &path,\n\t\t\tBody:     &body,\n\t\t\tPosition: &pos1,\n\t\t}},\n\t}\n\n\t_, _, err := client.PullRequests.CreateReview(ctx, \"o\", \"r\", 1, badReview)\n\tif err == nil {\n\t\tt.Error(\"CreateReview badReview err = nil, want err\")\n\t}\n}\n\nfunc TestPullRequestsService_CreateReview_addHeader(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tpath := \"path/to/file.go\"\n\tbody := \"this is a comment body\"\n\tleft, right := \"LEFT\", \"RIGHT\"\n\tline1, line2, line3 := 11, 22, 33\n\tinput := &PullRequestReviewRequest{\n\t\tComments: []*DraftReviewComment{{\n\t\t\tPath: &path,\n\t\t\tBody: &body,\n\t\t\tSide: &right,\n\t\t\tLine: &line1,\n\t\t}, {\n\t\t\tPath: &path,\n\t\t\tBody: &body,\n\t\t\tSide: &left,\n\t\t\tLine: &line2,\n\t\t}, {\n\t\t\tPath: &path,\n\t\t\tBody: &body,\n\t\t\tSide: &right,\n\t\t\tLine: &line3,\n\t\t}},\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/1/reviews\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *PullRequestReviewRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\n\t_, _, err := client.PullRequests.CreateReview(ctx, \"o\", \"r\", 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"CreateReview addHeader err = %v, want nil\", err)\n\t}\n}\n\nfunc TestPullRequestsService_UpdateReview(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/1/reviews/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.PullRequests.UpdateReview(ctx, \"o\", \"r\", 1, 1, \"updated_body\")\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.UpdateReview returned error: %v\", err)\n\t}\n\n\twant := &PullRequestReview{ID: Ptr(int64(1))}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"PullRequests.UpdateReview = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"UpdateReview\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.PullRequests.UpdateReview(ctx, \"\\n\", \"\\n\", -1, -1, \"updated_body\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PullRequests.UpdateReview(ctx, \"o\", \"r\", 1, 1, \"updated_body\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestPullRequestsService_SubmitReview(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &PullRequestReviewRequest{\n\t\tBody:  Ptr(\"b\"),\n\t\tEvent: Ptr(\"APPROVE\"),\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/1/reviews/1/events\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *PullRequestReviewRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\treview, _, err := client.PullRequests.SubmitReview(ctx, \"o\", \"r\", 1, 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.SubmitReview returned error: %v\", err)\n\t}\n\n\twant := &PullRequestReview{ID: Ptr(int64(1))}\n\tif !cmp.Equal(review, want) {\n\t\tt.Errorf(\"PullRequests.SubmitReview returned %+v, want %+v\", review, want)\n\t}\n\n\tconst methodName = \"SubmitReview\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.PullRequests.SubmitReview(ctx, \"\\n\", \"\\n\", -1, -1, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PullRequests.SubmitReview(ctx, \"o\", \"r\", 1, 1, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestPullRequestsService_SubmitReview_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.PullRequests.SubmitReview(ctx, \"%\", \"r\", 1, 1, &PullRequestReviewRequest{})\n\ttestURLParseError(t, err)\n}\n\nfunc TestPullRequestsService_DismissReview(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &PullRequestReviewDismissalRequest{Message: Ptr(\"m\")}\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/1/reviews/1/dismissals\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *PullRequestReviewDismissalRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\treview, _, err := client.PullRequests.DismissReview(ctx, \"o\", \"r\", 1, 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.DismissReview returned error: %v\", err)\n\t}\n\n\twant := &PullRequestReview{ID: Ptr(int64(1))}\n\tif !cmp.Equal(review, want) {\n\t\tt.Errorf(\"PullRequests.DismissReview returned %+v, want %+v\", review, want)\n\t}\n\n\tconst methodName = \"ListReviews\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.PullRequests.DismissReview(ctx, \"\\n\", \"\\n\", -1, -1, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PullRequests.DismissReview(ctx, \"o\", \"r\", 1, 1, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestPullRequestsService_DismissReview_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.PullRequests.DismissReview(ctx, \"%\", \"r\", 1, 1, &PullRequestReviewDismissalRequest{})\n\ttestURLParseError(t, err)\n}\n\nfunc TestPullRequestReviewDismissalRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PullRequestReviewDismissalRequest{}, \"{}\")\n\n\tu := &PullRequestReviewDismissalRequest{\n\t\tMessage: Ptr(\"msg\"),\n\t}\n\n\twant := `{\n\t\t\"message\": \"msg\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestDraftReviewComment_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &DraftReviewComment{}, \"{}\")\n\n\tu := &DraftReviewComment{\n\t\tPath:      Ptr(\"path\"),\n\t\tPosition:  Ptr(1),\n\t\tBody:      Ptr(\"body\"),\n\t\tStartSide: Ptr(\"ss\"),\n\t\tSide:      Ptr(\"side\"),\n\t\tStartLine: Ptr(1),\n\t\tLine:      Ptr(1),\n\t}\n\n\twant := `{\n\t\t\"path\": \"path\",\n\t\t\"position\": 1,\n\t\t\"body\": \"body\",\n\t\t\"start_side\": \"ss\",\n\t\t\"side\": \"side\",\n\t\t\"start_line\": 1,\n\t\t\"line\": 1\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPullRequestReviewRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PullRequestReviewRequest{}, \"{}\")\n\n\tu := &PullRequestReviewRequest{\n\t\tNodeID:   Ptr(\"nodeid\"),\n\t\tCommitID: Ptr(\"cid\"),\n\t\tBody:     Ptr(\"body\"),\n\t\tEvent:    Ptr(\"event\"),\n\t\tComments: []*DraftReviewComment{\n\t\t\t{\n\t\t\t\tPath:      Ptr(\"path\"),\n\t\t\t\tPosition:  Ptr(1),\n\t\t\t\tBody:      Ptr(\"body\"),\n\t\t\t\tStartSide: Ptr(\"ss\"),\n\t\t\t\tSide:      Ptr(\"side\"),\n\t\t\t\tStartLine: Ptr(1),\n\t\t\t\tLine:      Ptr(1),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"node_id\": \"nodeid\",\n\t\t\"commit_id\": \"cid\",\n\t\t\"body\": \"body\",\n\t\t\"event\": \"event\",\n\t\t\"comments\": [\n\t\t\t{\n\t\t\t\t\"path\": \"path\",\n\t\t\t\t\"position\": 1,\n\t\t\t\t\"body\": \"body\",\n\t\t\t\t\"start_side\": \"ss\",\n\t\t\t\t\"side\": \"side\",\n\t\t\t\t\"start_line\": 1,\n\t\t\t\t\"line\": 1\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPullRequestReview_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PullRequestReview{}, \"{}\")\n\n\tu := &PullRequestReview{\n\t\tID:     Ptr(int64(1)),\n\t\tNodeID: Ptr(\"nid\"),\n\t\tUser: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t\tBody:              Ptr(\"body\"),\n\t\tSubmittedAt:       &Timestamp{referenceTime},\n\t\tCommitID:          Ptr(\"cid\"),\n\t\tHTMLURL:           Ptr(\"hurl\"),\n\t\tPullRequestURL:    Ptr(\"prurl\"),\n\t\tState:             Ptr(\"state\"),\n\t\tAuthorAssociation: Ptr(\"aa\"),\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"node_id\": \"nid\",\n\t\t\"user\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"body\": \"body\",\n\t\t\"submitted_at\": ` + referenceTimeStr + `,\n\t\t\"commit_id\": \"cid\",\n\t\t\"html_url\": \"hurl\",\n\t\t\"pull_request_url\": \"prurl\",\n\t\t\"state\": \"state\",\n\t\t\"author_association\": \"aa\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/pulls_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestPullRequestsService_List(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pulls\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"state\":     \"closed\",\n\t\t\t\"head\":      \"h\",\n\t\t\t\"base\":      \"b\",\n\t\t\t\"sort\":      \"created\",\n\t\t\t\"direction\": \"desc\",\n\t\t\t\"page\":      \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"number\":1}]`)\n\t})\n\n\topts := &PullRequestListOptions{\"closed\", \"h\", \"b\", \"created\", \"desc\", ListOptions{Page: 2}}\n\tctx := t.Context()\n\tpulls, _, err := client.PullRequests.List(ctx, \"o\", \"r\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.List returned error: %v\", err)\n\t}\n\n\twant := []*PullRequest{{Number: Ptr(1)}}\n\tif !cmp.Equal(pulls, want) {\n\t\tt.Errorf(\"PullRequests.List returned %+v, want %+v\", pulls, want)\n\t}\n\n\tconst methodName = \"List\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.PullRequests.List(ctx, \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PullRequests.List(ctx, \"o\", \"r\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestPullRequestsService_ListPullRequestsWithCommit(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/commits/sha/pulls\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeListPullsOrBranchesForCommitPreview)\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"number\":1}]`)\n\t})\n\n\topts := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tpulls, _, err := client.PullRequests.ListPullRequestsWithCommit(ctx, \"o\", \"r\", \"sha\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.ListPullRequestsWithCommit returned error: %v\", err)\n\t}\n\n\twant := []*PullRequest{{Number: Ptr(1)}}\n\tif !cmp.Equal(pulls, want) {\n\t\tt.Errorf(\"PullRequests.ListPullRequestsWithCommit returned %+v, want %+v\", pulls, want)\n\t}\n\n\tconst methodName = \"ListPullRequestsWithCommit\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.PullRequests.ListPullRequestsWithCommit(ctx, \"\\n\", \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PullRequests.ListPullRequestsWithCommit(ctx, \"o\", \"r\", \"sha\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestPullRequestsService_List_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.PullRequests.List(ctx, \"%\", \"r\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestPullRequestsService_Get(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"number\":1}`)\n\t})\n\n\tctx := t.Context()\n\tpull, _, err := client.PullRequests.Get(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.Get returned error: %v\", err)\n\t}\n\n\twant := &PullRequest{Number: Ptr(1)}\n\tif !cmp.Equal(pull, want) {\n\t\tt.Errorf(\"PullRequests.Get returned %+v, want %+v\", pull, want)\n\t}\n\n\tconst methodName = \"Get\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.PullRequests.Get(ctx, \"\\n\", \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PullRequests.Get(ctx, \"o\", \"r\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestPullRequestsService_GetRaw_diff(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tconst rawStr = \"@@diff content\"\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeV3Diff)\n\t\tfmt.Fprint(w, rawStr)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.PullRequests.GetRaw(ctx, \"o\", \"r\", 1, RawOptions{Diff})\n\tif err != nil {\n\t\tt.Fatalf(\"PullRequests.GetRaw returned error: %v\", err)\n\t}\n\twant := rawStr\n\tif got != want {\n\t\tt.Errorf(\"PullRequests.GetRaw returned %v want %v\", got, want)\n\t}\n\n\tconst methodName = \"GetRaw\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.PullRequests.GetRaw(ctx, \"\\n\", \"\\n\", -1, RawOptions{Diff})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PullRequests.GetRaw(ctx, \"o\", \"r\", 1, RawOptions{Diff})\n\t\tif got != \"\" {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestPullRequestsService_GetRaw_patch(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tconst rawStr = \"@@patch content\"\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeV3Patch)\n\t\tfmt.Fprint(w, rawStr)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.PullRequests.GetRaw(ctx, \"o\", \"r\", 1, RawOptions{Patch})\n\tif err != nil {\n\t\tt.Fatalf(\"PullRequests.GetRaw returned error: %v\", err)\n\t}\n\twant := rawStr\n\tif got != want {\n\t\tt.Errorf(\"PullRequests.GetRaw returned %v want %v\", got, want)\n\t}\n}\n\nfunc TestPullRequestsService_GetRaw_invalid(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.PullRequests.GetRaw(ctx, \"o\", \"r\", 1, RawOptions{100})\n\tif err == nil {\n\t\tt.Fatal(\"PullRequests.GetRaw should return error\")\n\t}\n\tif !strings.Contains(err.Error(), \"unsupported raw type\") {\n\t\tt.Error(\"PullRequests.GetRaw should return unsupported raw type error\")\n\t}\n}\n\nfunc TestPullRequestsService_Get_links(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"number\":1,\n\t\t\t\"_links\":{\n\t\t\t\t\"self\":{\"href\":\"https://api.github.com/repos/octocat/Hello-World/pulls/1347\"},\n\t\t\t\t\"html\":{\"href\":\"https://github.com/octocat/Hello-World/pull/1347\"},\n\t\t\t\t\"issue\":{\"href\":\"https://api.github.com/repos/octocat/Hello-World/issues/1347\"},\n\t\t\t\t\"comments\":{\"href\":\"https://api.github.com/repos/octocat/Hello-World/issues/1347/comments\"},\n\t\t\t\t\"review_comments\":{\"href\":\"https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments\"},\n\t\t\t\t\"review_comment\":{\"href\":\"https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}\"},\n\t\t\t\t\"commits\":{\"href\":\"https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits\"},\n\t\t\t\t\"statuses\":{\"href\":\"https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\"}\n\t\t\t\t}\n\t\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tpull, _, err := client.PullRequests.Get(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.Get returned error: %v\", err)\n\t}\n\n\twant := &PullRequest{\n\t\tNumber: Ptr(1),\n\t\tLinks: &PRLinks{\n\t\t\tSelf: &PRLink{\n\t\t\t\tHRef: Ptr(\"https://api.github.com/repos/octocat/Hello-World/pulls/1347\"),\n\t\t\t}, HTML: &PRLink{\n\t\t\t\tHRef: Ptr(\"https://github.com/octocat/Hello-World/pull/1347\"),\n\t\t\t}, Issue: &PRLink{\n\t\t\t\tHRef: Ptr(\"https://api.github.com/repos/octocat/Hello-World/issues/1347\"),\n\t\t\t}, Comments: &PRLink{\n\t\t\t\tHRef: Ptr(\"https://api.github.com/repos/octocat/Hello-World/issues/1347/comments\"),\n\t\t\t}, ReviewComments: &PRLink{\n\t\t\t\tHRef: Ptr(\"https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments\"),\n\t\t\t}, ReviewComment: &PRLink{\n\t\t\t\tHRef: Ptr(\"https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}\"),\n\t\t\t}, Commits: &PRLink{\n\t\t\t\tHRef: Ptr(\"https://api.github.com/repos/octocat/Hello-World/pulls/1347/commits\"),\n\t\t\t}, Statuses: &PRLink{\n\t\t\t\tHRef: Ptr(\"https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\"),\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(pull, want) {\n\t\tt.Errorf(\"PullRequests.Get returned %+v, want %+v\", pull, want)\n\t}\n}\n\nfunc TestPullRequestsService_Get_headAndBase(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"number\":1,\"head\":{\"ref\":\"r2\",\"repo\":{\"id\":2}},\"base\":{\"ref\":\"r1\",\"repo\":{\"id\":1}}}`)\n\t})\n\n\tctx := t.Context()\n\tpull, _, err := client.PullRequests.Get(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.Get returned error: %v\", err)\n\t}\n\n\twant := &PullRequest{\n\t\tNumber: Ptr(1),\n\t\tHead: &PullRequestBranch{\n\t\t\tRef:  Ptr(\"r2\"),\n\t\t\tRepo: &Repository{ID: Ptr(int64(2))},\n\t\t},\n\t\tBase: &PullRequestBranch{\n\t\t\tRef:  Ptr(\"r1\"),\n\t\t\tRepo: &Repository{ID: Ptr(int64(1))},\n\t\t},\n\t}\n\tif !cmp.Equal(pull, want) {\n\t\tt.Errorf(\"PullRequests.Get returned %+v, want %+v\", pull, want)\n\t}\n}\n\nfunc TestPullRequestsService_Get_urlFields(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"number\":1,\n\t\t\t\"url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1347\",\n\t\t\t\"html_url\": \"https://github.com/octocat/Hello-World/pull/1347\",\n\t\t\t\"issue_url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n\t\t\t\"statuses_url\": \"https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n\t\t\t\"diff_url\": \"https://github.com/octocat/Hello-World/pull/1347.diff\",\n\t\t\t\"patch_url\": \"https://github.com/octocat/Hello-World/pull/1347.patch\",\n\t\t\t\"review_comments_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments\",\n\t\t\t\"review_comment_url\": \"https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}\"}`)\n\t})\n\n\tctx := t.Context()\n\tpull, _, err := client.PullRequests.Get(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.Get returned error: %v\", err)\n\t}\n\n\twant := &PullRequest{\n\t\tNumber:            Ptr(1),\n\t\tURL:               Ptr(\"https://api.github.com/repos/octocat/Hello-World/pulls/1347\"),\n\t\tHTMLURL:           Ptr(\"https://github.com/octocat/Hello-World/pull/1347\"),\n\t\tIssueURL:          Ptr(\"https://api.github.com/repos/octocat/Hello-World/issues/1347\"),\n\t\tStatusesURL:       Ptr(\"https://api.github.com/repos/octocat/Hello-World/statuses/6dcb09b5b57875f334f61aebed695e2e4193db5e\"),\n\t\tDiffURL:           Ptr(\"https://github.com/octocat/Hello-World/pull/1347.diff\"),\n\t\tPatchURL:          Ptr(\"https://github.com/octocat/Hello-World/pull/1347.patch\"),\n\t\tReviewCommentsURL: Ptr(\"https://api.github.com/repos/octocat/Hello-World/pulls/1347/comments\"),\n\t\tReviewCommentURL:  Ptr(\"https://api.github.com/repos/octocat/Hello-World/pulls/comments{/number}\"),\n\t}\n\n\tif !cmp.Equal(pull, want) {\n\t\tt.Errorf(\"PullRequests.Get returned %+v, want %+v\", pull, want)\n\t}\n}\n\nfunc TestPullRequestsService_Get_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.PullRequests.Get(ctx, \"%\", \"r\", 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestPullRequestsService_Create(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &NewPullRequest{Title: Ptr(\"t\")}\n\n\tmux.HandleFunc(\"/repos/o/r/pulls\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *NewPullRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"number\":1}`)\n\t})\n\n\tctx := t.Context()\n\tpull, _, err := client.PullRequests.Create(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.Create returned error: %v\", err)\n\t}\n\n\twant := &PullRequest{Number: Ptr(1)}\n\tif !cmp.Equal(pull, want) {\n\t\tt.Errorf(\"PullRequests.Create returned %+v, want %+v\", pull, want)\n\t}\n\n\tconst methodName = \"Create\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.PullRequests.Create(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PullRequests.Create(ctx, \"o\", \"r\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestPullRequestsService_Create_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.PullRequests.Create(ctx, \"%\", \"r\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestPullRequestsService_UpdateBranch(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/1/update-branch\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeUpdatePullRequestBranchPreview)\n\t\tfmt.Fprint(w, `\n\t\t\t{\n\t\t\t  \"message\": \"Updating pull request branch.\",\n\t\t\t  \"url\": \"https://github.com/repos/o/r/pulls/1\"\n\t\t\t}`)\n\t})\n\n\topts := &PullRequestBranchUpdateOptions{\n\t\tExpectedHeadSHA: Ptr(\"s\"),\n\t}\n\n\tctx := t.Context()\n\tpull, _, err := client.PullRequests.UpdateBranch(ctx, \"o\", \"r\", 1, opts)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.UpdateBranch returned error: %v\", err)\n\t}\n\n\twant := &PullRequestBranchUpdateResponse{\n\t\tMessage: Ptr(\"Updating pull request branch.\"),\n\t\tURL:     Ptr(\"https://github.com/repos/o/r/pulls/1\"),\n\t}\n\n\tif !cmp.Equal(pull, want) {\n\t\tt.Errorf(\"PullRequests.UpdateBranch returned %+v, want %+v\", pull, want)\n\t}\n\n\tconst methodName = \"UpdateBranch\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.PullRequests.UpdateBranch(ctx, \"\\n\", \"\\n\", -1, opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PullRequests.UpdateBranch(ctx, \"o\", \"r\", 1, opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestPullRequestsService_Edit(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\ttests := []struct {\n\t\tinput        *PullRequest\n\t\tsendResponse string\n\n\t\twantUpdate string\n\t\twant       *PullRequest\n\t}{\n\t\t{\n\t\t\tinput:        &PullRequest{Title: Ptr(\"t\")},\n\t\t\tsendResponse: `{\"number\":1}`,\n\t\t\twantUpdate:   `{\"title\":\"t\"}`,\n\t\t\twant:         &PullRequest{Number: Ptr(1)},\n\t\t},\n\t\t{\n\t\t\t// base update\n\t\t\tinput:        &PullRequest{Base: &PullRequestBranch{Ref: Ptr(\"master\")}},\n\t\t\tsendResponse: `{\"number\":1,\"base\":{\"ref\":\"master\"}}`,\n\t\t\twantUpdate:   `{\"base\":\"master\"}`,\n\t\t\twant: &PullRequest{\n\t\t\t\tNumber: Ptr(1),\n\t\t\t\tBase:   &PullRequestBranch{Ref: Ptr(\"master\")},\n\t\t\t},\n\t\t},\n\t}\n\n\tfor i, tt := range tests {\n\t\tmadeRequest := false\n\t\tmux.HandleFunc(fmt.Sprintf(\"/repos/o/r/pulls/%v\", i), func(w http.ResponseWriter, r *http.Request) {\n\t\t\ttestMethod(t, r, \"PATCH\")\n\t\t\ttestBody(t, r, tt.wantUpdate+\"\\n\")\n\t\t\t_, err := io.WriteString(w, tt.sendResponse)\n\t\t\tassertNilError(t, err)\n\t\t\tmadeRequest = true\n\t\t})\n\n\t\tctx := t.Context()\n\t\tpull, _, err := client.PullRequests.Edit(ctx, \"o\", \"r\", i, tt.input)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%v: PullRequests.Edit returned error: %v\", i, err)\n\t\t}\n\n\t\tif !cmp.Equal(pull, tt.want) {\n\t\t\tt.Errorf(\"%v: PullRequests.Edit returned %+v, want %+v\", i, pull, tt.want)\n\t\t}\n\n\t\tif !madeRequest {\n\t\t\tt.Errorf(\"%v: PullRequest.Edit did not make the expected request\", i)\n\t\t}\n\n\t\tconst methodName = \"Edit\"\n\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t_, _, err = client.PullRequests.Edit(ctx, \"\\n\", \"\\n\", -i, tt.input)\n\t\t\treturn err\n\t\t})\n\t}\n\ttestNewRequestAndDoFailure(t, \"Edit\", client, func() (*Response, error) {\n\t\tgot, resp, err := client.PullRequests.Edit(t.Context(), \"o\", \"r\", 1, &PullRequest{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", \"Edit\", got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestPullRequestsService_Edit_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.PullRequests.Edit(ctx, \"%\", \"r\", 1, &PullRequest{})\n\ttestURLParseError(t, err)\n}\n\nfunc TestPullRequestsService_ListCommits(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/1/commits\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `\n\t\t\t[\n\t\t\t  {\n\t\t\t    \"sha\": \"3\",\n\t\t\t    \"parents\": [\n\t\t\t      {\n\t\t\t        \"sha\": \"2\"\n\t\t\t      }\n\t\t\t    ]\n\t\t\t  },\n\t\t\t  {\n\t\t\t    \"sha\": \"2\",\n\t\t\t    \"parents\": [\n\t\t\t      {\n\t\t\t        \"sha\": \"1\"\n\t\t\t      }\n\t\t\t    ]\n\t\t\t  }\n\t\t\t]`)\n\t})\n\n\topts := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tcommits, _, err := client.PullRequests.ListCommits(ctx, \"o\", \"r\", 1, opts)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.ListCommits returned error: %v\", err)\n\t}\n\n\twant := []*RepositoryCommit{\n\t\t{\n\t\t\tSHA: Ptr(\"3\"),\n\t\t\tParents: []*Commit{\n\t\t\t\t{\n\t\t\t\t\tSHA: Ptr(\"2\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tSHA: Ptr(\"2\"),\n\t\t\tParents: []*Commit{\n\t\t\t\t{\n\t\t\t\t\tSHA: Ptr(\"1\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(commits, want) {\n\t\tt.Errorf(\"PullRequests.ListCommits returned %+v, want %+v\", commits, want)\n\t}\n\n\tconst methodName = \"ListCommits\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.PullRequests.ListCommits(ctx, \"\\n\", \"\\n\", -1, opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PullRequests.ListCommits(ctx, \"o\", \"r\", 1, opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestPullRequestsService_ListFiles(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/1/files\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `\n\t\t\t[\n\t\t\t  {\n\t\t\t    \"sha\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n\t\t\t    \"filename\": \"file1.txt\",\n\t\t\t    \"status\": \"added\",\n\t\t\t    \"additions\": 103,\n\t\t\t    \"deletions\": 21,\n\t\t\t    \"changes\": 124,\n\t\t\t    \"patch\": \"@@ -132,7 +132,7 @@ module Test @@ -1000,7 +1000,7 @@ module Test\"\n\t\t\t  },\n\t\t\t  {\n\t\t\t    \"sha\": \"f61aebed695e2e4193db5e6dcb09b5b57875f334\",\n\t\t\t    \"filename\": \"file2.txt\",\n\t\t\t    \"status\": \"modified\",\n\t\t\t    \"additions\": 5,\n\t\t\t    \"deletions\": 3,\n\t\t\t    \"changes\": 103,\n\t\t\t    \"patch\": \"@@ -132,7 +132,7 @@ module Test @@ -1000,7 +1000,7 @@ module Test\"\n\t\t\t  }\n\t\t\t]`)\n\t})\n\n\topts := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tcommitFiles, _, err := client.PullRequests.ListFiles(ctx, \"o\", \"r\", 1, opts)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.ListFiles returned error: %v\", err)\n\t}\n\n\twant := []*CommitFile{\n\t\t{\n\t\t\tSHA:       Ptr(\"6dcb09b5b57875f334f61aebed695e2e4193db5e\"),\n\t\t\tFilename:  Ptr(\"file1.txt\"),\n\t\t\tAdditions: Ptr(103),\n\t\t\tDeletions: Ptr(21),\n\t\t\tChanges:   Ptr(124),\n\t\t\tStatus:    Ptr(\"added\"),\n\t\t\tPatch:     Ptr(\"@@ -132,7 +132,7 @@ module Test @@ -1000,7 +1000,7 @@ module Test\"),\n\t\t},\n\t\t{\n\t\t\tSHA:       Ptr(\"f61aebed695e2e4193db5e6dcb09b5b57875f334\"),\n\t\t\tFilename:  Ptr(\"file2.txt\"),\n\t\t\tAdditions: Ptr(5),\n\t\t\tDeletions: Ptr(3),\n\t\t\tChanges:   Ptr(103),\n\t\t\tStatus:    Ptr(\"modified\"),\n\t\t\tPatch:     Ptr(\"@@ -132,7 +132,7 @@ module Test @@ -1000,7 +1000,7 @@ module Test\"),\n\t\t},\n\t}\n\n\tif !cmp.Equal(commitFiles, want) {\n\t\tt.Errorf(\"PullRequests.ListFiles returned %+v, want %+v\", commitFiles, want)\n\t}\n\n\tconst methodName = \"ListFiles\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.PullRequests.ListFiles(ctx, \"\\n\", \"\\n\", -1, opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PullRequests.ListFiles(ctx, \"o\", \"r\", 1, opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestPullRequestsService_IsMerged(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/1/merge\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tisMerged, _, err := client.PullRequests.IsMerged(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.IsMerged returned error: %v\", err)\n\t}\n\n\twant := true\n\tif !cmp.Equal(isMerged, want) {\n\t\tt.Errorf(\"PullRequests.IsMerged returned %+v, want %+v\", isMerged, want)\n\t}\n\n\tconst methodName = \"IsMerged\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.PullRequests.IsMerged(ctx, \"\\n\", \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PullRequests.IsMerged(ctx, \"o\", \"r\", 1)\n\t\tif got {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want false\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestPullRequestsService_Merge(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/1/merge\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tfmt.Fprint(w, `\n\t\t\t{\n\t\t\t  \"sha\": \"6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n\t\t\t  \"merged\": true,\n\t\t\t  \"message\": \"Pull Request successfully merged\"\n\t\t\t}`)\n\t})\n\n\toptions := &PullRequestOptions{MergeMethod: \"rebase\"}\n\tctx := t.Context()\n\tmerge, _, err := client.PullRequests.Merge(ctx, \"o\", \"r\", 1, \"merging pull request\", options)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequests.Merge returned error: %v\", err)\n\t}\n\n\twant := &PullRequestMergeResult{\n\t\tSHA:     Ptr(\"6dcb09b5b57875f334f61aebed695e2e4193db5e\"),\n\t\tMerged:  Ptr(true),\n\t\tMessage: Ptr(\"Pull Request successfully merged\"),\n\t}\n\tif !cmp.Equal(merge, want) {\n\t\tt.Errorf(\"PullRequests.Merge returned %+v, want %+v\", merge, want)\n\t}\n\n\tconst methodName = \"Merge\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.PullRequests.Merge(ctx, \"\\n\", \"\\n\", -1, \"\\n\", options)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.PullRequests.Merge(ctx, \"o\", \"r\", 1, \"merging pull request\", options)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\n// Test that different merge options produce expected PUT requests. See issue https://github.com/google/go-github/issues/500.\nfunc TestPullRequestsService_Merge_options(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\ttests := []struct {\n\t\toptions  *PullRequestOptions\n\t\twantBody string\n\t}{\n\t\t{\n\t\t\toptions:  nil,\n\t\t\twantBody: `{\"commit_message\":\"merging pull request\"}`,\n\t\t},\n\t\t{\n\t\t\toptions:  &PullRequestOptions{},\n\t\t\twantBody: `{\"commit_message\":\"merging pull request\"}`,\n\t\t},\n\t\t{\n\t\t\toptions:  &PullRequestOptions{MergeMethod: \"rebase\"},\n\t\t\twantBody: `{\"commit_message\":\"merging pull request\",\"merge_method\":\"rebase\"}`,\n\t\t},\n\t\t{\n\t\t\toptions:  &PullRequestOptions{SHA: \"6dcb09b5b57875f334f61aebed695e2e4193db5e\"},\n\t\t\twantBody: `{\"commit_message\":\"merging pull request\",\"sha\":\"6dcb09b5b57875f334f61aebed695e2e4193db5e\"}`,\n\t\t},\n\t\t{\n\t\t\toptions: &PullRequestOptions{\n\t\t\t\tCommitTitle: \"Extra detail\",\n\t\t\t\tSHA:         \"6dcb09b5b57875f334f61aebed695e2e4193db5e\",\n\t\t\t\tMergeMethod: \"squash\",\n\t\t\t},\n\t\t\twantBody: `{\"commit_message\":\"merging pull request\",\"commit_title\":\"Extra detail\",\"merge_method\":\"squash\",\"sha\":\"6dcb09b5b57875f334f61aebed695e2e4193db5e\"}`,\n\t\t},\n\t\t{\n\t\t\toptions: &PullRequestOptions{\n\t\t\t\tDontDefaultIfBlank: true,\n\t\t\t},\n\t\t\twantBody: `{\"commit_message\":\"merging pull request\"}`,\n\t\t},\n\t}\n\n\tfor i, test := range tests {\n\t\tmadeRequest := false\n\t\tmux.HandleFunc(fmt.Sprintf(\"/repos/o/r/pulls/%v/merge\", i), func(_ http.ResponseWriter, r *http.Request) {\n\t\t\ttestMethod(t, r, \"PUT\")\n\t\t\ttestBody(t, r, test.wantBody+\"\\n\")\n\t\t\tmadeRequest = true\n\t\t})\n\t\tctx := t.Context()\n\t\t_, _, _ = client.PullRequests.Merge(ctx, \"o\", \"r\", i, \"merging pull request\", test.options)\n\t\tif !madeRequest {\n\t\t\tt.Errorf(\"%v: PullRequests.Merge(%#v): expected request was not made\", i, test.options)\n\t\t}\n\t}\n}\n\nfunc TestPullRequestsService_Merge_Blank_Message(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmadeRequest := false\n\texpectedBody := \"\"\n\tmux.HandleFunc(\"/repos/o/r/pulls/1/merge\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestBody(t, r, expectedBody+\"\\n\")\n\t\tmadeRequest = true\n\t})\n\n\tctx := t.Context()\n\texpectedBody = `{}`\n\t_, _, _ = client.PullRequests.Merge(ctx, \"o\", \"r\", 1, \"\", nil)\n\tif !madeRequest {\n\t\tt.Error(\"TestPullRequestsService_Merge_Blank_Message #1 did not make request\")\n\t}\n\n\tmadeRequest = false\n\topts := PullRequestOptions{\n\t\tDontDefaultIfBlank: true,\n\t}\n\texpectedBody = `{\"commit_message\":\"\"}`\n\t_, _, _ = client.PullRequests.Merge(ctx, \"o\", \"r\", 1, \"\", &opts)\n\tif !madeRequest {\n\t\tt.Error(\"TestPullRequestsService_Merge_Blank_Message #2 did not make request\")\n\t}\n}\n\nfunc TestPullRequestMergeRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &pullRequestMergeRequest{}, \"{}\")\n\n\tu := &pullRequestMergeRequest{\n\t\tCommitMessage: Ptr(\"cm\"),\n\t\tCommitTitle:   \"ct\",\n\t\tMergeMethod:   \"mm\",\n\t\tSHA:           \"sha\",\n\t}\n\n\twant := `{\n\t\t\"commit_message\": \"cm\",\n\t\t\"commit_title\": \"ct\",\n\t\t\"merge_method\": \"mm\",\n\t\t\"sha\": \"sha\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPullRequestMergeResult_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PullRequestMergeResult{}, \"{}\")\n\n\tu := &PullRequestMergeResult{\n\t\tSHA:     Ptr(\"sha\"),\n\t\tMerged:  Ptr(false),\n\t\tMessage: Ptr(\"msg\"),\n\t}\n\n\twant := `{\n\t\t\"sha\": \"sha\",\n\t\t\"merged\": false,\n\t\t\"message\": \"msg\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPullRequestUpdate_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &pullRequestUpdate{}, \"{}\")\n\n\tu := &pullRequestUpdate{\n\t\tTitle:               Ptr(\"title\"),\n\t\tBody:                Ptr(\"body\"),\n\t\tState:               Ptr(\"state\"),\n\t\tBase:                Ptr(\"base\"),\n\t\tMaintainerCanModify: Ptr(false),\n\t}\n\n\twant := `{\n\t\t\"title\": \"title\",\n\t\t\"body\": \"body\",\n\t\t\"state\": \"state\",\n\t\t\"base\": \"base\",\n\t\t\"maintainer_can_modify\": false\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPullRequestBranchUpdateResponse_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PullRequestBranchUpdateResponse{}, \"{}\")\n\n\tu := &PullRequestBranchUpdateResponse{\n\t\tMessage: Ptr(\"message\"),\n\t\tURL:     Ptr(\"url\"),\n\t}\n\n\twant := `{\n\t\t\"message\": \"message\",\n\t\t\"url\": \"url\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPullRequestBranchUpdateOptions_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PullRequestBranchUpdateOptions{}, \"{}\")\n\n\tu := &PullRequestBranchUpdateOptions{\n\t\tExpectedHeadSHA: Ptr(\"eh\"),\n\t}\n\n\twant := `{\n\t\t\"expected_head_sha\": \"eh\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestNewPullRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &NewPullRequest{}, \"{}\")\n\n\tu := &NewPullRequest{\n\t\tTitle:               Ptr(\"eh\"),\n\t\tHead:                Ptr(\"eh\"),\n\t\tHeadRepo:            Ptr(\"eh\"),\n\t\tBase:                Ptr(\"eh\"),\n\t\tBody:                Ptr(\"eh\"),\n\t\tIssue:               Ptr(1),\n\t\tMaintainerCanModify: Ptr(false),\n\t\tDraft:               Ptr(false),\n\t}\n\n\twant := `{\n\t\t\"title\": \"eh\",\n\t\t\"head\": \"eh\",\n\t\t\"head_repo\": \"eh\",\n\t\t\"base\": \"eh\",\n\t\t\"body\": \"eh\",\n\t\t\"issue\": 1,\n\t\t\"maintainer_can_modify\": false,\n\t\t\"draft\": false\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPullRequestBranch_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PullRequestBranch{}, \"{}\")\n\n\tu := &PullRequestBranch{\n\t\tLabel: Ptr(\"label\"),\n\t\tRef:   Ptr(\"ref\"),\n\t\tSHA:   Ptr(\"sha\"),\n\t\tRepo:  &Repository{ID: Ptr(int64(1))},\n\t\tUser: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"label\": \"label\",\n\t\t\"ref\": \"ref\",\n\t\t\"sha\": \"sha\",\n\t\t\"repo\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"user\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPRLink_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PRLink{}, \"{}\")\n\n\tu := &PRLink{\n\t\tHRef: Ptr(\"href\"),\n\t}\n\n\twant := `{\n\t\t\"href\": \"href\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPRLinks_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PRLinks{}, \"{}\")\n\n\tu := &PRLinks{\n\t\tSelf: &PRLink{\n\t\t\tHRef: Ptr(\"href\"),\n\t\t},\n\t\tHTML: &PRLink{\n\t\t\tHRef: Ptr(\"href\"),\n\t\t},\n\t\tIssue: &PRLink{\n\t\t\tHRef: Ptr(\"href\"),\n\t\t},\n\t\tComments: &PRLink{\n\t\t\tHRef: Ptr(\"href\"),\n\t\t},\n\t\tReviewComments: &PRLink{\n\t\t\tHRef: Ptr(\"href\"),\n\t\t},\n\t\tReviewComment: &PRLink{\n\t\t\tHRef: Ptr(\"href\"),\n\t\t},\n\t\tCommits: &PRLink{\n\t\t\tHRef: Ptr(\"href\"),\n\t\t},\n\t\tStatuses: &PRLink{\n\t\t\tHRef: Ptr(\"href\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"self\": {\n\t\t\t\"href\": \"href\"\n\t\t},\n\t\t\"html\": {\n\t\t\t\"href\": \"href\"\n\t\t},\n\t\t\"issue\": {\n\t\t\t\"href\": \"href\"\n\t\t},\n\t\t\"comments\": {\n\t\t\t\"href\": \"href\"\n\t\t},\n\t\t\"review_comments\": {\n\t\t\t\"href\": \"href\"\n\t\t},\n\t\t\"review_comment\": {\n\t\t\t\"href\": \"href\"\n\t\t},\n\t\t\"commits\": {\n\t\t\t\"href\": \"href\"\n\t\t},\n\t\t\"statuses\": {\n\t\t\t\"href\": \"href\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPullRequestAutoMerge_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PullRequestAutoMerge{}, \"{}\")\n\n\tu := &PullRequestAutoMerge{\n\t\tEnabledBy: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t\tMergeMethod:   Ptr(\"mm\"),\n\t\tCommitTitle:   Ptr(\"ct\"),\n\t\tCommitMessage: Ptr(\"cm\"),\n\t}\n\n\twant := `{\n\t\t\"enabled_by\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"merge_method\": \"mm\",\n\t\t\"commit_title\": \"ct\",\n\t\t\"commit_message\": \"cm\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPullRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PullRequest{}, \"{}\")\n\n\tu := &PullRequest{\n\t\tID:        Ptr(int64(1)),\n\t\tNumber:    Ptr(1),\n\t\tState:     Ptr(\"state\"),\n\t\tLocked:    Ptr(false),\n\t\tTitle:     Ptr(\"title\"),\n\t\tBody:      Ptr(\"body\"),\n\t\tCreatedAt: &Timestamp{referenceTime},\n\t\tUpdatedAt: &Timestamp{referenceTime},\n\t\tClosedAt:  &Timestamp{referenceTime},\n\t\tMergedAt:  &Timestamp{referenceTime},\n\t\tLabels:    []*Label{{ID: Ptr(int64(1))}},\n\t\tUser: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t\tDraft:          Ptr(false),\n\t\tMerged:         Ptr(false),\n\t\tMergeable:      Ptr(false),\n\t\tMergeableState: Ptr(\"ms\"),\n\t\tMergedBy: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t\tMergeCommitSHA:    Ptr(\"mcs\"),\n\t\tRebaseable:        Ptr(false),\n\t\tComments:          Ptr(1),\n\t\tCommits:           Ptr(1),\n\t\tAdditions:         Ptr(1),\n\t\tDeletions:         Ptr(1),\n\t\tChangedFiles:      Ptr(1),\n\t\tURL:               Ptr(\"url\"),\n\t\tHTMLURL:           Ptr(\"hurl\"),\n\t\tIssueURL:          Ptr(\"iurl\"),\n\t\tStatusesURL:       Ptr(\"surl\"),\n\t\tDiffURL:           Ptr(\"durl\"),\n\t\tPatchURL:          Ptr(\"purl\"),\n\t\tCommitsURL:        Ptr(\"curl\"),\n\t\tCommentsURL:       Ptr(\"comurl\"),\n\t\tReviewCommentsURL: Ptr(\"rcurls\"),\n\t\tReviewCommentURL:  Ptr(\"rcurl\"),\n\t\tReviewComments:    Ptr(1),\n\t\tAssignee: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t\tAssignees: []*User{\n\t\t\t{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t},\n\t\tMilestone:           &Milestone{ID: Ptr(int64(1))},\n\t\tMaintainerCanModify: Ptr(true),\n\t\tAuthorAssociation:   Ptr(\"aa\"),\n\t\tNodeID:              Ptr(\"nid\"),\n\t\tRequestedReviewers: []*User{\n\t\t\t{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t},\n\t\tAutoMerge: &PullRequestAutoMerge{\n\t\t\tEnabledBy: &User{\n\t\t\t\tLogin:           Ptr(\"l\"),\n\t\t\t\tID:              Ptr(int64(1)),\n\t\t\t\tURL:             Ptr(\"u\"),\n\t\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\t\tName:            Ptr(\"n\"),\n\t\t\t\tCompany:         Ptr(\"c\"),\n\t\t\t\tBlog:            Ptr(\"b\"),\n\t\t\t\tLocation:        Ptr(\"l\"),\n\t\t\t\tEmail:           Ptr(\"e\"),\n\t\t\t\tHireable:        Ptr(true),\n\t\t\t\tBio:             Ptr(\"b\"),\n\t\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\t\tPublicRepos:     Ptr(1),\n\t\t\t\tFollowers:       Ptr(1),\n\t\t\t\tFollowing:       Ptr(1),\n\t\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t\t},\n\t\t\tMergeMethod:   Ptr(\"mm\"),\n\t\t\tCommitTitle:   Ptr(\"ct\"),\n\t\t\tCommitMessage: Ptr(\"cm\"),\n\t\t},\n\t\tRequestedTeams: []*Team{{ID: Ptr(int64(1))}},\n\t\tLinks: &PRLinks{\n\t\t\tSelf: &PRLink{\n\t\t\t\tHRef: Ptr(\"href\"),\n\t\t\t},\n\t\t\tHTML: &PRLink{\n\t\t\t\tHRef: Ptr(\"href\"),\n\t\t\t},\n\t\t\tIssue: &PRLink{\n\t\t\t\tHRef: Ptr(\"href\"),\n\t\t\t},\n\t\t\tComments: &PRLink{\n\t\t\t\tHRef: Ptr(\"href\"),\n\t\t\t},\n\t\t\tReviewComments: &PRLink{\n\t\t\t\tHRef: Ptr(\"href\"),\n\t\t\t},\n\t\t\tReviewComment: &PRLink{\n\t\t\t\tHRef: Ptr(\"href\"),\n\t\t\t},\n\t\t\tCommits: &PRLink{\n\t\t\t\tHRef: Ptr(\"href\"),\n\t\t\t},\n\t\t\tStatuses: &PRLink{\n\t\t\t\tHRef: Ptr(\"href\"),\n\t\t\t},\n\t\t},\n\t\tHead: &PullRequestBranch{\n\t\t\tRef:  Ptr(\"r2\"),\n\t\t\tRepo: &Repository{ID: Ptr(int64(2))},\n\t\t},\n\t\tBase: &PullRequestBranch{\n\t\t\tRef:  Ptr(\"r2\"),\n\t\t\tRepo: &Repository{ID: Ptr(int64(2))},\n\t\t},\n\t\tActiveLockReason: Ptr(\"alr\"),\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"number\": 1,\n\t\t\"state\": \"state\",\n\t\t\"locked\": false,\n\t\t\"title\": \"title\",\n\t\t\"body\": \"body\",\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"closed_at\": ` + referenceTimeStr + `,\n\t\t\"merged_at\": ` + referenceTimeStr + `,\n\t\t\"labels\": [\n\t\t\t{\n\t\t\t\t\"id\": 1\n\t\t\t}\n\t\t],\n\t\t\"user\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"draft\": false,\n\t\t\"merged\": false,\n\t\t\"mergeable\": false,\n\t\t\"mergeable_state\": \"ms\",\n\t\t\"merged_by\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"merge_commit_sha\": \"mcs\",\n\t\t\"rebaseable\": false,\n\t\t\"comments\": 1,\n\t\t\"commits\": 1,\n\t\t\"additions\": 1,\n\t\t\"deletions\": 1,\n\t\t\"changed_files\": 1,\n\t\t\"url\": \"url\",\n\t\t\"html_url\": \"hurl\",\n\t\t\"issue_url\": \"iurl\",\n\t\t\"statuses_url\": \"surl\",\n\t\t\"diff_url\": \"durl\",\n\t\t\"patch_url\": \"purl\",\n\t\t\"commits_url\": \"curl\",\n\t\t\"comments_url\": \"comurl\",\n\t\t\"review_comments_url\": \"rcurls\",\n\t\t\"review_comment_url\": \"rcurl\",\n\t\t\"review_comments\": 1,\n\t\t\"assignee\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"assignees\": [\n\t\t\t{\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t}\n\t\t],\n\t\t\"milestone\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"maintainer_can_modify\": true,\n\t\t\"author_association\": \"aa\",\n\t\t\"node_id\": \"nid\",\n\t\t\"requested_reviewers\": [\n\t\t\t{\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t}\n\t\t],\n\t\t\"auto_merge\": {\n\t\t\t\"enabled_by\": {\n\t\t\t\t\"login\": \"l\",\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"company\": \"c\",\n\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\"location\": \"l\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"hireable\": true,\n\t\t\t\t\"bio\": \"b\",\n\t\t\t\t\"twitter_username\": \"t\",\n\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\"followers\": 1,\n\t\t\t\t\"following\": 1,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"url\": \"u\"\n\t\t\t},\n\t\t\t\"merge_method\": \"mm\",\n\t\t\t\"commit_title\": \"ct\",\n\t\t\t\"commit_message\": \"cm\"\n\t\t},\n\t\t\"requested_teams\": [\n\t\t\t{\n\t\t\t\t\"id\": 1\n\t\t\t}\n\t\t],\n\t\t\"_links\": {\n\t\t\t\"self\": {\n\t\t\t\t\"href\": \"href\"\n\t\t\t},\n\t\t\t\"html\": {\n\t\t\t\t\"href\": \"href\"\n\t\t\t},\n\t\t\t\"issue\": {\n\t\t\t\t\"href\": \"href\"\n\t\t\t},\n\t\t\t\"comments\": {\n\t\t\t\t\"href\": \"href\"\n\t\t\t},\n\t\t\t\"review_comments\": {\n\t\t\t\t\"href\": \"href\"\n\t\t\t},\n\t\t\t\"review_comment\": {\n\t\t\t\t\"href\": \"href\"\n\t\t\t},\n\t\t\t\"commits\": {\n\t\t\t\t\"href\": \"href\"\n\t\t\t},\n\t\t\t\"statuses\": {\n\t\t\t\t\"href\": \"href\"\n\t\t\t}\n\t\t},\n\t\t\"head\": {\n\t\t\t\"ref\": \"r2\",\n\t\t\t\"repo\": {\n\t\t\t\t\"id\": 2\n\t\t\t}\n\t\t},\n\t\t\"base\": {\n\t\t\t\"ref\": \"r2\",\n\t\t\t\"repo\": {\n\t\t\t\t\"id\": 2\n\t\t\t}\n\t\t},\n\t\t\"active_lock_reason\": \"alr\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/pulls_threads.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\n// PullRequestThread represents a thread of comments on a pull request.\ntype PullRequestThread struct {\n\tID       *int64                `json:\"id,omitempty\"`\n\tNodeID   *string               `json:\"node_id,omitempty\"`\n\tComments []*PullRequestComment `json:\"comments,omitempty\"`\n}\n\nfunc (p PullRequestThread) String() string {\n\treturn Stringify(p)\n}\n"
  },
  {
    "path": "github/pulls_threads_test.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestPullRequestThread_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PullRequestThread{}, \"{}\")\n\n\tcreatedAt := Timestamp{time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC)}\n\tupdatedAt := Timestamp{time.Date(2002, time.February, 10, 15, 30, 0, 0, time.UTC)}\n\treactions := &Reactions{\n\t\tTotalCount: Ptr(1),\n\t\tPlusOne:    Ptr(1),\n\t\tMinusOne:   Ptr(0),\n\t\tLaugh:      Ptr(0),\n\t\tConfused:   Ptr(0),\n\t\tHeart:      Ptr(0),\n\t\tHooray:     Ptr(0),\n\t\tRocket:     Ptr(0),\n\t\tEyes:       Ptr(0),\n\t\tURL:        Ptr(\"u\"),\n\t}\n\tuser := &User{\n\t\tLogin:       Ptr(\"ll\"),\n\t\tID:          Ptr(int64(123)),\n\t\tAvatarURL:   Ptr(\"a\"),\n\t\tGravatarID:  Ptr(\"g\"),\n\t\tName:        Ptr(\"n\"),\n\t\tCompany:     Ptr(\"c\"),\n\t\tBlog:        Ptr(\"b\"),\n\t\tLocation:    Ptr(\"l\"),\n\t\tEmail:       Ptr(\"e\"),\n\t\tHireable:    Ptr(true),\n\t\tPublicRepos: Ptr(1),\n\t\tFollowers:   Ptr(1),\n\t\tFollowing:   Ptr(1),\n\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\tURL:         Ptr(\"u\"),\n\t}\n\tcomment := &PullRequestComment{\n\t\tID:                  Ptr(int64(10)),\n\t\tInReplyTo:           Ptr(int64(8)),\n\t\tBody:                Ptr(\"Test comment\"),\n\t\tPath:                Ptr(\"file1.txt\"),\n\t\tDiffHunk:            Ptr(\"@@ -16,33 +16,40 @@ fmt.Println()\"),\n\t\tPullRequestReviewID: Ptr(int64(42)),\n\t\tPosition:            Ptr(1),\n\t\tOriginalPosition:    Ptr(4),\n\t\tStartLine:           Ptr(2),\n\t\tLine:                Ptr(3),\n\t\tOriginalLine:        Ptr(2),\n\t\tOriginalStartLine:   Ptr(2),\n\t\tSide:                Ptr(\"RIGHT\"),\n\t\tStartSide:           Ptr(\"LEFT\"),\n\t\tCommitID:            Ptr(\"ab\"),\n\t\tOriginalCommitID:    Ptr(\"9c\"),\n\t\tUser:                user,\n\t\tReactions:           reactions,\n\t\tCreatedAt:           &createdAt,\n\t\tUpdatedAt:           &updatedAt,\n\t\tURL:                 Ptr(\"pullrequestcommentUrl\"),\n\t\tHTMLURL:             Ptr(\"pullrequestcommentHTMLUrl\"),\n\t\tPullRequestURL:      Ptr(\"pullrequestcommentPullRequestURL\"),\n\t}\n\n\tu := &PullRequestThread{\n\t\tID:       Ptr(int64(1)),\n\t\tNodeID:   Ptr(\"nid\"),\n\t\tComments: []*PullRequestComment{comment, comment},\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"node_id\": \"nid\",\n\t\t\"comments\": [\n\t\t\t{\n\t\t\t\t\"id\": 10,\n\t\t\t\t\"in_reply_to_id\": 8,\n\t\t\t\t\"body\": \"Test comment\",\n\t\t\t\t\"path\": \"file1.txt\",\n\t\t\t\t\"diff_hunk\": \"@@ -16,33 +16,40 @@ fmt.Println()\",\n\t\t\t\t\"pull_request_review_id\": 42,\n\t\t\t\t\"position\": 1,\n\t\t\t\t\"original_position\": 4,\n\t\t\t\t\"start_line\": 2,\n\t\t\t\t\"line\": 3,\n\t\t\t\t\"original_line\": 2,\n\t\t\t\t\"original_start_line\": 2,\n\t\t\t\t\"side\": \"RIGHT\",\n\t\t\t\t\"start_side\": \"LEFT\",\n\t\t\t\t\"commit_id\": \"ab\",\n\t\t\t\t\"original_commit_id\": \"9c\",\n\t\t\t\t\"user\": {\n\t\t\t\t\t\"login\": \"ll\",\n\t\t\t\t\t\"id\": 123,\n\t\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\"company\": \"c\",\n\t\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\t\"location\": \"l\",\n\t\t\t\t\t\"email\": \"e\",\n\t\t\t\t\t\"hireable\": true,\n\t\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\t\"followers\": 1,\n\t\t\t\t\t\"following\": 1,\n\t\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\t\"url\": \"u\"\n\t\t\t\t},\n\t\t\t\t\"reactions\": {\n\t\t\t\t\t\"total_count\": 1,\n\t\t\t\t\t\"+1\": 1,\n\t\t\t\t\t\"-1\": 0,\n\t\t\t\t\t\"laugh\": 0,\n\t\t\t\t\t\"confused\": 0,\n\t\t\t\t\t\"heart\": 0,\n\t\t\t\t\t\"hooray\": 0,\n\t\t\t\t\t\"rocket\": 0,\n\t\t\t\t\t\"eyes\": 0,\n\t\t\t\t\t\"url\": \"u\"\n\t\t\t\t},\n\t\t\t\t\"created_at\": \"2002-02-10T15:30:00Z\",\n\t\t\t\t\"updated_at\": \"2002-02-10T15:30:00Z\",\n\t\t\t\t\"url\": \"pullrequestcommentUrl\",\n\t\t\t\t\"html_url\": \"pullrequestcommentHTMLUrl\",\n\t\t\t\t\"pull_request_url\": \"pullrequestcommentPullRequestURL\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"id\": 10,\n\t\t\t\t\"in_reply_to_id\": 8,\n\t\t\t\t\"body\": \"Test comment\",\n\t\t\t\t\"path\": \"file1.txt\",\n\t\t\t\t\"diff_hunk\": \"@@ -16,33 +16,40 @@ fmt.Println()\",\n\t\t\t\t\"pull_request_review_id\": 42,\n\t\t\t\t\"position\": 1,\n\t\t\t\t\"original_position\": 4,\n\t\t\t\t\"start_line\": 2,\n\t\t\t\t\"line\": 3,\n\t\t\t\t\"original_line\": 2,\n\t\t\t\t\"original_start_line\": 2,\n\t\t\t\t\"side\": \"RIGHT\",\n\t\t\t\t\"start_side\": \"LEFT\",\n\t\t\t\t\"commit_id\": \"ab\",\n\t\t\t\t\"original_commit_id\": \"9c\",\n\t\t\t\t\"user\": {\n\t\t\t\t\t\"login\": \"ll\",\n\t\t\t\t\t\"id\": 123,\n\t\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\t\t\"name\": \"n\",\n\t\t\t\t\t\"company\": \"c\",\n\t\t\t\t\t\"blog\": \"b\",\n\t\t\t\t\t\"location\": \"l\",\n\t\t\t\t\t\"email\": \"e\",\n\t\t\t\t\t\"hireable\": true,\n\t\t\t\t\t\"public_repos\": 1,\n\t\t\t\t\t\"followers\": 1,\n\t\t\t\t\t\"following\": 1,\n\t\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\t\"url\": \"u\"\n\t\t\t\t},\n\t\t\t\t\"reactions\": {\n\t\t\t\t\t\"total_count\": 1,\n\t\t\t\t\t\"+1\": 1,\n\t\t\t\t\t\"-1\": 0,\n\t\t\t\t\t\"laugh\": 0,\n\t\t\t\t\t\"confused\": 0,\n\t\t\t\t\t\"heart\": 0,\n\t\t\t\t\t\"hooray\": 0,\n\t\t\t\t\t\"rocket\": 0,\n\t\t\t\t\t\"eyes\": 0,\n\t\t\t\t\t\"url\": \"u\"\n\t\t\t\t},\n\t\t\t\t\"created_at\": \"2002-02-10T15:30:00Z\",\n\t\t\t\t\"updated_at\": \"2002-02-10T15:30:00Z\",\n\t\t\t\t\"url\": \"pullrequestcommentUrl\",\n\t\t\t\t\"html_url\": \"pullrequestcommentHTMLUrl\",\n\t\t\t\t\"pull_request_url\": \"pullrequestcommentPullRequestURL\"\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/rate_limit.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport \"context\"\n\n// RateLimitService provides access to rate limit functions in the GitHub API.\ntype RateLimitService service\n\n// Rate represents the rate limit for the current client.\ntype Rate struct {\n\t// The maximum number of requests that you can make per hour.\n\tLimit int `json:\"limit\"`\n\n\t// The number of requests remaining in the current rate limit window.\n\tRemaining int `json:\"remaining\"`\n\n\t// The number of requests you have made in the current rate limit window.\n\tUsed int `json:\"used\"`\n\n\t// The time at which the current rate limit window resets, in UTC epoch seconds.\n\tReset Timestamp `json:\"reset\"`\n\n\t// The rate limit resource that the request counted against.\n\t// For more information about the different resources, see REST API endpoints for rate limits.\n\t// GitHub API docs: https://docs.github.com/en/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user\n\tResource string `json:\"resource,omitempty\"`\n}\n\nfunc (r Rate) String() string {\n\treturn Stringify(r)\n}\n\n// RateLimits represents the rate limits for the current client.\ntype RateLimits struct {\n\t// The rate limit for non-search API requests. Unauthenticated\n\t// requests are limited to 60 per hour. Authenticated requests are\n\t// limited to 5,000 per hour.\n\t//\n\t// GitHub API docs: https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting\n\tCore *Rate `json:\"core\"`\n\n\t// The rate limit for search API requests. Unauthenticated requests\n\t// are limited to 10 requests per minutes. Authenticated requests are\n\t// limited to 30 per minute.\n\t//\n\t// GitHub API docs: https://docs.github.com/en/rest/search#rate-limit\n\tSearch *Rate `json:\"search\"`\n\n\t// GitHub API docs: https://docs.github.com/en/graphql/overview/resource-limitations#rate-limit\n\tGraphQL *Rate `json:\"graphql\"`\n\n\t// GitHub API dos: https://docs.github.com/en/rest/rate-limit\n\tIntegrationManifest *Rate `json:\"integration_manifest\"`\n\n\tSourceImport              *Rate `json:\"source_import\"`\n\tCodeScanningUpload        *Rate `json:\"code_scanning_upload\"`\n\tActionsRunnerRegistration *Rate `json:\"actions_runner_registration\"`\n\tSCIM                      *Rate `json:\"scim\"`\n\tDependencySnapshots       *Rate `json:\"dependency_snapshots\"`\n\tCodeSearch                *Rate `json:\"code_search\"`\n\tAuditLog                  *Rate `json:\"audit_log\"`\n\tDependencySBOM            *Rate `json:\"dependency_sbom\"`\n}\n\nfunc (r RateLimits) String() string {\n\treturn Stringify(r)\n}\n\n// Get returns the rate limits for the current client.\n//\n// GitHub API docs: https://docs.github.com/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user\n//\n//meta:operation GET /rate_limit\nfunc (s *RateLimitService) Get(ctx context.Context) (*RateLimits, *Response, error) {\n\treq, err := s.client.NewRequest(\"GET\", \"rate_limit\", nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tresponse := new(struct {\n\t\tResources *RateLimits `json:\"resources\"`\n\t})\n\n\t// This resource is not subject to rate limits.\n\tctx = context.WithValue(ctx, BypassRateLimitCheck, true)\n\tresp, err := s.client.Do(ctx, req, response)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\tif response.Resources != nil {\n\t\ts.client.rateMu.Lock()\n\t\tif response.Resources.Core != nil {\n\t\t\ts.client.rateLimits[CoreCategory] = *response.Resources.Core\n\t\t}\n\t\tif response.Resources.Search != nil {\n\t\t\ts.client.rateLimits[SearchCategory] = *response.Resources.Search\n\t\t}\n\t\tif response.Resources.GraphQL != nil {\n\t\t\ts.client.rateLimits[GraphqlCategory] = *response.Resources.GraphQL\n\t\t}\n\t\tif response.Resources.IntegrationManifest != nil {\n\t\t\ts.client.rateLimits[IntegrationManifestCategory] = *response.Resources.IntegrationManifest\n\t\t}\n\t\tif response.Resources.SourceImport != nil {\n\t\t\ts.client.rateLimits[SourceImportCategory] = *response.Resources.SourceImport\n\t\t}\n\t\tif response.Resources.CodeScanningUpload != nil {\n\t\t\ts.client.rateLimits[CodeScanningUploadCategory] = *response.Resources.CodeScanningUpload\n\t\t}\n\t\tif response.Resources.ActionsRunnerRegistration != nil {\n\t\t\ts.client.rateLimits[ActionsRunnerRegistrationCategory] = *response.Resources.ActionsRunnerRegistration\n\t\t}\n\t\tif response.Resources.SCIM != nil {\n\t\t\ts.client.rateLimits[ScimCategory] = *response.Resources.SCIM\n\t\t}\n\t\tif response.Resources.DependencySnapshots != nil {\n\t\t\ts.client.rateLimits[DependencySnapshotsCategory] = *response.Resources.DependencySnapshots\n\t\t}\n\t\tif response.Resources.CodeSearch != nil {\n\t\t\ts.client.rateLimits[CodeSearchCategory] = *response.Resources.CodeSearch\n\t\t}\n\t\tif response.Resources.AuditLog != nil {\n\t\t\ts.client.rateLimits[AuditLogCategory] = *response.Resources.AuditLog\n\t\t}\n\t\tif response.Resources.DependencySBOM != nil {\n\t\t\ts.client.rateLimits[DependencySBOMCategory] = *response.Resources.DependencySBOM\n\t\t}\n\t\ts.client.rateMu.Unlock()\n\t}\n\n\treturn response.Resources, resp, nil\n}\n"
  },
  {
    "path": "github/rate_limit_test.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRateLimits_String(t *testing.T) {\n\tt.Parallel()\n\tv := RateLimits{\n\t\tCore:                      &Rate{},\n\t\tSearch:                    &Rate{},\n\t\tGraphQL:                   &Rate{},\n\t\tIntegrationManifest:       &Rate{},\n\t\tSourceImport:              &Rate{},\n\t\tCodeScanningUpload:        &Rate{},\n\t\tActionsRunnerRegistration: &Rate{},\n\t\tSCIM:                      &Rate{},\n\t\tDependencySnapshots:       &Rate{},\n\t\tCodeSearch:                &Rate{},\n\t\tAuditLog:                  &Rate{},\n\t\tDependencySBOM:            &Rate{},\n\t}\n\twant := `github.RateLimits{Core:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:\"\"}, Search:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:\"\"}, GraphQL:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:\"\"}, IntegrationManifest:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:\"\"}, SourceImport:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:\"\"}, CodeScanningUpload:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:\"\"}, ActionsRunnerRegistration:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:\"\"}, SCIM:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:\"\"}, DependencySnapshots:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:\"\"}, CodeSearch:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:\"\"}, AuditLog:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:\"\"}, DependencySBOM:github.Rate{Limit:0, Remaining:0, Used:0, Reset:github.Timestamp{0001-01-01 00:00:00 +0000 UTC}, Resource:\"\"}}`\n\tif got := v.String(); got != want {\n\t\tt.Errorf(\"RateLimits.String = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestRateLimits(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/rate_limit\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"resources\":{\n\t\t\t\"core\": {\"limit\":2,\"remaining\":1,\"used\":1,\"reset\":1372700873},\n\t\t\t\"search\": {\"limit\":3,\"remaining\":2,\"used\":1,\"reset\":1372700874},\n\t\t\t\"graphql\": {\"limit\":4,\"remaining\":3,\"used\":1,\"reset\":1372700875},\n\t\t\t\"integration_manifest\": {\"limit\":5,\"remaining\":4,\"used\":1,\"reset\":1372700876},\n\t\t\t\"source_import\": {\"limit\":6,\"remaining\":5,\"used\":1,\"reset\":1372700877},\n\t\t\t\"code_scanning_upload\": {\"limit\":7,\"remaining\":6,\"used\":1,\"reset\":1372700878},\n\t\t\t\"actions_runner_registration\": {\"limit\":8,\"remaining\":7,\"used\":1,\"reset\":1372700879},\n\t\t\t\"scim\": {\"limit\":9,\"remaining\":8,\"used\":1,\"reset\":1372700880},\n\t\t\t\"dependency_snapshots\": {\"limit\":10,\"remaining\":9,\"used\":1,\"reset\":1372700881},\n\t\t\t\"code_search\": {\"limit\":11,\"remaining\":10,\"used\":1,\"reset\":1372700882},\n\t\t\t\"audit_log\": {\"limit\": 12,\"remaining\":11,\"used\":1,\"reset\":1372700883},\n\t\t\t\"dependency_sbom\": {\"limit\": 100,\"remaining\":100,\"used\":0,\"reset\":1372700884}\n\t\t}}`)\n\t})\n\n\tctx := t.Context()\n\trate, _, err := client.RateLimit.Get(ctx)\n\tif err != nil {\n\t\tt.Errorf(\"RateLimits returned error: %v\", err)\n\t}\n\n\twant := &RateLimits{\n\t\tCore: &Rate{\n\t\t\tLimit:     2,\n\t\t\tRemaining: 1,\n\t\t\tUsed:      1,\n\t\t\tReset:     Timestamp{time.Date(2013, time.July, 1, 17, 47, 53, 0, time.UTC).Local()},\n\t\t},\n\t\tSearch: &Rate{\n\t\t\tLimit:     3,\n\t\t\tRemaining: 2,\n\t\t\tUsed:      1,\n\t\t\tReset:     Timestamp{time.Date(2013, time.July, 1, 17, 47, 54, 0, time.UTC).Local()},\n\t\t},\n\t\tGraphQL: &Rate{\n\t\t\tLimit:     4,\n\t\t\tRemaining: 3,\n\t\t\tUsed:      1,\n\t\t\tReset:     Timestamp{time.Date(2013, time.July, 1, 17, 47, 55, 0, time.UTC).Local()},\n\t\t},\n\t\tIntegrationManifest: &Rate{\n\t\t\tLimit:     5,\n\t\t\tRemaining: 4,\n\t\t\tUsed:      1,\n\t\t\tReset:     Timestamp{time.Date(2013, time.July, 1, 17, 47, 56, 0, time.UTC).Local()},\n\t\t},\n\t\tSourceImport: &Rate{\n\t\t\tLimit:     6,\n\t\t\tRemaining: 5,\n\t\t\tUsed:      1,\n\t\t\tReset:     Timestamp{time.Date(2013, time.July, 1, 17, 47, 57, 0, time.UTC).Local()},\n\t\t},\n\t\tCodeScanningUpload: &Rate{\n\t\t\tLimit:     7,\n\t\t\tRemaining: 6,\n\t\t\tUsed:      1,\n\t\t\tReset:     Timestamp{time.Date(2013, time.July, 1, 17, 47, 58, 0, time.UTC).Local()},\n\t\t},\n\t\tActionsRunnerRegistration: &Rate{\n\t\t\tLimit:     8,\n\t\t\tRemaining: 7,\n\t\t\tUsed:      1,\n\t\t\tReset:     Timestamp{time.Date(2013, time.July, 1, 17, 47, 59, 0, time.UTC).Local()},\n\t\t},\n\t\tSCIM: &Rate{\n\t\t\tLimit:     9,\n\t\t\tRemaining: 8,\n\t\t\tUsed:      1,\n\t\t\tReset:     Timestamp{time.Date(2013, time.July, 1, 17, 48, 0, 0, time.UTC).Local()},\n\t\t},\n\t\tDependencySnapshots: &Rate{\n\t\t\tLimit:     10,\n\t\t\tRemaining: 9,\n\t\t\tUsed:      1,\n\t\t\tReset:     Timestamp{time.Date(2013, time.July, 1, 17, 48, 1, 0, time.UTC).Local()},\n\t\t},\n\t\tCodeSearch: &Rate{\n\t\t\tLimit:     11,\n\t\t\tRemaining: 10,\n\t\t\tUsed:      1,\n\t\t\tReset:     Timestamp{time.Date(2013, time.July, 1, 17, 48, 2, 0, time.UTC).Local()},\n\t\t},\n\t\tAuditLog: &Rate{\n\t\t\tLimit:     12,\n\t\t\tRemaining: 11,\n\t\t\tUsed:      1,\n\t\t\tReset:     Timestamp{time.Date(2013, time.July, 1, 17, 48, 3, 0, time.UTC).Local()},\n\t\t},\n\t\tDependencySBOM: &Rate{\n\t\t\tLimit:     100,\n\t\t\tRemaining: 100,\n\t\t\tUsed:      0,\n\t\t\tReset:     Timestamp{time.Date(2013, time.July, 1, 17, 48, 4, 0, time.UTC).Local()},\n\t\t},\n\t}\n\tif !cmp.Equal(rate, want) {\n\t\tt.Errorf(\"RateLimits returned %+v, want %+v\", rate, want)\n\t}\n\ttests := []struct {\n\t\tcategory RateLimitCategory\n\t\trate     *Rate\n\t}{\n\t\t{\n\t\t\tcategory: CoreCategory,\n\t\t\trate:     want.Core,\n\t\t},\n\t\t{\n\t\t\tcategory: SearchCategory,\n\t\t\trate:     want.Search,\n\t\t},\n\t\t{\n\t\t\tcategory: GraphqlCategory,\n\t\t\trate:     want.GraphQL,\n\t\t},\n\t\t{\n\t\t\tcategory: IntegrationManifestCategory,\n\t\t\trate:     want.IntegrationManifest,\n\t\t},\n\t\t{\n\t\t\tcategory: SourceImportCategory,\n\t\t\trate:     want.SourceImport,\n\t\t},\n\t\t{\n\t\t\tcategory: CodeScanningUploadCategory,\n\t\t\trate:     want.CodeScanningUpload,\n\t\t},\n\t\t{\n\t\t\tcategory: ActionsRunnerRegistrationCategory,\n\t\t\trate:     want.ActionsRunnerRegistration,\n\t\t},\n\t\t{\n\t\t\tcategory: ScimCategory,\n\t\t\trate:     want.SCIM,\n\t\t},\n\t\t{\n\t\t\tcategory: DependencySnapshotsCategory,\n\t\t\trate:     want.DependencySnapshots,\n\t\t},\n\t\t{\n\t\t\tcategory: CodeSearchCategory,\n\t\t\trate:     want.CodeSearch,\n\t\t},\n\t\t{\n\t\t\tcategory: AuditLogCategory,\n\t\t\trate:     want.AuditLog,\n\t\t},\n\t\t{\n\t\t\tcategory: DependencySBOMCategory,\n\t\t\trate:     want.DependencySBOM,\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tif got, want := client.rateLimits[tt.category], *tt.rate; got != want {\n\t\t\tt.Errorf(\"client.rateLimits[%v] is %+v, want %+v\", tt.category, got, want)\n\t\t}\n\t}\n}\n\nfunc TestRateLimits_coverage(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\n\tconst methodName = \"RateLimits\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t_, resp, err := client.RateLimit.Get(ctx)\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRateLimits_overQuota(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tclient.rateLimits[CoreCategory] = Rate{\n\t\tLimit:     1,\n\t\tRemaining: 0,\n\t\tUsed:      1,\n\t\tReset:     Timestamp{time.Now().Add(time.Hour).Local()},\n\t}\n\tmux.HandleFunc(\"/rate_limit\", func(w http.ResponseWriter, _ *http.Request) {\n\t\tfmt.Fprint(w, `{\"resources\":{\n\t\t\t\"core\": {\"limit\":2,\"remaining\":1,\"used\":1,\"reset\":1372700873},\n\t\t\t\"search\": {\"limit\":3,\"remaining\":2,\"used\":1,\"reset\":1372700874},\n\t\t\t\"graphql\": {\"limit\":4,\"remaining\":3,\"used\":1,\"reset\":1372700875},\n\t\t\t\"integration_manifest\": {\"limit\":5,\"remaining\":4,\"used\":1,\"reset\":1372700876},\n\t\t\t\"source_import\": {\"limit\":6,\"remaining\":5,\"used\":1,\"reset\":1372700877},\n\t\t\t\"code_scanning_upload\": {\"limit\":7,\"remaining\":6,\"used\":1,\"reset\":1372700878},\n\t\t\t\"actions_runner_registration\": {\"limit\":8,\"remaining\":7,\"used\":1,\"reset\":1372700879},\n\t\t\t\"scim\": {\"limit\":9,\"remaining\":8,\"used\":1,\"reset\":1372700880},\n\t\t\t\"dependency_snapshots\": {\"limit\":10,\"remaining\":9,\"used\":1,\"reset\":1372700881},\n\t\t\t\"code_search\": {\"limit\":11,\"remaining\":10,\"used\":1,\"reset\":1372700882},\n\t\t\t\"audit_log\": {\"limit\":12,\"remaining\":11,\"used\":1,\"reset\":1372700883},\n\t\t\t\"dependency_sbom\": {\"limit\":13,\"remaining\":12,\"used\":1,\"reset\":1372700884}\n\t\t}}`)\n\t})\n\n\tctx := t.Context()\n\trate, _, err := client.RateLimit.Get(ctx)\n\tif err != nil {\n\t\tt.Errorf(\"RateLimits returned error: %v\", err)\n\t}\n\n\twant := &RateLimits{\n\t\tCore: &Rate{\n\t\t\tLimit:     2,\n\t\t\tRemaining: 1,\n\t\t\tUsed:      1,\n\t\t\tReset:     Timestamp{time.Date(2013, time.July, 1, 17, 47, 53, 0, time.UTC).Local()},\n\t\t},\n\t\tSearch: &Rate{\n\t\t\tLimit:     3,\n\t\t\tRemaining: 2,\n\t\t\tUsed:      1,\n\t\t\tReset:     Timestamp{time.Date(2013, time.July, 1, 17, 47, 54, 0, time.UTC).Local()},\n\t\t},\n\t\tGraphQL: &Rate{\n\t\t\tLimit:     4,\n\t\t\tRemaining: 3,\n\t\t\tUsed:      1,\n\t\t\tReset:     Timestamp{time.Date(2013, time.July, 1, 17, 47, 55, 0, time.UTC).Local()},\n\t\t},\n\t\tIntegrationManifest: &Rate{\n\t\t\tLimit:     5,\n\t\t\tRemaining: 4,\n\t\t\tUsed:      1,\n\t\t\tReset:     Timestamp{time.Date(2013, time.July, 1, 17, 47, 56, 0, time.UTC).Local()},\n\t\t},\n\t\tSourceImport: &Rate{\n\t\t\tLimit:     6,\n\t\t\tRemaining: 5,\n\t\t\tUsed:      1,\n\t\t\tReset:     Timestamp{time.Date(2013, time.July, 1, 17, 47, 57, 0, time.UTC).Local()},\n\t\t},\n\t\tCodeScanningUpload: &Rate{\n\t\t\tLimit:     7,\n\t\t\tRemaining: 6,\n\t\t\tUsed:      1,\n\t\t\tReset:     Timestamp{time.Date(2013, time.July, 1, 17, 47, 58, 0, time.UTC).Local()},\n\t\t},\n\t\tActionsRunnerRegistration: &Rate{\n\t\t\tLimit:     8,\n\t\t\tRemaining: 7,\n\t\t\tUsed:      1,\n\t\t\tReset:     Timestamp{time.Date(2013, time.July, 1, 17, 47, 59, 0, time.UTC).Local()},\n\t\t},\n\t\tSCIM: &Rate{\n\t\t\tLimit:     9,\n\t\t\tRemaining: 8,\n\t\t\tUsed:      1,\n\t\t\tReset:     Timestamp{time.Date(2013, time.July, 1, 17, 48, 0, 0, time.UTC).Local()},\n\t\t},\n\t\tDependencySnapshots: &Rate{\n\t\t\tLimit:     10,\n\t\t\tRemaining: 9,\n\t\t\tUsed:      1,\n\t\t\tReset:     Timestamp{time.Date(2013, time.July, 1, 17, 48, 1, 0, time.UTC).Local()},\n\t\t},\n\t\tCodeSearch: &Rate{\n\t\t\tLimit:     11,\n\t\t\tRemaining: 10,\n\t\t\tUsed:      1,\n\t\t\tReset:     Timestamp{time.Date(2013, time.July, 1, 17, 48, 2, 0, time.UTC).Local()},\n\t\t},\n\t\tAuditLog: &Rate{\n\t\t\tLimit:     12,\n\t\t\tRemaining: 11,\n\t\t\tUsed:      1,\n\t\t\tReset:     Timestamp{time.Date(2013, time.July, 1, 17, 48, 3, 0, time.UTC).Local()},\n\t\t},\n\t\tDependencySBOM: &Rate{\n\t\t\tLimit:     13,\n\t\t\tRemaining: 12,\n\t\t\tUsed:      1,\n\t\t\tReset:     Timestamp{time.Date(2013, time.July, 1, 17, 48, 4, 0, time.UTC).Local()},\n\t\t},\n\t}\n\tif !cmp.Equal(rate, want) {\n\t\tt.Errorf(\"RateLimits returned %+v, want %+v\", rate, want)\n\t}\n\n\ttests := []struct {\n\t\tcategory RateLimitCategory\n\t\trate     *Rate\n\t}{\n\t\t{\n\t\t\tcategory: CoreCategory,\n\t\t\trate:     want.Core,\n\t\t},\n\t\t{\n\t\t\tcategory: SearchCategory,\n\t\t\trate:     want.Search,\n\t\t},\n\t\t{\n\t\t\tcategory: GraphqlCategory,\n\t\t\trate:     want.GraphQL,\n\t\t},\n\t\t{\n\t\t\tcategory: IntegrationManifestCategory,\n\t\t\trate:     want.IntegrationManifest,\n\t\t},\n\t\t{\n\t\t\tcategory: SourceImportCategory,\n\t\t\trate:     want.SourceImport,\n\t\t},\n\t\t{\n\t\t\tcategory: CodeScanningUploadCategory,\n\t\t\trate:     want.CodeScanningUpload,\n\t\t},\n\t\t{\n\t\t\tcategory: ActionsRunnerRegistrationCategory,\n\t\t\trate:     want.ActionsRunnerRegistration,\n\t\t},\n\t\t{\n\t\t\tcategory: ScimCategory,\n\t\t\trate:     want.SCIM,\n\t\t},\n\t\t{\n\t\t\tcategory: DependencySnapshotsCategory,\n\t\t\trate:     want.DependencySnapshots,\n\t\t},\n\t\t{\n\t\t\tcategory: CodeSearchCategory,\n\t\t\trate:     want.CodeSearch,\n\t\t},\n\t\t{\n\t\t\tcategory: AuditLogCategory,\n\t\t\trate:     want.AuditLog,\n\t\t},\n\t\t{\n\t\t\tcategory: DependencySBOMCategory,\n\t\t\trate:     want.DependencySBOM,\n\t\t},\n\t}\n\tfor _, tt := range tests {\n\t\tif got, want := client.rateLimits[tt.category], *tt.rate; got != want {\n\t\t\tt.Errorf(\"client.rateLimits[%v] is %+v, want %+v\", tt.category, got, want)\n\t\t}\n\t}\n}\n\nfunc TestRateLimits_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RateLimits{}, `{\n\t\t\"core\": null,\n\t\t\"search\": null,\n\t\t\"graphql\": null,\n\t\t\"integration_manifest\": null,\n\t\t\"source_import\": null,\n\t\t\"code_scanning_upload\": null,\n\t\t\"actions_runner_registration\": null,\n\t\t\"scim\": null,\n\t\t\"dependency_snapshots\": null,\n\t\t\"code_search\": null,\n\t\t\"audit_log\": null,\n\t\t\"dependency_sbom\": null\n\t}`)\n\n\tu := &RateLimits{\n\t\tCore: &Rate{\n\t\t\tLimit:     1,\n\t\t\tRemaining: 1,\n\t\t\tUsed:      0,\n\t\t\tReset:     Timestamp{referenceTime},\n\t\t},\n\t\tSearch: &Rate{\n\t\t\tLimit:     1,\n\t\t\tRemaining: 1,\n\t\t\tUsed:      0,\n\t\t\tReset:     Timestamp{referenceTime},\n\t\t},\n\t\tGraphQL: &Rate{\n\t\t\tLimit:     1,\n\t\t\tRemaining: 1,\n\t\t\tUsed:      0,\n\t\t\tReset:     Timestamp{referenceTime},\n\t\t},\n\t\tIntegrationManifest: &Rate{\n\t\t\tLimit:     1,\n\t\t\tRemaining: 1,\n\t\t\tUsed:      0,\n\t\t\tReset:     Timestamp{referenceTime},\n\t\t},\n\t\tSourceImport: &Rate{\n\t\t\tLimit:     1,\n\t\t\tRemaining: 1,\n\t\t\tUsed:      0,\n\t\t\tReset:     Timestamp{referenceTime},\n\t\t},\n\t\tCodeScanningUpload: &Rate{\n\t\t\tLimit:     1,\n\t\t\tRemaining: 1,\n\t\t\tUsed:      0,\n\t\t\tReset:     Timestamp{referenceTime},\n\t\t},\n\t\tActionsRunnerRegistration: &Rate{\n\t\t\tLimit:     1,\n\t\t\tRemaining: 1,\n\t\t\tUsed:      0,\n\t\t\tReset:     Timestamp{referenceTime},\n\t\t},\n\t\tSCIM: &Rate{\n\t\t\tLimit:     1,\n\t\t\tRemaining: 1,\n\t\t\tUsed:      0,\n\t\t\tReset:     Timestamp{referenceTime},\n\t\t},\n\t\tDependencySnapshots: &Rate{\n\t\t\tLimit:     1,\n\t\t\tRemaining: 1,\n\t\t\tUsed:      0,\n\t\t\tReset:     Timestamp{referenceTime},\n\t\t},\n\t\tCodeSearch: &Rate{\n\t\t\tLimit:     1,\n\t\t\tRemaining: 1,\n\t\t\tUsed:      0,\n\t\t\tReset:     Timestamp{referenceTime},\n\t\t},\n\t\tAuditLog: &Rate{\n\t\t\tLimit:     1,\n\t\t\tRemaining: 1,\n\t\t\tUsed:      0,\n\t\t\tReset:     Timestamp{referenceTime},\n\t\t},\n\t\tDependencySBOM: &Rate{\n\t\t\tLimit:     1,\n\t\t\tRemaining: 1,\n\t\t\tUsed:      0,\n\t\t\tReset:     Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"core\": {\n\t\t\t\"limit\": 1,\n\t\t\t\"remaining\": 1,\n\t\t\t\"used\": 0,\n\t\t\t\"reset\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"search\": {\n\t\t\t\"limit\": 1,\n\t\t\t\"remaining\": 1,\n\t\t\t\"used\": 0,\n\t\t\t\"reset\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"graphql\": {\n\t\t\t\"limit\": 1,\n\t\t\t\"remaining\": 1,\n\t\t\t\"used\": 0,\n\t\t\t\"reset\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"integration_manifest\": {\n\t\t\t\"limit\": 1,\n\t\t\t\"remaining\": 1,\n\t\t\t\"used\": 0,\n\t\t\t\"reset\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"source_import\": {\n\t\t\t\"limit\": 1,\n\t\t\t\"remaining\": 1,\n\t\t\t\"used\": 0,\n\t\t\t\"reset\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"code_scanning_upload\": {\n\t\t\t\"limit\": 1,\n\t\t\t\"remaining\": 1,\n\t\t\t\"used\": 0,\n\t\t\t\"reset\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"actions_runner_registration\": {\n\t\t\t\"limit\": 1,\n\t\t\t\"remaining\": 1,\n\t\t\t\"used\": 0,\n\t\t\t\"reset\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"scim\": {\n\t\t\t\"limit\": 1,\n\t\t\t\"remaining\": 1,\n\t\t\t\"used\": 0,\n\t\t\t\"reset\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"dependency_snapshots\": {\n\t\t\t\"limit\": 1,\n\t\t\t\"remaining\": 1,\n\t\t\t\"used\": 0,\n\t\t\t\"reset\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"code_search\": {\n\t\t\t\"limit\": 1,\n\t\t\t\"remaining\": 1,\n\t\t\t\"used\": 0,\n\t\t\t\"reset\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"audit_log\": {\n\t\t\t\"limit\": 1,\n\t\t\t\"remaining\": 1,\n\t\t\t\"used\": 0,\n\t\t\t\"reset\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"dependency_sbom\": {\n\t\t\t\"limit\": 1,\n\t\t\t\"remaining\": 1,\n\t\t\t\"used\": 0,\n\t\t\t\"reset\": ` + referenceTimeStr + `\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestRate_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Rate{}, `{\n\t\t\"limit\": 0,\n\t\t\"remaining\": 0,\n\t\t\"used\": 0,\n\t\t\"reset\": \"0001-01-01T00:00:00Z\"\n\t}`)\n\n\tu := &Rate{\n\t\tLimit:     1,\n\t\tRemaining: 1,\n\t\tUsed:      0,\n\t\tReset:     Timestamp{referenceTime},\n\t\tResource:  \"core\",\n\t}\n\n\twant := `{\n\t\t\"limit\": 1,\n\t\t\"remaining\": 1,\n\t\t\"used\": 0,\n\t\t\"reset\": ` + referenceTimeStr + `,\n\t\t\"resource\": \"core\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/reactions.go",
    "content": "// Copyright 2016 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// ReactionsService provides access to the reactions-related functions in the\n// GitHub API.\n//\n// GitHub API docs: https://docs.github.com/rest/reactions\ntype ReactionsService service\n\n// Reaction represents a GitHub reaction.\ntype Reaction struct {\n\t// ID is the Reaction ID.\n\tID     *int64  `json:\"id,omitempty\"`\n\tUser   *User   `json:\"user,omitempty\"`\n\tNodeID *string `json:\"node_id,omitempty\"`\n\t// Content is the type of reaction.\n\t// Possible values are:\n\t//     \"+1\", \"-1\", \"laugh\", \"confused\", \"heart\", \"hooray\", \"rocket\", or \"eyes\".\n\tContent   *string    `json:\"content,omitempty\"`\n\tCreatedAt *Timestamp `json:\"created_at,omitempty\"`\n}\n\n// Reactions represents a summary of GitHub reactions.\ntype Reactions struct {\n\tTotalCount *int    `json:\"total_count,omitempty\"`\n\tPlusOne    *int    `json:\"+1,omitempty\"`\n\tMinusOne   *int    `json:\"-1,omitempty\"`\n\tLaugh      *int    `json:\"laugh,omitempty\"`\n\tConfused   *int    `json:\"confused,omitempty\"`\n\tHeart      *int    `json:\"heart,omitempty\"`\n\tHooray     *int    `json:\"hooray,omitempty\"`\n\tRocket     *int    `json:\"rocket,omitempty\"`\n\tEyes       *int    `json:\"eyes,omitempty\"`\n\tURL        *string `json:\"url,omitempty\"`\n}\n\nfunc (r Reaction) String() string {\n\treturn Stringify(r)\n}\n\n// ListReactionOptions specifies the optional parameters to the list reactions endpoints.\ntype ListReactionOptions struct {\n\t// Content restricts the returned comment reactions to only those with the given type.\n\t// Omit this parameter to list all reactions to a commit comment.\n\t// Possible values are: \"+1\", \"-1\", \"laugh\", \"confused\", \"heart\", \"hooray\", \"rocket\", or \"eyes\".\n\tContent string `url:\"content,omitempty\"`\n\n\tListOptions\n}\n\n// ListCommentReactions lists the reactions for a commit comment.\n//\n// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-commit-comment\n//\n//meta:operation GET /repos/{owner}/{repo}/comments/{comment_id}/reactions\nfunc (s *ReactionsService) ListCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListReactionOptions) ([]*Reaction, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/comments/%v/reactions\", owner, repo, id)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeReactionsPreview)\n\n\tvar m []*Reaction\n\tresp, err := s.client.Do(ctx, req, &m)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn m, resp, nil\n}\n\n// CreateCommentReaction creates a reaction for a commit comment.\n// Note that if you have already created a reaction of type content, the\n// previously created reaction will be returned with Status: 200 OK.\n// The content should have one of the following values: \"+1\", \"-1\", \"laugh\", \"confused\", \"heart\", \"hooray\", \"rocket\", or \"eyes\".\n//\n// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-commit-comment\n//\n//meta:operation POST /repos/{owner}/{repo}/comments/{comment_id}/reactions\nfunc (s *ReactionsService) CreateCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/comments/%v/reactions\", owner, repo, id)\n\n\tbody := &Reaction{Content: Ptr(content)}\n\treq, err := s.client.NewRequest(\"POST\", u, body)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeReactionsPreview)\n\n\tvar m *Reaction\n\tresp, err := s.client.Do(ctx, req, &m)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn m, resp, nil\n}\n\n// DeleteCommentReaction deletes the reaction for a commit comment.\n//\n// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction\n//\n//meta:operation DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}\nfunc (s *ReactionsService) DeleteCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/comments/%v/reactions/%v\", owner, repo, commentID, reactionID)\n\n\treturn s.deleteReaction(ctx, u)\n}\n\n// DeleteCommentReactionByID deletes the reaction for a commit comment by repository ID.\n//\n// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction\n//\n//meta:operation DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}\nfunc (s *ReactionsService) DeleteCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repositories/%v/comments/%v/reactions/%v\", repoID, commentID, reactionID)\n\n\treturn s.deleteReaction(ctx, u)\n}\n\n// ListIssueReactions lists the reactions for an issue.\n//\n// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue\n//\n//meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/reactions\nfunc (s *ReactionsService) ListIssueReactions(ctx context.Context, owner, repo string, number int, opts *ListReactionOptions) ([]*Reaction, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/issues/%v/reactions\", owner, repo, number)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeReactionsPreview)\n\n\tvar m []*Reaction\n\tresp, err := s.client.Do(ctx, req, &m)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn m, resp, nil\n}\n\n// CreateIssueReaction creates a reaction for an issue.\n// Note that if you have already created a reaction of type content, the\n// previously created reaction will be returned with Status: 200 OK.\n// The content should have one of the following values: \"+1\", \"-1\", \"laugh\", \"confused\", \"heart\", \"hooray\", \"rocket\", or \"eyes\".\n//\n// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue\n//\n//meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/reactions\nfunc (s *ReactionsService) CreateIssueReaction(ctx context.Context, owner, repo string, number int, content string) (*Reaction, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/issues/%v/reactions\", owner, repo, number)\n\n\tbody := &Reaction{Content: Ptr(content)}\n\treq, err := s.client.NewRequest(\"POST\", u, body)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeReactionsPreview)\n\n\tvar m *Reaction\n\tresp, err := s.client.Do(ctx, req, &m)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn m, resp, nil\n}\n\n// DeleteIssueReaction deletes the reaction to an issue.\n//\n// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction\n//\n//meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}\nfunc (s *ReactionsService) DeleteIssueReaction(ctx context.Context, owner, repo string, issueNumber int, reactionID int64) (*Response, error) {\n\turl := fmt.Sprintf(\"repos/%v/%v/issues/%v/reactions/%v\", owner, repo, issueNumber, reactionID)\n\n\treturn s.deleteReaction(ctx, url)\n}\n\n// DeleteIssueReactionByID deletes the reaction to an issue by repository ID.\n//\n// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction\n//\n//meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}\nfunc (s *ReactionsService) DeleteIssueReactionByID(ctx context.Context, repoID, issueNumber int, reactionID int64) (*Response, error) {\n\turl := fmt.Sprintf(\"repositories/%v/issues/%v/reactions/%v\", repoID, issueNumber, reactionID)\n\n\treturn s.deleteReaction(ctx, url)\n}\n\n// ListIssueCommentReactions lists the reactions for an issue comment.\n//\n// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue-comment\n//\n//meta:operation GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\nfunc (s *ReactionsService) ListIssueCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListReactionOptions) ([]*Reaction, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/issues/comments/%v/reactions\", owner, repo, id)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeReactionsPreview)\n\n\tvar m []*Reaction\n\tresp, err := s.client.Do(ctx, req, &m)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn m, resp, nil\n}\n\n// CreateIssueCommentReaction creates a reaction for an issue comment.\n// Note that if you have already created a reaction of type content, the\n// previously created reaction will be returned with Status: 200 OK.\n// The content should have one of the following values: \"+1\", \"-1\", \"laugh\", \"confused\", \"heart\", \"hooray\", \"rocket\", or \"eyes\".\n//\n// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue-comment\n//\n//meta:operation POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\nfunc (s *ReactionsService) CreateIssueCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/issues/comments/%v/reactions\", owner, repo, id)\n\n\tbody := &Reaction{Content: Ptr(content)}\n\treq, err := s.client.NewRequest(\"POST\", u, body)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeReactionsPreview)\n\n\tvar m *Reaction\n\tresp, err := s.client.Do(ctx, req, &m)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn m, resp, nil\n}\n\n// DeleteIssueCommentReaction deletes the reaction to an issue comment.\n//\n// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction\n//\n//meta:operation DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}\nfunc (s *ReactionsService) DeleteIssueCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) {\n\turl := fmt.Sprintf(\"repos/%v/%v/issues/comments/%v/reactions/%v\", owner, repo, commentID, reactionID)\n\n\treturn s.deleteReaction(ctx, url)\n}\n\n// DeleteIssueCommentReactionByID deletes the reaction to an issue comment by repository ID.\n//\n// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction\n//\n//meta:operation DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}\nfunc (s *ReactionsService) DeleteIssueCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) {\n\turl := fmt.Sprintf(\"repositories/%v/issues/comments/%v/reactions/%v\", repoID, commentID, reactionID)\n\n\treturn s.deleteReaction(ctx, url)\n}\n\n// ListPullRequestCommentReactions lists the reactions for a pull request review comment.\n//\n// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-pull-request-review-comment\n//\n//meta:operation GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\nfunc (s *ReactionsService) ListPullRequestCommentReactions(ctx context.Context, owner, repo string, id int64, opts *ListReactionOptions) ([]*Reaction, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pulls/comments/%v/reactions\", owner, repo, id)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeReactionsPreview)\n\n\tvar m []*Reaction\n\tresp, err := s.client.Do(ctx, req, &m)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn m, resp, nil\n}\n\n// CreatePullRequestCommentReaction creates a reaction for a pull request review comment.\n// Note that if you have already created a reaction of type content, the\n// previously created reaction will be returned with Status: 200 OK.\n// The content should have one of the following values: \"+1\", \"-1\", \"laugh\", \"confused\", \"heart\", \"hooray\", \"rocket\", or \"eyes\".\n//\n// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-pull-request-review-comment\n//\n//meta:operation POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\nfunc (s *ReactionsService) CreatePullRequestCommentReaction(ctx context.Context, owner, repo string, id int64, content string) (*Reaction, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pulls/comments/%v/reactions\", owner, repo, id)\n\n\tbody := &Reaction{Content: Ptr(content)}\n\treq, err := s.client.NewRequest(\"POST\", u, body)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeReactionsPreview)\n\n\tvar m *Reaction\n\tresp, err := s.client.Do(ctx, req, &m)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn m, resp, nil\n}\n\n// DeletePullRequestCommentReaction deletes the reaction to a pull request review comment.\n//\n// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-pull-request-comment-reaction\n//\n//meta:operation DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}\nfunc (s *ReactionsService) DeletePullRequestCommentReaction(ctx context.Context, owner, repo string, commentID, reactionID int64) (*Response, error) {\n\turl := fmt.Sprintf(\"repos/%v/%v/pulls/comments/%v/reactions/%v\", owner, repo, commentID, reactionID)\n\n\treturn s.deleteReaction(ctx, url)\n}\n\n// DeletePullRequestCommentReactionByID deletes the reaction to a pull request review comment by repository ID.\n//\n// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-pull-request-comment-reaction\n//\n//meta:operation DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}\nfunc (s *ReactionsService) DeletePullRequestCommentReactionByID(ctx context.Context, repoID, commentID, reactionID int64) (*Response, error) {\n\turl := fmt.Sprintf(\"repositories/%v/pulls/comments/%v/reactions/%v\", repoID, commentID, reactionID)\n\n\treturn s.deleteReaction(ctx, url)\n}\n\n// ListTeamDiscussionReactions lists the reactions for a team discussion.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/reactions/reactions#list-reactions-for-a-team-discussion-legacy\n//\n//meta:operation GET /teams/{team_id}/discussions/{discussion_number}/reactions\nfunc (s *ReactionsService) ListTeamDiscussionReactions(ctx context.Context, teamID int64, discussionNumber int, opts *ListReactionOptions) ([]*Reaction, *Response, error) {\n\tu := fmt.Sprintf(\"teams/%v/discussions/%v/reactions\", teamID, discussionNumber)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeReactionsPreview)\n\n\tvar m []*Reaction\n\tresp, err := s.client.Do(ctx, req, &m)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn m, resp, nil\n}\n\n// CreateTeamDiscussionReaction creates a reaction for a team discussion.\n// The content should have one of the following values: \"+1\", \"-1\", \"laugh\", \"confused\", \"heart\", \"hooray\", \"rocket\", or \"eyes\".\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/reactions/reactions#create-reaction-for-a-team-discussion-legacy\n//\n//meta:operation POST /teams/{team_id}/discussions/{discussion_number}/reactions\nfunc (s *ReactionsService) CreateTeamDiscussionReaction(ctx context.Context, teamID int64, discussionNumber int, content string) (*Reaction, *Response, error) {\n\tu := fmt.Sprintf(\"teams/%v/discussions/%v/reactions\", teamID, discussionNumber)\n\n\tbody := &Reaction{Content: Ptr(content)}\n\treq, err := s.client.NewRequest(\"POST\", u, body)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeReactionsPreview)\n\n\tvar m *Reaction\n\tresp, err := s.client.Do(ctx, req, &m)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn m, resp, nil\n}\n\n// DeleteTeamDiscussionReaction deletes the reaction to a team discussion.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/reactions/reactions#delete-team-discussion-reaction\n//\n//meta:operation DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}\nfunc (s *ReactionsService) DeleteTeamDiscussionReaction(ctx context.Context, org, teamSlug string, discussionNumber int, reactionID int64) (*Response, error) {\n\turl := fmt.Sprintf(\"orgs/%v/teams/%v/discussions/%v/reactions/%v\", org, teamSlug, discussionNumber, reactionID)\n\n\treturn s.deleteReaction(ctx, url)\n}\n\n// DeleteTeamDiscussionReactionByOrgIDAndTeamID deletes the reaction to a team discussion by organization ID and team ID.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/reactions/reactions#create-reaction-for-a-team-discussion\n//\n//meta:operation POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\nfunc (s *ReactionsService) DeleteTeamDiscussionReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber int, reactionID int64) (*Response, error) {\n\turl := fmt.Sprintf(\"organizations/%v/team/%v/discussions/%v/reactions/%v\", orgID, teamID, discussionNumber, reactionID)\n\n\treturn s.deleteReaction(ctx, url)\n}\n\n// ListTeamDiscussionCommentReactions lists the reactions for a team discussion comment.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment-legacy\n//\n//meta:operation GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions\nfunc (s *ReactionsService) ListTeamDiscussionCommentReactions(ctx context.Context, teamID int64, discussionNumber, commentNumber int, opts *ListReactionOptions) ([]*Reaction, *Response, error) {\n\tu := fmt.Sprintf(\"teams/%v/discussions/%v/comments/%v/reactions\", teamID, discussionNumber, commentNumber)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeReactionsPreview)\n\n\tvar m []*Reaction\n\tresp, err := s.client.Do(ctx, req, &m)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn m, resp, nil\n}\n\n// CreateTeamDiscussionCommentReaction creates a reaction for a team discussion comment.\n// The content should have one of the following values: \"+1\", \"-1\", \"laugh\", \"confused\", \"heart\", \"hooray\", \"rocket\", or \"eyes\".\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment-legacy\n//\n//meta:operation POST /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions\nfunc (s *ReactionsService) CreateTeamDiscussionCommentReaction(ctx context.Context, teamID int64, discussionNumber, commentNumber int, content string) (*Reaction, *Response, error) {\n\tu := fmt.Sprintf(\"teams/%v/discussions/%v/comments/%v/reactions\", teamID, discussionNumber, commentNumber)\n\n\tbody := &Reaction{Content: Ptr(content)}\n\treq, err := s.client.NewRequest(\"POST\", u, body)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeReactionsPreview)\n\n\tvar m *Reaction\n\tresp, err := s.client.Do(ctx, req, &m)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn m, resp, nil\n}\n\n// DeleteTeamDiscussionCommentReaction deletes the reaction to a team discussion comment.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/reactions/reactions#delete-team-discussion-comment-reaction\n//\n//meta:operation DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}\nfunc (s *ReactionsService) DeleteTeamDiscussionCommentReaction(ctx context.Context, org, teamSlug string, discussionNumber, commentNumber int, reactionID int64) (*Response, error) {\n\turl := fmt.Sprintf(\"orgs/%v/teams/%v/discussions/%v/comments/%v/reactions/%v\", org, teamSlug, discussionNumber, commentNumber, reactionID)\n\n\treturn s.deleteReaction(ctx, url)\n}\n\n// DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID deletes the reaction to a team discussion comment by organization ID and team ID.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment\n//\n//meta:operation POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\nfunc (s *ReactionsService) DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID(ctx context.Context, orgID, teamID, discussionNumber, commentNumber int, reactionID int64) (*Response, error) {\n\turl := fmt.Sprintf(\"organizations/%v/team/%v/discussions/%v/comments/%v/reactions/%v\", orgID, teamID, discussionNumber, commentNumber, reactionID)\n\n\treturn s.deleteReaction(ctx, url)\n}\n\nfunc (s *ReactionsService) deleteReaction(ctx context.Context, url string) (*Response, error) {\n\treq, err := s.client.NewRequest(\"DELETE\", url, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeReactionsPreview)\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// CreateReleaseReaction creates a reaction to a release.\n// Note that a response with a Status: 200 OK means that you already\n// added the reaction type to this release.\n// The content should have one of the following values: \"+1\", \"-1\", \"laugh\", \"confused\", \"heart\", \"hooray\", \"rocket\", or \"eyes\".\n//\n// GitHub API docs: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-release\n//\n//meta:operation POST /repos/{owner}/{repo}/releases/{release_id}/reactions\nfunc (s *ReactionsService) CreateReleaseReaction(ctx context.Context, owner, repo string, releaseID int64, content string) (*Reaction, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/releases/%v/reactions\", owner, repo, releaseID)\n\n\tbody := &Reaction{Content: Ptr(content)}\n\treq, err := s.client.NewRequest(\"POST\", u, body)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeReactionsPreview)\n\n\tvar m *Reaction\n\tresp, err := s.client.Do(ctx, req, &m)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn m, resp, nil\n}\n\n// ListReleaseReactions lists the reactions for a release.\n//\n// GitHub API docs: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-release\n//\n//meta:operation GET /repos/{owner}/{repo}/releases/{release_id}/reactions\nfunc (s *ReactionsService) ListReleaseReactions(ctx context.Context, owner, repo string, releaseID int64, opts *ListReactionOptions) ([]*Reaction, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/releases/%v/reactions\", owner, repo, releaseID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeReactionsPreview)\n\n\tvar m []*Reaction\n\tresp, err := s.client.Do(ctx, req, &m)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn m, resp, nil\n}\n\n// DeleteReleaseReaction deletes the reaction for a release.\n//\n// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-release-reaction\n//\n//meta:operation DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}\nfunc (s *ReactionsService) DeleteReleaseReaction(ctx context.Context, owner, repo string, releaseID, reactionID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/releases/%v/reactions/%v\", owner, repo, releaseID, reactionID)\n\n\treturn s.deleteReaction(ctx, u)\n}\n\n// DeleteReleaseReactionByID deletes the reaction for a release by repository ID.\n//\n// GitHub API docs: https://docs.github.com/rest/reactions/reactions#delete-a-release-reaction\n//\n//meta:operation DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}\nfunc (s *ReactionsService) DeleteReleaseReactionByID(ctx context.Context, repoID, releaseID, reactionID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repositories/%v/releases/%v/reactions/%v\", repoID, releaseID, reactionID)\n\n\treturn s.deleteReaction(ctx, u)\n}\n"
  },
  {
    "path": "github/reactions_test.go",
    "content": "// Copyright 2016 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestReaction_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Reaction{}, \"{}\")\n\n\tr := &Reaction{\n\t\tID:      Ptr(int64(1)),\n\t\tUser:    nil,\n\t\tNodeID:  Ptr(\"n\"),\n\t\tContent: Ptr(\"+1\"),\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"node_id\": \"n\",\n\t\t\"content\": \"+1\"\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n\nfunc TestReactions_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Reactions{}, \"{}\")\n\n\tr := &Reactions{\n\t\tTotalCount: Ptr(1),\n\t\tPlusOne:    Ptr(1),\n\t\tMinusOne:   Ptr(1),\n\t\tLaugh:      Ptr(1),\n\t\tConfused:   Ptr(1),\n\t\tHeart:      Ptr(1),\n\t\tHooray:     Ptr(1),\n\t\tRocket:     Ptr(1),\n\t\tEyes:       Ptr(1),\n\t\tURL:        Ptr(\"u\"),\n\t}\n\n\twant := `{\n\t\t\"total_count\": 1,\n\t\t\"+1\": 1,\n\t\t\"-1\": 1,\n\t\t\"laugh\": 1,\n\t\t\"confused\": 1,\n\t\t\"heart\": 1,\n\t\t\"hooray\": 1,\n\t\t\"rocket\": 1,\n\t\t\"eyes\": 1,\n\t\t\"url\": \"u\"\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n\nfunc TestReactionsService_ListCommentReactions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/comments/1/reactions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\n\t\ttestFormValues(t, r, values{\"content\": \"+1\"})\n\t\tfmt.Fprint(w, `[{\"id\":1,\"user\":{\"login\":\"l\",\"id\":2},\"content\":\"+1\"}]`)\n\t})\n\n\topt := &ListReactionOptions{Content: \"+1\"}\n\tctx := t.Context()\n\treactions, _, err := client.Reactions.ListCommentReactions(ctx, \"o\", \"r\", 1, opt)\n\tif err != nil {\n\t\tt.Errorf(\"ListCommentReactions returned error: %v\", err)\n\t}\n\twant := []*Reaction{{ID: Ptr(int64(1)), User: &User{Login: Ptr(\"l\"), ID: Ptr(int64(2))}, Content: Ptr(\"+1\")}}\n\tif !cmp.Equal(reactions, want) {\n\t\tt.Errorf(\"ListCommentReactions = %+v, want %+v\", reactions, want)\n\t}\n\n\tconst methodName = \"ListCommentReactions\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Reactions.ListCommentReactions(ctx, \"\\n\", \"\\n\", -1, opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Reactions.ListCommentReactions(ctx, \"o\", \"r\", 1, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestReactionsService_CreateCommentReaction(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/comments/1/reactions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\n\t\tw.WriteHeader(http.StatusCreated)\n\t\tassertWrite(t, w, []byte(`{\"id\":1,\"user\":{\"login\":\"l\",\"id\":2},\"content\":\"+1\"}`))\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Reactions.CreateCommentReaction(ctx, \"o\", \"r\", 1, \"+1\")\n\tif err != nil {\n\t\tt.Errorf(\"CreateCommentReaction returned error: %v\", err)\n\t}\n\twant := &Reaction{ID: Ptr(int64(1)), User: &User{Login: Ptr(\"l\"), ID: Ptr(int64(2))}, Content: Ptr(\"+1\")}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"CreateCommentReaction = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"CreateCommentReaction\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Reactions.CreateCommentReaction(ctx, \"\\n\", \"\\n\", -1, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Reactions.CreateCommentReaction(ctx, \"o\", \"r\", 1, \"+1\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestReactionsService_ListIssueReactions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/issues/1/reactions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\t\ttestFormValues(t, r, values{\"content\": \"+1\"})\n\n\t\tw.WriteHeader(http.StatusOK)\n\t\tassertWrite(t, w, []byte(`[{\"id\":1,\"user\":{\"login\":\"l\",\"id\":2},\"content\":\"+1\"}]`))\n\t})\n\n\topt := &ListReactionOptions{Content: \"+1\"}\n\tctx := t.Context()\n\tgot, _, err := client.Reactions.ListIssueReactions(ctx, \"o\", \"r\", 1, opt)\n\tif err != nil {\n\t\tt.Errorf(\"ListIssueReactions returned error: %v\", err)\n\t}\n\twant := []*Reaction{{ID: Ptr(int64(1)), User: &User{Login: Ptr(\"l\"), ID: Ptr(int64(2))}, Content: Ptr(\"+1\")}}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"ListIssueReactions = %+v, want %+v\", got, want)\n\t}\n}\n\nfunc TestReactionsService_ListIssueReactions_coverage(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\n\tconst methodName = \"ListIssueReactions\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Reactions.ListIssueReactions(ctx, \"\\n\", \"\\n\", -1, &ListReactionOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Reactions.ListIssueReactions(ctx, \"o\", \"r\", 1, nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestReactionsService_CreateIssueReaction(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/issues/1/reactions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\n\t\tw.WriteHeader(http.StatusCreated)\n\t\tassertWrite(t, w, []byte(`{\"id\":1,\"user\":{\"login\":\"l\",\"id\":2},\"content\":\"+1\"}`))\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Reactions.CreateIssueReaction(ctx, \"o\", \"r\", 1, \"+1\")\n\tif err != nil {\n\t\tt.Errorf(\"CreateIssueReaction returned error: %v\", err)\n\t}\n\twant := &Reaction{ID: Ptr(int64(1)), User: &User{Login: Ptr(\"l\"), ID: Ptr(int64(2))}, Content: Ptr(\"+1\")}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"CreateIssueReaction = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"CreateIssueReaction\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Reactions.CreateIssueReaction(ctx, \"\\n\", \"\\n\", -1, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Reactions.CreateIssueReaction(ctx, \"o\", \"r\", 1, \"+1\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestReactionsService_ListIssueCommentReactions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/issues/comments/1/reactions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\t\ttestFormValues(t, r, values{\"content\": \"+1\"})\n\n\t\tw.WriteHeader(http.StatusOK)\n\t\tassertWrite(t, w, []byte(`[{\"id\":1,\"user\":{\"login\":\"l\",\"id\":2},\"content\":\"+1\"}]`))\n\t})\n\n\topt := &ListReactionOptions{Content: \"+1\"}\n\tctx := t.Context()\n\tgot, _, err := client.Reactions.ListIssueCommentReactions(ctx, \"o\", \"r\", 1, opt)\n\tif err != nil {\n\t\tt.Errorf(\"ListIssueCommentReactions returned error: %v\", err)\n\t}\n\twant := []*Reaction{{ID: Ptr(int64(1)), User: &User{Login: Ptr(\"l\"), ID: Ptr(int64(2))}, Content: Ptr(\"+1\")}}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"ListIssueCommentReactions = %+v, want %+v\", got, want)\n\t}\n}\n\nfunc TestReactionsService_ListIssueCommentReactions_coverage(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\n\tconst methodName = \"ListIssueCommentReactions\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Reactions.ListIssueCommentReactions(ctx, \"\\n\", \"\\n\", -1, &ListReactionOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Reactions.ListIssueCommentReactions(ctx, \"o\", \"r\", 1, nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestReactionsService_CreateIssueCommentReaction(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/issues/comments/1/reactions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\n\t\tw.WriteHeader(http.StatusCreated)\n\t\tassertWrite(t, w, []byte(`{\"id\":1,\"user\":{\"login\":\"l\",\"id\":2},\"content\":\"+1\"}`))\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Reactions.CreateIssueCommentReaction(ctx, \"o\", \"r\", 1, \"+1\")\n\tif err != nil {\n\t\tt.Errorf(\"CreateIssueCommentReaction returned error: %v\", err)\n\t}\n\twant := &Reaction{ID: Ptr(int64(1)), User: &User{Login: Ptr(\"l\"), ID: Ptr(int64(2))}, Content: Ptr(\"+1\")}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"CreateIssueCommentReaction = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"CreateIssueCommentReaction\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Reactions.CreateIssueCommentReaction(ctx, \"\\n\", \"\\n\", -1, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Reactions.CreateIssueCommentReaction(ctx, \"o\", \"r\", 1, \"+1\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestReactionsService_ListPullRequestCommentReactions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/comments/1/reactions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\t\ttestFormValues(t, r, values{\"content\": \"+1\"})\n\n\t\tw.WriteHeader(http.StatusOK)\n\t\tassertWrite(t, w, []byte(`[{\"id\":1,\"user\":{\"login\":\"l\",\"id\":2},\"content\":\"+1\"}]`))\n\t})\n\n\topt := &ListReactionOptions{Content: \"+1\"}\n\tctx := t.Context()\n\tgot, _, err := client.Reactions.ListPullRequestCommentReactions(ctx, \"o\", \"r\", 1, opt)\n\tif err != nil {\n\t\tt.Errorf(\"ListPullRequestCommentReactions returned error: %v\", err)\n\t}\n\twant := []*Reaction{{ID: Ptr(int64(1)), User: &User{Login: Ptr(\"l\"), ID: Ptr(int64(2))}, Content: Ptr(\"+1\")}}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"ListPullRequestCommentReactions = %+v, want %+v\", got, want)\n\t}\n}\n\nfunc TestReactionsService_ListPullRequestCommentReactions_coverage(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\n\tconst methodName = \"ListPullRequestCommentReactions\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Reactions.ListPullRequestCommentReactions(ctx, \"\\n\", \"\\n\", -1, &ListReactionOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Reactions.ListPullRequestCommentReactions(ctx, \"o\", \"r\", 1, nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestReactionsService_CreatePullRequestCommentReaction(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/comments/1/reactions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\n\t\tw.WriteHeader(http.StatusCreated)\n\t\tassertWrite(t, w, []byte(`{\"id\":1,\"user\":{\"login\":\"l\",\"id\":2},\"content\":\"+1\"}`))\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Reactions.CreatePullRequestCommentReaction(ctx, \"o\", \"r\", 1, \"+1\")\n\tif err != nil {\n\t\tt.Errorf(\"CreatePullRequestCommentReaction returned error: %v\", err)\n\t}\n\twant := &Reaction{ID: Ptr(int64(1)), User: &User{Login: Ptr(\"l\"), ID: Ptr(int64(2))}, Content: Ptr(\"+1\")}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"CreatePullRequestCommentReaction = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"CreatePullRequestCommentReaction\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Reactions.CreatePullRequestCommentReaction(ctx, \"\\n\", \"\\n\", -1, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Reactions.CreatePullRequestCommentReaction(ctx, \"o\", \"r\", 1, \"+1\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestReactionsService_ListTeamDiscussionReactions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/teams/1/discussions/2/reactions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\t\ttestFormValues(t, r, values{\"content\": \"+1\"})\n\n\t\tw.WriteHeader(http.StatusOK)\n\t\tassertWrite(t, w, []byte(`[{\"id\":1,\"user\":{\"login\":\"l\",\"id\":2},\"content\":\"+1\"}]`))\n\t})\n\n\topt := &ListReactionOptions{Content: \"+1\"}\n\tctx := t.Context()\n\tgot, _, err := client.Reactions.ListTeamDiscussionReactions(ctx, 1, 2, opt)\n\tif err != nil {\n\t\tt.Errorf(\"ListTeamDiscussionReactions returned error: %v\", err)\n\t}\n\twant := []*Reaction{{ID: Ptr(int64(1)), User: &User{Login: Ptr(\"l\"), ID: Ptr(int64(2))}, Content: Ptr(\"+1\")}}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"ListTeamDiscussionReactions = %+v, want %+v\", got, want)\n\t}\n}\n\nfunc TestReactionsService_ListTeamDiscussionReactions_coverage(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\n\tconst methodName = \"ListTeamDiscussionReactions\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Reactions.ListTeamDiscussionReactions(ctx, -1, -2, &ListReactionOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Reactions.ListTeamDiscussionReactions(ctx, 1, 2, nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestReactionsService_CreateTeamDiscussionReaction(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/teams/1/discussions/2/reactions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\n\t\tw.WriteHeader(http.StatusCreated)\n\t\tassertWrite(t, w, []byte(`{\"id\":1,\"user\":{\"login\":\"l\",\"id\":2},\"content\":\"+1\"}`))\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Reactions.CreateTeamDiscussionReaction(ctx, 1, 2, \"+1\")\n\tif err != nil {\n\t\tt.Errorf(\"CreateTeamDiscussionReaction returned error: %v\", err)\n\t}\n\twant := &Reaction{ID: Ptr(int64(1)), User: &User{Login: Ptr(\"l\"), ID: Ptr(int64(2))}, Content: Ptr(\"+1\")}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"CreateTeamDiscussionReaction = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"CreateTeamDiscussionReaction\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Reactions.CreateTeamDiscussionReaction(ctx, -1, -2, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Reactions.CreateTeamDiscussionReaction(ctx, 1, 2, \"+1\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestReactionService_ListTeamDiscussionCommentReactions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/teams/1/discussions/2/comments/3/reactions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\t\ttestFormValues(t, r, values{\"content\": \"+1\"})\n\n\t\tw.WriteHeader(http.StatusOK)\n\t\tassertWrite(t, w, []byte(`[{\"id\":1,\"user\":{\"login\":\"l\",\"id\":2},\"content\":\"+1\"}]`))\n\t})\n\n\topt := &ListReactionOptions{Content: \"+1\"}\n\tctx := t.Context()\n\tgot, _, err := client.Reactions.ListTeamDiscussionCommentReactions(ctx, 1, 2, 3, opt)\n\tif err != nil {\n\t\tt.Errorf(\"ListTeamDiscussionCommentReactions returned error: %v\", err)\n\t}\n\twant := []*Reaction{{ID: Ptr(int64(1)), User: &User{Login: Ptr(\"l\"), ID: Ptr(int64(2))}, Content: Ptr(\"+1\")}}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"ListTeamDiscussionCommentReactions = %+v, want %+v\", got, want)\n\t}\n}\n\nfunc TestReactionService_ListTeamDiscussionCommentReactions_coverage(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\n\tconst methodName = \"ListTeamDiscussionCommentReactions\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Reactions.ListTeamDiscussionCommentReactions(ctx, -1, -2, -3, &ListReactionOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Reactions.ListTeamDiscussionCommentReactions(ctx, 1, 2, 3, nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestReactionService_CreateTeamDiscussionCommentReaction(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/teams/1/discussions/2/comments/3/reactions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\n\t\tw.WriteHeader(http.StatusCreated)\n\t\tassertWrite(t, w, []byte(`{\"id\":1,\"user\":{\"login\":\"l\",\"id\":2},\"content\":\"+1\"}`))\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Reactions.CreateTeamDiscussionCommentReaction(ctx, 1, 2, 3, \"+1\")\n\tif err != nil {\n\t\tt.Errorf(\"CreateTeamDiscussionCommentReaction returned error: %v\", err)\n\t}\n\twant := &Reaction{ID: Ptr(int64(1)), User: &User{Login: Ptr(\"l\"), ID: Ptr(int64(2))}, Content: Ptr(\"+1\")}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"CreateTeamDiscussionCommentReaction = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"CreateTeamDiscussionCommentReaction\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Reactions.CreateTeamDiscussionCommentReaction(ctx, -1, -2, -3, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Reactions.CreateTeamDiscussionCommentReaction(ctx, 1, 2, 3, \"+1\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestReactionsService_DeleteCommitCommentReaction(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/comments/1/reactions/2\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Reactions.DeleteCommentReaction(ctx, \"o\", \"r\", 1, 2); err != nil {\n\t\tt.Errorf(\"DeleteCommentReaction returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteCommentReaction\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Reactions.DeleteCommentReaction(ctx, \"\\n\", \"\\n\", -1, -2)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Reactions.DeleteCommentReaction(ctx, \"o\", \"r\", 1, 2)\n\t})\n}\n\nfunc TestReactionsService_DeleteCommitCommentReactionByRepoID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repositories/1/comments/2/reactions/3\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Reactions.DeleteCommentReactionByID(ctx, 1, 2, 3); err != nil {\n\t\tt.Errorf(\"DeleteCommentReactionByRepoID returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteCommentReactionByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Reactions.DeleteCommentReactionByID(ctx, -1, -2, -3)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Reactions.DeleteCommentReactionByID(ctx, 1, 2, 3)\n\t})\n}\n\nfunc TestReactionsService_DeleteIssueReaction(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/issues/1/reactions/2\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Reactions.DeleteIssueReaction(ctx, \"o\", \"r\", 1, 2); err != nil {\n\t\tt.Errorf(\"DeleteIssueReaction returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteIssueReaction\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Reactions.DeleteIssueReaction(ctx, \"\\n\", \"\\n\", -1, -2)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Reactions.DeleteIssueReaction(ctx, \"o\", \"r\", 1, 2)\n\t})\n}\n\nfunc TestReactionsService_DeleteIssueReactionByRepoID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repositories/1/issues/2/reactions/3\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Reactions.DeleteIssueReactionByID(ctx, 1, 2, 3); err != nil {\n\t\tt.Errorf(\"DeleteIssueReactionByRepoID returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteIssueReactionByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Reactions.DeleteIssueReactionByID(ctx, -1, -2, -3)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Reactions.DeleteIssueReactionByID(ctx, 1, 2, 3)\n\t})\n}\n\nfunc TestReactionsService_DeleteIssueCommentReaction(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/issues/comments/1/reactions/2\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Reactions.DeleteIssueCommentReaction(ctx, \"o\", \"r\", 1, 2); err != nil {\n\t\tt.Errorf(\"DeleteIssueCommentReaction returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteIssueCommentReaction\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Reactions.DeleteIssueCommentReaction(ctx, \"\\n\", \"\\n\", -1, -2)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Reactions.DeleteIssueCommentReaction(ctx, \"o\", \"r\", 1, 2)\n\t})\n}\n\nfunc TestReactionsService_DeleteIssueCommentReactionByRepoID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repositories/1/issues/comments/2/reactions/3\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Reactions.DeleteIssueCommentReactionByID(ctx, 1, 2, 3); err != nil {\n\t\tt.Errorf(\"DeleteIssueCommentReactionByRepoID returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteIssueCommentReactionByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Reactions.DeleteIssueCommentReactionByID(ctx, -1, -2, -3)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Reactions.DeleteIssueCommentReactionByID(ctx, 1, 2, 3)\n\t})\n}\n\nfunc TestReactionsService_DeletePullRequestCommentReaction(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pulls/comments/1/reactions/2\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Reactions.DeletePullRequestCommentReaction(ctx, \"o\", \"r\", 1, 2); err != nil {\n\t\tt.Errorf(\"DeletePullRequestCommentReaction returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeletePullRequestCommentReaction\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Reactions.DeletePullRequestCommentReaction(ctx, \"\\n\", \"\\n\", -1, -2)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Reactions.DeletePullRequestCommentReaction(ctx, \"o\", \"r\", 1, 2)\n\t})\n}\n\nfunc TestReactionsService_DeletePullRequestCommentReactionByRepoID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repositories/1/pulls/comments/2/reactions/3\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Reactions.DeletePullRequestCommentReactionByID(ctx, 1, 2, 3); err != nil {\n\t\tt.Errorf(\"DeletePullRequestCommentReactionByRepoID returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeletePullRequestCommentReactionByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Reactions.DeletePullRequestCommentReactionByID(ctx, -1, -2, -3)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Reactions.DeletePullRequestCommentReactionByID(ctx, 1, 2, 3)\n\t})\n}\n\nfunc TestReactionsService_DeleteTeamDiscussionReaction(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/s/discussions/1/reactions/2\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Reactions.DeleteTeamDiscussionReaction(ctx, \"o\", \"s\", 1, 2); err != nil {\n\t\tt.Errorf(\"DeleteTeamDiscussionReaction returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteTeamDiscussionReaction\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Reactions.DeleteTeamDiscussionReaction(ctx, \"\\n\", \"\\n\", -1, -2)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Reactions.DeleteTeamDiscussionReaction(ctx, \"o\", \"s\", 1, 2)\n\t})\n}\n\nfunc TestReactionsService_DeleteTeamDiscussionReactionByTeamIDAndOrgID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1/team/2/discussions/3/reactions/4\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Reactions.DeleteTeamDiscussionReactionByOrgIDAndTeamID(ctx, 1, 2, 3, 4); err != nil {\n\t\tt.Errorf(\"DeleteTeamDiscussionReactionByTeamIDAndOrgID returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteTeamDiscussionReactionByOrgIDAndTeamID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Reactions.DeleteTeamDiscussionReactionByOrgIDAndTeamID(ctx, -1, -2, -3, -4)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Reactions.DeleteTeamDiscussionReactionByOrgIDAndTeamID(ctx, 1, 2, 3, 4)\n\t})\n}\n\nfunc TestReactionsService_DeleteTeamDiscussionCommentReaction(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/s/discussions/1/comments/2/reactions/3\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Reactions.DeleteTeamDiscussionCommentReaction(ctx, \"o\", \"s\", 1, 2, 3); err != nil {\n\t\tt.Errorf(\"DeleteTeamDiscussionCommentReaction returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteTeamDiscussionCommentReaction\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Reactions.DeleteTeamDiscussionCommentReaction(ctx, \"\\n\", \"\\n\", -1, -2, -3)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Reactions.DeleteTeamDiscussionCommentReaction(ctx, \"o\", \"s\", 1, 2, 3)\n\t})\n}\n\nfunc TestReactionsService_DeleteTeamDiscussionCommentReactionByTeamIDAndOrgID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1/team/2/discussions/3/comments/4/reactions/5\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Reactions.DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID(ctx, 1, 2, 3, 4, 5); err != nil {\n\t\tt.Errorf(\"DeleteTeamDiscussionCommentReactionByTeamIDAndOrgID returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Reactions.DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID(ctx, -1, -2, -3, -4, -5)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Reactions.DeleteTeamDiscussionCommentReactionByOrgIDAndTeamID(ctx, 1, 2, 3, 4, 5)\n\t})\n}\n\nfunc TestReactionService_CreateReleaseReaction(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/releases/1/reactions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\n\t\tw.WriteHeader(http.StatusCreated)\n\t\tassertWrite(t, w, []byte(`{\"id\":1,\"user\":{\"login\":\"l\",\"id\":2},\"content\":\"rocket\"}`))\n\t})\n\n\tconst methodName = \"CreateReleaseReaction\"\n\tctx := t.Context()\n\tgot, _, err := client.Reactions.CreateReleaseReaction(ctx, \"o\", \"r\", 1, \"rocket\")\n\tif err != nil {\n\t\tt.Errorf(\"%v returned error: %v\", methodName, err)\n\t}\n\n\twant := &Reaction{ID: Ptr(int64(1)), User: &User{Login: Ptr(\"l\"), ID: Ptr(int64(2))}, Content: Ptr(\"rocket\")}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"%v = %+v, want %+v\", methodName, got, want)\n\t}\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Reactions.CreateReleaseReaction(ctx, \"\\n\", \"\\n\", -1, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Reactions.CreateReleaseReaction(ctx, \"o\", \"r\", 1, \"rocket\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestReactionsService_ListReleaseReactions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/releases/1/reactions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\t\ttestFormValues(t, r, values{\"content\": \"+1\"})\n\n\t\tw.WriteHeader(http.StatusOK)\n\t\tassertWrite(t, w, []byte(`[{\"id\":1,\"user\":{\"login\":\"l\",\"id\":2},\"content\":\"+1\"}]`))\n\t})\n\n\topt := &ListReactionOptions{Content: \"+1\"}\n\tctx := t.Context()\n\tgot, _, err := client.Reactions.ListReleaseReactions(ctx, \"o\", \"r\", 1, opt)\n\tif err != nil {\n\t\tt.Errorf(\"ListReleaseReactions returned error: %v\", err)\n\t}\n\twant := []*Reaction{{ID: Ptr(int64(1)), User: &User{Login: Ptr(\"l\"), ID: Ptr(int64(2))}, Content: Ptr(\"+1\")}}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"ListReleaseReactions = %+v, want %+v\", got, want)\n\t}\n}\n\nfunc TestReactionsService_ListReleaseReactions_coverage(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\n\tconst methodName = \"ListReleaseReactions\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Reactions.ListReleaseReactions(ctx, \"\\n\", \"\\n\", -1, &ListReactionOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Reactions.ListReleaseReactions(ctx, \"o\", \"r\", 1, nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestReactionsService_DeleteReleaseReaction(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/releases/1/reactions/2\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Reactions.DeleteReleaseReaction(ctx, \"o\", \"r\", 1, 2); err != nil {\n\t\tt.Errorf(\"DeleteReleaseReaction returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteReleaseReaction\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Reactions.DeleteReleaseReaction(ctx, \"\\n\", \"\\n\", -1, -2)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Reactions.DeleteReleaseReaction(ctx, \"o\", \"r\", 1, 2)\n\t})\n}\n\nfunc TestReactionsService_DeleteReleaseReactionByRepoID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repositories/1/releases/2/reactions/3\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Reactions.DeleteReleaseReactionByID(ctx, 1, 2, 3); err != nil {\n\t\tt.Errorf(\"DeleteReleaseReactionByRepoID returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteReleaseReactionByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Reactions.DeleteIssueReactionByID(ctx, -1, -2, -3)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Reactions.DeleteIssueReactionByID(ctx, 1, 2, 3)\n\t})\n}\n"
  },
  {
    "path": "github/repos.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strings\"\n)\n\nconst githubBranchNotProtected string = \"Branch not protected\"\n\nvar ErrBranchNotProtected = errors.New(\"branch is not protected\")\n\n// RepositoriesService handles communication with the repository related\n// methods of the GitHub API.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/\ntype RepositoriesService service\n\n// Repository represents a GitHub repository.\ntype Repository struct {\n\tID                        *int64                 `json:\"id,omitempty\"`\n\tNodeID                    *string                `json:\"node_id,omitempty\"`\n\tOwner                     *User                  `json:\"owner,omitempty\"`\n\tName                      *string                `json:\"name,omitempty\"`\n\tFullName                  *string                `json:\"full_name,omitempty\"`\n\tDescription               *string                `json:\"description,omitempty\"`\n\tHomepage                  *string                `json:\"homepage,omitempty\"`\n\tCodeOfConduct             *CodeOfConduct         `json:\"code_of_conduct,omitempty\"`\n\tDefaultBranch             *string                `json:\"default_branch,omitempty\"`\n\tMasterBranch              *string                `json:\"master_branch,omitempty\"`\n\tCreatedAt                 *Timestamp             `json:\"created_at,omitempty\"`\n\tPushedAt                  *Timestamp             `json:\"pushed_at,omitempty\"`\n\tUpdatedAt                 *Timestamp             `json:\"updated_at,omitempty\"`\n\tHTMLURL                   *string                `json:\"html_url,omitempty\"`\n\tCloneURL                  *string                `json:\"clone_url,omitempty\"`\n\tGitURL                    *string                `json:\"git_url,omitempty\"`\n\tMirrorURL                 *string                `json:\"mirror_url,omitempty\"`\n\tSSHURL                    *string                `json:\"ssh_url,omitempty\"`\n\tSVNURL                    *string                `json:\"svn_url,omitempty\"`\n\tLanguage                  *string                `json:\"language,omitempty\"`\n\tFork                      *bool                  `json:\"fork,omitempty\"`\n\tForksCount                *int                   `json:\"forks_count,omitempty\"`\n\tNetworkCount              *int                   `json:\"network_count,omitempty\"`\n\tOpenIssuesCount           *int                   `json:\"open_issues_count,omitempty\"`\n\tOpenIssues                *int                   `json:\"open_issues,omitempty\"` // Deprecated: Replaced by OpenIssuesCount. For backward compatibility OpenIssues is still populated.\n\tStargazersCount           *int                   `json:\"stargazers_count,omitempty\"`\n\tSubscribersCount          *int                   `json:\"subscribers_count,omitempty\"`\n\tWatchersCount             *int                   `json:\"watchers_count,omitempty\"` // Deprecated: Replaced by StargazersCount. For backward compatibility WatchersCount is still populated.\n\tWatchers                  *int                   `json:\"watchers,omitempty\"`       // Deprecated: Replaced by StargazersCount. For backward compatibility Watchers is still populated.\n\tSize                      *int                   `json:\"size,omitempty\"`\n\tAutoInit                  *bool                  `json:\"auto_init,omitempty\"`\n\tParent                    *Repository            `json:\"parent,omitempty\"`\n\tSource                    *Repository            `json:\"source,omitempty\"`\n\tTemplateRepository        *Repository            `json:\"template_repository,omitempty\"`\n\tOrganization              *Organization          `json:\"organization,omitempty\"`\n\tPermissions               *RepositoryPermissions `json:\"permissions,omitempty\"`\n\tAllowRebaseMerge          *bool                  `json:\"allow_rebase_merge,omitempty\"`\n\tAllowUpdateBranch         *bool                  `json:\"allow_update_branch,omitempty\"`\n\tAllowSquashMerge          *bool                  `json:\"allow_squash_merge,omitempty\"`\n\tAllowMergeCommit          *bool                  `json:\"allow_merge_commit,omitempty\"`\n\tAllowAutoMerge            *bool                  `json:\"allow_auto_merge,omitempty\"`\n\tAllowForking              *bool                  `json:\"allow_forking,omitempty\"`\n\tWebCommitSignoffRequired  *bool                  `json:\"web_commit_signoff_required,omitempty\"`\n\tDeleteBranchOnMerge       *bool                  `json:\"delete_branch_on_merge,omitempty\"`\n\tUseSquashPRTitleAsDefault *bool                  `json:\"use_squash_pr_title_as_default,omitempty\"`\n\tSquashMergeCommitTitle    *string                `json:\"squash_merge_commit_title,omitempty\"`   // Can be one of: \"PR_TITLE\", \"COMMIT_OR_PR_TITLE\"\n\tSquashMergeCommitMessage  *string                `json:\"squash_merge_commit_message,omitempty\"` // Can be one of: \"PR_BODY\", \"COMMIT_MESSAGES\", \"BLANK\"\n\tMergeCommitTitle          *string                `json:\"merge_commit_title,omitempty\"`          // Can be one of: \"PR_TITLE\", \"MERGE_MESSAGE\"\n\tMergeCommitMessage        *string                `json:\"merge_commit_message,omitempty\"`        // Can be one of: \"PR_BODY\", \"PR_TITLE\", \"BLANK\"\n\tTopics                    []string               `json:\"topics,omitempty\"`\n\tCustomProperties          map[string]any         `json:\"custom_properties,omitempty\"`\n\tArchived                  *bool                  `json:\"archived,omitempty\"`\n\tDisabled                  *bool                  `json:\"disabled,omitempty\"`\n\n\t// Only provided when using RepositoriesService.Get while in preview\n\tLicense *License `json:\"license,omitempty\"`\n\n\t// Additional mutable fields when creating and editing a repository\n\tPrivate           *bool   `json:\"private,omitempty\"`\n\tHasIssues         *bool   `json:\"has_issues,omitempty\"`\n\tHasWiki           *bool   `json:\"has_wiki,omitempty\"`\n\tHasPages          *bool   `json:\"has_pages,omitempty\"`\n\tHasProjects       *bool   `json:\"has_projects,omitempty\"`\n\tHasDownloads      *bool   `json:\"has_downloads,omitempty\"`\n\tHasDiscussions    *bool   `json:\"has_discussions,omitempty\"`\n\tIsTemplate        *bool   `json:\"is_template,omitempty\"`\n\tLicenseTemplate   *string `json:\"license_template,omitempty\"`\n\tGitignoreTemplate *string `json:\"gitignore_template,omitempty\"`\n\n\t// Options for configuring Advanced Security and Secret Scanning\n\tSecurityAndAnalysis *SecurityAndAnalysis `json:\"security_and_analysis,omitempty\"`\n\n\t// Creating an organization repository. Required for non-owners.\n\tTeamID *int64 `json:\"team_id,omitempty\"`\n\n\t// API URLs\n\tURL              *string `json:\"url,omitempty\"`\n\tArchiveURL       *string `json:\"archive_url,omitempty\"`\n\tAssigneesURL     *string `json:\"assignees_url,omitempty\"`\n\tBlobsURL         *string `json:\"blobs_url,omitempty\"`\n\tBranchesURL      *string `json:\"branches_url,omitempty\"`\n\tCollaboratorsURL *string `json:\"collaborators_url,omitempty\"`\n\tCommentsURL      *string `json:\"comments_url,omitempty\"`\n\tCommitsURL       *string `json:\"commits_url,omitempty\"`\n\tCompareURL       *string `json:\"compare_url,omitempty\"`\n\tContentsURL      *string `json:\"contents_url,omitempty\"`\n\tContributorsURL  *string `json:\"contributors_url,omitempty\"`\n\tDeploymentsURL   *string `json:\"deployments_url,omitempty\"`\n\tDownloadsURL     *string `json:\"downloads_url,omitempty\"`\n\tEventsURL        *string `json:\"events_url,omitempty\"`\n\tForksURL         *string `json:\"forks_url,omitempty\"`\n\tGitCommitsURL    *string `json:\"git_commits_url,omitempty\"`\n\tGitRefsURL       *string `json:\"git_refs_url,omitempty\"`\n\tGitTagsURL       *string `json:\"git_tags_url,omitempty\"`\n\tHooksURL         *string `json:\"hooks_url,omitempty\"`\n\tIssueCommentURL  *string `json:\"issue_comment_url,omitempty\"`\n\tIssueEventsURL   *string `json:\"issue_events_url,omitempty\"`\n\tIssuesURL        *string `json:\"issues_url,omitempty\"`\n\tKeysURL          *string `json:\"keys_url,omitempty\"`\n\tLabelsURL        *string `json:\"labels_url,omitempty\"`\n\tLanguagesURL     *string `json:\"languages_url,omitempty\"`\n\tMergesURL        *string `json:\"merges_url,omitempty\"`\n\tMilestonesURL    *string `json:\"milestones_url,omitempty\"`\n\tNotificationsURL *string `json:\"notifications_url,omitempty\"`\n\tPullsURL         *string `json:\"pulls_url,omitempty\"`\n\tReleasesURL      *string `json:\"releases_url,omitempty\"`\n\tStargazersURL    *string `json:\"stargazers_url,omitempty\"`\n\tStatusesURL      *string `json:\"statuses_url,omitempty\"`\n\tSubscribersURL   *string `json:\"subscribers_url,omitempty\"`\n\tSubscriptionURL  *string `json:\"subscription_url,omitempty\"`\n\tTagsURL          *string `json:\"tags_url,omitempty\"`\n\tTreesURL         *string `json:\"trees_url,omitempty\"`\n\tTeamsURL         *string `json:\"teams_url,omitempty\"`\n\n\t// TextMatches is only populated from search results that request text matches\n\t// See: search.go and https://docs.github.com/rest/search/#text-match-metadata\n\tTextMatches []*TextMatch `json:\"text_matches,omitempty\"`\n\n\t// Visibility is only used for Create and Edit endpoints. The visibility field\n\t// overrides the field parameter when both are used.\n\t// Can be one of public, private or internal.\n\tVisibility *string `json:\"visibility,omitempty\"`\n\n\t// RoleName is only returned by the API 'check team permissions for a repository'.\n\t// See: teams.go (IsTeamRepoByID) https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository\n\tRoleName *string `json:\"role_name,omitempty\"`\n}\n\nfunc (r Repository) String() string {\n\treturn Stringify(r)\n}\n\n// BranchListOptions specifies the optional parameters to the\n// RepositoriesService.ListBranches method.\ntype BranchListOptions struct {\n\t// Setting to true returns only protected branches.\n\t// When set to false, only unprotected branches are returned.\n\t// Omitting this parameter returns all branches.\n\t// Default: nil\n\tProtected *bool `url:\"protected,omitempty\"`\n\n\tListOptions\n}\n\n// RepositoryListOptions specifies the optional parameters to the\n// RepositoriesService.List method.\ntype RepositoryListOptions struct {\n\t// See RepositoryListByAuthenticatedUserOptions.Visibility\n\tVisibility string `url:\"visibility,omitempty\"`\n\n\t// See RepositoryListByAuthenticatedUserOptions.Affiliation\n\tAffiliation string `url:\"affiliation,omitempty\"`\n\n\t// See RepositoryListByUserOptions.Type or RepositoryListByAuthenticatedUserOptions.Type\n\tType string `url:\"type,omitempty\"`\n\n\t// See RepositoryListByUserOptions.Sort or RepositoryListByAuthenticatedUserOptions.Sort\n\tSort string `url:\"sort,omitempty\"`\n\n\t// See RepositoryListByUserOptions.Direction or RepositoryListByAuthenticatedUserOptions.Direction\n\tDirection string `url:\"direction,omitempty\"`\n\n\tListOptions\n}\n\n// SecurityAndAnalysis specifies the optional advanced security features\n// that are enabled on a given repository.\ntype SecurityAndAnalysis struct {\n\tAdvancedSecurity             *AdvancedSecurity             `json:\"advanced_security,omitempty\"`\n\tSecretScanning               *SecretScanning               `json:\"secret_scanning,omitempty\"`\n\tSecretScanningPushProtection *SecretScanningPushProtection `json:\"secret_scanning_push_protection,omitempty\"`\n\tDependabotSecurityUpdates    *DependabotSecurityUpdates    `json:\"dependabot_security_updates,omitempty\"`\n\tSecretScanningValidityChecks *SecretScanningValidityChecks `json:\"secret_scanning_validity_checks,omitempty\"`\n}\n\n// RepositoryPermissions represents the permissions a user has for a repository.\ntype RepositoryPermissions struct {\n\tAdmin    *bool `json:\"admin,omitempty\"`\n\tMaintain *bool `json:\"maintain,omitempty\"`\n\tPush     *bool `json:\"push,omitempty\"`\n\tTriage   *bool `json:\"triage,omitempty\"`\n\tPull     *bool `json:\"pull,omitempty\"`\n}\n\nfunc (s SecurityAndAnalysis) String() string {\n\treturn Stringify(s)\n}\n\n// AdvancedSecurity specifies the state of advanced security on a repository.\n//\n// GitHub API docs: https://docs.github.com/github/getting-started-with-github/learning-about-github/about-github-advanced-security\ntype AdvancedSecurity struct {\n\tStatus *string `json:\"status,omitempty\"`\n}\n\nfunc (a AdvancedSecurity) String() string {\n\treturn Stringify(a)\n}\n\n// SecretScanning specifies the state of secret scanning on a repository.\n//\n// GitHub API docs: https://docs.github.com/code-security/secret-security/about-secret-scanning\ntype SecretScanning struct {\n\tStatus *string `json:\"status,omitempty\"`\n}\n\nfunc (s SecretScanning) String() string {\n\treturn Stringify(s)\n}\n\n// SecretScanningPushProtection specifies the state of secret scanning push protection on a repository.\n//\n// GitHub API docs: https://docs.github.com/code-security/secret-scanning/about-secret-scanning#about-secret-scanning-for-partner-patterns\ntype SecretScanningPushProtection struct {\n\tStatus *string `json:\"status,omitempty\"`\n}\n\nfunc (s SecretScanningPushProtection) String() string {\n\treturn Stringify(s)\n}\n\n// DependabotSecurityUpdates specifies the state of Dependabot security updates on a repository.\n//\n// GitHub API docs: https://docs.github.com/code-security/dependabot/dependabot-security-updates/about-dependabot-security-updates\ntype DependabotSecurityUpdates struct {\n\tStatus *string `json:\"status,omitempty\"`\n}\n\nfunc (d DependabotSecurityUpdates) String() string {\n\treturn Stringify(d)\n}\n\n// SecretScanningValidityChecks represents the state of secret scanning validity checks on a repository.\n//\n// GitHub API docs: https://docs.github.com/en/enterprise-cloud@latest/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository#allowing-validity-checks-for-partner-patterns-in-a-repository\ntype SecretScanningValidityChecks struct {\n\tStatus *string `json:\"status,omitempty\"`\n}\n\n// List calls either RepositoriesService.ListByUser or RepositoriesService.ListByAuthenticatedUser\n// depending on whether user is empty.\n//\n// Deprecated: Use RepositoriesService.ListByUser or RepositoriesService.ListByAuthenticatedUser instead.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repositories-for-a-user\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repositories-for-the-authenticated-user\n//\n//meta:operation GET /user/repos\n//meta:operation GET /users/{username}/repos\nfunc (s *RepositoriesService) List(ctx context.Context, user string, opts *RepositoryListOptions) ([]*Repository, *Response, error) {\n\tif opts == nil {\n\t\topts = &RepositoryListOptions{}\n\t}\n\tif user != \"\" {\n\t\treturn s.ListByUser(ctx, user, &RepositoryListByUserOptions{\n\t\t\tType:        opts.Type,\n\t\t\tSort:        opts.Sort,\n\t\t\tDirection:   opts.Direction,\n\t\t\tListOptions: opts.ListOptions,\n\t\t})\n\t}\n\treturn s.ListByAuthenticatedUser(ctx, &RepositoryListByAuthenticatedUserOptions{\n\t\tVisibility:  opts.Visibility,\n\t\tAffiliation: opts.Affiliation,\n\t\tType:        opts.Type,\n\t\tSort:        opts.Sort,\n\t\tDirection:   opts.Direction,\n\t\tListOptions: opts.ListOptions,\n\t})\n}\n\n// RepositoryListByUserOptions specifies the optional parameters to the\n// RepositoriesService.ListByUser method.\ntype RepositoryListByUserOptions struct {\n\t// Limit results to repositories of the specified type.\n\t// Default: owner\n\t// Can be one of: all, owner, member\n\tType string `url:\"type,omitempty\"`\n\n\t// The property to sort the results by.\n\t// Default: full_name\n\t// Can be one of: created, updated, pushed, full_name\n\tSort string `url:\"sort,omitempty\"`\n\n\t// The order to sort by.\n\t// Default: asc when using full_name; otherwise, desc.\n\t// Can be one of: asc, desc\n\tDirection string `url:\"direction,omitempty\"`\n\n\tListOptions\n}\n\n// ListByUser lists public repositories for the specified user.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repositories-for-a-user\n//\n//meta:operation GET /users/{username}/repos\nfunc (s *RepositoriesService) ListByUser(ctx context.Context, user string, opts *RepositoryListByUserOptions) ([]*Repository, *Response, error) {\n\tu := fmt.Sprintf(\"users/%v/repos\", user)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar repos []*Repository\n\tresp, err := s.client.Do(ctx, req, &repos)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn repos, resp, nil\n}\n\n// RepositoryListByAuthenticatedUserOptions specifies the optional parameters to the\n// RepositoriesService.ListByAuthenticatedUser method.\ntype RepositoryListByAuthenticatedUserOptions struct {\n\t// Limit results to repositories with the specified visibility.\n\t// Default: all\n\t// Can be one of: all, public, private\n\tVisibility string `url:\"visibility,omitempty\"`\n\n\t// List repos of given affiliation[s].\n\t// Comma-separated list of values. Can include:\n\t// * owner: Repositories that are owned by the authenticated user.\n\t// * collaborator: Repositories that the user has been added to as a\n\t//   collaborator.\n\t// * organization_member: Repositories that the user has access to through\n\t//   being a member of an organization. This includes every repository on\n\t//   every team that the user is on.\n\t// Default: owner,collaborator,organization_member\n\tAffiliation string `url:\"affiliation,omitempty\"`\n\n\t// Limit results to repositories of the specified type. Will cause a 422 error if\n\t// used in the same request as visibility or affiliation.\n\t// Default: all\n\t// Can be one of: all, owner, public, private, member\n\tType string `url:\"type,omitempty\"`\n\n\t// The property to sort the results by.\n\t// Default: full_name\n\t// Can be one of: created, updated, pushed, full_name\n\tSort string `url:\"sort,omitempty\"`\n\n\t// Direction in which to sort repositories. Can be one of asc or desc.\n\t// Default: when using full_name: asc; otherwise desc\n\tDirection string `url:\"direction,omitempty\"`\n\n\tListOptions\n}\n\n// ListByAuthenticatedUser lists repositories for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repositories-for-the-authenticated-user\n//\n//meta:operation GET /user/repos\nfunc (s *RepositoriesService) ListByAuthenticatedUser(ctx context.Context, opts *RepositoryListByAuthenticatedUserOptions) ([]*Repository, *Response, error) {\n\tu := \"user/repos\"\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar repos []*Repository\n\tresp, err := s.client.Do(ctx, req, &repos)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn repos, resp, nil\n}\n\n// RepositoryListByOrgOptions specifies the optional parameters to the\n// RepositoriesService.ListByOrg method.\ntype RepositoryListByOrgOptions struct {\n\t// Type of repositories to list. Possible values are: all, public, private,\n\t// forks, sources, member. Default is \"all\".\n\tType string `url:\"type,omitempty\"`\n\n\t// How to sort the repository list. Can be one of created, updated, pushed,\n\t// full_name. Default is \"created\".\n\tSort string `url:\"sort,omitempty\"`\n\n\t// Direction in which to sort repositories. Can be one of asc or desc.\n\t// Default when using full_name: asc; otherwise desc.\n\tDirection string `url:\"direction,omitempty\"`\n\n\tListOptions\n}\n\n// ListByOrg lists the repositories for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#list-organization-repositories\n//\n//meta:operation GET /orgs/{org}/repos\nfunc (s *RepositoriesService) ListByOrg(ctx context.Context, org string, opts *RepositoryListByOrgOptions) ([]*Repository, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/repos\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tacceptHeaders := []string{mediaTypeTopicsPreview, mediaTypeRepositoryVisibilityPreview}\n\treq.Header.Set(\"Accept\", strings.Join(acceptHeaders, \", \"))\n\n\tvar repos []*Repository\n\tresp, err := s.client.Do(ctx, req, &repos)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn repos, resp, nil\n}\n\n// RepositoryListAllOptions specifies the optional parameters to the\n// RepositoriesService.ListAll method.\ntype RepositoryListAllOptions struct {\n\t// ID of the last repository seen\n\tSince int64 `url:\"since,omitempty\"`\n}\n\n// ListAll lists all GitHub repositories in the order that they were created.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#list-public-repositories\n//\n//meta:operation GET /repositories\nfunc (s *RepositoriesService) ListAll(ctx context.Context, opts *RepositoryListAllOptions) ([]*Repository, *Response, error) {\n\tu, err := addOptions(\"repositories\", opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar repos []*Repository\n\tresp, err := s.client.Do(ctx, req, &repos)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn repos, resp, nil\n}\n\n// createRepoRequest is a subset of Repository and is used internally\n// by Create to pass only the known fields for the endpoint.\n//\n// See https://github.com/google/go-github/issues/1014 for more\n// information.\ntype createRepoRequest struct {\n\t// Name is required when creating a repo.\n\tName        *string `json:\"name,omitempty\"`\n\tDescription *string `json:\"description,omitempty\"`\n\tHomepage    *string `json:\"homepage,omitempty\"`\n\n\tPrivate        *bool   `json:\"private,omitempty\"`\n\tVisibility     *string `json:\"visibility,omitempty\"`\n\tHasIssues      *bool   `json:\"has_issues,omitempty\"`\n\tHasProjects    *bool   `json:\"has_projects,omitempty\"`\n\tHasWiki        *bool   `json:\"has_wiki,omitempty\"`\n\tHasDiscussions *bool   `json:\"has_discussions,omitempty\"`\n\tIsTemplate     *bool   `json:\"is_template,omitempty\"`\n\n\t// Creating an organization repository. Required for non-owners.\n\tTeamID *int64 `json:\"team_id,omitempty\"`\n\n\tAutoInit                  *bool          `json:\"auto_init,omitempty\"`\n\tGitignoreTemplate         *string        `json:\"gitignore_template,omitempty\"`\n\tLicenseTemplate           *string        `json:\"license_template,omitempty\"`\n\tAllowSquashMerge          *bool          `json:\"allow_squash_merge,omitempty\"`\n\tAllowMergeCommit          *bool          `json:\"allow_merge_commit,omitempty\"`\n\tAllowRebaseMerge          *bool          `json:\"allow_rebase_merge,omitempty\"`\n\tAllowUpdateBranch         *bool          `json:\"allow_update_branch,omitempty\"`\n\tAllowAutoMerge            *bool          `json:\"allow_auto_merge,omitempty\"`\n\tAllowForking              *bool          `json:\"allow_forking,omitempty\"`\n\tDeleteBranchOnMerge       *bool          `json:\"delete_branch_on_merge,omitempty\"`\n\tUseSquashPRTitleAsDefault *bool          `json:\"use_squash_pr_title_as_default,omitempty\"`\n\tSquashMergeCommitTitle    *string        `json:\"squash_merge_commit_title,omitempty\"`\n\tSquashMergeCommitMessage  *string        `json:\"squash_merge_commit_message,omitempty\"`\n\tMergeCommitTitle          *string        `json:\"merge_commit_title,omitempty\"`\n\tMergeCommitMessage        *string        `json:\"merge_commit_message,omitempty\"`\n\tCustomProperties          map[string]any `json:\"custom_properties,omitempty\"`\n}\n\n// Create a new repository. If an organization is specified, the new\n// repository will be created under that org. If the empty string is\n// specified, it will be created for the authenticated user.\n//\n// Note that only a subset of the repo fields are used and repo must\n// not be nil.\n//\n// Also note that this method will return the response without actually\n// waiting for GitHub to finish creating the repository and letting the\n// changes propagate throughout its servers. You may set up a loop with\n// exponential back-off to verify repository's creation.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#create-a-repository-for-the-authenticated-user\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#create-an-organization-repository\n//\n//meta:operation POST /orgs/{org}/repos\n//meta:operation POST /user/repos\nfunc (s *RepositoriesService) Create(ctx context.Context, org string, repo *Repository) (*Repository, *Response, error) {\n\tif repo == nil {\n\t\treturn nil, nil, errors.New(\"repository must be provided\")\n\t}\n\n\tvar u string\n\tif org != \"\" {\n\t\tu = fmt.Sprintf(\"orgs/%v/repos\", org)\n\t} else {\n\t\tu = \"user/repos\"\n\t}\n\n\trepoReq := &createRepoRequest{\n\t\tName:                      repo.Name,\n\t\tDescription:               repo.Description,\n\t\tHomepage:                  repo.Homepage,\n\t\tPrivate:                   repo.Private,\n\t\tVisibility:                repo.Visibility,\n\t\tHasIssues:                 repo.HasIssues,\n\t\tHasProjects:               repo.HasProjects,\n\t\tHasWiki:                   repo.HasWiki,\n\t\tHasDiscussions:            repo.HasDiscussions,\n\t\tIsTemplate:                repo.IsTemplate,\n\t\tTeamID:                    repo.TeamID,\n\t\tAutoInit:                  repo.AutoInit,\n\t\tGitignoreTemplate:         repo.GitignoreTemplate,\n\t\tLicenseTemplate:           repo.LicenseTemplate,\n\t\tAllowSquashMerge:          repo.AllowSquashMerge,\n\t\tAllowMergeCommit:          repo.AllowMergeCommit,\n\t\tAllowRebaseMerge:          repo.AllowRebaseMerge,\n\t\tAllowUpdateBranch:         repo.AllowUpdateBranch,\n\t\tAllowAutoMerge:            repo.AllowAutoMerge,\n\t\tAllowForking:              repo.AllowForking,\n\t\tDeleteBranchOnMerge:       repo.DeleteBranchOnMerge,\n\t\tUseSquashPRTitleAsDefault: repo.UseSquashPRTitleAsDefault,\n\t\tSquashMergeCommitTitle:    repo.SquashMergeCommitTitle,\n\t\tSquashMergeCommitMessage:  repo.SquashMergeCommitMessage,\n\t\tMergeCommitTitle:          repo.MergeCommitTitle,\n\t\tMergeCommitMessage:        repo.MergeCommitMessage,\n\t\tCustomProperties:          repo.CustomProperties,\n\t}\n\n\treq, err := s.client.NewRequest(\"POST\", u, repoReq)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tacceptHeaders := []string{mediaTypeRepositoryTemplatePreview, mediaTypeRepositoryVisibilityPreview}\n\treq.Header.Set(\"Accept\", strings.Join(acceptHeaders, \", \"))\n\tvar r *Repository\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}\n\n// TemplateRepoRequest represents a request to create a repository from a template.\ntype TemplateRepoRequest struct {\n\t// Name is required when creating a repo.\n\tName        *string `json:\"name,omitempty\"`\n\tOwner       *string `json:\"owner,omitempty\"`\n\tDescription *string `json:\"description,omitempty\"`\n\n\tIncludeAllBranches *bool `json:\"include_all_branches,omitempty\"`\n\tPrivate            *bool `json:\"private,omitempty\"`\n}\n\n// CreateFromTemplate generates a repository from a template.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#create-a-repository-using-a-template\n//\n//meta:operation POST /repos/{template_owner}/{template_repo}/generate\nfunc (s *RepositoriesService) CreateFromTemplate(ctx context.Context, templateOwner, templateRepo string, templateRepoReq *TemplateRepoRequest) (*Repository, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/generate\", templateOwner, templateRepo)\n\n\treq, err := s.client.NewRequest(\"POST\", u, templateRepoReq)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeRepositoryTemplatePreview)\n\tvar r *Repository\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}\n\n// Get fetches a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#get-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}\nfunc (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Repository, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v\", owner, repo)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\t// https://docs.github.com/rest/licenses/#get-a-repositorys-license\n\tacceptHeaders := []string{\n\t\tmediaTypeCodesOfConductPreview,\n\t\tmediaTypeTopicsPreview,\n\t\tmediaTypeRepositoryTemplatePreview,\n\t\tmediaTypeRepositoryVisibilityPreview,\n\t}\n\treq.Header.Set(\"Accept\", strings.Join(acceptHeaders, \", \"))\n\n\tvar repository *Repository\n\tresp, err := s.client.Do(ctx, req, &repository)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn repository, resp, nil\n}\n\n// GetCodeOfConduct gets the contents of a repository's code of conduct.\n// Note that https://docs.github.com/rest/codes-of-conduct#about-the-codes-of-conduct-api\n// says to use the GET /repos/{owner}/{repo} endpoint.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#get-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}\nfunc (s *RepositoriesService) GetCodeOfConduct(ctx context.Context, owner, repo string) (*CodeOfConduct, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v\", owner, repo)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeCodesOfConductPreview)\n\n\tvar r *Repository\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r.GetCodeOfConduct(), resp, nil\n}\n\n// GetByID fetches a repository.\n//\n// Note: GetByID uses the undocumented GitHub API endpoint \"GET /repositories/{repository_id}\".\n//\n//meta:operation GET /repositories/{repository_id}\nfunc (s *RepositoriesService) GetByID(ctx context.Context, id int64) (*Repository, *Response, error) {\n\tu := fmt.Sprintf(\"repositories/%v\", id)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar repository *Repository\n\tresp, err := s.client.Do(ctx, req, &repository)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn repository, resp, nil\n}\n\n// Edit updates a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#update-a-repository\n//\n//meta:operation PATCH /repos/{owner}/{repo}\nfunc (s *RepositoriesService) Edit(ctx context.Context, owner, repo string, repository *Repository) (*Repository, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v\", owner, repo)\n\treq, err := s.client.NewRequest(\"PATCH\", u, repository)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tacceptHeaders := []string{mediaTypeRepositoryTemplatePreview, mediaTypeRepositoryVisibilityPreview}\n\treq.Header.Set(\"Accept\", strings.Join(acceptHeaders, \", \"))\n\tvar r *Repository\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}\n\n// Delete a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#delete-a-repository\n//\n//meta:operation DELETE /repos/{owner}/{repo}\nfunc (s *RepositoriesService) Delete(ctx context.Context, owner, repo string) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v\", owner, repo)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// Contributor represents a repository contributor.\ntype Contributor struct {\n\tLogin             *string `json:\"login,omitempty\"`\n\tID                *int64  `json:\"id,omitempty\"`\n\tNodeID            *string `json:\"node_id,omitempty\"`\n\tAvatarURL         *string `json:\"avatar_url,omitempty\"`\n\tGravatarID        *string `json:\"gravatar_id,omitempty\"`\n\tURL               *string `json:\"url,omitempty\"`\n\tHTMLURL           *string `json:\"html_url,omitempty\"`\n\tFollowersURL      *string `json:\"followers_url,omitempty\"`\n\tFollowingURL      *string `json:\"following_url,omitempty\"`\n\tGistsURL          *string `json:\"gists_url,omitempty\"`\n\tStarredURL        *string `json:\"starred_url,omitempty\"`\n\tSubscriptionsURL  *string `json:\"subscriptions_url,omitempty\"`\n\tOrganizationsURL  *string `json:\"organizations_url,omitempty\"`\n\tReposURL          *string `json:\"repos_url,omitempty\"`\n\tEventsURL         *string `json:\"events_url,omitempty\"`\n\tReceivedEventsURL *string `json:\"received_events_url,omitempty\"`\n\tType              *string `json:\"type,omitempty\"`\n\tSiteAdmin         *bool   `json:\"site_admin,omitempty\"`\n\tContributions     *int    `json:\"contributions,omitempty\"`\n\tName              *string `json:\"name,omitempty\"`\n\tEmail             *string `json:\"email,omitempty\"`\n}\n\n// ListContributorsOptions specifies the optional parameters to the\n// RepositoriesService.ListContributors method.\ntype ListContributorsOptions struct {\n\t// Include anonymous contributors in results or not\n\tAnon string `url:\"anon,omitempty\"`\n\n\tListOptions\n}\n\n// GetVulnerabilityAlerts checks if vulnerability alerts are enabled for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#check-if-vulnerability-alerts-are-enabled-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/vulnerability-alerts\nfunc (s *RepositoriesService) GetVulnerabilityAlerts(ctx context.Context, owner, repository string) (bool, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/vulnerability-alerts\", owner, repository)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn false, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeRequiredVulnerabilityAlertsPreview)\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tvulnerabilityAlertsEnabled, err := parseBoolResponse(err)\n\treturn vulnerabilityAlertsEnabled, resp, err\n}\n\n// EnableVulnerabilityAlerts enables vulnerability alerts and the dependency graph for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#enable-vulnerability-alerts\n//\n//meta:operation PUT /repos/{owner}/{repo}/vulnerability-alerts\nfunc (s *RepositoriesService) EnableVulnerabilityAlerts(ctx context.Context, owner, repository string) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/vulnerability-alerts\", owner, repository)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeRequiredVulnerabilityAlertsPreview)\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// DisableVulnerabilityAlerts disables vulnerability alerts and the dependency graph for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#disable-vulnerability-alerts\n//\n//meta:operation DELETE /repos/{owner}/{repo}/vulnerability-alerts\nfunc (s *RepositoriesService) DisableVulnerabilityAlerts(ctx context.Context, owner, repository string) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/vulnerability-alerts\", owner, repository)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeRequiredVulnerabilityAlertsPreview)\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// GetAutomatedSecurityFixes checks if the automated security fixes for a repository are enabled.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#check-if-dependabot-security-updates-are-enabled-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/automated-security-fixes\nfunc (s *RepositoriesService) GetAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*AutomatedSecurityFixes, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/automated-security-fixes\", owner, repository)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar p *AutomatedSecurityFixes\n\tresp, err := s.client.Do(ctx, req, &p)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn p, resp, nil\n}\n\n// EnableAutomatedSecurityFixes enables the automated security fixes for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#enable-dependabot-security-updates\n//\n//meta:operation PUT /repos/{owner}/{repo}/automated-security-fixes\nfunc (s *RepositoriesService) EnableAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/automated-security-fixes\", owner, repository)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// DisableAutomatedSecurityFixes disables vulnerability alerts and the dependency graph for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#disable-dependabot-security-updates\n//\n//meta:operation DELETE /repos/{owner}/{repo}/automated-security-fixes\nfunc (s *RepositoriesService) DisableAutomatedSecurityFixes(ctx context.Context, owner, repository string) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/automated-security-fixes\", owner, repository)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// ListContributors lists contributors for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-contributors\n//\n//meta:operation GET /repos/{owner}/{repo}/contributors\nfunc (s *RepositoriesService) ListContributors(ctx context.Context, owner, repository string, opts *ListContributorsOptions) ([]*Contributor, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/contributors\", owner, repository)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar contributor []*Contributor\n\tresp, err := s.client.Do(ctx, req, &contributor)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn contributor, resp, nil\n}\n\n// ListLanguages lists languages for the specified repository. The returned map\n// specifies the languages and the number of bytes of code written in that\n// language. For example:\n//\n//\t{\n//\t  \"C\": 78769,\n//\t  \"Python\": 7769\n//\t}\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-languages\n//\n//meta:operation GET /repos/{owner}/{repo}/languages\nfunc (s *RepositoriesService) ListLanguages(ctx context.Context, owner, repo string) (map[string]int, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/languages\", owner, repo)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tlanguages := make(map[string]int)\n\tresp, err := s.client.Do(ctx, req, &languages)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn languages, resp, nil\n}\n\n// ListTeams lists the teams for the specified repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-teams\n//\n//meta:operation GET /repos/{owner}/{repo}/teams\nfunc (s *RepositoriesService) ListTeams(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Team, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/teams\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar teams []*Team\n\tresp, err := s.client.Do(ctx, req, &teams)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn teams, resp, nil\n}\n\n// RepositoryTag represents a repository tag.\ntype RepositoryTag struct {\n\tName       *string `json:\"name,omitempty\"`\n\tCommit     *Commit `json:\"commit,omitempty\"`\n\tZipballURL *string `json:\"zipball_url,omitempty\"`\n\tTarballURL *string `json:\"tarball_url,omitempty\"`\n}\n\n// ListTags lists tags for the specified repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-tags\n//\n//meta:operation GET /repos/{owner}/{repo}/tags\nfunc (s *RepositoriesService) ListTags(ctx context.Context, owner, repo string, opts *ListOptions) ([]*RepositoryTag, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/tags\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar tags []*RepositoryTag\n\tresp, err := s.client.Do(ctx, req, &tags)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn tags, resp, nil\n}\n\n// Branch represents a repository branch.\ntype Branch struct {\n\tName      *string           `json:\"name,omitempty\"`\n\tCommit    *RepositoryCommit `json:\"commit,omitempty\"`\n\tProtected *bool             `json:\"protected,omitempty\"`\n\n\t// Protection will always be included in APIs which return the\n\t// 'Branch With Protection' schema such as 'Get a branch', but may\n\t// not be included in APIs that return the `Short Branch` schema\n\t// such as 'List branches'. In such cases, if branch protection is\n\t// enabled, Protected will be `true` but this will be nil, and\n\t// additional protection details can be obtained by calling GetBranch().\n\tProtection    *Protection `json:\"protection,omitempty\"`\n\tProtectionURL *string     `json:\"protection_url,omitempty\"`\n}\n\n// Protection represents a repository branch's protection.\ntype Protection struct {\n\tRequiredStatusChecks           *RequiredStatusChecks           `json:\"required_status_checks\"`\n\tRequiredPullRequestReviews     *PullRequestReviewsEnforcement  `json:\"required_pull_request_reviews\"`\n\tEnforceAdmins                  *AdminEnforcement               `json:\"enforce_admins\"`\n\tRestrictions                   *BranchRestrictions             `json:\"restrictions\"`\n\tRequireLinearHistory           *RequireLinearHistory           `json:\"required_linear_history\"`\n\tAllowForcePushes               *AllowForcePushes               `json:\"allow_force_pushes\"`\n\tAllowDeletions                 *AllowDeletions                 `json:\"allow_deletions\"`\n\tRequiredConversationResolution *RequiredConversationResolution `json:\"required_conversation_resolution\"`\n\tBlockCreations                 *BlockCreations                 `json:\"block_creations,omitempty\"`\n\tLockBranch                     *LockBranch                     `json:\"lock_branch,omitempty\"`\n\tAllowForkSyncing               *AllowForkSyncing               `json:\"allow_fork_syncing,omitempty\"`\n\tRequiredSignatures             *SignaturesProtectedBranch      `json:\"required_signatures,omitempty\"`\n\tURL                            *string                         `json:\"url,omitempty\"`\n}\n\n// BlockCreations represents whether users can push changes that create branches. If this is true, this\n// setting blocks pushes that create new branches, unless the push is initiated by a user, team, or app\n// which has the ability to push.\ntype BlockCreations struct {\n\tEnabled *bool `json:\"enabled,omitempty\"`\n}\n\n// LockBranch represents if the branch is marked as read-only. If this is true, users will not be able to push to the branch.\ntype LockBranch struct {\n\tEnabled *bool `json:\"enabled,omitempty\"`\n}\n\n// AllowForkSyncing represents whether users can pull changes from upstream when the branch is locked.\ntype AllowForkSyncing struct {\n\tEnabled *bool `json:\"enabled,omitempty\"`\n}\n\n// BranchProtectionRule represents the rule applied to a repositories branch.\ntype BranchProtectionRule struct {\n\tID                                       *int64     `json:\"id,omitempty\"`\n\tRepositoryID                             *int64     `json:\"repository_id,omitempty\"`\n\tName                                     *string    `json:\"name,omitempty\"`\n\tCreatedAt                                *Timestamp `json:\"created_at,omitempty\"`\n\tUpdatedAt                                *Timestamp `json:\"updated_at,omitempty\"`\n\tPullRequestReviewsEnforcementLevel       *string    `json:\"pull_request_reviews_enforcement_level,omitempty\"`\n\tRequiredApprovingReviewCount             *int       `json:\"required_approving_review_count,omitempty\"`\n\tDismissStaleReviewsOnPush                *bool      `json:\"dismiss_stale_reviews_on_push,omitempty\"`\n\tAuthorizedDismissalActorsOnly            *bool      `json:\"authorized_dismissal_actors_only,omitempty\"`\n\tIgnoreApprovalsFromContributors          *bool      `json:\"ignore_approvals_from_contributors,omitempty\"`\n\tRequireCodeOwnerReview                   *bool      `json:\"require_code_owner_review,omitempty\"`\n\tRequiredStatusChecks                     []string   `json:\"required_status_checks,omitempty\"`\n\tRequiredStatusChecksEnforcementLevel     *string    `json:\"required_status_checks_enforcement_level,omitempty\"`\n\tStrictRequiredStatusChecksPolicy         *bool      `json:\"strict_required_status_checks_policy,omitempty\"`\n\tSignatureRequirementEnforcementLevel     *string    `json:\"signature_requirement_enforcement_level,omitempty\"`\n\tLinearHistoryRequirementEnforcementLevel *string    `json:\"linear_history_requirement_enforcement_level,omitempty\"`\n\tAdminEnforced                            *bool      `json:\"admin_enforced,omitempty\"`\n\tAllowForcePushesEnforcementLevel         *string    `json:\"allow_force_pushes_enforcement_level,omitempty\"`\n\tAllowDeletionsEnforcementLevel           *string    `json:\"allow_deletions_enforcement_level,omitempty\"`\n\tMergeQueueEnforcementLevel               *string    `json:\"merge_queue_enforcement_level,omitempty\"`\n\tRequiredDeploymentsEnforcementLevel      *string    `json:\"required_deployments_enforcement_level,omitempty\"`\n\tRequiredConversationResolutionLevel      *string    `json:\"required_conversation_resolution_level,omitempty\"`\n\tAuthorizedActorsOnly                     *bool      `json:\"authorized_actors_only,omitempty\"`\n\tAuthorizedActorNames                     []string   `json:\"authorized_actor_names,omitempty\"`\n\tRequireLastPushApproval                  *bool      `json:\"require_last_push_approval,omitempty\"`\n}\n\n// ProtectionChanges represents the changes to the rule if the BranchProtection was edited.\ntype ProtectionChanges struct {\n\tAdminEnforced                            *AdminEnforcedChanges                            `json:\"admin_enforced,omitempty\"`\n\tAllowDeletionsEnforcementLevel           *AllowDeletionsEnforcementLevelChanges           `json:\"allow_deletions_enforcement_level,omitempty\"`\n\tAuthorizedActorNames                     *AuthorizedActorNames                            `json:\"authorized_actor_names,omitempty\"`\n\tAuthorizedActorsOnly                     *AuthorizedActorsOnly                            `json:\"authorized_actors_only,omitempty\"`\n\tAuthorizedDismissalActorsOnly            *AuthorizedDismissalActorsOnlyChanges            `json:\"authorized_dismissal_actors_only,omitempty\"`\n\tCreateProtected                          *CreateProtectedChanges                          `json:\"create_protected,omitempty\"`\n\tDismissStaleReviewsOnPush                *DismissStaleReviewsOnPushChanges                `json:\"dismiss_stale_reviews_on_push,omitempty\"`\n\tLinearHistoryRequirementEnforcementLevel *LinearHistoryRequirementEnforcementLevelChanges `json:\"linear_history_requirement_enforcement_level,omitempty\"`\n\tPullRequestReviewsEnforcementLevel       *PullRequestReviewsEnforcementLevelChanges       `json:\"pull_request_reviews_enforcement_level,omitempty\"`\n\tRequireCodeOwnerReview                   *RequireCodeOwnerReviewChanges                   `json:\"require_code_owner_review,omitempty\"`\n\tRequiredConversationResolutionLevel      *RequiredConversationResolutionLevelChanges      `json:\"required_conversation_resolution_level,omitempty\"`\n\tRequiredDeploymentsEnforcementLevel      *RequiredDeploymentsEnforcementLevelChanges      `json:\"required_deployments_enforcement_level,omitempty\"`\n\tRequiredStatusChecks                     *RequiredStatusChecksChanges                     `json:\"required_status_checks,omitempty\"`\n\tRequiredStatusChecksEnforcementLevel     *RequiredStatusChecksEnforcementLevelChanges     `json:\"required_status_checks_enforcement_level,omitempty\"`\n\tSignatureRequirementEnforcementLevel     *SignatureRequirementEnforcementLevelChanges     `json:\"signature_requirement_enforcement_level,omitempty\"`\n\tRequireLastPushApproval                  *RequireLastPushApprovalChanges                  `json:\"require_last_push_approval,omitempty\"`\n}\n\n// AdminEnforcedChanges represents the changes made to the AdminEnforced policy.\ntype AdminEnforcedChanges struct {\n\tFrom *bool `json:\"from,omitempty\"`\n}\n\n// AllowDeletionsEnforcementLevelChanges represents the changes made to the AllowDeletionsEnforcementLevel policy.\ntype AllowDeletionsEnforcementLevelChanges struct {\n\tFrom *string `json:\"from,omitempty\"`\n}\n\n// AuthorizedActorNames represents who are authorized to edit the branch protection rules.\ntype AuthorizedActorNames struct {\n\tFrom []string `json:\"from,omitempty\"`\n}\n\n// AuthorizedActorsOnly represents if the branch rule can be edited by authorized actors only.\ntype AuthorizedActorsOnly struct {\n\tFrom *bool `json:\"from,omitempty\"`\n}\n\n// AuthorizedDismissalActorsOnlyChanges represents the changes made to the AuthorizedDismissalActorsOnly policy.\ntype AuthorizedDismissalActorsOnlyChanges struct {\n\tFrom *bool `json:\"from,omitempty\"`\n}\n\n// CreateProtectedChanges represents the changes made to the CreateProtected policy.\ntype CreateProtectedChanges struct {\n\tFrom *bool `json:\"from,omitempty\"`\n}\n\n// DismissStaleReviewsOnPushChanges represents the changes made to the DismissStaleReviewsOnPushChanges policy.\ntype DismissStaleReviewsOnPushChanges struct {\n\tFrom *bool `json:\"from,omitempty\"`\n}\n\n// LinearHistoryRequirementEnforcementLevelChanges represents the changes made to the LinearHistoryRequirementEnforcementLevel policy.\ntype LinearHistoryRequirementEnforcementLevelChanges struct {\n\tFrom *string `json:\"from,omitempty\"`\n}\n\n// PullRequestReviewsEnforcementLevelChanges represents the changes made to the PullRequestReviewsEnforcementLevel policy.\ntype PullRequestReviewsEnforcementLevelChanges struct {\n\tFrom *string `json:\"from,omitempty\"`\n}\n\n// RequireCodeOwnerReviewChanges represents the changes made to the RequireCodeOwnerReview policy.\ntype RequireCodeOwnerReviewChanges struct {\n\tFrom *bool `json:\"from,omitempty\"`\n}\n\n// RequiredConversationResolutionLevelChanges represents the changes made to the RequiredConversationResolutionLevel policy.\ntype RequiredConversationResolutionLevelChanges struct {\n\tFrom *string `json:\"from,omitempty\"`\n}\n\n// RequiredDeploymentsEnforcementLevelChanges represents the changes made to the RequiredDeploymentsEnforcementLevel policy.\ntype RequiredDeploymentsEnforcementLevelChanges struct {\n\tFrom *string `json:\"from,omitempty\"`\n}\n\n// RequiredStatusChecksChanges represents the changes made to the RequiredStatusChecks policy.\ntype RequiredStatusChecksChanges struct {\n\tFrom []string `json:\"from,omitempty\"`\n}\n\n// RequiredStatusChecksEnforcementLevelChanges represents the changes made to the RequiredStatusChecksEnforcementLevel policy.\ntype RequiredStatusChecksEnforcementLevelChanges struct {\n\tFrom *string `json:\"from,omitempty\"`\n}\n\n// SignatureRequirementEnforcementLevelChanges represents the changes made to the SignatureRequirementEnforcementLevel policy.\ntype SignatureRequirementEnforcementLevelChanges struct {\n\tFrom *string `json:\"from,omitempty\"`\n}\n\n// RequireLastPushApprovalChanges represents the changes made to the RequireLastPushApproval policy.\ntype RequireLastPushApprovalChanges struct {\n\tFrom *bool `json:\"from,omitempty\"`\n}\n\n// ProtectionRequest represents a request to create/edit a branch's protection.\ntype ProtectionRequest struct {\n\tRequiredStatusChecks       *RequiredStatusChecks                 `json:\"required_status_checks\"`\n\tRequiredPullRequestReviews *PullRequestReviewsEnforcementRequest `json:\"required_pull_request_reviews\"`\n\tEnforceAdmins              bool                                  `json:\"enforce_admins\"`\n\tRestrictions               *BranchRestrictionsRequest            `json:\"restrictions\"`\n\t// Enforces a linear commit Git history, which prevents anyone from pushing merge commits to a branch.\n\tRequireLinearHistory *bool `json:\"required_linear_history,omitempty\"`\n\t// Permits force pushes to the protected branch by anyone with write access to the repository.\n\tAllowForcePushes *bool `json:\"allow_force_pushes,omitempty\"`\n\t// Allows deletion of the protected branch by anyone with write access to the repository.\n\tAllowDeletions *bool `json:\"allow_deletions,omitempty\"`\n\t// RequiredConversationResolution, if set to true, requires all comments\n\t// on the pull request to be resolved before it can be merged to a protected branch.\n\tRequiredConversationResolution *bool `json:\"required_conversation_resolution,omitempty\"`\n\t// BlockCreations, if set to true, will cause the restrictions setting to also block pushes\n\t// which create new branches, unless initiated by a user, team, app with the ability to push.\n\tBlockCreations *bool `json:\"block_creations,omitempty\"`\n\t// LockBranch, if set to true, will prevent users from pushing to the branch.\n\tLockBranch *bool `json:\"lock_branch,omitempty\"`\n\t// AllowForkSyncing, if set to true, will allow users to pull changes from upstream\n\t// when the branch is locked.\n\tAllowForkSyncing *bool `json:\"allow_fork_syncing,omitempty\"`\n}\n\n// RequiredStatusChecks represents the protection status of an individual branch.\ntype RequiredStatusChecks struct {\n\t// Require branches to be up to date before merging. (Required.)\n\tStrict bool `json:\"strict\"`\n\t// The list of status checks to require in order to merge into this\n\t// branch. An empty slice is valid. (Deprecated. Note: only one of\n\t// Contexts/Checks can be populated, but at least one must be populated).\n\tContexts *[]string `json:\"contexts,omitempty\"`\n\t// The list of status checks to require in order to merge into this\n\t// branch. An empty slice is valid.\n\tChecks      *[]*RequiredStatusCheck `json:\"checks,omitempty\"`\n\tContextsURL *string                 `json:\"contexts_url,omitempty\"`\n\tURL         *string                 `json:\"url,omitempty\"`\n}\n\n// RequiredStatusChecksRequest represents a request to edit a protected branch's status checks.\ntype RequiredStatusChecksRequest struct {\n\tStrict *bool `json:\"strict,omitempty\"`\n\t// Deprecated. Note: if both Contexts and Checks are populated,\n\t// the GitHub API will only use Checks.\n\tContexts []string               `json:\"contexts,omitempty\"`\n\tChecks   []*RequiredStatusCheck `json:\"checks,omitempty\"`\n}\n\n// RequiredStatusCheck represents a status check of a protected branch.\ntype RequiredStatusCheck struct {\n\t// The name of the required check.\n\tContext string `json:\"context\"`\n\t// The ID of the GitHub App that must provide this check.\n\t// Omit this field to automatically select the GitHub App\n\t// that has recently provided this check,\n\t// or any app if it was not set by a GitHub App.\n\t// Pass -1 to explicitly allow any app to set the status.\n\tAppID *int64 `json:\"app_id,omitempty\"`\n}\n\n// PullRequestReviewsEnforcement represents the pull request reviews enforcement of a protected branch.\ntype PullRequestReviewsEnforcement struct {\n\t// Allow specific users, teams, or apps to bypass pull request requirements.\n\tBypassPullRequestAllowances *BypassPullRequestAllowances `json:\"bypass_pull_request_allowances,omitempty\"`\n\t// Specifies which users, teams and apps can dismiss pull request reviews.\n\tDismissalRestrictions *DismissalRestrictions `json:\"dismissal_restrictions,omitempty\"`\n\t// Specifies if approved reviews are dismissed automatically, when a new commit is pushed.\n\tDismissStaleReviews bool `json:\"dismiss_stale_reviews\"`\n\t// RequireCodeOwnerReviews specifies if an approved review is required in pull requests including files with a designated code owner.\n\tRequireCodeOwnerReviews bool `json:\"require_code_owner_reviews\"`\n\t// RequiredApprovingReviewCount specifies the number of approvals required before the pull request can be merged.\n\t// Valid values are 1-6.\n\tRequiredApprovingReviewCount int `json:\"required_approving_review_count\"`\n\t// RequireLastPushApproval specifies whether the last pusher to a pull request branch can approve it.\n\tRequireLastPushApproval bool `json:\"require_last_push_approval\"`\n}\n\n// PullRequestReviewsEnforcementRequest represents request to set the pull request review\n// enforcement of a protected branch. It is separate from PullRequestReviewsEnforcement above\n// because the request structure is different from the response structure.\ntype PullRequestReviewsEnforcementRequest struct {\n\t// Allow specific users, teams, or apps to bypass pull request requirements.\n\tBypassPullRequestAllowancesRequest *BypassPullRequestAllowancesRequest `json:\"bypass_pull_request_allowances,omitempty\"`\n\t// Specifies which users, teams and apps should be allowed to dismiss pull request reviews.\n\t// User, team and app dismissal restrictions are only available for\n\t// organization-owned repositories. Must be nil for personal repositories.\n\tDismissalRestrictionsRequest *DismissalRestrictionsRequest `json:\"dismissal_restrictions,omitempty\"`\n\t// Specifies if approved reviews can be dismissed automatically, when a new commit is pushed. (Required)\n\tDismissStaleReviews bool `json:\"dismiss_stale_reviews\"`\n\t// RequireCodeOwnerReviews specifies if an approved review is required in pull requests including files with a designated code owner.\n\tRequireCodeOwnerReviews bool `json:\"require_code_owner_reviews\"`\n\t// RequiredApprovingReviewCount specifies the number of approvals required before the pull request can be merged.\n\t// Valid values are 1-6.\n\tRequiredApprovingReviewCount int `json:\"required_approving_review_count\"`\n\t// RequireLastPushApproval specifies whether the last pusher to a pull request branch can approve it.\n\tRequireLastPushApproval *bool `json:\"require_last_push_approval,omitempty\"`\n}\n\n// PullRequestReviewsEnforcementUpdate represents request to patch the pull request review\n// enforcement of a protected branch. It is separate from PullRequestReviewsEnforcementRequest above\n// because the patch request does not require all fields to be initialized.\ntype PullRequestReviewsEnforcementUpdate struct {\n\t// Allow specific users, teams, or apps to bypass pull request requirements.\n\tBypassPullRequestAllowancesRequest *BypassPullRequestAllowancesRequest `json:\"bypass_pull_request_allowances,omitempty\"`\n\t// Specifies which users, teams and apps can dismiss pull request reviews. Can be omitted.\n\tDismissalRestrictionsRequest *DismissalRestrictionsRequest `json:\"dismissal_restrictions,omitempty\"`\n\t// Specifies if approved reviews can be dismissed automatically, when a new commit is pushed. Can be omitted.\n\tDismissStaleReviews *bool `json:\"dismiss_stale_reviews,omitempty\"`\n\t// RequireCodeOwnerReviews specifies if merging pull requests is blocked until code owners have reviewed.\n\tRequireCodeOwnerReviews *bool `json:\"require_code_owner_reviews,omitempty\"`\n\t// RequiredApprovingReviewCount specifies the number of approvals required before the pull request can be merged.\n\t// Valid values are 1 - 6 or 0 to not require reviewers.\n\tRequiredApprovingReviewCount int `json:\"required_approving_review_count\"`\n\t// RequireLastPushApproval specifies whether the last pusher to a pull request branch can approve it.\n\tRequireLastPushApproval *bool `json:\"require_last_push_approval,omitempty\"`\n}\n\n// RequireLinearHistory represents the configuration to enforce branches with no merge commit.\ntype RequireLinearHistory struct {\n\tEnabled bool `json:\"enabled\"`\n}\n\n// AllowDeletions represents the configuration to accept deletion of protected branches.\ntype AllowDeletions struct {\n\tEnabled bool `json:\"enabled\"`\n}\n\n// AllowForcePushes represents the configuration to accept forced pushes on protected branches.\ntype AllowForcePushes struct {\n\tEnabled bool `json:\"enabled\"`\n}\n\n// RequiredConversationResolution requires all comments on the pull request to be resolved before it can be\n// merged to a protected branch when enabled.\ntype RequiredConversationResolution struct {\n\tEnabled bool `json:\"enabled\"`\n}\n\n// AdminEnforcement represents the configuration to enforce required status checks for repository administrators.\ntype AdminEnforcement struct {\n\tURL     *string `json:\"url,omitempty\"`\n\tEnabled bool    `json:\"enabled\"`\n}\n\n// BranchRestrictions represents the restriction that only certain users or\n// teams may push to a branch.\ntype BranchRestrictions struct {\n\t// The list of user logins with push access.\n\tUsers []*User `json:\"users\"`\n\t// The list of team slugs with push access.\n\tTeams []*Team `json:\"teams\"`\n\t// The list of app slugs with push access.\n\tApps []*App `json:\"apps\"`\n}\n\n// BranchRestrictionsRequest represents the request to create/edit the\n// restriction that only certain users or teams may push to a branch. It is\n// separate from BranchRestrictions above because the request structure is\n// different from the response structure.\ntype BranchRestrictionsRequest struct {\n\t// The list of user logins with push access. (Required; use []string{} instead of nil for empty list.)\n\tUsers []string `json:\"users\"`\n\t// The list of team slugs with push access. (Required; use []string{} instead of nil for empty list.)\n\tTeams []string `json:\"teams\"`\n\t// The list of app slugs with push access.\n\tApps []string `json:\"apps\"`\n}\n\n// BypassPullRequestAllowances represents the people, teams, or apps who are allowed to bypass required pull requests.\ntype BypassPullRequestAllowances struct {\n\t// The list of users allowed to bypass pull request requirements.\n\tUsers []*User `json:\"users\"`\n\t// The list of teams allowed to bypass pull request requirements.\n\tTeams []*Team `json:\"teams\"`\n\t// The list of apps allowed to bypass pull request requirements.\n\tApps []*App `json:\"apps\"`\n}\n\n// BypassPullRequestAllowancesRequest represents the people, teams, or apps who are\n// allowed to bypass required pull requests.\n// It is separate from BypassPullRequestAllowances above because the request structure is\n// different from the response structure.\ntype BypassPullRequestAllowancesRequest struct {\n\t// The list of user logins allowed to bypass pull request requirements.\n\tUsers []string `json:\"users\"`\n\t// The list of team slugs allowed to bypass pull request requirements.\n\tTeams []string `json:\"teams\"`\n\t// The list of app slugs allowed to bypass pull request requirements.\n\tApps []string `json:\"apps\"`\n}\n\n// DismissalRestrictions specifies which users and teams can dismiss pull request reviews.\ntype DismissalRestrictions struct {\n\t// The list of users who can dismiss pull request reviews.\n\tUsers []*User `json:\"users\"`\n\t// The list of teams which can dismiss pull request reviews.\n\tTeams []*Team `json:\"teams\"`\n\t// The list of apps which can dismiss pull request reviews.\n\tApps []*App `json:\"apps\"`\n}\n\n// DismissalRestrictionsRequest represents the request to create/edit the\n// restriction to allows only specific users, teams or apps to dismiss pull request reviews. It is\n// separate from DismissalRestrictions above because the request structure is\n// different from the response structure.\n// Note: Both Users and Teams must be nil, or both must be non-nil.\ntype DismissalRestrictionsRequest struct {\n\t// The list of user logins who can dismiss pull request reviews. (Required; use nil to disable dismissal_restrictions or &[]string{} otherwise.)\n\tUsers *[]string `json:\"users,omitempty\"`\n\t// The list of team slugs which can dismiss pull request reviews. (Required; use nil to disable dismissal_restrictions or &[]string{} otherwise.)\n\tTeams *[]string `json:\"teams,omitempty\"`\n\t// The list of app slugs which can dismiss pull request reviews. (Required; use nil to disable dismissal_restrictions or &[]string{} otherwise.)\n\tApps *[]string `json:\"apps,omitempty\"`\n}\n\n// SignaturesProtectedBranch represents the protection status of an individual branch.\ntype SignaturesProtectedBranch struct {\n\tURL *string `json:\"url,omitempty\"`\n\t// Commits pushed to matching branches must have verified signatures.\n\tEnabled *bool `json:\"enabled,omitempty\"`\n}\n\n// AutomatedSecurityFixes represents their status.\ntype AutomatedSecurityFixes struct {\n\tEnabled *bool `json:\"enabled\"`\n\tPaused  *bool `json:\"paused\"`\n}\n\n// ListBranches lists branches for the specified repository.\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branches#list-branches\n//\n//meta:operation GET /repos/{owner}/{repo}/branches\nfunc (s *RepositoriesService) ListBranches(ctx context.Context, owner, repo string, opts *BranchListOptions) ([]*Branch, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar branches []*Branch\n\tresp, err := s.client.Do(ctx, req, &branches)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn branches, resp, nil\n}\n\n// GetBranch gets the specified branch for a repository.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branches#get-a-branch\n//\n//meta:operation GET /repos/{owner}/{repo}/branches/{branch}\nfunc (s *RepositoriesService) GetBranch(ctx context.Context, owner, repo, branch string, maxRedirects int) (*Branch, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v\", owner, repo, url.PathEscape(branch))\n\n\tresp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, maxRedirects)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn nil, newResponse(resp), fmt.Errorf(\"unexpected status code: %v\", resp.Status)\n\t}\n\n\tvar b *Branch\n\terr = json.NewDecoder(resp.Body).Decode(&b)\n\treturn b, newResponse(resp), err\n}\n\n// renameBranchRequest represents a request to rename a branch.\ntype renameBranchRequest struct {\n\tNewName string `json:\"new_name\"`\n}\n\n// RenameBranch renames a branch in a repository.\n//\n// To rename a non-default branch: Users must have push access. GitHub Apps must have the `contents:write` repository permission.\n// To rename the default branch: Users must have admin or owner permissions. GitHub Apps must have the `administration:write` repository permission.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branches#rename-a-branch\n//\n//meta:operation POST /repos/{owner}/{repo}/branches/{branch}/rename\nfunc (s *RepositoriesService) RenameBranch(ctx context.Context, owner, repo, branch, newName string) (*Branch, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/rename\", owner, repo, url.PathEscape(branch))\n\tr := &renameBranchRequest{NewName: newName}\n\treq, err := s.client.NewRequest(\"POST\", u, r)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar b *Branch\n\tresp, err := s.client.Do(ctx, req, &b)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn b, resp, nil\n}\n\n// GetBranchProtection gets the protection of a given branch.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-branch-protection\n//\n//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection\nfunc (s *RepositoriesService) GetBranchProtection(ctx context.Context, owner, repo, branch string) (*Protection, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/protection\", owner, repo, url.PathEscape(branch))\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeRequiredApprovingReviewsPreview)\n\n\tvar p *Protection\n\tresp, err := s.client.Do(ctx, req, &p)\n\tif err != nil {\n\t\tif isBranchNotProtected(err) {\n\t\t\terr = ErrBranchNotProtected\n\t\t}\n\t\treturn nil, resp, err\n\t}\n\n\treturn p, resp, nil\n}\n\n// GetRequiredStatusChecks gets the required status checks for a given protected branch.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-status-checks-protection\n//\n//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\nfunc (s *RepositoriesService) GetRequiredStatusChecks(ctx context.Context, owner, repo, branch string) (*RequiredStatusChecks, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/protection/required_status_checks\", owner, repo, url.PathEscape(branch))\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar p *RequiredStatusChecks\n\tresp, err := s.client.Do(ctx, req, &p)\n\tif err != nil {\n\t\tif isBranchNotProtected(err) {\n\t\t\terr = ErrBranchNotProtected\n\t\t}\n\t\treturn nil, resp, err\n\t}\n\n\treturn p, resp, nil\n}\n\n// ListRequiredStatusChecksContexts lists the required status checks contexts for a given protected branch.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-all-status-check-contexts\n//\n//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\nfunc (s *RepositoriesService) ListRequiredStatusChecksContexts(ctx context.Context, owner, repo, branch string) (contexts []string, resp *Response, err error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/protection/required_status_checks/contexts\", owner, repo, url.PathEscape(branch))\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tresp, err = s.client.Do(ctx, req, &contexts)\n\tif err != nil {\n\t\tif isBranchNotProtected(err) {\n\t\t\terr = ErrBranchNotProtected\n\t\t}\n\t\treturn nil, resp, err\n\t}\n\n\treturn contexts, resp, nil\n}\n\n// UpdateBranchProtection updates the protection of a given branch.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#update-branch-protection\n//\n//meta:operation PUT /repos/{owner}/{repo}/branches/{branch}/protection\nfunc (s *RepositoriesService) UpdateBranchProtection(ctx context.Context, owner, repo, branch string, preq *ProtectionRequest) (*Protection, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/protection\", owner, repo, url.PathEscape(branch))\n\treq, err := s.client.NewRequest(\"PUT\", u, preq)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeRequiredApprovingReviewsPreview)\n\n\tvar p *Protection\n\tresp, err := s.client.Do(ctx, req, &p)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn p, resp, nil\n}\n\n// RemoveBranchProtection removes the protection of a given branch.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#delete-branch-protection\n//\n//meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection\nfunc (s *RepositoriesService) RemoveBranchProtection(ctx context.Context, owner, repo, branch string) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/protection\", owner, repo, url.PathEscape(branch))\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// GetSignaturesProtectedBranch gets required signatures of protected branch.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-commit-signature-protection\n//\n//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\nfunc (s *RepositoriesService) GetSignaturesProtectedBranch(ctx context.Context, owner, repo, branch string) (*SignaturesProtectedBranch, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/protection/required_signatures\", owner, repo, url.PathEscape(branch))\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeSignaturePreview)\n\n\tvar p *SignaturesProtectedBranch\n\tresp, err := s.client.Do(ctx, req, &p)\n\tif err != nil {\n\t\tif isBranchNotProtected(err) {\n\t\t\terr = ErrBranchNotProtected\n\t\t}\n\t\treturn nil, resp, err\n\t}\n\n\treturn p, resp, nil\n}\n\n// RequireSignaturesOnProtectedBranch makes signed commits required on a protected branch.\n// It requires admin access and branch protection to be enabled.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#create-commit-signature-protection\n//\n//meta:operation POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\nfunc (s *RepositoriesService) RequireSignaturesOnProtectedBranch(ctx context.Context, owner, repo, branch string) (*SignaturesProtectedBranch, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/protection/required_signatures\", owner, repo, url.PathEscape(branch))\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeSignaturePreview)\n\n\tvar r *SignaturesProtectedBranch\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}\n\n// OptionalSignaturesOnProtectedBranch removes required signed commits on a given branch.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#delete-commit-signature-protection\n//\n//meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\nfunc (s *RepositoriesService) OptionalSignaturesOnProtectedBranch(ctx context.Context, owner, repo, branch string) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/protection/required_signatures\", owner, repo, url.PathEscape(branch))\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeSignaturePreview)\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// UpdateRequiredStatusChecks updates the required status checks for a given protected branch.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#update-status-check-protection\n//\n//meta:operation PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\nfunc (s *RepositoriesService) UpdateRequiredStatusChecks(ctx context.Context, owner, repo, branch string, sreq *RequiredStatusChecksRequest) (*RequiredStatusChecks, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/protection/required_status_checks\", owner, repo, url.PathEscape(branch))\n\treq, err := s.client.NewRequest(\"PATCH\", u, sreq)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar sc *RequiredStatusChecks\n\tresp, err := s.client.Do(ctx, req, &sc)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn sc, resp, nil\n}\n\n// RemoveRequiredStatusChecks removes the required status checks for a given protected branch.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#remove-status-check-protection\n//\n//meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\nfunc (s *RepositoriesService) RemoveRequiredStatusChecks(ctx context.Context, owner, repo, branch string) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/protection/required_status_checks\", owner, repo, url.PathEscape(branch))\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// License gets the contents of a repository's license if one is detected.\n//\n// GitHub API docs: https://docs.github.com/rest/licenses/licenses#get-the-license-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/license\nfunc (s *RepositoriesService) License(ctx context.Context, owner, repo string) (*RepositoryLicense, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/license\", owner, repo)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar r *RepositoryLicense\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}\n\n// GetPullRequestReviewEnforcement gets pull request review enforcement of a protected branch.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-pull-request-review-protection\n//\n//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\nfunc (s *RepositoriesService) GetPullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string) (*PullRequestReviewsEnforcement, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/protection/required_pull_request_reviews\", owner, repo, url.PathEscape(branch))\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeRequiredApprovingReviewsPreview)\n\n\tvar r *PullRequestReviewsEnforcement\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}\n\n// UpdatePullRequestReviewEnforcement patches pull request review enforcement of a protected branch.\n// It requires admin access and branch protection to be enabled.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#update-pull-request-review-protection\n//\n//meta:operation PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\nfunc (s *RepositoriesService) UpdatePullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string, patch *PullRequestReviewsEnforcementUpdate) (*PullRequestReviewsEnforcement, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/protection/required_pull_request_reviews\", owner, repo, url.PathEscape(branch))\n\treq, err := s.client.NewRequest(\"PATCH\", u, patch)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeRequiredApprovingReviewsPreview)\n\n\tvar r *PullRequestReviewsEnforcement\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}\n\n// DisableDismissalRestrictions disables dismissal restrictions of a protected branch.\n// It requires admin access and branch protection to be enabled.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#update-pull-request-review-protection\n//\n//meta:operation PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\nfunc (s *RepositoriesService) DisableDismissalRestrictions(ctx context.Context, owner, repo, branch string) (*PullRequestReviewsEnforcement, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/protection/required_pull_request_reviews\", owner, repo, url.PathEscape(branch))\n\n\tdata := new(struct {\n\t\tDismissalRestrictionsRequest `json:\"dismissal_restrictions\"`\n\t})\n\n\treq, err := s.client.NewRequest(\"PATCH\", u, data)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeRequiredApprovingReviewsPreview)\n\n\tvar r *PullRequestReviewsEnforcement\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}\n\n// RemovePullRequestReviewEnforcement removes pull request enforcement of a protected branch.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#delete-pull-request-review-protection\n//\n//meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\nfunc (s *RepositoriesService) RemovePullRequestReviewEnforcement(ctx context.Context, owner, repo, branch string) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/protection/required_pull_request_reviews\", owner, repo, url.PathEscape(branch))\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// GetAdminEnforcement gets admin enforcement information of a protected branch.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-admin-branch-protection\n//\n//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\nfunc (s *RepositoriesService) GetAdminEnforcement(ctx context.Context, owner, repo, branch string) (*AdminEnforcement, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/protection/enforce_admins\", owner, repo, url.PathEscape(branch))\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar r *AdminEnforcement\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}\n\n// AddAdminEnforcement adds admin enforcement to a protected branch.\n// It requires admin access and branch protection to be enabled.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#set-admin-branch-protection\n//\n//meta:operation POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\nfunc (s *RepositoriesService) AddAdminEnforcement(ctx context.Context, owner, repo, branch string) (*AdminEnforcement, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/protection/enforce_admins\", owner, repo, url.PathEscape(branch))\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar r *AdminEnforcement\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}\n\n// RemoveAdminEnforcement removes admin enforcement from a protected branch.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#delete-admin-branch-protection\n//\n//meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\nfunc (s *RepositoriesService) RemoveAdminEnforcement(ctx context.Context, owner, repo, branch string) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/protection/enforce_admins\", owner, repo, url.PathEscape(branch))\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// repositoryTopics represents a collection of repository topics.\ntype repositoryTopics struct {\n\tNames []string `json:\"names\"`\n}\n\n// ListAllTopics lists topics for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#get-all-repository-topics\n//\n//meta:operation GET /repos/{owner}/{repo}/topics\nfunc (s *RepositoriesService) ListAllTopics(ctx context.Context, owner, repo string, opts *ListOptions) ([]string, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/topics\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeTopicsPreview)\n\n\tvar topics *repositoryTopics\n\tresp, err := s.client.Do(ctx, req, &topics)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn topics.Names, resp, nil\n}\n\n// ReplaceAllTopics replaces all repository topics.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#replace-all-repository-topics\n//\n//meta:operation PUT /repos/{owner}/{repo}/topics\nfunc (s *RepositoriesService) ReplaceAllTopics(ctx context.Context, owner, repo string, topics []string) ([]string, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/topics\", owner, repo)\n\tt := &repositoryTopics{\n\t\tNames: topics,\n\t}\n\tif t.Names == nil {\n\t\tt.Names = []string{}\n\t}\n\treq, err := s.client.NewRequest(\"PUT\", u, t)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeTopicsPreview)\n\n\tt = new(repositoryTopics)\n\tresp, err := s.client.Do(ctx, req, t)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn t.Names, resp, nil\n}\n\n// ListApps lists the GitHub apps that have push access to a given protected branch.\n// It requires the GitHub apps to have `write` access to the `content` permission.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// Deprecated: Please use ListAppRestrictions instead.\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch\n//\n//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\nfunc (s *RepositoriesService) ListApps(ctx context.Context, owner, repo, branch string) ([]*App, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/protection/restrictions/apps\", owner, repo, url.PathEscape(branch))\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar apps []*App\n\tresp, err := s.client.Do(ctx, req, &apps)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn apps, resp, nil\n}\n\n// ListAppRestrictions lists the GitHub apps that have push access to a given protected branch.\n// It requires the GitHub apps to have `write` access to the `content` permission.\n//\n// Note: This is a wrapper around ListApps so a naming convention with ListUserRestrictions and ListTeamRestrictions is preserved.\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch\n//\n//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\nfunc (s *RepositoriesService) ListAppRestrictions(ctx context.Context, owner, repo, branch string) ([]*App, *Response, error) {\n\treturn s.ListApps(ctx, owner, repo, branch)\n}\n\n// ReplaceAppRestrictions replaces the apps that have push access to a given protected branch.\n// It removes all apps that previously had push access and grants push access to the new list of apps.\n// It requires the GitHub apps to have `write` access to the `content` permission.\n//\n// Note: The list of users, apps, and teams in total is limited to 100 items.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#set-app-access-restrictions\n//\n//meta:operation PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\nfunc (s *RepositoriesService) ReplaceAppRestrictions(ctx context.Context, owner, repo, branch string, apps []string) ([]*App, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/protection/restrictions/apps\", owner, repo, url.PathEscape(branch))\n\treq, err := s.client.NewRequest(\"PUT\", u, apps)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar newApps []*App\n\tresp, err := s.client.Do(ctx, req, &newApps)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn newApps, resp, nil\n}\n\n// AddAppRestrictions grants the specified apps push access to a given protected branch.\n// It requires the GitHub apps to have `write` access to the `content` permission.\n//\n// Note: The list of users, apps, and teams in total is limited to 100 items.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#add-app-access-restrictions\n//\n//meta:operation POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\nfunc (s *RepositoriesService) AddAppRestrictions(ctx context.Context, owner, repo, branch string, apps []string) ([]*App, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/protection/restrictions/apps\", owner, repo, url.PathEscape(branch))\n\treq, err := s.client.NewRequest(\"POST\", u, apps)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar newApps []*App\n\tresp, err := s.client.Do(ctx, req, &newApps)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn newApps, resp, nil\n}\n\n// RemoveAppRestrictions removes the restrictions of an app from pushing to this branch.\n// It requires the GitHub apps to have `write` access to the `content` permission.\n//\n// Note: The list of users, apps, and teams in total is limited to 100 items.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#remove-app-access-restrictions\n//\n//meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\nfunc (s *RepositoriesService) RemoveAppRestrictions(ctx context.Context, owner, repo, branch string, apps []string) ([]*App, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/protection/restrictions/apps\", owner, repo, url.PathEscape(branch))\n\treq, err := s.client.NewRequest(\"DELETE\", u, apps)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar newApps []*App\n\tresp, err := s.client.Do(ctx, req, &newApps)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn newApps, resp, nil\n}\n\n// ListTeamRestrictions lists the GitHub teams that have push access to a given protected branch.\n// It requires the GitHub teams to have `write` access to the `content` permission.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-teams-with-access-to-the-protected-branch\n//\n//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\nfunc (s *RepositoriesService) ListTeamRestrictions(ctx context.Context, owner, repo, branch string) ([]*Team, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/protection/restrictions/teams\", owner, repo, url.PathEscape(branch))\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar teams []*Team\n\tresp, err := s.client.Do(ctx, req, &teams)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn teams, resp, nil\n}\n\n// ReplaceTeamRestrictions replaces the team that have push access to a given protected branch.\n// This removes all teams that previously had push access and grants push access to the new list of teams.\n// It requires the GitHub teams to have `write` access to the `content` permission.\n//\n// Note: The list of users, apps, and teams in total is limited to 100 items.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#set-team-access-restrictions\n//\n//meta:operation PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\nfunc (s *RepositoriesService) ReplaceTeamRestrictions(ctx context.Context, owner, repo, branch string, teams []string) ([]*Team, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/protection/restrictions/teams\", owner, repo, url.PathEscape(branch))\n\treq, err := s.client.NewRequest(\"PUT\", u, teams)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar newTeams []*Team\n\tresp, err := s.client.Do(ctx, req, &newTeams)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn newTeams, resp, nil\n}\n\n// AddTeamRestrictions grants the specified teams push access to a given protected branch.\n// It requires the GitHub teams to have `write` access to the `content` permission.\n//\n// Note: The list of users, apps, and teams in total is limited to 100 items.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#add-team-access-restrictions\n//\n//meta:operation POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\nfunc (s *RepositoriesService) AddTeamRestrictions(ctx context.Context, owner, repo, branch string, teams []string) ([]*Team, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/protection/restrictions/teams\", owner, repo, url.PathEscape(branch))\n\treq, err := s.client.NewRequest(\"POST\", u, teams)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar newTeams []*Team\n\tresp, err := s.client.Do(ctx, req, &newTeams)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn newTeams, resp, nil\n}\n\n// RemoveTeamRestrictions removes the restrictions of a team from pushing to this branch.\n// It requires the GitHub teams to have `write` access to the `content` permission.\n//\n// Note: The list of users, apps, and teams in total is limited to 100 items.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#remove-team-access-restrictions\n//\n//meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\nfunc (s *RepositoriesService) RemoveTeamRestrictions(ctx context.Context, owner, repo, branch string, teams []string) ([]*Team, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/protection/restrictions/teams\", owner, repo, url.PathEscape(branch))\n\treq, err := s.client.NewRequest(\"DELETE\", u, teams)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar newTeams []*Team\n\tresp, err := s.client.Do(ctx, req, &newTeams)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn newTeams, resp, nil\n}\n\n// ListUserRestrictions lists the GitHub users that have push access to a given protected branch.\n// It requires the GitHub users to have `write` access to the `content` permission.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#get-users-with-access-to-the-protected-branch\n//\n//meta:operation GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\nfunc (s *RepositoriesService) ListUserRestrictions(ctx context.Context, owner, repo, branch string) ([]*User, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/protection/restrictions/users\", owner, repo, url.PathEscape(branch))\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar users []*User\n\tresp, err := s.client.Do(ctx, req, &users)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn users, resp, nil\n}\n\n// ReplaceUserRestrictions replaces the user that have push access to a given protected branch.\n// It removes all users that previously had push access and grants push access to the new list of users.\n// It requires the GitHub users to have `write` access to the `content` permission.\n//\n// Note: The list of users, apps, and teams in total is limited to 100 items.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#set-user-access-restrictions\n//\n//meta:operation PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\nfunc (s *RepositoriesService) ReplaceUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/protection/restrictions/users\", owner, repo, url.PathEscape(branch))\n\treq, err := s.client.NewRequest(\"PUT\", u, users)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar newUsers []*User\n\tresp, err := s.client.Do(ctx, req, &newUsers)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn newUsers, resp, nil\n}\n\n// AddUserRestrictions grants the specified users push access to a given protected branch.\n// It requires the GitHub users to have `write` access to the `content` permission.\n//\n// Note: The list of users, apps, and teams in total is limited to 100 items.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#add-user-access-restrictions\n//\n//meta:operation POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\nfunc (s *RepositoriesService) AddUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/protection/restrictions/users\", owner, repo, url.PathEscape(branch))\n\treq, err := s.client.NewRequest(\"POST\", u, users)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar newUsers []*User\n\tresp, err := s.client.Do(ctx, req, &newUsers)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn newUsers, resp, nil\n}\n\n// RemoveUserRestrictions removes the restrictions of a user from pushing to this branch.\n// It requires the GitHub users to have `write` access to the `content` permission.\n//\n// Note: The list of users, apps, and teams in total is limited to 100 items.\n//\n// Note: the branch name is URL path escaped for you. See: https://pkg.go.dev/net/url#PathEscape .\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branch-protection#remove-user-access-restrictions\n//\n//meta:operation DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\nfunc (s *RepositoriesService) RemoveUserRestrictions(ctx context.Context, owner, repo, branch string, users []string) ([]*User, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/branches/%v/protection/restrictions/users\", owner, repo, url.PathEscape(branch))\n\treq, err := s.client.NewRequest(\"DELETE\", u, users)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar newUsers []*User\n\tresp, err := s.client.Do(ctx, req, &newUsers)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn newUsers, resp, nil\n}\n\n// TransferRequest represents a request to transfer a repository.\ntype TransferRequest struct {\n\tNewOwner string  `json:\"new_owner\"`\n\tNewName  *string `json:\"new_name,omitempty\"`\n\tTeamID   []int64 `json:\"team_ids,omitempty\"`\n}\n\n// Transfer transfers a repository from one account or organization to another.\n//\n// This method might return an *AcceptedError and a status code of\n// 202. This is because this is the status that GitHub returns to signify that\n// it has now scheduled the transfer of the repository in a background task.\n// A follow up request, after a delay of a second or so, should result\n// in a successful request.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#transfer-a-repository\n//\n//meta:operation POST /repos/{owner}/{repo}/transfer\nfunc (s *RepositoriesService) Transfer(ctx context.Context, owner, repo string, transfer TransferRequest) (*Repository, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/transfer\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"POST\", u, &transfer)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar r *Repository\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}\n\n// DispatchRequestOptions represents a request to trigger a repository_dispatch event.\ntype DispatchRequestOptions struct {\n\t// EventType is a custom webhook event name. (Required.)\n\tEventType string `json:\"event_type\"`\n\t// ClientPayload is a custom JSON payload with extra information about the webhook event.\n\t// Defaults to an empty JSON object.\n\tClientPayload *json.RawMessage `json:\"client_payload,omitempty\"`\n}\n\n// Dispatch triggers a repository_dispatch event in a GitHub Actions workflow.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#create-a-repository-dispatch-event\n//\n//meta:operation POST /repos/{owner}/{repo}/dispatches\nfunc (s *RepositoriesService) Dispatch(ctx context.Context, owner, repo string, opts DispatchRequestOptions) (*Repository, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/dispatches\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"POST\", u, &opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar r *Repository\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}\n\n// isBranchNotProtected determines whether a branch is not protected\n// based on the error message returned by GitHub API.\nfunc isBranchNotProtected(err error) bool {\n\tvar errorResponse *ErrorResponse\n\treturn errors.As(err, &errorResponse) && errorResponse.Message == githubBranchNotProtected\n}\n\n// EnablePrivateReporting enables private reporting of vulnerabilities for a\n// repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#enable-private-vulnerability-reporting-for-a-repository\n//\n//meta:operation PUT /repos/{owner}/{repo}/private-vulnerability-reporting\nfunc (s *RepositoriesService) EnablePrivateReporting(ctx context.Context, owner, repo string) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/private-vulnerability-reporting\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// DisablePrivateReporting disables private reporting of vulnerabilities for a\n// repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#disable-private-vulnerability-reporting-for-a-repository\n//\n//meta:operation DELETE /repos/{owner}/{repo}/private-vulnerability-reporting\nfunc (s *RepositoriesService) DisablePrivateReporting(ctx context.Context, owner, repo string) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/private-vulnerability-reporting\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// checkPrivateReporting represents whether private vulnerability reporting is enabled.\ntype checkPrivateReporting struct {\n\tEnabled bool `json:\"enabled,omitempty\"`\n}\n\n// IsPrivateReportingEnabled checks if private vulnerability reporting is enabled\n// for the repository and returns a boolean indicating the status.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#check-if-private-vulnerability-reporting-is-enabled-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/private-vulnerability-reporting\nfunc (s *RepositoriesService) IsPrivateReportingEnabled(ctx context.Context, owner, repo string) (bool, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/private-vulnerability-reporting\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn false, nil, err\n\t}\n\n\tvar privateReporting checkPrivateReporting\n\tresp, err := s.client.Do(ctx, req, &privateReporting)\n\treturn privateReporting.Enabled, resp, err\n}\n\n// ListRepositoryActivityOptions specifies the optional parameters to the\n// RepositoriesService.ListRepositoryActivities method.\ntype ListRepositoryActivityOptions struct {\n\t// The direction to sort the results by.\n\t// Default: desc\n\t// Can be one of: asc, desc\n\tDirection string `url:\"direction,omitempty\"`\n\n\t// For paginated result sets, The number of results per page (max 100).\n\tPerPage int `url:\"per_page,omitempty\"`\n\n\t// A cursor, as given in the Link header. If specified, the query only searches for events before this cursor.\n\tBefore string `url:\"before,omitempty\"`\n\n\t// A cursor, as given in the Link header. If specified, the query only searches for events after this cursor.\n\tAfter string `url:\"after,omitempty\"`\n\n\t// The Git reference for the activities you want to list.\n\t// The ref for a branch can be formatted either as refs/heads/BRANCH_NAME or BRANCH_NAME, where BRANCH_NAME is the name of your branch.\n\tRef string `url:\"ref,omitempty\"`\n\n\t// The GitHub username to use to filter by the actor who performed the activity.\n\tActor string `url:\"actor,omitempty\"`\n\n\t// The time period to filter by.\n\t// For example, day will filter for activity that occurred in the past 24 hours, and week will filter for activity that occurred in the past 7 days (168 hours).\n\t// Can be one of: day, week, month, quarter, year\n\tTimePeriod string `url:\"time_period,omitempty\"`\n\n\t// The activity type to filter by.\n\t// For example, you can choose to filter by \"force_push\", to see all force pushes to the repository.\n\t// Can be one of: push, force_push, branch_creation, branch_deletion, pr_merge, merge_queue_merge\n\tActivityType string `url:\"activity_type,omitempty\"`\n}\n\n// RepositoryActor represents a repository actor.\ntype RepositoryActor struct {\n\tLogin             *string `json:\"login,omitempty\"`\n\tID                *int64  `json:\"id,omitempty\"`\n\tNodeID            *string `json:\"node_id,omitempty\"`\n\tAvatarURL         *string `json:\"avatar_url,omitempty\"`\n\tGravatarID        *string `json:\"gravatar_id,omitempty\"`\n\tURL               *string `json:\"url,omitempty\"`\n\tHTMLURL           *string `json:\"html_url,omitempty\"`\n\tFollowersURL      *string `json:\"followers_url,omitempty\"`\n\tFollowingURL      *string `json:\"following_url,omitempty\"`\n\tGistsURL          *string `json:\"gists_url,omitempty\"`\n\tStarredURL        *string `json:\"starred_url,omitempty\"`\n\tSubscriptionsURL  *string `json:\"subscriptions_url,omitempty\"`\n\tOrganizationsURL  *string `json:\"organizations_url,omitempty\"`\n\tReposURL          *string `json:\"repos_url,omitempty\"`\n\tEventsURL         *string `json:\"events_url,omitempty\"`\n\tReceivedEventsURL *string `json:\"received_events_url,omitempty\"`\n\tType              *string `json:\"type,omitempty\"`\n\tUserViewType      *string `json:\"user_view_type,omitempty\"`\n\tSiteAdmin         *bool   `json:\"site_admin,omitempty\"`\n}\n\n// RepositoryActivity represents a repository activity.\ntype RepositoryActivity struct {\n\tID           int64            `json:\"id\"`\n\tNodeID       string           `json:\"node_id\"`\n\tBefore       string           `json:\"before\"`\n\tAfter        string           `json:\"after\"`\n\tRef          string           `json:\"ref\"`\n\tTimestamp    *Timestamp       `json:\"timestamp\"`\n\tActivityType string           `json:\"activity_type\"`\n\tActor        *RepositoryActor `json:\"actor,omitempty\"`\n}\n\n// ListRepositoryActivities lists the activities for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#list-repository-activities\n//\n//meta:operation GET /repos/{owner}/{repo}/activity\nfunc (s *RepositoriesService) ListRepositoryActivities(ctx context.Context, owner, repo string, opts *ListRepositoryActivityOptions) ([]*RepositoryActivity, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/activity\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar activities []*RepositoryActivity\n\tresp, err := s.client.Do(ctx, req, &activities)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn activities, resp, nil\n}\n"
  },
  {
    "path": "github/repos_actions_access.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// RepositoryActionsAccessLevel represents the repository actions access level.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository\ntype RepositoryActionsAccessLevel struct {\n\t// AccessLevel specifies the level of access that workflows outside of the repository have\n\t// to actions and reusable workflows within the repository.\n\t// Possible values are: \"none\", \"organization\" \"enterprise\".\n\tAccessLevel *string `json:\"access_level,omitempty\"`\n}\n\n// GetActionsAccessLevel gets the level of access that workflows outside of the repository have\n// to actions and reusable workflows in the repository.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-the-level-of-access-for-workflows-outside-of-the-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/permissions/access\nfunc (s *RepositoriesService) GetActionsAccessLevel(ctx context.Context, owner, repo string) (*RepositoryActionsAccessLevel, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/permissions/access\", owner, repo)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar raal *RepositoryActionsAccessLevel\n\tresp, err := s.client.Do(ctx, req, &raal)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn raal, resp, nil\n}\n\n// EditActionsAccessLevel sets the level of access that workflows outside of the repository have\n// to actions and reusable workflows in the repository.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository\n//\n//meta:operation PUT /repos/{owner}/{repo}/actions/permissions/access\nfunc (s *RepositoriesService) EditActionsAccessLevel(ctx context.Context, owner, repo string, repositoryActionsAccessLevel RepositoryActionsAccessLevel) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/permissions/access\", owner, repo)\n\treq, err := s.client.NewRequest(\"PUT\", u, repositoryActionsAccessLevel)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/repos_actions_access_test.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_GetActionsAccessLevel(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/permissions/access\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"access_level\": \"none\"}`)\n\t})\n\n\tctx := t.Context()\n\torg, _, err := client.Repositories.GetActionsAccessLevel(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetActionsAccessLevel returned error: %v\", err)\n\t}\n\twant := &RepositoryActionsAccessLevel{AccessLevel: Ptr(\"none\")}\n\tif !cmp.Equal(org, want) {\n\t\tt.Errorf(\"Repositories.GetActionsAccessLevel returned %+v, want %+v\", org, want)\n\t}\n\n\tconst methodName = \"GetActionsAccessLevel\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetActionsAccessLevel(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetActionsAccessLevel(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_EditActionsAccessLevel(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &RepositoryActionsAccessLevel{AccessLevel: Ptr(\"organization\")}\n\n\tmux.HandleFunc(\"/repos/o/r/actions/permissions/access\", func(_ http.ResponseWriter, r *http.Request) {\n\t\tvar v *RepositoryActionsAccessLevel\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Repositories.EditActionsAccessLevel(ctx, \"o\", \"r\", *input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.EditActionsAccessLevel returned error: %v\", err)\n\t}\n\n\tconst methodName = \"EditActionsAccessLevel\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.EditActionsAccessLevel(ctx, \"\\n\", \"\\n\", *input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tresp, err := client.Repositories.EditActionsAccessLevel(ctx, \"o\", \"r\", *input)\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoryActionsAccessLevel_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ActionsPermissions{}, \"{}\")\n\n\tu := &RepositoryActionsAccessLevel{\n\t\tAccessLevel: Ptr(\"enterprise\"),\n\t}\n\n\twant := `{\n\t\t\"access_level\": \"enterprise\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/repos_actions_allowed.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// GetActionsAllowed gets the allowed actions and reusable workflows for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/permissions/selected-actions\nfunc (s *RepositoriesService) GetActionsAllowed(ctx context.Context, org, repo string) (*ActionsAllowed, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/permissions/selected-actions\", org, repo)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar actionsAllowed *ActionsAllowed\n\tresp, err := s.client.Do(ctx, req, &actionsAllowed)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn actionsAllowed, resp, nil\n}\n\n// EditActionsAllowed sets the allowed actions and reusable workflows for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-a-repository\n//\n//meta:operation PUT /repos/{owner}/{repo}/actions/permissions/selected-actions\nfunc (s *RepositoriesService) EditActionsAllowed(ctx context.Context, org, repo string, actionsAllowed ActionsAllowed) (*ActionsAllowed, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/permissions/selected-actions\", org, repo)\n\treq, err := s.client.NewRequest(\"PUT\", u, actionsAllowed)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar p *ActionsAllowed\n\tresp, err := s.client.Do(ctx, req, &p)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn p, resp, nil\n}\n"
  },
  {
    "path": "github/repos_actions_allowed_test.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoryService_GetActionsAllowed(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/permissions/selected-actions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"github_owned_allowed\":true, \"verified_allowed\":false, \"patterns_allowed\":[\"a/b\"]}`)\n\t})\n\n\tctx := t.Context()\n\torg, _, err := client.Repositories.GetActionsAllowed(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetActionsAllowed returned error: %v\", err)\n\t}\n\twant := &ActionsAllowed{GithubOwnedAllowed: Ptr(true), VerifiedAllowed: Ptr(false), PatternsAllowed: []string{\"a/b\"}}\n\tif !cmp.Equal(org, want) {\n\t\tt.Errorf(\"Repositories.GetActionsAllowed returned %+v, want %+v\", org, want)\n\t}\n\n\tconst methodName = \"GetActionsAllowed\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetActionsAllowed(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetActionsAllowed(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_UpdateActionsAllowed(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &ActionsAllowed{GithubOwnedAllowed: Ptr(true), VerifiedAllowed: Ptr(false), PatternsAllowed: []string{\"a/b\"}}\n\n\tmux.HandleFunc(\"/repos/o/r/actions/permissions/selected-actions\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *ActionsAllowed\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"github_owned_allowed\":true, \"verified_allowed\":false, \"patterns_allowed\":[\"a/b\"]}`)\n\t})\n\n\tctx := t.Context()\n\torg, _, err := client.Repositories.EditActionsAllowed(ctx, \"o\", \"r\", *input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.UpdateActionsAllowed returned error: %v\", err)\n\t}\n\n\twant := &ActionsAllowed{GithubOwnedAllowed: Ptr(true), VerifiedAllowed: Ptr(false), PatternsAllowed: []string{\"a/b\"}}\n\tif !cmp.Equal(org, want) {\n\t\tt.Errorf(\"Repositories.UpdateActionsAllowed returned %+v, want %+v\", org, want)\n\t}\n\n\tconst methodName = \"UpdateActionsAllowed\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.EditActionsAllowed(ctx, \"\\n\", \"\\n\", *input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.EditActionsAllowed(ctx, \"o\", \"r\", *input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/repos_actions_permissions.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// ActionsPermissionsRepository represents a policy for repositories and allowed actions in a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions\ntype ActionsPermissionsRepository struct {\n\tEnabled            *bool   `json:\"enabled,omitempty\"`\n\tAllowedActions     *string `json:\"allowed_actions,omitempty\"`\n\tSelectedActionsURL *string `json:\"selected_actions_url,omitempty\"`\n\tSHAPinningRequired *bool   `json:\"sha_pinning_required,omitempty\"`\n}\n\nfunc (a ActionsPermissionsRepository) String() string {\n\treturn Stringify(a)\n}\n\n// DefaultWorkflowPermissionRepository represents the default permissions for GitHub Actions workflows for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions\ntype DefaultWorkflowPermissionRepository struct {\n\tDefaultWorkflowPermissions   *string `json:\"default_workflow_permissions,omitempty\"`\n\tCanApprovePullRequestReviews *bool   `json:\"can_approve_pull_request_reviews,omitempty\"`\n}\n\n// GetActionsPermissions gets the GitHub Actions permissions policy for repositories and allowed actions in a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/permissions\nfunc (s *RepositoriesService) GetActionsPermissions(ctx context.Context, owner, repo string) (*ActionsPermissionsRepository, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/permissions\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar permissions *ActionsPermissionsRepository\n\tresp, err := s.client.Do(ctx, req, &permissions)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn permissions, resp, nil\n}\n\n// UpdateActionsPermissions sets the permissions policy for repositories and allowed actions in a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-a-repository\n//\n//meta:operation PUT /repos/{owner}/{repo}/actions/permissions\nfunc (s *RepositoriesService) UpdateActionsPermissions(ctx context.Context, owner, repo string, actionsPermissionsRepository ActionsPermissionsRepository) (*ActionsPermissionsRepository, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/permissions\", owner, repo)\n\treq, err := s.client.NewRequest(\"PUT\", u, actionsPermissionsRepository)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar permissions *ActionsPermissionsRepository\n\tresp, err := s.client.Do(ctx, req, &permissions)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn permissions, resp, nil\n}\n\n// GetDefaultWorkflowPermissions gets the GitHub Actions default workflow permissions in a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/permissions/workflow\nfunc (s *RepositoriesService) GetDefaultWorkflowPermissions(ctx context.Context, owner, repo string) (*DefaultWorkflowPermissionRepository, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/permissions/workflow\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar permissions *DefaultWorkflowPermissionRepository\n\tresp, err := s.client.Do(ctx, req, &permissions)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn permissions, resp, nil\n}\n\n// UpdateDefaultWorkflowPermissions sets the GitHub Actions default workflow permissions in a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-a-repository\n//\n//meta:operation PUT /repos/{owner}/{repo}/actions/permissions/workflow\nfunc (s *RepositoriesService) UpdateDefaultWorkflowPermissions(ctx context.Context, owner, repo string, permissions DefaultWorkflowPermissionRepository) (*DefaultWorkflowPermissionRepository, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/permissions/workflow\", owner, repo)\n\treq, err := s.client.NewRequest(\"PUT\", u, permissions)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar p *DefaultWorkflowPermissionRepository\n\tresp, err := s.client.Do(ctx, req, &p)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn p, resp, nil\n}\n\n// GetArtifactAndLogRetentionPeriod gets the artifact and log retention period for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-artifact-and-log-retention-settings-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention\nfunc (s *RepositoriesService) GetArtifactAndLogRetentionPeriod(ctx context.Context, owner, repo string) (*ArtifactPeriod, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/permissions/artifact-and-log-retention\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar arp *ArtifactPeriod\n\tresp, err := s.client.Do(ctx, req, &arp)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn arp, resp, nil\n}\n\n// UpdateArtifactAndLogRetentionPeriod sets the artifact and log retention period for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-artifact-and-log-retention-settings-for-a-repository\n//\n//meta:operation PUT /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention\nfunc (s *RepositoriesService) UpdateArtifactAndLogRetentionPeriod(ctx context.Context, owner, repo string, period ArtifactPeriodOpt) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/permissions/artifact-and-log-retention\", owner, repo)\n\treq, err := s.client.NewRequest(\"PUT\", u, period)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// GetPrivateRepoForkPRWorkflowSettings gets the settings for whether workflows from fork pull requests can run on a private repository.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-private-repo-fork-pr-workflow-settings-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos\nfunc (s *RepositoriesService) GetPrivateRepoForkPRWorkflowSettings(ctx context.Context, owner, repo string) (*WorkflowsPermissions, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/permissions/fork-pr-workflows-private-repos\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar permissions *WorkflowsPermissions\n\tresp, err := s.client.Do(ctx, req, &permissions)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn permissions, resp, nil\n}\n\n// UpdatePrivateRepoForkPRWorkflowSettings sets the settings for whether workflows from fork pull requests can run on a private repository.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-private-repo-fork-pr-workflow-settings-for-a-repository\n//\n//meta:operation PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos\nfunc (s *RepositoriesService) UpdatePrivateRepoForkPRWorkflowSettings(ctx context.Context, owner, repo string, permissions *WorkflowsPermissionsOpt) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/permissions/fork-pr-workflows-private-repos\", owner, repo)\n\treq, err := s.client.NewRequest(\"PUT\", u, permissions)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// GetForkPRContributorApprovalPermissions gets the fork PR contributor approval policy for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#get-fork-pr-contributor-approval-permissions-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval\nfunc (s *ActionsService) GetForkPRContributorApprovalPermissions(ctx context.Context, owner, repo string) (*ContributorApprovalPermissions, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/permissions/fork-pr-contributor-approval\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar policy *ContributorApprovalPermissions\n\tresp, err := s.client.Do(ctx, req, &policy)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn policy, resp, nil\n}\n\n// UpdateForkPRContributorApprovalPermissions sets the fork PR contributor approval policy for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/actions/permissions#set-fork-pr-contributor-approval-permissions-for-a-repository\n//\n//meta:operation PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval\nfunc (s *ActionsService) UpdateForkPRContributorApprovalPermissions(ctx context.Context, owner, repo string, policy ContributorApprovalPermissions) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/actions/permissions/fork-pr-contributor-approval\", owner, repo)\n\treq, err := s.client.NewRequest(\"PUT\", u, policy)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/repos_actions_permissions_test.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_GetActionsPermissions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/permissions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"enabled\": true, \"allowed_actions\": \"all\", \"sha_pinning_required\": true}`)\n\t})\n\n\tctx := t.Context()\n\torg, _, err := client.Repositories.GetActionsPermissions(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetActionsPermissions returned error: %v\", err)\n\t}\n\twant := &ActionsPermissionsRepository{Enabled: Ptr(true), AllowedActions: Ptr(\"all\"), SHAPinningRequired: Ptr(true)}\n\tif !cmp.Equal(org, want) {\n\t\tt.Errorf(\"Repositories.GetActionsPermissions returned %+v, want %+v\", org, want)\n\t}\n\n\tconst methodName = \"GetActionsPermissions\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetActionsPermissions(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetActionsPermissions(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_UpdateActionsPermissions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &ActionsPermissionsRepository{Enabled: Ptr(true), AllowedActions: Ptr(\"selected\"), SHAPinningRequired: Ptr(true)}\n\n\tmux.HandleFunc(\"/repos/o/r/actions/permissions\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *ActionsPermissionsRepository\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"enabled\": true, \"allowed_actions\": \"selected\", \"sha_pinning_required\": true}`)\n\t})\n\n\tctx := t.Context()\n\torg, _, err := client.Repositories.UpdateActionsPermissions(ctx, \"o\", \"r\", *input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.UpdateActionsPermissions returned error: %v\", err)\n\t}\n\n\twant := &ActionsPermissionsRepository{Enabled: Ptr(true), AllowedActions: Ptr(\"selected\"), SHAPinningRequired: Ptr(true)}\n\tif !cmp.Equal(org, want) {\n\t\tt.Errorf(\"Repositories.UpdateActionsPermissions returned %+v, want %+v\", org, want)\n\t}\n\n\tconst methodName = \"UpdateActionsPermissions\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.UpdateActionsPermissions(ctx, \"\\n\", \"\\n\", *input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.UpdateActionsPermissions(ctx, \"o\", \"r\", *input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsPermissionsRepository_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ActionsPermissions{}, \"{}\")\n\n\tu := &ActionsPermissionsRepository{\n\t\tEnabled:            Ptr(true),\n\t\tAllowedActions:     Ptr(\"all\"),\n\t\tSelectedActionsURL: Ptr(\"someURL\"),\n\t\tSHAPinningRequired: Ptr(true),\n\t}\n\n\twant := `{\n\t\t\"enabled\": true,\n\t\t\"allowed_actions\": \"all\",\n\t\t\"selected_actions_url\": \"someURL\",\n\t\t\"sha_pinning_required\": true\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestRepositoriesService_GetDefaultWorkflowPermissions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/permissions/workflow\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{ \"default_workflow_permissions\": \"read\", \"can_approve_pull_request_reviews\": true }`)\n\t})\n\n\tctx := t.Context()\n\torg, _, err := client.Repositories.GetDefaultWorkflowPermissions(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetDefaultWorkflowPermissions returned error: %v\", err)\n\t}\n\twant := &DefaultWorkflowPermissionRepository{DefaultWorkflowPermissions: Ptr(\"read\"), CanApprovePullRequestReviews: Ptr(true)}\n\tif !cmp.Equal(org, want) {\n\t\tt.Errorf(\"Repositories.GetDefaultWorkflowPermissions returned %+v, want %+v\", org, want)\n\t}\n\n\tconst methodName = \"GetDefaultWorkflowPermissions\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetDefaultWorkflowPermissions(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetDefaultWorkflowPermissions(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_UpdateDefaultWorkflowPermissions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &DefaultWorkflowPermissionRepository{DefaultWorkflowPermissions: Ptr(\"read\"), CanApprovePullRequestReviews: Ptr(true)}\n\n\tmux.HandleFunc(\"/repos/o/r/actions/permissions/workflow\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *DefaultWorkflowPermissionRepository\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{ \"default_workflow_permissions\": \"read\", \"can_approve_pull_request_reviews\": true }`)\n\t})\n\n\tctx := t.Context()\n\torg, _, err := client.Repositories.UpdateDefaultWorkflowPermissions(ctx, \"o\", \"r\", *input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.UpdateDefaultWorkflowPermissions returned error: %v\", err)\n\t}\n\n\twant := &DefaultWorkflowPermissionRepository{DefaultWorkflowPermissions: Ptr(\"read\"), CanApprovePullRequestReviews: Ptr(true)}\n\tif !cmp.Equal(org, want) {\n\t\tt.Errorf(\"Repositories.UpdateDefaultWorkflowPermissions returned %+v, want %+v\", org, want)\n\t}\n\n\tconst methodName = \"UpdateDefaultWorkflowPermissions\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.UpdateDefaultWorkflowPermissions(ctx, \"\\n\", \"\\n\", *input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.UpdateDefaultWorkflowPermissions(ctx, \"o\", \"r\", *input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetArtifactAndLogRetentionPeriod(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/permissions/artifact-and-log-retention\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"days\": 90, \"maximum_allowed_days\": 365}`)\n\t})\n\n\tctx := t.Context()\n\tperiod, _, err := client.Repositories.GetArtifactAndLogRetentionPeriod(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetArtifactAndLogRetentionPeriod returned error: %v\", err)\n\t}\n\n\twant := &ArtifactPeriod{\n\t\tDays:               Ptr(90),\n\t\tMaximumAllowedDays: Ptr(365),\n\t}\n\tif !cmp.Equal(period, want) {\n\t\tt.Errorf(\"Repositories.GetArtifactAndLogRetentionPeriod = %+v, want %+v\", period, want)\n\t}\n\n\tconst methodName = \"GetArtifactAndLogRetentionPeriod\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetArtifactAndLogRetentionPeriod(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetArtifactAndLogRetentionPeriod(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_UpdateArtifactAndLogRetentionPeriod(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &ArtifactPeriodOpt{Days: Ptr(90)}\n\n\tmux.HandleFunc(\"/repos/o/r/actions/permissions/artifact-and-log-retention\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *ArtifactPeriodOpt\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Repositories.UpdateArtifactAndLogRetentionPeriod(ctx, \"o\", \"r\", *input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.UpdateArtifactAndLogRetentionPeriod returned error: %v\", err)\n\t}\n\n\tif resp.StatusCode != http.StatusNoContent {\n\t\tt.Errorf(\"Repositories.UpdateArtifactAndLogRetentionPeriod = %v, want %v\", resp.StatusCode, http.StatusNoContent)\n\t}\n\n\tconst methodName = \"UpdateArtifactAndLogRetentionPeriod\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.UpdateArtifactAndLogRetentionPeriod(ctx, \"\\n\", \"\\n\", *input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.UpdateArtifactAndLogRetentionPeriod(ctx, \"o\", \"r\", *input)\n\t})\n}\n\nfunc TestRepositoriesService_GetPrivateRepoForkPRWorkflowSettings(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/permissions/fork-pr-workflows-private-repos\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"run_workflows_from_fork_pull_requests\": true, \"send_write_tokens_to_workflows\": false, \"send_secrets_and_variables\": true, \"require_approval_for_fork_pr_workflows\": false}`)\n\t})\n\n\tctx := t.Context()\n\tpermissions, _, err := client.Repositories.GetPrivateRepoForkPRWorkflowSettings(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetPrivateRepoForkPRWorkflowSettings returned error: %v\", err)\n\t}\n\twant := &WorkflowsPermissions{\n\t\tRunWorkflowsFromForkPullRequests:  Ptr(true),\n\t\tSendWriteTokensToWorkflows:        Ptr(false),\n\t\tSendSecretsAndVariables:           Ptr(true),\n\t\tRequireApprovalForForkPRWorkflows: Ptr(false),\n\t}\n\tif !cmp.Equal(permissions, want) {\n\t\tt.Errorf(\"Repositories.GetPrivateRepoForkPRWorkflowSettings returned %+v, want %+v\", permissions, want)\n\t}\n\n\tconst methodName = \"GetPrivateRepoForkPRWorkflowSettings\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetPrivateRepoForkPRWorkflowSettings(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetPrivateRepoForkPRWorkflowSettings(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_UpdatePrivateRepoForkPRWorkflowSettings(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &WorkflowsPermissionsOpt{\n\t\tRunWorkflowsFromForkPullRequests: true,\n\t\tSendWriteTokensToWorkflows:       Ptr(false),\n\t\tSendSecretsAndVariables:          Ptr(true),\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/actions/permissions/fork-pr-workflows-private-repos\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *WorkflowsPermissionsOpt\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Repositories.UpdatePrivateRepoForkPRWorkflowSettings(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.UpdatePrivateRepoForkPRWorkflowSettings returned error: %v\", err)\n\t}\n\n\tif resp.StatusCode != http.StatusNoContent {\n\t\tt.Errorf(\"Repositories.UpdatePrivateRepoForkPRWorkflowSettings = %v, want %v\", resp.StatusCode, http.StatusNoContent)\n\t}\n\n\tconst methodName = \"UpdatePrivateRepoForkPRWorkflowSettings\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.UpdatePrivateRepoForkPRWorkflowSettings(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.UpdatePrivateRepoForkPRWorkflowSettings(ctx, \"o\", \"r\", input)\n\t})\n}\n\nfunc TestActionsService_GetForkPRContributorApprovalPermissions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/actions/permissions/fork-pr-contributor-approval\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"approval_policy\": \"require_approval\"}`)\n\t})\n\n\tctx := t.Context()\n\tpolicy, _, err := client.Actions.GetForkPRContributorApprovalPermissions(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Actions.GetForkPRContributorApprovalPermissions returned error: %v\", err)\n\t}\n\twant := &ContributorApprovalPermissions{ApprovalPolicy: \"require_approval\"}\n\tif !cmp.Equal(policy, want) {\n\t\tt.Errorf(\"Actions.GetForkPRContributorApprovalPermissions returned %+v, want %+v\", policy, want)\n\t}\n\n\tconst methodName = \"GetForkPRContributorApprovalPermissions\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Actions.GetForkPRContributorApprovalPermissions(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Actions.GetForkPRContributorApprovalPermissions(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestActionsService_UpdateForkPRContributorApprovalPermissions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := ContributorApprovalPermissions{ApprovalPolicy: \"require_approval\"}\n\n\tmux.HandleFunc(\"/repos/o/r/actions/permissions/fork-pr-contributor-approval\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *ContributorApprovalPermissions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, &input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, &input)\n\t\t}\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Actions.UpdateForkPRContributorApprovalPermissions(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Actions.UpdateForkPRContributorApprovalPermissions returned error: %v\", err)\n\t}\n\n\tif resp.StatusCode != http.StatusNoContent {\n\t\tt.Errorf(\"Actions.UpdateForkPRContributorApprovalPermissions = %v, want %v\", resp.StatusCode, http.StatusNoContent)\n\t}\n\n\tconst methodName = \"UpdateForkPRContributorApprovalPermissions\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Actions.UpdateForkPRContributorApprovalPermissions(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Actions.UpdateForkPRContributorApprovalPermissions(ctx, \"o\", \"r\", input)\n\t})\n}\n"
  },
  {
    "path": "github/repos_attestations.go",
    "content": "// Copyright 2024 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// ListAttestations returns a collection of artifact attestations\n// with a given subject digest that are associated with a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/attestations#list-attestations\n//\n//meta:operation GET /repos/{owner}/{repo}/attestations/{subject_digest}\nfunc (s *RepositoriesService) ListAttestations(ctx context.Context, owner, repo, subjectDigest string, opts *ListOptions) (*AttestationsResponse, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/attestations/%v\", owner, repo, subjectDigest)\n\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar attestations *AttestationsResponse\n\tresp, err := s.client.Do(ctx, req, &attestations)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn attestations, resp, nil\n}\n"
  },
  {
    "path": "github/repos_attestations_test.go",
    "content": "// Copyright 2024 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_ListAttestations(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/attestations/digest\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"attestations\": [\n\t\t\t\t{\n\t\t\t\t\t\"repository_id\": 1,\n\t\t\t\t\t\"bundle\": {}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"repository_id\": 2,\n\t\t\t\t\t\"bundle\": {}\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\tctx := t.Context()\n\tattestations, _, err := client.Repositories.ListAttestations(ctx, \"o\", \"r\", \"digest\", &ListOptions{})\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListAttestations returned error: %v\", err)\n\t}\n\n\twant := &AttestationsResponse{\n\t\tAttestations: []*Attestation{\n\t\t\t{\n\t\t\t\tRepositoryID: 1,\n\t\t\t\tBundle:       []byte(`{}`),\n\t\t\t},\n\t\t\t{\n\t\t\t\tRepositoryID: 2,\n\t\t\t\tBundle:       []byte(`{}`),\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(attestations, want) {\n\t\tt.Errorf(\"Repositories.ListAttestations = %+v, want %+v\", attestations, want)\n\t}\n\tconst methodName = \"ListAttestations\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListAttestations(ctx, \"\\n\", \"\\n\", \"\\n\", &ListOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListAttestations(ctx, \"o\", \"r\", \"digest\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/repos_autolinks.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// AutolinkOptions specifies parameters for RepositoriesService.AddAutolink method.\ntype AutolinkOptions struct {\n\tKeyPrefix      *string `json:\"key_prefix,omitempty\"`\n\tURLTemplate    *string `json:\"url_template,omitempty\"`\n\tIsAlphanumeric *bool   `json:\"is_alphanumeric,omitempty\"`\n}\n\n// Autolink represents autolinks to external resources like Jira issues and Zendesk tickets.\ntype Autolink struct {\n\tID             *int64  `json:\"id,omitempty\"`\n\tKeyPrefix      *string `json:\"key_prefix,omitempty\"`\n\tURLTemplate    *string `json:\"url_template,omitempty\"`\n\tIsAlphanumeric *bool   `json:\"is_alphanumeric,omitempty\"`\n}\n\n// ListAutolinks returns a list of autolinks configured for the given repository.\n// Information about autolinks are only available to repository administrators.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/autolinks#get-all-autolinks-of-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/autolinks\nfunc (s *RepositoriesService) ListAutolinks(ctx context.Context, owner, repo string) ([]*Autolink, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/autolinks\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar autolinks []*Autolink\n\tresp, err := s.client.Do(ctx, req, &autolinks)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn autolinks, resp, nil\n}\n\n// AddAutolink creates an autolink reference for a repository.\n// Users with admin access to the repository can create an autolink.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/autolinks#create-an-autolink-reference-for-a-repository\n//\n//meta:operation POST /repos/{owner}/{repo}/autolinks\nfunc (s *RepositoriesService) AddAutolink(ctx context.Context, owner, repo string, opts *AutolinkOptions) (*Autolink, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/autolinks\", owner, repo)\n\treq, err := s.client.NewRequest(\"POST\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar al *Autolink\n\tresp, err := s.client.Do(ctx, req, &al)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn al, resp, nil\n}\n\n// GetAutolink returns a single autolink reference by ID that was configured for the given repository.\n// Information about autolinks are only available to repository administrators.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/autolinks#get-an-autolink-reference-of-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/autolinks/{autolink_id}\nfunc (s *RepositoriesService) GetAutolink(ctx context.Context, owner, repo string, id int64) (*Autolink, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/autolinks/%v\", owner, repo, id)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar autolink *Autolink\n\tresp, err := s.client.Do(ctx, req, &autolink)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn autolink, resp, nil\n}\n\n// DeleteAutolink deletes a single autolink reference by ID that was configured for the given repository.\n// Information about autolinks are only available to repository administrators.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/autolinks#delete-an-autolink-reference-from-a-repository\n//\n//meta:operation DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}\nfunc (s *RepositoriesService) DeleteAutolink(ctx context.Context, owner, repo string, id int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/autolinks/%v\", owner, repo, id)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/repos_autolinks_test.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_ListAutolinks(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/autolinks\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"id\":1, \"key_prefix\": \"TICKET-\", \"url_template\": \"https://example.com/TICKET?query=<num>\"}, {\"id\":2, \"key_prefix\": \"STORY-\", \"url_template\": \"https://example.com/STORY?query=<num>\"}]`)\n\t})\n\n\tctx := t.Context()\n\tautolinks, _, err := client.Repositories.ListAutolinks(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListAutolinks returned error: %v\", err)\n\t}\n\n\twant := []*Autolink{\n\t\t{ID: Ptr(int64(1)), KeyPrefix: Ptr(\"TICKET-\"), URLTemplate: Ptr(\"https://example.com/TICKET?query=<num>\")},\n\t\t{ID: Ptr(int64(2)), KeyPrefix: Ptr(\"STORY-\"), URLTemplate: Ptr(\"https://example.com/STORY?query=<num>\")},\n\t}\n\n\tif !cmp.Equal(autolinks, want) {\n\t\tt.Errorf(\"Repositories.ListAutolinks returned %+v, want %+v\", autolinks, want)\n\t}\n\n\tconst methodName = \"ListAutolinks\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListAutolinks(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListAutolinks(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_AddAutolink(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\topt := &AutolinkOptions{\n\t\tKeyPrefix:      Ptr(\"TICKET-\"),\n\t\tURLTemplate:    Ptr(\"https://example.com/TICKET?query=<num>\"),\n\t\tIsAlphanumeric: Ptr(true),\n\t}\n\tmux.HandleFunc(\"/repos/o/r/autolinks\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *AutolinkOptions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, opt) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, opt)\n\t\t}\n\t\tw.WriteHeader(http.StatusOK)\n\t\tassertWrite(t, w, []byte(`\n\t\t\t{\n\t\t\t\t\"key_prefix\": \"TICKET-\",\n\t\t\t\t\"url_template\": \"https://example.com/TICKET?query=<num>\",\n\t\t\t\t\"is_alphanumeric\": true\n\t\t\t}\n\t\t`))\n\t})\n\tctx := t.Context()\n\tautolink, _, err := client.Repositories.AddAutolink(ctx, \"o\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.AddAutolink returned error: %v\", err)\n\t}\n\twant := &Autolink{\n\t\tKeyPrefix:      Ptr(\"TICKET-\"),\n\t\tURLTemplate:    Ptr(\"https://example.com/TICKET?query=<num>\"),\n\t\tIsAlphanumeric: Ptr(true),\n\t}\n\n\tif !cmp.Equal(autolink, want) {\n\t\tt.Errorf(\"AddAutolink returned %+v, want %+v\", autolink, want)\n\t}\n\n\tconst methodName = \"AddAutolink\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.AddAutolink(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.AddAutolink(ctx, \"o\", \"r\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetAutolink(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/autolinks/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1, \"key_prefix\": \"TICKET-\", \"url_template\": \"https://example.com/TICKET?query=<num>\"}`)\n\t})\n\n\tctx := t.Context()\n\tautolink, _, err := client.Repositories.GetAutolink(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetAutolink returned error: %v\", err)\n\t}\n\n\twant := &Autolink{ID: Ptr(int64(1)), KeyPrefix: Ptr(\"TICKET-\"), URLTemplate: Ptr(\"https://example.com/TICKET?query=<num>\")}\n\tif !cmp.Equal(autolink, want) {\n\t\tt.Errorf(\"Repositories.GetAutolink returned %+v, want %+v\", autolink, want)\n\t}\n\n\tconst methodName = \"GetAutolink\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetAutolink(ctx, \"o\", \"r\", 2)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_DeleteAutolink(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/autolinks/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Repositories.DeleteAutolink(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.DeleteAutolink returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteAutolink\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.DeleteAutolink(ctx, \"o\", \"r\", 2)\n\t})\n}\n\nfunc TestAutolinkOptions_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &AutolinkOptions{}, \"{}\")\n\n\tr := &AutolinkOptions{\n\t\tKeyPrefix:      Ptr(\"kp\"),\n\t\tURLTemplate:    Ptr(\"URLT\"),\n\t\tIsAlphanumeric: Ptr(true),\n\t}\n\n\twant := `{\n\t\t\"key_prefix\": \"kp\",\n\t\t\"url_template\": \"URLT\",\n\t\t\"is_alphanumeric\": true\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n\nfunc TestAutolink_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Autolink{}, \"{}\")\n\n\tr := &Autolink{\n\t\tID:             Ptr(int64(1)),\n\t\tKeyPrefix:      Ptr(\"kp\"),\n\t\tURLTemplate:    Ptr(\"URLT\"),\n\t\tIsAlphanumeric: Ptr(true),\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"key_prefix\": \"kp\",\n\t\t\"url_template\": \"URLT\",\n\t\t\"is_alphanumeric\": true\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n"
  },
  {
    "path": "github/repos_codeowners.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// GetCodeownersErrorsOptions specifies the optional parameters to the\n// RepositoriesService.GetCodeownersErrors method.\ntype GetCodeownersErrorsOptions struct {\n\t// A branch, tag or commit name used to determine which version of the CODEOWNERS file to use.\n\t// Default: the repository's default branch (e.g. main).\n\tRef string `url:\"ref,omitempty\"`\n}\n\n// CodeownersErrors represents a list of syntax errors detected in the CODEOWNERS file.\ntype CodeownersErrors struct {\n\tErrors []*CodeownersError `json:\"errors\"`\n}\n\n// CodeownersError represents a syntax error detected in the CODEOWNERS file.\ntype CodeownersError struct {\n\tLine       int     `json:\"line\"`\n\tColumn     int     `json:\"column\"`\n\tKind       string  `json:\"kind\"`\n\tSource     string  `json:\"source\"`\n\tSuggestion *string `json:\"suggestion,omitempty\"`\n\tMessage    string  `json:\"message\"`\n\tPath       string  `json:\"path\"`\n}\n\n// GetCodeownersErrors lists any syntax errors that are detected in the CODEOWNERS file.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#list-codeowners-errors\n//\n//meta:operation GET /repos/{owner}/{repo}/codeowners/errors\nfunc (s *RepositoriesService) GetCodeownersErrors(ctx context.Context, owner, repo string, opts *GetCodeownersErrorsOptions) (*CodeownersErrors, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/codeowners/errors\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar codeownersErrors *CodeownersErrors\n\tresp, err := s.client.Do(ctx, req, &codeownersErrors)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn codeownersErrors, resp, nil\n}\n"
  },
  {
    "path": "github/repos_codeowners_test.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_GetCodeownersErrors_noRef(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/codeowners/errors\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeV3)\n\t\tfmt.Fprint(w, `{\n\t\t  \"errors\": [\n\t\t\t{\n\t\t\t  \"line\": 1,\n\t\t\t  \"column\": 1,\n\t\t\t  \"kind\": \"Invalid pattern\",\n\t\t\t  \"source\": \"***/*.rb @monalisa\",\n\t\t\t  \"suggestion\": \"Did you mean **/*.rb?\",\n\t\t\t  \"message\": \"Invalid pattern on line 3: Did you mean **/*.rb?\\n\\n  ***/*.rb @monalisa\\n  ^\",\n\t\t\t  \"path\": \".github/CODEOWNERS\"\n\t\t\t}\n\t\t  ]\n\t\t}\n\t`)\n\t})\n\n\tctx := t.Context()\n\tcodeownersErrors, _, err := client.Repositories.GetCodeownersErrors(ctx, \"o\", \"r\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetCodeownersErrors returned error: %v\", err)\n\t}\n\n\twant := &CodeownersErrors{\n\t\tErrors: []*CodeownersError{\n\t\t\t{\n\t\t\t\tLine:       1,\n\t\t\t\tColumn:     1,\n\t\t\t\tKind:       \"Invalid pattern\",\n\t\t\t\tSource:     \"***/*.rb @monalisa\",\n\t\t\t\tSuggestion: Ptr(\"Did you mean **/*.rb?\"),\n\t\t\t\tMessage:    \"Invalid pattern on line 3: Did you mean **/*.rb?\\n\\n  ***/*.rb @monalisa\\n  ^\",\n\t\t\t\tPath:       \".github/CODEOWNERS\",\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(codeownersErrors, want) {\n\t\tt.Errorf(\"Repositories.GetCodeownersErrors returned %+v, want %+v\", codeownersErrors, want)\n\t}\n\n\tconst methodName = \"GetCodeownersErrors\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetCodeownersErrors(ctx, \"\\n\", \"\\n\", nil)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetCodeownersErrors(ctx, \"o\", \"r\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetCodeownersErrors_specificRef(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/codeowners/errors\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeV3)\n\t\ttestFormValues(t, r, values{\"ref\": \"mybranch\"})\n\t\tfmt.Fprint(w, `{\n\t\t  \"errors\": [\n\t\t\t{\n\t\t\t  \"line\": 1,\n\t\t\t  \"column\": 1,\n\t\t\t  \"kind\": \"Invalid pattern\",\n\t\t\t  \"source\": \"***/*.rb @monalisa\",\n\t\t\t  \"suggestion\": \"Did you mean **/*.rb?\",\n\t\t\t  \"message\": \"Invalid pattern on line 3: Did you mean **/*.rb?\\n\\n  ***/*.rb @monalisa\\n  ^\",\n\t\t\t  \"path\": \".github/CODEOWNERS\"\n\t\t\t}\n\t\t  ]\n\t\t}\n\t`)\n\t})\n\n\topts := &GetCodeownersErrorsOptions{Ref: \"mybranch\"}\n\tctx := t.Context()\n\tcodeownersErrors, _, err := client.Repositories.GetCodeownersErrors(ctx, \"o\", \"r\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetCodeownersErrors returned error: %v\", err)\n\t}\n\n\twant := &CodeownersErrors{\n\t\tErrors: []*CodeownersError{\n\t\t\t{\n\t\t\t\tLine:       1,\n\t\t\t\tColumn:     1,\n\t\t\t\tKind:       \"Invalid pattern\",\n\t\t\t\tSource:     \"***/*.rb @monalisa\",\n\t\t\t\tSuggestion: Ptr(\"Did you mean **/*.rb?\"),\n\t\t\t\tMessage:    \"Invalid pattern on line 3: Did you mean **/*.rb?\\n\\n  ***/*.rb @monalisa\\n  ^\",\n\t\t\t\tPath:       \".github/CODEOWNERS\",\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(codeownersErrors, want) {\n\t\tt.Errorf(\"Repositories.GetCodeownersErrors returned %+v, want %+v\", codeownersErrors, want)\n\t}\n\n\tconst methodName = \"GetCodeownersErrors\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetCodeownersErrors(ctx, \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetCodeownersErrors(ctx, \"o\", \"r\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestCodeownersErrors_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CodeownersErrors{}, `{\"errors\": null}`)\n\n\tu := &CodeownersErrors{\n\t\tErrors: []*CodeownersError{\n\t\t\t{\n\t\t\t\tLine:       1,\n\t\t\t\tColumn:     1,\n\t\t\t\tKind:       \"Invalid pattern\",\n\t\t\t\tSource:     \"***/*.rb @monalisa\",\n\t\t\t\tSuggestion: Ptr(\"Did you mean **/*.rb?\"),\n\t\t\t\tMessage:    \"Invalid pattern on line 3: Did you mean **/*.rb?\\n\\n  ***/*.rb @monalisa\\n  ^\",\n\t\t\t\tPath:       \".github/CODEOWNERS\",\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t  \"errors\": [\n\t\t{\n\t\t  \"line\": 1,\n\t\t  \"column\": 1,\n\t\t  \"kind\": \"Invalid pattern\",\n\t\t  \"source\": \"***/*.rb @monalisa\",\n\t\t  \"suggestion\": \"Did you mean **/*.rb?\",\n\t\t  \"message\": \"Invalid pattern on line 3: Did you mean **/*.rb?\\n\\n  ***/*.rb @monalisa\\n  ^\",\n\t\t  \"path\": \".github/CODEOWNERS\"\n\t\t}\n\t  ]\n\t}\n`\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/repos_collaborators.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// ListCollaboratorsOptions specifies the optional parameters to the\n// RepositoriesService.ListCollaborators method.\ntype ListCollaboratorsOptions struct {\n\t// Affiliation specifies how collaborators should be filtered by their affiliation.\n\t// Possible values are:\n\t//     outside - All outside collaborators of an organization-owned repository\n\t//     direct - All collaborators with permissions to an organization-owned repository,\n\t//              regardless of organization membership status\n\t//     all - All collaborators the authenticated user can see\n\t//\n\t// Default value is \"all\".\n\tAffiliation string `url:\"affiliation,omitempty\"`\n\n\t// Permission specifies how collaborators should be filtered by the permissions they have on the repository.\n\t// Possible values are:\n\t// \"pull\", \"triage\", \"push\", \"maintain\", \"admin\"\n\t//\n\t// If not specified, all collaborators will be returned.\n\tPermission string `url:\"permission,omitempty\"`\n\n\tListOptions\n}\n\n// CollaboratorInvitation represents an invitation created when adding a collaborator.\n// GitHub API docs: https://docs.github.com/rest/repos/collaborators/#response-when-a-new-invitation-is-created\ntype CollaboratorInvitation struct {\n\tID          *int64      `json:\"id,omitempty\"`\n\tRepo        *Repository `json:\"repository,omitempty\"`\n\tInvitee     *User       `json:\"invitee,omitempty\"`\n\tInviter     *User       `json:\"inviter,omitempty\"`\n\tPermissions *string     `json:\"permissions,omitempty\"`\n\tCreatedAt   *Timestamp  `json:\"created_at,omitempty\"`\n\tURL         *string     `json:\"url,omitempty\"`\n\tHTMLURL     *string     `json:\"html_url,omitempty\"`\n}\n\n// ListCollaborators lists the GitHub users that have access to the repository.\n//\n// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#list-repository-collaborators\n//\n//meta:operation GET /repos/{owner}/{repo}/collaborators\nfunc (s *RepositoriesService) ListCollaborators(ctx context.Context, owner, repo string, opts *ListCollaboratorsOptions) ([]*User, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/collaborators\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar users []*User\n\tresp, err := s.client.Do(ctx, req, &users)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn users, resp, nil\n}\n\n// IsCollaborator checks whether the specified GitHub user has collaborator\n// access to the given repo.\n// Note: This will return false if the user is not a collaborator OR the user\n// is not a GitHub user.\n//\n// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#check-if-a-user-is-a-repository-collaborator\n//\n//meta:operation GET /repos/{owner}/{repo}/collaborators/{username}\nfunc (s *RepositoriesService) IsCollaborator(ctx context.Context, owner, repo, user string) (bool, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/collaborators/%v\", owner, repo, user)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn false, nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tisCollab, err := parseBoolResponse(err)\n\treturn isCollab, resp, err\n}\n\n// RepositoryPermissionLevel represents the permission level an organization\n// member has for a given repository.\ntype RepositoryPermissionLevel struct {\n\t// Possible values: \"admin\", \"write\", \"read\", \"none\"\n\tPermission *string `json:\"permission,omitempty\"`\n\n\tUser *User `json:\"user,omitempty\"`\n\n\tRoleName *string `json:\"role_name,omitempty\"`\n}\n\n// GetPermissionLevel retrieves the specific permission level a collaborator has for a given repository.\n//\n// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#get-repository-permissions-for-a-user\n//\n//meta:operation GET /repos/{owner}/{repo}/collaborators/{username}/permission\nfunc (s *RepositoriesService) GetPermissionLevel(ctx context.Context, owner, repo, user string) (*RepositoryPermissionLevel, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/collaborators/%v/permission\", owner, repo, user)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar rpl *RepositoryPermissionLevel\n\tresp, err := s.client.Do(ctx, req, &rpl)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn rpl, resp, nil\n}\n\n// RepositoryAddCollaboratorOptions specifies the optional parameters to the\n// RepositoriesService.AddCollaborator method.\ntype RepositoryAddCollaboratorOptions struct {\n\t// Permission specifies the permission to grant the user on this repository.\n\t// Possible values are:\n\t//     pull - team members can pull, but not push to or administer this repository\n\t//     push - team members can push and pull, but not administer this repository\n\t//     admin - team members can pull, push and administer this repository\n\t//     maintain - team members can manage the repository without access to sensitive or destructive actions.\n\t//     triage - team members can proactively manage issues and pull requests without write access.\n\t//\n\t// Default value is \"push\". This option is only valid for organization-owned repositories.\n\tPermission string `json:\"permission,omitempty\"`\n}\n\n// AddCollaborator sends an invitation to the specified GitHub user\n// to become a collaborator to the given repo.\n//\n// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#add-a-repository-collaborator\n//\n//meta:operation PUT /repos/{owner}/{repo}/collaborators/{username}\nfunc (s *RepositoriesService) AddCollaborator(ctx context.Context, owner, repo, user string, opts *RepositoryAddCollaboratorOptions) (*CollaboratorInvitation, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/collaborators/%v\", owner, repo, user)\n\treq, err := s.client.NewRequest(\"PUT\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar acr *CollaboratorInvitation\n\tresp, err := s.client.Do(ctx, req, &acr)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn acr, resp, nil\n}\n\n// RemoveCollaborator removes the specified GitHub user as collaborator from the given repo.\n// Note: Does not return error if a valid user that is not a collaborator is removed.\n//\n// GitHub API docs: https://docs.github.com/rest/collaborators/collaborators#remove-a-repository-collaborator\n//\n//meta:operation DELETE /repos/{owner}/{repo}/collaborators/{username}\nfunc (s *RepositoriesService) RemoveCollaborator(ctx context.Context, owner, repo, user string) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/collaborators/%v\", owner, repo, user)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/repos_collaborators_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_ListCollaborators(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/collaborators\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}, {\"id\":2}]`)\n\t})\n\n\topt := &ListCollaboratorsOptions{\n\t\tListOptions: ListOptions{Page: 2},\n\t}\n\tctx := t.Context()\n\tusers, _, err := client.Repositories.ListCollaborators(ctx, \"o\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListCollaborators returned error: %v\", err)\n\t}\n\n\twant := []*User{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}}\n\tif !cmp.Equal(users, want) {\n\t\tt.Errorf(\"Repositories.ListCollaborators returned %+v, want %+v\", users, want)\n\t}\n\n\tconst methodName = \"ListCollaborators\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListCollaborators(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListCollaborators(ctx, \"o\", \"r\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListCollaborators_withAffiliation(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/collaborators\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"affiliation\": \"all\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}, {\"id\":2}]`)\n\t})\n\n\topt := &ListCollaboratorsOptions{\n\t\tListOptions: ListOptions{Page: 2},\n\t\tAffiliation: \"all\",\n\t}\n\tctx := t.Context()\n\tusers, _, err := client.Repositories.ListCollaborators(ctx, \"o\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListCollaborators returned error: %v\", err)\n\t}\n\n\twant := []*User{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}}\n\tif !cmp.Equal(users, want) {\n\t\tt.Errorf(\"Repositories.ListCollaborators returned %+v, want %+v\", users, want)\n\t}\n\n\tconst methodName = \"ListCollaborators\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListCollaborators(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListCollaborators(ctx, \"o\", \"r\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListCollaborators_withPermission(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/collaborators\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"permission\": \"pull\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}, {\"id\":2}]`)\n\t})\n\n\topt := &ListCollaboratorsOptions{\n\t\tListOptions: ListOptions{Page: 2},\n\t\tPermission:  \"pull\",\n\t}\n\tctx := t.Context()\n\tusers, _, err := client.Repositories.ListCollaborators(ctx, \"o\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListCollaborators returned error: %v\", err)\n\t}\n\n\twant := []*User{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}}\n\tif !cmp.Equal(users, want) {\n\t\tt.Errorf(\"Repositories.ListCollaborators returned %+v, want %+v\", users, want)\n\t}\n\n\tconst methodName = \"ListCollaborators\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListCollaborators(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListCollaborators(ctx, \"o\", \"r\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListCollaborators_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.ListCollaborators(ctx, \"%\", \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoriesService_IsCollaborator_True(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/collaborators/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tisCollab, _, err := client.Repositories.IsCollaborator(ctx, \"o\", \"r\", \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.IsCollaborator returned error: %v\", err)\n\t}\n\n\tif !isCollab {\n\t\tt.Error(\"Repositories.IsCollaborator returned false, want true\")\n\t}\n\n\tconst methodName = \"IsCollaborator\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.IsCollaborator(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.IsCollaborator(ctx, \"o\", \"r\", \"u\")\n\t\tif got {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want false\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_IsCollaborator_False(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/collaborators/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tisCollab, _, err := client.Repositories.IsCollaborator(ctx, \"o\", \"r\", \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.IsCollaborator returned error: %v\", err)\n\t}\n\n\tif isCollab {\n\t\tt.Error(\"Repositories.IsCollaborator returned true, want false\")\n\t}\n\n\tconst methodName = \"IsCollaborator\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.IsCollaborator(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.IsCollaborator(ctx, \"o\", \"r\", \"u\")\n\t\tif got {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want false\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_IsCollaborator_invalidUser(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.IsCollaborator(ctx, \"%\", \"%\", \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoryService_GetPermissionLevel(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/collaborators/u/permission\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"permission\":\"admin\",\"user\":{\"login\":\"u\"}}`)\n\t})\n\n\tctx := t.Context()\n\trpl, _, err := client.Repositories.GetPermissionLevel(ctx, \"o\", \"r\", \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetPermissionLevel returned error: %v\", err)\n\t}\n\n\twant := &RepositoryPermissionLevel{\n\t\tPermission: Ptr(\"admin\"),\n\t\tUser: &User{\n\t\t\tLogin: Ptr(\"u\"),\n\t\t},\n\t}\n\n\tif !cmp.Equal(rpl, want) {\n\t\tt.Errorf(\"Repositories.GetPermissionLevel returned %+v, want %+v\", rpl, want)\n\t}\n\n\tconst methodName = \"GetPermissionLevel\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetPermissionLevel(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetPermissionLevel(ctx, \"o\", \"r\", \"u\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_AddCollaborator(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\topt := &RepositoryAddCollaboratorOptions{Permission: \"admin\"}\n\tmux.HandleFunc(\"/repos/o/r/collaborators/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *RepositoryAddCollaboratorOptions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, opt) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, opt)\n\t\t}\n\t\tw.WriteHeader(http.StatusOK)\n\t\tassertWrite(t, w, []byte(`{\"permissions\": \"write\",\"url\": \"https://api.github.com/user/repository_invitations/1296269\",\"html_url\": \"https://github.com/octocat/Hello-World/invitations\",\"id\":1,\"permissions\":\"write\",\"repository\":{\"url\":\"s\",\"name\":\"r\",\"id\":1},\"invitee\":{\"login\":\"u\"},\"inviter\":{\"login\":\"o\"}}`))\n\t})\n\tctx := t.Context()\n\tcollaboratorInvitation, _, err := client.Repositories.AddCollaborator(ctx, \"o\", \"r\", \"u\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.AddCollaborator returned error: %v\", err)\n\t}\n\twant := &CollaboratorInvitation{\n\t\tID: Ptr(int64(1)),\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"s\"),\n\t\t\tName: Ptr(\"r\"),\n\t\t},\n\t\tInvitee: &User{\n\t\t\tLogin: Ptr(\"u\"),\n\t\t},\n\t\tInviter: &User{\n\t\t\tLogin: Ptr(\"o\"),\n\t\t},\n\t\tPermissions: Ptr(\"write\"),\n\t\tURL:         Ptr(\"https://api.github.com/user/repository_invitations/1296269\"),\n\t\tHTMLURL:     Ptr(\"https://github.com/octocat/Hello-World/invitations\"),\n\t}\n\n\tif !cmp.Equal(collaboratorInvitation, want) {\n\t\tt.Errorf(\"AddCollaborator returned %+v, want %+v\", collaboratorInvitation, want)\n\t}\n\n\tconst methodName = \"AddCollaborator\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.AddCollaborator(ctx, \"\\n\", \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.AddCollaborator(ctx, \"o\", \"r\", \"u\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_AddCollaborator_invalidUser(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.AddCollaborator(ctx, \"%\", \"%\", \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoriesService_RemoveCollaborator(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/collaborators/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Repositories.RemoveCollaborator(ctx, \"o\", \"r\", \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.RemoveCollaborator returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveCollaborator\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.RemoveCollaborator(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.RemoveCollaborator(ctx, \"o\", \"r\", \"u\")\n\t})\n}\n\nfunc TestRepositoriesService_RemoveCollaborator_invalidUser(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Repositories.RemoveCollaborator(ctx, \"%\", \"%\", \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoryAddCollaboratorOptions_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RepositoryAddCollaboratorOptions{}, \"{}\")\n\n\tr := &RepositoryAddCollaboratorOptions{\n\t\tPermission: \"permission\",\n\t}\n\n\twant := `{\n\t\t\"permission\": \"permission\"\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n\nfunc TestRepositoryPermissionLevel_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RepositoryPermissionLevel{}, \"{}\")\n\n\tr := &RepositoryPermissionLevel{\n\t\tPermission: Ptr(\"permission\"),\n\t\tUser: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"permission\": \"permission\",\n\t\t\"user\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n\nfunc TestCollaboratorInvitation_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CollaboratorInvitation{}, \"{}\")\n\n\tr := &CollaboratorInvitation{\n\t\tID: Ptr(int64(1)),\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tURL:  Ptr(\"url\"),\n\t\t\tName: Ptr(\"n\"),\n\t\t},\n\t\tInvitee: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t\tInviter: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t\tPermissions: Ptr(\"per\"),\n\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\tURL:         Ptr(\"url\"),\n\t\tHTMLURL:     Ptr(\"hurl\"),\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"repository\": {\n\t\t\t\"id\": 1,\n\t\t\t\"name\": \"n\",\n\t\t\t\"url\": \"url\"\n\t\t},\n\t\t\"invitee\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"inviter\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"permissions\": \"per\",\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"url\": \"url\",\n\t\t\"html_url\": \"hurl\"\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n"
  },
  {
    "path": "github/repos_comments.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// RepositoryComment represents a comment for a commit, file, or line in a repository.\ntype RepositoryComment struct {\n\tHTMLURL   *string    `json:\"html_url,omitempty\"`\n\tURL       *string    `json:\"url,omitempty\"`\n\tID        *int64     `json:\"id,omitempty\"`\n\tNodeID    *string    `json:\"node_id,omitempty\"`\n\tCommitID  *string    `json:\"commit_id,omitempty\"`\n\tUser      *User      `json:\"user,omitempty\"`\n\tReactions *Reactions `json:\"reactions,omitempty\"`\n\tCreatedAt *Timestamp `json:\"created_at,omitempty\"`\n\tUpdatedAt *Timestamp `json:\"updated_at,omitempty\"`\n\n\t// User-mutable fields\n\tBody *string `json:\"body\"`\n\t// User-initialized fields\n\tPath     *string `json:\"path,omitempty\"`\n\tPosition *int    `json:\"position,omitempty\"`\n}\n\nfunc (r RepositoryComment) String() string {\n\treturn Stringify(r)\n}\n\n// ListComments lists all the comments for the repository.\n//\n// GitHub API docs: https://docs.github.com/rest/commits/comments#list-commit-comments-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/comments\nfunc (s *RepositoriesService) ListComments(ctx context.Context, owner, repo string, opts *ListOptions) ([]*RepositoryComment, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/comments\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeReactionsPreview)\n\n\tvar comments []*RepositoryComment\n\tresp, err := s.client.Do(ctx, req, &comments)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn comments, resp, nil\n}\n\n// ListCommitComments lists all the comments for a given commit SHA.\n//\n// GitHub API docs: https://docs.github.com/rest/commits/comments#list-commit-comments\n//\n//meta:operation GET /repos/{owner}/{repo}/commits/{commit_sha}/comments\nfunc (s *RepositoriesService) ListCommitComments(ctx context.Context, owner, repo, sha string, opts *ListOptions) ([]*RepositoryComment, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/commits/%v/comments\", owner, repo, sha)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeReactionsPreview)\n\n\tvar comments []*RepositoryComment\n\tresp, err := s.client.Do(ctx, req, &comments)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn comments, resp, nil\n}\n\n// CreateComment creates a comment for the given commit.\n// Note: GitHub allows for comments to be created for non-existing files and positions.\n//\n// GitHub API docs: https://docs.github.com/rest/commits/comments#create-a-commit-comment\n//\n//meta:operation POST /repos/{owner}/{repo}/commits/{commit_sha}/comments\nfunc (s *RepositoriesService) CreateComment(ctx context.Context, owner, repo, sha string, comment *RepositoryComment) (*RepositoryComment, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/commits/%v/comments\", owner, repo, sha)\n\treq, err := s.client.NewRequest(\"POST\", u, comment)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar c *RepositoryComment\n\tresp, err := s.client.Do(ctx, req, &c)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn c, resp, nil\n}\n\n// GetComment gets a single comment from a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/commits/comments#get-a-commit-comment\n//\n//meta:operation GET /repos/{owner}/{repo}/comments/{comment_id}\nfunc (s *RepositoriesService) GetComment(ctx context.Context, owner, repo string, id int64) (*RepositoryComment, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/comments/%v\", owner, repo, id)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeReactionsPreview)\n\n\tvar c *RepositoryComment\n\tresp, err := s.client.Do(ctx, req, &c)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn c, resp, nil\n}\n\n// UpdateComment updates the body of a single comment.\n//\n// GitHub API docs: https://docs.github.com/rest/commits/comments#update-a-commit-comment\n//\n//meta:operation PATCH /repos/{owner}/{repo}/comments/{comment_id}\nfunc (s *RepositoriesService) UpdateComment(ctx context.Context, owner, repo string, id int64, comment *RepositoryComment) (*RepositoryComment, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/comments/%v\", owner, repo, id)\n\treq, err := s.client.NewRequest(\"PATCH\", u, comment)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar c *RepositoryComment\n\tresp, err := s.client.Do(ctx, req, &c)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn c, resp, nil\n}\n\n// DeleteComment deletes a single comment from a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/commits/comments#delete-a-commit-comment\n//\n//meta:operation DELETE /repos/{owner}/{repo}/comments/{comment_id}\nfunc (s *RepositoriesService) DeleteComment(ctx context.Context, owner, repo string, id int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/comments/%v\", owner, repo, id)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/repos_comments_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_ListComments(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/comments\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}, {\"id\":2}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tcomments, _, err := client.Repositories.ListComments(ctx, \"o\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListComments returned error: %v\", err)\n\t}\n\n\twant := []*RepositoryComment{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}}\n\tif !cmp.Equal(comments, want) {\n\t\tt.Errorf(\"Repositories.ListComments returned %+v, want %+v\", comments, want)\n\t}\n\n\tconst methodName = \"ListComments\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListComments(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListComments(ctx, \"o\", \"r\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListComments_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.ListComments(ctx, \"%\", \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoriesService_ListCommitComments(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/commits/s/comments\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}, {\"id\":2}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tcomments, _, err := client.Repositories.ListCommitComments(ctx, \"o\", \"r\", \"s\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListCommitComments returned error: %v\", err)\n\t}\n\n\twant := []*RepositoryComment{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}}\n\tif !cmp.Equal(comments, want) {\n\t\tt.Errorf(\"Repositories.ListCommitComments returned %+v, want %+v\", comments, want)\n\t}\n\n\tconst methodName = \"ListCommitComments\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListCommitComments(ctx, \"\\n\", \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListCommitComments(ctx, \"o\", \"r\", \"s\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListCommitComments_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.ListCommitComments(ctx, \"%\", \"%\", \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoriesService_CreateComment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &RepositoryComment{Body: Ptr(\"b\")}\n\n\tmux.HandleFunc(\"/repos/o/r/commits/s/comments\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *RepositoryComment\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tcomment, _, err := client.Repositories.CreateComment(ctx, \"o\", \"r\", \"s\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.CreateComment returned error: %v\", err)\n\t}\n\n\twant := &RepositoryComment{ID: Ptr(int64(1))}\n\tif !cmp.Equal(comment, want) {\n\t\tt.Errorf(\"Repositories.CreateComment returned %+v, want %+v\", comment, want)\n\t}\n\n\tconst methodName = \"CreateComment\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.CreateComment(ctx, \"\\n\", \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.CreateComment(ctx, \"o\", \"r\", \"s\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_CreateComment_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.CreateComment(ctx, \"%\", \"%\", \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoriesService_GetComment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/comments/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeReactionsPreview)\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tcomment, _, err := client.Repositories.GetComment(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetComment returned error: %v\", err)\n\t}\n\n\twant := &RepositoryComment{ID: Ptr(int64(1))}\n\tif !cmp.Equal(comment, want) {\n\t\tt.Errorf(\"Repositories.GetComment returned %+v, want %+v\", comment, want)\n\t}\n\n\tconst methodName = \"GetComment\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetComment(ctx, \"\\n\", \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetComment(ctx, \"o\", \"r\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetComment_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.GetComment(ctx, \"%\", \"%\", 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoriesService_UpdateComment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &RepositoryComment{Body: Ptr(\"b\")}\n\n\tmux.HandleFunc(\"/repos/o/r/comments/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *RepositoryComment\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tcomment, _, err := client.Repositories.UpdateComment(ctx, \"o\", \"r\", 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.UpdateComment returned error: %v\", err)\n\t}\n\n\twant := &RepositoryComment{ID: Ptr(int64(1))}\n\tif !cmp.Equal(comment, want) {\n\t\tt.Errorf(\"Repositories.UpdateComment returned %+v, want %+v\", comment, want)\n\t}\n\n\tconst methodName = \"UpdateComment\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.UpdateComment(ctx, \"\\n\", \"\\n\", -1, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.UpdateComment(ctx, \"o\", \"r\", 1, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_UpdateComment_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.UpdateComment(ctx, \"%\", \"%\", 1, nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoriesService_DeleteComment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/comments/1\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Repositories.DeleteComment(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.DeleteComment returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteComment\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.DeleteComment(ctx, \"\\n\", \"\\n\", 1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.DeleteComment(ctx, \"o\", \"r\", 1)\n\t})\n}\n\nfunc TestRepositoriesService_DeleteComment_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Repositories.DeleteComment(ctx, \"%\", \"%\", 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoryComment_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RepositoryComment{}, `{\"body\": null}`)\n\n\tr := &RepositoryComment{\n\t\tHTMLURL:  Ptr(\"hurl\"),\n\t\tURL:      Ptr(\"url\"),\n\t\tID:       Ptr(int64(1)),\n\t\tNodeID:   Ptr(\"nid\"),\n\t\tCommitID: Ptr(\"cid\"),\n\t\tUser: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t\tReactions: &Reactions{\n\t\t\tTotalCount: Ptr(1),\n\t\t\tPlusOne:    Ptr(1),\n\t\t\tMinusOne:   Ptr(1),\n\t\t\tLaugh:      Ptr(1),\n\t\t\tConfused:   Ptr(1),\n\t\t\tHeart:      Ptr(1),\n\t\t\tHooray:     Ptr(1),\n\t\t\tRocket:     Ptr(1),\n\t\t\tEyes:       Ptr(1),\n\t\t\tURL:        Ptr(\"u\"),\n\t\t},\n\t\tCreatedAt: &Timestamp{referenceTime},\n\t\tUpdatedAt: &Timestamp{referenceTime},\n\t\tBody:      Ptr(\"body\"),\n\t\tPath:      Ptr(\"path\"),\n\t\tPosition:  Ptr(1),\n\t}\n\n\twant := `{\n\t\t\"html_url\": \"hurl\",\n\t\t\"url\": \"url\",\n\t\t\"id\": 1,\n\t\t\"node_id\": \"nid\",\n\t\t\"commit_id\": \"cid\",\n\t\t\"user\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"reactions\": {\n\t\t\t\"total_count\": 1,\n\t\t\t\"+1\": 1,\n\t\t\t\"-1\": 1,\n\t\t\t\"laugh\": 1,\n\t\t\t\"confused\": 1,\n\t\t\t\"heart\": 1,\n\t\t\t\"hooray\": 1,\n\t\t\t\"rocket\": 1,\n\t\t\t\"eyes\": 1,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"body\": \"body\",\n\t\t\"path\": \"path\",\n\t\t\"position\": 1\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n"
  },
  {
    "path": "github/repos_commits.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"net/url\"\n\t\"time\"\n)\n\n// RepositoryCommit represents a commit in a repo.\n// Note that it's wrapping a Commit, so author/committer information is in two places,\n// but contain different details about them: in RepositoryCommit \"github details\", in Commit - \"git details\".\ntype RepositoryCommit struct {\n\tNodeID      *string   `json:\"node_id,omitempty\"`\n\tSHA         *string   `json:\"sha,omitempty\"`\n\tCommit      *Commit   `json:\"commit,omitempty\"`\n\tAuthor      *User     `json:\"author,omitempty\"`\n\tCommitter   *User     `json:\"committer,omitempty\"`\n\tParents     []*Commit `json:\"parents,omitempty\"`\n\tHTMLURL     *string   `json:\"html_url,omitempty\"`\n\tURL         *string   `json:\"url,omitempty\"`\n\tCommentsURL *string   `json:\"comments_url,omitempty\"`\n\n\t// Details about how many changes were made in this commit. Only filled in during GetCommit!\n\tStats *CommitStats `json:\"stats,omitempty\"`\n\t// Details about which files, and how this commit touched. Only filled in during GetCommit!\n\tFiles []*CommitFile `json:\"files,omitempty\"`\n}\n\nfunc (r RepositoryCommit) String() string {\n\treturn Stringify(r)\n}\n\n// CommitStats represents the number of additions / deletions from a file in a given RepositoryCommit or GistCommit.\ntype CommitStats struct {\n\tAdditions *int `json:\"additions,omitempty\"`\n\tDeletions *int `json:\"deletions,omitempty\"`\n\tTotal     *int `json:\"total,omitempty\"`\n}\n\nfunc (c CommitStats) String() string {\n\treturn Stringify(c)\n}\n\n// CommitFile represents a file modified in a commit.\ntype CommitFile struct {\n\tSHA              *string `json:\"sha,omitempty\"`\n\tFilename         *string `json:\"filename,omitempty\"`\n\tAdditions        *int    `json:\"additions,omitempty\"`\n\tDeletions        *int    `json:\"deletions,omitempty\"`\n\tChanges          *int    `json:\"changes,omitempty\"`\n\tStatus           *string `json:\"status,omitempty\"`\n\tPatch            *string `json:\"patch,omitempty\"`\n\tBlobURL          *string `json:\"blob_url,omitempty\"`\n\tRawURL           *string `json:\"raw_url,omitempty\"`\n\tContentsURL      *string `json:\"contents_url,omitempty\"`\n\tPreviousFilename *string `json:\"previous_filename,omitempty\"`\n}\n\nfunc (c CommitFile) String() string {\n\treturn Stringify(c)\n}\n\n// CommitsComparison is the result of comparing two commits.\n// See CompareCommits() for details.\ntype CommitsComparison struct {\n\tBaseCommit      *RepositoryCommit `json:\"base_commit,omitempty\"`\n\tMergeBaseCommit *RepositoryCommit `json:\"merge_base_commit,omitempty\"`\n\n\t// Head can be 'behind' or 'ahead'\n\tStatus       *string `json:\"status,omitempty\"`\n\tAheadBy      *int    `json:\"ahead_by,omitempty\"`\n\tBehindBy     *int    `json:\"behind_by,omitempty\"`\n\tTotalCommits *int    `json:\"total_commits,omitempty\"`\n\n\tCommits []*RepositoryCommit `json:\"commits,omitempty\"`\n\n\tFiles []*CommitFile `json:\"files,omitempty\"`\n\n\tHTMLURL      *string `json:\"html_url,omitempty\"`\n\tPermalinkURL *string `json:\"permalink_url,omitempty\"`\n\tDiffURL      *string `json:\"diff_url,omitempty\"`\n\tPatchURL     *string `json:\"patch_url,omitempty\"`\n\tURL          *string `json:\"url,omitempty\"` // API URL.\n}\n\nfunc (c CommitsComparison) String() string {\n\treturn Stringify(c)\n}\n\n// CommitsListOptions specifies the optional parameters to the\n// RepositoriesService.ListCommits method.\ntype CommitsListOptions struct {\n\t// SHA or branch to start listing Commits from.\n\tSHA string `url:\"sha,omitempty\"`\n\n\t// Path that should be touched by the returned Commits.\n\tPath string `url:\"path,omitempty\"`\n\n\t// Author of by which to filter Commits.\n\tAuthor string `url:\"author,omitempty\"`\n\n\t// Since when should Commits be included in the response.\n\tSince time.Time `url:\"since,omitempty\"`\n\n\t// Until when should Commits be included in the response.\n\tUntil time.Time `url:\"until,omitempty\"`\n\n\tListOptions\n}\n\n// BranchCommit is the result of listing branches with commit SHA.\ntype BranchCommit struct {\n\tName      *string `json:\"name,omitempty\"`\n\tCommit    *Commit `json:\"commit,omitempty\"`\n\tProtected *bool   `json:\"protected,omitempty\"`\n}\n\n// ListCommits lists the commits of a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/commits/commits#list-commits\n//\n//meta:operation GET /repos/{owner}/{repo}/commits\nfunc (s *RepositoriesService) ListCommits(ctx context.Context, owner, repo string, opts *CommitsListOptions) ([]*RepositoryCommit, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/commits\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar commits []*RepositoryCommit\n\tresp, err := s.client.Do(ctx, req, &commits)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn commits, resp, nil\n}\n\n// GetCommit fetches the specified commit, including all details about it.\n//\n// GitHub API docs: https://docs.github.com/rest/commits/commits#get-a-commit\n//\n//meta:operation GET /repos/{owner}/{repo}/commits/{ref}\nfunc (s *RepositoriesService) GetCommit(ctx context.Context, owner, repo, sha string, opts *ListOptions) (*RepositoryCommit, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/commits/%v\", owner, repo, sha)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar commit *RepositoryCommit\n\tresp, err := s.client.Do(ctx, req, &commit)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn commit, resp, nil\n}\n\n// GetCommitRaw fetches the specified commit in raw (diff or patch) format.\n//\n// GitHub API docs: https://docs.github.com/rest/commits/commits#get-a-commit\n//\n//meta:operation GET /repos/{owner}/{repo}/commits/{ref}\nfunc (s *RepositoriesService) GetCommitRaw(ctx context.Context, owner, repo, sha string, opts RawOptions) (string, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/commits/%v\", owner, repo, sha)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn \"\", nil, err\n\t}\n\n\tswitch opts.Type {\n\tcase Diff:\n\t\treq.Header.Set(\"Accept\", mediaTypeV3Diff)\n\tcase Patch:\n\t\treq.Header.Set(\"Accept\", mediaTypeV3Patch)\n\tdefault:\n\t\treturn \"\", nil, fmt.Errorf(\"unsupported raw type %v\", opts.Type)\n\t}\n\n\tvar buf bytes.Buffer\n\tresp, err := s.client.Do(ctx, req, &buf)\n\tif err != nil {\n\t\treturn \"\", resp, err\n\t}\n\n\treturn buf.String(), resp, nil\n}\n\n// GetCommitSHA1 gets the SHA-1 of a commit reference. If a last-known SHA1 is\n// supplied and no new commits have occurred, a 304 Unmodified response is returned.\n//\n// GitHub API docs: https://docs.github.com/rest/commits/commits#get-a-commit\n//\n//meta:operation GET /repos/{owner}/{repo}/commits/{ref}\nfunc (s *RepositoriesService) GetCommitSHA1(ctx context.Context, owner, repo, ref, lastSHA string) (string, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/commits/%v\", owner, repo, refURLEscape(ref))\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn \"\", nil, err\n\t}\n\tif lastSHA != \"\" {\n\t\treq.Header.Set(\"If-None-Match\", `\"`+lastSHA+`\"`)\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeV3SHA)\n\n\tvar buf bytes.Buffer\n\tresp, err := s.client.Do(ctx, req, &buf)\n\tif err != nil {\n\t\treturn \"\", resp, err\n\t}\n\n\treturn buf.String(), resp, nil\n}\n\n// CompareCommits compares a range of commits with each other.\n//\n// GitHub API docs: https://docs.github.com/rest/commits/commits#compare-two-commits\n//\n//meta:operation GET /repos/{owner}/{repo}/compare/{basehead}\nfunc (s *RepositoriesService) CompareCommits(ctx context.Context, owner, repo, base, head string, opts *ListOptions) (*CommitsComparison, *Response, error) {\n\tescapedBase := url.QueryEscape(base)\n\tescapedHead := url.QueryEscape(head)\n\n\tu := fmt.Sprintf(\"repos/%v/%v/compare/%v...%v\", owner, repo, escapedBase, escapedHead)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar comp *CommitsComparison\n\tresp, err := s.client.Do(ctx, req, &comp)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn comp, resp, nil\n}\n\n// CompareCommitsRaw compares a range of commits with each other in raw (diff or patch) format.\n//\n// Both \"base\" and \"head\" must be branch names in \"repo\".\n// To compare branches across other repositories in the same network as \"repo\",\n// use the format \"<USERNAME>:branch\".\n//\n// GitHub API docs: https://docs.github.com/rest/commits/commits#compare-two-commits\n//\n//meta:operation GET /repos/{owner}/{repo}/compare/{basehead}\nfunc (s *RepositoriesService) CompareCommitsRaw(ctx context.Context, owner, repo, base, head string, opts RawOptions) (string, *Response, error) {\n\tescapedBase := url.QueryEscape(base)\n\tescapedHead := url.QueryEscape(head)\n\n\tu := fmt.Sprintf(\"repos/%v/%v/compare/%v...%v\", owner, repo, escapedBase, escapedHead)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn \"\", nil, err\n\t}\n\n\tswitch opts.Type {\n\tcase Diff:\n\t\treq.Header.Set(\"Accept\", mediaTypeV3Diff)\n\tcase Patch:\n\t\treq.Header.Set(\"Accept\", mediaTypeV3Patch)\n\tdefault:\n\t\treturn \"\", nil, fmt.Errorf(\"unsupported raw type %v\", opts.Type)\n\t}\n\n\tvar buf bytes.Buffer\n\tresp, err := s.client.Do(ctx, req, &buf)\n\tif err != nil {\n\t\treturn \"\", resp, err\n\t}\n\n\treturn buf.String(), resp, nil\n}\n\n// ListBranchesHeadCommit gets all branches where the given commit SHA is the HEAD,\n// or latest commit for the branch.\n//\n// GitHub API docs: https://docs.github.com/rest/commits/commits#list-branches-for-head-commit\n//\n//meta:operation GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head\nfunc (s *RepositoriesService) ListBranchesHeadCommit(ctx context.Context, owner, repo, sha string) ([]*BranchCommit, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/commits/%v/branches-where-head\", owner, repo, sha)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeListPullsOrBranchesForCommitPreview)\n\tvar branchCommits []*BranchCommit\n\tresp, err := s.client.Do(ctx, req, &branchCommits)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn branchCommits, resp, nil\n}\n"
  },
  {
    "path": "github/repos_commits_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_ListCommits(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\t// given\n\tmux.HandleFunc(\"/repos/o/r/commits\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r,\n\t\t\tvalues{\n\t\t\t\t\"sha\":    \"s\",\n\t\t\t\t\"path\":   \"p\",\n\t\t\t\t\"author\": \"a\",\n\t\t\t\t\"since\":  \"2013-08-01T00:00:00Z\",\n\t\t\t\t\"until\":  \"2013-09-03T00:00:00Z\",\n\t\t\t})\n\t\tfmt.Fprint(w, `[{\"sha\": \"s\"}]`)\n\t})\n\n\topt := &CommitsListOptions{\n\t\tSHA:    \"s\",\n\t\tPath:   \"p\",\n\t\tAuthor: \"a\",\n\t\tSince:  time.Date(2013, time.August, 1, 0, 0, 0, 0, time.UTC),\n\t\tUntil:  time.Date(2013, time.September, 3, 0, 0, 0, 0, time.UTC),\n\t}\n\tctx := t.Context()\n\tcommits, _, err := client.Repositories.ListCommits(ctx, \"o\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListCommits returned error: %v\", err)\n\t}\n\n\twant := []*RepositoryCommit{{SHA: Ptr(\"s\")}}\n\tif !cmp.Equal(commits, want) {\n\t\tt.Errorf(\"Repositories.ListCommits returned %+v, want %+v\", commits, want)\n\t}\n\n\tconst methodName = \"ListCommits\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListCommits(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListCommits(ctx, \"o\", \"r\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetCommit(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/commits/s\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `{\n\t\t  \"sha\": \"s\",\n\t\t  \"commit\": { \"message\": \"m\" },\n\t\t  \"author\": { \"login\": \"l\" },\n\t\t  \"committer\": { \"login\": \"l\" },\n\t\t  \"parents\": [ { \"sha\": \"s\" } ],\n\t\t  \"stats\": { \"additions\": 104, \"deletions\": 4, \"total\": 108 },\n\t\t  \"files\": [\n\t\t    {\n\t\t      \"filename\": \"f\",\n\t\t      \"additions\": 10,\n\t\t      \"deletions\": 2,\n\t\t      \"changes\": 12,\n\t\t      \"status\": \"s\",\n\t\t      \"patch\": \"p\",\n\t\t      \"blob_url\": \"b\",\n\t\t      \"raw_url\": \"r\",\n\t\t      \"contents_url\": \"c\"\n\t\t    }\n\t\t  ]\n\t\t}`)\n\t})\n\n\topts := &ListOptions{Page: 2, PerPage: 2}\n\tctx := t.Context()\n\tcommit, _, err := client.Repositories.GetCommit(ctx, \"o\", \"r\", \"s\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetCommit returned error: %v\", err)\n\t}\n\n\twant := &RepositoryCommit{\n\t\tSHA: Ptr(\"s\"),\n\t\tCommit: &Commit{\n\t\t\tMessage: Ptr(\"m\"),\n\t\t},\n\t\tAuthor: &User{\n\t\t\tLogin: Ptr(\"l\"),\n\t\t},\n\t\tCommitter: &User{\n\t\t\tLogin: Ptr(\"l\"),\n\t\t},\n\t\tParents: []*Commit{\n\t\t\t{\n\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t},\n\t\t},\n\t\tStats: &CommitStats{\n\t\t\tAdditions: Ptr(104),\n\t\t\tDeletions: Ptr(4),\n\t\t\tTotal:     Ptr(108),\n\t\t},\n\t\tFiles: []*CommitFile{\n\t\t\t{\n\t\t\t\tFilename:    Ptr(\"f\"),\n\t\t\t\tAdditions:   Ptr(10),\n\t\t\t\tDeletions:   Ptr(2),\n\t\t\t\tChanges:     Ptr(12),\n\t\t\t\tStatus:      Ptr(\"s\"),\n\t\t\t\tPatch:       Ptr(\"p\"),\n\t\t\t\tBlobURL:     Ptr(\"b\"),\n\t\t\t\tRawURL:      Ptr(\"r\"),\n\t\t\t\tContentsURL: Ptr(\"c\"),\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(commit, want) {\n\t\tt.Errorf(\"Repositories.GetCommit returned \\n%+v, want \\n%+v\", commit, want)\n\t}\n\n\tconst methodName = \"GetCommit\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetCommit(ctx, \"\\n\", \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetCommit(ctx, \"o\", \"r\", \"s\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetCommitRaw_diff(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tconst rawStr = \"@@diff content\"\n\n\tmux.HandleFunc(\"/repos/o/r/commits/s\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeV3Diff)\n\t\tfmt.Fprint(w, rawStr)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.GetCommitRaw(ctx, \"o\", \"r\", \"s\", RawOptions{Type: Diff})\n\tif err != nil {\n\t\tt.Fatalf(\"Repositories.GetCommitRaw returned error: %v\", err)\n\t}\n\twant := rawStr\n\tif got != want {\n\t\tt.Errorf(\"Repositories.GetCommitRaw returned %v want %v\", got, want)\n\t}\n\n\tconst methodName = \"GetCommitRaw\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetCommitRaw(ctx, \"\\n\", \"\\n\", \"\\n\", RawOptions{Type: Diff})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetCommitRaw(ctx, \"o\", \"r\", \"s\", RawOptions{Type: Diff})\n\t\tif got != \"\" {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want ''\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetCommitRaw_patch(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tconst rawStr = \"@@patch content\"\n\n\tmux.HandleFunc(\"/repos/o/r/commits/s\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeV3Patch)\n\t\tfmt.Fprint(w, rawStr)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.GetCommitRaw(ctx, \"o\", \"r\", \"s\", RawOptions{Type: Patch})\n\tif err != nil {\n\t\tt.Fatalf(\"Repositories.GetCommitRaw returned error: %v\", err)\n\t}\n\twant := rawStr\n\tif got != want {\n\t\tt.Errorf(\"Repositories.GetCommitRaw returned %v want %v\", got, want)\n\t}\n}\n\nfunc TestRepositoriesService_GetCommitRaw_invalid(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.GetCommitRaw(ctx, \"o\", \"r\", \"s\", RawOptions{100})\n\tif err == nil {\n\t\tt.Fatal(\"Repositories.GetCommitRaw should return error\")\n\t}\n\tif !strings.Contains(err.Error(), \"unsupported raw type\") {\n\t\tt.Error(\"Repositories.GetCommitRaw should return unsupported raw type error\")\n\t}\n}\n\nfunc TestRepositoriesService_GetCommitSHA1(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tconst sha1 = \"01234abcde\"\n\n\tmux.HandleFunc(\"/repos/o/r/commits/master\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeV3SHA)\n\n\t\tfmt.Fprint(w, sha1)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.GetCommitSHA1(ctx, \"o\", \"r\", \"master\", \"\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetCommitSHA1 returned error: %v\", err)\n\t}\n\n\twant := sha1\n\tif got != want {\n\t\tt.Errorf(\"Repositories.GetCommitSHA1 = %v, want %v\", got, want)\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/commits/tag\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeV3SHA)\n\t\ttestHeader(t, r, \"If-None-Match\", `\"`+sha1+`\"`)\n\n\t\tw.WriteHeader(http.StatusNotModified)\n\t})\n\n\tgot, _, err = client.Repositories.GetCommitSHA1(ctx, \"o\", \"r\", \"tag\", sha1)\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 304 response\")\n\t}\n\n\twant = \"\"\n\tif got != want {\n\t\tt.Errorf(\"Repositories.GetCommitSHA1 = %v, want %v\", got, want)\n\t}\n\n\tconst methodName = \"GetCommitSHA1\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetCommitSHA1(ctx, \"\\n\", \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetCommitSHA1(ctx, \"o\", \"r\", \"master\", \"\")\n\t\tif got != \"\" {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want ''\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_NonAlphabetCharacter_GetCommitSHA1(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tconst sha1 = \"01234abcde\"\n\n\tmux.HandleFunc(\"/repos/o/r/commits/master%2520hash\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeV3SHA)\n\n\t\tfmt.Fprint(w, sha1)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.GetCommitSHA1(ctx, \"o\", \"r\", \"master%20hash\", \"\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetCommitSHA1 returned error: %v\", err)\n\t}\n\n\tif want := sha1; got != want {\n\t\tt.Errorf(\"Repositories.GetCommitSHA1 = %v, want %v\", got, want)\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/commits/tag\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeV3SHA)\n\t\ttestHeader(t, r, \"If-None-Match\", `\"`+sha1+`\"`)\n\n\t\tw.WriteHeader(http.StatusNotModified)\n\t})\n\n\tgot, _, err = client.Repositories.GetCommitSHA1(ctx, \"o\", \"r\", \"tag\", sha1)\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 304 response\")\n\t}\n\n\tif want := \"\"; got != want {\n\t\tt.Errorf(\"Repositories.GetCommitSHA1 = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestRepositoriesService_TrailingPercent_GetCommitSHA1(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tconst sha1 = \"01234abcde\"\n\n\tmux.HandleFunc(\"/repos/o/r/commits/comm%\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeV3SHA)\n\n\t\tfmt.Fprint(w, sha1)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.GetCommitSHA1(ctx, \"o\", \"r\", \"comm%\", \"\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetCommitSHA1 returned error: %v\", err)\n\t}\n\n\tif want := sha1; got != want {\n\t\tt.Errorf(\"Repositories.GetCommitSHA1 = %v, want %v\", got, want)\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/commits/tag\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeV3SHA)\n\t\ttestHeader(t, r, \"If-None-Match\", `\"`+sha1+`\"`)\n\n\t\tw.WriteHeader(http.StatusNotModified)\n\t})\n\n\tgot, _, err = client.Repositories.GetCommitSHA1(ctx, \"o\", \"r\", \"tag\", sha1)\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 304 response\")\n\t}\n\n\tif want := \"\"; got != want {\n\t\tt.Errorf(\"Repositories.GetCommitSHA1 = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestRepositoriesService_CompareCommits(t *testing.T) {\n\tt.Parallel()\n\ttestCases := []struct {\n\t\tbase string\n\t\thead string\n\t}{\n\t\t{base: \"b\", head: \"h\"},\n\t\t{base: \"123base\", head: \"head123\"},\n\t\t{base: \"`~!@#$%^&*()_+-=[]\\\\{}|;':\\\",./<>?/*-+123base\", head: \"head123`~!@#$%^&*()_+-=[]\\\\{}|;':\\\",./<>?/*-+\"},\n\t}\n\n\tfor i, sample := range testCases {\n\t\tt.Run(fmt.Sprintf(\"case #%v\", i+1), func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tbase := sample.base\n\t\t\thead := sample.head\n\n\t\t\tencodedBase := url.PathEscape(base)\n\t\t\tencodedHead := url.PathEscape(head)\n\n\t\t\tescapedBase := url.QueryEscape(base)\n\t\t\tescapedHead := url.QueryEscape(head)\n\n\t\t\tpattern := fmt.Sprintf(\"/repos/o/r/compare/%v...%v\", encodedBase, encodedHead)\n\n\t\t\tmux.HandleFunc(pattern, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\ttestFormValues(t, r, values{\"per_page\": \"2\", \"page\": \"2\"})\n\t\t\t\tfmt.Fprintf(w, `{\n  \"base_commit\": {\n    \"sha\": \"s\",\n    \"commit\": {\n      \"author\": { \"name\": \"n\" },\n      \"committer\": { \"name\": \"n\" },\n      \"message\": \"m\",\n      \"tree\": { \"sha\": \"t\" }\n    },\n    \"author\": { \"login\": \"l\" },\n    \"committer\": { \"login\": \"l\" },\n    \"parents\": [ { \"sha\": \"s\" } ]\n  },\n  \"status\": \"s\",\n  \"ahead_by\": 1,\n  \"behind_by\": 2,\n  \"total_commits\": 1,\n  \"commits\": [\n    {\n      \"sha\": \"s\",\n      \"commit\": { \"author\": { \"name\": \"n\" } },\n      \"author\": { \"login\": \"l\" },\n      \"committer\": { \"login\": \"l\" },\n      \"parents\": [ { \"sha\": \"s\" } ]\n    }\n  ],\n  \"files\": [ { \"filename\": \"f\" } ],\n  \"html_url\":      \"https://github.com/o/r/compare/%[1]v...%[2]v\",\n  \"permalink_url\": \"https://github.com/o/r/compare/o:bbcd538c8e72b8c175046e27cc8f907076331401...o:0328041d1152db8ae77652d1618a02e57f745f17\",\n  \"diff_url\":      \"https://github.com/o/r/compare/%[1]v...%[2]v.diff\",\n  \"patch_url\":     \"https://github.com/o/r/compare/%[1]v...%[2]v.patch\",\n  \"url\":           \"https://api.github.com/repos/o/r/compare/%[1]v...%[2]v\"\n}`, escapedBase, escapedHead)\n\t\t\t})\n\n\t\t\topts := &ListOptions{Page: 2, PerPage: 2}\n\t\t\tctx := t.Context()\n\t\t\tgot, _, err := client.Repositories.CompareCommits(ctx, \"o\", \"r\", base, head, opts)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.CompareCommits returned error: %v\", err)\n\t\t\t}\n\n\t\t\twant := &CommitsComparison{\n\t\t\t\tBaseCommit: &RepositoryCommit{\n\t\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\t\tCommit: &Commit{\n\t\t\t\t\t\tAuthor:    &CommitAuthor{Name: Ptr(\"n\")},\n\t\t\t\t\t\tCommitter: &CommitAuthor{Name: Ptr(\"n\")},\n\t\t\t\t\t\tMessage:   Ptr(\"m\"),\n\t\t\t\t\t\tTree:      &Tree{SHA: Ptr(\"t\")},\n\t\t\t\t\t},\n\t\t\t\t\tAuthor:    &User{Login: Ptr(\"l\")},\n\t\t\t\t\tCommitter: &User{Login: Ptr(\"l\")},\n\t\t\t\t\tParents: []*Commit{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tStatus:       Ptr(\"s\"),\n\t\t\t\tAheadBy:      Ptr(1),\n\t\t\t\tBehindBy:     Ptr(2),\n\t\t\t\tTotalCommits: Ptr(1),\n\t\t\t\tCommits: []*RepositoryCommit{\n\t\t\t\t\t{\n\t\t\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\t\t\tCommit: &Commit{\n\t\t\t\t\t\t\tAuthor: &CommitAuthor{Name: Ptr(\"n\")},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tAuthor:    &User{Login: Ptr(\"l\")},\n\t\t\t\t\t\tCommitter: &User{Login: Ptr(\"l\")},\n\t\t\t\t\t\tParents: []*Commit{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tFiles: []*CommitFile{\n\t\t\t\t\t{\n\t\t\t\t\t\tFilename: Ptr(\"f\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tHTMLURL:      Ptr(fmt.Sprintf(\"https://github.com/o/r/compare/%v...%v\", escapedBase, escapedHead)),\n\t\t\t\tPermalinkURL: Ptr(\"https://github.com/o/r/compare/o:bbcd538c8e72b8c175046e27cc8f907076331401...o:0328041d1152db8ae77652d1618a02e57f745f17\"),\n\t\t\t\tDiffURL:      Ptr(fmt.Sprintf(\"https://github.com/o/r/compare/%v...%v.diff\", escapedBase, escapedHead)),\n\t\t\t\tPatchURL:     Ptr(fmt.Sprintf(\"https://github.com/o/r/compare/%v...%v.patch\", escapedBase, escapedHead)),\n\t\t\t\tURL:          Ptr(fmt.Sprintf(\"https://api.github.com/repos/o/r/compare/%v...%v\", escapedBase, escapedHead)),\n\t\t\t}\n\n\t\t\tif !cmp.Equal(got, want) {\n\t\t\t\tt.Errorf(\"Repositories.CompareCommits returned \\n%+v, want \\n%+v\", got, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"CompareCommits\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.CompareCommits(ctx, \"\\n\", \"\\n\", \"\\n\", \"\\n\", opts)\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := client.Repositories.CompareCommits(ctx, \"o\", \"r\", base, head, opts)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_CompareCommitsRaw_diff(t *testing.T) {\n\tt.Parallel()\n\ttestCases := []struct {\n\t\tbase string\n\t\thead string\n\t}{\n\t\t{base: \"b\", head: \"h\"},\n\t\t{base: \"123base\", head: \"head123\"},\n\t\t{base: \"`~!@#$%^&*()_+-=[]\\\\{}|;':\\\",./<>?/*-+123base\", head: \"head123`~!@#$%^&*()_+-=[]\\\\{}|;':\\\",./<>?/*-+\"},\n\t}\n\n\tfor i, sample := range testCases {\n\t\tt.Run(fmt.Sprintf(\"case #%v\", i+1), func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tbase := sample.base\n\t\t\thead := sample.head\n\n\t\t\tencodedBase := url.PathEscape(base)\n\t\t\tencodedHead := url.PathEscape(head)\n\n\t\t\tpattern := fmt.Sprintf(\"/repos/o/r/compare/%v...%v\", encodedBase, encodedHead)\n\t\t\tconst rawStr = \"@@diff content\"\n\n\t\t\tmux.HandleFunc(pattern, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\ttestHeader(t, r, \"Accept\", mediaTypeV3Diff)\n\t\t\t\tfmt.Fprint(w, rawStr)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\tgot, _, err := client.Repositories.CompareCommitsRaw(ctx, \"o\", \"r\", base, head, RawOptions{Type: Diff})\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"Repositories.GetCommitRaw returned error: %v\", err)\n\t\t\t}\n\t\t\twant := rawStr\n\t\t\tif got != want {\n\t\t\t\tt.Errorf(\"Repositories.GetCommitRaw returned %v want %v\", got, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"CompareCommitsRaw\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.CompareCommitsRaw(ctx, \"\\n\", \"\\n\", \"\\n\", \"\\n\", RawOptions{Type: Diff})\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := client.Repositories.CompareCommitsRaw(ctx, \"o\", \"r\", base, head, RawOptions{Type: Diff})\n\t\t\t\tif got != \"\" {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want ''\", methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_CompareCommitsRaw_patch(t *testing.T) {\n\tt.Parallel()\n\ttestCases := []struct {\n\t\tbase string\n\t\thead string\n\t}{\n\t\t{base: \"b\", head: \"h\"},\n\t\t{base: \"123base\", head: \"head123\"},\n\t\t{base: \"`~!@#$%^&*()_+-=[]\\\\{}|;':\\\",./<>?/*-+123base\", head: \"head123`~!@#$%^&*()_+-=[]\\\\{}|;':\\\",./<>?/*-+\"},\n\t}\n\n\tfor i, sample := range testCases {\n\t\tt.Run(fmt.Sprintf(\"case #%v\", i+1), func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tbase := sample.base\n\t\t\thead := sample.head\n\n\t\t\tencodedBase := url.PathEscape(base)\n\t\t\tencodedHead := url.PathEscape(head)\n\n\t\t\tpattern := fmt.Sprintf(\"/repos/o/r/compare/%v...%v\", encodedBase, encodedHead)\n\t\t\tconst rawStr = \"@@patch content\"\n\n\t\t\tmux.HandleFunc(pattern, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\ttestHeader(t, r, \"Accept\", mediaTypeV3Patch)\n\t\t\t\tfmt.Fprint(w, rawStr)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\tgot, _, err := client.Repositories.CompareCommitsRaw(ctx, \"o\", \"r\", base, head, RawOptions{Type: Patch})\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"Repositories.GetCommitRaw returned error: %v\", err)\n\t\t\t}\n\t\t\twant := rawStr\n\t\t\tif got != want {\n\t\t\t\tt.Errorf(\"Repositories.GetCommitRaw returned %v want %v\", got, want)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_CompareCommitsRaw_invalid(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\n\ttestCases := []struct {\n\t\tbase string\n\t\thead string\n\t}{\n\t\t{base: \"b\", head: \"h\"},\n\t\t{base: \"123base\", head: \"head123\"},\n\t\t{base: \"`~!@#$%^&*()_+-=[]\\\\{}|;':\\\",./<>?/*-+123base\", head: \"head123`~!@#$%^&*()_+-=[]\\\\{}|;':\\\",./<>?/*-+\"},\n\t}\n\n\tfor i, sample := range testCases {\n\t\tt.Run(fmt.Sprintf(\"case #%v\", i+1), func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, _, _ := setup(t)\n\t\t\t_, _, err := client.Repositories.CompareCommitsRaw(ctx, \"o\", \"r\", sample.base, sample.head, RawOptions{100})\n\t\t\tif err == nil {\n\t\t\t\tt.Fatal(\"Repositories.GetCommitRaw should return error\")\n\t\t\t}\n\t\t\tif !strings.Contains(err.Error(), \"unsupported raw type\") {\n\t\t\t\tt.Error(\"Repositories.GetCommitRaw should return unsupported raw type error\")\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_ListBranchesHeadCommit(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/commits/s/branches-where-head\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"name\": \"b\",\"commit\":{\"sha\":\"2e90302801c870f17b6152327d9b9a03c8eca0e2\",\"url\":\"https://api.github.com/repos/google/go-github/commits/2e90302801c870f17b6152327d9b9a03c8eca0e2\"},\"protected\":true}]`)\n\t})\n\n\tctx := t.Context()\n\tbranches, _, err := client.Repositories.ListBranchesHeadCommit(ctx, \"o\", \"r\", \"s\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListBranchesHeadCommit returned error: %v\", err)\n\t}\n\n\twant := []*BranchCommit{\n\t\t{\n\t\t\tName: Ptr(\"b\"),\n\t\t\tCommit: &Commit{\n\t\t\t\tSHA: Ptr(\"2e90302801c870f17b6152327d9b9a03c8eca0e2\"),\n\t\t\t\tURL: Ptr(\"https://api.github.com/repos/google/go-github/commits/2e90302801c870f17b6152327d9b9a03c8eca0e2\"),\n\t\t\t},\n\t\t\tProtected: Ptr(true),\n\t\t},\n\t}\n\tif !cmp.Equal(branches, want) {\n\t\tt.Errorf(\"Repositories.ListBranchesHeadCommit returned %+v, want %+v\", branches, want)\n\t}\n\n\tconst methodName = \"ListBranchesHeadCommit\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListBranchesHeadCommit(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListBranchesHeadCommit(ctx, \"o\", \"r\", \"s\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestBranchCommit_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &BranchCommit{}, \"{}\")\n\n\tr := &BranchCommit{\n\t\tName: Ptr(\"n\"),\n\t\tCommit: &Commit{\n\t\t\tSHA: Ptr(\"s\"),\n\t\t\tAuthor: &CommitAuthor{\n\t\t\t\tDate:  &Timestamp{referenceTime},\n\t\t\t\tName:  Ptr(\"n\"),\n\t\t\t\tEmail: Ptr(\"e\"),\n\t\t\t\tLogin: Ptr(\"u\"),\n\t\t\t},\n\t\t\tCommitter: &CommitAuthor{\n\t\t\t\tDate:  &Timestamp{referenceTime},\n\t\t\t\tName:  Ptr(\"n\"),\n\t\t\t\tEmail: Ptr(\"e\"),\n\t\t\t\tLogin: Ptr(\"u\"),\n\t\t\t},\n\t\t\tMessage: Ptr(\"m\"),\n\t\t\tTree: &Tree{\n\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\tEntries: []*TreeEntry{{\n\t\t\t\t\tSHA:     Ptr(\"s\"),\n\t\t\t\t\tPath:    Ptr(\"p\"),\n\t\t\t\t\tMode:    Ptr(\"m\"),\n\t\t\t\t\tType:    Ptr(\"t\"),\n\t\t\t\t\tSize:    Ptr(1),\n\t\t\t\t\tContent: Ptr(\"c\"),\n\t\t\t\t\tURL:     Ptr(\"u\"),\n\t\t\t\t}},\n\t\t\t\tTruncated: Ptr(false),\n\t\t\t},\n\t\t\tParents: nil,\n\t\t\tHTMLURL: Ptr(\"h\"),\n\t\t\tURL:     Ptr(\"u\"),\n\t\t\tVerification: &SignatureVerification{\n\t\t\t\tVerified:  Ptr(false),\n\t\t\t\tReason:    Ptr(\"r\"),\n\t\t\t\tSignature: Ptr(\"s\"),\n\t\t\t\tPayload:   Ptr(\"p\"),\n\t\t\t},\n\t\t\tNodeID:       Ptr(\"n\"),\n\t\t\tCommentCount: Ptr(1),\n\t\t},\n\t\tProtected: Ptr(false),\n\t}\n\n\twant := `{\n\t\t\"name\": \"n\",\n\t\t\"commit\": {\n\t\t\t\"sha\": \"s\",\n\t\t\t\"author\": {\n\t\t\t\t\"date\": ` + referenceTimeStr + `,\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"username\": \"u\"\n\t\t\t},\n\t\t\t\"committer\": {\n\t\t\t\t\"date\": ` + referenceTimeStr + `,\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"username\": \"u\"\n\t\t\t},\n\t\t\t\"message\": \"m\",\n\t\t\t\"tree\": {\n\t\t\t\t\"sha\": \"s\",\n\t\t\t\t\"tree\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"sha\": \"s\",\n\t\t\t\t\t\t\"path\": \"p\",\n\t\t\t\t\t\t\"mode\": \"m\",\n\t\t\t\t\t\t\"type\": \"t\",\n\t\t\t\t\t\t\"size\": 1,\n\t\t\t\t\t\t\"content\": \"c\",\n\t\t\t\t\t\t\"url\": \"u\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"truncated\": false\n\t\t\t},\n\t\t\t\"html_url\": \"h\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"verification\": {\n\t\t\t\t\"verified\": false,\n\t\t\t\t\"reason\": \"r\",\n\t\t\t\t\"signature\": \"s\",\n\t\t\t\t\"payload\": \"p\"\n\t\t\t},\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"comment_count\": 1\n\t\t},\n\t\t\"protected\": false\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n\nfunc TestCommitsComparison_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CommitsComparison{}, \"{}\")\n\n\tr := &CommitsComparison{\n\t\tBaseCommit:      &RepositoryCommit{NodeID: Ptr(\"nid\")},\n\t\tMergeBaseCommit: &RepositoryCommit{NodeID: Ptr(\"nid\")},\n\t\tStatus:          Ptr(\"status\"),\n\t\tAheadBy:         Ptr(1),\n\t\tBehindBy:        Ptr(1),\n\t\tTotalCommits:    Ptr(1),\n\t\tCommits: []*RepositoryCommit{\n\t\t\t{\n\t\t\t\tNodeID: Ptr(\"nid\"),\n\t\t\t},\n\t\t},\n\t\tFiles: []*CommitFile{\n\t\t\t{\n\t\t\t\tSHA: Ptr(\"sha\"),\n\t\t\t},\n\t\t},\n\t\tHTMLURL:      Ptr(\"hurl\"),\n\t\tPermalinkURL: Ptr(\"purl\"),\n\t\tDiffURL:      Ptr(\"durl\"),\n\t\tPatchURL:     Ptr(\"purl\"),\n\t\tURL:          Ptr(\"url\"),\n\t}\n\n\twant := `{\n\t\t\"base_commit\": {\n\t\t\t\"node_id\": \"nid\"\n\t\t},\n\t\t\"merge_base_commit\": {\n\t\t\t\"node_id\": \"nid\"\n\t\t},\n\t\t\"status\": \"status\",\n\t\t\"ahead_by\": 1,\n\t\t\"behind_by\": 1,\n\t\t\"total_commits\": 1,\n\t\t\"commits\": [\n\t\t\t{\n\t\t\t\t\"node_id\": \"nid\"\n\t\t\t}\n\t\t],\n\t\t\"files\": [\n\t\t\t{\n\t\t\t\t\"sha\": \"sha\"\n\t\t\t}\n\t\t],\n\t\t\"html_url\": \"hurl\",\n\t\t\"permalink_url\": \"purl\",\n\t\t\"diff_url\": \"durl\",\n\t\t\"patch_url\": \"purl\",\n\t\t\"url\": \"url\"\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n\nfunc TestCommitFile_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CommitFile{}, \"{}\")\n\n\tr := &CommitFile{\n\t\tSHA:              Ptr(\"sha\"),\n\t\tFilename:         Ptr(\"fn\"),\n\t\tAdditions:        Ptr(1),\n\t\tDeletions:        Ptr(1),\n\t\tChanges:          Ptr(1),\n\t\tStatus:           Ptr(\"status\"),\n\t\tPatch:            Ptr(\"patch\"),\n\t\tBlobURL:          Ptr(\"burl\"),\n\t\tRawURL:           Ptr(\"rurl\"),\n\t\tContentsURL:      Ptr(\"curl\"),\n\t\tPreviousFilename: Ptr(\"pf\"),\n\t}\n\n\twant := `{\n\t\t\"sha\": \"sha\",\n\t\t\"filename\": \"fn\",\n\t\t\"additions\": 1,\n\t\t\"deletions\": 1,\n\t\t\"changes\": 1,\n\t\t\"status\": \"status\",\n\t\t\"patch\": \"patch\",\n\t\t\"blob_url\": \"burl\",\n\t\t\"raw_url\": \"rurl\",\n\t\t\"contents_url\": \"curl\",\n\t\t\"previous_filename\": \"pf\"\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n\nfunc TestCommitStats_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CommitStats{}, \"{}\")\n\n\tr := &CommitStats{\n\t\tAdditions: Ptr(1),\n\t\tDeletions: Ptr(1),\n\t\tTotal:     Ptr(1),\n\t}\n\n\twant := `{\n\t\t\"additions\": 1,\n\t\t\"deletions\": 1,\n\t\t\"total\": 1\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n\nfunc TestRepositoryCommit_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RepositoryCommit{}, \"{}\")\n\n\tr := &RepositoryCommit{\n\t\tNodeID: Ptr(\"nid\"),\n\t\tSHA:    Ptr(\"sha\"),\n\t\tCommit: &Commit{\n\t\t\tMessage: Ptr(\"m\"),\n\t\t},\n\t\tAuthor: &User{\n\t\t\tLogin: Ptr(\"l\"),\n\t\t},\n\t\tCommitter: &User{\n\t\t\tLogin: Ptr(\"l\"),\n\t\t},\n\t\tParents: []*Commit{\n\t\t\t{\n\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t},\n\t\t},\n\t\tHTMLURL:     Ptr(\"hurl\"),\n\t\tURL:         Ptr(\"url\"),\n\t\tCommentsURL: Ptr(\"curl\"),\n\t\tStats: &CommitStats{\n\t\t\tAdditions: Ptr(104),\n\t\t\tDeletions: Ptr(4),\n\t\t\tTotal:     Ptr(108),\n\t\t},\n\t\tFiles: []*CommitFile{\n\t\t\t{\n\t\t\t\tFilename:    Ptr(\"f\"),\n\t\t\t\tAdditions:   Ptr(10),\n\t\t\t\tDeletions:   Ptr(2),\n\t\t\t\tChanges:     Ptr(12),\n\t\t\t\tStatus:      Ptr(\"s\"),\n\t\t\t\tPatch:       Ptr(\"p\"),\n\t\t\t\tBlobURL:     Ptr(\"b\"),\n\t\t\t\tRawURL:      Ptr(\"r\"),\n\t\t\t\tContentsURL: Ptr(\"c\"),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"node_id\": \"nid\",\n\t\t\"sha\": \"sha\",\n\t\t\"commit\": {\n\t\t\t\"message\": \"m\"\n\t\t},\n\t\t\"author\": {\n\t\t\t\"login\": \"l\"\n\t\t},\n\t\t\"committer\": {\n\t\t\t\"login\": \"l\"\n\t\t},\n\t\t\"parents\": [\n\t\t\t{\n\t\t\t\t\"sha\": \"s\"\n\t\t\t}\n\t\t],\n\t\t\"html_url\": \"hurl\",\n\t\t\"url\": \"url\",\n\t\t\"comments_url\": \"curl\",\n\t\t\"stats\": {\n\t\t\t\"additions\": 104,\n\t\t\t\"deletions\": 4,\n\t\t\t\"total\": 108\n\t\t},\n\t\t\"files\": [\n\t\t\t{\n\t\t\t\t\"filename\": \"f\",\n\t\t\t\t\"additions\": 10,\n\t\t\t\t\"deletions\": 2,\n\t\t\t\t\"changes\": 12,\n\t\t\t\t\"status\": \"s\",\n\t\t\t\t\"patch\": \"p\",\n\t\t\t\t\"blob_url\": \"b\",\n\t\t\t\t\"raw_url\": \"r\",\n\t\t\t\t\"contents_url\": \"c\"\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n"
  },
  {
    "path": "github/repos_community_health.go",
    "content": "// Copyright 2017 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// Metric represents the different fields for one file in community health files.\ntype Metric struct {\n\tName    *string `json:\"name\"`\n\tKey     *string `json:\"key\"`\n\tSPDXID  *string `json:\"spdx_id\"`\n\tURL     *string `json:\"url\"`\n\tHTMLURL *string `json:\"html_url\"`\n\tNodeID  *string `json:\"node_id\"`\n}\n\n// CommunityHealthFiles represents the different files in the community health metrics response.\ntype CommunityHealthFiles struct {\n\tCodeOfConduct       *Metric `json:\"code_of_conduct\"`\n\tCodeOfConductFile   *Metric `json:\"code_of_conduct_file\"`\n\tContributing        *Metric `json:\"contributing\"`\n\tIssueTemplate       *Metric `json:\"issue_template\"`\n\tPullRequestTemplate *Metric `json:\"pull_request_template\"`\n\tLicense             *Metric `json:\"license\"`\n\tReadme              *Metric `json:\"readme\"`\n}\n\n// CommunityHealthMetrics represents a response containing the community metrics of a repository.\ntype CommunityHealthMetrics struct {\n\tHealthPercentage      *int                  `json:\"health_percentage\"`\n\tDescription           *string               `json:\"description\"`\n\tDocumentation         *string               `json:\"documentation\"`\n\tFiles                 *CommunityHealthFiles `json:\"files\"`\n\tUpdatedAt             *Timestamp            `json:\"updated_at\"`\n\tContentReportsEnabled *bool                 `json:\"content_reports_enabled\"`\n}\n\n// GetCommunityHealthMetrics retrieves all the community health  metrics for a  repository.\n//\n// GitHub API docs: https://docs.github.com/rest/metrics/community#get-community-profile-metrics\n//\n//meta:operation GET /repos/{owner}/{repo}/community/profile\nfunc (s *RepositoriesService) GetCommunityHealthMetrics(ctx context.Context, owner, repo string) (*CommunityHealthMetrics, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/community/profile\", owner, repo)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar metrics *CommunityHealthMetrics\n\tresp, err := s.client.Do(ctx, req, &metrics)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn metrics, resp, nil\n}\n"
  },
  {
    "path": "github/repos_community_health_test.go",
    "content": "// Copyright 2017 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_GetCommunityHealthMetrics(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/community/profile\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\t\"health_percentage\": 100,\n\t\t\t\t\"description\": \"My first repository on GitHub!\",\n\t\t\t\t\"documentation\": null,\n\t\t\t\t\"files\": {\n\t\t\t\t\t\"code_of_conduct\": {\n\t\t\t\t\t\t\"name\": \"Contributor Covenant\",\n\t\t\t\t\t\t\"key\": \"contributor_covenant\",\n\t\t\t\t\t\t\"url\": null,\n\t\t\t\t\t\t\"html_url\": \"https://github.com/octocat/Hello-World/blob/master/CODE_OF_CONDUCT.md\"\n\t\t\t\t\t},\n\t\t\t\t\t\"code_of_conduct_file\": {\n\t\t\t\t\t\t\"url\": \"https://api.github.com/repos/octocat/Hello-World/contents/CODE_OF_CONDUCT.md\",\n\t\t\t\t\t\t\"html_url\": \"https://github.com/octocat/Hello-World/blob/master/CODE_OF_CONDUCT.md\"\n\t\t\t\t\t},\n\t\t\t\t\t\"contributing\": {\n\t\t\t\t\t\t\"url\": \"https://api.github.com/repos/octocat/Hello-World/contents/CONTRIBUTING\",\n\t\t\t\t\t\t\"html_url\": \"https://github.com/octocat/Hello-World/blob/master/CONTRIBUTING\"\n\t\t\t\t\t},\n\t\t\t\t\t\"issue_template\": {\n\t\t\t\t\t\t\"url\": \"https://api.github.com/repos/octocat/Hello-World/contents/ISSUE_TEMPLATE\",\n\t\t\t\t\t\t\"html_url\": \"https://github.com/octocat/Hello-World/blob/master/ISSUE_TEMPLATE\"\n\t\t\t\t\t},\n\t\t\t\t\t\"pull_request_template\": {\n\t\t\t\t\t\t\"url\": \"https://api.github.com/repos/octocat/Hello-World/contents/PULL_REQUEST_TEMPLATE\",\n\t\t\t\t\t\t\"html_url\": \"https://github.com/octocat/Hello-World/blob/master/PULL_REQUEST_TEMPLATE\"\n\t\t\t\t\t},\n\t\t\t\t\t\"license\": {\n\t\t\t\t\t\t\"name\": \"MIT License\",\n\t\t\t\t\t\t\"key\": \"mit\",\n\t\t\t\t\t\t\"spdx_id\": \"MIT\",\n\t\t\t\t\t\t\"url\": \"https://api.github.com/licenses/mit\",\n\t\t\t\t\t\t\"html_url\": \"https://github.com/octocat/Hello-World/blob/master/LICENSE\",\n\t\t\t\t\t\t\"node_id\": \"MDc6TGljZW5zZW1pdA==\"\n\t\t\t\t\t},\n\t\t\t\t\t\"readme\": {\n\t\t\t\t\t\t\"url\": \"https://api.github.com/repos/octocat/Hello-World/contents/README.md\",\n\t\t\t\t\t\t\"html_url\": \"https://github.com/octocat/Hello-World/blob/master/README.md\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"updated_at\": \"2017-02-28T00:00:00Z\",\n\t\t\t\t\"content_reports_enabled\": true\n\t\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.GetCommunityHealthMetrics(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetCommunityHealthMetrics returned error: %v\", err)\n\t}\n\n\tupdatedAt := time.Date(2017, time.February, 28, 0, 0, 0, 0, time.UTC)\n\twant := &CommunityHealthMetrics{\n\t\tHealthPercentage:      Ptr(100),\n\t\tDescription:           Ptr(\"My first repository on GitHub!\"),\n\t\tUpdatedAt:             &Timestamp{updatedAt},\n\t\tContentReportsEnabled: Ptr(true),\n\t\tFiles: &CommunityHealthFiles{\n\t\t\tCodeOfConduct: &Metric{\n\t\t\t\tName:    Ptr(\"Contributor Covenant\"),\n\t\t\t\tKey:     Ptr(\"contributor_covenant\"),\n\t\t\t\tHTMLURL: Ptr(\"https://github.com/octocat/Hello-World/blob/master/CODE_OF_CONDUCT.md\"),\n\t\t\t},\n\t\t\tCodeOfConductFile: &Metric{\n\t\t\t\tURL:     Ptr(\"https://api.github.com/repos/octocat/Hello-World/contents/CODE_OF_CONDUCT.md\"),\n\t\t\t\tHTMLURL: Ptr(\"https://github.com/octocat/Hello-World/blob/master/CODE_OF_CONDUCT.md\"),\n\t\t\t},\n\t\t\tContributing: &Metric{\n\t\t\t\tURL:     Ptr(\"https://api.github.com/repos/octocat/Hello-World/contents/CONTRIBUTING\"),\n\t\t\t\tHTMLURL: Ptr(\"https://github.com/octocat/Hello-World/blob/master/CONTRIBUTING\"),\n\t\t\t},\n\t\t\tIssueTemplate: &Metric{\n\t\t\t\tURL:     Ptr(\"https://api.github.com/repos/octocat/Hello-World/contents/ISSUE_TEMPLATE\"),\n\t\t\t\tHTMLURL: Ptr(\"https://github.com/octocat/Hello-World/blob/master/ISSUE_TEMPLATE\"),\n\t\t\t},\n\t\t\tPullRequestTemplate: &Metric{\n\t\t\t\tURL:     Ptr(\"https://api.github.com/repos/octocat/Hello-World/contents/PULL_REQUEST_TEMPLATE\"),\n\t\t\t\tHTMLURL: Ptr(\"https://github.com/octocat/Hello-World/blob/master/PULL_REQUEST_TEMPLATE\"),\n\t\t\t},\n\t\t\tLicense: &Metric{\n\t\t\t\tName:    Ptr(\"MIT License\"),\n\t\t\t\tKey:     Ptr(\"mit\"),\n\t\t\t\tSPDXID:  Ptr(\"MIT\"),\n\t\t\t\tURL:     Ptr(\"https://api.github.com/licenses/mit\"),\n\t\t\t\tHTMLURL: Ptr(\"https://github.com/octocat/Hello-World/blob/master/LICENSE\"),\n\t\t\t\tNodeID:  Ptr(\"MDc6TGljZW5zZW1pdA==\"),\n\t\t\t},\n\t\t\tReadme: &Metric{\n\t\t\t\tURL:     Ptr(\"https://api.github.com/repos/octocat/Hello-World/contents/README.md\"),\n\t\t\t\tHTMLURL: Ptr(\"https://github.com/octocat/Hello-World/blob/master/README.md\"),\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.GetCommunityHealthMetrics:\\ngot:\\n%v\\nwant:\\n%v\", Stringify(got), Stringify(want))\n\t}\n\n\tconst methodName = \"GetCommunityHealthMetrics\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetCommunityHealthMetrics(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetCommunityHealthMetrics(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestMetric_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Metric{}, `{\n\t\t\"name\": null,\n\t\t\"key\": null,\n\t\t\"spdx_id\": null,\n\t\t\"url\": null,\n\t\t\"html_url\": null,\n\t\t\"node_id\": null\n\t}`)\n\n\tr := &Metric{\n\t\tName:    Ptr(\"name\"),\n\t\tKey:     Ptr(\"key\"),\n\t\tSPDXID:  Ptr(\"spdx_id\"),\n\t\tURL:     Ptr(\"url\"),\n\t\tHTMLURL: Ptr(\"hurl\"),\n\t\tNodeID:  Ptr(\"node_id\"),\n\t}\n\n\twant := `{\n\t\t\"name\": \"name\",\n\t\t\"key\": \"key\",\n\t\t\"spdx_id\": \"spdx_id\",\n\t\t\"url\": \"url\",\n\t\t\"html_url\": \"hurl\",\n\t\t\"node_id\": \"node_id\"\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n\nfunc TestCommunityHealthFiles_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CommunityHealthFiles{}, `{\n\t\t\"code_of_conduct\": null,\n\t\t\"code_of_conduct_file\": null,\n\t\t\"contributing\": null,\n\t\t\"issue_template\": null,\n\t\t\"pull_request_template\": null,\n\t\t\"license\": null,\n\t\t\"readme\": null\n\t}`)\n\n\tr := &CommunityHealthFiles{\n\t\tCodeOfConduct: &Metric{\n\t\t\tName:    Ptr(\"name\"),\n\t\t\tKey:     Ptr(\"key\"),\n\t\t\tURL:     Ptr(\"url\"),\n\t\t\tHTMLURL: Ptr(\"hurl\"),\n\t\t},\n\t\tCodeOfConductFile: &Metric{\n\t\t\tName:    Ptr(\"name\"),\n\t\t\tKey:     Ptr(\"key\"),\n\t\t\tURL:     Ptr(\"url\"),\n\t\t\tHTMLURL: Ptr(\"hurl\"),\n\t\t},\n\t\tContributing: &Metric{\n\t\t\tName:    Ptr(\"name\"),\n\t\t\tKey:     Ptr(\"key\"),\n\t\t\tURL:     Ptr(\"url\"),\n\t\t\tHTMLURL: Ptr(\"hurl\"),\n\t\t},\n\t\tIssueTemplate: &Metric{\n\t\t\tName:    Ptr(\"name\"),\n\t\t\tKey:     Ptr(\"key\"),\n\t\t\tURL:     Ptr(\"url\"),\n\t\t\tHTMLURL: Ptr(\"hurl\"),\n\t\t},\n\t\tPullRequestTemplate: &Metric{\n\t\t\tName:    Ptr(\"name\"),\n\t\t\tKey:     Ptr(\"key\"),\n\t\t\tURL:     Ptr(\"url\"),\n\t\t\tHTMLURL: Ptr(\"hurl\"),\n\t\t},\n\t\tLicense: &Metric{\n\t\t\tName:    Ptr(\"name\"),\n\t\t\tKey:     Ptr(\"key\"),\n\t\t\tSPDXID:  Ptr(\"spdx_id\"),\n\t\t\tURL:     Ptr(\"url\"),\n\t\t\tHTMLURL: Ptr(\"hurl\"),\n\t\t\tNodeID:  Ptr(\"node_id\"),\n\t\t},\n\t\tReadme: &Metric{\n\t\t\tName:    Ptr(\"name\"),\n\t\t\tKey:     Ptr(\"key\"),\n\t\t\tURL:     Ptr(\"url\"),\n\t\t\tHTMLURL: Ptr(\"hurl\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"code_of_conduct\": {\n\t\t\t\"name\": \"name\",\n\t\t\t\"key\": \"key\",\n\t\t\t\"url\": \"url\",\n\t\t\t\"html_url\": \"hurl\",\n\t\t\t\"node_id\": null,\n\t\t\t\"spdx_id\": null\n\t\t},\n\t\t\"code_of_conduct_file\": {\n\t\t\t\"name\": \"name\",\n\t\t\t\"key\": \"key\",\n\t\t\t\"url\": \"url\",\n\t\t\t\"html_url\": \"hurl\",\n\t\t\t\"node_id\": null,\n\t\t\t\"spdx_id\": null\n\t\t},\n\t\t\"contributing\": {\n\t\t\t\"name\": \"name\",\n\t\t\t\"key\": \"key\",\n\t\t\t\"url\": \"url\",\n\t\t\t\"html_url\": \"hurl\",\n\t\t\t\"node_id\": null,\n\t\t\t\"spdx_id\": null\n\t\t},\n\t\t\"issue_template\": {\n\t\t\t\"name\": \"name\",\n\t\t\t\"key\": \"key\",\n\t\t\t\"url\": \"url\",\n\t\t\t\"html_url\": \"hurl\",\n\t\t\t\"node_id\": null,\n\t\t\t\"spdx_id\": null\n\t\t},\n\t\t\"pull_request_template\": {\n\t\t\t\"name\": \"name\",\n\t\t\t\"key\": \"key\",\n\t\t\t\"url\": \"url\",\n\t\t\t\"html_url\": \"hurl\",\n\t\t\t\"node_id\": null,\n\t\t\t\"spdx_id\": null\n\t\t},\n\t\t\"license\": {\n\t\t\t\"name\": \"name\",\n\t\t\t\"key\": \"key\",\n\t\t\t\"spdx_id\": \"spdx_id\",\n\t\t\t\"url\": \"url\",\n\t\t\t\"html_url\": \"hurl\",\n\t\t\t\"node_id\": \"node_id\"\n\t\t},\n\t\t\"readme\": {\n\t\t\t\"name\": \"name\",\n\t\t\t\"key\": \"key\",\n\t\t\t\"url\": \"url\",\n\t\t\t\"html_url\": \"hurl\",\n\t\t\t\"node_id\": null,\n\t\t\t\"spdx_id\": null\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n\nfunc TestCommunityHealthMetrics_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CommunityHealthMetrics{}, `{\n\t\t\"health_percentage\": null,\n\t\t\"description\": null,\n\t\t\"documentation\": null,\n\t\t\"files\": null,\n\t\t\"updated_at\": null,\n\t\t\"content_reports_enabled\": null\n\t}`)\n\n\tr := &CommunityHealthMetrics{\n\t\tHealthPercentage: Ptr(1),\n\t\tDescription:      Ptr(\"desc\"),\n\t\tDocumentation:    Ptr(\"docs\"),\n\t\tFiles: &CommunityHealthFiles{\n\t\t\tCodeOfConduct: &Metric{\n\t\t\t\tName:    Ptr(\"name\"),\n\t\t\t\tKey:     Ptr(\"key\"),\n\t\t\t\tURL:     Ptr(\"url\"),\n\t\t\t\tHTMLURL: Ptr(\"hurl\"),\n\t\t\t},\n\t\t\tCodeOfConductFile: &Metric{\n\t\t\t\tName:    Ptr(\"name\"),\n\t\t\t\tKey:     Ptr(\"key\"),\n\t\t\t\tURL:     Ptr(\"url\"),\n\t\t\t\tHTMLURL: Ptr(\"hurl\"),\n\t\t\t},\n\t\t\tContributing: &Metric{\n\t\t\t\tName:    Ptr(\"name\"),\n\t\t\t\tKey:     Ptr(\"key\"),\n\t\t\t\tURL:     Ptr(\"url\"),\n\t\t\t\tHTMLURL: Ptr(\"hurl\"),\n\t\t\t},\n\t\t\tIssueTemplate: &Metric{\n\t\t\t\tName:    Ptr(\"name\"),\n\t\t\t\tKey:     Ptr(\"key\"),\n\t\t\t\tURL:     Ptr(\"url\"),\n\t\t\t\tHTMLURL: Ptr(\"hurl\"),\n\t\t\t},\n\t\t\tPullRequestTemplate: &Metric{\n\t\t\t\tName:    Ptr(\"name\"),\n\t\t\t\tKey:     Ptr(\"key\"),\n\t\t\t\tURL:     Ptr(\"url\"),\n\t\t\t\tHTMLURL: Ptr(\"hurl\"),\n\t\t\t},\n\t\t\tLicense: &Metric{\n\t\t\t\tName:    Ptr(\"name\"),\n\t\t\t\tKey:     Ptr(\"key\"),\n\t\t\t\tSPDXID:  Ptr(\"spdx_id\"),\n\t\t\t\tURL:     Ptr(\"url\"),\n\t\t\t\tHTMLURL: Ptr(\"hurl\"),\n\t\t\t\tNodeID:  Ptr(\"node_id\"),\n\t\t\t},\n\t\t\tReadme: &Metric{\n\t\t\t\tName:    Ptr(\"name\"),\n\t\t\t\tKey:     Ptr(\"key\"),\n\t\t\t\tURL:     Ptr(\"url\"),\n\t\t\t\tHTMLURL: Ptr(\"hurl\"),\n\t\t\t},\n\t\t},\n\t\tUpdatedAt:             &Timestamp{referenceTime},\n\t\tContentReportsEnabled: Ptr(true),\n\t}\n\n\twant := `{\n\t\t\"health_percentage\": 1,\n\t\t\"description\": \"desc\",\n\t\t\"documentation\": \"docs\",\n\t\t\"files\": {\n\t\t\t\"code_of_conduct\": {\n\t\t\t\t\"name\": \"name\",\n\t\t\t\t\"key\": \"key\",\n\t\t\t\t\"url\": \"url\",\n\t\t\t\t\"html_url\": \"hurl\",\n\t\t\t\t\"node_id\": null,\n\t\t\t\t\"spdx_id\": null\n\t\t\t},\n\t\t\t\"code_of_conduct_file\": {\n\t\t\t\t\"name\": \"name\",\n\t\t\t\t\"key\": \"key\",\n\t\t\t\t\"url\": \"url\",\n\t\t\t\t\"html_url\": \"hurl\",\n\t\t\t\t\"node_id\": null,\n\t\t\t\t\"spdx_id\": null\n\t\t\t},\n\t\t\t\"contributing\": {\n\t\t\t\t\"name\": \"name\",\n\t\t\t\t\"key\": \"key\",\n\t\t\t\t\"url\": \"url\",\n\t\t\t\t\"html_url\": \"hurl\",\n\t\t\t\t\"node_id\": null,\n\t\t\t\t\"spdx_id\": null\n\t\t\t},\n\t\t\t\"issue_template\": {\n\t\t\t\t\"name\": \"name\",\n\t\t\t\t\"key\": \"key\",\n\t\t\t\t\"url\": \"url\",\n\t\t\t\t\"html_url\": \"hurl\",\n\t\t\t\t\"node_id\": null,\n\t\t\t\t\"spdx_id\": null\n\t\t\t},\n\t\t\t\"pull_request_template\": {\n\t\t\t\t\"name\": \"name\",\n\t\t\t\t\"key\": \"key\",\n\t\t\t\t\"url\": \"url\",\n\t\t\t\t\"html_url\": \"hurl\",\n\t\t\t\t\"node_id\": null,\n\t\t\t\t\"spdx_id\": null\n\t\t\t},\n\t\t\t\"license\": {\n\t\t\t\t\"name\": \"name\",\n\t\t\t\t\"key\": \"key\",\n\t\t\t\t\"spdx_id\": \"spdx_id\",\n\t\t\t\t\"url\": \"url\",\n\t\t\t\t\"html_url\": \"hurl\",\n\t\t\t\t\"node_id\": \"node_id\"\n\t\t\t},\n\t\t\t\"readme\": {\n\t\t\t\t\"name\": \"name\",\n\t\t\t\t\"key\": \"key\",\n\t\t\t\t\"url\": \"url\",\n\t\t\t\t\"html_url\": \"hurl\",\n\t\t\t\t\"node_id\": null,\n\t\t\t\t\"spdx_id\": null\n\t\t\t}\n\t\t},\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"content_reports_enabled\": true\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n"
  },
  {
    "path": "github/repos_contents.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Repository contents API methods.\n// GitHub API docs: https://docs.github.com/rest/repos/contents/\n\npackage github\n\nimport (\n\t\"context\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"path\"\n\t\"strings\"\n)\n\nvar ErrPathForbidden = errors.New(\"path must not contain '..' due to auth vulnerability issue\")\n\n// RepositoryContent represents a file or directory in a github repository.\ntype RepositoryContent struct {\n\tType *string `json:\"type,omitempty\"`\n\t// Target is only set if the type is \"symlink\" and the target is not a normal file.\n\t// If Target is set, Path will be the symlink path.\n\tTarget   *string `json:\"target,omitempty\"`\n\tEncoding *string `json:\"encoding,omitempty\"`\n\tSize     *int    `json:\"size,omitempty\"`\n\tName     *string `json:\"name,omitempty\"`\n\tPath     *string `json:\"path,omitempty\"`\n\t// Content contains the actual file content, which may be encoded.\n\t// Callers should call GetContent which will decode the content if\n\t// necessary.\n\tContent         *string `json:\"content,omitempty\"`\n\tSHA             *string `json:\"sha,omitempty\"`\n\tURL             *string `json:\"url,omitempty\"`\n\tGitURL          *string `json:\"git_url,omitempty\"`\n\tHTMLURL         *string `json:\"html_url,omitempty\"`\n\tDownloadURL     *string `json:\"download_url,omitempty\"`\n\tSubmoduleGitURL *string `json:\"submodule_git_url,omitempty\"`\n}\n\n// RepositoryContentResponse holds the parsed response from CreateFile, UpdateFile, and DeleteFile.\ntype RepositoryContentResponse struct {\n\tContent *RepositoryContent `json:\"content,omitempty\"`\n\tCommit  `json:\"commit\"`\n}\n\n// RepositoryContentFileOptions specifies optional parameters for CreateFile, UpdateFile, and DeleteFile.\ntype RepositoryContentFileOptions struct {\n\tMessage   *string       `json:\"message,omitempty\"`\n\tContent   []byte        `json:\"content\"` // unencoded\n\tSHA       *string       `json:\"sha,omitempty\"`\n\tBranch    *string       `json:\"branch,omitempty\"`\n\tAuthor    *CommitAuthor `json:\"author,omitempty\"`\n\tCommitter *CommitAuthor `json:\"committer,omitempty\"`\n}\n\n// RepositoryContentGetOptions represents an optional ref parameter, which can be a SHA,\n// branch, or tag. E.g., `6540c41b`, `heads/main`, `tags/v1.0`.\ntype RepositoryContentGetOptions struct {\n\tRef string `url:\"ref,omitempty\"`\n}\n\n// String converts RepositoryContent to a string. It's primarily for testing.\nfunc (r RepositoryContent) String() string {\n\treturn Stringify(r)\n}\n\n// GetContent returns the content of r, decoding it if necessary.\nfunc (r *RepositoryContent) GetContent() (string, error) {\n\tvar encoding string\n\tif r.Encoding != nil {\n\t\tencoding = *r.Encoding\n\t}\n\n\tswitch encoding {\n\tcase \"base64\":\n\t\tif r.Content == nil {\n\t\t\treturn \"\", errors.New(\"malformed response: base64 encoding of null content\")\n\t\t}\n\t\tc, err := base64.StdEncoding.DecodeString(*r.Content)\n\t\treturn string(c), err\n\tcase \"\":\n\t\tif r.Content == nil {\n\t\t\treturn \"\", nil\n\t\t}\n\t\treturn *r.Content, nil\n\tcase \"none\":\n\t\treturn \"\", errors.New(\"unsupported content encoding: none, this may occur when file size > 1 MB, if that is the case consider using DownloadContents\")\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"unsupported content encoding: %v\", encoding)\n\t}\n}\n\n// GetReadme gets the Readme file for the repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/contents#get-a-repository-readme\n//\n//meta:operation GET /repos/{owner}/{repo}/readme\nfunc (s *RepositoriesService) GetReadme(ctx context.Context, owner, repo string, opts *RepositoryContentGetOptions) (*RepositoryContent, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/readme\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar readme *RepositoryContent\n\tresp, err := s.client.Do(ctx, req, &readme)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn readme, resp, nil\n}\n\n// DownloadContents returns an io.ReadCloser that reads the contents of the\n// specified file. This function will work with files of any size, as opposed\n// to GetContents which is limited to 1 Mb files. It is the caller's\n// responsibility to close the ReadCloser.\n//\n// It is possible for the download to result in a failed response when the\n// returned error is nil. Callers should check the returned Response status\n// code to verify the content is from a successful response.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/contents#get-repository-content\n//\n//meta:operation GET /repos/{owner}/{repo}/contents/{path}\nfunc (s *RepositoriesService) DownloadContents(ctx context.Context, owner, repo, filepath string, opts *RepositoryContentGetOptions) (io.ReadCloser, *Response, error) {\n\tdir := path.Dir(filepath)\n\tfilename := path.Base(filepath)\n\tfileContent, _, resp, err := s.GetContents(ctx, owner, repo, filepath, opts)\n\tif err == nil && fileContent != nil {\n\t\tcontent, err := fileContent.GetContent()\n\t\tif err == nil && content != \"\" {\n\t\t\treturn io.NopCloser(strings.NewReader(content)), resp, nil\n\t\t}\n\t}\n\n\t_, dirContents, resp, err := s.GetContents(ctx, owner, repo, dir, opts)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\tfor _, contents := range dirContents {\n\t\tif contents.GetName() == filename {\n\t\t\tif contents.GetDownloadURL() == \"\" {\n\t\t\t\treturn nil, resp, fmt.Errorf(\"no download link found for %v\", filepath)\n\t\t\t}\n\t\t\tdlReq, err := http.NewRequestWithContext(ctx, \"GET\", *contents.DownloadURL, nil)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, resp, err\n\t\t\t}\n\t\t\tdlResp, err := s.client.client.Do(dlReq)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, &Response{Response: dlResp}, err\n\t\t\t}\n\n\t\t\treturn dlResp.Body, &Response{Response: dlResp}, nil\n\t\t}\n\t}\n\n\treturn nil, resp, fmt.Errorf(\"no file named %v found in %v\", filename, dir)\n}\n\n// DownloadContentsWithMeta is identical to DownloadContents but additionally\n// returns the RepositoryContent of the requested file. This additional data\n// is useful for future operations involving the requested file. For merely\n// reading the content of a file, DownloadContents is perfectly adequate.\n//\n// It is possible for the download to result in a failed response when the\n// returned error is nil. Callers should check the returned Response status\n// code to verify the content is from a successful response.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/contents#get-repository-content\n//\n//meta:operation GET /repos/{owner}/{repo}/contents/{path}\nfunc (s *RepositoriesService) DownloadContentsWithMeta(ctx context.Context, owner, repo, filepath string, opts *RepositoryContentGetOptions) (io.ReadCloser, *RepositoryContent, *Response, error) {\n\tdir := path.Dir(filepath)\n\tfilename := path.Base(filepath)\n\tfileContent, _, resp, err := s.GetContents(ctx, owner, repo, filepath, opts)\n\tif err == nil && fileContent != nil {\n\t\tcontent, err := fileContent.GetContent()\n\t\tif err == nil && content != \"\" {\n\t\t\treturn io.NopCloser(strings.NewReader(content)), fileContent, resp, nil\n\t\t}\n\t}\n\n\t_, dirContents, resp, err := s.GetContents(ctx, owner, repo, dir, opts)\n\tif err != nil {\n\t\treturn nil, nil, resp, err\n\t}\n\n\tfor _, contents := range dirContents {\n\t\tif contents.GetName() == filename {\n\t\t\tif contents.GetDownloadURL() == \"\" {\n\t\t\t\treturn nil, contents, resp, fmt.Errorf(\"no download link found for %v\", filepath)\n\t\t\t}\n\t\t\tdlReq, err := http.NewRequestWithContext(ctx, \"GET\", *contents.DownloadURL, nil)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, contents, resp, err\n\t\t\t}\n\t\t\tdlResp, err := s.client.client.Do(dlReq)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, contents, &Response{Response: dlResp}, err\n\t\t\t}\n\n\t\t\treturn dlResp.Body, contents, &Response{Response: dlResp}, nil\n\t\t}\n\t}\n\n\treturn nil, nil, resp, fmt.Errorf(\"no file named %v found in %v\", filename, dir)\n}\n\n// GetContents can return either the metadata and content of a single file\n// (when path references a file) or the metadata of all the files and/or\n// subdirectories of a directory (when path references a directory). To make it\n// easy to distinguish between both result types and to mimic the API as much\n// as possible, both result types will be returned but only one will contain a\n// value and the other will be nil.\n//\n// Due to an auth vulnerability issue in the GitHub v3 API, \"..\" is not allowed\n// to appear anywhere in the \"path\" or this method will return an error.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/contents#get-repository-content\n//\n//meta:operation GET /repos/{owner}/{repo}/contents/{path}\nfunc (s *RepositoriesService) GetContents(ctx context.Context, owner, repo, path string, opts *RepositoryContentGetOptions) (fileContent *RepositoryContent, directoryContent []*RepositoryContent, resp *Response, err error) {\n\tif strings.Contains(path, \"..\") {\n\t\treturn nil, nil, nil, ErrPathForbidden\n\t}\n\n\tescapedPath := (&url.URL{Path: strings.TrimSuffix(path, \"/\")}).String()\n\tu := fmt.Sprintf(\"repos/%v/%v/contents/%v\", owner, repo, escapedPath)\n\tu, err = addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, nil, err\n\t}\n\n\tvar rawJSON json.RawMessage\n\tresp, err = s.client.Do(ctx, req, &rawJSON)\n\tif err != nil {\n\t\treturn nil, nil, resp, err\n\t}\n\n\tfileUnmarshalError := json.Unmarshal(rawJSON, &fileContent)\n\tif fileUnmarshalError == nil {\n\t\treturn fileContent, nil, resp, nil\n\t}\n\n\tdirectoryUnmarshalError := json.Unmarshal(rawJSON, &directoryContent)\n\tif directoryUnmarshalError == nil {\n\t\treturn nil, directoryContent, resp, nil\n\t}\n\n\treturn nil, nil, resp, fmt.Errorf(\"unmarshaling failed for both file and directory content: %v and %v\", fileUnmarshalError, directoryUnmarshalError)\n}\n\n// CreateFile creates a new file in a repository at the given path and returns\n// the commit and file metadata.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/contents#create-or-update-file-contents\n//\n//meta:operation PUT /repos/{owner}/{repo}/contents/{path}\nfunc (s *RepositoriesService) CreateFile(ctx context.Context, owner, repo, path string, opts *RepositoryContentFileOptions) (*RepositoryContentResponse, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/contents/%v\", owner, repo, path)\n\treq, err := s.client.NewRequest(\"PUT\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar createResponse *RepositoryContentResponse\n\tresp, err := s.client.Do(ctx, req, &createResponse)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn createResponse, resp, nil\n}\n\n// UpdateFile updates a file in a repository at the given path and returns the\n// commit and file metadata. Requires the blob SHA of the file being updated.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/contents#create-or-update-file-contents\n//\n//meta:operation PUT /repos/{owner}/{repo}/contents/{path}\nfunc (s *RepositoriesService) UpdateFile(ctx context.Context, owner, repo, path string, opts *RepositoryContentFileOptions) (*RepositoryContentResponse, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/contents/%v\", owner, repo, path)\n\treq, err := s.client.NewRequest(\"PUT\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar updateResponse *RepositoryContentResponse\n\tresp, err := s.client.Do(ctx, req, &updateResponse)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn updateResponse, resp, nil\n}\n\n// DeleteFile deletes a file from a repository and returns the commit.\n// Requires the blob SHA of the file to be deleted.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/contents#delete-a-file\n//\n//meta:operation DELETE /repos/{owner}/{repo}/contents/{path}\nfunc (s *RepositoriesService) DeleteFile(ctx context.Context, owner, repo, path string, opts *RepositoryContentFileOptions) (*RepositoryContentResponse, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/contents/%v\", owner, repo, path)\n\treq, err := s.client.NewRequest(\"DELETE\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar deleteResponse *RepositoryContentResponse\n\tresp, err := s.client.Do(ctx, req, &deleteResponse)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn deleteResponse, resp, nil\n}\n\n// ArchiveFormat is used to define the archive type when calling GetArchiveLink.\ntype ArchiveFormat string\n\nconst (\n\t// Tarball specifies an archive in gzipped tar format.\n\tTarball ArchiveFormat = \"tarball\"\n\n\t// Zipball specifies an archive in zip format.\n\tZipball ArchiveFormat = \"zipball\"\n)\n\n// GetArchiveLink returns an URL to download a tarball or zipball archive for a\n// repository. The archiveFormat can be specified by either the github.Tarball\n// or github.Zipball constant.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/contents#download-a-repository-archive-tar\n//\n// GitHub API docs: https://docs.github.com/rest/repos/contents#download-a-repository-archive-zip\n//\n//meta:operation GET /repos/{owner}/{repo}/tarball/{ref}\n//meta:operation GET /repos/{owner}/{repo}/zipball/{ref}\nfunc (s *RepositoriesService) GetArchiveLink(ctx context.Context, owner, repo string, archiveformat ArchiveFormat, opts *RepositoryContentGetOptions, maxRedirects int) (*url.URL, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/%v\", owner, repo, archiveformat)\n\tif opts != nil && opts.Ref != \"\" {\n\t\tu += fmt.Sprintf(\"/%v\", opts.Ref)\n\t}\n\n\tif s.client.RateLimitRedirectionalEndpoints {\n\t\treturn s.getArchiveLinkWithRateLimit(ctx, u, maxRedirects)\n\t}\n\n\treturn s.getArchiveLinkWithoutRateLimit(ctx, u, maxRedirects)\n}\n\nfunc (s *RepositoriesService) getArchiveLinkWithoutRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) {\n\tresp, err := s.client.roundTripWithOptionalFollowRedirect(ctx, u, maxRedirects)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusFound {\n\t\treturn nil, newResponse(resp), fmt.Errorf(\"unexpected status code: %v\", resp.Status)\n\t}\n\n\tparsedURL, err := url.Parse(resp.Header.Get(\"Location\"))\n\tif err != nil {\n\t\treturn nil, newResponse(resp), err\n\t}\n\n\treturn parsedURL, newResponse(resp), nil\n}\n\nfunc (s *RepositoriesService) getArchiveLinkWithRateLimit(ctx context.Context, u string, maxRedirects int) (*url.URL, *Response, error) {\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\turl, resp, err := s.client.bareDoUntilFound(ctx, req, maxRedirects)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\tdefer resp.Body.Close()\n\n\t// If we didn't receive a valid Location in a 302 response\n\tif url == nil {\n\t\treturn nil, resp, fmt.Errorf(\"unexpected status code: %v\", resp.Status)\n\t}\n\n\treturn url, resp, nil\n}\n"
  },
  {
    "path": "github/repos_contents_test.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoryContent_GetContent(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tencoding, content *string // input encoding and content\n\t\twant              string  // desired output\n\t\twantErr           bool    // whether an error is expected\n\t}{\n\t\t{\n\t\t\tencoding: Ptr(\"\"),\n\t\t\tcontent:  Ptr(\"hello\"),\n\t\t\twant:     \"hello\",\n\t\t\twantErr:  false,\n\t\t},\n\t\t{\n\t\t\tencoding: nil,\n\t\t\tcontent:  Ptr(\"hello\"),\n\t\t\twant:     \"hello\",\n\t\t\twantErr:  false,\n\t\t},\n\t\t{\n\t\t\tencoding: nil,\n\t\t\tcontent:  nil,\n\t\t\twant:     \"\",\n\t\t\twantErr:  false,\n\t\t},\n\t\t{\n\t\t\tencoding: Ptr(\"base64\"),\n\t\t\tcontent:  Ptr(\"aGVsbG8=\"),\n\t\t\twant:     \"hello\",\n\t\t\twantErr:  false,\n\t\t},\n\t\t{\n\t\t\tencoding: Ptr(\"bad\"),\n\t\t\tcontent:  Ptr(\"aGVsbG8=\"),\n\t\t\twant:     \"\",\n\t\t\twantErr:  true,\n\t\t},\n\t\t{\n\t\t\tencoding: Ptr(\"none\"),\n\t\t\tcontent:  nil,\n\t\t\twant:     \"\",\n\t\t\twantErr:  true,\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tr := RepositoryContent{Encoding: tt.encoding, Content: tt.content}\n\t\tgot, err := r.GetContent()\n\t\tif err != nil && !tt.wantErr {\n\t\t\tt.Errorf(\"RepositoryContent(%v, %v) returned unexpected error: %v\",\n\t\t\t\tstringOrNil(tt.encoding), stringOrNil(tt.content), err)\n\t\t}\n\t\tif err == nil && tt.wantErr {\n\t\t\tt.Errorf(\"RepositoryContent(%v, %v) did not return unexpected error\",\n\t\t\t\tstringOrNil(tt.encoding), stringOrNil(tt.content))\n\t\t}\n\t\tif want := tt.want; got != want {\n\t\t\tt.Errorf(\"RepositoryContent.GetContent returned %+v, want %+v\", got, want)\n\t\t}\n\t}\n}\n\n// stringOrNil converts a potentially null string pointer to string.\n// For non-nil input pointer, the returned string is enclosed in double-quotes.\nfunc stringOrNil(s *string) string {\n\tif s == nil {\n\t\treturn \"<nil>\"\n\t}\n\treturn fmt.Sprintf(\"%q\", *s)\n}\n\nfunc TestRepositoriesService_GetReadme(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/readme\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t  \"type\": \"file\",\n\t\t  \"encoding\": \"base64\",\n\t\t  \"size\": 5362,\n\t\t  \"name\": \"README.md\",\n\t\t  \"path\": \"README.md\"\n\t\t}`)\n\t})\n\tctx := t.Context()\n\treadme, _, err := client.Repositories.GetReadme(ctx, \"o\", \"r\", &RepositoryContentGetOptions{})\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetReadme returned error: %v\", err)\n\t}\n\twant := &RepositoryContent{Type: Ptr(\"file\"), Name: Ptr(\"README.md\"), Size: Ptr(5362), Encoding: Ptr(\"base64\"), Path: Ptr(\"README.md\")}\n\tif !cmp.Equal(readme, want) {\n\t\tt.Errorf(\"Repositories.GetReadme returned %+v, want %+v\", readme, want)\n\t}\n\n\tconst methodName = \"GetReadme\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetReadme(ctx, \"\\n\", \"\\n\", &RepositoryContentGetOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetReadme(ctx, \"o\", \"r\", &RepositoryContentGetOptions{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_DownloadContents_SuccessForFile(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, serverURL := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/contents/d/f\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t  \"type\": \"file\",\n\t\t  \"name\": \"f\",\n          \"content\": \"foo\",\n\t\t  \"download_url\": \"`+serverURL+baseURLPath+`/download/f\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tr, resp, err := client.Repositories.DownloadContents(ctx, \"o\", \"r\", \"d/f\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.DownloadContents returned error: %v\", err)\n\t}\n\n\tif got, want := resp.Response.StatusCode, http.StatusOK; got != want {\n\t\tt.Errorf(\"Repositories.DownloadContents returned status code %v, want %v\", got, want)\n\t}\n\n\tbytes, err := io.ReadAll(r)\n\tif err != nil {\n\t\tt.Errorf(\"Error reading response body: %v\", err)\n\t}\n\tr.Close()\n\n\tif got, want := string(bytes), \"foo\"; got != want {\n\t\tt.Errorf(\"Repositories.DownloadContents returned %v, want %v\", got, want)\n\t}\n\n\tconst methodName = \"DownloadContents\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.DownloadContents(ctx, \"\\n\", \"\\n\", \"\\n\", nil)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.DownloadContents(ctx, \"o\", \"r\", \"d/f\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_DownloadContents_SuccessForDirectory(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, serverURL := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/contents/d/f\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t  \"type\": \"file\",\n\t\t  \"name\": \"f\"\n\t\t}`)\n\t})\n\tmux.HandleFunc(\"/repos/o/r/contents/d\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\n\t\t  \"type\": \"file\",\n\t\t  \"name\": \"f\",\n\t\t  \"download_url\": \"`+serverURL+baseURLPath+`/download/f\"\n\t\t}]`)\n\t})\n\tmux.HandleFunc(\"/download/f\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, \"foo\")\n\t})\n\n\tctx := t.Context()\n\tr, resp, err := client.Repositories.DownloadContents(ctx, \"o\", \"r\", \"d/f\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.DownloadContents returned error: %v\", err)\n\t}\n\n\tif got, want := resp.Response.StatusCode, http.StatusOK; got != want {\n\t\tt.Errorf(\"Repositories.DownloadContents returned status code %v, want %v\", got, want)\n\t}\n\n\tbytes, err := io.ReadAll(r)\n\tif err != nil {\n\t\tt.Errorf(\"Error reading response body: %v\", err)\n\t}\n\tr.Close()\n\n\tif got, want := string(bytes), \"foo\"; got != want {\n\t\tt.Errorf(\"Repositories.DownloadContents returned %v, want %v\", got, want)\n\t}\n\n\tconst methodName = \"DownloadContents\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.DownloadContents(ctx, \"\\n\", \"\\n\", \"\\n\", nil)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.DownloadContents(ctx, \"o\", \"r\", \"d/f\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_DownloadContents_FailedResponse(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, serverURL := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/contents/d/f\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"type\": \"file\",\n\t\t\t\"name\": \"f\"\n\t\t  }`)\n\t})\n\tmux.HandleFunc(\"/repos/o/r/contents/d\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"type\": \"file\",\n\t\t\t\"name\": \"f\",\n\t\t\t\"download_url\": \"`+serverURL+baseURLPath+`/download/f\"\n\t\t  }]`)\n\t})\n\tmux.HandleFunc(\"/download/f\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tfmt.Fprint(w, \"foo error\")\n\t})\n\n\tctx := t.Context()\n\tr, resp, err := client.Repositories.DownloadContents(ctx, \"o\", \"r\", \"d/f\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.DownloadContents returned error: %v\", err)\n\t}\n\n\tif got, want := resp.Response.StatusCode, http.StatusInternalServerError; got != want {\n\t\tt.Errorf(\"Repositories.DownloadContents returned status code %v, want %v\", got, want)\n\t}\n\n\tbytes, err := io.ReadAll(r)\n\tif err != nil {\n\t\tt.Errorf(\"Error reading response body: %v\", err)\n\t}\n\tr.Close()\n\n\tif got, want := string(bytes), \"foo error\"; got != want {\n\t\tt.Errorf(\"Repositories.DownloadContents returned %v, want %v\", got, want)\n\t}\n}\n\nfunc TestRepositoriesService_DownloadContents_NoDownloadURL(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/contents/d/f\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t  \"type\": \"file\",\n\t\t  \"name\": \"f\",\n\t\t  \"content\": \"\"\n\t\t}`)\n\t})\n\tmux.HandleFunc(\"/repos/o/r/contents/d\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\n\t\t  \"type\": \"file\",\n\t\t  \"name\": \"f\",\n\t\t  \"content\": \"\"\n\t\t}]`)\n\t})\n\n\tctx := t.Context()\n\treader, resp, err := client.Repositories.DownloadContents(ctx, \"o\", \"r\", \"d/f\", nil)\n\tif err == nil {\n\t\tt.Error(\"Repositories.DownloadContents did not return expected error\")\n\t}\n\n\tif resp == nil {\n\t\tt.Error(\"Repositories.DownloadContents did not return expected response\")\n\t}\n\n\tif reader != nil {\n\t\tt.Error(\"Repositories.DownloadContents did not return expected reader\")\n\t}\n}\n\nfunc TestRepositoriesService_DownloadContents_NoFile(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/contents/d/f\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t  \"type\": \"file\",\n\t\t  \"name\": \"f\",\n\t\t  \"content\": \"\"\n\t\t}`)\n\t})\n\n\tmux.HandleFunc(\"/repos/o/r/contents/d\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[]`)\n\t})\n\n\tctx := t.Context()\n\treader, resp, err := client.Repositories.DownloadContents(ctx, \"o\", \"r\", \"d/f\", nil)\n\tif err == nil {\n\t\tt.Error(\"Repositories.DownloadContents did not return expected error\")\n\t}\n\n\tif resp == nil {\n\t\tt.Error(\"Repositories.DownloadContents did not return expected response\")\n\t}\n\n\tif reader != nil {\n\t\tt.Error(\"Repositories.DownloadContents did not return expected reader\")\n\t}\n}\n\nfunc TestRepositoriesService_DownloadContentsWithMeta_SuccessForFile(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, serverURL := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/contents/d/f\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t  \"type\": \"file\",\n\t\t  \"name\": \"f\",\n\t\t  \"download_url\": \"`+serverURL+baseURLPath+`/download/f\",\n          \"content\": \"foo\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tr, c, resp, err := client.Repositories.DownloadContentsWithMeta(ctx, \"o\", \"r\", \"d/f\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.DownloadContentsWithMeta returned error: %v\", err)\n\t}\n\n\tif got, want := resp.Response.StatusCode, http.StatusOK; got != want {\n\t\tt.Errorf(\"Repositories.DownloadContentsWithMeta returned status code %v, want %v\", got, want)\n\t}\n\n\tbytes, err := io.ReadAll(r)\n\tif err != nil {\n\t\tt.Errorf(\"Error reading response body: %v\", err)\n\t}\n\tr.Close()\n\n\tif got, want := string(bytes), \"foo\"; got != want {\n\t\tt.Errorf(\"Repositories.DownloadContentsWithMeta returned %v, want %v\", got, want)\n\t}\n\n\tif c != nil && c.Name != nil {\n\t\tif got, want := *c.Name, \"f\"; got != want {\n\t\t\tt.Errorf(\"Repositories.DownloadContentsWithMeta returned content name %v, want %v\", got, want)\n\t\t}\n\t} else {\n\t\tt.Error(\"Returned RepositoryContent is null\")\n\t}\n\n\tconst methodName = \"DownloadContentsWithMeta\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, _, err = client.Repositories.DownloadContentsWithMeta(ctx, \"\\n\", \"\\n\", \"\\n\", nil)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, cot, resp, err := client.Repositories.DownloadContentsWithMeta(ctx, \"o\", \"r\", \"d/f\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\tif cot != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, cot)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_DownloadContentsWithMeta_SuccessForDirectory(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, serverURL := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/contents/d\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\n\t\t  \"type\": \"file\",\n\t\t  \"name\": \"f\",\n\t\t  \"download_url\": \"`+serverURL+baseURLPath+`/download/f\"\n\t\t}]`)\n\t})\n\tmux.HandleFunc(\"/download/f\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, \"foo\")\n\t})\n\n\tctx := t.Context()\n\tr, c, resp, err := client.Repositories.DownloadContentsWithMeta(ctx, \"o\", \"r\", \"d/f\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.DownloadContentsWithMeta returned error: %v\", err)\n\t}\n\n\tif got, want := resp.Response.StatusCode, http.StatusOK; got != want {\n\t\tt.Errorf(\"Repositories.DownloadContentsWithMeta returned status code %v, want %v\", got, want)\n\t}\n\n\tbytes, err := io.ReadAll(r)\n\tif err != nil {\n\t\tt.Errorf(\"Error reading response body: %v\", err)\n\t}\n\tr.Close()\n\n\tif got, want := string(bytes), \"foo\"; got != want {\n\t\tt.Errorf(\"Repositories.DownloadContentsWithMeta returned %v, want %v\", got, want)\n\t}\n\n\tif c != nil && c.Name != nil {\n\t\tif got, want := *c.Name, \"f\"; got != want {\n\t\t\tt.Errorf(\"Repositories.DownloadContentsWithMeta returned content name %v, want %v\", got, want)\n\t\t}\n\t} else {\n\t\tt.Error(\"Returned RepositoryContent is null\")\n\t}\n}\n\nfunc TestRepositoriesService_DownloadContentsWithMeta_FailedResponse(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, serverURL := setup(t)\n\n\tdownloadURL := fmt.Sprintf(\"%v%v/download/f\", serverURL, baseURLPath)\n\n\tmux.HandleFunc(\"/repos/o/r/contents/d/f\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"type\": \"file\",\n\t\t\t\"name\": \"f\",\n\t\t\t\"download_url\": \"`+downloadURL+`\"\n\t\t  }`)\n\t})\n\tmux.HandleFunc(\"/download/f\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\tfmt.Fprint(w, \"foo error\")\n\t})\n\tmux.HandleFunc(\"/repos/o/r/contents/d\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"type\": \"file\",\n\t\t\t\"name\": \"f\",\n\t\t\t\"download_url\": \"`+downloadURL+`\"\n\t\t  }]`)\n\t})\n\n\tctx := t.Context()\n\tr, c, resp, err := client.Repositories.DownloadContentsWithMeta(ctx, \"o\", \"r\", \"d/f\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.DownloadContentsWithMeta returned error: %v\", err)\n\t}\n\n\tif got, want := resp.Response.StatusCode, http.StatusInternalServerError; got != want {\n\t\tt.Errorf(\"Repositories.DownloadContentsWithMeta returned status code %v, want %v\", got, want)\n\t}\n\n\tbytes, err := io.ReadAll(r)\n\tif err != nil {\n\t\tt.Errorf(\"Error reading response body: %v\", err)\n\t}\n\tr.Close()\n\n\tif got, want := string(bytes), \"foo error\"; got != want {\n\t\tt.Errorf(\"Repositories.DownloadContentsWithMeta returned %v, want %v\", got, want)\n\t}\n\n\tif c != nil && c.Name != nil {\n\t\tif got, want := *c.Name, \"f\"; got != want {\n\t\t\tt.Errorf(\"Repositories.DownloadContentsWithMeta returned content name %v, want %v\", got, want)\n\t\t}\n\t} else {\n\t\tt.Error(\"Returned RepositoryContent is null\")\n\t}\n}\n\nfunc TestRepositoriesService_DownloadContentsWithMeta_NoDownloadURL(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/contents/d/f\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t  \"type\": \"file\",\n\t\t  \"name\": \"f\",\n\t\t}`)\n\t})\n\tmux.HandleFunc(\"/repos/o/r/contents/d\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\n\t\t  \"type\": \"file\",\n\t\t  \"name\": \"f\",\n\t\t  \"content\": \"\"\n\t\t}]`)\n\t})\n\n\tctx := t.Context()\n\treader, contents, resp, err := client.Repositories.DownloadContentsWithMeta(ctx, \"o\", \"r\", \"d/f\", nil)\n\tif err == nil {\n\t\tt.Error(\"Repositories.DownloadContentsWithMeta did not return expected error\")\n\t}\n\n\tif reader != nil {\n\t\tt.Error(\"Repositories.DownloadContentsWithMeta did not return expected reader\")\n\t}\n\n\tif resp == nil {\n\t\tt.Error(\"Repositories.DownloadContentsWithMeta did not return expected response\")\n\t}\n\n\tif contents == nil {\n\t\tt.Error(\"Repositories.DownloadContentsWithMeta did not return expected content\")\n\t}\n}\n\nfunc TestRepositoriesService_DownloadContentsWithMeta_NoFile(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/contents/d\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[]`)\n\t})\n\n\tctx := t.Context()\n\t_, _, resp, err := client.Repositories.DownloadContentsWithMeta(ctx, \"o\", \"r\", \"d/f\", nil)\n\tif err == nil {\n\t\tt.Error(\"Repositories.DownloadContentsWithMeta did not return expected error\")\n\t}\n\n\tif resp == nil {\n\t\tt.Error(\"Repositories.DownloadContentsWithMeta did not return expected response\")\n\t}\n}\n\nfunc TestRepositoriesService_GetContents_File(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/contents/p\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t  \"type\": \"file\",\n\t\t  \"encoding\": \"base64\",\n\t\t  \"size\": 20678,\n\t\t  \"name\": \"LICENSE\",\n\t\t  \"path\": \"LICENSE\"\n\t\t}`)\n\t})\n\tctx := t.Context()\n\tfileContents, _, _, err := client.Repositories.GetContents(ctx, \"o\", \"r\", \"p\", &RepositoryContentGetOptions{})\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetContents returned error: %v\", err)\n\t}\n\twant := &RepositoryContent{Type: Ptr(\"file\"), Name: Ptr(\"LICENSE\"), Size: Ptr(20678), Encoding: Ptr(\"base64\"), Path: Ptr(\"LICENSE\")}\n\tif !cmp.Equal(fileContents, want) {\n\t\tt.Errorf(\"Repositories.GetContents returned %+v, want %+v\", fileContents, want)\n\t}\n\n\tconst methodName = \"GetContents\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, _, err = client.Repositories.GetContents(ctx, \"\\n\", \"\\n\", \"\\n\", &RepositoryContentGetOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, _, resp, err := client.Repositories.GetContents(ctx, \"o\", \"r\", \"p\", &RepositoryContentGetOptions{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetContents_FilenameNeedsEscape(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/contents/p#?%/中.go\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{}`)\n\t})\n\tctx := t.Context()\n\t_, _, _, err := client.Repositories.GetContents(ctx, \"o\", \"r\", \"p#?%/中.go\", &RepositoryContentGetOptions{})\n\tif err != nil {\n\t\tt.Fatalf(\"Repositories.GetContents returned error: %v\", err)\n\t}\n}\n\nfunc TestRepositoriesService_GetContents_DirectoryWithSpaces(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/contents/some%20directory/file.go\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{}`)\n\t})\n\tctx := t.Context()\n\t_, _, _, err := client.Repositories.GetContents(ctx, \"o\", \"r\", \"some directory/file.go\", &RepositoryContentGetOptions{})\n\tif err != nil {\n\t\tt.Fatalf(\"Repositories.GetContents returned error: %v\", err)\n\t}\n}\n\nfunc TestRepositoriesService_GetContents_PathWithParent(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/contents/some/../directory/file.go\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{}`)\n\t})\n\tctx := t.Context()\n\t_, _, _, err := client.Repositories.GetContents(ctx, \"o\", \"r\", \"some/../directory/file.go\", &RepositoryContentGetOptions{})\n\tif err == nil {\n\t\tt.Fatal(\"Repositories.GetContents expected error but got none\")\n\t}\n}\n\nfunc TestRepositoriesService_GetContents_DirectoryWithPlusChars(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/contents/some%20directory%2Bname/file.go\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{}`)\n\t})\n\tctx := t.Context()\n\t_, _, _, err := client.Repositories.GetContents(ctx, \"o\", \"r\", \"some directory+name/file.go\", &RepositoryContentGetOptions{})\n\tif err != nil {\n\t\tt.Fatalf(\"Repositories.GetContents returned error: %v\", err)\n\t}\n}\n\nfunc TestRepositoriesService_GetContents_Directory(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/contents/p\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\n\t\t  \"type\": \"dir\",\n\t\t  \"name\": \"lib\",\n\t\t  \"path\": \"lib\"\n\t\t},\n\t\t{\n\t\t  \"type\": \"file\",\n\t\t  \"size\": 20678,\n\t\t  \"name\": \"LICENSE\",\n\t\t  \"path\": \"LICENSE\"\n\t\t}]`)\n\t})\n\tctx := t.Context()\n\t_, directoryContents, _, err := client.Repositories.GetContents(ctx, \"o\", \"r\", \"p\", &RepositoryContentGetOptions{})\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetContents returned error: %v\", err)\n\t}\n\twant := []*RepositoryContent{\n\t\t{Type: Ptr(\"dir\"), Name: Ptr(\"lib\"), Path: Ptr(\"lib\")},\n\t\t{Type: Ptr(\"file\"), Name: Ptr(\"LICENSE\"), Size: Ptr(20678), Path: Ptr(\"LICENSE\")},\n\t}\n\tif !cmp.Equal(directoryContents, want) {\n\t\tt.Errorf(\"Repositories.GetContents_Directory returned %+v, want %+v\", directoryContents, want)\n\t}\n}\n\nfunc TestRepositoriesService_CreateFile(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/contents/p\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"content\":{\n\t\t\t\t\"name\":\"p\"\n\t\t\t},\n\t\t\t\"commit\":{\n\t\t\t\t\"message\":\"m\",\n\t\t\t\t\"sha\":\"f5f369044773ff9c6383c087466d12adb6fa0828\"\n\t\t\t}\n\t\t}`)\n\t})\n\tmessage := \"m\"\n\tcontent := []byte(\"c\")\n\trepositoryContentsOptions := &RepositoryContentFileOptions{\n\t\tMessage:   &message,\n\t\tContent:   content,\n\t\tCommitter: &CommitAuthor{Name: Ptr(\"n\"), Email: Ptr(\"e\")},\n\t}\n\tctx := t.Context()\n\tcreateResponse, _, err := client.Repositories.CreateFile(ctx, \"o\", \"r\", \"p\", repositoryContentsOptions)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.CreateFile returned error: %v\", err)\n\t}\n\twant := &RepositoryContentResponse{\n\t\tContent: &RepositoryContent{Name: Ptr(\"p\")},\n\t\tCommit: Commit{\n\t\t\tMessage: Ptr(\"m\"),\n\t\t\tSHA:     Ptr(\"f5f369044773ff9c6383c087466d12adb6fa0828\"),\n\t\t},\n\t}\n\tif !cmp.Equal(createResponse, want) {\n\t\tt.Errorf(\"Repositories.CreateFile returned %+v, want %+v\", createResponse, want)\n\t}\n\n\tconst methodName = \"CreateFile\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.CreateFile(ctx, \"\\n\", \"\\n\", \"\\n\", repositoryContentsOptions)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.CreateFile(ctx, \"o\", \"r\", \"p\", repositoryContentsOptions)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_UpdateFile(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/contents/p\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"content\":{\n\t\t\t\t\"name\":\"p\"\n\t\t\t},\n\t\t\t\"commit\":{\n\t\t\t\t\"message\":\"m\",\n\t\t\t\t\"sha\":\"f5f369044773ff9c6383c087466d12adb6fa0828\"\n\t\t\t}\n\t\t}`)\n\t})\n\tmessage := \"m\"\n\tcontent := []byte(\"c\")\n\tsha := \"f5f369044773ff9c6383c087466d12adb6fa0828\"\n\trepositoryContentsOptions := &RepositoryContentFileOptions{\n\t\tMessage:   &message,\n\t\tContent:   content,\n\t\tSHA:       &sha,\n\t\tCommitter: &CommitAuthor{Name: Ptr(\"n\"), Email: Ptr(\"e\")},\n\t}\n\tctx := t.Context()\n\tupdateResponse, _, err := client.Repositories.UpdateFile(ctx, \"o\", \"r\", \"p\", repositoryContentsOptions)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.UpdateFile returned error: %v\", err)\n\t}\n\twant := &RepositoryContentResponse{\n\t\tContent: &RepositoryContent{Name: Ptr(\"p\")},\n\t\tCommit: Commit{\n\t\t\tMessage: Ptr(\"m\"),\n\t\t\tSHA:     Ptr(\"f5f369044773ff9c6383c087466d12adb6fa0828\"),\n\t\t},\n\t}\n\tif !cmp.Equal(updateResponse, want) {\n\t\tt.Errorf(\"Repositories.UpdateFile returned %+v, want %+v\", updateResponse, want)\n\t}\n\n\tconst methodName = \"UpdateFile\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.UpdateFile(ctx, \"\\n\", \"\\n\", \"\\n\", repositoryContentsOptions)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.UpdateFile(ctx, \"o\", \"r\", \"p\", repositoryContentsOptions)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_DeleteFile(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/contents/p\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"content\": null,\n\t\t\t\"commit\":{\n\t\t\t\t\"message\":\"m\",\n\t\t\t\t\"sha\":\"f5f369044773ff9c6383c087466d12adb6fa0828\"\n\t\t\t}\n\t\t}`)\n\t})\n\tmessage := \"m\"\n\tsha := \"f5f369044773ff9c6383c087466d12adb6fa0828\"\n\trepositoryContentsOptions := &RepositoryContentFileOptions{\n\t\tMessage:   &message,\n\t\tSHA:       &sha,\n\t\tCommitter: &CommitAuthor{Name: Ptr(\"n\"), Email: Ptr(\"e\")},\n\t}\n\tctx := t.Context()\n\tdeleteResponse, _, err := client.Repositories.DeleteFile(ctx, \"o\", \"r\", \"p\", repositoryContentsOptions)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.DeleteFile returned error: %v\", err)\n\t}\n\twant := &RepositoryContentResponse{\n\t\tContent: nil,\n\t\tCommit: Commit{\n\t\t\tMessage: Ptr(\"m\"),\n\t\t\tSHA:     Ptr(\"f5f369044773ff9c6383c087466d12adb6fa0828\"),\n\t\t},\n\t}\n\tif !cmp.Equal(deleteResponse, want) {\n\t\tt.Errorf(\"Repositories.DeleteFile returned %+v, want %+v\", deleteResponse, want)\n\t}\n\n\tconst methodName = \"DeleteFile\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.DeleteFile(ctx, \"\\n\", \"\\n\", \"\\n\", repositoryContentsOptions)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.DeleteFile(ctx, \"o\", \"r\", \"p\", repositoryContentsOptions)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetArchiveLink(t *testing.T) {\n\tt.Parallel()\n\ttcs := []struct {\n\t\tname              string\n\t\trespectRateLimits bool\n\t}{\n\t\t{\n\t\t\tname:              \"withoutRateLimits\",\n\t\t\trespectRateLimits: false,\n\t\t},\n\t\t{\n\t\t\tname:              \"withRateLimits\",\n\t\t\trespectRateLimits: true,\n\t\t},\n\t}\n\n\tfor _, tc := range tcs {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\t\t\tclient.RateLimitRedirectionalEndpoints = tc.respectRateLimits\n\n\t\t\tmux.HandleFunc(\"/repos/o/r/tarball/yo\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\thttp.Redirect(w, r, \"https://github.com/a\", http.StatusFound)\n\t\t\t})\n\t\t\tctx := t.Context()\n\t\t\turl, resp, err := client.Repositories.GetArchiveLink(ctx, \"o\", \"r\", Tarball, &RepositoryContentGetOptions{Ref: \"yo\"}, 1)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.GetArchiveLink returned error: %v\", err)\n\t\t\t}\n\t\t\tif resp.StatusCode != http.StatusFound {\n\t\t\t\tt.Errorf(\"Repositories.GetArchiveLink returned status: %v, want %v\", resp.StatusCode, http.StatusFound)\n\t\t\t}\n\t\t\twant := \"https://github.com/a\"\n\t\t\tif url.String() != want {\n\t\t\t\tt.Errorf(\"Repositories.GetArchiveLink returned %+v, want %+v\", url, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"GetArchiveLink\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.GetArchiveLink(ctx, \"\\n\", \"\\n\", Tarball, &RepositoryContentGetOptions{}, 1)\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\t// Add custom round tripper\n\t\t\tclient.client.Transport = roundTripperFunc(func(*http.Request) (*http.Response, error) {\n\t\t\t\treturn nil, errors.New(\"failed to get archive link\")\n\t\t\t})\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.GetArchiveLink(ctx, \"o\", \"r\", Tarball, &RepositoryContentGetOptions{}, 1)\n\t\t\t\treturn err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_GetArchiveLink_StatusMovedPermanently_dontFollowRedirects(t *testing.T) {\n\tt.Parallel()\n\ttcs := []struct {\n\t\tname              string\n\t\trespectRateLimits bool\n\t}{\n\t\t{\n\t\t\tname:              \"withoutRateLimits\",\n\t\t\trespectRateLimits: false,\n\t\t},\n\t\t{\n\t\t\tname:              \"withRateLimits\",\n\t\t\trespectRateLimits: true,\n\t\t},\n\t}\n\n\tfor _, tc := range tcs {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\t\t\tclient.RateLimitRedirectionalEndpoints = tc.respectRateLimits\n\n\t\t\tmux.HandleFunc(\"/repos/o/r/tarball\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\thttp.Redirect(w, r, \"https://github.com/a\", http.StatusMovedPermanently)\n\t\t\t})\n\t\t\tctx := t.Context()\n\t\t\t_, resp, _ := client.Repositories.GetArchiveLink(ctx, \"o\", \"r\", Tarball, &RepositoryContentGetOptions{}, 0)\n\t\t\tif resp.StatusCode != http.StatusMovedPermanently {\n\t\t\t\tt.Errorf(\"Repositories.GetArchiveLink returned status: %v, want %v\", resp.StatusCode, http.StatusMovedPermanently)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_GetArchiveLink_StatusMovedPermanently_followRedirects(t *testing.T) {\n\tt.Parallel()\n\ttcs := []struct {\n\t\tname              string\n\t\trespectRateLimits bool\n\t}{\n\t\t{\n\t\t\tname:              \"withoutRateLimits\",\n\t\t\trespectRateLimits: false,\n\t\t},\n\t\t{\n\t\t\tname:              \"withRateLimits\",\n\t\t\trespectRateLimits: true,\n\t\t},\n\t}\n\n\tfor _, tc := range tcs {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, serverURL := setup(t)\n\t\t\tclient.RateLimitRedirectionalEndpoints = tc.respectRateLimits\n\n\t\t\t// Mock a redirect link, which leads to an archive link\n\t\t\tmux.HandleFunc(\"/repos/o/r/tarball\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\tredirectURL, _ := url.Parse(serverURL + baseURLPath + \"/redirect\")\n\t\t\t\thttp.Redirect(w, r, redirectURL.String(), http.StatusMovedPermanently)\n\t\t\t})\n\t\t\tmux.HandleFunc(\"/redirect\", func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\thttp.Redirect(w, r, \"https://github.com/a\", http.StatusFound)\n\t\t\t})\n\t\t\tctx := t.Context()\n\t\t\turl, resp, err := client.Repositories.GetArchiveLink(ctx, \"o\", \"r\", Tarball, &RepositoryContentGetOptions{}, 1)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.GetArchiveLink returned error: %v\", err)\n\t\t\t}\n\t\t\tif resp.StatusCode != http.StatusFound {\n\t\t\t\tt.Errorf(\"Repositories.GetArchiveLink returned status: %v, want %v\", resp.StatusCode, http.StatusFound)\n\t\t\t}\n\t\t\twant := \"https://github.com/a\"\n\t\t\tif url.String() != want {\n\t\t\t\tt.Errorf(\"Repositories.GetArchiveLink returned %+v, want %+v\", url, want)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_GetContents_NoTrailingSlashInDirectoryApiPath(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/contents/.github\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"ref\": \"mybranch\"})\n\t\tfmt.Fprint(w, `{}`)\n\t})\n\tctx := t.Context()\n\t_, _, _, err := client.Repositories.GetContents(ctx, \"o\", \"r\", \".github/\", &RepositoryContentGetOptions{\n\t\tRef: \"mybranch\",\n\t})\n\tif err != nil {\n\t\tt.Fatalf(\"Repositories.GetContents returned error: %v\", err)\n\t}\n}\n\nfunc TestRepositoryContent_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RepositoryContent{}, \"{}\")\n\n\tr := &RepositoryContent{\n\t\tType:            Ptr(\"type\"),\n\t\tTarget:          Ptr(\"target\"),\n\t\tEncoding:        Ptr(\"encoding\"),\n\t\tSize:            Ptr(1),\n\t\tName:            Ptr(\"name\"),\n\t\tPath:            Ptr(\"path\"),\n\t\tContent:         Ptr(\"content\"),\n\t\tSHA:             Ptr(\"sha\"),\n\t\tURL:             Ptr(\"url\"),\n\t\tGitURL:          Ptr(\"gurl\"),\n\t\tHTMLURL:         Ptr(\"hurl\"),\n\t\tDownloadURL:     Ptr(\"durl\"),\n\t\tSubmoduleGitURL: Ptr(\"smgurl\"),\n\t}\n\n\twant := `{\n\t\t\"type\": \"type\",\n\t\t\"target\": \"target\",\n\t\t\"encoding\": \"encoding\",\n\t\t\"size\": 1,\n\t\t\"name\": \"name\",\n\t\t\"path\": \"path\",\n\t\t\"content\": \"content\",\n\t\t\"sha\": \"sha\",\n\t\t\"url\": \"url\",\n\t\t\"git_url\": \"gurl\",\n\t\t\"html_url\": \"hurl\",\n\t\t\"download_url\": \"durl\",\n\t\t\"submodule_git_url\": \"smgurl\"\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n\nfunc TestRepositoryContentResponse_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RepositoryContentResponse{}, `{\"commit\": {}}`)\n\n\tr := &RepositoryContentResponse{\n\t\tContent: &RepositoryContent{\n\t\t\tType:            Ptr(\"type\"),\n\t\t\tTarget:          Ptr(\"target\"),\n\t\t\tEncoding:        Ptr(\"encoding\"),\n\t\t\tSize:            Ptr(1),\n\t\t\tName:            Ptr(\"name\"),\n\t\t\tPath:            Ptr(\"path\"),\n\t\t\tContent:         Ptr(\"content\"),\n\t\t\tSHA:             Ptr(\"sha\"),\n\t\t\tURL:             Ptr(\"url\"),\n\t\t\tGitURL:          Ptr(\"gurl\"),\n\t\t\tHTMLURL:         Ptr(\"hurl\"),\n\t\t\tDownloadURL:     Ptr(\"durl\"),\n\t\t\tSubmoduleGitURL: Ptr(\"smgurl\"),\n\t\t},\n\t\tCommit: Commit{\n\t\t\tSHA: Ptr(\"s\"),\n\t\t\tAuthor: &CommitAuthor{\n\t\t\t\tDate:  &Timestamp{referenceTime},\n\t\t\t\tName:  Ptr(\"n\"),\n\t\t\t\tEmail: Ptr(\"e\"),\n\t\t\t\tLogin: Ptr(\"u\"),\n\t\t\t},\n\t\t\tCommitter: &CommitAuthor{\n\t\t\t\tDate:  &Timestamp{referenceTime},\n\t\t\t\tName:  Ptr(\"n\"),\n\t\t\t\tEmail: Ptr(\"e\"),\n\t\t\t\tLogin: Ptr(\"u\"),\n\t\t\t},\n\t\t\tMessage: Ptr(\"m\"),\n\t\t\tTree: &Tree{\n\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\tEntries: []*TreeEntry{{\n\t\t\t\t\tSHA:     Ptr(\"s\"),\n\t\t\t\t\tPath:    Ptr(\"p\"),\n\t\t\t\t\tMode:    Ptr(\"m\"),\n\t\t\t\t\tType:    Ptr(\"t\"),\n\t\t\t\t\tSize:    Ptr(1),\n\t\t\t\t\tContent: Ptr(\"c\"),\n\t\t\t\t\tURL:     Ptr(\"u\"),\n\t\t\t\t}},\n\t\t\t\tTruncated: Ptr(false),\n\t\t\t},\n\t\t\tParents: nil,\n\t\t\tHTMLURL: Ptr(\"h\"),\n\t\t\tURL:     Ptr(\"u\"),\n\t\t\tVerification: &SignatureVerification{\n\t\t\t\tVerified:  Ptr(false),\n\t\t\t\tReason:    Ptr(\"r\"),\n\t\t\t\tSignature: Ptr(\"s\"),\n\t\t\t\tPayload:   Ptr(\"p\"),\n\t\t\t},\n\t\t\tNodeID:       Ptr(\"n\"),\n\t\t\tCommentCount: Ptr(1),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"content\": {\n\t\t\t\"type\": \"type\",\n\t\t\t\"target\": \"target\",\n\t\t\t\"encoding\": \"encoding\",\n\t\t\t\"size\": 1,\n\t\t\t\"name\": \"name\",\n\t\t\t\"path\": \"path\",\n\t\t\t\"content\": \"content\",\n\t\t\t\"sha\": \"sha\",\n\t\t\t\"url\": \"url\",\n\t\t\t\"git_url\": \"gurl\",\n\t\t\t\"html_url\": \"hurl\",\n\t\t\t\"download_url\": \"durl\",\n\t\t\t\"submodule_git_url\": \"smgurl\"\n\t\t},\n\t\t\"commit\": {\n\t\t\t\"sha\": \"s\",\n\t\t\t\"author\": {\n\t\t\t\t\"date\": ` + referenceTimeStr + `,\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"username\": \"u\"\n\t\t\t},\n\t\t\t\"committer\": {\n\t\t\t\t\"date\": ` + referenceTimeStr + `,\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"email\": \"e\",\n\t\t\t\t\"username\": \"u\"\n\t\t\t},\n\t\t\t\"message\": \"m\",\n\t\t\t\"tree\": {\n\t\t\t\t\"sha\": \"s\",\n\t\t\t\t\"tree\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"sha\": \"s\",\n\t\t\t\t\t\t\"path\": \"p\",\n\t\t\t\t\t\t\"mode\": \"m\",\n\t\t\t\t\t\t\"type\": \"t\",\n\t\t\t\t\t\t\"size\": 1,\n\t\t\t\t\t\t\"content\": \"c\",\n\t\t\t\t\t\t\"url\": \"u\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"truncated\": false\n\t\t\t},\n\t\t\t\"html_url\": \"h\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"verification\": {\n\t\t\t\t\"verified\": false,\n\t\t\t\t\"reason\": \"r\",\n\t\t\t\t\"signature\": \"s\",\n\t\t\t\t\"payload\": \"p\"\n\t\t\t},\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"comment_count\": 1\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n\nfunc TestRepositoryContentFileOptions_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RepositoryContentFileOptions{}, `{\"content\": null}`)\n\n\tr := &RepositoryContentFileOptions{\n\t\tMessage: Ptr(\"type\"),\n\t\tContent: []byte{1},\n\t\tSHA:     Ptr(\"type\"),\n\t\tBranch:  Ptr(\"type\"),\n\t\tAuthor: &CommitAuthor{\n\t\t\tDate:  &Timestamp{referenceTime},\n\t\t\tName:  Ptr(\"name\"),\n\t\t\tEmail: Ptr(\"email\"),\n\t\t\tLogin: Ptr(\"login\"),\n\t\t},\n\t\tCommitter: &CommitAuthor{\n\t\t\tDate:  &Timestamp{referenceTime},\n\t\t\tName:  Ptr(\"name\"),\n\t\t\tEmail: Ptr(\"email\"),\n\t\t\tLogin: Ptr(\"login\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"message\": \"type\",\n\t\t\"content\": \"AQ==\",\n\t\t\"sha\": \"type\",\n\t\t\"branch\": \"type\",\n\t\t\"author\": {\n\t\t\t\"date\": ` + referenceTimeStr + `,\n\t\t\t\"name\": \"name\",\n\t\t\t\"email\": \"email\",\n\t\t\t\"username\": \"login\"\n\t\t},\n\t\t\"committer\": {\n\t\t\t\"date\": ` + referenceTimeStr + `,\n\t\t\t\"name\": \"name\",\n\t\t\t\"email\": \"email\",\n\t\t\t\"username\": \"login\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n"
  },
  {
    "path": "github/repos_deployment_branch_policies.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// DeploymentBranchPolicy represents a single deployment branch policy for an environment.\ntype DeploymentBranchPolicy struct {\n\tName   *string `json:\"name,omitempty\"`\n\tID     *int64  `json:\"id,omitempty\"`\n\tNodeID *string `json:\"node_id,omitempty\"`\n\tType   *string `json:\"type,omitempty\"`\n}\n\n// DeploymentBranchPolicyResponse represents the slightly different format of response that comes back when you list deployment branch policies.\ntype DeploymentBranchPolicyResponse struct {\n\tTotalCount     *int                      `json:\"total_count,omitempty\"`\n\tBranchPolicies []*DeploymentBranchPolicy `json:\"branch_policies,omitempty\"`\n}\n\n// DeploymentBranchPolicyRequest represents a deployment branch policy request.\ntype DeploymentBranchPolicyRequest struct {\n\tName *string `json:\"name,omitempty\"`\n\tType *string `json:\"type,omitempty\"`\n}\n\n// ListDeploymentBranchPolicies lists the deployment branch policies for an environment.\n//\n// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#list-deployment-branch-policies\n//\n//meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies\nfunc (s *RepositoriesService) ListDeploymentBranchPolicies(ctx context.Context, owner, repo, environment string, opts *ListOptions) (*DeploymentBranchPolicyResponse, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/environments/%v/deployment-branch-policies\", owner, repo, environment)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar list *DeploymentBranchPolicyResponse\n\tresp, err := s.client.Do(ctx, req, &list)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn list, resp, nil\n}\n\n// GetDeploymentBranchPolicy gets a deployment branch policy for an environment.\n//\n// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#get-a-deployment-branch-policy\n//\n//meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}\nfunc (s *RepositoriesService) GetDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, branchPolicyID int64) (*DeploymentBranchPolicy, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/environments/%v/deployment-branch-policies/%v\", owner, repo, environment, branchPolicyID)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar policy *DeploymentBranchPolicy\n\tresp, err := s.client.Do(ctx, req, &policy)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn policy, resp, nil\n}\n\n// CreateDeploymentBranchPolicy creates a deployment branch policy for an environment.\n//\n// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#create-a-deployment-branch-policy\n//\n//meta:operation POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies\nfunc (s *RepositoriesService) CreateDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, request *DeploymentBranchPolicyRequest) (*DeploymentBranchPolicy, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/environments/%v/deployment-branch-policies\", owner, repo, environment)\n\n\treq, err := s.client.NewRequest(\"POST\", u, request)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar policy *DeploymentBranchPolicy\n\tresp, err := s.client.Do(ctx, req, &policy)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn policy, resp, nil\n}\n\n// UpdateDeploymentBranchPolicy updates a deployment branch policy for an environment.\n//\n// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#update-a-deployment-branch-policy\n//\n//meta:operation PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}\nfunc (s *RepositoriesService) UpdateDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, branchPolicyID int64, request *DeploymentBranchPolicyRequest) (*DeploymentBranchPolicy, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/environments/%v/deployment-branch-policies/%v\", owner, repo, environment, branchPolicyID)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, request)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar policy *DeploymentBranchPolicy\n\tresp, err := s.client.Do(ctx, req, &policy)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn policy, resp, nil\n}\n\n// DeleteDeploymentBranchPolicy deletes a deployment branch policy for an environment.\n//\n// GitHub API docs: https://docs.github.com/rest/deployments/branch-policies#delete-a-deployment-branch-policy\n//\n//meta:operation DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}\nfunc (s *RepositoriesService) DeleteDeploymentBranchPolicy(ctx context.Context, owner, repo, environment string, branchPolicyID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/environments/%v/deployment-branch-policies/%v\", owner, repo, environment, branchPolicyID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/repos_deployment_branch_policies_test.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_ListDeploymentBranchPolicies(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/environments/e/deployment-branch-policies\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\":     \"1\",\n\t\t\t\"per_page\": \"30\",\n\t\t})\n\t\tfmt.Fprint(w, `{\"total_count\":2, \"branch_policies\":[{\"id\":1}, {\"id\": 2}]}`)\n\t})\n\n\topts := &ListOptions{Page: 1, PerPage: 30}\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.ListDeploymentBranchPolicies(ctx, \"o\", \"r\", \"e\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListDeploymentBranchPolicies returned error: %v\", err)\n\t}\n\n\twant := &DeploymentBranchPolicyResponse{\n\t\tBranchPolicies: []*DeploymentBranchPolicy{\n\t\t\t{ID: Ptr(int64(1))},\n\t\t\t{ID: Ptr(int64(2))},\n\t\t},\n\t\tTotalCount: Ptr(2),\n\t}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.ListDeploymentBranchPolicies = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ListDeploymentBranchPolicies\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListDeploymentBranchPolicies(ctx, \"\\n\", \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListDeploymentBranchPolicies(ctx, \"o\", \"r\", \"e\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"got non-nil Repositories.ListDeploymentBranchPolicies response: %+v\", got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetDeploymentBranchPolicy(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/environments/e/deployment-branch-policies/1\", func(w http.ResponseWriter, _ *http.Request) {\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.GetDeploymentBranchPolicy(ctx, \"o\", \"r\", \"e\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetDeploymentBranchPolicy returned error: %v\", err)\n\t}\n\n\twant := &DeploymentBranchPolicy{ID: Ptr(int64(1))}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.GetDeploymentBranchPolicy = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"GetDeploymentBranchPolicy\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetDeploymentBranchPolicy(ctx, \"o\", \"r\", \"e\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"got non-nil Repositories.GetDeploymentBranchPolicy response: %+v\", got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_CreateDeploymentBranchPolicy(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/environments/e/deployment-branch-policies\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\"id\":1, \"type\":\"branch\"}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.CreateDeploymentBranchPolicy(ctx, \"o\", \"r\", \"e\", &DeploymentBranchPolicyRequest{Name: Ptr(\"n\"), Type: Ptr(\"branch\")})\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.CreateDeploymentBranchPolicy returned error: %v\", err)\n\t}\n\n\twant := &DeploymentBranchPolicy{ID: Ptr(int64(1)), Type: Ptr(\"branch\")}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.CreateDeploymentBranchPolicy = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"CreateDeploymentBranchPolicy\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.CreateDeploymentBranchPolicy(ctx, \"o\", \"r\", \"e\", &DeploymentBranchPolicyRequest{Name: Ptr(\"n\")})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"got non-nil Repositories.CreateDeploymentBranchPolicy response: %+v\", got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_UpdateDeploymentBranchPolicy(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/environments/e/deployment-branch-policies/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.UpdateDeploymentBranchPolicy(ctx, \"o\", \"r\", \"e\", 1, &DeploymentBranchPolicyRequest{Name: Ptr(\"n\")})\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.UpdateDeploymentBranchPolicy returned error: %v\", err)\n\t}\n\n\twant := &DeploymentBranchPolicy{ID: Ptr(int64(1))}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.UpdateDeploymentBranchPolicy = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"UpdateDeploymentBranchPolicy\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.UpdateDeploymentBranchPolicy(ctx, \"o\", \"r\", \"e\", 1, &DeploymentBranchPolicyRequest{Name: Ptr(\"n\")})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"got non-nil Repositories.UpdateDeploymentBranchPolicy response: %+v\", got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_DeleteDeploymentBranchPolicy(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/environments/e/deployment-branch-policies/1\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Repositories.DeleteDeploymentBranchPolicy(ctx, \"o\", \"r\", \"e\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.DeleteDeploymentBranchPolicy returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteDeploymentBranchPolicy\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.DeleteDeploymentBranchPolicy(ctx, \"o\", \"r\", \"e\", 1)\n\t})\n}\n"
  },
  {
    "path": "github/repos_deployment_protection_rules.go",
    "content": "// Copyright 2024 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// CustomDeploymentProtectionRuleApp represents a single deployment protection rule app for an environment.\ntype CustomDeploymentProtectionRuleApp struct {\n\tID             *int64  `json:\"id,omitempty\"`\n\tSlug           *string `json:\"slug,omitempty\"`\n\tIntegrationURL *string `json:\"integration_url,omitempty\"`\n\tNodeID         *string `json:\"node_id,omitempty\"`\n}\n\n// CustomDeploymentProtectionRule represents a single deployment protection rule for an environment.\ntype CustomDeploymentProtectionRule struct {\n\tID      *int64                             `json:\"id,omitempty\"`\n\tNodeID  *string                            `json:\"node_id,omitempty\"`\n\tEnabled *bool                              `json:\"enabled,omitempty\"`\n\tApp     *CustomDeploymentProtectionRuleApp `json:\"app,omitempty\"`\n}\n\n// ListDeploymentProtectionRuleResponse represents the response that comes back when you list deployment protection rules.\ntype ListDeploymentProtectionRuleResponse struct {\n\tTotalCount      *int                              `json:\"total_count,omitempty\"`\n\tProtectionRules []*CustomDeploymentProtectionRule `json:\"custom_deployment_protection_rules,omitempty\"`\n}\n\n// ListCustomDeploymentRuleIntegrationsResponse represents the slightly different response that comes back when you list custom deployment rule integrations.\ntype ListCustomDeploymentRuleIntegrationsResponse struct {\n\tTotalCount            *int                                 `json:\"total_count,omitempty\"`\n\tAvailableIntegrations []*CustomDeploymentProtectionRuleApp `json:\"available_custom_deployment_protection_rule_integrations,omitempty\"`\n}\n\n// CustomDeploymentProtectionRuleRequest represents a deployment protection rule request.\ntype CustomDeploymentProtectionRuleRequest struct {\n\tIntegrationID *int64 `json:\"integration_id,omitempty\"`\n}\n\n// GetAllDeploymentProtectionRules gets all the deployment protection rules for an environment.\n//\n// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules#get-all-deployment-protection-rules-for-an-environment\n//\n//meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules\nfunc (s *RepositoriesService) GetAllDeploymentProtectionRules(ctx context.Context, owner, repo, environment string) (*ListDeploymentProtectionRuleResponse, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/environments/%v/deployment_protection_rules\", owner, repo, environment)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar list *ListDeploymentProtectionRuleResponse\n\tresp, err := s.client.Do(ctx, req, &list)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn list, resp, nil\n}\n\n// CreateCustomDeploymentProtectionRule creates a custom deployment protection rule on an environment.\n//\n// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules#create-a-custom-deployment-protection-rule-on-an-environment\n//\n//meta:operation POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules\nfunc (s *RepositoriesService) CreateCustomDeploymentProtectionRule(ctx context.Context, owner, repo, environment string, request *CustomDeploymentProtectionRuleRequest) (*CustomDeploymentProtectionRule, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/environments/%v/deployment_protection_rules\", owner, repo, environment)\n\n\treq, err := s.client.NewRequest(\"POST\", u, request)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar protectionRule *CustomDeploymentProtectionRule\n\tresp, err := s.client.Do(ctx, req, &protectionRule)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn protectionRule, resp, nil\n}\n\n// ListCustomDeploymentRuleIntegrations lists the custom deployment rule integrations for an environment.\n//\n// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules#list-custom-deployment-rule-integrations-available-for-an-environment\n//\n//meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps\nfunc (s *RepositoriesService) ListCustomDeploymentRuleIntegrations(ctx context.Context, owner, repo, environment string, opts *ListOptions) (*ListCustomDeploymentRuleIntegrationsResponse, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/environments/%v/deployment_protection_rules/apps\", owner, repo, environment)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar list *ListCustomDeploymentRuleIntegrationsResponse\n\tresp, err := s.client.Do(ctx, req, &list)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn list, resp, nil\n}\n\n// GetCustomDeploymentProtectionRule gets a custom deployment protection rule for an environment.\n//\n// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules#get-a-custom-deployment-protection-rule\n//\n//meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}\nfunc (s *RepositoriesService) GetCustomDeploymentProtectionRule(ctx context.Context, owner, repo, environment string, protectionRuleID int64) (*CustomDeploymentProtectionRule, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/environments/%v/deployment_protection_rules/%v\", owner, repo, environment, protectionRuleID)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar protectionRule *CustomDeploymentProtectionRule\n\tresp, err := s.client.Do(ctx, req, &protectionRule)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn protectionRule, resp, nil\n}\n\n// DisableCustomDeploymentProtectionRule disables a custom deployment protection rule for an environment.\n//\n// GitHub API docs: https://docs.github.com/rest/deployments/protection-rules#disable-a-custom-protection-rule-for-an-environment\n//\n//meta:operation DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}\nfunc (s *RepositoriesService) DisableCustomDeploymentProtectionRule(ctx context.Context, owner, repo, environment string, protectionRuleID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/environments/%v/deployment_protection_rules/%v\", owner, repo, environment, protectionRuleID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/repos_deployment_protection_rules_test.go",
    "content": "// Copyright 2024 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_GetAllDeploymentProtectionRules(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/environments/e/deployment_protection_rules\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"total_count\":2, \"custom_deployment_protection_rules\":[{ \"id\": 3, \"node_id\": \"IEH37kRlcGxveW1lbnRTdGF0ddiv\", \"enabled\": true, \"app\": { \"id\": 1, \"node_id\": \"GHT58kRlcGxveW1lbnRTdTY!bbcy\", \"slug\": \"a-custom-app\", \"integration_url\": \"https://api.github.com/apps/a-custom-app\"}}, { \"id\": 4, \"node_id\": \"MDE2OkRlcGxveW1lbnRTdHJ41128\", \"enabled\": true, \"app\": { \"id\": 1, \"node_id\": \"UHVE67RlcGxveW1lbnRTdTY!jfeuy\", \"slug\": \"another-custom-app\", \"integration_url\": \"https://api.github.com/apps/another-custom-app\"}}]}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.GetAllDeploymentProtectionRules(ctx, \"o\", \"r\", \"e\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetAllDeploymentProtectionRules returned error: %v\", err)\n\t}\n\n\twant := &ListDeploymentProtectionRuleResponse{\n\t\tProtectionRules: []*CustomDeploymentProtectionRule{\n\t\t\t{ID: Ptr(int64(3)), NodeID: Ptr(\"IEH37kRlcGxveW1lbnRTdGF0ddiv\"), Enabled: Ptr(true), App: &CustomDeploymentProtectionRuleApp{ID: Ptr(int64(1)), NodeID: Ptr(\"GHT58kRlcGxveW1lbnRTdTY!bbcy\"), Slug: Ptr(\"a-custom-app\"), IntegrationURL: Ptr(\"https://api.github.com/apps/a-custom-app\")}},\n\t\t\t{ID: Ptr(int64(4)), NodeID: Ptr(\"MDE2OkRlcGxveW1lbnRTdHJ41128\"), Enabled: Ptr(true), App: &CustomDeploymentProtectionRuleApp{ID: Ptr(int64(1)), NodeID: Ptr(\"UHVE67RlcGxveW1lbnRTdTY!jfeuy\"), Slug: Ptr(\"another-custom-app\"), IntegrationURL: Ptr(\"https://api.github.com/apps/another-custom-app\")}},\n\t\t},\n\t\tTotalCount: Ptr(2),\n\t}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.GetAllDeploymentProtectionRules = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"GetAllDeploymentProtectionRules\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetAllDeploymentProtectionRules(ctx, \"o\", \"r\", \"e\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"got non-nil Repositories.GetAllDeploymentProtectionRules response: %+v\", got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_CreateCustomDeploymentProtectionRule(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &CustomDeploymentProtectionRuleRequest{\n\t\tIntegrationID: Ptr(int64(5)),\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/environments/e/deployment_protection_rules\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *CustomDeploymentProtectionRuleRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\twant := input\n\t\tif !cmp.Equal(v, want) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, want)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":3, \"node_id\": \"IEH37kRlcGxveW1lbnRTdGF0ddiv\", \"enabled\": true, \"app\": {\"id\": 1, \"node_id\": \"GHT58kRlcGxveW1lbnRTdTY!bbcy\", \"slug\": \"a-custom-app\", \"integration_url\": \"https://api.github.com/apps/a-custom-app\"}}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.CreateCustomDeploymentProtectionRule(ctx, \"o\", \"r\", \"e\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.CreateCustomDeploymentProtectionRule returned error: %v\", err)\n\t}\n\n\twant := &CustomDeploymentProtectionRule{\n\t\tID:      Ptr(int64(3)),\n\t\tNodeID:  Ptr(\"IEH37kRlcGxveW1lbnRTdGF0ddiv\"),\n\t\tEnabled: Ptr(true),\n\t\tApp: &CustomDeploymentProtectionRuleApp{\n\t\t\tID:             Ptr(int64(1)),\n\t\t\tNodeID:         Ptr(\"GHT58kRlcGxveW1lbnRTdTY!bbcy\"),\n\t\t\tSlug:           Ptr(\"a-custom-app\"),\n\t\t\tIntegrationURL: Ptr(\"https://api.github.com/apps/a-custom-app\"),\n\t\t},\n\t}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.CreateCustomDeploymentProtectionRule = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"CreateCustomDeploymentProtectionRule\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.CreateCustomDeploymentProtectionRule(ctx, \"\\n\", \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.CreateCustomDeploymentProtectionRule(ctx, \"o\", \"r\", \"e\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListCustomDeploymentRuleIntegrations(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/environments/e/deployment_protection_rules/apps\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\":     \"1\",\n\t\t\t\"per_page\": \"30\",\n\t\t})\n\t\tfmt.Fprint(w, `{\"total_count\": 2, \"available_custom_deployment_protection_rule_integrations\": [{\"id\": 1, \"node_id\": \"GHT58kRlcGxveW1lbnRTdTY!bbcy\", \"slug\": \"a-custom-app\", \"integration_url\": \"https://api.github.com/apps/a-custom-app\"}, {\"id\": 2, \"node_id\": \"UHVE67RlcGxveW1lbnRTdTY!jfeuy\", \"slug\": \"another-custom-app\", \"integration_url\": \"https://api.github.com/apps/another-custom-app\"}]}`)\n\t})\n\n\tctx := t.Context()\n\topts := &ListOptions{Page: 1, PerPage: 30}\n\tgot, _, err := client.Repositories.ListCustomDeploymentRuleIntegrations(ctx, \"o\", \"r\", \"e\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListCustomDeploymentRuleIntegrations returned error: %v\", err)\n\t}\n\n\twant := &ListCustomDeploymentRuleIntegrationsResponse{\n\t\tTotalCount: Ptr(2),\n\t\tAvailableIntegrations: []*CustomDeploymentProtectionRuleApp{\n\t\t\t{ID: Ptr(int64(1)), NodeID: Ptr(\"GHT58kRlcGxveW1lbnRTdTY!bbcy\"), Slug: Ptr(\"a-custom-app\"), IntegrationURL: Ptr(\"https://api.github.com/apps/a-custom-app\")},\n\t\t\t{ID: Ptr(int64(2)), NodeID: Ptr(\"UHVE67RlcGxveW1lbnRTdTY!jfeuy\"), Slug: Ptr(\"another-custom-app\"), IntegrationURL: Ptr(\"https://api.github.com/apps/another-custom-app\")},\n\t\t},\n\t}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.ListCustomDeploymentRuleIntegrations = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ListCustomDeploymentRuleIntegrations\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListCustomDeploymentRuleIntegrations(ctx, \"\\n\", \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListCustomDeploymentRuleIntegrations(ctx, \"o\", \"r\", \"e\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"got non-nil Repositories.ListCustomDeploymentRuleIntegrations response: %+v\", got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetCustomDeploymentProtectionRule(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/environments/e/deployment_protection_rules/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1, \"node_id\": \"IEH37kRlcGxveW1lbnRTdGF0ddiv\", \"enabled\": true, \"app\": {\"id\": 1, \"node_id\": \"GHT58kRlcGxveW1lbnRTdTY!bbcy\", \"slug\": \"a-custom-app\", \"integration_url\": \"https://api.github.com/apps/a-custom-app\"}}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.GetCustomDeploymentProtectionRule(ctx, \"o\", \"r\", \"e\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetCustomDeploymentProtectionRule returned error: %v\", err)\n\t}\n\n\twant := &CustomDeploymentProtectionRule{\n\t\tID:      Ptr(int64(1)),\n\t\tNodeID:  Ptr(\"IEH37kRlcGxveW1lbnRTdGF0ddiv\"),\n\t\tEnabled: Ptr(true),\n\t\tApp: &CustomDeploymentProtectionRuleApp{\n\t\t\tID:             Ptr(int64(1)),\n\t\t\tNodeID:         Ptr(\"GHT58kRlcGxveW1lbnRTdTY!bbcy\"),\n\t\t\tSlug:           Ptr(\"a-custom-app\"),\n\t\t\tIntegrationURL: Ptr(\"https://api.github.com/apps/a-custom-app\"),\n\t\t},\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.GetCustomDeploymentProtectionRule = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"GetCustomDeploymentProtectionRule\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetCustomDeploymentProtectionRule(ctx, \"o\", \"r\", \"e\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"got non-nil Repositories.GetCustomDeploymentProtectionRule response: %+v\", got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_DisableCustomDeploymentProtectionRule(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/environments/e/deployment_protection_rules/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Repositories.DisableCustomDeploymentProtectionRule(ctx, \"o\", \"r\", \"e\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.DisableCustomDeploymentProtectionRule returned error: %v\", err)\n\t}\n\n\tif !cmp.Equal(resp.StatusCode, 204) {\n\t\tt.Errorf(\"Repositories.DisableCustomDeploymentProtectionRule returned  status code %+v, want %+v\", resp.StatusCode, \"204\")\n\t}\n\n\tconst methodName = \"DisableCustomDeploymentProtectionRule\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.DisableCustomDeploymentProtectionRule(ctx, \"\\n\", \"\\n\", \"\\n\", 1)\n\t\treturn err\n\t})\n}\n"
  },
  {
    "path": "github/repos_deployments.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"strings\"\n)\n\n// Deployment represents a deployment in a repo.\ntype Deployment struct {\n\tURL           *string         `json:\"url,omitempty\"`\n\tID            *int64          `json:\"id,omitempty\"`\n\tSHA           *string         `json:\"sha,omitempty\"`\n\tRef           *string         `json:\"ref,omitempty\"`\n\tTask          *string         `json:\"task,omitempty\"`\n\tPayload       json.RawMessage `json:\"payload,omitempty\"`\n\tEnvironment   *string         `json:\"environment,omitempty\"`\n\tDescription   *string         `json:\"description,omitempty\"`\n\tCreator       *User           `json:\"creator,omitempty\"`\n\tCreatedAt     *Timestamp      `json:\"created_at,omitempty\"`\n\tUpdatedAt     *Timestamp      `json:\"updated_at,omitempty\"`\n\tStatusesURL   *string         `json:\"statuses_url,omitempty\"`\n\tRepositoryURL *string         `json:\"repository_url,omitempty\"`\n\tNodeID        *string         `json:\"node_id,omitempty\"`\n}\n\n// DeploymentRequest represents a deployment request.\ntype DeploymentRequest struct {\n\tRef                   *string   `json:\"ref,omitempty\"`\n\tTask                  *string   `json:\"task,omitempty\"`\n\tAutoMerge             *bool     `json:\"auto_merge,omitempty\"`\n\tRequiredContexts      *[]string `json:\"required_contexts,omitempty\"`\n\tPayload               any       `json:\"payload,omitempty\"`\n\tEnvironment           *string   `json:\"environment,omitempty\"`\n\tDescription           *string   `json:\"description,omitempty\"`\n\tTransientEnvironment  *bool     `json:\"transient_environment,omitempty\"`\n\tProductionEnvironment *bool     `json:\"production_environment,omitempty\"`\n}\n\n// DeploymentsListOptions specifies the optional parameters to the\n// RepositoriesService.ListDeployments method.\ntype DeploymentsListOptions struct {\n\t// SHA of the Deployment.\n\tSHA string `url:\"sha,omitempty\"`\n\n\t// List deployments for a given ref. This can be a branch, tag, or SHA.\n\tRef string `url:\"ref,omitempty\"`\n\n\t// List deployments for a given task.\n\tTask string `url:\"task,omitempty\"`\n\n\t// List deployments for a given environment.\n\tEnvironment string `url:\"environment,omitempty\"`\n\n\tListOptions\n}\n\n// ListDeployments lists the deployments of a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/deployments/deployments#list-deployments\n//\n//meta:operation GET /repos/{owner}/{repo}/deployments\nfunc (s *RepositoriesService) ListDeployments(ctx context.Context, owner, repo string, opts *DeploymentsListOptions) ([]*Deployment, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/deployments\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar deployments []*Deployment\n\tresp, err := s.client.Do(ctx, req, &deployments)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn deployments, resp, nil\n}\n\n// GetDeployment returns a single deployment of a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/deployments/deployments#get-a-deployment\n//\n//meta:operation GET /repos/{owner}/{repo}/deployments/{deployment_id}\nfunc (s *RepositoriesService) GetDeployment(ctx context.Context, owner, repo string, deploymentID int64) (*Deployment, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/deployments/%v\", owner, repo, deploymentID)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar deployment *Deployment\n\tresp, err := s.client.Do(ctx, req, &deployment)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn deployment, resp, nil\n}\n\n// CreateDeployment creates a new deployment for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/deployments/deployments#create-a-deployment\n//\n//meta:operation POST /repos/{owner}/{repo}/deployments\nfunc (s *RepositoriesService) CreateDeployment(ctx context.Context, owner, repo string, request *DeploymentRequest) (*Deployment, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/deployments\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"POST\", u, request)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tacceptHeaders := []string{mediaTypeDeploymentStatusPreview, mediaTypeExpandDeploymentStatusPreview}\n\treq.Header.Set(\"Accept\", strings.Join(acceptHeaders, \", \"))\n\n\tvar d *Deployment\n\tresp, err := s.client.Do(ctx, req, &d)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn d, resp, nil\n}\n\n// DeleteDeployment deletes an existing deployment for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/deployments/deployments#delete-a-deployment\n//\n//meta:operation DELETE /repos/{owner}/{repo}/deployments/{deployment_id}\nfunc (s *RepositoriesService) DeleteDeployment(ctx context.Context, owner, repo string, deploymentID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/deployments/%v\", owner, repo, deploymentID)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// DeploymentStatus represents the status of a\n// particular deployment.\ntype DeploymentStatus struct {\n\tID *int64 `json:\"id,omitempty\"`\n\t// State is the deployment state.\n\t// Possible values are: \"pending\", \"success\", \"failure\", \"error\",\n\t// \"inactive\", \"in_progress\", \"queued\".\n\tState          *string    `json:\"state,omitempty\"`\n\tCreator        *User      `json:\"creator,omitempty\"`\n\tDescription    *string    `json:\"description,omitempty\"`\n\tEnvironment    *string    `json:\"environment,omitempty\"`\n\tNodeID         *string    `json:\"node_id,omitempty\"`\n\tCreatedAt      *Timestamp `json:\"created_at,omitempty\"`\n\tUpdatedAt      *Timestamp `json:\"updated_at,omitempty\"`\n\tTargetURL      *string    `json:\"target_url,omitempty\"`\n\tDeploymentURL  *string    `json:\"deployment_url,omitempty\"`\n\tRepositoryURL  *string    `json:\"repository_url,omitempty\"`\n\tEnvironmentURL *string    `json:\"environment_url,omitempty\"`\n\tLogURL         *string    `json:\"log_url,omitempty\"`\n\tURL            *string    `json:\"url,omitempty\"`\n}\n\n// DeploymentStatusRequest represents a deployment request.\ntype DeploymentStatusRequest struct {\n\tState          *string `json:\"state,omitempty\"`\n\tLogURL         *string `json:\"log_url,omitempty\"`\n\tDescription    *string `json:\"description,omitempty\"`\n\tEnvironment    *string `json:\"environment,omitempty\"`\n\tEnvironmentURL *string `json:\"environment_url,omitempty\"`\n\tAutoInactive   *bool   `json:\"auto_inactive,omitempty\"`\n}\n\n// ListDeploymentStatuses lists the statuses of a given deployment of a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/deployments/statuses#list-deployment-statuses\n//\n//meta:operation GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\nfunc (s *RepositoriesService) ListDeploymentStatuses(ctx context.Context, owner, repo string, deployment int64, opts *ListOptions) ([]*DeploymentStatus, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/deployments/%v/statuses\", owner, repo, deployment)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tacceptHeaders := []string{mediaTypeDeploymentStatusPreview, mediaTypeExpandDeploymentStatusPreview}\n\treq.Header.Set(\"Accept\", strings.Join(acceptHeaders, \", \"))\n\n\tvar statuses []*DeploymentStatus\n\tresp, err := s.client.Do(ctx, req, &statuses)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn statuses, resp, nil\n}\n\n// GetDeploymentStatus returns a single deployment status of a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/deployments/statuses#get-a-deployment-status\n//\n//meta:operation GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}\nfunc (s *RepositoriesService) GetDeploymentStatus(ctx context.Context, owner, repo string, deploymentID, deploymentStatusID int64) (*DeploymentStatus, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/deployments/%v/statuses/%v\", owner, repo, deploymentID, deploymentStatusID)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tacceptHeaders := []string{mediaTypeDeploymentStatusPreview, mediaTypeExpandDeploymentStatusPreview}\n\treq.Header.Set(\"Accept\", strings.Join(acceptHeaders, \", \"))\n\n\tvar d *DeploymentStatus\n\tresp, err := s.client.Do(ctx, req, &d)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn d, resp, nil\n}\n\n// CreateDeploymentStatus creates a new status for a deployment.\n//\n// GitHub API docs: https://docs.github.com/rest/deployments/statuses#create-a-deployment-status\n//\n//meta:operation POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\nfunc (s *RepositoriesService) CreateDeploymentStatus(ctx context.Context, owner, repo string, deployment int64, request *DeploymentStatusRequest) (*DeploymentStatus, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/deployments/%v/statuses\", owner, repo, deployment)\n\n\treq, err := s.client.NewRequest(\"POST\", u, request)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tacceptHeaders := []string{mediaTypeDeploymentStatusPreview, mediaTypeExpandDeploymentStatusPreview}\n\treq.Header.Set(\"Accept\", strings.Join(acceptHeaders, \", \"))\n\n\tvar d *DeploymentStatus\n\tresp, err := s.client.Do(ctx, req, &d)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn d, resp, nil\n}\n"
  },
  {
    "path": "github/repos_deployments_test.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_ListDeployments(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/deployments\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"environment\": \"test\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}, {\"id\":2}]`)\n\t})\n\n\topt := &DeploymentsListOptions{Environment: \"test\"}\n\tctx := t.Context()\n\tdeployments, _, err := client.Repositories.ListDeployments(ctx, \"o\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListDeployments returned error: %v\", err)\n\t}\n\n\twant := []*Deployment{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}}\n\tif !cmp.Equal(deployments, want) {\n\t\tt.Errorf(\"Repositories.ListDeployments returned %+v, want %+v\", deployments, want)\n\t}\n\n\tconst methodName = \"ListDeployments\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListDeployments(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListDeployments(ctx, \"o\", \"r\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetDeployment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/deployments/3\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":3}`)\n\t})\n\n\tctx := t.Context()\n\tdeployment, _, err := client.Repositories.GetDeployment(ctx, \"o\", \"r\", 3)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetDeployment returned error: %v\", err)\n\t}\n\n\twant := &Deployment{ID: Ptr(int64(3))}\n\n\tif !cmp.Equal(deployment, want) {\n\t\tt.Errorf(\"Repositories.GetDeployment returned %+v, want %+v\", deployment, want)\n\t}\n\n\tconst methodName = \"GetDeployment\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetDeployment(ctx, \"\\n\", \"\\n\", 3)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetDeployment(ctx, \"o\", \"r\", 3)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_CreateDeployment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &DeploymentRequest{Ref: Ptr(\"1111\"), Task: Ptr(\"deploy\"), TransientEnvironment: Ptr(true)}\n\n\tmux.HandleFunc(\"/repos/o/r/deployments\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *DeploymentRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\twantAcceptHeaders := []string{mediaTypeDeploymentStatusPreview, mediaTypeExpandDeploymentStatusPreview}\n\t\ttestHeader(t, r, \"Accept\", strings.Join(wantAcceptHeaders, \", \"))\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"ref\": \"1111\", \"task\": \"deploy\"}`)\n\t})\n\n\tctx := t.Context()\n\tdeployment, _, err := client.Repositories.CreateDeployment(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.CreateDeployment returned error: %v\", err)\n\t}\n\n\twant := &Deployment{Ref: Ptr(\"1111\"), Task: Ptr(\"deploy\")}\n\tif !cmp.Equal(deployment, want) {\n\t\tt.Errorf(\"Repositories.CreateDeployment returned %+v, want %+v\", deployment, want)\n\t}\n\n\tconst methodName = \"CreateDeployment\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.CreateDeployment(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.CreateDeployment(ctx, \"o\", \"r\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_DeleteDeployment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/deployments/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Repositories.DeleteDeployment(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.DeleteDeployment returned error: %v\", err)\n\t}\n\tif resp.StatusCode != http.StatusNoContent {\n\t\tt.Error(\"Repositories.DeleteDeployment should return a 204 status\")\n\t}\n\n\tresp, err = client.Repositories.DeleteDeployment(ctx, \"o\", \"r\", 2)\n\tif err == nil {\n\t\tt.Error(\"Repositories.DeleteDeployment should return an error\")\n\t}\n\tif resp.StatusCode != http.StatusNotFound {\n\t\tt.Error(\"Repositories.DeleteDeployment should return a 404 status\")\n\t}\n\n\tconst methodName = \"DeleteDeployment\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.DeleteDeployment(ctx, \"\\n\", \"\\n\", 1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.DeleteDeployment(ctx, \"o\", \"r\", 1)\n\t})\n}\n\nfunc TestRepositoriesService_ListDeploymentStatuses(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\twantAcceptHeaders := []string{mediaTypeDeploymentStatusPreview, mediaTypeExpandDeploymentStatusPreview}\n\tmux.HandleFunc(\"/repos/o/r/deployments/1/statuses\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", strings.Join(wantAcceptHeaders, \", \"))\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}, {\"id\":2}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tstatuses, _, err := client.Repositories.ListDeploymentStatuses(ctx, \"o\", \"r\", 1, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListDeploymentStatuses returned error: %v\", err)\n\t}\n\n\twant := []*DeploymentStatus{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}}\n\tif !cmp.Equal(statuses, want) {\n\t\tt.Errorf(\"Repositories.ListDeploymentStatuses returned %+v, want %+v\", statuses, want)\n\t}\n\n\tconst methodName = \"ListDeploymentStatuses\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListDeploymentStatuses(ctx, \"\\n\", \"\\n\", 1, opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListDeploymentStatuses(ctx, \"o\", \"r\", 1, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetDeploymentStatus(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\twantAcceptHeaders := []string{mediaTypeDeploymentStatusPreview, mediaTypeExpandDeploymentStatusPreview}\n\tmux.HandleFunc(\"/repos/o/r/deployments/3/statuses/4\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", strings.Join(wantAcceptHeaders, \", \"))\n\t\tfmt.Fprint(w, `{\"id\":4}`)\n\t})\n\n\tctx := t.Context()\n\tdeploymentStatus, _, err := client.Repositories.GetDeploymentStatus(ctx, \"o\", \"r\", 3, 4)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetDeploymentStatus returned error: %v\", err)\n\t}\n\n\twant := &DeploymentStatus{ID: Ptr(int64(4))}\n\tif !cmp.Equal(deploymentStatus, want) {\n\t\tt.Errorf(\"Repositories.GetDeploymentStatus returned %+v, want %+v\", deploymentStatus, want)\n\t}\n\n\tconst methodName = \"GetDeploymentStatus\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetDeploymentStatus(ctx, \"\\n\", \"\\n\", 3, 4)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetDeploymentStatus(ctx, \"o\", \"r\", 3, 4)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_CreateDeploymentStatus(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &DeploymentStatusRequest{State: Ptr(\"inactive\"), Description: Ptr(\"deploy\"), AutoInactive: Ptr(false)}\n\n\tmux.HandleFunc(\"/repos/o/r/deployments/1/statuses\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *DeploymentStatusRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\twantAcceptHeaders := []string{mediaTypeDeploymentStatusPreview, mediaTypeExpandDeploymentStatusPreview}\n\t\ttestHeader(t, r, \"Accept\", strings.Join(wantAcceptHeaders, \", \"))\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"state\": \"inactive\", \"description\": \"deploy\"}`)\n\t})\n\n\tctx := t.Context()\n\tdeploymentStatus, _, err := client.Repositories.CreateDeploymentStatus(ctx, \"o\", \"r\", 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.CreateDeploymentStatus returned error: %v\", err)\n\t}\n\n\twant := &DeploymentStatus{State: Ptr(\"inactive\"), Description: Ptr(\"deploy\")}\n\tif !cmp.Equal(deploymentStatus, want) {\n\t\tt.Errorf(\"Repositories.CreateDeploymentStatus returned %+v, want %+v\", deploymentStatus, want)\n\t}\n\n\tconst methodName = \"CreateDeploymentStatus\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.CreateDeploymentStatus(ctx, \"\\n\", \"\\n\", 1, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.CreateDeploymentStatus(ctx, \"o\", \"r\", 1, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestDeploymentStatusRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &DeploymentStatusRequest{}, \"{}\")\n\n\tr := &DeploymentStatusRequest{\n\t\tState:          Ptr(\"state\"),\n\t\tLogURL:         Ptr(\"logurl\"),\n\t\tDescription:    Ptr(\"desc\"),\n\t\tEnvironment:    Ptr(\"env\"),\n\t\tEnvironmentURL: Ptr(\"eurl\"),\n\t\tAutoInactive:   Ptr(false),\n\t}\n\n\twant := `{\n\t\t\"state\": \"state\",\n\t\t\"log_url\": \"logurl\",\n\t\t\"description\": \"desc\",\n\t\t\"environment\": \"env\",\n\t\t\"environment_url\": \"eurl\",\n\t\t\"auto_inactive\": false\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n\nfunc TestDeploymentStatus_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &DeploymentStatus{}, \"{}\")\n\n\tr := &DeploymentStatus{\n\t\tID:    Ptr(int64(1)),\n\t\tState: Ptr(\"state\"),\n\t\tCreator: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t\tDescription:    Ptr(\"desc\"),\n\t\tEnvironment:    Ptr(\"env\"),\n\t\tNodeID:         Ptr(\"nid\"),\n\t\tCreatedAt:      &Timestamp{referenceTime},\n\t\tUpdatedAt:      &Timestamp{referenceTime},\n\t\tTargetURL:      Ptr(\"turl\"),\n\t\tDeploymentURL:  Ptr(\"durl\"),\n\t\tRepositoryURL:  Ptr(\"rurl\"),\n\t\tEnvironmentURL: Ptr(\"eurl\"),\n\t\tLogURL:         Ptr(\"lurl\"),\n\t\tURL:            Ptr(\"url\"),\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"state\": \"state\",\n\t\t\"creator\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"description\": \"desc\",\n\t\t\"environment\": \"env\",\n\t\t\"node_id\": \"nid\",\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"target_url\": \"turl\",\n\t\t\"deployment_url\": \"durl\",\n\t\t\"repository_url\": \"rurl\",\n\t\t\"environment_url\": \"eurl\",\n\t\t\"log_url\": \"lurl\",\n\t\t\"url\": \"url\"\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n\nfunc TestDeploymentRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &DeploymentRequest{}, \"{}\")\n\n\tr := &DeploymentRequest{\n\t\tRef:                   Ptr(\"ref\"),\n\t\tTask:                  Ptr(\"task\"),\n\t\tAutoMerge:             Ptr(false),\n\t\tRequiredContexts:      &[]string{\"s\"},\n\t\tPayload:               \"payload\",\n\t\tEnvironment:           Ptr(\"environment\"),\n\t\tDescription:           Ptr(\"description\"),\n\t\tTransientEnvironment:  Ptr(false),\n\t\tProductionEnvironment: Ptr(false),\n\t}\n\n\twant := `{\n\t\t\"ref\": \"ref\",\n\t\t\"task\": \"task\",\n\t\t\"auto_merge\": false,\n\t\t\"required_contexts\": [\"s\"],\n\t\t\"payload\": \"payload\",\n\t\t\"environment\": \"environment\",\n\t\t\"description\": \"description\",\n\t\t\"transient_environment\": false,\n\t\t\"production_environment\": false\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n\nfunc TestDeployment_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Deployment{}, \"{}\")\n\n\tstr := \"s\"\n\tjsonMsg, _ := json.Marshal(str)\n\n\tr := &Deployment{\n\t\tURL:         Ptr(\"url\"),\n\t\tID:          Ptr(int64(1)),\n\t\tSHA:         Ptr(\"sha\"),\n\t\tRef:         Ptr(\"ref\"),\n\t\tTask:        Ptr(\"task\"),\n\t\tPayload:     jsonMsg,\n\t\tEnvironment: Ptr(\"env\"),\n\t\tDescription: Ptr(\"desc\"),\n\t\tCreator: &User{\n\t\t\tLogin:           Ptr(\"l\"),\n\t\t\tID:              Ptr(int64(1)),\n\t\t\tURL:             Ptr(\"u\"),\n\t\t\tAvatarURL:       Ptr(\"a\"),\n\t\t\tGravatarID:      Ptr(\"g\"),\n\t\t\tName:            Ptr(\"n\"),\n\t\t\tCompany:         Ptr(\"c\"),\n\t\t\tBlog:            Ptr(\"b\"),\n\t\t\tLocation:        Ptr(\"l\"),\n\t\t\tEmail:           Ptr(\"e\"),\n\t\t\tHireable:        Ptr(true),\n\t\t\tBio:             Ptr(\"b\"),\n\t\t\tTwitterUsername: Ptr(\"t\"),\n\t\t\tPublicRepos:     Ptr(1),\n\t\t\tFollowers:       Ptr(1),\n\t\t\tFollowing:       Ptr(1),\n\t\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t\t},\n\t\tCreatedAt:     &Timestamp{referenceTime},\n\t\tUpdatedAt:     &Timestamp{referenceTime},\n\t\tStatusesURL:   Ptr(\"surl\"),\n\t\tRepositoryURL: Ptr(\"rurl\"),\n\t\tNodeID:        Ptr(\"nid\"),\n\t}\n\n\twant := `{\n\t\t\"url\": \"url\",\n\t\t\"id\": 1,\n\t\t\"sha\": \"sha\",\n\t\t\"ref\": \"ref\",\n\t\t\"task\": \"task\",\n\t\t\"payload\": \"s\",\n\t\t\"environment\": \"env\",\n\t\t\"description\": \"desc\",\n\t\t\"creator\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"gravatar_id\": \"g\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": true,\n\t\t\t\"bio\": \"b\",\n\t\t\t\"twitter_username\": \"t\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"followers\": 1,\n\t\t\t\"following\": 1,\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\t\"url\": \"u\"\n\t\t},\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"statuses_url\": \"surl\",\n\t\t\"repository_url\": \"rurl\",\n\t\t\"node_id\": \"nid\"\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n"
  },
  {
    "path": "github/repos_environments.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n)\n\n// Environment represents a single environment in a repository.\ntype Environment struct {\n\tOwner                  *string         `json:\"owner,omitempty\"`\n\tRepo                   *string         `json:\"repo,omitempty\"`\n\tEnvironmentName        *string         `json:\"environment_name,omitempty\"`\n\tWaitTimer              *int            `json:\"wait_timer,omitempty\"`\n\tReviewers              []*EnvReviewers `json:\"reviewers,omitempty\"`\n\tDeploymentBranchPolicy *BranchPolicy   `json:\"deployment_branch_policy,omitempty\"`\n\t// Return/response only values\n\tID              *int64            `json:\"id,omitempty\"`\n\tNodeID          *string           `json:\"node_id,omitempty\"`\n\tName            *string           `json:\"name,omitempty\"`\n\tURL             *string           `json:\"url,omitempty\"`\n\tHTMLURL         *string           `json:\"html_url,omitempty\"`\n\tCreatedAt       *Timestamp        `json:\"created_at,omitempty\"`\n\tUpdatedAt       *Timestamp        `json:\"updated_at,omitempty\"`\n\tCanAdminsBypass *bool             `json:\"can_admins_bypass,omitempty\"`\n\tProtectionRules []*ProtectionRule `json:\"protection_rules,omitempty\"`\n}\n\n// EnvReviewers represents a single environment reviewer entry.\ntype EnvReviewers struct {\n\tType *string `json:\"type,omitempty\"`\n\tID   *int64  `json:\"id,omitempty\"`\n}\n\n// BranchPolicy represents the options for whether a branch deployment policy is applied to this environment.\ntype BranchPolicy struct {\n\tProtectedBranches    *bool `json:\"protected_branches,omitempty\"`\n\tCustomBranchPolicies *bool `json:\"custom_branch_policies,omitempty\"`\n}\n\n// EnvResponse represents the slightly different format of response that comes back when you list an environment.\ntype EnvResponse struct {\n\tTotalCount   *int           `json:\"total_count,omitempty\"`\n\tEnvironments []*Environment `json:\"environments,omitempty\"`\n}\n\n// ProtectionRule represents a single protection rule applied to the environment.\ntype ProtectionRule struct {\n\tID                *int64              `json:\"id,omitempty\"`\n\tNodeID            *string             `json:\"node_id,omitempty\"`\n\tPreventSelfReview *bool               `json:\"prevent_self_review,omitempty\"`\n\tType              *string             `json:\"type,omitempty\"`\n\tWaitTimer         *int                `json:\"wait_timer,omitempty\"`\n\tReviewers         []*RequiredReviewer `json:\"reviewers,omitempty\"`\n}\n\n// RequiredReviewer represents a required reviewer.\ntype RequiredReviewer struct {\n\tType     *string `json:\"type,omitempty\"`\n\tReviewer any     `json:\"reviewer,omitempty\"`\n}\n\n// EnvironmentListOptions specifies the optional parameters to the\n// RepositoriesService.ListEnvironments method.\ntype EnvironmentListOptions struct {\n\tListOptions\n}\n\n// UnmarshalJSON implements the json.Unmarshaler interface.\n// This helps us handle the fact that RequiredReviewer can have either a User or Team type reviewer field.\nfunc (r *RequiredReviewer) UnmarshalJSON(data []byte) error {\n\ttype aliasReviewer RequiredReviewer\n\tvar reviewer aliasReviewer\n\tif err := json.Unmarshal(data, &reviewer); err != nil {\n\t\treturn err\n\t}\n\n\tr.Type = reviewer.Type\n\n\tswitch *reviewer.Type {\n\tcase \"User\":\n\t\treviewer.Reviewer = &User{}\n\t\tif err := json.Unmarshal(data, &reviewer); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tr.Reviewer = reviewer.Reviewer\n\tcase \"Team\":\n\t\treviewer.Reviewer = &Team{}\n\t\tif err := json.Unmarshal(data, &reviewer); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tr.Reviewer = reviewer.Reviewer\n\tdefault:\n\t\tr.Type = nil\n\t\tr.Reviewer = nil\n\t\treturn fmt.Errorf(\"reviewer.Type is %T, not a string of 'User' or 'Team', unable to unmarshal\", reviewer.Type)\n\t}\n\n\treturn nil\n}\n\n// ListEnvironments lists all environments for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/deployments/environments#list-environments\n//\n//meta:operation GET /repos/{owner}/{repo}/environments\nfunc (s *RepositoriesService) ListEnvironments(ctx context.Context, owner, repo string, opts *EnvironmentListOptions) (*EnvResponse, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/environments\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar list *EnvResponse\n\tresp, err := s.client.Do(ctx, req, &list)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn list, resp, nil\n}\n\n// GetEnvironment get a single environment for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/deployments/environments#get-an-environment\n//\n//meta:operation GET /repos/{owner}/{repo}/environments/{environment_name}\nfunc (s *RepositoriesService) GetEnvironment(ctx context.Context, owner, repo, name string) (*Environment, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/environments/%v\", owner, repo, name)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar env *Environment\n\tresp, err := s.client.Do(ctx, req, &env)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn env, resp, nil\n}\n\n// MarshalJSON implements the json.Marshaler interface.\n// As the only way to clear a WaitTimer is to set it to 0, a missing WaitTimer object should default to 0, not null.\n// As the default value for CanAdminsBypass is true, a nil value here marshals to true.\nfunc (c *CreateUpdateEnvironment) MarshalJSON() ([]byte, error) {\n\ttype Alias CreateUpdateEnvironment\n\tif c.WaitTimer == nil {\n\t\tc.WaitTimer = Ptr(0)\n\t}\n\tif c.CanAdminsBypass == nil {\n\t\tc.CanAdminsBypass = Ptr(true)\n\t}\n\treturn json.Marshal(&struct {\n\t\t*Alias\n\t}{\n\t\tAlias: (*Alias)(c),\n\t})\n}\n\n// CreateUpdateEnvironment represents the fields required for the create/update operation\n// following the Create/Update release example.\n// See https://github.com/google/go-github/issues/992 for more information.\n// Removed omitempty here as the API expects null values for reviewers and deployment_branch_policy to clear them.\ntype CreateUpdateEnvironment struct {\n\tWaitTimer              *int            `json:\"wait_timer\"`\n\tReviewers              []*EnvReviewers `json:\"reviewers\"`\n\tCanAdminsBypass        *bool           `json:\"can_admins_bypass\"`\n\tDeploymentBranchPolicy *BranchPolicy   `json:\"deployment_branch_policy\"`\n\tPreventSelfReview      *bool           `json:\"prevent_self_review,omitempty\"`\n}\n\n// createUpdateEnvironmentNoEnterprise represents the fields accepted for Pro/Teams private repos.\n// Ref: https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment\n// See https://github.com/google/go-github/issues/2602 for more information.\ntype createUpdateEnvironmentNoEnterprise struct {\n\tDeploymentBranchPolicy *BranchPolicy `json:\"deployment_branch_policy\"`\n}\n\n// CreateUpdateEnvironment create or update a new environment for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/deployments/environments#create-or-update-an-environment\n//\n//meta:operation PUT /repos/{owner}/{repo}/environments/{environment_name}\nfunc (s *RepositoriesService) CreateUpdateEnvironment(ctx context.Context, owner, repo, name string, environment *CreateUpdateEnvironment) (*Environment, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/environments/%v\", owner, repo, name)\n\treq, err := s.client.NewRequest(\"PUT\", u, environment)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar e *Environment\n\tresp, err := s.client.Do(ctx, req, &e)\n\tif err != nil {\n\t\t// The API returns 422 when the pricing plan doesn't support all the fields sent.\n\t\t// This path will be executed for Pro/Teams private repos.\n\t\t// For public repos, regardless of the pricing plan, all fields supported.\n\t\t// For Free plan private repos the returned error code is 404.\n\t\t// We are checking that the user didn't try to send a value for unsupported fields,\n\t\t// and return an error if they did.\n\t\tif resp != nil && resp.StatusCode == http.StatusUnprocessableEntity && environment != nil && len(environment.Reviewers) == 0 && environment.GetWaitTimer() == 0 {\n\t\t\treturn s.createNewEnvNoEnterprise(ctx, u, environment)\n\t\t}\n\t\treturn nil, resp, err\n\t}\n\n\treturn e, resp, nil\n}\n\n// createNewEnvNoEnterprise is an internal function for cases where the original call returned 422.\n// Currently only the `deployment_branch_policy` parameter is supported for Pro/Team private repos.\nfunc (s *RepositoriesService) createNewEnvNoEnterprise(ctx context.Context, u string, environment *CreateUpdateEnvironment) (*Environment, *Response, error) {\n\treq, err := s.client.NewRequest(\"PUT\", u, &createUpdateEnvironmentNoEnterprise{\n\t\tDeploymentBranchPolicy: environment.DeploymentBranchPolicy,\n\t})\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar e *Environment\n\tresp, err := s.client.Do(ctx, req, &e)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn e, resp, nil\n}\n\n// DeleteEnvironment delete an environment from a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/deployments/environments#delete-an-environment\n//\n//meta:operation DELETE /repos/{owner}/{repo}/environments/{environment_name}\nfunc (s *RepositoriesService) DeleteEnvironment(ctx context.Context, owner, repo, name string) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/environments/%v\", owner, repo, name)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/repos_environments_test.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRequiredReviewer_UnmarshalJSON(t *testing.T) {\n\tt.Parallel()\n\ttestCases := map[string]struct {\n\t\tdata      []byte\n\t\twantRule  []*RequiredReviewer\n\t\twantError bool\n\t}{\n\t\t\"User Reviewer\": {\n\t\t\tdata:      []byte(`[{\"type\": \"User\", \"reviewer\": {\"id\": 1,\"login\": \"octocat\"}}]`),\n\t\t\twantRule:  []*RequiredReviewer{{Type: Ptr(\"User\"), Reviewer: &User{ID: Ptr(int64(1)), Login: Ptr(\"octocat\")}}},\n\t\t\twantError: false,\n\t\t},\n\t\t\"Team Reviewer\": {\n\t\t\tdata:      []byte(`[{\"type\": \"Team\", \"reviewer\": {\"id\": 1, \"name\": \"Justice League\"}}]`),\n\t\t\twantRule:  []*RequiredReviewer{{Type: Ptr(\"Team\"), Reviewer: &Team{ID: Ptr(int64(1)), Name: Ptr(\"Justice League\")}}},\n\t\t\twantError: false,\n\t\t},\n\t\t\"Both Types Reviewer\": {\n\t\t\tdata:      []byte(`[{\"type\": \"User\", \"reviewer\": {\"id\": 1,\"login\": \"octocat\"}},{\"type\": \"Team\", \"reviewer\": {\"id\": 1, \"name\": \"Justice League\"}}]`),\n\t\t\twantRule:  []*RequiredReviewer{{Type: Ptr(\"User\"), Reviewer: &User{ID: Ptr(int64(1)), Login: Ptr(\"octocat\")}}, {Type: Ptr(\"Team\"), Reviewer: &Team{ID: Ptr(int64(1)), Name: Ptr(\"Justice League\")}}},\n\t\t\twantError: false,\n\t\t},\n\t\t\"Empty JSON Object\": {\n\t\t\tdata:      []byte(`[]`),\n\t\t\twantRule:  []*RequiredReviewer{},\n\t\t\twantError: false,\n\t\t},\n\t\t\"Bad JSON Object\": {\n\t\t\tdata:      []byte(`[badjson: 1]`),\n\t\t\twantRule:  []*RequiredReviewer{},\n\t\t\twantError: true,\n\t\t},\n\t\t\"Wrong Type in Reviewer Object\": {\n\t\t\tdata:      []byte(`[{\"type\": 1, \"reviewer\": {\"id\": 1}}]`),\n\t\t\twantRule:  []*RequiredReviewer{{Type: nil, Reviewer: nil}},\n\t\t\twantError: true,\n\t\t},\n\t\t\"Wrong ID Type in User Object\": {\n\t\t\tdata:      []byte(`[{\"type\": \"User\", \"reviewer\": {\"id\": \"string\"}}]`),\n\t\t\twantRule:  []*RequiredReviewer{{Type: Ptr(\"User\"), Reviewer: nil}},\n\t\t\twantError: true,\n\t\t},\n\t\t\"Wrong ID Type in Team Object\": {\n\t\t\tdata:      []byte(`[{\"type\": \"Team\", \"reviewer\": {\"id\": \"string\"}}]`),\n\t\t\twantRule:  []*RequiredReviewer{{Type: Ptr(\"Team\"), Reviewer: nil}},\n\t\t\twantError: true,\n\t\t},\n\t\t\"Wrong Type of Reviewer\": {\n\t\t\tdata:      []byte(`[{\"type\": \"Cat\", \"reviewer\": {\"id\": 1,\"login\": \"octocat\"}}]`),\n\t\t\twantRule:  []*RequiredReviewer{{Type: nil, Reviewer: nil}},\n\t\t\twantError: true,\n\t\t},\n\t}\n\n\tfor name, test := range testCases {\n\t\tt.Run(name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\trule := []*RequiredReviewer{}\n\t\t\terr := json.Unmarshal(test.data, &rule)\n\t\t\tif err != nil && !test.wantError {\n\t\t\t\tt.Error(\"RequiredReviewer.UnmarshalJSON returned an error when we expected nil\")\n\t\t\t}\n\t\t\tif err == nil && test.wantError {\n\t\t\t\tt.Error(\"RequiredReviewer.UnmarshalJSON returned no error when we expected one\")\n\t\t\t}\n\t\t\tif !cmp.Equal(test.wantRule, rule) {\n\t\t\t\tt.Errorf(\"RequiredReviewer.UnmarshalJSON expected rule %+v, got %+v\", test.wantRule, rule)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestCreateUpdateEnvironment_MarshalJSON(t *testing.T) {\n\tt.Parallel()\n\tcu := &CreateUpdateEnvironment{}\n\n\tgot, err := cu.MarshalJSON()\n\tif err != nil {\n\t\tt.Errorf(\"MarshalJSON: %v\", err)\n\t}\n\n\twant := `{\"wait_timer\":0,\"reviewers\":null,\"can_admins_bypass\":true,\"deployment_branch_policy\":null}`\n\tif string(got) != want {\n\t\tt.Errorf(\"MarshalJSON = %v, want %v\", got, want)\n\t}\n}\n\nfunc TestRepositoriesService_ListEnvironments(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/environments\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"total_count\":1, \"environments\":[{\"id\":1}, {\"id\": 2}]}`)\n\t})\n\n\topt := &EnvironmentListOptions{\n\t\tListOptions: ListOptions{\n\t\t\tPage:    2,\n\t\t\tPerPage: 2,\n\t\t},\n\t}\n\tctx := t.Context()\n\tenvironments, _, err := client.Repositories.ListEnvironments(ctx, \"o\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListEnvironments returned error: %v\", err)\n\t}\n\twant := &EnvResponse{TotalCount: Ptr(1), Environments: []*Environment{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}}}\n\tif !cmp.Equal(environments, want) {\n\t\tt.Errorf(\"Repositories.ListEnvironments returned %+v, want %+v\", environments, want)\n\t}\n\n\tconst methodName = \"ListEnvironments\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListEnvironments(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListEnvironments(ctx, \"o\", \"r\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetEnvironment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/environments/e\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\": 1,\"name\": \"staging\", \"deployment_branch_policy\": {\"protected_branches\": true,\t\"custom_branch_policies\": false}, \"can_admins_bypass\": false}`)\n\t})\n\n\tctx := t.Context()\n\trelease, resp, err := client.Repositories.GetEnvironment(ctx, \"o\", \"r\", \"e\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetEnvironment returned error: %v\\n%v\", err, resp.Body)\n\t}\n\n\twant := &Environment{ID: Ptr(int64(1)), Name: Ptr(\"staging\"), DeploymentBranchPolicy: &BranchPolicy{ProtectedBranches: Ptr(true), CustomBranchPolicies: Ptr(false)}, CanAdminsBypass: Ptr(false)}\n\tif !cmp.Equal(release, want) {\n\t\tt.Errorf(\"Repositories.GetEnvironment returned %+v, want %+v\", release, want)\n\t}\n\n\tconst methodName = \"GetEnvironment\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetEnvironment(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetEnvironment(ctx, \"o\", \"r\", \"e\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_CreateEnvironment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &CreateUpdateEnvironment{\n\t\tWaitTimer: Ptr(30),\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/environments/e\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *CreateUpdateEnvironment\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\twant := &CreateUpdateEnvironment{WaitTimer: Ptr(30), CanAdminsBypass: Ptr(true)}\n\t\tif !cmp.Equal(v, want) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, want)\n\t\t}\n\t\tfmt.Fprint(w, `{\"id\": 1, \"name\": \"staging\",\t\"protection_rules\": [{\"id\": 1, \"type\": \"wait_timer\", \"wait_timer\": 30}]}`)\n\t})\n\n\tctx := t.Context()\n\trelease, _, err := client.Repositories.CreateUpdateEnvironment(ctx, \"o\", \"r\", \"e\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.CreateUpdateEnvironment returned error: %v\", err)\n\t}\n\n\twant := &Environment{ID: Ptr(int64(1)), Name: Ptr(\"staging\"), ProtectionRules: []*ProtectionRule{{ID: Ptr(int64(1)), Type: Ptr(\"wait_timer\"), WaitTimer: Ptr(30)}}}\n\tif !cmp.Equal(release, want) {\n\t\tt.Errorf(\"Repositories.CreateUpdateEnvironment returned %+v, want %+v\", release, want)\n\t}\n\n\tconst methodName = \"CreateUpdateEnvironment\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.CreateUpdateEnvironment(ctx, \"\\n\", \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.CreateUpdateEnvironment(ctx, \"o\", \"r\", \"e\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_CreateEnvironment_noEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &CreateUpdateEnvironment{}\n\tcallCount := 0\n\n\tmux.HandleFunc(\"/repos/o/r/environments/e\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *CreateUpdateEnvironment\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif callCount == 0 {\n\t\t\tw.WriteHeader(http.StatusUnprocessableEntity)\n\t\t\tcallCount++\n\t\t} else {\n\t\t\twant := &CreateUpdateEnvironment{}\n\t\t\tif !cmp.Equal(v, want) {\n\t\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, want)\n\t\t\t}\n\t\t\tfmt.Fprint(w, `{\"id\": 1, \"name\": \"staging\",\t\"protection_rules\": []}`)\n\t\t}\n\t})\n\n\tctx := t.Context()\n\trelease, _, err := client.Repositories.CreateUpdateEnvironment(ctx, \"o\", \"r\", \"e\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.CreateUpdateEnvironment returned error: %v\", err)\n\t}\n\n\twant := &Environment{ID: Ptr(int64(1)), Name: Ptr(\"staging\"), ProtectionRules: []*ProtectionRule{}}\n\tif !cmp.Equal(release, want) {\n\t\tt.Errorf(\"Repositories.CreateUpdateEnvironment returned %+v, want %+v\", release, want)\n\t}\n}\n\nfunc TestRepositoriesService_createNewEnvNoEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &CreateUpdateEnvironment{\n\t\tDeploymentBranchPolicy: &BranchPolicy{\n\t\t\tProtectedBranches:    Ptr(true),\n\t\t\tCustomBranchPolicies: Ptr(false),\n\t\t},\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/environments/e\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *createUpdateEnvironmentNoEnterprise\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\twant := &createUpdateEnvironmentNoEnterprise{\n\t\t\tDeploymentBranchPolicy: &BranchPolicy{\n\t\t\t\tProtectedBranches:    Ptr(true),\n\t\t\t\tCustomBranchPolicies: Ptr(false),\n\t\t\t},\n\t\t}\n\t\tif !cmp.Equal(v, want) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, want)\n\t\t}\n\t\tfmt.Fprint(w, `{\"id\": 1, \"name\": \"staging\",\t\"protection_rules\": [{\"id\": 1, \"node_id\": \"id\", \"type\": \"branch_policy\"}], \"deployment_branch_policy\": {\"protected_branches\": true, \"custom_branch_policies\": false}}`)\n\t})\n\n\tctx := t.Context()\n\trelease, _, err := client.Repositories.createNewEnvNoEnterprise(ctx, \"repos/o/r/environments/e\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.createNewEnvNoEnterprise returned error: %v\", err)\n\t}\n\n\twant := &Environment{\n\t\tID:   Ptr(int64(1)),\n\t\tName: Ptr(\"staging\"),\n\t\tProtectionRules: []*ProtectionRule{\n\t\t\t{\n\t\t\t\tID:     Ptr(int64(1)),\n\t\t\t\tNodeID: Ptr(\"id\"),\n\t\t\t\tType:   Ptr(\"branch_policy\"),\n\t\t\t},\n\t\t},\n\t\tDeploymentBranchPolicy: &BranchPolicy{\n\t\t\tProtectedBranches:    Ptr(true),\n\t\t\tCustomBranchPolicies: Ptr(false),\n\t\t},\n\t}\n\tif !cmp.Equal(release, want) {\n\t\tt.Errorf(\"Repositories.createNewEnvNoEnterprise returned %+v, want %+v\", release, want)\n\t}\n\n\tconst methodName = \"createNewEnvNoEnterprise\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.createNewEnvNoEnterprise(ctx, \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.createNewEnvNoEnterprise(ctx, \"repos/o/r/environments/e\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_DeleteEnvironment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/environments/e\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Repositories.DeleteEnvironment(ctx, \"o\", \"r\", \"e\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.DeleteEnvironment returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteEnvironment\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.DeleteEnvironment(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.DeleteEnvironment(ctx, \"o\", \"r\", \"e\")\n\t})\n}\n\nfunc TestRepoEnvironment_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &EnvResponse{}, \"{}\")\n\n\trepoEnv := &EnvResponse{\n\t\tTotalCount: Ptr(1),\n\t\tEnvironments: []*Environment{\n\t\t\t{\n\t\t\t\tOwner:           Ptr(\"me\"),\n\t\t\t\tRepo:            Ptr(\"se\"),\n\t\t\t\tEnvironmentName: Ptr(\"dev\"),\n\t\t\t\tWaitTimer:       Ptr(123),\n\t\t\t\tReviewers: []*EnvReviewers{\n\t\t\t\t\t{\n\t\t\t\t\t\tType: Ptr(\"main\"),\n\t\t\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tType: Ptr(\"rev\"),\n\t\t\t\t\t\tID:   Ptr(int64(2)),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tDeploymentBranchPolicy: &BranchPolicy{\n\t\t\t\t\tProtectedBranches:    Ptr(false),\n\t\t\t\t\tCustomBranchPolicies: Ptr(false),\n\t\t\t\t},\n\t\t\t\tID:        Ptr(int64(2)),\n\t\t\t\tNodeID:    Ptr(\"star\"),\n\t\t\t\tName:      Ptr(\"eg\"),\n\t\t\t\tURL:       Ptr(\"https://example.com\"),\n\t\t\t\tHTMLURL:   Ptr(\"htmlurl\"),\n\t\t\t\tCreatedAt: &Timestamp{referenceTime},\n\t\t\t\tUpdatedAt: &Timestamp{referenceTime},\n\t\t\t\tProtectionRules: []*ProtectionRule{\n\t\t\t\t\t{\n\t\t\t\t\t\tID:        Ptr(int64(21)),\n\t\t\t\t\t\tNodeID:    Ptr(\"mnb\"),\n\t\t\t\t\t\tType:      Ptr(\"ewq\"),\n\t\t\t\t\t\tWaitTimer: Ptr(9090),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"total_count\":1,\n\t\t\"environments\":[\n\t\t   {\n\t\t\t  \"owner\":\"me\",\n\t\t\t  \"repo\":\"se\",\n\t\t\t  \"environment_name\":\"dev\",\n\t\t\t  \"wait_timer\":123,\n\t\t\t  \"reviewers\":[\n\t\t\t\t {\n\t\t\t\t\t\"type\":\"main\",\n\t\t\t\t\t\"id\":1\n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t\t\"type\":\"rev\",\n\t\t\t\t\t\"id\":2\n\t\t\t\t }\n\t\t\t  ],\n\t\t\t  \"deployment_branch_policy\":{\n\t\t\t\t \"protected_branches\":false,\n\t\t\t\t \"custom_branch_policies\":false\n\t\t\t  },\n\t\t\t  \"id\":2,\n\t\t\t  \"node_id\":\"star\",\n\t\t\t  \"name\":\"eg\",\n\t\t\t  \"url\":\"https://example.com\",\n\t\t\t  \"html_url\":\"htmlurl\",\n\t\t\t  \"created_at\":` + referenceTimeStr + `,\n\t\t\t  \"updated_at\":` + referenceTimeStr + `,\n\t\t\t  \"protection_rules\":[\n\t\t\t\t {\n\t\t\t\t\t\"id\":21,\n\t\t\t\t\t\"node_id\":\"mnb\",\n\t\t\t\t\t\"type\":\"ewq\",\n\t\t\t\t\t\"wait_timer\":9090\n\t\t\t\t }\n\t\t\t  ]\n\t\t   }\n\t\t]\n\t }`\n\n\ttestJSONMarshal(t, repoEnv, want)\n}\n\nfunc TestEnvReviewers_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &EnvReviewers{}, \"{}\")\n\n\trepoEnv := &EnvReviewers{\n\t\tType: Ptr(\"main\"),\n\t\tID:   Ptr(int64(1)),\n\t}\n\n\twant := `{\n\t\t\"type\":\"main\",\n\t\t\"id\":1\n\t}`\n\n\ttestJSONMarshal(t, repoEnv, want)\n}\n\nfunc TestEnvironment_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Environment{}, \"{}\")\n\n\trepoEnv := &Environment{\n\t\tOwner:           Ptr(\"o\"),\n\t\tRepo:            Ptr(\"r\"),\n\t\tEnvironmentName: Ptr(\"e\"),\n\t\tWaitTimer:       Ptr(123),\n\t\tReviewers: []*EnvReviewers{\n\t\t\t{\n\t\t\t\tType: Ptr(\"main\"),\n\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t},\n\t\t\t{\n\t\t\t\tType: Ptr(\"rev\"),\n\t\t\t\tID:   Ptr(int64(2)),\n\t\t\t},\n\t\t},\n\t\tDeploymentBranchPolicy: &BranchPolicy{\n\t\t\tProtectedBranches:    Ptr(false),\n\t\t\tCustomBranchPolicies: Ptr(false),\n\t\t},\n\t\tID:        Ptr(int64(2)),\n\t\tNodeID:    Ptr(\"star\"),\n\t\tName:      Ptr(\"eg\"),\n\t\tURL:       Ptr(\"https://example.com\"),\n\t\tHTMLURL:   Ptr(\"htmlurl\"),\n\t\tCreatedAt: &Timestamp{referenceTime},\n\t\tUpdatedAt: &Timestamp{referenceTime},\n\t\tProtectionRules: []*ProtectionRule{\n\t\t\t{\n\t\t\t\tID:        Ptr(int64(21)),\n\t\t\t\tNodeID:    Ptr(\"mnb\"),\n\t\t\t\tType:      Ptr(\"ewq\"),\n\t\t\t\tWaitTimer: Ptr(9090),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"owner\":\"o\",\n\t\t\"repo\":\"r\",\n\t\t\"environment_name\":\"e\",\n\t\t\"wait_timer\":123,\n\t\t\"reviewers\":[\n\t\t\t{\n\t\t\t\t\"type\":\"main\",\n\t\t\t\t\"id\":1\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"type\":\"rev\",\n\t\t\t\t\"id\":2\n\t\t\t}\n\t\t],\n\t\t\"deployment_branch_policy\":{\n\t\t\t\"protected_branches\":false,\n\t\t\t\"custom_branch_policies\":false\n\t\t},\n\t\t\"id\":2,\n\t\t\"node_id\":\"star\",\n\t\t\"name\":\"eg\",\n\t\t\"url\":\"https://example.com\",\n\t\t\"html_url\":\"htmlurl\",\n\t\t\"created_at\":` + referenceTimeStr + `,\n\t\t\"updated_at\":` + referenceTimeStr + `,\n\t\t\"protection_rules\":[\n\t\t\t{\n\t\t\t\t\"id\":21,\n\t\t\t\t\"node_id\":\"mnb\",\n\t\t\t\t\"type\":\"ewq\",\n\t\t\t\t\"wait_timer\":9090\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, repoEnv, want)\n}\n\nfunc TestBranchPolicy_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &BranchPolicy{}, \"{}\")\n\n\tbp := &BranchPolicy{\n\t\tProtectedBranches:    Ptr(false),\n\t\tCustomBranchPolicies: Ptr(false),\n\t}\n\n\twant := `{\n\t\t\"protected_branches\": false,\n\t\t\"custom_branch_policies\": false\n\t}`\n\n\ttestJSONMarshal(t, bp, want)\n}\n"
  },
  {
    "path": "github/repos_forks.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n)\n\n// RepositoryListForksOptions specifies the optional parameters to the\n// RepositoriesService.ListForks method.\ntype RepositoryListForksOptions struct {\n\t// How to sort the forks list. Possible values are: newest, oldest,\n\t// watchers. Default is \"newest\".\n\tSort string `url:\"sort,omitempty\"`\n\n\tListOptions\n}\n\n// ListForks lists the forks of the specified repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/forks#list-forks\n//\n//meta:operation GET /repos/{owner}/{repo}/forks\nfunc (s *RepositoriesService) ListForks(ctx context.Context, owner, repo string, opts *RepositoryListForksOptions) ([]*Repository, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/forks\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeTopicsPreview)\n\n\tvar repos []*Repository\n\tresp, err := s.client.Do(ctx, req, &repos)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn repos, resp, nil\n}\n\n// RepositoryCreateForkOptions specifies the optional parameters to the\n// RepositoriesService.CreateFork method.\ntype RepositoryCreateForkOptions struct {\n\t// The organization to fork the repository into.\n\tOrganization      string `json:\"organization,omitempty\"`\n\tName              string `json:\"name,omitempty\"`\n\tDefaultBranchOnly bool   `json:\"default_branch_only,omitempty\"`\n}\n\n// CreateFork creates a fork of the specified repository.\n//\n// This method might return an *AcceptedError and a status code of\n// 202. This is because this is the status that GitHub returns to signify that\n// it is now computing creating the fork in a background task. In this event,\n// the Repository value will be returned, which includes the details about the pending fork.\n// A follow up request, after a delay of a second or so, should result\n// in a successful request.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/forks#create-a-fork\n//\n//meta:operation POST /repos/{owner}/{repo}/forks\nfunc (s *RepositoriesService) CreateFork(ctx context.Context, owner, repo string, opts *RepositoryCreateForkOptions) (*Repository, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/forks\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"POST\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar fork Repository\n\tresp, err := s.client.Do(ctx, req, &fork)\n\tif err != nil {\n\t\t// Persist AcceptedError's metadata to the Repository object.\n\t\tvar aerr *AcceptedError\n\t\tif errors.As(err, &aerr) {\n\t\t\tif err := json.Unmarshal(aerr.Raw, &fork); err != nil {\n\t\t\t\treturn &fork, resp, err\n\t\t\t}\n\n\t\t\treturn &fork, resp, err\n\t\t}\n\t\treturn nil, resp, err\n\t}\n\n\treturn &fork, resp, nil\n}\n"
  },
  {
    "path": "github/repos_forks_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_ListForks(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/forks\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeTopicsPreview)\n\t\ttestFormValues(t, r, values{\n\t\t\t\"sort\": \"newest\",\n\t\t\t\"page\": \"3\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"id\":1},{\"id\":2}]`)\n\t})\n\n\topt := &RepositoryListForksOptions{\n\t\tSort:        \"newest\",\n\t\tListOptions: ListOptions{Page: 3},\n\t}\n\tctx := t.Context()\n\trepos, _, err := client.Repositories.ListForks(ctx, \"o\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListForks returned error: %v\", err)\n\t}\n\n\twant := []*Repository{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}}\n\tif !cmp.Equal(repos, want) {\n\t\tt.Errorf(\"Repositories.ListForks returned %+v, want %+v\", repos, want)\n\t}\n\n\tconst methodName = \"ListForks\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListForks(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListForks(ctx, \"o\", \"r\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListForks_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.ListForks(ctx, \"%\", \"r\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoriesService_CreateFork(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/forks\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestBody(t, r, `{\"organization\":\"o\",\"name\":\"n\",\"default_branch_only\":true}`+\"\\n\")\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\topt := &RepositoryCreateForkOptions{Organization: \"o\", Name: \"n\", DefaultBranchOnly: true}\n\tctx := t.Context()\n\trepo, _, err := client.Repositories.CreateFork(ctx, \"o\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.CreateFork returned error: %v\", err)\n\t}\n\n\twant := &Repository{ID: Ptr(int64(1))}\n\tif !cmp.Equal(repo, want) {\n\t\tt.Errorf(\"Repositories.CreateFork returned %+v, want %+v\", repo, want)\n\t}\n\n\tconst methodName = \"CreateFork\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.CreateFork(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.CreateFork(ctx, \"o\", \"r\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_CreateFork_deferred(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/forks\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestBody(t, r, `{\"organization\":\"o\",\"name\":\"n\",\"default_branch_only\":true}`+\"\\n\")\n\t\t// This response indicates the fork will happen asynchronously.\n\t\tw.WriteHeader(http.StatusAccepted)\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\topt := &RepositoryCreateForkOptions{Organization: \"o\", Name: \"n\", DefaultBranchOnly: true}\n\tctx := t.Context()\n\trepo, _, err := client.Repositories.CreateFork(ctx, \"o\", \"r\", opt)\n\tif !errors.As(err, new(*AcceptedError)) {\n\t\tt.Errorf(\"Repositories.CreateFork returned error: %v (want AcceptedError)\", err)\n\t}\n\n\twant := &Repository{ID: Ptr(int64(1))}\n\tif !cmp.Equal(repo, want) {\n\t\tt.Errorf(\"Repositories.CreateFork returned %+v, want %+v\", repo, want)\n\t}\n}\n\nfunc TestRepositoriesService_CreateFork_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.CreateFork(ctx, \"%\", \"r\", nil)\n\ttestURLParseError(t, err)\n}\n"
  },
  {
    "path": "github/repos_hooks.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strings\"\n)\n\n// WebHookPayload represents the data that is received from GitHub when a push\n// event hook is triggered. The format of these payloads pre-date most of the\n// GitHub v3 API, so there are lots of minor incompatibilities with the types\n// defined in the rest of the API. Therefore, several types are duplicated\n// here to account for these differences.\n//\n// GitHub API docs: https://help.github.com/articles/post-receive-hooks\n//\n// Deprecated: Please use PushEvent instead.\ntype WebHookPayload = PushEvent\n\n// WebHookCommit represents the commit variant we receive from GitHub in a\n// WebHookPayload.\n//\n// Deprecated: Please use HeadCommit instead.\ntype WebHookCommit = HeadCommit\n\n// WebHookAuthor represents the author or committer of a commit, as specified\n// in a WebHookCommit. The commit author may not correspond to a GitHub User.\n//\n// Deprecated: Please use CommitAuthor instead.\n// NOTE Breaking API change: the `Username` field is now called `Login`.\ntype WebHookAuthor = CommitAuthor\n\n// Hook represents a GitHub (web and service) hook for a repository.\ntype Hook struct {\n\tCreatedAt    *Timestamp     `json:\"created_at,omitempty\"`\n\tUpdatedAt    *Timestamp     `json:\"updated_at,omitempty\"`\n\tURL          *string        `json:\"url,omitempty\"`\n\tID           *int64         `json:\"id,omitempty\"`\n\tType         *string        `json:\"type,omitempty\"`\n\tName         *string        `json:\"name,omitempty\"`\n\tTestURL      *string        `json:\"test_url,omitempty\"`\n\tPingURL      *string        `json:\"ping_url,omitempty\"`\n\tLastResponse map[string]any `json:\"last_response,omitempty\"`\n\n\t// Only the following fields are used when creating a hook.\n\t// Config is required.\n\tConfig *HookConfig `json:\"config,omitempty\"`\n\tEvents []string    `json:\"events,omitempty\"`\n\tActive *bool       `json:\"active,omitempty\"`\n}\n\nfunc (h Hook) String() string {\n\treturn Stringify(h)\n}\n\n// createHookRequest is a subset of Hook and is used internally\n// by CreateHook to pass only the known fields for the endpoint.\n//\n// See https://github.com/google/go-github/issues/1015 for more\n// information.\ntype createHookRequest struct {\n\t// Config is required.\n\tName   string      `json:\"name\"`\n\tConfig *HookConfig `json:\"config,omitempty\"`\n\tEvents []string    `json:\"events,omitempty\"`\n\tActive *bool       `json:\"active,omitempty\"`\n}\n\n// CreateHook creates a Hook for the specified repository.\n// Config is a required field.\n//\n// Note that only a subset of the hook fields are used and hook must\n// not be nil.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/webhooks#create-a-repository-webhook\n//\n//meta:operation POST /repos/{owner}/{repo}/hooks\nfunc (s *RepositoriesService) CreateHook(ctx context.Context, owner, repo string, hook *Hook) (*Hook, *Response, error) {\n\tif hook == nil {\n\t\treturn nil, nil, errors.New(\"hook must be provided\")\n\t}\n\n\tu := fmt.Sprintf(\"repos/%v/%v/hooks\", owner, repo)\n\n\thookReq := &createHookRequest{\n\t\tName:   \"web\",\n\t\tEvents: hook.Events,\n\t\tActive: hook.Active,\n\t\tConfig: hook.Config,\n\t}\n\n\treq, err := s.client.NewRequest(\"POST\", u, hookReq)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar h *Hook\n\tresp, err := s.client.Do(ctx, req, &h)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn h, resp, nil\n}\n\n// ListHooks lists all Hooks for the specified repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/webhooks#list-repository-webhooks\n//\n//meta:operation GET /repos/{owner}/{repo}/hooks\nfunc (s *RepositoriesService) ListHooks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Hook, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/hooks\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar hooks []*Hook\n\tresp, err := s.client.Do(ctx, req, &hooks)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn hooks, resp, nil\n}\n\n// GetHook returns a single specified Hook.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/webhooks#get-a-repository-webhook\n//\n//meta:operation GET /repos/{owner}/{repo}/hooks/{hook_id}\nfunc (s *RepositoriesService) GetHook(ctx context.Context, owner, repo string, id int64) (*Hook, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/hooks/%v\", owner, repo, id)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar h *Hook\n\tresp, err := s.client.Do(ctx, req, &h)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn h, resp, nil\n}\n\n// EditHook updates a specified Hook.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/webhooks#update-a-repository-webhook\n//\n//meta:operation PATCH /repos/{owner}/{repo}/hooks/{hook_id}\nfunc (s *RepositoriesService) EditHook(ctx context.Context, owner, repo string, id int64, hook *Hook) (*Hook, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/hooks/%v\", owner, repo, id)\n\treq, err := s.client.NewRequest(\"PATCH\", u, hook)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar h *Hook\n\tresp, err := s.client.Do(ctx, req, &h)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn h, resp, nil\n}\n\n// DeleteHook deletes a specified Hook.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/webhooks#delete-a-repository-webhook\n//\n//meta:operation DELETE /repos/{owner}/{repo}/hooks/{hook_id}\nfunc (s *RepositoriesService) DeleteHook(ctx context.Context, owner, repo string, id int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/hooks/%v\", owner, repo, id)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// PingHook triggers a 'ping' event to be sent to the Hook.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/webhooks#ping-a-repository-webhook\n//\n//meta:operation POST /repos/{owner}/{repo}/hooks/{hook_id}/pings\nfunc (s *RepositoriesService) PingHook(ctx context.Context, owner, repo string, id int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/hooks/%v/pings\", owner, repo, id)\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// TestHook triggers a test Hook by github.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/webhooks#test-the-push-repository-webhook\n//\n//meta:operation POST /repos/{owner}/{repo}/hooks/{hook_id}/tests\nfunc (s *RepositoriesService) TestHook(ctx context.Context, owner, repo string, id int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/hooks/%v/tests\", owner, repo, id)\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// Subscribe lets servers register to receive updates when a topic is updated.\n//\n// GitHub API docs: https://docs.github.com/webhooks/about-webhooks-for-repositories#pubsubhubbub\n//\n//meta:operation POST /hub\nfunc (s *RepositoriesService) Subscribe(ctx context.Context, owner, repo, event, callback string, secret []byte) (*Response, error) {\n\treq, err := s.createWebSubRequest(\"subscribe\", owner, repo, event, callback, secret)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// Unsubscribe lets servers unregister to no longer receive updates when a topic is updated.\n//\n// GitHub API docs: https://docs.github.com/webhooks/about-webhooks-for-repositories#pubsubhubbub\n//\n//meta:operation POST /hub\nfunc (s *RepositoriesService) Unsubscribe(ctx context.Context, owner, repo, event, callback string, secret []byte) (*Response, error) {\n\treq, err := s.createWebSubRequest(\"unsubscribe\", owner, repo, event, callback, secret)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// createWebSubRequest returns a subscribe/unsubscribe request that implements\n// the WebSub (formerly PubSubHubbub) protocol.\n//\n// See: https://www.w3.org/TR/websub/#subscriber-sends-subscription-request\nfunc (s *RepositoriesService) createWebSubRequest(hubMode, owner, repo, event, callback string, secret []byte) (*http.Request, error) {\n\ttopic := fmt.Sprintf(\n\t\t\"https://github.com/%v/%v/events/%v\",\n\t\towner,\n\t\trepo,\n\t\tevent,\n\t)\n\tform := url.Values{}\n\tform.Add(\"hub.mode\", hubMode)\n\tform.Add(\"hub.topic\", topic)\n\tform.Add(\"hub.callback\", callback)\n\tif secret != nil {\n\t\tform.Add(\"hub.secret\", string(secret))\n\t}\n\tbody := strings.NewReader(form.Encode())\n\n\treq, err := s.client.NewFormRequest(\"hub\", body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn req, nil\n}\n"
  },
  {
    "path": "github/repos_hooks_configuration.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// HookConfig describes metadata about a webhook configuration.\ntype HookConfig struct {\n\t// The media type used to serialize the payloads\n\t// Possible values are `json` and `form`, the field is not specified the default is `form`\n\tContentType *string `json:\"content_type,omitempty\"`\n\t// The possible values are 0 and 1.\n\t// Setting it to 1 will allow skipping certificate verification for the host,\n\t// potentially exposing to MitM attacks: https://en.wikipedia.org/wiki/Man-in-the-middle_attack\n\tInsecureSSL *string `json:\"insecure_ssl,omitempty\"`\n\tURL         *string `json:\"url,omitempty\"`\n\n\t// Secret is returned obfuscated by GitHub, but it can be set for outgoing requests.\n\tSecret *string `json:\"secret,omitempty\"`\n}\n\n// GetHookConfiguration returns the configuration for the specified repository webhook.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/webhooks#get-a-webhook-configuration-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/hooks/{hook_id}/config\nfunc (s *RepositoriesService) GetHookConfiguration(ctx context.Context, owner, repo string, id int64) (*HookConfig, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/hooks/%v/config\", owner, repo, id)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar config *HookConfig\n\tresp, err := s.client.Do(ctx, req, &config)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn config, resp, nil\n}\n\n// EditHookConfiguration updates the configuration for the specified repository webhook.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/webhooks#update-a-webhook-configuration-for-a-repository\n//\n//meta:operation PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config\nfunc (s *RepositoriesService) EditHookConfiguration(ctx context.Context, owner, repo string, id int64, config *HookConfig) (*HookConfig, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/hooks/%v/config\", owner, repo, id)\n\treq, err := s.client.NewRequest(\"PATCH\", u, config)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar c *HookConfig\n\tresp, err := s.client.Do(ctx, req, &c)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn c, resp, nil\n}\n"
  },
  {
    "path": "github/repos_hooks_configuration_test.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_GetHookConfiguration(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/hooks/1/config\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"content_type\": \"json\", \"insecure_ssl\": \"0\", \"secret\": \"********\", \"url\": \"https://example.com/webhook\"}`)\n\t})\n\n\tctx := t.Context()\n\tconfig, _, err := client.Repositories.GetHookConfiguration(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetHookConfiguration returned error: %v\", err)\n\t}\n\n\twant := &HookConfig{\n\t\tContentType: Ptr(\"json\"),\n\t\tInsecureSSL: Ptr(\"0\"),\n\t\tSecret:      Ptr(\"********\"),\n\t\tURL:         Ptr(\"https://example.com/webhook\"),\n\t}\n\tif !cmp.Equal(config, want) {\n\t\tt.Errorf(\"Repositories.GetHookConfiguration returned %+v, want %+v\", config, want)\n\t}\n\n\tconst methodName = \"GetHookConfiguration\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetHookConfiguration(ctx, \"\\n\", \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetHookConfiguration(ctx, \"o\", \"r\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetHookConfiguration_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.GetHookConfiguration(ctx, \"%\", \"%\", 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoriesService_EditHookConfiguration(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &HookConfig{}\n\n\tmux.HandleFunc(\"/repos/o/r/hooks/1/config\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *HookConfig\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"content_type\": \"json\", \"insecure_ssl\": \"0\", \"secret\": \"********\", \"url\": \"https://example.com/webhook\"}`)\n\t})\n\n\tctx := t.Context()\n\tconfig, _, err := client.Repositories.EditHookConfiguration(ctx, \"o\", \"r\", 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.EditHookConfiguration returned error: %v\", err)\n\t}\n\n\twant := &HookConfig{\n\t\tContentType: Ptr(\"json\"),\n\t\tInsecureSSL: Ptr(\"0\"),\n\t\tSecret:      Ptr(\"********\"),\n\t\tURL:         Ptr(\"https://example.com/webhook\"),\n\t}\n\tif !cmp.Equal(config, want) {\n\t\tt.Errorf(\"Repositories.EditHookConfiguration returned %+v, want %+v\", config, want)\n\t}\n\n\tconst methodName = \"EditHookConfiguration\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.EditHookConfiguration(ctx, \"\\n\", \"\\n\", -1, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.EditHookConfiguration(ctx, \"o\", \"r\", 1, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_EditHookConfiguration_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.EditHookConfiguration(ctx, \"%\", \"%\", 1, nil)\n\ttestURLParseError(t, err)\n}\n"
  },
  {
    "path": "github/repos_hooks_deliveries.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"strings\"\n)\n\n// HookDelivery represents the data that is received from GitHub's Webhook Delivery API\n//\n// GitHub API docs:\n// - https://docs.github.com/rest/webhooks/repo-deliveries#list-deliveries-for-a-repository-webhook\n// - https://docs.github.com/rest/webhooks/repo-deliveries#get-a-delivery-for-a-repository-webhook\ntype HookDelivery struct {\n\tID             *int64     `json:\"id,omitempty\"`\n\tGUID           *string    `json:\"guid,omitempty\"`\n\tDeliveredAt    *Timestamp `json:\"delivered_at,omitempty\"`\n\tRedelivery     *bool      `json:\"redelivery,omitempty\"`\n\tDuration       *float64   `json:\"duration,omitempty\"`\n\tStatus         *string    `json:\"status,omitempty\"`\n\tStatusCode     *int       `json:\"status_code,omitempty\"`\n\tEvent          *string    `json:\"event,omitempty\"`\n\tAction         *string    `json:\"action,omitempty\"`\n\tInstallationID *int64     `json:\"installation_id,omitempty\"`\n\tRepositoryID   *int64     `json:\"repository_id,omitempty\"`\n\n\t// Request is populated by GetHookDelivery.\n\tRequest *HookRequest `json:\"request,omitempty\"`\n\t// Response is populated by GetHookDelivery.\n\tResponse *HookResponse `json:\"response,omitempty\"`\n}\n\nfunc (d HookDelivery) String() string {\n\treturn Stringify(d)\n}\n\n// getHeader common function for GetHeader funcs of HookRequest & HookResponse.\nfunc getHeader(headers map[string]string, key string) string {\n\tfor k, v := range headers {\n\t\tif strings.EqualFold(k, key) {\n\t\t\treturn v\n\t\t}\n\t}\n\treturn \"\"\n}\n\n// HookRequest is a part of HookDelivery that contains\n// the HTTP headers and the JSON payload of the webhook request.\ntype HookRequest struct {\n\tHeaders    map[string]string `json:\"headers,omitempty\"`\n\tRawPayload *json.RawMessage  `json:\"payload,omitempty\"`\n}\n\n// GetHeader gets the value associated with the given key (ignoring key case).\nfunc (r *HookRequest) GetHeader(key string) string {\n\treturn getHeader(r.Headers, key)\n}\n\nfunc (r HookRequest) String() string {\n\treturn Stringify(r)\n}\n\n// HookResponse is a part of HookDelivery that contains\n// the HTTP headers and the response body served by the webhook endpoint.\ntype HookResponse struct {\n\tHeaders    map[string]string `json:\"headers,omitempty\"`\n\tRawPayload *json.RawMessage  `json:\"payload,omitempty\"`\n}\n\n// GetHeader gets the value associated with the given key (ignoring key case).\nfunc (r *HookResponse) GetHeader(key string) string {\n\treturn getHeader(r.Headers, key)\n}\n\nfunc (r HookResponse) String() string {\n\treturn Stringify(r)\n}\n\n// ListHookDeliveries lists webhook deliveries for a webhook configured in a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/webhooks#list-deliveries-for-a-repository-webhook\n//\n//meta:operation GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries\nfunc (s *RepositoriesService) ListHookDeliveries(ctx context.Context, owner, repo string, id int64, opts *ListCursorOptions) ([]*HookDelivery, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/hooks/%v/deliveries\", owner, repo, id)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tdeliveries := []*HookDelivery{}\n\tresp, err := s.client.Do(ctx, req, &deliveries)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn deliveries, resp, nil\n}\n\n// GetHookDelivery returns a delivery for a webhook configured in a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/webhooks#get-a-delivery-for-a-repository-webhook\n//\n//meta:operation GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}\nfunc (s *RepositoriesService) GetHookDelivery(ctx context.Context, owner, repo string, hookID, deliveryID int64) (*HookDelivery, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/hooks/%v/deliveries/%v\", owner, repo, hookID, deliveryID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar h *HookDelivery\n\tresp, err := s.client.Do(ctx, req, &h)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn h, resp, nil\n}\n\n// RedeliverHookDelivery redelivers a delivery for a webhook configured in a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/webhooks#redeliver-a-delivery-for-a-repository-webhook\n//\n//meta:operation POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts\nfunc (s *RepositoriesService) RedeliverHookDelivery(ctx context.Context, owner, repo string, hookID, deliveryID int64) (*HookDelivery, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/hooks/%v/deliveries/%v/attempts\", owner, repo, hookID, deliveryID)\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar h *HookDelivery\n\tresp, err := s.client.Do(ctx, req, &h)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn h, resp, nil\n}\n\n// ParseRequestPayload parses the request payload. For recognized event types,\n// a value of the corresponding struct type will be returned.\nfunc (d *HookDelivery) ParseRequestPayload() (any, error) {\n\teType, ok := messageToTypeName[d.GetEvent()]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"unsupported event type %q\", d.GetEvent())\n\t}\n\n\te := &Event{Type: &eType, RawPayload: d.Request.RawPayload}\n\treturn e.ParsePayload()\n}\n"
  },
  {
    "path": "github/repos_hooks_deliveries_test.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_ListHookDeliveries(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/hooks/1/deliveries\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"cursor\": \"v1_12077215967\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}, {\"id\":2}]`)\n\t})\n\n\topt := &ListCursorOptions{Cursor: \"v1_12077215967\"}\n\n\tctx := t.Context()\n\thooks, _, err := client.Repositories.ListHookDeliveries(ctx, \"o\", \"r\", 1, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListHookDeliveries returned error: %v\", err)\n\t}\n\n\twant := []*HookDelivery{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}}\n\tif d := cmp.Diff(hooks, want); d != \"\" {\n\t\tt.Errorf(\"Repositories.ListHooks want (-), got (+):\\n%v\", d)\n\t}\n\n\tconst methodName = \"ListHookDeliveries\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListHookDeliveries(ctx, \"\\n\", \"\\n\", -1, opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListHookDeliveries(ctx, \"o\", \"r\", 1, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListHookDeliveries_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.ListHookDeliveries(ctx, \"%\", \"%\", 1, nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoriesService_GetHookDelivery(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/hooks/1/deliveries/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\thook, _, err := client.Repositories.GetHookDelivery(ctx, \"o\", \"r\", 1, 1)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetHookDelivery returned error: %v\", err)\n\t}\n\n\twant := &HookDelivery{ID: Ptr(int64(1))}\n\tif !cmp.Equal(hook, want) {\n\t\tt.Errorf(\"Repositories.GetHookDelivery returned %+v, want %+v\", hook, want)\n\t}\n\n\tconst methodName = \"GetHookDelivery\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetHookDelivery(ctx, \"\\n\", \"\\n\", -1, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetHookDelivery(ctx, \"o\", \"r\", 1, 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetHookDelivery_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.GetHookDelivery(ctx, \"%\", \"%\", 1, 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoriesService_RedeliverHookDelivery(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/hooks/1/deliveries/1/attempts\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\thook, _, err := client.Repositories.RedeliverHookDelivery(ctx, \"o\", \"r\", 1, 1)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.RedeliverHookDelivery returned error: %v\", err)\n\t}\n\n\twant := &HookDelivery{ID: Ptr(int64(1))}\n\tif !cmp.Equal(hook, want) {\n\t\tt.Errorf(\"Repositories.RedeliverHookDelivery returned %+v, want %+v\", hook, want)\n\t}\n\n\tconst methodName = \"RedeliverHookDelivery\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.RedeliverHookDelivery(ctx, \"\\n\", \"\\n\", -1, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.RedeliverHookDelivery(ctx, \"o\", \"r\", 1, 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nvar hookDeliveryPayloadTypeToStruct = map[string]any{\n\t\"check_run\":                      &CheckRunEvent{},\n\t\"check_suite\":                    &CheckSuiteEvent{},\n\t\"code_scanning_alert\":            &CodeScanningAlertEvent{},\n\t\"commit_comment\":                 &CommitCommentEvent{},\n\t\"content_reference\":              &ContentReferenceEvent{},\n\t\"create\":                         &CreateEvent{},\n\t\"delete\":                         &DeleteEvent{},\n\t\"dependabot_alert\":               &DependabotAlertEvent{},\n\t\"deploy_key\":                     &DeployKeyEvent{},\n\t\"deployment\":                     &DeploymentEvent{},\n\t\"deployment_status\":              &DeploymentStatusEvent{},\n\t\"discussion_comment\":             &DiscussionCommentEvent{},\n\t\"discussion\":                     &DiscussionEvent{},\n\t\"fork\":                           &ForkEvent{},\n\t\"github_app_authorization\":       &GitHubAppAuthorizationEvent{},\n\t\"gollum\":                         &GollumEvent{},\n\t\"installation\":                   &InstallationEvent{},\n\t\"installation_repositories\":      &InstallationRepositoriesEvent{},\n\t\"issue_comment\":                  &IssueCommentEvent{},\n\t\"issues\":                         &IssuesEvent{},\n\t\"label\":                          &LabelEvent{},\n\t\"marketplace_purchase\":           &MarketplacePurchaseEvent{},\n\t\"member\":                         &MemberEvent{},\n\t\"membership\":                     &MembershipEvent{},\n\t\"meta\":                           &MetaEvent{},\n\t\"milestone\":                      &MilestoneEvent{},\n\t\"organization\":                   &OrganizationEvent{},\n\t\"org_block\":                      &OrgBlockEvent{},\n\t\"package\":                        &PackageEvent{},\n\t\"page_build\":                     &PageBuildEvent{},\n\t\"ping\":                           &PingEvent{},\n\t\"projects_v2\":                    &ProjectV2Event{},\n\t\"projects_v2_item\":               &ProjectV2ItemEvent{},\n\t\"public\":                         &PublicEvent{},\n\t\"pull_request\":                   &PullRequestEvent{},\n\t\"pull_request_review\":            &PullRequestReviewEvent{},\n\t\"pull_request_review_comment\":    &PullRequestReviewCommentEvent{},\n\t\"pull_request_review_thread\":     &PullRequestReviewThreadEvent{},\n\t\"pull_request_target\":            &PullRequestTargetEvent{},\n\t\"push\":                           &PushEvent{},\n\t\"registry_package\":               &RegistryPackageEvent{},\n\t\"release\":                        &ReleaseEvent{},\n\t\"repository\":                     &RepositoryEvent{},\n\t\"repository_dispatch\":            &RepositoryDispatchEvent{},\n\t\"repository_import\":              &RepositoryImportEvent{},\n\t\"repository_vulnerability_alert\": &RepositoryVulnerabilityAlertEvent{},\n\t\"secret_scanning_alert\":          &SecretScanningAlertEvent{},\n\t\"security_advisory\":              &SecurityAdvisoryEvent{},\n\t\"security_and_analysis\":          &SecurityAndAnalysisEvent{},\n\t\"star\":                           &StarEvent{},\n\t\"status\":                         &StatusEvent{},\n\t\"team\":                           &TeamEvent{},\n\t\"team_add\":                       &TeamAddEvent{},\n\t\"user\":                           &UserEvent{},\n\t\"watch\":                          &WatchEvent{},\n\t\"workflow_dispatch\":              &WorkflowDispatchEvent{},\n\t\"workflow_job\":                   &WorkflowJobEvent{},\n\t\"workflow_run\":                   &WorkflowRunEvent{},\n}\n\nfunc TestHookDelivery_ParsePayload(t *testing.T) {\n\tt.Parallel()\n\tfor evt, obj := range hookDeliveryPayloadTypeToStruct {\n\t\tt.Run(evt, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tbs, err := json.Marshal(obj)\n\t\t\tif err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\n\t\t\tp := json.RawMessage(bs)\n\n\t\t\td := &HookDelivery{\n\t\t\t\tEvent: Ptr(evt),\n\t\t\t\tRequest: &HookRequest{\n\t\t\t\t\tRawPayload: &p,\n\t\t\t\t},\n\t\t\t}\n\n\t\t\tgot, err := d.ParseRequestPayload()\n\t\t\tif err != nil {\n\t\t\t\tt.Error(err)\n\t\t\t}\n\n\t\t\tif !cmp.Equal(obj, got) {\n\t\t\t\tt.Errorf(\"want %T %v, got %T %v\", obj, obj, got, got)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestHookDelivery_ParsePayload_invalidEvent(t *testing.T) {\n\tt.Parallel()\n\tp := json.RawMessage(nil)\n\n\td := &HookDelivery{\n\t\tEvent: Ptr(\"some_invalid_event\"),\n\t\tRequest: &HookRequest{\n\t\t\tRawPayload: &p,\n\t\t},\n\t}\n\n\t_, err := d.ParseRequestPayload()\n\tif err == nil || err.Error() != `unsupported event type \"some_invalid_event\"` {\n\t\tt.Errorf(\"unexpected error: %v\", err)\n\t}\n}\n\nfunc TestHookDelivery_ParsePayload_invalidPayload(t *testing.T) {\n\tt.Parallel()\n\tp := json.RawMessage([]byte(`{\"check_run\":{\"id\":\"invalid\"}}`))\n\n\td := &HookDelivery{\n\t\tEvent: Ptr(\"check_run\"),\n\t\tRequest: &HookRequest{\n\t\t\tRawPayload: &p,\n\t\t},\n\t}\n\n\t_, err := d.ParseRequestPayload()\n\tif err == nil || !strings.Contains(err.Error(), \"json: cannot unmarshal\") || !strings.Contains(err.Error(), \"check_run.id\") {\n\t\tt.Errorf(\"unexpected error: %v\", err)\n\t}\n}\n\nfunc TestHookRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &HookRequest{}, \"{}\")\n\n\theader := make(map[string]string)\n\theader[\"key\"] = \"value\"\n\n\tjsonMsg, _ := json.Marshal(&header)\n\n\tr := &HookRequest{\n\t\tHeaders:    header,\n\t\tRawPayload: (*json.RawMessage)(&jsonMsg),\n\t}\n\n\twant := `{\n\t\t\"headers\": {\n\t\t\t\"key\": \"value\"\n\t\t},\n\t\t\"payload\": {\n\t\t\t\"key\": \"value\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, r, want, cmpJSONRawMessageComparator())\n}\n\nfunc TestHookRequest_GetHeader(t *testing.T) {\n\tt.Parallel()\n\n\theader := make(map[string]string)\n\theader[\"key1\"] = \"value1\"\n\theader[\"Key+2\"] = \"value2\"\n\theader[\"kEy-3\"] = \"value3\"\n\theader[\"KEY_4\"] = \"value4\"\n\n\tr := &HookRequest{\n\t\tHeaders: header,\n\t}\n\n\t// Checking positive cases\n\ttestPrefixes := []string{\"key\", \"Key\", \"kEy\", \"KEY\"}\n\tfor hdrKey, hdrValue := range header {\n\t\tfor _, prefix := range testPrefixes {\n\t\t\tkey := prefix + hdrKey[3:]\n\t\t\tif val := r.GetHeader(key); val != hdrValue {\n\t\t\t\tt.Errorf(\"GetHeader(%q) is not working: %q != %q\", key, val, hdrValue)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Checking negative case\n\tkey := \"asd\"\n\tif val := r.GetHeader(key); val != \"\" {\n\t\tt.Errorf(\"GetHeader(%q) should return empty value: %q != %q\", key, val, \"\")\n\t}\n\tkey = \"kay1\"\n\tif val := r.GetHeader(key); val != \"\" {\n\t\tt.Errorf(\"GetHeader(%q) should return empty value: %q != %q\", key, val, \"\")\n\t}\n}\n\nfunc TestHookResponse_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &HookResponse{}, \"{}\")\n\n\theader := make(map[string]string)\n\theader[\"key\"] = \"value\"\n\n\tjsonMsg, _ := json.Marshal(&header)\n\n\tr := &HookResponse{\n\t\tHeaders:    header,\n\t\tRawPayload: (*json.RawMessage)(&jsonMsg),\n\t}\n\n\twant := `{\n\t\t\"headers\": {\n\t\t\t\"key\": \"value\"\n\t\t},\n\t\t\"payload\": {\n\t\t\t\"key\": \"value\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, r, want, cmpJSONRawMessageComparator())\n}\n\nfunc TestHookResponse_GetHeader(t *testing.T) {\n\tt.Parallel()\n\n\theader := make(map[string]string)\n\theader[\"key1\"] = \"value1\"\n\theader[\"Key+2\"] = \"value2\"\n\theader[\"kEy-3\"] = \"value3\"\n\theader[\"KEY_4\"] = \"value4\"\n\n\tr := &HookResponse{\n\t\tHeaders: header,\n\t}\n\n\t// Checking positive cases\n\ttestPrefixes := []string{\"key\", \"Key\", \"kEy\", \"KEY\"}\n\tfor hdrKey, hdrValue := range header {\n\t\tfor _, prefix := range testPrefixes {\n\t\t\tkey := prefix + hdrKey[3:]\n\t\t\tif val := r.GetHeader(key); val != hdrValue {\n\t\t\t\tt.Errorf(\"GetHeader(%q) is not working: %q != %q\", key, val, hdrValue)\n\t\t\t}\n\t\t}\n\t}\n\n\t// Checking negative case\n\tkey := \"asd\"\n\tif val := r.GetHeader(key); val != \"\" {\n\t\tt.Errorf(\"GetHeader(%q) should return empty value: %q != %q\", key, val, \"\")\n\t}\n\tkey = \"kay1\"\n\tif val := r.GetHeader(key); val != \"\" {\n\t\tt.Errorf(\"GetHeader(%q) should return empty value: %q != %q\", key, val, \"\")\n\t}\n}\n\nfunc TestHookDelivery_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &HookDelivery{}, \"{}\")\n\n\theader := make(map[string]string)\n\theader[\"key\"] = \"value\"\n\n\tjsonMsg, _ := json.Marshal(&header)\n\n\tr := &HookDelivery{\n\t\tID:             Ptr(int64(1)),\n\t\tGUID:           Ptr(\"guid\"),\n\t\tDeliveredAt:    &Timestamp{referenceTime},\n\t\tRedelivery:     Ptr(true),\n\t\tDuration:       Ptr(1.0),\n\t\tStatus:         Ptr(\"guid\"),\n\t\tStatusCode:     Ptr(1),\n\t\tEvent:          Ptr(\"guid\"),\n\t\tAction:         Ptr(\"guid\"),\n\t\tInstallationID: Ptr(int64(1)),\n\t\tRepositoryID:   Ptr(int64(1)),\n\t\tRequest: &HookRequest{\n\t\t\tHeaders:    header,\n\t\t\tRawPayload: (*json.RawMessage)(&jsonMsg),\n\t\t},\n\t\tResponse: &HookResponse{\n\t\t\tHeaders:    header,\n\t\t\tRawPayload: (*json.RawMessage)(&jsonMsg),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"guid\": \"guid\",\n\t\t\"delivered_at\": ` + referenceTimeStr + `,\n\t\t\"redelivery\": true,\n\t\t\"duration\": 1,\n\t\t\"status\": \"guid\",\n\t\t\"status_code\": 1,\n\t\t\"event\": \"guid\",\n\t\t\"action\": \"guid\",\n\t\t\"installation_id\": 1,\n\t\t\"repository_id\": 1,\n\t\t\"request\": {\n\t\t\t\"headers\": {\n\t\t\t\t\"key\": \"value\"\n\t\t\t},\n\t\t\t\"payload\": {\n\t\t\t\t\"key\": \"value\"\n\t\t\t}\n\t\t},\n\t\t\"response\": {\n\t\t\t\"headers\": {\n\t\t\t\t\"key\": \"value\"\n\t\t\t},\n\t\t\t\"payload\": {\n\t\t\t\t\"key\": \"value\"\n\t\t\t}\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, r, want, cmpJSONRawMessageComparator())\n}\n"
  },
  {
    "path": "github/repos_hooks_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_CreateHook(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &Hook{CreatedAt: &Timestamp{referenceTime}}\n\n\tmux.HandleFunc(\"/repos/o/r/hooks\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *createHookRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\twant := &createHookRequest{Name: \"web\"}\n\t\tif !cmp.Equal(v, want) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, want)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\thook, _, err := client.Repositories.CreateHook(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.CreateHook returned error: %v\", err)\n\t}\n\n\twant := &Hook{ID: Ptr(int64(1))}\n\tif !cmp.Equal(hook, want) {\n\t\tt.Errorf(\"Repositories.CreateHook returned %+v, want %+v\", hook, want)\n\t}\n\n\tconst methodName = \"CreateHook\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.CreateHook(ctx, \"o\", \"r\", nil)\n\t\treturn err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.CreateHook(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.CreateHook(ctx, \"o\", \"r\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListHooks(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/hooks\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}, {\"id\":2}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\n\tctx := t.Context()\n\thooks, _, err := client.Repositories.ListHooks(ctx, \"o\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListHooks returned error: %v\", err)\n\t}\n\n\twant := []*Hook{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}}\n\tif !cmp.Equal(hooks, want) {\n\t\tt.Errorf(\"Repositories.ListHooks returned %+v, want %+v\", hooks, want)\n\t}\n\n\tconst methodName = \"ListHooks\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListHooks(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListHooks(ctx, \"o\", \"r\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListHooks_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.ListHooks(ctx, \"%\", \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoriesService_ListHooks_403_code_no_rate_limit(t *testing.T) {\n\tt.Parallel()\n\ttestErrorResponseForStatusCode(t, http.StatusForbidden)\n}\n\nfunc TestRepositoriesService_ListHooks_404_code(t *testing.T) {\n\tt.Parallel()\n\ttestErrorResponseForStatusCode(t, http.StatusNotFound)\n}\n\nfunc TestRepositoriesService_GetHook(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/hooks/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\thook, _, err := client.Repositories.GetHook(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetHook returned error: %v\", err)\n\t}\n\n\twant := &Hook{ID: Ptr(int64(1))}\n\tif !cmp.Equal(hook, want) {\n\t\tt.Errorf(\"Repositories.GetHook returned %+v, want %+v\", hook, want)\n\t}\n\n\tconst methodName = \"GetHook\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetHook(ctx, \"\\n\", \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetHook(ctx, \"o\", \"r\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetHook_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.GetHook(ctx, \"%\", \"%\", 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoriesService_EditHook(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &Hook{}\n\n\tmux.HandleFunc(\"/repos/o/r/hooks/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *Hook\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\thook, _, err := client.Repositories.EditHook(ctx, \"o\", \"r\", 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.EditHook returned error: %v\", err)\n\t}\n\n\twant := &Hook{ID: Ptr(int64(1))}\n\tif !cmp.Equal(hook, want) {\n\t\tt.Errorf(\"Repositories.EditHook returned %+v, want %+v\", hook, want)\n\t}\n\n\tconst methodName = \"EditHook\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.EditHook(ctx, \"\\n\", \"\\n\", -1, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.EditHook(ctx, \"o\", \"r\", 1, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_EditHook_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.EditHook(ctx, \"%\", \"%\", 1, nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoriesService_DeleteHook(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/hooks/1\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Repositories.DeleteHook(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.DeleteHook returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteHook\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.DeleteHook(ctx, \"\\n\", \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.DeleteHook(ctx, \"o\", \"r\", 1)\n\t})\n}\n\nfunc TestRepositoriesService_DeleteHook_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Repositories.DeleteHook(ctx, \"%\", \"%\", 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoriesService_PingHook(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/hooks/1/pings\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Repositories.PingHook(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.PingHook returned error: %v\", err)\n\t}\n\n\tconst methodName = \"PingHook\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.PingHook(ctx, \"\\n\", \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.PingHook(ctx, \"o\", \"r\", 1)\n\t})\n}\n\nfunc TestRepositoriesService_TestHook(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/hooks/1/tests\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Repositories.TestHook(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.TestHook returned error: %v\", err)\n\t}\n\n\tconst methodName = \"TestHook\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.TestHook(ctx, \"\\n\", \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.TestHook(ctx, \"o\", \"r\", 1)\n\t})\n}\n\nfunc TestRepositoriesService_TestHook_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Repositories.TestHook(ctx, \"%\", \"%\", 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestBranchWebHookPayload_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &WebHookPayload{}, \"{}\")\n\n\tv := &WebHookPayload{\n\t\tAction: Ptr(\"action\"),\n\t\tAfter:  Ptr(\"after\"),\n\t\tBefore: Ptr(\"before\"),\n\t\tCommits: []*WebHookCommit{\n\t\t\t{\n\t\t\t\tAdded: []string{\"1\", \"2\", \"3\"},\n\t\t\t\tAuthor: &WebHookAuthor{\n\t\t\t\t\tEmail: Ptr(\"abc@example.com\"),\n\t\t\t\t\tName:  Ptr(\"abc\"),\n\t\t\t\t\tLogin: Ptr(\"abc_12\"),\n\t\t\t\t},\n\t\t\t\tCommitter: &WebHookAuthor{\n\t\t\t\t\tEmail: Ptr(\"abc@example.com\"),\n\t\t\t\t\tName:  Ptr(\"abc\"),\n\t\t\t\t\tLogin: Ptr(\"abc_12\"),\n\t\t\t\t},\n\t\t\t\tID:       Ptr(\"1\"),\n\t\t\t\tMessage:  Ptr(\"WebHookCommit\"),\n\t\t\t\tModified: []string{\"abc\", \"efg\", \"erd\"},\n\t\t\t\tRemoved:  []string{\"cmd\", \"rti\", \"duv\"},\n\t\t\t},\n\t\t},\n\t\tCompare: Ptr(\"compare\"),\n\t\tCreated: Ptr(true),\n\t\tForced:  Ptr(false),\n\t\tHeadCommit: &WebHookCommit{\n\t\t\tAdded: []string{\"1\", \"2\", \"3\"},\n\t\t\tAuthor: &WebHookAuthor{\n\t\t\t\tEmail: Ptr(\"abc@example.com\"),\n\t\t\t\tName:  Ptr(\"abc\"),\n\t\t\t\tLogin: Ptr(\"abc_12\"),\n\t\t\t},\n\t\t\tCommitter: &WebHookAuthor{\n\t\t\t\tEmail: Ptr(\"abc@example.com\"),\n\t\t\t\tName:  Ptr(\"abc\"),\n\t\t\t\tLogin: Ptr(\"abc_12\"),\n\t\t\t},\n\t\t\tID:       Ptr(\"1\"),\n\t\t\tMessage:  Ptr(\"WebHookCommit\"),\n\t\t\tModified: []string{\"abc\", \"efg\", \"erd\"},\n\t\t\tRemoved:  []string{\"cmd\", \"rti\", \"duv\"},\n\t\t},\n\t\tInstallation: &Installation{\n\t\t\tID: Ptr(int64(12)),\n\t\t},\n\t\tOrganization: &Organization{\n\t\t\tID: Ptr(int64(22)),\n\t\t},\n\t\tPusher: &CommitAuthor{\n\t\t\tLogin: Ptr(\"rd@example.com\"),\n\t\t},\n\t\tRepo: &PushEventRepository{\n\t\t\tID:     Ptr(int64(321)),\n\t\t\tNodeID: Ptr(\"node_321\"),\n\t\t},\n\t\tSender: &User{\n\t\t\tLogin: Ptr(\"st@example.com\"),\n\t\t\tID:    Ptr(int64(202)),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"action\": \"action\",\n\t\t\"after\":  \"after\",\n\t\t\"before\": \"before\",\n\t\t\"commits\": [\n\t\t\t{\n\t\t\t\"added\":   [\"1\", \"2\", \"3\"],\n\t\t\t\"author\":{\n\t\t\t\t\"email\": \"abc@example.com\",\n\t\t\t\t\"name\": \"abc\",\n\t\t\t\t\"username\": \"abc_12\"\n\t\t\t},\n\t\t\t\"committer\": {\n\t\t\t\t\"email\": \"abc@example.com\",\n\t\t\t\t\"name\": \"abc\",\n\t\t\t\t\"username\": \"abc_12\"\n\t\t\t},\n\t\t\t\"id\":       \"1\",\n\t\t\t\"message\":  \"WebHookCommit\",\n\t\t\t\"modified\": [\"abc\", \"efg\", \"erd\"],\n\t\t\t\"removed\":  [\"cmd\", \"rti\", \"duv\"]\n\t\t\t}\n\t\t],\n\t\t\"compare\": \"compare\",\n\t\t\"created\": true,\n\t\t\"forced\":  false,\n\t\t\"head_commit\": {\n\t\t\t\"added\":   [\"1\", \"2\", \"3\"],\n\t\t\"author\":{\n\t\t\t\"email\": \"abc@example.com\",\n\t\t\t\"name\": \"abc\",\n\t\t\t\"username\": \"abc_12\"\n\t\t},\n\t\t\"committer\": {\n\t\t\t\"email\": \"abc@example.com\",\n\t\t\t\"name\": \"abc\",\n\t\t\t\"username\": \"abc_12\"\n\t\t},\n\t\t\"id\":       \"1\",\n\t\t\"message\":  \"WebHookCommit\",\n\t\t\"modified\": [\"abc\", \"efg\", \"erd\"],\n\t\t\"removed\":  [\"cmd\", \"rti\", \"duv\"]\n\t\t},\n\t\t\"installation\": {\n\t\t\t\"id\": 12\n\t\t},\n\t\t\"organization\": {\n\t\t\t\"id\" : 22\n\t\t},\n\t\t\"pusher\":{\n\t\t\t\"username\": \"rd@example.com\"\n\t\t},\n\t\t\"repository\":{\n\t\t\t\"id\": 321,\n\t\t\t\"node_id\": \"node_321\"\n\t\t},\n\t\t\"sender\":{\n\t\t\t\"login\": \"st@example.com\",\n\t\t\t\"id\": 202\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, v, want)\n}\n\nfunc TestBranchWebHookAuthor_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &WebHookAuthor{}, \"{}\")\n\n\tv := &WebHookAuthor{\n\t\tEmail: Ptr(\"abc@example.com\"),\n\t\tName:  Ptr(\"abc\"),\n\t\tLogin: Ptr(\"abc_12\"),\n\t}\n\n\twant := `{\n\t\t\t\"email\": \"abc@example.com\",\n\t\t\t\"name\": \"abc\",\n\t\t\t\"username\": \"abc_12\"\n\t}`\n\n\ttestJSONMarshal(t, v, want)\n}\n\nfunc TestBranchWebHookCommit_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &WebHookCommit{}, \"{}\")\n\n\tv := &WebHookCommit{\n\t\tAdded: []string{\"1\", \"2\", \"3\"},\n\t\tAuthor: &WebHookAuthor{\n\t\t\tEmail: Ptr(\"abc@example.com\"),\n\t\t\tName:  Ptr(\"abc\"),\n\t\t\tLogin: Ptr(\"abc_12\"),\n\t\t},\n\t\tCommitter: &WebHookAuthor{\n\t\t\tEmail: Ptr(\"abc@example.com\"),\n\t\t\tName:  Ptr(\"abc\"),\n\t\t\tLogin: Ptr(\"abc_12\"),\n\t\t},\n\t\tID:       Ptr(\"1\"),\n\t\tMessage:  Ptr(\"WebHookCommit\"),\n\t\tModified: []string{\"abc\", \"efg\", \"erd\"},\n\t\tRemoved:  []string{\"cmd\", \"rti\", \"duv\"},\n\t}\n\n\twant := `{\n\t\t\"added\":   [\"1\", \"2\", \"3\"],\n\t\t\"author\":{\n\t\t\t\"email\": \"abc@example.com\",\n\t\t\t\"name\": \"abc\",\n\t\t\t\"username\": \"abc_12\"\n\t\t},\n\t\t\"committer\": {\n\t\t\t\"email\": \"abc@example.com\",\n\t\t\t\"name\": \"abc\",\n\t\t\t\"username\": \"abc_12\"\n\t\t},\n\t\t\"id\":       \"1\",\n\t\t\"message\":  \"WebHookCommit\",\n\t\t\"modified\": [\"abc\", \"efg\", \"erd\"],\n\t\t\"removed\":  [\"cmd\", \"rti\", \"duv\"]\n\t}`\n\n\ttestJSONMarshal(t, v, want)\n}\n\nfunc TestBranchCreateHookRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &createHookRequest{}, `{\"name\": \"\"}`)\n\n\tv := &createHookRequest{\n\t\tName:   \"abc\",\n\t\tEvents: []string{\"1\", \"2\", \"3\"},\n\t\tActive: Ptr(true),\n\t\tConfig: &HookConfig{ContentType: Ptr(\"json\")},\n\t}\n\n\twant := `{\n\t\t\"name\": \"abc\",\n\t\t\"active\": true,\n\t\t\"events\": [\"1\",\"2\",\"3\"],\n\t\t\"config\":{\n\t\t\t\"content_type\": \"json\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, v, want)\n}\n\nfunc TestBranchHook_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Hook{}, \"{}\")\n\n\tv := &Hook{\n\t\tCreatedAt: &Timestamp{referenceTime},\n\t\tUpdatedAt: &Timestamp{referenceTime},\n\t\tURL:       Ptr(\"url\"),\n\t\tID:        Ptr(int64(1)),\n\t\tType:      Ptr(\"type\"),\n\t\tName:      Ptr(\"name\"),\n\t\tTestURL:   Ptr(\"testurl\"),\n\t\tPingURL:   Ptr(\"pingurl\"),\n\t\tLastResponse: map[string]any{\n\t\t\t\"item\": \"item\",\n\t\t},\n\t\tConfig: &HookConfig{ContentType: Ptr(\"json\")},\n\t\tEvents: []string{\"1\", \"2\", \"3\"},\n\t\tActive: Ptr(true),\n\t}\n\n\twant := `{\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"url\": \"url\",\n\t\t\"id\": 1,\n\t\t\"type\": \"type\",\n\t\t\"name\": \"name\",\n\t\t\"test_url\": \"testurl\",\n\t\t\"ping_url\": \"pingurl\",\n\t\t\"last_response\":{\n\t\t\t\"item\": \"item\"\n\t\t},\n\t\t\"config\":{\n\t\t\t\"content_type\": \"json\"\n\t\t},\n\t\t\"events\": [\"1\",\"2\",\"3\"],\n\t\t\"active\": true\n\t}`\n\n\ttestJSONMarshal(t, v, want)\n}\n\nfunc TestRepositoriesService_Subscribe(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/hub\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Content-Type\", \"application/x-www-form-urlencoded\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"hub.mode\":     \"subscribe\",\n\t\t\t\"hub.topic\":    \"https://github.com/o/r/events/push\",\n\t\t\t\"hub.callback\": \"http://localhost:8080/callback\",\n\t\t\t\"hub.secret\":   \"test secret\",\n\t\t})\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Repositories.Subscribe(\n\t\tctx,\n\t\t\"o\",\n\t\t\"r\",\n\t\t\"push\",\n\t\t\"http://localhost:8080/callback\",\n\t\t[]byte(\"test secret\"),\n\t)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.Subscribe returned error: %v\", err)\n\t}\n\n\ttestNewRequestAndDoFailure(t, \"Subscribe\", client, func() (*Response, error) {\n\t\treturn client.Repositories.Subscribe(ctx, \"o\", \"r\", \"push\", \"http://localhost:8080\", nil)\n\t})\n}\n\nfunc TestRepositoriesService_Unsubscribe(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/hub\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Content-Type\", \"application/x-www-form-urlencoded\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"hub.mode\":     \"unsubscribe\",\n\t\t\t\"hub.topic\":    \"https://github.com/o/r/events/push\",\n\t\t\t\"hub.callback\": \"http://localhost:8080/callback\",\n\t\t\t\"hub.secret\":   \"test secret\",\n\t\t})\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Repositories.Unsubscribe(\n\t\tctx,\n\t\t\"o\",\n\t\t\"r\",\n\t\t\"push\",\n\t\t\"http://localhost:8080/callback\",\n\t\t[]byte(\"test secret\"),\n\t)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.Unsubscribe returned error: %v\", err)\n\t}\n\n\ttestNewRequestAndDoFailure(t, \"Unsubscribe\", client, func() (*Response, error) {\n\t\treturn client.Repositories.Unsubscribe(ctx, \"o\", \"r\", \"push\", \"http://localhost:8080/callback\", nil)\n\t})\n}\n"
  },
  {
    "path": "github/repos_immutable_releases.go",
    "content": "// Copyright 2026 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// RepoImmutableReleasesStatus represents the immutable releases status for a repository.\ntype RepoImmutableReleasesStatus struct {\n\tEnabled         *bool `json:\"enabled,omitempty\"`\n\tEnforcedByOwner *bool `json:\"enforced_by_owner,omitempty\"`\n}\n\n// EnableImmutableReleases enables immutable releases for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#enable-immutable-releases\n//\n//meta:operation PUT /repos/{owner}/{repo}/immutable-releases\nfunc (s *RepositoriesService) EnableImmutableReleases(ctx context.Context, owner, repo string) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/immutable-releases\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// DisableImmutableReleases disables immutable releases for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#disable-immutable-releases\n//\n//meta:operation DELETE /repos/{owner}/{repo}/immutable-releases\nfunc (s *RepositoriesService) DisableImmutableReleases(ctx context.Context, owner, repo string) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/immutable-releases\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// AreImmutableReleasesEnabled checks if immutable releases are enabled for\n// the repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/repos#check-if-immutable-releases-are-enabled-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/immutable-releases\nfunc (s *RepositoriesService) AreImmutableReleasesEnabled(ctx context.Context, owner, repo string) (*RepoImmutableReleasesStatus, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/immutable-releases\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar status *RepoImmutableReleasesStatus\n\tresp, err := s.client.Do(ctx, req, &status)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn status, resp, nil\n}\n"
  },
  {
    "path": "github/repos_immutable_releases_test.go",
    "content": "// Copyright 2026 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_EnableImmutableReleases(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/owner/repo/immutable-releases\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Repositories.EnableImmutableReleases(ctx, \"owner\", \"repo\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.EnableImmutableReleases returned error: %v\", err)\n\t}\n\n\tconst methodName = \"EnableImmutableReleases\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.EnableImmutableReleases(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.EnableImmutableReleases(ctx, \"owner\", \"repo\")\n\t})\n}\n\nfunc TestRepositoriesService_DisableImmutableReleases(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/owner/repo/immutable-releases\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Repositories.DisableImmutableReleases(ctx, \"owner\", \"repo\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.DisableImmutableReleases returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DisableImmutableReleases\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.DisableImmutableReleases(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.DisableImmutableReleases(ctx, \"owner\", \"repo\")\n\t})\n}\n\nfunc TestRepositoriesService_AreImmutableReleasesEnabled(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/owner/repo/immutable-releases\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"enabled\": true, \"enforced_by_owner\": false}`)\n\t})\n\n\tctx := t.Context()\n\tstatus, _, err := client.Repositories.AreImmutableReleasesEnabled(ctx, \"owner\", \"repo\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.AreImmutableReleasesEnabled returned error: %v\", err)\n\t}\n\twant := &RepoImmutableReleasesStatus{Enabled: Ptr(true), EnforcedByOwner: Ptr(false)}\n\tif !cmp.Equal(status, want) {\n\t\tt.Errorf(\"Repositories.AreImmutableReleasesEnabled returned %+v, want %+v\", status, want)\n\t}\n\n\tconst methodName = \"AreImmutableReleasesEnabled\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.AreImmutableReleasesEnabled(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.AreImmutableReleasesEnabled(ctx, \"owner\", \"repo\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/repos_invitations.go",
    "content": "// Copyright 2016 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// RepositoryInvitation represents an invitation to collaborate on a repo.\ntype RepositoryInvitation struct {\n\tID      *int64      `json:\"id,omitempty\"`\n\tRepo    *Repository `json:\"repository,omitempty\"`\n\tInvitee *User       `json:\"invitee,omitempty\"`\n\tInviter *User       `json:\"inviter,omitempty\"`\n\n\t// Permissions represents the permissions that the associated user will have\n\t// on the repository. Possible values are: \"read\", \"write\", \"admin\".\n\tPermissions *string    `json:\"permissions,omitempty\"`\n\tCreatedAt   *Timestamp `json:\"created_at,omitempty\"`\n\tURL         *string    `json:\"url,omitempty\"`\n\tHTMLURL     *string    `json:\"html_url,omitempty\"`\n\tExpired     *bool      `json:\"expired,omitempty\"`\n}\n\n// ListInvitations lists all currently-open repository invitations.\n//\n// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations\n//\n//meta:operation GET /repos/{owner}/{repo}/invitations\nfunc (s *RepositoriesService) ListInvitations(ctx context.Context, owner, repo string, opts *ListOptions) ([]*RepositoryInvitation, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/invitations\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tinvites := []*RepositoryInvitation{}\n\tresp, err := s.client.Do(ctx, req, &invites)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn invites, resp, nil\n}\n\n// DeleteInvitation deletes a repository invitation.\n//\n// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#delete-a-repository-invitation\n//\n//meta:operation DELETE /repos/{owner}/{repo}/invitations/{invitation_id}\nfunc (s *RepositoriesService) DeleteInvitation(ctx context.Context, owner, repo string, invitationID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/invitations/%v\", owner, repo, invitationID)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// UpdateInvitation updates the permissions associated with a repository\n// invitation.\n//\n// permissions represents the permissions that the associated user will have\n// on the repository. Possible values are: \"read\", \"write\", \"admin\".\n//\n// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#update-a-repository-invitation\n//\n//meta:operation PATCH /repos/{owner}/{repo}/invitations/{invitation_id}\nfunc (s *RepositoriesService) UpdateInvitation(ctx context.Context, owner, repo string, invitationID int64, permissions string) (*RepositoryInvitation, *Response, error) {\n\topts := &struct {\n\t\tPermissions string `json:\"permissions\"`\n\t}{Permissions: permissions}\n\tu := fmt.Sprintf(\"repos/%v/%v/invitations/%v\", owner, repo, invitationID)\n\treq, err := s.client.NewRequest(\"PATCH\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar invite *RepositoryInvitation\n\tresp, err := s.client.Do(ctx, req, &invite)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn invite, resp, nil\n}\n"
  },
  {
    "path": "github/repos_invitations_test.go",
    "content": "// Copyright 2016 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_ListInvitations(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/invitations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}, {\"id\":2}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.ListInvitations(ctx, \"o\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListInvitations returned error: %v\", err)\n\t}\n\n\twant := []*RepositoryInvitation{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.ListInvitations = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ListInvitations\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListInvitations(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListInvitations(ctx, \"o\", \"r\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_DeleteInvitation(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/invitations/2\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Repositories.DeleteInvitation(ctx, \"o\", \"r\", 2)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.DeleteInvitation returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteInvitation\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.DeleteInvitation(ctx, \"\\n\", \"\\n\", 2)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.DeleteInvitation(ctx, \"o\", \"r\", 2)\n\t})\n}\n\nfunc TestRepositoriesService_UpdateInvitation(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/invitations/2\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.UpdateInvitation(ctx, \"o\", \"r\", 2, \"write\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.UpdateInvitation returned error: %v\", err)\n\t}\n\n\twant := &RepositoryInvitation{ID: Ptr(int64(1))}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.UpdateInvitation = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"UpdateInvitation\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.UpdateInvitation(ctx, \"\\n\", \"\\n\", 2, \"write\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.UpdateInvitation(ctx, \"o\", \"r\", 2, \"write\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoryInvitation_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RepositoryInvitation{}, \"{}\")\n\n\tr := &RepositoryInvitation{\n\t\tID: Ptr(int64(1)),\n\t\tRepo: &Repository{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tName: Ptr(\"n\"),\n\t\t\tURL:  Ptr(\"u\"),\n\t\t},\n\t\tInvitee: &User{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tName: Ptr(\"n\"),\n\t\t\tURL:  Ptr(\"u\"),\n\t\t},\n\t\tInviter: &User{\n\t\t\tID:   Ptr(int64(1)),\n\t\t\tName: Ptr(\"n\"),\n\t\t\tURL:  Ptr(\"u\"),\n\t\t},\n\t\tPermissions: Ptr(\"p\"),\n\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\tURL:         Ptr(\"u\"),\n\t\tHTMLURL:     Ptr(\"h\"),\n\t}\n\n\twant := `{\n\t\t\"id\":1,\n\t\t\"repository\":{\n\t\t\t\"id\":1,\n\t\t\t\"name\":\"n\",\n\t\t\t\"url\":\"u\"\n\t\t},\n\t\t\"invitee\":{\n\t\t\t\"id\":1,\n\t\t\t\"name\":\"n\",\n\t\t\t\"url\":\"u\"\n\t\t},\n\t\t\"inviter\":{\n\t\t\t\"id\":1,\n\t\t\t\"name\":\"n\",\n\t\t\t\"url\":\"u\"\n\t\t},\n\t\t\"permissions\":\"p\",\n\t\t\"created_at\":` + referenceTimeStr + `,\n\t\t\"url\":\"u\",\n\t\t\"html_url\":\"h\"\n\t}`\n\n\ttestJSONMarshal(t, r, want)\n}\n"
  },
  {
    "path": "github/repos_keys.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// The Key type is defined in users_keys.go\n\n// ListKeys lists the deploy keys for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#list-deploy-keys\n//\n//meta:operation GET /repos/{owner}/{repo}/keys\nfunc (s *RepositoriesService) ListKeys(ctx context.Context, owner, repo string, opts *ListOptions) ([]*Key, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/keys\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar keys []*Key\n\tresp, err := s.client.Do(ctx, req, &keys)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn keys, resp, nil\n}\n\n// GetKey fetches a single deploy key.\n//\n// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#get-a-deploy-key\n//\n//meta:operation GET /repos/{owner}/{repo}/keys/{key_id}\nfunc (s *RepositoriesService) GetKey(ctx context.Context, owner, repo string, id int64) (*Key, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/keys/%v\", owner, repo, id)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar key *Key\n\tresp, err := s.client.Do(ctx, req, &key)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn key, resp, nil\n}\n\n// CreateKey adds a deploy key for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#create-a-deploy-key\n//\n//meta:operation POST /repos/{owner}/{repo}/keys\nfunc (s *RepositoriesService) CreateKey(ctx context.Context, owner, repo string, key *Key) (*Key, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/keys\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"POST\", u, key)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar k *Key\n\tresp, err := s.client.Do(ctx, req, &k)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn k, resp, nil\n}\n\n// DeleteKey deletes a deploy key.\n//\n// GitHub API docs: https://docs.github.com/rest/deploy-keys/deploy-keys#delete-a-deploy-key\n//\n//meta:operation DELETE /repos/{owner}/{repo}/keys/{key_id}\nfunc (s *RepositoriesService) DeleteKey(ctx context.Context, owner, repo string, id int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/keys/%v\", owner, repo, id)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/repos_keys_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_ListKeys(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/keys\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tkeys, _, err := client.Repositories.ListKeys(ctx, \"o\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListKeys returned error: %v\", err)\n\t}\n\n\twant := []*Key{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(keys, want) {\n\t\tt.Errorf(\"Repositories.ListKeys returned %+v, want %+v\", keys, want)\n\t}\n\n\tconst methodName = \"ListKeys\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListKeys(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListKeys(ctx, \"o\", \"r\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListKeys_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.ListKeys(ctx, \"%\", \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoriesService_GetKey(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/keys/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tkey, _, err := client.Repositories.GetKey(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetKey returned error: %v\", err)\n\t}\n\n\twant := &Key{ID: Ptr(int64(1))}\n\tif !cmp.Equal(key, want) {\n\t\tt.Errorf(\"Repositories.GetKey returned %+v, want %+v\", key, want)\n\t}\n\n\tconst methodName = \"GetKey\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetKey(ctx, \"\\n\", \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetKey(ctx, \"o\", \"r\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetKey_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.GetKey(ctx, \"%\", \"%\", 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoriesService_CreateKey(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &Key{Key: Ptr(\"k\"), Title: Ptr(\"t\")}\n\n\tmux.HandleFunc(\"/repos/o/r/keys\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *Key\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tkey, _, err := client.Repositories.CreateKey(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetKey returned error: %v\", err)\n\t}\n\n\twant := &Key{ID: Ptr(int64(1))}\n\tif !cmp.Equal(key, want) {\n\t\tt.Errorf(\"Repositories.GetKey returned %+v, want %+v\", key, want)\n\t}\n\n\tconst methodName = \"CreateKey\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.CreateKey(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.CreateKey(ctx, \"o\", \"r\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_CreateKey_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.CreateKey(ctx, \"%\", \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoriesService_DeleteKey(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/keys/1\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Repositories.DeleteKey(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.DeleteKey returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteKey\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.DeleteKey(ctx, \"\\n\", \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.DeleteKey(ctx, \"o\", \"r\", 1)\n\t})\n}\n\nfunc TestRepositoriesService_DeleteKey_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Repositories.DeleteKey(ctx, \"%\", \"%\", 1)\n\ttestURLParseError(t, err)\n}\n"
  },
  {
    "path": "github/repos_lfs.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// EnableLFS turns the LFS (Large File Storage) feature ON for the selected repo.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/repos/lfs#enable-git-lfs-for-a-repository\n//\n//meta:operation PUT /repos/{owner}/{repo}/lfs\nfunc (s *RepositoriesService) EnableLFS(ctx context.Context, owner, repo string) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/lfs\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// DisableLFS turns the LFS (Large File Storage) feature OFF for the selected repo.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/repos/lfs#disable-git-lfs-for-a-repository\n//\n//meta:operation DELETE /repos/{owner}/{repo}/lfs\nfunc (s *RepositoriesService) DisableLFS(ctx context.Context, owner, repo string) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/lfs\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n"
  },
  {
    "path": "github/repos_lfs_test.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"net/http\"\n\t\"testing\"\n)\n\nfunc TestRepositoriesService_EnableLFS(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/lfs\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Repositories.EnableLFS(ctx, \"o\", \"r\"); err != nil {\n\t\tt.Errorf(\"Repositories.EnableLFS returned error: %v\", err)\n\t}\n\n\tconst methodName = \"EnableLFS\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.EnableLFS(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.EnableLFS(ctx, \"o\", \"r\")\n\t})\n}\n\nfunc TestRepositoriesService_DisableLFS(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/lfs\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Repositories.DisableLFS(ctx, \"o\", \"r\"); err != nil {\n\t\tt.Errorf(\"Repositories.DisableLFS returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DisableLFS\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.DisableLFS(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.DisableLFS(ctx, \"o\", \"r\")\n\t})\n}\n"
  },
  {
    "path": "github/repos_merging.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// RepositoryMergeRequest represents a request to merge a branch in a\n// repository.\ntype RepositoryMergeRequest struct {\n\tBase          *string `json:\"base,omitempty\"`\n\tHead          *string `json:\"head,omitempty\"`\n\tCommitMessage *string `json:\"commit_message,omitempty\"`\n}\n\n// RepoMergeUpstreamRequest represents a request to sync a branch of\n// a forked repository to keep it up-to-date with the upstream repository.\ntype RepoMergeUpstreamRequest struct {\n\tBranch *string `json:\"branch,omitempty\"`\n}\n\n// RepoMergeUpstreamResult represents the result of syncing a branch of\n// a forked repository with the upstream repository.\ntype RepoMergeUpstreamResult struct {\n\tMessage    *string `json:\"message,omitempty\"`\n\tMergeType  *string `json:\"merge_type,omitempty\"`\n\tBaseBranch *string `json:\"base_branch,omitempty\"`\n}\n\n// Merge a branch in the specified repository.\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branches#merge-a-branch\n//\n//meta:operation POST /repos/{owner}/{repo}/merges\nfunc (s *RepositoriesService) Merge(ctx context.Context, owner, repo string, request *RepositoryMergeRequest) (*RepositoryCommit, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/merges\", owner, repo)\n\treq, err := s.client.NewRequest(\"POST\", u, request)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar commit *RepositoryCommit\n\tresp, err := s.client.Do(ctx, req, &commit)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn commit, resp, nil\n}\n\n// MergeUpstream syncs a branch of a forked repository to keep it up-to-date\n// with the upstream repository.\n//\n// GitHub API docs: https://docs.github.com/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository\n//\n//meta:operation POST /repos/{owner}/{repo}/merge-upstream\nfunc (s *RepositoriesService) MergeUpstream(ctx context.Context, owner, repo string, request *RepoMergeUpstreamRequest) (*RepoMergeUpstreamResult, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/merge-upstream\", owner, repo)\n\treq, err := s.client.NewRequest(\"POST\", u, request)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar result *RepoMergeUpstreamResult\n\tresp, err := s.client.Do(ctx, req, &result)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn result, resp, nil\n}\n"
  },
  {
    "path": "github/repos_merging_test.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_Merge(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &RepositoryMergeRequest{\n\t\tBase:          Ptr(\"b\"),\n\t\tHead:          Ptr(\"h\"),\n\t\tCommitMessage: Ptr(\"c\"),\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/merges\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *RepositoryMergeRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"sha\":\"s\"}`)\n\t})\n\n\tctx := t.Context()\n\tcommit, _, err := client.Repositories.Merge(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.Merge returned error: %v\", err)\n\t}\n\n\twant := &RepositoryCommit{SHA: Ptr(\"s\")}\n\tif !cmp.Equal(commit, want) {\n\t\tt.Errorf(\"Repositories.Merge returned %+v, want %+v\", commit, want)\n\t}\n\n\tconst methodName = \"Merge\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.Merge(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.Merge(ctx, \"o\", \"r\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoryMergeRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RepositoryMergeRequest{}, \"{}\")\n\n\tu := &RepositoryMergeRequest{\n\t\tBase:          Ptr(\"base\"),\n\t\tHead:          Ptr(\"head\"),\n\t\tCommitMessage: Ptr(\"cm\"),\n\t}\n\n\twant := `{\n\t\t\"base\": \"base\",\n\t\t\"head\": \"head\",\n\t\t\"commit_message\": \"cm\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestRepositoriesService_MergeUpstream(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &RepoMergeUpstreamRequest{\n\t\tBranch: Ptr(\"b\"),\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/merge-upstream\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *RepoMergeUpstreamRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"merge_type\":\"m\"}`)\n\t})\n\n\tctx := t.Context()\n\tresult, _, err := client.Repositories.MergeUpstream(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.MergeUpstream returned error: %v\", err)\n\t}\n\n\twant := &RepoMergeUpstreamResult{MergeType: Ptr(\"m\")}\n\tif !cmp.Equal(result, want) {\n\t\tt.Errorf(\"Repositories.MergeUpstream returned %+v, want %+v\", result, want)\n\t}\n\n\tconst methodName = \"MergeUpstream\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.MergeUpstream(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.MergeUpstream(ctx, \"o\", \"r\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepoMergeUpstreamResult_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RepoMergeUpstreamResult{}, \"{}\")\n\n\tu := &RepoMergeUpstreamResult{\n\t\tMessage:    Ptr(\"message\"),\n\t\tMergeType:  Ptr(\"merge_type\"),\n\t\tBaseBranch: Ptr(\"base_branch\"),\n\t}\n\n\twant := `{\n\t\t\"message\": \"message\",\n\t\t\"merge_type\": \"merge_type\",\n\t\t\"base_branch\": \"base_branch\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/repos_pages.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n)\n\n// Pages represents a GitHub Pages site configuration.\ntype Pages struct {\n\tURL              *string                `json:\"url,omitempty\"`\n\tStatus           *string                `json:\"status,omitempty\"`\n\tCNAME            *string                `json:\"cname,omitempty\"`\n\tCustom404        *bool                  `json:\"custom_404,omitempty\"`\n\tHTMLURL          *string                `json:\"html_url,omitempty\"`\n\tBuildType        *string                `json:\"build_type,omitempty\"`\n\tSource           *PagesSource           `json:\"source,omitempty\"`\n\tPublic           *bool                  `json:\"public,omitempty\"`\n\tHTTPSCertificate *PagesHTTPSCertificate `json:\"https_certificate,omitempty\"`\n\tHTTPSEnforced    *bool                  `json:\"https_enforced,omitempty\"`\n}\n\n// PagesSource represents a GitHub page's source.\ntype PagesSource struct {\n\tBranch *string `json:\"branch,omitempty\"`\n\tPath   *string `json:\"path,omitempty\"`\n}\n\n// PagesError represents a build error for a GitHub Pages site.\ntype PagesError struct {\n\tMessage *string `json:\"message,omitempty\"`\n}\n\n// PagesBuild represents the build information for a GitHub Pages site.\ntype PagesBuild struct {\n\tURL       *string     `json:\"url,omitempty\"`\n\tStatus    *string     `json:\"status,omitempty\"`\n\tError     *PagesError `json:\"error,omitempty\"`\n\tPusher    *User       `json:\"pusher,omitempty\"`\n\tCommit    *string     `json:\"commit,omitempty\"`\n\tDuration  *int        `json:\"duration,omitempty\"`\n\tCreatedAt *Timestamp  `json:\"created_at,omitempty\"`\n\tUpdatedAt *Timestamp  `json:\"updated_at,omitempty\"`\n}\n\n// PagesDomain represents a domain associated with a GitHub Pages site.\ntype PagesDomain struct {\n\tHost                          *string `json:\"host,omitempty\"`\n\tURI                           *string `json:\"uri,omitempty\"`\n\tNameservers                   *string `json:\"nameservers,omitempty\"`\n\tDNSResolves                   *bool   `json:\"dns_resolves,omitempty\"`\n\tIsProxied                     *bool   `json:\"is_proxied,omitempty\"`\n\tIsCloudflareIP                *bool   `json:\"is_cloudflare_ip,omitempty\"`\n\tIsFastlyIP                    *bool   `json:\"is_fastly_ip,omitempty\"`\n\tIsOldIPAddress                *bool   `json:\"is_old_ip_address,omitempty\"`\n\tIsARecord                     *bool   `json:\"is_a_record,omitempty\"`\n\tHasCNAMERecord                *bool   `json:\"has_cname_record,omitempty\"`\n\tHasMXRecordsPresent           *bool   `json:\"has_mx_records_present,omitempty\"`\n\tIsValidDomain                 *bool   `json:\"is_valid_domain,omitempty\"`\n\tIsApexDomain                  *bool   `json:\"is_apex_domain,omitempty\"`\n\tShouldBeARecord               *bool   `json:\"should_be_a_record,omitempty\"`\n\tIsCNAMEToGithubUserDomain     *bool   `json:\"is_cname_to_github_user_domain,omitempty\"`\n\tIsCNAMEToPagesDotGithubDotCom *bool   `json:\"is_cname_to_pages_dot_github_dot_com,omitempty\"`\n\tIsCNAMEToFastly               *bool   `json:\"is_cname_to_fastly,omitempty\"`\n\tIsPointedToGithubPagesIP      *bool   `json:\"is_pointed_to_github_pages_ip,omitempty\"`\n\tIsNonGithubPagesIPPresent     *bool   `json:\"is_non_github_pages_ip_present,omitempty\"`\n\tIsPagesDomain                 *bool   `json:\"is_pages_domain,omitempty\"`\n\tIsServedByPages               *bool   `json:\"is_served_by_pages,omitempty\"`\n\tIsValid                       *bool   `json:\"is_valid,omitempty\"`\n\tReason                        *string `json:\"reason,omitempty\"`\n\tRespondsToHTTPS               *bool   `json:\"responds_to_https,omitempty\"`\n\tEnforcesHTTPS                 *bool   `json:\"enforces_https,omitempty\"`\n\tHTTPSError                    *string `json:\"https_error,omitempty\"`\n\tIsHTTPSEligible               *bool   `json:\"is_https_eligible,omitempty\"`\n\tCAAError                      *string `json:\"caa_error,omitempty\"`\n}\n\n// PagesHealthCheckResponse represents the response given for the health check of a GitHub Pages site.\ntype PagesHealthCheckResponse struct {\n\tDomain    *PagesDomain `json:\"domain,omitempty\"`\n\tAltDomain *PagesDomain `json:\"alt_domain,omitempty\"`\n}\n\n// PagesHTTPSCertificate represents the HTTPS Certificate information for a GitHub Pages site.\ntype PagesHTTPSCertificate struct {\n\tState       *string  `json:\"state,omitempty\"`\n\tDescription *string  `json:\"description,omitempty\"`\n\tDomains     []string `json:\"domains,omitempty\"`\n\t// GitHub's API doesn't return a standard Timestamp, rather it returns a YYYY-MM-DD string.\n\tExpiresAt *string `json:\"expires_at,omitempty\"`\n}\n\n// createPagesRequest is a subset of Pages and is used internally\n// by EnablePages to pass only the known fields for the endpoint.\ntype createPagesRequest struct {\n\tBuildType *string      `json:\"build_type,omitempty\"`\n\tSource    *PagesSource `json:\"source,omitempty\"`\n}\n\n// EnablePages enables GitHub Pages for the named repo.\n//\n// GitHub API docs: https://docs.github.com/rest/pages/pages#create-a-github-pages-site\n//\n//meta:operation POST /repos/{owner}/{repo}/pages\nfunc (s *RepositoriesService) EnablePages(ctx context.Context, owner, repo string, pages *Pages) (*Pages, *Response, error) {\n\tif pages == nil {\n\t\treturn nil, nil, errors.New(\"pages must be provided\")\n\t}\n\n\tu := fmt.Sprintf(\"repos/%v/%v/pages\", owner, repo)\n\n\tpagesReq := &createPagesRequest{\n\t\tBuildType: pages.BuildType,\n\t\tSource:    pages.Source,\n\t}\n\n\treq, err := s.client.NewRequest(\"POST\", u, pagesReq)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeEnablePagesAPIPreview)\n\n\tvar enable *Pages\n\tresp, err := s.client.Do(ctx, req, &enable)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn enable, resp, nil\n}\n\n// PagesUpdate sets up parameters needed to update a GitHub Pages site.\ntype PagesUpdate struct {\n\t// CNAME represents a custom domain for the repository.\n\t// Leaving CNAME empty will remove the custom domain.\n\tCNAME *string `json:\"cname\"`\n\t// BuildType is optional and can either be \"legacy\" or \"workflow\".\n\t// \"workflow\" - You are using a github workflow to build your pages.\n\t// \"legacy\"   - You are deploying from a branch.\n\tBuildType *string `json:\"build_type,omitempty\"`\n\t// Source must include the branch name, and may optionally specify the subdirectory \"/docs\".\n\t// Possible values for Source.Branch are usually \"gh-pages\", \"main\", and \"master\",\n\t// or any other existing branch name.\n\t// Possible values for Source.Path are: \"/\", and \"/docs\".\n\tSource *PagesSource `json:\"source,omitempty\"`\n\t// Public configures access controls for the site.\n\t// If \"true\", the site will be accessible to anyone on the internet. If \"false\",\n\t// the site will be accessible to anyone with read access to the repository that\n\t// published the site.\n\tPublic *bool `json:\"public,omitempty\"`\n\t// HTTPSEnforced specifies whether HTTPS should be enforced for the repository.\n\tHTTPSEnforced *bool `json:\"https_enforced,omitempty\"`\n}\n\n// UpdatePages updates GitHub Pages for the named repo.\n//\n// GitHub API docs: https://docs.github.com/rest/pages/pages#update-information-about-a-github-pages-site\n//\n//meta:operation PUT /repos/{owner}/{repo}/pages\nfunc (s *RepositoriesService) UpdatePages(ctx context.Context, owner, repo string, opts *PagesUpdate) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pages\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\treturn resp, nil\n}\n\n// PagesUpdateWithoutCNAME defines parameters for updating a GitHub Pages site on GitHub Enterprise Servers.\n// Sending a request with a CNAME (any value, empty string, or null) results in a 400 error: \"Custom domains are not available for GitHub Pages\".\ntype PagesUpdateWithoutCNAME struct {\n\tBuildType     *string      `json:\"build_type,omitempty\"`\n\tSource        *PagesSource `json:\"source,omitempty\"`\n\tPublic        *bool        `json:\"public,omitempty\"`\n\tHTTPSEnforced *bool        `json:\"https_enforced,omitempty\"`\n}\n\n// UpdatePagesGHES updates GitHub Pages for the named repo in GitHub Enterprise Servers.\n//\n// GitHub API docs: https://docs.github.com/rest/pages/pages#update-information-about-a-github-pages-site\n//\n//meta:operation PUT /repos/{owner}/{repo}/pages\nfunc (s *RepositoriesService) UpdatePagesGHES(ctx context.Context, owner, repo string, opts *PagesUpdateWithoutCNAME) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pages\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\treturn resp, nil\n}\n\n// DisablePages disables GitHub Pages for the named repo.\n//\n// GitHub API docs: https://docs.github.com/rest/pages/pages#delete-a-github-pages-site\n//\n//meta:operation DELETE /repos/{owner}/{repo}/pages\nfunc (s *RepositoriesService) DisablePages(ctx context.Context, owner, repo string) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pages\", owner, repo)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeEnablePagesAPIPreview)\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// GetPagesInfo fetches information about a GitHub Pages site.\n//\n// GitHub API docs: https://docs.github.com/rest/pages/pages#get-a-github-pages-site\n//\n//meta:operation GET /repos/{owner}/{repo}/pages\nfunc (s *RepositoriesService) GetPagesInfo(ctx context.Context, owner, repo string) (*Pages, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pages\", owner, repo)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar site *Pages\n\tresp, err := s.client.Do(ctx, req, &site)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn site, resp, nil\n}\n\n// ListPagesBuilds lists the builds for a GitHub Pages site.\n//\n// GitHub API docs: https://docs.github.com/rest/pages/pages#list-github-pages-builds\n//\n//meta:operation GET /repos/{owner}/{repo}/pages/builds\nfunc (s *RepositoriesService) ListPagesBuilds(ctx context.Context, owner, repo string, opts *ListOptions) ([]*PagesBuild, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pages/builds\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar pages []*PagesBuild\n\tresp, err := s.client.Do(ctx, req, &pages)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn pages, resp, nil\n}\n\n// GetLatestPagesBuild fetches the latest build information for a GitHub pages site.\n//\n// GitHub API docs: https://docs.github.com/rest/pages/pages#get-latest-pages-build\n//\n//meta:operation GET /repos/{owner}/{repo}/pages/builds/latest\nfunc (s *RepositoriesService) GetLatestPagesBuild(ctx context.Context, owner, repo string) (*PagesBuild, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pages/builds/latest\", owner, repo)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar build *PagesBuild\n\tresp, err := s.client.Do(ctx, req, &build)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn build, resp, nil\n}\n\n// GetPageBuild fetches the specific build information for a GitHub pages site.\n//\n// GitHub API docs: https://docs.github.com/rest/pages/pages#get-github-pages-build\n//\n//meta:operation GET /repos/{owner}/{repo}/pages/builds/{build_id}\nfunc (s *RepositoriesService) GetPageBuild(ctx context.Context, owner, repo string, id int64) (*PagesBuild, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pages/builds/%v\", owner, repo, id)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar build *PagesBuild\n\tresp, err := s.client.Do(ctx, req, &build)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn build, resp, nil\n}\n\n// RequestPageBuild requests a build of a GitHub Pages site without needing to push new commit.\n//\n// GitHub API docs: https://docs.github.com/rest/pages/pages#request-a-github-pages-build\n//\n//meta:operation POST /repos/{owner}/{repo}/pages/builds\nfunc (s *RepositoriesService) RequestPageBuild(ctx context.Context, owner, repo string) (*PagesBuild, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pages/builds\", owner, repo)\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar build *PagesBuild\n\tresp, err := s.client.Do(ctx, req, &build)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn build, resp, nil\n}\n\n// GetPageHealthCheck gets a DNS health check for the CNAME record configured for a repository's GitHub Pages.\n//\n// GitHub API docs: https://docs.github.com/rest/pages/pages#get-a-dns-health-check-for-github-pages\n//\n//meta:operation GET /repos/{owner}/{repo}/pages/health\nfunc (s *RepositoriesService) GetPageHealthCheck(ctx context.Context, owner, repo string) (*PagesHealthCheckResponse, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pages/health\", owner, repo)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar healthCheckResponse *PagesHealthCheckResponse\n\tresp, err := s.client.Do(ctx, req, &healthCheckResponse)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn healthCheckResponse, resp, nil\n}\n"
  },
  {
    "path": "github/repos_pages_test.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_EnablePagesLegacy(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &Pages{\n\t\tBuildType: Ptr(\"legacy\"),\n\t\tSource: &PagesSource{\n\t\t\tBranch: Ptr(\"master\"),\n\t\t\tPath:   Ptr(\"/\"),\n\t\t},\n\t\tCNAME: Ptr(\"www.example.com\"), // not passed along.\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/pages\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *createPagesRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeEnablePagesAPIPreview)\n\t\twant := &createPagesRequest{BuildType: Ptr(\"legacy\"), Source: &PagesSource{Branch: Ptr(\"master\"), Path: Ptr(\"/\")}}\n\t\tif !cmp.Equal(v, want) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, want)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"url\":\"u\",\"status\":\"s\",\"cname\":\"c\",\"custom_404\":false,\"html_url\":\"h\",\"build_type\": \"legacy\",\"source\": {\"branch\":\"master\", \"path\":\"/\"}}`)\n\t})\n\n\tctx := t.Context()\n\tpage, _, err := client.Repositories.EnablePages(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.EnablePages returned error: %v\", err)\n\t}\n\n\twant := &Pages{URL: Ptr(\"u\"), Status: Ptr(\"s\"), CNAME: Ptr(\"c\"), Custom404: Ptr(false), HTMLURL: Ptr(\"h\"), BuildType: Ptr(\"legacy\"), Source: &PagesSource{Branch: Ptr(\"master\"), Path: Ptr(\"/\")}}\n\n\tif !cmp.Equal(page, want) {\n\t\tt.Errorf(\"Repositories.EnablePages returned %v, want %v\", page, want)\n\t}\n\n\tconst methodName = \"EnablePages\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.EnablePages(ctx, \"o\", \"r\", nil)\n\t\treturn err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.EnablePages(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.EnablePages(ctx, \"o\", \"r\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_EnablePagesWorkflow(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &Pages{\n\t\tBuildType: Ptr(\"workflow\"),\n\t\tCNAME:     Ptr(\"www.example.com\"), // not passed along.\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/pages\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *createPagesRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeEnablePagesAPIPreview)\n\t\twant := &createPagesRequest{BuildType: Ptr(\"workflow\")}\n\t\tif !cmp.Equal(v, want) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, want)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"url\":\"u\",\"status\":\"s\",\"cname\":\"c\",\"custom_404\":false,\"html_url\":\"h\",\"build_type\": \"workflow\"}`)\n\t})\n\n\tctx := t.Context()\n\tpage, _, err := client.Repositories.EnablePages(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.EnablePages returned error: %v\", err)\n\t}\n\n\twant := &Pages{URL: Ptr(\"u\"), Status: Ptr(\"s\"), CNAME: Ptr(\"c\"), Custom404: Ptr(false), HTMLURL: Ptr(\"h\"), BuildType: Ptr(\"workflow\")}\n\n\tif !cmp.Equal(page, want) {\n\t\tt.Errorf(\"Repositories.EnablePages returned %v, want %v\", page, want)\n\t}\n\n\tconst methodName = \"EnablePages\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.EnablePages(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.EnablePages(ctx, \"o\", \"r\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_UpdatePagesLegacy(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &PagesUpdate{\n\t\tCNAME:     Ptr(\"www.example.com\"),\n\t\tBuildType: Ptr(\"legacy\"),\n\t\tSource:    &PagesSource{Branch: Ptr(\"gh-pages\")},\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/pages\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *PagesUpdate\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\twant := &PagesUpdate{CNAME: Ptr(\"www.example.com\"), BuildType: Ptr(\"legacy\"), Source: &PagesSource{Branch: Ptr(\"gh-pages\")}}\n\t\tif !cmp.Equal(v, want) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, want)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"cname\":\"www.example.com\",\"build_type\":\"legacy\",\"source\":{\"branch\":\"gh-pages\"}}`)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Repositories.UpdatePages(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.UpdatePages returned error: %v\", err)\n\t}\n\n\tconst methodName = \"UpdatePages\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.UpdatePages(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.UpdatePages(ctx, \"o\", \"r\", input)\n\t})\n}\n\nfunc TestRepositoriesService_UpdatePagesWorkflow(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &PagesUpdate{\n\t\tCNAME:     Ptr(\"www.example.com\"),\n\t\tBuildType: Ptr(\"workflow\"),\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/pages\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *PagesUpdate\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\twant := &PagesUpdate{CNAME: Ptr(\"www.example.com\"), BuildType: Ptr(\"workflow\")}\n\t\tif !cmp.Equal(v, want) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, want)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"cname\":\"www.example.com\",\"build_type\":\"workflow\"}`)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Repositories.UpdatePages(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.UpdatePages returned error: %v\", err)\n\t}\n\n\tconst methodName = \"UpdatePages\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.UpdatePages(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.UpdatePages(ctx, \"o\", \"r\", input)\n\t})\n}\n\nfunc TestRepositoriesService_UpdatePagesGHES(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &PagesUpdateWithoutCNAME{\n\t\tBuildType: Ptr(\"workflow\"),\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/pages\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *PagesUpdate\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\twant := &PagesUpdate{BuildType: Ptr(\"workflow\")}\n\t\tif !cmp.Equal(v, want) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, want)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"build_type\":\"workflow\"}`)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Repositories.UpdatePagesGHES(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.UpdatePagesGHES returned error: %v\", err)\n\t}\n\n\tconst methodName = \"UpdatePagesGHES\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.UpdatePagesGHES(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.UpdatePagesGHES(ctx, \"o\", \"r\", input)\n\t})\n}\n\nfunc TestRepositoriesService_UpdatePages_NullCNAME(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &PagesUpdate{\n\t\tSource: &PagesSource{Branch: Ptr(\"gh-pages\")},\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/pages\", func(w http.ResponseWriter, r *http.Request) {\n\t\tgot, err := io.ReadAll(r.Body)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"unable to read body: %v\", err)\n\t\t}\n\n\t\twant := []byte(`{\"cname\":null,\"source\":{\"branch\":\"gh-pages\"}}` + \"\\n\")\n\t\tif !bytes.Equal(got, want) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", got, want)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"cname\":null,\"source\":{\"branch\":\"gh-pages\"}}`)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Repositories.UpdatePages(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.UpdatePages returned error: %v\", err)\n\t}\n}\n\nfunc TestRepositoriesService_DisablePages(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pages\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeEnablePagesAPIPreview)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Repositories.DisablePages(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.DisablePages returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DisablePages\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.DisablePages(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.DisablePages(ctx, \"o\", \"r\")\n\t})\n}\n\nfunc TestRepositoriesService_GetPagesInfo(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pages\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"url\":\"u\",\"status\":\"s\",\"cname\":\"c\",\"custom_404\":false,\"html_url\":\"h\",\"public\":true, \"https_certificate\": {\"state\":\"approved\",\"description\": \"Certificate is approved\",\"domains\": [\"developer.github.com\"],\"expires_at\": \"2021-05-22\"},\"https_enforced\": true}`)\n\t})\n\n\tctx := t.Context()\n\tpage, _, err := client.Repositories.GetPagesInfo(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetPagesInfo returned error: %v\", err)\n\t}\n\n\twant := &Pages{URL: Ptr(\"u\"), Status: Ptr(\"s\"), CNAME: Ptr(\"c\"), Custom404: Ptr(false), HTMLURL: Ptr(\"h\"), Public: Ptr(true), HTTPSCertificate: &PagesHTTPSCertificate{State: Ptr(\"approved\"), Description: Ptr(\"Certificate is approved\"), Domains: []string{\"developer.github.com\"}, ExpiresAt: Ptr(\"2021-05-22\")}, HTTPSEnforced: Ptr(true)}\n\tif !cmp.Equal(page, want) {\n\t\tt.Errorf(\"Repositories.GetPagesInfo returned %+v, want %+v\", page, want)\n\t}\n\n\tconst methodName = \"GetPagesInfo\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetPagesInfo(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetPagesInfo(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListPagesBuilds(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pages/builds\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"url\":\"u\",\"status\":\"s\",\"commit\":\"c\"}]`)\n\t})\n\n\tctx := t.Context()\n\tpages, _, err := client.Repositories.ListPagesBuilds(ctx, \"o\", \"r\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListPagesBuilds returned error: %v\", err)\n\t}\n\n\twant := []*PagesBuild{{URL: Ptr(\"u\"), Status: Ptr(\"s\"), Commit: Ptr(\"c\")}}\n\tif !cmp.Equal(pages, want) {\n\t\tt.Errorf(\"Repositories.ListPagesBuilds returned %+v, want %+v\", pages, want)\n\t}\n\n\tconst methodName = \"ListPagesBuilds\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListPagesBuilds(ctx, \"\\n\", \"\\n\", nil)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListPagesBuilds(ctx, \"o\", \"r\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListPagesBuilds_withOptions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pages/builds\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[]`)\n\t})\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.ListPagesBuilds(ctx, \"o\", \"r\", &ListOptions{Page: 2})\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListPagesBuilds returned error: %v\", err)\n\t}\n}\n\nfunc TestRepositoriesService_GetLatestPagesBuild(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pages/builds/latest\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"url\":\"u\",\"status\":\"s\",\"commit\":\"c\"}`)\n\t})\n\n\tctx := t.Context()\n\tbuild, _, err := client.Repositories.GetLatestPagesBuild(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetLatestPagesBuild returned error: %v\", err)\n\t}\n\n\twant := &PagesBuild{URL: Ptr(\"u\"), Status: Ptr(\"s\"), Commit: Ptr(\"c\")}\n\tif !cmp.Equal(build, want) {\n\t\tt.Errorf(\"Repositories.GetLatestPagesBuild returned %+v, want %+v\", build, want)\n\t}\n\n\tconst methodName = \"GetLatestPagesBuild\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetLatestPagesBuild(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetLatestPagesBuild(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetPageBuild(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pages/builds/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"url\":\"u\",\"status\":\"s\",\"commit\":\"c\"}`)\n\t})\n\n\tctx := t.Context()\n\tbuild, _, err := client.Repositories.GetPageBuild(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetPageBuild returned error: %v\", err)\n\t}\n\n\twant := &PagesBuild{URL: Ptr(\"u\"), Status: Ptr(\"s\"), Commit: Ptr(\"c\")}\n\tif !cmp.Equal(build, want) {\n\t\tt.Errorf(\"Repositories.GetPageBuild returned %+v, want %+v\", build, want)\n\t}\n\n\tconst methodName = \"GetPageBuild\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetPageBuild(ctx, \"\\n\", \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetPageBuild(ctx, \"o\", \"r\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_RequestPageBuild(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pages/builds\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\"url\":\"u\",\"status\":\"s\"}`)\n\t})\n\n\tctx := t.Context()\n\tbuild, _, err := client.Repositories.RequestPageBuild(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.RequestPageBuild returned error: %v\", err)\n\t}\n\n\twant := &PagesBuild{URL: Ptr(\"u\"), Status: Ptr(\"s\")}\n\tif !cmp.Equal(build, want) {\n\t\tt.Errorf(\"Repositories.RequestPageBuild returned %+v, want %+v\", build, want)\n\t}\n\n\tconst methodName = \"RequestPageBuild\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.RequestPageBuild(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.RequestPageBuild(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetPageHealthCheck(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pages/health\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"domain\":{\"host\":\"example.com\",\"uri\":\"http://example.com/\",\"nameservers\":\"default\",\"dns_resolves\":true},\"alt_domain\":{\"host\":\"www.example.com\",\"uri\":\"http://www.example.com/\",\"nameservers\":\"default\",\"dns_resolves\":true}}`)\n\t})\n\n\tctx := t.Context()\n\thealthCheckResponse, _, err := client.Repositories.GetPageHealthCheck(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetPageHealthCheck returned error: %v\", err)\n\t}\n\n\twant := &PagesHealthCheckResponse{\n\t\tDomain: &PagesDomain{\n\t\t\tHost:        Ptr(\"example.com\"),\n\t\t\tURI:         Ptr(\"http://example.com/\"),\n\t\t\tNameservers: Ptr(\"default\"),\n\t\t\tDNSResolves: Ptr(true),\n\t\t},\n\t\tAltDomain: &PagesDomain{\n\t\t\tHost:        Ptr(\"www.example.com\"),\n\t\t\tURI:         Ptr(\"http://www.example.com/\"),\n\t\t\tNameservers: Ptr(\"default\"),\n\t\t\tDNSResolves: Ptr(true),\n\t\t},\n\t}\n\tif !cmp.Equal(healthCheckResponse, want) {\n\t\tt.Errorf(\"Repositories.GetPageHealthCheck returned %+v, want %+v\", healthCheckResponse, want)\n\t}\n\n\tconst methodName = \"GetPageHealthCheck\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetPageHealthCheck(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetPageHealthCheck(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestPagesSource_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PagesSource{}, \"{}\")\n\n\tu := &PagesSource{\n\t\tBranch: Ptr(\"branch\"),\n\t\tPath:   Ptr(\"path\"),\n\t}\n\n\twant := `{\n\t\t\"branch\": \"branch\",\n\t\t\"path\": \"path\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPagesError_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PagesError{}, \"{}\")\n\n\tu := &PagesError{\n\t\tMessage: Ptr(\"message\"),\n\t}\n\n\twant := `{\n\t\t\"message\": \"message\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPagesUpdate_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PagesUpdate{}, `{\"cname\": null}`)\n\n\tu := &PagesUpdate{\n\t\tCNAME:  Ptr(\"cname\"),\n\t\tSource: &PagesSource{Path: Ptr(\"src\")},\n\t}\n\n\twant := `{\n\t\t\"cname\": \"cname\",\n\t\t\"source\": { \"path\": \"src\" }\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPages_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Pages{}, \"{}\")\n\n\tu := &Pages{\n\t\tURL:       Ptr(\"url\"),\n\t\tStatus:    Ptr(\"status\"),\n\t\tCNAME:     Ptr(\"cname\"),\n\t\tCustom404: Ptr(false),\n\t\tHTMLURL:   Ptr(\"hurl\"),\n\t\tSource: &PagesSource{\n\t\t\tBranch: Ptr(\"branch\"),\n\t\t\tPath:   Ptr(\"path\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"url\": \"url\",\n\t\t\"status\": \"status\",\n\t\t\"cname\": \"cname\",\n\t\t\"custom_404\": false,\n\t\t\"html_url\": \"hurl\",\n\t\t\"source\": {\n\t\t\t\"branch\": \"branch\",\n\t\t\t\"path\": \"path\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPagesBuild_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PagesBuild{}, \"{}\")\n\n\tu := &PagesBuild{\n\t\tURL:    Ptr(\"url\"),\n\t\tStatus: Ptr(\"status\"),\n\t\tError: &PagesError{\n\t\t\tMessage: Ptr(\"message\"),\n\t\t},\n\t\tPusher:    &User{ID: Ptr(int64(1))},\n\t\tCommit:    Ptr(\"commit\"),\n\t\tDuration:  Ptr(1),\n\t\tCreatedAt: &Timestamp{referenceTime},\n\t\tUpdatedAt: &Timestamp{referenceTime},\n\t}\n\n\twant := `{\n\t\t\"url\": \"url\",\n\t\t\"status\": \"status\",\n\t\t\"error\": {\n\t\t\t\"message\": \"message\"\n\t\t},\n\t\t\"pusher\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"commit\": \"commit\",\n\t\t\"duration\": 1,\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPagesHealthCheckResponse_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PagesHealthCheckResponse{}, \"{}\")\n\n\tu := &PagesHealthCheckResponse{\n\t\tDomain: &PagesDomain{\n\t\t\tHost:                          Ptr(\"example.com\"),\n\t\t\tURI:                           Ptr(\"http://example.com/\"),\n\t\t\tNameservers:                   Ptr(\"default\"),\n\t\t\tDNSResolves:                   Ptr(true),\n\t\t\tIsProxied:                     Ptr(false),\n\t\t\tIsCloudflareIP:                Ptr(false),\n\t\t\tIsFastlyIP:                    Ptr(false),\n\t\t\tIsOldIPAddress:                Ptr(false),\n\t\t\tIsARecord:                     Ptr(true),\n\t\t\tHasCNAMERecord:                Ptr(false),\n\t\t\tHasMXRecordsPresent:           Ptr(false),\n\t\t\tIsValidDomain:                 Ptr(true),\n\t\t\tIsApexDomain:                  Ptr(true),\n\t\t\tShouldBeARecord:               Ptr(true),\n\t\t\tIsCNAMEToGithubUserDomain:     Ptr(false),\n\t\t\tIsCNAMEToPagesDotGithubDotCom: Ptr(false),\n\t\t\tIsCNAMEToFastly:               Ptr(false),\n\t\t\tIsPointedToGithubPagesIP:      Ptr(true),\n\t\t\tIsNonGithubPagesIPPresent:     Ptr(false),\n\t\t\tIsPagesDomain:                 Ptr(false),\n\t\t\tIsServedByPages:               Ptr(true),\n\t\t\tIsValid:                       Ptr(true),\n\t\t\tReason:                        Ptr(\"some reason\"),\n\t\t\tRespondsToHTTPS:               Ptr(true),\n\t\t\tEnforcesHTTPS:                 Ptr(true),\n\t\t\tHTTPSError:                    Ptr(\"some error\"),\n\t\t\tIsHTTPSEligible:               Ptr(true),\n\t\t\tCAAError:                      Ptr(\"some error\"),\n\t\t},\n\t\tAltDomain: &PagesDomain{\n\t\t\tHost:        Ptr(\"www.example.com\"),\n\t\t\tURI:         Ptr(\"http://www.example.com/\"),\n\t\t\tNameservers: Ptr(\"default\"),\n\t\t\tDNSResolves: Ptr(true),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"domain\": {\n\t\t  \"host\": \"example.com\",\n\t\t  \"uri\": \"http://example.com/\",\n\t\t  \"nameservers\": \"default\",\n\t\t  \"dns_resolves\": true,\n\t\t  \"is_proxied\": false,\n\t\t  \"is_cloudflare_ip\": false,\n\t\t  \"is_fastly_ip\": false,\n\t\t  \"is_old_ip_address\": false,\n\t\t  \"is_a_record\": true,\n\t\t  \"has_cname_record\": false,\n\t\t  \"has_mx_records_present\": false,\n\t\t  \"is_valid_domain\": true,\n\t\t  \"is_apex_domain\": true,\n\t\t  \"should_be_a_record\": true,\n\t\t  \"is_cname_to_github_user_domain\": false,\n\t\t  \"is_cname_to_pages_dot_github_dot_com\": false,\n\t\t  \"is_cname_to_fastly\": false,\n\t\t  \"is_pointed_to_github_pages_ip\": true,\n\t\t  \"is_non_github_pages_ip_present\": false,\n\t\t  \"is_pages_domain\": false,\n\t\t  \"is_served_by_pages\": true,\n\t\t  \"is_valid\": true,\n\t\t  \"reason\": \"some reason\",\n\t\t  \"responds_to_https\": true,\n\t\t  \"enforces_https\": true,\n\t\t  \"https_error\": \"some error\",\n\t\t  \"is_https_eligible\": true,\n\t\t  \"caa_error\": \"some error\"\n\t\t},\n\t\t\"alt_domain\": {\n\t\t  \"host\": \"www.example.com\",\n\t\t  \"uri\": \"http://www.example.com/\",\n\t\t  \"nameservers\": \"default\",\n\t\t  \"dns_resolves\": true\n\t\t}\n\t  }`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestCreatePagesRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &createPagesRequest{}, \"{}\")\n\n\tu := &createPagesRequest{\n\t\tSource: &PagesSource{\n\t\t\tBranch: Ptr(\"branch\"),\n\t\t\tPath:   Ptr(\"path\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"source\": {\n\t\t\t\"branch\": \"branch\",\n\t\t\t\"path\": \"path\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/repos_prereceive_hooks.go",
    "content": "// Copyright 2018 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// PreReceiveHook represents a GitHub pre-receive hook for a repository.\ntype PreReceiveHook struct {\n\tID          *int64  `json:\"id,omitempty\"`\n\tName        *string `json:\"name,omitempty\"`\n\tEnforcement *string `json:\"enforcement,omitempty\"`\n\tConfigURL   *string `json:\"configuration_url,omitempty\"`\n}\n\nfunc (p PreReceiveHook) String() string {\n\treturn Stringify(p)\n}\n\n// ListPreReceiveHooks lists all pre-receive hooks for the specified repository.\n//\n// 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\n//\n//meta:operation GET /repos/{owner}/{repo}/pre-receive-hooks\nfunc (s *RepositoriesService) ListPreReceiveHooks(ctx context.Context, owner, repo string, opts *ListOptions) ([]*PreReceiveHook, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pre-receive-hooks\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypePreReceiveHooksPreview)\n\n\tvar hooks []*PreReceiveHook\n\tresp, err := s.client.Do(ctx, req, &hooks)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn hooks, resp, nil\n}\n\n// GetPreReceiveHook returns a single specified pre-receive hook.\n//\n// 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\n//\n//meta:operation GET /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id}\nfunc (s *RepositoriesService) GetPreReceiveHook(ctx context.Context, owner, repo string, id int64) (*PreReceiveHook, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pre-receive-hooks/%v\", owner, repo, id)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypePreReceiveHooksPreview)\n\n\tvar h *PreReceiveHook\n\tresp, err := s.client.Do(ctx, req, &h)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn h, resp, nil\n}\n\n// UpdatePreReceiveHook updates a specified pre-receive hook.\n//\n// 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\n//\n//meta:operation PATCH /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id}\nfunc (s *RepositoriesService) UpdatePreReceiveHook(ctx context.Context, owner, repo string, id int64, hook *PreReceiveHook) (*PreReceiveHook, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pre-receive-hooks/%v\", owner, repo, id)\n\treq, err := s.client.NewRequest(\"PATCH\", u, hook)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypePreReceiveHooksPreview)\n\n\tvar h *PreReceiveHook\n\tresp, err := s.client.Do(ctx, req, &h)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn h, resp, nil\n}\n\n// DeletePreReceiveHook deletes a specified pre-receive hook.\n//\n// 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\n//\n//meta:operation DELETE /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id}\nfunc (s *RepositoriesService) DeletePreReceiveHook(ctx context.Context, owner, repo string, id int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/pre-receive-hooks/%v\", owner, repo, id)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypePreReceiveHooksPreview)\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/repos_prereceive_hooks_test.go",
    "content": "// Copyright 2018 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_ListPreReceiveHooks(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pre-receive-hooks\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypePreReceiveHooksPreview)\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}, {\"id\":2}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\n\tctx := t.Context()\n\thooks, _, err := client.Repositories.ListPreReceiveHooks(ctx, \"o\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListHooks returned error: %v\", err)\n\t}\n\n\twant := []*PreReceiveHook{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}}\n\tif !cmp.Equal(hooks, want) {\n\t\tt.Errorf(\"Repositories.ListPreReceiveHooks returned %+v, want %+v\", hooks, want)\n\t}\n\n\tconst methodName = \"ListPreReceiveHooks\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListPreReceiveHooks(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListPreReceiveHooks(ctx, \"o\", \"r\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListPreReceiveHooks_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.ListPreReceiveHooks(ctx, \"%\", \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoriesService_GetPreReceiveHook(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pre-receive-hooks/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypePreReceiveHooksPreview)\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\thook, _, err := client.Repositories.GetPreReceiveHook(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetPreReceiveHook returned error: %v\", err)\n\t}\n\n\twant := &PreReceiveHook{ID: Ptr(int64(1))}\n\tif !cmp.Equal(hook, want) {\n\t\tt.Errorf(\"Repositories.GetPreReceiveHook returned %+v, want %+v\", hook, want)\n\t}\n\n\tconst methodName = \"GetPreReceiveHook\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetPreReceiveHook(ctx, \"\\n\", \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetPreReceiveHook(ctx, \"o\", \"r\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetPreReceiveHook_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.GetPreReceiveHook(ctx, \"%\", \"%\", 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoriesService_UpdatePreReceiveHook(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &PreReceiveHook{}\n\n\tmux.HandleFunc(\"/repos/o/r/pre-receive-hooks/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *PreReceiveHook\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\thook, _, err := client.Repositories.UpdatePreReceiveHook(ctx, \"o\", \"r\", 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.UpdatePreReceiveHook returned error: %v\", err)\n\t}\n\n\twant := &PreReceiveHook{ID: Ptr(int64(1))}\n\tif !cmp.Equal(hook, want) {\n\t\tt.Errorf(\"Repositories.UpdatePreReceiveHook returned %+v, want %+v\", hook, want)\n\t}\n\n\tconst methodName = \"UpdatePreReceiveHook\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.UpdatePreReceiveHook(ctx, \"\\n\", \"\\n\", -1, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.UpdatePreReceiveHook(ctx, \"o\", \"r\", 1, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_PreReceiveHook_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.UpdatePreReceiveHook(ctx, \"%\", \"%\", 1, nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoriesService_DeletePreReceiveHook(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/pre-receive-hooks/1\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Repositories.DeletePreReceiveHook(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.DeletePreReceiveHook returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeletePreReceiveHook\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.DeletePreReceiveHook(ctx, \"\\n\", \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.DeletePreReceiveHook(ctx, \"o\", \"r\", 1)\n\t})\n}\n\nfunc TestRepositoriesService_DeletePreReceiveHook_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Repositories.DeletePreReceiveHook(ctx, \"%\", \"%\", 1)\n\ttestURLParseError(t, err)\n}\n\nfunc TestPreReceiveHook_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PreReceiveHook{}, \"{}\")\n\n\tu := &PreReceiveHook{\n\t\tID:          Ptr(int64(1)),\n\t\tName:        Ptr(\"name\"),\n\t\tEnforcement: Ptr(\"e\"),\n\t\tConfigURL:   Ptr(\"curl\"),\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"name\": \"name\",\n\t\t\"enforcement\": \"e\",\n\t\t\"configuration_url\": \"curl\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/repos_properties.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// GetAllCustomPropertyValues gets all custom property values that are set for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/custom-properties#get-all-custom-property-values-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/properties/values\nfunc (s *RepositoriesService) GetAllCustomPropertyValues(ctx context.Context, org, repo string) ([]*CustomPropertyValue, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/properties/values\", org, repo)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar customPropertyValues []*CustomPropertyValue\n\tresp, err := s.client.Do(ctx, req, &customPropertyValues)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn customPropertyValues, resp, nil\n}\n\n// CreateOrUpdateCustomProperties creates new or updates existing custom property values for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/custom-properties#create-or-update-custom-property-values-for-a-repository\n//\n//meta:operation PATCH /repos/{owner}/{repo}/properties/values\nfunc (s *RepositoriesService) CreateOrUpdateCustomProperties(ctx context.Context, org, repo string, customPropertyValues []*CustomPropertyValue) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/properties/values\", org, repo)\n\n\tparams := struct {\n\t\tProperties []*CustomPropertyValue `json:\"properties\"`\n\t}{\n\t\tProperties: customPropertyValues,\n\t}\n\n\treq, err := s.client.NewRequest(\"PATCH\", u, params)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n"
  },
  {
    "path": "github/repos_properties_test.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_GetAllCustomPropertyValues(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/properties/values\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[\n\t\t{\n          \"property_name\": \"environment\",\n          \"value\": \"production\"\n        },\n        {\n          \"property_name\": \"service\",\n          \"value\": \"web\"\n        },\n        {\n          \"property_name\": \"languages\",\n          \"value\": [\"Go\", \"JavaScript\"]\n        },\n        {\n          \"property_name\": \"null_property\",\n          \"value\": null\n        }\n\t\t]`)\n\t})\n\n\tctx := t.Context()\n\tcustomPropertyValues, _, err := client.Repositories.GetAllCustomPropertyValues(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetAllCustomPropertyValues returned error: %v\", err)\n\t}\n\n\twant := []*CustomPropertyValue{\n\t\t{\n\t\t\tPropertyName: \"environment\",\n\t\t\tValue:        \"production\",\n\t\t},\n\t\t{\n\t\t\tPropertyName: \"service\",\n\t\t\tValue:        \"web\",\n\t\t},\n\t\t{\n\t\t\tPropertyName: \"languages\",\n\t\t\tValue:        []string{\"Go\", \"JavaScript\"},\n\t\t},\n\t\t{\n\t\t\tPropertyName: \"null_property\",\n\t\t\tValue:        nil,\n\t\t},\n\t}\n\n\tif !cmp.Equal(customPropertyValues, want) {\n\t\tt.Errorf(\"Repositories.GetAllCustomPropertyValues returned %+v, want %+v\", customPropertyValues, want)\n\t}\n\n\tconst methodName = \"GetAllCustomPropertyValues\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetAllCustomPropertyValues(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_CreateOrUpdateCustomProperties(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/usr/r/properties/values\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\trepoCustomProperty := []*CustomPropertyValue{\n\t\t{\n\t\t\tPropertyName: \"environment\",\n\t\t\tValue:        \"production\",\n\t\t},\n\t}\n\t_, err := client.Repositories.CreateOrUpdateCustomProperties(ctx, \"usr\", \"r\", repoCustomProperty)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.CreateOrUpdateCustomProperties returned error: %v\", err)\n\t}\n\n\tconst methodName = \"CreateOrUpdateCustomProperties\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.CreateOrUpdateCustomProperties(ctx, \"usr\", \"r\", repoCustomProperty)\n\t})\n}\n"
  },
  {
    "path": "github/repos_releases.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"mime\"\n\t\"net/http\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n)\n\n// RepositoryRelease represents a GitHub release in a repository.\ntype RepositoryRelease struct {\n\tTagName         *string `json:\"tag_name,omitempty\"`\n\tTargetCommitish *string `json:\"target_commitish,omitempty\"`\n\tName            *string `json:\"name,omitempty\"`\n\tBody            *string `json:\"body,omitempty\"`\n\tDraft           *bool   `json:\"draft,omitempty\"`\n\tPrerelease      *bool   `json:\"prerelease,omitempty\"`\n\t// MakeLatest can be one of: \"true\", \"false\", or \"legacy\".\n\tMakeLatest             *string `json:\"make_latest,omitempty\"`\n\tDiscussionCategoryName *string `json:\"discussion_category_name,omitempty\"`\n\n\t// The following fields are not used in EditRelease:\n\tGenerateReleaseNotes *bool `json:\"generate_release_notes,omitempty\"`\n\n\t// The following fields are not used in CreateRelease or EditRelease:\n\tID          *int64          `json:\"id,omitempty\"`\n\tCreatedAt   *Timestamp      `json:\"created_at,omitempty\"`\n\tPublishedAt *Timestamp      `json:\"published_at,omitempty\"`\n\tURL         *string         `json:\"url,omitempty\"`\n\tHTMLURL     *string         `json:\"html_url,omitempty\"`\n\tAssetsURL   *string         `json:\"assets_url,omitempty\"`\n\tAssets      []*ReleaseAsset `json:\"assets,omitempty\"`\n\tUploadURL   *string         `json:\"upload_url,omitempty\"`\n\tZipballURL  *string         `json:\"zipball_url,omitempty\"`\n\tTarballURL  *string         `json:\"tarball_url,omitempty\"`\n\tAuthor      *User           `json:\"author,omitempty\"`\n\tNodeID      *string         `json:\"node_id,omitempty\"`\n\tImmutable   *bool           `json:\"immutable,omitempty\"`\n}\n\nfunc (r RepositoryRelease) String() string {\n\treturn Stringify(r)\n}\n\n// RepositoryReleaseNotes represents a GitHub-generated release notes.\ntype RepositoryReleaseNotes struct {\n\tName string `json:\"name\"`\n\tBody string `json:\"body\"`\n}\n\n// GenerateNotesOptions represents the options to generate release notes.\ntype GenerateNotesOptions struct {\n\tTagName               string  `json:\"tag_name\"`\n\tPreviousTagName       *string `json:\"previous_tag_name,omitempty\"`\n\tTargetCommitish       *string `json:\"target_commitish,omitempty\"`\n\tConfigurationFilePath *string `json:\"configuration_file_path,omitempty\"`\n}\n\n// ReleaseAsset represents a GitHub release asset in a repository.\ntype ReleaseAsset struct {\n\tID                 *int64     `json:\"id,omitempty\"`\n\tURL                *string    `json:\"url,omitempty\"`\n\tName               *string    `json:\"name,omitempty\"`\n\tLabel              *string    `json:\"label,omitempty\"`\n\tState              *string    `json:\"state,omitempty\"`\n\tContentType        *string    `json:\"content_type,omitempty\"`\n\tSize               *int       `json:\"size,omitempty\"`\n\tDownloadCount      *int       `json:\"download_count,omitempty\"`\n\tCreatedAt          *Timestamp `json:\"created_at,omitempty\"`\n\tUpdatedAt          *Timestamp `json:\"updated_at,omitempty\"`\n\tBrowserDownloadURL *string    `json:\"browser_download_url,omitempty\"`\n\tUploader           *User      `json:\"uploader,omitempty\"`\n\tNodeID             *string    `json:\"node_id,omitempty\"`\n\tDigest             *string    `json:\"digest,omitempty\"`\n}\n\nfunc (r ReleaseAsset) String() string {\n\treturn Stringify(r)\n}\n\n// ListReleases lists the releases for a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/releases/releases#list-releases\n//\n//meta:operation GET /repos/{owner}/{repo}/releases\nfunc (s *RepositoriesService) ListReleases(ctx context.Context, owner, repo string, opts *ListOptions) ([]*RepositoryRelease, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/releases\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar releases []*RepositoryRelease\n\tresp, err := s.client.Do(ctx, req, &releases)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn releases, resp, nil\n}\n\n// GetRelease fetches a single release.\n//\n// GitHub API docs: https://docs.github.com/rest/releases/releases#get-a-release\n//\n//meta:operation GET /repos/{owner}/{repo}/releases/{release_id}\nfunc (s *RepositoriesService) GetRelease(ctx context.Context, owner, repo string, id int64) (*RepositoryRelease, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/releases/%v\", owner, repo, id)\n\treturn s.getSingleRelease(ctx, u)\n}\n\n// GetLatestRelease fetches the latest published release for the repository.\n//\n// GitHub API docs: https://docs.github.com/rest/releases/releases#get-the-latest-release\n//\n//meta:operation GET /repos/{owner}/{repo}/releases/latest\nfunc (s *RepositoriesService) GetLatestRelease(ctx context.Context, owner, repo string) (*RepositoryRelease, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/releases/latest\", owner, repo)\n\treturn s.getSingleRelease(ctx, u)\n}\n\n// GetReleaseByTag fetches a release with the specified tag.\n//\n// GitHub API docs: https://docs.github.com/rest/releases/releases#get-a-release-by-tag-name\n//\n//meta:operation GET /repos/{owner}/{repo}/releases/tags/{tag}\nfunc (s *RepositoriesService) GetReleaseByTag(ctx context.Context, owner, repo, tag string) (*RepositoryRelease, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/releases/tags/%v\", owner, repo, tag)\n\treturn s.getSingleRelease(ctx, u)\n}\n\n// GenerateReleaseNotes generates the release notes for the given tag.\n//\n// GitHub API docs: https://docs.github.com/rest/releases/releases#generate-release-notes-content-for-a-release\n//\n//meta:operation POST /repos/{owner}/{repo}/releases/generate-notes\nfunc (s *RepositoriesService) GenerateReleaseNotes(ctx context.Context, owner, repo string, opts *GenerateNotesOptions) (*RepositoryReleaseNotes, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/releases/generate-notes\", owner, repo)\n\treq, err := s.client.NewRequest(\"POST\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar r *RepositoryReleaseNotes\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}\n\nfunc (s *RepositoriesService) getSingleRelease(ctx context.Context, url string) (*RepositoryRelease, *Response, error) {\n\treq, err := s.client.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar release *RepositoryRelease\n\tresp, err := s.client.Do(ctx, req, &release)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn release, resp, nil\n}\n\n// repositoryReleaseRequest is a subset of RepositoryRelease and\n// is used internally by CreateRelease and EditRelease to pass\n// only the known fields for these endpoints.\n//\n// See https://github.com/google/go-github/issues/992 for more\n// information.\ntype repositoryReleaseRequest struct {\n\tTagName                *string `json:\"tag_name,omitempty\"`\n\tTargetCommitish        *string `json:\"target_commitish,omitempty\"`\n\tName                   *string `json:\"name,omitempty\"`\n\tBody                   *string `json:\"body,omitempty\"`\n\tDraft                  *bool   `json:\"draft,omitempty\"`\n\tPrerelease             *bool   `json:\"prerelease,omitempty\"`\n\tMakeLatest             *string `json:\"make_latest,omitempty\"`\n\tGenerateReleaseNotes   *bool   `json:\"generate_release_notes,omitempty\"`\n\tDiscussionCategoryName *string `json:\"discussion_category_name,omitempty\"`\n}\n\n// CreateRelease adds a new release for a repository.\n//\n// Note that only a subset of the release fields are used.\n// See RepositoryRelease for more information.\n//\n// GitHub API docs: https://docs.github.com/rest/releases/releases#create-a-release\n//\n//meta:operation POST /repos/{owner}/{repo}/releases\nfunc (s *RepositoriesService) CreateRelease(ctx context.Context, owner, repo string, release *RepositoryRelease) (*RepositoryRelease, *Response, error) {\n\tif release == nil {\n\t\treturn nil, nil, errors.New(\"release must be provided\")\n\t}\n\n\tu := fmt.Sprintf(\"repos/%v/%v/releases\", owner, repo)\n\n\treleaseReq := &repositoryReleaseRequest{\n\t\tTagName:                release.TagName,\n\t\tTargetCommitish:        release.TargetCommitish,\n\t\tName:                   release.Name,\n\t\tBody:                   release.Body,\n\t\tDraft:                  release.Draft,\n\t\tPrerelease:             release.Prerelease,\n\t\tMakeLatest:             release.MakeLatest,\n\t\tDiscussionCategoryName: release.DiscussionCategoryName,\n\t\tGenerateReleaseNotes:   release.GenerateReleaseNotes,\n\t}\n\n\treq, err := s.client.NewRequest(\"POST\", u, releaseReq)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar r *RepositoryRelease\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}\n\n// EditRelease edits a repository release.\n//\n// Note that only a subset of the release fields are used.\n// See RepositoryRelease for more information.\n//\n// GitHub API docs: https://docs.github.com/rest/releases/releases#update-a-release\n//\n//meta:operation PATCH /repos/{owner}/{repo}/releases/{release_id}\nfunc (s *RepositoriesService) EditRelease(ctx context.Context, owner, repo string, id int64, release *RepositoryRelease) (*RepositoryRelease, *Response, error) {\n\tif release == nil {\n\t\treturn nil, nil, errors.New(\"release must be provided\")\n\t}\n\n\tu := fmt.Sprintf(\"repos/%v/%v/releases/%v\", owner, repo, id)\n\n\treleaseReq := &repositoryReleaseRequest{\n\t\tTagName:                release.TagName,\n\t\tTargetCommitish:        release.TargetCommitish,\n\t\tName:                   release.Name,\n\t\tBody:                   release.Body,\n\t\tDraft:                  release.Draft,\n\t\tPrerelease:             release.Prerelease,\n\t\tMakeLatest:             release.MakeLatest,\n\t\tDiscussionCategoryName: release.DiscussionCategoryName,\n\t}\n\n\treq, err := s.client.NewRequest(\"PATCH\", u, releaseReq)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar r *RepositoryRelease\n\tresp, err := s.client.Do(ctx, req, &r)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn r, resp, nil\n}\n\n// DeleteRelease delete a single release from a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/releases/releases#delete-a-release\n//\n//meta:operation DELETE /repos/{owner}/{repo}/releases/{release_id}\nfunc (s *RepositoriesService) DeleteRelease(ctx context.Context, owner, repo string, id int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/releases/%v\", owner, repo, id)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// ListReleaseAssets lists the release's assets.\n//\n// GitHub API docs: https://docs.github.com/rest/releases/assets#list-release-assets\n//\n//meta:operation GET /repos/{owner}/{repo}/releases/{release_id}/assets\nfunc (s *RepositoriesService) ListReleaseAssets(ctx context.Context, owner, repo string, id int64, opts *ListOptions) ([]*ReleaseAsset, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/releases/%v/assets\", owner, repo, id)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar assets []*ReleaseAsset\n\tresp, err := s.client.Do(ctx, req, &assets)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn assets, resp, nil\n}\n\n// GetReleaseAsset fetches a single release asset.\n//\n// GitHub API docs: https://docs.github.com/rest/releases/assets#get-a-release-asset\n//\n//meta:operation GET /repos/{owner}/{repo}/releases/assets/{asset_id}\nfunc (s *RepositoriesService) GetReleaseAsset(ctx context.Context, owner, repo string, id int64) (*ReleaseAsset, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/releases/assets/%v\", owner, repo, id)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar asset *ReleaseAsset\n\tresp, err := s.client.Do(ctx, req, &asset)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn asset, resp, nil\n}\n\n// DownloadReleaseAsset downloads a release asset or returns a redirect URL.\n//\n// DownloadReleaseAsset returns an io.ReadCloser that reads the contents of the\n// specified release asset. It is the caller's responsibility to close the ReadCloser.\n// If a redirect is returned, the redirect URL will be returned as a string instead\n// of the io.ReadCloser. Exactly one of rc and redirectURL will be zero.\n//\n// followRedirectsClient can be passed to download the asset from a redirected\n// location. Specifying any http.Client is possible, but passing http.DefaultClient\n// is recommended, except when the specified repository is private, in which case\n// it's necessary to pass an http.Client that performs authenticated requests.\n// If nil is passed the redirectURL will be returned instead.\n//\n// GitHub API docs: https://docs.github.com/rest/releases/assets#get-a-release-asset\n//\n//meta:operation GET /repos/{owner}/{repo}/releases/assets/{asset_id}\nfunc (s *RepositoriesService) DownloadReleaseAsset(ctx context.Context, owner, repo string, id int64, followRedirectsClient *http.Client) (rc io.ReadCloser, redirectURL string, err error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/releases/assets/%v\", owner, repo, id)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\treq.Header.Set(\"Accept\", defaultMediaType)\n\n\ts.client.clientMu.Lock()\n\tdefer s.client.clientMu.Unlock()\n\n\tvar loc string\n\tsaveRedirect := s.client.client.CheckRedirect\n\ts.client.client.CheckRedirect = func(req *http.Request, _ []*http.Request) error {\n\t\tloc = req.URL.String()\n\t\treturn errors.New(\"disable redirect\")\n\t}\n\tdefer func() { s.client.client.CheckRedirect = saveRedirect }()\n\n\treq = withContext(ctx, req)\n\tresp, err := s.client.client.Do(req)\n\tif err != nil {\n\t\tif !strings.Contains(err.Error(), \"disable redirect\") {\n\t\t\treturn nil, \"\", err\n\t\t}\n\t\tif followRedirectsClient != nil {\n\t\t\trc, err := s.downloadReleaseAssetFromURL(ctx, followRedirectsClient, loc)\n\t\t\treturn rc, \"\", err\n\t\t}\n\t\treturn nil, loc, nil // Intentionally return no error with valid redirect URL.\n\t}\n\n\tif err := CheckResponse(resp); err != nil {\n\t\t_ = resp.Body.Close()\n\t\treturn nil, \"\", err\n\t}\n\n\treturn resp.Body, \"\", nil\n}\n\nfunc (s *RepositoriesService) downloadReleaseAssetFromURL(ctx context.Context, followRedirectsClient *http.Client, url string) (rc io.ReadCloser, err error) {\n\treq, err := http.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq = withContext(ctx, req)\n\treq.Header.Set(\"Accept\", defaultMediaType)\n\tresp, err := followRedirectsClient.Do(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := CheckResponse(resp); err != nil {\n\t\t_ = resp.Body.Close()\n\t\treturn nil, err\n\t}\n\treturn resp.Body, nil\n}\n\n// EditReleaseAsset edits a repository release asset.\n//\n// GitHub API docs: https://docs.github.com/rest/releases/assets#update-a-release-asset\n//\n//meta:operation PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}\nfunc (s *RepositoriesService) EditReleaseAsset(ctx context.Context, owner, repo string, id int64, release *ReleaseAsset) (*ReleaseAsset, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/releases/assets/%v\", owner, repo, id)\n\n\treq, err := s.client.NewRequest(\"PATCH\", u, release)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar asset *ReleaseAsset\n\tresp, err := s.client.Do(ctx, req, &asset)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn asset, resp, nil\n}\n\n// DeleteReleaseAsset delete a single release asset from a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/releases/assets#delete-a-release-asset\n//\n//meta:operation DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}\nfunc (s *RepositoriesService) DeleteReleaseAsset(ctx context.Context, owner, repo string, id int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/releases/assets/%v\", owner, repo, id)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// UploadReleaseAsset creates an asset by uploading a file into a release repository.\n// To upload assets that cannot be represented by an os.File, call NewUploadRequest directly.\n//\n// GitHub API docs: https://docs.github.com/rest/releases/assets#upload-a-release-asset\n//\n//meta:operation POST /repos/{owner}/{repo}/releases/{release_id}/assets\nfunc (s *RepositoriesService) UploadReleaseAsset(ctx context.Context, owner, repo string, id int64, opts *UploadOptions, file *os.File) (*ReleaseAsset, *Response, error) {\n\tif file == nil {\n\t\treturn nil, nil, errors.New(\"file must be provided\")\n\t}\n\n\tu := fmt.Sprintf(\"repos/%v/%v/releases/%v/assets\", owner, repo, id)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tstat, err := file.Stat()\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tif stat.IsDir() {\n\t\treturn nil, nil, errors.New(\"the asset to upload can't be a directory\")\n\t}\n\n\tmediaType := mime.TypeByExtension(filepath.Ext(file.Name()))\n\tif opts.MediaType != \"\" {\n\t\tmediaType = opts.MediaType\n\t}\n\n\treq, err := s.client.NewUploadRequest(u, file, stat.Size(), mediaType)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar asset *ReleaseAsset\n\tresp, err := s.client.Do(ctx, req, &asset)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn asset, resp, nil\n}\n\n// UploadReleaseAssetFromRelease uploads an asset using the UploadURL that's embedded\n// in a RepositoryRelease object.\n//\n// This is a convenience wrapper that extracts the release.UploadURL (which is usually\n// templated like \"https://uploads.github.com/.../assets{?name,label}\") and uploads\n// the provided data (reader + size) using the existing upload helpers.\n//\n// GitHub API docs: https://docs.github.com/rest/releases/assets#upload-a-release-asset\n//\n//meta:operation POST /repos/{owner}/{repo}/releases/{release_id}/assets\nfunc (s *RepositoriesService) UploadReleaseAssetFromRelease(\n\tctx context.Context,\n\trelease *RepositoryRelease,\n\topts *UploadOptions,\n\treader io.Reader,\n\tsize int64,\n) (*ReleaseAsset, *Response, error) {\n\tif release == nil || release.UploadURL == nil {\n\t\treturn nil, nil, errors.New(\"release UploadURL must be provided\")\n\t}\n\tif reader == nil {\n\t\treturn nil, nil, errors.New(\"reader must be provided\")\n\t}\n\tif size < 0 {\n\t\treturn nil, nil, errors.New(\"size must be >= 0\")\n\t}\n\n\t// Strip URI-template portion (e.g. \"{?name,label}\") if present.\n\tuploadURL := *release.UploadURL\n\tif idx := strings.Index(uploadURL, \"{\"); idx != -1 {\n\t\tuploadURL = uploadURL[:idx]\n\t}\n\n\t// If this is a *relative* URL (no scheme), normalize it by trimming a leading \"/\"\n\t// so it works with Client.BaseURL path prefixes (e.g. \"/api-v3/\").\n\tif !strings.HasPrefix(uploadURL, \"http://\") && !strings.HasPrefix(uploadURL, \"https://\") {\n\t\tuploadURL = strings.TrimPrefix(uploadURL, \"/\")\n\t}\n\n\t// addOptions will append name/label query params (same behavior as UploadReleaseAsset).\n\tu, err := addOptions(uploadURL, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\t// determine media type\n\tmediaType := defaultMediaType\n\tif opts != nil {\n\t\tswitch {\n\t\tcase opts.MediaType != \"\":\n\t\t\tmediaType = opts.MediaType\n\t\tcase opts.Name != \"\":\n\t\t\tif ext := filepath.Ext(opts.Name); ext != \"\" {\n\t\t\t\tif mt := mime.TypeByExtension(ext); mt != \"\" {\n\t\t\t\t\tmediaType = mt\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treq, err := s.client.NewUploadRequest(u, reader, size, mediaType)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar asset *ReleaseAsset\n\tresp, err := s.client.Do(ctx, req, &asset)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn asset, resp, nil\n}\n"
  },
  {
    "path": "github/repos_releases_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_ListReleases(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/releases\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\treleases, _, err := client.Repositories.ListReleases(ctx, \"o\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListReleases returned error: %v\", err)\n\t}\n\twant := []*RepositoryRelease{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(releases, want) {\n\t\tt.Errorf(\"Repositories.ListReleases returned %+v, want %+v\", releases, want)\n\t}\n\n\tconst methodName = \"ListReleases\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListReleases(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListReleases(ctx, \"o\", \"r\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GenerateReleaseNotes(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/releases/generate-notes\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestBody(t, r, `{\"tag_name\":\"v1.0.0\"}`+\"\\n\")\n\t\tfmt.Fprint(w, `{\"name\":\"v1.0.0\",\"body\":\"**Full Changelog**: https://github.com/o/r/compare/v0.9.0...v1.0.0\"}`)\n\t})\n\n\topt := &GenerateNotesOptions{\n\t\tTagName: \"v1.0.0\",\n\t}\n\tctx := t.Context()\n\treleases, _, err := client.Repositories.GenerateReleaseNotes(ctx, \"o\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GenerateReleaseNotes returned error: %v\", err)\n\t}\n\twant := &RepositoryReleaseNotes{\n\t\tName: \"v1.0.0\",\n\t\tBody: \"**Full Changelog**: https://github.com/o/r/compare/v0.9.0...v1.0.0\",\n\t}\n\tif !cmp.Equal(releases, want) {\n\t\tt.Errorf(\"Repositories.GenerateReleaseNotes returned %+v, want %+v\", releases, want)\n\t}\n\n\tconst methodName = \"GenerateReleaseNotes\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GenerateReleaseNotes(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GenerateReleaseNotes(ctx, \"o\", \"r\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetRelease(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/releases/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1,\"author\":{\"login\":\"l\"}}`)\n\t})\n\n\tctx := t.Context()\n\trelease, resp, err := client.Repositories.GetRelease(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetRelease returned error: %v\\n%v\", err, resp.Body)\n\t}\n\n\twant := &RepositoryRelease{ID: Ptr(int64(1)), Author: &User{Login: Ptr(\"l\")}}\n\tif !cmp.Equal(release, want) {\n\t\tt.Errorf(\"Repositories.GetRelease returned %+v, want %+v\", release, want)\n\t}\n\n\tconst methodName = \"GetRelease\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetRelease(ctx, \"\\n\", \"\\n\", 1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetRelease(ctx, \"o\", \"r\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetLatestRelease(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/releases/latest\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":3}`)\n\t})\n\n\tctx := t.Context()\n\trelease, resp, err := client.Repositories.GetLatestRelease(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetLatestRelease returned error: %v\\n%v\", err, resp.Body)\n\t}\n\n\twant := &RepositoryRelease{ID: Ptr(int64(3))}\n\tif !cmp.Equal(release, want) {\n\t\tt.Errorf(\"Repositories.GetLatestRelease returned %+v, want %+v\", release, want)\n\t}\n\n\tconst methodName = \"GetLatestRelease\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetLatestRelease(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetLatestRelease(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetReleaseByTag(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/releases/tags/foo\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":13}`)\n\t})\n\n\tctx := t.Context()\n\trelease, resp, err := client.Repositories.GetReleaseByTag(ctx, \"o\", \"r\", \"foo\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetReleaseByTag returned error: %v\\n%v\", err, resp.Body)\n\t}\n\n\twant := &RepositoryRelease{ID: Ptr(int64(13))}\n\tif !cmp.Equal(release, want) {\n\t\tt.Errorf(\"Repositories.GetReleaseByTag returned %+v, want %+v\", release, want)\n\t}\n\n\tconst methodName = \"GetReleaseByTag\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetReleaseByTag(ctx, \"\\n\", \"\\n\", \"foo\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetReleaseByTag(ctx, \"o\", \"r\", \"foo\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_CreateRelease(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &RepositoryRelease{\n\t\tName:                   Ptr(\"v1.0\"),\n\t\tDiscussionCategoryName: Ptr(\"General\"),\n\t\tGenerateReleaseNotes:   Ptr(true),\n\t\t// Fields to be removed:\n\t\tID:          Ptr(int64(2)),\n\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\tPublishedAt: &Timestamp{referenceTime},\n\t\tURL:         Ptr(\"http://url/\"),\n\t\tHTMLURL:     Ptr(\"http://htmlurl/\"),\n\t\tAssetsURL:   Ptr(\"http://assetsurl/\"),\n\t\tAssets:      []*ReleaseAsset{{ID: Ptr(int64(5))}},\n\t\tUploadURL:   Ptr(\"http://uploadurl/\"),\n\t\tZipballURL:  Ptr(\"http://zipballurl/\"),\n\t\tTarballURL:  Ptr(\"http://tarballurl/\"),\n\t\tAuthor:      &User{Name: Ptr(\"octocat\")},\n\t\tNodeID:      Ptr(\"nodeid\"),\n\t\tImmutable:   Ptr(false),\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/releases\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *repositoryReleaseRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\twant := &repositoryReleaseRequest{\n\t\t\tName:                   Ptr(\"v1.0\"),\n\t\t\tDiscussionCategoryName: Ptr(\"General\"),\n\t\t\tGenerateReleaseNotes:   Ptr(true),\n\t\t}\n\t\tif !cmp.Equal(v, want) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, want)\n\t\t}\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\trelease, _, err := client.Repositories.CreateRelease(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.CreateRelease returned error: %v\", err)\n\t}\n\n\twant := &RepositoryRelease{ID: Ptr(int64(1))}\n\tif !cmp.Equal(release, want) {\n\t\tt.Errorf(\"Repositories.CreateRelease returned %+v, want %+v\", release, want)\n\t}\n\n\tconst methodName = \"CreateRelease\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.CreateRelease(ctx, \"o\", \"r\", nil)\n\t\treturn err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.CreateRelease(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.CreateRelease(ctx, \"o\", \"r\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_EditRelease(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &RepositoryRelease{\n\t\tName:                   Ptr(\"n\"),\n\t\tDiscussionCategoryName: Ptr(\"General\"),\n\t\t// Fields to be removed:\n\t\tGenerateReleaseNotes: Ptr(true),\n\t\tID:                   Ptr(int64(2)),\n\t\tCreatedAt:            &Timestamp{referenceTime},\n\t\tPublishedAt:          &Timestamp{referenceTime},\n\t\tURL:                  Ptr(\"http://url/\"),\n\t\tHTMLURL:              Ptr(\"http://htmlurl/\"),\n\t\tAssetsURL:            Ptr(\"http://assetsurl/\"),\n\t\tAssets:               []*ReleaseAsset{{ID: Ptr(int64(5))}},\n\t\tUploadURL:            Ptr(\"http://uploadurl/\"),\n\t\tZipballURL:           Ptr(\"http://zipballurl/\"),\n\t\tTarballURL:           Ptr(\"http://tarballurl/\"),\n\t\tAuthor:               &User{Name: Ptr(\"octocat\")},\n\t\tNodeID:               Ptr(\"nodeid\"),\n\t\tImmutable:            Ptr(false),\n\t}\n\n\tmux.HandleFunc(\"/repos/o/r/releases/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *repositoryReleaseRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\twant := &repositoryReleaseRequest{\n\t\t\tName:                   Ptr(\"n\"),\n\t\t\tDiscussionCategoryName: Ptr(\"General\"),\n\t\t}\n\t\tif !cmp.Equal(v, want) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, want)\n\t\t}\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\trelease, _, err := client.Repositories.EditRelease(ctx, \"o\", \"r\", 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.EditRelease returned error: %v\", err)\n\t}\n\twant := &RepositoryRelease{ID: Ptr(int64(1))}\n\tif !cmp.Equal(release, want) {\n\t\tt.Errorf(\"Repositories.EditRelease returned = %+v, want %+v\", release, want)\n\t}\n\n\tconst methodName = \"EditRelease\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.EditRelease(ctx, \"o\", \"r\", 1, nil)\n\t\treturn err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.EditRelease(ctx, \"\\n\", \"\\n\", 1, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.EditRelease(ctx, \"o\", \"r\", 1, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_DeleteRelease(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/releases/1\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Repositories.DeleteRelease(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.DeleteRelease returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteRelease\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.DeleteRelease(ctx, \"\\n\", \"\\n\", 1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.DeleteRelease(ctx, \"o\", \"r\", 1)\n\t})\n}\n\nfunc TestRepositoriesService_ListReleaseAssets(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/releases/1/assets\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tassets, _, err := client.Repositories.ListReleaseAssets(ctx, \"o\", \"r\", 1, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListReleaseAssets returned error: %v\", err)\n\t}\n\twant := []*ReleaseAsset{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(assets, want) {\n\t\tt.Errorf(\"Repositories.ListReleaseAssets returned %+v, want %+v\", assets, want)\n\t}\n\n\tconst methodName = \"ListReleaseAssets\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListReleaseAssets(ctx, \"\\n\", \"\\n\", 1, opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListReleaseAssets(ctx, \"o\", \"r\", 1, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetReleaseAsset(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/releases/assets/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tasset, _, err := client.Repositories.GetReleaseAsset(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetReleaseAsset returned error: %v\", err)\n\t}\n\twant := &ReleaseAsset{ID: Ptr(int64(1))}\n\tif !cmp.Equal(asset, want) {\n\t\tt.Errorf(\"Repositories.GetReleaseAsset returned %+v, want %+v\", asset, want)\n\t}\n\n\tconst methodName = \"GetReleaseAsset\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetReleaseAsset(ctx, \"\\n\", \"\\n\", 1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetReleaseAsset(ctx, \"o\", \"r\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_DownloadReleaseAsset_Stream(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/releases/assets/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", defaultMediaType)\n\t\tw.Header().Set(\"Content-Type\", \"application/octet-stream\")\n\t\tw.Header().Set(\"Content-Disposition\", \"attachment; filename=hello-world.txt\")\n\t\tfmt.Fprint(w, \"Hello World\")\n\t})\n\n\tctx := t.Context()\n\treader, _, err := client.Repositories.DownloadReleaseAsset(ctx, \"o\", \"r\", 1, nil)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.DownloadReleaseAsset returned error: %v\", err)\n\t}\n\twant := []byte(\"Hello World\")\n\tcontent, err := io.ReadAll(reader)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.DownloadReleaseAsset returned bad reader: %v\", err)\n\t}\n\tif !bytes.Equal(want, content) {\n\t\tt.Errorf(\"Repositories.DownloadReleaseAsset returned %+v, want %+v\", content, want)\n\t}\n\n\tconst methodName = \"DownloadReleaseAsset\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.DownloadReleaseAsset(ctx, \"\\n\", \"\\n\", -1, nil)\n\t\treturn err\n\t})\n}\n\nfunc TestRepositoriesService_DownloadReleaseAsset_Redirect(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/releases/assets/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", defaultMediaType)\n\t\thttp.Redirect(w, r, \"/yo\", http.StatusFound)\n\t})\n\n\tctx := t.Context()\n\t_, got, err := client.Repositories.DownloadReleaseAsset(ctx, \"o\", \"r\", 1, nil)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.DownloadReleaseAsset returned error: %v\", err)\n\t}\n\twant := \"/yo\"\n\tif !strings.HasSuffix(got, want) {\n\t\tt.Errorf(\"Repositories.DownloadReleaseAsset returned %+v, want %+v\", got, want)\n\t}\n}\n\nfunc TestRepositoriesService_DownloadReleaseAsset_FollowRedirect(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/releases/assets/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", defaultMediaType)\n\t\t// /yo, below will be served as baseURLPath/yo\n\t\thttp.Redirect(w, r, baseURLPath+\"/yo\", http.StatusFound)\n\t})\n\tmux.HandleFunc(\"/yo\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", defaultMediaType)\n\t\tw.Header().Set(\"Content-Type\", \"application/octet-stream\")\n\t\tw.Header().Set(\"Content-Disposition\", \"attachment; filename=hello-world.txt\")\n\t\tfmt.Fprint(w, \"Hello World\")\n\t})\n\n\tctx := t.Context()\n\treader, _, err := client.Repositories.DownloadReleaseAsset(ctx, \"o\", \"r\", 1, http.DefaultClient)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.DownloadReleaseAsset returned error: %v\", err)\n\t}\n\tcontent, err := io.ReadAll(reader)\n\tif err != nil {\n\t\tt.Errorf(\"Reading Repositories.DownloadReleaseAsset returned error: %v\", err)\n\t}\n\treader.Close()\n\twant := []byte(\"Hello World\")\n\tif !bytes.Equal(want, content) {\n\t\tt.Errorf(\"Repositories.DownloadReleaseAsset returned %+v, want %+v\", content, want)\n\t}\n}\n\nfunc TestRepositoriesService_DownloadReleaseAsset_FollowMultipleRedirects(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/releases/assets/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Header().Set(\"Content-Type\", \"application/json; charset=utf-8\")\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", defaultMediaType)\n\t\t// /yo, below will be served as baseURLPath/yo\n\t\thttp.Redirect(w, r, baseURLPath+\"/yo\", http.StatusMovedPermanently)\n\t})\n\tmux.HandleFunc(\"/yo\", func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Header().Set(\"Content-Type\", \"text/html;charset=utf-8\")\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", defaultMediaType)\n\t\t// /yo2, below will be served as baseURLPath/yo2\n\t\thttp.Redirect(w, r, baseURLPath+\"/yo2\", http.StatusFound)\n\t})\n\tmux.HandleFunc(\"/yo2\", func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Header().Set(\"Content-Type\", \"application/octet-stream\")\n\t\tw.Header().Set(\"Content-Disposition\", \"attachment; filename=hello-world.txt\")\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", defaultMediaType)\n\t\tfmt.Fprint(w, \"Hello World\")\n\t})\n\n\tctx := t.Context()\n\treader, _, err := client.Repositories.DownloadReleaseAsset(ctx, \"o\", \"r\", 1, http.DefaultClient)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.DownloadReleaseAsset returned error: %v\", err)\n\t}\n\tcontent, err := io.ReadAll(reader)\n\tif err != nil {\n\t\tt.Errorf(\"Reading Repositories.DownloadReleaseAsset returned error: %v\", err)\n\t}\n\treader.Close()\n\twant := []byte(\"Hello World\")\n\tif !bytes.Equal(want, content) {\n\t\tt.Errorf(\"Repositories.DownloadReleaseAsset returned %+v, want %+v\", content, want)\n\t}\n}\n\nfunc TestRepositoriesService_DownloadReleaseAsset_FollowRedirectToError(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/releases/assets/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", defaultMediaType)\n\t\t// /yo, below will be served as baseURLPath/yo\n\t\thttp.Redirect(w, r, baseURLPath+\"/yo\", http.StatusFound)\n\t})\n\tmux.HandleFunc(\"/yo\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", defaultMediaType)\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tresp, loc, err := client.Repositories.DownloadReleaseAsset(ctx, \"o\", \"r\", 1, http.DefaultClient)\n\tif err == nil {\n\t\tt.Error(\"Repositories.DownloadReleaseAsset did not return an error\")\n\t}\n\tif resp != nil {\n\t\tresp.Close()\n\t\tt.Error(\"Repositories.DownloadReleaseAsset returned stream, want nil\")\n\t}\n\tif loc != \"\" {\n\t\tt.Errorf(`Repositories.DownloadReleaseAsset returned \"%v\", want empty \"\"`, loc)\n\t}\n}\n\nfunc TestRepositoriesService_DownloadReleaseAsset_APIError(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/releases/assets/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", defaultMediaType)\n\t\tw.WriteHeader(http.StatusNotFound)\n\t\tfmt.Fprint(w, `{\"message\":\"Not Found\",\"documentation_url\":\"https://developer.github.com/v3\"}`)\n\t})\n\n\tctx := t.Context()\n\tresp, loc, err := client.Repositories.DownloadReleaseAsset(ctx, \"o\", \"r\", 1, nil)\n\tif err == nil {\n\t\tt.Error(\"Repositories.DownloadReleaseAsset did not return an error\")\n\t}\n\n\tif resp != nil {\n\t\tresp.Close()\n\t\tt.Error(\"Repositories.DownloadReleaseAsset returned stream, want nil\")\n\t}\n\n\tif loc != \"\" {\n\t\tt.Errorf(`Repositories.DownloadReleaseAsset returned \"%v\", want empty \"\"`, loc)\n\t}\n}\n\nfunc TestRepositoriesService_EditReleaseAsset(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &ReleaseAsset{Name: Ptr(\"n\")}\n\n\tmux.HandleFunc(\"/repos/o/r/releases/assets/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *ReleaseAsset\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tasset, _, err := client.Repositories.EditReleaseAsset(ctx, \"o\", \"r\", 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.EditReleaseAsset returned error: %v\", err)\n\t}\n\twant := &ReleaseAsset{ID: Ptr(int64(1))}\n\tif !cmp.Equal(asset, want) {\n\t\tt.Errorf(\"Repositories.EditReleaseAsset returned = %+v, want %+v\", asset, want)\n\t}\n\n\tconst methodName = \"EditReleaseAsset\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.EditReleaseAsset(ctx, \"\\n\", \"\\n\", 1, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.EditReleaseAsset(ctx, \"o\", \"r\", 1, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_DeleteReleaseAsset(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/releases/assets/1\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Repositories.DeleteReleaseAsset(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.DeleteReleaseAsset returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteReleaseAsset\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.DeleteReleaseAsset(ctx, \"\\n\", \"\\n\", 1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.DeleteReleaseAsset(ctx, \"o\", \"r\", 1)\n\t})\n}\n\nfunc TestRepositoriesService_UploadReleaseAsset(t *testing.T) {\n\tt.Parallel()\n\tvar (\n\t\tdefaultUploadOptions     = &UploadOptions{Name: \"n\"}\n\t\tdefaultExpectedFormValue = values{\"name\": \"n\"}\n\t\tmediaTypeTextPlain       = \"text/plain; charset=utf-8\"\n\t)\n\tuploadTests := []struct {\n\t\tuploadOpts         *UploadOptions\n\t\tfileName           string\n\t\texpectedFormValues values\n\t\texpectedMediaType  string\n\t}{\n\t\t// No file extension and no explicit media type.\n\t\t{\n\t\t\tdefaultUploadOptions,\n\t\t\t\"upload\",\n\t\t\tdefaultExpectedFormValue,\n\t\t\tdefaultMediaType,\n\t\t},\n\t\t// File extension and no explicit media type.\n\t\t{\n\t\t\tdefaultUploadOptions,\n\t\t\t\"upload.txt\",\n\t\t\tdefaultExpectedFormValue,\n\t\t\tmediaTypeTextPlain,\n\t\t},\n\t\t// No file extension and explicit media type.\n\t\t{\n\t\t\t&UploadOptions{Name: \"n\", MediaType: \"image/png\"},\n\t\t\t\"upload\",\n\t\t\tdefaultExpectedFormValue,\n\t\t\t\"image/png\",\n\t\t},\n\t\t// File extension and explicit media type.\n\t\t{\n\t\t\t&UploadOptions{Name: \"n\", MediaType: \"image/png\"},\n\t\t\t\"upload.png\",\n\t\t\tdefaultExpectedFormValue,\n\t\t\t\"image/png\",\n\t\t},\n\t\t// Label provided.\n\t\t{\n\t\t\t&UploadOptions{Name: \"n\", Label: \"l\"},\n\t\t\t\"upload.txt\",\n\t\t\tvalues{\"name\": \"n\", \"label\": \"l\"},\n\t\t\tmediaTypeTextPlain,\n\t\t},\n\t\t// No label provided.\n\t\t{\n\t\t\tdefaultUploadOptions,\n\t\t\t\"upload.txt\",\n\t\t\tdefaultExpectedFormValue,\n\t\t\tmediaTypeTextPlain,\n\t\t},\n\t}\n\n\tclient, mux, _ := setup(t)\n\n\tfor key, test := range uploadTests {\n\t\treleaseEndpoint := fmt.Sprintf(\"/repos/o/r/releases/%v/assets\", key)\n\t\tmux.HandleFunc(releaseEndpoint, func(w http.ResponseWriter, r *http.Request) {\n\t\t\ttestMethod(t, r, \"POST\")\n\t\t\ttestHeader(t, r, \"Content-Type\", test.expectedMediaType)\n\t\t\ttestHeader(t, r, \"Content-Length\", \"12\")\n\t\t\ttestFormValues(t, r, test.expectedFormValues)\n\t\t\ttestBody(t, r, \"Upload me !\\n\")\n\n\t\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t\t})\n\n\t\tfile := openTestFile(t, test.fileName, \"Upload me !\\n\")\n\n\t\tctx := t.Context()\n\t\tasset, _, err := client.Repositories.UploadReleaseAsset(ctx, \"o\", \"r\", int64(key), test.uploadOpts, file)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Repositories.UploadReleaseAssert returned error: %v\", err)\n\t\t}\n\t\twant := &ReleaseAsset{ID: Ptr(int64(1))}\n\t\tif !cmp.Equal(asset, want) {\n\t\t\tt.Errorf(\"Repositories.UploadReleaseAssert returned %+v, want %+v\", asset, want)\n\t\t}\n\n\t\tconst methodName = \"UploadReleaseAsset\"\n\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t_, _, err = client.Repositories.UploadReleaseAsset(ctx, \"o\", \"r\", int64(key), test.uploadOpts, nil)\n\t\t\treturn err\n\t\t})\n\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t_, _, err = client.Repositories.UploadReleaseAsset(ctx, \"\\n\", \"\\n\", int64(key), test.uploadOpts, file)\n\t\t\treturn err\n\t\t})\n\t}\n\ttestNewRequestAndDoFailure(t, \"UploadReleaseAsset\", client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.UploadReleaseAsset(t.Context(), \"o\", \"r\", 1, defaultUploadOptions, openTestFile(t, \"upload.txt\", \"Upload me !\\n\"))\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure UploadReleaseAsset = %#v, want nil\", got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoryReleaseRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &repositoryReleaseRequest{}, \"{}\")\n\n\tu := &repositoryReleaseRequest{\n\t\tTagName:                Ptr(\"tn\"),\n\t\tTargetCommitish:        Ptr(\"tc\"),\n\t\tName:                   Ptr(\"name\"),\n\t\tBody:                   Ptr(\"body\"),\n\t\tDraft:                  Ptr(false),\n\t\tPrerelease:             Ptr(false),\n\t\tMakeLatest:             Ptr(\"legacy\"),\n\t\tDiscussionCategoryName: Ptr(\"dcn\"),\n\t}\n\n\twant := `{\n\t\t\"tag_name\": \"tn\",\n\t\t\"target_commitish\": \"tc\",\n\t\t\"name\": \"name\",\n\t\t\"body\": \"body\",\n\t\t\"draft\": false,\n\t\t\"prerelease\": false,\n\t\t\"make_latest\": \"legacy\",\n\t\t\"discussion_category_name\": \"dcn\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestReleaseAsset_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ReleaseAsset{}, \"{}\")\n\n\tu := &ReleaseAsset{\n\t\tID:                 Ptr(int64(1)),\n\t\tURL:                Ptr(\"url\"),\n\t\tName:               Ptr(\"name\"),\n\t\tLabel:              Ptr(\"label\"),\n\t\tState:              Ptr(\"state\"),\n\t\tContentType:        Ptr(\"ct\"),\n\t\tSize:               Ptr(1),\n\t\tDownloadCount:      Ptr(1),\n\t\tCreatedAt:          &Timestamp{referenceTime},\n\t\tUpdatedAt:          &Timestamp{referenceTime},\n\t\tBrowserDownloadURL: Ptr(\"bdu\"),\n\t\tUploader:           &User{ID: Ptr(int64(1))},\n\t\tNodeID:             Ptr(\"nid\"),\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"url\": \"url\",\n\t\t\"name\": \"name\",\n\t\t\"label\": \"label\",\n\t\t\"state\": \"state\",\n\t\t\"content_type\": \"ct\",\n\t\t\"size\": 1,\n\t\t\"download_count\": 1,\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"browser_download_url\": \"bdu\",\n\t\t\"uploader\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"node_id\": \"nid\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestRepositoryRelease_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RepositoryRelease{}, \"{}\")\n\n\tu := &RepositoryRelease{\n\t\tTagName:                Ptr(\"tn\"),\n\t\tTargetCommitish:        Ptr(\"tc\"),\n\t\tName:                   Ptr(\"name\"),\n\t\tBody:                   Ptr(\"body\"),\n\t\tDraft:                  Ptr(false),\n\t\tPrerelease:             Ptr(false),\n\t\tMakeLatest:             Ptr(\"legacy\"),\n\t\tDiscussionCategoryName: Ptr(\"dcn\"),\n\t\tID:                     Ptr(int64(1)),\n\t\tCreatedAt:              &Timestamp{referenceTime},\n\t\tPublishedAt:            &Timestamp{referenceTime},\n\t\tURL:                    Ptr(\"url\"),\n\t\tHTMLURL:                Ptr(\"hurl\"),\n\t\tAssetsURL:              Ptr(\"aurl\"),\n\t\tAssets:                 []*ReleaseAsset{{ID: Ptr(int64(1))}},\n\t\tUploadURL:              Ptr(\"uurl\"),\n\t\tZipballURL:             Ptr(\"zurl\"),\n\t\tTarballURL:             Ptr(\"turl\"),\n\t\tAuthor:                 &User{ID: Ptr(int64(1))},\n\t\tNodeID:                 Ptr(\"nid\"),\n\t\tImmutable:              Ptr(true),\n\t}\n\n\twant := `{\n\t\t\"tag_name\": \"tn\",\n\t\t\"target_commitish\": \"tc\",\n\t\t\"name\": \"name\",\n\t\t\"body\": \"body\",\n\t\t\"draft\": false,\n\t\t\"prerelease\": false,\n\t\t\"make_latest\": \"legacy\",\n\t\t\"discussion_category_name\": \"dcn\",\n\t\t\"id\": 1,\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"published_at\": ` + referenceTimeStr + `,\n\t\t\"url\": \"url\",\n\t\t\"html_url\": \"hurl\",\n\t\t\"assets_url\": \"aurl\",\n\t\t\"assets\": [\n\t\t\t{\n\t\t\t\t\"id\": 1\n\t\t\t}\n\t\t],\n\t\t\"upload_url\": \"uurl\",\n\t\t\"zipball_url\": \"zurl\",\n\t\t\"tarball_url\": \"turl\",\n\t\t\"author\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"node_id\": \"nid\",\n\t\t\"immutable\": true\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestGenerateNotesOptions_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &GenerateNotesOptions{}, `{\"tag_name\": \"\"}`)\n\n\tu := &GenerateNotesOptions{\n\t\tTagName:               \"tag_name\",\n\t\tPreviousTagName:       Ptr(\"previous_tag_name\"),\n\t\tTargetCommitish:       Ptr(\"target_commitish\"),\n\t\tConfigurationFilePath: Ptr(\"configuration_file_path\"),\n\t}\n\n\twant := `{\n\t\t\"tag_name\":               \"tag_name\",\n\t\t\"previous_tag_name\":      \"previous_tag_name\",\n\t\t\"target_commitish\":       \"target_commitish\",\n\t\t\"configuration_file_path\": \"configuration_file_path\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestRepositoriesService_UploadReleaseAssetFromRelease(t *testing.T) {\n\tt.Parallel()\n\n\tvar (\n\t\tdefaultUploadOptions     = &UploadOptions{Name: \"n.txt\"}\n\t\tdefaultExpectedFormValue = values{\"name\": \"n.txt\"}\n\t\tmediaTypeTextPlain       = \"text/plain; charset=utf-8\"\n\t)\n\n\tclient, mux, _ := setup(t)\n\n\t// Use the same endpoint path used in other release asset tests.\n\tmux.HandleFunc(\"/repos/o/r/releases/1/assets\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Content-Type\", mediaTypeTextPlain)\n\t\ttestHeader(t, r, \"Content-Length\", \"12\")\n\t\ttestFormValues(t, r, defaultExpectedFormValue)\n\t\ttestBody(t, r, \"Upload me !\\n\")\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tbody := []byte(\"Upload me !\\n\")\n\treader := bytes.NewReader(body)\n\tsize := int64(len(body))\n\n\t// Provide a templated upload URL like GitHub returns.\n\tuploadURL := \"/repos/o/r/releases/1/assets{?name,label}\"\n\trelease := &RepositoryRelease{\n\t\tUploadURL: &uploadURL,\n\t}\n\n\tctx := t.Context()\n\tasset, _, err := client.Repositories.UploadReleaseAssetFromRelease(ctx, release, defaultUploadOptions, reader, size)\n\tif err != nil {\n\t\tt.Fatalf(\"Repositories.UploadReleaseAssetFromRelease returned error: %v\", err)\n\t}\n\twant := &ReleaseAsset{ID: Ptr(int64(1))}\n\tif !cmp.Equal(asset, want) {\n\t\tt.Fatalf(\"Repositories.UploadReleaseAssetFromRelease returned %+v, want %+v\", asset, want)\n\t}\n}\n\nfunc TestRepositoriesService_UploadReleaseAssetFromRelease_AbsoluteTemplate(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/releases/1/assets\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestFormValues(t, r, values{\"name\": \"abs.txt\"})\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tbody := []byte(\"Upload me !\\n\")\n\treader := bytes.NewReader(body)\n\tsize := int64(len(body))\n\n\t// Build an absolute URL using the test client's BaseURL.\n\tabsoluteUploadURL := client.BaseURL.String() + \"repos/o/r/releases/1/assets{?name,label}\"\n\trelease := &RepositoryRelease{UploadURL: &absoluteUploadURL}\n\n\topts := &UploadOptions{Name: \"abs.txt\"}\n\tctx := t.Context()\n\tasset, _, err := client.Repositories.UploadReleaseAssetFromRelease(ctx, release, opts, reader, size)\n\tif err != nil {\n\t\tt.Fatalf(\"UploadReleaseAssetFromRelease returned error: %v\", err)\n\t}\n\twant := &ReleaseAsset{ID: Ptr(int64(1))}\n\tif !cmp.Equal(asset, want) {\n\t\tt.Fatalf(\"UploadReleaseAssetFromRelease returned %+v, want %+v\", asset, want)\n\t}\n}\n\nfunc TestRepositoriesService_UploadReleaseAssetFromRelease_NilRelease(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tbody := []byte(\"Upload me !\\n\")\n\treader := bytes.NewReader(body)\n\tsize := int64(len(body))\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.UploadReleaseAssetFromRelease(ctx, nil, &UploadOptions{Name: \"n.txt\"}, reader, size)\n\tif err == nil {\n\t\tt.Fatal(\"expected error for nil release, got nil\")\n\t}\n\n\tconst methodName = \"UploadReleaseAssetFromRelease\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.UploadReleaseAssetFromRelease(ctx, nil, &UploadOptions{Name: \"n.txt\"}, reader, size)\n\t\treturn err\n\t})\n}\n\nfunc TestRepositoriesService_UploadReleaseAssetFromRelease_NilReader(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tuploadURL := \"/repos/o/r/releases/1/assets{?name,label}\"\n\trelease := &RepositoryRelease{UploadURL: &uploadURL}\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.UploadReleaseAssetFromRelease(ctx, release, &UploadOptions{Name: \"n.txt\"}, nil, 12)\n\tif err == nil {\n\t\tt.Fatal(\"expected error when reader is nil\")\n\t}\n\n\tconst methodName = \"UploadReleaseAssetFromRelease\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.UploadReleaseAssetFromRelease(ctx, release, &UploadOptions{Name: \"n.txt\"}, nil, 12)\n\t\treturn err\n\t})\n}\n\nfunc TestRepositoriesService_UploadReleaseAssetFromRelease_NegativeSize(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tuploadURL := \"/repos/o/r/releases/1/assets{?name,label}\"\n\trelease := &RepositoryRelease{UploadURL: &uploadURL}\n\n\tbody := []byte(\"Upload me !\\n\")\n\treader := bytes.NewReader(body)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.UploadReleaseAssetFromRelease(ctx, release, &UploadOptions{Name: \"n..txt\"}, reader, -1)\n\tif err == nil {\n\t\tt.Fatal(\"expected error when size is negative\")\n\t}\n}\n\nfunc TestRepositoriesService_UploadReleaseAssetFromRelease_NoOpts(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\t// No opts: we just assert that the handler is hit and body is as expected.\n\tmux.HandleFunc(\"/repos/o/r/releases/1/assets\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestBody(t, r, \"Upload me !\\n\")\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tbody := []byte(\"Upload me !\\n\")\n\treader := bytes.NewReader(body)\n\tsize := int64(len(body))\n\n\tuploadURL := \"/repos/o/r/releases/1/assets{?name,label}\"\n\trelease := &RepositoryRelease{UploadURL: &uploadURL}\n\n\tctx := t.Context()\n\tasset, _, err := client.Repositories.UploadReleaseAssetFromRelease(ctx, release, nil, reader, size)\n\tif err != nil {\n\t\tt.Fatalf(\"unexpected error: %v\", err)\n\t}\n\twant := &ReleaseAsset{ID: Ptr(int64(1))}\n\tif !cmp.Equal(asset, want) {\n\t\tt.Fatalf(\"Repositories.UploadReleaseAssetFromRelease returned %+v, want %+v\", asset, want)\n\t}\n\n\tconst methodName = \"UploadReleaseAssetFromRelease\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.UploadReleaseAssetFromRelease(ctx, release, nil, reader, size)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_UploadReleaseAssetFromRelease_WithMediaType(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\t// Expect explicit media type to be used.\n\tmux.HandleFunc(\"/repos/o/r/releases/1/assets\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Content-Type\", \"image/png\")\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tbody := []byte(\"Binary!\")\n\treader := bytes.NewReader(body)\n\tsize := int64(len(body))\n\n\tuploadURL := \"/repos/o/r/releases/1/assets{?name,label}\"\n\trelease := &RepositoryRelease{UploadURL: &uploadURL}\n\n\topts := &UploadOptions{Name: \"n.txt\", MediaType: \"image/png\"}\n\n\tctx := t.Context()\n\tasset, _, err := client.Repositories.UploadReleaseAssetFromRelease(ctx, release, opts, reader, size)\n\tif err != nil {\n\t\tt.Fatalf(\"unexpected error: %v\", err)\n\t}\n\twant := &ReleaseAsset{ID: Ptr(int64(1))}\n\tif !cmp.Equal(asset, want) {\n\t\tt.Fatalf(\"UploadReleaseAssetFromRelease returned %+v, want %+v\", asset, want)\n\t}\n}\n"
  },
  {
    "path": "github/repos_rules.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// GetRulesForBranch gets all the repository rules that apply to the specified branch.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/rules#get-rules-for-a-branch\n//\n//meta:operation GET /repos/{owner}/{repo}/rules/branches/{branch}\nfunc (s *RepositoriesService) GetRulesForBranch(ctx context.Context, owner, repo, branch string, opts *ListOptions) (*BranchRules, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/rules/branches/%v\", owner, repo, branch)\n\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar rules *BranchRules\n\tresp, err := s.client.Do(ctx, req, &rules)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn rules, resp, nil\n}\n\n// RepositoryListRulesetsOptions specifies optional parameters to the\n// RepositoriesService.GetAllRulesets method.\ntype RepositoryListRulesetsOptions struct {\n\t// IncludesParents indicates whether to include rulesets configured at the organization or enterprise level that apply to the repository.\n\tIncludesParents *bool `url:\"includes_parents,omitempty\"`\n\tListOptions\n}\n\n// GetAllRulesets gets all the repository rulesets for the specified repository.\n// By default, this endpoint will include rulesets configured at the organization or enterprise level that apply to the repository.\n// To exclude those rulesets, set the `RepositoryListRulesetsOptions.IncludesParents` parameter to `false`.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets\n//\n//meta:operation GET /repos/{owner}/{repo}/rulesets\nfunc (s *RepositoriesService) GetAllRulesets(ctx context.Context, owner, repo string, opts *RepositoryListRulesetsOptions) ([]*RepositoryRuleset, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/rulesets\", owner, repo)\n\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar ruleset []*RepositoryRuleset\n\tresp, err := s.client.Do(ctx, req, &ruleset)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn ruleset, resp, nil\n}\n\n// CreateRuleset creates a repository ruleset for the specified repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset\n//\n//meta:operation POST /repos/{owner}/{repo}/rulesets\nfunc (s *RepositoriesService) CreateRuleset(ctx context.Context, owner, repo string, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/rulesets\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"POST\", u, ruleset)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar rs *RepositoryRuleset\n\tresp, err := s.client.Do(ctx, req, &rs)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn rs, resp, nil\n}\n\n// GetRuleset gets a repository ruleset for the specified repository.\n// If includesParents is true, rulesets configured at the organization or enterprise level that apply to the repository will be returned.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/rules#get-a-repository-ruleset\n//\n//meta:operation GET /repos/{owner}/{repo}/rulesets/{ruleset_id}\nfunc (s *RepositoriesService) GetRuleset(ctx context.Context, owner, repo string, rulesetID int64, includesParents bool) (*RepositoryRuleset, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/rulesets/%v?includes_parents=%v\", owner, repo, rulesetID, includesParents)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar ruleset *RepositoryRuleset\n\tresp, err := s.client.Do(ctx, req, &ruleset)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn ruleset, resp, nil\n}\n\n// UpdateRuleset updates a repository ruleset for the specified repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset\n//\n//meta:operation PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}\nfunc (s *RepositoriesService) UpdateRuleset(ctx context.Context, owner, repo string, rulesetID int64, ruleset RepositoryRuleset) (*RepositoryRuleset, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/rulesets/%v\", owner, repo, rulesetID)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, ruleset)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar rs *RepositoryRuleset\n\tresp, err := s.client.Do(ctx, req, &rs)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn rs, resp, nil\n}\n\n// DeleteRuleset deletes a repository ruleset for the specified repository.\n//\n// GitHub API docs: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset\n//\n//meta:operation DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}\nfunc (s *RepositoriesService) DeleteRuleset(ctx context.Context, owner, repo string, rulesetID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/rulesets/%v\", owner, repo, rulesetID)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/repos_rules_test.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_GetRulesForBranch(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/repo/rules/branches/branch\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[\n\t\t\t{\n\t\t\t  \"ruleset_id\": 42069,\n\t\t\t  \"ruleset_source_type\": \"Repository\",\n\t\t\t  \"ruleset_source\": \"google/a\",\n\t\t\t  \"type\": \"creation\"\n\t\t\t},\n\t\t\t{\n\t\t\t  \"ruleset_id\": 42069,\n\t\t\t  \"ruleset_source_type\": \"Organization\",\n\t\t\t  \"ruleset_source\": \"google\",\n\t\t\t  \"type\": \"update\",\n\t\t\t  \"parameters\": {\n\t\t\t    \"update_allows_fetch_and_merge\": true\n\t\t\t  }\n\t\t\t}\n\t\t]`)\n\t})\n\n\tctx := t.Context()\n\trules, _, err := client.Repositories.GetRulesForBranch(ctx, \"o\", \"repo\", \"branch\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetRulesForBranch returned error: %v\", err)\n\t}\n\n\twant := &BranchRules{\n\t\tCreation: []*BranchRuleMetadata{{RulesetSourceType: RulesetSourceTypeRepository, RulesetSource: \"google/a\", RulesetID: 42069}},\n\t\tUpdate:   []*UpdateBranchRule{{BranchRuleMetadata: BranchRuleMetadata{RulesetSourceType: RulesetSourceTypeOrganization, RulesetSource: \"google\", RulesetID: 42069}, Parameters: UpdateRuleParameters{UpdateAllowsFetchAndMerge: true}}},\n\t}\n\n\tif !cmp.Equal(rules, want) {\n\t\tt.Errorf(\"Repositories.GetRulesForBranch returned %+v, want %+v\", rules, want)\n\t}\n\n\tconst methodName = \"GetRulesForBranch\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetRulesForBranch(ctx, \"o\", \"repo\", \"branch\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_UpdateRuleset_OmitZero_Nil(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/repo/rulesets/42\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\n\t\tvar v map[string]any\n\t\tif err := json.NewDecoder(r.Body).Decode(&v); err != nil {\n\t\t\tt.Errorf(\"could not decode body: %v\", err)\n\t\t}\n\n\t\tif _, ok := v[\"bypass_actors\"]; ok {\n\t\t\tt.Error(\"Request body contained 'bypass_actors', expected it to be omitted for nil input\")\n\t\t}\n\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 42,\n\t\t\t\"name\": \"ruleset\",\n\t\t\t\"source\": \"o/repo\",\n\t\t\t\"enforcement\": \"active\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tinput := RepositoryRuleset{\n\t\tName:         \"ruleset\",\n\t\tEnforcement:  RulesetEnforcementActive,\n\t\tBypassActors: nil,\n\t}\n\n\t_, _, err := client.Repositories.UpdateRuleset(ctx, \"o\", \"repo\", 42, input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.UpdateRuleset returned error: %v\", err)\n\t}\n}\n\nfunc TestRepositoriesService_UpdateRuleset_OmitZero_EmptySlice(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\t// Scenario 2: User passes empty slice (non-zero value).\n\tmux.HandleFunc(\"/repos/o/repo/rulesets/42\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\n\t\ttestBody(t, r, `{\"name\":\"ruleset\",\"source\":\"\",\"enforcement\":\"active\",\"bypass_actors\":[]}`+\"\\n\")\n\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 42,\n\t\t\t\"name\": \"ruleset\",\n\t\t\t\"source\": \"o/repo\",\n\t\t\t\"enforcement\": \"active\",\n\t\t\t\"bypass_actors\": []\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tinput := RepositoryRuleset{\n\t\tName:         \"ruleset\",\n\t\tEnforcement:  RulesetEnforcementActive,\n\t\tBypassActors: []*BypassActor{},\n\t}\n\n\t_, _, err := client.Repositories.UpdateRuleset(ctx, \"o\", \"repo\", 42, input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.UpdateRuleset returned error: %v\", err)\n\t}\n}\n\nfunc TestRepositoriesService_GetRulesForBranch_ListOptions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/repo/rules/branches/branch\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\":     \"2\",\n\t\t\t\"per_page\": \"35\",\n\t\t})\n\t\tfmt.Fprint(w, `[\n\t\t\t{\n\t\t\t  \"ruleset_id\": 42069,\n\t\t\t  \"type\": \"creation\"\n\t\t\t}\n\t\t]`)\n\t})\n\n\topts := &ListOptions{Page: 2, PerPage: 35}\n\tctx := t.Context()\n\trules, _, err := client.Repositories.GetRulesForBranch(ctx, \"o\", \"repo\", \"branch\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetRulesForBranch returned error: %v\", err)\n\t}\n\n\twant := &BranchRules{\n\t\tCreation: []*BranchRuleMetadata{{RulesetID: 42069}},\n\t}\n\n\tif !cmp.Equal(rules, want) {\n\t\tt.Errorf(\"Repositories.GetRulesForBranch returned %+v, want %+v\", rules, want)\n\t}\n\n\tconst methodName = \"GetRulesForBranch\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetRulesForBranch(ctx, \"\\n\", \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetRulesForBranch(ctx, \"o\", \"repo\", \"branch\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetAllRulesets(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/repo/rulesets\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprintf(w, `[\n\t\t\t{\n\t\t\t  \"id\": 42,\n\t\t\t  \"name\": \"ruleset\",\n\t\t\t  \"source_type\": \"Repository\",\n\t\t\t  \"source\": \"o/repo\",\n\t\t\t  \"enforcement\": \"active\",\n\t\t\t  \"created_at\": %[1]s,\n\t\t\t  \"updated_at\": %[1]s\n\t\t\t},\n\t\t\t{\n\t\t\t  \"id\": 314,\n\t\t\t  \"name\": \"Another ruleset\",\n\t\t\t  \"source_type\": \"Repository\",\n\t\t\t  \"source\": \"o/repo\",\n\t\t\t  \"enforcement\": \"active\",\n\t\t\t  \"created_at\": %[1]s,\n\t\t\t  \"updated_at\": %[1]s\n\t\t\t}\n\t\t]`, referenceTimeStr)\n\t})\n\n\tctx := t.Context()\n\truleSet, _, err := client.Repositories.GetAllRulesets(ctx, \"o\", \"repo\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetAllRulesets returned error: %v\", err)\n\t}\n\n\twant := []*RepositoryRuleset{\n\t\t{\n\t\t\tID:          Ptr(int64(42)),\n\t\t\tName:        \"ruleset\",\n\t\t\tSourceType:  Ptr(RulesetSourceTypeRepository),\n\t\t\tSource:      \"o/repo\",\n\t\t\tEnforcement: RulesetEnforcementActive,\n\t\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\t\tUpdatedAt:   &Timestamp{referenceTime},\n\t\t},\n\t\t{\n\t\t\tID:          Ptr(int64(314)),\n\t\t\tName:        \"Another ruleset\",\n\t\t\tSourceType:  Ptr(RulesetSourceTypeRepository),\n\t\t\tSource:      \"o/repo\",\n\t\t\tEnforcement: RulesetEnforcementActive,\n\t\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\t\tUpdatedAt:   &Timestamp{referenceTime},\n\t\t},\n\t}\n\tif !cmp.Equal(ruleSet, want) {\n\t\tt.Errorf(\"Repositories.GetAllRulesets returned %+v, want %+v\", ruleSet, want)\n\t}\n\n\tconst methodName = \"GetAllRulesets\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetAllRulesets(ctx, \"o\", \"repo\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetAllRulesets_ListOptions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/repo/rulesets\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"includes_parents\": \"false\",\n\t\t\t\"page\":             \"2\",\n\t\t\t\"per_page\":         \"35\",\n\t\t})\n\t\tfmt.Fprint(w, `[\n\t\t\t{\n\t\t\t  \"id\": 42\n\t\t\t}\n\t\t]`)\n\t})\n\n\topts := &RepositoryListRulesetsOptions{\n\t\tIncludesParents: Ptr(false),\n\t\tListOptions: ListOptions{\n\t\t\tPage:    2,\n\t\t\tPerPage: 35,\n\t\t},\n\t}\n\tctx := t.Context()\n\truleSet, _, err := client.Repositories.GetAllRulesets(ctx, \"o\", \"repo\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetAllRulesets returned error: %v\", err)\n\t}\n\n\twant := []*RepositoryRuleset{\n\t\t{\n\t\t\tID: Ptr(int64(42)),\n\t\t},\n\t}\n\tif !cmp.Equal(ruleSet, want) {\n\t\tt.Errorf(\"Repositories.GetAllRulesets returned %+v, want %+v\", ruleSet, want)\n\t}\n\n\tconst methodName = \"GetAllRulesets\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetAllRulesets(ctx, \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetAllRulesets(ctx, \"o\", \"repo\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_CreateRuleset(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/repo/rulesets\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 42,\n\t\t\t\"name\": \"ruleset\",\n\t\t\t\"source_type\": \"Repository\",\n\t\t\t\"source\": \"o/repo\",\n\t\t\t\"enforcement\": \"active\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\truleSet, _, err := client.Repositories.CreateRuleset(ctx, \"o\", \"repo\", RepositoryRuleset{\n\t\tName:        \"ruleset\",\n\t\tEnforcement: RulesetEnforcementActive,\n\t})\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.CreateRuleset returned error: %v\", err)\n\t}\n\n\twant := &RepositoryRuleset{\n\t\tID:          Ptr(int64(42)),\n\t\tName:        \"ruleset\",\n\t\tSourceType:  Ptr(RulesetSourceTypeRepository),\n\t\tSource:      \"o/repo\",\n\t\tEnforcement: RulesetEnforcementActive,\n\t}\n\tif !cmp.Equal(ruleSet, want) {\n\t\tt.Errorf(\"Repositories.CreateRuleset returned %+v, want %+v\", ruleSet, want)\n\t}\n\n\tconst methodName = \"CreateRuleset\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.CreateRuleset(ctx, \"o\", \"repo\", RepositoryRuleset{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_CreateRulesetWithPushRules(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/repo/rulesets\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 42,\n\t\t\t\"name\": \"ruleset\",\n\t\t\t\"source_type\": \"Repository\",\n\t\t\t\"source\": \"o/repo\",\n\t\t\t\"enforcement\": \"active\",\n\t\t\t\"target\": \"push\",\n\t\t\t\"rules\": [\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"file_path_restriction\",\n\t\t\t\t\t\"parameters\": {\n\t\t\t\t\t\t\"restricted_file_paths\": [\"/a/file\"]\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"max_file_path_length\",\n\t\t\t\t\t\"parameters\": {\n\t\t\t\t\t\t\"max_file_path_length\": 255\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"file_extension_restriction\",\n\t\t\t\t\t\"parameters\": {\n\t\t\t\t\t\t\"restricted_file_extensions\": [\".exe\"]\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"max_file_size\",\n\t\t\t\t\t\"parameters\": {\n\t\t\t\t\t\t\"max_file_size\": 1024\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\truleSet, _, err := client.Repositories.CreateRuleset(ctx, \"o\", \"repo\", RepositoryRuleset{\n\t\tName:        \"ruleset\",\n\t\tEnforcement: RulesetEnforcementActive,\n\t})\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.CreateRuleset returned error: %v\", err)\n\t}\n\n\twant := &RepositoryRuleset{\n\t\tID:          Ptr(int64(42)),\n\t\tName:        \"ruleset\",\n\t\tSourceType:  Ptr(RulesetSourceTypeRepository),\n\t\tSource:      \"o/repo\",\n\t\tTarget:      Ptr(RulesetTargetPush),\n\t\tEnforcement: RulesetEnforcementActive,\n\t\tRules: &RepositoryRulesetRules{\n\t\t\tFilePathRestriction:      &FilePathRestrictionRuleParameters{RestrictedFilePaths: []string{\"/a/file\"}},\n\t\t\tMaxFilePathLength:        &MaxFilePathLengthRuleParameters{MaxFilePathLength: 255},\n\t\t\tFileExtensionRestriction: &FileExtensionRestrictionRuleParameters{RestrictedFileExtensions: []string{\".exe\"}},\n\t\t\tMaxFileSize:              &MaxFileSizeRuleParameters{MaxFileSize: 1024},\n\t\t},\n\t}\n\tif !cmp.Equal(ruleSet, want) {\n\t\tt.Errorf(\"Repositories.CreateRuleset returned %+v, want %+v\", ruleSet, want)\n\t}\n\n\tconst methodName = \"CreateRuleset\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.CreateRuleset(ctx, \"o\", \"repo\", RepositoryRuleset{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetRuleset(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/repo/rulesets/42\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 42,\n\t\t\t\"name\": \"ruleset\",\n\t\t\t\"source_type\": \"Organization\",\n\t\t\t\"source\": \"o\",\n\t\t\t\"enforcement\": \"active\",\n\t\t\t\"created_at\": `+referenceTimeStr+`,\n\t\t\t\"updated_at\": `+referenceTimeStr+`\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\truleSet, _, err := client.Repositories.GetRuleset(ctx, \"o\", \"repo\", 42, true)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetRuleset returned error: %v\", err)\n\t}\n\n\twant := &RepositoryRuleset{\n\t\tID:          Ptr(int64(42)),\n\t\tName:        \"ruleset\",\n\t\tSourceType:  Ptr(RulesetSourceTypeOrganization),\n\t\tSource:      \"o\",\n\t\tEnforcement: RulesetEnforcementActive,\n\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\tUpdatedAt:   &Timestamp{referenceTime},\n\t}\n\tif !cmp.Equal(ruleSet, want) {\n\t\tt.Errorf(\"Repositories.GetRuleset returned %+v, want %+v\", ruleSet, want)\n\t}\n\n\tconst methodName = \"GetRuleset\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetRuleset(ctx, \"o\", \"repo\", 42, true)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_UpdateRuleset(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/repo/rulesets/42\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 42,\n\t\t\t\"name\": \"ruleset\",\n\t\t\t\"source_type\": \"Repository\",\n\t\t\t\"source\": \"o/repo\",\n\t\t\t\"enforcement\": \"active\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\truleSet, _, err := client.Repositories.UpdateRuleset(ctx, \"o\", \"repo\", 42, RepositoryRuleset{\n\t\tName:        \"ruleset\",\n\t\tEnforcement: RulesetEnforcementActive,\n\t})\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.UpdateRuleset returned error: %v\", err)\n\t}\n\n\twant := &RepositoryRuleset{\n\t\tID:          Ptr(int64(42)),\n\t\tName:        \"ruleset\",\n\t\tSourceType:  Ptr(RulesetSourceTypeRepository),\n\t\tSource:      \"o/repo\",\n\t\tEnforcement: \"active\",\n\t}\n\n\tif !cmp.Equal(ruleSet, want) {\n\t\tt.Errorf(\"Repositories.UpdateRuleset returned %+v, want %+v\", ruleSet, want)\n\t}\n\n\tconst methodName = \"UpdateRuleset\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.UpdateRuleset(ctx, \"o\", \"repo\", 42, RepositoryRuleset{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_DeleteRuleset(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/repo/rulesets/42\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Repositories.DeleteRuleset(ctx, \"o\", \"repo\", 42)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.DeleteRuleset returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteRuleset\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.DeleteRuleset(ctx, \"o\", \"repo\", 42)\n\t})\n}\n"
  },
  {
    "path": "github/repos_stats.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n)\n\n// ContributorStats represents a contributor to a repository and their\n// weekly contributions to a given repo.\ntype ContributorStats struct {\n\tAuthor *Contributor   `json:\"author,omitempty\"`\n\tTotal  *int           `json:\"total,omitempty\"`\n\tWeeks  []*WeeklyStats `json:\"weeks,omitempty\"`\n}\n\nfunc (c ContributorStats) String() string {\n\treturn Stringify(c)\n}\n\n// WeeklyStats represents the number of additions, deletions and commits\n// a Contributor made in a given week.\ntype WeeklyStats struct {\n\tWeek      *Timestamp `json:\"w,omitempty\"`\n\tAdditions *int       `json:\"a,omitempty\"`\n\tDeletions *int       `json:\"d,omitempty\"`\n\tCommits   *int       `json:\"c,omitempty\"`\n}\n\nfunc (w WeeklyStats) String() string {\n\treturn Stringify(w)\n}\n\n// ListContributorsStats gets a repo's contributor list with additions,\n// deletions and commit counts.\n//\n// If this is the first time these statistics are requested for the given\n// repository, this method will return an *AcceptedError and a status code of\n// 202. This is because this is the status that GitHub returns to signify that\n// it is now computing the requested statistics. A follow up request, after a\n// delay of a second or so, should result in a successful request.\n//\n// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-all-contributor-commit-activity\n//\n//meta:operation GET /repos/{owner}/{repo}/stats/contributors\nfunc (s *RepositoriesService) ListContributorsStats(ctx context.Context, owner, repo string) ([]*ContributorStats, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/stats/contributors\", owner, repo)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar contributorStats []*ContributorStats\n\tresp, err := s.client.Do(ctx, req, &contributorStats)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn contributorStats, resp, nil\n}\n\n// WeeklyCommitActivity represents the weekly commit activity for a repository.\n// The days array is a group of commits per day, starting on Sunday.\ntype WeeklyCommitActivity struct {\n\tDays  []int      `json:\"days,omitempty\"`\n\tTotal *int       `json:\"total,omitempty\"`\n\tWeek  *Timestamp `json:\"week,omitempty\"`\n}\n\nfunc (w WeeklyCommitActivity) String() string {\n\treturn Stringify(w)\n}\n\n// ListCommitActivity returns the last year of commit activity\n// grouped by week. The days array is a group of commits per day,\n// starting on Sunday.\n//\n// If this is the first time these statistics are requested for the given\n// repository, this method will return an *AcceptedError and a status code of\n// 202. This is because this is the status that GitHub returns to signify that\n// it is now computing the requested statistics. A follow up request, after a\n// delay of a second or so, should result in a successful request.\n//\n// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-the-last-year-of-commit-activity\n//\n//meta:operation GET /repos/{owner}/{repo}/stats/commit_activity\nfunc (s *RepositoriesService) ListCommitActivity(ctx context.Context, owner, repo string) ([]*WeeklyCommitActivity, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/stats/commit_activity\", owner, repo)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar weeklyCommitActivity []*WeeklyCommitActivity\n\tresp, err := s.client.Do(ctx, req, &weeklyCommitActivity)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn weeklyCommitActivity, resp, nil\n}\n\n// ListCodeFrequency returns a weekly aggregate of the number of additions and\n// deletions pushed to a repository. Returned WeeklyStats will contain\n// additions and deletions, but not total commits.\n//\n// If this is the first time these statistics are requested for the given\n// repository, this method will return an *AcceptedError and a status code of\n// 202. This is because this is the status that GitHub returns to signify that\n// it is now computing the requested statistics. A follow up request, after a\n// delay of a second or so, should result in a successful request.\n//\n// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-activity\n//\n//meta:operation GET /repos/{owner}/{repo}/stats/code_frequency\nfunc (s *RepositoriesService) ListCodeFrequency(ctx context.Context, owner, repo string) ([]*WeeklyStats, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/stats/code_frequency\", owner, repo)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar weeks [][]int\n\tresp, err := s.client.Do(ctx, req, &weeks)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\t// convert int slices into WeeklyStats\n\tvar stats []*WeeklyStats\n\tfor _, week := range weeks {\n\t\tif len(week) != 3 {\n\t\t\tcontinue\n\t\t}\n\t\tstat := &WeeklyStats{\n\t\t\tWeek:      &Timestamp{time.Unix(int64(week[0]), 0)},\n\t\t\tAdditions: Ptr(week[1]),\n\t\t\tDeletions: Ptr(week[2]),\n\t\t}\n\t\tstats = append(stats, stat)\n\t}\n\n\treturn stats, resp, nil\n}\n\n// RepositoryParticipation is the number of commits by everyone\n// who has contributed to the repository (including the owner)\n// as well as the number of commits by the owner themselves.\ntype RepositoryParticipation struct {\n\tAll   []int `json:\"all,omitempty\"`\n\tOwner []int `json:\"owner,omitempty\"`\n}\n\nfunc (r RepositoryParticipation) String() string {\n\treturn Stringify(r)\n}\n\n// ListParticipation returns the total commit counts for the 'owner'\n// and total commit counts in 'all'. 'all' is everyone combined,\n// including the 'owner' in the last 52 weeks. If you’d like to get\n// the commit counts for non-owners, you can subtract 'all' from 'owner'.\n//\n// The array order is oldest week (index 0) to most recent week.\n//\n// If this is the first time these statistics are requested for the given\n// repository, this method will return an *AcceptedError and a status code of\n// 202. This is because this is the status that GitHub returns to signify that\n// it is now computing the requested statistics. A follow up request, after a\n// delay of a second or so, should result in a successful request.\n//\n// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-count\n//\n//meta:operation GET /repos/{owner}/{repo}/stats/participation\nfunc (s *RepositoriesService) ListParticipation(ctx context.Context, owner, repo string) (*RepositoryParticipation, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/stats/participation\", owner, repo)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar participation *RepositoryParticipation\n\tresp, err := s.client.Do(ctx, req, &participation)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn participation, resp, nil\n}\n\n// PunchCard represents the number of commits made during a given hour of a\n// day of the week.\ntype PunchCard struct {\n\tDay     *int // Day of the week (0-6: =Sunday - Saturday).\n\tHour    *int // Hour of day (0-23).\n\tCommits *int // Number of commits.\n}\n\n// ListPunchCard returns the number of commits per hour in each day.\n//\n// If this is the first time these statistics are requested for the given\n// repository, this method will return an *AcceptedError and a status code of\n// 202. This is because this is the status that GitHub returns to signify that\n// it is now computing the requested statistics. A follow up request, after a\n// delay of a second or so, should result in a successful request.\n//\n// GitHub API docs: https://docs.github.com/rest/metrics/statistics#get-the-hourly-commit-count-for-each-day\n//\n//meta:operation GET /repos/{owner}/{repo}/stats/punch_card\nfunc (s *RepositoriesService) ListPunchCard(ctx context.Context, owner, repo string) ([]*PunchCard, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/stats/punch_card\", owner, repo)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar results [][]int\n\tresp, err := s.client.Do(ctx, req, &results)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\t// convert int slices into Punchcards\n\tvar cards []*PunchCard\n\tfor _, result := range results {\n\t\tif len(result) != 3 {\n\t\t\tcontinue\n\t\t}\n\t\tcard := &PunchCard{\n\t\t\tDay:     Ptr(result[0]),\n\t\t\tHour:    Ptr(result[1]),\n\t\t\tCommits: Ptr(result[2]),\n\t\t}\n\t\tcards = append(cards, card)\n\t}\n\n\treturn cards, resp, nil\n}\n"
  },
  {
    "path": "github/repos_stats_test.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_ListContributorsStats(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/stats/contributors\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\n\t\tfmt.Fprint(w, `\n[\n  {\n    \"author\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"nodeid-1\"\n    },\n    \"total\": 135,\n    \"weeks\": [\n      {\n        \"w\": 1367712000,\n        \"a\": 6898,\n        \"d\": 77,\n        \"c\": 10\n      }\n    ]\n  }\n]\n`)\n\t})\n\n\tctx := t.Context()\n\tstats, _, err := client.Repositories.ListContributorsStats(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"RepositoriesService.ListContributorsStats returned error: %v\", err)\n\t}\n\n\twant := []*ContributorStats{\n\t\t{\n\t\t\tAuthor: &Contributor{\n\t\t\t\tID:     Ptr(int64(1)),\n\t\t\t\tNodeID: Ptr(\"nodeid-1\"),\n\t\t\t},\n\t\t\tTotal: Ptr(135),\n\t\t\tWeeks: []*WeeklyStats{\n\t\t\t\t{\n\t\t\t\t\tWeek:      &Timestamp{time.Date(2013, time.May, 5, 0, 0, 0, 0, time.UTC).Local()},\n\t\t\t\t\tAdditions: Ptr(6898),\n\t\t\t\t\tDeletions: Ptr(77),\n\t\t\t\t\tCommits:   Ptr(10),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(stats, want) {\n\t\tt.Errorf(\"RepositoriesService.ListContributorsStats returned %+v, want %+v\", stats, want)\n\t}\n\n\tconst methodName = \"ListContributorsStats\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListContributorsStats(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListContributorsStats(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListCommitActivity(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/stats/commit_activity\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\n\t\tfmt.Fprint(w, `\n[\n  {\n    \"days\": [0, 3, 26, 20, 39, 1, 0],\n    \"total\": 89,\n    \"week\": 1336280400\n  }\n]\n`)\n\t})\n\n\tctx := t.Context()\n\tactivity, _, err := client.Repositories.ListCommitActivity(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"RepositoriesService.ListCommitActivity returned error: %v\", err)\n\t}\n\n\twant := []*WeeklyCommitActivity{\n\t\t{\n\t\t\tDays:  []int{0, 3, 26, 20, 39, 1, 0},\n\t\t\tTotal: Ptr(89),\n\t\t\tWeek:  &Timestamp{time.Date(2012, time.May, 6, 5, 0, 0, 0, time.UTC).Local()},\n\t\t},\n\t}\n\n\tif !cmp.Equal(activity, want) {\n\t\tt.Errorf(\"RepositoriesService.ListCommitActivity returned %+v, want %+v\", activity, want)\n\t}\n\n\tconst methodName = \"ListCommitActivity\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListCommitActivity(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListCommitActivity(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListCodeFrequency(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/stats/code_frequency\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\n\t\tfmt.Fprint(w, `[[1302998400, 1124, -435]]`)\n\t})\n\n\tctx := t.Context()\n\tcode, _, err := client.Repositories.ListCodeFrequency(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"RepositoriesService.ListCodeFrequency returned error: %v\", err)\n\t}\n\n\twant := []*WeeklyStats{{\n\t\tWeek:      &Timestamp{time.Date(2011, time.April, 17, 0, 0, 0, 0, time.UTC).Local()},\n\t\tAdditions: Ptr(1124),\n\t\tDeletions: Ptr(-435),\n\t}}\n\n\tif !cmp.Equal(code, want) {\n\t\tt.Errorf(\"RepositoriesService.ListCodeFrequency returned %+v, want %+v\", code, want)\n\t}\n\n\tconst methodName = \"ListCodeFrequency\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListCodeFrequency(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListCodeFrequency(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_Participation(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/stats/participation\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\n\t\tfmt.Fprint(w, `\n{\n  \"all\": [\n    11,21,15,2,8,1,8,23,17,21,11,10,33,\n    91,38,34,22,23,32,3,43,87,71,18,13,5,\n    13,16,66,27,12,45,110,117,13,8,18,9,19,\n    26,39,12,20,31,46,91,45,10,24,9,29,7\n  ],\n  \"owner\": [\n    3,2,3,0,2,0,5,14,7,9,1,5,0,\n    48,19,2,0,1,10,2,23,40,35,8,8,2,\n    10,6,30,0,2,9,53,104,3,3,10,4,7,\n    11,21,4,4,22,26,63,11,2,14,1,10,3\n  ]\n}\n`)\n\t})\n\n\tctx := t.Context()\n\tparticipation, _, err := client.Repositories.ListParticipation(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"RepositoriesService.ListParticipation returned error: %v\", err)\n\t}\n\n\twant := &RepositoryParticipation{\n\t\tAll: []int{\n\t\t\t11, 21, 15, 2, 8, 1, 8, 23, 17, 21, 11, 10, 33,\n\t\t\t91, 38, 34, 22, 23, 32, 3, 43, 87, 71, 18, 13, 5,\n\t\t\t13, 16, 66, 27, 12, 45, 110, 117, 13, 8, 18, 9, 19,\n\t\t\t26, 39, 12, 20, 31, 46, 91, 45, 10, 24, 9, 29, 7,\n\t\t},\n\t\tOwner: []int{\n\t\t\t3, 2, 3, 0, 2, 0, 5, 14, 7, 9, 1, 5, 0,\n\t\t\t48, 19, 2, 0, 1, 10, 2, 23, 40, 35, 8, 8, 2,\n\t\t\t10, 6, 30, 0, 2, 9, 53, 104, 3, 3, 10, 4, 7,\n\t\t\t11, 21, 4, 4, 22, 26, 63, 11, 2, 14, 1, 10, 3,\n\t\t},\n\t}\n\n\tif !cmp.Equal(participation, want) {\n\t\tt.Errorf(\"RepositoriesService.ListParticipation returned %+v, want %+v\", participation, want)\n\t}\n\n\tconst methodName = \"ListParticipation\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListParticipation(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListParticipation(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListPunchCard(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/stats/punch_card\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\n\t\tfmt.Fprint(w, `[\n\t\t  [0, 0, 5],\n\t\t  [0, 1, 43],\n\t\t  [0, 2, 21]\n\t\t]`)\n\t})\n\n\tctx := t.Context()\n\tcard, _, err := client.Repositories.ListPunchCard(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"RepositoriesService.ListPunchCard returned error: %v\", err)\n\t}\n\n\twant := []*PunchCard{\n\t\t{Day: Ptr(0), Hour: Ptr(0), Commits: Ptr(5)},\n\t\t{Day: Ptr(0), Hour: Ptr(1), Commits: Ptr(43)},\n\t\t{Day: Ptr(0), Hour: Ptr(2), Commits: Ptr(21)},\n\t}\n\n\tif !cmp.Equal(card, want) {\n\t\tt.Errorf(\"RepositoriesService.ListPunchCard returned %+v, want %+v\", card, want)\n\t}\n\n\tconst methodName = \"ListPunchCard\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListPunchCard(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListPunchCard(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_AcceptedError(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/stats/contributors\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\t// This response indicates the fork will happen asynchronously.\n\t\tw.WriteHeader(http.StatusAccepted)\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tstats, _, err := client.Repositories.ListContributorsStats(ctx, \"o\", \"r\")\n\tif err == nil {\n\t\tt.Error(\"RepositoriesService.AcceptedError should have returned an error\")\n\t}\n\n\tif !errors.As(err, new(*AcceptedError)) {\n\t\tt.Errorf(\"RepositoriesService.AcceptedError returned an AcceptedError: %v\", err)\n\t}\n\n\tif stats != nil {\n\t\tt.Errorf(\"RepositoriesService.AcceptedError expected stats to be nil: %v\", stats)\n\t}\n\n\tconst methodName = \"ListContributorsStats\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListContributorsStats(ctx, \"o\", \"r\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListContributorsStats(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoryParticipation_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RepositoryParticipation{}, \"{}\")\n\n\tu := &RepositoryParticipation{\n\t\tAll:   []int{1},\n\t\tOwner: []int{1},\n\t}\n\n\twant := `{\n\t\t\"all\": [1],\n\t\t\"owner\": [1]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestWeeklyCommitActivity_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &WeeklyCommitActivity{}, \"{}\")\n\n\tu := &WeeklyCommitActivity{\n\t\tDays:  []int{1},\n\t\tTotal: Ptr(1),\n\t\tWeek:  &Timestamp{referenceTime},\n\t}\n\n\twant := `{\n\t\t\"days\": [\n\t\t\t1\n\t\t],\n\t\t\"total\": 1,\n\t\t\"week\": ` + referenceTimeStr + `\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestWeeklyStats_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &WeeklyStats{}, \"{}\")\n\n\tu := &WeeklyStats{\n\t\tWeek:      &Timestamp{referenceTime},\n\t\tAdditions: Ptr(1),\n\t\tDeletions: Ptr(1),\n\t\tCommits:   Ptr(1),\n\t}\n\n\twant := `{\n\t\t\"w\": ` + referenceTimeStr + `,\n\t\t\"a\": 1,\n\t\t\"d\": 1,\n\t\t\"c\": 1\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestContributorStats_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ContributorStats{}, \"{}\")\n\n\tu := &ContributorStats{\n\t\tAuthor: &Contributor{ID: Ptr(int64(1))},\n\t\tTotal:  Ptr(1),\n\t\tWeeks: []*WeeklyStats{\n\t\t\t{\n\t\t\t\tWeek:      &Timestamp{referenceTime},\n\t\t\t\tAdditions: Ptr(1),\n\t\t\t\tDeletions: Ptr(1),\n\t\t\t\tCommits:   Ptr(1),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"author\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"total\": 1,\n\t\t\"weeks\": [\n\t\t\t{\n\t\t\t\t\"w\": ` + referenceTimeStr + `,\n\t\t\t\t\"a\": 1,\n\t\t\t\t\"d\": 1,\n\t\t\t\t\"c\": 1\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/repos_statuses.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// RepoStatus represents the status of a repository at a particular reference.\ntype RepoStatus struct {\n\tID     *int64  `json:\"id,omitempty\"`\n\tNodeID *string `json:\"node_id,omitempty\"`\n\tURL    *string `json:\"url,omitempty\"`\n\n\t// State is the current state of the repository. Possible values are:\n\t// pending, success, error, or failure.\n\tState *string `json:\"state,omitempty\"`\n\n\t// TargetURL is the URL of the page representing this status. It will be\n\t// linked from the GitHub UI to allow users to see the source of the status.\n\tTargetURL *string `json:\"target_url,omitempty\"`\n\n\t// Description is a short high level summary of the status.\n\tDescription *string `json:\"description,omitempty\"`\n\n\t// A string label to differentiate this status from the statuses of other systems.\n\tContext *string `json:\"context,omitempty\"`\n\n\t// AvatarURL is the URL of the avatar of this status.\n\tAvatarURL *string `json:\"avatar_url,omitempty\"`\n\n\tCreator   *User      `json:\"creator,omitempty\"`\n\tCreatedAt *Timestamp `json:\"created_at,omitempty\"`\n\tUpdatedAt *Timestamp `json:\"updated_at,omitempty\"`\n}\n\nfunc (r RepoStatus) String() string {\n\treturn Stringify(r)\n}\n\n// ListStatuses lists the statuses of a repository at the specified\n// reference. The ref can be a SHA, a branch name, or a tag name.\n//\n// GitHub API docs: https://docs.github.com/rest/commits/statuses#list-commit-statuses-for-a-reference\n//\n//meta:operation GET /repos/{owner}/{repo}/commits/{ref}/statuses\nfunc (s *RepositoriesService) ListStatuses(ctx context.Context, owner, repo, ref string, opts *ListOptions) ([]*RepoStatus, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/commits/%v/statuses\", owner, repo, refURLEscape(ref))\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar statuses []*RepoStatus\n\tresp, err := s.client.Do(ctx, req, &statuses)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn statuses, resp, nil\n}\n\n// CreateStatus creates a new status for a repository at the specified\n// reference. The ref can be a SHA, a branch name, or a tag name.\n//\n// GitHub API docs: https://docs.github.com/rest/commits/statuses#create-a-commit-status\n//\n//meta:operation POST /repos/{owner}/{repo}/statuses/{sha}\nfunc (s *RepositoriesService) CreateStatus(ctx context.Context, owner, repo, ref string, status RepoStatus) (*RepoStatus, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/statuses/%v\", owner, repo, refURLEscape(ref))\n\treq, err := s.client.NewRequest(\"POST\", u, &status)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar repoStatus *RepoStatus\n\tresp, err := s.client.Do(ctx, req, &repoStatus)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn repoStatus, resp, nil\n}\n\n// CombinedStatus represents the combined status of a repository at a particular reference.\ntype CombinedStatus struct {\n\t// State is the combined state of the repository. Possible values are:\n\t// failure, pending, or success.\n\tState *string `json:\"state,omitempty\"`\n\n\tName       *string       `json:\"name,omitempty\"`\n\tSHA        *string       `json:\"sha,omitempty\"`\n\tTotalCount *int          `json:\"total_count,omitempty\"`\n\tStatuses   []*RepoStatus `json:\"statuses,omitempty\"`\n\n\tCommitURL     *string `json:\"commit_url,omitempty\"`\n\tRepositoryURL *string `json:\"repository_url,omitempty\"`\n}\n\nfunc (s CombinedStatus) String() string {\n\treturn Stringify(s)\n}\n\n// GetCombinedStatus returns the combined status of a repository at the specified\n// reference. The ref can be a SHA, a branch name, or a tag name.\n//\n// GitHub API docs: https://docs.github.com/rest/commits/statuses#get-the-combined-status-for-a-specific-reference\n//\n//meta:operation GET /repos/{owner}/{repo}/commits/{ref}/status\nfunc (s *RepositoriesService) GetCombinedStatus(ctx context.Context, owner, repo, ref string, opts *ListOptions) (*CombinedStatus, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/commits/%v/status\", owner, repo, refURLEscape(ref))\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar status *CombinedStatus\n\tresp, err := s.client.Do(ctx, req, &status)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn status, resp, nil\n}\n"
  },
  {
    "path": "github/repos_statuses_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_ListStatuses(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/commits/r/statuses\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tstatuses, _, err := client.Repositories.ListStatuses(ctx, \"o\", \"r\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListStatuses returned error: %v\", err)\n\t}\n\n\twant := []*RepoStatus{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(statuses, want) {\n\t\tt.Errorf(\"Repositories.ListStatuses returned %+v, want %+v\", statuses, want)\n\t}\n\n\tconst methodName = \"ListStatuses\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListStatuses(ctx, \"\\n\", \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListStatuses(ctx, \"o\", \"r\", \"r\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListStatuses_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.ListStatuses(ctx, \"%\", \"r\", \"r\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoriesService_CreateStatus(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := RepoStatus{State: Ptr(\"s\"), TargetURL: Ptr(\"t\"), Description: Ptr(\"d\")}\n\n\tmux.HandleFunc(\"/repos/o/r/statuses/r\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *RepoStatus\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, &input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tstatus, _, err := client.Repositories.CreateStatus(ctx, \"o\", \"r\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.CreateStatus returned error: %v\", err)\n\t}\n\n\twant := &RepoStatus{ID: Ptr(int64(1))}\n\tif !cmp.Equal(status, want) {\n\t\tt.Errorf(\"Repositories.CreateStatus returned %+v, want %+v\", status, want)\n\t}\n\n\tconst methodName = \"CreateStatus\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.CreateStatus(ctx, \"\\n\", \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.CreateStatus(ctx, \"o\", \"r\", \"r\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_CreateStatus_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.CreateStatus(ctx, \"%\", \"r\", \"r\", RepoStatus{})\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoriesService_GetCombinedStatus(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/commits/r/status\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `{\"state\":\"success\", \"statuses\":[{\"id\":1}]}`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tstatus, _, err := client.Repositories.GetCombinedStatus(ctx, \"o\", \"r\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetCombinedStatus returned error: %v\", err)\n\t}\n\n\twant := &CombinedStatus{State: Ptr(\"success\"), Statuses: []*RepoStatus{{ID: Ptr(int64(1))}}}\n\tif !cmp.Equal(status, want) {\n\t\tt.Errorf(\"Repositories.GetCombinedStatus returned %+v, want %+v\", status, want)\n\t}\n\n\tconst methodName = \"GetCombinedStatus\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetCombinedStatus(ctx, \"\\n\", \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetCombinedStatus(ctx, \"o\", \"r\", \"r\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepoStatus_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RepoStatus{}, \"{}\")\n\n\tu := &RepoStatus{\n\t\tID:          Ptr(int64(1)),\n\t\tNodeID:      Ptr(\"nid\"),\n\t\tURL:         Ptr(\"url\"),\n\t\tState:       Ptr(\"state\"),\n\t\tTargetURL:   Ptr(\"turl\"),\n\t\tDescription: Ptr(\"desc\"),\n\t\tContext:     Ptr(\"ctx\"),\n\t\tAvatarURL:   Ptr(\"aurl\"),\n\t\tCreator:     &User{ID: Ptr(int64(1))},\n\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\tUpdatedAt:   &Timestamp{referenceTime},\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"node_id\": \"nid\",\n\t\t\"url\": \"url\",\n\t\t\"state\": \"state\",\n\t\t\"target_url\": \"turl\",\n\t\t\"description\": \"desc\",\n\t\t\"context\": \"ctx\",\n\t\t\"avatar_url\": \"aurl\",\n\t\t\"creator\": {\n\t\t\t\"id\": 1\n\t\t},\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestCombinedStatus_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CombinedStatus{}, \"{}\")\n\n\tu := &CombinedStatus{\n\t\tState:      Ptr(\"state\"),\n\t\tName:       Ptr(\"name\"),\n\t\tSHA:        Ptr(\"sha\"),\n\t\tTotalCount: Ptr(1),\n\t\tStatuses: []*RepoStatus{\n\t\t\t{\n\t\t\t\tID:          Ptr(int64(1)),\n\t\t\t\tNodeID:      Ptr(\"nid\"),\n\t\t\t\tURL:         Ptr(\"url\"),\n\t\t\t\tState:       Ptr(\"state\"),\n\t\t\t\tTargetURL:   Ptr(\"turl\"),\n\t\t\t\tDescription: Ptr(\"desc\"),\n\t\t\t\tContext:     Ptr(\"ctx\"),\n\t\t\t\tAvatarURL:   Ptr(\"aurl\"),\n\t\t\t\tCreator:     &User{ID: Ptr(int64(1))},\n\t\t\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\t\t\tUpdatedAt:   &Timestamp{referenceTime},\n\t\t\t},\n\t\t},\n\t\tCommitURL:     Ptr(\"curl\"),\n\t\tRepositoryURL: Ptr(\"rurl\"),\n\t}\n\n\twant := `{\n\t\t\"state\": \"state\",\n\t\t\"name\": \"name\",\n\t\t\"sha\": \"sha\",\n\t\t\"total_count\": 1,\n\t\t\"statuses\": [\n\t\t\t{\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"node_id\": \"nid\",\n\t\t\t\t\"url\": \"url\",\n\t\t\t\t\"state\": \"state\",\n\t\t\t\t\"target_url\": \"turl\",\n\t\t\t\t\"description\": \"desc\",\n\t\t\t\t\"context\": \"ctx\",\n\t\t\t\t\"avatar_url\": \"aurl\",\n\t\t\t\t\"creator\": {\n\t\t\t\t\t\"id\": 1\n\t\t\t\t},\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"updated_at\": ` + referenceTimeStr + `\n\t\t\t}\n\t\t],\n\t\t\"commit_url\": \"curl\",\n\t\t\"repository_url\": \"rurl\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/repos_tags.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// TagProtection represents a repository tag protection.\ntype TagProtection struct {\n\tID      *int64  `json:\"id\"`\n\tPattern *string `json:\"pattern\"`\n}\n\n// tagProtectionRequest represents a request to create tag protection.\ntype tagProtectionRequest struct {\n\t// An optional glob pattern to match against when enforcing tag protection.\n\tPattern string `json:\"pattern\"`\n}\n\n// ListTagProtection lists tag protection of the specified repository.\n//\n// 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\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/repos/tags#closing-down---list-tag-protection-states-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/tags/protection\nfunc (s *RepositoriesService) ListTagProtection(ctx context.Context, owner, repo string) ([]*TagProtection, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/tags/protection\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar tagProtections []*TagProtection\n\tresp, err := s.client.Do(ctx, req, &tagProtections)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn tagProtections, resp, nil\n}\n\n// CreateTagProtection creates the tag protection of the specified repository.\n//\n// 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\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/repos/tags#closing-down---create-a-tag-protection-state-for-a-repository\n//\n//meta:operation POST /repos/{owner}/{repo}/tags/protection\nfunc (s *RepositoriesService) CreateTagProtection(ctx context.Context, owner, repo, pattern string) (*TagProtection, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/tags/protection\", owner, repo)\n\tr := &tagProtectionRequest{Pattern: pattern}\n\treq, err := s.client.NewRequest(\"POST\", u, r)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar tagProtection *TagProtection\n\tresp, err := s.client.Do(ctx, req, &tagProtection)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn tagProtection, resp, nil\n}\n\n// DeleteTagProtection deletes a tag protection from the specified repository.\n//\n// 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\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/repos/tags#closing-down---delete-a-tag-protection-state-for-a-repository\n//\n//meta:operation DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}\nfunc (s *RepositoriesService) DeleteTagProtection(ctx context.Context, owner, repo string, tagProtectionID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/tags/protection/%v\", owner, repo, tagProtectionID)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/repos_tags_test.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_ListTagProtection(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/tags/protection\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\n\t\tfmt.Fprint(w, `[{\"id\":1, \"pattern\":\"tag1\"},{\"id\":2, \"pattern\":\"tag2\"}]`)\n\t})\n\n\tctx := t.Context()\n\ttagProtections, _, err := client.Repositories.ListTagProtection(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListTagProtection returned error: %v\", err)\n\t}\n\n\twant := []*TagProtection{{ID: Ptr(int64(1)), Pattern: Ptr(\"tag1\")}, {ID: Ptr(int64(2)), Pattern: Ptr(\"tag2\")}}\n\tif !cmp.Equal(tagProtections, want) {\n\t\tt.Errorf(\"Repositories.ListTagProtection returned %+v, want %+v\", tagProtections, want)\n\t}\n\n\tconst methodName = \"ListTagProtection\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListTagProtection(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListTagProtection(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListTagProtection_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.ListTagProtection(ctx, \"%\", \"r\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoriesService_CreateTagProtection(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tpattern := \"tag*\"\n\n\tmux.HandleFunc(\"/repos/o/r/tags/protection\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *tagProtectionRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\twant := &tagProtectionRequest{Pattern: \"tag*\"}\n\t\tif !cmp.Equal(v, want) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, want)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1,\"pattern\":\"tag*\"}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.CreateTagProtection(ctx, \"o\", \"r\", pattern)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.CreateTagProtection returned error: %v\", err)\n\t}\n\n\twant := &TagProtection{ID: Ptr(int64(1)), Pattern: Ptr(\"tag*\")}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.CreateTagProtection returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"CreateTagProtection\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.CreateTagProtection(ctx, \"\\n\", \"\\n\", pattern)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.CreateTagProtection(ctx, \"o\", \"r\", pattern)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_DeleteTagProtection(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/tags/protection/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Repositories.DeleteTagProtection(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.DeleteTagProtection returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteTagProtection\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.DeleteTagProtection(ctx, \"\\n\", \"\\n\", 1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.DeleteTagProtection(ctx, \"o\", \"r\", 1)\n\t})\n}\n\nfunc TestTagProtection_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &TagProtection{}, `{\n\t\t\"id\": null,\n\t\t\"pattern\": null\n\t}`)\n\n\tu := &TagProtection{\n\t\tID:      Ptr(int64(1)),\n\t\tPattern: Ptr(\"pattern\"),\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"pattern\": \"pattern\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/repos_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_ListByAuthenticatedUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/repos\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"id\":1},{\"id\":2}]`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.ListByAuthenticatedUser(ctx, nil)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.List returned error: %v\", err)\n\t}\n\n\twant := []*Repository{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.ListByAuthenticatedUser returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ListByAuthenticatedUser\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListByAuthenticatedUser(ctx, nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListByUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/repos\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"sort\":      \"created\",\n\t\t\t\"direction\": \"asc\",\n\t\t\t\"page\":      \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &RepositoryListByUserOptions{\n\t\tSort:        \"created\",\n\t\tDirection:   \"asc\",\n\t\tListOptions: ListOptions{Page: 2},\n\t}\n\tctx := t.Context()\n\trepos, _, err := client.Repositories.ListByUser(ctx, \"u\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.List returned error: %v\", err)\n\t}\n\n\twant := []*Repository{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(repos, want) {\n\t\tt.Errorf(\"Repositories.ListByUser returned %+v, want %+v\", repos, want)\n\t}\n\n\tconst methodName = \"ListByUser\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListByUser(ctx, \"\\n\", &RepositoryListByUserOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListByUser(ctx, \"u\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListByUser_type(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/repos\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"type\": \"owner\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &RepositoryListByUserOptions{\n\t\tType: \"owner\",\n\t}\n\tctx := t.Context()\n\trepos, _, err := client.Repositories.ListByUser(ctx, \"u\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListByUser returned error: %v\", err)\n\t}\n\n\twant := []*Repository{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(repos, want) {\n\t\tt.Errorf(\"Repositories.ListByUser returned %+v, want %+v\", repos, want)\n\t}\n}\n\nfunc TestRepositoriesService_ListByUser_invalidUser(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.ListByUser(ctx, \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoriesService_ListByOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\twantAcceptHeaders := []string{mediaTypeTopicsPreview, mediaTypeRepositoryVisibilityPreview}\n\tmux.HandleFunc(\"/orgs/o/repos\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", strings.Join(wantAcceptHeaders, \", \"))\n\t\ttestFormValues(t, r, values{\n\t\t\t\"type\": \"forks\",\n\t\t\t\"page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\tctx := t.Context()\n\topt := &RepositoryListByOrgOptions{\n\t\tType:        \"forks\",\n\t\tListOptions: ListOptions{Page: 2},\n\t}\n\tgot, _, err := client.Repositories.ListByOrg(ctx, \"o\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListByOrg returned error: %v\", err)\n\t}\n\n\twant := []*Repository{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.ListByOrg returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ListByOrg\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListByOrg(ctx, \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListByOrg(ctx, \"o\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListByOrg_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.ListByOrg(ctx, \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoriesService_ListAll(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repositories\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"since\": \"1\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\tctx := t.Context()\n\topt := &RepositoryListAllOptions{1}\n\tgot, _, err := client.Repositories.ListAll(ctx, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListAll returned error: %v\", err)\n\t}\n\n\twant := []*Repository{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.ListAll returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ListAll\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListAll(ctx, &RepositoryListAllOptions{1})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_Create_user(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &Repository{\n\t\tName:     Ptr(\"n\"),\n\t\tArchived: Ptr(true), // not passed along.\n\t}\n\n\twantAcceptHeaders := []string{mediaTypeRepositoryTemplatePreview, mediaTypeRepositoryVisibilityPreview}\n\tmux.HandleFunc(\"/user/repos\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *createRepoRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Accept\", strings.Join(wantAcceptHeaders, \", \"))\n\t\twant := &createRepoRequest{Name: Ptr(\"n\")}\n\t\tif !cmp.Equal(v, want) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, want)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.Create(ctx, \"\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.Create returned error: %v\", err)\n\t}\n\n\twant := &Repository{ID: Ptr(int64(1))}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.Create returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"Create\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.Create(ctx, \"\", nil)\n\t\treturn err\n\t})\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.Create(ctx, \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.Create(ctx, \"\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_Create_org(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &Repository{\n\t\tName:     Ptr(\"n\"),\n\t\tArchived: Ptr(true), // not passed along.\n\t}\n\n\twantAcceptHeaders := []string{mediaTypeRepositoryTemplatePreview, mediaTypeRepositoryVisibilityPreview}\n\tmux.HandleFunc(\"/orgs/o/repos\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *createRepoRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Accept\", strings.Join(wantAcceptHeaders, \", \"))\n\t\twant := &createRepoRequest{Name: Ptr(\"n\")}\n\t\tif !cmp.Equal(v, want) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, want)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\trepo, _, err := client.Repositories.Create(ctx, \"o\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.Create returned error: %v\", err)\n\t}\n\n\twant := &Repository{ID: Ptr(int64(1))}\n\tif !cmp.Equal(repo, want) {\n\t\tt.Errorf(\"Repositories.Create returned %+v, want %+v\", repo, want)\n\t}\n}\n\nfunc TestRepositoriesService_Create_withCustomProperties(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &Repository{\n\t\tName: Ptr(\"n\"),\n\t\tCustomProperties: map[string]any{\n\t\t\t\"environment\": \"production\",\n\t\t\t\"team\":        \"backend\",\n\t\t\t\"priority\":    1,\n\t\t},\n\t}\n\n\twantAcceptHeaders := []string{mediaTypeRepositoryTemplatePreview, mediaTypeRepositoryVisibilityPreview}\n\tmux.HandleFunc(\"/orgs/o/repos\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *createRepoRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Accept\", strings.Join(wantAcceptHeaders, \", \"))\n\t\twant := &createRepoRequest{\n\t\t\tName: Ptr(\"n\"),\n\t\t\tCustomProperties: map[string]any{\n\t\t\t\t\"environment\": \"production\",\n\t\t\t\t\"team\":        \"backend\",\n\t\t\t\t\"priority\":    float64(1), // JSON unmarshals numbers as float64\n\t\t\t},\n\t\t}\n\t\tif !cmp.Equal(v, want) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, want)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\trepo, _, err := client.Repositories.Create(ctx, \"o\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.Create returned error: %v\", err)\n\t}\n\n\twant := &Repository{ID: Ptr(int64(1))}\n\tif !cmp.Equal(repo, want) {\n\t\tt.Errorf(\"Repositories.Create returned %+v, want %+v\", repo, want)\n\t}\n}\n\nfunc TestRepositoriesService_CreateFromTemplate(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\ttemplateRepoReq := &TemplateRepoRequest{\n\t\tName: Ptr(\"n\"),\n\t}\n\n\tmux.HandleFunc(\"/repos/to/tr/generate\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *TemplateRepoRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeRepositoryTemplatePreview)\n\t\twant := &TemplateRepoRequest{Name: Ptr(\"n\")}\n\t\tif !cmp.Equal(v, want) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, want)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1,\"name\":\"n\"}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.CreateFromTemplate(ctx, \"to\", \"tr\", templateRepoReq)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.CreateFromTemplate returned error: %v\", err)\n\t}\n\n\twant := &Repository{ID: Ptr(int64(1)), Name: Ptr(\"n\")}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.CreateFromTemplate returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"CreateFromTemplate\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.CreateFromTemplate(ctx, \"\\n\", \"\\n\", templateRepoReq)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.CreateFromTemplate(ctx, \"to\", \"tr\", templateRepoReq)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_Get(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\twantAcceptHeaders := []string{mediaTypeCodesOfConductPreview, mediaTypeTopicsPreview, mediaTypeRepositoryTemplatePreview, mediaTypeRepositoryVisibilityPreview}\n\tmux.HandleFunc(\"/repos/o/r\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", strings.Join(wantAcceptHeaders, \", \"))\n\t\tfmt.Fprint(w, `{\"id\":1,\"name\":\"n\",\"description\":\"d\",\"owner\":{\"login\":\"l\"},\"license\":{\"key\":\"mit\"},\"security_and_analysis\":{\"advanced_security\":{\"status\":\"enabled\"},\"secret_scanning\":{\"status\":\"enabled\"},\"secret_scanning_push_protection\":{\"status\":\"enabled\"},\"dependabot_security_updates\":{\"status\": \"enabled\"}, \"secret_scanning_validity_checks\":{\"status\":\"enabled\"}}}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.Get(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.Get returned error: %v\", err)\n\t}\n\n\twant := &Repository{ID: Ptr(int64(1)), Name: Ptr(\"n\"), Description: Ptr(\"d\"), Owner: &User{Login: Ptr(\"l\")}, License: &License{Key: Ptr(\"mit\")}, SecurityAndAnalysis: &SecurityAndAnalysis{AdvancedSecurity: &AdvancedSecurity{Status: Ptr(\"enabled\")}, SecretScanning: &SecretScanning{Ptr(\"enabled\")}, SecretScanningPushProtection: &SecretScanningPushProtection{Ptr(\"enabled\")}, DependabotSecurityUpdates: &DependabotSecurityUpdates{Ptr(\"enabled\")}, SecretScanningValidityChecks: &SecretScanningValidityChecks{Ptr(\"enabled\")}}}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.Get returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"Get\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.Get(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.Get(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetCodeOfConduct(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeCodesOfConductPreview)\n\t\tfmt.Fprint(w, `{\n            \"code_of_conduct\": {\n  \t\t\t\t\t\t\"key\": \"key\",\n  \t\t\t\t\t\t\"name\": \"name\",\n  \t\t\t\t\t\t\"url\": \"url\",\n  \t\t\t\t\t\t\"body\": \"body\"\n            }}`,\n\t\t)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.GetCodeOfConduct(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetCodeOfConduct returned error: %v\", err)\n\t}\n\n\twant := &CodeOfConduct{\n\t\tKey:  Ptr(\"key\"),\n\t\tName: Ptr(\"name\"),\n\t\tURL:  Ptr(\"url\"),\n\t\tBody: Ptr(\"body\"),\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.GetCodeOfConduct returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"GetCodeOfConduct\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetCodeOfConduct(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetCodeOfConduct(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repositories/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1,\"name\":\"n\",\"description\":\"d\",\"owner\":{\"login\":\"l\"},\"license\":{\"key\":\"mit\"}}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.GetByID(ctx, 1)\n\tif err != nil {\n\t\tt.Fatalf(\"Repositories.GetByID returned error: %v\", err)\n\t}\n\n\twant := &Repository{ID: Ptr(int64(1)), Name: Ptr(\"n\"), Description: Ptr(\"d\"), Owner: &User{Login: Ptr(\"l\")}, License: &License{Key: Ptr(\"mit\")}}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.GetByID returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"GetByID\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetByID(ctx, 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_Edit(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\ti := true\n\tinput := &Repository{HasIssues: &i}\n\n\twantAcceptHeaders := []string{mediaTypeRepositoryTemplatePreview, mediaTypeRepositoryVisibilityPreview}\n\tmux.HandleFunc(\"/repos/o/r\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *Repository\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\ttestHeader(t, r, \"Accept\", strings.Join(wantAcceptHeaders, \", \"))\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.Edit(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.Edit returned error: %v\", err)\n\t}\n\n\twant := &Repository{ID: Ptr(int64(1))}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.Edit returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"Edit\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.Edit(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.Edit(ctx, \"o\", \"r\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_Delete(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Repositories.Delete(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.Delete returned error: %v\", err)\n\t}\n\n\tconst methodName = \"Delete\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.Delete(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.Delete(ctx, \"o\", \"r\")\n\t})\n}\n\nfunc TestRepositoriesService_Get_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.Get(ctx, \"%\", \"r\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoriesService_Edit_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.Edit(ctx, \"%\", \"r\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoriesService_GetVulnerabilityAlerts(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/vulnerability-alerts\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeRequiredVulnerabilityAlertsPreview)\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tvulnerabilityAlertsEnabled, _, err := client.Repositories.GetVulnerabilityAlerts(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetVulnerabilityAlerts returned error: %v\", err)\n\t}\n\n\tif want := true; vulnerabilityAlertsEnabled != want {\n\t\tt.Errorf(\"Repositories.GetVulnerabilityAlerts returned %+v, want %+v\", vulnerabilityAlertsEnabled, want)\n\t}\n\n\tconst methodName = \"GetVulnerabilityAlerts\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetVulnerabilityAlerts(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetVulnerabilityAlerts(ctx, \"o\", \"r\")\n\t\tif got {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want false\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_EnableVulnerabilityAlerts(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/vulnerability-alerts\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeRequiredVulnerabilityAlertsPreview)\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Repositories.EnableVulnerabilityAlerts(ctx, \"o\", \"r\"); err != nil {\n\t\tt.Errorf(\"Repositories.EnableVulnerabilityAlerts returned error: %v\", err)\n\t}\n\n\tconst methodName = \"EnableVulnerabilityAlerts\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.EnableVulnerabilityAlerts(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.EnableVulnerabilityAlerts(ctx, \"o\", \"r\")\n\t})\n}\n\nfunc TestRepositoriesService_DisableVulnerabilityAlerts(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/vulnerability-alerts\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeRequiredVulnerabilityAlertsPreview)\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Repositories.DisableVulnerabilityAlerts(ctx, \"o\", \"r\"); err != nil {\n\t\tt.Errorf(\"Repositories.DisableVulnerabilityAlerts returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DisableVulnerabilityAlerts\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.DisableVulnerabilityAlerts(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.DisableVulnerabilityAlerts(ctx, \"o\", \"r\")\n\t})\n}\n\nfunc TestRepositoriesService_EnableAutomatedSecurityFixes(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/automated-security-fixes\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Repositories.EnableAutomatedSecurityFixes(ctx, \"o\", \"r\"); err != nil {\n\t\tt.Errorf(\"Repositories.EnableAutomatedSecurityFixes returned error: %v\", err)\n\t}\n}\n\nfunc TestRepositoriesService_GetAutomatedSecurityFixes(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/automated-security-fixes\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"enabled\": true, \"paused\": false}`)\n\t})\n\n\tctx := t.Context()\n\tfixes, _, err := client.Repositories.GetAutomatedSecurityFixes(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetAutomatedSecurityFixes returned error: %v\", err)\n\t}\n\n\twant := &AutomatedSecurityFixes{\n\t\tEnabled: Ptr(true),\n\t\tPaused:  Ptr(false),\n\t}\n\tif !cmp.Equal(fixes, want) {\n\t\tt.Errorf(\"Repositories.GetAutomatedSecurityFixes returned %#v, want %#v\", fixes, want)\n\t}\n\n\tconst methodName = \"GetAutomatedSecurityFixes\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.GetAutomatedSecurityFixes(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.GetAutomatedSecurityFixes(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_DisableAutomatedSecurityFixes(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/automated-security-fixes\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Repositories.DisableAutomatedSecurityFixes(ctx, \"o\", \"r\"); err != nil {\n\t\tt.Errorf(\"Repositories.DisableAutomatedSecurityFixes returned error: %v\", err)\n\t}\n}\n\nfunc TestRepositoriesService_ListContributors(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/contributors\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"anon\": \"true\",\n\t\t\t\"page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"contributions\":42}]`)\n\t})\n\n\topts := &ListContributorsOptions{Anon: \"true\", ListOptions: ListOptions{Page: 2}}\n\tctx := t.Context()\n\tcontributors, _, err := client.Repositories.ListContributors(ctx, \"o\", \"r\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListContributors returned error: %v\", err)\n\t}\n\n\twant := []*Contributor{{Contributions: Ptr(42)}}\n\tif !cmp.Equal(contributors, want) {\n\t\tt.Errorf(\"Repositories.ListContributors returned %+v, want %+v\", contributors, want)\n\t}\n\n\tconst methodName = \"ListContributors\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListContributors(ctx, \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListContributors(ctx, \"o\", \"r\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListLanguages(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/languages\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"go\":1}`)\n\t})\n\n\tctx := t.Context()\n\tlanguages, _, err := client.Repositories.ListLanguages(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListLanguages returned error: %v\", err)\n\t}\n\n\twant := map[string]int{\"go\": 1}\n\tif !cmp.Equal(languages, want) {\n\t\tt.Errorf(\"Repositories.ListLanguages returned %+v, want %+v\", languages, want)\n\t}\n\n\tconst methodName = \"ListLanguages\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListLanguages(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListLanguages(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListTeams(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/teams\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tteams, _, err := client.Repositories.ListTeams(ctx, \"o\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListTeams returned error: %v\", err)\n\t}\n\n\twant := []*Team{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(teams, want) {\n\t\tt.Errorf(\"Repositories.ListTeams returned %+v, want %+v\", teams, want)\n\t}\n\n\tconst methodName = \"ListTeams\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListTeams(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListTeams(ctx, \"o\", \"r\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListTags(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/tags\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"name\":\"n\", \"commit\" : {\"sha\" : \"s\", \"url\" : \"u\"}, \"zipball_url\": \"z\", \"tarball_url\": \"t\"}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\ttags, _, err := client.Repositories.ListTags(ctx, \"o\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListTags returned error: %v\", err)\n\t}\n\n\twant := []*RepositoryTag{\n\t\t{\n\t\t\tName: Ptr(\"n\"),\n\t\t\tCommit: &Commit{\n\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\tURL: Ptr(\"u\"),\n\t\t\t},\n\t\t\tZipballURL: Ptr(\"z\"),\n\t\t\tTarballURL: Ptr(\"t\"),\n\t\t},\n\t}\n\tif !cmp.Equal(tags, want) {\n\t\tt.Errorf(\"Repositories.ListTags returned %+v, want %+v\", tags, want)\n\t}\n\n\tconst methodName = \"ListTags\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListTags(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListTags(ctx, \"o\", \"r\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListBranches(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/branches\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"name\":\"master\", \"commit\" : {\"sha\" : \"a57781\", \"url\" : \"https://api.github.com/repos/o/r/commits/a57781\"}}]`)\n\t})\n\n\topt := &BranchListOptions{\n\t\tProtected:   nil,\n\t\tListOptions: ListOptions{Page: 2},\n\t}\n\tctx := t.Context()\n\tbranches, _, err := client.Repositories.ListBranches(ctx, \"o\", \"r\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListBranches returned error: %v\", err)\n\t}\n\n\twant := []*Branch{{Name: Ptr(\"master\"), Commit: &RepositoryCommit{SHA: Ptr(\"a57781\"), URL: Ptr(\"https://api.github.com/repos/o/r/commits/a57781\")}}}\n\tif !cmp.Equal(branches, want) {\n\t\tt.Errorf(\"Repositories.ListBranches returned %+v, want %+v\", branches, want)\n\t}\n\n\tconst methodName = \"ListBranches\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListBranches(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListBranches(ctx, \"o\", \"r\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetBranch(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\ttestMethod(t, r, \"GET\")\n\t\t\tfmt.Fprint(w, `{\"name\":\"n\", \"commit\":{\"sha\":\"s\",\"commit\":{\"message\":\"m\"}}, \"protected\":true, \"protection\":{\"required_status_checks\":{\"contexts\":[\"c\"]}}}`)\n\t\t})\n\n\t\tctx := t.Context()\n\t\tbranch, _, err := client.Repositories.GetBranch(ctx, \"o\", \"r\", test.branch, 0)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Repositories.GetBranch returned error: %v\", err)\n\t\t}\n\n\t\twant := &Branch{\n\t\t\tName: Ptr(\"n\"),\n\t\t\tCommit: &RepositoryCommit{\n\t\t\t\tSHA: Ptr(\"s\"),\n\t\t\t\tCommit: &Commit{\n\t\t\t\t\tMessage: Ptr(\"m\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tProtected: Ptr(true),\n\t\t\tProtection: &Protection{\n\t\t\t\tRequiredStatusChecks: &RequiredStatusChecks{\n\t\t\t\t\tContexts: &[]string{\"c\"},\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\n\t\tif !cmp.Equal(branch, want) {\n\t\t\tt.Errorf(\"Repositories.GetBranch returned %+v, want %+v\", branch, want)\n\t\t}\n\n\t\tconst methodName = \"GetBranch\"\n\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t_, _, err = client.Repositories.GetBranch(ctx, \"\\n\", \"\\n\", \"\\n\", 0)\n\t\t\treturn err\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_GetBranch_BadJSONResponse(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\tfmt.Fprint(w, `{\"name\":\"n\", \"commit\":{\"sha\":...truncated`)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\tif _, _, err := client.Repositories.GetBranch(ctx, \"o\", \"r\", test.branch, 0); err == nil {\n\t\t\t\tt.Error(\"Repositories.GetBranch returned no error; wanted JSON error\")\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_GetBranch_StatusMovedPermanently_followRedirects(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, serverURL := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/branches/b\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tredirectURL, _ := url.Parse(serverURL + baseURLPath + \"/repos/o/r/branches/br\")\n\t\thttp.Redirect(w, r, redirectURL.String(), http.StatusMovedPermanently)\n\t})\n\tmux.HandleFunc(\"/repos/o/r/branches/br\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"name\":\"n\", \"commit\":{\"sha\":\"s\",\"commit\":{\"message\":\"m\"}}, \"protected\":true, \"protection\":{\"required_status_checks\":{\"contexts\":[\"c\"]}}}`)\n\t})\n\tctx := t.Context()\n\tbranch, resp, err := client.Repositories.GetBranch(ctx, \"o\", \"r\", \"b\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.GetBranch returned error: %v\", err)\n\t}\n\tif resp.StatusCode != http.StatusOK {\n\t\tt.Errorf(\"Repositories.GetBranch returned status: %v, want %v\", resp.StatusCode, http.StatusOK)\n\t}\n\n\twant := &Branch{\n\t\tName: Ptr(\"n\"),\n\t\tCommit: &RepositoryCommit{\n\t\t\tSHA: Ptr(\"s\"),\n\t\t\tCommit: &Commit{\n\t\t\t\tMessage: Ptr(\"m\"),\n\t\t\t},\n\t\t},\n\t\tProtected: Ptr(true),\n\t\tProtection: &Protection{\n\t\t\tRequiredStatusChecks: &RequiredStatusChecks{\n\t\t\t\tContexts: &[]string{\"c\"},\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(branch, want) {\n\t\tt.Errorf(\"Repositories.GetBranch returned %+v, want %+v\", branch, want)\n\t}\n}\n\nfunc TestRepositoriesService_GetBranch_notFound(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat-branch-50%\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\thttp.Error(w, \"branch not found\", http.StatusNotFound)\n\t\t\t})\n\t\t\tctx := t.Context()\n\t\t\t_, resp, err := client.Repositories.GetBranch(ctx, \"o\", \"r\", test.branch, 1)\n\t\t\tif err == nil {\n\t\t\t\tt.Error(\"Repositories.GetBranch returned error: nil\")\n\t\t\t}\n\t\t\tif resp.StatusCode != http.StatusNotFound {\n\t\t\t\tt.Errorf(\"Repositories.GetBranch returned status: %v, want %v\", resp.StatusCode, http.StatusNotFound)\n\t\t\t}\n\n\t\t\t// Add custom round tripper\n\t\t\tclient.client.Transport = roundTripperFunc(func(*http.Request) (*http.Response, error) {\n\t\t\t\treturn nil, errors.New(\"failed to get branch\")\n\t\t\t})\n\n\t\t\tconst methodName = \"GetBranch\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.GetBranch(ctx, \"\\n\", \"\\n\", \"\\n\", 1)\n\t\t\t\treturn err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_RenameBranch(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/rename\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/rename\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\trenameBranchReq := \"nn\"\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\tvar v *renameBranchRequest\n\t\t\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\t\t\ttestMethod(t, r, \"POST\")\n\t\t\t\twant := &renameBranchRequest{NewName: renameBranchReq}\n\t\t\t\tif !cmp.Equal(v, want) {\n\t\t\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, want)\n\t\t\t\t}\n\n\t\t\t\tfmt.Fprint(w, `{\"protected\":true,\"name\":\"nn\"}`)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\tgot, _, err := client.Repositories.RenameBranch(ctx, \"o\", \"r\", test.branch, renameBranchReq)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.RenameBranch returned error: %v\", err)\n\t\t\t}\n\n\t\t\twant := &Branch{Name: Ptr(\"nn\"), Protected: Ptr(true)}\n\t\t\tif !cmp.Equal(got, want) {\n\t\t\t\tt.Errorf(\"Repositories.RenameBranch returned %+v, want %+v\", got, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"RenameBranch\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.RenameBranch(ctx, \"\\n\", \"\\n\", \"\\n\", renameBranchReq)\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := client.Repositories.RenameBranch(ctx, \"o\", \"r\", test.branch, renameBranchReq)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_GetBranchProtection(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch               string\n\t\turlPath              string\n\t\tenforceAdminsURLPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection\", enforceAdminsURLPath: \"/repos/o/r/branches/b/protection/enforce_admins\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection\", enforceAdminsURLPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/enforce_admins\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\ttestHeader(t, r, \"Accept\", mediaTypeRequiredApprovingReviewsPreview)\n\t\t\t\tfmt.Fprintf(w, `{\n\t\t\t\t\t\t\"required_status_checks\":{\n\t\t\t\t\t\t\t\"strict\":true,\n\t\t\t\t\t\t\t\"contexts\":[\"continuous-integration\"],\n\t\t\t\t\t\t\t\"checks\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"context\": \"continuous-integration\",\n\t\t\t\t\t\t\t\t\t\"app_id\": null\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"required_pull_request_reviews\":{\n\t\t\t\t\t\t\t\"dismissal_restrictions\":{\n\t\t\t\t\t\t\t\t\"users\":[{\n\t\t\t\t\t\t\t\t\t\"id\":3,\n\t\t\t\t\t\t\t\t\t\"login\":\"u\"\n\t\t\t\t\t\t\t\t}],\n\t\t\t\t\t\t\t\t\"teams\":[{\n\t\t\t\t\t\t\t\t\t\"id\":4,\n\t\t\t\t\t\t\t\t\t\"slug\":\"t\"\n\t\t\t\t\t\t\t\t}],\n\t\t\t\t\t\t\t\t\"apps\":[{\n\t\t\t\t\t\t\t\t\t\"id\":5,\n\t\t\t\t\t\t\t\t\t\"slug\":\"a\"\n\t\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"dismiss_stale_reviews\":true,\n\t\t\t\t\t\t\t\"require_code_owner_reviews\":true,\n\t\t\t\t\t\t\t\"require_last_push_approval\":false,\n\t\t\t\t\t\t\t\"required_approving_review_count\":1\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"enforce_admins\":{\n\t\t\t\t\t\t\t\t\"url\":\"%v\",\n\t\t\t\t\t\t\t\t\"enabled\":true\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"restrictions\":{\n\t\t\t\t\t\t\t\t\"users\":[{\"id\":1,\"login\":\"u\"}],\n\t\t\t\t\t\t\t\t\"teams\":[{\"id\":2,\"slug\":\"t\"}],\n\t\t\t\t\t\t\t\t\"apps\":[{\"id\":3,\"slug\":\"a\"}]\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"required_conversation_resolution\": {\n\t\t\t\t\t\t\t\t\"enabled\": true\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"block_creations\": {\n\t\t\t\t\t\t\t\t\"enabled\": false\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"lock_branch\": {\n\t\t\t\t\t\t\t\t\"enabled\": false\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"allow_fork_syncing\": {\n\t\t\t\t\t\t\t\t\"enabled\": false\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}`, test.enforceAdminsURLPath)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\tprotection, _, err := client.Repositories.GetBranchProtection(ctx, \"o\", \"r\", test.branch)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.GetBranchProtection returned error: %v\", err)\n\t\t\t}\n\n\t\t\twant := &Protection{\n\t\t\t\tRequiredStatusChecks: &RequiredStatusChecks{\n\t\t\t\t\tStrict:   true,\n\t\t\t\t\tContexts: &[]string{\"continuous-integration\"},\n\t\t\t\t\tChecks: &[]*RequiredStatusCheck{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tContext: \"continuous-integration\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tRequiredPullRequestReviews: &PullRequestReviewsEnforcement{\n\t\t\t\t\tDismissStaleReviews: true,\n\t\t\t\t\tDismissalRestrictions: &DismissalRestrictions{\n\t\t\t\t\t\tUsers: []*User{\n\t\t\t\t\t\t\t{Login: Ptr(\"u\"), ID: Ptr(int64(3))},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tTeams: []*Team{\n\t\t\t\t\t\t\t{Slug: Ptr(\"t\"), ID: Ptr(int64(4))},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tApps: []*App{\n\t\t\t\t\t\t\t{Slug: Ptr(\"a\"), ID: Ptr(int64(5))},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tRequireCodeOwnerReviews:      true,\n\t\t\t\t\tRequiredApprovingReviewCount: 1,\n\t\t\t\t\tRequireLastPushApproval:      false,\n\t\t\t\t},\n\t\t\t\tEnforceAdmins: &AdminEnforcement{\n\t\t\t\t\tURL:     Ptr(test.enforceAdminsURLPath),\n\t\t\t\t\tEnabled: true,\n\t\t\t\t},\n\t\t\t\tRestrictions: &BranchRestrictions{\n\t\t\t\t\tUsers: []*User{\n\t\t\t\t\t\t{Login: Ptr(\"u\"), ID: Ptr(int64(1))},\n\t\t\t\t\t},\n\t\t\t\t\tTeams: []*Team{\n\t\t\t\t\t\t{Slug: Ptr(\"t\"), ID: Ptr(int64(2))},\n\t\t\t\t\t},\n\t\t\t\t\tApps: []*App{\n\t\t\t\t\t\t{Slug: Ptr(\"a\"), ID: Ptr(int64(3))},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tRequiredConversationResolution: &RequiredConversationResolution{\n\t\t\t\t\tEnabled: true,\n\t\t\t\t},\n\t\t\t\tBlockCreations: &BlockCreations{\n\t\t\t\t\tEnabled: Ptr(false),\n\t\t\t\t},\n\t\t\t\tLockBranch: &LockBranch{\n\t\t\t\t\tEnabled: Ptr(false),\n\t\t\t\t},\n\t\t\t\tAllowForkSyncing: &AllowForkSyncing{\n\t\t\t\t\tEnabled: Ptr(false),\n\t\t\t\t},\n\t\t\t}\n\t\t\tif !cmp.Equal(protection, want) {\n\t\t\t\tt.Errorf(\"Repositories.GetBranchProtection returned %+v, want %+v\", protection, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"GetBranchProtection\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.GetBranchProtection(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := client.Repositories.GetBranchProtection(ctx, \"o\", \"r\", test.branch)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_GetBranchProtection_noDismissalRestrictions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\ttests := []struct {\n\t\tbranch               string\n\t\turlPath              string\n\t\tenforceAdminsURLPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection\", enforceAdminsURLPath: \"/repos/o/r/branches/b/protection/enforce_admins\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection\", enforceAdminsURLPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/enforce_admins\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\ttestMethod(t, r, \"GET\")\n\t\t\ttestHeader(t, r, \"Accept\", mediaTypeRequiredApprovingReviewsPreview)\n\t\t\tfmt.Fprintf(w, `{\n\t\t\t\t\t\"required_status_checks\":{\n\t\t\t\t\t\t\"strict\":true,\n\t\t\t\t\t\t\"contexts\":[\"continuous-integration\"],\n\t\t\t\t\t\t\"checks\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"context\": \"continuous-integration\",\n\t\t\t\t\t\t\t\t\"app_id\": null\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t\"required_pull_request_reviews\":{\n\t\t\t\t\t\t\"dismiss_stale_reviews\":true,\n\t\t\t\t\t\t\"require_code_owner_reviews\":true,\n\t\t\t\t\t\t\"required_approving_review_count\":1\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"enforce_admins\":{\n\t\t\t\t\t\t\t\"url\":\"%v\",\n\t\t\t\t\t\t\t\"enabled\":true\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"restrictions\":{\n\t\t\t\t\t\t\t\"users\":[{\"id\":1,\"login\":\"u\"}],\n\t\t\t\t\t\t\t\"teams\":[{\"id\":2,\"slug\":\"t\"}]\n\t\t\t\t\t\t}\n\t\t\t\t\t}`, test.enforceAdminsURLPath)\n\t\t})\n\n\t\tctx := t.Context()\n\t\tprotection, _, err := client.Repositories.GetBranchProtection(ctx, \"o\", \"r\", test.branch)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Repositories.GetBranchProtection returned error: %v\", err)\n\t\t}\n\n\t\twant := &Protection{\n\t\t\tRequiredStatusChecks: &RequiredStatusChecks{\n\t\t\t\tStrict:   true,\n\t\t\t\tContexts: &[]string{\"continuous-integration\"},\n\t\t\t\tChecks: &[]*RequiredStatusCheck{\n\t\t\t\t\t{\n\t\t\t\t\t\tContext: \"continuous-integration\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tRequiredPullRequestReviews: &PullRequestReviewsEnforcement{\n\t\t\t\tDismissStaleReviews:          true,\n\t\t\t\tDismissalRestrictions:        nil,\n\t\t\t\tRequireCodeOwnerReviews:      true,\n\t\t\t\tRequiredApprovingReviewCount: 1,\n\t\t\t},\n\t\t\tEnforceAdmins: &AdminEnforcement{\n\t\t\t\tURL:     Ptr(test.enforceAdminsURLPath),\n\t\t\t\tEnabled: true,\n\t\t\t},\n\t\t\tRestrictions: &BranchRestrictions{\n\t\t\t\tUsers: []*User{\n\t\t\t\t\t{Login: Ptr(\"u\"), ID: Ptr(int64(1))},\n\t\t\t\t},\n\t\t\t\tTeams: []*Team{\n\t\t\t\t\t{Slug: Ptr(\"t\"), ID: Ptr(int64(2))},\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t\tif !cmp.Equal(protection, want) {\n\t\t\tt.Errorf(\"Repositories.GetBranchProtection returned %+v, want %+v\", protection, want)\n\t\t}\n\t}\n}\n\nfunc TestRepositoriesService_GetBranchProtection_branchNotProtected(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\n\t\t\t\tw.WriteHeader(http.StatusBadRequest)\n\t\t\t\tfmt.Fprintf(w, `{\n\t\t\t\t\t\"message\": %q,\n\t\t\t\t\t\"documentation_url\": \"https://docs.github.com/rest/repos#get-branch-protection\"\n\t\t\t\t\t}`, githubBranchNotProtected)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\tprotection, _, err := client.Repositories.GetBranchProtection(ctx, \"o\", \"r\", test.branch)\n\n\t\t\tif protection != nil {\n\t\t\t\tt.Error(\"Repositories.GetBranchProtection returned non-nil protection data\")\n\t\t\t}\n\n\t\t\tif !errors.Is(err, ErrBranchNotProtected) {\n\t\t\t\tt.Errorf(\"Repositories.GetBranchProtection returned an invalid error: %v\", err)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_UpdateBranchProtection_Contexts(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tinput := &ProtectionRequest{\n\t\t\t\tRequiredStatusChecks: &RequiredStatusChecks{\n\t\t\t\t\tStrict:   true,\n\t\t\t\t\tContexts: &[]string{\"continuous-integration\"},\n\t\t\t\t},\n\t\t\t\tRequiredPullRequestReviews: &PullRequestReviewsEnforcementRequest{\n\t\t\t\t\tDismissStaleReviews: true,\n\t\t\t\t\tDismissalRestrictionsRequest: &DismissalRestrictionsRequest{\n\t\t\t\t\t\tUsers: &[]string{\"uu\"},\n\t\t\t\t\t\tTeams: &[]string{\"tt\"},\n\t\t\t\t\t\tApps:  &[]string{\"aa\"},\n\t\t\t\t\t},\n\t\t\t\t\tBypassPullRequestAllowancesRequest: &BypassPullRequestAllowancesRequest{\n\t\t\t\t\t\tUsers: []string{\"uuu\"},\n\t\t\t\t\t\tTeams: []string{\"ttt\"},\n\t\t\t\t\t\tApps:  []string{\"aaa\"},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tRestrictions: &BranchRestrictionsRequest{\n\t\t\t\t\tUsers: []string{\"u\"},\n\t\t\t\t\tTeams: []string{\"t\"},\n\t\t\t\t\tApps:  []string{\"a\"},\n\t\t\t\t},\n\t\t\t\tBlockCreations:   Ptr(true),\n\t\t\t\tLockBranch:       Ptr(true),\n\t\t\t\tAllowForkSyncing: Ptr(true),\n\t\t\t}\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\tvar v *ProtectionRequest\n\t\t\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\t\t\ttestMethod(t, r, \"PUT\")\n\t\t\t\tif !cmp.Equal(v, input) {\n\t\t\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t\t\t}\n\n\t\t\t\ttestHeader(t, r, \"Accept\", mediaTypeRequiredApprovingReviewsPreview)\n\t\t\t\tfmt.Fprint(w, `{\n\t\t\t\t\t\"required_status_checks\":{\n\t\t\t\t\t\t\"strict\":true,\n\t\t\t\t\t\t\"contexts\":[\"continuous-integration\"],\n\t\t\t\t\t\t\"checks\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"context\": \"continuous-integration\",\n\t\t\t\t\t\t\t\t\"app_id\": null\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t\"required_pull_request_reviews\":{\n\t\t\t\t\t\t\"dismissal_restrictions\":{\n\t\t\t\t\t\t\t\"users\":[{\n\t\t\t\t\t\t\t\t\"id\":3,\n\t\t\t\t\t\t\t\t\"login\":\"uu\"\n\t\t\t\t\t\t\t}],\n\t\t\t\t\t\t\t\"teams\":[{\n\t\t\t\t\t\t\t\t\"id\":4,\n\t\t\t\t\t\t\t\t\"slug\":\"tt\"\n\t\t\t\t\t\t\t}],\n\t\t\t\t\t\t\t\"apps\":[{\n\t\t\t\t\t\t\t\t\"id\":5,\n\t\t\t\t\t\t\t\t\"slug\":\"aa\"\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"dismiss_stale_reviews\":true,\n\t\t\t\t\t\t\"require_code_owner_reviews\":true,\n\t\t\t\t\t\t\"bypass_pull_request_allowances\": {\n\t\t\t\t\t\t\t\"users\":[{\"id\":10,\"login\":\"uuu\"}],\n\t\t\t\t\t\t\t\"teams\":[{\"id\":20,\"slug\":\"ttt\"}],\n\t\t\t\t\t\t\t\"apps\":[{\"id\":30,\"slug\":\"aaa\"}]\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"restrictions\":{\n\t\t\t\t\t\t\"users\":[{\"id\":1,\"login\":\"u\"}],\n\t\t\t\t\t\t\"teams\":[{\"id\":2,\"slug\":\"t\"}],\n\t\t\t\t\t\t\"apps\":[{\"id\":3,\"slug\":\"a\"}]\n\t\t\t\t\t},\n\t\t\t\t\t\"block_creations\": {\n\t\t\t\t\t\t\"enabled\": true\n\t\t\t\t\t},\n\t\t\t\t\t\"lock_branch\": {\n\t\t\t\t\t\t\"enabled\": true\n\t\t\t\t\t},\n\t\t\t\t\t\"allow_fork_syncing\": {\n\t\t\t\t\t\t\"enabled\": true\n\t\t\t\t\t}\n\t\t\t\t}`)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\tprotection, _, err := client.Repositories.UpdateBranchProtection(ctx, \"o\", \"r\", test.branch, input)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.UpdateBranchProtection returned error: %v\", err)\n\t\t\t}\n\n\t\t\twant := &Protection{\n\t\t\t\tRequiredStatusChecks: &RequiredStatusChecks{\n\t\t\t\t\tStrict:   true,\n\t\t\t\t\tContexts: &[]string{\"continuous-integration\"},\n\t\t\t\t\tChecks: &[]*RequiredStatusCheck{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tContext: \"continuous-integration\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tRequiredPullRequestReviews: &PullRequestReviewsEnforcement{\n\t\t\t\t\tDismissStaleReviews: true,\n\t\t\t\t\tDismissalRestrictions: &DismissalRestrictions{\n\t\t\t\t\t\tUsers: []*User{\n\t\t\t\t\t\t\t{Login: Ptr(\"uu\"), ID: Ptr(int64(3))},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tTeams: []*Team{\n\t\t\t\t\t\t\t{Slug: Ptr(\"tt\"), ID: Ptr(int64(4))},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tApps: []*App{\n\t\t\t\t\t\t\t{Slug: Ptr(\"aa\"), ID: Ptr(int64(5))},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tRequireCodeOwnerReviews: true,\n\t\t\t\t\tBypassPullRequestAllowances: &BypassPullRequestAllowances{\n\t\t\t\t\t\tUsers: []*User{\n\t\t\t\t\t\t\t{Login: Ptr(\"uuu\"), ID: Ptr(int64(10))},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tTeams: []*Team{\n\t\t\t\t\t\t\t{Slug: Ptr(\"ttt\"), ID: Ptr(int64(20))},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tApps: []*App{\n\t\t\t\t\t\t\t{Slug: Ptr(\"aaa\"), ID: Ptr(int64(30))},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tRestrictions: &BranchRestrictions{\n\t\t\t\t\tUsers: []*User{\n\t\t\t\t\t\t{Login: Ptr(\"u\"), ID: Ptr(int64(1))},\n\t\t\t\t\t},\n\t\t\t\t\tTeams: []*Team{\n\t\t\t\t\t\t{Slug: Ptr(\"t\"), ID: Ptr(int64(2))},\n\t\t\t\t\t},\n\t\t\t\t\tApps: []*App{\n\t\t\t\t\t\t{Slug: Ptr(\"a\"), ID: Ptr(int64(3))},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tBlockCreations: &BlockCreations{\n\t\t\t\t\tEnabled: Ptr(true),\n\t\t\t\t},\n\t\t\t\tLockBranch: &LockBranch{\n\t\t\t\t\tEnabled: Ptr(true),\n\t\t\t\t},\n\t\t\t\tAllowForkSyncing: &AllowForkSyncing{\n\t\t\t\t\tEnabled: Ptr(true),\n\t\t\t\t},\n\t\t\t}\n\t\t\tif !cmp.Equal(protection, want) {\n\t\t\t\tt.Errorf(\"Repositories.UpdateBranchProtection returned %+v, want %+v\", protection, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"UpdateBranchProtection\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.UpdateBranchProtection(ctx, \"\\n\", \"\\n\", \"\\n\", input)\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := client.Repositories.UpdateBranchProtection(ctx, \"o\", \"r\", test.branch, input)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_UpdateBranchProtection_EmptyContexts(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tinput := &ProtectionRequest{\n\t\t\t\tRequiredStatusChecks: &RequiredStatusChecks{\n\t\t\t\t\tStrict:   true,\n\t\t\t\t\tContexts: &[]string{},\n\t\t\t\t},\n\t\t\t\tRequiredPullRequestReviews: &PullRequestReviewsEnforcementRequest{\n\t\t\t\t\tDismissStaleReviews: true,\n\t\t\t\t\tDismissalRestrictionsRequest: &DismissalRestrictionsRequest{\n\t\t\t\t\t\tUsers: &[]string{\"uu\"},\n\t\t\t\t\t\tTeams: &[]string{\"tt\"},\n\t\t\t\t\t\tApps:  &[]string{\"aa\"},\n\t\t\t\t\t},\n\t\t\t\t\tBypassPullRequestAllowancesRequest: &BypassPullRequestAllowancesRequest{\n\t\t\t\t\t\tUsers: []string{\"uuu\"},\n\t\t\t\t\t\tTeams: []string{\"ttt\"},\n\t\t\t\t\t\tApps:  []string{\"aaa\"},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tRestrictions: &BranchRestrictionsRequest{\n\t\t\t\t\tUsers: []string{\"u\"},\n\t\t\t\t\tTeams: []string{\"t\"},\n\t\t\t\t\tApps:  []string{\"a\"},\n\t\t\t\t},\n\t\t\t\tBlockCreations:   Ptr(true),\n\t\t\t\tLockBranch:       Ptr(true),\n\t\t\t\tAllowForkSyncing: Ptr(true),\n\t\t\t}\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\tvar v *ProtectionRequest\n\t\t\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\t\t\ttestMethod(t, r, \"PUT\")\n\t\t\t\tif !cmp.Equal(v, input) {\n\t\t\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t\t\t}\n\n\t\t\t\ttestHeader(t, r, \"Accept\", mediaTypeRequiredApprovingReviewsPreview)\n\t\t\t\tfmt.Fprint(w, `{\n\t\t\t\t\t\"required_status_checks\":{\n\t\t\t\t\t\t\"strict\":true,\n\t\t\t\t\t\t\"contexts\":[],\n\t\t\t\t\t\t\"checks\": null\n\t\t\t\t\t},\n\t\t\t\t\t\"required_pull_request_reviews\":{\n\t\t\t\t\t\t\"dismissal_restrictions\":{\n\t\t\t\t\t\t\t\"users\":[{\n\t\t\t\t\t\t\t\t\"id\":3,\n\t\t\t\t\t\t\t\t\"login\":\"uu\"\n\t\t\t\t\t\t\t}],\n\t\t\t\t\t\t\t\"teams\":[{\n\t\t\t\t\t\t\t\t\"id\":4,\n\t\t\t\t\t\t\t\t\"slug\":\"tt\"\n\t\t\t\t\t\t\t}],\n\t\t\t\t\t\t\t\"apps\":[{\n\t\t\t\t\t\t\t\t\"id\":5,\n\t\t\t\t\t\t\t\t\"slug\":\"aa\"\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"dismiss_stale_reviews\":true,\n\t\t\t\t\t\t\"require_code_owner_reviews\":true,\n\t\t\t\t\t\t\"bypass_pull_request_allowances\": {\n\t\t\t\t\t\t\t\"users\":[{\"id\":10,\"login\":\"uuu\"}],\n\t\t\t\t\t\t\t\"teams\":[{\"id\":20,\"slug\":\"ttt\"}],\n\t\t\t\t\t\t\t\"apps\":[{\"id\":30,\"slug\":\"aaa\"}]\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"restrictions\":{\n\t\t\t\t\t\t\"users\":[{\"id\":1,\"login\":\"u\"}],\n\t\t\t\t\t\t\"teams\":[{\"id\":2,\"slug\":\"t\"}],\n\t\t\t\t\t\t\"apps\":[{\"id\":3,\"slug\":\"a\"}]\n\t\t\t\t\t},\n\t\t\t\t\t\"block_creations\": {\n\t\t\t\t\t\t\"enabled\": true\n\t\t\t\t\t},\n\t\t\t\t\t\"lock_branch\": {\n\t\t\t\t\t\t\"enabled\": true\n\t\t\t\t\t},\n\t\t\t\t\t\"allow_fork_syncing\": {\n\t\t\t\t\t\t\"enabled\": true\n\t\t\t\t\t}\n\t\t\t\t}`)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\tprotection, _, err := client.Repositories.UpdateBranchProtection(ctx, \"o\", \"r\", test.branch, input)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.UpdateBranchProtection returned error: %v\", err)\n\t\t\t}\n\n\t\t\twant := &Protection{\n\t\t\t\tRequiredStatusChecks: &RequiredStatusChecks{\n\t\t\t\t\tStrict:   true,\n\t\t\t\t\tContexts: &[]string{},\n\t\t\t\t},\n\t\t\t\tRequiredPullRequestReviews: &PullRequestReviewsEnforcement{\n\t\t\t\t\tDismissStaleReviews: true,\n\t\t\t\t\tDismissalRestrictions: &DismissalRestrictions{\n\t\t\t\t\t\tUsers: []*User{\n\t\t\t\t\t\t\t{Login: Ptr(\"uu\"), ID: Ptr(int64(3))},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tTeams: []*Team{\n\t\t\t\t\t\t\t{Slug: Ptr(\"tt\"), ID: Ptr(int64(4))},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tApps: []*App{\n\t\t\t\t\t\t\t{Slug: Ptr(\"aa\"), ID: Ptr(int64(5))},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tRequireCodeOwnerReviews: true,\n\t\t\t\t\tBypassPullRequestAllowances: &BypassPullRequestAllowances{\n\t\t\t\t\t\tUsers: []*User{\n\t\t\t\t\t\t\t{Login: Ptr(\"uuu\"), ID: Ptr(int64(10))},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tTeams: []*Team{\n\t\t\t\t\t\t\t{Slug: Ptr(\"ttt\"), ID: Ptr(int64(20))},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tApps: []*App{\n\t\t\t\t\t\t\t{Slug: Ptr(\"aaa\"), ID: Ptr(int64(30))},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tRestrictions: &BranchRestrictions{\n\t\t\t\t\tUsers: []*User{\n\t\t\t\t\t\t{Login: Ptr(\"u\"), ID: Ptr(int64(1))},\n\t\t\t\t\t},\n\t\t\t\t\tTeams: []*Team{\n\t\t\t\t\t\t{Slug: Ptr(\"t\"), ID: Ptr(int64(2))},\n\t\t\t\t\t},\n\t\t\t\t\tApps: []*App{\n\t\t\t\t\t\t{Slug: Ptr(\"a\"), ID: Ptr(int64(3))},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tBlockCreations: &BlockCreations{\n\t\t\t\t\tEnabled: Ptr(true),\n\t\t\t\t},\n\t\t\t\tLockBranch: &LockBranch{\n\t\t\t\t\tEnabled: Ptr(true),\n\t\t\t\t},\n\t\t\t\tAllowForkSyncing: &AllowForkSyncing{\n\t\t\t\t\tEnabled: Ptr(true),\n\t\t\t\t},\n\t\t\t}\n\t\t\tif !cmp.Equal(protection, want) {\n\t\t\t\tt.Errorf(\"Repositories.UpdateBranchProtection returned %+v, want %+v\", protection, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"UpdateBranchProtection\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.UpdateBranchProtection(ctx, \"\\n\", \"\\n\", \"\\n\", input)\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := client.Repositories.UpdateBranchProtection(ctx, \"o\", \"r\", test.branch, input)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_UpdateBranchProtection_Checks(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tinput := &ProtectionRequest{\n\t\t\t\tRequiredStatusChecks: &RequiredStatusChecks{\n\t\t\t\t\tStrict: true,\n\t\t\t\t\tChecks: &[]*RequiredStatusCheck{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tContext: \"continuous-integration\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tRequiredPullRequestReviews: &PullRequestReviewsEnforcementRequest{\n\t\t\t\t\tDismissStaleReviews: true,\n\t\t\t\t\tDismissalRestrictionsRequest: &DismissalRestrictionsRequest{\n\t\t\t\t\t\tUsers: &[]string{\"uu\"},\n\t\t\t\t\t\tTeams: &[]string{\"tt\"},\n\t\t\t\t\t\tApps:  &[]string{\"aa\"},\n\t\t\t\t\t},\n\t\t\t\t\tBypassPullRequestAllowancesRequest: &BypassPullRequestAllowancesRequest{\n\t\t\t\t\t\tUsers: []string{\"uuu\"},\n\t\t\t\t\t\tTeams: []string{\"ttt\"},\n\t\t\t\t\t\tApps:  []string{\"aaa\"},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tRestrictions: &BranchRestrictionsRequest{\n\t\t\t\t\tUsers: []string{\"u\"},\n\t\t\t\t\tTeams: []string{\"t\"},\n\t\t\t\t\tApps:  []string{\"a\"},\n\t\t\t\t},\n\t\t\t}\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\tvar v *ProtectionRequest\n\t\t\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\t\t\ttestMethod(t, r, \"PUT\")\n\t\t\t\tif !cmp.Equal(v, input) {\n\t\t\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t\t\t}\n\n\t\t\t\ttestHeader(t, r, \"Accept\", mediaTypeRequiredApprovingReviewsPreview)\n\t\t\t\tfmt.Fprint(w, `{\n\t\t\t\t\t\"required_status_checks\":{\n\t\t\t\t\t\t\"strict\":true,\n\t\t\t\t\t\t\"contexts\":[\"continuous-integration\"],\n\t\t\t\t\t\t\"checks\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"context\": \"continuous-integration\",\n\t\t\t\t\t\t\t\t\"app_id\": null\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t},\n\t\t\t\t\t\"required_pull_request_reviews\":{\n\t\t\t\t\t\t\"dismissal_restrictions\":{\n\t\t\t\t\t\t\t\"users\":[{\n\t\t\t\t\t\t\t\t\"id\":3,\n\t\t\t\t\t\t\t\t\"login\":\"uu\"\n\t\t\t\t\t\t\t}],\n\t\t\t\t\t\t\t\"teams\":[{\n\t\t\t\t\t\t\t\t\"id\":4,\n\t\t\t\t\t\t\t\t\"slug\":\"tt\"\n\t\t\t\t\t\t\t}],\n\t\t\t\t\t\t\t\"apps\":[{\n\t\t\t\t\t\t\t\t\"id\":5,\n\t\t\t\t\t\t\t\t\"slug\":\"aa\"\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"dismiss_stale_reviews\":true,\n\t\t\t\t\t\t\"require_code_owner_reviews\":true,\n\t\t\t\t\t\t\"bypass_pull_request_allowances\": {\n\t\t\t\t\t\t\t\"users\":[{\"id\":10,\"login\":\"uuu\"}],\n\t\t\t\t\t\t\t\"teams\":[{\"id\":20,\"slug\":\"ttt\"}],\n\t\t\t\t\t\t\t\"apps\":[{\"id\":30,\"slug\":\"aaa\"}]\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"restrictions\":{\n\t\t\t\t\t\t\"users\":[{\"id\":1,\"login\":\"u\"}],\n\t\t\t\t\t\t\"teams\":[{\"id\":2,\"slug\":\"t\"}],\n\t\t\t\t\t\t\"apps\":[{\"id\":3,\"slug\":\"a\"}]\n\t\t\t\t\t}\n\t\t\t\t}`)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\tprotection, _, err := client.Repositories.UpdateBranchProtection(ctx, \"o\", \"r\", test.branch, input)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.UpdateBranchProtection returned error: %v\", err)\n\t\t\t}\n\n\t\t\twant := &Protection{\n\t\t\t\tRequiredStatusChecks: &RequiredStatusChecks{\n\t\t\t\t\tStrict:   true,\n\t\t\t\t\tContexts: &[]string{\"continuous-integration\"},\n\t\t\t\t\tChecks: &[]*RequiredStatusCheck{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tContext: \"continuous-integration\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tRequiredPullRequestReviews: &PullRequestReviewsEnforcement{\n\t\t\t\t\tDismissStaleReviews: true,\n\t\t\t\t\tDismissalRestrictions: &DismissalRestrictions{\n\t\t\t\t\t\tUsers: []*User{\n\t\t\t\t\t\t\t{Login: Ptr(\"uu\"), ID: Ptr(int64(3))},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tTeams: []*Team{\n\t\t\t\t\t\t\t{Slug: Ptr(\"tt\"), ID: Ptr(int64(4))},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tApps: []*App{\n\t\t\t\t\t\t\t{Slug: Ptr(\"aa\"), ID: Ptr(int64(5))},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tRequireCodeOwnerReviews: true,\n\t\t\t\t\tBypassPullRequestAllowances: &BypassPullRequestAllowances{\n\t\t\t\t\t\tUsers: []*User{\n\t\t\t\t\t\t\t{Login: Ptr(\"uuu\"), ID: Ptr(int64(10))},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tTeams: []*Team{\n\t\t\t\t\t\t\t{Slug: Ptr(\"ttt\"), ID: Ptr(int64(20))},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tApps: []*App{\n\t\t\t\t\t\t\t{Slug: Ptr(\"aaa\"), ID: Ptr(int64(30))},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tRestrictions: &BranchRestrictions{\n\t\t\t\t\tUsers: []*User{\n\t\t\t\t\t\t{Login: Ptr(\"u\"), ID: Ptr(int64(1))},\n\t\t\t\t\t},\n\t\t\t\t\tTeams: []*Team{\n\t\t\t\t\t\t{Slug: Ptr(\"t\"), ID: Ptr(int64(2))},\n\t\t\t\t\t},\n\t\t\t\t\tApps: []*App{\n\t\t\t\t\t\t{Slug: Ptr(\"a\"), ID: Ptr(int64(3))},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}\n\t\t\tif !cmp.Equal(protection, want) {\n\t\t\t\tt.Errorf(\"Repositories.UpdateBranchProtection returned %+v, want %+v\", protection, want)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_UpdateBranchProtection_EmptyChecks(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tinput := &ProtectionRequest{\n\t\t\t\tRequiredStatusChecks: &RequiredStatusChecks{\n\t\t\t\t\tStrict: true,\n\t\t\t\t\tChecks: &[]*RequiredStatusCheck{},\n\t\t\t\t},\n\t\t\t\tRequiredPullRequestReviews: &PullRequestReviewsEnforcementRequest{\n\t\t\t\t\tDismissStaleReviews: true,\n\t\t\t\t\tDismissalRestrictionsRequest: &DismissalRestrictionsRequest{\n\t\t\t\t\t\tUsers: &[]string{\"uu\"},\n\t\t\t\t\t\tTeams: &[]string{\"tt\"},\n\t\t\t\t\t\tApps:  &[]string{\"aa\"},\n\t\t\t\t\t},\n\t\t\t\t\tBypassPullRequestAllowancesRequest: &BypassPullRequestAllowancesRequest{\n\t\t\t\t\t\tUsers: []string{\"uuu\"},\n\t\t\t\t\t\tTeams: []string{\"ttt\"},\n\t\t\t\t\t\tApps:  []string{\"aaa\"},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tRestrictions: &BranchRestrictionsRequest{\n\t\t\t\t\tUsers: []string{\"u\"},\n\t\t\t\t\tTeams: []string{\"t\"},\n\t\t\t\t\tApps:  []string{\"a\"},\n\t\t\t\t},\n\t\t\t}\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\tvar v *ProtectionRequest\n\t\t\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\t\t\ttestMethod(t, r, \"PUT\")\n\t\t\t\tif !cmp.Equal(v, input) {\n\t\t\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t\t\t}\n\n\t\t\t\ttestHeader(t, r, \"Accept\", mediaTypeRequiredApprovingReviewsPreview)\n\t\t\t\tfmt.Fprint(w, `{\n\t\t\t\t\t\"required_status_checks\":{\n\t\t\t\t\t\t\"strict\":true,\n\t\t\t\t\t\t\"contexts\":null,\n\t\t\t\t\t\t\"checks\": []\n\t\t\t\t\t},\n\t\t\t\t\t\"required_pull_request_reviews\":{\n\t\t\t\t\t\t\"dismissal_restrictions\":{\n\t\t\t\t\t\t\t\"users\":[{\n\t\t\t\t\t\t\t\t\"id\":3,\n\t\t\t\t\t\t\t\t\"login\":\"uu\"\n\t\t\t\t\t\t\t}],\n\t\t\t\t\t\t\t\"teams\":[{\n\t\t\t\t\t\t\t\t\"id\":4,\n\t\t\t\t\t\t\t\t\"slug\":\"tt\"\n\t\t\t\t\t\t\t}],\n\t\t\t\t\t\t\t\"apps\":[{\n\t\t\t\t\t\t\t\t\"id\":5,\n\t\t\t\t\t\t\t\t\"slug\":\"aa\"\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"dismiss_stale_reviews\":true,\n\t\t\t\t\t\t\"require_code_owner_reviews\":true,\n\t\t\t\t\t\t\"bypass_pull_request_allowances\": {\n\t\t\t\t\t\t\t\"users\":[{\"id\":10,\"login\":\"uuu\"}],\n\t\t\t\t\t\t\t\"teams\":[{\"id\":20,\"slug\":\"ttt\"}],\n\t\t\t\t\t\t\t\"apps\":[{\"id\":30,\"slug\":\"aaa\"}]\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"restrictions\":{\n\t\t\t\t\t\t\"users\":[{\"id\":1,\"login\":\"u\"}],\n\t\t\t\t\t\t\"teams\":[{\"id\":2,\"slug\":\"t\"}],\n\t\t\t\t\t\t\"apps\":[{\"id\":3,\"slug\":\"a\"}]\n\t\t\t\t\t}\n\t\t\t\t}`)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\tprotection, _, err := client.Repositories.UpdateBranchProtection(ctx, \"o\", \"r\", test.branch, input)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.UpdateBranchProtection returned error: %v\", err)\n\t\t\t}\n\n\t\t\twant := &Protection{\n\t\t\t\tRequiredStatusChecks: &RequiredStatusChecks{\n\t\t\t\t\tStrict: true,\n\t\t\t\t\tChecks: &[]*RequiredStatusCheck{},\n\t\t\t\t},\n\t\t\t\tRequiredPullRequestReviews: &PullRequestReviewsEnforcement{\n\t\t\t\t\tDismissStaleReviews: true,\n\t\t\t\t\tDismissalRestrictions: &DismissalRestrictions{\n\t\t\t\t\t\tUsers: []*User{\n\t\t\t\t\t\t\t{Login: Ptr(\"uu\"), ID: Ptr(int64(3))},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tTeams: []*Team{\n\t\t\t\t\t\t\t{Slug: Ptr(\"tt\"), ID: Ptr(int64(4))},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tApps: []*App{\n\t\t\t\t\t\t\t{Slug: Ptr(\"aa\"), ID: Ptr(int64(5))},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tRequireCodeOwnerReviews: true,\n\t\t\t\t\tBypassPullRequestAllowances: &BypassPullRequestAllowances{\n\t\t\t\t\t\tUsers: []*User{\n\t\t\t\t\t\t\t{Login: Ptr(\"uuu\"), ID: Ptr(int64(10))},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tTeams: []*Team{\n\t\t\t\t\t\t\t{Slug: Ptr(\"ttt\"), ID: Ptr(int64(20))},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tApps: []*App{\n\t\t\t\t\t\t\t{Slug: Ptr(\"aaa\"), ID: Ptr(int64(30))},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tRestrictions: &BranchRestrictions{\n\t\t\t\t\tUsers: []*User{\n\t\t\t\t\t\t{Login: Ptr(\"u\"), ID: Ptr(int64(1))},\n\t\t\t\t\t},\n\t\t\t\t\tTeams: []*Team{\n\t\t\t\t\t\t{Slug: Ptr(\"t\"), ID: Ptr(int64(2))},\n\t\t\t\t\t},\n\t\t\t\t\tApps: []*App{\n\t\t\t\t\t\t{Slug: Ptr(\"a\"), ID: Ptr(int64(3))},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}\n\t\t\tif !cmp.Equal(protection, want) {\n\t\t\t\tt.Errorf(\"Repositories.UpdateBranchProtection returned %+v, want %+v\", protection, want)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_UpdateBranchProtection_StrictNoChecks(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tinput := &ProtectionRequest{\n\t\t\t\tRequiredStatusChecks: &RequiredStatusChecks{\n\t\t\t\t\tStrict: true,\n\t\t\t\t},\n\t\t\t\tRequiredPullRequestReviews: &PullRequestReviewsEnforcementRequest{\n\t\t\t\t\tDismissStaleReviews: true,\n\t\t\t\t\tDismissalRestrictionsRequest: &DismissalRestrictionsRequest{\n\t\t\t\t\t\tUsers: &[]string{\"uu\"},\n\t\t\t\t\t\tTeams: &[]string{\"tt\"},\n\t\t\t\t\t\tApps:  &[]string{\"aa\"},\n\t\t\t\t\t},\n\t\t\t\t\tBypassPullRequestAllowancesRequest: &BypassPullRequestAllowancesRequest{\n\t\t\t\t\t\tUsers: []string{\"uuu\"},\n\t\t\t\t\t\tTeams: []string{\"ttt\"},\n\t\t\t\t\t\tApps:  []string{\"aaa\"},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tRestrictions: &BranchRestrictionsRequest{\n\t\t\t\t\tUsers: []string{\"u\"},\n\t\t\t\t\tTeams: []string{\"t\"},\n\t\t\t\t\tApps:  []string{\"a\"},\n\t\t\t\t},\n\t\t\t}\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\tvar v *ProtectionRequest\n\t\t\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\t\t\ttestMethod(t, r, \"PUT\")\n\t\t\t\tif !cmp.Equal(v, input) {\n\t\t\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t\t\t}\n\n\t\t\t\ttestHeader(t, r, \"Accept\", mediaTypeRequiredApprovingReviewsPreview)\n\t\t\t\tfmt.Fprint(w, `{\n\t\t\t\t\t\"required_status_checks\":{\n\t\t\t\t\t\t\"strict\":true,\n\t\t\t\t\t\t\"contexts\":[]\n\t\t\t\t\t},\n\t\t\t\t\t\"required_pull_request_reviews\":{\n\t\t\t\t\t\t\"dismissal_restrictions\":{\n\t\t\t\t\t\t\t\"users\":[{\n\t\t\t\t\t\t\t\t\"id\":3,\n\t\t\t\t\t\t\t\t\"login\":\"uu\"\n\t\t\t\t\t\t\t}],\n\t\t\t\t\t\t\t\"teams\":[{\n\t\t\t\t\t\t\t\t\"id\":4,\n\t\t\t\t\t\t\t\t\"slug\":\"tt\"\n\t\t\t\t\t\t\t}],\n\t\t\t\t\t\t\t\"apps\":[{\n\t\t\t\t\t\t\t\t\"id\":5,\n\t\t\t\t\t\t\t\t\"slug\":\"aa\"\n\t\t\t\t\t\t\t}]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"dismiss_stale_reviews\":true,\n\t\t\t\t\t\t\"require_code_owner_reviews\":true,\n\t\t\t\t\t\t\"require_last_push_approval\":false,\n\t\t\t\t\t\t\"bypass_pull_request_allowances\": {\n\t\t\t\t\t\t\t\"users\":[{\"id\":10,\"login\":\"uuu\"}],\n\t\t\t\t\t\t\t\"teams\":[{\"id\":20,\"slug\":\"ttt\"}],\n\t\t\t\t\t\t\t\"apps\":[{\"id\":30,\"slug\":\"aaa\"}]\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t\"restrictions\":{\n\t\t\t\t\t\t\"users\":[{\"id\":1,\"login\":\"u\"}],\n\t\t\t\t\t\t\"teams\":[{\"id\":2,\"slug\":\"t\"}],\n\t\t\t\t\t\t\"apps\":[{\"id\":3,\"slug\":\"a\"}]\n\t\t\t\t\t}\n\t\t\t\t}`)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\tprotection, _, err := client.Repositories.UpdateBranchProtection(ctx, \"o\", \"r\", test.branch, input)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.UpdateBranchProtection returned error: %v\", err)\n\t\t\t}\n\n\t\t\twant := &Protection{\n\t\t\t\tRequiredStatusChecks: &RequiredStatusChecks{\n\t\t\t\t\tStrict:   true,\n\t\t\t\t\tContexts: &[]string{},\n\t\t\t\t},\n\t\t\t\tRequiredPullRequestReviews: &PullRequestReviewsEnforcement{\n\t\t\t\t\tDismissStaleReviews: true,\n\t\t\t\t\tDismissalRestrictions: &DismissalRestrictions{\n\t\t\t\t\t\tUsers: []*User{\n\t\t\t\t\t\t\t{Login: Ptr(\"uu\"), ID: Ptr(int64(3))},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tTeams: []*Team{\n\t\t\t\t\t\t\t{Slug: Ptr(\"tt\"), ID: Ptr(int64(4))},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tApps: []*App{\n\t\t\t\t\t\t\t{Slug: Ptr(\"aa\"), ID: Ptr(int64(5))},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tRequireCodeOwnerReviews: true,\n\t\t\t\t\tBypassPullRequestAllowances: &BypassPullRequestAllowances{\n\t\t\t\t\t\tUsers: []*User{\n\t\t\t\t\t\t\t{Login: Ptr(\"uuu\"), ID: Ptr(int64(10))},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tTeams: []*Team{\n\t\t\t\t\t\t\t{Slug: Ptr(\"ttt\"), ID: Ptr(int64(20))},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tApps: []*App{\n\t\t\t\t\t\t\t{Slug: Ptr(\"aaa\"), ID: Ptr(int64(30))},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tRestrictions: &BranchRestrictions{\n\t\t\t\t\tUsers: []*User{\n\t\t\t\t\t\t{Login: Ptr(\"u\"), ID: Ptr(int64(1))},\n\t\t\t\t\t},\n\t\t\t\t\tTeams: []*Team{\n\t\t\t\t\t\t{Slug: Ptr(\"t\"), ID: Ptr(int64(2))},\n\t\t\t\t\t},\n\t\t\t\t\tApps: []*App{\n\t\t\t\t\t\t{Slug: Ptr(\"a\"), ID: Ptr(int64(3))},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}\n\t\t\tif !cmp.Equal(protection, want) {\n\t\t\t\tt.Errorf(\"Repositories.UpdateBranchProtection returned %+v, want %+v\", protection, want)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_UpdateBranchProtection_RequireLastPushApproval(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tinput := &ProtectionRequest{\n\t\t\t\tRequiredPullRequestReviews: &PullRequestReviewsEnforcementRequest{\n\t\t\t\t\tRequireLastPushApproval: Ptr(true),\n\t\t\t\t},\n\t\t\t}\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\tvar v *ProtectionRequest\n\t\t\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\t\t\ttestMethod(t, r, \"PUT\")\n\t\t\t\tif !cmp.Equal(v, input) {\n\t\t\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t\t\t}\n\n\t\t\t\tfmt.Fprint(w, `{\n\t\t\t\t\t\"required_pull_request_reviews\":{\n\t\t\t\t\t\t\"require_last_push_approval\":true\n\t\t\t\t\t}\n\t\t\t\t}`)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\tprotection, _, err := client.Repositories.UpdateBranchProtection(ctx, \"o\", \"r\", test.branch, input)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.UpdateBranchProtection returned error: %v\", err)\n\t\t\t}\n\n\t\t\twant := &Protection{\n\t\t\t\tRequiredPullRequestReviews: &PullRequestReviewsEnforcement{\n\t\t\t\t\tRequireLastPushApproval: true,\n\t\t\t\t},\n\t\t\t}\n\t\t\tif !cmp.Equal(protection, want) {\n\t\t\t\tt.Errorf(\"Repositories.UpdateBranchProtection returned %+v, want %+v\", protection, want)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_RemoveBranchProtection(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"DELETE\")\n\t\t\t\tw.WriteHeader(http.StatusNoContent)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\t_, err := client.Repositories.RemoveBranchProtection(ctx, \"o\", \"r\", test.branch)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.RemoveBranchProtection returned error: %v\", err)\n\t\t\t}\n\n\t\t\tconst methodName = \"RemoveBranchProtection\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, err = client.Repositories.RemoveBranchProtection(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\treturn client.Repositories.RemoveBranchProtection(ctx, \"o\", \"r\", test.branch)\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_ListLanguages_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.ListLanguages(ctx, \"%\", \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestRepositoriesService_License(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/license\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"name\": \"LICENSE\", \"path\": \"LICENSE\", \"license\":{\"key\":\"mit\",\"name\":\"MIT License\",\"spdx_id\":\"MIT\",\"url\":\"https://api.github.com/licenses/mit\",\"featured\":true}}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.License(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.License returned error: %v\", err)\n\t}\n\n\twant := &RepositoryLicense{\n\t\tName: Ptr(\"LICENSE\"),\n\t\tPath: Ptr(\"LICENSE\"),\n\t\tLicense: &License{\n\t\t\tName:     Ptr(\"MIT License\"),\n\t\t\tKey:      Ptr(\"mit\"),\n\t\t\tSPDXID:   Ptr(\"MIT\"),\n\t\t\tURL:      Ptr(\"https://api.github.com/licenses/mit\"),\n\t\t\tFeatured: Ptr(true),\n\t\t},\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.License returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"License\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.License(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.License(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_GetRequiredStatusChecks(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/required_status_checks\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/required_status_checks\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\tfmt.Fprint(w, `{\n\t\t\t\t\t\"strict\": true,\n\t\t\t\t\t\"contexts\": [\"x\",\"y\",\"z\"],\n\t\t\t\t\t\"checks\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"context\": \"x\",\n\t\t\t\t\t\t\t\"app_id\": null\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"context\": \"y\",\n\t\t\t\t\t\t\t\"app_id\": null\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"context\": \"z\",\n\t\t\t\t\t\t\t\"app_id\": null\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}`)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\tchecks, _, err := client.Repositories.GetRequiredStatusChecks(ctx, \"o\", \"r\", test.branch)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.GetRequiredStatusChecks returned error: %v\", err)\n\t\t\t}\n\n\t\t\twant := &RequiredStatusChecks{\n\t\t\t\tStrict:   true,\n\t\t\t\tContexts: &[]string{\"x\", \"y\", \"z\"},\n\t\t\t\tChecks: &[]*RequiredStatusCheck{\n\t\t\t\t\t{\n\t\t\t\t\t\tContext: \"x\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tContext: \"y\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tContext: \"z\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}\n\t\t\tif !cmp.Equal(checks, want) {\n\t\t\t\tt.Errorf(\"Repositories.GetRequiredStatusChecks returned %+v, want %+v\", checks, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"GetRequiredStatusChecks\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.GetRequiredStatusChecks(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := client.Repositories.GetRequiredStatusChecks(ctx, \"o\", \"r\", test.branch)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_GetRequiredStatusChecks_branchNotProtected(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/required_status_checks\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/required_status_checks\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\n\t\t\t\tw.WriteHeader(http.StatusBadRequest)\n\t\t\t\tfmt.Fprintf(w, `{\n\t\t\t\"message\": %q,\n\t\t\t\"documentation_url\": \"https://docs.github.com/rest/repos#get-branch-protection\"\n\t\t\t}`, githubBranchNotProtected)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\tchecks, _, err := client.Repositories.GetRequiredStatusChecks(ctx, \"o\", \"r\", test.branch)\n\n\t\t\tif checks != nil {\n\t\t\t\tt.Error(\"Repositories.GetRequiredStatusChecks returned non-nil status-checks data\")\n\t\t\t}\n\n\t\t\tif !errors.Is(err, ErrBranchNotProtected) {\n\t\t\t\tt.Errorf(\"Repositories.GetRequiredStatusChecks returned an invalid error: %v\", err)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_UpdateRequiredStatusChecks_Contexts(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/required_status_checks\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/required_status_checks\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tinput := &RequiredStatusChecksRequest{\n\t\t\t\tStrict:   Ptr(true),\n\t\t\t\tContexts: []string{\"continuous-integration\"},\n\t\t\t}\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\tvar v *RequiredStatusChecksRequest\n\t\t\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\t\t\ttestMethod(t, r, \"PATCH\")\n\t\t\t\tif !cmp.Equal(v, input) {\n\t\t\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t\t\t}\n\t\t\t\ttestHeader(t, r, \"Accept\", mediaTypeV3)\n\t\t\t\tfmt.Fprint(w, `{\n\t\t\t\t\t\"strict\":true,\n\t\t\t\t\t\"contexts\":[\"continuous-integration\"],\n\t\t\t\t\t\"checks\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"context\": \"continuous-integration\",\n\t\t\t\t\t\t\t\"app_id\": null\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}`)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\tstatusChecks, _, err := client.Repositories.UpdateRequiredStatusChecks(ctx, \"o\", \"r\", test.branch, input)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.UpdateRequiredStatusChecks returned error: %v\", err)\n\t\t\t}\n\n\t\t\twant := &RequiredStatusChecks{\n\t\t\t\tStrict:   true,\n\t\t\t\tContexts: &[]string{\"continuous-integration\"},\n\t\t\t\tChecks: &[]*RequiredStatusCheck{\n\t\t\t\t\t{\n\t\t\t\t\t\tContext: \"continuous-integration\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}\n\t\t\tif !cmp.Equal(statusChecks, want) {\n\t\t\t\tt.Errorf(\"Repositories.UpdateRequiredStatusChecks returned %+v, want %+v\", statusChecks, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"UpdateRequiredStatusChecks\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.UpdateRequiredStatusChecks(ctx, \"\\n\", \"\\n\", \"\\n\", input)\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := client.Repositories.UpdateRequiredStatusChecks(ctx, \"o\", \"r\", test.branch, input)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_UpdateRequiredStatusChecks_Checks(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/required_status_checks\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/required_status_checks\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tappID := int64(123)\n\t\t\tnoAppID := int64(-1)\n\t\t\tinput := &RequiredStatusChecksRequest{\n\t\t\t\tStrict: Ptr(true),\n\t\t\t\tChecks: []*RequiredStatusCheck{\n\t\t\t\t\t{\n\t\t\t\t\t\tContext: \"continuous-integration\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tContext: \"continuous-integration2\",\n\t\t\t\t\t\tAppID:   &appID,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tContext: \"continuous-integration3\",\n\t\t\t\t\t\tAppID:   &noAppID,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\tvar v *RequiredStatusChecksRequest\n\t\t\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\t\t\ttestMethod(t, r, \"PATCH\")\n\t\t\t\tif !cmp.Equal(v, input) {\n\t\t\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t\t\t}\n\t\t\t\ttestHeader(t, r, \"Accept\", mediaTypeV3)\n\t\t\t\tfmt.Fprint(w, `{\n\t\t\t\t\t\"strict\":true,\n\t\t\t\t\t\"contexts\":[\"continuous-integration\"],\n\t\t\t\t\t\"checks\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"context\": \"continuous-integration\",\n\t\t\t\t\t\t\t\"app_id\": null\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"context\": \"continuous-integration2\",\n\t\t\t\t\t\t\t\"app_id\": 123\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"context\": \"continuous-integration3\",\n\t\t\t\t\t\t\t\"app_id\": null\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}`)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\tstatusChecks, _, err := client.Repositories.UpdateRequiredStatusChecks(ctx, \"o\", \"r\", test.branch, input)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.UpdateRequiredStatusChecks returned error: %v\", err)\n\t\t\t}\n\n\t\t\twant := &RequiredStatusChecks{\n\t\t\t\tStrict:   true,\n\t\t\t\tContexts: &[]string{\"continuous-integration\"},\n\t\t\t\tChecks: &[]*RequiredStatusCheck{\n\t\t\t\t\t{\n\t\t\t\t\t\tContext: \"continuous-integration\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tContext: \"continuous-integration2\",\n\t\t\t\t\t\tAppID:   &appID,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tContext: \"continuous-integration3\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}\n\t\t\tif !cmp.Equal(statusChecks, want) {\n\t\t\t\tt.Errorf(\"Repositories.UpdateRequiredStatusChecks returned %+v, want %+v\", statusChecks, want)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_RemoveRequiredStatusChecks(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/required_status_checks\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/required_status_checks\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"DELETE\")\n\t\t\t\ttestHeader(t, r, \"Accept\", mediaTypeV3)\n\t\t\t\tw.WriteHeader(http.StatusNoContent)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\t_, err := client.Repositories.RemoveRequiredStatusChecks(ctx, \"o\", \"r\", test.branch)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.RemoveRequiredStatusChecks returned error: %v\", err)\n\t\t\t}\n\n\t\t\tconst methodName = \"RemoveRequiredStatusChecks\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, err = client.Repositories.RemoveRequiredStatusChecks(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\treturn client.Repositories.RemoveRequiredStatusChecks(ctx, \"o\", \"r\", test.branch)\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_ListRequiredStatusChecksContexts(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/required_status_checks/contexts\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/required_status_checks/contexts\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\tfmt.Fprint(w, `[\"x\", \"y\", \"z\"]`)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\tcontexts, _, err := client.Repositories.ListRequiredStatusChecksContexts(ctx, \"o\", \"r\", test.branch)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.ListRequiredStatusChecksContexts returned error: %v\", err)\n\t\t\t}\n\n\t\t\twant := []string{\"x\", \"y\", \"z\"}\n\t\t\tif !cmp.Equal(contexts, want) {\n\t\t\t\tt.Errorf(\"Repositories.ListRequiredStatusChecksContexts returned %+v, want %+v\", contexts, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"ListRequiredStatusChecksContexts\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.ListRequiredStatusChecksContexts(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := client.Repositories.ListRequiredStatusChecksContexts(ctx, \"o\", \"r\", test.branch)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_ListRequiredStatusChecksContexts_branchNotProtected(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/required_status_checks/contexts\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/required_status_checks/contexts\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\n\t\t\t\tw.WriteHeader(http.StatusBadRequest)\n\t\t\t\tfmt.Fprintf(w, `{\n\t\t\t\"message\": %q,\n\t\t\t\"documentation_url\": \"https://docs.github.com/rest/repos#get-branch-protection\"\n\t\t\t}`, githubBranchNotProtected)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\tcontexts, _, err := client.Repositories.ListRequiredStatusChecksContexts(ctx, \"o\", \"r\", test.branch)\n\n\t\t\tif contexts != nil {\n\t\t\t\tt.Error(\"Repositories.ListRequiredStatusChecksContexts returned non-nil contexts data\")\n\t\t\t}\n\n\t\t\tif !errors.Is(err, ErrBranchNotProtected) {\n\t\t\t\tt.Errorf(\"Repositories.ListRequiredStatusChecksContexts returned an invalid error: %v\", err)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_GetPullRequestReviewEnforcement(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/required_pull_request_reviews\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/required_pull_request_reviews\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\ttestHeader(t, r, \"Accept\", mediaTypeRequiredApprovingReviewsPreview)\n\t\t\t\tfmt.Fprint(w, `{\n\t\t\t\"dismissal_restrictions\":{\n\t\t\t\t\"users\":[{\"id\":1,\"login\":\"u\"}],\n\t\t\t\t\"teams\":[{\"id\":2,\"slug\":\"t\"}],\n\t\t\t\t\"apps\":[{\"id\":3,\"slug\":\"a\"}]\n\t\t\t},\n\t\t\t\"dismiss_stale_reviews\":true,\n\t\t\t\"require_code_owner_reviews\":true,\n\t\t\t\"required_approving_review_count\":1\n\t\t}`)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\tenforcement, _, err := client.Repositories.GetPullRequestReviewEnforcement(ctx, \"o\", \"r\", test.branch)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.GetPullRequestReviewEnforcement returned error: %v\", err)\n\t\t\t}\n\n\t\t\twant := &PullRequestReviewsEnforcement{\n\t\t\t\tDismissStaleReviews: true,\n\t\t\t\tDismissalRestrictions: &DismissalRestrictions{\n\t\t\t\t\tUsers: []*User{\n\t\t\t\t\t\t{Login: Ptr(\"u\"), ID: Ptr(int64(1))},\n\t\t\t\t\t},\n\t\t\t\t\tTeams: []*Team{\n\t\t\t\t\t\t{Slug: Ptr(\"t\"), ID: Ptr(int64(2))},\n\t\t\t\t\t},\n\t\t\t\t\tApps: []*App{\n\t\t\t\t\t\t{Slug: Ptr(\"a\"), ID: Ptr(int64(3))},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tRequireCodeOwnerReviews:      true,\n\t\t\t\tRequiredApprovingReviewCount: 1,\n\t\t\t}\n\n\t\t\tif !cmp.Equal(enforcement, want) {\n\t\t\t\tt.Errorf(\"Repositories.GetPullRequestReviewEnforcement returned %+v, want %+v\", enforcement, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"GetPullRequestReviewEnforcement\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.GetPullRequestReviewEnforcement(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := client.Repositories.GetPullRequestReviewEnforcement(ctx, \"o\", \"r\", test.branch)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_UpdatePullRequestReviewEnforcement(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/required_pull_request_reviews\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/required_pull_request_reviews\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tinput := &PullRequestReviewsEnforcementUpdate{\n\t\t\t\tDismissalRestrictionsRequest: &DismissalRestrictionsRequest{\n\t\t\t\t\tUsers: &[]string{\"u\"},\n\t\t\t\t\tTeams: &[]string{\"t\"},\n\t\t\t\t\tApps:  &[]string{\"a\"},\n\t\t\t\t},\n\t\t\t}\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\tvar v *PullRequestReviewsEnforcementUpdate\n\t\t\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\t\t\ttestMethod(t, r, \"PATCH\")\n\t\t\t\tif !cmp.Equal(v, input) {\n\t\t\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t\t\t}\n\t\t\t\ttestHeader(t, r, \"Accept\", mediaTypeRequiredApprovingReviewsPreview)\n\t\t\t\tfmt.Fprint(w, `{\n\t\t\t\t\t\"dismissal_restrictions\":{\n\t\t\t\t\t\t\"users\":[{\"id\":1,\"login\":\"u\"}],\n\t\t\t\t\t\t\"teams\":[{\"id\":2,\"slug\":\"t\"}],\n\t\t\t\t\t\t\"apps\":[{\"id\":3,\"slug\":\"a\"}]\n\t\t\t\t\t},\n\t\t\t\t\t\"dismiss_stale_reviews\":true,\n\t\t\t\t\t\"require_code_owner_reviews\":true,\n\t\t\t\t\t\"required_approving_review_count\":3\n\t\t\t\t}`)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\tenforcement, _, err := client.Repositories.UpdatePullRequestReviewEnforcement(ctx, \"o\", \"r\", test.branch, input)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.UpdatePullRequestReviewEnforcement returned error: %v\", err)\n\t\t\t}\n\n\t\t\twant := &PullRequestReviewsEnforcement{\n\t\t\t\tDismissStaleReviews: true,\n\t\t\t\tDismissalRestrictions: &DismissalRestrictions{\n\t\t\t\t\tUsers: []*User{\n\t\t\t\t\t\t{Login: Ptr(\"u\"), ID: Ptr(int64(1))},\n\t\t\t\t\t},\n\t\t\t\t\tTeams: []*Team{\n\t\t\t\t\t\t{Slug: Ptr(\"t\"), ID: Ptr(int64(2))},\n\t\t\t\t\t},\n\t\t\t\t\tApps: []*App{\n\t\t\t\t\t\t{Slug: Ptr(\"a\"), ID: Ptr(int64(3))},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tRequireCodeOwnerReviews:      true,\n\t\t\t\tRequiredApprovingReviewCount: 3,\n\t\t\t}\n\t\t\tif !cmp.Equal(enforcement, want) {\n\t\t\t\tt.Errorf(\"Repositories.UpdatePullRequestReviewEnforcement returned %+v, want %+v\", enforcement, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"UpdatePullRequestReviewEnforcement\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.UpdatePullRequestReviewEnforcement(ctx, \"\\n\", \"\\n\", \"\\n\", input)\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := client.Repositories.UpdatePullRequestReviewEnforcement(ctx, \"o\", \"r\", test.branch, input)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_DisableDismissalRestrictions(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/required_pull_request_reviews\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/required_pull_request_reviews\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"PATCH\")\n\t\t\t\ttestHeader(t, r, \"Accept\", mediaTypeRequiredApprovingReviewsPreview)\n\t\t\t\ttestBody(t, r, `{\"dismissal_restrictions\":{}}`+\"\\n\")\n\t\t\t\tfmt.Fprint(w, `{\"dismiss_stale_reviews\":true,\"require_code_owner_reviews\":true,\"required_approving_review_count\":1}`)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\tenforcement, _, err := client.Repositories.DisableDismissalRestrictions(ctx, \"o\", \"r\", test.branch)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.DisableDismissalRestrictions returned error: %v\", err)\n\t\t\t}\n\n\t\t\twant := &PullRequestReviewsEnforcement{\n\t\t\t\tDismissStaleReviews:          true,\n\t\t\t\tDismissalRestrictions:        nil,\n\t\t\t\tRequireCodeOwnerReviews:      true,\n\t\t\t\tRequiredApprovingReviewCount: 1,\n\t\t\t}\n\t\t\tif !cmp.Equal(enforcement, want) {\n\t\t\t\tt.Errorf(\"Repositories.DisableDismissalRestrictions returned %+v, want %+v\", enforcement, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"DisableDismissalRestrictions\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.DisableDismissalRestrictions(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := client.Repositories.DisableDismissalRestrictions(ctx, \"o\", \"r\", test.branch)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_RemovePullRequestReviewEnforcement(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/required_pull_request_reviews\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/required_pull_request_reviews\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"DELETE\")\n\t\t\t\tw.WriteHeader(http.StatusNoContent)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\t_, err := client.Repositories.RemovePullRequestReviewEnforcement(ctx, \"o\", \"r\", test.branch)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.RemovePullRequestReviewEnforcement returned error: %v\", err)\n\t\t\t}\n\n\t\t\tconst methodName = \"RemovePullRequestReviewEnforcement\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, err = client.Repositories.RemovePullRequestReviewEnforcement(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\treturn client.Repositories.RemovePullRequestReviewEnforcement(ctx, \"o\", \"r\", test.branch)\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_GetAdminEnforcement(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/enforce_admins\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/enforce_admins\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\tfmt.Fprint(w, `{\"url\":\"/repos/o/r/branches/b/protection/enforce_admins\",\"enabled\":true}`)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\tenforcement, _, err := client.Repositories.GetAdminEnforcement(ctx, \"o\", \"r\", test.branch)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.GetAdminEnforcement returned error: %v\", err)\n\t\t\t}\n\n\t\t\twant := &AdminEnforcement{\n\t\t\t\tURL:     Ptr(\"/repos/o/r/branches/b/protection/enforce_admins\"),\n\t\t\t\tEnabled: true,\n\t\t\t}\n\n\t\t\tif !cmp.Equal(enforcement, want) {\n\t\t\t\tt.Errorf(\"Repositories.GetAdminEnforcement returned %+v, want %+v\", enforcement, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"GetAdminEnforcement\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.GetAdminEnforcement(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := client.Repositories.GetAdminEnforcement(ctx, \"o\", \"r\", test.branch)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_AddAdminEnforcement(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/enforce_admins\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/enforce_admins\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"POST\")\n\t\t\t\tfmt.Fprint(w, `{\"url\":\"/repos/o/r/branches/b/protection/enforce_admins\",\"enabled\":true}`)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\tenforcement, _, err := client.Repositories.AddAdminEnforcement(ctx, \"o\", \"r\", test.branch)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.AddAdminEnforcement returned error: %v\", err)\n\t\t\t}\n\n\t\t\twant := &AdminEnforcement{\n\t\t\t\tURL:     Ptr(\"/repos/o/r/branches/b/protection/enforce_admins\"),\n\t\t\t\tEnabled: true,\n\t\t\t}\n\t\t\tif !cmp.Equal(enforcement, want) {\n\t\t\t\tt.Errorf(\"Repositories.AddAdminEnforcement returned %+v, want %+v\", enforcement, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"AddAdminEnforcement\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.AddAdminEnforcement(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := client.Repositories.AddAdminEnforcement(ctx, \"o\", \"r\", test.branch)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_RemoveAdminEnforcement(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/enforce_admins\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/enforce_admins\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"DELETE\")\n\t\t\t\tw.WriteHeader(http.StatusNoContent)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\t_, err := client.Repositories.RemoveAdminEnforcement(ctx, \"o\", \"r\", test.branch)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.RemoveAdminEnforcement returned error: %v\", err)\n\t\t\t}\n\n\t\t\tconst methodName = \"RemoveAdminEnforcement\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, err = client.Repositories.RemoveAdminEnforcement(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\treturn client.Repositories.RemoveAdminEnforcement(ctx, \"o\", \"r\", test.branch)\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_GetSignaturesProtectedBranch(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/required_signatures\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/required_signatures\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t\ttestHeader(t, r, \"Accept\", mediaTypeSignaturePreview)\n\t\t\t\tfmt.Fprint(w, `{\"url\":\"/repos/o/r/branches/b/protection/required_signatures\",\"enabled\":false}`)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\tsignature, _, err := client.Repositories.GetSignaturesProtectedBranch(ctx, \"o\", \"r\", test.branch)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.GetSignaturesProtectedBranch returned error: %v\", err)\n\t\t\t}\n\n\t\t\twant := &SignaturesProtectedBranch{\n\t\t\t\tURL:     Ptr(\"/repos/o/r/branches/b/protection/required_signatures\"),\n\t\t\t\tEnabled: Ptr(false),\n\t\t\t}\n\n\t\t\tif !cmp.Equal(signature, want) {\n\t\t\t\tt.Errorf(\"Repositories.GetSignaturesProtectedBranch returned %+v, want %+v\", signature, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"GetSignaturesProtectedBranch\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.GetSignaturesProtectedBranch(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := client.Repositories.GetSignaturesProtectedBranch(ctx, \"o\", \"r\", test.branch)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_GetSignaturesProtectedBranch_branchNotProtected(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/required_signatures\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/required_signatures\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\n\t\t\t\tw.WriteHeader(http.StatusBadRequest)\n\t\t\t\tfmt.Fprintf(w, `{\n\t\t\t\"message\": %q,\n\t\t\t\"documentation_url\": \"https://docs.github.com/rest/repos#get-branch-protection\"\n\t\t\t}`, githubBranchNotProtected)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\tchecks, _, err := client.Repositories.GetSignaturesProtectedBranch(ctx, \"o\", \"r\", test.branch)\n\n\t\t\tif checks != nil {\n\t\t\t\tt.Error(\"Repositories.GetSignaturesProtectedBranch returned non-nil status-checks data\")\n\t\t\t}\n\n\t\t\tif !errors.Is(err, ErrBranchNotProtected) {\n\t\t\t\tt.Errorf(\"Repositories.GetSignaturesProtectedBranch returned an invalid error: %v\", err)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_RequireSignaturesOnProtectedBranch(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/required_signatures\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/required_signatures\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"POST\")\n\t\t\t\ttestHeader(t, r, \"Accept\", mediaTypeSignaturePreview)\n\t\t\t\tfmt.Fprint(w, `{\"url\":\"/repos/o/r/branches/b/protection/required_signatures\",\"enabled\":true}`)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\tsignature, _, err := client.Repositories.RequireSignaturesOnProtectedBranch(ctx, \"o\", \"r\", test.branch)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.RequireSignaturesOnProtectedBranch returned error: %v\", err)\n\t\t\t}\n\n\t\t\twant := &SignaturesProtectedBranch{\n\t\t\t\tURL:     Ptr(\"/repos/o/r/branches/b/protection/required_signatures\"),\n\t\t\t\tEnabled: Ptr(true),\n\t\t\t}\n\n\t\t\tif !cmp.Equal(signature, want) {\n\t\t\t\tt.Errorf(\"Repositories.RequireSignaturesOnProtectedBranch returned %+v, want %+v\", signature, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"RequireSignaturesOnProtectedBranch\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.RequireSignaturesOnProtectedBranch(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := client.Repositories.RequireSignaturesOnProtectedBranch(ctx, \"o\", \"r\", test.branch)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_OptionalSignaturesOnProtectedBranch(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/required_signatures\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/required_signatures\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"DELETE\")\n\t\t\t\ttestHeader(t, r, \"Accept\", mediaTypeSignaturePreview)\n\t\t\t\tw.WriteHeader(http.StatusNoContent)\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\t_, err := client.Repositories.OptionalSignaturesOnProtectedBranch(ctx, \"o\", \"r\", test.branch)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.OptionalSignaturesOnProtectedBranch returned error: %v\", err)\n\t\t\t}\n\n\t\t\tconst methodName = \"OptionalSignaturesOnProtectedBranch\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, err = client.Repositories.OptionalSignaturesOnProtectedBranch(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\treturn client.Repositories.OptionalSignaturesOnProtectedBranch(ctx, \"o\", \"r\", test.branch)\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestPullRequestReviewsEnforcementRequest_MarshalJSON_nilDismissalRestrictions(t *testing.T) {\n\tt.Parallel()\n\treq := PullRequestReviewsEnforcementRequest{}\n\n\tgot, err := json.Marshal(req)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequestReviewsEnforcementRequest.MarshalJSON returned error: %v\", err)\n\t}\n\n\twant := `{\"dismiss_stale_reviews\":false,\"require_code_owner_reviews\":false,\"required_approving_review_count\":0}`\n\tif want != string(got) {\n\t\tt.Errorf(\"PullRequestReviewsEnforcementRequest.MarshalJSON returned %+v, want %+v\", string(got), want)\n\t}\n\n\treq = PullRequestReviewsEnforcementRequest{\n\t\tDismissalRestrictionsRequest: &DismissalRestrictionsRequest{},\n\t}\n\n\tgot, err = json.Marshal(req)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequestReviewsEnforcementRequest.MarshalJSON returned error: %v\", err)\n\t}\n\n\twant = `{\"dismissal_restrictions\":{},\"dismiss_stale_reviews\":false,\"require_code_owner_reviews\":false,\"required_approving_review_count\":0}`\n\tif want != string(got) {\n\t\tt.Errorf(\"PullRequestReviewsEnforcementRequest.MarshalJSON returned %+v, want %+v\", string(got), want)\n\t}\n\n\treq = PullRequestReviewsEnforcementRequest{\n\t\tDismissalRestrictionsRequest: &DismissalRestrictionsRequest{\n\t\t\tUsers: &[]string{},\n\t\t\tTeams: &[]string{},\n\t\t\tApps:  &[]string{},\n\t\t},\n\t\tRequireLastPushApproval: Ptr(true),\n\t}\n\n\tgot, err = json.Marshal(req)\n\tif err != nil {\n\t\tt.Errorf(\"PullRequestReviewsEnforcementRequest.MarshalJSON returned error: %v\", err)\n\t}\n\n\twant = `{\"dismissal_restrictions\":{\"users\":[],\"teams\":[],\"apps\":[]},\"dismiss_stale_reviews\":false,\"require_code_owner_reviews\":false,\"required_approving_review_count\":0,\"require_last_push_approval\":true}`\n\tif want != string(got) {\n\t\tt.Errorf(\"PullRequestReviewsEnforcementRequest.MarshalJSON returned %+v, want %+v\", string(got), want)\n\t}\n}\n\nfunc TestRepositoriesService_ListAllTopics(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/topics\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeTopicsPreview)\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\":     \"1\",\n\t\t\t\"per_page\": \"30\",\n\t\t})\n\t\tfmt.Fprint(w, `{\"names\":[\"go\", \"go-github\", \"github\"]}`)\n\t})\n\n\tctx := t.Context()\n\topts := &ListOptions{Page: 1, PerPage: 30}\n\tgot, _, err := client.Repositories.ListAllTopics(ctx, \"o\", \"r\", opts)\n\tif err != nil {\n\t\tt.Fatalf(\"Repositories.ListAllTopics returned error: %v\", err)\n\t}\n\n\twant := []string{\"go\", \"go-github\", \"github\"}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.ListAllTopics returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ListAllTopics\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListAllTopics(ctx, \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListAllTopics(ctx, \"o\", \"r\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListAllTopics_emptyTopics(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/topics\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeTopicsPreview)\n\t\tfmt.Fprint(w, `{\"names\":[]}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.ListAllTopics(ctx, \"o\", \"r\", nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Repositories.ListAllTopics returned error: %v\", err)\n\t}\n\n\twant := []string{}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.ListAllTopics returned %+v, want %+v\", got, want)\n\t}\n}\n\nfunc TestRepositoriesService_ReplaceAllTopics(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/topics\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeTopicsPreview)\n\t\tfmt.Fprint(w, `{\"names\":[\"go\", \"go-github\", \"github\"]}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.ReplaceAllTopics(ctx, \"o\", \"r\", []string{\"go\", \"go-github\", \"github\"})\n\tif err != nil {\n\t\tt.Fatalf(\"Repositories.ReplaceAllTopics returned error: %v\", err)\n\t}\n\n\twant := []string{\"go\", \"go-github\", \"github\"}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.ReplaceAllTopics returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ReplaceAllTopics\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ReplaceAllTopics(ctx, \"\\n\", \"\\n\", []string{\"\\n\", \"\\n\", \"\\n\"})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ReplaceAllTopics(ctx, \"o\", \"r\", []string{\"go\", \"go-github\", \"github\"})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ReplaceAllTopics_nilSlice(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/topics\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeTopicsPreview)\n\t\ttestBody(t, r, `{\"names\":[]}`+\"\\n\")\n\t\tfmt.Fprint(w, `{\"names\":[]}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.ReplaceAllTopics(ctx, \"o\", \"r\", nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Repositories.ReplaceAllTopics returned error: %v\", err)\n\t}\n\n\twant := []string{}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.ReplaceAllTopics returned %+v, want %+v\", got, want)\n\t}\n}\n\nfunc TestRepositoriesService_ReplaceAllTopics_emptySlice(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/topics\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeTopicsPreview)\n\t\ttestBody(t, r, `{\"names\":[]}`+\"\\n\")\n\t\tfmt.Fprint(w, `{\"names\":[]}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.ReplaceAllTopics(ctx, \"o\", \"r\", []string{})\n\tif err != nil {\n\t\tt.Fatalf(\"Repositories.ReplaceAllTopics returned error: %v\", err)\n\t}\n\n\twant := []string{}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.ReplaceAllTopics returned %+v, want %+v\", got, want)\n\t}\n}\n\nfunc TestRepositoriesService_ListAppRestrictions(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/restrictions/apps\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/restrictions/apps\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(_ http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\t_, _, err := client.Repositories.ListAppRestrictions(ctx, \"o\", \"r\", test.branch)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.ListAppRestrictions returned error: %v\", err)\n\t\t\t}\n\n\t\t\tconst methodName = \"ListAppRestrictions\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.ListAppRestrictions(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := client.Repositories.ListAppRestrictions(ctx, \"o\", \"r\", test.branch)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_ReplaceAppRestrictions(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/restrictions/apps\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/restrictions/apps\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"PUT\")\n\t\t\t\tfmt.Fprint(w, `[{\n\t\t\t\t\"name\": \"octocat\"\n\t\t\t}]`)\n\t\t\t})\n\t\t\tinput := []string{\"octocat\"}\n\t\t\tctx := t.Context()\n\t\t\tgot, _, err := client.Repositories.ReplaceAppRestrictions(ctx, \"o\", \"r\", test.branch, input)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.ReplaceAppRestrictions returned error: %v\", err)\n\t\t\t}\n\t\t\twant := []*App{\n\t\t\t\t{Name: Ptr(\"octocat\")},\n\t\t\t}\n\t\t\tif !cmp.Equal(got, want) {\n\t\t\t\tt.Errorf(\"Repositories.ReplaceAppRestrictions returned %+v, want %+v\", got, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"ReplaceAppRestrictions\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.ReplaceAppRestrictions(ctx, \"\\n\", \"\\n\", \"\\n\", input)\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := client.Repositories.ReplaceAppRestrictions(ctx, \"o\", \"r\", test.branch, input)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_AddAppRestrictions(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/restrictions/apps\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/restrictions/apps\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"POST\")\n\t\t\t\tfmt.Fprint(w, `[{\n\t\t\t\t\"name\": \"octocat\"\n\t\t\t}]`)\n\t\t\t})\n\t\t\tinput := []string{\"octocat\"}\n\t\t\tctx := t.Context()\n\t\t\tgot, _, err := client.Repositories.AddAppRestrictions(ctx, \"o\", \"r\", test.branch, input)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.AddAppRestrictions returned error: %v\", err)\n\t\t\t}\n\t\t\twant := []*App{\n\t\t\t\t{Name: Ptr(\"octocat\")},\n\t\t\t}\n\t\t\tif !cmp.Equal(got, want) {\n\t\t\t\tt.Errorf(\"Repositories.AddAppRestrictions returned %+v, want %+v\", got, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"AddAppRestrictions\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.AddAppRestrictions(ctx, \"\\n\", \"\\n\", \"\\n\", input)\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := client.Repositories.AddAppRestrictions(ctx, \"o\", \"r\", test.branch, input)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_RemoveAppRestrictions(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/restrictions/apps\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/restrictions/apps\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"DELETE\")\n\t\t\t\tfmt.Fprint(w, `[]`)\n\t\t\t})\n\t\t\tinput := []string{\"octocat\"}\n\t\t\tctx := t.Context()\n\t\t\tgot, _, err := client.Repositories.RemoveAppRestrictions(ctx, \"o\", \"r\", test.branch, input)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.RemoveAppRestrictions returned error: %v\", err)\n\t\t\t}\n\t\t\twant := []*App{}\n\t\t\tif !cmp.Equal(got, want) {\n\t\t\t\tt.Errorf(\"Repositories.RemoveAppRestrictions returned %+v, want %+v\", got, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"RemoveAppRestrictions\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.RemoveAppRestrictions(ctx, \"\\n\", \"\\n\", \"\\n\", input)\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := client.Repositories.RemoveAppRestrictions(ctx, \"o\", \"r\", test.branch, input)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_ListTeamRestrictions(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/restrictions/teams\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/restrictions/teams\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(_ http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\t_, _, err := client.Repositories.ListTeamRestrictions(ctx, \"o\", \"r\", test.branch)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.ListTeamRestrictions returned error: %v\", err)\n\t\t\t}\n\n\t\t\tconst methodName = \"ListTeamRestrictions\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.ListTeamRestrictions(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := client.Repositories.ListTeamRestrictions(ctx, \"o\", \"r\", test.branch)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_ReplaceTeamRestrictions(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/restrictions/teams\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/restrictions/teams\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"PUT\")\n\t\t\t\tfmt.Fprint(w, `[{\n\t\t\t\t\"name\": \"octocat\"\n\t\t\t}]`)\n\t\t\t})\n\t\t\tinput := []string{\"octocat\"}\n\t\t\tctx := t.Context()\n\t\t\tgot, _, err := client.Repositories.ReplaceTeamRestrictions(ctx, \"o\", \"r\", test.branch, input)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.ReplaceTeamRestrictions returned error: %v\", err)\n\t\t\t}\n\t\t\twant := []*Team{\n\t\t\t\t{Name: Ptr(\"octocat\")},\n\t\t\t}\n\t\t\tif !cmp.Equal(got, want) {\n\t\t\t\tt.Errorf(\"Repositories.ReplaceTeamRestrictions returned %+v, want %+v\", got, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"ReplaceTeamRestrictions\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.ReplaceTeamRestrictions(ctx, \"\\n\", \"\\n\", \"\\n\", input)\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := client.Repositories.ReplaceTeamRestrictions(ctx, \"o\", \"r\", test.branch, input)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_AddTeamRestrictions(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/restrictions/teams\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/restrictions/teams\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"POST\")\n\t\t\t\tfmt.Fprint(w, `[{\n\t\t\t\t\"name\": \"octocat\"\n\t\t\t}]`)\n\t\t\t})\n\t\t\tinput := []string{\"octocat\"}\n\t\t\tctx := t.Context()\n\t\t\tgot, _, err := client.Repositories.AddTeamRestrictions(ctx, \"o\", \"r\", test.branch, input)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.AddTeamRestrictions returned error: %v\", err)\n\t\t\t}\n\t\t\twant := []*Team{\n\t\t\t\t{Name: Ptr(\"octocat\")},\n\t\t\t}\n\t\t\tif !cmp.Equal(got, want) {\n\t\t\t\tt.Errorf(\"Repositories.AddTeamRestrictions returned %+v, want %+v\", got, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"AddTeamRestrictions\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.AddTeamRestrictions(ctx, \"\\n\", \"\\n\", \"\\n\", input)\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := client.Repositories.AddTeamRestrictions(ctx, \"o\", \"r\", test.branch, input)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_RemoveTeamRestrictions(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/restrictions/teams\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/restrictions/teams\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"DELETE\")\n\t\t\t\tfmt.Fprint(w, `[]`)\n\t\t\t})\n\t\t\tinput := []string{\"octocat\"}\n\t\t\tctx := t.Context()\n\t\t\tgot, _, err := client.Repositories.RemoveTeamRestrictions(ctx, \"o\", \"r\", test.branch, input)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.RemoveTeamRestrictions returned error: %v\", err)\n\t\t\t}\n\t\t\twant := []*Team{}\n\t\t\tif !cmp.Equal(got, want) {\n\t\t\t\tt.Errorf(\"Repositories.RemoveTeamRestrictions returned %+v, want %+v\", got, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"RemoveTeamRestrictions\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.RemoveTeamRestrictions(ctx, \"\\n\", \"\\n\", \"\\n\", input)\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := client.Repositories.RemoveTeamRestrictions(ctx, \"o\", \"r\", test.branch, input)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_ListUserRestrictions(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/restrictions/users\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/restrictions/users\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(_ http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"GET\")\n\t\t\t})\n\n\t\t\tctx := t.Context()\n\t\t\t_, _, err := client.Repositories.ListUserRestrictions(ctx, \"o\", \"r\", test.branch)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.ListUserRestrictions returned error: %v\", err)\n\t\t\t}\n\n\t\t\tconst methodName = \"ListUserRestrictions\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.ListUserRestrictions(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := client.Repositories.ListUserRestrictions(ctx, \"o\", \"r\", test.branch)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_ReplaceUserRestrictions(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/restrictions/users\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/restrictions/users\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"PUT\")\n\t\t\t\tfmt.Fprint(w, `[{\n\t\t\t\t\"name\": \"octocat\"\n\t\t\t}]`)\n\t\t\t})\n\t\t\tinput := []string{\"octocat\"}\n\t\t\tctx := t.Context()\n\t\t\tgot, _, err := client.Repositories.ReplaceUserRestrictions(ctx, \"o\", \"r\", test.branch, input)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.ReplaceUserRestrictions returned error: %v\", err)\n\t\t\t}\n\t\t\twant := []*User{\n\t\t\t\t{Name: Ptr(\"octocat\")},\n\t\t\t}\n\t\t\tif !cmp.Equal(got, want) {\n\t\t\t\tt.Errorf(\"Repositories.ReplaceUserRestrictions returned %+v, want %+v\", got, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"ReplaceUserRestrictions\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.ReplaceUserRestrictions(ctx, \"\\n\", \"\\n\", \"\\n\", input)\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := client.Repositories.ReplaceUserRestrictions(ctx, \"o\", \"r\", test.branch, input)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_AddUserRestrictions(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/restrictions/users\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/restrictions/users\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"POST\")\n\t\t\t\tfmt.Fprint(w, `[{\n\t\t\t\t\"name\": \"octocat\"\n\t\t\t}]`)\n\t\t\t})\n\t\t\tinput := []string{\"octocat\"}\n\t\t\tctx := t.Context()\n\t\t\tgot, _, err := client.Repositories.AddUserRestrictions(ctx, \"o\", \"r\", test.branch, input)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.AddUserRestrictions returned error: %v\", err)\n\t\t\t}\n\t\t\twant := []*User{\n\t\t\t\t{Name: Ptr(\"octocat\")},\n\t\t\t}\n\t\t\tif !cmp.Equal(got, want) {\n\t\t\t\tt.Errorf(\"Repositories.AddUserRestrictions returned %+v, want %+v\", got, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"AddUserRestrictions\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.AddUserRestrictions(ctx, \"\\n\", \"\\n\", \"\\n\", input)\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := client.Repositories.AddUserRestrictions(ctx, \"o\", \"r\", test.branch, input)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_RemoveUserRestrictions(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tbranch  string\n\t\turlPath string\n\t}{\n\t\t{branch: \"b\", urlPath: \"/repos/o/r/branches/b/protection/restrictions/users\"},\n\t\t{branch: \"feat/branch-50%\", urlPath: \"/repos/o/r/branches/feat%2fbranch-50%25/protection/restrictions/users\"},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.branch, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux, _ := setup(t)\n\n\t\t\tmux.HandleFunc(test.urlPath, func(w http.ResponseWriter, r *http.Request) {\n\t\t\t\ttestMethod(t, r, \"DELETE\")\n\t\t\t\tfmt.Fprint(w, `[]`)\n\t\t\t})\n\t\t\tinput := []string{\"octocat\"}\n\t\t\tctx := t.Context()\n\t\t\tgot, _, err := client.Repositories.RemoveUserRestrictions(ctx, \"o\", \"r\", test.branch, input)\n\t\t\tif err != nil {\n\t\t\t\tt.Errorf(\"Repositories.RemoveUserRestrictions returned error: %v\", err)\n\t\t\t}\n\t\t\twant := []*User{}\n\t\t\tif !cmp.Equal(got, want) {\n\t\t\t\tt.Errorf(\"Repositories.RemoveUserRestrictions returned %+v, want %+v\", got, want)\n\t\t\t}\n\n\t\t\tconst methodName = \"RemoveUserRestrictions\"\n\t\t\ttestBadOptions(t, methodName, func() (err error) {\n\t\t\t\t_, _, err = client.Repositories.RemoveUserRestrictions(ctx, \"\\n\", \"\\n\", \"\\n\", input)\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t\t\tgot, resp, err := client.Repositories.RemoveUserRestrictions(ctx, \"o\", \"r\", test.branch, input)\n\t\t\t\tif got != nil {\n\t\t\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t\t\t}\n\t\t\t\treturn resp, err\n\t\t\t})\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_Transfer(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := TransferRequest{NewOwner: \"a\", NewName: Ptr(\"b\"), TeamID: []int64{123}}\n\n\tmux.HandleFunc(\"/repos/o/r/transfer\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v TransferRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"owner\":{\"login\":\"a\"}}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.Transfer(ctx, \"o\", \"r\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.Transfer returned error: %v\", err)\n\t}\n\n\twant := &Repository{Owner: &User{Login: Ptr(\"a\")}}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.Transfer returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"Transfer\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.Transfer(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.Transfer(ctx, \"o\", \"r\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_Dispatch(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tvar input DispatchRequestOptions\n\n\tmux.HandleFunc(\"/repos/o/r/dispatches\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v DispatchRequestOptions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"owner\":{\"login\":\"a\"}}`)\n\t})\n\n\tctx := t.Context()\n\n\ttestCases := []any{\n\t\tnil,\n\t\tstruct {\n\t\t\tFoo string\n\t\t}{\n\t\t\tFoo: \"test\",\n\t\t},\n\t\tstruct {\n\t\t\tBar int\n\t\t}{\n\t\t\tBar: 42,\n\t\t},\n\t\tstruct {\n\t\t\tFoo string\n\t\t\tBar int\n\t\t\tBaz bool\n\t\t}{\n\t\t\tFoo: \"test\",\n\t\t\tBar: 42,\n\t\t\tBaz: false,\n\t\t},\n\t}\n\n\tfor _, tc := range testCases {\n\t\tif tc == nil {\n\t\t\tinput = DispatchRequestOptions{EventType: \"go\"}\n\t\t} else {\n\t\t\tbytes, _ := json.Marshal(tc)\n\t\t\tpayload := json.RawMessage(bytes)\n\t\t\tinput = DispatchRequestOptions{EventType: \"go\", ClientPayload: &payload}\n\t\t}\n\n\t\tgot, _, err := client.Repositories.Dispatch(ctx, \"o\", \"r\", input)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Repositories.Dispatch returned error: %v\", err)\n\t\t}\n\n\t\twant := &Repository{Owner: &User{Login: Ptr(\"a\")}}\n\t\tif !cmp.Equal(got, want) {\n\t\t\tt.Errorf(\"Repositories.Dispatch returned %+v, want %+v\", got, want)\n\t\t}\n\t}\n\n\tconst methodName = \"Dispatch\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.Dispatch(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.Dispatch(ctx, \"o\", \"r\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestAdvancedSecurity_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &AdvancedSecurity{}, \"{}\")\n\n\tu := &AdvancedSecurity{\n\t\tStatus: Ptr(\"status\"),\n\t}\n\n\twant := `{\n\t\t\"status\": \"status\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestAuthorizedActorsOnly_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &AuthorizedActorsOnly{}, \"{}\")\n\n\tu := &AuthorizedActorsOnly{\n\t\tFrom: Ptr(true),\n\t}\n\n\twant := `{\n\t\t\"from\" : true\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestDispatchRequestOptions_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &DispatchRequestOptions{}, `{\"event_type\": \"\"}`)\n\n\tcp := json.RawMessage(`{\"testKey\":\"testValue\"}`)\n\tu := &DispatchRequestOptions{\n\t\tEventType:     \"test_event_type\",\n\t\tClientPayload: &cp,\n\t}\n\n\twant := `{\n\t\t\"event_type\": \"test_event_type\",\n\t\t\"client_payload\": {\n\t\t  \"testKey\": \"testValue\"\n\t\t}\n\t  }`\n\n\ttestJSONMarshal(t, u, want, cmpJSONRawMessageComparator())\n}\n\nfunc TestTransferRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &TransferRequest{}, `{\"new_owner\": \"\"}`)\n\n\tu := &TransferRequest{\n\t\tNewOwner: \"testOwner\",\n\t\tNewName:  Ptr(\"testName\"),\n\t\tTeamID:   []int64{1, 2},\n\t}\n\n\twant := `{\n\t\t\"new_owner\": \"testOwner\",\n\t\t\"new_name\": \"testName\",\n\t\t\"team_ids\": [1,2]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestSignaturesProtectedBranch_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SignaturesProtectedBranch{}, \"{}\")\n\n\tu := &SignaturesProtectedBranch{\n\t\tURL:     Ptr(\"https://www.example.com\"),\n\t\tEnabled: Ptr(false),\n\t}\n\n\twant := `{\n\t\t\"url\": \"https://www.example.com\",\n\t\t\"enabled\": false\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n\n\tu2 := &SignaturesProtectedBranch{\n\t\tURL:     Ptr(\"testURL\"),\n\t\tEnabled: Ptr(true),\n\t}\n\n\twant2 := `{\n\t\t\"url\": \"testURL\",\n\t\t\"enabled\": true\n\t}`\n\n\ttestJSONMarshal(t, u2, want2)\n}\n\nfunc TestDismissalRestrictionsRequest_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &DismissalRestrictionsRequest{}, \"{}\")\n\n\tu := &DismissalRestrictionsRequest{\n\t\tUsers: &[]string{\"user1\", \"user2\"},\n\t\tTeams: &[]string{\"team1\", \"team2\"},\n\t\tApps:  &[]string{\"app1\", \"app2\"},\n\t}\n\n\twant := `{\n\t\t\"users\": [\"user1\",\"user2\"],\n\t\t\"teams\": [\"team1\",\"team2\"],\n\t\t\"apps\": [\"app1\",\"app2\"]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestAdminEnforcement_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &AdminEnforcement{}, `{\"enabled\": false}`)\n\n\tu := &AdminEnforcement{\n\t\tURL:     Ptr(\"https://www.example.com\"),\n\t\tEnabled: false,\n\t}\n\n\twant := `{\n\t\t\"url\": \"https://www.example.com\",\n\t\t\"enabled\": false\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestPullRequestReviewsEnforcementUpdate_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &PullRequestReviewsEnforcementUpdate{}, `{\"required_approving_review_count\": 0}`)\n\n\tu := &PullRequestReviewsEnforcementUpdate{\n\t\tBypassPullRequestAllowancesRequest: &BypassPullRequestAllowancesRequest{\n\t\t\tUsers: []string{\"user1\", \"user2\"},\n\t\t\tTeams: []string{\"team1\", \"team2\"},\n\t\t\tApps:  []string{\"app1\", \"app2\"},\n\t\t},\n\t\tDismissStaleReviews:          Ptr(false),\n\t\tRequireCodeOwnerReviews:      Ptr(true),\n\t\tRequiredApprovingReviewCount: 2,\n\t}\n\n\twant := `{\n\t\t\"bypass_pull_request_allowances\": {\n\t\t\t\"users\": [\"user1\",\"user2\"],\n\t\t\t\"teams\": [\"team1\",\"team2\"],\n\t\t\t\"apps\": [\"app1\",\"app2\"]\n\t\t},\n\t\t\"dismiss_stale_reviews\": false,\n\t\t\"require_code_owner_reviews\": true,\n\t\t\"required_approving_review_count\": 2\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestRequiredStatusCheck_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RequiredStatusCheck{}, `{\"context\": \"\"}`)\n\n\tu := &RequiredStatusCheck{\n\t\tContext: \"ctx\",\n\t\tAppID:   Ptr(int64(1)),\n\t}\n\n\twant := `{\n\t\t\"context\": \"ctx\",\n\t\t\"app_id\": 1\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestRepositoryTag_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RepositoryTag{}, \"{}\")\n\n\tu := &RepositoryTag{\n\t\tName: Ptr(\"v0.1\"),\n\t\tCommit: &Commit{\n\t\t\tSHA: Ptr(\"sha\"),\n\t\t\tURL: Ptr(\"url\"),\n\t\t},\n\t\tZipballURL: Ptr(\"zball\"),\n\t\tTarballURL: Ptr(\"tball\"),\n\t}\n\n\twant := `{\n\t\t\"name\": \"v0.1\",\n\t\t\"commit\": {\n\t\t\t\"sha\": \"sha\",\n\t\t\t\"url\": \"url\"\n\t\t},\n\t\t\"zipball_url\": \"zball\",\n\t\t\"tarball_url\": \"tball\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestRepositoriesService_EnablePrivateReporting(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/owner/repo/private-vulnerability-reporting\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Repositories.EnablePrivateReporting(ctx, \"owner\", \"repo\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.EnablePrivateReporting returned error: %v\", err)\n\t}\n\n\tconst methodName = \"EnablePrivateReporting\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.EnablePrivateReporting(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.EnablePrivateReporting(ctx, \"owner\", \"repo\")\n\t})\n}\n\nfunc TestRepositoriesService_DisablePrivateReporting(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/owner/repo/private-vulnerability-reporting\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Repositories.DisablePrivateReporting(ctx, \"owner\", \"repo\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.DisablePrivateReporting returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DisablePrivateReporting\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Repositories.DisablePrivateReporting(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Repositories.DisablePrivateReporting(ctx, \"owner\", \"repo\")\n\t})\n}\n\nfunc TestRepositoriesService_IsPrivateReportingEnabled(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/owner/repo/private-vulnerability-reporting\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"enabled\": true}`)\n\t})\n\n\tctx := t.Context()\n\tenabled, _, err := client.Repositories.IsPrivateReportingEnabled(ctx, \"owner\", \"repo\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.IsPrivateReportingEnabled returned error: %v\", err)\n\t}\n\tif want := true; enabled != want {\n\t\tt.Errorf(\"Repositories.IsPrivateReportingEnabled returned %+v, want %+v\", enabled, want)\n\t}\n\n\tconst methodName = \"IsPrivateReportingEnabled\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.IsPrivateReportingEnabled(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.IsPrivateReportingEnabled(ctx, \"owner\", \"repo\")\n\t\tif got {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want false\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepository_UnmarshalJSON(t *testing.T) {\n\tt.Parallel()\n\ttestCases := map[string]struct {\n\t\tdata           []byte\n\t\twantRepository Repository\n\t\twantErr        bool\n\t}{\n\t\t\"Empty\": {\n\t\t\tdata:           []byte(\"{}\"),\n\t\t\twantRepository: Repository{},\n\t\t\twantErr:        false,\n\t\t},\n\t\t\"Invalid JSON\": {\n\t\t\tdata:           []byte(\"{\"),\n\t\t\twantRepository: Repository{},\n\t\t\twantErr:        true,\n\t\t},\n\t\t\"Partial project\": {\n\t\t\tdata:           []byte(`{\"id\":10270722,\"name\":\"go-github\",\"private\":false,\"owner\":{\"login\":\"google\"},\"created_at\":\"2013-05-24T16:42:58Z\",\"license\":{},\"topics\":[\"github\"],\"permissions\":{\"pull\":true},\"custom_properties\":{},\"organization\":{\"login\":\"google\"}}`),\n\t\t\twantRepository: Repository{ID: Ptr(int64(10270722)), Name: Ptr(\"go-github\"), Private: Ptr(false), Owner: &User{Login: Ptr(\"google\")}, CreatedAt: &Timestamp{time.Date(2013, 5, 24, 16, 42, 58, 0, time.UTC)}, License: &License{}, Topics: []string{\"github\"}, Permissions: &RepositoryPermissions{Pull: Ptr(true)}, CustomProperties: map[string]any{}, Organization: &Organization{Login: Ptr(\"google\")}},\n\t\t\twantErr:        false,\n\t\t},\n\t\t\"With custom properties\": {\n\t\t\tdata:           []byte(`{\"custom_properties\":{\"boolean\":\"false\",\"text\":\"a\",\"single-select\":\"a\",\"multi-select\":[\"a\",\"b\",\"c\"]}}`),\n\t\t\twantRepository: Repository{CustomProperties: map[string]any{\"boolean\": \"false\", \"text\": \"a\", \"single-select\": \"a\", \"multi-select\": []any{\"a\", \"b\", \"c\"}}},\n\t\t\twantErr:        false,\n\t\t},\n\t}\n\n\tfor name, tt := range testCases {\n\t\tt.Run(name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tpk := Repository{}\n\t\t\terr := json.Unmarshal(tt.data, &pk)\n\t\t\tif err == nil && tt.wantErr {\n\t\t\t\tt.Error(\"Repository.UnmarshalJSON returned nil instead of an error\")\n\t\t\t}\n\t\t\tif err != nil && !tt.wantErr {\n\t\t\t\tt.Errorf(\"Repository.UnmarshalJSON returned an unexpected error: %+v\", err)\n\t\t\t}\n\t\t\tif !cmp.Equal(tt.wantRepository, pk) {\n\t\t\t\tt.Errorf(\"Repository.UnmarshalJSON expected repository %+v, got %+v\", tt.wantRepository, pk)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestRepositoriesService_ListRepositoryActivities(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/activity\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"per_page\": \"100\",\n\t\t})\n\t\tfmt.Fprint(w, `[\n\t\t\t{\n\t\t\t\t\"id\": 123456789,\n\t\t\t\t\"node_id\": \"PSH_test123\",\n\t\t\t\t\"before\": \"abc123def456\",\n\t\t\t\t\"after\": \"def456ghi789\",\n\t\t\t\t\"ref\": \"refs/heads/main\",\n\t\t\t\t\"timestamp\": \"2023-01-01T12:00:00Z\",\n\t\t\t\t\"activity_type\": \"push\",\n\t\t\t\t\"actor\": {\n\t\t\t\t\t\"login\": \"testuser1\",\n\t\t\t\t\t\"id\": 111111,\n\t\t\t\t\t\"node_id\": \"MDQ6VXNlcjExMTExMQ==\",\n\t\t\t\t\t\"avatar_url\": \"https://avatars.githubusercontent.com/u/111111?v=4\",\n\t\t\t\t\t\"gravatar_id\": \"\",\n\t\t\t\t\t\"url\": \"https://api.github.com/users/testuser1\",\n\t\t\t\t\t\"html_url\": \"https://github.com/testuser1\",\n\t\t\t\t\t\"followers_url\": \"https://api.github.com/users/testuser1/followers\",\n\t\t\t\t\t\"following_url\": \"https://api.github.com/users/testuser1/following{/other_user}\",\n\t\t\t\t\t\"gists_url\": \"https://api.github.com/users/testuser1/gists{/gist_id}\",\n\t\t\t\t\t\"starred_url\": \"https://api.github.com/users/testuser1/starred{/owner}{/repo}\",\n\t\t\t\t\t\"subscriptions_url\": \"https://api.github.com/users/testuser1/subscriptions\",\n\t\t\t\t\t\"organizations_url\": \"https://api.github.com/users/testuser1/orgs\",\n\t\t\t\t\t\"repos_url\": \"https://api.github.com/users/testuser1/repos\",\n\t\t\t\t\t\"events_url\": \"https://api.github.com/users/testuser1/events{/privacy}\",\n\t\t\t\t\t\"received_events_url\": \"https://api.github.com/users/testuser1/received_events\",\n\t\t\t\t\t\"type\": \"User\",\n\t\t\t\t\t\"user_view_type\": \"public\",\n\t\t\t\t\t\"site_admin\": false\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"id\": 123456788,\n\t\t\t\t\"node_id\": \"PSH_test124\",\n\t\t\t\t\"before\": \"def456ghi789\",\n\t\t\t\t\"after\": \"ghi789jkl012\",\n\t\t\t\t\"ref\": \"refs/heads/feature\",\n\t\t\t\t\"timestamp\": \"2023-01-01T11:30:00Z\",\n\t\t\t\t\"activity_type\": \"branch_deletion\",\n\t\t\t\t\"actor\": {\n\t\t\t\t\t\"login\": \"testuser2\",\n\t\t\t\t\t\"id\": 222222,\n\t\t\t\t\t\"node_id\": \"MDQ6VXNlcjIyMjIyMg==\",\n\t\t\t\t\t\"avatar_url\": \"https://avatars.githubusercontent.com/u/222222?v=4\",\n\t\t\t\t\t\"gravatar_id\": \"\",\n\t\t\t\t\t\"url\": \"https://api.github.com/users/testuser2\",\n\t\t\t\t\t\"html_url\": \"https://github.com/testuser2\",\n\t\t\t\t\t\"followers_url\": \"https://api.github.com/users/testuser2/followers\",\n\t\t\t\t\t\"following_url\": \"https://api.github.com/users/testuser2/following{/other_user}\",\n\t\t\t\t\t\"gists_url\": \"https://api.github.com/users/testuser2/gists{/gist_id}\",\n\t\t\t\t\t\"starred_url\": \"https://api.github.com/users/testuser2/starred{/owner}{/repo}\",\n\t\t\t\t\t\"subscriptions_url\": \"https://api.github.com/users/testuser2/subscriptions\",\n\t\t\t\t\t\"organizations_url\": \"https://api.github.com/users/testuser2/orgs\",\n\t\t\t\t\t\"repos_url\": \"https://api.github.com/users/testuser2/repos\",\n\t\t\t\t\t\"events_url\": \"https://api.github.com/users/testuser2/events{/privacy}\",\n\t\t\t\t\t\"received_events_url\": \"https://api.github.com/users/testuser2/received_events\",\n\t\t\t\t\t\"type\": \"User\",\n\t\t\t\t\t\"user_view_type\": \"public\",\n\t\t\t\t\t\"site_admin\": false\n\t\t\t\t}\n\t\t\t}\n\t\t]`)\n\t})\n\n\topts := &ListRepositoryActivityOptions{PerPage: 100}\n\tctx := t.Context()\n\tactivities, _, err := client.Repositories.ListRepositoryActivities(ctx, \"o\", \"r\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListRepositoryActivities returned error: %v\", err)\n\t}\n\n\twant := []*RepositoryActivity{\n\t\t{\n\t\t\tID:           123456789,\n\t\t\tNodeID:       \"PSH_test123\",\n\t\t\tBefore:       \"abc123def456\",\n\t\t\tAfter:        \"def456ghi789\",\n\t\t\tRef:          \"refs/heads/main\",\n\t\t\tTimestamp:    &Timestamp{Time: time.Date(2023, 1, 1, 12, 0, 0, 0, time.UTC)},\n\t\t\tActivityType: \"push\",\n\t\t\tActor: &RepositoryActor{\n\t\t\t\tLogin:             Ptr(\"testuser1\"),\n\t\t\t\tID:                Ptr(int64(111111)),\n\t\t\t\tNodeID:            Ptr(\"MDQ6VXNlcjExMTExMQ==\"),\n\t\t\t\tAvatarURL:         Ptr(\"https://avatars.githubusercontent.com/u/111111?v=4\"),\n\t\t\t\tGravatarID:        Ptr(\"\"),\n\t\t\t\tURL:               Ptr(\"https://api.github.com/users/testuser1\"),\n\t\t\t\tHTMLURL:           Ptr(\"https://github.com/testuser1\"),\n\t\t\t\tFollowersURL:      Ptr(\"https://api.github.com/users/testuser1/followers\"),\n\t\t\t\tFollowingURL:      Ptr(\"https://api.github.com/users/testuser1/following{/other_user}\"),\n\t\t\t\tGistsURL:          Ptr(\"https://api.github.com/users/testuser1/gists{/gist_id}\"),\n\t\t\t\tStarredURL:        Ptr(\"https://api.github.com/users/testuser1/starred{/owner}{/repo}\"),\n\t\t\t\tSubscriptionsURL:  Ptr(\"https://api.github.com/users/testuser1/subscriptions\"),\n\t\t\t\tOrganizationsURL:  Ptr(\"https://api.github.com/users/testuser1/orgs\"),\n\t\t\t\tReposURL:          Ptr(\"https://api.github.com/users/testuser1/repos\"),\n\t\t\t\tEventsURL:         Ptr(\"https://api.github.com/users/testuser1/events{/privacy}\"),\n\t\t\t\tReceivedEventsURL: Ptr(\"https://api.github.com/users/testuser1/received_events\"),\n\t\t\t\tType:              Ptr(\"User\"),\n\t\t\t\tUserViewType:      Ptr(\"public\"),\n\t\t\t\tSiteAdmin:         Ptr(false),\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tID:           123456788,\n\t\t\tNodeID:       \"PSH_test124\",\n\t\t\tBefore:       \"def456ghi789\",\n\t\t\tAfter:        \"ghi789jkl012\",\n\t\t\tRef:          \"refs/heads/feature\",\n\t\t\tTimestamp:    &Timestamp{Time: time.Date(2023, 1, 1, 11, 30, 0, 0, time.UTC)},\n\t\t\tActivityType: \"branch_deletion\",\n\t\t\tActor: &RepositoryActor{\n\t\t\t\tLogin:             Ptr(\"testuser2\"),\n\t\t\t\tID:                Ptr(int64(222222)),\n\t\t\t\tNodeID:            Ptr(\"MDQ6VXNlcjIyMjIyMg==\"),\n\t\t\t\tAvatarURL:         Ptr(\"https://avatars.githubusercontent.com/u/222222?v=4\"),\n\t\t\t\tGravatarID:        Ptr(\"\"),\n\t\t\t\tURL:               Ptr(\"https://api.github.com/users/testuser2\"),\n\t\t\t\tHTMLURL:           Ptr(\"https://github.com/testuser2\"),\n\t\t\t\tFollowersURL:      Ptr(\"https://api.github.com/users/testuser2/followers\"),\n\t\t\t\tFollowingURL:      Ptr(\"https://api.github.com/users/testuser2/following{/other_user}\"),\n\t\t\t\tGistsURL:          Ptr(\"https://api.github.com/users/testuser2/gists{/gist_id}\"),\n\t\t\t\tStarredURL:        Ptr(\"https://api.github.com/users/testuser2/starred{/owner}{/repo}\"),\n\t\t\t\tSubscriptionsURL:  Ptr(\"https://api.github.com/users/testuser2/subscriptions\"),\n\t\t\t\tOrganizationsURL:  Ptr(\"https://api.github.com/users/testuser2/orgs\"),\n\t\t\t\tReposURL:          Ptr(\"https://api.github.com/users/testuser2/repos\"),\n\t\t\t\tEventsURL:         Ptr(\"https://api.github.com/users/testuser2/events{/privacy}\"),\n\t\t\t\tReceivedEventsURL: Ptr(\"https://api.github.com/users/testuser2/received_events\"),\n\t\t\t\tType:              Ptr(\"User\"),\n\t\t\t\tUserViewType:      Ptr(\"public\"),\n\t\t\t\tSiteAdmin:         Ptr(false),\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(activities, want) {\n\t\tt.Errorf(\"Repositories.ListRepositoryActivities returned %+v, want %+v\", activities, want)\n\t}\n\n\tconst methodName = \"ListRepositoryActivities\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListRepositoryActivities(ctx, \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListRepositoryActivities(ctx, \"o\", \"r\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListRepositoryActivities_withOptions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/activity\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"direction\":     \"desc\",\n\t\t\t\"before\":        \"2023-01-01T12:00:00Z\",\n\t\t\t\"after\":         \"2023-01-01T11:30:00Z\",\n\t\t\t\"ref\":           \"refs/heads/main\",\n\t\t\t\"actor\":         \"testuser1\",\n\t\t\t\"time_period\":   \"day\",\n\t\t\t\"activity_type\": \"push\",\n\t\t\t\"per_page\":      \"50\",\n\t\t})\n\t\tfmt.Fprint(w, `[\n\t\t\t{\n\t\t\t\t\"id\": 123456789,\n\t\t\t\t\"node_id\": \"PSH_test123\",\n\t\t\t\t\"before\": \"abc123def456\",\n\t\t\t\t\"after\": \"def456ghi789\",\n\t\t\t\t\"ref\": \"refs/heads/main\",\n\t\t\t\t\"timestamp\": \"2023-01-01T12:00:00Z\",\n\t\t\t\t\"activity_type\": \"push\",\n\t\t\t\t\"actor\": {\n\t\t\t\t\t\"login\": \"testuser1\",\n\t\t\t\t\t\"id\": 111111,\n\t\t\t\t\t\"node_id\": \"MDQ6VXNlcjExMTExMQ==\",\n\t\t\t\t\t\"avatar_url\": \"https://avatars.githubusercontent.com/u/111111?v=4\",\n\t\t\t\t\t\"gravatar_id\": \"\",\n\t\t\t\t\t\"url\": \"https://api.github.com/users/testuser1\",\n\t\t\t\t\t\"html_url\": \"https://github.com/testuser1\",\n\t\t\t\t\t\"followers_url\": \"https://api.github.com/users/testuser1/followers\",\n\t\t\t\t\t\"following_url\": \"https://api.github.com/users/testuser1/following{/other_user}\",\n\t\t\t\t\t\"gists_url\": \"https://api.github.com/users/testuser1/gists{/gist_id}\",\n\t\t\t\t\t\"starred_url\": \"https://api.github.com/users/testuser1/starred{/owner}{/repo}\",\n\t\t\t\t\t\"subscriptions_url\": \"https://api.github.com/users/testuser1/subscriptions\",\n\t\t\t\t\t\"organizations_url\": \"https://api.github.com/users/testuser1/orgs\",\n\t\t\t\t\t\"repos_url\": \"https://api.github.com/users/testuser1/repos\",\n\t\t\t\t\t\"events_url\": \"https://api.github.com/users/testuser1/events{/privacy}\",\n\t\t\t\t\t\"received_events_url\": \"https://api.github.com/users/testuser1/received_events\",\n\t\t\t\t\t\"type\": \"User\",\n\t\t\t\t\t\"user_view_type\": \"public\",\n\t\t\t\t\t\"site_admin\": false\n\t\t\t\t}\n\t\t\t}\n\t\t]`)\n\t})\n\n\topts := &ListRepositoryActivityOptions{\n\t\tDirection:    \"desc\",\n\t\tBefore:       \"2023-01-01T12:00:00Z\",\n\t\tAfter:        \"2023-01-01T11:30:00Z\",\n\t\tRef:          \"refs/heads/main\",\n\t\tActor:        \"testuser1\",\n\t\tTimePeriod:   \"day\",\n\t\tActivityType: \"push\",\n\t\tPerPage:      50,\n\t}\n\tctx := t.Context()\n\tactivities, _, err := client.Repositories.ListRepositoryActivities(ctx, \"o\", \"r\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListRepositoryActivities returned error: %v\", err)\n\t}\n\n\twant := []*RepositoryActivity{\n\t\t{\n\t\t\tID:           123456789,\n\t\t\tNodeID:       \"PSH_test123\",\n\t\t\tBefore:       \"abc123def456\",\n\t\t\tAfter:        \"def456ghi789\",\n\t\t\tRef:          \"refs/heads/main\",\n\t\t\tTimestamp:    &Timestamp{Time: time.Date(2023, 1, 1, 12, 0, 0, 0, time.UTC)},\n\t\t\tActivityType: \"push\",\n\t\t\tActor: &RepositoryActor{\n\t\t\t\tLogin:             Ptr(\"testuser1\"),\n\t\t\t\tID:                Ptr(int64(111111)),\n\t\t\t\tNodeID:            Ptr(\"MDQ6VXNlcjExMTExMQ==\"),\n\t\t\t\tAvatarURL:         Ptr(\"https://avatars.githubusercontent.com/u/111111?v=4\"),\n\t\t\t\tGravatarID:        Ptr(\"\"),\n\t\t\t\tURL:               Ptr(\"https://api.github.com/users/testuser1\"),\n\t\t\t\tHTMLURL:           Ptr(\"https://github.com/testuser1\"),\n\t\t\t\tFollowersURL:      Ptr(\"https://api.github.com/users/testuser1/followers\"),\n\t\t\t\tFollowingURL:      Ptr(\"https://api.github.com/users/testuser1/following{/other_user}\"),\n\t\t\t\tGistsURL:          Ptr(\"https://api.github.com/users/testuser1/gists{/gist_id}\"),\n\t\t\t\tStarredURL:        Ptr(\"https://api.github.com/users/testuser1/starred{/owner}{/repo}\"),\n\t\t\t\tSubscriptionsURL:  Ptr(\"https://api.github.com/users/testuser1/subscriptions\"),\n\t\t\t\tOrganizationsURL:  Ptr(\"https://api.github.com/users/testuser1/orgs\"),\n\t\t\t\tReposURL:          Ptr(\"https://api.github.com/users/testuser1/repos\"),\n\t\t\t\tEventsURL:         Ptr(\"https://api.github.com/users/testuser1/events{/privacy}\"),\n\t\t\t\tReceivedEventsURL: Ptr(\"https://api.github.com/users/testuser1/received_events\"),\n\t\t\t\tType:              Ptr(\"User\"),\n\t\t\t\tUserViewType:      Ptr(\"public\"),\n\t\t\t\tSiteAdmin:         Ptr(false),\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(activities, want) {\n\t\tt.Errorf(\"Repositories.ListRepositoryActivities returned %+v, want %+v\", activities, want)\n\t}\n}\n\nfunc TestRepositoriesService_ListRepositoryActivities_emptyResponse(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/activity\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[]`)\n\t})\n\n\tctx := t.Context()\n\tactivities, _, err := client.Repositories.ListRepositoryActivities(ctx, \"o\", \"r\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListRepositoryActivities returned error: %v\", err)\n\t}\n\n\twant := []*RepositoryActivity{}\n\tif !cmp.Equal(activities, want) {\n\t\tt.Errorf(\"Repositories.ListRepositoryActivities returned %+v, want %+v\", activities, want)\n\t}\n}\n\nfunc TestRepositoriesService_ListRepositoryActivities_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.ListRepositoryActivities(ctx, \"%\", \"r\", nil)\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned\")\n\t}\n}\n\nfunc TestRepositoriesService_ListRepositoryActivities_invalidRepo(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Repositories.ListRepositoryActivities(ctx, \"o\", \"%\", nil)\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned\")\n\t}\n}\n"
  },
  {
    "path": "github/repos_traffic.go",
    "content": "// Copyright 2016 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// TrafficReferrer represent information about traffic from a referrer .\ntype TrafficReferrer struct {\n\tReferrer *string `json:\"referrer,omitempty\"`\n\tCount    *int    `json:\"count,omitempty\"`\n\tUniques  *int    `json:\"uniques,omitempty\"`\n}\n\n// TrafficPath represent information about the traffic on a path of the repo.\ntype TrafficPath struct {\n\tPath    *string `json:\"path,omitempty\"`\n\tTitle   *string `json:\"title,omitempty\"`\n\tCount   *int    `json:\"count,omitempty\"`\n\tUniques *int    `json:\"uniques,omitempty\"`\n}\n\n// TrafficData represent information about a specific timestamp in views or clones list.\ntype TrafficData struct {\n\tTimestamp *Timestamp `json:\"timestamp,omitempty\"`\n\tCount     *int       `json:\"count,omitempty\"`\n\tUniques   *int       `json:\"uniques,omitempty\"`\n}\n\n// TrafficViews represent information about the number of views in the last 14 days.\ntype TrafficViews struct {\n\tViews   []*TrafficData `json:\"views,omitempty\"`\n\tCount   *int           `json:\"count,omitempty\"`\n\tUniques *int           `json:\"uniques,omitempty\"`\n}\n\n// TrafficClones represent information about the number of clones in the last 14 days.\ntype TrafficClones struct {\n\tClones  []*TrafficData `json:\"clones,omitempty\"`\n\tCount   *int           `json:\"count,omitempty\"`\n\tUniques *int           `json:\"uniques,omitempty\"`\n}\n\n// TrafficBreakdownOptions specifies the parameters to methods that support breakdown per day or week.\n// Can be one of: day, week. Default: day.\ntype TrafficBreakdownOptions struct {\n\tPer string `url:\"per,omitempty\"`\n}\n\n// ListTrafficReferrers list the top 10 referrers over the last 14 days.\n//\n// GitHub API docs: https://docs.github.com/rest/metrics/traffic#get-top-referral-sources\n//\n//meta:operation GET /repos/{owner}/{repo}/traffic/popular/referrers\nfunc (s *RepositoriesService) ListTrafficReferrers(ctx context.Context, owner, repo string) ([]*TrafficReferrer, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/traffic/popular/referrers\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar trafficReferrers []*TrafficReferrer\n\tresp, err := s.client.Do(ctx, req, &trafficReferrers)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn trafficReferrers, resp, nil\n}\n\n// ListTrafficPaths list the top 10 popular content over the last 14 days.\n//\n// GitHub API docs: https://docs.github.com/rest/metrics/traffic#get-top-referral-paths\n//\n//meta:operation GET /repos/{owner}/{repo}/traffic/popular/paths\nfunc (s *RepositoriesService) ListTrafficPaths(ctx context.Context, owner, repo string) ([]*TrafficPath, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/traffic/popular/paths\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar paths []*TrafficPath\n\tresp, err := s.client.Do(ctx, req, &paths)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn paths, resp, nil\n}\n\n// ListTrafficViews get total number of views for the last 14 days and breaks it down either per day or week.\n//\n// GitHub API docs: https://docs.github.com/rest/metrics/traffic#get-page-views\n//\n//meta:operation GET /repos/{owner}/{repo}/traffic/views\nfunc (s *RepositoriesService) ListTrafficViews(ctx context.Context, owner, repo string, opts *TrafficBreakdownOptions) (*TrafficViews, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/traffic/views\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar trafficViews *TrafficViews\n\tresp, err := s.client.Do(ctx, req, &trafficViews)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn trafficViews, resp, nil\n}\n\n// 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.\n//\n// GitHub API docs: https://docs.github.com/rest/metrics/traffic#get-repository-clones\n//\n//meta:operation GET /repos/{owner}/{repo}/traffic/clones\nfunc (s *RepositoriesService) ListTrafficClones(ctx context.Context, owner, repo string, opts *TrafficBreakdownOptions) (*TrafficClones, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/traffic/clones\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar trafficClones *TrafficClones\n\tresp, err := s.client.Do(ctx, req, &trafficClones)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn trafficClones, resp, nil\n}\n"
  },
  {
    "path": "github/repos_traffic_test.go",
    "content": "// Copyright 2016 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRepositoriesService_ListTrafficReferrers(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/traffic/popular/referrers\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"referrer\": \"Google\",\n\t\t\t\"count\": 4,\n\t\t\t\"uniques\": 3\n \t\t}]`)\n\t})\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.ListTrafficReferrers(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListTrafficReferrers returned error: %+v\", err)\n\t}\n\n\twant := []*TrafficReferrer{{\n\t\tReferrer: Ptr(\"Google\"),\n\t\tCount:    Ptr(4),\n\t\tUniques:  Ptr(3),\n\t}}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.ListTrafficReferrers returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ListTrafficReferrers\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListTrafficReferrers(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListTrafficReferrers(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListTrafficPaths(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/traffic/popular/paths\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"path\": \"/github/hubot\",\n\t\t\t\"title\": \"github/hubot: A customizable life embetterment robot.\",\n\t\t\t\"count\": 3542,\n\t\t\t\"uniques\": 2225\n \t\t}]`)\n\t})\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.ListTrafficPaths(ctx, \"o\", \"r\")\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListTrafficPaths returned error: %+v\", err)\n\t}\n\n\twant := []*TrafficPath{{\n\t\tPath:    Ptr(\"/github/hubot\"),\n\t\tTitle:   Ptr(\"github/hubot: A customizable life embetterment robot.\"),\n\t\tCount:   Ptr(3542),\n\t\tUniques: Ptr(2225),\n\t}}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.ListTrafficPaths returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ListTrafficPaths\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListTrafficPaths(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListTrafficPaths(ctx, \"o\", \"r\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListTrafficViews(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/traffic/views\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"count\": 7,\n\t\t\t\"uniques\": 6,\n\t\t\t\"views\": [{\n\t\t\t\t\"timestamp\": \"2016-05-31T16:00:00.000Z\",\n\t\t\t\t\"count\": 7,\n\t\t\t\t\"uniques\": 6\n\t\t}]}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.ListTrafficViews(ctx, \"o\", \"r\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListTrafficViews returned error: %+v\", err)\n\t}\n\n\twant := &TrafficViews{\n\t\tViews: []*TrafficData{{\n\t\t\tTimestamp: &Timestamp{time.Date(2016, time.May, 31, 16, 0, 0, 0, time.UTC)},\n\t\t\tCount:     Ptr(7),\n\t\t\tUniques:   Ptr(6),\n\t\t}},\n\t\tCount:   Ptr(7),\n\t\tUniques: Ptr(6),\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.ListTrafficViews returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ListTrafficViews\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListTrafficViews(ctx, \"\\n\", \"\\n\", &TrafficBreakdownOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListTrafficViews(ctx, \"o\", \"r\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestRepositoriesService_ListTrafficClones(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/traffic/clones\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"count\": 7,\n\t\t\t\"uniques\": 6,\n\t\t\t\"clones\": [{\n\t\t\t\t\"timestamp\": \"2016-05-31T16:00:00.00Z\",\n\t\t\t\t\"count\": 7,\n\t\t\t\t\"uniques\": 6\n\t\t}]}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Repositories.ListTrafficClones(ctx, \"o\", \"r\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"Repositories.ListTrafficClones returned error: %+v\", err)\n\t}\n\n\twant := &TrafficClones{\n\t\tClones: []*TrafficData{{\n\t\t\tTimestamp: &Timestamp{time.Date(2016, time.May, 31, 16, 0, 0, 0, time.UTC)},\n\t\t\tCount:     Ptr(7),\n\t\t\tUniques:   Ptr(6),\n\t\t}},\n\t\tCount:   Ptr(7),\n\t\tUniques: Ptr(6),\n\t}\n\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Repositories.ListTrafficClones returned %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ListTrafficClones\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Repositories.ListTrafficClones(ctx, \"\\n\", \"\\n\", &TrafficBreakdownOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Repositories.ListTrafficClones(ctx, \"o\", \"r\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTrafficReferrer_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &TrafficReferrer{}, \"{}\")\n\n\tu := &TrafficReferrer{\n\t\tReferrer: Ptr(\"referrer\"),\n\t\tCount:    Ptr(0),\n\t\tUniques:  Ptr(0),\n\t}\n\n\twant := `{\n\t\t\"referrer\" : \"referrer\",\n\t\t\"count\" : 0,\n\t\t\"uniques\" : 0\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestTrafficViews_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &TrafficViews{}, \"{}\")\n\n\tu := &TrafficViews{\n\t\tViews: []*TrafficData{{\n\t\t\tTimestamp: &Timestamp{time.Date(2016, time.May, 31, 16, 0, 0, 0, time.UTC)},\n\t\t\tCount:     Ptr(7),\n\t\t\tUniques:   Ptr(6),\n\t\t}},\n\t\tCount:   Ptr(0),\n\t\tUniques: Ptr(0),\n\t}\n\n\twant := `{\n\t\t\"views\": [{\n\t\t\t\"timestamp\": \"2016-05-31T16:00:00Z\",\n\t\t\t\"count\": 7,\n\t\t\t\"uniques\": 6\n\t\t}],\n\t\t\"count\" : 0,\n\t\t\"uniques\" : 0\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestTrafficClones_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &TrafficClones{}, \"{}\")\n\n\tu := &TrafficClones{\n\t\tClones: []*TrafficData{{\n\t\t\tTimestamp: &Timestamp{time.Date(2021, time.October, 29, 16, 0, 0, 0, time.UTC)},\n\t\t\tCount:     Ptr(1),\n\t\t\tUniques:   Ptr(1),\n\t\t}},\n\t\tCount:   Ptr(0),\n\t\tUniques: Ptr(0),\n\t}\n\n\twant := `{\n\t\t\"clones\": [{\n\t\t\t\"timestamp\": \"2021-10-29T16:00:00Z\",\n\t\t\t\"count\": 1,\n\t\t\t\"uniques\": 1\n\t\t}],\n\t\t\"count\" : 0,\n\t\t\"uniques\" : 0\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestTrafficPath_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &TrafficPath{}, \"{}\")\n\n\tu := &TrafficPath{\n\t\tPath:    Ptr(\"test/path\"),\n\t\tTitle:   Ptr(\"test\"),\n\t\tCount:   Ptr(2),\n\t\tUniques: Ptr(3),\n\t}\n\n\twant := `{\n\t\t\"path\" : \"test/path\",\n\t\t\"title\": \"test\",\n\t\t\"count\": 2,\n\t\t\"uniques\": 3\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestTrafficData_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &TrafficData{}, \"{}\")\n\n\tu := &TrafficData{\n\t\tTimestamp: &Timestamp{time.Date(2016, time.May, 31, 16, 0, 0, 0, time.UTC)},\n\t\tCount:     Ptr(7),\n\t\tUniques:   Ptr(6),\n\t}\n\n\twant := `{\n\t\t\t\"timestamp\": \"2016-05-31T16:00:00Z\",\n\t\t\t\"count\": 7,\n\t\t\t\"uniques\": 6\n      }`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/rules.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n)\n\n// RulesetTarget represents a GitHub ruleset target.\ntype RulesetTarget string\n\n// This is the set of GitHub ruleset targets.\nconst (\n\tRulesetTargetBranch     RulesetTarget = \"branch\"\n\tRulesetTargetTag        RulesetTarget = \"tag\"\n\tRulesetTargetPush       RulesetTarget = \"push\"\n\tRulesetTargetRepository RulesetTarget = \"repository\"\n)\n\n// RulesetSourceType represents a GitHub ruleset source type.\ntype RulesetSourceType string\n\n// This is the set of GitHub ruleset source types.\nconst (\n\tRulesetSourceTypeRepository   RulesetSourceType = \"Repository\"\n\tRulesetSourceTypeOrganization RulesetSourceType = \"Organization\"\n\tRulesetSourceTypeEnterprise   RulesetSourceType = \"Enterprise\"\n)\n\n// RulesetEnforcement represents a GitHub ruleset enforcement.\ntype RulesetEnforcement string\n\n// This is the set of GitHub ruleset enforcements.\nconst (\n\tRulesetEnforcementDisabled RulesetEnforcement = \"disabled\"\n\tRulesetEnforcementActive   RulesetEnforcement = \"active\"\n\tRulesetEnforcementEvaluate RulesetEnforcement = \"evaluate\"\n)\n\n// BypassActorType represents a GitHub ruleset bypass actor type.\ntype BypassActorType string\n\n// This is the set of GitHub ruleset bypass actor types.\nconst (\n\tBypassActorTypeIntegration       BypassActorType = \"Integration\"\n\tBypassActorTypeOrganizationAdmin BypassActorType = \"OrganizationAdmin\"\n\tBypassActorTypeRepositoryRole    BypassActorType = \"RepositoryRole\"\n\tBypassActorTypeTeam              BypassActorType = \"Team\"\n\tBypassActorTypeDeployKey         BypassActorType = \"DeployKey\"\n)\n\n// BypassMode represents a GitHub ruleset bypass mode.\ntype BypassMode string\n\n// This is the set of GitHub ruleset bypass modes.\nconst (\n\tBypassModeAlways      BypassMode = \"always\"\n\tBypassModeExempt      BypassMode = \"exempt\"\n\tBypassModeNever       BypassMode = \"never\"\n\tBypassModePullRequest BypassMode = \"pull_request\"\n)\n\n// RepositoryRuleType represents a GitHub ruleset rule type.\ntype RepositoryRuleType string\n\n// This is the set of GitHub ruleset rule types.\nconst (\n\t// Branch or tag target rules.\n\tRulesetRuleTypeBranchNamePattern        RepositoryRuleType = \"branch_name_pattern\"\n\tRulesetRuleTypeCodeScanning             RepositoryRuleType = \"code_scanning\"\n\tRulesetRuleTypeCommitAuthorEmailPattern RepositoryRuleType = \"commit_author_email_pattern\"\n\tRulesetRuleTypeCommitMessagePattern     RepositoryRuleType = \"commit_message_pattern\"\n\tRulesetRuleTypeCommitterEmailPattern    RepositoryRuleType = \"committer_email_pattern\"\n\tRulesetRuleTypeCopilotCodeReview        RepositoryRuleType = \"copilot_code_review\"\n\tRulesetRuleTypeCreation                 RepositoryRuleType = \"creation\"\n\tRulesetRuleTypeDeletion                 RepositoryRuleType = \"deletion\"\n\tRulesetRuleTypeMergeQueue               RepositoryRuleType = \"merge_queue\"\n\tRulesetRuleTypeNonFastForward           RepositoryRuleType = \"non_fast_forward\"\n\tRulesetRuleTypePullRequest              RepositoryRuleType = \"pull_request\"\n\tRulesetRuleTypeRequiredDeployments      RepositoryRuleType = \"required_deployments\"\n\tRulesetRuleTypeRequiredLinearHistory    RepositoryRuleType = \"required_linear_history\"\n\tRulesetRuleTypeRequiredSignatures       RepositoryRuleType = \"required_signatures\"\n\tRulesetRuleTypeRequiredStatusChecks     RepositoryRuleType = \"required_status_checks\"\n\tRulesetRuleTypeTagNamePattern           RepositoryRuleType = \"tag_name_pattern\"\n\tRulesetRuleTypeUpdate                   RepositoryRuleType = \"update\"\n\tRulesetRuleTypeWorkflows                RepositoryRuleType = \"workflows\"\n\n\t// Push target rules.\n\tRulesetRuleTypeFileExtensionRestriction RepositoryRuleType = \"file_extension_restriction\"\n\tRulesetRuleTypeFilePathRestriction      RepositoryRuleType = \"file_path_restriction\"\n\tRulesetRuleTypeMaxFilePathLength        RepositoryRuleType = \"max_file_path_length\"\n\tRulesetRuleTypeMaxFileSize              RepositoryRuleType = \"max_file_size\"\n\n\t// Repository target rules.\n\tRulesetRuleTypeRepositoryCreate     RepositoryRuleType = \"repository_create\"\n\tRulesetRuleTypeRepositoryDelete     RepositoryRuleType = \"repository_delete\"\n\tRulesetRuleTypeRepositoryName       RepositoryRuleType = \"repository_name\"\n\tRulesetRuleTypeRepositoryTransfer   RepositoryRuleType = \"repository_transfer\"\n\tRulesetRuleTypeRepositoryVisibility RepositoryRuleType = \"repository_visibility\"\n)\n\n// MergeGroupingStrategy models a GitHub merge grouping strategy.\ntype MergeGroupingStrategy string\n\n// This is the set of GitHub merge grouping strategies.\nconst (\n\tMergeGroupingStrategyAllGreen  MergeGroupingStrategy = \"ALLGREEN\"\n\tMergeGroupingStrategyHeadGreen MergeGroupingStrategy = \"HEADGREEN\"\n)\n\n// PullRequestMergeMethod is used in PullRequestRuleParameters,\n// where the GitHub API expects lowercase merge method values: \"merge\", \"rebase\", \"squash\".\n//\n// NOTE: GitHub's API inconsistently uses different casing for the same logical values\n// across different rules.\n//\n// TODO: Unify with MergeQueueMergeMethod once the GitHub API uses consistent casing.\ntype PullRequestMergeMethod string\n\nconst (\n\tPullRequestMergeMethodMerge  PullRequestMergeMethod = \"merge\"\n\tPullRequestMergeMethodRebase PullRequestMergeMethod = \"rebase\"\n\tPullRequestMergeMethodSquash PullRequestMergeMethod = \"squash\"\n)\n\n// MergeQueueMergeMethod is used in MergeQueueRuleParameters,\n// where the GitHub API expects uppercase merge method values: \"MERGE\", \"REBASE\", \"SQUASH\".\n//\n// NOTE: This type exists alongside PullRequestMergeMethod solely due to API casing inconsistencies.\n// It enforces the correct usage by API context.\n//\n// TODO: Unify with PullRequestMergeMethod once the GitHub API uses consistent casing.\ntype MergeQueueMergeMethod string\n\nconst (\n\tMergeQueueMergeMethodMerge  MergeQueueMergeMethod = \"MERGE\"\n\tMergeQueueMergeMethodRebase MergeQueueMergeMethod = \"REBASE\"\n\tMergeQueueMergeMethodSquash MergeQueueMergeMethod = \"SQUASH\"\n)\n\n// RulesetReviewerType represents the type of reviewer in a ruleset required reviewer.\ntype RulesetReviewerType string\n\n// This is the set of GitHub ruleset reviewer types.\nconst (\n\tRulesetReviewerTypeTeam RulesetReviewerType = \"Team\"\n)\n\n// PatternRuleOperator models a GitHub pattern rule operator.\ntype PatternRuleOperator string\n\n// This is the set of GitHub pattern rule operators.\nconst (\n\tPatternRuleOperatorStartsWith PatternRuleOperator = \"starts_with\"\n\tPatternRuleOperatorEndsWith   PatternRuleOperator = \"ends_with\"\n\tPatternRuleOperatorContains   PatternRuleOperator = \"contains\"\n\tPatternRuleOperatorRegex      PatternRuleOperator = \"regex\"\n)\n\n// CodeScanningAlertsThreshold models a GitHub code scanning alerts threshold.\ntype CodeScanningAlertsThreshold string\n\n// This is the set of GitHub code scanning alerts thresholds.\nconst (\n\tCodeScanningAlertsThresholdNone              CodeScanningAlertsThreshold = \"none\"\n\tCodeScanningAlertsThresholdErrors            CodeScanningAlertsThreshold = \"errors\"\n\tCodeScanningAlertsThresholdErrorsAndWarnings CodeScanningAlertsThreshold = \"errors_and_warnings\"\n\tCodeScanningAlertsThresholdAll               CodeScanningAlertsThreshold = \"all\"\n)\n\n// CodeScanningSecurityAlertsThreshold models a GitHub code scanning security alerts threshold.\ntype CodeScanningSecurityAlertsThreshold string\n\n// This is the set of GitHub code scanning security alerts thresholds.\nconst (\n\tCodeScanningSecurityAlertsThresholdNone           CodeScanningSecurityAlertsThreshold = \"none\"\n\tCodeScanningSecurityAlertsThresholdCritical       CodeScanningSecurityAlertsThreshold = \"critical\"\n\tCodeScanningSecurityAlertsThresholdHighOrHigher   CodeScanningSecurityAlertsThreshold = \"high_or_higher\"\n\tCodeScanningSecurityAlertsThresholdMediumOrHigher CodeScanningSecurityAlertsThreshold = \"medium_or_higher\"\n\tCodeScanningSecurityAlertsThresholdAll            CodeScanningSecurityAlertsThreshold = \"all\"\n)\n\n// RepositoryRuleset represents a GitHub ruleset object.\ntype RepositoryRuleset struct {\n\tID                   *int64                       `json:\"id,omitempty\"`\n\tName                 string                       `json:\"name\"`\n\tTarget               *RulesetTarget               `json:\"target,omitempty\"`\n\tSourceType           *RulesetSourceType           `json:\"source_type,omitempty\"`\n\tSource               string                       `json:\"source\"`\n\tEnforcement          RulesetEnforcement           `json:\"enforcement\"`\n\tBypassActors         []*BypassActor               `json:\"bypass_actors,omitzero\"`\n\tCurrentUserCanBypass *BypassMode                  `json:\"current_user_can_bypass,omitempty\"`\n\tNodeID               *string                      `json:\"node_id,omitempty\"`\n\tLinks                *RepositoryRulesetLinks      `json:\"_links,omitempty\"`\n\tConditions           *RepositoryRulesetConditions `json:\"conditions,omitempty\"`\n\tRules                *RepositoryRulesetRules      `json:\"rules,omitempty\"`\n\tUpdatedAt            *Timestamp                   `json:\"updated_at,omitempty\"`\n\tCreatedAt            *Timestamp                   `json:\"created_at,omitempty\"`\n}\n\n// BypassActor represents the bypass actors from a ruleset.\ntype BypassActor struct {\n\tActorID    *int64           `json:\"actor_id,omitempty\"`\n\tActorType  *BypassActorType `json:\"actor_type,omitempty\"`\n\tBypassMode *BypassMode      `json:\"bypass_mode,omitempty\"`\n}\n\n// RepositoryRulesetLinks represents the \"_links\" object in a Ruleset.\ntype RepositoryRulesetLinks struct {\n\tSelf *RepositoryRulesetLink `json:\"self,omitempty\"`\n\tHTML *RepositoryRulesetLink `json:\"html,omitempty\"`\n}\n\n// RepositoryRulesetLink represents a single link object from GitHub ruleset request _links.\ntype RepositoryRulesetLink struct {\n\tHRef *string `json:\"href,omitempty\"`\n}\n\n// RepositoryRulesetConditions represents the conditions object in a ruleset.\n// Set either RepositoryName or RepositoryID or RepositoryProperty, not more than one.\ntype RepositoryRulesetConditions struct {\n\tRefName              *RepositoryRulesetRefConditionParameters                  `json:\"ref_name,omitempty\"`\n\tRepositoryID         *RepositoryRulesetRepositoryIDsConditionParameters        `json:\"repository_id,omitempty\"`\n\tRepositoryName       *RepositoryRulesetRepositoryNamesConditionParameters      `json:\"repository_name,omitempty\"`\n\tRepositoryProperty   *RepositoryRulesetRepositoryPropertyConditionParameters   `json:\"repository_property,omitempty\"`\n\tOrganizationID       *RepositoryRulesetOrganizationIDsConditionParameters      `json:\"organization_id,omitempty\"`\n\tOrganizationName     *RepositoryRulesetOrganizationNamesConditionParameters    `json:\"organization_name,omitempty\"`\n\tOrganizationProperty *RepositoryRulesetOrganizationPropertyConditionParameters `json:\"organization_property,omitempty\"`\n}\n\n// RepositoryRulesetRefConditionParameters represents the conditions object for ref_names.\ntype RepositoryRulesetRefConditionParameters struct {\n\tInclude []string `json:\"include\"`\n\tExclude []string `json:\"exclude\"`\n}\n\n// RepositoryRulesetOrganizationPropertyConditionParameters represents the conditions object for an organization property selector.\ntype RepositoryRulesetOrganizationPropertyConditionParameters struct {\n\tInclude []*RepositoryRulesetRepositoryPropertyTargetParameters `json:\"include\"`\n\tExclude []*RepositoryRulesetRepositoryPropertyTargetParameters `json:\"exclude\"`\n}\n\n// RepositoryRulesetRepositoryIDsConditionParameters represents the conditions object for repository_id.\ntype RepositoryRulesetRepositoryIDsConditionParameters struct {\n\tRepositoryIDs []int64 `json:\"repository_ids,omitempty\"`\n}\n\n// RepositoryRulesetRepositoryNamesConditionParameters represents the conditions object for repository_name.\ntype RepositoryRulesetRepositoryNamesConditionParameters struct {\n\tInclude   []string `json:\"include\"`\n\tExclude   []string `json:\"exclude\"`\n\tProtected *bool    `json:\"protected,omitempty\"`\n}\n\n// RepositoryRulesetRepositoryPropertyConditionParameters represents the conditions object for repository_property.\ntype RepositoryRulesetRepositoryPropertyConditionParameters struct {\n\tInclude []*RepositoryRulesetRepositoryPropertyTargetParameters `json:\"include\"`\n\tExclude []*RepositoryRulesetRepositoryPropertyTargetParameters `json:\"exclude\"`\n}\n\n// RepositoryRulesetRepositoryPropertyTargetParameters represents a repository_property name and values to be used for targeting.\ntype RepositoryRulesetRepositoryPropertyTargetParameters struct {\n\tName           string   `json:\"name\"`\n\tPropertyValues []string `json:\"property_values\"`\n\tSource         *string  `json:\"source,omitempty\"`\n}\n\n// RepositoryRulesetOrganizationIDsConditionParameters represents the conditions object for organization_id.\ntype RepositoryRulesetOrganizationIDsConditionParameters struct {\n\tOrganizationIDs []int64 `json:\"organization_ids,omitempty\"`\n}\n\n// RepositoryRulesetOrganizationNamesConditionParameters represents the conditions object for organization_name.\ntype RepositoryRulesetOrganizationNamesConditionParameters struct {\n\tInclude []string `json:\"include\"`\n\tExclude []string `json:\"exclude\"`\n}\n\n// RepositoryRule represents a GitHub ruleset rule object.\ntype RepositoryRule struct {\n\tType       RepositoryRuleType `json:\"type\"`\n\tParameters any                `json:\"parameters,omitempty\"`\n}\n\n// RepositoryRulesetRules represents a GitHub ruleset rules object.\n// This type doesn't have JSON annotations as it uses custom marshaling.\ntype RepositoryRulesetRules struct {\n\t// Branch or tag target rules.\n\tCreation                 *EmptyRuleParameters\n\tUpdate                   *UpdateRuleParameters\n\tDeletion                 *EmptyRuleParameters\n\tRequiredLinearHistory    *EmptyRuleParameters\n\tMergeQueue               *MergeQueueRuleParameters\n\tRequiredDeployments      *RequiredDeploymentsRuleParameters\n\tRequiredSignatures       *EmptyRuleParameters\n\tPullRequest              *PullRequestRuleParameters\n\tRequiredStatusChecks     *RequiredStatusChecksRuleParameters\n\tNonFastForward           *EmptyRuleParameters\n\tCommitMessagePattern     *PatternRuleParameters\n\tCommitAuthorEmailPattern *PatternRuleParameters\n\tCommitterEmailPattern    *PatternRuleParameters\n\tBranchNamePattern        *PatternRuleParameters\n\tTagNamePattern           *PatternRuleParameters\n\tWorkflows                *WorkflowsRuleParameters\n\tCodeScanning             *CodeScanningRuleParameters\n\tCopilotCodeReview        *CopilotCodeReviewRuleParameters\n\n\t// Push target rules.\n\tFileExtensionRestriction *FileExtensionRestrictionRuleParameters\n\tFilePathRestriction      *FilePathRestrictionRuleParameters\n\tMaxFilePathLength        *MaxFilePathLengthRuleParameters\n\tMaxFileSize              *MaxFileSizeRuleParameters\n\n\t// Repository target rules.\n\tRepositoryCreate     *EmptyRuleParameters\n\tRepositoryDelete     *EmptyRuleParameters\n\tRepositoryName       *SimplePatternRuleParameters\n\tRepositoryTransfer   *EmptyRuleParameters\n\tRepositoryVisibility *RepositoryVisibilityRuleParameters\n}\n\n// BranchRules represents the rules active for a GitHub repository branch.\n// This type doesn't have JSON annotations as it uses custom marshaling.\ntype BranchRules struct {\n\t// Branch or tag target rules.\n\tCreation                 []*BranchRuleMetadata\n\tUpdate                   []*UpdateBranchRule\n\tDeletion                 []*BranchRuleMetadata\n\tRequiredLinearHistory    []*BranchRuleMetadata\n\tMergeQueue               []*MergeQueueBranchRule\n\tRequiredDeployments      []*RequiredDeploymentsBranchRule\n\tRequiredSignatures       []*BranchRuleMetadata\n\tPullRequest              []*PullRequestBranchRule\n\tRequiredStatusChecks     []*RequiredStatusChecksBranchRule\n\tNonFastForward           []*BranchRuleMetadata\n\tCommitMessagePattern     []*PatternBranchRule\n\tCommitAuthorEmailPattern []*PatternBranchRule\n\tCommitterEmailPattern    []*PatternBranchRule\n\tBranchNamePattern        []*PatternBranchRule\n\tTagNamePattern           []*PatternBranchRule\n\tWorkflows                []*WorkflowsBranchRule\n\tCodeScanning             []*CodeScanningBranchRule\n\tCopilotCodeReview        []*CopilotCodeReviewBranchRule\n\n\t// Push target rules.\n\tFileExtensionRestriction []*FileExtensionRestrictionBranchRule\n\tFilePathRestriction      []*FilePathRestrictionBranchRule\n\tMaxFilePathLength        []*MaxFilePathLengthBranchRule\n\tMaxFileSize              []*MaxFileSizeBranchRule\n}\n\n// BranchRuleMetadata represents the metadata for a branch rule.\ntype BranchRuleMetadata struct {\n\tRulesetSourceType RulesetSourceType `json:\"ruleset_source_type\"`\n\tRulesetSource     string            `json:\"ruleset_source\"`\n\tRulesetID         int64             `json:\"ruleset_id\"`\n}\n\n// UpdateBranchRule represents an update branch rule.\ntype UpdateBranchRule struct {\n\tBranchRuleMetadata\n\tParameters UpdateRuleParameters `json:\"parameters\"`\n}\n\n// MergeQueueBranchRule represents a merge queue branch rule.\ntype MergeQueueBranchRule struct {\n\tBranchRuleMetadata\n\tParameters MergeQueueRuleParameters `json:\"parameters\"`\n}\n\n// RequiredDeploymentsBranchRule represents a required deployments branch rule.\ntype RequiredDeploymentsBranchRule struct {\n\tBranchRuleMetadata\n\tParameters RequiredDeploymentsRuleParameters `json:\"parameters\"`\n}\n\n// PullRequestBranchRule represents a pull request branch rule.\ntype PullRequestBranchRule struct {\n\tBranchRuleMetadata\n\tParameters PullRequestRuleParameters `json:\"parameters\"`\n}\n\n// RequiredStatusChecksBranchRule represents a required status checks branch rule.\ntype RequiredStatusChecksBranchRule struct {\n\tBranchRuleMetadata\n\tParameters RequiredStatusChecksRuleParameters `json:\"parameters\"`\n}\n\n// PatternBranchRule represents a pattern branch rule.\ntype PatternBranchRule struct {\n\tBranchRuleMetadata\n\tParameters PatternRuleParameters `json:\"parameters\"`\n}\n\n// FilePathRestrictionBranchRule represents a file path restriction branch rule.\ntype FilePathRestrictionBranchRule struct {\n\tBranchRuleMetadata\n\tParameters FilePathRestrictionRuleParameters `json:\"parameters\"`\n}\n\n// MaxFilePathLengthBranchRule represents a max file path length branch rule.\ntype MaxFilePathLengthBranchRule struct {\n\tBranchRuleMetadata\n\tParameters MaxFilePathLengthRuleParameters `json:\"parameters\"`\n}\n\n// FileExtensionRestrictionBranchRule represents a file extension restriction branch rule.\ntype FileExtensionRestrictionBranchRule struct {\n\tBranchRuleMetadata\n\tParameters FileExtensionRestrictionRuleParameters `json:\"parameters\"`\n}\n\n// MaxFileSizeBranchRule represents a max file size branch rule.\ntype MaxFileSizeBranchRule struct {\n\tBranchRuleMetadata\n\tParameters MaxFileSizeRuleParameters `json:\"parameters\"`\n}\n\n// WorkflowsBranchRule represents a workflows branch rule.\ntype WorkflowsBranchRule struct {\n\tBranchRuleMetadata\n\tParameters WorkflowsRuleParameters `json:\"parameters\"`\n}\n\n// CodeScanningBranchRule represents a code scanning branch rule.\ntype CodeScanningBranchRule struct {\n\tBranchRuleMetadata\n\tParameters CodeScanningRuleParameters `json:\"parameters\"`\n}\n\n// CopilotCodeReviewBranchRule represents a copilot code review branch rule.\ntype CopilotCodeReviewBranchRule struct {\n\tBranchRuleMetadata\n\tParameters CopilotCodeReviewRuleParameters `json:\"parameters\"`\n}\n\n// EmptyRuleParameters represents the parameters for a rule with no options.\ntype EmptyRuleParameters struct{}\n\n// UpdateRuleParameters represents the update rule parameters.\ntype UpdateRuleParameters struct {\n\tUpdateAllowsFetchAndMerge bool `json:\"update_allows_fetch_and_merge,omitempty\"`\n}\n\n// MergeQueueRuleParameters represents the merge_queue rule parameters.\ntype MergeQueueRuleParameters struct {\n\tCheckResponseTimeoutMinutes  int                   `json:\"check_response_timeout_minutes\"`\n\tGroupingStrategy             MergeGroupingStrategy `json:\"grouping_strategy\"`\n\tMaxEntriesToBuild            int                   `json:\"max_entries_to_build\"`\n\tMaxEntriesToMerge            int                   `json:\"max_entries_to_merge\"`\n\tMergeMethod                  MergeQueueMergeMethod `json:\"merge_method\"`\n\tMinEntriesToMerge            int                   `json:\"min_entries_to_merge\"`\n\tMinEntriesToMergeWaitMinutes int                   `json:\"min_entries_to_merge_wait_minutes\"`\n}\n\n// RequiredDeploymentsRuleParameters represents the required deployments rule parameters.\ntype RequiredDeploymentsRuleParameters struct {\n\tRequiredDeploymentEnvironments []string `json:\"required_deployment_environments\"`\n}\n\n// PullRequestRuleParameters represents the pull_request rule parameters.\ntype PullRequestRuleParameters struct {\n\tAllowedMergeMethods            []PullRequestMergeMethod   `json:\"allowed_merge_methods,omitempty\"`\n\tDismissStaleReviewsOnPush      bool                       `json:\"dismiss_stale_reviews_on_push\"`\n\tRequireCodeOwnerReview         bool                       `json:\"require_code_owner_review\"`\n\tRequireLastPushApproval        bool                       `json:\"require_last_push_approval\"`\n\tRequiredApprovingReviewCount   int                        `json:\"required_approving_review_count\"`\n\tRequiredReviewers              []*RulesetRequiredReviewer `json:\"required_reviewers,omitempty\"`\n\tRequiredReviewThreadResolution bool                       `json:\"required_review_thread_resolution\"`\n}\n\n// RulesetRequiredReviewer represents required reviewer parameters for pull requests in rulesets.\ntype RulesetRequiredReviewer struct {\n\tMinimumApprovals *int             `json:\"minimum_approvals,omitempty\"`\n\tFilePatterns     []string         `json:\"file_patterns,omitempty\"`\n\tReviewer         *RulesetReviewer `json:\"reviewer,omitempty\"`\n}\n\n// RulesetReviewer represents a reviewer in a ruleset required reviewer rule.\ntype RulesetReviewer struct {\n\tID   *int64               `json:\"id,omitempty\"`\n\tType *RulesetReviewerType `json:\"type,omitempty\"`\n}\n\n// RequiredStatusChecksRuleParameters represents the required status checks rule parameters.\ntype RequiredStatusChecksRuleParameters struct {\n\tDoNotEnforceOnCreate             *bool              `json:\"do_not_enforce_on_create,omitempty\"`\n\tRequiredStatusChecks             []*RuleStatusCheck `json:\"required_status_checks\"`\n\tStrictRequiredStatusChecksPolicy bool               `json:\"strict_required_status_checks_policy\"`\n}\n\n// RuleStatusCheck represents a status checks for the required status checks rule parameters.\ntype RuleStatusCheck struct {\n\tContext       string `json:\"context\"`\n\tIntegrationID *int64 `json:\"integration_id,omitempty\"`\n}\n\n// PatternRuleParameters represents the parameters for a pattern rule.\ntype PatternRuleParameters struct {\n\tName *string `json:\"name,omitempty\"`\n\t// If Negate is true, the rule will fail if the pattern matches.\n\tNegate   *bool               `json:\"negate,omitempty\"`\n\tOperator PatternRuleOperator `json:\"operator\"`\n\tPattern  string              `json:\"pattern\"`\n}\n\n// FilePathRestrictionRuleParameters represents the file path restriction rule parameters.\ntype FilePathRestrictionRuleParameters struct {\n\tRestrictedFilePaths []string `json:\"restricted_file_paths\"`\n}\n\n// MaxFilePathLengthRuleParameters represents the max file path length rule parameters.\ntype MaxFilePathLengthRuleParameters struct {\n\tMaxFilePathLength int `json:\"max_file_path_length\"`\n}\n\n// FileExtensionRestrictionRuleParameters represents the file extension restriction rule parameters.\ntype FileExtensionRestrictionRuleParameters struct {\n\tRestrictedFileExtensions []string `json:\"restricted_file_extensions\"`\n}\n\n// MaxFileSizeRuleParameters represents the max file size rule parameters.\ntype MaxFileSizeRuleParameters struct {\n\tMaxFileSize int64 `json:\"max_file_size\"`\n}\n\n// WorkflowsRuleParameters represents the workflows rule parameters.\ntype WorkflowsRuleParameters struct {\n\tDoNotEnforceOnCreate *bool           `json:\"do_not_enforce_on_create,omitempty\"`\n\tWorkflows            []*RuleWorkflow `json:\"workflows\"`\n}\n\n// RuleWorkflow represents a Workflow for the workflows rule parameters.\ntype RuleWorkflow struct {\n\tPath         string  `json:\"path\"`\n\tRef          *string `json:\"ref,omitempty\"`\n\tRepositoryID *int64  `json:\"repository_id,omitempty\"`\n\tSHA          *string `json:\"sha,omitempty\"`\n}\n\n// CodeScanningRuleParameters represents the code scanning rule parameters.\ntype CodeScanningRuleParameters struct {\n\tCodeScanningTools []*RuleCodeScanningTool `json:\"code_scanning_tools\"`\n}\n\n// CopilotCodeReviewRuleParameters represents the copilot_code_review rule parameters.\ntype CopilotCodeReviewRuleParameters struct {\n\tReviewOnPush            bool `json:\"review_on_push\"`\n\tReviewDraftPullRequests bool `json:\"review_draft_pull_requests\"`\n}\n\n// RuleCodeScanningTool represents a single code scanning tool for the code scanning parameters.\ntype RuleCodeScanningTool struct {\n\tAlertsThreshold         CodeScanningAlertsThreshold         `json:\"alerts_threshold\"`\n\tSecurityAlertsThreshold CodeScanningSecurityAlertsThreshold `json:\"security_alerts_threshold\"`\n\tTool                    string                              `json:\"tool\"`\n}\n\n// SimplePatternRuleParameters represents the parameters for a simple pattern rule.\ntype SimplePatternRuleParameters struct {\n\tNegate  bool   `json:\"negate\"`\n\tPattern string `json:\"pattern\"`\n}\n\n// RepositoryVisibilityRuleParameters represents the repository visibility rule parameters.\ntype RepositoryVisibilityRuleParameters struct {\n\tInternal bool `json:\"internal\"`\n\tPrivate  bool `json:\"private\"`\n}\n\n// repositoryRulesetRuleWrapper is a helper type to marshal & unmarshal a ruleset rule.\ntype repositoryRulesetRuleWrapper struct {\n\tType       RepositoryRuleType `json:\"type\"`\n\tParameters json.RawMessage    `json:\"parameters,omitempty\"`\n}\n\n// MarshalJSON is a custom JSON marshaler for RulesetRules.\nfunc (r *RepositoryRulesetRules) MarshalJSON() ([]byte, error) {\n\tvar rawRules []json.RawMessage\n\n\tif r.Creation != nil {\n\t\tbytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeCreation, r.Creation)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawRules = append(rawRules, json.RawMessage(bytes))\n\t}\n\n\tif r.Update != nil {\n\t\tbytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeUpdate, r.Update)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawRules = append(rawRules, json.RawMessage(bytes))\n\t}\n\n\tif r.Deletion != nil {\n\t\tbytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeDeletion, r.Deletion)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawRules = append(rawRules, json.RawMessage(bytes))\n\t}\n\n\tif r.RequiredLinearHistory != nil {\n\t\tbytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeRequiredLinearHistory, r.RequiredLinearHistory)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawRules = append(rawRules, json.RawMessage(bytes))\n\t}\n\n\tif r.MergeQueue != nil {\n\t\tbytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeMergeQueue, r.MergeQueue)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawRules = append(rawRules, json.RawMessage(bytes))\n\t}\n\n\tif r.RequiredDeployments != nil {\n\t\tbytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeRequiredDeployments, r.RequiredDeployments)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawRules = append(rawRules, json.RawMessage(bytes))\n\t}\n\n\tif r.RequiredSignatures != nil {\n\t\tbytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeRequiredSignatures, r.RequiredSignatures)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawRules = append(rawRules, json.RawMessage(bytes))\n\t}\n\n\tif r.PullRequest != nil {\n\t\tbytes, err := marshalRepositoryRulesetRule(RulesetRuleTypePullRequest, r.PullRequest)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawRules = append(rawRules, json.RawMessage(bytes))\n\t}\n\n\tif r.RequiredStatusChecks != nil {\n\t\tbytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeRequiredStatusChecks, r.RequiredStatusChecks)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawRules = append(rawRules, json.RawMessage(bytes))\n\t}\n\n\tif r.NonFastForward != nil {\n\t\tbytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeNonFastForward, r.NonFastForward)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawRules = append(rawRules, json.RawMessage(bytes))\n\t}\n\n\tif r.CommitMessagePattern != nil {\n\t\tbytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeCommitMessagePattern, r.CommitMessagePattern)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawRules = append(rawRules, json.RawMessage(bytes))\n\t}\n\n\tif r.CommitAuthorEmailPattern != nil {\n\t\tbytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeCommitAuthorEmailPattern, r.CommitAuthorEmailPattern)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawRules = append(rawRules, json.RawMessage(bytes))\n\t}\n\n\tif r.CommitterEmailPattern != nil {\n\t\tbytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeCommitterEmailPattern, r.CommitterEmailPattern)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawRules = append(rawRules, json.RawMessage(bytes))\n\t}\n\n\tif r.BranchNamePattern != nil {\n\t\tbytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeBranchNamePattern, r.BranchNamePattern)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawRules = append(rawRules, json.RawMessage(bytes))\n\t}\n\n\tif r.TagNamePattern != nil {\n\t\tbytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeTagNamePattern, r.TagNamePattern)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawRules = append(rawRules, json.RawMessage(bytes))\n\t}\n\n\tif r.FilePathRestriction != nil {\n\t\tbytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeFilePathRestriction, r.FilePathRestriction)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawRules = append(rawRules, json.RawMessage(bytes))\n\t}\n\n\tif r.MaxFilePathLength != nil {\n\t\tbytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeMaxFilePathLength, r.MaxFilePathLength)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawRules = append(rawRules, json.RawMessage(bytes))\n\t}\n\n\tif r.FileExtensionRestriction != nil {\n\t\tbytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeFileExtensionRestriction, r.FileExtensionRestriction)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawRules = append(rawRules, json.RawMessage(bytes))\n\t}\n\n\tif r.MaxFileSize != nil {\n\t\tbytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeMaxFileSize, r.MaxFileSize)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawRules = append(rawRules, json.RawMessage(bytes))\n\t}\n\n\tif r.Workflows != nil {\n\t\tbytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeWorkflows, r.Workflows)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawRules = append(rawRules, json.RawMessage(bytes))\n\t}\n\n\tif r.CodeScanning != nil {\n\t\tbytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeCodeScanning, r.CodeScanning)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawRules = append(rawRules, json.RawMessage(bytes))\n\t}\n\n\tif r.CopilotCodeReview != nil {\n\t\tbytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeCopilotCodeReview, r.CopilotCodeReview)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawRules = append(rawRules, json.RawMessage(bytes))\n\t}\n\n\tif r.RepositoryCreate != nil {\n\t\tbytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeRepositoryCreate, r.RepositoryCreate)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawRules = append(rawRules, json.RawMessage(bytes))\n\t}\n\n\tif r.RepositoryDelete != nil {\n\t\tbytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeRepositoryDelete, r.RepositoryDelete)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawRules = append(rawRules, json.RawMessage(bytes))\n\t}\n\n\tif r.RepositoryName != nil {\n\t\tbytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeRepositoryName, r.RepositoryName)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawRules = append(rawRules, json.RawMessage(bytes))\n\t}\n\n\tif r.RepositoryTransfer != nil {\n\t\tbytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeRepositoryTransfer, r.RepositoryTransfer)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawRules = append(rawRules, json.RawMessage(bytes))\n\t}\n\n\tif r.RepositoryVisibility != nil {\n\t\tbytes, err := marshalRepositoryRulesetRule(RulesetRuleTypeRepositoryVisibility, r.RepositoryVisibility)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trawRules = append(rawRules, json.RawMessage(bytes))\n\t}\n\n\tif len(rawRules) == 0 {\n\t\treturn []byte(\"[]\"), nil\n\t}\n\n\treturn json.Marshal(rawRules)\n}\n\n// marshalRepositoryRulesetRule is a helper function to marshal a ruleset rule.\nfunc marshalRepositoryRulesetRule[T any](t RepositoryRuleType, params T) ([]byte, error) {\n\thasParams := true\n\n\tswitch t {\n\tcase RulesetRuleTypeCreation,\n\t\tRulesetRuleTypeDeletion,\n\t\tRulesetRuleTypeRequiredLinearHistory,\n\t\tRulesetRuleTypeRequiredSignatures,\n\t\tRulesetRuleTypeNonFastForward,\n\t\tRulesetRuleTypeRepositoryCreate,\n\t\tRulesetRuleTypeRepositoryDelete,\n\t\tRulesetRuleTypeRepositoryTransfer:\n\t\thasParams = false\n\tcase RulesetRuleTypeUpdate:\n\t\tparamsTyped, ok := any(params).(*UpdateRuleParameters)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"expected UpdateRuleParameters for rule type %v\", t)\n\t\t}\n\t\tif paramsTyped == nil || *paramsTyped == (UpdateRuleParameters{}) {\n\t\t\thasParams = false\n\t\t}\n\t}\n\n\tif !hasParams {\n\t\treturn json.Marshal(repositoryRulesetRuleWrapper{Type: t})\n\t}\n\n\tbytes, err := json.Marshal(params)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn json.Marshal(repositoryRulesetRuleWrapper{Type: t, Parameters: json.RawMessage(bytes)})\n}\n\n// UnmarshalJSON is a custom JSON unmarshaler for RulesetRules.\nfunc (r *RepositoryRulesetRules) UnmarshalJSON(data []byte) error {\n\tvar wrappers []*repositoryRulesetRuleWrapper\n\n\tif err := json.Unmarshal(data, &wrappers); err != nil {\n\t\treturn err\n\t}\n\n\tfor _, w := range wrappers {\n\t\tswitch w.Type {\n\t\tcase RulesetRuleTypeCreation:\n\t\t\tr.Creation = &EmptyRuleParameters{}\n\t\tcase RulesetRuleTypeUpdate:\n\t\t\tr.Update = &UpdateRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, r.Update); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\tcase RulesetRuleTypeDeletion:\n\t\t\tr.Deletion = &EmptyRuleParameters{}\n\t\tcase RulesetRuleTypeRequiredLinearHistory:\n\t\t\tr.RequiredLinearHistory = &EmptyRuleParameters{}\n\t\tcase RulesetRuleTypeMergeQueue:\n\t\t\tr.MergeQueue = &MergeQueueRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, r.MergeQueue); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\tcase RulesetRuleTypeRequiredDeployments:\n\t\t\tr.RequiredDeployments = &RequiredDeploymentsRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, r.RequiredDeployments); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\tcase RulesetRuleTypeRequiredSignatures:\n\t\t\tr.RequiredSignatures = &EmptyRuleParameters{}\n\t\tcase RulesetRuleTypePullRequest:\n\t\t\tr.PullRequest = &PullRequestRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, r.PullRequest); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\tcase RulesetRuleTypeRequiredStatusChecks:\n\t\t\tr.RequiredStatusChecks = &RequiredStatusChecksRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, r.RequiredStatusChecks); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\tcase RulesetRuleTypeNonFastForward:\n\t\t\tr.NonFastForward = &EmptyRuleParameters{}\n\t\tcase RulesetRuleTypeCommitMessagePattern:\n\t\t\tr.CommitMessagePattern = &PatternRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, r.CommitMessagePattern); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\tcase RulesetRuleTypeCommitAuthorEmailPattern:\n\t\t\tr.CommitAuthorEmailPattern = &PatternRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, r.CommitAuthorEmailPattern); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\tcase RulesetRuleTypeCommitterEmailPattern:\n\t\t\tr.CommitterEmailPattern = &PatternRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, r.CommitterEmailPattern); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\tcase RulesetRuleTypeBranchNamePattern:\n\t\t\tr.BranchNamePattern = &PatternRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, r.BranchNamePattern); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\tcase RulesetRuleTypeTagNamePattern:\n\t\t\tr.TagNamePattern = &PatternRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, r.TagNamePattern); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\tcase RulesetRuleTypeFilePathRestriction:\n\t\t\tr.FilePathRestriction = &FilePathRestrictionRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, r.FilePathRestriction); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\tcase RulesetRuleTypeMaxFilePathLength:\n\t\t\tr.MaxFilePathLength = &MaxFilePathLengthRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, r.MaxFilePathLength); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\tcase RulesetRuleTypeFileExtensionRestriction:\n\t\t\tr.FileExtensionRestriction = &FileExtensionRestrictionRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, r.FileExtensionRestriction); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\tcase RulesetRuleTypeMaxFileSize:\n\t\t\tr.MaxFileSize = &MaxFileSizeRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, r.MaxFileSize); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\tcase RulesetRuleTypeWorkflows:\n\t\t\tr.Workflows = &WorkflowsRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, r.Workflows); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\tcase RulesetRuleTypeCodeScanning:\n\t\t\tr.CodeScanning = &CodeScanningRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, r.CodeScanning); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\tcase RulesetRuleTypeCopilotCodeReview:\n\t\t\tr.CopilotCodeReview = &CopilotCodeReviewRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, r.CopilotCodeReview); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\tcase RulesetRuleTypeRepositoryCreate:\n\t\t\tr.RepositoryCreate = &EmptyRuleParameters{}\n\t\tcase RulesetRuleTypeRepositoryDelete:\n\t\t\tr.RepositoryDelete = &EmptyRuleParameters{}\n\t\tcase RulesetRuleTypeRepositoryName:\n\t\t\tr.RepositoryName = &SimplePatternRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, r.RepositoryName); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\tcase RulesetRuleTypeRepositoryTransfer:\n\t\t\tr.RepositoryTransfer = &EmptyRuleParameters{}\n\t\tcase RulesetRuleTypeRepositoryVisibility:\n\t\t\tr.RepositoryVisibility = &RepositoryVisibilityRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, r.RepositoryVisibility); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// branchRuleWrapper is a helper type to unmarshal a branch rule.\ntype branchRuleWrapper struct {\n\tType RepositoryRuleType `json:\"type\"`\n\tBranchRuleMetadata\n\tParameters json.RawMessage `json:\"parameters,omitempty\"`\n}\n\n// UnmarshalJSON is a custom JSON unmarshaler for BranchRules.\nfunc (r *BranchRules) UnmarshalJSON(data []byte) error {\n\tvar wrappers []*branchRuleWrapper\n\n\tif err := json.Unmarshal(data, &wrappers); err != nil {\n\t\treturn err\n\t}\n\n\tfor _, w := range wrappers {\n\t\tswitch w.Type {\n\t\tcase RulesetRuleTypeCreation:\n\t\t\tr.Creation = append(r.Creation, &BranchRuleMetadata{RulesetSourceType: w.RulesetSourceType, RulesetSource: w.RulesetSource, RulesetID: w.RulesetID})\n\t\tcase RulesetRuleTypeUpdate:\n\t\t\tparams := &UpdateRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, params); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tr.Update = append(r.Update, &UpdateBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params})\n\t\tcase RulesetRuleTypeDeletion:\n\t\t\tr.Deletion = append(r.Deletion, &BranchRuleMetadata{RulesetSourceType: w.RulesetSourceType, RulesetSource: w.RulesetSource, RulesetID: w.RulesetID})\n\t\tcase RulesetRuleTypeRequiredLinearHistory:\n\t\t\tr.RequiredLinearHistory = append(r.RequiredLinearHistory, &BranchRuleMetadata{RulesetSourceType: w.RulesetSourceType, RulesetSource: w.RulesetSource, RulesetID: w.RulesetID})\n\t\tcase RulesetRuleTypeMergeQueue:\n\t\t\tparams := &MergeQueueRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, params); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tr.MergeQueue = append(r.MergeQueue, &MergeQueueBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params})\n\t\tcase RulesetRuleTypeRequiredDeployments:\n\t\t\tparams := &RequiredDeploymentsRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, params); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tr.RequiredDeployments = append(r.RequiredDeployments, &RequiredDeploymentsBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params})\n\t\tcase RulesetRuleTypeRequiredSignatures:\n\t\t\tr.RequiredSignatures = append(r.RequiredSignatures, &BranchRuleMetadata{RulesetSourceType: w.RulesetSourceType, RulesetSource: w.RulesetSource, RulesetID: w.RulesetID})\n\t\tcase RulesetRuleTypePullRequest:\n\t\t\tparams := &PullRequestRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, params); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tr.PullRequest = append(r.PullRequest, &PullRequestBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params})\n\t\tcase RulesetRuleTypeRequiredStatusChecks:\n\t\t\tparams := &RequiredStatusChecksRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, params); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tr.RequiredStatusChecks = append(r.RequiredStatusChecks, &RequiredStatusChecksBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params})\n\t\tcase RulesetRuleTypeNonFastForward:\n\t\t\tr.NonFastForward = append(r.NonFastForward, &BranchRuleMetadata{RulesetSourceType: w.RulesetSourceType, RulesetSource: w.RulesetSource, RulesetID: w.RulesetID})\n\t\tcase RulesetRuleTypeCommitMessagePattern:\n\t\t\tparams := &PatternRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, params); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tr.CommitMessagePattern = append(r.CommitMessagePattern, &PatternBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params})\n\t\tcase RulesetRuleTypeCommitAuthorEmailPattern:\n\t\t\tparams := &PatternRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, params); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tr.CommitAuthorEmailPattern = append(r.CommitAuthorEmailPattern, &PatternBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params})\n\t\tcase RulesetRuleTypeCommitterEmailPattern:\n\t\t\tparams := &PatternRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, params); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tr.CommitterEmailPattern = append(r.CommitterEmailPattern, &PatternBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params})\n\t\tcase RulesetRuleTypeBranchNamePattern:\n\t\t\tparams := &PatternRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, params); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tr.BranchNamePattern = append(r.BranchNamePattern, &PatternBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params})\n\t\tcase RulesetRuleTypeTagNamePattern:\n\t\t\tparams := &PatternRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, params); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tr.TagNamePattern = append(r.TagNamePattern, &PatternBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params})\n\t\tcase RulesetRuleTypeFilePathRestriction:\n\t\t\tparams := &FilePathRestrictionRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, params); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tr.FilePathRestriction = append(r.FilePathRestriction, &FilePathRestrictionBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params})\n\t\tcase RulesetRuleTypeMaxFilePathLength:\n\t\t\tparams := &MaxFilePathLengthRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, params); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tr.MaxFilePathLength = append(r.MaxFilePathLength, &MaxFilePathLengthBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params})\n\t\tcase RulesetRuleTypeFileExtensionRestriction:\n\t\t\tparams := &FileExtensionRestrictionRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, params); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tr.FileExtensionRestriction = append(r.FileExtensionRestriction, &FileExtensionRestrictionBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params})\n\t\tcase RulesetRuleTypeMaxFileSize:\n\t\t\tparams := &MaxFileSizeRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, params); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tr.MaxFileSize = append(r.MaxFileSize, &MaxFileSizeBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params})\n\t\tcase RulesetRuleTypeWorkflows:\n\t\t\tparams := &WorkflowsRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, params); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tr.Workflows = append(r.Workflows, &WorkflowsBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params})\n\t\tcase RulesetRuleTypeCodeScanning:\n\t\t\tparams := &CodeScanningRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, params); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tr.CodeScanning = append(r.CodeScanning, &CodeScanningBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params})\n\t\tcase RulesetRuleTypeCopilotCodeReview:\n\t\t\tparams := &CopilotCodeReviewRuleParameters{}\n\n\t\t\tif w.Parameters != nil {\n\t\t\t\tif err := json.Unmarshal(w.Parameters, params); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tr.CopilotCodeReview = append(r.CopilotCodeReview, &CopilotCodeReviewBranchRule{BranchRuleMetadata: w.BranchRuleMetadata, Parameters: *params})\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// UnmarshalJSON is a custom JSON unmarshaler for RulesetRule.\nfunc (r *RepositoryRule) UnmarshalJSON(data []byte) error {\n\tw := repositoryRulesetRuleWrapper{}\n\n\tif err := json.Unmarshal(data, &w); err != nil {\n\t\treturn err\n\t}\n\n\tr.Type = w.Type\n\n\tswitch r.Type {\n\tcase RulesetRuleTypeCreation,\n\t\tRulesetRuleTypeDeletion,\n\t\tRulesetRuleTypeRequiredLinearHistory,\n\t\tRulesetRuleTypeRequiredSignatures,\n\t\tRulesetRuleTypeNonFastForward,\n\t\tRulesetRuleTypeRepositoryCreate,\n\t\tRulesetRuleTypeRepositoryDelete,\n\t\tRulesetRuleTypeRepositoryTransfer:\n\t\tr.Parameters = nil\n\tcase RulesetRuleTypeUpdate:\n\t\tp := &UpdateRuleParameters{}\n\n\t\tif w.Parameters != nil {\n\t\t\tif err := json.Unmarshal(w.Parameters, p); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tr.Parameters = p\n\tcase RulesetRuleTypeMergeQueue:\n\t\tp := &MergeQueueRuleParameters{}\n\n\t\tif w.Parameters != nil {\n\t\t\tif err := json.Unmarshal(w.Parameters, p); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tr.Parameters = p\n\tcase RulesetRuleTypeRequiredDeployments:\n\t\tp := &RequiredDeploymentsRuleParameters{}\n\n\t\tif w.Parameters != nil {\n\t\t\tif err := json.Unmarshal(w.Parameters, p); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tr.Parameters = p\n\tcase RulesetRuleTypePullRequest:\n\t\tp := &PullRequestRuleParameters{}\n\n\t\tif w.Parameters != nil {\n\t\t\tif err := json.Unmarshal(w.Parameters, p); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tr.Parameters = p\n\tcase RulesetRuleTypeRequiredStatusChecks:\n\t\tp := &RequiredStatusChecksRuleParameters{}\n\n\t\tif w.Parameters != nil {\n\t\t\tif err := json.Unmarshal(w.Parameters, p); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tr.Parameters = p\n\tcase RulesetRuleTypeCommitMessagePattern,\n\t\tRulesetRuleTypeCommitAuthorEmailPattern,\n\t\tRulesetRuleTypeCommitterEmailPattern,\n\t\tRulesetRuleTypeBranchNamePattern,\n\t\tRulesetRuleTypeTagNamePattern:\n\t\tp := &PatternRuleParameters{}\n\n\t\tif w.Parameters != nil {\n\t\t\tif err := json.Unmarshal(w.Parameters, p); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tr.Parameters = p\n\tcase RulesetRuleTypeFilePathRestriction:\n\t\tp := &FilePathRestrictionRuleParameters{}\n\n\t\tif w.Parameters != nil {\n\t\t\tif err := json.Unmarshal(w.Parameters, p); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tr.Parameters = p\n\tcase RulesetRuleTypeMaxFilePathLength:\n\t\tp := &MaxFilePathLengthRuleParameters{}\n\n\t\tif w.Parameters != nil {\n\t\t\tif err := json.Unmarshal(w.Parameters, p); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tr.Parameters = p\n\tcase RulesetRuleTypeFileExtensionRestriction:\n\t\tp := &FileExtensionRestrictionRuleParameters{}\n\n\t\tif w.Parameters != nil {\n\t\t\tif err := json.Unmarshal(w.Parameters, p); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tr.Parameters = p\n\tcase RulesetRuleTypeMaxFileSize:\n\t\tp := &MaxFileSizeRuleParameters{}\n\n\t\tif w.Parameters != nil {\n\t\t\tif err := json.Unmarshal(w.Parameters, p); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tr.Parameters = p\n\tcase RulesetRuleTypeWorkflows:\n\t\tp := &WorkflowsRuleParameters{}\n\n\t\tif w.Parameters != nil {\n\t\t\tif err := json.Unmarshal(w.Parameters, p); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tr.Parameters = p\n\tcase RulesetRuleTypeCodeScanning:\n\t\tp := &CodeScanningRuleParameters{}\n\n\t\tif w.Parameters != nil {\n\t\t\tif err := json.Unmarshal(w.Parameters, p); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tr.Parameters = p\n\tcase RulesetRuleTypeCopilotCodeReview:\n\t\tp := &CopilotCodeReviewRuleParameters{}\n\n\t\tif w.Parameters != nil {\n\t\t\tif err := json.Unmarshal(w.Parameters, p); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tr.Parameters = p\n\tcase RulesetRuleTypeRepositoryName:\n\t\tp := &SimplePatternRuleParameters{}\n\n\t\tif w.Parameters != nil {\n\t\t\tif err := json.Unmarshal(w.Parameters, p); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tr.Parameters = p\n\tcase RulesetRuleTypeRepositoryVisibility:\n\t\tp := &RepositoryVisibilityRuleParameters{}\n\n\t\tif w.Parameters != nil {\n\t\t\tif err := json.Unmarshal(w.Parameters, p); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tr.Parameters = p\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "github/rules_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestRulesetRules(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tname  string\n\t\trules *RepositoryRulesetRules\n\t\tjson  string\n\t}{\n\t\t{\"empty\", &RepositoryRulesetRules{}, `[]`},\n\t\t{\n\t\t\t\"single_rule_with_empty_params\",\n\t\t\t&RepositoryRulesetRules{Creation: &EmptyRuleParameters{}},\n\t\t\t`[{\"type\":\"creation\"}]`,\n\t\t},\n\t\t{\n\t\t\t\"single_rule_with_required_params\",\n\t\t\t&RepositoryRulesetRules{\n\t\t\t\tRequiredDeployments: &RequiredDeploymentsRuleParameters{\n\t\t\t\t\tRequiredDeploymentEnvironments: []string{\"test\"},\n\t\t\t\t},\n\t\t\t},\n\t\t\t`[{\"type\":\"required_deployments\",\"parameters\":{\"required_deployment_environments\":[\"test\"]}}]`,\n\t\t},\n\t\t{\n\t\t\t\"all_rules_with_required_params\",\n\t\t\t&RepositoryRulesetRules{\n\t\t\t\tCreation:              &EmptyRuleParameters{},\n\t\t\t\tUpdate:                &UpdateRuleParameters{},\n\t\t\t\tDeletion:              &EmptyRuleParameters{},\n\t\t\t\tRequiredLinearHistory: &EmptyRuleParameters{},\n\t\t\t\tMergeQueue: &MergeQueueRuleParameters{\n\t\t\t\t\tCheckResponseTimeoutMinutes:  5,\n\t\t\t\t\tGroupingStrategy:             MergeGroupingStrategyAllGreen,\n\t\t\t\t\tMaxEntriesToBuild:            10,\n\t\t\t\t\tMaxEntriesToMerge:            20,\n\t\t\t\t\tMergeMethod:                  MergeQueueMergeMethodSquash,\n\t\t\t\t\tMinEntriesToMerge:            1,\n\t\t\t\t\tMinEntriesToMergeWaitMinutes: 15,\n\t\t\t\t},\n\t\t\t\tRequiredDeployments: &RequiredDeploymentsRuleParameters{\n\t\t\t\t\tRequiredDeploymentEnvironments: []string{\"test1\", \"test2\"},\n\t\t\t\t},\n\t\t\t\tRequiredSignatures: &EmptyRuleParameters{},\n\t\t\t\tPullRequest: &PullRequestRuleParameters{\n\t\t\t\t\tDismissStaleReviewsOnPush:      true,\n\t\t\t\t\tRequireCodeOwnerReview:         true,\n\t\t\t\t\tRequireLastPushApproval:        true,\n\t\t\t\t\tRequiredApprovingReviewCount:   2,\n\t\t\t\t\tRequiredReviewThreadResolution: true,\n\t\t\t\t},\n\t\t\t\tRequiredStatusChecks: &RequiredStatusChecksRuleParameters{\n\t\t\t\t\tRequiredStatusChecks: []*RuleStatusCheck{\n\t\t\t\t\t\t{Context: \"test1\"},\n\t\t\t\t\t\t{Context: \"test2\"},\n\t\t\t\t\t},\n\t\t\t\t\tStrictRequiredStatusChecksPolicy: true,\n\t\t\t\t},\n\t\t\t\tNonFastForward: &EmptyRuleParameters{},\n\t\t\t\tCommitMessagePattern: &PatternRuleParameters{\n\t\t\t\t\tOperator: PatternRuleOperatorStartsWith,\n\t\t\t\t\tPattern:  \"test\",\n\t\t\t\t},\n\t\t\t\tCommitAuthorEmailPattern: &PatternRuleParameters{\n\t\t\t\t\tOperator: PatternRuleOperatorStartsWith,\n\t\t\t\t\tPattern:  \"test\",\n\t\t\t\t},\n\t\t\t\tCommitterEmailPattern: &PatternRuleParameters{\n\t\t\t\t\tOperator: PatternRuleOperatorStartsWith,\n\t\t\t\t\tPattern:  \"test\",\n\t\t\t\t},\n\t\t\t\tBranchNamePattern: &PatternRuleParameters{\n\t\t\t\t\tOperator: PatternRuleOperatorStartsWith,\n\t\t\t\t\tPattern:  \"test\",\n\t\t\t\t},\n\t\t\t\tTagNamePattern: &PatternRuleParameters{\n\t\t\t\t\tOperator: PatternRuleOperatorStartsWith,\n\t\t\t\t\tPattern:  \"test\",\n\t\t\t\t},\n\t\t\t\tFilePathRestriction: &FilePathRestrictionRuleParameters{\n\t\t\t\t\tRestrictedFilePaths: []string{\"test1\", \"test2\"},\n\t\t\t\t},\n\t\t\t\tMaxFilePathLength: &MaxFilePathLengthRuleParameters{MaxFilePathLength: 512},\n\t\t\t\tFileExtensionRestriction: &FileExtensionRestrictionRuleParameters{\n\t\t\t\t\tRestrictedFileExtensions: []string{\".exe\", \".pkg\"},\n\t\t\t\t},\n\t\t\t\tMaxFileSize: &MaxFileSizeRuleParameters{MaxFileSize: 1024},\n\t\t\t\tWorkflows: &WorkflowsRuleParameters{\n\t\t\t\t\tWorkflows: []*RuleWorkflow{\n\t\t\t\t\t\t{Path: \".github/workflows/test1.yaml\"},\n\t\t\t\t\t\t{Path: \".github/workflows/test2.yaml\"},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tCodeScanning: &CodeScanningRuleParameters{\n\t\t\t\t\tCodeScanningTools: []*RuleCodeScanningTool{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tAlertsThreshold:         CodeScanningAlertsThresholdAll,\n\t\t\t\t\t\t\tSecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdAll,\n\t\t\t\t\t\t\tTool:                    \"test\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tAlertsThreshold:         CodeScanningAlertsThresholdNone,\n\t\t\t\t\t\t\tSecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdNone,\n\t\t\t\t\t\t\tTool:                    \"test\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tCopilotCodeReview: &CopilotCodeReviewRuleParameters{\n\t\t\t\t\tReviewOnPush:            true,\n\t\t\t\t\tReviewDraftPullRequests: false,\n\t\t\t\t},\n\t\t\t\tRepositoryCreate:     &EmptyRuleParameters{},\n\t\t\t\tRepositoryDelete:     &EmptyRuleParameters{},\n\t\t\t\tRepositoryName:       &SimplePatternRuleParameters{Pattern: \"^test-.+\", Negate: false},\n\t\t\t\tRepositoryTransfer:   &EmptyRuleParameters{},\n\t\t\t\tRepositoryVisibility: &RepositoryVisibilityRuleParameters{Internal: false, Private: false},\n\t\t\t},\n\t\t\t`[{\"type\":\"creation\"},{\"type\":\"update\"},{\"type\":\"deletion\"},{\"type\":\"required_linear_history\"},{\"type\":\"merge_queue\",\"parameters\":{\"check_response_timeout_minutes\":5,\"grouping_strategy\":\"ALLGREEN\",\"max_entries_to_build\":10,\"max_entries_to_merge\":20,\"merge_method\":\"SQUASH\",\"min_entries_to_merge\":1,\"min_entries_to_merge_wait_minutes\":15}},{\"type\":\"required_deployments\",\"parameters\":{\"required_deployment_environments\":[\"test1\",\"test2\"]}},{\"type\":\"required_signatures\"},{\"type\":\"pull_request\",\"parameters\":{\"dismiss_stale_reviews_on_push\":true,\"require_code_owner_review\":true,\"require_last_push_approval\":true,\"required_approving_review_count\":2,\"required_review_thread_resolution\":true}},{\"type\":\"required_status_checks\",\"parameters\":{\"required_status_checks\":[{\"context\":\"test1\"},{\"context\":\"test2\"}],\"strict_required_status_checks_policy\":true}},{\"type\":\"non_fast_forward\"},{\"type\":\"commit_message_pattern\",\"parameters\":{\"operator\":\"starts_with\",\"pattern\":\"test\"}},{\"type\":\"commit_author_email_pattern\",\"parameters\":{\"operator\":\"starts_with\",\"pattern\":\"test\"}},{\"type\":\"committer_email_pattern\",\"parameters\":{\"operator\":\"starts_with\",\"pattern\":\"test\"}},{\"type\":\"branch_name_pattern\",\"parameters\":{\"operator\":\"starts_with\",\"pattern\":\"test\"}},{\"type\":\"tag_name_pattern\",\"parameters\":{\"operator\":\"starts_with\",\"pattern\":\"test\"}},{\"type\":\"file_path_restriction\",\"parameters\":{\"restricted_file_paths\":[\"test1\",\"test2\"]}},{\"type\":\"max_file_path_length\",\"parameters\":{\"max_file_path_length\":512}},{\"type\":\"file_extension_restriction\",\"parameters\":{\"restricted_file_extensions\":[\".exe\",\".pkg\"]}},{\"type\":\"max_file_size\",\"parameters\":{\"max_file_size\":1024}},{\"type\":\"workflows\",\"parameters\":{\"workflows\":[{\"path\":\".github/workflows/test1.yaml\"},{\"path\":\".github/workflows/test2.yaml\"}]}},{\"type\":\"code_scanning\",\"parameters\":{\"code_scanning_tools\":[{\"alerts_threshold\":\"all\",\"security_alerts_threshold\":\"all\",\"tool\":\"test\"},{\"alerts_threshold\":\"none\",\"security_alerts_threshold\":\"none\",\"tool\":\"test\"}]}},{\"type\":\"copilot_code_review\",\"parameters\":{\"review_on_push\":true,\"review_draft_pull_requests\":false}},{\"type\":\"repository_create\"},{\"type\":\"repository_delete\"},{\"type\":\"repository_name\",\"parameters\":{\"negate\":false,\"pattern\":\"^test-.+\"}},{\"type\":\"repository_transfer\"},{\"type\":\"repository_visibility\",\"parameters\":{\"internal\":false,\"private\":false}}]`,\n\t\t},\n\t\t{\n\t\t\t\"all_rules_with_all_params\",\n\t\t\t&RepositoryRulesetRules{\n\t\t\t\tCreation:              &EmptyRuleParameters{},\n\t\t\t\tUpdate:                &UpdateRuleParameters{UpdateAllowsFetchAndMerge: true},\n\t\t\t\tDeletion:              &EmptyRuleParameters{},\n\t\t\t\tRequiredLinearHistory: &EmptyRuleParameters{},\n\t\t\t\tMergeQueue: &MergeQueueRuleParameters{\n\t\t\t\t\tCheckResponseTimeoutMinutes:  5,\n\t\t\t\t\tGroupingStrategy:             MergeGroupingStrategyAllGreen,\n\t\t\t\t\tMaxEntriesToBuild:            10,\n\t\t\t\t\tMaxEntriesToMerge:            20,\n\t\t\t\t\tMergeMethod:                  MergeQueueMergeMethodSquash,\n\t\t\t\t\tMinEntriesToMerge:            1,\n\t\t\t\t\tMinEntriesToMergeWaitMinutes: 15,\n\t\t\t\t},\n\t\t\t\tRequiredDeployments: &RequiredDeploymentsRuleParameters{\n\t\t\t\t\tRequiredDeploymentEnvironments: []string{\"test1\", \"test2\"},\n\t\t\t\t},\n\t\t\t\tRequiredSignatures: &EmptyRuleParameters{},\n\t\t\t\tPullRequest: &PullRequestRuleParameters{\n\t\t\t\t\tAllowedMergeMethods: []PullRequestMergeMethod{\n\t\t\t\t\t\tPullRequestMergeMethodSquash,\n\t\t\t\t\t\tPullRequestMergeMethodRebase,\n\t\t\t\t\t},\n\t\t\t\t\tDismissStaleReviewsOnPush:      true,\n\t\t\t\t\tRequireCodeOwnerReview:         true,\n\t\t\t\t\tRequireLastPushApproval:        true,\n\t\t\t\t\tRequiredApprovingReviewCount:   2,\n\t\t\t\t\tRequiredReviewThreadResolution: true,\n\t\t\t\t},\n\t\t\t\tRequiredStatusChecks: &RequiredStatusChecksRuleParameters{\n\t\t\t\t\tDoNotEnforceOnCreate: Ptr(true),\n\t\t\t\t\tRequiredStatusChecks: []*RuleStatusCheck{\n\t\t\t\t\t\t{Context: \"test1\", IntegrationID: Ptr(int64(1))},\n\t\t\t\t\t\t{Context: \"test2\", IntegrationID: Ptr(int64(2))},\n\t\t\t\t\t},\n\t\t\t\t\tStrictRequiredStatusChecksPolicy: true,\n\t\t\t\t},\n\t\t\t\tNonFastForward: &EmptyRuleParameters{},\n\t\t\t\tCommitMessagePattern: &PatternRuleParameters{\n\t\t\t\t\tName:     Ptr(\"cmp\"),\n\t\t\t\t\tNegate:   Ptr(false),\n\t\t\t\t\tOperator: PatternRuleOperatorStartsWith,\n\t\t\t\t\tPattern:  \"test\",\n\t\t\t\t},\n\t\t\t\tCommitAuthorEmailPattern: &PatternRuleParameters{\n\t\t\t\t\tName:     Ptr(\"caep\"),\n\t\t\t\t\tNegate:   Ptr(false),\n\t\t\t\t\tOperator: PatternRuleOperatorStartsWith,\n\t\t\t\t\tPattern:  \"test\",\n\t\t\t\t},\n\t\t\t\tCommitterEmailPattern: &PatternRuleParameters{\n\t\t\t\t\tName:     Ptr(\"cep\"),\n\t\t\t\t\tNegate:   Ptr(false),\n\t\t\t\t\tOperator: PatternRuleOperatorStartsWith,\n\t\t\t\t\tPattern:  \"test\",\n\t\t\t\t},\n\t\t\t\tBranchNamePattern: &PatternRuleParameters{\n\t\t\t\t\tName:     Ptr(\"bp\"),\n\t\t\t\t\tNegate:   Ptr(false),\n\t\t\t\t\tOperator: PatternRuleOperatorStartsWith,\n\t\t\t\t\tPattern:  \"test\",\n\t\t\t\t},\n\t\t\t\tTagNamePattern: &PatternRuleParameters{\n\t\t\t\t\tName:     Ptr(\"tp\"),\n\t\t\t\t\tNegate:   Ptr(false),\n\t\t\t\t\tOperator: PatternRuleOperatorStartsWith,\n\t\t\t\t\tPattern:  \"test\",\n\t\t\t\t},\n\t\t\t\tFilePathRestriction: &FilePathRestrictionRuleParameters{\n\t\t\t\t\tRestrictedFilePaths: []string{\"test1\", \"test2\"},\n\t\t\t\t},\n\t\t\t\tMaxFilePathLength: &MaxFilePathLengthRuleParameters{MaxFilePathLength: 512},\n\t\t\t\tFileExtensionRestriction: &FileExtensionRestrictionRuleParameters{\n\t\t\t\t\tRestrictedFileExtensions: []string{\".exe\", \".pkg\"},\n\t\t\t\t},\n\t\t\t\tMaxFileSize: &MaxFileSizeRuleParameters{MaxFileSize: 1024},\n\t\t\t\tWorkflows: &WorkflowsRuleParameters{\n\t\t\t\t\tDoNotEnforceOnCreate: Ptr(true),\n\t\t\t\t\tWorkflows: []*RuleWorkflow{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tPath:         \".github/workflows/test1.yaml\",\n\t\t\t\t\t\t\tRef:          Ptr(\"main\"),\n\t\t\t\t\t\t\tRepositoryID: Ptr(int64(1)),\n\t\t\t\t\t\t\tSHA:          Ptr(\"aaaa\"),\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tPath:         \".github/workflows/test2.yaml\",\n\t\t\t\t\t\t\tRef:          Ptr(\"main\"),\n\t\t\t\t\t\t\tRepositoryID: Ptr(int64(2)),\n\t\t\t\t\t\t\tSHA:          Ptr(\"bbbb\"),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tCodeScanning: &CodeScanningRuleParameters{\n\t\t\t\t\tCodeScanningTools: []*RuleCodeScanningTool{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tAlertsThreshold:         CodeScanningAlertsThresholdAll,\n\t\t\t\t\t\t\tSecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdAll,\n\t\t\t\t\t\t\tTool:                    \"test\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tAlertsThreshold:         CodeScanningAlertsThresholdNone,\n\t\t\t\t\t\t\tSecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdNone,\n\t\t\t\t\t\t\tTool:                    \"test\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tCopilotCodeReview: &CopilotCodeReviewRuleParameters{\n\t\t\t\t\tReviewOnPush:            true,\n\t\t\t\t\tReviewDraftPullRequests: false,\n\t\t\t\t},\n\t\t\t\tRepositoryCreate:     &EmptyRuleParameters{},\n\t\t\t\tRepositoryDelete:     &EmptyRuleParameters{},\n\t\t\t\tRepositoryName:       &SimplePatternRuleParameters{Pattern: \"^test-.+\", Negate: false},\n\t\t\t\tRepositoryTransfer:   &EmptyRuleParameters{},\n\t\t\t\tRepositoryVisibility: &RepositoryVisibilityRuleParameters{Internal: false, Private: false},\n\t\t\t},\n\t\t\t`[{\"type\":\"creation\"},{\"type\":\"update\",\"parameters\":{\"update_allows_fetch_and_merge\":true}},{\"type\":\"deletion\"},{\"type\":\"required_linear_history\"},{\"type\":\"merge_queue\",\"parameters\":{\"check_response_timeout_minutes\":5,\"grouping_strategy\":\"ALLGREEN\",\"max_entries_to_build\":10,\"max_entries_to_merge\":20,\"merge_method\":\"SQUASH\",\"min_entries_to_merge\":1,\"min_entries_to_merge_wait_minutes\":15}},{\"type\":\"required_deployments\",\"parameters\":{\"required_deployment_environments\":[\"test1\",\"test2\"]}},{\"type\":\"required_signatures\"},{\"type\":\"pull_request\",\"parameters\":{\"allowed_merge_methods\":[\"squash\",\"rebase\"],\"dismiss_stale_reviews_on_push\":true,\"require_code_owner_review\":true,\"require_last_push_approval\":true,\"required_approving_review_count\":2,\"required_review_thread_resolution\":true}},{\"type\":\"required_status_checks\",\"parameters\":{\"do_not_enforce_on_create\":true,\"required_status_checks\":[{\"context\":\"test1\",\"integration_id\":1},{\"context\":\"test2\",\"integration_id\":2}],\"strict_required_status_checks_policy\":true}},{\"type\":\"non_fast_forward\"},{\"type\":\"commit_message_pattern\",\"parameters\":{\"name\":\"cmp\",\"negate\":false,\"operator\":\"starts_with\",\"pattern\":\"test\"}},{\"type\":\"commit_author_email_pattern\",\"parameters\":{\"name\":\"caep\",\"negate\":false,\"operator\":\"starts_with\",\"pattern\":\"test\"}},{\"type\":\"committer_email_pattern\",\"parameters\":{\"name\":\"cep\",\"negate\":false,\"operator\":\"starts_with\",\"pattern\":\"test\"}},{\"type\":\"branch_name_pattern\",\"parameters\":{\"name\":\"bp\",\"negate\":false,\"operator\":\"starts_with\",\"pattern\":\"test\"}},{\"type\":\"tag_name_pattern\",\"parameters\":{\"name\":\"tp\",\"negate\":false,\"operator\":\"starts_with\",\"pattern\":\"test\"}},{\"type\":\"file_path_restriction\",\"parameters\":{\"restricted_file_paths\":[\"test1\",\"test2\"]}},{\"type\":\"max_file_path_length\",\"parameters\":{\"max_file_path_length\":512}},{\"type\":\"file_extension_restriction\",\"parameters\":{\"restricted_file_extensions\":[\".exe\",\".pkg\"]}},{\"type\":\"max_file_size\",\"parameters\":{\"max_file_size\":1024}},{\"type\":\"workflows\",\"parameters\":{\"do_not_enforce_on_create\":true,\"workflows\":[{\"path\":\".github/workflows/test1.yaml\",\"ref\":\"main\",\"repository_id\":1,\"sha\":\"aaaa\"},{\"path\":\".github/workflows/test2.yaml\",\"ref\":\"main\",\"repository_id\":2,\"sha\":\"bbbb\"}]}},{\"type\":\"code_scanning\",\"parameters\":{\"code_scanning_tools\":[{\"alerts_threshold\":\"all\",\"security_alerts_threshold\":\"all\",\"tool\":\"test\"},{\"alerts_threshold\":\"none\",\"security_alerts_threshold\":\"none\",\"tool\":\"test\"}]}},{\"type\":\"copilot_code_review\",\"parameters\":{\"review_on_push\":true,\"review_draft_pull_requests\":false}},{\"type\":\"repository_create\"},{\"type\":\"repository_delete\"},{\"type\":\"repository_name\",\"parameters\":{\"negate\":false,\"pattern\":\"^test-.+\"}},{\"type\":\"repository_transfer\"},{\"type\":\"repository_visibility\",\"parameters\":{\"internal\":false,\"private\":false}}]`,\n\t\t},\n\t}\n\n\tt.Run(\"MarshalJSON\", func(t *testing.T) {\n\t\tt.Parallel()\n\n\t\tfor _, test := range tests {\n\t\t\tt.Run(test.name, func(t *testing.T) {\n\t\t\t\tt.Parallel()\n\n\t\t\t\tgot, err := json.Marshal(test.rules)\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Errorf(\"Unable to marshal JSON for %#v\", test.rules)\n\t\t\t\t}\n\n\t\t\t\tif diff := cmp.Diff(test.json, string(got)); diff != \"\" {\n\t\t\t\t\tt.Errorf(\n\t\t\t\t\t\t\"json.Marshal returned:\\n%v\\nwant:\\n%v\\ndiff:\\n%v\",\n\t\t\t\t\t\tgot,\n\t\t\t\t\t\ttest.json,\n\t\t\t\t\t\tdiff,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t})\n\n\tt.Run(\"UnmarshalJSON\", func(t *testing.T) {\n\t\tt.Parallel()\n\n\t\tfor _, test := range tests {\n\t\t\tt.Run(test.name, func(t *testing.T) {\n\t\t\t\tt.Parallel()\n\n\t\t\t\tgot := &RepositoryRulesetRules{}\n\t\t\t\terr := json.Unmarshal([]byte(test.json), got)\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Errorf(\"Unable to unmarshal JSON %v: %v\", test.json, err)\n\t\t\t\t}\n\n\t\t\t\tif diff := cmp.Diff(test.rules, got); diff != \"\" {\n\t\t\t\t\tt.Errorf(\n\t\t\t\t\t\t\"json.Unmarshal returned:\\n%#v\\nwant:\\n%#v\\ndiff:\\n%v\",\n\t\t\t\t\t\tgot,\n\t\t\t\t\t\ttest.rules,\n\t\t\t\t\t\tdiff,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t})\n\n\tt.Run(\"UnmarshalJSON_Error\", func(t *testing.T) {\n\t\tt.Parallel()\n\n\t\ttests := []struct {\n\t\t\tname string\n\t\t\tjson string\n\t\t}{\n\t\t\t{\n\t\t\t\t\"invalid_copilot_code_review_bool\",\n\t\t\t\t`[{\"type\":\"copilot_code_review\",\"parameters\":{\"review_on_push\":\"invalid_bool\"}}]`,\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"invalid_copilot_code_review_draft_pr\",\n\t\t\t\t`[{\"type\":\"copilot_code_review\",\"parameters\":{\"review_on_push\":true,\"review_draft_pull_requests\":\"not_a_bool\"}}]`,\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"invalid_copilot_code_review_parameters\",\n\t\t\t\t`[{\"type\":\"copilot_code_review\",\"parameters\":\"not_an_object\"}]`,\n\t\t\t},\n\t\t}\n\n\t\tfor _, tt := range tests {\n\t\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\t\tt.Parallel()\n\t\t\t\tgot := &RepositoryRulesetRules{}\n\t\t\t\terr := json.Unmarshal([]byte(tt.json), got)\n\t\t\t\tif err == nil {\n\t\t\t\t\tt.Errorf(\"Expected error unmarshaling %q, got nil\", tt.json)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t})\n}\n\nfunc TestBranchRules(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tname  string\n\t\trules *BranchRules\n\t\tjson  string\n\t}{\n\t\t{\"empty\", &BranchRules{}, `[]`},\n\t\t{\n\t\t\t\"single_rule_type_single_rule_empty_params\",\n\t\t\t&BranchRules{\n\t\t\t\tCreation: []*BranchRuleMetadata{\n\t\t\t\t\t{\n\t\t\t\t\t\tRulesetSourceType: RulesetSourceTypeRepository,\n\t\t\t\t\t\tRulesetSource:     \"test/test\",\n\t\t\t\t\t\tRulesetID:         1,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t`[{\"type\":\"creation\",\"ruleset_source_type\":\"Repository\",\"ruleset_source\":\"test/test\",\"ruleset_id\":1}]`,\n\t\t},\n\t\t{\n\t\t\t\"single_rule_type_single_rule_with_params\",\n\t\t\t&BranchRules{\n\t\t\t\tUpdate: []*UpdateBranchRule{\n\t\t\t\t\t{\n\t\t\t\t\t\tBranchRuleMetadata: BranchRuleMetadata{\n\t\t\t\t\t\t\tRulesetSourceType: RulesetSourceTypeRepository,\n\t\t\t\t\t\t\tRulesetSource:     \"test/test\",\n\t\t\t\t\t\t\tRulesetID:         1,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tParameters: UpdateRuleParameters{UpdateAllowsFetchAndMerge: true},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t`[{\"type\":\"update\",\"ruleset_source_type\":\"Repository\",\"ruleset_source\":\"test/test\",\"ruleset_id\":1,\"parameters\":{\"update_allows_fetch_and_merge\":true}}]`,\n\t\t},\n\t\t{\n\t\t\t\"all_rule_types_with_all_parameters\",\n\t\t\t&BranchRules{\n\t\t\t\tCreation: []*BranchRuleMetadata{\n\t\t\t\t\t{\n\t\t\t\t\t\tRulesetSourceType: RulesetSourceTypeRepository,\n\t\t\t\t\t\tRulesetSource:     \"test/test\",\n\t\t\t\t\t\tRulesetID:         1,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tUpdate: []*UpdateBranchRule{\n\t\t\t\t\t{\n\t\t\t\t\t\tBranchRuleMetadata: BranchRuleMetadata{\n\t\t\t\t\t\t\tRulesetSourceType: RulesetSourceTypeRepository,\n\t\t\t\t\t\t\tRulesetSource:     \"test/test\",\n\t\t\t\t\t\t\tRulesetID:         1,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tParameters: UpdateRuleParameters{UpdateAllowsFetchAndMerge: true},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tDeletion: []*BranchRuleMetadata{\n\t\t\t\t\t{\n\t\t\t\t\t\tRulesetSourceType: RulesetSourceTypeRepository,\n\t\t\t\t\t\tRulesetSource:     \"test/test\",\n\t\t\t\t\t\tRulesetID:         1,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tRequiredLinearHistory: []*BranchRuleMetadata{\n\t\t\t\t\t{\n\t\t\t\t\t\tRulesetSourceType: RulesetSourceTypeRepository,\n\t\t\t\t\t\tRulesetSource:     \"test/test\",\n\t\t\t\t\t\tRulesetID:         1,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tMergeQueue: []*MergeQueueBranchRule{\n\t\t\t\t\t{\n\t\t\t\t\t\tBranchRuleMetadata: BranchRuleMetadata{\n\t\t\t\t\t\t\tRulesetSourceType: RulesetSourceTypeRepository,\n\t\t\t\t\t\t\tRulesetSource:     \"test/test\",\n\t\t\t\t\t\t\tRulesetID:         1,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tParameters: MergeQueueRuleParameters{\n\t\t\t\t\t\t\tCheckResponseTimeoutMinutes:  5,\n\t\t\t\t\t\t\tGroupingStrategy:             MergeGroupingStrategyAllGreen,\n\t\t\t\t\t\t\tMaxEntriesToBuild:            10,\n\t\t\t\t\t\t\tMaxEntriesToMerge:            20,\n\t\t\t\t\t\t\tMergeMethod:                  MergeQueueMergeMethodSquash,\n\t\t\t\t\t\t\tMinEntriesToMerge:            1,\n\t\t\t\t\t\t\tMinEntriesToMergeWaitMinutes: 15,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tRequiredDeployments: []*RequiredDeploymentsBranchRule{\n\t\t\t\t\t{\n\t\t\t\t\t\tBranchRuleMetadata: BranchRuleMetadata{\n\t\t\t\t\t\t\tRulesetSourceType: RulesetSourceTypeRepository,\n\t\t\t\t\t\t\tRulesetSource:     \"test/test\",\n\t\t\t\t\t\t\tRulesetID:         1,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tParameters: RequiredDeploymentsRuleParameters{\n\t\t\t\t\t\t\tRequiredDeploymentEnvironments: []string{\"test1\", \"test2\"},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tRequiredSignatures: []*BranchRuleMetadata{\n\t\t\t\t\t{\n\t\t\t\t\t\tRulesetSourceType: RulesetSourceTypeRepository,\n\t\t\t\t\t\tRulesetSource:     \"test/test\",\n\t\t\t\t\t\tRulesetID:         1,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tPullRequest: []*PullRequestBranchRule{\n\t\t\t\t\t{\n\t\t\t\t\t\tBranchRuleMetadata: BranchRuleMetadata{\n\t\t\t\t\t\t\tRulesetSourceType: RulesetSourceTypeRepository,\n\t\t\t\t\t\t\tRulesetSource:     \"test/test\",\n\t\t\t\t\t\t\tRulesetID:         1,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tParameters: PullRequestRuleParameters{\n\t\t\t\t\t\t\tAllowedMergeMethods: []PullRequestMergeMethod{\n\t\t\t\t\t\t\t\tPullRequestMergeMethodSquash,\n\t\t\t\t\t\t\t\tPullRequestMergeMethodRebase,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tDismissStaleReviewsOnPush:      true,\n\t\t\t\t\t\t\tRequireCodeOwnerReview:         true,\n\t\t\t\t\t\t\tRequireLastPushApproval:        true,\n\t\t\t\t\t\t\tRequiredApprovingReviewCount:   2,\n\t\t\t\t\t\t\tRequiredReviewThreadResolution: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tRequiredStatusChecks: []*RequiredStatusChecksBranchRule{\n\t\t\t\t\t{\n\t\t\t\t\t\tBranchRuleMetadata: BranchRuleMetadata{\n\t\t\t\t\t\t\tRulesetSourceType: RulesetSourceTypeRepository,\n\t\t\t\t\t\t\tRulesetSource:     \"test/test\",\n\t\t\t\t\t\t\tRulesetID:         1,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tParameters: RequiredStatusChecksRuleParameters{\n\t\t\t\t\t\t\tDoNotEnforceOnCreate: Ptr(true),\n\t\t\t\t\t\t\tRequiredStatusChecks: []*RuleStatusCheck{\n\t\t\t\t\t\t\t\t{Context: \"test1\", IntegrationID: Ptr(int64(1))},\n\t\t\t\t\t\t\t\t{Context: \"test2\", IntegrationID: Ptr(int64(2))},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tStrictRequiredStatusChecksPolicy: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tNonFastForward: []*BranchRuleMetadata{\n\t\t\t\t\t{\n\t\t\t\t\t\tRulesetSourceType: RulesetSourceTypeRepository,\n\t\t\t\t\t\tRulesetSource:     \"test/test\",\n\t\t\t\t\t\tRulesetID:         1,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tCommitMessagePattern: []*PatternBranchRule{\n\t\t\t\t\t{\n\t\t\t\t\t\tBranchRuleMetadata: BranchRuleMetadata{\n\t\t\t\t\t\t\tRulesetSourceType: RulesetSourceTypeRepository,\n\t\t\t\t\t\t\tRulesetSource:     \"test/test\",\n\t\t\t\t\t\t\tRulesetID:         1,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tParameters: PatternRuleParameters{\n\t\t\t\t\t\t\tName:     Ptr(\"cmp\"),\n\t\t\t\t\t\t\tNegate:   Ptr(false),\n\t\t\t\t\t\t\tOperator: PatternRuleOperatorStartsWith,\n\t\t\t\t\t\t\tPattern:  \"test\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tCommitAuthorEmailPattern: []*PatternBranchRule{\n\t\t\t\t\t{\n\t\t\t\t\t\tBranchRuleMetadata: BranchRuleMetadata{\n\t\t\t\t\t\t\tRulesetSourceType: RulesetSourceTypeRepository,\n\t\t\t\t\t\t\tRulesetSource:     \"test/test\",\n\t\t\t\t\t\t\tRulesetID:         1,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tParameters: PatternRuleParameters{\n\t\t\t\t\t\t\tName:     Ptr(\"caep\"),\n\t\t\t\t\t\t\tNegate:   Ptr(false),\n\t\t\t\t\t\t\tOperator: PatternRuleOperatorStartsWith,\n\t\t\t\t\t\t\tPattern:  \"test\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tCommitterEmailPattern: []*PatternBranchRule{\n\t\t\t\t\t{\n\t\t\t\t\t\tBranchRuleMetadata: BranchRuleMetadata{\n\t\t\t\t\t\t\tRulesetSourceType: RulesetSourceTypeRepository,\n\t\t\t\t\t\t\tRulesetSource:     \"test/test\",\n\t\t\t\t\t\t\tRulesetID:         1,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tParameters: PatternRuleParameters{\n\t\t\t\t\t\t\tName:     Ptr(\"cep\"),\n\t\t\t\t\t\t\tNegate:   Ptr(false),\n\t\t\t\t\t\t\tOperator: PatternRuleOperatorStartsWith,\n\t\t\t\t\t\t\tPattern:  \"test\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tBranchNamePattern: []*PatternBranchRule{\n\t\t\t\t\t{\n\t\t\t\t\t\tBranchRuleMetadata: BranchRuleMetadata{\n\t\t\t\t\t\t\tRulesetSourceType: RulesetSourceTypeRepository,\n\t\t\t\t\t\t\tRulesetSource:     \"test/test\",\n\t\t\t\t\t\t\tRulesetID:         1,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tParameters: PatternRuleParameters{\n\t\t\t\t\t\t\tName:     Ptr(\"bp\"),\n\t\t\t\t\t\t\tNegate:   Ptr(false),\n\t\t\t\t\t\t\tOperator: PatternRuleOperatorStartsWith,\n\t\t\t\t\t\t\tPattern:  \"test\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tTagNamePattern: []*PatternBranchRule{\n\t\t\t\t\t{\n\t\t\t\t\t\tBranchRuleMetadata: BranchRuleMetadata{\n\t\t\t\t\t\t\tRulesetSourceType: RulesetSourceTypeRepository,\n\t\t\t\t\t\t\tRulesetSource:     \"test/test\",\n\t\t\t\t\t\t\tRulesetID:         1,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tParameters: PatternRuleParameters{\n\t\t\t\t\t\t\tName:     Ptr(\"tp\"),\n\t\t\t\t\t\t\tNegate:   Ptr(false),\n\t\t\t\t\t\t\tOperator: PatternRuleOperatorStartsWith,\n\t\t\t\t\t\t\tPattern:  \"test\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tFilePathRestriction: []*FilePathRestrictionBranchRule{\n\t\t\t\t\t{\n\t\t\t\t\t\tBranchRuleMetadata: BranchRuleMetadata{\n\t\t\t\t\t\t\tRulesetSourceType: RulesetSourceTypeRepository,\n\t\t\t\t\t\t\tRulesetSource:     \"test/test\",\n\t\t\t\t\t\t\tRulesetID:         1,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tParameters: FilePathRestrictionRuleParameters{\n\t\t\t\t\t\t\tRestrictedFilePaths: []string{\"test1\", \"test2\"},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tMaxFilePathLength: []*MaxFilePathLengthBranchRule{\n\t\t\t\t\t{\n\t\t\t\t\t\tBranchRuleMetadata: BranchRuleMetadata{\n\t\t\t\t\t\t\tRulesetSourceType: RulesetSourceTypeRepository,\n\t\t\t\t\t\t\tRulesetSource:     \"test/test\",\n\t\t\t\t\t\t\tRulesetID:         1,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tParameters: MaxFilePathLengthRuleParameters{MaxFilePathLength: 512},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tFileExtensionRestriction: []*FileExtensionRestrictionBranchRule{\n\t\t\t\t\t{\n\t\t\t\t\t\tBranchRuleMetadata: BranchRuleMetadata{\n\t\t\t\t\t\t\tRulesetSourceType: RulesetSourceTypeRepository,\n\t\t\t\t\t\t\tRulesetSource:     \"test/test\",\n\t\t\t\t\t\t\tRulesetID:         1,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tParameters: FileExtensionRestrictionRuleParameters{\n\t\t\t\t\t\t\tRestrictedFileExtensions: []string{\".exe\", \".pkg\"},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tMaxFileSize: []*MaxFileSizeBranchRule{\n\t\t\t\t\t{\n\t\t\t\t\t\tBranchRuleMetadata: BranchRuleMetadata{\n\t\t\t\t\t\t\tRulesetSourceType: RulesetSourceTypeRepository,\n\t\t\t\t\t\t\tRulesetSource:     \"test/test\",\n\t\t\t\t\t\t\tRulesetID:         1,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tParameters: MaxFileSizeRuleParameters{MaxFileSize: 1024},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tWorkflows: []*WorkflowsBranchRule{\n\t\t\t\t\t{\n\t\t\t\t\t\tBranchRuleMetadata: BranchRuleMetadata{\n\t\t\t\t\t\t\tRulesetSourceType: RulesetSourceTypeRepository,\n\t\t\t\t\t\t\tRulesetSource:     \"test/test\",\n\t\t\t\t\t\t\tRulesetID:         1,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tParameters: WorkflowsRuleParameters{\n\t\t\t\t\t\t\tDoNotEnforceOnCreate: Ptr(true),\n\t\t\t\t\t\t\tWorkflows: []*RuleWorkflow{\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tPath:         \".github/workflows/test1.yaml\",\n\t\t\t\t\t\t\t\t\tRef:          Ptr(\"main\"),\n\t\t\t\t\t\t\t\t\tRepositoryID: Ptr(int64(1)),\n\t\t\t\t\t\t\t\t\tSHA:          Ptr(\"aaaa\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tPath:         \".github/workflows/test2.yaml\",\n\t\t\t\t\t\t\t\t\tRef:          Ptr(\"main\"),\n\t\t\t\t\t\t\t\t\tRepositoryID: Ptr(int64(2)),\n\t\t\t\t\t\t\t\t\tSHA:          Ptr(\"bbbb\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tCodeScanning: []*CodeScanningBranchRule{\n\t\t\t\t\t{\n\t\t\t\t\t\tBranchRuleMetadata: BranchRuleMetadata{\n\t\t\t\t\t\t\tRulesetSourceType: RulesetSourceTypeRepository,\n\t\t\t\t\t\t\tRulesetSource:     \"test/test\",\n\t\t\t\t\t\t\tRulesetID:         1,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tParameters: CodeScanningRuleParameters{\n\t\t\t\t\t\t\tCodeScanningTools: []*RuleCodeScanningTool{\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tAlertsThreshold:         CodeScanningAlertsThresholdAll,\n\t\t\t\t\t\t\t\t\tSecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdAll,\n\t\t\t\t\t\t\t\t\tTool:                    \"test\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tAlertsThreshold:         CodeScanningAlertsThresholdNone,\n\t\t\t\t\t\t\t\t\tSecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdNone,\n\t\t\t\t\t\t\t\t\tTool:                    \"test\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tCopilotCodeReview: []*CopilotCodeReviewBranchRule{\n\t\t\t\t\t{\n\t\t\t\t\t\tBranchRuleMetadata: BranchRuleMetadata{\n\t\t\t\t\t\t\tRulesetSourceType: RulesetSourceTypeRepository,\n\t\t\t\t\t\t\tRulesetSource:     \"test/test\",\n\t\t\t\t\t\t\tRulesetID:         1,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tParameters: CopilotCodeReviewRuleParameters{\n\t\t\t\t\t\t\tReviewOnPush:            true,\n\t\t\t\t\t\t\tReviewDraftPullRequests: false,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t`[{\"type\":\"creation\",\"ruleset_source_type\":\"Repository\",\"ruleset_source\":\"test/test\",\"ruleset_id\":1},{\"type\":\"update\",\"ruleset_source_type\":\"Repository\",\"ruleset_source\":\"test/test\",\"ruleset_id\":1,\"parameters\":{\"update_allows_fetch_and_merge\":true}},{\"type\":\"deletion\",\"ruleset_source_type\":\"Repository\",\"ruleset_source\":\"test/test\",\"ruleset_id\":1},{\"type\":\"required_linear_history\",\"ruleset_source_type\":\"Repository\",\"ruleset_source\":\"test/test\",\"ruleset_id\":1},{\"type\":\"merge_queue\",\"ruleset_source_type\":\"Repository\",\"ruleset_source\":\"test/test\",\"ruleset_id\":1,\"parameters\":{\"check_response_timeout_minutes\":5,\"grouping_strategy\":\"ALLGREEN\",\"max_entries_to_build\":10,\"max_entries_to_merge\":20,\"merge_method\":\"SQUASH\",\"min_entries_to_merge\":1,\"min_entries_to_merge_wait_minutes\":15}},{\"type\":\"required_deployments\",\"ruleset_source_type\":\"Repository\",\"ruleset_source\":\"test/test\",\"ruleset_id\":1,\"parameters\":{\"required_deployment_environments\":[\"test1\",\"test2\"]}},{\"type\":\"required_signatures\",\"ruleset_source_type\":\"Repository\",\"ruleset_source\":\"test/test\",\"ruleset_id\":1},{\"type\":\"pull_request\",\"ruleset_source_type\":\"Repository\",\"ruleset_source\":\"test/test\",\"ruleset_id\":1,\"parameters\":{\"allowed_merge_methods\":[\"squash\",\"rebase\"],\"dismiss_stale_reviews_on_push\":true,\"require_code_owner_review\":true,\"require_last_push_approval\":true,\"required_approving_review_count\":2,\"required_review_thread_resolution\":true}},{\"type\":\"required_status_checks\",\"ruleset_source_type\":\"Repository\",\"ruleset_source\":\"test/test\",\"ruleset_id\":1,\"parameters\":{\"do_not_enforce_on_create\":true,\"required_status_checks\":[{\"context\":\"test1\",\"integration_id\":1},{\"context\":\"test2\",\"integration_id\":2}],\"strict_required_status_checks_policy\":true}},{\"type\":\"non_fast_forward\",\"ruleset_source_type\":\"Repository\",\"ruleset_source\":\"test/test\",\"ruleset_id\":1},{\"type\":\"commit_message_pattern\",\"ruleset_source_type\":\"Repository\",\"ruleset_source\":\"test/test\",\"ruleset_id\":1,\"parameters\":{\"name\":\"cmp\",\"negate\":false,\"operator\":\"starts_with\",\"pattern\":\"test\"}},{\"type\":\"commit_author_email_pattern\",\"ruleset_source_type\":\"Repository\",\"ruleset_source\":\"test/test\",\"ruleset_id\":1,\"parameters\":{\"name\":\"caep\",\"negate\":false,\"operator\":\"starts_with\",\"pattern\":\"test\"}},{\"type\":\"committer_email_pattern\",\"ruleset_source_type\":\"Repository\",\"ruleset_source\":\"test/test\",\"ruleset_id\":1,\"parameters\":{\"name\":\"cep\",\"negate\":false,\"operator\":\"starts_with\",\"pattern\":\"test\"}},{\"type\":\"branch_name_pattern\",\"ruleset_source_type\":\"Repository\",\"ruleset_source\":\"test/test\",\"ruleset_id\":1,\"parameters\":{\"name\":\"bp\",\"negate\":false,\"operator\":\"starts_with\",\"pattern\":\"test\"}},{\"type\":\"tag_name_pattern\",\"ruleset_source_type\":\"Repository\",\"ruleset_source\":\"test/test\",\"ruleset_id\":1,\"parameters\":{\"name\":\"tp\",\"negate\":false,\"operator\":\"starts_with\",\"pattern\":\"test\"}},{\"type\":\"file_path_restriction\",\"ruleset_source_type\":\"Repository\",\"ruleset_source\":\"test/test\",\"ruleset_id\":1,\"parameters\":{\"restricted_file_paths\":[\"test1\",\"test2\"]}},{\"type\":\"max_file_path_length\",\"ruleset_source_type\":\"Repository\",\"ruleset_source\":\"test/test\",\"ruleset_id\":1,\"parameters\":{\"max_file_path_length\":512}},{\"type\":\"file_extension_restriction\",\"ruleset_source_type\":\"Repository\",\"ruleset_source\":\"test/test\",\"ruleset_id\":1,\"parameters\":{\"restricted_file_extensions\":[\".exe\",\".pkg\"]}},{\"type\":\"max_file_size\",\"ruleset_source_type\":\"Repository\",\"ruleset_source\":\"test/test\",\"ruleset_id\":1,\"parameters\":{\"max_file_size\":1024}},{\"type\":\"workflows\",\"ruleset_source_type\":\"Repository\",\"ruleset_source\":\"test/test\",\"ruleset_id\":1,\"parameters\":{\"do_not_enforce_on_create\":true,\"workflows\":[{\"path\":\".github/workflows/test1.yaml\",\"ref\":\"main\",\"repository_id\":1,\"sha\":\"aaaa\"},{\"path\":\".github/workflows/test2.yaml\",\"ref\":\"main\",\"repository_id\":2,\"sha\":\"bbbb\"}]}},{\"type\":\"code_scanning\",\"ruleset_source_type\":\"Repository\",\"ruleset_source\":\"test/test\",\"ruleset_id\":1,\"parameters\":{\"code_scanning_tools\":[{\"alerts_threshold\":\"all\",\"security_alerts_threshold\":\"all\",\"tool\":\"test\"},{\"alerts_threshold\":\"none\",\"security_alerts_threshold\":\"none\",\"tool\":\"test\"}]}},{\"type\":\"copilot_code_review\",\"ruleset_source_type\":\"Repository\",\"ruleset_source\":\"test/test\",\"ruleset_id\":1,\"parameters\":{\"review_on_push\":true,\"review_draft_pull_requests\":false}}]`,\n\t\t},\n\t}\n\n\tt.Run(\"UnmarshalJSON\", func(t *testing.T) {\n\t\tt.Parallel()\n\n\t\tfor _, test := range tests {\n\t\t\tt.Run(test.name, func(t *testing.T) {\n\t\t\t\tt.Parallel()\n\n\t\t\t\tgot := &BranchRules{}\n\t\t\t\terr := json.Unmarshal([]byte(test.json), got)\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Errorf(\"Unable to unmarshal JSON %v: %v\", test.json, err)\n\t\t\t\t}\n\n\t\t\t\tif diff := cmp.Diff(test.rules, got); diff != \"\" {\n\t\t\t\t\tt.Errorf(\n\t\t\t\t\t\t\"json.Unmarshal returned:\\n%#v\\nwant:\\n%#v\\ndiff:\\n%v\",\n\t\t\t\t\t\tgot,\n\t\t\t\t\t\ttest.rules,\n\t\t\t\t\t\tdiff,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t})\n\n\tt.Run(\"UnmarshalJSON_Error\", func(t *testing.T) {\n\t\tt.Parallel()\n\n\t\ttests := []struct {\n\t\t\tname string\n\t\t\tjson string\n\t\t}{\n\t\t\t{\n\t\t\t\t\"invalid_copilot_code_review_parameters\",\n\t\t\t\t`[{\"type\":\"copilot_code_review\",\"ruleset_source_type\":\"Repository\",\"ruleset_source\":\"test/test\",\"ruleset_id\":1,\"parameters\":\"not_an_object\"}]`,\n\t\t\t},\n\t\t}\n\n\t\tfor _, tt := range tests {\n\t\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\t\tt.Parallel()\n\t\t\t\tgot := &BranchRules{}\n\t\t\t\terr := json.Unmarshal([]byte(tt.json), got)\n\t\t\t\tif err == nil {\n\t\t\t\t\tt.Errorf(\"Expected error unmarshaling %q, got nil\", tt.json)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t})\n}\n\nfunc TestRepositoryRule(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tname string\n\t\trule *RepositoryRule\n\t\tjson string\n\t}{\n\t\t{\n\t\t\t\"empty\",\n\t\t\t&RepositoryRule{},\n\t\t\t`{}`,\n\t\t},\n\t\t{\n\t\t\t\"creation\",\n\t\t\t&RepositoryRule{Type: RulesetRuleTypeCreation, Parameters: nil},\n\t\t\t`{\"type\":\"creation\"}`,\n\t\t},\n\t\t{\n\t\t\t\"update\",\n\t\t\t&RepositoryRule{Type: RulesetRuleTypeUpdate, Parameters: &UpdateRuleParameters{}},\n\t\t\t`{\"type\":\"update\"}`,\n\t\t},\n\t\t{\n\t\t\t\"update_params_empty\",\n\t\t\t&RepositoryRule{Type: RulesetRuleTypeUpdate, Parameters: &UpdateRuleParameters{}},\n\t\t\t`{\"type\":\"update\",\"parameters\":{}}`,\n\t\t},\n\t\t{\n\t\t\t\"update_params_set\",\n\t\t\t&RepositoryRule{\n\t\t\t\tType:       RulesetRuleTypeUpdate,\n\t\t\t\tParameters: &UpdateRuleParameters{UpdateAllowsFetchAndMerge: true},\n\t\t\t},\n\t\t\t`{\"type\":\"update\",\"parameters\":{\"update_allows_fetch_and_merge\":true}}`,\n\t\t},\n\t\t{\n\t\t\t\"deletion\",\n\t\t\t&RepositoryRule{Type: RulesetRuleTypeDeletion, Parameters: nil},\n\t\t\t`{\"type\":\"deletion\"}`,\n\t\t},\n\t\t{\n\t\t\t\"required_linear_history\",\n\t\t\t&RepositoryRule{Type: RulesetRuleTypeRequiredLinearHistory, Parameters: nil},\n\t\t\t`{\"type\":\"required_linear_history\"}`,\n\t\t},\n\t\t{\n\t\t\t\"merge_queue\",\n\t\t\t&RepositoryRule{\n\t\t\t\tType: RulesetRuleTypeMergeQueue,\n\t\t\t\tParameters: &MergeQueueRuleParameters{\n\t\t\t\t\tCheckResponseTimeoutMinutes:  5,\n\t\t\t\t\tGroupingStrategy:             MergeGroupingStrategyAllGreen,\n\t\t\t\t\tMaxEntriesToBuild:            10,\n\t\t\t\t\tMaxEntriesToMerge:            20,\n\t\t\t\t\tMergeMethod:                  MergeQueueMergeMethodSquash,\n\t\t\t\t\tMinEntriesToMerge:            1,\n\t\t\t\t\tMinEntriesToMergeWaitMinutes: 15,\n\t\t\t\t},\n\t\t\t},\n\t\t\t`{\"type\":\"merge_queue\",\"parameters\":{\"check_response_timeout_minutes\":5,\"grouping_strategy\":\"ALLGREEN\",\"max_entries_to_build\":10,\"max_entries_to_merge\":20,\"merge_method\":\"SQUASH\",\"min_entries_to_merge\":1,\"min_entries_to_merge_wait_minutes\":15}}`,\n\t\t},\n\t\t{\n\t\t\t\"required_deployments\",\n\t\t\t&RepositoryRule{\n\t\t\t\tType: RulesetRuleTypeRequiredDeployments,\n\t\t\t\tParameters: &RequiredDeploymentsRuleParameters{\n\t\t\t\t\tRequiredDeploymentEnvironments: []string{\"test1\", \"test2\"},\n\t\t\t\t},\n\t\t\t},\n\t\t\t`{\"type\":\"required_deployments\",\"parameters\":{\"required_deployment_environments\":[\"test1\",\"test2\"]}}`,\n\t\t},\n\t\t{\n\t\t\t\"required_signatures\",\n\t\t\t&RepositoryRule{Type: RulesetRuleTypeRequiredSignatures, Parameters: nil},\n\t\t\t`{\"type\":\"required_signatures\"}`,\n\t\t},\n\t\t{\n\t\t\t\"pull_request\",\n\t\t\t&RepositoryRule{\n\t\t\t\tType: RulesetRuleTypePullRequest,\n\t\t\t\tParameters: &PullRequestRuleParameters{\n\t\t\t\t\tAllowedMergeMethods: []PullRequestMergeMethod{\n\t\t\t\t\t\tPullRequestMergeMethodSquash,\n\t\t\t\t\t\tPullRequestMergeMethodRebase,\n\t\t\t\t\t},\n\t\t\t\t\tDismissStaleReviewsOnPush:      true,\n\t\t\t\t\tRequireCodeOwnerReview:         true,\n\t\t\t\t\tRequireLastPushApproval:        true,\n\t\t\t\t\tRequiredApprovingReviewCount:   2,\n\t\t\t\t\tRequiredReviewThreadResolution: true,\n\t\t\t\t},\n\t\t\t},\n\t\t\t`{\"type\":\"pull_request\",\"parameters\":{\"allowed_merge_methods\":[\"squash\",\"rebase\"],\"dismiss_stale_reviews_on_push\":true,\"require_code_owner_review\":true,\"require_last_push_approval\":true,\"required_approving_review_count\":2,\"required_review_thread_resolution\":true}}`,\n\t\t},\n\t\t{\n\t\t\t\"pull_request_with_required_reviewers\",\n\t\t\t&RepositoryRule{\n\t\t\t\tType: RulesetRuleTypePullRequest,\n\t\t\t\tParameters: &PullRequestRuleParameters{\n\t\t\t\t\tAllowedMergeMethods: []PullRequestMergeMethod{\n\t\t\t\t\t\tPullRequestMergeMethodMerge,\n\t\t\t\t\t\tPullRequestMergeMethodSquash,\n\t\t\t\t\t\tPullRequestMergeMethodRebase,\n\t\t\t\t\t},\n\t\t\t\t\tDismissStaleReviewsOnPush:      false,\n\t\t\t\t\tRequireCodeOwnerReview:         false,\n\t\t\t\t\tRequireLastPushApproval:        false,\n\t\t\t\t\tRequiredApprovingReviewCount:   0,\n\t\t\t\t\tRequiredReviewThreadResolution: false,\n\t\t\t\t\tRequiredReviewers: []*RulesetRequiredReviewer{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tMinimumApprovals: Ptr(1),\n\t\t\t\t\t\t\tFilePatterns:     []string{\"*\"},\n\t\t\t\t\t\t\tReviewer: &RulesetReviewer{\n\t\t\t\t\t\t\t\tID:   Ptr(int64(123456)),\n\t\t\t\t\t\t\t\tType: Ptr(RulesetReviewerTypeTeam),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t`{\"type\":\"pull_request\",\"parameters\":{\"allowed_merge_methods\":[\"merge\",\"squash\",\"rebase\"],\"dismiss_stale_reviews_on_push\":false,\"require_code_owner_review\":false,\"require_last_push_approval\":false,\"required_approving_review_count\":0,\"required_reviewers\":[{\"minimum_approvals\":1,\"file_patterns\":[\"*\"],\"reviewer\":{\"id\":123456,\"type\":\"Team\"}}],\"required_review_thread_resolution\":false}}`,\n\t\t},\n\t\t{\n\t\t\t\"required_status_checks\",\n\t\t\t&RepositoryRule{\n\t\t\t\tType: RulesetRuleTypeRequiredStatusChecks,\n\t\t\t\tParameters: &RequiredStatusChecksRuleParameters{\n\t\t\t\t\tRequiredStatusChecks: []*RuleStatusCheck{\n\t\t\t\t\t\t{Context: \"test1\"},\n\t\t\t\t\t\t{Context: \"test2\"},\n\t\t\t\t\t},\n\t\t\t\t\tStrictRequiredStatusChecksPolicy: true,\n\t\t\t\t},\n\t\t\t},\n\t\t\t`{\"type\":\"required_status_checks\",\"parameters\":{\"required_status_checks\":[{\"context\":\"test1\"},{\"context\":\"test2\"}],\"strict_required_status_checks_policy\":true}}`,\n\t\t},\n\t\t{\n\t\t\t\"non_fast_forward\",\n\t\t\t&RepositoryRule{Type: RulesetRuleTypeNonFastForward, Parameters: nil},\n\t\t\t`{\"type\":\"non_fast_forward\"}`,\n\t\t},\n\t\t{\n\t\t\t\"commit_message_pattern\",\n\t\t\t&RepositoryRule{\n\t\t\t\tType: RulesetRuleTypeCommitMessagePattern,\n\t\t\t\tParameters: &PatternRuleParameters{\n\t\t\t\t\tName:     Ptr(\"test\"),\n\t\t\t\t\tNegate:   Ptr(false),\n\t\t\t\t\tOperator: PatternRuleOperatorStartsWith,\n\t\t\t\t\tPattern:  \"test\",\n\t\t\t\t},\n\t\t\t},\n\t\t\t`{\"type\":\"commit_message_pattern\",\"parameters\":{\"name\":\"test\",\"negate\":false,\"operator\":\"starts_with\",\"pattern\":\"test\"}}`,\n\t\t},\n\t\t{\n\t\t\t\"commit_author_email_pattern\",\n\t\t\t&RepositoryRule{\n\t\t\t\tType: RulesetRuleTypeCommitAuthorEmailPattern,\n\t\t\t\tParameters: &PatternRuleParameters{\n\t\t\t\t\tName:     Ptr(\"test\"),\n\t\t\t\t\tNegate:   Ptr(false),\n\t\t\t\t\tOperator: PatternRuleOperatorStartsWith,\n\t\t\t\t\tPattern:  \"test\",\n\t\t\t\t},\n\t\t\t},\n\t\t\t`{\"type\":\"commit_author_email_pattern\",\"parameters\":{\"name\":\"test\",\"negate\":false,\"operator\":\"starts_with\",\"pattern\":\"test\"}}`,\n\t\t},\n\t\t{\n\t\t\t\"committer_email_pattern\",\n\t\t\t&RepositoryRule{\n\t\t\t\tType: RulesetRuleTypeCommitterEmailPattern,\n\t\t\t\tParameters: &PatternRuleParameters{\n\t\t\t\t\tName:     Ptr(\"test\"),\n\t\t\t\t\tNegate:   Ptr(false),\n\t\t\t\t\tOperator: PatternRuleOperatorStartsWith,\n\t\t\t\t\tPattern:  \"test\",\n\t\t\t\t},\n\t\t\t},\n\t\t\t`{\"type\":\"committer_email_pattern\",\"parameters\":{\"name\":\"test\",\"negate\":false,\"operator\":\"starts_with\",\"pattern\":\"test\"}}`,\n\t\t},\n\t\t{\n\t\t\t\"branch_name_pattern\",\n\t\t\t&RepositoryRule{\n\t\t\t\tType: RulesetRuleTypeBranchNamePattern,\n\t\t\t\tParameters: &PatternRuleParameters{\n\t\t\t\t\tName:     Ptr(\"test\"),\n\t\t\t\t\tNegate:   Ptr(false),\n\t\t\t\t\tOperator: PatternRuleOperatorStartsWith,\n\t\t\t\t\tPattern:  \"test\",\n\t\t\t\t},\n\t\t\t},\n\t\t\t`{\"type\":\"branch_name_pattern\",\"parameters\":{\"name\":\"test\",\"negate\":false,\"operator\":\"starts_with\",\"pattern\":\"test\"}}`,\n\t\t},\n\t\t{\n\t\t\t\"tag_name_pattern\",\n\t\t\t&RepositoryRule{\n\t\t\t\tType: RulesetRuleTypeTagNamePattern,\n\t\t\t\tParameters: &PatternRuleParameters{\n\t\t\t\t\tName:     Ptr(\"test\"),\n\t\t\t\t\tNegate:   Ptr(false),\n\t\t\t\t\tOperator: PatternRuleOperatorStartsWith,\n\t\t\t\t\tPattern:  \"test\",\n\t\t\t\t},\n\t\t\t},\n\t\t\t`{\"type\":\"tag_name_pattern\",\"parameters\":{\"name\":\"test\",\"negate\":false,\"operator\":\"starts_with\",\"pattern\":\"test\"}}`,\n\t\t},\n\t\t{\n\t\t\t\"file_path_restriction\",\n\t\t\t&RepositoryRule{\n\t\t\t\tType: RulesetRuleTypeFilePathRestriction,\n\t\t\t\tParameters: &FilePathRestrictionRuleParameters{\n\t\t\t\t\tRestrictedFilePaths: []string{\"test1\", \"test2\"},\n\t\t\t\t},\n\t\t\t},\n\t\t\t`{\"type\":\"file_path_restriction\",\"parameters\":{\"restricted_file_paths\":[\"test1\",\"test2\"]}}`,\n\t\t},\n\t\t{\n\t\t\t\"max_file_path_length\",\n\t\t\t&RepositoryRule{\n\t\t\t\tType:       RulesetRuleTypeMaxFilePathLength,\n\t\t\t\tParameters: &MaxFilePathLengthRuleParameters{MaxFilePathLength: 512},\n\t\t\t},\n\t\t\t`{\"type\":\"max_file_path_length\",\"parameters\":{\"max_file_path_length\":512}}`,\n\t\t},\n\t\t{\n\t\t\t\"file_extension_restriction\",\n\t\t\t&RepositoryRule{\n\t\t\t\tType: RulesetRuleTypeFileExtensionRestriction,\n\t\t\t\tParameters: &FileExtensionRestrictionRuleParameters{\n\t\t\t\t\tRestrictedFileExtensions: []string{\".exe\", \".pkg\"},\n\t\t\t\t},\n\t\t\t},\n\t\t\t`{\"type\":\"file_extension_restriction\",\"parameters\":{\"restricted_file_extensions\":[\".exe\",\".pkg\"]}}`,\n\t\t},\n\t\t{\n\t\t\t\"max_file_size\",\n\t\t\t&RepositoryRule{\n\t\t\t\tType:       RulesetRuleTypeMaxFileSize,\n\t\t\t\tParameters: &MaxFileSizeRuleParameters{MaxFileSize: 1024},\n\t\t\t},\n\t\t\t`{\"type\":\"max_file_size\",\"parameters\":{\"max_file_size\":1024}}`,\n\t\t},\n\t\t{\n\t\t\t\"workflows\",\n\t\t\t&RepositoryRule{\n\t\t\t\tType: RulesetRuleTypeWorkflows,\n\t\t\t\tParameters: &WorkflowsRuleParameters{\n\t\t\t\t\tWorkflows: []*RuleWorkflow{\n\t\t\t\t\t\t{Path: \".github/workflows/test1.yaml\"},\n\t\t\t\t\t\t{Path: \".github/workflows/test2.yaml\"},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t`{\"type\":\"workflows\",\"parameters\":{\"workflows\":[{\"path\":\".github/workflows/test1.yaml\"},{\"path\":\".github/workflows/test2.yaml\"}]}}`,\n\t\t},\n\t\t{\n\t\t\t\"code_scanning\",\n\t\t\t&RepositoryRule{\n\t\t\t\tType: RulesetRuleTypeCodeScanning,\n\t\t\t\tParameters: &CodeScanningRuleParameters{\n\t\t\t\t\tCodeScanningTools: []*RuleCodeScanningTool{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tAlertsThreshold:         CodeScanningAlertsThresholdAll,\n\t\t\t\t\t\t\tSecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdAll,\n\t\t\t\t\t\t\tTool:                    \"test\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tAlertsThreshold:         CodeScanningAlertsThresholdNone,\n\t\t\t\t\t\t\tSecurityAlertsThreshold: CodeScanningSecurityAlertsThresholdNone,\n\t\t\t\t\t\t\tTool:                    \"test\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t`{\"type\":\"code_scanning\",\"parameters\":{\"code_scanning_tools\":[{\"alerts_threshold\":\"all\",\"security_alerts_threshold\":\"all\",\"tool\":\"test\"},{\"alerts_threshold\":\"none\",\"security_alerts_threshold\":\"none\",\"tool\":\"test\"}]}}`,\n\t\t},\n\t\t{\n\t\t\t\"copilot_code_review\",\n\t\t\t&RepositoryRule{\n\t\t\t\tType: RulesetRuleTypeCopilotCodeReview,\n\t\t\t\tParameters: &CopilotCodeReviewRuleParameters{\n\t\t\t\t\tReviewOnPush:            true,\n\t\t\t\t\tReviewDraftPullRequests: false,\n\t\t\t\t},\n\t\t\t},\n\t\t\t`{\"type\":\"copilot_code_review\",\"parameters\":{\"review_on_push\":true,\"review_draft_pull_requests\":false}}`,\n\t\t},\n\t\t{\n\t\t\t\"copilot_code_review_empty_params\",\n\t\t\t&RepositoryRule{\n\t\t\t\tType:       RulesetRuleTypeCopilotCodeReview,\n\t\t\t\tParameters: &CopilotCodeReviewRuleParameters{},\n\t\t\t},\n\t\t\t`{\"type\":\"copilot_code_review\",\"parameters\":{\"review_on_push\":false,\"review_draft_pull_requests\":false}}`,\n\t\t},\n\t\t{\n\t\t\t\"repository_create\",\n\t\t\t&RepositoryRule{Type: RulesetRuleTypeRepositoryCreate, Parameters: nil},\n\t\t\t`{\"type\":\"repository_create\"}`,\n\t\t},\n\t\t{\n\t\t\t\"repository_delete\",\n\t\t\t&RepositoryRule{Type: RulesetRuleTypeRepositoryDelete, Parameters: nil},\n\t\t\t`{\"type\":\"repository_delete\"}`,\n\t\t},\n\t\t{\n\t\t\t\"repository_name\",\n\t\t\t&RepositoryRule{\n\t\t\t\tType: RulesetRuleTypeRepositoryName,\n\t\t\t\tParameters: &SimplePatternRuleParameters{\n\t\t\t\t\tNegate:  false,\n\t\t\t\t\tPattern: \"^test-.+\",\n\t\t\t\t},\n\t\t\t},\n\t\t\t`{\"type\":\"repository_name\",\"parameters\":{\"negate\":false,\"pattern\":\"^test-.+\"}}`,\n\t\t},\n\t\t{\n\t\t\t\"repository_transfer\",\n\t\t\t&RepositoryRule{Type: RulesetRuleTypeRepositoryTransfer, Parameters: nil},\n\t\t\t`{\"type\":\"repository_transfer\"}`,\n\t\t},\n\t\t{\n\t\t\t\"repository_visibility\",\n\t\t\t&RepositoryRule{\n\t\t\t\tType: RulesetRuleTypeRepositoryVisibility,\n\t\t\t\tParameters: &RepositoryVisibilityRuleParameters{\n\t\t\t\t\tInternal: false,\n\t\t\t\t\tPrivate:  false,\n\t\t\t\t},\n\t\t\t},\n\t\t\t`{\"type\":\"repository_visibility\",\"parameters\":{\"internal\":false,\"private\":false}}`,\n\t\t},\n\t}\n\n\tmarshalTests := []struct {\n\t\tname string\n\t\trule *RepositoryRule\n\t\tjson string\n\t}{\n\t\t{\n\t\t\t\"creation\",\n\t\t\t&RepositoryRule{Type: RulesetRuleTypeCreation, Parameters: nil},\n\t\t\t`{\"type\":\"creation\"}`,\n\t\t},\n\t\t{\n\t\t\t\"copilot_code_review\",\n\t\t\t&RepositoryRule{\n\t\t\t\tType: RulesetRuleTypeCopilotCodeReview,\n\t\t\t\tParameters: &CopilotCodeReviewRuleParameters{\n\t\t\t\t\tReviewOnPush:            true,\n\t\t\t\t\tReviewDraftPullRequests: false,\n\t\t\t\t},\n\t\t\t},\n\t\t\t`{\"type\":\"copilot_code_review\",\"parameters\":{\"review_on_push\":true,\"review_draft_pull_requests\":false}}`,\n\t\t},\n\t\t{\n\t\t\t\"copilot_code_review_empty_params\",\n\t\t\t&RepositoryRule{\n\t\t\t\tType:       RulesetRuleTypeCopilotCodeReview,\n\t\t\t\tParameters: &CopilotCodeReviewRuleParameters{},\n\t\t\t},\n\t\t\t`{\"type\":\"copilot_code_review\",\"parameters\":{\"review_on_push\":false,\"review_draft_pull_requests\":false}}`,\n\t\t},\n\t}\n\n\tt.Run(\"MarshalJSON\", func(t *testing.T) {\n\t\tt.Parallel()\n\n\t\tfor _, test := range marshalTests {\n\t\t\tt.Run(test.name, func(t *testing.T) {\n\t\t\t\tt.Parallel()\n\n\t\t\t\tgot, err := json.Marshal(test.rule)\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Errorf(\"Unable to marshal JSON for %#v\", test.rule)\n\t\t\t\t}\n\n\t\t\t\tif diff := cmp.Diff(test.json, string(got)); diff != \"\" {\n\t\t\t\t\tt.Errorf(\n\t\t\t\t\t\t\"json.Marshal returned:\\n%v\\nwant:\\n%v\\ndiff:\\n%v\",\n\t\t\t\t\t\tstring(got),\n\t\t\t\t\t\ttest.json,\n\t\t\t\t\t\tdiff,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t})\n\n\tt.Run(\"UnmarshalJSON\", func(t *testing.T) {\n\t\tt.Parallel()\n\n\t\tfor _, test := range tests {\n\t\t\tt.Run(test.name, func(t *testing.T) {\n\t\t\t\tt.Parallel()\n\n\t\t\t\tgot := &RepositoryRule{}\n\t\t\t\terr := json.Unmarshal([]byte(test.json), got)\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Errorf(\"Unable to unmarshal JSON %v: %v\", test.json, err)\n\t\t\t\t}\n\n\t\t\t\tif diff := cmp.Diff(test.rule, got); diff != \"\" {\n\t\t\t\t\tt.Errorf(\n\t\t\t\t\t\t\"json.Unmarshal returned:\\n%#v\\nwant:\\n%#v\\ndiff:\\n%v\",\n\t\t\t\t\t\tgot,\n\t\t\t\t\t\ttest.rule,\n\t\t\t\t\t\tdiff,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t})\n\n\tt.Run(\"UnmarshalJSON_Error\", func(t *testing.T) {\n\t\tt.Parallel()\n\n\t\ttests := []struct {\n\t\t\tname string\n\t\t\tjson string\n\t\t}{\n\t\t\t{\n\t\t\t\t\"invalid_copilot_code_review_bool\",\n\t\t\t\t`{\"type\":\"copilot_code_review\",\"parameters\":{\"review_on_push\":\"invalid_bool\"}}`,\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"invalid_copilot_code_review_draft_pr\",\n\t\t\t\t`{\"type\":\"copilot_code_review\",\"parameters\":{\"review_on_push\":true,\"review_draft_pull_requests\":\"not_a_bool\"}}`,\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"invalid_copilot_code_review_parameters\",\n\t\t\t\t`{\"type\":\"copilot_code_review\",\"parameters\":\"not_an_object\"}`,\n\t\t\t},\n\t\t}\n\n\t\tfor _, tt := range tests {\n\t\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\t\tt.Parallel()\n\t\t\t\tgot := &RepositoryRule{}\n\t\t\t\terr := json.Unmarshal([]byte(tt.json), got)\n\t\t\t\tif err == nil {\n\t\t\t\t\tt.Errorf(\"Expected error unmarshaling %q, got nil\", tt.json)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t})\n}\n"
  },
  {
    "path": "github/scim.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n)\n\n// SCIMService provides access to SCIM related functions in the\n// GitHub API.\n//\n// GitHub API docs: https://docs.github.com/rest/scim\ntype SCIMService service\n\n// SCIMUserAttributes represents supported SCIM User attributes.\n//\n// GitHub Enterprise Cloud API docs: https://docs.github.com/rest/scim#supported-scim-user-attributes\n// 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\ntype SCIMUserAttributes struct {\n\tUserName    string           `json:\"userName\"`              // Configured by the admin. Could be an email, login, or username. (Required.)\n\tName        SCIMUserName     `json:\"name\"`                  // (Required.)\n\tDisplayName *string          `json:\"displayName,omitempty\"` // The name of the user, suitable for display to end-users. (Optional.)\n\tEmails      []*SCIMUserEmail `json:\"emails\"`                // User emails. (Required.)\n\tSchemas     []string         `json:\"schemas,omitempty\"`     // (Optional.)\n\tExternalID  *string          `json:\"externalId,omitempty\"`  // (Optional.)\n\tGroups      []string         `json:\"groups,omitempty\"`      // (Optional.)\n\tRoles       []*SCIMUserRole  `json:\"roles,omitempty\"`       // (Optional, GHES only.)\n\tActive      *bool            `json:\"active,omitempty\"`      // (Optional.)\n\t// Only populated as a result of calling ListSCIMProvisionedIdentitiesOptions or GetSCIMProvisioningInfoForUser:\n\tID   *string   `json:\"id,omitempty\"`\n\tMeta *SCIMMeta `json:\"meta,omitempty\"`\n}\n\n// SCIMUserName represents SCIM user information.\ntype SCIMUserName struct {\n\tGivenName  string  `json:\"givenName\"`           // The first name of the user. (Required.)\n\tFamilyName string  `json:\"familyName\"`          // The family name of the user. (Required.)\n\tFormatted  *string `json:\"formatted,omitempty\"` // (Optional.)\n}\n\n// SCIMUserEmail represents SCIM user email.\ntype SCIMUserEmail struct {\n\tValue   string  `json:\"value\"`             // (Required.)\n\tPrimary *bool   `json:\"primary,omitempty\"` // (Optional.)\n\tType    *string `json:\"type,omitempty\"`    // (Optional.)\n}\n\n// SCIMUserRole is an enterprise-wide role granted to the user. This is only\n// supported in GitHub Enterprise Server, and not GitHub Enterprise Cloud.\n// See the docs for allowed role names.\n//\n// https://docs.github.com/en/enterprise-server@latest/rest/enterprise-admin/scim?apiVersion=2022-11-28#provision-a-scim-enterprise-user\ntype SCIMUserRole struct {\n\tValue   string  `json:\"value\"`             // (Required.)\n\tDisplay *string `json:\"display,omitempty\"` // (Optional.)\n\tType    *string `json:\"type,omitempty\"`    // (Optional.)\n\tPrimary *bool   `json:\"primary,omitempty\"` // (Optional.)\n}\n\n// SCIMMeta represents metadata about the SCIM resource.\ntype SCIMMeta struct {\n\tResourceType *string    `json:\"resourceType,omitempty\"`\n\tCreated      *Timestamp `json:\"created,omitempty\"`\n\tLastModified *Timestamp `json:\"lastModified,omitempty\"`\n\tLocation     *string    `json:\"location,omitempty\"`\n}\n\n// SCIMProvisionedIdentities represents the result of calling ListSCIMProvisionedIdentities.\ntype SCIMProvisionedIdentities struct {\n\tSchemas      []string              `json:\"schemas,omitempty\"`\n\tTotalResults *int                  `json:\"totalResults,omitempty\"`\n\tItemsPerPage *int                  `json:\"itemsPerPage,omitempty\"`\n\tStartIndex   *int                  `json:\"startIndex,omitempty\"`\n\tResources    []*SCIMUserAttributes `json:\"Resources,omitempty\"`\n}\n\n// ListSCIMProvisionedIdentitiesOptions represents options for ListSCIMProvisionedIdentities.\n//\n// GitHub API docs: https://docs.github.com/rest/scim#list-scim-provisioned-identities--parameters\ntype ListSCIMProvisionedIdentitiesOptions struct {\n\tStartIndex *int `url:\"startIndex,omitempty\"` // Used for pagination: the index of the first result to return. (Optional.)\n\tCount      *int `url:\"count,omitempty\"`      // Used for pagination: the number of results to return. (Optional.)\n\t// Filter results using the equals query parameter operator (eq).\n\t// You can filter results that are equal to id, userName, emails, and external_id.\n\t// For example, to search for an identity with the userName Octocat, you would use this query: ?filter=userName%20eq%20\\\"Octocat\\\".\n\t// To filter results for the identity with the email octocat@github.com, you would use this query: ?filter=emails%20eq%20\\\"octocat@github.com\\\".\n\t// (Optional.)\n\tFilter *string `url:\"filter,omitempty\"`\n}\n\n// ListSCIMProvisionedIdentities lists SCIM provisioned identities.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#list-scim-provisioned-identities\n//\n//meta:operation GET /scim/v2/organizations/{org}/Users\nfunc (s *SCIMService) ListSCIMProvisionedIdentities(ctx context.Context, org string, opts *ListSCIMProvisionedIdentitiesOptions) (*SCIMProvisionedIdentities, *Response, error) {\n\tu := fmt.Sprintf(\"scim/v2/organizations/%v/Users\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar identities *SCIMProvisionedIdentities\n\tresp, err := s.client.Do(ctx, req, &identities)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn identities, resp, nil\n}\n\n// ProvisionAndInviteSCIMUser provisions organization membership for a user, and sends an activation email to the email address.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#provision-and-invite-a-scim-user\n//\n//meta:operation POST /scim/v2/organizations/{org}/Users\nfunc (s *SCIMService) ProvisionAndInviteSCIMUser(ctx context.Context, org string, opts *SCIMUserAttributes) (*SCIMUserAttributes, *Response, error) {\n\tu := fmt.Sprintf(\"scim/v2/organizations/%v/Users\", org)\n\n\treq, err := s.client.NewRequest(\"POST\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar user *SCIMUserAttributes\n\tresp, err := s.client.Do(ctx, req, &user)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn user, resp, nil\n}\n\n// GetSCIMProvisioningInfoForUser returns SCIM provisioning information for a user.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#get-scim-provisioning-information-for-a-user\n//\n//meta:operation GET /scim/v2/organizations/{org}/Users/{scim_user_id}\nfunc (s *SCIMService) GetSCIMProvisioningInfoForUser(ctx context.Context, org, scimUserID string) (*SCIMUserAttributes, *Response, error) {\n\tu := fmt.Sprintf(\"scim/v2/organizations/%v/Users/%v\", org, scimUserID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar user *SCIMUserAttributes\n\tresp, err := s.client.Do(ctx, req, &user)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn user, resp, nil\n}\n\n// UpdateProvisionedOrgMembership updates a provisioned organization membership.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#update-a-provisioned-organization-membership\n//\n//meta:operation PUT /scim/v2/organizations/{org}/Users/{scim_user_id}\nfunc (s *SCIMService) UpdateProvisionedOrgMembership(ctx context.Context, org, scimUserID string, opts *SCIMUserAttributes) (*Response, error) {\n\tu := fmt.Sprintf(\"scim/v2/organizations/%v/Users/%v\", org, scimUserID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// UpdateAttributeForSCIMUserOptions represents options for UpdateAttributeForSCIMUser.\n//\n// GitHub API docs: https://docs.github.com/rest/scim#update-an-attribute-for-a-scim-user--parameters\ntype UpdateAttributeForSCIMUserOptions struct {\n\tSchemas    []string                             `json:\"schemas,omitempty\"` // (Optional.)\n\tOperations UpdateAttributeForSCIMUserOperations `json:\"operations\"`        // Set of operations to be performed. (Required.)\n}\n\n// UpdateAttributeForSCIMUserOperations represents operations for UpdateAttributeForSCIMUser.\ntype UpdateAttributeForSCIMUserOperations struct {\n\tOp    string          `json:\"op\"`              // (Required.)\n\tPath  *string         `json:\"path,omitempty\"`  // (Optional.)\n\tValue json.RawMessage `json:\"value,omitempty\"` // (Optional.)\n}\n\n// UpdateAttributeForSCIMUser updates an attribute for an SCIM user.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#update-an-attribute-for-a-scim-user\n//\n//meta:operation PATCH /scim/v2/organizations/{org}/Users/{scim_user_id}\nfunc (s *SCIMService) UpdateAttributeForSCIMUser(ctx context.Context, org, scimUserID string, opts *UpdateAttributeForSCIMUserOptions) (*Response, error) {\n\tu := fmt.Sprintf(\"scim/v2/organizations/%v/Users/%v\", org, scimUserID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"PATCH\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// DeleteSCIMUserFromOrg deletes SCIM user from an organization.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/scim/scim#delete-a-scim-user-from-an-organization\n//\n//meta:operation DELETE /scim/v2/organizations/{org}/Users/{scim_user_id}\nfunc (s *SCIMService) DeleteSCIMUserFromOrg(ctx context.Context, org, scimUserID string) (*Response, error) {\n\tu := fmt.Sprintf(\"scim/v2/organizations/%v/Users/%v\", org, scimUserID)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/scim_test.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestSCIMService_ListSCIMProvisionedIdentities(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/scim/v2/organizations/o/Users\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"startIndex\": \"1\", \"count\": \"10\", \"filter\": `userName=\"Octocat\"`})\n\t\tw.WriteHeader(http.StatusOK)\n\t\t_, _ = w.Write([]byte(`{\n\t\t\t\"schemas\": [\n\t\t\t  \"urn:ietf:params:scim:api:messages:2.0:ListResponse\"\n\t\t\t],\n\t\t\t\"totalResults\": 1,\n\t\t\t\"itemsPerPage\": 1,\n\t\t\t\"startIndex\": 1,\n\t\t\t\"Resources\": [\n\t\t\t  {\n\t\t\t\t\"schemas\": [\n\t\t\t\t  \"urn:ietf:params:scim:schemas:core:2.0:User\"\n\t\t\t\t],\n\t\t\t\t\"id\": \"5fc0c238-1112-11e8-8e45-920c87bdbd75\",\n\t\t\t\t\"externalId\": \"00u1dhhb1fkIGP7RL1d8\",\n\t\t\t\t\"userName\": \"octocat@github.com\",\n\t\t\t\t\"displayName\": \"Mona Octocat\",\n\t\t\t\t\"name\": {\n\t\t\t\t  \"givenName\": \"Mona\",\n\t\t\t\t  \"familyName\": \"Octocat\",\n\t\t\t\t  \"formatted\": \"Mona Octocat\"\n\t\t\t\t},\n\t\t\t\t\"emails\": [\n\t\t\t\t  {\n\t\t\t\t\t\"value\": \"octocat@github.com\",\n\t\t\t\t\t\"primary\": true\n\t\t\t\t  }\n\t\t\t\t],\n\t\t\t\t\"active\": true,\n\t\t\t\t\"meta\": {\n\t\t\t\t  \"resourceType\": \"User\",\n\t\t\t\t  \"created\": \"2018-02-13T15:05:24.000-00:00\",\n\t\t\t\t  \"lastModified\": \"2018-02-13T15:05:24.000-00:00\",\n\t\t\t\t  \"location\": \"https://api.github.com/scim/v2/organizations/octo-org/Users/5fc0c238-1112-11e8-8e45-920c87bdbd75\"\n\t\t\t\t}\n\t\t\t  }\n\t\t\t]\n\t\t  }`))\n\t})\n\n\tctx := t.Context()\n\topts := &ListSCIMProvisionedIdentitiesOptions{\n\t\tStartIndex: Ptr(1),\n\t\tCount:      Ptr(10),\n\t\tFilter:     Ptr(`userName=\"Octocat\"`),\n\t}\n\tidentities, _, err := client.SCIM.ListSCIMProvisionedIdentities(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"SCIM.ListSCIMProvisionedIdentities returned error: %v\", err)\n\t}\n\n\tdate := Timestamp{time.Date(2018, time.February, 13, 15, 5, 24, 0, time.UTC)}\n\twant := SCIMProvisionedIdentities{\n\t\tSchemas:      []string{\"urn:ietf:params:scim:api:messages:2.0:ListResponse\"},\n\t\tTotalResults: Ptr(1),\n\t\tItemsPerPage: Ptr(1),\n\t\tStartIndex:   Ptr(1),\n\t\tResources: []*SCIMUserAttributes{\n\t\t\t{\n\t\t\t\tID: Ptr(\"5fc0c238-1112-11e8-8e45-920c87bdbd75\"),\n\t\t\t\tMeta: &SCIMMeta{\n\t\t\t\t\tResourceType: Ptr(\"User\"),\n\t\t\t\t\tCreated:      &date,\n\t\t\t\t\tLastModified: &date,\n\t\t\t\t\tLocation:     Ptr(\"https://api.github.com/scim/v2/organizations/octo-org/Users/5fc0c238-1112-11e8-8e45-920c87bdbd75\"),\n\t\t\t\t},\n\t\t\t\tUserName: \"octocat@github.com\",\n\t\t\t\tName: SCIMUserName{\n\t\t\t\t\tGivenName:  \"Mona\",\n\t\t\t\t\tFamilyName: \"Octocat\",\n\t\t\t\t\tFormatted:  Ptr(\"Mona Octocat\"),\n\t\t\t\t},\n\t\t\t\tDisplayName: Ptr(\"Mona Octocat\"),\n\t\t\t\tEmails: []*SCIMUserEmail{\n\t\t\t\t\t{\n\t\t\t\t\t\tValue:   \"octocat@github.com\",\n\t\t\t\t\t\tPrimary: Ptr(true),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tSchemas:    []string{\"urn:ietf:params:scim:schemas:core:2.0:User\"},\n\t\t\t\tExternalID: Ptr(\"00u1dhhb1fkIGP7RL1d8\"),\n\t\t\t\tGroups:     nil,\n\t\t\t\tActive:     Ptr(true),\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(identities, &want) {\n\t\tdiff := cmp.Diff(identities, want)\n\t\tt.Errorf(\"SCIM.ListSCIMProvisionedIdentities returned %+v, want %+v: diff %+v\", identities, want, diff)\n\t}\n\n\tconst methodName = \"ListSCIMProvisionedIdentities\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.SCIM.ListSCIMProvisionedIdentities(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t_, r, err := client.SCIM.ListSCIMProvisionedIdentities(ctx, \"o\", nil)\n\t\treturn r, err\n\t})\n}\n\nfunc TestSCIMService_ProvisionAndInviteSCIMUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/scim/v2/organizations/o/Users\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tw.WriteHeader(http.StatusCreated)\n\t\tfmt.Fprint(w, `{\"id\":\"1234567890\",\"userName\":\"userName\"}`)\n\t})\n\n\tctx := t.Context()\n\topts := &SCIMUserAttributes{\n\t\tUserName: \"userName\",\n\t\tName: SCIMUserName{\n\t\t\tGivenName:  \"givenName\",\n\t\t\tFamilyName: \"familyName\",\n\t\t},\n\t\tEmails: []*SCIMUserEmail{\n\t\t\t{\n\t\t\t\tValue: \"octocat@github.com\",\n\t\t\t},\n\t\t},\n\t}\n\tuser, _, err := client.SCIM.ProvisionAndInviteSCIMUser(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"SCIM.ProvisionAndInviteSCIMUser returned error: %v\", err)\n\t}\n\n\twant := &SCIMUserAttributes{\n\t\tID:       Ptr(\"1234567890\"),\n\t\tUserName: \"userName\",\n\t}\n\tif !cmp.Equal(user, want) {\n\t\tt.Errorf(\"SCIM.ProvisionAndInviteSCIMUser returned %+v, want %+v\", user, want)\n\t}\n\n\tconst methodName = \"ProvisionAndInviteSCIMUser\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.SCIM.ProvisionAndInviteSCIMUser(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.SCIM.ProvisionAndInviteSCIMUser(ctx, \"o\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestSCIMService_GetSCIMProvisioningInfoForUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/scim/v2/organizations/o/Users/123\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusOK)\n\t\t_, _ = w.Write([]byte(`{\n\t\t\t\"schemas\": [\n\t\t\t  \"urn:ietf:params:scim:schemas:core:2.0:User\"\n\t\t\t],\n\t\t\t\"id\": \"edefdfedf-050c-11e7-8d32\",\n\t\t\t\"externalId\": \"a7d0f98382\",\n\t\t\t\"userName\": \"mona.octocat@okta.example.com\",\n\t\t\t\"displayName\": \"Mona Octocat\",\n\t\t\t\"name\": {\n\t\t\t  \"givenName\": \"Mona\",\n\t\t\t  \"familyName\": \"Octocat\",\n\t\t\t  \"formatted\": \"Mona Octocat\"\n\t\t\t},\n\t\t\t\"emails\": [\n\t\t\t  {\n\t\t\t\t\"value\": \"mona.octocat@okta.example.com\",\n\t\t\t\t\"primary\": true\n\t\t\t  },\n\t\t\t  {\n\t\t\t\t\"value\": \"mona@octocat.github.com\"\n\t\t\t  }\n\t\t\t],\n\t\t\t\"active\": true,\n\t\t\t\"meta\": {\n\t\t\t  \"resourceType\": \"User\",\n\t\t\t  \"created\": \"2017-03-09T16:11:13-00:00\",\n\t\t\t  \"lastModified\": \"2017-03-09T16:11:13-00:00\",\n\t\t\t  \"location\": \"https://api.github.com/scim/v2/organizations/octo-org/Users/edefdfedf-050c-11e7-8d32\"\n\t\t\t}\n\t\t  }`))\n\t})\n\n\tctx := t.Context()\n\tuser, _, err := client.SCIM.GetSCIMProvisioningInfoForUser(ctx, \"o\", \"123\")\n\tif err != nil {\n\t\tt.Errorf(\"SCIM.GetSCIMProvisioningInfoForUser returned error: %v\", err)\n\t}\n\n\tdate := Timestamp{time.Date(2017, time.March, 9, 16, 11, 13, 0, time.UTC)}\n\twant := SCIMUserAttributes{\n\t\tID: Ptr(\"edefdfedf-050c-11e7-8d32\"),\n\t\tMeta: &SCIMMeta{\n\t\t\tResourceType: Ptr(\"User\"),\n\t\t\tCreated:      &date,\n\t\t\tLastModified: &date,\n\t\t\tLocation:     Ptr(\"https://api.github.com/scim/v2/organizations/octo-org/Users/edefdfedf-050c-11e7-8d32\"),\n\t\t},\n\t\tUserName: \"mona.octocat@okta.example.com\",\n\t\tName: SCIMUserName{\n\t\t\tGivenName:  \"Mona\",\n\t\t\tFamilyName: \"Octocat\",\n\t\t\tFormatted:  Ptr(\"Mona Octocat\"),\n\t\t},\n\t\tDisplayName: Ptr(\"Mona Octocat\"),\n\t\tEmails: []*SCIMUserEmail{\n\t\t\t{\n\t\t\t\tValue:   \"mona.octocat@okta.example.com\",\n\t\t\t\tPrimary: Ptr(true),\n\t\t\t},\n\t\t\t{\n\t\t\t\tValue: \"mona@octocat.github.com\",\n\t\t\t},\n\t\t},\n\t\tSchemas:    []string{\"urn:ietf:params:scim:schemas:core:2.0:User\"},\n\t\tExternalID: Ptr(\"a7d0f98382\"),\n\t\tGroups:     nil,\n\t\tActive:     Ptr(true),\n\t}\n\n\tif !cmp.Equal(user, &want) {\n\t\tdiff := cmp.Diff(user, want)\n\t\tt.Errorf(\"SCIM.ListSCIMProvisionedIdentities returned %+v, want %+v: diff %+v\", user, want, diff)\n\t}\n\n\tconst methodName = \"GetSCIMProvisioningInfoForUser\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, _, err := client.SCIM.GetSCIMProvisioningInfoForUser(ctx, \"\\n\", \"123\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t_, r, err := client.SCIM.GetSCIMProvisioningInfoForUser(ctx, \"o\", \"123\")\n\t\treturn r, err\n\t})\n}\n\nfunc TestSCIMService_UpdateProvisionedOrgMembership(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/scim/v2/organizations/o/Users/123\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tw.WriteHeader(http.StatusOK)\n\t})\n\n\tctx := t.Context()\n\topts := &SCIMUserAttributes{\n\t\tUserName: \"userName\",\n\t\tName: SCIMUserName{\n\t\t\tGivenName:  \"givenName\",\n\t\t\tFamilyName: \"familyName\",\n\t\t},\n\t\tEmails: []*SCIMUserEmail{\n\t\t\t{\n\t\t\t\tValue: \"octocat@github.com\",\n\t\t\t},\n\t\t},\n\t}\n\t_, err := client.SCIM.UpdateProvisionedOrgMembership(ctx, \"o\", \"123\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"SCIM.UpdateProvisionedOrgMembership returned error: %v\", err)\n\t}\n\n\tconst methodName = \"UpdateProvisionedOrgMembership\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, err := client.SCIM.UpdateProvisionedOrgMembership(ctx, \"\\n\", \"123\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.SCIM.UpdateProvisionedOrgMembership(ctx, \"o\", \"123\", opts)\n\t})\n}\n\nfunc TestSCIMService_UpdateAttributeForSCIMUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/scim/v2/organizations/o/Users/123\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\topts := &UpdateAttributeForSCIMUserOptions{}\n\t_, err := client.SCIM.UpdateAttributeForSCIMUser(ctx, \"o\", \"123\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"SCIM.UpdateAttributeForSCIMUser returned error: %v\", err)\n\t}\n\n\tconst methodName = \"UpdateAttributeForSCIMUser\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, err := client.SCIM.UpdateAttributeForSCIMUser(ctx, \"\\n\", \"123\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.SCIM.UpdateAttributeForSCIMUser(ctx, \"o\", \"123\", opts)\n\t})\n}\n\nfunc TestSCIMService_DeleteSCIMUserFromOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/scim/v2/organizations/o/Users/123\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.SCIM.DeleteSCIMUserFromOrg(ctx, \"o\", \"123\")\n\tif err != nil {\n\t\tt.Errorf(\"SCIM.DeleteSCIMUserFromOrg returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteSCIMUserFromOrg\"\n\ttestBadOptions(t, methodName, func() error {\n\t\t_, err := client.SCIM.DeleteSCIMUserFromOrg(ctx, \"\\n\", \"\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.SCIM.DeleteSCIMUserFromOrg(ctx, \"o\", \"123\")\n\t})\n}\n\nfunc TestSCIMUserAttributes_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SCIMUserAttributes{}, `{\n\t\t\"userName\":\"\",\"name\":{\"givenName\":\"\",\"familyName\":\"\"},\"emails\":null\n\t}`)\n\n\tu := &SCIMUserAttributes{\n\t\tUserName: \"userName1\",\n\t\tName: SCIMUserName{\n\t\t\tGivenName:  \"Name1\",\n\t\t\tFamilyName: \"Fname\",\n\t\t\tFormatted:  Ptr(\"formatted name\"),\n\t\t},\n\t\tDisplayName: Ptr(\"Name\"),\n\t\tEmails: []*SCIMUserEmail{\n\t\t\t{\n\t\t\t\tValue:   \"value\",\n\t\t\t\tPrimary: Ptr(false),\n\t\t\t\tType:    Ptr(\"type\"),\n\t\t\t},\n\t\t},\n\t\tSchemas:    []string{\"schema1\"},\n\t\tExternalID: Ptr(\"id\"),\n\t\tGroups:     []string{\"group1\"},\n\t\tActive:     Ptr(true),\n\t}\n\n\twant := `{\n\t\t\"userName\": \"userName1\",\n\t\t\"name\": {\n\t\t\t\"givenName\": \"Name1\",\n\t\t\t\"familyName\": \"Fname\",\n\t\t\t\"formatted\": \"formatted name\"\n\t\t},\n\t\t\"displayName\": \"Name\",\n\t\t\"emails\": [{\n\t\t\t\"value\": \"value\",\n\t\t\t\"primary\": false,\n\t\t\t\"type\": \"type\"\n\t\t}],\n\t\t\"schemas\": [\"schema1\"],\n\t\t\"externalId\": \"id\",\n\t\t\"groups\": [\"group1\"],\n\t\t\"active\": true\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestUpdateAttributeForSCIMUserOperations_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &UpdateAttributeForSCIMUserOperations{}, `{\"op\": \"\"}`)\n\n\tu := &UpdateAttributeForSCIMUserOperations{\n\t\tOp:   \"TestOp\",\n\t\tPath: Ptr(\"path\"),\n\t}\n\n\twant := `{\n\t\t\"op\": \"TestOp\",\n\t\t\"path\": \"path\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestUpdateAttributeForSCIMUserOptions_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &UpdateAttributeForSCIMUserOptions{}, `{\n\t\t\"operations\": {\n\t\t\t\"op\": \"\"\n\t\t}\n\t}`)\n\n\tu := &UpdateAttributeForSCIMUserOptions{\n\t\tSchemas: []string{\"test\", \"schema\"},\n\t\tOperations: UpdateAttributeForSCIMUserOperations{\n\t\t\tOp:   \"TestOp\",\n\t\t\tPath: Ptr(\"path\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"schemas\": [\"test\", \"schema\"],\n\t\t\"operations\": {\n\t\t\t\"op\": \"TestOp\",\n\t\t\t\"path\": \"path\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestSCIMUserName_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SCIMUserName{}, `{\n\t\t\"givenName\":\"\",\"familyName\":\"\"\n\t}`)\n\n\tu := &SCIMUserName{\n\t\tGivenName:  \"Name1\",\n\t\tFamilyName: \"Fname\",\n\t\tFormatted:  Ptr(\"formatted name\"),\n\t}\n\n\twant := `{\n\t\t\t\"givenName\": \"Name1\",\n\t\t\t\"familyName\": \"Fname\",\n\t\t\t\"formatted\": \"formatted name\"\n\t}`\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestSCIMMeta_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SCIMMeta{}, `{}`)\n\n\tu := &SCIMMeta{\n\t\tResourceType: Ptr(\"test\"),\n\t\tLocation:     Ptr(\"test\"),\n\t}\n\n\twant := `{\n\t\t\"resourceType\": \"test\",\n\t\t\"location\": \"test\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestSCIMUserRole_Marshal(t *testing.T) {\n\tt.Parallel()\n\n\ttestJSONMarshal(t, &SCIMUserRole{\n\t\tValue:   \"enterprise_owner\",\n\t\tPrimary: Ptr(true),\n\t}, `{\n\t\t\"value\": \"enterprise_owner\",\n\t\t\"primary\": true\n\t}`)\n\n\tr := &SCIMUserRole{\n\t\tValue: \"billing_manager\",\n\t}\n\twant := `{\"value\": \"billing_manager\"}`\n\ttestJSONMarshal(t, r, want)\n}\n\nfunc TestSCIMProvisionedIdentities_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SCIMProvisionedIdentities{}, `{}`)\n\n\tu := &SCIMProvisionedIdentities{\n\t\tSchemas:      []string{\"test\", \"schema\"},\n\t\tTotalResults: Ptr(1),\n\t\tItemsPerPage: Ptr(2),\n\t\tStartIndex:   Ptr(1),\n\t\tResources: []*SCIMUserAttributes{\n\t\t\t{\n\t\t\t\tUserName: \"SCIM\",\n\t\t\t\tName: SCIMUserName{\n\t\t\t\t\tGivenName:  \"scim\",\n\t\t\t\t\tFamilyName: \"test\",\n\t\t\t\t\tFormatted:  Ptr(\"SCIM\"),\n\t\t\t\t},\n\t\t\t\tDisplayName: Ptr(\"Test SCIM\"),\n\t\t\t\tEmails: []*SCIMUserEmail{\n\t\t\t\t\t{\n\t\t\t\t\t\tValue:   \"test\",\n\t\t\t\t\t\tPrimary: Ptr(true),\n\t\t\t\t\t\tType:    Ptr(\"test\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tSchemas:    []string{\"schema1\"},\n\t\t\t\tExternalID: Ptr(\"id\"),\n\t\t\t\tGroups:     []string{\"group1\"},\n\t\t\t\tActive:     Ptr(true),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"schemas\": [\"test\", \"schema\"],\n\t\t\"totalResults\": 1,\n\t\t\"itemsPerPage\": 2,\n\t\t\"startIndex\": 1,\n\t\t\"Resources\": [{\n\t\t\t\"userName\": \"SCIM\",\n\t\t\t\"name\": {\n\t\t\t\t\"givenName\": \"scim\",\n\t\t\t\t\"familyName\": \"test\",\n\t\t\t\t\"formatted\": \"SCIM\"\n\t\t\t},\n\t\t\t\"displayName\": \"Test SCIM\",\n\t\t\t\"emails\": [{\n\t\t\t\t\"value\": \"test\",\n\t\t\t\t\"primary\": true,\n\t\t\t\t\"type\": \"test\"\n\t\t\t}],\n\t\t\t\"schemas\": [\"schema1\"],\n\t\t\t\"externalId\": \"id\",\n\t\t\t\"groups\": [\"group1\"],\n\t\t\t\"active\": true\n\t\t}]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/search.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\n\tqs \"github.com/google/go-querystring/query\"\n)\n\n// SearchService provides access to the search related functions\n// in the GitHub API.\n//\n// Each method takes a query string defining the search keywords and any search qualifiers.\n// For example, when searching issues, the query \"gopher is:issue language:go\" will search\n// for issues containing the word \"gopher\" in Go repositories. The method call\n//\n//\topts :=  &github.SearchOptions{Sort: \"created\", Order: \"asc\"}\n//\tcl.Search.Issues(ctx, \"gopher is:issue language:go\", opts)\n//\n// will search for such issues, sorting by creation date in ascending order\n// (i.e., oldest first).\n//\n// If query includes multiple conditions, it MUST NOT include \"+\" as the condition separator.\n// You have to use \" \" as the separator instead.\n// For example, querying with \"language:c++\" and \"leveldb\", then query should be\n// \"language:c++ leveldb\" but not \"language:c+++leveldb\".\n//\n// GitHub API docs: https://docs.github.com/rest/search/\ntype SearchService service\n\n// SearchOptions specifies optional parameters to the SearchService methods.\ntype SearchOptions struct {\n\t// How to sort the search results. Possible values are:\n\t//   - for repositories: stars, fork, updated\n\t//   - for commits: author-date, committer-date\n\t//   - for code: indexed\n\t//   - for issues: comments, created, updated\n\t//   - for users: followers, repositories, joined\n\t//\n\t// Default is to sort by best match.\n\tSort string `url:\"sort,omitempty\"`\n\n\t// Sort order if sort parameter is provided. Possible values are: asc,\n\t// desc. Default is desc.\n\tOrder string `url:\"order,omitempty\"`\n\n\t// Whether to retrieve text match metadata with a query\n\tTextMatch bool `url:\"-\"`\n\n\t// Whether to enable advanced search for issues\n\tAdvancedSearch *bool `url:\"advanced_search,omitempty\"`\n\n\tListOptions\n}\n\n// Common search parameters.\ntype searchParameters struct {\n\tQuery        string\n\tRepositoryID *int64 // Sent if non-nil.\n}\n\n// RepositoriesSearchResult represents the result of a repositories search.\ntype RepositoriesSearchResult struct {\n\tTotal             *int          `json:\"total_count,omitempty\"`\n\tIncompleteResults *bool         `json:\"incomplete_results,omitempty\"`\n\tRepositories      []*Repository `json:\"items,omitempty\"`\n}\n\n// Repositories searches repositories via various criteria.\n//\n// GitHub API docs: https://docs.github.com/rest/search/search#search-repositories\n//\n//meta:operation GET /search/repositories\nfunc (s *SearchService) Repositories(ctx context.Context, query string, opts *SearchOptions) (*RepositoriesSearchResult, *Response, error) {\n\tvar result *RepositoriesSearchResult\n\tresp, err := s.search(ctx, \"repositories\", &searchParameters{Query: query}, opts, &result)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn result, resp, nil\n}\n\n// TopicsSearchResult represents the result of a topics search.\ntype TopicsSearchResult struct {\n\tTotal             *int           `json:\"total_count,omitempty\"`\n\tIncompleteResults *bool          `json:\"incomplete_results,omitempty\"`\n\tTopics            []*TopicResult `json:\"items,omitempty\"`\n}\n\n// TopicResult represents a topic search result.\ntype TopicResult struct {\n\tName             *string    `json:\"name,omitempty\"`\n\tDisplayName      *string    `json:\"display_name,omitempty\"`\n\tShortDescription *string    `json:\"short_description,omitempty\"`\n\tDescription      *string    `json:\"description,omitempty\"`\n\tCreatedBy        *string    `json:\"created_by,omitempty\"`\n\tCreatedAt        *Timestamp `json:\"created_at,omitempty\"`\n\tUpdatedAt        *string    `json:\"updated_at,omitempty\"`\n\tFeatured         *bool      `json:\"featured,omitempty\"`\n\tCurated          *bool      `json:\"curated,omitempty\"`\n\tScore            *float64   `json:\"score,omitempty\"`\n}\n\n// Topics finds topics via various criteria. Results are sorted by best match.\n// Please see https://help.github.com/articles/searching-topics for more\n// information about search qualifiers.\n//\n// GitHub API docs: https://docs.github.com/rest/search/search#search-topics\n//\n//meta:operation GET /search/topics\nfunc (s *SearchService) Topics(ctx context.Context, query string, opts *SearchOptions) (*TopicsSearchResult, *Response, error) {\n\tvar result *TopicsSearchResult\n\tresp, err := s.search(ctx, \"topics\", &searchParameters{Query: query}, opts, &result)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn result, resp, nil\n}\n\n// CommitsSearchResult represents the result of a commits search.\ntype CommitsSearchResult struct {\n\tTotal             *int            `json:\"total_count,omitempty\"`\n\tIncompleteResults *bool           `json:\"incomplete_results,omitempty\"`\n\tCommits           []*CommitResult `json:\"items,omitempty\"`\n}\n\n// CommitResult represents a commit object as returned in commit search endpoint response.\ntype CommitResult struct {\n\tSHA         *string   `json:\"sha,omitempty\"`\n\tCommit      *Commit   `json:\"commit,omitempty\"`\n\tAuthor      *User     `json:\"author,omitempty\"`\n\tCommitter   *User     `json:\"committer,omitempty\"`\n\tParents     []*Commit `json:\"parents,omitempty\"`\n\tHTMLURL     *string   `json:\"html_url,omitempty\"`\n\tURL         *string   `json:\"url,omitempty\"`\n\tCommentsURL *string   `json:\"comments_url,omitempty\"`\n\n\tRepository *Repository `json:\"repository,omitempty\"`\n\tScore      *float64    `json:\"score,omitempty\"`\n}\n\n// Commits searches commits via various criteria.\n//\n// GitHub API docs: https://docs.github.com/rest/search/search#search-commits\n//\n//meta:operation GET /search/commits\nfunc (s *SearchService) Commits(ctx context.Context, query string, opts *SearchOptions) (*CommitsSearchResult, *Response, error) {\n\tvar result *CommitsSearchResult\n\tresp, err := s.search(ctx, \"commits\", &searchParameters{Query: query}, opts, &result)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn result, resp, nil\n}\n\n// IssuesSearchResult represents the result of an issues search.\ntype IssuesSearchResult struct {\n\tTotal             *int     `json:\"total_count,omitempty\"`\n\tIncompleteResults *bool    `json:\"incomplete_results,omitempty\"`\n\tIssues            []*Issue `json:\"items,omitempty\"`\n}\n\n// Issues searches issues via various criteria.\n//\n// GitHub API docs: https://docs.github.com/rest/search/search#search-issues-and-pull-requests\n//\n//meta:operation GET /search/issues\nfunc (s *SearchService) Issues(ctx context.Context, query string, opts *SearchOptions) (*IssuesSearchResult, *Response, error) {\n\tvar result *IssuesSearchResult\n\tresp, err := s.search(ctx, \"issues\", &searchParameters{Query: query}, opts, &result)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn result, resp, nil\n}\n\n// UsersSearchResult represents the result of a users search.\ntype UsersSearchResult struct {\n\tTotal             *int    `json:\"total_count,omitempty\"`\n\tIncompleteResults *bool   `json:\"incomplete_results,omitempty\"`\n\tUsers             []*User `json:\"items,omitempty\"`\n}\n\n// Users searches users via various criteria.\n//\n// GitHub API docs: https://docs.github.com/rest/search/search#search-users\n//\n//meta:operation GET /search/users\nfunc (s *SearchService) Users(ctx context.Context, query string, opts *SearchOptions) (*UsersSearchResult, *Response, error) {\n\tvar result *UsersSearchResult\n\tresp, err := s.search(ctx, \"users\", &searchParameters{Query: query}, opts, &result)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn result, resp, nil\n}\n\n// Match represents a single text match.\ntype Match struct {\n\tText    *string `json:\"text,omitempty\"`\n\tIndices []int   `json:\"indices,omitempty\"`\n}\n\n// TextMatch represents a text match for a SearchResult.\ntype TextMatch struct {\n\tObjectURL  *string  `json:\"object_url,omitempty\"`\n\tObjectType *string  `json:\"object_type,omitempty\"`\n\tProperty   *string  `json:\"property,omitempty\"`\n\tFragment   *string  `json:\"fragment,omitempty\"`\n\tMatches    []*Match `json:\"matches,omitempty\"`\n}\n\nfunc (tm TextMatch) String() string {\n\treturn Stringify(tm)\n}\n\n// CodeSearchResult represents the result of a code search.\ntype CodeSearchResult struct {\n\tTotal             *int          `json:\"total_count,omitempty\"`\n\tIncompleteResults *bool         `json:\"incomplete_results,omitempty\"`\n\tCodeResults       []*CodeResult `json:\"items,omitempty\"`\n}\n\n// CodeResult represents a single search result.\ntype CodeResult struct {\n\tName        *string      `json:\"name,omitempty\"`\n\tPath        *string      `json:\"path,omitempty\"`\n\tSHA         *string      `json:\"sha,omitempty\"`\n\tHTMLURL     *string      `json:\"html_url,omitempty\"`\n\tRepository  *Repository  `json:\"repository,omitempty\"`\n\tTextMatches []*TextMatch `json:\"text_matches,omitempty\"`\n}\n\nfunc (c CodeResult) String() string {\n\treturn Stringify(c)\n}\n\n// Code searches code via various criteria.\n//\n// GitHub API docs: https://docs.github.com/rest/search/search#search-code\n//\n//meta:operation GET /search/code\nfunc (s *SearchService) Code(ctx context.Context, query string, opts *SearchOptions) (*CodeSearchResult, *Response, error) {\n\tvar result *CodeSearchResult\n\tresp, err := s.search(ctx, \"code\", &searchParameters{Query: query}, opts, &result)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn result, resp, nil\n}\n\n// LabelsSearchResult represents the result of a code search.\ntype LabelsSearchResult struct {\n\tTotal             *int           `json:\"total_count,omitempty\"`\n\tIncompleteResults *bool          `json:\"incomplete_results,omitempty\"`\n\tLabels            []*LabelResult `json:\"items,omitempty\"`\n}\n\n// LabelResult represents a single search result.\ntype LabelResult struct {\n\tID          *int64   `json:\"id,omitempty\"`\n\tURL         *string  `json:\"url,omitempty\"`\n\tName        *string  `json:\"name,omitempty\"`\n\tColor       *string  `json:\"color,omitempty\"`\n\tDefault     *bool    `json:\"default,omitempty\"`\n\tDescription *string  `json:\"description,omitempty\"`\n\tScore       *float64 `json:\"score,omitempty\"`\n}\n\nfunc (l LabelResult) String() string {\n\treturn Stringify(l)\n}\n\n// Labels searches labels in the repository with ID repoID via various criteria.\n//\n// GitHub API docs: https://docs.github.com/rest/search/search#search-labels\n//\n//meta:operation GET /search/labels\nfunc (s *SearchService) Labels(ctx context.Context, repoID int64, query string, opts *SearchOptions) (*LabelsSearchResult, *Response, error) {\n\tvar result *LabelsSearchResult\n\tresp, err := s.search(ctx, \"labels\", &searchParameters{RepositoryID: &repoID, Query: query}, opts, &result)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn result, resp, nil\n}\n\n// Helper function that executes search queries against different\n// GitHub search types (repositories, commits, code, issues, users, labels)\n//\n// If searchParameters.Query includes multiple condition, it MUST NOT include \"+\" as condition separator.\n// For example, querying with \"language:c++\" and \"leveldb\", then searchParameters.Query should be \"language:c++ leveldb\" but not \"language:c+++leveldb\".\nfunc (s *SearchService) search(ctx context.Context, searchType string, parameters *searchParameters, opts *SearchOptions, result any) (*Response, error) {\n\tparams, err := qs.Values(opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif parameters.RepositoryID != nil {\n\t\tparams.Set(\"repository_id\", strconv.FormatInt(*parameters.RepositoryID, 10))\n\t}\n\tparams.Set(\"q\", parameters.Query)\n\tu := fmt.Sprintf(\"search/%v?%v\", searchType, params.Encode())\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar acceptHeaders []string\n\tswitch searchType {\n\tcase \"commits\":\n\t\t// Accept header for search commits preview endpoint\n\t\tacceptHeaders = append(acceptHeaders, mediaTypeCommitSearchPreview)\n\tcase \"topics\", \"repositories\":\n\t\t// Accept header for search repositories based on topics preview endpoint\n\t\tacceptHeaders = append(acceptHeaders, mediaTypeTopicsPreview)\n\tcase \"issues\":\n\t\t// Accept header for search issues based on reactions preview endpoint\n\t\tacceptHeaders = append(acceptHeaders, mediaTypeReactionsPreview)\n\t}\n\t// https://docs.github.com/rest/search#search-repositories\n\t// Accept header defaults to \"application/vnd.github.v3+json\"\n\t// We change it here to fetch back text-match metadata\n\tif opts != nil && opts.TextMatch {\n\t\tacceptHeaders = append(acceptHeaders, \"application/vnd.github.v3.text-match+json\")\n\t}\n\treq.Header.Set(\"Accept\", strings.Join(acceptHeaders, \", \"))\n\n\treturn s.client.Do(ctx, req, result)\n}\n"
  },
  {
    "path": "github/search_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestSearchService_Repositories(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/search/repositories\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"q\":        \"blah\",\n\t\t\t\"sort\":     \"forks\",\n\t\t\t\"order\":    \"desc\",\n\t\t\t\"page\":     \"2\",\n\t\t\t\"per_page\": \"2\",\n\t\t})\n\n\t\tfmt.Fprint(w, `{\"total_count\": 4, \"incomplete_results\": false, \"items\": [{\"id\":1},{\"id\":2}]}`)\n\t})\n\n\topts := &SearchOptions{Sort: \"forks\", Order: \"desc\", ListOptions: ListOptions{Page: 2, PerPage: 2}}\n\tctx := t.Context()\n\tresult, _, err := client.Search.Repositories(ctx, \"blah\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Search.Repositories returned error: %v\", err)\n\t}\n\n\twant := &RepositoriesSearchResult{\n\t\tTotal:             Ptr(4),\n\t\tIncompleteResults: Ptr(false),\n\t\tRepositories:      []*Repository{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}},\n\t}\n\tif !cmp.Equal(result, want) {\n\t\tt.Errorf(\"Search.Repositories returned %+v, want %+v\", result, want)\n\t}\n\tconst methodName = \"Repositories\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Search.Repositories(ctx, \"blah\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestSearchService_Repositories_coverage(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\n\tconst methodName = \"Repositories\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Search.Repositories(ctx, \"\\n\", nil)\n\t\treturn err\n\t})\n}\n\nfunc TestSearchService_RepositoriesTextMatch(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/search/repositories\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttextMatchResponse := `\n\t\t\t{\n\t\t\t\t\"total_count\": 1,\n\t\t\t\t\"incomplete_results\": false,\n\t\t\t\t\"items\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"name\":\"gopher1\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t`\n\t\tlist := strings.Split(r.Header.Get(\"Accept\"), \",\")\n\t\taMap := make(map[string]struct{})\n\t\tfor _, s := range list {\n\t\t\taMap[strings.TrimSpace(s)] = struct{}{}\n\t\t}\n\t\tif _, ok := aMap[\"application/vnd.github.v3.text-match+json\"]; ok {\n\t\t\ttextMatchResponse = `\n\t\t\t\t\t{\n\t\t\t\t\t\t\"total_count\": 1,\n\t\t\t\t\t\t\"incomplete_results\": false,\n\t\t\t\t\t\t\"items\": [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\"name\":\"gopher1\",\n\t\t\t\t\t\t\t\t\"text_matches\": [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\"fragment\": \"I'm afraid my friend what you have found\\nIs a gopher who lives to feed\",\n\t\t\t\t\t\t\t\t\t\t\"matches\": [\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\"text\": \"gopher\",\n\t\t\t\t\t\t\t\t\t\t\t\t\"indices\": [\n\t\t\t\t\t\t\t\t\t\t\t\t\t14,\n\t\t\t\t\t\t\t\t\t\t\t\t\t21\n\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t  ]\n\t\t\t\t\t\t\t\t  }\n\t\t\t\t\t\t\t  ]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t`\n\t\t}\n\n\t\tfmt.Fprint(w, textMatchResponse)\n\t})\n\n\topts := &SearchOptions{Sort: \"forks\", Order: \"desc\", ListOptions: ListOptions{Page: 2, PerPage: 2}, TextMatch: true}\n\tctx := t.Context()\n\tresult, _, err := client.Search.Repositories(ctx, \"blah\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Search.Code returned error: %v\", err)\n\t}\n\n\twantedRepoResult := &Repository{\n\t\tName: Ptr(\"gopher1\"),\n\t\tTextMatches: []*TextMatch{\n\t\t\t{\n\t\t\t\tFragment: Ptr(\"I'm afraid my friend what you have found\\nIs a gopher who lives to feed\"),\n\t\t\t\tMatches:  []*Match{{Text: Ptr(\"gopher\"), Indices: []int{14, 21}}},\n\t\t\t},\n\t\t},\n\t}\n\n\twant := &RepositoriesSearchResult{\n\t\tTotal:             Ptr(1),\n\t\tIncompleteResults: Ptr(false),\n\t\tRepositories:      []*Repository{wantedRepoResult},\n\t}\n\tif !cmp.Equal(result, want) {\n\t\tt.Errorf(\"Search.Repo returned %+v, want %+v\", result, want)\n\t}\n}\n\nfunc TestSearchService_Topics(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/search/topics\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"q\":        \"blah\",\n\t\t\t\"page\":     \"2\",\n\t\t\t\"per_page\": \"2\",\n\t\t})\n\n\t\tfmt.Fprint(w, `{\"total_count\": 4, \"incomplete_results\": false, \"items\": [{\"name\":\"blah\"},{\"name\":\"blahblah\"}]}`)\n\t})\n\n\topts := &SearchOptions{ListOptions: ListOptions{Page: 2, PerPage: 2}}\n\tctx := t.Context()\n\tresult, _, err := client.Search.Topics(ctx, \"blah\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Search.Topics returned error: %v\", err)\n\t}\n\n\twant := &TopicsSearchResult{\n\t\tTotal:             Ptr(4),\n\t\tIncompleteResults: Ptr(false),\n\t\tTopics:            []*TopicResult{{Name: Ptr(\"blah\")}, {Name: Ptr(\"blahblah\")}},\n\t}\n\tif !cmp.Equal(result, want) {\n\t\tt.Errorf(\"Search.Topics returned %+v, want %+v\", result, want)\n\t}\n\tconst methodName = \"Topics\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Search.Topics(ctx, \"blah\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestSearchService_Topics_coverage(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\n\tconst methodName = \"Topics\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Search.Topics(ctx, \"\\n\", nil)\n\t\treturn err\n\t})\n}\n\nfunc TestSearchService_Commits(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/search/commits\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"q\":     \"blah\",\n\t\t\t\"sort\":  \"author-date\",\n\t\t\t\"order\": \"desc\",\n\t\t})\n\n\t\tfmt.Fprint(w, `{\"total_count\": 4, \"incomplete_results\": false, \"items\": [{\"sha\":\"random_hash1\"},{\"sha\":\"random_hash2\"}]}`)\n\t})\n\n\topts := &SearchOptions{Sort: \"author-date\", Order: \"desc\"}\n\tctx := t.Context()\n\tresult, _, err := client.Search.Commits(ctx, \"blah\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Search.Commits returned error: %v\", err)\n\t}\n\n\twant := &CommitsSearchResult{\n\t\tTotal:             Ptr(4),\n\t\tIncompleteResults: Ptr(false),\n\t\tCommits:           []*CommitResult{{SHA: Ptr(\"random_hash1\")}, {SHA: Ptr(\"random_hash2\")}},\n\t}\n\tif !cmp.Equal(result, want) {\n\t\tt.Errorf(\"Search.Commits returned %+v, want %+v\", result, want)\n\t}\n\tconst methodName = \"Commits\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Search.Commits(ctx, \"blah\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestSearchService_Commits_coverage(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\n\tconst methodName = \"Commits\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Search.Commits(ctx, \"\\n\", nil)\n\t\treturn err\n\t})\n}\n\nfunc TestSearchService_Issues(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/search/issues\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"q\":        \"blah\",\n\t\t\t\"sort\":     \"forks\",\n\t\t\t\"order\":    \"desc\",\n\t\t\t\"page\":     \"2\",\n\t\t\t\"per_page\": \"2\",\n\t\t})\n\n\t\tfmt.Fprint(w, `{\"total_count\": 4, \"incomplete_results\": true, \"items\": [{\"number\":1},{\"number\":2}]}`)\n\t})\n\n\topts := &SearchOptions{Sort: \"forks\", Order: \"desc\", ListOptions: ListOptions{Page: 2, PerPage: 2}}\n\tctx := t.Context()\n\tresult, _, err := client.Search.Issues(ctx, \"blah\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Search.Issues returned error: %v\", err)\n\t}\n\n\twant := &IssuesSearchResult{\n\t\tTotal:             Ptr(4),\n\t\tIncompleteResults: Ptr(true),\n\t\tIssues:            []*Issue{{Number: Ptr(1)}, {Number: Ptr(2)}},\n\t}\n\tif !cmp.Equal(result, want) {\n\t\tt.Errorf(\"Search.Issues returned %+v, want %+v\", result, want)\n\t}\n\tconst methodName = \"Issues\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Search.Issues(ctx, \"blah\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestSearchService_Issues_advancedSearch(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/search/issues\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"q\":               \"blah\",\n\t\t\t\"sort\":            \"forks\",\n\t\t\t\"order\":           \"desc\",\n\t\t\t\"page\":            \"2\",\n\t\t\t\"per_page\":        \"2\",\n\t\t\t\"advanced_search\": \"true\",\n\t\t})\n\n\t\tfmt.Fprint(w, `{\"total_count\": 4, \"incomplete_results\": true, \"items\": [{\"number\":1},{\"number\":2}]}`)\n\t})\n\n\topts := &SearchOptions{Sort: \"forks\", Order: \"desc\", ListOptions: ListOptions{Page: 2, PerPage: 2}, AdvancedSearch: Ptr(true)}\n\tctx := t.Context()\n\tresult, _, err := client.Search.Issues(ctx, \"blah\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Search.Issues_advancedSearch returned error: %v\", err)\n\t}\n\n\twant := &IssuesSearchResult{\n\t\tTotal:             Ptr(4),\n\t\tIncompleteResults: Ptr(true),\n\t\tIssues:            []*Issue{{Number: Ptr(1)}, {Number: Ptr(2)}},\n\t}\n\tif !cmp.Equal(result, want) {\n\t\tt.Errorf(\"Search.Issues_advancedSearch returned %+v, want %+v\", result, want)\n\t}\n}\n\nfunc TestSearchService_Issues_coverage(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\n\tconst methodName = \"Issues\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Search.Issues(ctx, \"\\n\", nil)\n\t\treturn err\n\t})\n}\n\nfunc TestSearchService_Issues_withQualifiersNoOpts(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tconst q = \"gopher is:issue label:bug language:c++ pushed:>=2018-01-01 stars:>=200\"\n\n\tvar requestURI string\n\tmux.HandleFunc(\"/search/issues\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"q\": q,\n\t\t})\n\t\trequestURI = r.RequestURI\n\n\t\tfmt.Fprint(w, `{\"total_count\": 4, \"incomplete_results\": true, \"items\": [{\"number\":1},{\"number\":2}]}`)\n\t})\n\n\topts := &SearchOptions{}\n\tctx := t.Context()\n\tresult, _, err := client.Search.Issues(ctx, q, opts)\n\tif err != nil {\n\t\tt.Errorf(\"Search.Issues returned error: %v\", err)\n\t}\n\n\tif want := \"/api-v3/search/issues?q=gopher+is%3Aissue+label%3Abug+language%3Ac%2B%2B+pushed%3A%3E%3D2018-01-01+stars%3A%3E%3D200\"; requestURI != want {\n\t\tt.Fatalf(\"URI encoding failed: got %v, want %v\", requestURI, want)\n\t}\n\n\twant := &IssuesSearchResult{\n\t\tTotal:             Ptr(4),\n\t\tIncompleteResults: Ptr(true),\n\t\tIssues:            []*Issue{{Number: Ptr(1)}, {Number: Ptr(2)}},\n\t}\n\tif !cmp.Equal(result, want) {\n\t\tt.Errorf(\"Search.Issues returned %+v, want %+v\", result, want)\n\t}\n}\n\nfunc TestSearchService_Issues_withQualifiersAndOpts(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tconst q = \"gopher is:issue label:bug language:c++ pushed:>=2018-01-01 stars:>=200\"\n\n\tvar requestURI string\n\tmux.HandleFunc(\"/search/issues\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"q\":    q,\n\t\t\t\"sort\": \"forks\",\n\t\t})\n\t\trequestURI = r.RequestURI\n\n\t\tfmt.Fprint(w, `{\"total_count\": 4, \"incomplete_results\": true, \"items\": [{\"number\":1},{\"number\":2}]}`)\n\t})\n\n\topts := &SearchOptions{Sort: \"forks\"}\n\tctx := t.Context()\n\tresult, _, err := client.Search.Issues(ctx, q, opts)\n\tif err != nil {\n\t\tt.Errorf(\"Search.Issues returned error: %v\", err)\n\t}\n\n\tif want := \"/api-v3/search/issues?q=gopher+is%3Aissue+label%3Abug+language%3Ac%2B%2B+pushed%3A%3E%3D2018-01-01+stars%3A%3E%3D200&sort=forks\"; requestURI != want {\n\t\tt.Fatalf(\"URI encoding failed: got %v, want %v\", requestURI, want)\n\t}\n\n\twant := &IssuesSearchResult{\n\t\tTotal:             Ptr(4),\n\t\tIncompleteResults: Ptr(true),\n\t\tIssues:            []*Issue{{Number: Ptr(1)}, {Number: Ptr(2)}},\n\t}\n\tif !cmp.Equal(result, want) {\n\t\tt.Errorf(\"Search.Issues returned %+v, want %+v\", result, want)\n\t}\n}\n\nfunc TestSearchService_Users(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/search/users\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"q\":        \"blah\",\n\t\t\t\"sort\":     \"forks\",\n\t\t\t\"order\":    \"desc\",\n\t\t\t\"page\":     \"2\",\n\t\t\t\"per_page\": \"2\",\n\t\t})\n\n\t\tfmt.Fprint(w, `{\"total_count\": 4, \"incomplete_results\": false, \"items\": [{\"id\":1},{\"id\":2}]}`)\n\t})\n\n\topts := &SearchOptions{Sort: \"forks\", Order: \"desc\", ListOptions: ListOptions{Page: 2, PerPage: 2}}\n\tctx := t.Context()\n\tresult, _, err := client.Search.Users(ctx, \"blah\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Search.Issues returned error: %v\", err)\n\t}\n\n\twant := &UsersSearchResult{\n\t\tTotal:             Ptr(4),\n\t\tIncompleteResults: Ptr(false),\n\t\tUsers:             []*User{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}},\n\t}\n\tif !cmp.Equal(result, want) {\n\t\tt.Errorf(\"Search.Users returned %+v, want %+v\", result, want)\n\t}\n\tconst methodName = \"Users\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Search.Users(ctx, \"blah\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestSearchService_Users_coverage(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\n\tconst methodName = \"Users\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Search.Users(ctx, \"\\n\", nil)\n\t\treturn err\n\t})\n}\n\nfunc TestSearchService_Code(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/search/code\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"q\":        \"blah\",\n\t\t\t\"sort\":     \"forks\",\n\t\t\t\"order\":    \"desc\",\n\t\t\t\"page\":     \"2\",\n\t\t\t\"per_page\": \"2\",\n\t\t})\n\n\t\tfmt.Fprint(w, `{\"total_count\": 4, \"incomplete_results\": false, \"items\": [{\"name\":\"1\"},{\"name\":\"2\"}]}`)\n\t})\n\n\topts := &SearchOptions{Sort: \"forks\", Order: \"desc\", ListOptions: ListOptions{Page: 2, PerPage: 2}}\n\tctx := t.Context()\n\tresult, _, err := client.Search.Code(ctx, \"blah\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Search.Code returned error: %v\", err)\n\t}\n\n\twant := &CodeSearchResult{\n\t\tTotal:             Ptr(4),\n\t\tIncompleteResults: Ptr(false),\n\t\tCodeResults:       []*CodeResult{{Name: Ptr(\"1\")}, {Name: Ptr(\"2\")}},\n\t}\n\tif !cmp.Equal(result, want) {\n\t\tt.Errorf(\"Search.Code returned %+v, want %+v\", result, want)\n\t}\n\tconst methodName = \"Code\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Search.Code(ctx, \"blah\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestSearchService_Code_coverage(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\n\tconst methodName = \"Code\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Search.Code(ctx, \"\\n\", nil)\n\t\treturn err\n\t})\n}\n\nfunc TestSearchService_CodeTextMatch(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/search/code\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\n\t\ttextMatchResponse := `\n\t\t{\n\t\t\t\"total_count\": 1,\n\t\t\t\"incomplete_results\": false,\n\t\t\t\"items\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\":\"gopher1\",\n\t\t\t\t\t\"text_matches\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"fragment\": \"I'm afraid my friend what you have found\\nIs a gopher who lives to feed\",\n\t\t\t\t\t\t\t\"matches\": [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\"text\": \"gopher\",\n\t\t\t\t\t\t\t\t\t\"indices\": [\n\t\t\t\t\t\t\t\t\t\t14,\n\t\t\t\t\t\t\t\t\t\t21\n\t\t\t\t\t\t\t  \t]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t  ]\n\t\t\t\t\t  }\n\t\t\t\t  ]\n\t\t\t\t}\n\t\t\t]\n\t\t}\n    `\n\n\t\tfmt.Fprint(w, textMatchResponse)\n\t})\n\n\topts := &SearchOptions{Sort: \"forks\", Order: \"desc\", ListOptions: ListOptions{Page: 2, PerPage: 2}, TextMatch: true}\n\tctx := t.Context()\n\tresult, _, err := client.Search.Code(ctx, \"blah\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Search.Code returned error: %v\", err)\n\t}\n\n\twantedCodeResult := &CodeResult{\n\t\tName: Ptr(\"gopher1\"),\n\t\tTextMatches: []*TextMatch{\n\t\t\t{\n\t\t\t\tFragment: Ptr(\"I'm afraid my friend what you have found\\nIs a gopher who lives to feed\"),\n\t\t\t\tMatches:  []*Match{{Text: Ptr(\"gopher\"), Indices: []int{14, 21}}},\n\t\t\t},\n\t\t},\n\t}\n\n\twant := &CodeSearchResult{\n\t\tTotal:             Ptr(1),\n\t\tIncompleteResults: Ptr(false),\n\t\tCodeResults:       []*CodeResult{wantedCodeResult},\n\t}\n\tif !cmp.Equal(result, want) {\n\t\tt.Errorf(\"Search.Code returned %+v, want %+v\", result, want)\n\t}\n}\n\nfunc TestSearchService_Labels(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/search/labels\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"repository_id\": \"1234\",\n\t\t\t\"q\":             \"blah\",\n\t\t\t\"sort\":          \"updated\",\n\t\t\t\"order\":         \"desc\",\n\t\t\t\"page\":          \"2\",\n\t\t\t\"per_page\":      \"2\",\n\t\t})\n\n\t\tfmt.Fprint(w, `{\"total_count\": 4, \"incomplete_results\": false, \"items\": [{\"id\": 1234, \"name\":\"bug\", \"description\": \"some text\"},{\"id\": 4567, \"name\":\"feature\"}]}`)\n\t})\n\n\topts := &SearchOptions{Sort: \"updated\", Order: \"desc\", ListOptions: ListOptions{Page: 2, PerPage: 2}}\n\tctx := t.Context()\n\tresult, _, err := client.Search.Labels(ctx, 1234, \"blah\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Search.Code returned error: %v\", err)\n\t}\n\n\twant := &LabelsSearchResult{\n\t\tTotal:             Ptr(4),\n\t\tIncompleteResults: Ptr(false),\n\t\tLabels: []*LabelResult{\n\t\t\t{ID: Ptr(int64(1234)), Name: Ptr(\"bug\"), Description: Ptr(\"some text\")},\n\t\t\t{ID: Ptr(int64(4567)), Name: Ptr(\"feature\")},\n\t\t},\n\t}\n\tif !cmp.Equal(result, want) {\n\t\tt.Errorf(\"Search.Labels returned %+v, want %+v\", result, want)\n\t}\n\tconst methodName = \"Labels\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Search.Labels(ctx, 1234, \"blah\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestSearchService_Labels_coverage(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\n\tconst methodName = \"Labels\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Search.Labels(ctx, -1234, \"\\n\", nil)\n\t\treturn err\n\t})\n}\n\nfunc TestMatch_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Match{}, \"{}\")\n\n\tu := &Match{\n\t\tText:    Ptr(\"txt\"),\n\t\tIndices: []int{1},\n\t}\n\n\twant := `{\n\t\t\"text\": \"txt\",\n\t\t\"indices\": [1]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestTextMatch_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &TextMatch{}, \"{}\")\n\n\tu := &TextMatch{\n\t\tObjectURL:  Ptr(\"ourl\"),\n\t\tObjectType: Ptr(\"otype\"),\n\t\tProperty:   Ptr(\"prop\"),\n\t\tFragment:   Ptr(\"fragment\"),\n\t\tMatches: []*Match{\n\t\t\t{\n\t\t\t\tText:    Ptr(\"txt\"),\n\t\t\t\tIndices: []int{1},\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"object_url\": \"ourl\",\n\t\t\"object_type\": \"otype\",\n\t\t\"property\": \"prop\",\n\t\t\"fragment\": \"fragment\",\n\t\t\"matches\": [{\n\t\t\t\"text\": \"txt\",\n\t\t\t\"indices\": [1]\n\t\t}]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestTopicResult_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &TopicResult{}, \"{}\")\n\n\tu := &TopicResult{\n\t\tName:             Ptr(\"name\"),\n\t\tDisplayName:      Ptr(\"displayName\"),\n\t\tShortDescription: Ptr(\"shortDescription\"),\n\t\tDescription:      Ptr(\"description\"),\n\t\tCreatedBy:        Ptr(\"createdBy\"),\n\t\tUpdatedAt:        Ptr(\"2021-10-26\"),\n\t\tFeatured:         Ptr(false),\n\t\tCurated:          Ptr(true),\n\t\tScore:            Ptr(99.9),\n\t}\n\n\twant := `{\n\t\t\"name\": \"name\",\n\t\t\"display_name\": \"displayName\",\n\t\t\"short_description\": \"shortDescription\",\n\t\t\"description\": \"description\",\n\t\t\"created_by\": \"createdBy\",\n\t\t\"updated_at\": \"2021-10-26\",\n\t\t\"featured\": false,\n\t\t\"curated\": true,\n\t\t\"score\": 99.9\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestRepositoriesSearchResult_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RepositoriesSearchResult{}, \"{}\")\n\n\tu := &RepositoriesSearchResult{\n\t\tTotal:             Ptr(0),\n\t\tIncompleteResults: Ptr(true),\n\t\tRepositories:      []*Repository{{ID: Ptr(int64(1))}},\n\t}\n\n\twant := `{\n\t\t\"total_count\" : 0,\n\t\t\"incomplete_results\" : true,\n\t\t\"items\" : [{\"id\":1}]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestCommitsSearchResult_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CommitsSearchResult{}, \"{}\")\n\n\tc := &CommitsSearchResult{\n\t\tTotal:             Ptr(0),\n\t\tIncompleteResults: Ptr(true),\n\t\tCommits: []*CommitResult{{\n\t\t\tSHA: Ptr(\"s\"),\n\t\t}},\n\t}\n\n\twant := `{\n\t\t\"total_count\" : 0,\n\t\t\"incomplete_results\" : true,\n\t\t\"items\" : [{\"sha\" : \"s\"}]\n\t}`\n\n\ttestJSONMarshal(t, c, want)\n}\n\nfunc TestTopicsSearchResult_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &TopicsSearchResult{}, \"{}\")\n\n\tu := &TopicsSearchResult{\n\t\tTotal:             Ptr(2),\n\t\tIncompleteResults: Ptr(false),\n\t\tTopics: []*TopicResult{\n\t\t\t{\n\t\t\t\tName:             Ptr(\"t1\"),\n\t\t\t\tDisplayName:      Ptr(\"tt\"),\n\t\t\t\tShortDescription: Ptr(\"t desc\"),\n\t\t\t\tDescription:      Ptr(\"desc\"),\n\t\t\t\tCreatedBy:        Ptr(\"mi\"),\n\t\t\t\tCreatedAt:        &Timestamp{referenceTime},\n\t\t\t\tUpdatedAt:        Ptr(\"2006-01-02T15:04:05Z\"),\n\t\t\t\tFeatured:         Ptr(true),\n\t\t\t\tCurated:          Ptr(true),\n\t\t\t\tScore:            Ptr(123.0),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"total_count\" : 2,\n\t\t\"incomplete_results\" : false,\n\t\t\"items\" : [\n\t\t\t{\n\t\t\t\t\"name\" : \"t1\",\n\t\t\t\t\"display_name\":\"tt\",\n\t\t\t\t\"short_description\":\"t desc\",\n\t\t\t\t\"description\":\"desc\",\n\t\t\t\t\"created_by\":\"mi\",\n\t\t\t\t\"created_at\":` + referenceTimeStr + `,\n\t\t\t\t\"updated_at\":\"2006-01-02T15:04:05Z\",\n\t\t\t\t\"featured\":true,\n\t\t\t\t\"curated\":true,\n\t\t\t\t\"score\":123\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestLabelResult_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &LabelResult{}, \"{}\")\n\n\tu := &LabelResult{\n\t\tID:          Ptr(int64(11)),\n\t\tURL:         Ptr(\"url\"),\n\t\tName:        Ptr(\"label\"),\n\t\tColor:       Ptr(\"green\"),\n\t\tDefault:     Ptr(true),\n\t\tDescription: Ptr(\"desc\"),\n\t\tScore:       Ptr(123.0),\n\t}\n\n\twant := `{\n\t\t\"id\":11,\n\t\t\"url\":\"url\",\n\t\t\"name\":\"label\",\n\t\t\"color\":\"green\",\n\t\t\"default\":true,\n\t\t\"description\":\"desc\",\n\t\t\"score\":123\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestIssuesSearchResult_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &IssuesSearchResult{}, \"{}\")\n\n\tu := &IssuesSearchResult{\n\t\tTotal:             Ptr(48),\n\t\tIncompleteResults: Ptr(false),\n\t\tIssues: []*Issue{\n\t\t\t{\n\t\t\t\tID:                Ptr(int64(1)),\n\t\t\t\tNumber:            Ptr(1),\n\t\t\t\tState:             Ptr(\"s\"),\n\t\t\t\tLocked:            Ptr(false),\n\t\t\t\tTitle:             Ptr(\"title\"),\n\t\t\t\tBody:              Ptr(\"body\"),\n\t\t\t\tAuthorAssociation: Ptr(\"aa\"),\n\t\t\t\tUser:              &User{ID: Ptr(int64(1))},\n\t\t\t\tLabels:            []*Label{{ID: Ptr(int64(1))}},\n\t\t\t\tAssignee:          &User{ID: Ptr(int64(1))},\n\t\t\t\tComments:          Ptr(1),\n\t\t\t\tClosedAt:          &Timestamp{referenceTime},\n\t\t\t\tCreatedAt:         &Timestamp{referenceTime},\n\t\t\t\tUpdatedAt:         &Timestamp{referenceTime},\n\t\t\t\tClosedBy:          &User{ID: Ptr(int64(1))},\n\t\t\t\tURL:               Ptr(\"url\"),\n\t\t\t\tHTMLURL:           Ptr(\"hurl\"),\n\t\t\t\tCommentsURL:       Ptr(\"curl\"),\n\t\t\t\tEventsURL:         Ptr(\"eurl\"),\n\t\t\t\tLabelsURL:         Ptr(\"lurl\"),\n\t\t\t\tRepositoryURL:     Ptr(\"rurl\"),\n\t\t\t\tMilestone:         &Milestone{ID: Ptr(int64(1))},\n\t\t\t\tPullRequestLinks:  &PullRequestLinks{URL: Ptr(\"url\")},\n\t\t\t\tRepository:        &Repository{ID: Ptr(int64(1))},\n\t\t\t\tReactions:         &Reactions{TotalCount: Ptr(1)},\n\t\t\t\tAssignees:         []*User{{ID: Ptr(int64(1))}},\n\t\t\t\tNodeID:            Ptr(\"nid\"),\n\t\t\t\tTextMatches:       []*TextMatch{{ObjectURL: Ptr(\"ourl\")}},\n\t\t\t\tActiveLockReason:  Ptr(\"alr\"),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"total_count\": 48,\n\t\t\"incomplete_results\": false,\n\t\t\"items\": [\n\t\t\t{\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"number\": 1,\n\t\t\t\t\"state\": \"s\",\n\t\t\t\t\"locked\": false,\n\t\t\t\t\"title\": \"title\",\n\t\t\t\t\"body\": \"body\",\n\t\t\t\t\"author_association\": \"aa\",\n\t\t\t\t\"user\": {\n\t\t\t\t\t\"id\": 1\n\t\t\t\t},\n\t\t\t\t\"labels\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": 1\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"assignee\": {\n\t\t\t\t\t\"id\": 1\n\t\t\t\t},\n\t\t\t\t\"comments\": 1,\n\t\t\t\t\"closed_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\t\t\"closed_by\": {\n\t\t\t\t\t\"id\": 1\n\t\t\t\t},\n\t\t\t\t\"url\": \"url\",\n\t\t\t\t\"html_url\": \"hurl\",\n\t\t\t\t\"comments_url\": \"curl\",\n\t\t\t\t\"events_url\": \"eurl\",\n\t\t\t\t\"labels_url\": \"lurl\",\n\t\t\t\t\"repository_url\": \"rurl\",\n\t\t\t\t\"milestone\": {\n\t\t\t\t\t\"id\": 1\n\t\t\t\t},\n\t\t\t\t\"pull_request\": {\n\t\t\t\t\t\"url\": \"url\"\n\t\t\t\t},\n\t\t\t\t\"repository\": {\n\t\t\t\t\t\"id\": 1\n\t\t\t\t},\n\t\t\t\t\"reactions\": {\n\t\t\t\t\t\"total_count\": 1\n\t\t\t\t},\n\t\t\t\t\"assignees\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": 1\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"node_id\": \"nid\",\n\t\t\t\t\"text_matches\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"object_url\": \"ourl\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"active_lock_reason\": \"alr\"\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestLabelsSearchResult_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &LabelsSearchResult{}, \"{}\")\n\n\tu := &LabelsSearchResult{\n\t\tTotal:             Ptr(5),\n\t\tIncompleteResults: Ptr(false),\n\t\tLabels: []*LabelResult{\n\t\t\t{\n\t\t\t\tID:          Ptr(int64(1)),\n\t\t\t\tURL:         Ptr(\"https://www.example.com\"),\n\t\t\t\tName:        Ptr(\"test name\"),\n\t\t\t\tColor:       Ptr(\"green\"),\n\t\t\t\tDefault:     Ptr(true),\n\t\t\t\tDescription: Ptr(\"testDescription\"),\n\t\t\t\tScore:       Ptr(1.0),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"total_count\": 5,\n\t\t\"incomplete_results\": false,\n\t\t\"items\": [\n\t\t\t{\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"url\": \"https://www.example.com\",\n\t\t\t\t\"name\": \"test name\",\n\t\t\t\t\"color\": \"green\",\n\t\t\t\t\"default\": true,\n\t\t\t\t\"description\": \"testDescription\",\n\t\t\t\t\"score\": 1\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestCommitResult_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CommitResult{}, \"{}\")\n\n\tc := &CommitResult{\n\t\tSHA:         Ptr(\"test\"),\n\t\tHTMLURL:     Ptr(\"hurl\"),\n\t\tCommentsURL: Ptr(\"curl\"),\n\t\tURL:         Ptr(\"url\"),\n\t\tRepository:  &Repository{ID: Ptr(int64(1))},\n\t\tScore:       Ptr(123.0),\n\t\tCommit:      &Commit{SHA: Ptr(\"test\")},\n\t\tAuthor:      &User{ID: Ptr(int64(1))},\n\t\tCommitter:   &User{ID: Ptr(int64(1))},\n\t}\n\n\twant := `{\n\t\t\"sha\": \"test\",\n\t\t\"commit\": {\n\t\t   \"sha\": \"test\"\n\t\t},\n\t\t\"author\": {\n\t\t   \"id\": 1\n\t\t},\n\t\t\"committer\": {\n\t\t   \"id\": 1\n\t\t},\n\t\t\"html_url\": \"hurl\",\n\t\t\"url\": \"url\",\n\t\t\"comments_url\": \"curl\",\n\t\t\"repository\": {\n\t\t   \"id\": 1\n\t\t},\n\t\t\"score\": 123\n\t }`\n\n\ttestJSONMarshal(t, c, want)\n}\n\nfunc TestUsersSearchResult_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &UsersSearchResult{}, \"{}\")\n\n\tu := &UsersSearchResult{\n\t\tTotal:             Ptr(2),\n\t\tIncompleteResults: Ptr(false),\n\t\tUsers: []*User{{\n\t\t\tLogin:      Ptr(\"loginTest\"),\n\t\t\tID:         Ptr(int64(1)),\n\t\t\tNodeID:     Ptr(\"NodeTest\"),\n\t\t\tAvatarURL:  Ptr(\"AvatarURLTest\"),\n\t\t\tHTMLURL:    Ptr(\"Hurl\"),\n\t\t\tGravatarID: Ptr(\"gravatarIDTest\"),\n\t\t\tName:       Ptr(\"nameTest\"),\n\t\t}},\n\t}\n\n\twant := `{\n\t\t\"total_count\": 2,\n\t\t\"incomplete_results\": false,\n\t\t\"items\": [\n\t\t   {\n\t\t\t  \"login\": \"loginTest\",\n\t\t\t  \"id\": 1,\n\t\t\t  \"node_id\": \"NodeTest\",\n\t\t\t  \"avatar_url\": \"AvatarURLTest\",\n\t\t\t  \"html_url\": \"Hurl\",\n\t\t\t  \"gravatar_id\": \"gravatarIDTest\",\n\t\t\t  \"name\": \"nameTest\"\n\t\t   }\n\t\t]\n\t }`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestCodeSearchResult_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &CodeSearchResult{}, \"{}\")\n\n\tu := &CodeSearchResult{\n\t\tTotal:             Ptr(4),\n\t\tIncompleteResults: Ptr(false),\n\t\tCodeResults:       []*CodeResult{{Name: Ptr(\"n\")}},\n\t}\n\n\twant := `{\n\t\t\"total_count\" : 4,\n\t\t\"incomplete_results\" : false,\n\t\t\"items\" : [{\"name\": \"n\"}]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/secret_scanning.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// SecretScanningService handles communication with the secret scanning related\n// methods of the GitHub API.\ntype SecretScanningService service\n\n// SecretScanningAlert represents a GitHub secret scanning alert.\ntype SecretScanningAlert struct {\n\tNumber                                     *int                                `json:\"number,omitempty\"`\n\tCreatedAt                                  *Timestamp                          `json:\"created_at,omitempty\"`\n\tURL                                        *string                             `json:\"url,omitempty\"`\n\tHTMLURL                                    *string                             `json:\"html_url,omitempty\"`\n\tLocationsURL                               *string                             `json:\"locations_url,omitempty\"`\n\tFirstLocationDetected                      *SecretScanningAlertLocationDetails `json:\"first_location_detected,omitempty\"`\n\tHasMoreLocations                           *bool                               `json:\"has_more_locations,omitempty\"`\n\tState                                      *string                             `json:\"state,omitempty\"`\n\tResolution                                 *string                             `json:\"resolution,omitempty\"`\n\tResolvedAt                                 *Timestamp                          `json:\"resolved_at,omitempty\"`\n\tResolvedBy                                 *User                               `json:\"resolved_by,omitempty\"`\n\tSecretType                                 *string                             `json:\"secret_type,omitempty\"`\n\tSecretTypeDisplayName                      *string                             `json:\"secret_type_display_name,omitempty\"`\n\tSecret                                     *string                             `json:\"secret,omitempty\"`\n\tRepository                                 *Repository                         `json:\"repository,omitempty\"`\n\tUpdatedAt                                  *Timestamp                          `json:\"updated_at,omitempty\"`\n\tIsBase64Encoded                            *bool                               `json:\"is_base64_encoded,omitempty\"`\n\tMultiRepo                                  *bool                               `json:\"multi_repo,omitempty\"`\n\tPubliclyLeaked                             *bool                               `json:\"publicly_leaked,omitempty\"`\n\tPushProtectionBypassed                     *bool                               `json:\"push_protection_bypassed,omitempty\"`\n\tPushProtectionBypassedBy                   *User                               `json:\"push_protection_bypassed_by,omitempty\"`\n\tPushProtectionBypassedAt                   *Timestamp                          `json:\"push_protection_bypassed_at,omitempty\"`\n\tResolutionComment                          *string                             `json:\"resolution_comment,omitempty\"`\n\tPushProtectionBypassRequestComment         *string                             `json:\"push_protection_bypass_request_comment,omitempty\"`\n\tPushProtectionBypassRequestHTMLURL         *string                             `json:\"push_protection_bypass_request_html_url,omitempty\"`\n\tPushProtectionBypassRequestReviewer        *User                               `json:\"push_protection_bypass_request_reviewer,omitempty\"`\n\tPushProtectionBypassRequestReviewerComment *string                             `json:\"push_protection_bypass_request_reviewer_comment,omitempty\"`\n\tValidity                                   *string                             `json:\"validity,omitempty\"`\n}\n\n// SecretScanningAlertLocation represents the location for a secret scanning alert.\ntype SecretScanningAlertLocation struct {\n\tType    *string                             `json:\"type,omitempty\"`\n\tDetails *SecretScanningAlertLocationDetails `json:\"details,omitempty\"`\n}\n\n// SecretScanningAlertLocationDetails represents the location details for a secret scanning alert.\ntype SecretScanningAlertLocationDetails struct {\n\tPath                  *string `json:\"path,omitempty\"`\n\tStartline             *int    `json:\"start_line,omitempty\"`\n\tEndLine               *int    `json:\"end_line,omitempty\"`\n\tStartColumn           *int    `json:\"start_column,omitempty\"`\n\tEndColumn             *int    `json:\"end_column,omitempty\"`\n\tBlobSHA               *string `json:\"blob_sha,omitempty\"`\n\tBlobURL               *string `json:\"blob_url,omitempty\"`\n\tCommitSHA             *string `json:\"commit_sha,omitempty\"`\n\tCommitURL             *string `json:\"commit_url,omitempty\"`\n\tPullRequestCommentURL *string `json:\"pull_request_comment_url,omitempty\"`\n}\n\n// SecretScanningAlertListOptions specifies optional parameters to the SecretScanningService.ListAlertsForEnterprise method.\ntype SecretScanningAlertListOptions struct {\n\t// State of the secret scanning alerts to list. Set to open or resolved to only list secret scanning alerts in a specific state.\n\tState string `url:\"state,omitempty\"`\n\n\t// A comma-separated list of secret types to return. By default all secret types are returned.\n\tSecretType string `url:\"secret_type,omitempty\"`\n\n\t// A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed.\n\t// Valid resolutions are false_positive, wont_fix, revoked, pattern_edited, pattern_deleted or used_in_tests.\n\tResolution string `url:\"resolution,omitempty\"`\n\n\t// A comma-separated list of validities that, when present, will return alerts that match the validities in this list.\n\t// Valid options are active, inactive, and unknown.\n\tValidity string `url:\"validity,omitempty\"`\n\n\t// A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. Default: false.\n\tIsPubliclyLeaked bool `url:\"is_publicly_leaked,omitempty\"`\n\n\t// A boolean value representing whether or not to filter alerts by the multi-repo tag being present. Default: false.\n\tIsMultiRepo bool `url:\"is_multi_repo,omitempty\"`\n\n\t// The direction to sort the results by. Possible values are: asc, desc. Default: desc.\n\tDirection string `url:\"direction,omitempty\"`\n\n\t// The property by which to sort the results. Possible values are: created, updated. Default: created.\n\tSort string `url:\"sort,omitempty\"`\n\n\tListCursorOptions\n\n\t// List options can vary on the Enterprise type.\n\t// On Enterprise Cloud, Secret Scan alerts support requesting by page number\n\t// along with providing a cursor for an \"after\" param.\n\t// See: https://docs.github.com/enterprise-cloud@latest/rest/secret-scanning#list-secret-scanning-alerts-for-an-organization\n\t// Whereas on Enterprise Server, pagination is by index.\n\t// See: https://docs.github.com/enterprise-server@3.6/rest/secret-scanning#list-secret-scanning-alerts-for-an-organization\n\tListOptions\n}\n\n// SecretScanningAlertUpdateOptions specifies optional parameters to the SecretScanningService.UpdateAlert method.\ntype SecretScanningAlertUpdateOptions struct {\n\t// State is required and sets the state of the secret scanning alert.\n\t// Can be either \"open\" or \"resolved\".\n\t// You must provide resolution when you set the state to \"resolved\".\n\tState string `json:\"state\"`\n\n\t// Required when the state is \"resolved\" and represents the reason for resolving the alert.\n\t// Can be one of: \"false_positive\", \"wont_fix\", \"revoked\", or \"used_in_tests\".\n\tResolution *string `json:\"resolution,omitempty\"`\n\n\t// An optional comment when closing an alert.\n\tResolutionComment *string `json:\"resolution_comment,omitempty\"`\n}\n\n// PushProtectionBypassRequest represents the parameters for CreatePushProtectionBypass.\ntype PushProtectionBypassRequest struct {\n\t// The reason for bypassing push protection.\n\t// Can be one of: false_positive, used_in_tests, will_fix_later\n\tReason string `json:\"reason\"`\n\t// PlaceholderID is an identifier used for the bypass request.\n\t// GitHub Secret Scanning provides you with a unique PlaceholderID associated with that specific blocked push.\n\tPlaceholderID string `json:\"placeholder_id\"`\n}\n\n// PushProtectionBypass represents the response from CreatePushProtectionBypass.\ntype PushProtectionBypass struct {\n\t// The reason for bypassing push protection.\n\tReason string `json:\"reason\"`\n\t// The time that the bypass will expire in ISO 8601 format.\n\tExpireAt *Timestamp `json:\"expire_at\"`\n\t// The token type this bypass is for.\n\tTokenType string `json:\"token_type\"`\n}\n\n// SecretsScan represents the common fields for a secret scanning scan.\ntype SecretsScan struct {\n\tType        string     `json:\"type\"`\n\tStatus      string     `json:\"status\"`\n\tCompletedAt *Timestamp `json:\"completed_at,omitempty\"`\n\tStartedAt   *Timestamp `json:\"started_at,omitempty\"`\n}\n\n// CustomPatternBackfillScan represents a scan with an associated custom pattern.\ntype CustomPatternBackfillScan struct {\n\tSecretsScan\n\tPatternSlug  *string `json:\"pattern_slug,omitempty\"`\n\tPatternScope *string `json:\"pattern_scope,omitempty\"`\n}\n\n// SecretScanningScanHistory is the top-level struct for the secret scanning API response.\ntype SecretScanningScanHistory struct {\n\t// Information on incremental scan performed by secret scanning on the repository.\n\tIncrementalScans []*SecretsScan `json:\"incremental_scans,omitempty\"`\n\t// Information on backfill scan performed by secret scanning on the repository.\n\tBackfillScans []*SecretsScan `json:\"backfill_scans,omitempty\"`\n\t// Information on pattern update scan performed by secret scanning on the repository.\n\tPatternUpdateScans []*SecretsScan `json:\"pattern_update_scans,omitempty\"`\n\t// Information on custom pattern backfill scan performed by secret scanning on the repository.\n\tCustomPatternBackfillScans []*CustomPatternBackfillScan `json:\"custom_pattern_backfill_scans,omitempty\"`\n}\n\n// ListAlertsForEnterprise lists secret scanning alerts for eligible repositories in an enterprise, from newest to oldest.\n//\n// To use this endpoint, you must be a member of the enterprise, and you must use an access token with the repo scope or\n// security_events scope. Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-enterprise\n//\n//meta:operation GET /enterprises/{enterprise}/secret-scanning/alerts\nfunc (s *SecretScanningService) ListAlertsForEnterprise(ctx context.Context, enterprise string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/secret-scanning/alerts\", enterprise)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar alerts []*SecretScanningAlert\n\tresp, err := s.client.Do(ctx, req, &alerts)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn alerts, resp, nil\n}\n\n// ListAlertsForOrg lists secret scanning alerts for eligible repositories in an organization, from newest to oldest.\n//\n// To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with\n// the repo scope or security_events scope.\n//\n// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-organization\n//\n//meta:operation GET /orgs/{org}/secret-scanning/alerts\nfunc (s *SecretScanningService) ListAlertsForOrg(ctx context.Context, org string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/secret-scanning/alerts\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar alerts []*SecretScanningAlert\n\tresp, err := s.client.Do(ctx, req, &alerts)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn alerts, resp, nil\n}\n\n// ListAlertsForRepo lists secret scanning alerts for a private repository, from newest to oldest.\n//\n// To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with\n// the repo scope or security_events scope.\n//\n// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/secret-scanning/alerts\nfunc (s *SecretScanningService) ListAlertsForRepo(ctx context.Context, owner, repo string, opts *SecretScanningAlertListOptions) ([]*SecretScanningAlert, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/secret-scanning/alerts\", owner, repo)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar alerts []*SecretScanningAlert\n\tresp, err := s.client.Do(ctx, req, &alerts)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn alerts, resp, nil\n}\n\n// GetAlert gets a single secret scanning alert detected in a private repository.\n//\n// To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with\n// the repo scope or security_events scope.\n//\n// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#get-a-secret-scanning-alert\n//\n//meta:operation GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\nfunc (s *SecretScanningService) GetAlert(ctx context.Context, owner, repo string, number int64) (*SecretScanningAlert, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/secret-scanning/alerts/%v\", owner, repo, number)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar alert *SecretScanningAlert\n\tresp, err := s.client.Do(ctx, req, &alert)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn alert, resp, nil\n}\n\n// UpdateAlert updates the status of a secret scanning alert in a private repository.\n//\n// To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with\n// the repo scope or security_events scope.\n//\n// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#update-a-secret-scanning-alert\n//\n//meta:operation PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\nfunc (s *SecretScanningService) UpdateAlert(ctx context.Context, owner, repo string, number int64, opts *SecretScanningAlertUpdateOptions) (*SecretScanningAlert, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/secret-scanning/alerts/%v\", owner, repo, number)\n\n\treq, err := s.client.NewRequest(\"PATCH\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar alert *SecretScanningAlert\n\tresp, err := s.client.Do(ctx, req, &alert)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn alert, resp, nil\n}\n\n// ListLocationsForAlert lists all locations for a given secret scanning alert for a private repository.\n//\n// To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with\n// the repo scope or security_events scope.\n//\n// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#list-locations-for-a-secret-scanning-alert\n//\n//meta:operation GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations\nfunc (s *SecretScanningService) ListLocationsForAlert(ctx context.Context, owner, repo string, number int64, opts *ListOptions) ([]*SecretScanningAlertLocation, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/secret-scanning/alerts/%v/locations\", owner, repo, number)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar locations []*SecretScanningAlertLocation\n\tresp, err := s.client.Do(ctx, req, &locations)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn locations, resp, nil\n}\n\n// CreatePushProtectionBypass creates a push protection bypass for a given repository.\n//\n// To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with\n// the repo scope or security_events scope.\n//\n// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#create-a-push-protection-bypass\n//\n//meta:operation POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses\nfunc (s *SecretScanningService) CreatePushProtectionBypass(ctx context.Context, owner, repo string, request PushProtectionBypassRequest) (*PushProtectionBypass, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/secret-scanning/push-protection-bypasses\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"POST\", u, request)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar pushProtectionBypass *PushProtectionBypass\n\tresp, err := s.client.Do(ctx, req, &pushProtectionBypass)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\treturn pushProtectionBypass, resp, nil\n}\n\n// GetScanHistory fetches the secret scanning history for a given repository.\n//\n// To use this endpoint, you must be an administrator for the repository or organization, and you must use an access token with\n// the repo scope or security_events scope and gitHub advanced security or secret scanning must be enabled.\n//\n// GitHub API docs: https://docs.github.com/rest/secret-scanning/secret-scanning#get-secret-scanning-scan-history-for-a-repository\n//\n//meta:operation GET /repos/{owner}/{repo}/secret-scanning/scan-history\nfunc (s *SecretScanningService) GetScanHistory(ctx context.Context, owner, repo string) (*SecretScanningScanHistory, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/secret-scanning/scan-history\", owner, repo)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar secretScanningHistory *SecretScanningScanHistory\n\tresp, err := s.client.Do(ctx, req, &secretScanningHistory)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn secretScanningHistory, resp, nil\n}\n"
  },
  {
    "path": "github/secret_scanning_pattern_configs.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// SecretScanningPatternConfigs represents a collection of GitHub secret scanning patterns\n// and their settings related to push protection.\ntype SecretScanningPatternConfigs struct {\n\tPatternConfigVersion     *string                          `json:\"pattern_config_version,omitempty\"`\n\tProviderPatternOverrides []*SecretScanningPatternOverride `json:\"provider_pattern_overrides,omitempty\"`\n\tCustomPatternOverrides   []*SecretScanningPatternOverride `json:\"custom_pattern_overrides,omitempty\"`\n}\n\n// SecretScanningPatternOverride represents an override for provider partner or custom organization patterns.\ntype SecretScanningPatternOverride struct {\n\tTokenType            *string `json:\"token_type,omitempty\"`\n\tCustomPatternVersion *string `json:\"custom_pattern_version,omitempty\"`\n\tSlug                 *string `json:\"slug,omitempty\"`\n\tDisplayName          *string `json:\"display_name,omitempty\"`\n\tAlertTotal           *int    `json:\"alert_total,omitempty\"`\n\tAlertTotalPercentage *int    `json:\"alert_total_percentage,omitempty\"`\n\tFalsePositives       *int    `json:\"false_positives,omitempty\"`\n\tFalsePositiveRate    *int    `json:\"false_positive_rate,omitempty\"`\n\tBypassrate           *int    `json:\"bypass_rate,omitempty\"`\n\tDefaultSetting       *string `json:\"default_setting,omitempty\"`\n\tEnterpriseSetting    *string `json:\"enterprise_setting,omitempty\"`\n\tSetting              *string `json:\"setting,omitempty\"`\n}\n\n// SecretScanningPatternConfigsUpdate represents a secret scanning pattern configurations update.\ntype SecretScanningPatternConfigsUpdate struct {\n\tPatternConfigVersion *string `json:\"pattern_config_version,omitempty\"`\n}\n\n// SecretScanningPatternConfigsUpdateOptions specifies optional parameters to\n// the SecretScanningService.UpdatePatternConfigsForEnterprise method and\n// the SecretScanningService.UpdatePatternConfigsForOrg method.\ntype SecretScanningPatternConfigsUpdateOptions struct {\n\t// The version of the entity.\n\tPatternConfigVersion *string `json:\"pattern_config_version,omitempty\"`\n\n\t// Pattern settings for provider patterns.\n\tProviderPatternSettings []*SecretScanningProviderPatternSetting `json:\"provider_pattern_settings,omitempty\"`\n\n\t// Pattern settings for custom patterns.\n\tCustomPatternSettings []*SecretScanningCustomPatternSetting `json:\"custom_pattern_settings,omitempty\"`\n}\n\n// SecretScanningProviderPatternSetting defines an optional pattern setting for provider patterns.\ntype SecretScanningProviderPatternSetting struct {\n\t// The ID of the pattern to configure.\n\tTokenType string `json:\"token_type\"`\n\n\t// Push protection setting to set for the pattern.\n\t// Can be one of: \"not-set\", \"disabled\", \"enabled\"\n\tPushProtectionSetting string `json:\"push_protection_setting\"`\n}\n\n// SecretScanningCustomPatternSetting defines an optional pattern setting for custom patterns.\ntype SecretScanningCustomPatternSetting struct {\n\t// The ID of the pattern to configure.\n\tTokenType string `json:\"token_type\"`\n\n\t// The version of the entity\n\tCustomPatternVersion *string `json:\"custom_pattern_version,omitempty\"`\n\n\t// Push protection setting to set for the pattern.\n\t// Can be one of: \"not-set\", \"disabled\", \"enabled\"\n\tPushProtectionSetting string `json:\"push_protection_setting\"`\n}\n\n// ListPatternConfigsForEnterprise lists the secret scanning pattern configurations for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/secret-scanning/push-protection#list-enterprise-pattern-configurations\n//\n//meta:operation GET /enterprises/{enterprise}/secret-scanning/pattern-configurations\nfunc (s *SecretScanningService) ListPatternConfigsForEnterprise(ctx context.Context, enterprise string) (*SecretScanningPatternConfigs, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/secret-scanning/pattern-configurations\", enterprise)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar patternConfigs *SecretScanningPatternConfigs\n\tresp, err := s.client.Do(ctx, req, &patternConfigs)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn patternConfigs, resp, nil\n}\n\n// ListPatternConfigsForOrg lists the secret scanning pattern configurations for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/secret-scanning/push-protection#list-organization-pattern-configurations\n//\n//meta:operation GET /orgs/{org}/secret-scanning/pattern-configurations\nfunc (s *SecretScanningService) ListPatternConfigsForOrg(ctx context.Context, org string) (*SecretScanningPatternConfigs, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/secret-scanning/pattern-configurations\", org)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar patternConfigs *SecretScanningPatternConfigs\n\tresp, err := s.client.Do(ctx, req, &patternConfigs)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn patternConfigs, resp, nil\n}\n\n// UpdatePatternConfigsForEnterprise updates the secret scanning pattern configurations for an enterprise.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/secret-scanning/push-protection#update-enterprise-pattern-configurations\n//\n//meta:operation PATCH /enterprises/{enterprise}/secret-scanning/pattern-configurations\nfunc (s *SecretScanningService) UpdatePatternConfigsForEnterprise(ctx context.Context, enterprise string, opts *SecretScanningPatternConfigsUpdateOptions) (*SecretScanningPatternConfigsUpdate, *Response, error) {\n\tu := fmt.Sprintf(\"enterprises/%v/secret-scanning/pattern-configurations\", enterprise)\n\n\treq, err := s.client.NewRequest(\"PATCH\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar patternConfigsUpdate *SecretScanningPatternConfigsUpdate\n\tresp, err := s.client.Do(ctx, req, &patternConfigsUpdate)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn patternConfigsUpdate, resp, nil\n}\n\n// UpdatePatternConfigsForOrg updates the secret scanning pattern configurations for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/secret-scanning/push-protection#update-organization-pattern-configurations\n//\n//meta:operation PATCH /orgs/{org}/secret-scanning/pattern-configurations\nfunc (s *SecretScanningService) UpdatePatternConfigsForOrg(ctx context.Context, org string, opts *SecretScanningPatternConfigsUpdateOptions) (*SecretScanningPatternConfigsUpdate, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/secret-scanning/pattern-configurations\", org)\n\n\treq, err := s.client.NewRequest(\"PATCH\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar patternConfigsUpdate *SecretScanningPatternConfigsUpdate\n\tresp, err := s.client.Do(ctx, req, &patternConfigsUpdate)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn patternConfigsUpdate, resp, nil\n}\n"
  },
  {
    "path": "github/secret_scanning_pattern_configs_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestSecretScanningService_ListPatternConfigsForEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/secret-scanning/pattern-configurations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\n\t\tfmt.Fprint(w, `{\n\t\t\t\"pattern_config_version\": \"0ujsswThIGTUYm2K8FjOOfXtY1K\",\n\t\t\t\"provider_pattern_overrides\": [\n\t\t\t  {\n\t\t\t    \"token_type\": \"GITHUB_PERSONAL_ACCESS_TOKEN\",\n\t\t\t    \"slug\": \"github_personal_access_token_legacy_v2\",\n\t\t\t    \"display_name\": \"GitHub Personal Access Token (Legacy v2)\",\n\t\t\t    \"alert_total\": 15,\n\t\t\t    \"alert_total_percentage\": 36,\n\t\t\t    \"false_positives\": 2,\n\t\t\t    \"false_positive_rate\": 13,\n\t\t\t    \"bypass_rate\": 13,\n\t\t\t    \"default_setting\": \"enabled\",\n\t\t\t    \"setting\": \"enabled\",\n\t\t\t    \"enterprise_setting\": \"enabled\"\n\t\t\t  }\n\t\t\t],\n\t\t\t\"custom_pattern_overrides\": [\n\t\t\t  {\n\t\t\t    \"token_type\": \"cp_2\",\n\t\t\t    \"custom_pattern_version\": \"0ujsswThIGTUYm2K8FjOOfXtY1K\",\n\t\t\t    \"slug\": \"custom-api-key\",\n\t\t\t    \"display_name\": \"Custom API Key\",\n\t\t\t    \"alert_total\": 15,\n\t\t\t    \"alert_total_percentage\": 36,\n\t\t\t    \"false_positives\": 3,\n\t\t\t    \"false_positive_rate\": 20,\n\t\t\t    \"bypass_rate\": 20,\n\t\t\t    \"default_setting\": \"disabled\",\n\t\t\t    \"setting\": \"enabled\"\n\t\t\t  }\n\t\t\t]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\n\tpatternConfigs, _, err := client.SecretScanning.ListPatternConfigsForEnterprise(ctx, \"e\")\n\tif err != nil {\n\t\tt.Errorf(\"SecretScanning.ListPatternConfigsForEnterprise returned error: %v\", err)\n\t}\n\n\twant := &SecretScanningPatternConfigs{\n\t\tPatternConfigVersion: Ptr(\"0ujsswThIGTUYm2K8FjOOfXtY1K\"),\n\t\tProviderPatternOverrides: []*SecretScanningPatternOverride{\n\t\t\t{\n\t\t\t\tTokenType:            Ptr(\"GITHUB_PERSONAL_ACCESS_TOKEN\"),\n\t\t\t\tCustomPatternVersion: nil,\n\t\t\t\tSlug:                 Ptr(\"github_personal_access_token_legacy_v2\"),\n\t\t\t\tDisplayName:          Ptr(\"GitHub Personal Access Token (Legacy v2)\"),\n\t\t\t\tAlertTotal:           Ptr(15),\n\t\t\t\tAlertTotalPercentage: Ptr(36),\n\t\t\t\tFalsePositives:       Ptr(2),\n\t\t\t\tFalsePositiveRate:    Ptr(13),\n\t\t\t\tBypassrate:           Ptr(13),\n\t\t\t\tDefaultSetting:       Ptr(\"enabled\"),\n\t\t\t\tEnterpriseSetting:    Ptr(\"enabled\"),\n\t\t\t\tSetting:              Ptr(\"enabled\"),\n\t\t\t},\n\t\t},\n\t\tCustomPatternOverrides: []*SecretScanningPatternOverride{\n\t\t\t{\n\t\t\t\tTokenType:            Ptr(\"cp_2\"),\n\t\t\t\tCustomPatternVersion: Ptr(\"0ujsswThIGTUYm2K8FjOOfXtY1K\"),\n\t\t\t\tSlug:                 Ptr(\"custom-api-key\"),\n\t\t\t\tDisplayName:          Ptr(\"Custom API Key\"),\n\t\t\t\tAlertTotal:           Ptr(15),\n\t\t\t\tAlertTotalPercentage: Ptr(36),\n\t\t\t\tFalsePositives:       Ptr(3),\n\t\t\t\tFalsePositiveRate:    Ptr(20),\n\t\t\t\tBypassrate:           Ptr(20),\n\t\t\t\tDefaultSetting:       Ptr(\"disabled\"),\n\t\t\t\tEnterpriseSetting:    nil,\n\t\t\t\tSetting:              Ptr(\"enabled\"),\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(patternConfigs, want) {\n\t\tt.Errorf(\"SecretScanning.ListPatternConfigsForEnterprise returned %+v, want %+v\", patternConfigs, want)\n\t}\n\n\tconst methodName = \"ListPatternConfigsForEnterprise\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.SecretScanning.ListPatternConfigsForEnterprise(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t_, resp, err := client.SecretScanning.ListPatternConfigsForEnterprise(ctx, \"e\")\n\t\treturn resp, err\n\t})\n}\n\nfunc TestSecretScanningService_ListPatternConfigsForOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/secret-scanning/pattern-configurations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\n\t\tfmt.Fprint(w, `{\n\t\t\t\"pattern_config_version\": \"0ujsswThIGTUYm2K8FjOOfXtY1K\",\n\t\t\t\"provider_pattern_overrides\": [\n\t\t\t  {\n\t\t\t    \"token_type\": \"GITHUB_PERSONAL_ACCESS_TOKEN\",\n\t\t\t    \"slug\": \"github_personal_access_token_legacy_v2\",\n\t\t\t    \"display_name\": \"GitHub Personal Access Token (Legacy v2)\",\n\t\t\t    \"alert_total\": 15,\n\t\t\t    \"alert_total_percentage\": 36,\n\t\t\t    \"false_positives\": 2,\n\t\t\t    \"false_positive_rate\": 13,\n\t\t\t    \"bypass_rate\": 13,\n\t\t\t    \"default_setting\": \"enabled\",\n\t\t\t    \"setting\": \"enabled\",\n\t\t\t    \"enterprise_setting\": \"enabled\"\n\t\t\t  }\n\t\t\t],\n\t\t\t\"custom_pattern_overrides\": [\n\t\t\t  {\n\t\t\t    \"token_type\": \"cp_2\",\n\t\t\t    \"custom_pattern_version\": \"0ujsswThIGTUYm2K8FjOOfXtY1K\",\n\t\t\t    \"slug\": \"custom-api-key\",\n\t\t\t    \"display_name\": \"Custom API Key\",\n\t\t\t    \"alert_total\": 15,\n\t\t\t    \"alert_total_percentage\": 36,\n\t\t\t    \"false_positives\": 3,\n\t\t\t    \"false_positive_rate\": 20,\n\t\t\t    \"bypass_rate\": 20,\n\t\t\t    \"default_setting\": \"disabled\",\n\t\t\t    \"setting\": \"enabled\"\n\t\t\t  }\n\t\t\t]\n\t\t}`)\n\t})\n\tctx := t.Context()\n\n\tpatternConfigs, _, err := client.SecretScanning.ListPatternConfigsForOrg(ctx, \"o\")\n\tif err != nil {\n\t\tt.Errorf(\"SecretScanning.ListPatternConfigsForOrg returned error: %v\", err)\n\t}\n\n\twant := &SecretScanningPatternConfigs{\n\t\tPatternConfigVersion: Ptr(\"0ujsswThIGTUYm2K8FjOOfXtY1K\"),\n\t\tProviderPatternOverrides: []*SecretScanningPatternOverride{\n\t\t\t{\n\t\t\t\tTokenType:            Ptr(\"GITHUB_PERSONAL_ACCESS_TOKEN\"),\n\t\t\t\tCustomPatternVersion: nil,\n\t\t\t\tSlug:                 Ptr(\"github_personal_access_token_legacy_v2\"),\n\t\t\t\tDisplayName:          Ptr(\"GitHub Personal Access Token (Legacy v2)\"),\n\t\t\t\tAlertTotal:           Ptr(15),\n\t\t\t\tAlertTotalPercentage: Ptr(36),\n\t\t\t\tFalsePositives:       Ptr(2),\n\t\t\t\tFalsePositiveRate:    Ptr(13),\n\t\t\t\tBypassrate:           Ptr(13),\n\t\t\t\tDefaultSetting:       Ptr(\"enabled\"),\n\t\t\t\tEnterpriseSetting:    Ptr(\"enabled\"),\n\t\t\t\tSetting:              Ptr(\"enabled\"),\n\t\t\t},\n\t\t},\n\t\tCustomPatternOverrides: []*SecretScanningPatternOverride{\n\t\t\t{\n\t\t\t\tTokenType:            Ptr(\"cp_2\"),\n\t\t\t\tCustomPatternVersion: Ptr(\"0ujsswThIGTUYm2K8FjOOfXtY1K\"),\n\t\t\t\tSlug:                 Ptr(\"custom-api-key\"),\n\t\t\t\tDisplayName:          Ptr(\"Custom API Key\"),\n\t\t\t\tAlertTotal:           Ptr(15),\n\t\t\t\tAlertTotalPercentage: Ptr(36),\n\t\t\t\tFalsePositives:       Ptr(3),\n\t\t\t\tFalsePositiveRate:    Ptr(20),\n\t\t\t\tBypassrate:           Ptr(20),\n\t\t\t\tDefaultSetting:       Ptr(\"disabled\"),\n\t\t\t\tEnterpriseSetting:    nil,\n\t\t\t\tSetting:              Ptr(\"enabled\"),\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(patternConfigs, want) {\n\t\tt.Errorf(\"SecretScanning.ListPatternConfigsForOrg returned %+v, want %+v\", patternConfigs, want)\n\t}\n\n\tconst methodName = \"ListPatternConfigsForOrg\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.SecretScanning.ListPatternConfigsForOrg(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t_, resp, err := client.SecretScanning.ListPatternConfigsForOrg(ctx, \"o\")\n\t\treturn resp, err\n\t})\n}\n\nfunc TestSecretScanningService_UpdatePatternConfigsForEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/secret-scanning/pattern-configurations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\n\t\tfmt.Fprint(w, `{\n\t\t\t\"pattern_config_version\": \"0ujsswThIGTUYm2K8FjOOfXtY1K\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\n\topts := &SecretScanningPatternConfigsUpdateOptions{\n\t\tPatternConfigVersion: Ptr(\"0ujsswThIGTUYm2K8FjOOfXtY1K\"),\n\t\tProviderPatternSettings: []*SecretScanningProviderPatternSetting{\n\t\t\t{\n\t\t\t\tTokenType:             \"GITHUB_PERSONAL_ACCESS_TOKEN\",\n\t\t\t\tPushProtectionSetting: \"enabled\",\n\t\t\t},\n\t\t},\n\t\tCustomPatternSettings: []*SecretScanningCustomPatternSetting{\n\t\t\t{\n\t\t\t\tTokenType:             \"cp_2\",\n\t\t\t\tCustomPatternVersion:  Ptr(\"0ujsswThIGTUYm2K8FjOOfXtY1K\"),\n\t\t\t\tPushProtectionSetting: \"enabled\",\n\t\t\t},\n\t\t},\n\t}\n\n\tconfigsUpdate, _, err := client.SecretScanning.UpdatePatternConfigsForEnterprise(ctx, \"e\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"SecretScanning.UpdatePatternConfigsForEnterprise returned error: %v\", err)\n\t}\n\n\twant := &SecretScanningPatternConfigsUpdate{\n\t\tPatternConfigVersion: Ptr(\"0ujsswThIGTUYm2K8FjOOfXtY1K\"),\n\t}\n\n\tif !cmp.Equal(configsUpdate, want) {\n\t\tt.Errorf(\"SecretScanning.UpdatePatternConfigsForEnterprise returned %+v, want %+v\", configsUpdate, want)\n\t}\n\n\tconst methodName = \"UpdatePatternConfigsForEnterprise\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.SecretScanning.UpdatePatternConfigsForEnterprise(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t_, resp, err := client.SecretScanning.UpdatePatternConfigsForEnterprise(ctx, \"o\", opts)\n\t\treturn resp, err\n\t})\n}\n\nfunc TestSecretScanningService_UpdatePatternConfigsForOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/secret-scanning/pattern-configurations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\n\t\tfmt.Fprint(w, `{\n\t\t\t\"pattern_config_version\": \"0ujsswThIGTUYm2K8FjOOfXtY1K\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\n\topts := &SecretScanningPatternConfigsUpdateOptions{\n\t\tPatternConfigVersion: Ptr(\"0ujsswThIGTUYm2K8FjOOfXtY1K\"),\n\t\tProviderPatternSettings: []*SecretScanningProviderPatternSetting{\n\t\t\t{\n\t\t\t\tTokenType:             \"GITHUB_PERSONAL_ACCESS_TOKEN\",\n\t\t\t\tPushProtectionSetting: \"enabled\",\n\t\t\t},\n\t\t},\n\t\tCustomPatternSettings: []*SecretScanningCustomPatternSetting{\n\t\t\t{\n\t\t\t\tTokenType:             \"cp_2\",\n\t\t\t\tCustomPatternVersion:  Ptr(\"0ujsswThIGTUYm2K8FjOOfXtY1K\"),\n\t\t\t\tPushProtectionSetting: \"enabled\",\n\t\t\t},\n\t\t},\n\t}\n\n\tconfigsUpdate, _, err := client.SecretScanning.UpdatePatternConfigsForOrg(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"SecretScanning.UpdatePatternConfigsForOrg returned err: %v\", err)\n\t}\n\n\twant := &SecretScanningPatternConfigsUpdate{\n\t\tPatternConfigVersion: Ptr(\"0ujsswThIGTUYm2K8FjOOfXtY1K\"),\n\t}\n\n\tif !cmp.Equal(configsUpdate, want) {\n\t\tt.Errorf(\"SecretScanning.UpdatePatternConfigsForOrg returned %+v, want %+v\", configsUpdate, want)\n\t}\n\n\tconst methodName = \"UpdatePatternConfigsForOrg\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.SecretScanning.UpdatePatternConfigsForOrg(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t_, resp, err := client.SecretScanning.UpdatePatternConfigsForOrg(ctx, \"o\", opts)\n\t\treturn resp, err\n\t})\n}\n\nfunc TestSecretScanningPatternConfigs_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SecretScanningPatternConfigs{}, `{}`)\n\n\tv := &SecretScanningPatternConfigs{\n\t\tPatternConfigVersion: Ptr(\"0ujsswThIGTUYm2K8FjOOfXtY1K\"),\n\t\tProviderPatternOverrides: []*SecretScanningPatternOverride{\n\t\t\t{\n\t\t\t\tTokenType:            Ptr(\"GITHUB_PERSONAL_ACCESS_TOKEN\"),\n\t\t\t\tCustomPatternVersion: nil,\n\t\t\t\tSlug:                 Ptr(\"github_personal_access_token_legacy_v2\"),\n\t\t\t\tDisplayName:          Ptr(\"GitHub Personal Access Token (Legacy v2)\"),\n\t\t\t\tAlertTotal:           Ptr(15),\n\t\t\t\tAlertTotalPercentage: Ptr(36),\n\t\t\t\tFalsePositives:       Ptr(2),\n\t\t\t\tFalsePositiveRate:    Ptr(13),\n\t\t\t\tBypassrate:           Ptr(13),\n\t\t\t\tDefaultSetting:       Ptr(\"enabled\"),\n\t\t\t\tEnterpriseSetting:    Ptr(\"enabled\"),\n\t\t\t\tSetting:              Ptr(\"enabled\"),\n\t\t\t},\n\t\t},\n\t\tCustomPatternOverrides: []*SecretScanningPatternOverride{\n\t\t\t{\n\t\t\t\tTokenType:            Ptr(\"cp_2\"),\n\t\t\t\tCustomPatternVersion: Ptr(\"0ujsswThIGTUYm2K8FjOOfXtY1K\"),\n\t\t\t\tSlug:                 Ptr(\"custom-api-key\"),\n\t\t\t\tDisplayName:          Ptr(\"Custom API Key\"),\n\t\t\t\tAlertTotal:           Ptr(15),\n\t\t\t\tAlertTotalPercentage: Ptr(36),\n\t\t\t\tFalsePositives:       Ptr(3),\n\t\t\t\tFalsePositiveRate:    Ptr(20),\n\t\t\t\tBypassrate:           Ptr(20),\n\t\t\t\tDefaultSetting:       Ptr(\"disabled\"),\n\t\t\t\tEnterpriseSetting:    nil,\n\t\t\t\tSetting:              Ptr(\"enabled\"),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"pattern_config_version\": \"0ujsswThIGTUYm2K8FjOOfXtY1K\",\n\t\t\"provider_pattern_overrides\": [\n\t\t  {\n\t\t    \"token_type\": \"GITHUB_PERSONAL_ACCESS_TOKEN\",\n\t\t    \"slug\": \"github_personal_access_token_legacy_v2\",\n\t\t    \"display_name\": \"GitHub Personal Access Token (Legacy v2)\",\n\t\t    \"alert_total\": 15,\n\t\t    \"alert_total_percentage\": 36,\n\t\t    \"false_positives\": 2,\n\t\t    \"false_positive_rate\": 13,\n\t\t    \"bypass_rate\": 13,\n\t\t    \"default_setting\": \"enabled\",\n\t\t    \"setting\": \"enabled\",\n\t\t    \"enterprise_setting\": \"enabled\"\n\t\t  }\n\t\t],\n\t\t\"custom_pattern_overrides\": [\n\t\t  {\n\t\t    \"token_type\": \"cp_2\",\n\t\t    \"custom_pattern_version\": \"0ujsswThIGTUYm2K8FjOOfXtY1K\",\n\t\t    \"slug\": \"custom-api-key\",\n\t\t    \"display_name\": \"Custom API Key\",\n\t\t    \"alert_total\": 15,\n\t\t    \"alert_total_percentage\": 36,\n\t\t    \"false_positives\": 3,\n\t\t    \"false_positive_rate\": 20,\n\t\t    \"bypass_rate\": 20,\n\t\t    \"default_setting\": \"disabled\",\n\t\t    \"setting\": \"enabled\"\n\t\t  }\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, v, want)\n}\n\nfunc TestSecretScanningPatternOverride_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SecretScanningPatternOverride{}, `{}`)\n\n\tv := &SecretScanningPatternOverride{\n\t\tTokenType:            Ptr(\"GITHUB_PERSONAL_ACCESS_TOKEN\"),\n\t\tCustomPatternVersion: nil,\n\t\tSlug:                 Ptr(\"github_personal_access_token_legacy_v2\"),\n\t\tDisplayName:          Ptr(\"GitHub Personal Access Token (Legacy v2)\"),\n\t\tAlertTotal:           Ptr(15),\n\t\tAlertTotalPercentage: Ptr(36),\n\t\tFalsePositives:       Ptr(2),\n\t\tFalsePositiveRate:    Ptr(13),\n\t\tBypassrate:           Ptr(13),\n\t\tDefaultSetting:       Ptr(\"enabled\"),\n\t\tEnterpriseSetting:    Ptr(\"enabled\"),\n\t\tSetting:              Ptr(\"enabled\"),\n\t}\n\n\twant := `{\n    \t\"token_type\": \"GITHUB_PERSONAL_ACCESS_TOKEN\",\n    \t\"slug\": \"github_personal_access_token_legacy_v2\",\n    \t\"display_name\": \"GitHub Personal Access Token (Legacy v2)\",\n    \t\"alert_total\": 15,\n    \t\"alert_total_percentage\": 36,\n    \t\"false_positives\": 2,\n    \t\"false_positive_rate\": 13,\n    \t\"bypass_rate\": 13,\n    \t\"default_setting\": \"enabled\",\n    \t\"setting\": \"enabled\",\n    \t\"enterprise_setting\": \"enabled\"\n    }`\n\n\ttestJSONMarshal(t, v, want)\n\n\tv = &SecretScanningPatternOverride{\n\t\tTokenType:            Ptr(\"cp_2\"),\n\t\tCustomPatternVersion: Ptr(\"0ujsswThIGTUYm2K8FjOOfXtY1K\"),\n\t\tSlug:                 Ptr(\"custom-api-key\"),\n\t\tDisplayName:          Ptr(\"Custom API Key\"),\n\t\tAlertTotal:           Ptr(15),\n\t\tAlertTotalPercentage: Ptr(36),\n\t\tFalsePositives:       Ptr(3),\n\t\tFalsePositiveRate:    Ptr(20),\n\t\tBypassrate:           Ptr(20),\n\t\tDefaultSetting:       Ptr(\"disabled\"),\n\t\tEnterpriseSetting:    nil,\n\t\tSetting:              Ptr(\"enabled\"),\n\t}\n\n\twant = `{\n    \t\"token_type\": \"cp_2\",\n    \t\"custom_pattern_version\": \"0ujsswThIGTUYm2K8FjOOfXtY1K\",\n    \t\"slug\": \"custom-api-key\",\n    \t\"display_name\": \"Custom API Key\",\n    \t\"alert_total\": 15,\n    \t\"alert_total_percentage\": 36,\n    \t\"false_positives\": 3,\n    \t\"false_positive_rate\": 20,\n    \t\"bypass_rate\": 20,\n    \t\"default_setting\": \"disabled\",\n    \t\"setting\": \"enabled\"\n    }`\n\n\ttestJSONMarshal(t, v, want)\n}\n\nfunc TestSecretScanningPatternConfigsUpdate_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SecretScanningPatternConfigsUpdate{}, `{}`)\n\n\tv := &SecretScanningPatternConfigsUpdate{\n\t\tPatternConfigVersion: Ptr(\"0ujsswThIGTUYm2K8FjOOfXtY1K\"),\n\t}\n\n\twant := `{\n\t\t\"pattern_config_version\": \"0ujsswThIGTUYm2K8FjOOfXtY1K\"\n\t}`\n\n\ttestJSONMarshal(t, v, want)\n}\n\nfunc TestSecretScanningPatternConfigsUpdateOptions_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SecretScanningPatternConfigsUpdateOptions{}, `{}`)\n\n\tv := &SecretScanningPatternConfigsUpdateOptions{\n\t\tPatternConfigVersion: Ptr(\"0ujsswThIGTUYm2K8FjOOfXtY1K\"),\n\t\tProviderPatternSettings: []*SecretScanningProviderPatternSetting{\n\t\t\t{\n\t\t\t\tTokenType:             \"GITHUB_PERSONAL_ACCESS_TOKEN\",\n\t\t\t\tPushProtectionSetting: \"enabled\",\n\t\t\t},\n\t\t},\n\t\tCustomPatternSettings: []*SecretScanningCustomPatternSetting{\n\t\t\t{\n\t\t\t\tTokenType:             \"cp_2\",\n\t\t\t\tCustomPatternVersion:  Ptr(\"0ujsswThIGTUYm2K8FjOOfXtY1K\"),\n\t\t\t\tPushProtectionSetting: \"enabled\",\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n  \t\t\"pattern_config_version\": \"0ujsswThIGTUYm2K8FjOOfXtY1K\",\n  \t\t\"provider_pattern_settings\": [\n    \t\t{\n\t\t      \"token_type\": \"GITHUB_PERSONAL_ACCESS_TOKEN\",\n\t\t      \"push_protection_setting\": \"enabled\"\n\t\t    }\n\t\t  ],\n\t\t  \"custom_pattern_settings\": [\n\t\t    {\n\t\t      \"token_type\": \"cp_2\",\n\t\t      \"custom_pattern_version\": \"0ujsswThIGTUYm2K8FjOOfXtY1K\",\n\t\t      \"push_protection_setting\": \"enabled\"\n\t\t    }\n\t\t  ]\n\t\t}`\n\n\ttestJSONMarshal(t, v, want)\n}\n\nfunc TestSecretScanningProviderPatternSetting_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SecretScanningProviderPatternSetting{}, `{\n\t\t\"token_type\": \"\",\n\t\t\"push_protection_setting\": \"\"\n\t}`)\n\n\tv := SecretScanningProviderPatternSetting{\n\t\tTokenType:             \"GITHUB_PERSONAL_ACCESS_TOKEN\",\n\t\tPushProtectionSetting: \"enabled\",\n\t}\n\n\twant := `{\n    \t\"token_type\": \"GITHUB_PERSONAL_ACCESS_TOKEN\",\n    \t\"push_protection_setting\": \"enabled\"\n    }`\n\n\ttestJSONMarshal(t, v, want)\n}\n\nfunc TestSecretScanningCustomPatternSetting_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SecretScanningCustomPatternSetting{}, `{\n\t\t\"token_type\": \"\",\n\t\t\"push_protection_setting\": \"\"\n\t}`)\n\n\tv := SecretScanningCustomPatternSetting{\n\t\tTokenType:             \"cp_2\",\n\t\tCustomPatternVersion:  Ptr(\"0ujsswThIGTUYm2K8FjOOfXtY1K\"),\n\t\tPushProtectionSetting: \"enabled\",\n\t}\n\n\twant := `{\n    \t\"token_type\": \"cp_2\",\n    \t\"custom_pattern_version\": \"0ujsswThIGTUYm2K8FjOOfXtY1K\",\n    \t\"push_protection_setting\": \"enabled\"\n    }`\n\n\ttestJSONMarshal(t, v, want)\n}\n"
  },
  {
    "path": "github/secret_scanning_test.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestSecretScanningService_ListAlertsForEnterprise(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/enterprises/e/secret-scanning/alerts\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"state\": \"open\", \"secret_type\": \"mailchimp_api_key\", \"sort\": \"updated\", \"direction\": \"asc\"})\n\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"number\": 1,\n\t\t\t\"created_at\": \"1996-06-20T00:00:00Z\",\n\t\t\t\"url\": \"https://api.github.com/repos/o/r/secret-scanning/alerts/1\",\n\t\t\t\"html_url\": \"https://github.com/o/r/security/secret-scanning/1\",\n\t\t\t\"locations_url\": \"https://api.github.com/repos/o/r/secret-scanning/alerts/1/locations\",\n\t\t\t\"state\": \"open\",\n\t\t\t\"resolution\": null,\n\t\t\t\"resolved_at\": null,\n\t\t\t\"resolved_by\": null,\n\t\t\t\"secret_type\": \"mailchimp_api_key\",\n\t\t\t\"secret\": \"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2\",\n\t\t\t\"repository\": {\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"name\": \"n\",\n\t\t\t\t\"url\": \"url\"\n\t\t\t}\n\t\t}]`)\n\t})\n\n\tctx := t.Context()\n\topts := &SecretScanningAlertListOptions{State: \"open\", SecretType: \"mailchimp_api_key\", Direction: \"asc\", Sort: \"updated\"}\n\n\talerts, _, err := client.SecretScanning.ListAlertsForEnterprise(ctx, \"e\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"SecretScanning.ListAlertsForEnterprise returned error: %v\", err)\n\t}\n\n\tdate := Timestamp{time.Date(1996, time.June, 20, 0, 0, 0, 0, time.UTC)}\n\twant := []*SecretScanningAlert{\n\t\t{\n\t\t\tNumber:       Ptr(1),\n\t\t\tCreatedAt:    &date,\n\t\t\tURL:          Ptr(\"https://api.github.com/repos/o/r/secret-scanning/alerts/1\"),\n\t\t\tHTMLURL:      Ptr(\"https://github.com/o/r/security/secret-scanning/1\"),\n\t\t\tLocationsURL: Ptr(\"https://api.github.com/repos/o/r/secret-scanning/alerts/1/locations\"),\n\t\t\tState:        Ptr(\"open\"),\n\t\t\tResolution:   nil,\n\t\t\tResolvedAt:   nil,\n\t\t\tResolvedBy:   nil,\n\t\t\tSecretType:   Ptr(\"mailchimp_api_key\"),\n\t\t\tSecret:       Ptr(\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2\"),\n\t\t\tRepository: &Repository{\n\t\t\t\tID:   Ptr(int64(1)),\n\t\t\t\tURL:  Ptr(\"url\"),\n\t\t\t\tName: Ptr(\"n\"),\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(alerts, want) {\n\t\tt.Errorf(\"SecretScanning.ListAlertsForEnterprise returned %+v, want %+v\", alerts, want)\n\t}\n\n\tconst methodName = \"ListAlertsForEnterprise\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.SecretScanning.ListAlertsForEnterprise(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t_, resp, err := client.SecretScanning.ListAlertsForEnterprise(ctx, \"e\", opts)\n\t\treturn resp, err\n\t})\n}\n\nfunc TestSecretScanningService_ListAlertsForOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/secret-scanning/alerts\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"state\": \"open\", \"secret_type\": \"mailchimp_api_key\", \"sort\": \"updated\", \"direction\": \"asc\"})\n\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"number\": 1,\n\t\t\t\"created_at\": \"1996-06-20T00:00:00Z\",\n\t\t\t\"url\": \"https://api.github.com/repos/o/r/secret-scanning/alerts/1\",\n\t\t\t\"html_url\": \"https://github.com/o/r/security/secret-scanning/1\",\n\t\t\t\"locations_url\": \"https://api.github.com/repos/o/r/secret-scanning/alerts/1/locations\",\n\t\t\t\"state\": \"open\",\n\t\t\t\"resolution\": null,\n\t\t\t\"resolved_at\": null,\n\t\t\t\"resolved_by\": null,\n\t\t\t\"secret_type\": \"mailchimp_api_key\",\n\t\t\t\"secret\": \"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2\"\n\t\t}]`)\n\t})\n\n\tctx := t.Context()\n\topts := &SecretScanningAlertListOptions{State: \"open\", SecretType: \"mailchimp_api_key\", Direction: \"asc\", Sort: \"updated\"}\n\n\talerts, _, err := client.SecretScanning.ListAlertsForOrg(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"SecretScanning.ListAlertsForOrg returned error: %v\", err)\n\t}\n\n\tdate := Timestamp{time.Date(1996, time.June, 20, 0, 0, 0, 0, time.UTC)}\n\twant := []*SecretScanningAlert{\n\t\t{\n\t\t\tNumber:       Ptr(1),\n\t\t\tCreatedAt:    &date,\n\t\t\tURL:          Ptr(\"https://api.github.com/repos/o/r/secret-scanning/alerts/1\"),\n\t\t\tHTMLURL:      Ptr(\"https://github.com/o/r/security/secret-scanning/1\"),\n\t\t\tLocationsURL: Ptr(\"https://api.github.com/repos/o/r/secret-scanning/alerts/1/locations\"),\n\t\t\tState:        Ptr(\"open\"),\n\t\t\tResolution:   nil,\n\t\t\tResolvedAt:   nil,\n\t\t\tResolvedBy:   nil,\n\t\t\tSecretType:   Ptr(\"mailchimp_api_key\"),\n\t\t\tSecret:       Ptr(\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2\"),\n\t\t},\n\t}\n\n\tif !cmp.Equal(alerts, want) {\n\t\tt.Errorf(\"SecretScanning.ListAlertsForOrg returned %+v, want %+v\", alerts, want)\n\t}\n\n\tconst methodName = \"ListAlertsForOrg\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.SecretScanning.ListAlertsForOrg(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t_, resp, err := client.SecretScanning.ListAlertsForOrg(ctx, \"o\", opts)\n\t\treturn resp, err\n\t})\n}\n\nfunc TestSecretScanningService_ListAlertsForOrgListOptions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/secret-scanning/alerts\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"state\": \"open\", \"secret_type\": \"mailchimp_api_key\", \"per_page\": \"1\", \"page\": \"1\", \"sort\": \"updated\", \"direction\": \"asc\"})\n\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"number\": 1,\n\t\t\t\"created_at\": \"1996-06-20T00:00:00Z\",\n\t\t\t\"url\": \"https://api.github.com/repos/o/r/secret-scanning/alerts/1\",\n\t\t\t\"html_url\": \"https://github.com/o/r/security/secret-scanning/1\",\n\t\t\t\"locations_url\": \"https://api.github.com/repos/o/r/secret-scanning/alerts/1/locations\",\n\t\t\t\"state\": \"open\",\n\t\t\t\"resolution\": null,\n\t\t\t\"resolved_at\": null,\n\t\t\t\"resolved_by\": null,\n\t\t\t\"secret_type\": \"mailchimp_api_key\",\n\t\t\t\"secret\": \"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2\"\n\t\t}]`)\n\t})\n\n\tctx := t.Context()\n\n\t// Testing pagination by index\n\topts := &SecretScanningAlertListOptions{State: \"open\", SecretType: \"mailchimp_api_key\", ListOptions: ListOptions{Page: 1, PerPage: 1}, Direction: \"asc\", Sort: \"updated\"}\n\n\talerts, _, err := client.SecretScanning.ListAlertsForOrg(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"SecretScanning.ListAlertsForOrg returned error: %v\", err)\n\t}\n\n\tdate := Timestamp{time.Date(1996, time.June, 20, 0, 0, 0, 0, time.UTC)}\n\twant := []*SecretScanningAlert{\n\t\t{\n\t\t\tNumber:       Ptr(1),\n\t\t\tCreatedAt:    &date,\n\t\t\tURL:          Ptr(\"https://api.github.com/repos/o/r/secret-scanning/alerts/1\"),\n\t\t\tHTMLURL:      Ptr(\"https://github.com/o/r/security/secret-scanning/1\"),\n\t\t\tLocationsURL: Ptr(\"https://api.github.com/repos/o/r/secret-scanning/alerts/1/locations\"),\n\t\t\tState:        Ptr(\"open\"),\n\t\t\tResolution:   nil,\n\t\t\tResolvedAt:   nil,\n\t\t\tResolvedBy:   nil,\n\t\t\tSecretType:   Ptr(\"mailchimp_api_key\"),\n\t\t\tSecret:       Ptr(\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2\"),\n\t\t},\n\t}\n\n\tif !cmp.Equal(alerts, want) {\n\t\tt.Errorf(\"SecretScanning.ListAlertsForOrg returned %+v, want %+v\", alerts, want)\n\t}\n\n\tconst methodName = \"ListAlertsForOrg\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.SecretScanning.ListAlertsForOrg(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t_, resp, err := client.SecretScanning.ListAlertsForOrg(ctx, \"o\", opts)\n\t\treturn resp, err\n\t})\n}\n\nfunc TestSecretScanningService_ListAlertsForRepo(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/secret-scanning/alerts\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"state\": \"open\", \"secret_type\": \"mailchimp_api_key\", \"sort\": \"updated\", \"direction\": \"asc\"})\n\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"number\": 1,\n\t\t\t\"created_at\": \"1996-06-20T00:00:00Z\",\n\t\t\t\"url\": \"https://api.github.com/repos/o/r/secret-scanning/alerts/1\",\n\t\t\t\"html_url\": \"https://github.com/o/r/security/secret-scanning/1\",\n\t\t\t\"locations_url\": \"https://api.github.com/repos/o/r/secret-scanning/alerts/1/locations\",\n\t\t\t\"state\": \"open\",\n\t\t\t\"resolution\": null,\n\t\t\t\"resolved_at\": null,\n\t\t\t\"resolved_by\": null,\n\t\t\t\"secret_type\": \"mailchimp_api_key\",\n\t\t\t\"secret\": \"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2\"\n\t\t}]`)\n\t})\n\n\tctx := t.Context()\n\topts := &SecretScanningAlertListOptions{State: \"open\", SecretType: \"mailchimp_api_key\", Direction: \"asc\", Sort: \"updated\"}\n\n\talerts, _, err := client.SecretScanning.ListAlertsForRepo(ctx, \"o\", \"r\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"SecretScanning.ListAlertsForRepo returned error: %v\", err)\n\t}\n\n\tdate := Timestamp{time.Date(1996, time.June, 20, 0, 0, 0, 0, time.UTC)}\n\twant := []*SecretScanningAlert{\n\t\t{\n\t\t\tNumber:       Ptr(1),\n\t\t\tCreatedAt:    &date,\n\t\t\tURL:          Ptr(\"https://api.github.com/repos/o/r/secret-scanning/alerts/1\"),\n\t\t\tHTMLURL:      Ptr(\"https://github.com/o/r/security/secret-scanning/1\"),\n\t\t\tLocationsURL: Ptr(\"https://api.github.com/repos/o/r/secret-scanning/alerts/1/locations\"),\n\t\t\tState:        Ptr(\"open\"),\n\t\t\tResolution:   nil,\n\t\t\tResolvedAt:   nil,\n\t\t\tResolvedBy:   nil,\n\t\t\tSecretType:   Ptr(\"mailchimp_api_key\"),\n\t\t\tSecret:       Ptr(\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2\"),\n\t\t},\n\t}\n\n\tif !cmp.Equal(alerts, want) {\n\t\tt.Errorf(\"SecretScanning.ListAlertsForRepo returned %+v, want %+v\", alerts, want)\n\t}\n\n\tconst methodName = \"ListAlertsForRepo\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.SecretScanning.ListAlertsForRepo(ctx, \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t_, resp, err := client.SecretScanning.ListAlertsForRepo(ctx, \"o\", \"r\", opts)\n\t\treturn resp, err\n\t})\n}\n\nfunc TestSecretScanningService_GetAlert(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/secret-scanning/alerts/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\n\t\tfmt.Fprint(w, `{\n\t\t\t\"number\": 1,\n\t\t\t\"created_at\": \"1996-06-20T00:00:00Z\",\n\t\t\t\"url\": \"https://api.github.com/repos/o/r/secret-scanning/alerts/1\",\n\t\t\t\"html_url\": \"https://github.com/o/r/security/secret-scanning/1\",\n\t\t\t\"locations_url\": \"https://api.github.com/repos/o/r/secret-scanning/alerts/1/locations\",\n\t\t\t\"state\": \"open\",\n\t\t\t\"resolution\": null,\n\t\t\t\"resolved_at\": null,\n\t\t\t\"resolved_by\": null,\n\t\t\t\"secret_type\": \"mailchimp_api_key\",\n\t\t\t\"secret\": \"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\n\talert, _, err := client.SecretScanning.GetAlert(ctx, \"o\", \"r\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"SecretScanning.GetAlert returned error: %v\", err)\n\t}\n\n\tdate := Timestamp{time.Date(1996, time.June, 20, 0, 0, 0, 0, time.UTC)}\n\twant := &SecretScanningAlert{\n\t\tNumber:       Ptr(1),\n\t\tCreatedAt:    &date,\n\t\tURL:          Ptr(\"https://api.github.com/repos/o/r/secret-scanning/alerts/1\"),\n\t\tHTMLURL:      Ptr(\"https://github.com/o/r/security/secret-scanning/1\"),\n\t\tLocationsURL: Ptr(\"https://api.github.com/repos/o/r/secret-scanning/alerts/1/locations\"),\n\t\tState:        Ptr(\"open\"),\n\t\tResolution:   nil,\n\t\tResolvedAt:   nil,\n\t\tResolvedBy:   nil,\n\t\tSecretType:   Ptr(\"mailchimp_api_key\"),\n\t\tSecret:       Ptr(\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2\"),\n\t}\n\n\tif !cmp.Equal(alert, want) {\n\t\tt.Errorf(\"SecretScanning.GetAlert returned %+v, want %+v\", alert, want)\n\t}\n\n\tconst methodName = \"GetAlert\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.SecretScanning.GetAlert(ctx, \"\\n\", \"\\n\", 0)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t_, resp, err := client.SecretScanning.GetAlert(ctx, \"o\", \"r\", 1)\n\t\treturn resp, err\n\t})\n}\n\nfunc TestSecretScanningService_UpdateAlert(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/secret-scanning/alerts/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\n\t\tvar v *SecretScanningAlertUpdateOptions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\twant := &SecretScanningAlertUpdateOptions{State: \"resolved\", Resolution: Ptr(\"used_in_tests\")}\n\n\t\tif !cmp.Equal(v, want) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, want)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\n\t\t\t\"number\": 1,\n\t\t\t\"created_at\": \"1996-06-20T00:00:00Z\",\n\t\t\t\"url\": \"https://api.github.com/repos/o/r/secret-scanning/alerts/1\",\n\t\t\t\"html_url\": \"https://github.com/o/r/security/secret-scanning/1\",\n\t\t\t\"locations_url\": \"https://api.github.com/repos/o/r/secret-scanning/alerts/1/locations\",\n\t\t\t\"state\": \"resolved\",\n\t\t\t\"resolution\": \"used_in_tests\",\n\t\t\t\"resolution_comment\": \"resolution comment\",\n\t\t\t\"resolved_at\": \"1996-06-20T00:00:00Z\",\n\t\t\t\"resolved_by\": null,\n\t\t\t\"secret_type\": \"mailchimp_api_key\",\n\t\t\t\"secret\": \"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\topts := &SecretScanningAlertUpdateOptions{State: \"resolved\", Resolution: Ptr(\"used_in_tests\")}\n\n\talert, _, err := client.SecretScanning.UpdateAlert(ctx, \"o\", \"r\", 1, opts)\n\tif err != nil {\n\t\tt.Errorf(\"SecretScanning.UpdateAlert returned error: %v\", err)\n\t}\n\n\tdate := Timestamp{time.Date(1996, time.June, 20, 0, 0, 0, 0, time.UTC)}\n\twant := &SecretScanningAlert{\n\t\tNumber:            Ptr(1),\n\t\tCreatedAt:         &date,\n\t\tURL:               Ptr(\"https://api.github.com/repos/o/r/secret-scanning/alerts/1\"),\n\t\tHTMLURL:           Ptr(\"https://github.com/o/r/security/secret-scanning/1\"),\n\t\tLocationsURL:      Ptr(\"https://api.github.com/repos/o/r/secret-scanning/alerts/1/locations\"),\n\t\tState:             Ptr(\"resolved\"),\n\t\tResolution:        Ptr(\"used_in_tests\"),\n\t\tResolutionComment: Ptr(\"resolution comment\"),\n\t\tResolvedAt:        &date,\n\t\tResolvedBy:        nil,\n\t\tSecretType:        Ptr(\"mailchimp_api_key\"),\n\t\tSecret:            Ptr(\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-us2\"),\n\t}\n\n\tif !cmp.Equal(alert, want) {\n\t\tt.Errorf(\"SecretScanning.UpdateAlert returned %+v, want %+v\", alert, want)\n\t}\n\n\tconst methodName = \"UpdateAlert\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.SecretScanning.UpdateAlert(ctx, \"\\n\", \"\\n\", 1, opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t_, resp, err := client.SecretScanning.UpdateAlert(ctx, \"o\", \"r\", 1, opts)\n\t\treturn resp, err\n\t})\n}\n\nfunc TestSecretScanningService_ListLocationsForAlert(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/secret-scanning/alerts/1/locations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"1\", \"per_page\": \"100\"})\n\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"type\": \"commit\",\n\t\t\t\"details\": {\n\t\t\t  \"path\": \"/example/secrets.txt\",\n\t\t\t  \"start_line\": 1,\n\t\t\t  \"end_line\": 1,\n\t\t\t  \"start_column\": 1,\n\t\t\t  \"end_column\": 64,\n\t\t\t  \"blob_sha\": \"af5626b4a114abcb82d63db7c8082c3c4756e51b\",\n\t\t\t  \"blob_url\": \"https://api.github.com/repos/o/r/git/blobs/af5626b4a114abcb82d63db7c8082c3c4756e51b\",\n\t\t\t  \"commit_sha\": \"f14d7debf9775f957cf4f1e8176da0786431f72b\",\n\t\t\t  \"commit_url\": \"https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b\"\n\t\t\t}\n\t\t}]`)\n\t})\n\n\tctx := t.Context()\n\topts := &ListOptions{Page: 1, PerPage: 100}\n\n\tlocations, _, err := client.SecretScanning.ListLocationsForAlert(ctx, \"o\", \"r\", 1, opts)\n\tif err != nil {\n\t\tt.Errorf(\"SecretScanning.ListLocationsForAlert returned error: %v\", err)\n\t}\n\n\twant := []*SecretScanningAlertLocation{\n\t\t{\n\t\t\tType: Ptr(\"commit\"),\n\t\t\tDetails: &SecretScanningAlertLocationDetails{\n\t\t\t\tPath:        Ptr(\"/example/secrets.txt\"),\n\t\t\t\tStartline:   Ptr(1),\n\t\t\t\tEndLine:     Ptr(1),\n\t\t\t\tStartColumn: Ptr(1),\n\t\t\t\tEndColumn:   Ptr(64),\n\t\t\t\tBlobSHA:     Ptr(\"af5626b4a114abcb82d63db7c8082c3c4756e51b\"),\n\t\t\t\tBlobURL:     Ptr(\"https://api.github.com/repos/o/r/git/blobs/af5626b4a114abcb82d63db7c8082c3c4756e51b\"),\n\t\t\t\tCommitSHA:   Ptr(\"f14d7debf9775f957cf4f1e8176da0786431f72b\"),\n\t\t\t\tCommitURL:   Ptr(\"https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b\"),\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(locations, want) {\n\t\tt.Errorf(\"SecretScanning.ListLocationsForAlert returned %+v, want %+v\", locations, want)\n\t}\n\n\tconst methodName = \"ListLocationsForAlert\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.SecretScanning.ListLocationsForAlert(ctx, \"\\n\", \"\\n\", 1, opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t_, resp, err := client.SecretScanning.ListLocationsForAlert(ctx, \"o\", \"r\", 1, opts)\n\t\treturn resp, err\n\t})\n}\n\nfunc TestSecretScanningAlert_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SecretScanningAlert{}, `{}`)\n\n\tu := &SecretScanningAlert{\n\t\tNumber:       Ptr(1),\n\t\tCreatedAt:    &Timestamp{referenceTime},\n\t\tURL:          Ptr(\"https://api.github.com/teams/2/discussions/3/comments\"),\n\t\tHTMLURL:      Ptr(\"https://api.github.com/teams/2/discussions/3/comments\"),\n\t\tLocationsURL: Ptr(\"https://api.github.com/teams/2/discussions/3/comments\"),\n\t\tState:        Ptr(\"test_state\"),\n\t\tResolution:   Ptr(\"test_resolution\"),\n\t\tResolvedAt:   &Timestamp{referenceTime},\n\t\tResolvedBy: &User{\n\t\t\tLogin:     Ptr(\"test\"),\n\t\t\tID:        Ptr(int64(10)),\n\t\t\tNodeID:    Ptr(\"A123\"),\n\t\t\tAvatarURL: Ptr(\"https://api.github.com/teams/2/discussions/3/comments\"),\n\t\t},\n\t\tSecretType: Ptr(\"test\"),\n\t\tSecret:     Ptr(\"test\"),\n\t}\n\n\twant := `{\n\t\t\"number\": 1,\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"url\": \"https://api.github.com/teams/2/discussions/3/comments\",\n\t\t\"html_url\": \"https://api.github.com/teams/2/discussions/3/comments\",\n\t\t\"locations_url\": \"https://api.github.com/teams/2/discussions/3/comments\",\n\t\t\"state\": \"test_state\",\n\t\t\"resolution\": \"test_resolution\",\n\t\t\"resolved_at\": ` + referenceTimeStr + `,\n\t\t\"resolved_by\": {\n\t\t\t\"login\": \"test\",\n\t\t\t\"id\": 10,\n\t\t\t\"node_id\": \"A123\",\n\t\t\t\"avatar_url\": \"https://api.github.com/teams/2/discussions/3/comments\"\n\t\t},\n\t\t\"secret_type\": \"test\",\n\t\t\"secret\": \"test\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestSecretScanningAlertLocation_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SecretScanningAlertLocation{}, `{}`)\n\n\tu := &SecretScanningAlertLocation{\n\t\tType: Ptr(\"test\"),\n\t\tDetails: &SecretScanningAlertLocationDetails{\n\t\t\tPath:        Ptr(\"test_path\"),\n\t\t\tStartline:   Ptr(10),\n\t\t\tEndLine:     Ptr(20),\n\t\t\tStartColumn: Ptr(30),\n\t\t\tEndColumn:   Ptr(40),\n\t\t\tBlobSHA:     Ptr(\"test_sha\"),\n\t\t\tBlobURL:     Ptr(\"https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b\"),\n\t\t\tCommitSHA:   Ptr(\"test_sha\"),\n\t\t\tCommitURL:   Ptr(\"https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"type\": \"test\",\n\t\t\"details\": {\n\t\t\t\"path\": \"test_path\",\n\t\t\t\"start_line\": 10,\n\t\t\t\"end_line\": 20,\n\t\t\t\"start_column\": 30,\n\t\t\t\"end_column\": 40,\n\t\t\t\"blob_sha\": \"test_sha\",\n\t\t\t\"blob_url\": \"https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b\",\n\t\t\t\"commit_sha\": \"test_sha\",\n\t\t\t\"commit_url\": \"https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestSecretScanningAlertLocationDetails_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SecretScanningAlertLocationDetails{}, `{}`)\n\n\tu := &SecretScanningAlertLocationDetails{\n\t\tPath:        Ptr(\"test_path\"),\n\t\tStartline:   Ptr(10),\n\t\tEndLine:     Ptr(20),\n\t\tStartColumn: Ptr(30),\n\t\tEndColumn:   Ptr(40),\n\t\tBlobSHA:     Ptr(\"test_sha\"),\n\t\tBlobURL:     Ptr(\"https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b\"),\n\t\tCommitSHA:   Ptr(\"test_sha\"),\n\t\tCommitURL:   Ptr(\"https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b\"),\n\t}\n\n\twant := `{\n\t\t\"path\": \"test_path\",\n\t\t\"start_line\": 10,\n\t\t\"end_line\": 20,\n\t\t\"start_column\": 30,\n\t\t\"end_column\": 40,\n\t\t\"blob_sha\": \"test_sha\",\n\t\t\"blob_url\": \"https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b\",\n\t\t\"commit_sha\": \"test_sha\",\n\t\t\"commit_url\": \"https://api.github.com/repos/o/r/git/commits/f14d7debf9775f957cf4f1e8176da0786431f72b\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestSecretScanningAlertUpdateOptions_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SecretScanningAlertUpdateOptions{}, `{\"state\": \"\"}`)\n\n\tu := &SecretScanningAlertUpdateOptions{\n\t\tState:      \"open\",\n\t\tResolution: Ptr(\"false_positive\"),\n\t}\n\n\twant := `{\n\t\t\"state\": \"open\",\n\t\t\"resolution\": \"false_positive\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestSecretScanningService_CreatePushProtectionBypass(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\towner := \"o\"\n\trepo := \"r\"\n\n\tmux.HandleFunc(fmt.Sprintf(\"/repos/%v/%v/secret-scanning/push-protection-bypasses\", owner, repo), func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tvar v *PushProtectionBypassRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\t\twant := &PushProtectionBypassRequest{Reason: \"valid reason\", PlaceholderID: \"bypass-123\"}\n\t\tif !cmp.Equal(v, want) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, want)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\n\t\t\t\"reason\": \"valid reason\",\n\t\t\t\"expire_at\": \"2018-01-01T00:00:00Z\",\n\t\t\t\"token_type\": \"github_token\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\topts := PushProtectionBypassRequest{Reason: \"valid reason\", PlaceholderID: \"bypass-123\"}\n\n\tbypass, _, err := client.SecretScanning.CreatePushProtectionBypass(ctx, owner, repo, opts)\n\tif err != nil {\n\t\tt.Errorf(\"SecretScanning.CreatePushProtectionBypass returned error: %v\", err)\n\t}\n\n\texpireTime := Timestamp{time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)}\n\twant := &PushProtectionBypass{\n\t\tReason:    \"valid reason\",\n\t\tExpireAt:  &expireTime,\n\t\tTokenType: \"github_token\",\n\t}\n\n\tif !cmp.Equal(bypass, want) {\n\t\tt.Errorf(\"SecretScanning.CreatePushProtectionBypass returned %+v, want %+v\", bypass, want)\n\t}\n\tconst methodName = \"CreatePushProtectionBypass\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.SecretScanning.CreatePushProtectionBypass(ctx, \"\\n\", \"\\n\", opts)\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t_, resp, err := client.SecretScanning.CreatePushProtectionBypass(ctx, \"o\", \"r\", opts)\n\t\treturn resp, err\n\t})\n}\n\nfunc TestSecretScanningService_GetScanHistory(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\towner := \"o\"\n\trepo := \"r\"\n\n\tmux.HandleFunc(fmt.Sprintf(\"/repos/%v/%v/secret-scanning/scan-history\", owner, repo), func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"incremental_scans\": [\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"incremental\",\n\t\t\t\t\t\"status\": \"success\",\n\t\t\t\t\t\"completed_at\": \"2025-07-29T10:00:00Z\",\n\t\t\t\t\t\"started_at\": \"2025-07-29T09:55:00Z\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"backfill_scans\": [],\n\t\t\t\"pattern_update_scans\": [],\n\t\t\t\"custom_pattern_backfill_scans\": [\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"custom_backfill\",\n\t\t\t\t\t\"status\": \"in_progress\",\n\t\t\t\t\t\"completed_at\": null,\n\t\t\t\t\t\"started_at\": \"2025-07-29T09:00:00Z\",\n\t\t\t\t\t\"pattern_slug\": \"my-custom-pattern\",\n\t\t\t\t\t\"pattern_scope\": \"organization\"\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\n\thistory, _, err := client.SecretScanning.GetScanHistory(ctx, owner, repo)\n\tif err != nil {\n\t\tt.Errorf(\"SecretScanning.GetScanHistory returned error: %v\", err)\n\t}\n\n\tincrementalScanStartAt := Timestamp{time.Date(2025, time.July, 29, 9, 55, 0, 0, time.UTC)}\n\tincrementalScancompleteAt := Timestamp{time.Date(2025, time.July, 29, 10, 0, 0, 0, time.UTC)}\n\tcustomPatternBackfillScanStartedAt := Timestamp{time.Date(2025, time.July, 29, 9, 0, 0, 0, time.UTC)}\n\n\twant := &SecretScanningScanHistory{\n\t\tIncrementalScans: []*SecretsScan{\n\t\t\t{Type: \"incremental\", Status: \"success\", CompletedAt: &incrementalScancompleteAt, StartedAt: &incrementalScanStartAt},\n\t\t},\n\t\tBackfillScans:      []*SecretsScan{},\n\t\tPatternUpdateScans: []*SecretsScan{},\n\t\tCustomPatternBackfillScans: []*CustomPatternBackfillScan{\n\t\t\t{\n\t\t\t\tSecretsScan:  SecretsScan{Type: \"custom_backfill\", Status: \"in_progress\", CompletedAt: nil, StartedAt: &customPatternBackfillScanStartedAt},\n\t\t\t\tPatternSlug:  Ptr(\"my-custom-pattern\"),\n\t\t\t\tPatternScope: Ptr(\"organization\"),\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(history, want) {\n\t\tt.Errorf(\"SecretScanning.GetScanHistory returned %+v, want %+v\", history, want)\n\t}\n\tconst methodName = \"GetScanHistory\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.SecretScanning.GetScanHistory(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t_, resp, err := client.SecretScanning.GetScanHistory(ctx, \"o\", \"r\")\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/security_advisories.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n)\n\n// SecurityAdvisoriesService handles communication with the security advisories\n// related methods of the GitHub API.\n//\n// GitHub API docs: https://docs.github.com/rest/security-advisories\ntype SecurityAdvisoriesService service\n\n// SecurityAdvisorySubmission represents the Security Advisory Submission.\ntype SecurityAdvisorySubmission struct {\n\t// Accepted represents whether a private vulnerability report was accepted by the repository's administrators.\n\tAccepted *bool `json:\"accepted,omitempty\"`\n}\n\n// RepoAdvisoryCredit represents the credit object for a repository Security Advisory.\ntype RepoAdvisoryCredit struct {\n\tLogin *string `json:\"login,omitempty\"`\n\tType  *string `json:\"type,omitempty\"`\n}\n\n// RepoAdvisoryCreditDetailed represents a credit given to a user for a repository Security Advisory.\ntype RepoAdvisoryCreditDetailed struct {\n\tUser  *User   `json:\"user,omitempty\"`\n\tType  *string `json:\"type,omitempty\"`\n\tState *string `json:\"state,omitempty\"`\n}\n\n// ListRepositorySecurityAdvisoriesOptions specifies the optional parameters to list the repository security advisories.\ntype ListRepositorySecurityAdvisoriesOptions struct {\n\tListCursorOptions\n\n\t// Direction in which to sort advisories. Possible values are: asc, desc.\n\t// Default is \"asc\".\n\tDirection string `url:\"direction,omitempty\"`\n\n\t// Sort specifies how to sort advisories. Possible values are: created, updated,\n\t// and published. Default value is \"created\".\n\tSort string `url:\"sort,omitempty\"`\n\n\t// State filters advisories based on their state. Possible values are: triage, draft, published, closed.\n\tState string `url:\"state,omitempty\"`\n}\n\n// ListGlobalSecurityAdvisoriesOptions specifies the optional parameters to list the global security advisories.\ntype ListGlobalSecurityAdvisoriesOptions struct {\n\tListCursorOptions\n\n\t// If specified, only advisories with this GHSA (GitHub Security Advisory) identifier will be returned.\n\tGHSAID *string `url:\"ghsa_id,omitempty\"`\n\n\t// If specified, only advisories of this type will be returned.\n\t// By default, a request with no other parameters defined will only return reviewed advisories that are not malware.\n\t// Default: reviewed\n\t// Can be one of: reviewed, malware, unreviewed\n\tType *string `url:\"type,omitempty\"`\n\n\t// If specified, only advisories with this CVE (Common Vulnerabilities and Exposures) identifier will be returned.\n\tCVEID *string `url:\"cve_id,omitempty\"`\n\n\t// If specified, only advisories for these ecosystems will be returned.\n\t// Can be one of: actions, composer, erlang, go, maven, npm, nuget, other, pip, pub, rubygems, rust\n\tEcosystem *string `url:\"ecosystem,omitempty\"`\n\n\t// If specified, only advisories with these severities will be returned.\n\t// Can be one of: unknown, low, medium, high, critical\n\tSeverity *string `url:\"severity,omitempty\"`\n\n\t// If specified, only advisories with these Common Weakness Enumerations (CWEs) will be returned.\n\t// Example: cwes=79,284,22 or cwes[]=79&cwes[]=284&cwes[]=22\n\tCWEs []string `url:\"cwes,omitempty\"`\n\n\t// Whether to only return advisories that have been withdrawn.\n\tIsWithdrawn *bool `url:\"is_withdrawn,omitempty\"`\n\n\t// If specified, only return advisories that affect any of package or package@version.\n\t// A maximum of 1000 packages can be specified. If the query parameter causes\n\t// the URL to exceed the maximum URL length supported by your client, you must specify fewer packages.\n\t// Example: affects=package1,package2@1.0.0,package3@^2.0.0 or affects[]=package1&affects[]=package2@1.0.0\n\tAffects *string `url:\"affects,omitempty\"`\n\n\t// If specified, only return advisories that were published on a date or date range.\n\tPublished *string `url:\"published,omitempty\"`\n\n\t// If specified, only return advisories that were updated on a date or date range.\n\tUpdated *string `url:\"updated,omitempty\"`\n\n\t// If specified, only show advisories that were updated or published on a date or date range.\n\tModified *string `url:\"modified,omitempty\"`\n}\n\n// GlobalSecurityAdvisory represents the global security advisory object response.\ntype GlobalSecurityAdvisory struct {\n\tSecurityAdvisory\n\tID                    *int64                         `json:\"id,omitempty\"`\n\tRepositoryAdvisoryURL *string                        `json:\"repository_advisory_url,omitempty\"`\n\tType                  *string                        `json:\"type,omitempty\"`\n\tSourceCodeLocation    *string                        `json:\"source_code_location,omitempty\"`\n\tReferences            []string                       `json:\"references,omitempty\"`\n\tVulnerabilities       []*GlobalSecurityVulnerability `json:\"vulnerabilities,omitempty\"`\n\tGithubReviewedAt      *Timestamp                     `json:\"github_reviewed_at,omitempty\"`\n\tNVDPublishedAt        *Timestamp                     `json:\"nvd_published_at,omitempty\"`\n\tCredits               []*Credit                      `json:\"credits,omitempty\"`\n}\n\n// GlobalSecurityVulnerability represents a vulnerability for a global security advisory.\ntype GlobalSecurityVulnerability struct {\n\tPackage                *VulnerabilityPackage `json:\"package,omitempty\"`\n\tFirstPatchedVersion    *string               `json:\"first_patched_version,omitempty\"`\n\tVulnerableVersionRange *string               `json:\"vulnerable_version_range,omitempty\"`\n\tVulnerableFunctions    []string              `json:\"vulnerable_functions,omitempty\"`\n}\n\n// Credit represents the credit object for a global security advisory.\ntype Credit struct {\n\tUser *User   `json:\"user,omitempty\"`\n\tType *string `json:\"type,omitempty\"`\n}\n\n// RequestCVE requests a Common Vulnerabilities and Exposures (CVE) for a repository security advisory.\n// The ghsaID is the GitHub Security Advisory identifier of the advisory.\n//\n// GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories#request-a-cve-for-a-repository-security-advisory\n//\n//meta:operation POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve\nfunc (s *SecurityAdvisoriesService) RequestCVE(ctx context.Context, owner, repo, ghsaID string) (*Response, error) {\n\turl := fmt.Sprintf(\"repos/%v/%v/security-advisories/%v/cve\", owner, repo, ghsaID)\n\n\treq, err := s.client.NewRequest(\"POST\", url, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tif err != nil {\n\t\tif errors.As(err, new(*AcceptedError)) {\n\t\t\treturn resp, nil\n\t\t}\n\n\t\treturn resp, err\n\t}\n\n\treturn resp, nil\n}\n\n// CreateTemporaryPrivateFork creates a temporary private fork to collaborate on fixing a security vulnerability in your repository.\n// The ghsaID is the GitHub Security Advisory identifier of the advisory.\n//\n// GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories#create-a-temporary-private-fork\n//\n//meta:operation POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks\nfunc (s *SecurityAdvisoriesService) CreateTemporaryPrivateFork(ctx context.Context, owner, repo, ghsaID string) (*Repository, *Response, error) {\n\turl := fmt.Sprintf(\"repos/%v/%v/security-advisories/%v/forks\", owner, repo, ghsaID)\n\n\treq, err := s.client.NewRequest(\"POST\", url, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar fork Repository\n\tresp, err := s.client.Do(ctx, req, &fork)\n\tif err != nil {\n\t\tvar aerr *AcceptedError\n\t\tif errors.As(err, &aerr) {\n\t\t\tif err := json.Unmarshal(aerr.Raw, &fork); err != nil {\n\t\t\t\treturn &fork, resp, err\n\t\t\t}\n\n\t\t\treturn &fork, resp, err\n\t\t}\n\t\treturn nil, resp, err\n\t}\n\n\treturn &fork, resp, nil\n}\n\n// ListRepositorySecurityAdvisoriesForOrg lists the repository security advisories for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories-for-an-organization\n//\n//meta:operation GET /orgs/{org}/security-advisories\nfunc (s *SecurityAdvisoriesService) ListRepositorySecurityAdvisoriesForOrg(ctx context.Context, org string, opts *ListRepositorySecurityAdvisoriesOptions) ([]*SecurityAdvisory, *Response, error) {\n\turl := fmt.Sprintf(\"orgs/%v/security-advisories\", org)\n\turl, err := addOptions(url, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar advisories []*SecurityAdvisory\n\tresp, err := s.client.Do(ctx, req, &advisories)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn advisories, resp, nil\n}\n\n// ListRepositorySecurityAdvisories lists the security advisories in a repository.\n//\n// GitHub API docs: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories\n//\n//meta:operation GET /repos/{owner}/{repo}/security-advisories\nfunc (s *SecurityAdvisoriesService) ListRepositorySecurityAdvisories(ctx context.Context, owner, repo string, opts *ListRepositorySecurityAdvisoriesOptions) ([]*SecurityAdvisory, *Response, error) {\n\turl := fmt.Sprintf(\"repos/%v/%v/security-advisories\", owner, repo)\n\turl, err := addOptions(url, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar advisories []*SecurityAdvisory\n\tresp, err := s.client.Do(ctx, req, &advisories)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn advisories, resp, nil\n}\n\n// ListGlobalSecurityAdvisories lists all global security advisories.\n//\n// GitHub API docs: https://docs.github.com/rest/security-advisories/global-advisories#list-global-security-advisories\n//\n//meta:operation GET /advisories\nfunc (s *SecurityAdvisoriesService) ListGlobalSecurityAdvisories(ctx context.Context, opts *ListGlobalSecurityAdvisoriesOptions) ([]*GlobalSecurityAdvisory, *Response, error) {\n\turl := \"advisories\"\n\turl, err := addOptions(url, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar advisories []*GlobalSecurityAdvisory\n\tresp, err := s.client.Do(ctx, req, &advisories)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn advisories, resp, nil\n}\n\n// GetGlobalSecurityAdvisories gets a global security advisory using its GitHub Security Advisory (GHSA) identifier.\n//\n// GitHub API docs: https://docs.github.com/rest/security-advisories/global-advisories#get-a-global-security-advisory\n//\n//meta:operation GET /advisories/{ghsa_id}\nfunc (s *SecurityAdvisoriesService) GetGlobalSecurityAdvisories(ctx context.Context, ghsaID string) (*GlobalSecurityAdvisory, *Response, error) {\n\turl := fmt.Sprintf(\"advisories/%v\", ghsaID)\n\treq, err := s.client.NewRequest(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar advisory *GlobalSecurityAdvisory\n\tresp, err := s.client.Do(ctx, req, &advisory)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn advisory, resp, nil\n}\n"
  },
  {
    "path": "github/security_advisories_test.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestSecurityAdvisoriesService_RequestCVE(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/security-advisories/ghsa_id_ok/cve\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tw.WriteHeader(http.StatusOK)\n\t})\n\n\tmux.HandleFunc(\"/repos/o/r/security-advisories/ghsa_id_accepted/cve\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tw.WriteHeader(http.StatusAccepted)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.SecurityAdvisories.RequestCVE(ctx, \"o\", \"r\", \"ghsa_id_ok\")\n\tif err != nil {\n\t\tt.Errorf(\"SecurityAdvisoriesService.RequestCVE returned error: %v\", err)\n\t}\n\n\t_, err = client.SecurityAdvisories.RequestCVE(ctx, \"o\", \"r\", \"ghsa_id_accepted\")\n\tif err != nil {\n\t\tt.Errorf(\"SecurityAdvisoriesService.RequestCVE returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RequestCVE\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.SecurityAdvisories.RequestCVE(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tresp, err := client.SecurityAdvisories.RequestCVE(ctx, \"o\", \"r\", \"ghsa_id\")\n\t\tif err == nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v should have return err\", methodName)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestSecurityAdvisoriesService_CreateTemporaryPrivateFork(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/security-advisories/ghsa_id/forks\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"R_kgDPP3c6pQ\",\n\t\t\t\"owner\": {\n\t\t\t\t\"login\": \"owner\",\n\t\t\t\t\"id\": 2,\n\t\t\t\t\"node_id\": \"MDQ6VXFGcjYyMjcyMTQw\",\n\t\t\t\t\"avatar_url\": \"https://avatars.githubusercontent.com/u/111111?v=4\",\n\t\t\t\t\"html_url\": \"https://github.com/xxxxx\",\n\t\t\t\t\"gravatar_id\": \"\",\n\t\t\t\t\"type\": \"User\",\n\t\t\t\t\"site_admin\": false,\n\t\t\t\t\"url\": \"https://api.github.com/users/owner\",\n\t\t\t\t\"events_url\": \"https://api.github.com/users/owner/events{/privacy}\",\n\t\t\t\t\"following_url\": \"https://api.github.com/users/owner/following{/other_user}\",\n\t\t\t\t\"followers_url\": \"https://api.github.com/users/owner/followers\",\n\t\t\t\t\"gists_url\": \"https://api.github.com/users/owner/gists{/gist_id}\",\n\t\t\t\t\"organizations_url\": \"https://api.github.com/users/owner/orgs\",\n\t\t\t\t\"received_events_url\": \"https://api.github.com/users/owner/received_events\",\n\t\t\t\t\"repos_url\": \"https://api.github.com/users/owner/repos\",\n\t\t\t\t\"starred_url\": \"https://api.github.com/users/owner/starred{/owner}{/repo}\",\n\t\t\t\t\"subscriptions_url\": \"https://api.github.com/users/owner/subscriptions\"\n\t\t\t},\n\t\t\t\"name\": \"repo-ghsa-xxxx-xxxx-xxxx\",\n\t\t\t\"full_name\": \"owner/repo-ghsa-xxxx-xxxx-xxxx\",\n\t\t\t\"default_branch\": \"master\",\n\t\t\t\"created_at\": \"2023-12-08T17:22:41Z\",\n\t\t\t\"pushed_at\": \"2023-12-03T11:27:08Z\",\n\t\t\t\"updated_at\": \"2023-12-08T17:22:42Z\",\n\t\t\t\"html_url\": \"https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx\",\n\t\t\t\"clone_url\": \"https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git\",\n\t\t\t\"git_url\": \"git://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git\",\n\t\t\t\"ssh_url\": \"git@github.com:owner/repo-ghsa-xxxx-xxxx-xxxx.git\",\n\t\t\t\"svn_url\": \"https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx\",\n\t\t\t\"fork\": false,\n\t\t\t\"forks_count\": 0,\n\t\t\t\"network_count\": 0,\n\t\t\t\"open_issues_count\": 0,\n\t\t\t\"open_issues\": 0,\n\t\t\t\"stargazers_count\": 0,\n\t\t\t\"subscribers_count\": 0,\n\t\t\t\"watchers_count\": 0,\n\t\t\t\"watchers\": 0,\n\t\t\t\"size\": 0,\n\t\t\t\"permissions\": {\n\t\t\t\t\"admin\": true,\n\t\t\t\t\"maintain\": true,\n\t\t\t\t\"pull\": true,\n\t\t\t\t\"push\": true,\n\t\t\t\t\"triage\": true\n\t\t\t},\n\t\t\t\"allow_forking\": true,\n\t\t\t\"web_commit_signoff_required\": false,\n\t\t\t\"archived\": false,\n\t\t\t\"disabled\": false,\n\t\t\t\"private\": true,\n\t\t\t\"has_issues\": false,\n\t\t\t\"has_wiki\": false,\n\t\t\t\"has_pages\": false,\n\t\t\t\"has_projects\": false,\n\t\t\t\"has_downloads\": false,\n\t\t\t\"has_discussions\": false,\n\t\t\t\"is_template\": false,\n\t\t\t\"url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx\",\n\t\t\t\"archive_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/{archive_format}{/ref}\",\n\t\t\t\"assignees_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/assignees{/user}\",\n\t\t\t\"blobs_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/blobs{/sha}\",\n\t\t\t\"branches_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/branches{/branch}\",\n\t\t\t\"collaborators_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/collaborators{/collaborator}\",\n\t\t\t\"comments_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/comments{/number}\",\n\t\t\t\"commits_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/commits{/sha}\",\n\t\t\t\"compare_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/compare/{base}...{head}\",\n\t\t\t\"contents_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contents/{+path}\",\n\t\t\t\"contributors_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contributors\",\n\t\t\t\"deployments_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/deployments\",\n\t\t\t\"downloads_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/downloads\",\n\t\t\t\"events_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/events\",\n\t\t\t\"forks_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/forks\",\n\t\t\t\"git_commits_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/commits{/sha}\",\n\t\t\t\"git_refs_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/refs{/sha}\",\n\t\t\t\"git_tags_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/tags{/sha}\",\n\t\t\t\"hooks_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/hooks\",\n\t\t\t\"issue_comment_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/comments{/number}\",\n\t\t\t\"issue_events_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/events{/number}\",\n\t\t\t\"issues_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues{/number}\",\n\t\t\t\"keys_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/keys{/key_id}\",\n\t\t\t\"labels_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/labels{/name}\",\n\t\t\t\"languages_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/languages\",\n\t\t\t\"merges_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/merges\",\n\t\t\t\"milestones_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/milestones{/number}\",\n\t\t\t\"notifications_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/notifications{?since,all,participating}\",\n\t\t\t\"pulls_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/pulls{/number}\",\n\t\t\t\"releases_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/releases{/id}\",\n\t\t\t\"stargazers_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/stargazers\",\n\t\t\t\"statuses_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/statuses/{sha}\",\n\t\t\t\"subscribers_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscribers\",\n\t\t\t\"subscription_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscription\",\n\t\t\t\"tags_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/tags\",\n\t\t\t\"teams_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/teams\",\n\t\t\t\"visibility\": \"private\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tfork, _, err := client.SecurityAdvisories.CreateTemporaryPrivateFork(ctx, \"o\", \"r\", \"ghsa_id\")\n\tif err != nil {\n\t\tt.Errorf(\"SecurityAdvisoriesService.CreateTemporaryPrivateFork returned error: %v\", err)\n\t}\n\n\twant := &Repository{\n\t\tID:     Ptr(int64(1)),\n\t\tNodeID: Ptr(\"R_kgDPP3c6pQ\"),\n\t\tOwner: &User{\n\t\t\tLogin:             Ptr(\"owner\"),\n\t\t\tID:                Ptr(int64(2)),\n\t\t\tNodeID:            Ptr(\"MDQ6VXFGcjYyMjcyMTQw\"),\n\t\t\tAvatarURL:         Ptr(\"https://avatars.githubusercontent.com/u/111111?v=4\"),\n\t\t\tHTMLURL:           Ptr(\"https://github.com/xxxxx\"),\n\t\t\tGravatarID:        Ptr(\"\"),\n\t\t\tType:              Ptr(\"User\"),\n\t\t\tSiteAdmin:         Ptr(false),\n\t\t\tURL:               Ptr(\"https://api.github.com/users/owner\"),\n\t\t\tEventsURL:         Ptr(\"https://api.github.com/users/owner/events{/privacy}\"),\n\t\t\tFollowingURL:      Ptr(\"https://api.github.com/users/owner/following{/other_user}\"),\n\t\t\tFollowersURL:      Ptr(\"https://api.github.com/users/owner/followers\"),\n\t\t\tGistsURL:          Ptr(\"https://api.github.com/users/owner/gists{/gist_id}\"),\n\t\t\tOrganizationsURL:  Ptr(\"https://api.github.com/users/owner/orgs\"),\n\t\t\tReceivedEventsURL: Ptr(\"https://api.github.com/users/owner/received_events\"),\n\t\t\tReposURL:          Ptr(\"https://api.github.com/users/owner/repos\"),\n\t\t\tStarredURL:        Ptr(\"https://api.github.com/users/owner/starred{/owner}{/repo}\"),\n\t\t\tSubscriptionsURL:  Ptr(\"https://api.github.com/users/owner/subscriptions\"),\n\t\t},\n\t\tName:             Ptr(\"repo-ghsa-xxxx-xxxx-xxxx\"),\n\t\tFullName:         Ptr(\"owner/repo-ghsa-xxxx-xxxx-xxxx\"),\n\t\tDefaultBranch:    Ptr(\"master\"),\n\t\tCreatedAt:        &Timestamp{time.Date(2023, time.December, 8, 17, 22, 41, 0, time.UTC)},\n\t\tPushedAt:         &Timestamp{time.Date(2023, time.December, 3, 11, 27, 8, 0, time.UTC)},\n\t\tUpdatedAt:        &Timestamp{time.Date(2023, time.December, 8, 17, 22, 42, 0, time.UTC)},\n\t\tHTMLURL:          Ptr(\"https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx\"),\n\t\tCloneURL:         Ptr(\"https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git\"),\n\t\tGitURL:           Ptr(\"git://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git\"),\n\t\tSSHURL:           Ptr(\"git@github.com:owner/repo-ghsa-xxxx-xxxx-xxxx.git\"),\n\t\tSVNURL:           Ptr(\"https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx\"),\n\t\tFork:             Ptr(false),\n\t\tForksCount:       Ptr(0),\n\t\tNetworkCount:     Ptr(0),\n\t\tOpenIssuesCount:  Ptr(0),\n\t\tOpenIssues:       Ptr(0),\n\t\tStargazersCount:  Ptr(0),\n\t\tSubscribersCount: Ptr(0),\n\t\tWatchersCount:    Ptr(0),\n\t\tWatchers:         Ptr(0),\n\t\tSize:             Ptr(0),\n\t\tPermissions: &RepositoryPermissions{\n\t\t\tAdmin:    Ptr(true),\n\t\t\tMaintain: Ptr(true),\n\t\t\tPull:     Ptr(true),\n\t\t\tPush:     Ptr(true),\n\t\t\tTriage:   Ptr(true),\n\t\t},\n\t\tAllowForking:             Ptr(true),\n\t\tWebCommitSignoffRequired: Ptr(false),\n\t\tArchived:                 Ptr(false),\n\t\tDisabled:                 Ptr(false),\n\t\tPrivate:                  Ptr(true),\n\t\tHasIssues:                Ptr(false),\n\t\tHasWiki:                  Ptr(false),\n\t\tHasPages:                 Ptr(false),\n\t\tHasProjects:              Ptr(false),\n\t\tHasDownloads:             Ptr(false),\n\t\tHasDiscussions:           Ptr(false),\n\t\tIsTemplate:               Ptr(false),\n\t\tURL:                      Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx\"),\n\t\tArchiveURL:               Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/{archive_format}{/ref}\"),\n\t\tAssigneesURL:             Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/assignees{/user}\"),\n\t\tBlobsURL:                 Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/blobs{/sha}\"),\n\t\tBranchesURL:              Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/branches{/branch}\"),\n\t\tCollaboratorsURL:         Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/collaborators{/collaborator}\"),\n\t\tCommentsURL:              Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/comments{/number}\"),\n\t\tCommitsURL:               Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/commits{/sha}\"),\n\t\tCompareURL:               Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/compare/{base}...{head}\"),\n\t\tContentsURL:              Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contents/{+path}\"),\n\t\tContributorsURL:          Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contributors\"),\n\t\tDeploymentsURL:           Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/deployments\"),\n\t\tDownloadsURL:             Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/downloads\"),\n\t\tEventsURL:                Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/events\"),\n\t\tForksURL:                 Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/forks\"),\n\t\tGitCommitsURL:            Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/commits{/sha}\"),\n\t\tGitRefsURL:               Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/refs{/sha}\"),\n\t\tGitTagsURL:               Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/tags{/sha}\"),\n\t\tHooksURL:                 Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/hooks\"),\n\t\tIssueCommentURL:          Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/comments{/number}\"),\n\t\tIssueEventsURL:           Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/events{/number}\"),\n\t\tIssuesURL:                Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues{/number}\"),\n\t\tKeysURL:                  Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/keys{/key_id}\"),\n\t\tLabelsURL:                Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/labels{/name}\"),\n\t\tLanguagesURL:             Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/languages\"),\n\t\tMergesURL:                Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/merges\"),\n\t\tMilestonesURL:            Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/milestones{/number}\"),\n\t\tNotificationsURL:         Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/notifications{?since,all,participating}\"),\n\t\tPullsURL:                 Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/pulls{/number}\"),\n\t\tReleasesURL:              Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/releases{/id}\"),\n\t\tStargazersURL:            Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/stargazers\"),\n\t\tStatusesURL:              Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/statuses/{sha}\"),\n\t\tSubscribersURL:           Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscribers\"),\n\t\tSubscriptionURL:          Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscription\"),\n\t\tTagsURL:                  Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/tags\"),\n\t\tTeamsURL:                 Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/teams\"),\n\t\tVisibility:               Ptr(\"private\"),\n\t}\n\tif !cmp.Equal(fork, want) {\n\t\tt.Errorf(\"SecurityAdvisoriesService.CreateTemporaryPrivateFork returned %+v, want %+v\", fork, want)\n\t}\n\n\tconst methodName = \"CreateTemporaryPrivateFork\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.SecurityAdvisories.CreateTemporaryPrivateFork(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.SecurityAdvisories.CreateTemporaryPrivateFork(ctx, \"o\", \"r\", \"ghsa_id\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestSecurityAdvisoriesService_CreateTemporaryPrivateFork_deferred(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/security-advisories/ghsa_id/forks\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\tw.WriteHeader(http.StatusAccepted)\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"R_kgDPP3c6pQ\",\n\t\t\t\"owner\": {\n\t\t\t\t\"login\": \"owner\",\n\t\t\t\t\"id\": 2,\n\t\t\t\t\"node_id\": \"MDQ6VXFGcjYyMjcyMTQw\",\n\t\t\t\t\"avatar_url\": \"https://avatars.githubusercontent.com/u/111111?v=4\",\n\t\t\t\t\"html_url\": \"https://github.com/xxxxx\",\n\t\t\t\t\"gravatar_id\": \"\",\n\t\t\t\t\"type\": \"User\",\n\t\t\t\t\"site_admin\": false,\n\t\t\t\t\"url\": \"https://api.github.com/users/owner\",\n\t\t\t\t\"events_url\": \"https://api.github.com/users/owner/events{/privacy}\",\n\t\t\t\t\"following_url\": \"https://api.github.com/users/owner/following{/other_user}\",\n\t\t\t\t\"followers_url\": \"https://api.github.com/users/owner/followers\",\n\t\t\t\t\"gists_url\": \"https://api.github.com/users/owner/gists{/gist_id}\",\n\t\t\t\t\"organizations_url\": \"https://api.github.com/users/owner/orgs\",\n\t\t\t\t\"received_events_url\": \"https://api.github.com/users/owner/received_events\",\n\t\t\t\t\"repos_url\": \"https://api.github.com/users/owner/repos\",\n\t\t\t\t\"starred_url\": \"https://api.github.com/users/owner/starred{/owner}{/repo}\",\n\t\t\t\t\"subscriptions_url\": \"https://api.github.com/users/owner/subscriptions\"\n\t\t\t},\n\t\t\t\"name\": \"repo-ghsa-xxxx-xxxx-xxxx\",\n\t\t\t\"full_name\": \"owner/repo-ghsa-xxxx-xxxx-xxxx\",\n\t\t\t\"default_branch\": \"master\",\n\t\t\t\"created_at\": \"2023-12-08T17:22:41Z\",\n\t\t\t\"pushed_at\": \"2023-12-03T11:27:08Z\",\n\t\t\t\"updated_at\": \"2023-12-08T17:22:42Z\",\n\t\t\t\"html_url\": \"https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx\",\n\t\t\t\"clone_url\": \"https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git\",\n\t\t\t\"git_url\": \"git://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git\",\n\t\t\t\"ssh_url\": \"git@github.com:owner/repo-ghsa-xxxx-xxxx-xxxx.git\",\n\t\t\t\"svn_url\": \"https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx\",\n\t\t\t\"fork\": false,\n\t\t\t\"forks_count\": 0,\n\t\t\t\"network_count\": 0,\n\t\t\t\"open_issues_count\": 0,\n\t\t\t\"open_issues\": 0,\n\t\t\t\"stargazers_count\": 0,\n\t\t\t\"subscribers_count\": 0,\n\t\t\t\"watchers_count\": 0,\n\t\t\t\"watchers\": 0,\n\t\t\t\"size\": 0,\n\t\t\t\"permissions\": {\n\t\t\t\t\"admin\": true,\n\t\t\t\t\"maintain\": true,\n\t\t\t\t\"pull\": true,\n\t\t\t\t\"push\": true,\n\t\t\t\t\"triage\": true\n\t\t\t},\n\t\t\t\"allow_forking\": true,\n\t\t\t\"web_commit_signoff_required\": false,\n\t\t\t\"archived\": false,\n\t\t\t\"disabled\": false,\n\t\t\t\"private\": true,\n\t\t\t\"has_issues\": false,\n\t\t\t\"has_wiki\": false,\n\t\t\t\"has_pages\": false,\n\t\t\t\"has_projects\": false,\n\t\t\t\"has_downloads\": false,\n\t\t\t\"has_discussions\": false,\n\t\t\t\"is_template\": false,\n\t\t\t\"url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx\",\n\t\t\t\"archive_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/{archive_format}{/ref}\",\n\t\t\t\"assignees_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/assignees{/user}\",\n\t\t\t\"blobs_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/blobs{/sha}\",\n\t\t\t\"branches_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/branches{/branch}\",\n\t\t\t\"collaborators_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/collaborators{/collaborator}\",\n\t\t\t\"comments_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/comments{/number}\",\n\t\t\t\"commits_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/commits{/sha}\",\n\t\t\t\"compare_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/compare/{base}...{head}\",\n\t\t\t\"contents_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contents/{+path}\",\n\t\t\t\"contributors_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contributors\",\n\t\t\t\"deployments_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/deployments\",\n\t\t\t\"downloads_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/downloads\",\n\t\t\t\"events_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/events\",\n\t\t\t\"forks_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/forks\",\n\t\t\t\"git_commits_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/commits{/sha}\",\n\t\t\t\"git_refs_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/refs{/sha}\",\n\t\t\t\"git_tags_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/tags{/sha}\",\n\t\t\t\"hooks_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/hooks\",\n\t\t\t\"issue_comment_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/comments{/number}\",\n\t\t\t\"issue_events_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/events{/number}\",\n\t\t\t\"issues_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues{/number}\",\n\t\t\t\"keys_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/keys{/key_id}\",\n\t\t\t\"labels_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/labels{/name}\",\n\t\t\t\"languages_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/languages\",\n\t\t\t\"merges_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/merges\",\n\t\t\t\"milestones_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/milestones{/number}\",\n\t\t\t\"notifications_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/notifications{?since,all,participating}\",\n\t\t\t\"pulls_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/pulls{/number}\",\n\t\t\t\"releases_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/releases{/id}\",\n\t\t\t\"stargazers_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/stargazers\",\n\t\t\t\"statuses_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/statuses/{sha}\",\n\t\t\t\"subscribers_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscribers\",\n\t\t\t\"subscription_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscription\",\n\t\t\t\"tags_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/tags\",\n\t\t\t\"teams_url\": \"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/teams\",\n\t\t\t\"visibility\": \"private\"\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tfork, _, err := client.SecurityAdvisories.CreateTemporaryPrivateFork(ctx, \"o\", \"r\", \"ghsa_id\")\n\tif !errors.As(err, new(*AcceptedError)) {\n\t\tt.Errorf(\"SecurityAdvisoriesService.CreateTemporaryPrivateFork returned error: %v (want AcceptedError)\", err)\n\t}\n\n\twant := &Repository{\n\t\tID:     Ptr(int64(1)),\n\t\tNodeID: Ptr(\"R_kgDPP3c6pQ\"),\n\t\tOwner: &User{\n\t\t\tLogin:             Ptr(\"owner\"),\n\t\t\tID:                Ptr(int64(2)),\n\t\t\tNodeID:            Ptr(\"MDQ6VXFGcjYyMjcyMTQw\"),\n\t\t\tAvatarURL:         Ptr(\"https://avatars.githubusercontent.com/u/111111?v=4\"),\n\t\t\tHTMLURL:           Ptr(\"https://github.com/xxxxx\"),\n\t\t\tGravatarID:        Ptr(\"\"),\n\t\t\tType:              Ptr(\"User\"),\n\t\t\tSiteAdmin:         Ptr(false),\n\t\t\tURL:               Ptr(\"https://api.github.com/users/owner\"),\n\t\t\tEventsURL:         Ptr(\"https://api.github.com/users/owner/events{/privacy}\"),\n\t\t\tFollowingURL:      Ptr(\"https://api.github.com/users/owner/following{/other_user}\"),\n\t\t\tFollowersURL:      Ptr(\"https://api.github.com/users/owner/followers\"),\n\t\t\tGistsURL:          Ptr(\"https://api.github.com/users/owner/gists{/gist_id}\"),\n\t\t\tOrganizationsURL:  Ptr(\"https://api.github.com/users/owner/orgs\"),\n\t\t\tReceivedEventsURL: Ptr(\"https://api.github.com/users/owner/received_events\"),\n\t\t\tReposURL:          Ptr(\"https://api.github.com/users/owner/repos\"),\n\t\t\tStarredURL:        Ptr(\"https://api.github.com/users/owner/starred{/owner}{/repo}\"),\n\t\t\tSubscriptionsURL:  Ptr(\"https://api.github.com/users/owner/subscriptions\"),\n\t\t},\n\t\tName:             Ptr(\"repo-ghsa-xxxx-xxxx-xxxx\"),\n\t\tFullName:         Ptr(\"owner/repo-ghsa-xxxx-xxxx-xxxx\"),\n\t\tDefaultBranch:    Ptr(\"master\"),\n\t\tCreatedAt:        &Timestamp{time.Date(2023, time.December, 8, 17, 22, 41, 0, time.UTC)},\n\t\tPushedAt:         &Timestamp{time.Date(2023, time.December, 3, 11, 27, 8, 0, time.UTC)},\n\t\tUpdatedAt:        &Timestamp{time.Date(2023, time.December, 8, 17, 22, 42, 0, time.UTC)},\n\t\tHTMLURL:          Ptr(\"https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx\"),\n\t\tCloneURL:         Ptr(\"https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git\"),\n\t\tGitURL:           Ptr(\"git://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx.git\"),\n\t\tSSHURL:           Ptr(\"git@github.com:owner/repo-ghsa-xxxx-xxxx-xxxx.git\"),\n\t\tSVNURL:           Ptr(\"https://github.com/owner/repo-ghsa-xxxx-xxxx-xxxx\"),\n\t\tFork:             Ptr(false),\n\t\tForksCount:       Ptr(0),\n\t\tNetworkCount:     Ptr(0),\n\t\tOpenIssuesCount:  Ptr(0),\n\t\tOpenIssues:       Ptr(0),\n\t\tStargazersCount:  Ptr(0),\n\t\tSubscribersCount: Ptr(0),\n\t\tWatchersCount:    Ptr(0),\n\t\tWatchers:         Ptr(0),\n\t\tSize:             Ptr(0),\n\t\tPermissions: &RepositoryPermissions{\n\t\t\tAdmin:    Ptr(true),\n\t\t\tMaintain: Ptr(true),\n\t\t\tPull:     Ptr(true),\n\t\t\tPush:     Ptr(true),\n\t\t\tTriage:   Ptr(true),\n\t\t},\n\t\tAllowForking:             Ptr(true),\n\t\tWebCommitSignoffRequired: Ptr(false),\n\t\tArchived:                 Ptr(false),\n\t\tDisabled:                 Ptr(false),\n\t\tPrivate:                  Ptr(true),\n\t\tHasIssues:                Ptr(false),\n\t\tHasWiki:                  Ptr(false),\n\t\tHasPages:                 Ptr(false),\n\t\tHasProjects:              Ptr(false),\n\t\tHasDownloads:             Ptr(false),\n\t\tHasDiscussions:           Ptr(false),\n\t\tIsTemplate:               Ptr(false),\n\t\tURL:                      Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx\"),\n\t\tArchiveURL:               Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/{archive_format}{/ref}\"),\n\t\tAssigneesURL:             Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/assignees{/user}\"),\n\t\tBlobsURL:                 Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/blobs{/sha}\"),\n\t\tBranchesURL:              Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/branches{/branch}\"),\n\t\tCollaboratorsURL:         Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/collaborators{/collaborator}\"),\n\t\tCommentsURL:              Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/comments{/number}\"),\n\t\tCommitsURL:               Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/commits{/sha}\"),\n\t\tCompareURL:               Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/compare/{base}...{head}\"),\n\t\tContentsURL:              Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contents/{+path}\"),\n\t\tContributorsURL:          Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/contributors\"),\n\t\tDeploymentsURL:           Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/deployments\"),\n\t\tDownloadsURL:             Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/downloads\"),\n\t\tEventsURL:                Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/events\"),\n\t\tForksURL:                 Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/forks\"),\n\t\tGitCommitsURL:            Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/commits{/sha}\"),\n\t\tGitRefsURL:               Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/refs{/sha}\"),\n\t\tGitTagsURL:               Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/git/tags{/sha}\"),\n\t\tHooksURL:                 Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/hooks\"),\n\t\tIssueCommentURL:          Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/comments{/number}\"),\n\t\tIssueEventsURL:           Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues/events{/number}\"),\n\t\tIssuesURL:                Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/issues{/number}\"),\n\t\tKeysURL:                  Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/keys{/key_id}\"),\n\t\tLabelsURL:                Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/labels{/name}\"),\n\t\tLanguagesURL:             Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/languages\"),\n\t\tMergesURL:                Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/merges\"),\n\t\tMilestonesURL:            Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/milestones{/number}\"),\n\t\tNotificationsURL:         Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/notifications{?since,all,participating}\"),\n\t\tPullsURL:                 Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/pulls{/number}\"),\n\t\tReleasesURL:              Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/releases{/id}\"),\n\t\tStargazersURL:            Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/stargazers\"),\n\t\tStatusesURL:              Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/statuses/{sha}\"),\n\t\tSubscribersURL:           Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscribers\"),\n\t\tSubscriptionURL:          Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/subscription\"),\n\t\tTagsURL:                  Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/tags\"),\n\t\tTeamsURL:                 Ptr(\"https://api.github.com/repos/owner/repo-ghsa-xxxx-xxxx-xxxx/teams\"),\n\t\tVisibility:               Ptr(\"private\"),\n\t}\n\tif !cmp.Equal(fork, want) {\n\t\tt.Errorf(\"SecurityAdvisoriesService.CreateTemporaryPrivateFork returned %+v, want %+v\", fork, want)\n\t}\n}\n\nfunc TestSecurityAdvisoriesService_CreateTemporaryPrivateFork_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.SecurityAdvisories.CreateTemporaryPrivateFork(ctx, \"%\", \"r\", \"ghsa_id\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg_BadRequest(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/security-advisories\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\n\t\thttp.Error(w, \"Bad Request\", 400)\n\t})\n\n\tctx := t.Context()\n\tadvisories, resp, err := client.SecurityAdvisories.ListRepositorySecurityAdvisoriesForOrg(ctx, \"o\", nil)\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 400 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusBadRequest; got != want {\n\t\tt.Errorf(\"ListRepositorySecurityAdvisoriesForOrg return status %v, want %v\", got, want)\n\t}\n\tif advisories != nil {\n\t\tt.Errorf(\"ListRepositorySecurityAdvisoriesForOrg return %+v, want nil\", advisories)\n\t}\n}\n\nfunc TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg_NotFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/security-advisories\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"state\": \"draft\"})\n\n\t\thttp.NotFound(w, r)\n\t})\n\n\tctx := t.Context()\n\tadvisories, resp, err := client.SecurityAdvisories.ListRepositorySecurityAdvisoriesForOrg(ctx, \"o\", &ListRepositorySecurityAdvisoriesOptions{\n\t\tState: \"draft\",\n\t})\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"ListRepositorySecurityAdvisoriesForOrg return status %v, want %v\", got, want)\n\t}\n\tif advisories != nil {\n\t\tt.Errorf(\"ListRepositorySecurityAdvisoriesForOrg return %+v, want nil\", advisories)\n\t}\n}\n\nfunc TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg_UnmarshalError(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/security-advisories\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\n\t\tw.WriteHeader(http.StatusOK)\n\t\tassertWrite(t, w, []byte(`[{\"ghsa_id\": 12334354}]`))\n\t})\n\n\tctx := t.Context()\n\tadvisories, resp, err := client.SecurityAdvisories.ListRepositorySecurityAdvisoriesForOrg(ctx, \"o\", nil)\n\tif err == nil {\n\t\tt.Error(\"Expected unmarshal error\")\n\t} else if !strings.Contains(err.Error(), \"json: cannot unmarshal\") || !strings.Contains(err.Error(), \"ghsa_id\") {\n\t\tt.Errorf(\"ListRepositorySecurityAdvisoriesForOrg returned unexpected error: %v\", err)\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusOK; got != want {\n\t\tt.Errorf(\"ListRepositorySecurityAdvisoriesForOrg return status %v, want %v\", got, want)\n\t}\n\tif advisories != nil {\n\t\tt.Errorf(\"ListRepositorySecurityAdvisoriesForOrg return %+v, want nil\", advisories)\n\t}\n}\n\nfunc TestSecurityAdvisoriesService_ListRepositorySecurityAdvisoriesForOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/security-advisories\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\n\t\tw.WriteHeader(http.StatusOK)\n\t\tassertWrite(t, w, []byte(`[\n\t\t\t{\n\t\t\t\t\"ghsa_id\": \"GHSA-abcd-1234-efgh\",\n\t\t\t\t\"cve_id\": \"CVE-2050-00000\"\n\t\t\t}\n\t\t]`))\n\t})\n\n\tctx := t.Context()\n\tadvisories, resp, err := client.SecurityAdvisories.ListRepositorySecurityAdvisoriesForOrg(ctx, \"o\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"ListRepositorySecurityAdvisoriesForOrg returned error: %v, want nil\", err)\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusOK; got != want {\n\t\tt.Errorf(\"ListRepositorySecurityAdvisoriesForOrg return status %v, want %v\", got, want)\n\t}\n\n\twant := []*SecurityAdvisory{\n\t\t{\n\t\t\tGHSAID: Ptr(\"GHSA-abcd-1234-efgh\"),\n\t\t\tCVEID:  Ptr(\"CVE-2050-00000\"),\n\t\t},\n\t}\n\tif !cmp.Equal(advisories, want) {\n\t\tt.Errorf(\"ListRepositorySecurityAdvisoriesForOrg returned %+v, want %+v\", advisories, want)\n\t}\n\n\tmethodName := \"ListRepositorySecurityAdvisoriesForOrg\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.SecurityAdvisories.ListRepositorySecurityAdvisoriesForOrg(ctx, \"\\n\", &ListRepositorySecurityAdvisoriesOptions{\n\t\t\tSort: \"\\n\",\n\t\t})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.SecurityAdvisories.ListRepositorySecurityAdvisoriesForOrg(ctx, \"o\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories_BadRequest(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/security-advisories\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\n\t\thttp.Error(w, \"Bad Request\", 400)\n\t})\n\n\tctx := t.Context()\n\tadvisories, resp, err := client.SecurityAdvisories.ListRepositorySecurityAdvisories(ctx, \"o\", \"r\", nil)\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 400 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusBadRequest; got != want {\n\t\tt.Errorf(\"ListRepositorySecurityAdvisories return status %v, want %v\", got, want)\n\t}\n\tif advisories != nil {\n\t\tt.Errorf(\"ListRepositorySecurityAdvisories return %+v, want nil\", advisories)\n\t}\n}\n\nfunc TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories_NotFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/security-advisories\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"state\": \"draft\"})\n\n\t\thttp.NotFound(w, r)\n\t})\n\n\tctx := t.Context()\n\tadvisories, resp, err := client.SecurityAdvisories.ListRepositorySecurityAdvisories(ctx, \"o\", \"r\", &ListRepositorySecurityAdvisoriesOptions{\n\t\tState: \"draft\",\n\t})\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"ListRepositorySecurityAdvisories return status %v, want %v\", got, want)\n\t}\n\tif advisories != nil {\n\t\tt.Errorf(\"ListRepositorySecurityAdvisories return %+v, want nil\", advisories)\n\t}\n}\n\nfunc TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories_UnmarshalError(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/security-advisories\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\n\t\tw.WriteHeader(http.StatusOK)\n\t\tassertWrite(t, w, []byte(`[{\"ghsa_id\": 12334354}]`))\n\t})\n\n\tctx := t.Context()\n\tadvisories, resp, err := client.SecurityAdvisories.ListRepositorySecurityAdvisories(ctx, \"o\", \"r\", nil)\n\tif err == nil {\n\t\tt.Error(\"Expected unmarshal error\")\n\t} else if !strings.Contains(err.Error(), \"json: cannot unmarshal\") || !strings.Contains(err.Error(), \"ghsa_id\") {\n\t\tt.Errorf(\"ListRepositorySecurityAdvisories returned unexpected error: %v\", err)\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusOK; got != want {\n\t\tt.Errorf(\"ListRepositorySecurityAdvisories return status %v, want %v\", got, want)\n\t}\n\tif advisories != nil {\n\t\tt.Errorf(\"ListRepositorySecurityAdvisories return %+v, want nil\", advisories)\n\t}\n}\n\nfunc TestSecurityAdvisoriesService_ListRepositorySecurityAdvisories(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/security-advisories\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\n\t\tw.WriteHeader(http.StatusOK)\n\t\tassertWrite(t, w, []byte(`[\n\t\t\t{\n\t\t\t\t\"ghsa_id\": \"GHSA-abcd-1234-efgh\",\n\t\t\t\t\"cve_id\": \"CVE-2050-00000\"\n\t\t\t}\n\t\t]`))\n\t})\n\n\tctx := t.Context()\n\tadvisories, resp, err := client.SecurityAdvisories.ListRepositorySecurityAdvisories(ctx, \"o\", \"r\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"ListRepositorySecurityAdvisories returned error: %v, want nil\", err)\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusOK; got != want {\n\t\tt.Errorf(\"ListRepositorySecurityAdvisories return status %v, want %v\", got, want)\n\t}\n\n\twant := []*SecurityAdvisory{\n\t\t{\n\t\t\tGHSAID: Ptr(\"GHSA-abcd-1234-efgh\"),\n\t\t\tCVEID:  Ptr(\"CVE-2050-00000\"),\n\t\t},\n\t}\n\tif !cmp.Equal(advisories, want) {\n\t\tt.Errorf(\"ListRepositorySecurityAdvisories returned %+v, want %+v\", advisories, want)\n\t}\n\n\tmethodName := \"ListRepositorySecurityAdvisories\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.SecurityAdvisories.ListRepositorySecurityAdvisories(ctx, \"\\n\", \"\\n\", &ListRepositorySecurityAdvisoriesOptions{\n\t\t\tSort: \"\\n\",\n\t\t})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.SecurityAdvisories.ListRepositorySecurityAdvisories(ctx, \"o\", \"r\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestListGlobalSecurityAdvisories(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/advisories\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"cve_id\": \"CVE-xoxo-1234\"})\n\n\t\tfmt.Fprint(w, `[{\n\t\t\t\t\"id\": 1,\n\t\t\t\t\"ghsa_id\": \"GHSA-xoxo-1234-xoxo\",\n\t\t\t\t\"cve_id\": \"CVE-xoxo-1234\",\n\t\t\t\t\"url\": \"https://api.github.com/advisories/GHSA-xoxo-1234-xoxo\",\n\t\t\t\t\"html_url\": \"https://github.com/advisories/GHSA-xoxo-1234-xoxo\",\n\t\t\t\t\"repository_advisory_url\": \"https://api.github.com/repos/project/a-package/security-advisories/GHSA-xoxo-1234-xoxo\",\n\t\t\t\t\"summary\": \"Heartbleed security advisory\",\n\t\t\t\t\"description\": \"This bug allows an attacker to read portions of the affected server’s memory, potentially disclosing sensitive information.\",\n\t\t\t\t\"type\": \"reviewed\",\n\t\t\t\t\"severity\": \"high\",\n\t\t\t\t\"source_code_location\": \"https://github.com/project/a-package\",\n\t\t\t\t\"identifiers\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"GHSA\",\n\t\t\t\t\t\t\"value\": \"GHSA-xoxo-1234-xoxo\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"type\": \"CVE\",\n\t\t\t\t\t\t\"value\": \"CVE-xoxo-1234\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"references\": [\"https://nvd.nist.gov/vuln/detail/CVE-xoxo-1234\"],\n\t\t\t\t\"published_at\": \"1996-06-20T00:00:00Z\",\n\t\t\t\t\"updated_at\": \"1996-06-20T00:00:00Z\",\n\t\t\t\t\"github_reviewed_at\": \"1996-06-20T00:00:00Z\",\n\t\t\t\t\"nvd_published_at\": \"1996-06-20T00:00:00Z\",\n\t\t\t\t\"withdrawn_at\": null,\n\t\t\t\t\"vulnerabilities\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"package\": {\n\t\t\t\t\t\t\t\"ecosystem\": \"npm\",\n\t\t\t\t\t\t\t\"name\": \"a-package\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"first_patched_version\": \"1.0.3\",\n\t\t\t\t\t\t\"vulnerable_version_range\": \"<=1.0.2\",\n\t\t\t\t\t\t\"vulnerable_functions\": [\"a_function\"]\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"cvss\": {\n\t\t\t\t\t\"vector_string\": \"CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H\",\n\t\t\t\t\t\"score\": 7.6\n\t\t\t\t},\n\t\t\t\t\"cwes\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"cwe_id\": \"CWE-400\",\n\t\t\t\t\t\t\"name\": \"Uncontrolled Resource Consumption\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\t\"credits\": [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"user\": {\n\t\t\t\t\t\t\t\"login\": \"user\",\n\t\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\t\"node_id\": \"12=\",\n\t\t\t\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\t\t\t\"gravatar_id\": \"\",\n\t\t\t\t\t\t\t\"url\": \"a\",\n\t\t\t\t\t\t\t\"html_url\": \"b\",\n\t\t\t\t\t\t\t\"followers_url\": \"b\",\n\t\t\t\t\t\t\t\"following_url\": \"c\",\n\t\t\t\t\t\t\t\"gists_url\": \"d\",\n\t\t\t\t\t\t\t\"starred_url\": \"e\",\n\t\t\t\t\t\t\t\"subscriptions_url\": \"f\",\n\t\t\t\t\t\t\t\"organizations_url\": \"g\",\n\t\t\t\t\t\t\t\"repos_url\": \"h\",\n\t\t\t\t\t\t\t\"events_url\": \"i\",\n\t\t\t\t\t\t\t\"received_events_url\": \"j\",\n\t\t\t\t\t\t\t\"type\": \"User\",\n\t\t\t\t\t\t\t\"site_admin\": false\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"type\": \"analyst\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t]`)\n\t})\n\n\tctx := t.Context()\n\topts := &ListGlobalSecurityAdvisoriesOptions{CVEID: Ptr(\"CVE-xoxo-1234\")}\n\n\tadvisories, _, err := client.SecurityAdvisories.ListGlobalSecurityAdvisories(ctx, opts)\n\tif err != nil {\n\t\tt.Errorf(\"SecurityAdvisories.ListGlobalSecurityAdvisories returned error: %v\", err)\n\t}\n\n\tdate := Timestamp{time.Date(1996, time.June, 20, 0, 0, 0, 0, time.UTC)}\n\twant := []*GlobalSecurityAdvisory{\n\t\t{\n\t\t\tID: Ptr(int64(1)),\n\t\t\tSecurityAdvisory: SecurityAdvisory{\n\t\t\t\tGHSAID:      Ptr(\"GHSA-xoxo-1234-xoxo\"),\n\t\t\t\tCVEID:       Ptr(\"CVE-xoxo-1234\"),\n\t\t\t\tURL:         Ptr(\"https://api.github.com/advisories/GHSA-xoxo-1234-xoxo\"),\n\t\t\t\tHTMLURL:     Ptr(\"https://github.com/advisories/GHSA-xoxo-1234-xoxo\"),\n\t\t\t\tSeverity:    Ptr(\"high\"),\n\t\t\t\tSummary:     Ptr(\"Heartbleed security advisory\"),\n\t\t\t\tDescription: Ptr(\"This bug allows an attacker to read portions of the affected server’s memory, potentially disclosing sensitive information.\"),\n\t\t\t\tIdentifiers: []*AdvisoryIdentifier{\n\t\t\t\t\t{\n\t\t\t\t\t\tType:  Ptr(\"GHSA\"),\n\t\t\t\t\t\tValue: Ptr(\"GHSA-xoxo-1234-xoxo\"),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tType:  Ptr(\"CVE\"),\n\t\t\t\t\t\tValue: Ptr(\"CVE-xoxo-1234\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tPublishedAt: &date,\n\t\t\t\tUpdatedAt:   &date,\n\t\t\t\tWithdrawnAt: nil,\n\t\t\t\tCVSS: &AdvisoryCVSS{\n\t\t\t\t\tVectorString: Ptr(\"CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H\"),\n\t\t\t\t\tScore:        Ptr(7.6),\n\t\t\t\t},\n\t\t\t\tCWEs: []*AdvisoryCWEs{\n\t\t\t\t\t{\n\t\t\t\t\t\tCWEID: Ptr(\"CWE-400\"),\n\t\t\t\t\t\tName:  Ptr(\"Uncontrolled Resource Consumption\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tReferences: []string{\"https://nvd.nist.gov/vuln/detail/CVE-xoxo-1234\"},\n\t\t\tVulnerabilities: []*GlobalSecurityVulnerability{\n\t\t\t\t{\n\t\t\t\t\tPackage: &VulnerabilityPackage{\n\t\t\t\t\t\tEcosystem: Ptr(\"npm\"),\n\t\t\t\t\t\tName:      Ptr(\"a-package\"),\n\t\t\t\t\t},\n\t\t\t\t\tFirstPatchedVersion:    Ptr(\"1.0.3\"),\n\t\t\t\t\tVulnerableVersionRange: Ptr(\"<=1.0.2\"),\n\t\t\t\t\tVulnerableFunctions:    []string{\"a_function\"},\n\t\t\t\t},\n\t\t\t},\n\t\t\tRepositoryAdvisoryURL: Ptr(\"https://api.github.com/repos/project/a-package/security-advisories/GHSA-xoxo-1234-xoxo\"),\n\t\t\tType:                  Ptr(\"reviewed\"),\n\t\t\tSourceCodeLocation:    Ptr(\"https://github.com/project/a-package\"),\n\t\t\tGithubReviewedAt:      &date,\n\t\t\tNVDPublishedAt:        &date,\n\t\t\tCredits: []*Credit{\n\t\t\t\t{\n\t\t\t\t\tUser: &User{\n\t\t\t\t\t\tLogin:             Ptr(\"user\"),\n\t\t\t\t\t\tID:                Ptr(int64(1)),\n\t\t\t\t\t\tNodeID:            Ptr(\"12=\"),\n\t\t\t\t\t\tAvatarURL:         Ptr(\"a\"),\n\t\t\t\t\t\tGravatarID:        Ptr(\"\"),\n\t\t\t\t\t\tURL:               Ptr(\"a\"),\n\t\t\t\t\t\tHTMLURL:           Ptr(\"b\"),\n\t\t\t\t\t\tFollowersURL:      Ptr(\"b\"),\n\t\t\t\t\t\tFollowingURL:      Ptr(\"c\"),\n\t\t\t\t\t\tGistsURL:          Ptr(\"d\"),\n\t\t\t\t\t\tStarredURL:        Ptr(\"e\"),\n\t\t\t\t\t\tSubscriptionsURL:  Ptr(\"f\"),\n\t\t\t\t\t\tOrganizationsURL:  Ptr(\"g\"),\n\t\t\t\t\t\tReposURL:          Ptr(\"h\"),\n\t\t\t\t\t\tEventsURL:         Ptr(\"i\"),\n\t\t\t\t\t\tReceivedEventsURL: Ptr(\"j\"),\n\t\t\t\t\t\tType:              Ptr(\"User\"),\n\t\t\t\t\t\tSiteAdmin:         Ptr(false),\n\t\t\t\t\t},\n\t\t\t\t\tType: Ptr(\"analyst\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(advisories, want) {\n\t\tt.Errorf(\"SecurityAdvisories.ListGlobalSecurityAdvisories %+v, want %+v\", advisories, want)\n\t}\n\n\tconst methodName = \"ListGlobalSecurityAdvisories\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\t_, resp, err := client.SecurityAdvisories.ListGlobalSecurityAdvisories(ctx, nil)\n\t\treturn resp, err\n\t})\n}\n\nfunc TestGetGlobalSecurityAdvisories(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/advisories/GHSA-xoxo-1234-xoxo\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 1,\n\t\t\t\"ghsa_id\": \"GHSA-xoxo-1234-xoxo\",\n\t\t\t\"cve_id\": \"CVE-xoxo-1234\",\n\t\t\t\"url\": \"https://api.github.com/advisories/GHSA-xoxo-1234-xoxo\",\n\t\t\t\"html_url\": \"https://github.com/advisories/GHSA-xoxo-1234-xoxo\",\n\t\t\t\"repository_advisory_url\": \"https://api.github.com/repos/project/a-package/security-advisories/GHSA-xoxo-1234-xoxo\",\n\t\t\t\"summary\": \"Heartbleed security advisory\",\n\t\t\t\"description\": \"This bug allows an attacker to read portions of the affected server’s memory, potentially disclosing sensitive information.\",\n\t\t\t\"type\": \"reviewed\",\n\t\t\t\"severity\": \"high\",\n\t\t\t\"source_code_location\": \"https://github.com/project/a-package\",\n\t\t\t\"identifiers\": [\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"GHSA\",\n\t\t\t\t\t\"value\": \"GHSA-xoxo-1234-xoxo\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"type\": \"CVE\",\n\t\t\t\t\t\"value\": \"CVE-xoxo-1234\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"references\": [\"https://nvd.nist.gov/vuln/detail/CVE-xoxo-1234\"],\n\t\t\t\"published_at\": \"1996-06-20T00:00:00Z\",\n\t\t\t\"updated_at\": \"1996-06-20T00:00:00Z\",\n\t\t\t\"github_reviewed_at\": \"1996-06-20T00:00:00Z\",\n\t\t\t\"nvd_published_at\": \"1996-06-20T00:00:00Z\",\n\t\t\t\"withdrawn_at\": null,\n\t\t\t\"vulnerabilities\": [\n\t\t\t\t{\n\t\t\t\t\t\"package\": {\n\t\t\t\t\t\t\"ecosystem\": \"npm\",\n\t\t\t\t\t\t\"name\": \"a-package\"\n\t\t\t\t\t},\n\t\t\t\t\t\"first_patched_version\": \"1.0.3\",\n\t\t\t\t\t\"vulnerable_version_range\": \"<=1.0.2\",\n\t\t\t\t\t\"vulnerable_functions\": [\"a_function\"]\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"cvss\": {\n\t\t\t\t\"vector_string\": \"CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H\",\n\t\t\t\t\"score\": 7.6\n\t\t\t},\n\t\t\t\"cwes\": [\n\t\t\t\t{\n\t\t\t\t\t\"cwe_id\": \"CWE-400\",\n\t\t\t\t\t\"name\": \"Uncontrolled Resource Consumption\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"credits\": [\n\t\t\t\t{\n\t\t\t\t\t\"user\": {\n\t\t\t\t\t\t\"login\": \"user\",\n\t\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\t\"node_id\": \"12=\",\n\t\t\t\t\t\t\"avatar_url\": \"a\",\n\t\t\t\t\t\t\"gravatar_id\": \"\",\n\t\t\t\t\t\t\"url\": \"a\",\n\t\t\t\t\t\t\"html_url\": \"b\",\n\t\t\t\t\t\t\"followers_url\": \"b\",\n\t\t\t\t\t\t\"following_url\": \"c\",\n\t\t\t\t\t\t\"gists_url\": \"d\",\n\t\t\t\t\t\t\"starred_url\": \"e\",\n\t\t\t\t\t\t\"subscriptions_url\": \"f\",\n\t\t\t\t\t\t\"organizations_url\": \"g\",\n\t\t\t\t\t\t\"repos_url\": \"h\",\n\t\t\t\t\t\t\"events_url\": \"i\",\n\t\t\t\t\t\t\"received_events_url\": \"j\",\n\t\t\t\t\t\t\"type\": \"User\",\n\t\t\t\t\t\t\"site_admin\": false\n\t\t\t\t\t},\n\t\t\t\t\t\"type\": \"analyst\"\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tadvisory, _, err := client.SecurityAdvisories.GetGlobalSecurityAdvisories(ctx, \"GHSA-xoxo-1234-xoxo\")\n\tif err != nil {\n\t\tt.Errorf(\"SecurityAdvisories.GetGlobalSecurityAdvisories returned error: %v\", err)\n\t}\n\n\tdate := Timestamp{time.Date(1996, time.June, 20, 0, 0, 0, 0, time.UTC)}\n\twant := &GlobalSecurityAdvisory{\n\t\tID: Ptr(int64(1)),\n\t\tSecurityAdvisory: SecurityAdvisory{\n\t\t\tGHSAID:      Ptr(\"GHSA-xoxo-1234-xoxo\"),\n\t\t\tCVEID:       Ptr(\"CVE-xoxo-1234\"),\n\t\t\tURL:         Ptr(\"https://api.github.com/advisories/GHSA-xoxo-1234-xoxo\"),\n\t\t\tHTMLURL:     Ptr(\"https://github.com/advisories/GHSA-xoxo-1234-xoxo\"),\n\t\t\tSeverity:    Ptr(\"high\"),\n\t\t\tSummary:     Ptr(\"Heartbleed security advisory\"),\n\t\t\tDescription: Ptr(\"This bug allows an attacker to read portions of the affected server’s memory, potentially disclosing sensitive information.\"),\n\t\t\tIdentifiers: []*AdvisoryIdentifier{\n\t\t\t\t{\n\t\t\t\t\tType:  Ptr(\"GHSA\"),\n\t\t\t\t\tValue: Ptr(\"GHSA-xoxo-1234-xoxo\"),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tType:  Ptr(\"CVE\"),\n\t\t\t\t\tValue: Ptr(\"CVE-xoxo-1234\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tPublishedAt: &date,\n\t\t\tUpdatedAt:   &date,\n\t\t\tWithdrawnAt: nil,\n\t\t\tCVSS: &AdvisoryCVSS{\n\t\t\t\tVectorString: Ptr(\"CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H\"),\n\t\t\t\tScore:        Ptr(7.6),\n\t\t\t},\n\t\t\tCWEs: []*AdvisoryCWEs{\n\t\t\t\t{\n\t\t\t\t\tCWEID: Ptr(\"CWE-400\"),\n\t\t\t\t\tName:  Ptr(\"Uncontrolled Resource Consumption\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tRepositoryAdvisoryURL: Ptr(\"https://api.github.com/repos/project/a-package/security-advisories/GHSA-xoxo-1234-xoxo\"),\n\t\tType:                  Ptr(\"reviewed\"),\n\t\tSourceCodeLocation:    Ptr(\"https://github.com/project/a-package\"),\n\t\tReferences:            []string{\"https://nvd.nist.gov/vuln/detail/CVE-xoxo-1234\"},\n\t\tGithubReviewedAt:      &date,\n\t\tNVDPublishedAt:        &date,\n\n\t\tVulnerabilities: []*GlobalSecurityVulnerability{\n\t\t\t{\n\t\t\t\tPackage: &VulnerabilityPackage{\n\t\t\t\t\tEcosystem: Ptr(\"npm\"),\n\t\t\t\t\tName:      Ptr(\"a-package\"),\n\t\t\t\t},\n\t\t\t\tFirstPatchedVersion:    Ptr(\"1.0.3\"),\n\t\t\t\tVulnerableVersionRange: Ptr(\"<=1.0.2\"),\n\t\t\t\tVulnerableFunctions:    []string{\"a_function\"},\n\t\t\t},\n\t\t},\n\t\tCredits: []*Credit{\n\t\t\t{\n\t\t\t\tUser: &User{\n\t\t\t\t\tLogin:             Ptr(\"user\"),\n\t\t\t\t\tID:                Ptr(int64(1)),\n\t\t\t\t\tNodeID:            Ptr(\"12=\"),\n\t\t\t\t\tAvatarURL:         Ptr(\"a\"),\n\t\t\t\t\tGravatarID:        Ptr(\"\"),\n\t\t\t\t\tURL:               Ptr(\"a\"),\n\t\t\t\t\tHTMLURL:           Ptr(\"b\"),\n\t\t\t\t\tFollowersURL:      Ptr(\"b\"),\n\t\t\t\t\tFollowingURL:      Ptr(\"c\"),\n\t\t\t\t\tGistsURL:          Ptr(\"d\"),\n\t\t\t\t\tStarredURL:        Ptr(\"e\"),\n\t\t\t\t\tSubscriptionsURL:  Ptr(\"f\"),\n\t\t\t\t\tOrganizationsURL:  Ptr(\"g\"),\n\t\t\t\t\tReposURL:          Ptr(\"h\"),\n\t\t\t\t\tEventsURL:         Ptr(\"i\"),\n\t\t\t\t\tReceivedEventsURL: Ptr(\"j\"),\n\t\t\t\t\tType:              Ptr(\"User\"),\n\t\t\t\t\tSiteAdmin:         Ptr(false),\n\t\t\t\t},\n\t\t\t\tType: Ptr(\"analyst\"),\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(advisory, want) {\n\t\tt.Errorf(\"SecurityAdvisories.GetGlobalSecurityAdvisories %+v, want %+v\", advisory, want)\n\t}\n\n\tconst methodName = \"GetGlobalSecurityAdvisories\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.SecurityAdvisories.GetGlobalSecurityAdvisories(ctx, \"CVE-\\n-1234\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.SecurityAdvisories.GetGlobalSecurityAdvisories(ctx, \"e\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestSecurityAdvisorySubmission_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SecurityAdvisorySubmission{}, `{}`)\n\n\tu := &SecurityAdvisorySubmission{\n\t\tAccepted: Ptr(true),\n\t}\n\n\tw := `{\n\t\t\"accepted\": true\n\t}`\n\n\ttestJSONMarshal(t, u, w)\n}\n\nfunc TestRepoAdvisoryCredit_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RepoAdvisoryCredit{}, `{}`)\n\n\tu := &RepoAdvisoryCredit{\n\t\tLogin: Ptr(\"l\"),\n\t\tType:  Ptr(\"t\"),\n\t}\n\n\tw := `{\n\t\t\"login\": \"l\",\n\t\t\"type\": \"t\"\n\t}`\n\n\ttestJSONMarshal(t, u, w)\n}\n\nfunc TestRepoAdvisoryCreditDetailed_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &RepoAdvisoryCreditDetailed{}, `{}`)\n\n\ttestDate := &Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)}\n\tu := &RepoAdvisoryCreditDetailed{\n\t\tType:  Ptr(\"t\"),\n\t\tState: Ptr(\"s\"),\n\t\tUser: &User{\n\t\t\tName:                    Ptr(\"u\"),\n\t\t\tCompany:                 Ptr(\"c\"),\n\t\t\tBlog:                    Ptr(\"b\"),\n\t\t\tLocation:                Ptr(\"l\"),\n\t\t\tEmail:                   Ptr(\"e\"),\n\t\t\tHireable:                Ptr(false),\n\t\t\tBio:                     Ptr(\"bio\"),\n\t\t\tTwitterUsername:         Ptr(\"tu\"),\n\t\t\tPublicRepos:             Ptr(1),\n\t\t\tPublicGists:             Ptr(1),\n\t\t\tFollowers:               Ptr(2),\n\t\t\tFollowing:               Ptr(2),\n\t\t\tCreatedAt:               testDate,\n\t\t\tUpdatedAt:               testDate,\n\t\t\tSuspendedAt:             testDate,\n\t\t\tType:                    Ptr(\"type\"),\n\t\t\tSiteAdmin:               Ptr(false),\n\t\t\tTotalPrivateRepos:       Ptr(int64(10)),\n\t\t\tOwnedPrivateRepos:       Ptr(int64(10)),\n\t\t\tPrivateGists:            Ptr(10),\n\t\t\tDiskUsage:               Ptr(10),\n\t\t\tCollaborators:           Ptr(10),\n\t\t\tTwoFactorAuthentication: Ptr(true),\n\t\t\tPlan: &Plan{\n\t\t\t\tName:          Ptr(\"p\"),\n\t\t\t\tSpace:         Ptr(2),\n\t\t\t\tCollaborators: Ptr(2),\n\t\t\t\tPrivateRepos:  Ptr(int64(2)),\n\t\t\t\tSeats:         Ptr(2),\n\t\t\t\tFilledSeats:   Ptr(1),\n\t\t\t},\n\t\t\tLdapDn:            Ptr(\"l\"),\n\t\t\tURL:               Ptr(\"url\"),\n\t\t\tEventsURL:         Ptr(\"e\"),\n\t\t\tFollowingURL:      Ptr(\"f\"),\n\t\t\tFollowersURL:      Ptr(\"f\"),\n\t\t\tGistsURL:          Ptr(\"g\"),\n\t\t\tOrganizationsURL:  Ptr(\"o\"),\n\t\t\tReceivedEventsURL: Ptr(\"r\"),\n\t\t\tReposURL:          Ptr(\"rep\"),\n\t\t\tStarredURL:        Ptr(\"star\"),\n\t\t\tSubscriptionsURL:  Ptr(\"sub\"),\n\t\t\tTextMatches: []*TextMatch{\n\t\t\t\t{\n\t\t\t\t\tObjectURL:  Ptr(\"u\"),\n\t\t\t\t\tObjectType: Ptr(\"t\"),\n\t\t\t\t\tProperty:   Ptr(\"p\"),\n\t\t\t\t\tFragment:   Ptr(\"f\"),\n\t\t\t\t\tMatches: []*Match{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tText:    Ptr(\"t\"),\n\t\t\t\t\t\t\tIndices: []int{1, 2},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tPermissions: &RepositoryPermissions{Pull: Ptr(true)},\n\t\t\tRoleName:    Ptr(\"r\"),\n\t\t},\n\t}\n\n\tw := `{\n\t\t\"type\": \"t\",\n\t\t\"state\": \"s\",\n\t\t\"user\": {\n\t\t  \"name\": \"u\",\n\t\t  \"company\": \"c\",\n\t\t  \"blog\": \"b\",\n\t\t  \"location\": \"l\",\n\t\t  \"email\": \"e\",\n\t\t  \"hireable\": false,\n\t\t  \"bio\": \"bio\",\n\t\t  \"twitter_username\": \"tu\",\n\t\t  \"public_repos\": 1,\n\t\t  \"public_gists\": 1,\n\t\t  \"followers\": 2,\n\t\t  \"following\": 2,\n\t\t  \"created_at\": \"2019-08-10T14:59:22Z\",\n\t\t  \"updated_at\": \"2019-08-10T14:59:22Z\",\n\t\t  \"suspended_at\": \"2019-08-10T14:59:22Z\",\n\t\t  \"type\": \"type\",\n\t\t  \"site_admin\": false,\n\t\t  \"total_private_repos\": 10,\n\t\t  \"owned_private_repos\": 10,\n\t\t  \"private_gists\": 10,\n\t\t  \"disk_usage\": 10,\n\t\t  \"collaborators\": 10,\n\t\t  \"two_factor_authentication\": true,\n\t\t  \"plan\": {\n\t\t\t\"name\": \"p\",\n\t\t\t\"space\": 2,\n\t\t\t\"collaborators\": 2,\n\t\t\t\"private_repos\": 2,\n\t\t\t\"seats\": 2,\n\t\t\t\"filled_seats\": 1\n\t\t  },\n\t\t  \"ldap_dn\": \"l\",\n\t\t  \"url\": \"url\",\n\t\t  \"events_url\": \"e\",\n\t\t  \"following_url\": \"f\",\n\t\t  \"followers_url\": \"f\",\n\t\t  \"gists_url\": \"g\",\n\t\t  \"organizations_url\": \"o\",\n\t\t  \"received_events_url\": \"r\",\n\t\t  \"repos_url\": \"rep\",\n\t\t  \"starred_url\": \"star\",\n\t\t  \"subscriptions_url\": \"sub\",\n\t\t  \"text_matches\": [\n\t\t\t{\n\t\t\t  \"object_url\": \"u\",\n\t\t\t  \"object_type\": \"t\",\n\t\t\t  \"property\": \"p\",\n\t\t\t  \"fragment\": \"f\",\n\t\t\t  \"matches\": [\n\t\t\t\t{\n\t\t\t\t  \"text\": \"t\",\n\t\t\t\t  \"indices\": [1, 2]\n\t\t\t\t}\n\t\t\t  ]\n\t\t\t}\n\t\t  ],\n\t\t  \"permissions\": {\n\t\t\t\"pull\": true\n\t\t  },\n\t\t  \"role_name\": \"r\"\n\t\t}\n\t  }`\n\n\ttestJSONMarshal(t, u, w)\n}\n\nfunc TestCredit_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Credit{}, `{}`)\n\n\ttestDate := &Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)}\n\tu := &Credit{\n\t\tType: Ptr(\"t\"),\n\t\tUser: &User{\n\t\t\tName:                    Ptr(\"u\"),\n\t\t\tCompany:                 Ptr(\"c\"),\n\t\t\tBlog:                    Ptr(\"b\"),\n\t\t\tLocation:                Ptr(\"l\"),\n\t\t\tEmail:                   Ptr(\"e\"),\n\t\t\tHireable:                Ptr(false),\n\t\t\tBio:                     Ptr(\"bio\"),\n\t\t\tTwitterUsername:         Ptr(\"tu\"),\n\t\t\tPublicRepos:             Ptr(1),\n\t\t\tPublicGists:             Ptr(1),\n\t\t\tFollowers:               Ptr(2),\n\t\t\tFollowing:               Ptr(2),\n\t\t\tCreatedAt:               testDate,\n\t\t\tUpdatedAt:               testDate,\n\t\t\tSuspendedAt:             testDate,\n\t\t\tType:                    Ptr(\"type\"),\n\t\t\tSiteAdmin:               Ptr(false),\n\t\t\tTotalPrivateRepos:       Ptr(int64(10)),\n\t\t\tOwnedPrivateRepos:       Ptr(int64(10)),\n\t\t\tPrivateGists:            Ptr(10),\n\t\t\tDiskUsage:               Ptr(10),\n\t\t\tCollaborators:           Ptr(10),\n\t\t\tTwoFactorAuthentication: Ptr(true),\n\t\t\tPlan: &Plan{\n\t\t\t\tName:          Ptr(\"p\"),\n\t\t\t\tSpace:         Ptr(2),\n\t\t\t\tCollaborators: Ptr(2),\n\t\t\t\tPrivateRepos:  Ptr(int64(2)),\n\t\t\t\tSeats:         Ptr(2),\n\t\t\t\tFilledSeats:   Ptr(1),\n\t\t\t},\n\t\t\tLdapDn:            Ptr(\"l\"),\n\t\t\tURL:               Ptr(\"url\"),\n\t\t\tEventsURL:         Ptr(\"e\"),\n\t\t\tFollowingURL:      Ptr(\"f\"),\n\t\t\tFollowersURL:      Ptr(\"f\"),\n\t\t\tGistsURL:          Ptr(\"g\"),\n\t\t\tOrganizationsURL:  Ptr(\"o\"),\n\t\t\tReceivedEventsURL: Ptr(\"r\"),\n\t\t\tReposURL:          Ptr(\"rep\"),\n\t\t\tStarredURL:        Ptr(\"star\"),\n\t\t\tSubscriptionsURL:  Ptr(\"sub\"),\n\t\t\tTextMatches: []*TextMatch{\n\t\t\t\t{\n\t\t\t\t\tObjectURL:  Ptr(\"u\"),\n\t\t\t\t\tObjectType: Ptr(\"t\"),\n\t\t\t\t\tProperty:   Ptr(\"p\"),\n\t\t\t\t\tFragment:   Ptr(\"f\"),\n\t\t\t\t\tMatches: []*Match{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tText:    Ptr(\"t\"),\n\t\t\t\t\t\t\tIndices: []int{1, 2},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tPermissions: &RepositoryPermissions{Pull: Ptr(true)},\n\t\t\tRoleName:    Ptr(\"r\"),\n\t\t},\n\t}\n\n\tw := `{\n\t\t\"type\": \"t\",\n\t\t\"user\": {\n\t\t\t\"name\": \"u\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\",\n\t\t\t\"hireable\": false,\n\t\t\t\"bio\": \"bio\",\n\t\t\t\"twitter_username\": \"tu\",\n\t\t\t\"public_repos\": 1,\n\t\t\t\"public_gists\": 1,\n\t\t\t\"followers\": 2,\n\t\t\t\"following\": 2,\n\t\t\t\"created_at\": \"2019-08-10T14:59:22Z\",\n\t\t\t\"updated_at\": \"2019-08-10T14:59:22Z\",\n\t\t\t\"suspended_at\": \"2019-08-10T14:59:22Z\",\n\t\t\t\"type\": \"type\",\n\t\t\t\"site_admin\": false,\n\t\t\t\"total_private_repos\": 10,\n\t\t\t\"owned_private_repos\": 10,\n\t\t\t\"private_gists\": 10,\n\t\t\t\"disk_usage\": 10,\n\t\t\t\"collaborators\": 10,\n\t\t\t\"two_factor_authentication\": true,\n\t\t\t\"plan\": {\n\t\t\t\"name\": \"p\",\n\t\t\t\"space\": 2,\n\t\t\t\"collaborators\": 2,\n\t\t\t\"private_repos\": 2,\n\t\t\t\"seats\": 2,\n\t\t\t\"filled_seats\": 1\n\t\t\t},\n\t\t\t\"ldap_dn\": \"l\",\n\t\t\t\"url\": \"url\",\n\t\t\t\"events_url\": \"e\",\n\t\t\t\"following_url\": \"f\",\n\t\t\t\"followers_url\": \"f\",\n\t\t\t\"gists_url\": \"g\",\n\t\t\t\"organizations_url\": \"o\",\n\t\t\t\"received_events_url\": \"r\",\n\t\t\t\"repos_url\": \"rep\",\n\t\t\t\"starred_url\": \"star\",\n\t\t\t\"subscriptions_url\": \"sub\",\n\t\t\t\"text_matches\": [\n\t\t\t{\n\t\t\t\t\"object_url\": \"u\",\n\t\t\t\t\"object_type\": \"t\",\n\t\t\t\t\"property\": \"p\",\n\t\t\t\t\"fragment\": \"f\",\n\t\t\t\t\"matches\": [\n\t\t\t\t{\n\t\t\t\t\t\"text\": \"t\",\n\t\t\t\t\t\"indices\": [1, 2]\n\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t\t],\n\t\t\t\"permissions\": {\n\t\t\t\"pull\": true\n\t\t\t},\n\t\t\t\"role_name\": \"r\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, w)\n}\n\nfunc TestGlobalSecurityAdvisory_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &GlobalSecurityAdvisory{}, `{}`)\n\n\ttestDate := &Timestamp{time.Date(2019, time.August, 10, 14, 59, 22, 0, time.UTC)}\n\tu := &GlobalSecurityAdvisory{\n\t\tID:                    Ptr(int64(1)),\n\t\tRepositoryAdvisoryURL: Ptr(\"r\"),\n\t\tType:                  Ptr(\"t\"),\n\t\tSourceCodeLocation:    Ptr(\"s\"),\n\t\tReferences:            []string{\"r\"},\n\t\tVulnerabilities: []*GlobalSecurityVulnerability{\n\t\t\t{\n\t\t\t\tPackage: &VulnerabilityPackage{\n\t\t\t\t\tEcosystem: Ptr(\"npm\"),\n\t\t\t\t\tName:      Ptr(\"a-package\"),\n\t\t\t\t},\n\t\t\t\tFirstPatchedVersion:    Ptr(\"1.0.3\"),\n\t\t\t\tVulnerableVersionRange: Ptr(\"<=1.0.2\"),\n\t\t\t\tVulnerableFunctions:    []string{\"a_function\"},\n\t\t\t},\n\t\t},\n\t\tGithubReviewedAt: testDate,\n\t\tNVDPublishedAt:   testDate,\n\t\tCredits: []*Credit{\n\t\t\t{\n\t\t\t\tType: Ptr(\"t\"),\n\t\t\t\tUser: &User{\n\t\t\t\t\tName:                    Ptr(\"u\"),\n\t\t\t\t\tCompany:                 Ptr(\"c\"),\n\t\t\t\t\tBlog:                    Ptr(\"b\"),\n\t\t\t\t\tLocation:                Ptr(\"l\"),\n\t\t\t\t\tEmail:                   Ptr(\"e\"),\n\t\t\t\t\tHireable:                Ptr(false),\n\t\t\t\t\tBio:                     Ptr(\"bio\"),\n\t\t\t\t\tTwitterUsername:         Ptr(\"tu\"),\n\t\t\t\t\tPublicRepos:             Ptr(1),\n\t\t\t\t\tPublicGists:             Ptr(1),\n\t\t\t\t\tFollowers:               Ptr(2),\n\t\t\t\t\tFollowing:               Ptr(2),\n\t\t\t\t\tCreatedAt:               testDate,\n\t\t\t\t\tUpdatedAt:               testDate,\n\t\t\t\t\tSuspendedAt:             testDate,\n\t\t\t\t\tType:                    Ptr(\"type\"),\n\t\t\t\t\tSiteAdmin:               Ptr(false),\n\t\t\t\t\tTotalPrivateRepos:       Ptr(int64(10)),\n\t\t\t\t\tOwnedPrivateRepos:       Ptr(int64(10)),\n\t\t\t\t\tPrivateGists:            Ptr(10),\n\t\t\t\t\tDiskUsage:               Ptr(10),\n\t\t\t\t\tCollaborators:           Ptr(10),\n\t\t\t\t\tTwoFactorAuthentication: Ptr(true),\n\t\t\t\t\tPlan: &Plan{\n\t\t\t\t\t\tName:          Ptr(\"p\"),\n\t\t\t\t\t\tSpace:         Ptr(2),\n\t\t\t\t\t\tCollaborators: Ptr(2),\n\t\t\t\t\t\tPrivateRepos:  Ptr(int64(2)),\n\t\t\t\t\t\tSeats:         Ptr(2),\n\t\t\t\t\t\tFilledSeats:   Ptr(1),\n\t\t\t\t\t},\n\t\t\t\t\tLdapDn:            Ptr(\"l\"),\n\t\t\t\t\tURL:               Ptr(\"url\"),\n\t\t\t\t\tEventsURL:         Ptr(\"e\"),\n\t\t\t\t\tFollowingURL:      Ptr(\"f\"),\n\t\t\t\t\tFollowersURL:      Ptr(\"f\"),\n\t\t\t\t\tGistsURL:          Ptr(\"g\"),\n\t\t\t\t\tOrganizationsURL:  Ptr(\"o\"),\n\t\t\t\t\tReceivedEventsURL: Ptr(\"r\"),\n\t\t\t\t\tReposURL:          Ptr(\"rep\"),\n\t\t\t\t\tStarredURL:        Ptr(\"star\"),\n\t\t\t\t\tSubscriptionsURL:  Ptr(\"sub\"),\n\t\t\t\t\tTextMatches: []*TextMatch{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tObjectURL:  Ptr(\"u\"),\n\t\t\t\t\t\t\tObjectType: Ptr(\"t\"),\n\t\t\t\t\t\t\tProperty:   Ptr(\"p\"),\n\t\t\t\t\t\t\tFragment:   Ptr(\"f\"),\n\t\t\t\t\t\t\tMatches: []*Match{\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tText:    Ptr(\"t\"),\n\t\t\t\t\t\t\t\t\tIndices: []int{1, 2},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tPermissions: &RepositoryPermissions{Pull: Ptr(true)},\n\t\t\t\t\tRoleName:    Ptr(\"r\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tSecurityAdvisory: SecurityAdvisory{\n\t\t\tGHSAID:      Ptr(\"GHSA-xoxo-1234-xoxo\"),\n\t\t\tCVEID:       Ptr(\"CVE-xoxo-1234\"),\n\t\t\tURL:         Ptr(\"https://api.github.com/advisories/GHSA-xoxo-1234-xoxo\"),\n\t\t\tHTMLURL:     Ptr(\"https://github.com/advisories/GHSA-xoxo-1234-xoxo\"),\n\t\t\tSeverity:    Ptr(\"high\"),\n\t\t\tSummary:     Ptr(\"Heartbleed security advisory\"),\n\t\t\tDescription: Ptr(\"This bug allows an attacker to read portions of the affected server’s memory, potentially disclosing sensitive information.\"),\n\t\t\tIdentifiers: []*AdvisoryIdentifier{\n\t\t\t\t{\n\t\t\t\t\tType:  Ptr(\"GHSA\"),\n\t\t\t\t\tValue: Ptr(\"GHSA-xoxo-1234-xoxo\"),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tType:  Ptr(\"CVE\"),\n\t\t\t\t\tValue: Ptr(\"CVE-xoxo-1234\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tPublishedAt: testDate,\n\t\t\tUpdatedAt:   testDate,\n\t\t\tWithdrawnAt: nil,\n\t\t\tCVSS: &AdvisoryCVSS{\n\t\t\t\tVectorString: Ptr(\"CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H\"),\n\t\t\t\tScore:        Ptr(7.6),\n\t\t\t},\n\t\t\tCWEs: []*AdvisoryCWEs{\n\t\t\t\t{\n\t\t\t\t\tCWEID: Ptr(\"CWE-400\"),\n\t\t\t\t\tName:  Ptr(\"Uncontrolled Resource Consumption\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tw := `{\n\t\t\"cvss\": {\n\t\t  \"score\": 7.6,\n\t\t  \"vector_string\": \"CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H\"\n\t\t},\n\t\t\"cwes\": [\n\t\t  {\n\t\t\t\"cwe_id\": \"CWE-400\",\n\t\t\t\"name\": \"Uncontrolled Resource Consumption\"\n\t\t  }\n\t\t],\n\t\t\"ghsa_id\": \"GHSA-xoxo-1234-xoxo\",\n\t\t\"summary\": \"Heartbleed security advisory\",\n\t\t\"description\": \"This bug allows an attacker to read portions of the affected server’s memory, potentially disclosing sensitive information.\",\n\t\t\"severity\": \"high\",\n\t\t\"identifiers\": [\n\t\t  {\n\t\t\t\"value\": \"GHSA-xoxo-1234-xoxo\",\n\t\t\t\"type\": \"GHSA\"\n\t\t  },\n\t\t  {\n\t\t\t\"value\": \"CVE-xoxo-1234\",\n\t\t\t\"type\": \"CVE\"\n\t\t  }\n\t\t],\n\t\t\"published_at\": \"2019-08-10T14:59:22Z\",\n\t\t\"updated_at\": \"2019-08-10T14:59:22Z\",\n\t\t\"cve_id\": \"CVE-xoxo-1234\",\n\t\t\"url\": \"https://api.github.com/advisories/GHSA-xoxo-1234-xoxo\",\n\t\t\"html_url\": \"https://github.com/advisories/GHSA-xoxo-1234-xoxo\",\n\t\t\"id\": 1,\n\t\t\"repository_advisory_url\": \"r\",\n\t\t\"type\": \"t\",\n\t\t\"source_code_location\": \"s\",\n\t\t\"references\": [\n\t\t  \"r\"\n\t\t],\n\t\t\"vulnerabilities\": [\n\t\t  {\n\t\t\t\"package\": {\n\t\t\t  \"ecosystem\": \"npm\",\n\t\t\t  \"name\": \"a-package\"\n\t\t\t},\n\t\t\t\"first_patched_version\": \"1.0.3\",\n\t\t\t\"vulnerable_version_range\": \"\\u003c=1.0.2\",\n\t\t\t\"vulnerable_functions\": [\n\t\t\t  \"a_function\"\n\t\t\t]\n\t\t  }\n\t\t],\n\t\t\"github_reviewed_at\": \"2019-08-10T14:59:22Z\",\n\t\t\"nvd_published_at\": \"2019-08-10T14:59:22Z\",\n\t\t\"credits\": [\n\t\t  {\n\t\t\t\"user\": {\n\t\t\t  \"name\": \"u\",\n\t\t\t  \"company\": \"c\",\n\t\t\t  \"blog\": \"b\",\n\t\t\t  \"location\": \"l\",\n\t\t\t  \"email\": \"e\",\n\t\t\t  \"hireable\": false,\n\t\t\t  \"bio\": \"bio\",\n\t\t\t  \"twitter_username\": \"tu\",\n\t\t\t  \"public_repos\": 1,\n\t\t\t  \"public_gists\": 1,\n\t\t\t  \"followers\": 2,\n\t\t\t  \"following\": 2,\n\t\t\t  \"created_at\": \"2019-08-10T14:59:22Z\",\n\t\t\t  \"updated_at\": \"2019-08-10T14:59:22Z\",\n\t\t\t  \"suspended_at\": \"2019-08-10T14:59:22Z\",\n\t\t\t  \"type\": \"type\",\n\t\t\t  \"site_admin\": false,\n\t\t\t  \"total_private_repos\": 10,\n\t\t\t  \"owned_private_repos\": 10,\n\t\t\t  \"private_gists\": 10,\n\t\t\t  \"disk_usage\": 10,\n\t\t\t  \"collaborators\": 10,\n\t\t\t  \"two_factor_authentication\": true,\n\t\t\t  \"plan\": {\n\t\t\t\t\"name\": \"p\",\n\t\t\t\t\"space\": 2,\n\t\t\t\t\"collaborators\": 2,\n\t\t\t\t\"private_repos\": 2,\n\t\t\t\t\"filled_seats\": 1,\n\t\t\t\t\"seats\": 2\n\t\t\t  },\n\t\t\t  \"ldap_dn\": \"l\",\n\t\t\t  \"url\": \"url\",\n\t\t\t  \"events_url\": \"e\",\n\t\t\t  \"following_url\": \"f\",\n\t\t\t  \"followers_url\": \"f\",\n\t\t\t  \"gists_url\": \"g\",\n\t\t\t  \"organizations_url\": \"o\",\n\t\t\t  \"received_events_url\": \"r\",\n\t\t\t  \"repos_url\": \"rep\",\n\t\t\t  \"starred_url\": \"star\",\n\t\t\t  \"subscriptions_url\": \"sub\",\n\t\t\t  \"text_matches\": [\n\t\t\t\t{\n\t\t\t\t  \"object_url\": \"u\",\n\t\t\t\t  \"object_type\": \"t\",\n\t\t\t\t  \"property\": \"p\",\n\t\t\t\t  \"fragment\": \"f\",\n\t\t\t\t  \"matches\": [\n\t\t\t\t\t{\n\t\t\t\t\t  \"text\": \"t\",\n\t\t\t\t\t  \"indices\": [\n\t\t\t\t\t\t1,\n\t\t\t\t\t\t2\n\t\t\t\t\t  ]\n\t\t\t\t\t}\n\t\t\t\t  ]\n\t\t\t\t}\n\t\t\t  ],\n\t\t\t  \"permissions\": {\n\t\t\t\t\"pull\": true\n\t\t\t  },\n\t\t\t  \"role_name\": \"r\"\n\t\t\t},\n\t\t\t\"type\": \"t\"\n\t\t  }\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, w)\n}\n"
  },
  {
    "path": "github/strings.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"sync\"\n)\n\nvar timestampType = reflect.TypeFor[Timestamp]()\n\nvar bufferPool = sync.Pool{\n\tNew: func() any {\n\t\treturn new(bytes.Buffer)\n\t},\n}\n\n// Stringify attempts to create a reasonable string representation of types in\n// the GitHub library. It does things like resolve pointers to their values\n// and omits struct fields with nil values.\nfunc Stringify(message any) string {\n\tbuf := bufferPool.Get().(*bytes.Buffer)\n\tdefer func() {\n\t\tbuf.Reset()\n\t\tbufferPool.Put(buf)\n\t}()\n\n\tv := reflect.ValueOf(message)\n\tstringifyValue(buf, v)\n\treturn buf.String()\n}\n\n// stringifyValue was heavily inspired by the goprotobuf library.\n\nfunc stringifyValue(w *bytes.Buffer, val reflect.Value) {\n\tif val.Kind() == reflect.Pointer && val.IsNil() {\n\t\tw.WriteString(\"<nil>\")\n\t\treturn\n\t}\n\n\tv := reflect.Indirect(val)\n\n\tswitch v.Kind() {\n\tcase reflect.Bool:\n\t\tw.Write(strconv.AppendBool(w.Bytes(), v.Bool())[w.Len():])\n\tcase reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:\n\t\tw.Write(strconv.AppendInt(w.Bytes(), v.Int(), 10)[w.Len():])\n\tcase reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:\n\t\tw.Write(strconv.AppendUint(w.Bytes(), v.Uint(), 10)[w.Len():])\n\tcase reflect.Float32:\n\t\tw.Write(strconv.AppendFloat(w.Bytes(), v.Float(), 'g', -1, 32)[w.Len():])\n\tcase reflect.Float64:\n\t\tw.Write(strconv.AppendFloat(w.Bytes(), v.Float(), 'g', -1, 64)[w.Len():])\n\tcase reflect.String:\n\t\tw.WriteByte('\"')\n\t\tw.WriteString(v.String())\n\t\tw.WriteByte('\"')\n\tcase reflect.Slice:\n\t\tw.WriteByte('[')\n\t\tfor i := range v.Len() {\n\t\t\tif i > 0 {\n\t\t\t\tw.WriteByte(' ')\n\t\t\t}\n\n\t\t\tstringifyValue(w, v.Index(i))\n\t\t}\n\n\t\tw.WriteByte(']')\n\t\treturn\n\tcase reflect.Struct:\n\t\tif v.Type().Name() != \"\" {\n\t\t\tw.WriteString(v.Type().String())\n\t\t}\n\n\t\t// special handling of Timestamp values\n\t\tif v.Type() == timestampType {\n\t\t\tfmt.Fprintf(w, \"{%v}\", v.Interface())\n\t\t\treturn\n\t\t}\n\n\t\tw.WriteByte('{')\n\n\t\tvar sep bool\n\t\tfor i := range v.NumField() {\n\t\t\tfv := v.Field(i)\n\t\t\tif fv.Kind() == reflect.Pointer && fv.IsNil() {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif fv.Kind() == reflect.Slice && fv.IsNil() {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif fv.Kind() == reflect.Map && fv.IsNil() {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif sep {\n\t\t\t\tw.WriteString(\", \")\n\t\t\t} else {\n\t\t\t\tsep = true\n\t\t\t}\n\n\t\t\tw.WriteString(v.Type().Field(i).Name)\n\t\t\tw.WriteByte(':')\n\t\t\tstringifyValue(w, fv)\n\t\t}\n\n\t\tw.WriteByte('}')\n\tdefault:\n\t\tif v.CanInterface() {\n\t\t\tfmt.Fprint(w, v.Interface())\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "github/strings_benchmark_test.go",
    "content": "// Copyright 2026 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"testing\"\n)\n\ntype BenchmarkStruct struct {\n\tName    string\n\tAge     int\n\tActive  bool\n\tScore   float32\n\tRank    float64\n\tTags    []string\n\tPointer *int\n}\n\nfunc BenchmarkStringify(b *testing.B) {\n\tval := 42\n\ts := &BenchmarkStruct{\n\t\tName:    \"benchmark\",\n\t\tAge:     30,\n\t\tActive:  true,\n\t\tScore:   1.1,\n\t\tRank:    99.999999,\n\t\tTags:    []string{\"go\", \"github\", \"api\"},\n\t\tPointer: Ptr(val),\n\t}\n\tb.ResetTimer()\n\tfor b.Loop() {\n\t\tStringify(s)\n\t}\n}\n"
  },
  {
    "path": "github/strings_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestStringify(t *testing.T) {\n\tt.Parallel()\n\tvar nilPointer *string\n\n\ttests := []struct {\n\t\tin  any\n\t\tout string\n\t}{\n\t\t// basic types\n\t\t{\"foo\", `\"foo\"`},\n\t\t{123, `123`},\n\t\t{1.5, `1.5`},\n\t\t{false, `false`},\n\t\t{\n\t\t\t[]string{\"a\", \"b\"},\n\t\t\t`[\"a\" \"b\"]`,\n\t\t},\n\t\t{\n\t\t\tstruct {\n\t\t\t\tA []string\n\t\t\t}{nil},\n\t\t\t// nil slice is skipped\n\t\t\t`{}`,\n\t\t},\n\t\t{\n\t\t\tstruct {\n\t\t\t\tA string\n\t\t\t}{\"foo\"},\n\t\t\t// structs not of a named type get no prefix\n\t\t\t`{A:\"foo\"}`,\n\t\t},\n\n\t\t// pointers\n\t\t{nilPointer, `<nil>`},\n\t\t{Ptr(\"foo\"), `\"foo\"`},\n\t\t{Ptr(123), `123`},\n\t\t{Ptr(false), `false`},\n\t\t{\n\t\t\t//nolint:sliceofpointers\n\t\t\t[]*string{Ptr(\"a\"), Ptr(\"b\")},\n\t\t\t`[\"a\" \"b\"]`,\n\t\t},\n\n\t\t// actual GitHub structs\n\t\t{\n\t\t\tTimestamp{time.Date(2006, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t\t\t`github.Timestamp{2006-01-02 15:04:05 +0000 UTC}`,\n\t\t},\n\t\t{\n\t\t\t&Timestamp{time.Date(2006, time.January, 2, 15, 4, 5, 0, time.UTC)},\n\t\t\t`github.Timestamp{2006-01-02 15:04:05 +0000 UTC}`,\n\t\t},\n\t\t{\n\t\t\tUser{ID: Ptr(int64(123)), Name: Ptr(\"n\")},\n\t\t\t`github.User{ID:123, Name:\"n\"}`,\n\t\t},\n\t\t{\n\t\t\tRepository{Owner: &User{ID: Ptr(int64(123))}},\n\t\t\t`github.Repository{Owner:github.User{ID:123}}`,\n\t\t},\n\t}\n\n\tfor i, tt := range tests {\n\t\ts := Stringify(tt.in)\n\t\tif s != tt.out {\n\t\t\tt.Errorf(\"%v. Stringify(%q) => %q, want %q\", i, tt.in, s, tt.out)\n\t\t}\n\t}\n}\n\nfunc TestStringify_Primitives(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tin  any\n\t\tout string\n\t}{\n\t\t// Bool\n\t\t{true, \"true\"},\n\t\t{false, \"false\"},\n\n\t\t// Int variants\n\t\t{int(1), \"1\"},\n\t\t{int8(2), \"2\"},\n\t\t{int16(3), \"3\"},\n\t\t{int32(4), \"4\"},\n\t\t{int64(5), \"5\"},\n\n\t\t// Uint variants\n\t\t{uint(6), \"6\"},\n\t\t{uint8(7), \"7\"},\n\t\t{uint16(8), \"8\"},\n\t\t{uint32(9), \"9\"},\n\t\t{uint64(10), \"10\"},\n\t\t{uintptr(11), \"11\"},\n\n\t\t// Float variants (Precision Correctness)\n\t\t{float32(1.1), \"1.1\"},\n\t\t{float64(1.1), \"1.1\"},\n\t\t{float32(1.0000001), \"1.0000001\"},\n\t\t{float64(1.000000000000001), \"1.000000000000001\"},\n\n\t\t// Boundary Cases\n\t\t{int8(-128), \"-128\"},\n\t\t{int8(127), \"127\"},\n\t\t{uint64(18446744073709551615), \"18446744073709551615\"},\n\n\t\t// String Optimization\n\t\t{\"hello\", `\"hello\"`},\n\t\t{\"\", `\"\"`},\n\t}\n\n\tfor i, tt := range tests {\n\t\ts := Stringify(tt.in)\n\t\tif s != tt.out {\n\t\t\tt.Errorf(\"%v. Stringify(%T) => %q, want %q\", i, tt.in, s, tt.out)\n\t\t}\n\t}\n}\n\nfunc TestStringify_BufferPool(t *testing.T) {\n\tt.Parallel()\n\t// Verify that concurrent usage of Stringify is safe and doesn't corrupt buffers.\n\t// While we can't easily verify reuse without exposing internal metrics,\n\t// we can verify correctness under load which implies proper Reset() handling.\n\tconst goroutines = 10\n\tconst iterations = 100\n\n\terrCh := make(chan error, goroutines)\n\n\tfor range goroutines {\n\t\tgo func() {\n\t\t\tfor range iterations {\n\t\t\t\t// Use a mix of types to exercise different code paths\n\t\t\t\ts1 := Stringify(123)\n\t\t\t\tif s1 != \"123\" {\n\t\t\t\t\terrCh <- fmt.Errorf(\"got %q, want %q\", s1, \"123\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\ts2 := Stringify(\"test\")\n\t\t\t\tif s2 != `\"test\"` {\n\t\t\t\t\terrCh <- fmt.Errorf(\"got %q, want %q\", s2, `\"test\"`)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\terrCh <- nil\n\t\t}()\n\t}\n\n\tfor range goroutines {\n\t\tif err := <-errCh; err != nil {\n\t\t\tt.Error(err)\n\t\t}\n\t}\n}\n\n// Directly test the String() methods on various GitHub types. We don't do an\n// exhaustive test of all the various field types, since TestStringify() above\n// takes care of that. Rather, we just make sure that Stringify() is being\n// used to build the strings, which we do by verifying that pointers are\n// stringified as their underlying value.\nfunc TestString(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tin  any\n\t\tout string\n\t}{\n\t\t{CodeResult{Name: Ptr(\"n\")}, `github.CodeResult{Name:\"n\"}`},\n\t\t{CommitAuthor{Name: Ptr(\"n\")}, `github.CommitAuthor{Name:\"n\"}`},\n\t\t{CommitFile{SHA: Ptr(\"s\")}, `github.CommitFile{SHA:\"s\"}`},\n\t\t{CommitStats{Total: Ptr(1)}, `github.CommitStats{Total:1}`},\n\t\t{CommitsComparison{TotalCommits: Ptr(1)}, `github.CommitsComparison{TotalCommits:1}`},\n\t\t{Commit{SHA: Ptr(\"s\")}, `github.Commit{SHA:\"s\"}`},\n\t\t{Event{ID: Ptr(\"1\")}, `github.Event{ID:\"1\"}`},\n\t\t{GistComment{ID: Ptr(int64(1))}, `github.GistComment{ID:1}`},\n\t\t{GistFile{Size: Ptr(1)}, `github.GistFile{Size:1}`},\n\t\t{Gist{ID: Ptr(\"1\")}, `github.Gist{ID:\"1\"}`},\n\t\t{GitObject{SHA: Ptr(\"s\")}, `github.GitObject{SHA:\"s\"}`},\n\t\t{Gitignore{Name: Ptr(\"n\")}, `github.Gitignore{Name:\"n\"}`},\n\t\t{Hook{ID: Ptr(int64(1))}, `github.Hook{ID:1}`},\n\t\t{IssueComment{ID: Ptr(int64(1))}, `github.IssueComment{ID:1}`},\n\t\t{Issue{Number: Ptr(1)}, `github.Issue{Number:1}`},\n\t\t{SubIssue{ID: Ptr(int64(1))}, `github.SubIssue{ID:1}`},\n\t\t{Key{ID: Ptr(int64(1))}, `github.Key{ID:1}`},\n\t\t{Label{ID: Ptr(int64(1)), Name: Ptr(\"l\")}, `github.Label{ID:1, Name:\"l\"}`},\n\t\t{Organization{ID: Ptr(int64(1))}, `github.Organization{ID:1}`},\n\t\t{PullRequestComment{ID: Ptr(int64(1))}, `github.PullRequestComment{ID:1}`},\n\t\t{PullRequest{Number: Ptr(1)}, `github.PullRequest{Number:1}`},\n\t\t{PullRequestReview{ID: Ptr(int64(1))}, `github.PullRequestReview{ID:1}`},\n\t\t{DraftReviewComment{Position: Ptr(1)}, `github.DraftReviewComment{Position:1}`},\n\t\t{PullRequestReviewRequest{Body: Ptr(\"r\")}, `github.PullRequestReviewRequest{Body:\"r\"}`},\n\t\t{PullRequestReviewDismissalRequest{Message: Ptr(\"r\")}, `github.PullRequestReviewDismissalRequest{Message:\"r\"}`},\n\t\t{HeadCommit{SHA: Ptr(\"s\")}, `github.HeadCommit{SHA:\"s\"}`},\n\t\t{PushEvent{PushID: Ptr(int64(1))}, `github.PushEvent{PushID:1}`},\n\t\t{Reference{Ref: Ptr(\"r\")}, `github.Reference{Ref:\"r\"}`},\n\t\t{ReleaseAsset{ID: Ptr(int64(1))}, `github.ReleaseAsset{ID:1}`},\n\t\t{RepoStatus{ID: Ptr(int64(1))}, `github.RepoStatus{ID:1}`},\n\t\t{RepositoryComment{ID: Ptr(int64(1))}, `github.RepositoryComment{ID:1}`},\n\t\t{RepositoryCommit{SHA: Ptr(\"s\")}, `github.RepositoryCommit{SHA:\"s\"}`},\n\t\t{RepositoryContent{Name: Ptr(\"n\")}, `github.RepositoryContent{Name:\"n\"}`},\n\t\t{RepositoryRelease{ID: Ptr(int64(1))}, `github.RepositoryRelease{ID:1}`},\n\t\t{Repository{ID: Ptr(int64(1))}, `github.Repository{ID:1}`},\n\t\t{Team{ID: Ptr(int64(1))}, `github.Team{ID:1}`},\n\t\t{TreeEntry{SHA: Ptr(\"s\")}, `github.TreeEntry{SHA:\"s\"}`},\n\t\t{Tree{SHA: Ptr(\"s\")}, `github.Tree{SHA:\"s\"}`},\n\t\t{User{ID: Ptr(int64(1))}, `github.User{ID:1}`},\n\t\t{WebHookAuthor{Name: Ptr(\"n\")}, `github.CommitAuthor{Name:\"n\"}`},\n\t\t{WebHookCommit{ID: Ptr(\"1\")}, `github.HeadCommit{ID:\"1\"}`},\n\t\t{WebHookPayload{Ref: Ptr(\"r\")}, `github.PushEvent{Ref:\"r\"}`},\n\t}\n\n\tfor i, tt := range tests {\n\t\ts := tt.in.(fmt.Stringer).String()\n\t\tif s != tt.out {\n\t\t\tt.Errorf(\"%v. String() => %q, want %q\", i, tt.in, tt.out)\n\t\t}\n\t}\n}\n\nfunc TestStringify_Floats(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tin  any\n\t\tout string\n\t}{\n\t\t{float32(1.1), \"1.1\"},\n\t\t{float64(1.1), \"1.1\"},\n\t\t{float32(1.0000001), \"1.0000001\"},\n\t\t{struct{ F float32 }{1.1}, \"{F:1.1}\"},\n\t}\n\n\tfor i, tt := range tests {\n\t\ts := Stringify(tt.in)\n\t\tif s != tt.out {\n\t\t\tt.Errorf(\"%v. Stringify(%v) = %q, want %q\", i, tt.in, s, tt.out)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "github/sub_issue.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// SubIssueService handles communication with the sub-issue related\n// methods of the GitHub API.\n//\n// Sub-issues help you group and manage your issues with a parent/child relationship.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/sub-issues\ntype SubIssueService service\n\n// SubIssue represents a GitHub sub-issue on a repository.\n// Note: As far as the GitHub API is concerned, every pull request is an issue,\n// but not every issue is a pull request. Some endpoints, events, and webhooks\n// may also return pull requests via this struct. If PullRequestLinks is nil,\n// this is an issue, and if PullRequestLinks is not nil, this is a pull request.\n// The IsPullRequest helper method can be used to check that.\ntype SubIssue Issue\n\nfunc (i SubIssue) String() string {\n\treturn Stringify(i)\n}\n\n// SubIssueListByIssueOptions specifies the optional parameters to the\n// SubIssueService.ListByIssue method.\ntype SubIssueListByIssueOptions struct {\n\tIssueListByRepoOptions\n}\n\n// SubIssueRequest represents a request to add, remove, or reprioritize sub-issues.\ntype SubIssueRequest struct {\n\tSubIssueID    int64  `json:\"sub_issue_id\"`             // Required: The ID of the sub-issue\n\tAfterID       *int64 `json:\"after_id,omitempty\"`       // Optional: Position after this sub-issue ID\n\tBeforeID      *int64 `json:\"before_id,omitempty\"`      // Optional: Position before this sub-issue ID\n\tReplaceParent *bool  `json:\"replace_parent,omitempty\"` // Optional: Whether to replace the existing parent\n}\n\n// Remove a sub-issue from the specified repository.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#remove-sub-issue\n//\n//meta:operation DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue\nfunc (s *SubIssueService) Remove(ctx context.Context, owner, repo string, issueNumber int64, subIssue SubIssueRequest) (*SubIssue, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/issues/%v/sub_issue\", owner, repo, issueNumber)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, subIssue)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar si *SubIssue\n\tresp, err := s.client.Do(ctx, req, &si)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn si, resp, nil\n}\n\n// ListByIssue lists all sub-issues for the specified issue.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#list-sub-issues\n//\n//meta:operation GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues\nfunc (s *SubIssueService) ListByIssue(ctx context.Context, owner, repo string, issueNumber int64, opts *ListOptions) ([]*SubIssue, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/issues/%v/sub_issues\", owner, repo, issueNumber)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar subIssues []*SubIssue\n\tresp, err := s.client.Do(ctx, req, &subIssues)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn subIssues, resp, nil\n}\n\n// Add adds a sub-issue to the specified issue.\n//\n// The sub-issue to be added must belong to the same repository owner as the parent issue.\n// To replace the existing parent of a sub-issue, set replaceParent to true.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#add-sub-issue\n//\n//meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues\nfunc (s *SubIssueService) Add(ctx context.Context, owner, repo string, issueNumber int64, subIssue SubIssueRequest) (*SubIssue, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/issues/%v/sub_issues\", owner, repo, issueNumber)\n\treq, err := s.client.NewRequest(\"POST\", u, subIssue)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar si *SubIssue\n\tresp, err := s.client.Do(ctx, req, &si)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn si, resp, nil\n}\n\n// Reprioritize changes a sub-issue's priority to a different position in the parent list.\n//\n// Either afterId or beforeId must be specified to determine the new position of the sub-issue.\n//\n// GitHub API docs: https://docs.github.com/rest/issues/sub-issues#reprioritize-sub-issue\n//\n//meta:operation PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority\nfunc (s *SubIssueService) Reprioritize(ctx context.Context, owner, repo string, issueNumber int64, subIssue SubIssueRequest) (*SubIssue, *Response, error) {\n\tu := fmt.Sprintf(\"repos/%v/%v/issues/%v/sub_issues/priority\", owner, repo, issueNumber)\n\treq, err := s.client.NewRequest(\"PATCH\", u, subIssue)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar si *SubIssue\n\tresp, err := s.client.Do(ctx, req, &si)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn si, resp, nil\n}\n"
  },
  {
    "path": "github/sub_issue_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestSubIssuesService_Add(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &SubIssueRequest{SubIssueID: 42}\n\n\tmux.HandleFunc(\"/repos/o/r/issues/1/sub_issues\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *SubIssueRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":42, \"number\":1}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.SubIssue.Add(ctx, \"o\", \"r\", 1, *input)\n\tif err != nil {\n\t\tt.Errorf(\"SubIssues.Add returned error: %v\", err)\n\t}\n\n\twant := &SubIssue{Number: Ptr(1), ID: Ptr(int64(42))}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"SubIssues.Add = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"Add\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.SubIssue.Add(ctx, \"o\", \"r\", 1, *input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestSubIssuesService_ListByIssue(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/repos/o/r/issues/1/sub_issues\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\":     \"2\",\n\t\t\t\"per_page\": \"50\",\n\t\t})\n\n\t\tfmt.Fprint(w, `[{\"id\":1},{\"id\":2}]`)\n\t})\n\n\tctx := t.Context()\n\topt := &ListOptions{\n\t\tPage:    2,\n\t\tPerPage: 50,\n\t}\n\tissues, _, err := client.SubIssue.ListByIssue(ctx, \"o\", \"r\", 1, opt)\n\tif err != nil {\n\t\tt.Errorf(\"SubIssues.ListByIssue returned error: %v\", err)\n\t}\n\n\twant := []*SubIssue{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}}\n\tif !cmp.Equal(issues, want) {\n\t\tt.Errorf(\"SubIssues.ListByIssue = %+v, want %+v\", issues, want)\n\t}\n\n\tconst methodName = \"ListByIssue\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.SubIssue.ListByIssue(ctx, \"\\n\", \"\\n\", 1, opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.SubIssue.ListByIssue(ctx, \"o\", \"r\", 1, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestSubIssuesService_Remove(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &SubIssueRequest{SubIssueID: 42}\n\n\tmux.HandleFunc(\"/repos/o/r/issues/1/sub_issue\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *SubIssueRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":42, \"number\":1}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.SubIssue.Remove(ctx, \"o\", \"r\", 1, *input)\n\tif err != nil {\n\t\tt.Errorf(\"SubIssues.Remove returned error: %v\", err)\n\t}\n\n\twant := &SubIssue{ID: Ptr(int64(42)), Number: Ptr(1)}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"SubIssues.Remove = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"Remove\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.SubIssue.Remove(ctx, \"o\", \"r\", 1, *input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestSubIssuesService_Reprioritize(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &SubIssueRequest{SubIssueID: 42, AfterID: Ptr(int64(5))}\n\n\tmux.HandleFunc(\"/repos/o/r/issues/1/sub_issues/priority\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\n\t\tvar v *SubIssueRequest\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":42, \"number\":1}`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.SubIssue.Reprioritize(ctx, \"o\", \"r\", 1, *input)\n\tif err != nil {\n\t\tt.Errorf(\"SubIssues.Reprioritize returned error: %v\", err)\n\t}\n\n\twant := &SubIssue{ID: Ptr(int64(42)), Number: Ptr(1)}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"SubIssues.Reprioritize = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"Reprioritize\"\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.SubIssue.Reprioritize(ctx, \"o\", \"r\", 1, *input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/teams.go",
    "content": "// Copyright 2018 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/http\"\n)\n\n// TeamsService provides access to the team-related functions\n// in the GitHub API.\n//\n// GitHub API docs: https://docs.github.com/rest/teams/\ntype TeamsService service\n\n// Team represents a team within a GitHub organization. Teams are used to\n// manage access to an organization's repositories.\ntype Team struct {\n\tID          *int64  `json:\"id,omitempty\"`\n\tNodeID      *string `json:\"node_id,omitempty\"`\n\tName        *string `json:\"name,omitempty\"`\n\tDescription *string `json:\"description,omitempty\"`\n\tURL         *string `json:\"url,omitempty\"`\n\tSlug        *string `json:\"slug,omitempty\"`\n\n\t// Permission specifies the default permission for repositories owned by the team.\n\tPermission *string `json:\"permission,omitempty\"`\n\n\t// Privacy identifies the level of privacy this team should have.\n\t// Possible values are:\n\t//     secret - only visible to organization owners and members of this team\n\t//     closed - visible to all members of this organization\n\t// Default is \"secret\".\n\tPrivacy *string `json:\"privacy,omitempty\"`\n\n\t// NotificationSetting can be one of: \"notifications_enabled\", \"notifications_disabled\".\n\tNotificationSetting *string `json:\"notification_setting,omitempty\"`\n\n\tMembersCount    *int          `json:\"members_count,omitempty\"`\n\tReposCount      *int          `json:\"repos_count,omitempty\"`\n\tOrganization    *Organization `json:\"organization,omitempty\"`\n\tHTMLURL         *string       `json:\"html_url,omitempty\"`\n\tMembersURL      *string       `json:\"members_url,omitempty\"`\n\tRepositoriesURL *string       `json:\"repositories_url,omitempty\"`\n\tParent          *Team         `json:\"parent,omitempty\"`\n\n\t// LDAPDN is only available in GitHub Enterprise and when the team\n\t// membership is synchronized with LDAP.\n\tLDAPDN *string `json:\"ldap_dn,omitempty\"`\n\n\t// Permissions identifies the permissions that a team has on a given\n\t// repository. This is only populated when calling Repositories.ListTeams.\n\tPermissions map[string]bool `json:\"permissions,omitempty\"`\n\n\t// Assignment identifies how a team was assigned to an organization role. Its\n\t// possible values are: \"direct\", \"indirect\", \"mixed\". This is only populated when\n\t// calling the ListTeamsAssignedToOrgRole method.\n\tAssignment *string `json:\"assignment,omitempty\"`\n\n\t// Type identifies the ownership type of the team\n\t// Possible values are: \"organization\", \"enterprise\".\n\tType *string `json:\"type,omitempty\"`\n}\n\nfunc (t Team) String() string {\n\treturn Stringify(t)\n}\n\n// Invitation represents a team member's invitation status.\ntype Invitation struct {\n\tID     *int64  `json:\"id,omitempty\"`\n\tNodeID *string `json:\"node_id,omitempty\"`\n\tLogin  *string `json:\"login,omitempty\"`\n\tEmail  *string `json:\"email,omitempty\"`\n\t// Role can be one of the values - 'direct_member', 'admin', 'billing_manager', 'hiring_manager', or 'reinstate'.\n\tRole              *string    `json:\"role,omitempty\"`\n\tCreatedAt         *Timestamp `json:\"created_at,omitempty\"`\n\tInviter           *User      `json:\"inviter,omitempty\"`\n\tTeamCount         *int       `json:\"team_count,omitempty\"`\n\tInvitationTeamURL *string    `json:\"invitation_team_url,omitempty\"`\n\tFailedAt          *Timestamp `json:\"failed_at,omitempty\"`\n\tFailedReason      *string    `json:\"failed_reason,omitempty\"`\n}\n\nfunc (i Invitation) String() string {\n\treturn Stringify(i)\n}\n\n// ListTeams lists all of the teams for an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/teams/teams#list-teams\n//\n//meta:operation GET /orgs/{org}/teams\nfunc (s *TeamsService) ListTeams(ctx context.Context, org string, opts *ListOptions) ([]*Team, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar teams []*Team\n\tresp, err := s.client.Do(ctx, req, &teams)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn teams, resp, nil\n}\n\n// GetTeamByID fetches a team, given a specified organization ID, by ID.\n//\n// Deprecated: Use GetTeamBySlug instead.\n//\n// GitHub API docs: https://docs.github.com/rest/teams/teams#get-a-team-by-name\n//\n//meta:operation GET /orgs/{org}/teams/{team_slug}\nfunc (s *TeamsService) GetTeamByID(ctx context.Context, orgID, teamID int64) (*Team, *Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/team/%v\", orgID, teamID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar t *Team\n\tresp, err := s.client.Do(ctx, req, &t)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn t, resp, nil\n}\n\n// GetTeamBySlug fetches a team, given a specified organization name, by slug.\n//\n// GitHub API docs: https://docs.github.com/rest/teams/teams#get-a-team-by-name\n//\n//meta:operation GET /orgs/{org}/teams/{team_slug}\nfunc (s *TeamsService) GetTeamBySlug(ctx context.Context, org, slug string) (*Team, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v\", org, slug)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar t *Team\n\tresp, err := s.client.Do(ctx, req, &t)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn t, resp, nil\n}\n\n// NewTeam represents a team to be created or modified.\ntype NewTeam struct {\n\tName         string   `json:\"name\"` // Name of the team. (Required.)\n\tDescription  *string  `json:\"description,omitempty\"`\n\tMaintainers  []string `json:\"maintainers,omitempty\"`\n\tRepoNames    []string `json:\"repo_names,omitempty\"`\n\tParentTeamID *int64   `json:\"parent_team_id,omitempty\"`\n\n\t// NotificationSetting can be one of: \"notifications_enabled\", \"notifications_disabled\".\n\tNotificationSetting *string `json:\"notification_setting,omitempty\"`\n\n\t// Deprecated: Permission is deprecated when creating or editing a team in an org\n\t// using the new GitHub permission model. It no longer identifies the\n\t// permission a team has on its repos, but only specifies the default\n\t// permission a repo is initially added with. Avoid confusion by\n\t// specifying a permission value when calling AddTeamRepo.\n\tPermission *string `json:\"permission,omitempty\"`\n\n\t// Privacy identifies the level of privacy this team should have.\n\t// Possible values are:\n\t//     secret - only visible to organization owners and members of this team\n\t//     closed - visible to all members of this organization\n\t// Default is \"secret\".\n\tPrivacy *string `json:\"privacy,omitempty\"`\n\n\t// LDAPDN may be used in GitHub Enterprise when the team membership\n\t// is synchronized with LDAP.\n\tLDAPDN *string `json:\"ldap_dn,omitempty\"`\n}\n\nfunc (s NewTeam) String() string {\n\treturn Stringify(s)\n}\n\n// CreateTeam creates a new team within an organization.\n//\n// GitHub API docs: https://docs.github.com/rest/teams/teams#create-a-team\n//\n//meta:operation POST /orgs/{org}/teams\nfunc (s *TeamsService) CreateTeam(ctx context.Context, org string, team NewTeam) (*Team, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams\", org)\n\treq, err := s.client.NewRequest(\"POST\", u, team)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar t *Team\n\tresp, err := s.client.Do(ctx, req, &t)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn t, resp, nil\n}\n\n// newTeamNoParent is the same as NewTeam but ensures that the\n// \"parent_team_id\" field will be null. It is for internal use\n// only and should not be exported.\ntype newTeamNoParent struct {\n\tName                string   `json:\"name\"`\n\tDescription         *string  `json:\"description,omitempty\"`\n\tMaintainers         []string `json:\"maintainers,omitempty\"`\n\tRepoNames           []string `json:\"repo_names,omitempty\"`\n\tParentTeamID        *int64   `json:\"parent_team_id\"` // This will be \"null\"\n\tNotificationSetting *string  `json:\"notification_setting,omitempty\"`\n\tPrivacy             *string  `json:\"privacy,omitempty\"`\n\tLDAPDN              *string  `json:\"ldap_dn,omitempty\"`\n}\n\n// copyNewTeamWithoutParent is used to set the \"parent_team_id\"\n// field to \"null\" after copying the other fields from a NewTeam.\n// It is for internal use only and should not be exported.\nfunc copyNewTeamWithoutParent(team *NewTeam) *newTeamNoParent {\n\treturn &newTeamNoParent{\n\t\tName:                team.Name,\n\t\tDescription:         team.Description,\n\t\tMaintainers:         team.Maintainers,\n\t\tRepoNames:           team.RepoNames,\n\t\tNotificationSetting: team.NotificationSetting,\n\t\tPrivacy:             team.Privacy,\n\t\tLDAPDN:              team.LDAPDN,\n\t}\n}\n\n// EditTeamByID edits a team, given an organization ID, selected by ID.\n//\n// Deprecated: Use EditTeamBySlug instead.\n//\n// GitHub API docs: https://docs.github.com/rest/teams/teams#update-a-team\n//\n//meta:operation PATCH /orgs/{org}/teams/{team_slug}\nfunc (s *TeamsService) EditTeamByID(ctx context.Context, orgID, teamID int64, team NewTeam, removeParent bool) (*Team, *Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/team/%v\", orgID, teamID)\n\n\tvar req *http.Request\n\tvar err error\n\tif removeParent {\n\t\tteamRemoveParent := copyNewTeamWithoutParent(&team)\n\t\treq, err = s.client.NewRequest(\"PATCH\", u, teamRemoveParent)\n\t} else {\n\t\treq, err = s.client.NewRequest(\"PATCH\", u, team)\n\t}\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar t *Team\n\tresp, err := s.client.Do(ctx, req, &t)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn t, resp, nil\n}\n\n// EditTeamBySlug edits a team, given an organization name, by slug.\n//\n// GitHub API docs: https://docs.github.com/rest/teams/teams#update-a-team\n//\n//meta:operation PATCH /orgs/{org}/teams/{team_slug}\nfunc (s *TeamsService) EditTeamBySlug(ctx context.Context, org, slug string, team NewTeam, removeParent bool) (*Team, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v\", org, slug)\n\n\tvar req *http.Request\n\tvar err error\n\tif removeParent {\n\t\tteamRemoveParent := copyNewTeamWithoutParent(&team)\n\t\treq, err = s.client.NewRequest(\"PATCH\", u, teamRemoveParent)\n\t} else {\n\t\treq, err = s.client.NewRequest(\"PATCH\", u, team)\n\t}\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar t *Team\n\tresp, err := s.client.Do(ctx, req, &t)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn t, resp, nil\n}\n\n// DeleteTeamByID deletes a team referenced by ID.\n//\n// Deprecated: Use DeleteTeamBySlug instead.\n//\n// GitHub API docs: https://docs.github.com/rest/teams/teams#delete-a-team\n//\n//meta:operation DELETE /orgs/{org}/teams/{team_slug}\nfunc (s *TeamsService) DeleteTeamByID(ctx context.Context, orgID, teamID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/team/%v\", orgID, teamID)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// DeleteTeamBySlug deletes a team reference by slug.\n//\n// GitHub API docs: https://docs.github.com/rest/teams/teams#delete-a-team\n//\n//meta:operation DELETE /orgs/{org}/teams/{team_slug}\nfunc (s *TeamsService) DeleteTeamBySlug(ctx context.Context, org, slug string) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v\", org, slug)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// ListChildTeamsByParentID lists child teams for a parent team given parent ID.\n//\n// Deprecated: Use ListChildTeamsByParentSlug instead.\n//\n// GitHub API docs: https://docs.github.com/rest/teams/teams#list-child-teams\n//\n//meta:operation GET /orgs/{org}/teams/{team_slug}/teams\nfunc (s *TeamsService) ListChildTeamsByParentID(ctx context.Context, orgID, teamID int64, opts *ListOptions) ([]*Team, *Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/team/%v/teams\", orgID, teamID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar teams []*Team\n\tresp, err := s.client.Do(ctx, req, &teams)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn teams, resp, nil\n}\n\n// ListChildTeamsByParentSlug lists child teams for a parent team given parent slug.\n//\n// GitHub API docs: https://docs.github.com/rest/teams/teams#list-child-teams\n//\n//meta:operation GET /orgs/{org}/teams/{team_slug}/teams\nfunc (s *TeamsService) ListChildTeamsByParentSlug(ctx context.Context, org, slug string, opts *ListOptions) ([]*Team, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v/teams\", org, slug)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar teams []*Team\n\tresp, err := s.client.Do(ctx, req, &teams)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn teams, resp, nil\n}\n\n// ListTeamReposByID lists the repositories given a team ID that the specified team has access to.\n//\n// Deprecated: Use ListTeamReposBySlug instead.\n//\n// GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-repositories\n//\n//meta:operation GET /orgs/{org}/teams/{team_slug}/repos\nfunc (s *TeamsService) ListTeamReposByID(ctx context.Context, orgID, teamID int64, opts *ListOptions) ([]*Repository, *Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/team/%v/repos\", orgID, teamID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeTopicsPreview)\n\n\tvar repos []*Repository\n\tresp, err := s.client.Do(ctx, req, &repos)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn repos, resp, nil\n}\n\n// ListTeamReposBySlug lists the repositories given a team slug that the specified team has access to.\n//\n// GitHub API docs: https://docs.github.com/rest/teams/teams#list-team-repositories\n//\n//meta:operation GET /orgs/{org}/teams/{team_slug}/repos\nfunc (s *TeamsService) ListTeamReposBySlug(ctx context.Context, org, slug string, opts *ListOptions) ([]*Repository, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v/repos\", org, slug)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeTopicsPreview)\n\n\tvar repos []*Repository\n\tresp, err := s.client.Do(ctx, req, &repos)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn repos, resp, nil\n}\n\n// IsTeamRepoByID checks if a team, given its ID, manages the specified repository. If the\n// repository is managed by team, a Repository is returned which includes the\n// permissions team has for that repo.\n//\n// Deprecated: Use IsTeamRepoBySlug instead.\n//\n// GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository\n//\n//meta:operation GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\nfunc (s *TeamsService) IsTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string) (*Repository, *Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/team/%v/repos/%v/%v\", orgID, teamID, owner, repo)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeOrgPermissionRepo)\n\n\tvar repository *Repository\n\tresp, err := s.client.Do(ctx, req, &repository)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn repository, resp, nil\n}\n\n// IsTeamRepoBySlug checks if a team, given its slug, manages the specified repository. If the\n// repository is managed by team, a Repository is returned which includes the\n// permissions team has for that repo.\n//\n// GitHub API docs: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository\n//\n//meta:operation GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\nfunc (s *TeamsService) IsTeamRepoBySlug(ctx context.Context, org, slug, owner, repo string) (*Repository, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v/repos/%v/%v\", org, slug, owner, repo)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeOrgPermissionRepo)\n\n\tvar repository *Repository\n\tresp, err := s.client.Do(ctx, req, &repository)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn repository, resp, nil\n}\n\n// TeamAddTeamRepoOptions specifies the optional parameters to the\n// TeamsService.AddTeamRepoByID and TeamsService.AddTeamRepoBySlug methods.\ntype TeamAddTeamRepoOptions struct {\n\t// Permission specifies the permission to grant the team on this repository.\n\t// Possible values are:\n\t//     pull - team members can pull, but not push to or administer this repository\n\t//     push - team members can push and pull, but not administer this repository\n\t//     admin - team members can pull, push and administer this repository\n\t//     maintain - team members can manage the repository without access to sensitive or destructive actions.\n\t//     triage - team members can proactively manage issues and pull requests without write access.\n\t//\n\t// If not specified, the team's permission attribute will be used.\n\tPermission string `json:\"permission,omitempty\"`\n}\n\n// AddTeamRepoByID adds a repository to be managed by the specified team given the team ID.\n// The specified repository must be owned by the organization to which the team\n// belongs, or a direct fork of a repository owned by the organization.\n//\n// Deprecated: Use AddTeamRepoBySlug instead.\n//\n// GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions\n//\n//meta:operation PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\nfunc (s *TeamsService) AddTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string, opts *TeamAddTeamRepoOptions) (*Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/team/%v/repos/%v/%v\", orgID, teamID, owner, repo)\n\treq, err := s.client.NewRequest(\"PUT\", u, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// AddTeamRepoBySlug adds a repository to be managed by the specified team given the team slug.\n// The specified repository must be owned by the organization to which the team\n// belongs, or a direct fork of a repository owned by the organization.\n//\n// GitHub API docs: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions\n//\n//meta:operation PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\nfunc (s *TeamsService) AddTeamRepoBySlug(ctx context.Context, org, slug, owner, repo string, opts *TeamAddTeamRepoOptions) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v/repos/%v/%v\", org, slug, owner, repo)\n\treq, err := s.client.NewRequest(\"PUT\", u, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// RemoveTeamRepoByID removes a repository from being managed by the specified\n// team given the team ID. Note that this does not delete the repository, it\n// just removes it from the team.\n//\n// Deprecated: Use RemoveTeamRepoBySlug instead.\n//\n// GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team\n//\n//meta:operation DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\nfunc (s *TeamsService) RemoveTeamRepoByID(ctx context.Context, orgID, teamID int64, owner, repo string) (*Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/team/%v/repos/%v/%v\", orgID, teamID, owner, repo)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// RemoveTeamRepoBySlug removes a repository from being managed by the specified\n// team given the team slug. Note that this does not delete the repository, it\n// just removes it from the team.\n//\n// GitHub API docs: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team\n//\n//meta:operation DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\nfunc (s *TeamsService) RemoveTeamRepoBySlug(ctx context.Context, org, slug, owner, repo string) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v/repos/%v/%v\", org, slug, owner, repo)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// ListUserTeams lists a user's teams\n//\n// GitHub API docs: https://docs.github.com/rest/teams/teams#list-teams-for-the-authenticated-user\n//\n//meta:operation GET /user/teams\nfunc (s *TeamsService) ListUserTeams(ctx context.Context, opts *ListOptions) ([]*Team, *Response, error) {\n\tu := \"user/teams\"\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar teams []*Team\n\tresp, err := s.client.Do(ctx, req, &teams)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn teams, resp, nil\n}\n\n// ListTeamProjectsByID lists the organization projects for a team given the team ID.\n//\n// Deprecated: Use ListTeamProjectsBySlug instead.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/teams/teams#list-team-projects\n//\n//meta:operation GET /orgs/{org}/teams/{team_slug}/projects\nfunc (s *TeamsService) ListTeamProjectsByID(ctx context.Context, orgID, teamID int64) ([]*ProjectV2, *Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/team/%v/projects\", orgID, teamID)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeProjectsPreview)\n\n\tvar projects []*ProjectV2\n\tresp, err := s.client.Do(ctx, req, &projects)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn projects, resp, nil\n}\n\n// ListTeamProjectsBySlug lists the organization projects for a team given the team slug.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/teams/teams#list-team-projects\n//\n//meta:operation GET /orgs/{org}/teams/{team_slug}/projects\nfunc (s *TeamsService) ListTeamProjectsBySlug(ctx context.Context, org, slug string) ([]*ProjectV2, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v/projects\", org, slug)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeProjectsPreview)\n\n\tvar projects []*ProjectV2\n\tresp, err := s.client.Do(ctx, req, &projects)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn projects, resp, nil\n}\n\n// ReviewTeamProjectsByID checks whether a team, given its ID, has read, write, or admin\n// permissions for an organization project.\n//\n// Deprecated: Use ReviewTeamProjectsBySlug instead.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/teams/teams#check-team-permissions-for-a-project\n//\n//meta:operation GET /orgs/{org}/teams/{team_slug}/projects/{project_id}\nfunc (s *TeamsService) ReviewTeamProjectsByID(ctx context.Context, orgID, teamID, projectID int64) (*ProjectV2, *Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/team/%v/projects/%v\", orgID, teamID, projectID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeProjectsPreview)\n\n\tvar projects *ProjectV2\n\tresp, err := s.client.Do(ctx, req, &projects)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn projects, resp, nil\n}\n\n// ReviewTeamProjectsBySlug checks whether a team, given its slug, has read, write, or admin\n// permissions for an organization project.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/teams/teams#check-team-permissions-for-a-project\n//\n//meta:operation GET /orgs/{org}/teams/{team_slug}/projects/{project_id}\nfunc (s *TeamsService) ReviewTeamProjectsBySlug(ctx context.Context, org, slug string, projectID int64) (*ProjectV2, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v/projects/%v\", org, slug, projectID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeProjectsPreview)\n\n\tvar projects *ProjectV2\n\tresp, err := s.client.Do(ctx, req, &projects)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn projects, resp, nil\n}\n\n// TeamProjectOptions specifies the optional parameters to the\n// TeamsService.AddTeamProject method.\ntype TeamProjectOptions struct {\n\t// Permission specifies the permission to grant to the team for this project.\n\t// Possible values are:\n\t//     \"read\" - team members can read, but not write to or administer this project.\n\t//     \"write\" - team members can read and write, but not administer this project.\n\t//     \"admin\" - team members can read, write and administer this project.\n\t//\n\tPermission *string `json:\"permission,omitempty\"`\n}\n\n// AddTeamProjectByID adds an organization project to a team given the team ID.\n// To add a project to a team or update the team's permission on a project, the\n// authenticated user must have admin permissions for the project.\n//\n// Deprecated: Use AddTeamProjectBySlug instead.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/teams/teams#add-or-update-team-project-permissions\n//\n//meta:operation PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}\nfunc (s *TeamsService) AddTeamProjectByID(ctx context.Context, orgID, teamID, projectID int64, opts *TeamProjectOptions) (*Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/team/%v/projects/%v\", orgID, teamID, projectID)\n\treq, err := s.client.NewRequest(\"PUT\", u, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeProjectsPreview)\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// AddTeamProjectBySlug adds an organization project to a team given the team slug.\n// To add a project to a team or update the team's permission on a project, the\n// authenticated user must have admin permissions for the project.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/teams/teams#add-or-update-team-project-permissions\n//\n//meta:operation PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}\nfunc (s *TeamsService) AddTeamProjectBySlug(ctx context.Context, org, slug string, projectID int64, opts *TeamProjectOptions) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v/projects/%v\", org, slug, projectID)\n\treq, err := s.client.NewRequest(\"PUT\", u, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeProjectsPreview)\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// RemoveTeamProjectByID removes an organization project from a team given team ID.\n// An organization owner or a team maintainer can remove any project from the team.\n// To remove a project from a team as an organization member, the authenticated user\n// must have \"read\" access to both the team and project, or \"admin\" access to the team\n// or project.\n// Note: This endpoint removes the project from the team, but does not delete it.\n//\n// Deprecated: Use RemoveTeamProjectBySlug instead.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/teams/teams#remove-a-project-from-a-team\n//\n//meta:operation DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}\nfunc (s *TeamsService) RemoveTeamProjectByID(ctx context.Context, orgID, teamID, projectID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/team/%v/projects/%v\", orgID, teamID, projectID)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeProjectsPreview)\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// RemoveTeamProjectBySlug removes an organization project from a team given team slug.\n// An organization owner or a team maintainer can remove any project from the team.\n// To remove a project from a team as an organization member, the authenticated user\n// must have \"read\" access to both the team and project, or \"admin\" access to the team\n// or project.\n// Note: This endpoint removes the project from the team, but does not delete it.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.16/rest/teams/teams#remove-a-project-from-a-team\n//\n//meta:operation DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}\nfunc (s *TeamsService) RemoveTeamProjectBySlug(ctx context.Context, org, slug string, projectID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v/projects/%v\", org, slug, projectID)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeProjectsPreview)\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// ListIDPGroupsOptions specifies the optional parameters to the ListIDPGroupsInOrganization method.\ntype ListIDPGroupsOptions struct {\n\t// Filters the results to return only those that begin with the value specified by this parameter.\n\tQuery string `url:\"q,omitempty\"`\n\n\tListCursorOptions\n}\n\n// IDPGroupList represents a list of external identity provider (IDP) groups.\ntype IDPGroupList struct {\n\tGroups []*IDPGroup `json:\"groups\"`\n}\n\n// IDPGroup represents an external identity provider (IDP) group.\ntype IDPGroup struct {\n\tGroupID          *string `json:\"group_id,omitempty\"`\n\tGroupName        *string `json:\"group_name,omitempty\"`\n\tGroupDescription *string `json:\"group_description,omitempty\"`\n}\n\n// ListIDPGroupsInOrganization lists IDP groups available in an organization.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#list-idp-groups-for-an-organization\n//\n//meta:operation GET /orgs/{org}/team-sync/groups\nfunc (s *TeamsService) ListIDPGroupsInOrganization(ctx context.Context, org string, opts *ListIDPGroupsOptions) (*IDPGroupList, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/team-sync/groups\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar groups *IDPGroupList\n\tresp, err := s.client.Do(ctx, req, &groups)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn groups, resp, nil\n}\n\n// ListIDPGroupsForTeamByID lists IDP groups connected to a team on GitHub\n// given organization and team IDs.\n//\n// Deprecated: Use ListIDPGroupsForTeamBySlug instead.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#list-idp-groups-for-a-team\n//\n//meta:operation GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings\nfunc (s *TeamsService) ListIDPGroupsForTeamByID(ctx context.Context, orgID, teamID int64) (*IDPGroupList, *Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/team/%v/team-sync/group-mappings\", orgID, teamID)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar groups *IDPGroupList\n\tresp, err := s.client.Do(ctx, req, &groups)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn groups, resp, nil\n}\n\n// ListIDPGroupsForTeamBySlug lists IDP groups connected to a team on GitHub\n// given organization name and team slug.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#list-idp-groups-for-a-team\n//\n//meta:operation GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings\nfunc (s *TeamsService) ListIDPGroupsForTeamBySlug(ctx context.Context, org, slug string) (*IDPGroupList, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v/team-sync/group-mappings\", org, slug)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar groups *IDPGroupList\n\tresp, err := s.client.Do(ctx, req, &groups)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn groups, resp, nil\n}\n\n// CreateOrUpdateIDPGroupConnectionsByID creates, updates, or removes a connection\n// between a team and an IDP group given organization and team IDs.\n//\n// Deprecated: Use CreateOrUpdateIDPGroupConnectionsBySlug instead.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#create-or-update-idp-group-connections\n//\n//meta:operation PATCH /orgs/{org}/teams/{team_slug}/team-sync/group-mappings\nfunc (s *TeamsService) CreateOrUpdateIDPGroupConnectionsByID(ctx context.Context, orgID, teamID int64, opts IDPGroupList) (*IDPGroupList, *Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/team/%v/team-sync/group-mappings\", orgID, teamID)\n\n\treq, err := s.client.NewRequest(\"PATCH\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar groups *IDPGroupList\n\tresp, err := s.client.Do(ctx, req, &groups)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn groups, resp, nil\n}\n\n// CreateOrUpdateIDPGroupConnectionsBySlug creates, updates, or removes a connection\n// between a team and an IDP group given organization name and team slug.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/team-sync#create-or-update-idp-group-connections\n//\n//meta:operation PATCH /orgs/{org}/teams/{team_slug}/team-sync/group-mappings\nfunc (s *TeamsService) CreateOrUpdateIDPGroupConnectionsBySlug(ctx context.Context, org, slug string, opts IDPGroupList) (*IDPGroupList, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v/team-sync/group-mappings\", org, slug)\n\n\treq, err := s.client.NewRequest(\"PATCH\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar groups *IDPGroupList\n\tresp, err := s.client.Do(ctx, req, &groups)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn groups, resp, nil\n}\n\n// ExternalGroupMember represents a member of an external group.\ntype ExternalGroupMember struct {\n\tMemberID    *int64  `json:\"member_id,omitempty\"`\n\tMemberLogin *string `json:\"member_login,omitempty\"`\n\tMemberName  *string `json:\"member_name,omitempty\"`\n\tMemberEmail *string `json:\"member_email,omitempty\"`\n}\n\n// ExternalGroupTeam represents a team connected to an external group.\ntype ExternalGroupTeam struct {\n\tTeamID   *int64  `json:\"team_id,omitempty\"`\n\tTeamName *string `json:\"team_name,omitempty\"`\n}\n\n// ExternalGroup represents an external group.\ntype ExternalGroup struct {\n\tGroupID   *int64                 `json:\"group_id,omitempty\"`\n\tGroupName *string                `json:\"group_name,omitempty\"`\n\tUpdatedAt *Timestamp             `json:\"updated_at,omitempty\"`\n\tTeams     []*ExternalGroupTeam   `json:\"teams,omitempty\"`\n\tMembers   []*ExternalGroupMember `json:\"members,omitempty\"`\n}\n\n// ExternalGroupList represents a list of external groups.\ntype ExternalGroupList struct {\n\tGroups []*ExternalGroup `json:\"groups\"`\n}\n\n// GetExternalGroup fetches an external group.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups#get-an-external-group\n//\n//meta:operation GET /orgs/{org}/external-group/{group_id}\nfunc (s *TeamsService) GetExternalGroup(ctx context.Context, org string, groupID int64) (*ExternalGroup, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/external-group/%v\", org, groupID)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar externalGroup *ExternalGroup\n\tresp, err := s.client.Do(ctx, req, &externalGroup)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn externalGroup, resp, nil\n}\n\n// ListExternalGroupsOptions specifies the optional parameters to the\n// TeamsService.ListExternalGroups method.\ntype ListExternalGroupsOptions struct {\n\tDisplayName *string `url:\"display_name,omitempty\"`\n\n\tListOptions\n}\n\n// ListExternalGroups lists external groups in an organization on GitHub.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups#list-external-groups-available-to-an-organization\n//\n//meta:operation GET /orgs/{org}/external-groups\nfunc (s *TeamsService) ListExternalGroups(ctx context.Context, org string, opts *ListExternalGroupsOptions) (*ExternalGroupList, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/external-groups\", org)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar externalGroups *ExternalGroupList\n\tresp, err := s.client.Do(ctx, req, &externalGroups)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn externalGroups, resp, nil\n}\n\n// ListExternalGroupsForTeamBySlug lists external groups connected to a team on GitHub.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups#list-a-connection-between-an-external-group-and-a-team\n//\n//meta:operation GET /orgs/{org}/teams/{team_slug}/external-groups\nfunc (s *TeamsService) ListExternalGroupsForTeamBySlug(ctx context.Context, org, slug string) (*ExternalGroupList, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v/external-groups\", org, slug)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar externalGroups *ExternalGroupList\n\tresp, err := s.client.Do(ctx, req, &externalGroups)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn externalGroups, resp, nil\n}\n\n// UpdateConnectedExternalGroup updates the connection between an external group and a team.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups#update-the-connection-between-an-external-group-and-a-team\n//\n//meta:operation PATCH /orgs/{org}/teams/{team_slug}/external-groups\nfunc (s *TeamsService) UpdateConnectedExternalGroup(ctx context.Context, org, slug string, eg *ExternalGroup) (*ExternalGroup, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v/external-groups\", org, slug)\n\n\treq, err := s.client.NewRequest(\"PATCH\", u, eg)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar externalGroup *ExternalGroup\n\tresp, err := s.client.Do(ctx, req, &externalGroup)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn externalGroup, resp, nil\n}\n\n// RemoveConnectedExternalGroup removes the connection between an external group and a team.\n//\n// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/teams/external-groups#remove-the-connection-between-an-external-group-and-a-team\n//\n//meta:operation DELETE /orgs/{org}/teams/{team_slug}/external-groups\nfunc (s *TeamsService) RemoveConnectedExternalGroup(ctx context.Context, org, slug string) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v/external-groups\", org, slug)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/teams_discussion_comments.go",
    "content": "// Copyright 2018 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// DiscussionComment represents a GitHub discussion in a team.\ntype DiscussionComment struct {\n\tAuthor        *User      `json:\"author,omitempty\"`\n\tBody          *string    `json:\"body,omitempty\"`\n\tBodyHTML      *string    `json:\"body_html,omitempty\"`\n\tBodyVersion   *string    `json:\"body_version,omitempty\"`\n\tCreatedAt     *Timestamp `json:\"created_at,omitempty\"`\n\tLastEditedAt  *Timestamp `json:\"last_edited_at,omitempty\"`\n\tDiscussionURL *string    `json:\"discussion_url,omitempty\"`\n\tHTMLURL       *string    `json:\"html_url,omitempty\"`\n\tNodeID        *string    `json:\"node_id,omitempty\"`\n\tNumber        *int       `json:\"number,omitempty\"`\n\tUpdatedAt     *Timestamp `json:\"updated_at,omitempty\"`\n\tURL           *string    `json:\"url,omitempty\"`\n\tReactions     *Reactions `json:\"reactions,omitempty\"`\n}\n\nfunc (c DiscussionComment) String() string {\n\treturn Stringify(c)\n}\n\n// DiscussionCommentListOptions specifies optional parameters to the\n// TeamServices.ListComments method.\ntype DiscussionCommentListOptions struct {\n\t// Sorts the discussion comments by the date they were created.\n\t// Accepted values are asc and desc. Default is desc.\n\tDirection string `url:\"direction,omitempty\"`\n\tListOptions\n}\n\n// ListCommentsByID lists all comments on a team discussion by team ID.\n// Authenticated user must grant read:discussion scope.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#list-discussion-comments\n//\n//meta:operation GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\nfunc (s *TeamsService) ListCommentsByID(ctx context.Context, orgID, teamID int64, discussionNumber int, options *DiscussionCommentListOptions) ([]*DiscussionComment, *Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/team/%v/discussions/%v/comments\", orgID, teamID, discussionNumber)\n\tu, err := addOptions(u, options)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar comments []*DiscussionComment\n\tresp, err := s.client.Do(ctx, req, &comments)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn comments, resp, nil\n}\n\n// ListCommentsBySlug lists all comments on a team discussion by team slug.\n// Authenticated user must grant read:discussion scope.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#list-discussion-comments\n//\n//meta:operation GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\nfunc (s *TeamsService) ListCommentsBySlug(ctx context.Context, org, slug string, discussionNumber int, options *DiscussionCommentListOptions) ([]*DiscussionComment, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v/discussions/%v/comments\", org, slug, discussionNumber)\n\tu, err := addOptions(u, options)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar comments []*DiscussionComment\n\tresp, err := s.client.Do(ctx, req, &comments)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn comments, resp, nil\n}\n\n// GetCommentByID gets a specific comment on a team discussion by team ID.\n// Authenticated user must grant read:discussion scope.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#get-a-discussion-comment\n//\n//meta:operation GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\nfunc (s *TeamsService) GetCommentByID(ctx context.Context, orgID, teamID int64, discussionNumber, commentNumber int) (*DiscussionComment, *Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/team/%v/discussions/%v/comments/%v\", orgID, teamID, discussionNumber, commentNumber)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar discussionComment *DiscussionComment\n\tresp, err := s.client.Do(ctx, req, &discussionComment)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn discussionComment, resp, nil\n}\n\n// GetCommentBySlug gets a specific comment on a team discussion by team slug.\n// Authenticated user must grant read:discussion scope.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#get-a-discussion-comment\n//\n//meta:operation GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\nfunc (s *TeamsService) GetCommentBySlug(ctx context.Context, org, slug string, discussionNumber, commentNumber int) (*DiscussionComment, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v/discussions/%v/comments/%v\", org, slug, discussionNumber, commentNumber)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar discussionComment *DiscussionComment\n\tresp, err := s.client.Do(ctx, req, &discussionComment)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn discussionComment, resp, nil\n}\n\n// CreateCommentByID creates a new comment on a team discussion by team ID.\n// Authenticated user must grant write:discussion scope.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#create-a-discussion-comment\n//\n//meta:operation POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\nfunc (s *TeamsService) CreateCommentByID(ctx context.Context, orgID, teamID int64, discussionNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/team/%v/discussions/%v/comments\", orgID, teamID, discussionNumber)\n\treq, err := s.client.NewRequest(\"POST\", u, comment)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar discussionComment *DiscussionComment\n\tresp, err := s.client.Do(ctx, req, &discussionComment)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn discussionComment, resp, nil\n}\n\n// CreateCommentBySlug creates a new comment on a team discussion by team slug.\n// Authenticated user must grant write:discussion scope.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#create-a-discussion-comment\n//\n//meta:operation POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\nfunc (s *TeamsService) CreateCommentBySlug(ctx context.Context, org, slug string, discussionNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v/discussions/%v/comments\", org, slug, discussionNumber)\n\treq, err := s.client.NewRequest(\"POST\", u, comment)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar discussionComment *DiscussionComment\n\tresp, err := s.client.Do(ctx, req, &discussionComment)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn discussionComment, resp, nil\n}\n\n// EditCommentByID edits the body text of a discussion comment by team ID.\n// Authenticated user must grant write:discussion scope.\n// User is allowed to edit body of a comment only.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#update-a-discussion-comment\n//\n//meta:operation PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\nfunc (s *TeamsService) EditCommentByID(ctx context.Context, orgID, teamID int64, discussionNumber, commentNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/team/%v/discussions/%v/comments/%v\", orgID, teamID, discussionNumber, commentNumber)\n\treq, err := s.client.NewRequest(\"PATCH\", u, comment)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar discussionComment *DiscussionComment\n\tresp, err := s.client.Do(ctx, req, &discussionComment)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn discussionComment, resp, nil\n}\n\n// EditCommentBySlug edits the body text of a discussion comment by team slug.\n// Authenticated user must grant write:discussion scope.\n// User is allowed to edit body of a comment only.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#update-a-discussion-comment\n//\n//meta:operation PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\nfunc (s *TeamsService) EditCommentBySlug(ctx context.Context, org, slug string, discussionNumber, commentNumber int, comment DiscussionComment) (*DiscussionComment, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v/discussions/%v/comments/%v\", org, slug, discussionNumber, commentNumber)\n\treq, err := s.client.NewRequest(\"PATCH\", u, comment)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar discussionComment *DiscussionComment\n\tresp, err := s.client.Do(ctx, req, &discussionComment)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn discussionComment, resp, nil\n}\n\n// DeleteCommentByID deletes a comment on a team discussion by team ID.\n// Authenticated user must grant write:discussion scope.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#delete-a-discussion-comment\n//\n//meta:operation DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\nfunc (s *TeamsService) DeleteCommentByID(ctx context.Context, orgID, teamID int64, discussionNumber, commentNumber int) (*Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/team/%v/discussions/%v/comments/%v\", orgID, teamID, discussionNumber, commentNumber)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// DeleteCommentBySlug deletes a comment on a team discussion by team slug.\n// Authenticated user must grant write:discussion scope.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#delete-a-discussion-comment\n//\n//meta:operation DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\nfunc (s *TeamsService) DeleteCommentBySlug(ctx context.Context, org, slug string, discussionNumber, commentNumber int) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v/discussions/%v/comments/%v\", org, slug, discussionNumber, commentNumber)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/teams_discussion_comments_test.go",
    "content": "// Copyright 2018 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\n// \"Team Discussion Comments\" endpoint, when using a teamID.\nfunc tdcEndpointByID(orgID, teamID, discussionNumber, commentNumber string) string {\n\tout := fmt.Sprintf(\"/organizations/%v/team/%v/discussions/%v/comments\", orgID, teamID, discussionNumber)\n\tif commentNumber != \"\" {\n\t\treturn fmt.Sprintf(\"%v/%v\", out, commentNumber)\n\t}\n\treturn out\n}\n\n// \"Team Discussion Comments\" endpoint, when using a team slug.\nfunc tdcEndpointBySlug(org, slug, discussionNumber, commentNumber string) string {\n\tout := fmt.Sprintf(\"/orgs/%v/teams/%v/discussions/%v/comments\", org, slug, discussionNumber)\n\tif commentNumber != \"\" {\n\t\treturn fmt.Sprintf(\"%v/%v\", out, commentNumber)\n\t}\n\treturn out\n}\n\nfunc TestTeamsService_ListComments(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\thandleFunc := func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"direction\": \"desc\",\n\t\t})\n\t\tfmt.Fprint(w,\n\t\t\t`[\n\t\t\t\t{\n\t\t\t\t\t\"author\": {\n\t\t\t\t\t\t\"login\": \"author\",\n\t\t\t\t\t\t\"id\": 0,\n\t\t\t\t\t\t\"avatar_url\": \"https://avatars1.githubusercontent.com/u/0?v=4\",\n\t\t\t\t\t\t\"gravatar_id\": \"\",\n\t\t\t\t\t\t\"url\": \"https://api.github.com/users/author\",\n\t\t\t\t\t\t\"html_url\": \"https://github.com/author\",\n\t\t\t\t\t\t\"followers_url\": \"https://api.github.com/users/author/followers\",\n\t\t\t\t\t\t\"following_url\": \"https://api.github.com/users/author/following{/other_user}\",\n\t\t\t\t\t\t\"gists_url\": \"https://api.github.com/users/author/gists{/gist_id}\",\n\t\t\t\t\t\t\"starred_url\": \"https://api.github.com/users/author/starred{/owner}{/repo}\",\n\t\t\t\t\t\t\"subscriptions_url\": \"https://api.github.com/users/author/subscriptions\",\n\t\t\t\t\t\t\"organizations_url\": \"https://api.github.com/users/author/orgs\",\n\t\t\t\t\t\t\"repos_url\": \"https://api.github.com/users/author/repos\",\n\t\t\t\t\t\t\"events_url\": \"https://api.github.com/users/author/events{/privacy}\",\n\t\t\t\t\t\t\"received_events_url\": \"https://api.github.com/users/author/received_events\",\n\t\t\t\t\t\t\"type\": \"User\",\n\t\t\t\t\t\t\"site_admin\": false\n\t\t\t\t\t},\n\t\t\t\t\t\"body\": \"comment\",\n\t\t\t\t\t\"body_html\": \"<p>comment</p>\",\n\t\t\t\t\t\"body_version\": \"version\",\n\t\t\t\t\t\"created_at\": \"2018-01-01T00:00:00Z\",\n\t\t\t\t\t\"last_edited_at\": null,\n\t\t\t\t\t\"discussion_url\": \"https://api.github.com/teams/2/discussions/3\",\n\t\t\t\t\t\"html_url\": \"https://github.com/orgs/1/teams/2/discussions/3/comments/4\",\n\t\t\t\t\t\"node_id\": \"node\",\n\t\t\t\t\t\"number\": 4,\n\t\t\t\t\t\"updated_at\": \"2018-01-01T00:00:00Z\",\n\t\t\t\t\t\"url\": \"https://api.github.com/teams/2/discussions/3/comments/4\"\n\t\t\t\t}\n\t\t\t]`)\n\t}\n\n\twant := []*DiscussionComment{\n\t\t{\n\t\t\tAuthor: &User{\n\t\t\t\tLogin:             Ptr(\"author\"),\n\t\t\t\tID:                Ptr(int64(0)),\n\t\t\t\tAvatarURL:         Ptr(\"https://avatars1.githubusercontent.com/u/0?v=4\"),\n\t\t\t\tGravatarID:        Ptr(\"\"),\n\t\t\t\tURL:               Ptr(\"https://api.github.com/users/author\"),\n\t\t\t\tHTMLURL:           Ptr(\"https://github.com/author\"),\n\t\t\t\tFollowersURL:      Ptr(\"https://api.github.com/users/author/followers\"),\n\t\t\t\tFollowingURL:      Ptr(\"https://api.github.com/users/author/following{/other_user}\"),\n\t\t\t\tGistsURL:          Ptr(\"https://api.github.com/users/author/gists{/gist_id}\"),\n\t\t\t\tStarredURL:        Ptr(\"https://api.github.com/users/author/starred{/owner}{/repo}\"),\n\t\t\t\tSubscriptionsURL:  Ptr(\"https://api.github.com/users/author/subscriptions\"),\n\t\t\t\tOrganizationsURL:  Ptr(\"https://api.github.com/users/author/orgs\"),\n\t\t\t\tReposURL:          Ptr(\"https://api.github.com/users/author/repos\"),\n\t\t\t\tEventsURL:         Ptr(\"https://api.github.com/users/author/events{/privacy}\"),\n\t\t\t\tReceivedEventsURL: Ptr(\"https://api.github.com/users/author/received_events\"),\n\t\t\t\tType:              Ptr(\"User\"),\n\t\t\t\tSiteAdmin:         Ptr(false),\n\t\t\t},\n\t\t\tBody:          Ptr(\"comment\"),\n\t\t\tBodyHTML:      Ptr(\"<p>comment</p>\"),\n\t\t\tBodyVersion:   Ptr(\"version\"),\n\t\t\tCreatedAt:     &Timestamp{time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)},\n\t\t\tLastEditedAt:  nil,\n\t\t\tDiscussionURL: Ptr(\"https://api.github.com/teams/2/discussions/3\"),\n\t\t\tHTMLURL:       Ptr(\"https://github.com/orgs/1/teams/2/discussions/3/comments/4\"),\n\t\t\tNodeID:        Ptr(\"node\"),\n\t\t\tNumber:        Ptr(4),\n\t\t\tUpdatedAt:     &Timestamp{time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)},\n\t\t\tURL:           Ptr(\"https://api.github.com/teams/2/discussions/3/comments/4\"),\n\t\t},\n\t}\n\n\te := tdcEndpointByID(\"1\", \"2\", \"3\", \"\")\n\tmux.HandleFunc(e, handleFunc)\n\n\tctx := t.Context()\n\tcommentsByID, _, err := client.Teams.ListCommentsByID(ctx, 1, 2, 3,\n\t\t&DiscussionCommentListOptions{Direction: \"desc\"})\n\tif err != nil {\n\t\tt.Errorf(\"Teams.ListCommentsByID returned error: %v\", err)\n\t}\n\n\tif !cmp.Equal(commentsByID, want) {\n\t\tt.Errorf(\"Teams.ListCommentsByID returned %+v, want %+v\", commentsByID, want)\n\t}\n\n\te = tdcEndpointBySlug(\"a\", \"b\", \"3\", \"\")\n\tmux.HandleFunc(e, handleFunc)\n\n\tcommentsBySlug, _, err := client.Teams.ListCommentsBySlug(ctx, \"a\", \"b\", 3,\n\t\t&DiscussionCommentListOptions{Direction: \"desc\"})\n\tif err != nil {\n\t\tt.Errorf(\"Teams.ListCommentsBySlug returned error: %v\", err)\n\t}\n\n\tif !cmp.Equal(commentsBySlug, want) {\n\t\tt.Errorf(\"Teams.ListCommentsBySlug returned %+v, want %+v\", commentsBySlug, want)\n\t}\n\n\tmethodName := \"ListCommentsByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.ListCommentsByID(ctx, -1, -2, -3,\n\t\t\t&DiscussionCommentListOptions{Direction: \"desc\"})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.ListCommentsByID(ctx, 1, 2, 3,\n\t\t\t&DiscussionCommentListOptions{Direction: \"desc\"})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n\n\tmethodName = \"ListCommentsBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.ListCommentsBySlug(ctx, \"a\\na\", \"b\\nb\", -3,\n\t\t\t&DiscussionCommentListOptions{Direction: \"desc\"})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.ListCommentsBySlug(ctx, \"a\", \"b\", 3,\n\t\t\t&DiscussionCommentListOptions{Direction: \"desc\"})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_GetComment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\thandlerFunc := func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"number\":4}`)\n\t}\n\twant := &DiscussionComment{Number: Ptr(4)}\n\n\te := tdcEndpointByID(\"1\", \"2\", \"3\", \"4\")\n\tmux.HandleFunc(e, handlerFunc)\n\n\tctx := t.Context()\n\tcommentByID, _, err := client.Teams.GetCommentByID(ctx, 1, 2, 3, 4)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.GetCommentByID returned error: %v\", err)\n\t}\n\n\tif !cmp.Equal(commentByID, want) {\n\t\tt.Errorf(\"Teams.GetCommentByID returned %+v, want %+v\", commentByID, want)\n\t}\n\n\te = tdcEndpointBySlug(\"a\", \"b\", \"3\", \"4\")\n\tmux.HandleFunc(e, handlerFunc)\n\n\tcommentBySlug, _, err := client.Teams.GetCommentBySlug(ctx, \"a\", \"b\", 3, 4)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.GetCommentBySlug returned error: %v\", err)\n\t}\n\n\tif !cmp.Equal(commentBySlug, want) {\n\t\tt.Errorf(\"Teams.GetCommentBySlug returned %+v, want %+v\", commentBySlug, want)\n\t}\n\n\tmethodName := \"GetCommentByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.GetCommentByID(ctx, -1, -2, -3, -4)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.GetCommentByID(ctx, 1, 2, 3, 4)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n\n\tmethodName = \"ListCommentsBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.GetCommentBySlug(ctx, \"a\\na\", \"b\\nb\", -3, -4)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.GetCommentBySlug(ctx, \"a\", \"b\", 3, 4)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_CreateComment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := DiscussionComment{Body: Ptr(\"c\")}\n\n\thandlerFunc := func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *DiscussionComment\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, &input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"number\":4}`)\n\t}\n\twant := &DiscussionComment{Number: Ptr(4)}\n\n\te := tdcEndpointByID(\"1\", \"2\", \"3\", \"\")\n\tmux.HandleFunc(e, handlerFunc)\n\n\tctx := t.Context()\n\tcommentByID, _, err := client.Teams.CreateCommentByID(ctx, 1, 2, 3, input)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.CreateCommentByID returned error: %v\", err)\n\t}\n\n\tif !cmp.Equal(commentByID, want) {\n\t\tt.Errorf(\"Teams.CreateCommentByID returned %+v, want %+v\", commentByID, want)\n\t}\n\n\te = tdcEndpointBySlug(\"a\", \"b\", \"3\", \"\")\n\tmux.HandleFunc(e, handlerFunc)\n\n\tcommentBySlug, _, err := client.Teams.CreateCommentBySlug(ctx, \"a\", \"b\", 3, input)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.CreateCommentBySlug returned error: %v\", err)\n\t}\n\n\tif !cmp.Equal(commentBySlug, want) {\n\t\tt.Errorf(\"Teams.CreateCommentBySlug returned %+v, want %+v\", commentBySlug, want)\n\t}\n\n\tmethodName := \"CreateCommentByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.CreateCommentByID(ctx, -1, -2, -3, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.CreateCommentByID(ctx, 1, 2, 3, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n\n\tmethodName = \"CreateCommentBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.CreateCommentBySlug(ctx, \"a\\na\", \"b\\nb\", -3, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.CreateCommentBySlug(ctx, \"a\", \"b\", 3, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_EditComment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := DiscussionComment{Body: Ptr(\"e\")}\n\thandlerFunc := func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *DiscussionComment\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, &input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"number\":4}`)\n\t}\n\twant := &DiscussionComment{Number: Ptr(4)}\n\n\te := tdcEndpointByID(\"1\", \"2\", \"3\", \"4\")\n\tmux.HandleFunc(e, handlerFunc)\n\n\tctx := t.Context()\n\tcommentByID, _, err := client.Teams.EditCommentByID(ctx, 1, 2, 3, 4, input)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.EditCommentByID returned error: %v\", err)\n\t}\n\n\tif !cmp.Equal(commentByID, want) {\n\t\tt.Errorf(\"Teams.EditCommentByID returned %+v, want %+v\", commentByID, want)\n\t}\n\n\te = tdcEndpointBySlug(\"a\", \"b\", \"3\", \"4\")\n\tmux.HandleFunc(e, handlerFunc)\n\n\tcommentBySlug, _, err := client.Teams.EditCommentBySlug(ctx, \"a\", \"b\", 3, 4, input)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.EditCommentBySlug returned error: %v\", err)\n\t}\n\n\tif !cmp.Equal(commentBySlug, want) {\n\t\tt.Errorf(\"Teams.EditCommentBySlug returned %+v, want %+v\", commentBySlug, want)\n\t}\n\n\tmethodName := \"EditCommentByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.EditCommentByID(ctx, -1, -2, -3, -4, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.EditCommentByID(ctx, 1, 2, 3, 4, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n\n\tmethodName = \"EditCommentBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.EditCommentBySlug(ctx, \"a\\na\", \"b\\nb\", -3, -4, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.EditCommentBySlug(ctx, \"a\", \"b\", 3, 4, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_DeleteComment(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\thandlerFunc := func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t}\n\n\te := tdcEndpointByID(\"1\", \"2\", \"3\", \"4\")\n\tmux.HandleFunc(e, handlerFunc)\n\n\tctx := t.Context()\n\t_, err := client.Teams.DeleteCommentByID(ctx, 1, 2, 3, 4)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.DeleteCommentByID returned error: %v\", err)\n\t}\n\n\te = tdcEndpointBySlug(\"a\", \"b\", \"3\", \"4\")\n\tmux.HandleFunc(e, handlerFunc)\n\n\t_, err = client.Teams.DeleteCommentBySlug(ctx, \"a\", \"b\", 3, 4)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.DeleteCommentBySlug returned error: %v\", err)\n\t}\n\n\tmethodName := \"DeleteCommentByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Teams.DeleteCommentByID(ctx, -1, -2, -3, -4)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tresp, err := client.Teams.DeleteCommentByID(ctx, 1, 2, 3, 4)\n\t\treturn resp, err\n\t})\n\n\tmethodName = \"DeleteCommentBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Teams.DeleteCommentBySlug(ctx, \"a\\na\", \"b\\nb\", -3, -4)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tresp, err := client.Teams.DeleteCommentBySlug(ctx, \"a\", \"b\", 3, 4)\n\t\treturn resp, err\n\t})\n}\n\nfunc TestDiscussionComment_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &DiscussionComment{}, \"{}\")\n\n\tu := &DiscussionComment{\n\t\tAuthor:        &User{},\n\t\tBody:          Ptr(\"body\"),\n\t\tBodyHTML:      Ptr(\"body html\"),\n\t\tBodyVersion:   Ptr(\"body version\"),\n\t\tCreatedAt:     &Timestamp{referenceTime},\n\t\tLastEditedAt:  &Timestamp{referenceTime},\n\t\tDiscussionURL: Ptr(\"url\"),\n\t\tHTMLURL:       Ptr(\"html url\"),\n\t\tNodeID:        Ptr(\"node\"),\n\t\tNumber:        Ptr(1),\n\t\tUpdatedAt:     &Timestamp{referenceTime},\n\t\tURL:           Ptr(\"url\"),\n\t\tReactions: &Reactions{\n\t\t\tTotalCount: Ptr(10),\n\t\t\tPlusOne:    Ptr(1),\n\t\t\tMinusOne:   Ptr(1),\n\t\t\tLaugh:      Ptr(1),\n\t\t\tConfused:   Ptr(1),\n\t\t\tHeart:      Ptr(2),\n\t\t\tHooray:     Ptr(5),\n\t\t\tRocket:     Ptr(3),\n\t\t\tEyes:       Ptr(9),\n\t\t\tURL:        Ptr(\"url\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"author\":{},\n\t\t\"body\":\"body\",\n\t\t\"body_html\":\"body html\",\n\t\t\"body_version\":\"body version\",\n\t\t\"created_at\":` + referenceTimeStr + `,\n\t\t\"last_edited_at\":` + referenceTimeStr + `,\n\t\t\"discussion_url\":\"url\",\n\t\t\"html_url\":\"html url\",\n\t\t\"node_id\":\"node\",\n\t\t\"number\":1,\n\t\t\"updated_at\":` + referenceTimeStr + `,\n\t\t\"url\":\"url\",\n\t\t\"reactions\":{\n\t\t\t\"total_count\": 10,\n\t\t\t\"+1\": 1,\n\t\t\t\"-1\": 1,\n\t\t\t\"laugh\": 1,\n\t\t\t\"confused\": 1,\n\t\t\t\"heart\": 2,\n\t\t\t\"hooray\": 5,\n\t\t\t\"rocket\": 3,\n\t\t\t\"eyes\": 9,\n\t\t\t\"url\":\"url\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/teams_discussions.go",
    "content": "// Copyright 2018 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// TeamDiscussion represents a GitHub discussion in a team.\ntype TeamDiscussion struct {\n\tAuthor        *User      `json:\"author,omitempty\"`\n\tBody          *string    `json:\"body,omitempty\"`\n\tBodyHTML      *string    `json:\"body_html,omitempty\"`\n\tBodyVersion   *string    `json:\"body_version,omitempty\"`\n\tCommentsCount *int       `json:\"comments_count,omitempty\"`\n\tCommentsURL   *string    `json:\"comments_url,omitempty\"`\n\tCreatedAt     *Timestamp `json:\"created_at,omitempty\"`\n\tLastEditedAt  *Timestamp `json:\"last_edited_at,omitempty\"`\n\tHTMLURL       *string    `json:\"html_url,omitempty\"`\n\tNodeID        *string    `json:\"node_id,omitempty\"`\n\tNumber        *int       `json:\"number,omitempty\"`\n\tPinned        *bool      `json:\"pinned,omitempty\"`\n\tPrivate       *bool      `json:\"private,omitempty\"`\n\tTeamURL       *string    `json:\"team_url,omitempty\"`\n\tTitle         *string    `json:\"title,omitempty\"`\n\tUpdatedAt     *Timestamp `json:\"updated_at,omitempty\"`\n\tURL           *string    `json:\"url,omitempty\"`\n\tReactions     *Reactions `json:\"reactions,omitempty\"`\n}\n\nfunc (d TeamDiscussion) String() string {\n\treturn Stringify(d)\n}\n\n// DiscussionListOptions specifies optional parameters to the\n// TeamServices.ListDiscussions method.\ntype DiscussionListOptions struct {\n\t// Sorts the discussion by the date they were created.\n\t// Accepted values are asc and desc. Default is desc.\n\tDirection string `url:\"direction,omitempty\"`\n\n\tListOptions\n}\n\n// ListDiscussionsByID lists all discussions on team's page given Organization and Team ID.\n// Authenticated user must grant read:discussion scope.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussions#list-discussions\n//\n//meta:operation GET /orgs/{org}/teams/{team_slug}/discussions\nfunc (s *TeamsService) ListDiscussionsByID(ctx context.Context, orgID, teamID int64, opts *DiscussionListOptions) ([]*TeamDiscussion, *Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/team/%v/discussions\", orgID, teamID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar teamDiscussions []*TeamDiscussion\n\tresp, err := s.client.Do(ctx, req, &teamDiscussions)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn teamDiscussions, resp, nil\n}\n\n// ListDiscussionsBySlug lists all discussions on team's page given Organization name and Team's slug.\n// Authenticated user must grant read:discussion scope.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussions#list-discussions\n//\n//meta:operation GET /orgs/{org}/teams/{team_slug}/discussions\nfunc (s *TeamsService) ListDiscussionsBySlug(ctx context.Context, org, slug string, opts *DiscussionListOptions) ([]*TeamDiscussion, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v/discussions\", org, slug)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar teamDiscussions []*TeamDiscussion\n\tresp, err := s.client.Do(ctx, req, &teamDiscussions)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn teamDiscussions, resp, nil\n}\n\n// GetDiscussionByID gets a specific discussion on a team's page given Organization and Team ID.\n// Authenticated user must grant read:discussion scope.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussions#get-a-discussion\n//\n//meta:operation GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\nfunc (s *TeamsService) GetDiscussionByID(ctx context.Context, orgID, teamID int64, discussionNumber int) (*TeamDiscussion, *Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/team/%v/discussions/%v\", orgID, teamID, discussionNumber)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar teamDiscussion *TeamDiscussion\n\tresp, err := s.client.Do(ctx, req, &teamDiscussion)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn teamDiscussion, resp, nil\n}\n\n// GetDiscussionBySlug gets a specific discussion on a team's page given Organization name and Team's slug.\n// Authenticated user must grant read:discussion scope.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussions#get-a-discussion\n//\n//meta:operation GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\nfunc (s *TeamsService) GetDiscussionBySlug(ctx context.Context, org, slug string, discussionNumber int) (*TeamDiscussion, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v/discussions/%v\", org, slug, discussionNumber)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar teamDiscussion *TeamDiscussion\n\tresp, err := s.client.Do(ctx, req, &teamDiscussion)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn teamDiscussion, resp, nil\n}\n\n// CreateDiscussionByID creates a new discussion post on a team's page given Organization and Team ID.\n// Authenticated user must grant write:discussion scope.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussions#create-a-discussion\n//\n//meta:operation POST /orgs/{org}/teams/{team_slug}/discussions\nfunc (s *TeamsService) CreateDiscussionByID(ctx context.Context, orgID, teamID int64, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/team/%v/discussions\", orgID, teamID)\n\treq, err := s.client.NewRequest(\"POST\", u, discussion)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar teamDiscussion *TeamDiscussion\n\tresp, err := s.client.Do(ctx, req, &teamDiscussion)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn teamDiscussion, resp, nil\n}\n\n// CreateDiscussionBySlug creates a new discussion post on a team's page given Organization name and Team's slug.\n// Authenticated user must grant write:discussion scope.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussions#create-a-discussion\n//\n//meta:operation POST /orgs/{org}/teams/{team_slug}/discussions\nfunc (s *TeamsService) CreateDiscussionBySlug(ctx context.Context, org, slug string, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v/discussions\", org, slug)\n\treq, err := s.client.NewRequest(\"POST\", u, discussion)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar teamDiscussion *TeamDiscussion\n\tresp, err := s.client.Do(ctx, req, &teamDiscussion)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn teamDiscussion, resp, nil\n}\n\n// EditDiscussionByID edits the title and body text of a discussion post given Organization and Team ID.\n// Authenticated user must grant write:discussion scope.\n// User is allowed to change Title and Body of a discussion only.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussions#update-a-discussion\n//\n//meta:operation PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\nfunc (s *TeamsService) EditDiscussionByID(ctx context.Context, orgID, teamID int64, discussionNumber int, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/team/%v/discussions/%v\", orgID, teamID, discussionNumber)\n\treq, err := s.client.NewRequest(\"PATCH\", u, discussion)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar teamDiscussion *TeamDiscussion\n\tresp, err := s.client.Do(ctx, req, &teamDiscussion)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn teamDiscussion, resp, nil\n}\n\n// EditDiscussionBySlug edits the title and body text of a discussion post given Organization name and Team's slug.\n// Authenticated user must grant write:discussion scope.\n// User is allowed to change Title and Body of a discussion only.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussions#update-a-discussion\n//\n//meta:operation PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\nfunc (s *TeamsService) EditDiscussionBySlug(ctx context.Context, org, slug string, discussionNumber int, discussion TeamDiscussion) (*TeamDiscussion, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v/discussions/%v\", org, slug, discussionNumber)\n\treq, err := s.client.NewRequest(\"PATCH\", u, discussion)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar teamDiscussion *TeamDiscussion\n\tresp, err := s.client.Do(ctx, req, &teamDiscussion)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn teamDiscussion, resp, nil\n}\n\n// DeleteDiscussionByID deletes a discussion from team's page given Organization and Team ID.\n// Authenticated user must grant write:discussion scope.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussions#delete-a-discussion\n//\n//meta:operation DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\nfunc (s *TeamsService) DeleteDiscussionByID(ctx context.Context, orgID, teamID int64, discussionNumber int) (*Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/team/%v/discussions/%v\", orgID, teamID, discussionNumber)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// DeleteDiscussionBySlug deletes a discussion from team's page given Organization name and Team's slug.\n// Authenticated user must grant write:discussion scope.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.13/rest/teams/discussions#delete-a-discussion\n//\n//meta:operation DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\nfunc (s *TeamsService) DeleteDiscussionBySlug(ctx context.Context, org, slug string, discussionNumber int) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v/discussions/%v\", org, slug, discussionNumber)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/teams_discussions_test.go",
    "content": "// Copyright 2018 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestTeamsService_ListDiscussionsByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1/team/2/discussions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"direction\": \"desc\",\n\t\t\t\"page\":      \"2\",\n\t\t})\n\t\tfmt.Fprint(w,\n\t\t\t`[\n\t\t\t\t{\n\t\t\t\t\t\"author\": {\n\t\t\t\t\t\t\"login\": \"author\",\n\t\t\t\t\t\t\"id\": 0,\n\t\t\t\t\t\t\"avatar_url\": \"https://avatars1.githubusercontent.com/u/0?v=4\",\n\t\t\t\t\t\t\"gravatar_id\": \"\",\n\t\t\t\t\t\t\"url\": \"https://api.github.com/users/author\",\n\t\t\t\t\t\t\"html_url\": \"https://github.com/author\",\n\t\t\t\t\t\t\"followers_url\": \"https://api.github.com/users/author/followers\",\n\t\t\t\t\t\t\"following_url\": \"https://api.github.com/users/author/following{/other_user}\",\n\t\t\t\t\t\t\"gists_url\": \"https://api.github.com/users/author/gists{/gist_id}\",\n\t\t\t\t\t\t\"starred_url\": \"https://api.github.com/users/author/starred{/owner}{/repo}\",\n\t\t\t\t\t\t\"subscriptions_url\": \"https://api.github.com/users/author/subscriptions\",\n\t\t\t\t\t\t\"organizations_url\": \"https://api.github.com/users/author/orgs\",\n\t\t\t\t\t\t\"repos_url\": \"https://api.github.com/users/author/repos\",\n\t\t\t\t\t\t\"events_url\": \"https://api.github.com/users/author/events{/privacy}\",\n\t\t\t\t\t\t\"received_events_url\": \"https://api.github.com/users/author/received_events\",\n\t\t\t\t\t\t\"type\": \"User\",\n\t\t\t\t\t\t\"site_admin\": false\n\t\t\t\t\t},\n\t\t\t\t\t\"body\": \"test\",\n\t\t\t\t\t\"body_html\": \"<p>test</p>\",\n\t\t\t\t\t\"body_version\": \"version\",\n\t\t\t\t\t\"comments_count\": 1,\n\t\t\t\t\t\"comments_url\": \"https://api.github.com/teams/2/discussions/3/comments\",\n\t\t\t\t\t\"created_at\": \"2018-01-01T00:00:00Z\",\n\t\t\t\t\t\"last_edited_at\": null,\n\t\t\t\t\t\"html_url\": \"https://github.com/orgs/1/teams/2/discussions/3\",\n\t\t\t\t\t\"node_id\": \"node\",\n\t\t\t\t\t\"number\": 3,\n\t\t\t\t\t\"pinned\": false,\n\t\t\t\t\t\"private\": false,\n\t\t\t\t\t\"team_url\": \"https://api.github.com/teams/2\",\n\t\t\t\t\t\"title\": \"test\",\n\t\t\t\t\t\"updated_at\": \"2018-01-01T00:00:00Z\",\n\t\t\t\t\t\"url\": \"https://api.github.com/teams/2/discussions/3\"\n\t\t\t\t}\n\t\t\t]`)\n\t})\n\tctx := t.Context()\n\tdiscussions, _, err := client.Teams.ListDiscussionsByID(ctx, 1, 2, &DiscussionListOptions{\"desc\", ListOptions{Page: 2}})\n\tif err != nil {\n\t\tt.Errorf(\"Teams.ListDiscussionsByID returned error: %v\", err)\n\t}\n\n\twant := []*TeamDiscussion{\n\t\t{\n\t\t\tAuthor: &User{\n\t\t\t\tLogin:             Ptr(\"author\"),\n\t\t\t\tID:                Ptr(int64(0)),\n\t\t\t\tAvatarURL:         Ptr(\"https://avatars1.githubusercontent.com/u/0?v=4\"),\n\t\t\t\tGravatarID:        Ptr(\"\"),\n\t\t\t\tURL:               Ptr(\"https://api.github.com/users/author\"),\n\t\t\t\tHTMLURL:           Ptr(\"https://github.com/author\"),\n\t\t\t\tFollowersURL:      Ptr(\"https://api.github.com/users/author/followers\"),\n\t\t\t\tFollowingURL:      Ptr(\"https://api.github.com/users/author/following{/other_user}\"),\n\t\t\t\tGistsURL:          Ptr(\"https://api.github.com/users/author/gists{/gist_id}\"),\n\t\t\t\tStarredURL:        Ptr(\"https://api.github.com/users/author/starred{/owner}{/repo}\"),\n\t\t\t\tSubscriptionsURL:  Ptr(\"https://api.github.com/users/author/subscriptions\"),\n\t\t\t\tOrganizationsURL:  Ptr(\"https://api.github.com/users/author/orgs\"),\n\t\t\t\tReposURL:          Ptr(\"https://api.github.com/users/author/repos\"),\n\t\t\t\tEventsURL:         Ptr(\"https://api.github.com/users/author/events{/privacy}\"),\n\t\t\t\tReceivedEventsURL: Ptr(\"https://api.github.com/users/author/received_events\"),\n\t\t\t\tType:              Ptr(\"User\"),\n\t\t\t\tSiteAdmin:         Ptr(false),\n\t\t\t},\n\t\t\tBody:          Ptr(\"test\"),\n\t\t\tBodyHTML:      Ptr(\"<p>test</p>\"),\n\t\t\tBodyVersion:   Ptr(\"version\"),\n\t\t\tCommentsCount: Ptr(1),\n\t\t\tCommentsURL:   Ptr(\"https://api.github.com/teams/2/discussions/3/comments\"),\n\t\t\tCreatedAt:     &Timestamp{time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)},\n\t\t\tLastEditedAt:  nil,\n\t\t\tHTMLURL:       Ptr(\"https://github.com/orgs/1/teams/2/discussions/3\"),\n\t\t\tNodeID:        Ptr(\"node\"),\n\t\t\tNumber:        Ptr(3),\n\t\t\tPinned:        Ptr(false),\n\t\t\tPrivate:       Ptr(false),\n\t\t\tTeamURL:       Ptr(\"https://api.github.com/teams/2\"),\n\t\t\tTitle:         Ptr(\"test\"),\n\t\t\tUpdatedAt:     &Timestamp{time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)},\n\t\t\tURL:           Ptr(\"https://api.github.com/teams/2/discussions/3\"),\n\t\t},\n\t}\n\tif !cmp.Equal(discussions, want) {\n\t\tt.Errorf(\"Teams.ListDiscussionsByID returned %+v, want %+v\", discussions, want)\n\t}\n\n\tconst methodName = \"ListDiscussionsByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.ListDiscussionsByID(ctx, -1, -2, nil)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.ListDiscussionsByID(ctx, 1, 2, &DiscussionListOptions{\"desc\", ListOptions{Page: 2}})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_ListDiscussionsBySlug(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/s/discussions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"direction\": \"desc\",\n\t\t\t\"page\":      \"2\",\n\t\t})\n\t\tfmt.Fprint(w,\n\t\t\t`[\n\t\t\t\t{\n\t\t\t\t\t\"author\": {\n\t\t\t\t\t\t\"login\": \"author\",\n\t\t\t\t\t\t\"id\": 0,\n\t\t\t\t\t\t\"avatar_url\": \"https://avatars1.githubusercontent.com/u/0?v=4\",\n\t\t\t\t\t\t\"gravatar_id\": \"\",\n\t\t\t\t\t\t\"url\": \"https://api.github.com/users/author\",\n\t\t\t\t\t\t\"html_url\": \"https://github.com/author\",\n\t\t\t\t\t\t\"followers_url\": \"https://api.github.com/users/author/followers\",\n\t\t\t\t\t\t\"following_url\": \"https://api.github.com/users/author/following{/other_user}\",\n\t\t\t\t\t\t\"gists_url\": \"https://api.github.com/users/author/gists{/gist_id}\",\n\t\t\t\t\t\t\"starred_url\": \"https://api.github.com/users/author/starred{/owner}{/repo}\",\n\t\t\t\t\t\t\"subscriptions_url\": \"https://api.github.com/users/author/subscriptions\",\n\t\t\t\t\t\t\"organizations_url\": \"https://api.github.com/users/author/orgs\",\n\t\t\t\t\t\t\"repos_url\": \"https://api.github.com/users/author/repos\",\n\t\t\t\t\t\t\"events_url\": \"https://api.github.com/users/author/events{/privacy}\",\n\t\t\t\t\t\t\"received_events_url\": \"https://api.github.com/users/author/received_events\",\n\t\t\t\t\t\t\"type\": \"User\",\n\t\t\t\t\t\t\"site_admin\": false\n\t\t\t\t\t},\n\t\t\t\t\t\"body\": \"test\",\n\t\t\t\t\t\"body_html\": \"<p>test</p>\",\n\t\t\t\t\t\"body_version\": \"version\",\n\t\t\t\t\t\"comments_count\": 1,\n\t\t\t\t\t\"comments_url\": \"https://api.github.com/teams/2/discussions/3/comments\",\n\t\t\t\t\t\"created_at\": \"2018-01-01T00:00:00Z\",\n\t\t\t\t\t\"last_edited_at\": null,\n\t\t\t\t\t\"html_url\": \"https://github.com/orgs/1/teams/2/discussions/3\",\n\t\t\t\t\t\"node_id\": \"node\",\n\t\t\t\t\t\"number\": 3,\n\t\t\t\t\t\"pinned\": false,\n\t\t\t\t\t\"private\": false,\n\t\t\t\t\t\"team_url\": \"https://api.github.com/teams/2\",\n\t\t\t\t\t\"title\": \"test\",\n\t\t\t\t\t\"updated_at\": \"2018-01-01T00:00:00Z\",\n\t\t\t\t\t\"url\": \"https://api.github.com/teams/2/discussions/3\"\n\t\t\t\t}\n\t\t\t]`)\n\t})\n\tctx := t.Context()\n\tdiscussions, _, err := client.Teams.ListDiscussionsBySlug(ctx, \"o\", \"s\", &DiscussionListOptions{\"desc\", ListOptions{Page: 2}})\n\tif err != nil {\n\t\tt.Errorf(\"Teams.ListDiscussionsBySlug returned error: %v\", err)\n\t}\n\n\twant := []*TeamDiscussion{\n\t\t{\n\t\t\tAuthor: &User{\n\t\t\t\tLogin:             Ptr(\"author\"),\n\t\t\t\tID:                Ptr(int64(0)),\n\t\t\t\tAvatarURL:         Ptr(\"https://avatars1.githubusercontent.com/u/0?v=4\"),\n\t\t\t\tGravatarID:        Ptr(\"\"),\n\t\t\t\tURL:               Ptr(\"https://api.github.com/users/author\"),\n\t\t\t\tHTMLURL:           Ptr(\"https://github.com/author\"),\n\t\t\t\tFollowersURL:      Ptr(\"https://api.github.com/users/author/followers\"),\n\t\t\t\tFollowingURL:      Ptr(\"https://api.github.com/users/author/following{/other_user}\"),\n\t\t\t\tGistsURL:          Ptr(\"https://api.github.com/users/author/gists{/gist_id}\"),\n\t\t\t\tStarredURL:        Ptr(\"https://api.github.com/users/author/starred{/owner}{/repo}\"),\n\t\t\t\tSubscriptionsURL:  Ptr(\"https://api.github.com/users/author/subscriptions\"),\n\t\t\t\tOrganizationsURL:  Ptr(\"https://api.github.com/users/author/orgs\"),\n\t\t\t\tReposURL:          Ptr(\"https://api.github.com/users/author/repos\"),\n\t\t\t\tEventsURL:         Ptr(\"https://api.github.com/users/author/events{/privacy}\"),\n\t\t\t\tReceivedEventsURL: Ptr(\"https://api.github.com/users/author/received_events\"),\n\t\t\t\tType:              Ptr(\"User\"),\n\t\t\t\tSiteAdmin:         Ptr(false),\n\t\t\t},\n\t\t\tBody:          Ptr(\"test\"),\n\t\t\tBodyHTML:      Ptr(\"<p>test</p>\"),\n\t\t\tBodyVersion:   Ptr(\"version\"),\n\t\t\tCommentsCount: Ptr(1),\n\t\t\tCommentsURL:   Ptr(\"https://api.github.com/teams/2/discussions/3/comments\"),\n\t\t\tCreatedAt:     &Timestamp{time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)},\n\t\t\tLastEditedAt:  nil,\n\t\t\tHTMLURL:       Ptr(\"https://github.com/orgs/1/teams/2/discussions/3\"),\n\t\t\tNodeID:        Ptr(\"node\"),\n\t\t\tNumber:        Ptr(3),\n\t\t\tPinned:        Ptr(false),\n\t\t\tPrivate:       Ptr(false),\n\t\t\tTeamURL:       Ptr(\"https://api.github.com/teams/2\"),\n\t\t\tTitle:         Ptr(\"test\"),\n\t\t\tUpdatedAt:     &Timestamp{time.Date(2018, time.January, 1, 0, 0, 0, 0, time.UTC)},\n\t\t\tURL:           Ptr(\"https://api.github.com/teams/2/discussions/3\"),\n\t\t},\n\t}\n\tif !cmp.Equal(discussions, want) {\n\t\tt.Errorf(\"Teams.ListDiscussionsBySlug returned %+v, want %+v\", discussions, want)\n\t}\n\n\tconst methodName = \"ListDiscussionsBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.ListDiscussionsBySlug(ctx, \"o\\no\", \"s\\ns\", nil)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.ListDiscussionsBySlug(ctx, \"o\", \"s\", &DiscussionListOptions{\"desc\", ListOptions{Page: 2}})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_GetDiscussionByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1/team/2/discussions/3\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"number\":3}`)\n\t})\n\n\tctx := t.Context()\n\tdiscussion, _, err := client.Teams.GetDiscussionByID(ctx, 1, 2, 3)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.GetDiscussionByID returned error: %v\", err)\n\t}\n\n\twant := &TeamDiscussion{Number: Ptr(3)}\n\tif !cmp.Equal(discussion, want) {\n\t\tt.Errorf(\"Teams.GetDiscussionByID returned %+v, want %+v\", discussion, want)\n\t}\n\n\tconst methodName = \"GetDiscussionByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.GetDiscussionByID(ctx, -1, -2, -3)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.GetDiscussionByID(ctx, 1, 2, 3)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_GetDiscussionBySlug(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/s/discussions/3\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"number\":3}`)\n\t})\n\n\tctx := t.Context()\n\tdiscussion, _, err := client.Teams.GetDiscussionBySlug(ctx, \"o\", \"s\", 3)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.GetDiscussionBySlug returned error: %v\", err)\n\t}\n\n\twant := &TeamDiscussion{Number: Ptr(3)}\n\tif !cmp.Equal(discussion, want) {\n\t\tt.Errorf(\"Teams.GetDiscussionBySlug returned %+v, want %+v\", discussion, want)\n\t}\n\n\tconst methodName = \"GetDiscussionBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.GetDiscussionBySlug(ctx, \"o\\no\", \"s\\ns\", -3)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.GetDiscussionBySlug(ctx, \"o\", \"s\", 3)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_CreateDiscussionByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := TeamDiscussion{Title: Ptr(\"c_t\"), Body: Ptr(\"c_b\")}\n\n\tmux.HandleFunc(\"/organizations/1/team/2/discussions\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *TeamDiscussion\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, &input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"number\":3}`)\n\t})\n\n\tctx := t.Context()\n\tcomment, _, err := client.Teams.CreateDiscussionByID(ctx, 1, 2, input)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.CreateDiscussionByID returned error: %v\", err)\n\t}\n\n\twant := &TeamDiscussion{Number: Ptr(3)}\n\tif !cmp.Equal(comment, want) {\n\t\tt.Errorf(\"Teams.CreateDiscussionByID returned %+v, want %+v\", comment, want)\n\t}\n\n\tconst methodName = \"CreateDiscussionByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.CreateDiscussionByID(ctx, -1, -2, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.CreateDiscussionByID(ctx, 1, 2, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_CreateDiscussionBySlug(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := TeamDiscussion{Title: Ptr(\"c_t\"), Body: Ptr(\"c_b\")}\n\n\tmux.HandleFunc(\"/orgs/o/teams/s/discussions\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *TeamDiscussion\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, &input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"number\":3}`)\n\t})\n\n\tctx := t.Context()\n\tcomment, _, err := client.Teams.CreateDiscussionBySlug(ctx, \"o\", \"s\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.CreateDiscussionBySlug returned error: %v\", err)\n\t}\n\n\twant := &TeamDiscussion{Number: Ptr(3)}\n\tif !cmp.Equal(comment, want) {\n\t\tt.Errorf(\"Teams.CreateDiscussionBySlug returned %+v, want %+v\", comment, want)\n\t}\n\n\tconst methodName = \"CreateDiscussionBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.CreateDiscussionBySlug(ctx, \"o\\no\", \"s\\ns\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.CreateDiscussionBySlug(ctx, \"o\", \"s\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_EditDiscussionByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := TeamDiscussion{Title: Ptr(\"e_t\"), Body: Ptr(\"e_b\")}\n\n\tmux.HandleFunc(\"/organizations/1/team/2/discussions/3\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *TeamDiscussion\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, &input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"number\":3}`)\n\t})\n\n\tctx := t.Context()\n\tcomment, _, err := client.Teams.EditDiscussionByID(ctx, 1, 2, 3, input)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.EditDiscussionByID returned error: %v\", err)\n\t}\n\n\twant := &TeamDiscussion{Number: Ptr(3)}\n\tif !cmp.Equal(comment, want) {\n\t\tt.Errorf(\"Teams.EditDiscussionByID returned %+v, want %+v\", comment, want)\n\t}\n\n\tconst methodName = \"EditDiscussionByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.EditDiscussionByID(ctx, -1, -2, -3, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.EditDiscussionByID(ctx, 1, 2, 3, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_EditDiscussionBySlug(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := TeamDiscussion{Title: Ptr(\"e_t\"), Body: Ptr(\"e_b\")}\n\n\tmux.HandleFunc(\"/orgs/o/teams/s/discussions/3\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *TeamDiscussion\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, &input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"number\":3}`)\n\t})\n\n\tctx := t.Context()\n\tcomment, _, err := client.Teams.EditDiscussionBySlug(ctx, \"o\", \"s\", 3, input)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.EditDiscussionBySlug returned error: %v\", err)\n\t}\n\n\twant := &TeamDiscussion{Number: Ptr(3)}\n\tif !cmp.Equal(comment, want) {\n\t\tt.Errorf(\"Teams.EditDiscussionBySlug returned %+v, want %+v\", comment, want)\n\t}\n\n\tconst methodName = \"EditDiscussionBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.EditDiscussionBySlug(ctx, \"o\\no\", \"s\\ns\", -3, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.EditDiscussionBySlug(ctx, \"o\", \"s\", 3, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_DeleteDiscussionByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1/team/2/discussions/3\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Teams.DeleteDiscussionByID(ctx, 1, 2, 3)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.DeleteDiscussionByID returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteDiscussionByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Teams.DeleteDiscussionByID(ctx, -1, -2, -3)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Teams.DeleteDiscussionByID(ctx, 1, 2, 3)\n\t})\n}\n\nfunc TestTeamsService_DeleteDiscussionBySlug(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/s/discussions/3\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Teams.DeleteDiscussionBySlug(ctx, \"o\", \"s\", 3)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.DeleteDiscussionBySlug returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteDiscussionBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Teams.DeleteDiscussionBySlug(ctx, \"o\\no\", \"s\\ns\", -3)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Teams.DeleteDiscussionBySlug(ctx, \"o\", \"s\", 3)\n\t})\n}\n\nfunc TestTeamDiscussion_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &TeamDiscussion{}, \"{}\")\n\n\tu := &TeamDiscussion{\n\t\tAuthor: &User{\n\t\t\tLogin:       Ptr(\"author\"),\n\t\t\tID:          Ptr(int64(0)),\n\t\t\tURL:         Ptr(\"https://api.github.com/users/author\"),\n\t\t\tAvatarURL:   Ptr(\"https://avatars1.githubusercontent.com/u/0?v=4\"),\n\t\t\tGravatarID:  Ptr(\"\"),\n\t\t\tCreatedAt:   &Timestamp{referenceTime},\n\t\t\tSuspendedAt: &Timestamp{referenceTime},\n\t\t},\n\t\tBody:          Ptr(\"test\"),\n\t\tBodyHTML:      Ptr(\"<p>test</p>\"),\n\t\tBodyVersion:   Ptr(\"version\"),\n\t\tCommentsCount: Ptr(1),\n\t\tCommentsURL:   Ptr(\"https://api.github.com/teams/2/discussions/3/comments\"),\n\t\tCreatedAt:     &Timestamp{referenceTime},\n\t\tLastEditedAt:  &Timestamp{referenceTime},\n\t\tHTMLURL:       Ptr(\"https://api.github.com/teams/2/discussions/3/comments\"),\n\t\tNodeID:        Ptr(\"A123\"),\n\t\tNumber:        Ptr(10),\n\t\tPinned:        Ptr(true),\n\t\tPrivate:       Ptr(false),\n\t\tTeamURL:       Ptr(\"https://api.github.com/teams/2/discussions/3/comments\"),\n\t\tTitle:         Ptr(\"Test\"),\n\t\tUpdatedAt:     &Timestamp{referenceTime},\n\t\tURL:           Ptr(\"https://api.github.com/teams/2/discussions/3/comments\"),\n\t\tReactions: &Reactions{\n\t\t\tTotalCount: Ptr(1),\n\t\t\tPlusOne:    Ptr(2),\n\t\t\tMinusOne:   Ptr(-3),\n\t\t\tLaugh:      Ptr(4),\n\t\t\tConfused:   Ptr(5),\n\t\t\tHeart:      Ptr(6),\n\t\t\tHooray:     Ptr(7),\n\t\t\tRocket:     Ptr(8),\n\t\t\tEyes:       Ptr(9),\n\t\t\tURL:        Ptr(\"https://api.github.com/teams/2/discussions/3/comments\"),\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"author\": {\n\t\t\t\"login\": \"author\",\n\t\t\t\"id\": 0,\n\t\t\t\"avatar_url\": \"https://avatars1.githubusercontent.com/u/0?v=4\",\n\t\t\t\"gravatar_id\": \"\",\n\t\t\t\"url\": \"https://api.github.com/users/author\",\n\t\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\t\"suspended_at\": ` + referenceTimeStr + `\n\t\t},\n\t\t\"body\": \"test\",\n\t\t\"body_html\": \"<p>test</p>\",\n\t\t\"body_version\": \"version\",\n\t\t\"comments_count\": 1,\n\t\t\"comments_url\": \"https://api.github.com/teams/2/discussions/3/comments\",\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"last_edited_at\": ` + referenceTimeStr + `,\n\t\t\"html_url\": \"https://api.github.com/teams/2/discussions/3/comments\",\n\t\t\"node_id\": \"A123\",\n\t\t\"number\": 10,\n\t\t\"pinned\": true,\n\t\t\"private\": false,\n\t\t\"team_url\": \"https://api.github.com/teams/2/discussions/3/comments\",\n\t\t\"title\": \"Test\",\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"url\": \"https://api.github.com/teams/2/discussions/3/comments\",\n\t\t\"reactions\": {\n\t\t\t\"total_count\": 1,\n\t\t\t\"+1\": 2,\n\t\t\t\"-1\": -3,\n\t\t\t\"laugh\": 4,\n\t\t\t\"confused\": 5,\n\t\t\t\"heart\": 6,\n\t\t\t\"hooray\": 7,\n\t\t\t\"rocket\": 8,\n\t\t\t\"eyes\": 9,\n\t\t\t\"url\": \"https://api.github.com/teams/2/discussions/3/comments\"\n\t\t}\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/teams_members.go",
    "content": "// Copyright 2018 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// TeamListTeamMembersOptions specifies the optional parameters to the\n// TeamsService.ListTeamMembers method.\ntype TeamListTeamMembersOptions struct {\n\t// Role filters members returned by their role in the team. Possible\n\t// values are \"all\", \"member\", \"maintainer\". Default is \"all\".\n\tRole string `url:\"role,omitempty\"`\n\n\tListOptions\n}\n\n// ListTeamMembersByID lists all of the users who are members of a team, given a specified\n// organization ID, by team ID.\n//\n// GitHub API docs: https://docs.github.com/rest/teams/members#list-team-members\n//\n//meta:operation GET /orgs/{org}/teams/{team_slug}/members\nfunc (s *TeamsService) ListTeamMembersByID(ctx context.Context, orgID, teamID int64, opts *TeamListTeamMembersOptions) ([]*User, *Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/team/%v/members\", orgID, teamID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar members []*User\n\tresp, err := s.client.Do(ctx, req, &members)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn members, resp, nil\n}\n\n// ListTeamMembersBySlug lists all of the users who are members of a team, given a specified\n// organization name, by team slug.\n//\n// GitHub API docs: https://docs.github.com/rest/teams/members#list-team-members\n//\n//meta:operation GET /orgs/{org}/teams/{team_slug}/members\nfunc (s *TeamsService) ListTeamMembersBySlug(ctx context.Context, org, slug string, opts *TeamListTeamMembersOptions) ([]*User, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v/members\", org, slug)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar members []*User\n\tresp, err := s.client.Do(ctx, req, &members)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn members, resp, nil\n}\n\n// GetTeamMembershipByID returns the membership status for a user in a team, given a specified\n// organization ID, by team ID.\n//\n// GitHub API docs: https://docs.github.com/rest/teams/members#list-team-members\n//\n//meta:operation GET /orgs/{org}/teams/{team_slug}/members\nfunc (s *TeamsService) GetTeamMembershipByID(ctx context.Context, orgID, teamID int64, user string) (*Membership, *Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/team/%v/memberships/%v\", orgID, teamID, user)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar t *Membership\n\tresp, err := s.client.Do(ctx, req, &t)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn t, resp, nil\n}\n\n// GetTeamMembershipBySlug returns the membership status for a user in a team, given a specified\n// organization name, by team slug.\n//\n// GitHub API docs: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user\n//\n//meta:operation GET /orgs/{org}/teams/{team_slug}/memberships/{username}\nfunc (s *TeamsService) GetTeamMembershipBySlug(ctx context.Context, org, slug, user string) (*Membership, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v/memberships/%v\", org, slug, user)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar t *Membership\n\tresp, err := s.client.Do(ctx, req, &t)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn t, resp, nil\n}\n\n// TeamAddTeamMembershipOptions specifies the optional\n// parameters to the TeamsService.AddTeamMembership method.\ntype TeamAddTeamMembershipOptions struct {\n\t// Role specifies the role the user should have in the team. Possible\n\t// values are:\n\t//     member - a normal member of the team\n\t//     maintainer - a team maintainer. Able to add/remove other team\n\t//                  members, promote other team members to team\n\t//                  maintainer, and edit the team’s name and description\n\t//\n\t// Default value is \"member\".\n\tRole string `json:\"role,omitempty\"`\n}\n\n// AddTeamMembershipByID adds or invites a user to a team, given a specified\n// organization ID, by team ID.\n//\n// GitHub API docs: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user\n//\n//meta:operation PUT /orgs/{org}/teams/{team_slug}/memberships/{username}\nfunc (s *TeamsService) AddTeamMembershipByID(ctx context.Context, orgID, teamID int64, user string, opts *TeamAddTeamMembershipOptions) (*Membership, *Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/team/%v/memberships/%v\", orgID, teamID, user)\n\treq, err := s.client.NewRequest(\"PUT\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar t *Membership\n\tresp, err := s.client.Do(ctx, req, &t)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn t, resp, nil\n}\n\n// AddTeamMembershipBySlug adds or invites a user to a team, given a specified\n// organization name, by team slug.\n//\n// GitHub API docs: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user\n//\n//meta:operation PUT /orgs/{org}/teams/{team_slug}/memberships/{username}\nfunc (s *TeamsService) AddTeamMembershipBySlug(ctx context.Context, org, slug, user string, opts *TeamAddTeamMembershipOptions) (*Membership, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v/memberships/%v\", org, slug, user)\n\treq, err := s.client.NewRequest(\"PUT\", u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar t *Membership\n\tresp, err := s.client.Do(ctx, req, &t)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn t, resp, nil\n}\n\n// RemoveTeamMembershipByID removes a user from a team, given a specified\n// organization ID, by team ID.\n//\n// GitHub API docs: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user\n//\n//meta:operation DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}\nfunc (s *TeamsService) RemoveTeamMembershipByID(ctx context.Context, orgID, teamID int64, user string) (*Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/team/%v/memberships/%v\", orgID, teamID, user)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// RemoveTeamMembershipBySlug removes a user from a team, given a specified\n// organization name, by team slug.\n//\n// GitHub API docs: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user\n//\n//meta:operation DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}\nfunc (s *TeamsService) RemoveTeamMembershipBySlug(ctx context.Context, org, slug, user string) (*Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v/memberships/%v\", org, slug, user)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// ListPendingTeamInvitationsByID gets pending invitation list of a team, given a specified\n// organization ID, by team ID.\n//\n// GitHub API docs: https://docs.github.com/rest/teams/members#list-pending-team-invitations\n//\n//meta:operation GET /orgs/{org}/teams/{team_slug}/invitations\nfunc (s *TeamsService) ListPendingTeamInvitationsByID(ctx context.Context, orgID, teamID int64, opts *ListOptions) ([]*Invitation, *Response, error) {\n\tu := fmt.Sprintf(\"organizations/%v/team/%v/invitations\", orgID, teamID)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar pendingInvitations []*Invitation\n\tresp, err := s.client.Do(ctx, req, &pendingInvitations)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn pendingInvitations, resp, nil\n}\n\n// ListPendingTeamInvitationsBySlug get pending invitation list of a team, given a specified\n// organization name, by team slug.\n//\n// GitHub API docs: https://docs.github.com/rest/teams/members#list-pending-team-invitations\n//\n//meta:operation GET /orgs/{org}/teams/{team_slug}/invitations\nfunc (s *TeamsService) ListPendingTeamInvitationsBySlug(ctx context.Context, org, slug string, opts *ListOptions) ([]*Invitation, *Response, error) {\n\tu := fmt.Sprintf(\"orgs/%v/teams/%v/invitations\", org, slug)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar pendingInvitations []*Invitation\n\tresp, err := s.client.Do(ctx, req, &pendingInvitations)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn pendingInvitations, resp, nil\n}\n"
  },
  {
    "path": "github/teams_members_test.go",
    "content": "// Copyright 2018 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestTeamsService__ListTeamMembersByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1/team/2/members\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"role\": \"member\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &TeamListTeamMembersOptions{Role: \"member\", ListOptions: ListOptions{Page: 2}}\n\tctx := t.Context()\n\tmembers, _, err := client.Teams.ListTeamMembersByID(ctx, 1, 2, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.ListTeamMembersByID returned error: %v\", err)\n\t}\n\n\twant := []*User{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(members, want) {\n\t\tt.Errorf(\"Teams.ListTeamMembersByID returned %+v, want %+v\", members, want)\n\t}\n\n\tconst methodName = \"ListTeamMembersByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.ListTeamMembersByID(ctx, -1, -2, opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.ListTeamMembersByID(ctx, 1, 2, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService__ListTeamMembersByID_notFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1/team/2/members\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"role\": \"member\", \"page\": \"2\"})\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\topt := &TeamListTeamMembersOptions{Role: \"member\", ListOptions: ListOptions{Page: 2}}\n\tctx := t.Context()\n\tmembers, resp, err := client.Teams.ListTeamMembersByID(ctx, 1, 2, opt)\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Teams.ListTeamMembersByID returned status %v, want %v\", got, want)\n\t}\n\tif members != nil {\n\t\tt.Errorf(\"Teams.ListTeamMembersByID returned %+v, want nil\", members)\n\t}\n\n\tconst methodName = \"ListTeamMembersByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.ListTeamMembersByID(ctx, 1, 2, opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.ListTeamMembersByID(ctx, 1, 2, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService__ListTeamMembersBySlug(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/s/members\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"role\": \"member\", \"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &TeamListTeamMembersOptions{Role: \"member\", ListOptions: ListOptions{Page: 2}}\n\tctx := t.Context()\n\tmembers, _, err := client.Teams.ListTeamMembersBySlug(ctx, \"o\", \"s\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.ListTeamMembersBySlug returned error: %v\", err)\n\t}\n\n\twant := []*User{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(members, want) {\n\t\tt.Errorf(\"Teams.ListTeamMembersBySlug returned %+v, want %+v\", members, want)\n\t}\n\n\tconst methodName = \"ListTeamMembersBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.ListTeamMembersBySlug(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.ListTeamMembersBySlug(ctx, \"o\", \"s\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService__ListTeamMembersBySlug_notFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/s/members\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"role\": \"member\", \"page\": \"2\"})\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\topt := &TeamListTeamMembersOptions{Role: \"member\", ListOptions: ListOptions{Page: 2}}\n\tctx := t.Context()\n\tmembers, resp, err := client.Teams.ListTeamMembersBySlug(ctx, \"o\", \"s\", opt)\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Teams.ListTeamMembersBySlug returned status %v, want %v\", got, want)\n\t}\n\tif members != nil {\n\t\tt.Errorf(\"Teams.ListTeamMembersBySlug returned %+v, want nil\", members)\n\t}\n\n\tconst methodName = \"ListTeamMembersBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.ListTeamMembersBySlug(ctx, \"o\", \"s\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.ListTeamMembersBySlug(ctx, \"o\", \"s\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService__ListTeamMembersBySlug_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Teams.ListTeamMembersBySlug(ctx, \"%\", \"s\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestTeamsService__GetTeamMembershipByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1/team/2/memberships/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"url\":\"u\", \"state\":\"active\"}`)\n\t})\n\n\tctx := t.Context()\n\tmembership, _, err := client.Teams.GetTeamMembershipByID(ctx, 1, 2, \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Teams.GetTeamMembershipByID returned error: %v\", err)\n\t}\n\n\twant := &Membership{URL: Ptr(\"u\"), State: Ptr(\"active\")}\n\tif !cmp.Equal(membership, want) {\n\t\tt.Errorf(\"Teams.GetTeamMembershipByID returned %+v, want %+v\", membership, want)\n\t}\n\n\tconst methodName = \"GetTeamMembershipByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.GetTeamMembershipByID(ctx, -1, -2, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.GetTeamMembershipByID(ctx, 1, 2, \"u\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService__GetTeamMembershipByID_notFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1/team/2/memberships/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tmembership, resp, err := client.Teams.GetTeamMembershipByID(ctx, 1, 2, \"u\")\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Teams.GetTeamMembershipByID returned status %v, want %v\", got, want)\n\t}\n\tif membership != nil {\n\t\tt.Errorf(\"Teams.GetTeamMembershipByID returned %+v, want nil\", membership)\n\t}\n\n\tconst methodName = \"GetTeamMembershipByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.GetTeamMembershipByID(ctx, 1, 2, \"u\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.GetTeamMembershipByID(ctx, 1, 2, \"u\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService__GetTeamMembershipBySlug(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/s/memberships/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"url\":\"u\", \"state\":\"active\"}`)\n\t})\n\n\tctx := t.Context()\n\tmembership, _, err := client.Teams.GetTeamMembershipBySlug(ctx, \"o\", \"s\", \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Teams.GetTeamMembershipBySlug returned error: %v\", err)\n\t}\n\n\twant := &Membership{URL: Ptr(\"u\"), State: Ptr(\"active\")}\n\tif !cmp.Equal(membership, want) {\n\t\tt.Errorf(\"Teams.GetTeamMembershipBySlug returned %+v, want %+v\", membership, want)\n\t}\n\n\tconst methodName = \"GetTeamMembershipBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.GetTeamMembershipBySlug(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.GetTeamMembershipBySlug(ctx, \"o\", \"s\", \"u\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService__GetTeamMembershipBySlug_notFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/s/memberships/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tmembership, resp, err := client.Teams.GetTeamMembershipBySlug(ctx, \"o\", \"s\", \"u\")\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Teams.GetTeamMembershipBySlug returned status %v, want %v\", got, want)\n\t}\n\tif membership != nil {\n\t\tt.Errorf(\"Teams.GetTeamMembershipBySlug returned %+v, want nil\", membership)\n\t}\n\n\tconst methodName = \"GetTeamMembershipBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.GetTeamMembershipBySlug(ctx, \"o\", \"s\", \"u\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.GetTeamMembershipBySlug(ctx, \"o\", \"s\", \"u\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService__GetTeamMembershipBySlug_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Teams.GetTeamMembershipBySlug(ctx, \"%v\", \"s\", \"u\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestTeamsService__AddTeamMembershipByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\topt := &TeamAddTeamMembershipOptions{Role: \"maintainer\"}\n\n\tmux.HandleFunc(\"/organizations/1/team/2/memberships/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *TeamAddTeamMembershipOptions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, opt) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, opt)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"url\":\"u\", \"state\":\"pending\"}`)\n\t})\n\n\tctx := t.Context()\n\tmembership, _, err := client.Teams.AddTeamMembershipByID(ctx, 1, 2, \"u\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.AddTeamMembershipByID returned error: %v\", err)\n\t}\n\n\twant := &Membership{URL: Ptr(\"u\"), State: Ptr(\"pending\")}\n\tif !cmp.Equal(membership, want) {\n\t\tt.Errorf(\"Teams.AddTeamMembershipByID returned %+v, want %+v\", membership, want)\n\t}\n\n\tconst methodName = \"AddTeamMembershipByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.AddTeamMembershipByID(ctx, -1, -2, \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.AddTeamMembershipByID(ctx, 1, 2, \"u\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService__AddTeamMembershipByID_notFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\topt := &TeamAddTeamMembershipOptions{Role: \"maintainer\"}\n\n\tmux.HandleFunc(\"/organizations/1/team/2/memberships/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *TeamAddTeamMembershipOptions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, opt) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, opt)\n\t\t}\n\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tmembership, resp, err := client.Teams.AddTeamMembershipByID(ctx, 1, 2, \"u\", opt)\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Teams.AddTeamMembershipByID returned status %v, want %v\", got, want)\n\t}\n\tif membership != nil {\n\t\tt.Errorf(\"Teams.AddTeamMembershipByID returned %+v, want nil\", membership)\n\t}\n\n\tconst methodName = \"AddTeamMembershipByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.AddTeamMembershipByID(ctx, 1, 2, \"u\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.AddTeamMembershipByID(ctx, 1, 2, \"u\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService__AddTeamMembershipBySlug(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\topt := &TeamAddTeamMembershipOptions{Role: \"maintainer\"}\n\n\tmux.HandleFunc(\"/orgs/o/teams/s/memberships/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *TeamAddTeamMembershipOptions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, opt) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, opt)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"url\":\"u\", \"state\":\"pending\"}`)\n\t})\n\n\tctx := t.Context()\n\tmembership, _, err := client.Teams.AddTeamMembershipBySlug(ctx, \"o\", \"s\", \"u\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.AddTeamMembershipBySlug returned error: %v\", err)\n\t}\n\n\twant := &Membership{URL: Ptr(\"u\"), State: Ptr(\"pending\")}\n\tif !cmp.Equal(membership, want) {\n\t\tt.Errorf(\"Teams.AddTeamMembershipBySlug returned %+v, want %+v\", membership, want)\n\t}\n\n\tconst methodName = \"AddTeamMembershipBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.AddTeamMembershipBySlug(ctx, \"\\n\", \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.AddTeamMembershipBySlug(ctx, \"o\", \"s\", \"u\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService__AddTeamMembershipBySlug_notFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\topt := &TeamAddTeamMembershipOptions{Role: \"maintainer\"}\n\n\tmux.HandleFunc(\"/orgs/o/teams/s/memberships/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *TeamAddTeamMembershipOptions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, opt) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, opt)\n\t\t}\n\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tmembership, resp, err := client.Teams.AddTeamMembershipBySlug(ctx, \"o\", \"s\", \"u\", opt)\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Teams.AddTeamMembershipBySlug returned status %v, want %v\", got, want)\n\t}\n\tif membership != nil {\n\t\tt.Errorf(\"Teams.AddTeamMembershipBySlug returned %+v, want nil\", membership)\n\t}\n\n\tconst methodName = \"AddTeamMembershipBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.AddTeamMembershipBySlug(ctx, \"o\", \"s\", \"u\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.AddTeamMembershipBySlug(ctx, \"o\", \"s\", \"u\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService__AddTeamMembershipBySlug_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Teams.AddTeamMembershipBySlug(ctx, \"%\", \"s\", \"u\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestTeamsService__RemoveTeamMembershipByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1/team/2/memberships/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Teams.RemoveTeamMembershipByID(ctx, 1, 2, \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Teams.RemoveTeamMembershipByID returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveTeamMembershipByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Teams.RemoveTeamMembershipByID(ctx, -1, -2, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Teams.RemoveTeamMembershipByID(ctx, 1, 2, \"u\")\n\t})\n}\n\nfunc TestTeamsService__RemoveTeamMembershipByID_notFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1/team/2/memberships/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Teams.RemoveTeamMembershipByID(ctx, 1, 2, \"u\")\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Teams.RemoveTeamMembershipByID returned status %v, want %v\", got, want)\n\t}\n\n\tconst methodName = \"RemoveTeamMembershipByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Teams.RemoveTeamMembershipByID(ctx, 1, 2, \"u\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Teams.RemoveTeamMembershipByID(ctx, 1, 2, \"u\")\n\t})\n}\n\nfunc TestTeamsService__RemoveTeamMembershipBySlug(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/s/memberships/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Teams.RemoveTeamMembershipBySlug(ctx, \"o\", \"s\", \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Teams.RemoveTeamMembershipBySlug returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveTeamMembershipBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Teams.RemoveTeamMembershipBySlug(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Teams.RemoveTeamMembershipBySlug(ctx, \"o\", \"s\", \"u\")\n\t})\n}\n\nfunc TestTeamsService__RemoveTeamMembershipBySlug_notFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/s/memberships/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Teams.RemoveTeamMembershipBySlug(ctx, \"o\", \"s\", \"u\")\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Teams.RemoveTeamMembershipBySlug returned status %v, want %v\", got, want)\n\t}\n\n\tconst methodName = \"RemoveTeamMembershipBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Teams.RemoveTeamMembershipBySlug(ctx, \"o\", \"s\", \"u\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Teams.RemoveTeamMembershipBySlug(ctx, \"o\", \"s\", \"u\")\n\t})\n}\n\nfunc TestTeamsService__RemoveTeamMembershipBySlug_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Teams.RemoveTeamMembershipBySlug(ctx, \"%\", \"s\", \"u\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestTeamsService__ListPendingTeamInvitationsByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1/team/2/invitations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tinvitations, _, err := client.Teams.ListPendingTeamInvitationsByID(ctx, 1, 2, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.ListPendingTeamInvitationsByID returned error: %v\", err)\n\t}\n\n\twant := []*Invitation{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(invitations, want) {\n\t\tt.Errorf(\"Teams.ListPendingTeamInvitationsByID returned %+v, want %+v\", invitations, want)\n\t}\n\n\tconst methodName = \"ListPendingTeamInvitationsByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.ListPendingTeamInvitationsByID(ctx, -1, -2, opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.ListPendingTeamInvitationsByID(ctx, 1, 2, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService__ListPendingTeamInvitationsByID_notFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1/team/2/invitations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tinvitations, resp, err := client.Teams.ListPendingTeamInvitationsByID(ctx, 1, 2, opt)\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Teams.RemoveTeamMembershipByID returned status %v, want %v\", got, want)\n\t}\n\tif invitations != nil {\n\t\tt.Errorf(\"Teams.RemoveTeamMembershipByID returned %+v, want nil\", invitations)\n\t}\n\n\tconst methodName = \"ListPendingTeamInvitationsByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.ListPendingTeamInvitationsByID(ctx, 1, 2, opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.ListPendingTeamInvitationsByID(ctx, 1, 2, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService__ListPendingTeamInvitationsBySlug(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/s/invitations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tinvitations, _, err := client.Teams.ListPendingTeamInvitationsBySlug(ctx, \"o\", \"s\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.ListPendingTeamInvitationsByID returned error: %v\", err)\n\t}\n\n\twant := []*Invitation{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(invitations, want) {\n\t\tt.Errorf(\"Teams.ListPendingTeamInvitationsByID returned %+v, want %+v\", invitations, want)\n\t}\n\n\tconst methodName = \"ListPendingTeamInvitationsBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.ListPendingTeamInvitationsBySlug(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.ListPendingTeamInvitationsBySlug(ctx, \"o\", \"s\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService__ListPendingTeamInvitationsBySlug_notFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/s/invitations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tinvitations, resp, err := client.Teams.ListPendingTeamInvitationsBySlug(ctx, \"o\", \"s\", opt)\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Teams.RemoveTeamMembershipByID returned status %v, want %v\", got, want)\n\t}\n\tif invitations != nil {\n\t\tt.Errorf(\"Teams.RemoveTeamMembershipByID returned %+v, want nil\", invitations)\n\t}\n\n\tconst methodName = \"ListPendingTeamInvitationsBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.ListPendingTeamInvitationsBySlug(ctx, \"o\", \"s\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.ListPendingTeamInvitationsBySlug(ctx, \"o\", \"s\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService__ListPendingTeamInvitationsBySlug_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Teams.ListPendingTeamInvitationsBySlug(ctx, \"%\", \"s\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestTeamAddTeamMembershipOptions_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &TeamAddTeamMembershipOptions{}, \"{}\")\n\n\tu := &TeamAddTeamMembershipOptions{\n\t\tRole: \"role\",\n\t}\n\n\twant := `{\n\t\t\"role\": \"role\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/teams_test.go",
    "content": "// Copyright 2018 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestTeamsService_ListTeams(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tteams, _, err := client.Teams.ListTeams(ctx, \"o\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.ListTeams returned error: %v\", err)\n\t}\n\n\twant := []*Team{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(teams, want) {\n\t\tt.Errorf(\"Teams.ListTeams returned %+v, want %+v\", teams, want)\n\t}\n\n\tconst methodName = \"ListTeams\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.ListTeams(ctx, \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.ListTeams(ctx, \"o\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_ListTeams_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Teams.ListTeams(ctx, \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestTeamsService_GetTeamByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1/team/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1, \"name\":\"n\", \"description\": \"d\", \"url\":\"u\", \"slug\": \"s\", \"permission\":\"p\", \"ldap_dn\":\"cn=n,ou=groups,dc=example,dc=com\", \"type\": \"organization\", \"parent\":null}`)\n\t})\n\n\tctx := t.Context()\n\tteam, _, err := client.Teams.GetTeamByID(ctx, 1, 1)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.GetTeamByID returned error: %v\", err)\n\t}\n\n\twant := &Team{ID: Ptr(int64(1)), Name: Ptr(\"n\"), Description: Ptr(\"d\"), URL: Ptr(\"u\"), Slug: Ptr(\"s\"), Permission: Ptr(\"p\"), LDAPDN: Ptr(\"cn=n,ou=groups,dc=example,dc=com\"), Type: Ptr(\"organization\")}\n\tif !cmp.Equal(team, want) {\n\t\tt.Errorf(\"Teams.GetTeamByID returned %+v, want %+v\", team, want)\n\t}\n\n\tconst methodName = \"GetTeamByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.GetTeamByID(ctx, -1, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.GetTeamByID(ctx, 1, 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_GetTeamByID_notFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1/team/2\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tteam, resp, err := client.Teams.GetTeamByID(ctx, 1, 2)\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Teams.GetTeamByID returned status %v, want %v\", got, want)\n\t}\n\tif team != nil {\n\t\tt.Errorf(\"Teams.GetTeamByID returned %+v, want nil\", team)\n\t}\n}\n\nfunc TestTeamsService_GetTeamBySlug(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/s\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1, \"name\":\"n\", \"description\": \"d\", \"url\":\"u\", \"slug\": \"s\", \"permission\":\"p\", \"ldap_dn\":\"cn=n,ou=groups,dc=example,dc=com\", \"type\": \"organization\", \"parent\":null}`)\n\t})\n\n\tctx := t.Context()\n\tteam, _, err := client.Teams.GetTeamBySlug(ctx, \"o\", \"s\")\n\tif err != nil {\n\t\tt.Errorf(\"Teams.GetTeamBySlug returned error: %v\", err)\n\t}\n\n\twant := &Team{ID: Ptr(int64(1)), Name: Ptr(\"n\"), Description: Ptr(\"d\"), URL: Ptr(\"u\"), Slug: Ptr(\"s\"), Permission: Ptr(\"p\"), LDAPDN: Ptr(\"cn=n,ou=groups,dc=example,dc=com\"), Type: Ptr(\"organization\")}\n\tif !cmp.Equal(team, want) {\n\t\tt.Errorf(\"Teams.GetTeamBySlug returned %+v, want %+v\", team, want)\n\t}\n\n\tconst methodName = \"GetTeamBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.GetTeamBySlug(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.GetTeamBySlug(ctx, \"o\", \"s\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_GetTeamBySlug_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Teams.GetTeamBySlug(ctx, \"%\", \"s\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestTeamsService_GetTeamBySlug_notFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/s\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tteam, resp, err := client.Teams.GetTeamBySlug(ctx, \"o\", \"s\")\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Teams.GetTeamBySlug returned status %v, want %v\", got, want)\n\t}\n\tif team != nil {\n\t\tt.Errorf(\"Teams.GetTeamBySlug returned %+v, want nil\", team)\n\t}\n}\n\nfunc TestTeamsService_CreateTeam(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := NewTeam{Name: \"n\", Privacy: Ptr(\"closed\"), RepoNames: []string{\"r\"}}\n\n\tmux.HandleFunc(\"/orgs/o/teams\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *NewTeam\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, &input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tteam, _, err := client.Teams.CreateTeam(ctx, \"o\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.CreateTeam returned error: %v\", err)\n\t}\n\n\twant := &Team{ID: Ptr(int64(1))}\n\tif !cmp.Equal(team, want) {\n\t\tt.Errorf(\"Teams.CreateTeam returned %+v, want %+v\", team, want)\n\t}\n\n\tconst methodName = \"CreateTeam\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.CreateTeam(ctx, \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.CreateTeam(ctx, \"o\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_CreateTeam_invalidOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Teams.CreateTeam(ctx, \"%\", NewTeam{})\n\ttestURLParseError(t, err)\n}\n\nfunc TestTeamsService_EditTeamByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := NewTeam{Name: \"n\", Privacy: Ptr(\"closed\")}\n\n\tmux.HandleFunc(\"/organizations/1/team/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *NewTeam\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, &input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tteam, _, err := client.Teams.EditTeamByID(ctx, 1, 1, input, false)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.EditTeamByID returned error: %v\", err)\n\t}\n\n\twant := &Team{ID: Ptr(int64(1))}\n\tif !cmp.Equal(team, want) {\n\t\tt.Errorf(\"Teams.EditTeamByID returned %+v, want %+v\", team, want)\n\t}\n\n\tconst methodName = \"EditTeamByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.EditTeamByID(ctx, -1, -1, input, false)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.EditTeamByID(ctx, 1, 1, input, false)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_EditTeamByID_RemoveParent(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := NewTeam{Name: \"n\", NotificationSetting: Ptr(\"notifications_enabled\"), Privacy: Ptr(\"closed\")}\n\tvar body string\n\n\tmux.HandleFunc(\"/organizations/1/team/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\tbuf, err := io.ReadAll(r.Body)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unable to read body: %v\", err)\n\t\t}\n\t\tbody = string(buf)\n\t\tvar v *NewTeam\n\t\tassertNilError(t, json.NewDecoder(bytes.NewBuffer(buf)).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, &input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tteam, _, err := client.Teams.EditTeamByID(ctx, 1, 1, input, true)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.EditTeamByID returned error: %v\", err)\n\t}\n\n\twant := &Team{ID: Ptr(int64(1))}\n\tif !cmp.Equal(team, want) {\n\t\tt.Errorf(\"Teams.EditTeamByID returned %+v, want %+v\", team, want)\n\t}\n\n\tif want := `{\"name\":\"n\",\"parent_team_id\":null,\"notification_setting\":\"notifications_enabled\",\"privacy\":\"closed\"}` + \"\\n\"; body != want {\n\t\tt.Errorf(\"Teams.EditTeamByID body = %+v, want %+v\", body, want)\n\t}\n}\n\nfunc TestTeamsService_EditTeamBySlug(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := NewTeam{Name: \"n\", Privacy: Ptr(\"closed\")}\n\n\tmux.HandleFunc(\"/orgs/o/teams/s\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *NewTeam\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, &input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tteam, _, err := client.Teams.EditTeamBySlug(ctx, \"o\", \"s\", input, false)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.EditTeamBySlug returned error: %v\", err)\n\t}\n\n\twant := &Team{ID: Ptr(int64(1))}\n\tif !cmp.Equal(team, want) {\n\t\tt.Errorf(\"Teams.EditTeamBySlug returned %+v, want %+v\", team, want)\n\t}\n\n\tconst methodName = \"EditTeamBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.EditTeamBySlug(ctx, \"\\n\", \"\\n\", input, false)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.EditTeamBySlug(ctx, \"o\", \"s\", input, false)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_EditTeamBySlug_RemoveParent(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := NewTeam{Name: \"n\", NotificationSetting: Ptr(\"notifications_disabled\"), Privacy: Ptr(\"closed\")}\n\tvar body string\n\n\tmux.HandleFunc(\"/orgs/o/teams/s\", func(w http.ResponseWriter, r *http.Request) {\n\t\tbuf, err := io.ReadAll(r.Body)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"Unable to read body: %v\", err)\n\t\t}\n\t\tbody = string(buf)\n\t\tvar v *NewTeam\n\t\tassertNilError(t, json.NewDecoder(bytes.NewBuffer(buf)).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, &input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tteam, _, err := client.Teams.EditTeamBySlug(ctx, \"o\", \"s\", input, true)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.EditTeam returned error: %v\", err)\n\t}\n\n\twant := &Team{ID: Ptr(int64(1))}\n\tif !cmp.Equal(team, want) {\n\t\tt.Errorf(\"Teams.EditTeam returned %+v, want %+v\", team, want)\n\t}\n\n\tif want := `{\"name\":\"n\",\"parent_team_id\":null,\"notification_setting\":\"notifications_disabled\",\"privacy\":\"closed\"}` + \"\\n\"; body != want {\n\t\tt.Errorf(\"Teams.EditTeam body = %+v, want %+v\", body, want)\n\t}\n}\n\nfunc TestTeamsService_DeleteTeamByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1/team/1\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Teams.DeleteTeamByID(ctx, 1, 1)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.DeleteTeamByID returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteTeamByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Teams.DeleteTeamByID(ctx, -1, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Teams.DeleteTeamByID(ctx, 1, 1)\n\t})\n}\n\nfunc TestTeamsService_DeleteTeamBySlug(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/s\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Teams.DeleteTeamBySlug(ctx, \"o\", \"s\")\n\tif err != nil {\n\t\tt.Errorf(\"Teams.DeleteTeamBySlug returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteTeamBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Teams.DeleteTeamBySlug(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Teams.DeleteTeamBySlug(ctx, \"o\", \"s\")\n\t})\n}\n\nfunc TestTeamsService_ListChildTeamsByParentID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1/team/2/teams\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":2}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tteams, _, err := client.Teams.ListChildTeamsByParentID(ctx, 1, 2, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.ListChildTeamsByParentID returned error: %v\", err)\n\t}\n\n\twant := []*Team{{ID: Ptr(int64(2))}}\n\tif !cmp.Equal(teams, want) {\n\t\tt.Errorf(\"Teams.ListChildTeamsByParentID returned %+v, want %+v\", teams, want)\n\t}\n\n\tconst methodName = \"ListChildTeamsByParentID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.ListChildTeamsByParentID(ctx, -1, -2, opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.ListChildTeamsByParentID(ctx, 1, 2, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_ListChildTeamsByParentSlug(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/s/teams\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":2}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tteams, _, err := client.Teams.ListChildTeamsByParentSlug(ctx, \"o\", \"s\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.ListChildTeamsByParentSlug returned error: %v\", err)\n\t}\n\n\twant := []*Team{{ID: Ptr(int64(2))}}\n\tif !cmp.Equal(teams, want) {\n\t\tt.Errorf(\"Teams.ListChildTeamsByParentSlug returned %+v, want %+v\", teams, want)\n\t}\n\n\tconst methodName = \"ListChildTeamsByParentSlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.ListChildTeamsByParentSlug(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.ListChildTeamsByParentSlug(ctx, \"o\", \"s\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_ListTeamReposByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1/team/1/repos\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeTopicsPreview)\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tmembers, _, err := client.Teams.ListTeamReposByID(ctx, 1, 1, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.ListTeamReposByID returned error: %v\", err)\n\t}\n\n\twant := []*Repository{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(members, want) {\n\t\tt.Errorf(\"Teams.ListTeamReposByID returned %+v, want %+v\", members, want)\n\t}\n\n\tconst methodName = \"ListTeamReposByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.ListTeamReposByID(ctx, -1, -1, opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.ListTeamReposByID(ctx, 1, 1, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_ListTeamReposBySlug(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/s/repos\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeTopicsPreview)\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tmembers, _, err := client.Teams.ListTeamReposBySlug(ctx, \"o\", \"s\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.ListTeamReposBySlug returned error: %v\", err)\n\t}\n\n\twant := []*Repository{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(members, want) {\n\t\tt.Errorf(\"Teams.ListTeamReposBySlug returned %+v, want %+v\", members, want)\n\t}\n\n\tconst methodName = \"ListTeamReposBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.ListTeamReposBySlug(ctx, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.ListTeamReposBySlug(ctx, \"o\", \"s\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_IsTeamRepoByID_true(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1/team/1/repos/owner/repo\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeOrgPermissionRepo)\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\trepo, _, err := client.Teams.IsTeamRepoByID(ctx, 1, 1, \"owner\", \"repo\")\n\tif err != nil {\n\t\tt.Errorf(\"Teams.IsTeamRepoByID returned error: %v\", err)\n\t}\n\n\twant := &Repository{ID: Ptr(int64(1))}\n\tif !cmp.Equal(repo, want) {\n\t\tt.Errorf(\"Teams.IsTeamRepoByID returned %+v, want %+v\", repo, want)\n\t}\n\n\tconst methodName = \"IsTeamRepoByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.IsTeamRepoByID(ctx, -1, -1, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.IsTeamRepoByID(ctx, 1, 1, \"owner\", \"repo\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_IsTeamRepoBySlug_true(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/org/teams/slug/repos/owner/repo\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeOrgPermissionRepo)\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\trepo, _, err := client.Teams.IsTeamRepoBySlug(ctx, \"org\", \"slug\", \"owner\", \"repo\")\n\tif err != nil {\n\t\tt.Errorf(\"Teams.IsTeamRepoBySlug returned error: %v\", err)\n\t}\n\n\twant := &Repository{ID: Ptr(int64(1))}\n\tif !cmp.Equal(repo, want) {\n\t\tt.Errorf(\"Teams.IsTeamRepoBySlug returned %+v, want %+v\", repo, want)\n\t}\n\n\tconst methodName = \"IsTeamRepoBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.IsTeamRepoBySlug(ctx, \"\\n\", \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.IsTeamRepoBySlug(ctx, \"org\", \"slug\", \"owner\", \"repo\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_IsTeamRepoByID_false(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1/team/1/repos/owner/repo\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\trepo, resp, err := client.Teams.IsTeamRepoByID(ctx, 1, 1, \"owner\", \"repo\")\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Teams.IsTeamRepoByID returned status %v, want %v\", got, want)\n\t}\n\tif repo != nil {\n\t\tt.Errorf(\"Teams.IsTeamRepoByID returned %+v, want nil\", repo)\n\t}\n}\n\nfunc TestTeamsService_IsTeamRepoBySlug_false(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/org/teams/slug/repos/o/r\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\trepo, resp, err := client.Teams.IsTeamRepoBySlug(ctx, \"org\", \"slug\", \"owner\", \"repo\")\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Teams.IsTeamRepoByID returned status %v, want %v\", got, want)\n\t}\n\tif repo != nil {\n\t\tt.Errorf(\"Teams.IsTeamRepoByID returned %+v, want nil\", repo)\n\t}\n}\n\nfunc TestTeamsService_IsTeamRepoByID_error(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1/team/1/repos/owner/repo\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\thttp.Error(w, \"BadRequest\", http.StatusBadRequest)\n\t})\n\n\tctx := t.Context()\n\trepo, resp, err := client.Teams.IsTeamRepoByID(ctx, 1, 1, \"owner\", \"repo\")\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 400 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusBadRequest; got != want {\n\t\tt.Errorf(\"Teams.IsTeamRepoByID returned status %v, want %v\", got, want)\n\t}\n\tif repo != nil {\n\t\tt.Errorf(\"Teams.IsTeamRepoByID returned %+v, want nil\", repo)\n\t}\n}\n\nfunc TestTeamsService_IsTeamRepoBySlug_error(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/org/teams/slug/repos/owner/repo\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\thttp.Error(w, \"BadRequest\", http.StatusBadRequest)\n\t})\n\n\tctx := t.Context()\n\trepo, resp, err := client.Teams.IsTeamRepoBySlug(ctx, \"org\", \"slug\", \"owner\", \"repo\")\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 400 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusBadRequest; got != want {\n\t\tt.Errorf(\"Teams.IsTeamRepoBySlug returned status %v, want %v\", got, want)\n\t}\n\tif repo != nil {\n\t\tt.Errorf(\"Teams.IsTeamRepoBySlug returned %+v, want nil\", repo)\n\t}\n}\n\nfunc TestTeamsService_IsTeamRepoByID_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Teams.IsTeamRepoByID(ctx, 1, 1, \"%\", \"r\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestTeamsService_IsTeamRepoBySlug_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Teams.IsTeamRepoBySlug(ctx, \"o\", \"s\", \"%\", \"r\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestTeamsService_AddTeamRepoByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\topt := &TeamAddTeamRepoOptions{Permission: \"admin\"}\n\n\tmux.HandleFunc(\"/organizations/1/team/1/repos/owner/repo\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *TeamAddTeamRepoOptions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, opt) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, opt)\n\t\t}\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Teams.AddTeamRepoByID(ctx, 1, 1, \"owner\", \"repo\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.AddTeamRepoByID returned error: %v\", err)\n\t}\n\n\tconst methodName = \"AddTeamRepoByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Teams.AddTeamRepoByID(ctx, 1, 1, \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Teams.AddTeamRepoByID(ctx, 1, 1, \"owner\", \"repo\", opt)\n\t})\n}\n\nfunc TestTeamsService_AddTeamRepoBySlug(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\topt := &TeamAddTeamRepoOptions{Permission: \"admin\"}\n\n\tmux.HandleFunc(\"/orgs/org/teams/slug/repos/owner/repo\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *TeamAddTeamRepoOptions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, opt) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, opt)\n\t\t}\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Teams.AddTeamRepoBySlug(ctx, \"org\", \"slug\", \"owner\", \"repo\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.AddTeamRepoBySlug returned error: %v\", err)\n\t}\n\n\tconst methodName = \"AddTeamRepoBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Teams.AddTeamRepoBySlug(ctx, \"\\n\", \"\\n\", \"\\n\", \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Teams.AddTeamRepoBySlug(ctx, \"org\", \"slug\", \"owner\", \"repo\", opt)\n\t})\n}\n\nfunc TestTeamsService_AddTeamRepoByID_noAccess(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1/team/1/repos/owner/repo\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tw.WriteHeader(http.StatusUnprocessableEntity)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Teams.AddTeamRepoByID(ctx, 1, 1, \"owner\", \"repo\", nil)\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned\")\n\t}\n}\n\nfunc TestTeamsService_AddTeamRepoBySlug_noAccess(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/org/teams/slug/repos/o/r\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tw.WriteHeader(http.StatusUnprocessableEntity)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Teams.AddTeamRepoBySlug(ctx, \"org\", \"slug\", \"owner\", \"repo\", nil)\n\tif err == nil {\n\t\tt.Error(\"Expected error to be returned\")\n\t}\n}\n\nfunc TestTeamsService_AddTeamRepoByID_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Teams.AddTeamRepoByID(ctx, 1, 1, \"%\", \"r\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestTeamsService_AddTeamRepoBySlug_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Teams.AddTeamRepoBySlug(ctx, \"o\", \"s\", \"%\", \"r\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestTeamsService_RemoveTeamRepoByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1/team/1/repos/owner/repo\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Teams.RemoveTeamRepoByID(ctx, 1, 1, \"owner\", \"repo\")\n\tif err != nil {\n\t\tt.Errorf(\"Teams.RemoveTeamRepoByID returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveTeamRepoByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Teams.RemoveTeamRepoByID(ctx, -1, -1, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Teams.RemoveTeamRepoByID(ctx, 1, 1, \"owner\", \"repo\")\n\t})\n}\n\nfunc TestTeamsService_RemoveTeamRepoBySlug(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/org/teams/slug/repos/owner/repo\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Teams.RemoveTeamRepoBySlug(ctx, \"org\", \"slug\", \"owner\", \"repo\")\n\tif err != nil {\n\t\tt.Errorf(\"Teams.RemoveTeamRepoBySlug returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveTeamRepoBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Teams.RemoveTeamRepoBySlug(ctx, \"\\n\", \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Teams.RemoveTeamRepoBySlug(ctx, \"org\", \"slug\", \"owner\", \"repo\")\n\t})\n}\n\nfunc TestTeamsService_RemoveTeamRepoByID_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Teams.RemoveTeamRepoByID(ctx, 1, 1, \"%\", \"r\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestTeamsService_RemoveTeamRepoBySlug_invalidOwner(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Teams.RemoveTeamRepoBySlug(ctx, \"o\", \"s\", \"%\", \"r\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestTeamsService_ListUserTeams(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/teams\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"1\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &ListOptions{Page: 1}\n\tctx := t.Context()\n\tteams, _, err := client.Teams.ListUserTeams(ctx, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.ListUserTeams returned error: %v\", err)\n\t}\n\n\twant := []*Team{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(teams, want) {\n\t\tt.Errorf(\"Teams.ListUserTeams returned %+v, want %+v\", teams, want)\n\t}\n\n\tconst methodName = \"ListUserTeams\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.ListUserTeams(ctx, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_ListProjectsByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1/team/1/projects\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeProjectsPreview)\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\tctx := t.Context()\n\tprojects, _, err := client.Teams.ListTeamProjectsByID(ctx, 1, 1)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.ListTeamProjectsByID returned error: %v\", err)\n\t}\n\n\twant := []*ProjectV2{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(projects, want) {\n\t\tt.Errorf(\"Teams.ListTeamProjectsByID returned %+v, want %+v\", projects, want)\n\t}\n\n\tconst methodName = \"ListTeamProjectsByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.ListTeamProjectsByID(ctx, -1, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.ListTeamProjectsByID(ctx, 1, 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_ListProjectsBySlug(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/s/projects\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeProjectsPreview)\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\tctx := t.Context()\n\tprojects, _, err := client.Teams.ListTeamProjectsBySlug(ctx, \"o\", \"s\")\n\tif err != nil {\n\t\tt.Errorf(\"Teams.ListTeamProjectsBySlug returned error: %v\", err)\n\t}\n\n\twant := []*ProjectV2{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(projects, want) {\n\t\tt.Errorf(\"Teams.ListTeamProjectsBySlug returned %+v, want %+v\", projects, want)\n\t}\n\n\tconst methodName = \"ListTeamProjectsBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.ListTeamProjectsBySlug(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.ListTeamProjectsBySlug(ctx, \"o\", \"s\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_ReviewProjectsByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1/team/1/projects/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeProjectsPreview)\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tproject, _, err := client.Teams.ReviewTeamProjectsByID(ctx, 1, 1, 1)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.ReviewTeamProjectsByID returned error: %v\", err)\n\t}\n\n\twant := &ProjectV2{ID: Ptr(int64(1))}\n\tif !cmp.Equal(project, want) {\n\t\tt.Errorf(\"Teams.ReviewTeamProjectsByID returned %+v, want %+v\", project, want)\n\t}\n\n\tconst methodName = \"ReviewTeamProjectsByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.ReviewTeamProjectsByID(ctx, -1, -1, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.ReviewTeamProjectsByID(ctx, 1, 1, 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_ReviewProjectsBySlug(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/s/projects/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeProjectsPreview)\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tproject, _, err := client.Teams.ReviewTeamProjectsBySlug(ctx, \"o\", \"s\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.ReviewTeamProjectsBySlug returned error: %v\", err)\n\t}\n\n\twant := &ProjectV2{ID: Ptr(int64(1))}\n\tif !cmp.Equal(project, want) {\n\t\tt.Errorf(\"Teams.ReviewTeamProjectsBySlug returned %+v, want %+v\", project, want)\n\t}\n\n\tconst methodName = \"ReviewTeamProjectsBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.ReviewTeamProjectsBySlug(ctx, \"\\n\", \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.ReviewTeamProjectsBySlug(ctx, \"o\", \"s\", 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_AddTeamProjectByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\topt := &TeamProjectOptions{\n\t\tPermission: Ptr(\"admin\"),\n\t}\n\n\tmux.HandleFunc(\"/organizations/1/team/1/projects/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeProjectsPreview)\n\n\t\tvar v *TeamProjectOptions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\t\tif !cmp.Equal(v, opt) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, opt)\n\t\t}\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Teams.AddTeamProjectByID(ctx, 1, 1, 1, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.AddTeamProjectByID returned error: %v\", err)\n\t}\n\n\tconst methodName = \"AddTeamProjectByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Teams.AddTeamProjectByID(ctx, -1, -1, -1, opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Teams.AddTeamProjectByID(ctx, 1, 1, 1, opt)\n\t})\n}\n\nfunc TestTeamsService_AddTeamProjectBySlug(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\topt := &TeamProjectOptions{\n\t\tPermission: Ptr(\"admin\"),\n\t}\n\n\tmux.HandleFunc(\"/orgs/o/teams/s/projects/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeProjectsPreview)\n\n\t\tvar v *TeamProjectOptions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\t\tif !cmp.Equal(v, opt) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, opt)\n\t\t}\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Teams.AddTeamProjectBySlug(ctx, \"o\", \"s\", 1, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.AddTeamProjectBySlug returned error: %v\", err)\n\t}\n\n\tconst methodName = \"AddTeamProjectBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Teams.AddTeamProjectBySlug(ctx, \"\\n\", \"\\n\", -1, opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Teams.AddTeamProjectBySlug(ctx, \"o\", \"s\", 1, opt)\n\t})\n}\n\nfunc TestTeamsService_RemoveTeamProjectByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1/team/1/projects/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeProjectsPreview)\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Teams.RemoveTeamProjectByID(ctx, 1, 1, 1)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.RemoveTeamProjectByID returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveTeamProjectByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Teams.RemoveTeamProjectByID(ctx, -1, -1, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Teams.RemoveTeamProjectByID(ctx, 1, 1, 1)\n\t})\n}\n\nfunc TestTeamsService_RemoveTeamProjectBySlug(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/s/projects/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeProjectsPreview)\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Teams.RemoveTeamProjectBySlug(ctx, \"o\", \"s\", 1)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.RemoveTeamProjectBySlug returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveTeamProjectBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Teams.RemoveTeamProjectBySlug(ctx, \"\\n\", \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Teams.RemoveTeamProjectBySlug(ctx, \"o\", \"s\", 1)\n\t})\n}\n\nfunc TestTeamsService_ListIDPGroupsInOrganization(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/team-sync/groups\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\": \"url-encoded-next-page-token\",\n\t\t\t\"q\":    \"n\",\n\t\t})\n\t\tfmt.Fprint(w, `{\"groups\": [{\"group_id\": \"1\",  \"group_name\": \"n\", \"group_description\": \"d\"}]}`)\n\t})\n\n\topt := &ListIDPGroupsOptions{\n\t\tQuery:             \"n\",\n\t\tListCursorOptions: ListCursorOptions{Page: \"url-encoded-next-page-token\"},\n\t}\n\tctx := t.Context()\n\tgroups, _, err := client.Teams.ListIDPGroupsInOrganization(ctx, \"o\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.ListIDPGroupsInOrganization returned error: %v\", err)\n\t}\n\n\twant := &IDPGroupList{\n\t\tGroups: []*IDPGroup{\n\t\t\t{\n\t\t\t\tGroupID:          Ptr(\"1\"),\n\t\t\t\tGroupName:        Ptr(\"n\"),\n\t\t\t\tGroupDescription: Ptr(\"d\"),\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(groups, want) {\n\t\tt.Errorf(\"Teams.ListIDPGroupsInOrganization returned %+v. want %+v\", groups, want)\n\t}\n\n\tconst methodName = \"ListIDPGroupsInOrganization\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.ListIDPGroupsInOrganization(ctx, \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.ListIDPGroupsInOrganization(ctx, \"o\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_ListIDPGroupsForTeamByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1/team/1/team-sync/group-mappings\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"groups\": [{\"group_id\": \"1\",  \"group_name\": \"n\", \"group_description\": \"d\"}]}`)\n\t})\n\n\tctx := t.Context()\n\tgroups, _, err := client.Teams.ListIDPGroupsForTeamByID(ctx, 1, 1)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.ListIDPGroupsForTeamByID returned error: %v\", err)\n\t}\n\n\twant := &IDPGroupList{\n\t\tGroups: []*IDPGroup{\n\t\t\t{\n\t\t\t\tGroupID:          Ptr(\"1\"),\n\t\t\t\tGroupName:        Ptr(\"n\"),\n\t\t\t\tGroupDescription: Ptr(\"d\"),\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(groups, want) {\n\t\tt.Errorf(\"Teams.ListIDPGroupsForTeamByID returned %+v. want %+v\", groups, want)\n\t}\n\n\tconst methodName = \"ListIDPGroupsForTeamByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.ListIDPGroupsForTeamByID(ctx, -1, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.ListIDPGroupsForTeamByID(ctx, 1, 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_ListIDPGroupsForTeamBySlug(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/slug/team-sync/group-mappings\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"groups\": [{\"group_id\": \"1\",  \"group_name\": \"n\", \"group_description\": \"d\"}]}`)\n\t})\n\n\tctx := t.Context()\n\tgroups, _, err := client.Teams.ListIDPGroupsForTeamBySlug(ctx, \"o\", \"slug\")\n\tif err != nil {\n\t\tt.Errorf(\"Teams.ListIDPGroupsForTeamBySlug returned error: %v\", err)\n\t}\n\n\twant := &IDPGroupList{\n\t\tGroups: []*IDPGroup{\n\t\t\t{\n\t\t\t\tGroupID:          Ptr(\"1\"),\n\t\t\t\tGroupName:        Ptr(\"n\"),\n\t\t\t\tGroupDescription: Ptr(\"d\"),\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(groups, want) {\n\t\tt.Errorf(\"Teams.ListIDPGroupsForTeamBySlug returned %+v. want %+v\", groups, want)\n\t}\n\n\tconst methodName = \"ListIDPGroupsForTeamBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.ListIDPGroupsForTeamBySlug(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.ListIDPGroupsForTeamBySlug(ctx, \"o\", \"slug\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_CreateOrUpdateIDPGroupConnectionsByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1/team/1/team-sync/group-mappings\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tfmt.Fprint(w, `{\"groups\": [{\"group_id\": \"1\",  \"group_name\": \"n\", \"group_description\": \"d\"}]}`)\n\t})\n\n\tinput := IDPGroupList{\n\t\tGroups: []*IDPGroup{\n\t\t\t{\n\t\t\t\tGroupID:          Ptr(\"1\"),\n\t\t\t\tGroupName:        Ptr(\"n\"),\n\t\t\t\tGroupDescription: Ptr(\"d\"),\n\t\t\t},\n\t\t},\n\t}\n\n\tctx := t.Context()\n\tgroups, _, err := client.Teams.CreateOrUpdateIDPGroupConnectionsByID(ctx, 1, 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.CreateOrUpdateIDPGroupConnectionsByID returned error: %v\", err)\n\t}\n\n\twant := &IDPGroupList{\n\t\tGroups: []*IDPGroup{\n\t\t\t{\n\t\t\t\tGroupID:          Ptr(\"1\"),\n\t\t\t\tGroupName:        Ptr(\"n\"),\n\t\t\t\tGroupDescription: Ptr(\"d\"),\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(groups, want) {\n\t\tt.Errorf(\"Teams.CreateOrUpdateIDPGroupConnectionsByID returned %+v. want %+v\", groups, want)\n\t}\n\n\tconst methodName = \"CreateOrUpdateIDPGroupConnectionsByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.CreateOrUpdateIDPGroupConnectionsByID(ctx, -1, -1, input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.CreateOrUpdateIDPGroupConnectionsByID(ctx, 1, 1, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_CreateOrUpdateIDPGroupConnectionsBySlug(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/slug/team-sync/group-mappings\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tfmt.Fprint(w, `{\"groups\": [{\"group_id\": \"1\",  \"group_name\": \"n\", \"group_description\": \"d\"}]}`)\n\t})\n\n\tinput := IDPGroupList{\n\t\tGroups: []*IDPGroup{\n\t\t\t{\n\t\t\t\tGroupID:          Ptr(\"1\"),\n\t\t\t\tGroupName:        Ptr(\"n\"),\n\t\t\t\tGroupDescription: Ptr(\"d\"),\n\t\t\t},\n\t\t},\n\t}\n\n\tctx := t.Context()\n\tgroups, _, err := client.Teams.CreateOrUpdateIDPGroupConnectionsBySlug(ctx, \"o\", \"slug\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.CreateOrUpdateIDPGroupConnectionsBySlug returned error: %v\", err)\n\t}\n\n\twant := &IDPGroupList{\n\t\tGroups: []*IDPGroup{\n\t\t\t{\n\t\t\t\tGroupID:          Ptr(\"1\"),\n\t\t\t\tGroupName:        Ptr(\"n\"),\n\t\t\t\tGroupDescription: Ptr(\"d\"),\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(groups, want) {\n\t\tt.Errorf(\"Teams.CreateOrUpdateIDPGroupConnectionsBySlug returned %+v. want %+v\", groups, want)\n\t}\n\n\tconst methodName = \"CreateOrUpdateIDPGroupConnectionsBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.CreateOrUpdateIDPGroupConnectionsBySlug(ctx, \"\\n\", \"\\n\", input)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.CreateOrUpdateIDPGroupConnectionsBySlug(ctx, \"o\", \"slug\", input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_CreateOrUpdateIDPGroupConnectionsByID_empty(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/organizations/1/team/1/team-sync/group-mappings\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tfmt.Fprint(w, `{\"groups\": []}`)\n\t})\n\n\tinput := IDPGroupList{\n\t\tGroups: []*IDPGroup{},\n\t}\n\n\tctx := t.Context()\n\tgroups, _, err := client.Teams.CreateOrUpdateIDPGroupConnectionsByID(ctx, 1, 1, input)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.CreateOrUpdateIDPGroupConnectionsByID returned error: %v\", err)\n\t}\n\n\twant := &IDPGroupList{\n\t\tGroups: []*IDPGroup{},\n\t}\n\tif !cmp.Equal(groups, want) {\n\t\tt.Errorf(\"Teams.CreateOrUpdateIDPGroupConnectionsByID returned %+v. want %+v\", groups, want)\n\t}\n}\n\nfunc TestTeamsService_CreateOrUpdateIDPGroupConnectionsBySlug_empty(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/slug/team-sync/group-mappings\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tfmt.Fprint(w, `{\"groups\": []}`)\n\t})\n\n\tinput := IDPGroupList{\n\t\tGroups: []*IDPGroup{},\n\t}\n\n\tctx := t.Context()\n\tgroups, _, err := client.Teams.CreateOrUpdateIDPGroupConnectionsBySlug(ctx, \"o\", \"slug\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.CreateOrUpdateIDPGroupConnectionsBySlug returned error: %v\", err)\n\t}\n\n\twant := &IDPGroupList{\n\t\tGroups: []*IDPGroup{},\n\t}\n\tif !cmp.Equal(groups, want) {\n\t\tt.Errorf(\"Teams.CreateOrUpdateIDPGroupConnectionsBySlug returned %+v. want %+v\", groups, want)\n\t}\n}\n\nfunc TestNewTeam_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &NewTeam{}, `{\"name\": \"\"}`)\n\n\tu := &NewTeam{\n\t\tName:                \"n\",\n\t\tDescription:         Ptr(\"d\"),\n\t\tMaintainers:         []string{\"m1\", \"m2\"},\n\t\tRepoNames:           []string{\"repo1\", \"repo2\"},\n\t\tNotificationSetting: Ptr(\"notifications_enabled\"),\n\t\tParentTeamID:        Ptr(int64(1)),\n\t\tPermission:          Ptr(\"perm\"),\n\t\tPrivacy:             Ptr(\"p\"),\n\t\tLDAPDN:              Ptr(\"l\"),\n\t}\n\n\twant := `{\n\t\t\"name\":           \"n\",\n\t\t\"description\":    \"d\",\n\t\t\"maintainers\":    [\"m1\", \"m2\"],\n\t\t\"repo_names\":     [\"repo1\", \"repo2\"],\n\t\t\"parent_team_id\": 1,\n\t\t\"notification_setting\": \"notifications_enabled\",\n\t\t\"permission\":     \"perm\",\n\t\t\"privacy\":        \"p\",\n\t\t\"ldap_dn\":        \"l\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestTeams_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Team{}, \"{}\")\n\n\tu := &Team{\n\t\tID:              Ptr(int64(1)),\n\t\tNodeID:          Ptr(\"n\"),\n\t\tName:            Ptr(\"n\"),\n\t\tDescription:     Ptr(\"d\"),\n\t\tURL:             Ptr(\"u\"),\n\t\tSlug:            Ptr(\"s\"),\n\t\tPermission:      Ptr(\"p\"),\n\t\tPrivacy:         Ptr(\"p\"),\n\t\tMembersCount:    Ptr(1),\n\t\tReposCount:      Ptr(1),\n\t\tMembersURL:      Ptr(\"m\"),\n\t\tRepositoriesURL: Ptr(\"r\"),\n\t\tOrganization: &Organization{\n\t\t\tLogin:     Ptr(\"l\"),\n\t\t\tID:        Ptr(int64(1)),\n\t\t\tNodeID:    Ptr(\"n\"),\n\t\t\tAvatarURL: Ptr(\"a\"),\n\t\t\tHTMLURL:   Ptr(\"h\"),\n\t\t\tName:      Ptr(\"n\"),\n\t\t\tCompany:   Ptr(\"c\"),\n\t\t\tBlog:      Ptr(\"b\"),\n\t\t\tLocation:  Ptr(\"l\"),\n\t\t\tEmail:     Ptr(\"e\"),\n\t\t},\n\t\tParent: &Team{\n\t\t\tID:           Ptr(int64(1)),\n\t\t\tNodeID:       Ptr(\"n\"),\n\t\t\tName:         Ptr(\"n\"),\n\t\t\tDescription:  Ptr(\"d\"),\n\t\t\tURL:          Ptr(\"u\"),\n\t\t\tSlug:         Ptr(\"s\"),\n\t\t\tPermission:   Ptr(\"p\"),\n\t\t\tPrivacy:      Ptr(\"p\"),\n\t\t\tMembersCount: Ptr(1),\n\t\t\tReposCount:   Ptr(1),\n\t\t},\n\t\tLDAPDN: Ptr(\"l\"),\n\t\tType:   Ptr(\"t\"),\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"node_id\": \"n\",\n\t\t\"name\": \"n\",\n\t\t\"description\": \"d\",\n\t\t\"url\": \"u\",\n\t\t\"slug\": \"s\",\n\t\t\"permission\": \"p\",\n\t\t\"privacy\": \"p\",\n\t\t\"members_count\": 1,\n\t\t\"repos_count\": 1,\n\t\t\"members_url\": \"m\",\n\t\t\"repositories_url\": \"r\",\n\t\t\"organization\": {\n\t\t\t\"login\": \"l\",\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"avatar_url\": \"a\",\n\t\t\t\"html_url\": \"h\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"company\": \"c\",\n\t\t\t\"blog\": \"b\",\n\t\t\t\"location\": \"l\",\n\t\t\t\"email\": \"e\"\n\t\t},\n\t\t\"parent\": {\n\t\t\t\"id\": 1,\n\t\t\t\"node_id\": \"n\",\n\t\t\t\"name\": \"n\",\n\t\t\t\"description\": \"d\",\n\t\t\t\"url\": \"u\",\n\t\t\t\"slug\": \"s\",\n\t\t\t\"permission\": \"p\",\n\t\t\t\"privacy\": \"p\",\n\t\t\t\"members_count\": 1,\n\t\t\t\"repos_count\": 1\n\t\t},\n\t\t\"ldap_dn\": \"l\",\n\t\t\"type\": \"t\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestInvitation_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Invitation{}, \"{}\")\n\n\tu := &Invitation{\n\t\tID:                Ptr(int64(1)),\n\t\tNodeID:            Ptr(\"test node\"),\n\t\tLogin:             Ptr(\"login123\"),\n\t\tEmail:             Ptr(\"go@github.com\"),\n\t\tRole:              Ptr(\"developer\"),\n\t\tCreatedAt:         &Timestamp{referenceTime},\n\t\tTeamCount:         Ptr(99),\n\t\tInvitationTeamURL: Ptr(\"url\"),\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"node_id\": \"test node\",\n\t\t\"login\":\"login123\",\n\t\t\"email\":\"go@github.com\",\n\t\t\"role\":\"developer\",\n\t\t\"created_at\":` + referenceTimeStr + `,\n\t\t\"team_count\":99,\n\t\t\"invitation_team_url\":\"url\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestIDPGroup_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &IDPGroup{}, \"{}\")\n\n\tu := &IDPGroup{\n\t\tGroupID:          Ptr(\"abc1\"),\n\t\tGroupName:        Ptr(\"test group\"),\n\t\tGroupDescription: Ptr(\"test group description\"),\n\t}\n\n\twant := `{\n\t\t\"group_id\": \"abc1\",\n\t\t\"group_name\": \"test group\",\n\t\t\"group_description\":\"test group description\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestTeamsService_GetExternalGroup(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/external-group/123\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"group_id\": 123,\n\t\t\t\"group_name\": \"Octocat admins\",\n\t\t\t\"updated_at\": \"2006-01-02T15:04:05Z\",\n\t\t\t\"teams\": [\n\t\t\t\t{\n\t\t\t\t\t\"team_id\": 1,\n\t\t\t\t\t\"team_name\": \"team-test\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"team_id\": 2,\n\t\t\t\t\t\"team_name\": \"team-test2\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"members\": [\n\t\t\t\t{\n\t\t\t\t\t\"member_id\": 1,\n\t\t\t\t\t\"member_login\": \"mona-lisa_eocsaxrs\",\n\t\t\t\t\t\"member_name\": \"Mona Lisa\",\n\t\t\t\t\t\"member_email\": \"mona_lisa@github.com\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"member_id\": 2,\n\t\t\t\t\t\"member_login\": \"octo-lisa_eocsaxrs\",\n\t\t\t\t\t\"member_name\": \"Octo Lisa\",\n\t\t\t\t\t\"member_email\": \"octo_lisa@github.com\"\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\texternalGroup, _, err := client.Teams.GetExternalGroup(ctx, \"o\", 123)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.GetExternalGroup returned error: %v\", err)\n\t}\n\n\twant := &ExternalGroup{\n\t\tGroupID:   Ptr(int64(123)),\n\t\tGroupName: Ptr(\"Octocat admins\"),\n\t\tUpdatedAt: &Timestamp{Time: referenceTime},\n\t\tTeams: []*ExternalGroupTeam{\n\t\t\t{\n\t\t\t\tTeamID:   Ptr(int64(1)),\n\t\t\t\tTeamName: Ptr(\"team-test\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\tTeamID:   Ptr(int64(2)),\n\t\t\t\tTeamName: Ptr(\"team-test2\"),\n\t\t\t},\n\t\t},\n\t\tMembers: []*ExternalGroupMember{\n\t\t\t{\n\t\t\t\tMemberID:    Ptr(int64(1)),\n\t\t\t\tMemberLogin: Ptr(\"mona-lisa_eocsaxrs\"),\n\t\t\t\tMemberName:  Ptr(\"Mona Lisa\"),\n\t\t\t\tMemberEmail: Ptr(\"mona_lisa@github.com\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\tMemberID:    Ptr(int64(2)),\n\t\t\t\tMemberLogin: Ptr(\"octo-lisa_eocsaxrs\"),\n\t\t\t\tMemberName:  Ptr(\"Octo Lisa\"),\n\t\t\t\tMemberEmail: Ptr(\"octo_lisa@github.com\"),\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(externalGroup, want) {\n\t\tt.Errorf(\"Teams.GetExternalGroup returned %+v, want %+v\", externalGroup, want)\n\t}\n\n\tconst methodName = \"GetExternalGroup\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.GetExternalGroup(ctx, \"\\n\", -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.GetExternalGroup(ctx, \"o\", 123)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_GetExternalGroup_notFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/external-group/123\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\teg, resp, err := client.Teams.GetExternalGroup(ctx, \"o\", 123)\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Teams.GetExternalGroup returned status %v, want %v\", got, want)\n\t}\n\tif eg != nil {\n\t\tt.Errorf(\"Teams.GetExternalGroup returned %+v, want nil\", eg)\n\t}\n}\n\nfunc TestTeamsService_ListExternalGroups(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/external-groups\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"groups\": [\n\t\t\t\t{\n\t\t\t\t\t\"group_id\": 123,\n\t\t\t\t\t\"group_name\": \"Octocat admins\",\n\t\t\t\t\t\"updated_at\": \"2006-01-02T15:04:05Z\"\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\topts := &ListExternalGroupsOptions{\n\t\tDisplayName: Ptr(\"Octocat\"),\n\t}\n\tlist, _, err := client.Teams.ListExternalGroups(ctx, \"o\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.ListExternalGroups returned error: %v\", err)\n\t}\n\n\twant := &ExternalGroupList{\n\t\tGroups: []*ExternalGroup{\n\t\t\t{\n\t\t\t\tGroupID:   Ptr(int64(123)),\n\t\t\t\tGroupName: Ptr(\"Octocat admins\"),\n\t\t\t\tUpdatedAt: &Timestamp{Time: referenceTime},\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(list, want) {\n\t\tt.Errorf(\"Teams.ListExternalGroups returned %+v, want %+v\", list, want)\n\t}\n\n\tconst methodName = \"ListExternalGroups\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.ListExternalGroups(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.ListExternalGroups(ctx, \"o\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_ListExternalGroups_notFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/external-groups\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\teg, resp, err := client.Teams.ListExternalGroups(ctx, \"o\", nil)\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Teams.ListExternalGroups returned status %v, want %v\", got, want)\n\t}\n\tif eg != nil {\n\t\tt.Errorf(\"Teams.ListExternalGroups returned %+v, want nil\", eg)\n\t}\n}\n\nfunc TestTeamsService_ListExternalGroupsForTeamBySlug(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/t/external-groups\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"groups\": [\n\t\t\t\t{\n\t\t\t\t\t\"group_id\": 123,\n\t\t\t\t\t\"group_name\": \"Octocat admins\",\n\t\t\t\t\t\"updated_at\": \"2006-01-02T15:04:05Z\"\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tlist, _, err := client.Teams.ListExternalGroupsForTeamBySlug(ctx, \"o\", \"t\")\n\tif err != nil {\n\t\tt.Errorf(\"Teams.ListExternalGroupsForTeamBySlug returned error: %v\", err)\n\t}\n\n\twant := &ExternalGroupList{\n\t\tGroups: []*ExternalGroup{\n\t\t\t{\n\t\t\t\tGroupID:   Ptr(int64(123)),\n\t\t\t\tGroupName: Ptr(\"Octocat admins\"),\n\t\t\t\tUpdatedAt: &Timestamp{Time: referenceTime},\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(list, want) {\n\t\tt.Errorf(\"Teams.ListExternalGroupsForTeamBySlug returned %+v, want %+v\", list, want)\n\t}\n\n\tconst methodName = \"ListExternalGroupsForTeamBySlug\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.ListExternalGroupsForTeamBySlug(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.ListExternalGroupsForTeamBySlug(ctx, \"o\", \"t\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_ListExternalGroupsForTeamBySlug_notFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/t/external-groups\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\teg, resp, err := client.Teams.ListExternalGroupsForTeamBySlug(ctx, \"o\", \"t\")\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Teams.ListExternalGroupsForTeamBySlug returned status %v, want %v\", got, want)\n\t}\n\tif eg != nil {\n\t\tt.Errorf(\"Teams.ListExternalGroupsForTeamBySlug returned %+v, want nil\", eg)\n\t}\n}\n\nfunc TestTeamsService_UpdateConnectedExternalGroup(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/t/external-groups\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"group_id\": 123,\n\t\t\t\"group_name\": \"Octocat admins\",\n\t\t\t\"updated_at\": \"2006-01-02T15:04:05Z\",\n\t\t\t\"teams\": [\n\t\t\t\t{\n\t\t\t\t\t\"team_id\": 1,\n\t\t\t\t\t\"team_name\": \"team-test\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"team_id\": 2,\n\t\t\t\t\t\"team_name\": \"team-test2\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"members\": [\n\t\t\t\t{\n\t\t\t\t\t\"member_id\": 1,\n\t\t\t\t\t\"member_login\": \"mona-lisa_eocsaxrs\",\n\t\t\t\t\t\"member_name\": \"Mona Lisa\",\n\t\t\t\t\t\"member_email\": \"mona_lisa@github.com\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"member_id\": 2,\n\t\t\t\t\t\"member_login\": \"octo-lisa_eocsaxrs\",\n\t\t\t\t\t\"member_name\": \"Octo Lisa\",\n\t\t\t\t\t\"member_email\": \"octo_lisa@github.com\"\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tbody := &ExternalGroup{\n\t\tGroupID: Ptr(int64(123)),\n\t}\n\texternalGroup, _, err := client.Teams.UpdateConnectedExternalGroup(ctx, \"o\", \"t\", body)\n\tif err != nil {\n\t\tt.Errorf(\"Teams.UpdateConnectedExternalGroup returned error: %v\", err)\n\t}\n\n\twant := &ExternalGroup{\n\t\tGroupID:   Ptr(int64(123)),\n\t\tGroupName: Ptr(\"Octocat admins\"),\n\t\tUpdatedAt: &Timestamp{Time: referenceTime},\n\t\tTeams: []*ExternalGroupTeam{\n\t\t\t{\n\t\t\t\tTeamID:   Ptr(int64(1)),\n\t\t\t\tTeamName: Ptr(\"team-test\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\tTeamID:   Ptr(int64(2)),\n\t\t\t\tTeamName: Ptr(\"team-test2\"),\n\t\t\t},\n\t\t},\n\t\tMembers: []*ExternalGroupMember{\n\t\t\t{\n\t\t\t\tMemberID:    Ptr(int64(1)),\n\t\t\t\tMemberLogin: Ptr(\"mona-lisa_eocsaxrs\"),\n\t\t\t\tMemberName:  Ptr(\"Mona Lisa\"),\n\t\t\t\tMemberEmail: Ptr(\"mona_lisa@github.com\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\tMemberID:    Ptr(int64(2)),\n\t\t\t\tMemberLogin: Ptr(\"octo-lisa_eocsaxrs\"),\n\t\t\t\tMemberName:  Ptr(\"Octo Lisa\"),\n\t\t\t\tMemberEmail: Ptr(\"octo_lisa@github.com\"),\n\t\t\t},\n\t\t},\n\t}\n\tif !cmp.Equal(externalGroup, want) {\n\t\tt.Errorf(\"Teams.GetExternalGroup returned %+v, want %+v\", externalGroup, want)\n\t}\n\n\tconst methodName = \"UpdateConnectedExternalGroup\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Teams.UpdateConnectedExternalGroup(ctx, \"\\n\", \"\\n\", body)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Teams.UpdateConnectedExternalGroup(ctx, \"o\", \"t\", body)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestTeamsService_UpdateConnectedExternalGroup_notFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/t/external-groups\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tbody := &ExternalGroup{\n\t\tGroupID: Ptr(int64(123)),\n\t}\n\teg, resp, err := client.Teams.UpdateConnectedExternalGroup(ctx, \"o\", \"t\", body)\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Teams.UpdateConnectedExternalGroup returned status %v, want %v\", got, want)\n\t}\n\tif eg != nil {\n\t\tt.Errorf(\"Teams.UpdateConnectedExternalGroup returned %+v, want nil\", eg)\n\t}\n}\n\nfunc TestTeamsService_RemoveConnectedExternalGroup(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/t/external-groups\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Teams.RemoveConnectedExternalGroup(ctx, \"o\", \"t\")\n\tif err != nil {\n\t\tt.Errorf(\"Teams.RemoveConnectedExternalGroup returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RemoveConnectedExternalGroup\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Teams.RemoveConnectedExternalGroup(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Teams.RemoveConnectedExternalGroup(ctx, \"o\", \"t\")\n\t})\n}\n\nfunc TestTeamsService_RemoveConnectedExternalGroup_notFound(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/orgs/o/teams/t/external-groups\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tresp, err := client.Teams.RemoveConnectedExternalGroup(ctx, \"o\", \"t\")\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 404 response\")\n\t}\n\tif got, want := resp.Response.StatusCode, http.StatusNotFound; got != want {\n\t\tt.Errorf(\"Teams.GetExternalGroup returned status %v, want %v\", got, want)\n\t}\n}\n\nfunc TestIDPGroupList_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &IDPGroupList{}, `{\"groups\": null}`)\n\n\tu := &IDPGroupList{\n\t\tGroups: []*IDPGroup{\n\t\t\t{\n\t\t\t\tGroupID:          Ptr(\"abc1\"),\n\t\t\t\tGroupName:        Ptr(\"test group\"),\n\t\t\t\tGroupDescription: Ptr(\"test group description\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\tGroupID:          Ptr(\"abc2\"),\n\t\t\t\tGroupName:        Ptr(\"test group2\"),\n\t\t\t\tGroupDescription: Ptr(\"test group description2\"),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"groups\": [\n\t\t\t{\n\t\t\t\t\"group_id\": \"abc1\",\n\t\t\t\t\"group_name\": \"test group\",\n\t\t\t\t\"group_description\": \"test group description\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"group_id\": \"abc2\",\n\t\t\t\t\"group_name\": \"test group2\",\n\t\t\t\t\"group_description\": \"test group description2\"\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestExternalGroupMember_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ExternalGroupMember{}, \"{}\")\n\n\tu := &ExternalGroupMember{\n\t\tMemberID:    Ptr(int64(1)),\n\t\tMemberLogin: Ptr(\"test member\"),\n\t\tMemberName:  Ptr(\"test member name\"),\n\t\tMemberEmail: Ptr(\"test member email\"),\n\t}\n\n\twant := `{\n\t\t\"member_id\": 1,\n\t\t\"member_login\": \"test member\",\n\t\t\"member_name\":\"test member name\",\n\t\t\"member_email\":\"test member email\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestExternalGroup_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ExternalGroup{}, \"{}\")\n\n\tu := &ExternalGroup{\n\t\tGroupID:   Ptr(int64(123)),\n\t\tGroupName: Ptr(\"group1\"),\n\t\tUpdatedAt: &Timestamp{referenceTime},\n\t\tTeams: []*ExternalGroupTeam{\n\t\t\t{\n\t\t\t\tTeamID:   Ptr(int64(1)),\n\t\t\t\tTeamName: Ptr(\"team-test\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\tTeamID:   Ptr(int64(2)),\n\t\t\t\tTeamName: Ptr(\"team-test2\"),\n\t\t\t},\n\t\t},\n\t\tMembers: []*ExternalGroupMember{\n\t\t\t{\n\t\t\t\tMemberID:    Ptr(int64(1)),\n\t\t\t\tMemberLogin: Ptr(\"test\"),\n\t\t\t\tMemberName:  Ptr(\"test\"),\n\t\t\t\tMemberEmail: Ptr(\"test@github.com\"),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"group_id\": 123,\n\t\t\"group_name\": \"group1\",\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"teams\": [\n\t\t\t{\n\t\t\t\t\"team_id\": 1,\n\t\t\t\t\"team_name\": \"team-test\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"team_id\": 2,\n\t\t\t\t\"team_name\": \"team-test2\"\n\t\t\t}\n\t\t],\n\t\t\"members\": [\n\t\t\t{\n\t\t\t\t\"member_id\": 1,\n\t\t\t\t\"member_login\": \"test\",\n\t\t\t\t\"member_name\": \"test\",\n\t\t\t\t\"member_email\": \"test@github.com\"\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestExternalGroupTeam_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &ExternalGroupTeam{}, \"{}\")\n\n\tu := &ExternalGroupTeam{\n\t\tTeamID:   Ptr(int64(123)),\n\t\tTeamName: Ptr(\"test\"),\n\t}\n\n\twant := `{\n\t\t\"team_id\": 123,\n\t\t\"team_name\": \"test\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestTeamAddTeamRepoOptions_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &TeamAddTeamRepoOptions{}, \"{}\")\n\n\tu := &TeamAddTeamRepoOptions{\n\t\tPermission: \"a\",\n\t}\n\n\twant := `{\n\t\t\"permission\": \"a\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/timestamp.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"strconv\"\n\t\"time\"\n)\n\n// Timestamp represents a time that can be unmarshaled from a JSON string\n// formatted as either an RFC3339 or Unix timestamp. This is necessary for some\n// fields since the GitHub API is inconsistent in how it represents times. All\n// exported methods of time.Time can be called on Timestamp.\ntype Timestamp struct {\n\ttime.Time\n}\n\nfunc (t Timestamp) String() string {\n\treturn t.Time.String()\n}\n\n// GetTime returns std time.Time.\nfunc (t *Timestamp) GetTime() *time.Time {\n\tif t == nil {\n\t\treturn nil\n\t}\n\treturn &t.Time\n}\n\n// UnmarshalJSON implements the json.Unmarshaler interface.\n// Time is expected in RFC3339 or Unix format.\nfunc (t *Timestamp) UnmarshalJSON(data []byte) (err error) {\n\tstr := string(data)\n\ti, err := strconv.ParseInt(str, 10, 64)\n\tif err == nil {\n\t\tt.Time = time.Unix(i, 0)\n\t\tif t.Time.Year() > 3000 {\n\t\t\tt.Time = time.Unix(0, i*1e6)\n\t\t}\n\t} else {\n\t\tt.Time, err = time.Parse(`\"`+time.RFC3339+`\"`, str)\n\t}\n\treturn err\n}\n\n// Equal reports whether t and u are equal based on time.Equal.\nfunc (t Timestamp) Equal(u Timestamp) bool {\n\treturn t.Time.Equal(u.Time)\n}\n"
  },
  {
    "path": "github/timestamp_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n)\n\nconst (\n\temptyTimeStr                     = `\"0001-01-01T00:00:00Z\"`\n\treferenceTimeStr                 = `\"2006-01-02T15:04:05Z\"`\n\treferenceTimeStrFractional       = `\"2006-01-02T15:04:05.000Z\"` // This format was returned by the Projects API before October 1, 2017.\n\treferenceUnixTimeStr             = `1136214245`\n\treferenceUnixTimeStrMilliSeconds = `1136214245000` // Millisecond-granular timestamps were introduced in the Audit log API.\n)\n\nvar (\n\treferenceTime = time.Date(2006, time.January, 2, 15, 4, 5, 0, time.UTC)\n\tunixOrigin    = time.Unix(0, 0).In(time.UTC)\n)\n\nfunc TestTimestamp_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestCases := []struct {\n\t\tdesc    string\n\t\tdata    Timestamp\n\t\twant    string\n\t\twantErr bool\n\t\tequal   bool\n\t}{\n\t\t{\"Reference\", Timestamp{referenceTime}, referenceTimeStr, false, true},\n\t\t{\"Empty\", Timestamp{}, emptyTimeStr, false, true},\n\t\t{\"Mismatch\", Timestamp{}, referenceTimeStr, false, false},\n\t}\n\tfor _, tc := range testCases {\n\t\tout, err := json.Marshal(tc.data)\n\t\tif gotErr := err != nil; gotErr != tc.wantErr {\n\t\t\tt.Errorf(\"%v: gotErr=%v, wantErr=%v, err=%v\", tc.desc, gotErr, tc.wantErr, err)\n\t\t}\n\t\tgot := string(out)\n\t\tequal := got == tc.want\n\t\tif (got == tc.want) != tc.equal {\n\t\t\tt.Errorf(\"%v: got=%v, want=%v, equal=%v, want=%v\", tc.desc, got, tc.want, equal, tc.equal)\n\t\t}\n\t}\n}\n\nfunc TestTimestamp_Unmarshal(t *testing.T) {\n\tt.Parallel()\n\ttestCases := []struct {\n\t\tdesc    string\n\t\tdata    string\n\t\twant    Timestamp\n\t\twantErr bool\n\t\tequal   bool\n\t}{\n\t\t{\"Reference\", referenceTimeStr, Timestamp{referenceTime}, false, true},\n\t\t{\"ReferenceUnix\", referenceUnixTimeStr, Timestamp{referenceTime}, false, true},\n\t\t{\"ReferenceUnixMillisecond\", referenceUnixTimeStrMilliSeconds, Timestamp{referenceTime}, false, true},\n\t\t{\"ReferenceFractional\", referenceTimeStrFractional, Timestamp{referenceTime}, false, true},\n\t\t{\"Empty\", emptyTimeStr, Timestamp{}, false, true},\n\t\t{\"UnixStart\", `0`, Timestamp{unixOrigin}, false, true},\n\t\t{\"Mismatch\", referenceTimeStr, Timestamp{}, false, false},\n\t\t{\"MismatchUnix\", `0`, Timestamp{}, false, false},\n\t\t{\"Invalid\", `\"asdf\"`, Timestamp{referenceTime}, true, false},\n\t\t{\"OffByMillisecond\", `1136214245001`, Timestamp{referenceTime}, false, false},\n\t}\n\tfor _, tc := range testCases {\n\t\tvar got Timestamp\n\t\terr := json.Unmarshal([]byte(tc.data), &got)\n\t\tif gotErr := err != nil; gotErr != tc.wantErr {\n\t\t\tt.Errorf(\"%v: gotErr=%v, wantErr=%v, err=%v\", tc.desc, gotErr, tc.wantErr, err)\n\t\t\tcontinue\n\t\t}\n\t\tequal := got.Equal(tc.want)\n\t\tif equal != tc.equal {\n\t\t\tt.Errorf(\"%v: got=%#v, want=%#v, equal=%v, want=%v\", tc.desc, got, tc.want, equal, tc.equal)\n\t\t}\n\t}\n}\n\nfunc TestTimestamp_MarshalReflexivity(t *testing.T) {\n\tt.Parallel()\n\ttestCases := []struct {\n\t\tdesc string\n\t\tdata Timestamp\n\t}{\n\t\t{\"Reference\", Timestamp{referenceTime}},\n\t\t{\"Empty\", Timestamp{}},\n\t}\n\tfor _, tc := range testCases {\n\t\tdata, err := json.Marshal(tc.data)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%v: Marshal err=%v\", tc.desc, err)\n\t\t}\n\t\tvar got Timestamp\n\t\terr = json.Unmarshal(data, &got)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%v: Unmarshal err=%v\", tc.desc, err)\n\t\t}\n\t\tif !got.Equal(tc.data) {\n\t\t\tt.Errorf(\"%v: %+v != %+v\", tc.desc, got, data)\n\t\t}\n\t}\n}\n\ntype WrappedTimestamp struct {\n\tA    int       `json:\"A\"`\n\tTime Timestamp `json:\"Time\"`\n}\n\nfunc TestWrappedTimestamp_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestCases := []struct {\n\t\tdesc    string\n\t\tdata    WrappedTimestamp\n\t\twant    string\n\t\twantErr bool\n\t\tequal   bool\n\t}{\n\t\t{\"Reference\", WrappedTimestamp{0, Timestamp{referenceTime}}, fmt.Sprintf(`{\"A\":0,\"Time\":%v}`, referenceTimeStr), false, true},\n\t\t{\"Empty\", WrappedTimestamp{}, fmt.Sprintf(`{\"A\":0,\"Time\":%v}`, emptyTimeStr), false, true},\n\t\t{\"Mismatch\", WrappedTimestamp{}, fmt.Sprintf(`{\"A\":0,\"Time\":%v}`, referenceTimeStr), false, false},\n\t}\n\tfor _, tc := range testCases {\n\t\tout, err := json.Marshal(tc.data)\n\t\tif gotErr := err != nil; gotErr != tc.wantErr {\n\t\t\tt.Errorf(\"%v: gotErr=%v, wantErr=%v, err=%v\", tc.desc, gotErr, tc.wantErr, err)\n\t\t}\n\t\tgot := string(out)\n\t\tequal := got == tc.want\n\t\tif equal != tc.equal {\n\t\t\tt.Errorf(\"%v: got=%v, want=%v, equal=%v, want=%v\", tc.desc, got, tc.want, equal, tc.equal)\n\t\t}\n\t}\n}\n\nfunc TestWrappedTimestamp_Unmarshal(t *testing.T) {\n\tt.Parallel()\n\ttestCases := []struct {\n\t\tdesc    string\n\t\tdata    string\n\t\twant    WrappedTimestamp\n\t\twantErr bool\n\t\tequal   bool\n\t}{\n\t\t{\"Reference\", referenceTimeStr, WrappedTimestamp{0, Timestamp{referenceTime}}, false, true},\n\t\t{\"ReferenceUnix\", referenceUnixTimeStr, WrappedTimestamp{0, Timestamp{referenceTime}}, false, true},\n\t\t{\"ReferenceUnixMillisecond\", referenceUnixTimeStrMilliSeconds, WrappedTimestamp{0, Timestamp{referenceTime}}, false, true},\n\t\t{\"Empty\", emptyTimeStr, WrappedTimestamp{0, Timestamp{}}, false, true},\n\t\t{\"UnixStart\", `0`, WrappedTimestamp{0, Timestamp{unixOrigin}}, false, true},\n\t\t{\"Mismatch\", referenceTimeStr, WrappedTimestamp{0, Timestamp{}}, false, false},\n\t\t{\"MismatchUnix\", `0`, WrappedTimestamp{0, Timestamp{}}, false, false},\n\t\t{\"Invalid\", `\"asdf\"`, WrappedTimestamp{0, Timestamp{referenceTime}}, true, false},\n\t\t{\"OffByMillisecond\", `1136214245001`, WrappedTimestamp{0, Timestamp{referenceTime}}, false, false},\n\t}\n\tfor _, tc := range testCases {\n\t\tvar got Timestamp\n\t\terr := json.Unmarshal([]byte(tc.data), &got)\n\t\tif gotErr := err != nil; gotErr != tc.wantErr {\n\t\t\tt.Errorf(\"%v: gotErr=%v, wantErr=%v, err=%v\", tc.desc, gotErr, tc.wantErr, err)\n\t\t\tcontinue\n\t\t}\n\t\tequal := got.Time.Equal(tc.want.Time.Time)\n\t\tif equal != tc.equal {\n\t\t\tt.Errorf(\"%v: got=%#v, want=%#v, equal=%v, want=%v\", tc.desc, got, tc.want, equal, tc.equal)\n\t\t}\n\t}\n}\n\nfunc TestTimestamp_GetTime(t *testing.T) {\n\tt.Parallel()\n\tvar t1 *Timestamp\n\tif t1.GetTime() != nil {\n\t\tt.Errorf(\"nil timestamp should return nil, got: %v\", t1.GetTime())\n\t}\n\tt1 = &Timestamp{referenceTime}\n\tif !t1.GetTime().Equal(referenceTime) {\n\t\tt.Errorf(\"want reference time, got: %v\", t1.GetTime())\n\t}\n}\n\nfunc TestWrappedTimestamp_MarshalReflexivity(t *testing.T) {\n\tt.Parallel()\n\ttestCases := []struct {\n\t\tdesc string\n\t\tdata WrappedTimestamp\n\t}{\n\t\t{\"Reference\", WrappedTimestamp{0, Timestamp{referenceTime}}},\n\t\t{\"Empty\", WrappedTimestamp{0, Timestamp{}}},\n\t}\n\tfor _, tc := range testCases {\n\t\tbytes, err := json.Marshal(tc.data)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%v: Marshal err=%v\", tc.desc, err)\n\t\t}\n\t\tvar got WrappedTimestamp\n\t\terr = json.Unmarshal(bytes, &got)\n\t\tif err != nil {\n\t\t\tt.Errorf(\"%v: Unmarshal err=%v\", tc.desc, err)\n\t\t}\n\t\tif !got.Time.Equal(tc.data.Time) {\n\t\t\tt.Errorf(\"%v: %+v != %+v\", tc.desc, got, tc.data)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "github/users.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// UsersService handles communication with the user related\n// methods of the GitHub API.\n//\n// GitHub API docs: https://docs.github.com/rest/users/\ntype UsersService service\n\n// User represents a GitHub user.\ntype User struct {\n\tLogin                   *string    `json:\"login,omitempty\"`\n\tID                      *int64     `json:\"id,omitempty\"`\n\tNodeID                  *string    `json:\"node_id,omitempty\"`\n\tAvatarURL               *string    `json:\"avatar_url,omitempty\"`\n\tHTMLURL                 *string    `json:\"html_url,omitempty\"`\n\tGravatarID              *string    `json:\"gravatar_id,omitempty\"`\n\tName                    *string    `json:\"name,omitempty\"`\n\tCompany                 *string    `json:\"company,omitempty\"`\n\tBlog                    *string    `json:\"blog,omitempty\"`\n\tLocation                *string    `json:\"location,omitempty\"`\n\tEmail                   *string    `json:\"email,omitempty\"`\n\tHireable                *bool      `json:\"hireable,omitempty\"`\n\tBio                     *string    `json:\"bio,omitempty\"`\n\tTwitterUsername         *string    `json:\"twitter_username,omitempty\"`\n\tPublicRepos             *int       `json:\"public_repos,omitempty\"`\n\tPublicGists             *int       `json:\"public_gists,omitempty\"`\n\tFollowers               *int       `json:\"followers,omitempty\"`\n\tFollowing               *int       `json:\"following,omitempty\"`\n\tCreatedAt               *Timestamp `json:\"created_at,omitempty\"`\n\tUpdatedAt               *Timestamp `json:\"updated_at,omitempty\"`\n\tSuspendedAt             *Timestamp `json:\"suspended_at,omitempty\"`\n\tType                    *string    `json:\"type,omitempty\"`\n\tSiteAdmin               *bool      `json:\"site_admin,omitempty\"`\n\tTotalPrivateRepos       *int64     `json:\"total_private_repos,omitempty\"`\n\tOwnedPrivateRepos       *int64     `json:\"owned_private_repos,omitempty\"`\n\tPrivateGists            *int       `json:\"private_gists,omitempty\"`\n\tDiskUsage               *int       `json:\"disk_usage,omitempty\"`\n\tCollaborators           *int       `json:\"collaborators,omitempty\"`\n\tTwoFactorAuthentication *bool      `json:\"two_factor_authentication,omitempty\"`\n\tPlan                    *Plan      `json:\"plan,omitempty\"`\n\tLdapDn                  *string    `json:\"ldap_dn,omitempty\"`\n\n\t// API URLs\n\tURL               *string `json:\"url,omitempty\"`\n\tEventsURL         *string `json:\"events_url,omitempty\"`\n\tFollowingURL      *string `json:\"following_url,omitempty\"`\n\tFollowersURL      *string `json:\"followers_url,omitempty\"`\n\tGistsURL          *string `json:\"gists_url,omitempty\"`\n\tOrganizationsURL  *string `json:\"organizations_url,omitempty\"`\n\tReceivedEventsURL *string `json:\"received_events_url,omitempty\"`\n\tReposURL          *string `json:\"repos_url,omitempty\"`\n\tStarredURL        *string `json:\"starred_url,omitempty\"`\n\tSubscriptionsURL  *string `json:\"subscriptions_url,omitempty\"`\n\n\t// TextMatches is only populated from search results that request text matches\n\t// See: search.go and https://docs.github.com/rest/search/#text-match-metadata\n\tTextMatches []*TextMatch `json:\"text_matches,omitempty\"`\n\n\t// Permissions and RoleName identify the permissions and role that a user has on a given\n\t// repository. These are only populated when calling Repositories.ListCollaborators.\n\tPermissions *RepositoryPermissions `json:\"permissions,omitempty\"`\n\tRoleName    *string                `json:\"role_name,omitempty\"`\n\n\t// Assignment identifies how a user was assigned to an organization role. Its\n\t// possible values are: \"direct\", \"indirect\", \"mixed\". This is only populated when\n\t// calling the ListUsersAssignedToOrgRole method.\n\tAssignment *string `json:\"assignment,omitempty\"`\n\t// InheritedFrom identifies the team that a user inherited their organization role\n\t// from. This is only populated when calling the ListUsersAssignedToOrgRole method.\n\tInheritedFrom []*Team `json:\"inherited_from,omitempty\"`\n}\n\nfunc (u User) String() string {\n\treturn Stringify(u)\n}\n\n// Get fetches a user. Passing the empty string will fetch the authenticated\n// user.\n//\n// GitHub API docs: https://docs.github.com/rest/users/users#get-a-user\n//\n// GitHub API docs: https://docs.github.com/rest/users/users#get-the-authenticated-user\n//\n//meta:operation GET /user\n//meta:operation GET /users/{username}\nfunc (s *UsersService) Get(ctx context.Context, user string) (*User, *Response, error) {\n\tvar u string\n\tif user != \"\" {\n\t\tu = fmt.Sprintf(\"users/%v\", user)\n\t} else {\n\t\tu = \"user\"\n\t}\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar uResp *User\n\tresp, err := s.client.Do(ctx, req, &uResp)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn uResp, resp, nil\n}\n\n// GetByID fetches a user.\n//\n// GitHub API docs: https://docs.github.com/rest/users/users#get-a-user-using-their-id\n//\n//meta:operation GET /user/{account_id}\nfunc (s *UsersService) GetByID(ctx context.Context, id int64) (*User, *Response, error) {\n\tu := fmt.Sprintf(\"user/%v\", id)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar user *User\n\tresp, err := s.client.Do(ctx, req, &user)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn user, resp, nil\n}\n\n// Edit the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/users/users#update-the-authenticated-user\n//\n//meta:operation PATCH /user\nfunc (s *UsersService) Edit(ctx context.Context, user *User) (*User, *Response, error) {\n\tu := \"user\"\n\treq, err := s.client.NewRequest(\"PATCH\", u, user)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar uResp *User\n\tresp, err := s.client.Do(ctx, req, &uResp)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn uResp, resp, nil\n}\n\n// HovercardOptions specifies optional parameters to the UsersService.GetHovercard\n// method.\ntype HovercardOptions struct {\n\t// SubjectType specifies the additional information to be received about the hovercard.\n\t// Possible values are: organization, repository, issue, pull_request. (Required when using subject_id.)\n\tSubjectType string `url:\"subject_type\"`\n\n\t// SubjectID specifies the ID for the SubjectType. (Required when using subject_type.)\n\tSubjectID string `url:\"subject_id\"`\n}\n\n// Hovercard represents hovercard information about a user.\ntype Hovercard struct {\n\tContexts []*UserContext `json:\"contexts,omitempty\"`\n}\n\n// UserContext represents the contextual information about user.\ntype UserContext struct {\n\tMessage *string `json:\"message,omitempty\"`\n\tOcticon *string `json:\"octicon,omitempty\"`\n}\n\n// GetHovercard fetches contextual information about user. It requires authentication\n// via Basic Auth or via OAuth with the repo scope.\n//\n// GitHub API docs: https://docs.github.com/rest/users/users#get-contextual-information-for-a-user\n//\n//meta:operation GET /users/{username}/hovercard\nfunc (s *UsersService) GetHovercard(ctx context.Context, user string, opts *HovercardOptions) (*Hovercard, *Response, error) {\n\tu := fmt.Sprintf(\"users/%v/hovercard\", user)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar hc *Hovercard\n\tresp, err := s.client.Do(ctx, req, &hc)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn hc, resp, nil\n}\n\n// UserListOptions specifies optional parameters to the UsersService.ListAll\n// method.\ntype UserListOptions struct {\n\t// A user ID. Only return users with an ID greater than this ID.\n\tSince   int64 `url:\"since,omitempty\"`\n\tPerPage int   `url:\"per_page,omitempty\"`\n}\n\n// ListAll lists all GitHub users.\n//\n// To paginate through all users, populate 'Since' with the ID of the last user.\n//\n// GitHub API docs: https://docs.github.com/rest/users/users#list-users\n//\n//meta:operation GET /users\nfunc (s *UsersService) ListAll(ctx context.Context, opts *UserListOptions) ([]*User, *Response, error) {\n\tu, err := addOptions(\"users\", opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar users []*User\n\tresp, err := s.client.Do(ctx, req, &users)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn users, resp, nil\n}\n\n// ListInvitations lists all currently-open repository invitations for the\n// authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations-for-the-authenticated-user\n//\n//meta:operation GET /user/repository_invitations\nfunc (s *UsersService) ListInvitations(ctx context.Context, opts *ListOptions) ([]*RepositoryInvitation, *Response, error) {\n\tu, err := addOptions(\"user/repository_invitations\", opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tinvites := []*RepositoryInvitation{}\n\tresp, err := s.client.Do(ctx, req, &invites)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn invites, resp, nil\n}\n\n// AcceptInvitation accepts the currently-open repository invitation for the\n// authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#accept-a-repository-invitation\n//\n//meta:operation PATCH /user/repository_invitations/{invitation_id}\nfunc (s *UsersService) AcceptInvitation(ctx context.Context, invitationID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"user/repository_invitations/%v\", invitationID)\n\treq, err := s.client.NewRequest(\"PATCH\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// DeclineInvitation declines the currently-open repository invitation for the\n// authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/collaborators/invitations#decline-a-repository-invitation\n//\n//meta:operation DELETE /user/repository_invitations/{invitation_id}\nfunc (s *UsersService) DeclineInvitation(ctx context.Context, invitationID int64) (*Response, error) {\n\tu := fmt.Sprintf(\"user/repository_invitations/%v\", invitationID)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/users_administration.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// PromoteSiteAdmin promotes a user to a site administrator of a GitHub Enterprise instance.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator\n//\n//meta:operation PUT /users/{username}/site_admin\nfunc (s *UsersService) PromoteSiteAdmin(ctx context.Context, user string) (*Response, error) {\n\tu := fmt.Sprintf(\"users/%v/site_admin\", user)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// DemoteSiteAdmin demotes a user from site administrator of a GitHub Enterprise instance.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#demote-a-site-administrator\n//\n//meta:operation DELETE /users/{username}/site_admin\nfunc (s *UsersService) DemoteSiteAdmin(ctx context.Context, user string) (*Response, error) {\n\tu := fmt.Sprintf(\"users/%v/site_admin\", user)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// UserSuspendOptions represents the reason to suspend a user.\ntype UserSuspendOptions struct {\n\tReason *string `json:\"reason,omitempty\"`\n}\n\n// Suspend a user on a GitHub Enterprise instance.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#suspend-a-user\n//\n//meta:operation PUT /users/{username}/suspended\nfunc (s *UsersService) Suspend(ctx context.Context, user string, opts *UserSuspendOptions) (*Response, error) {\n\tu := fmt.Sprintf(\"users/%v/suspended\", user)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, opts)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// Unsuspend a user on a GitHub Enterprise instance.\n//\n// GitHub API docs: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#unsuspend-a-user\n//\n//meta:operation DELETE /users/{username}/suspended\nfunc (s *UsersService) Unsuspend(ctx context.Context, user string) (*Response, error) {\n\tu := fmt.Sprintf(\"users/%v/suspended\", user)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/users_administration_test.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestUsersService_PromoteSiteAdmin(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/site_admin\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Users.PromoteSiteAdmin(ctx, \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Users.PromoteSiteAdmin returned error: %v\", err)\n\t}\n\n\tconst methodName = \"PromoteSiteAdmin\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Users.PromoteSiteAdmin(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Users.PromoteSiteAdmin(ctx, \"u\")\n\t})\n}\n\nfunc TestUsersService_DemoteSiteAdmin(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/site_admin\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Users.DemoteSiteAdmin(ctx, \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Users.DemoteSiteAdmin returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DemoteSiteAdmin\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Users.DemoteSiteAdmin(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Users.DemoteSiteAdmin(ctx, \"u\")\n\t})\n}\n\nfunc TestUsersService_Suspend(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/suspended\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Users.Suspend(ctx, \"u\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"Users.Suspend returned error: %v\", err)\n\t}\n\n\tconst methodName = \"Suspend\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Users.Suspend(ctx, \"\\n\", nil)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Users.Suspend(ctx, \"u\", nil)\n\t})\n}\n\nfunc TestUsersServiceReason_Suspend(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &UserSuspendOptions{Reason: Ptr(\"test\")}\n\n\tmux.HandleFunc(\"/users/u/suspended\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *UserSuspendOptions\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PUT\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Users.Suspend(ctx, \"u\", input)\n\tif err != nil {\n\t\tt.Errorf(\"Users.Suspend returned error: %v\", err)\n\t}\n}\n\nfunc TestUsersService_Unsuspend(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/suspended\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Users.Unsuspend(ctx, \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Users.Unsuspend returned error: %v\", err)\n\t}\n\n\tconst methodName = \"Unsuspend\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Users.Unsuspend(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Users.Unsuspend(ctx, \"u\")\n\t})\n}\n\nfunc TestUserSuspendOptions_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &UserSuspendOptions{}, \"{}\")\n\n\tu := &UserSuspendOptions{\n\t\tReason: Ptr(\"reason\"),\n\t}\n\n\twant := `{\n\t\t\"reason\": \"reason\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/users_attestations.go",
    "content": "// Copyright 2024 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// ListAttestations returns a collection of artifact attestations\n// with a given subject digest that are associated with repositories\n// owned by a user.\n//\n// GitHub API docs: https://docs.github.com/rest/users/attestations#list-attestations\n//\n//meta:operation GET /users/{username}/attestations/{subject_digest}\nfunc (s *UsersService) ListAttestations(ctx context.Context, user, subjectDigest string, opts *ListOptions) (*AttestationsResponse, *Response, error) {\n\tu := fmt.Sprintf(\"users/%v/attestations/%v\", user, subjectDigest)\n\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar attestations *AttestationsResponse\n\tres, err := s.client.Do(ctx, req, &attestations)\n\tif err != nil {\n\t\treturn nil, res, err\n\t}\n\n\treturn attestations, res, nil\n}\n"
  },
  {
    "path": "github/users_attestations_test.go",
    "content": "// Copyright 2024 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestUsersService_ListAttestations(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/attestations/digest\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"attestations\": [\n\t\t\t\t{\n\t\t\t\t\t\"repository_id\": 1,\n\t\t\t\t\t\"bundle\": {}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"repository_id\": 2,\n\t\t\t\t\t\"bundle\": {}\n\t\t\t\t}\n\t\t\t]\n\t\t}`)\n\t})\n\tctx := t.Context()\n\tattestations, _, err := client.Users.ListAttestations(ctx, \"u\", \"digest\", &ListOptions{})\n\tif err != nil {\n\t\tt.Errorf(\"Users.ListAttestations returned error: %v\", err)\n\t}\n\n\twant := &AttestationsResponse{\n\t\tAttestations: []*Attestation{\n\t\t\t{\n\t\t\t\tRepositoryID: 1,\n\t\t\t\tBundle:       []byte(`{}`),\n\t\t\t},\n\t\t\t{\n\t\t\t\tRepositoryID: 2,\n\t\t\t\tBundle:       []byte(`{}`),\n\t\t\t},\n\t\t},\n\t}\n\n\tif !cmp.Equal(attestations, want) {\n\t\tt.Errorf(\"Users.ListAttestations = %+v, want %+v\", attestations, want)\n\t}\n\tconst methodName = \"ListAttestations\"\n\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Users.ListAttestations(ctx, \"\\n\", \"\\n\", &ListOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.ListAttestations(ctx, \"u\", \"digest\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/users_blocking.go",
    "content": "// Copyright 2017 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// ListBlockedUsers lists all the blocked users by the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/users/blocking#list-users-blocked-by-the-authenticated-user\n//\n//meta:operation GET /user/blocks\nfunc (s *UsersService) ListBlockedUsers(ctx context.Context, opts *ListOptions) ([]*User, *Response, error) {\n\tu := \"user/blocks\"\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeBlockUsersPreview)\n\n\tvar blockedUsers []*User\n\tresp, err := s.client.Do(ctx, req, &blockedUsers)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn blockedUsers, resp, nil\n}\n\n// IsBlocked reports whether specified user is blocked by the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/users/blocking#check-if-a-user-is-blocked-by-the-authenticated-user\n//\n//meta:operation GET /user/blocks/{username}\nfunc (s *UsersService) IsBlocked(ctx context.Context, user string) (bool, *Response, error) {\n\tu := fmt.Sprintf(\"user/blocks/%v\", user)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn false, nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeBlockUsersPreview)\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tisBlocked, err := parseBoolResponse(err)\n\treturn isBlocked, resp, err\n}\n\n// BlockUser blocks specified user for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/users/blocking#block-a-user\n//\n//meta:operation PUT /user/blocks/{username}\nfunc (s *UsersService) BlockUser(ctx context.Context, user string) (*Response, error) {\n\tu := fmt.Sprintf(\"user/blocks/%v\", user)\n\n\treq, err := s.client.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeBlockUsersPreview)\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// UnblockUser unblocks specified user for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/users/blocking#unblock-a-user\n//\n//meta:operation DELETE /user/blocks/{username}\nfunc (s *UsersService) UnblockUser(ctx context.Context, user string) (*Response, error) {\n\tu := fmt.Sprintf(\"user/blocks/%v\", user)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.Header.Set(\"Accept\", mediaTypeBlockUsersPreview)\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/users_blocking_test.go",
    "content": "// Copyright 2017 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestUsersService_ListBlockedUsers(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/blocks\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeBlockUsersPreview)\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"login\": \"octocat\"\n\t\t}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tblockedUsers, _, err := client.Users.ListBlockedUsers(ctx, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Users.ListBlockedUsers returned error: %v\", err)\n\t}\n\n\twant := []*User{{Login: Ptr(\"octocat\")}}\n\tif !cmp.Equal(blockedUsers, want) {\n\t\tt.Errorf(\"Users.ListBlockedUsers returned %+v, want %+v\", blockedUsers, want)\n\t}\n\n\tconst methodName = \"ListBlockedUsers\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.ListBlockedUsers(ctx, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_IsBlocked(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/blocks/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeBlockUsersPreview)\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tisBlocked, _, err := client.Users.IsBlocked(ctx, \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Users.IsBlocked returned error: %v\", err)\n\t}\n\tif want := true; isBlocked != want {\n\t\tt.Errorf(\"Users.IsBlocked returned %+v, want %+v\", isBlocked, want)\n\t}\n\n\tconst methodName = \"IsBlocked\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Users.IsBlocked(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.IsBlocked(ctx, \"u\")\n\t\tif got {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_BlockUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/blocks/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeBlockUsersPreview)\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Users.BlockUser(ctx, \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Users.BlockUser returned error: %v\", err)\n\t}\n\n\tconst methodName = \"BlockUser\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Users.BlockUser(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Users.BlockUser(ctx, \"u\")\n\t})\n}\n\nfunc TestUsersService_UnblockUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/blocks/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestHeader(t, r, \"Accept\", mediaTypeBlockUsersPreview)\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Users.UnblockUser(ctx, \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Users.UnblockUser returned error: %v\", err)\n\t}\n\n\tconst methodName = \"UnblockUser\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Users.UnblockUser(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Users.UnblockUser(ctx, \"u\")\n\t})\n}\n"
  },
  {
    "path": "github/users_emails.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport \"context\"\n\n// UserEmail represents user's email address.\ntype UserEmail struct {\n\tEmail      *string `json:\"email,omitempty\"`\n\tPrimary    *bool   `json:\"primary,omitempty\"`\n\tVerified   *bool   `json:\"verified,omitempty\"`\n\tVisibility *string `json:\"visibility,omitempty\"`\n}\n\n// ListEmails lists all email addresses for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/users/emails#list-email-addresses-for-the-authenticated-user\n//\n//meta:operation GET /user/emails\nfunc (s *UsersService) ListEmails(ctx context.Context, opts *ListOptions) ([]*UserEmail, *Response, error) {\n\tu := \"user/emails\"\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar emails []*UserEmail\n\tresp, err := s.client.Do(ctx, req, &emails)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn emails, resp, nil\n}\n\n// AddEmails adds email addresses of the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/users/emails#add-an-email-address-for-the-authenticated-user\n//\n//meta:operation POST /user/emails\nfunc (s *UsersService) AddEmails(ctx context.Context, emails []string) ([]*UserEmail, *Response, error) {\n\tu := \"user/emails\"\n\treq, err := s.client.NewRequest(\"POST\", u, emails)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar e []*UserEmail\n\tresp, err := s.client.Do(ctx, req, &e)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn e, resp, nil\n}\n\n// DeleteEmails deletes email addresses from authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/users/emails#delete-an-email-address-for-the-authenticated-user\n//\n//meta:operation DELETE /user/emails\nfunc (s *UsersService) DeleteEmails(ctx context.Context, emails []string) (*Response, error) {\n\tu := \"user/emails\"\n\treq, err := s.client.NewRequest(\"DELETE\", u, emails)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// SetEmailVisibility sets the visibility for the primary email address of the authenticated user.\n// `visibility` can be \"private\" or \"public\".\n//\n// GitHub API docs: https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user\n//\n//meta:operation PATCH /user/email/visibility\nfunc (s *UsersService) SetEmailVisibility(ctx context.Context, visibility string) ([]*UserEmail, *Response, error) {\n\tu := \"user/email/visibility\"\n\n\tupdateVisibilityReq := &UserEmail{\n\t\tVisibility: &visibility,\n\t}\n\n\treq, err := s.client.NewRequest(\"PATCH\", u, updateVisibilityReq)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar e []*UserEmail\n\tresp, err := s.client.Do(ctx, req, &e)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn e, resp, nil\n}\n"
  },
  {
    "path": "github/users_emails_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestUsersService_ListEmails(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/emails\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"email\": \"user@example.com\",\n\t\t\t\"verified\": false,\n\t\t\t\"primary\": true\n\t\t}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\temails, _, err := client.Users.ListEmails(ctx, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Users.ListEmails returned error: %v\", err)\n\t}\n\n\twant := []*UserEmail{{Email: Ptr(\"user@example.com\"), Verified: Ptr(false), Primary: Ptr(true)}}\n\tif !cmp.Equal(emails, want) {\n\t\tt.Errorf(\"Users.ListEmails returned %+v, want %+v\", emails, want)\n\t}\n\n\tconst methodName = \"ListEmails\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.ListEmails(ctx, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_AddEmails(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := []string{\"new@example.com\"}\n\n\tmux.HandleFunc(\"/user/emails\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v []string\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `[{\"email\":\"old@example.com\"}, {\"email\":\"new@example.com\"}]`)\n\t})\n\n\tctx := t.Context()\n\temails, _, err := client.Users.AddEmails(ctx, input)\n\tif err != nil {\n\t\tt.Errorf(\"Users.AddEmails returned error: %v\", err)\n\t}\n\n\twant := []*UserEmail{\n\t\t{Email: Ptr(\"old@example.com\")},\n\t\t{Email: Ptr(\"new@example.com\")},\n\t}\n\tif !cmp.Equal(emails, want) {\n\t\tt.Errorf(\"Users.AddEmails returned %+v, want %+v\", emails, want)\n\t}\n\n\tconst methodName = \"AddEmails\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.AddEmails(ctx, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_DeleteEmails(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := []string{\"user@example.com\"}\n\n\tmux.HandleFunc(\"/user/emails\", func(_ http.ResponseWriter, r *http.Request) {\n\t\tvar v []string\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Users.DeleteEmails(ctx, input)\n\tif err != nil {\n\t\tt.Errorf(\"Users.DeleteEmails returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteEmails\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Users.DeleteEmails(ctx, input)\n\t})\n}\n\nfunc TestUserEmail_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &UserEmail{}, \"{}\")\n\n\tu := &UserEmail{\n\t\tEmail:      Ptr(\"qwe@qwe.qwe\"),\n\t\tPrimary:    Ptr(false),\n\t\tVerified:   Ptr(true),\n\t\tVisibility: Ptr(\"yes\"),\n\t}\n\n\twant := `{\n\t\t\"email\": \"qwe@qwe.qwe\",\n\t\t\"primary\": false,\n\t\t\"verified\": true,\n\t\t\"visibility\": \"yes\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestUsersService_SetEmailVisibility(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &UserEmail{Visibility: Ptr(\"private\")}\n\n\tmux.HandleFunc(\"/user/email/visibility\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *UserEmail\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"email\": \"user@example.com\",\n\t\t\t\"verified\": false,\n\t\t\t\"primary\": true,\n\t\t\t\"visibility\": \"private\"\n\t\t}]`)\n\t})\n\n\tctx := t.Context()\n\temails, _, err := client.Users.SetEmailVisibility(ctx, \"private\")\n\tif err != nil {\n\t\tt.Errorf(\"Users.SetEmailVisibility returned error: %v\", err)\n\t}\n\n\twant := []*UserEmail{{Email: Ptr(\"user@example.com\"), Verified: Ptr(false), Primary: Ptr(true), Visibility: Ptr(\"private\")}}\n\tif !cmp.Equal(emails, want) {\n\t\tt.Errorf(\"Users.SetEmailVisibility returned %+v, want %+v\", emails, want)\n\t}\n\n\tconst methodName = \"SetEmailVisibility\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.SetEmailVisibility(ctx, \"private\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/users_followers.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// ListFollowers lists the followers for a user. Passing the empty string will\n// fetch followers for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/users/followers#list-followers-of-a-user\n//\n// GitHub API docs: https://docs.github.com/rest/users/followers#list-followers-of-the-authenticated-user\n//\n//meta:operation GET /user/followers\n//meta:operation GET /users/{username}/followers\nfunc (s *UsersService) ListFollowers(ctx context.Context, user string, opts *ListOptions) ([]*User, *Response, error) {\n\tvar u string\n\tif user != \"\" {\n\t\tu = fmt.Sprintf(\"users/%v/followers\", user)\n\t} else {\n\t\tu = \"user/followers\"\n\t}\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar users []*User\n\tresp, err := s.client.Do(ctx, req, &users)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn users, resp, nil\n}\n\n// ListFollowing lists the people that a user is following. Passing the empty\n// string will list people the authenticated user is following.\n//\n// GitHub API docs: https://docs.github.com/rest/users/followers#list-the-people-a-user-follows\n//\n// GitHub API docs: https://docs.github.com/rest/users/followers#list-the-people-the-authenticated-user-follows\n//\n//meta:operation GET /user/following\n//meta:operation GET /users/{username}/following\nfunc (s *UsersService) ListFollowing(ctx context.Context, user string, opts *ListOptions) ([]*User, *Response, error) {\n\tvar u string\n\tif user != \"\" {\n\t\tu = fmt.Sprintf(\"users/%v/following\", user)\n\t} else {\n\t\tu = \"user/following\"\n\t}\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar users []*User\n\tresp, err := s.client.Do(ctx, req, &users)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn users, resp, nil\n}\n\n// IsFollowing checks if \"user\" is following \"target\". Passing the empty\n// string for \"user\" will check if the authenticated user is following \"target\".\n//\n// GitHub API docs: https://docs.github.com/rest/users/followers#check-if-a-person-is-followed-by-the-authenticated-user\n//\n// GitHub API docs: https://docs.github.com/rest/users/followers#check-if-a-user-follows-another-user\n//\n//meta:operation GET /user/following/{username}\n//meta:operation GET /users/{username}/following/{target_user}\nfunc (s *UsersService) IsFollowing(ctx context.Context, user, target string) (bool, *Response, error) {\n\tvar u string\n\tif user != \"\" {\n\t\tu = fmt.Sprintf(\"users/%v/following/%v\", user, target)\n\t} else {\n\t\tu = fmt.Sprintf(\"user/following/%v\", target)\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn false, nil, err\n\t}\n\n\tresp, err := s.client.Do(ctx, req, nil)\n\tfollowing, err := parseBoolResponse(err)\n\treturn following, resp, err\n}\n\n// Follow will cause the authenticated user to follow the specified user.\n//\n// GitHub API docs: https://docs.github.com/rest/users/followers#follow-a-user\n//\n//meta:operation PUT /user/following/{username}\nfunc (s *UsersService) Follow(ctx context.Context, user string) (*Response, error) {\n\tu := fmt.Sprintf(\"user/following/%v\", user)\n\treq, err := s.client.NewRequest(\"PUT\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// Unfollow will cause the authenticated user to unfollow the specified user.\n//\n// GitHub API docs: https://docs.github.com/rest/users/followers#unfollow-a-user\n//\n//meta:operation DELETE /user/following/{username}\nfunc (s *UsersService) Unfollow(ctx context.Context, user string) (*Response, error) {\n\tu := fmt.Sprintf(\"user/following/%v\", user)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/users_followers_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestUsersService_ListFollowers_authenticatedUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/followers\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tusers, _, err := client.Users.ListFollowers(ctx, \"\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Users.ListFollowers returned error: %v\", err)\n\t}\n\n\twant := []*User{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(users, want) {\n\t\tt.Errorf(\"Users.ListFollowers returned %+v, want %+v\", users, want)\n\t}\n\n\tconst methodName = \"ListFollowers\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Users.ListFollowers(ctx, \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.ListFollowers(ctx, \"\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_ListFollowers_specifiedUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/followers\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\tctx := t.Context()\n\tusers, _, err := client.Users.ListFollowers(ctx, \"u\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"Users.ListFollowers returned error: %v\", err)\n\t}\n\n\twant := []*User{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(users, want) {\n\t\tt.Errorf(\"Users.ListFollowers returned %+v, want %+v\", users, want)\n\t}\n\n\tconst methodName = \"ListFollowers\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Users.ListFollowers(ctx, \"\\n\", nil)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.ListFollowers(ctx, \"u\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_ListFollowers_invalidUser(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Users.ListFollowers(ctx, \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestUsersService_ListFollowing_authenticatedUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/following\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topts := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tusers, _, err := client.Users.ListFollowing(ctx, \"\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Users.ListFollowing returned error: %v\", err)\n\t}\n\n\twant := []*User{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(users, want) {\n\t\tt.Errorf(\"Users.ListFollowing returned %+v, want %+v\", users, want)\n\t}\n\n\tconst methodName = \"ListFollowing\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Users.ListFollowing(ctx, \"\\n\", opts)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.ListFollowing(ctx, \"\", opts)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_ListFollowing_specifiedUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/following\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\tctx := t.Context()\n\tusers, _, err := client.Users.ListFollowing(ctx, \"u\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"Users.ListFollowing returned error: %v\", err)\n\t}\n\n\twant := []*User{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(users, want) {\n\t\tt.Errorf(\"Users.ListFollowing returned %+v, want %+v\", users, want)\n\t}\n\n\tconst methodName = \"ListFollowing\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Users.ListFollowing(ctx, \"\\n\", nil)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.ListFollowing(ctx, \"u\", nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_ListFollowing_invalidUser(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Users.ListFollowing(ctx, \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestUsersService_IsFollowing_authenticatedUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/following/t\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tfollowing, _, err := client.Users.IsFollowing(ctx, \"\", \"t\")\n\tif err != nil {\n\t\tt.Errorf(\"Users.IsFollowing returned error: %v\", err)\n\t}\n\tif want := true; following != want {\n\t\tt.Errorf(\"Users.IsFollowing returned %+v, want %+v\", following, want)\n\t}\n\n\tconst methodName = \"IsFollowing\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Users.IsFollowing(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.IsFollowing(ctx, \"\", \"t\")\n\t\tif got {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want false\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_IsFollowing_specifiedUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/following/t\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tfollowing, _, err := client.Users.IsFollowing(ctx, \"u\", \"t\")\n\tif err != nil {\n\t\tt.Errorf(\"Users.IsFollowing returned error: %v\", err)\n\t}\n\tif want := true; following != want {\n\t\tt.Errorf(\"Users.IsFollowing returned %+v, want %+v\", following, want)\n\t}\n\n\tconst methodName = \"IsFollowing\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Users.IsFollowing(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.IsFollowing(ctx, \"u\", \"t\")\n\t\tif got {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want false\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_IsFollowing_false(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/following/t\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tw.WriteHeader(http.StatusNotFound)\n\t})\n\n\tctx := t.Context()\n\tfollowing, _, err := client.Users.IsFollowing(ctx, \"u\", \"t\")\n\tif err != nil {\n\t\tt.Errorf(\"Users.IsFollowing returned error: %v\", err)\n\t}\n\tif want := false; following != want {\n\t\tt.Errorf(\"Users.IsFollowing returned %+v, want %+v\", following, want)\n\t}\n\n\tconst methodName = \"IsFollowing\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Users.IsFollowing(ctx, \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.IsFollowing(ctx, \"u\", \"t\")\n\t\tif got {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want false\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_IsFollowing_error(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/following/t\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\thttp.Error(w, \"BadRequest\", http.StatusBadRequest)\n\t})\n\n\tctx := t.Context()\n\tfollowing, _, err := client.Users.IsFollowing(ctx, \"u\", \"t\")\n\tif err == nil {\n\t\tt.Error(\"Expected HTTP 400 response\")\n\t}\n\tif want := false; following != want {\n\t\tt.Errorf(\"Users.IsFollowing returned %+v, want %+v\", following, want)\n\t}\n\n\tconst methodName = \"IsFollowing\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Users.IsFollowing(ctx, \"u\", \"t\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.IsFollowing(ctx, \"u\", \"t\")\n\t\tif got {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want false\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_IsFollowing_invalidUser(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Users.IsFollowing(ctx, \"%\", \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestUsersService_Follow(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/following/u\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PUT\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Users.Follow(ctx, \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Users.Follow returned error: %v\", err)\n\t}\n\n\tconst methodName = \"Follow\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Users.Follow(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Users.Follow(ctx, \"u\")\n\t})\n}\n\nfunc TestUsersService_Follow_invalidUser(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Users.Follow(ctx, \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestUsersService_Unfollow(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/following/u\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Users.Unfollow(ctx, \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Users.Follow returned error: %v\", err)\n\t}\n\n\tconst methodName = \"Unfollow\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Users.Unfollow(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Users.Unfollow(ctx, \"u\")\n\t})\n}\n\nfunc TestUsersService_Unfollow_invalidUser(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, err := client.Users.Unfollow(ctx, \"%\")\n\ttestURLParseError(t, err)\n}\n"
  },
  {
    "path": "github/users_gpg_keys.go",
    "content": "// Copyright 2016 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// GPGKey represents a GitHub user's public GPG key used to verify GPG signed commits and tags.\n//\n// https://developer.github.com/changes/2016-04-04-git-signing-api-preview/\ntype GPGKey struct {\n\tID                *int64      `json:\"id,omitempty\"`\n\tPrimaryKeyID      *int64      `json:\"primary_key_id,omitempty\"`\n\tKeyID             *string     `json:\"key_id,omitempty\"`\n\tRawKey            *string     `json:\"raw_key,omitempty\"`\n\tPublicKey         *string     `json:\"public_key,omitempty\"`\n\tEmails            []*GPGEmail `json:\"emails,omitempty\"`\n\tSubkeys           []*GPGKey   `json:\"subkeys,omitempty\"`\n\tCanSign           *bool       `json:\"can_sign,omitempty\"`\n\tCanEncryptComms   *bool       `json:\"can_encrypt_comms,omitempty\"`\n\tCanEncryptStorage *bool       `json:\"can_encrypt_storage,omitempty\"`\n\tCanCertify        *bool       `json:\"can_certify,omitempty\"`\n\tCreatedAt         *Timestamp  `json:\"created_at,omitempty\"`\n\tExpiresAt         *Timestamp  `json:\"expires_at,omitempty\"`\n}\n\n// String stringifies a GPGKey.\nfunc (k GPGKey) String() string {\n\treturn Stringify(k)\n}\n\n// GPGEmail represents an email address associated to a GPG key.\ntype GPGEmail struct {\n\tEmail    *string `json:\"email,omitempty\"`\n\tVerified *bool   `json:\"verified,omitempty\"`\n}\n\n// ListGPGKeys lists the public GPG keys for a user. Passing the empty\n// string will fetch keys for the authenticated user. It requires authentication\n// via Basic Auth or via OAuth with at least read:gpg_key scope.\n//\n// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-a-user\n//\n// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-the-authenticated-user\n//\n//meta:operation GET /user/gpg_keys\n//meta:operation GET /users/{username}/gpg_keys\nfunc (s *UsersService) ListGPGKeys(ctx context.Context, user string, opts *ListOptions) ([]*GPGKey, *Response, error) {\n\tvar u string\n\tif user != \"\" {\n\t\tu = fmt.Sprintf(\"users/%v/gpg_keys\", user)\n\t} else {\n\t\tu = \"user/gpg_keys\"\n\t}\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar keys []*GPGKey\n\tresp, err := s.client.Do(ctx, req, &keys)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn keys, resp, nil\n}\n\n// GetGPGKey gets extended details for a single GPG key. It requires authentication\n// via Basic Auth or via OAuth with at least read:gpg_key scope.\n//\n// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#get-a-gpg-key-for-the-authenticated-user\n//\n//meta:operation GET /user/gpg_keys/{gpg_key_id}\nfunc (s *UsersService) GetGPGKey(ctx context.Context, id int64) (*GPGKey, *Response, error) {\n\tu := fmt.Sprintf(\"user/gpg_keys/%v\", id)\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar key *GPGKey\n\tresp, err := s.client.Do(ctx, req, &key)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn key, resp, nil\n}\n\n// CreateGPGKey creates a GPG key. It requires authentication via Basic Auth\n// or OAuth with at least write:gpg_key scope.\n//\n// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#create-a-gpg-key-for-the-authenticated-user\n//\n//meta:operation POST /user/gpg_keys\nfunc (s *UsersService) CreateGPGKey(ctx context.Context, armoredPublicKey string) (*GPGKey, *Response, error) {\n\tgpgKey := &struct {\n\t\tArmoredPublicKey string `json:\"armored_public_key\"`\n\t}{ArmoredPublicKey: armoredPublicKey}\n\treq, err := s.client.NewRequest(\"POST\", \"user/gpg_keys\", gpgKey)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar key *GPGKey\n\tresp, err := s.client.Do(ctx, req, &key)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn key, resp, nil\n}\n\n// DeleteGPGKey deletes a GPG key. It requires authentication via Basic Auth or\n// via OAuth with at least admin:gpg_key scope.\n//\n// GitHub API docs: https://docs.github.com/rest/users/gpg-keys#delete-a-gpg-key-for-the-authenticated-user\n//\n//meta:operation DELETE /user/gpg_keys/{gpg_key_id}\nfunc (s *UsersService) DeleteGPGKey(ctx context.Context, id int64) (*Response, error) {\n\tu := fmt.Sprintf(\"user/gpg_keys/%v\", id)\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/users_gpg_keys_test.go",
    "content": "// Copyright 2016 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestUsersService_ListGPGKeys_authenticatedUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/gpg_keys\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":1,\"primary_key_id\":2}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tkeys, _, err := client.Users.ListGPGKeys(ctx, \"\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Users.ListGPGKeys returned error: %v\", err)\n\t}\n\n\twant := []*GPGKey{{ID: Ptr(int64(1)), PrimaryKeyID: Ptr(int64(2))}}\n\tif !cmp.Equal(keys, want) {\n\t\tt.Errorf(\"Users.ListGPGKeys = %+v, want %+v\", keys, want)\n\t}\n\n\tconst methodName = \"ListGPGKeys\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Users.ListGPGKeys(ctx, \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.ListGPGKeys(ctx, \"\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_ListGPGKeys_specifiedUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/gpg_keys\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"id\":1,\"primary_key_id\":2}]`)\n\t})\n\n\tctx := t.Context()\n\tkeys, _, err := client.Users.ListGPGKeys(ctx, \"u\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"Users.ListGPGKeys returned error: %v\", err)\n\t}\n\n\twant := []*GPGKey{{ID: Ptr(int64(1)), PrimaryKeyID: Ptr(int64(2))}}\n\tif !cmp.Equal(keys, want) {\n\t\tt.Errorf(\"Users.ListGPGKeys = %+v, want %+v\", keys, want)\n\t}\n}\n\nfunc TestUsersService_ListGPGKeys_invalidUser(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Users.ListGPGKeys(ctx, \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestUsersService_GetGPGKey(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/gpg_keys/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tkey, _, err := client.Users.GetGPGKey(ctx, 1)\n\tif err != nil {\n\t\tt.Errorf(\"Users.GetGPGKey returned error: %v\", err)\n\t}\n\n\twant := &GPGKey{ID: Ptr(int64(1))}\n\tif !cmp.Equal(key, want) {\n\t\tt.Errorf(\"Users.GetGPGKey = %+v, want %+v\", key, want)\n\t}\n\n\tconst methodName = \"GetGPGKey\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Users.GetGPGKey(ctx, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.GetGPGKey(ctx, 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_CreateGPGKey(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := `\n-----BEGIN PGP PUBLIC KEY BLOCK-----\nComment: GPGTools - https://gpgtools.org\n\nmQINBFcEd9kBEACo54TDbGhKlXKWMvJgecEUKPPcv7XdnpKdGb3LRw5MvFwT0V0f\n...\n=tqfb\n-----END PGP PUBLIC KEY BLOCK-----`\n\n\tmux.HandleFunc(\"/user/gpg_keys\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar gpgKey struct {\n\t\t\tArmoredPublicKey *string `json:\"armored_public_key,omitempty\"`\n\t\t}\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&gpgKey))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif gpgKey.ArmoredPublicKey == nil || *gpgKey.ArmoredPublicKey != input {\n\t\t\tt.Errorf(\"gpgKey = %+v, want %q\", gpgKey, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tgpgKey, _, err := client.Users.CreateGPGKey(ctx, input)\n\tif err != nil {\n\t\tt.Errorf(\"Users.GetGPGKey returned error: %v\", err)\n\t}\n\n\twant := &GPGKey{ID: Ptr(int64(1))}\n\tif !cmp.Equal(gpgKey, want) {\n\t\tt.Errorf(\"Users.GetGPGKey = %+v, want %+v\", gpgKey, want)\n\t}\n\n\tconst methodName = \"CreateGPGKey\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.CreateGPGKey(ctx, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_DeleteGPGKey(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/gpg_keys/1\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Users.DeleteGPGKey(ctx, 1)\n\tif err != nil {\n\t\tt.Errorf(\"Users.DeleteGPGKey returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteGPGKey\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Users.DeleteGPGKey(ctx, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Users.DeleteGPGKey(ctx, 1)\n\t})\n}\n\nfunc TestGPGEmail_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &GPGEmail{}, \"{}\")\n\n\tu := &GPGEmail{\n\t\tEmail:    Ptr(\"email@example.com\"),\n\t\tVerified: Ptr(false),\n\t}\n\n\twant := `{\n\t\t\"email\" : \"email@example.com\",\n\t\t\"verified\" : false\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestGPGKey_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &GPGKey{}, \"{}\")\n\n\tti := &Timestamp{}\n\n\tg := &GPGKey{\n\t\tID:           Ptr(int64(1)),\n\t\tPrimaryKeyID: Ptr(int64(1)),\n\t\tKeyID:        Ptr(\"someKeyID\"),\n\t\tRawKey:       Ptr(\"someRawKeyID\"),\n\t\tPublicKey:    Ptr(\"somePublicKey\"),\n\t\tEmails: []*GPGEmail{\n\t\t\t{\n\t\t\t\tEmail:    Ptr(\"someEmail\"),\n\t\t\t\tVerified: Ptr(true),\n\t\t\t},\n\t\t},\n\t\tSubkeys: []*GPGKey{\n\t\t\t{},\n\t\t},\n\t\tCanSign:           Ptr(true),\n\t\tCanEncryptComms:   Ptr(true),\n\t\tCanEncryptStorage: Ptr(true),\n\t\tCanCertify:        Ptr(true),\n\t\tCreatedAt:         ti,\n\t\tExpiresAt:         ti,\n\t}\n\n\twant := `{\n\t\t\t\"id\":1,\n\t\t\t\"primary_key_id\":1,\n\t\t\t\"key_id\":\"someKeyID\",\n\t\t\t\"raw_key\":\"someRawKeyID\",\n\t\t\t\"public_key\":\"somePublicKey\",\n\t\t\t\"emails\":[\n\t\t\t\t{\n\t\t\t\t\t\"email\":\"someEmail\",\n\t\t\t\t\t\"verified\":true\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"subkeys\":[\n\t\t\t\t{}\n\t\t\t],\n\t\t\t\"can_sign\":true,\n\t\t\t\"can_encrypt_comms\":true,\n\t\t\t\"can_encrypt_storage\":true,\n\t\t\t\"can_certify\":true,\n\t\t\t\"created_at\":\"0001-01-01T00:00:00Z\",\n\t\t\t\"expires_at\":\"0001-01-01T00:00:00Z\"\n\t\t}`\n\n\ttestJSONMarshal(t, g, want)\n}\n"
  },
  {
    "path": "github/users_keys.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// Key represents a public SSH key used to authenticate a user or deploy script.\ntype Key struct {\n\tID        *int64     `json:\"id,omitempty\"`\n\tKey       *string    `json:\"key,omitempty\"`\n\tURL       *string    `json:\"url,omitempty\"`\n\tTitle     *string    `json:\"title,omitempty\"`\n\tReadOnly  *bool      `json:\"read_only,omitempty\"`\n\tVerified  *bool      `json:\"verified,omitempty\"`\n\tCreatedAt *Timestamp `json:\"created_at,omitempty\"`\n\tAddedBy   *string    `json:\"added_by,omitempty\"`\n\tLastUsed  *Timestamp `json:\"last_used,omitempty\"`\n}\n\nfunc (k Key) String() string {\n\treturn Stringify(k)\n}\n\n// ListKeys lists the verified public keys for a user. Passing the empty\n// string will fetch keys for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/users/keys#list-public-keys-for-a-user\n//\n// GitHub API docs: https://docs.github.com/rest/users/keys#list-public-ssh-keys-for-the-authenticated-user\n//\n//meta:operation GET /user/keys\n//meta:operation GET /users/{username}/keys\nfunc (s *UsersService) ListKeys(ctx context.Context, user string, opts *ListOptions) ([]*Key, *Response, error) {\n\tvar u string\n\tif user != \"\" {\n\t\tu = fmt.Sprintf(\"users/%v/keys\", user)\n\t} else {\n\t\tu = \"user/keys\"\n\t}\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar keys []*Key\n\tresp, err := s.client.Do(ctx, req, &keys)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn keys, resp, nil\n}\n\n// GetKey fetches a single public key.\n//\n// GitHub API docs: https://docs.github.com/rest/users/keys#get-a-public-ssh-key-for-the-authenticated-user\n//\n//meta:operation GET /user/keys/{key_id}\nfunc (s *UsersService) GetKey(ctx context.Context, id int64) (*Key, *Response, error) {\n\tu := fmt.Sprintf(\"user/keys/%v\", id)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar key *Key\n\tresp, err := s.client.Do(ctx, req, &key)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn key, resp, nil\n}\n\n// CreateKey adds a public key for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/users/keys#create-a-public-ssh-key-for-the-authenticated-user\n//\n//meta:operation POST /user/keys\nfunc (s *UsersService) CreateKey(ctx context.Context, key *Key) (*Key, *Response, error) {\n\tu := \"user/keys\"\n\n\treq, err := s.client.NewRequest(\"POST\", u, key)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar k *Key\n\tresp, err := s.client.Do(ctx, req, &k)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn k, resp, nil\n}\n\n// DeleteKey deletes a public key.\n//\n// GitHub API docs: https://docs.github.com/rest/users/keys#delete-a-public-ssh-key-for-the-authenticated-user\n//\n//meta:operation DELETE /user/keys/{key_id}\nfunc (s *UsersService) DeleteKey(ctx context.Context, id int64) (*Response, error) {\n\tu := fmt.Sprintf(\"user/keys/%v\", id)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/users_keys_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestUsersService_ListKeys_authenticatedUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/keys\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tkeys, _, err := client.Users.ListKeys(ctx, \"\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Users.ListKeys returned error: %v\", err)\n\t}\n\n\twant := []*Key{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(keys, want) {\n\t\tt.Errorf(\"Users.ListKeys returned %+v, want %+v\", keys, want)\n\t}\n\n\tconst methodName = \"ListKeys\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Users.ListKeys(ctx, \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.ListKeys(ctx, \"\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_ListKeys_specifiedUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/keys\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\tctx := t.Context()\n\tkeys, _, err := client.Users.ListKeys(ctx, \"u\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"Users.ListKeys returned error: %v\", err)\n\t}\n\n\twant := []*Key{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(keys, want) {\n\t\tt.Errorf(\"Users.ListKeys returned %+v, want %+v\", keys, want)\n\t}\n}\n\nfunc TestUsersService_ListKeys_invalidUser(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Users.ListKeys(ctx, \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestUsersService_GetKey(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/keys/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tkey, _, err := client.Users.GetKey(ctx, 1)\n\tif err != nil {\n\t\tt.Errorf(\"Users.GetKey returned error: %v\", err)\n\t}\n\n\twant := &Key{ID: Ptr(int64(1))}\n\tif !cmp.Equal(key, want) {\n\t\tt.Errorf(\"Users.GetKey returned %+v, want %+v\", key, want)\n\t}\n\n\tconst methodName = \"GetKey\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Users.GetKey(ctx, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.GetKey(ctx, 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_CreateKey(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &Key{Key: Ptr(\"k\"), Title: Ptr(\"t\")}\n\n\tmux.HandleFunc(\"/user/keys\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *Key\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tkey, _, err := client.Users.CreateKey(ctx, input)\n\tif err != nil {\n\t\tt.Errorf(\"Users.CreateKey returned error: %v\", err)\n\t}\n\n\twant := &Key{ID: Ptr(int64(1))}\n\tif !cmp.Equal(key, want) {\n\t\tt.Errorf(\"Users.CreateKey returned %+v, want %+v\", key, want)\n\t}\n\n\tconst methodName = \"CreateKey\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.CreateKey(ctx, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_DeleteKey(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/keys/1\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Users.DeleteKey(ctx, 1)\n\tif err != nil {\n\t\tt.Errorf(\"Users.DeleteKey returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteKey\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Users.DeleteKey(ctx, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Users.DeleteKey(ctx, 1)\n\t})\n}\n\nfunc TestKey_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Key{}, \"{}\")\n\n\tu := &Key{\n\t\tID:        Ptr(int64(1)),\n\t\tKey:       Ptr(\"abc\"),\n\t\tURL:       Ptr(\"url\"),\n\t\tTitle:     Ptr(\"title\"),\n\t\tReadOnly:  Ptr(true),\n\t\tVerified:  Ptr(true),\n\t\tCreatedAt: &Timestamp{referenceTime},\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"key\": \"abc\",\n\t\t\"url\": \"url\",\n\t\t\"title\": \"title\",\n\t\t\"read_only\": true,\n\t\t\"verified\": true,\n\t\t\"created_at\": ` + referenceTimeStr + `\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/users_packages.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"net/url\"\n)\n\n// ListPackages lists the packages for a user. Passing the empty string for \"user\" will\n// list packages for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/packages/packages#list-packages-for-a-user\n//\n// GitHub API docs: https://docs.github.com/rest/packages/packages#list-packages-for-the-authenticated-users-namespace\n//\n//meta:operation GET /user/packages\n//meta:operation GET /users/{username}/packages\nfunc (s *UsersService) ListPackages(ctx context.Context, user string, opts *PackageListOptions) ([]*Package, *Response, error) {\n\tvar u string\n\tif user != \"\" {\n\t\tu = fmt.Sprintf(\"users/%v/packages\", user)\n\t} else {\n\t\tu = \"user/packages\"\n\t}\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar packages []*Package\n\tresp, err := s.client.Do(ctx, req, &packages)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn packages, resp, nil\n}\n\n// GetPackage gets a package by name for a user. Passing the empty string for \"user\" will\n// get the package for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-for-a-user\n//\n// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-for-the-authenticated-user\n//\n//meta:operation GET /user/packages/{package_type}/{package_name}\n//meta:operation GET /users/{username}/packages/{package_type}/{package_name}\nfunc (s *UsersService) GetPackage(ctx context.Context, user, packageType, packageName string) (*Package, *Response, error) {\n\tvar u string\n\tif user != \"\" {\n\t\tu = fmt.Sprintf(\"users/%v/packages/%v/%v\", user, packageType, url.PathEscape(packageName))\n\t} else {\n\t\tu = fmt.Sprintf(\"user/packages/%v/%v\", packageType, url.PathEscape(packageName))\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar pack *Package\n\tresp, err := s.client.Do(ctx, req, &pack)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn pack, resp, nil\n}\n\n// DeletePackage deletes a package from a user. Passing the empty string for \"user\" will\n// delete the package for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-for-a-user\n//\n// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-for-the-authenticated-user\n//\n//meta:operation DELETE /user/packages/{package_type}/{package_name}\n//meta:operation DELETE /users/{username}/packages/{package_type}/{package_name}\nfunc (s *UsersService) DeletePackage(ctx context.Context, user, packageType, packageName string) (*Response, error) {\n\tvar u string\n\tif user != \"\" {\n\t\tu = fmt.Sprintf(\"users/%v/packages/%v/%v\", user, packageType, packageName)\n\t} else {\n\t\tu = fmt.Sprintf(\"user/packages/%v/%v\", packageType, packageName)\n\t}\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// RestorePackage restores a package to a user. Passing the empty string for \"user\" will\n// restore the package for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-for-a-user\n//\n// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-for-the-authenticated-user\n//\n//meta:operation POST /user/packages/{package_type}/{package_name}/restore\n//meta:operation POST /users/{username}/packages/{package_type}/{package_name}/restore\nfunc (s *UsersService) RestorePackage(ctx context.Context, user, packageType, packageName string) (*Response, error) {\n\tvar u string\n\tif user != \"\" {\n\t\tu = fmt.Sprintf(\"users/%v/packages/%v/%v/restore\", user, packageType, packageName)\n\t} else {\n\t\tu = fmt.Sprintf(\"user/packages/%v/%v/restore\", packageType, packageName)\n\t}\n\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// ListPackageVersionsOptions specifies the optional parameters to the UsersService.ListPackageVersions.\ntype ListPackageVersionsOptions struct {\n\t// State of package either \"active\" or \"deleted\".\n\tState string `url:\"state,omitempty\"`\n\n\tListOptions\n}\n\n// ListPackageVersions gets all versions of a package for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-the-authenticated-user\n//\n//meta:operation GET /user/packages/{package_type}/{package_name}/versions\nfunc (s *UsersService) ListPackageVersions(ctx context.Context, packageType, packageName string, opts *ListPackageVersionsOptions) ([]*PackageVersion, *Response, error) {\n\tu := fmt.Sprintf(\"user/packages/%v/%v/versions\", packageType, packageName)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar versions []*PackageVersion\n\tresp, err := s.client.Do(ctx, req, &versions)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn versions, resp, nil\n}\n\n// ListUserPackageVersions returns package versions for a public package owned by a specified user.\n//\n// GitHub API docs: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-a-user\n//\n//meta:operation GET /users/{username}/packages/{package_type}/{package_name}/versions\nfunc (s *UsersService) ListUserPackageVersions(ctx context.Context, user, packageType, packageName string) ([]*PackageVersion, *Response, error) {\n\tu := fmt.Sprintf(\"users/%v/packages/%v/%v/versions\", user, packageType, packageName)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar versions []*PackageVersion\n\tresp, err := s.client.Do(ctx, req, &versions)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn versions, resp, nil\n}\n\n// PackageGetVersion gets a specific version of a package for a user. Passing the empty string for \"user\" will\n// get the version for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-version-for-a-user\n//\n// GitHub API docs: https://docs.github.com/rest/packages/packages#get-a-package-version-for-the-authenticated-user\n//\n//meta:operation GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}\n//meta:operation GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}\nfunc (s *UsersService) PackageGetVersion(ctx context.Context, user, packageType, packageName string, packageVersionID int64) (*PackageVersion, *Response, error) {\n\tvar u string\n\tif user != \"\" {\n\t\tu = fmt.Sprintf(\"users/%v/packages/%v/%v/versions/%v\", user, packageType, packageName, packageVersionID)\n\t} else {\n\t\tu = fmt.Sprintf(\"user/packages/%v/%v/versions/%v\", packageType, packageName, packageVersionID)\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar version *PackageVersion\n\tresp, err := s.client.Do(ctx, req, &version)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn version, resp, nil\n}\n\n// PackageDeleteVersion deletes a package version for a user. Passing the empty string for \"user\" will\n// delete the version for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-a-package-version-for-the-authenticated-user\n//\n// GitHub API docs: https://docs.github.com/rest/packages/packages#delete-package-version-for-a-user\n//\n//meta:operation DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}\n//meta:operation DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}\nfunc (s *UsersService) PackageDeleteVersion(ctx context.Context, user, packageType, packageName string, packageVersionID int64) (*Response, error) {\n\tvar u string\n\tif user != \"\" {\n\t\tu = fmt.Sprintf(\"users/%v/packages/%v/%v/versions/%v\", user, packageType, packageName, packageVersionID)\n\t} else {\n\t\tu = fmt.Sprintf(\"user/packages/%v/%v/versions/%v\", packageType, packageName, packageVersionID)\n\t}\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// PackageRestoreVersion restores a package version to a user. Passing the empty string for \"user\" will\n// restore the version for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-a-package-version-for-the-authenticated-user\n//\n// GitHub API docs: https://docs.github.com/rest/packages/packages#restore-package-version-for-a-user\n//\n//meta:operation POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\n//meta:operation POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\nfunc (s *UsersService) PackageRestoreVersion(ctx context.Context, user, packageType, packageName string, packageVersionID int64) (*Response, error) {\n\tvar u string\n\tif user != \"\" {\n\t\tu = fmt.Sprintf(\"users/%v/packages/%v/%v/versions/%v/restore\", user, packageType, packageName, packageVersionID)\n\t} else {\n\t\tu = fmt.Sprintf(\"user/packages/%v/%v/versions/%v/restore\", packageType, packageName, packageVersionID)\n\t}\n\n\treq, err := s.client.NewRequest(\"POST\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/users_packages_test.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestUsersService_Authenticated_ListPackages(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/packages\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"package_type\": \"container\", \"visibility\": \"private\"})\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"id\": 197,\n\t\t\t\"name\": \"hello_docker\",\n\t\t\t\"package_type\": \"container\",\n\t\t\t\"version_count\": 1,\n\t\t\t\"visibility\": \"private\",\n\t\t\t\"url\": \"https://api.github.com/orgs/github/packages/container/hello_docker\",\n\t\t\t\"created_at\": `+referenceTimeStr+`,\n\t\t\t\"updated_at\": `+referenceTimeStr+`,\n\t\t\t\"html_url\": \"https://github.com/orgs/github/packages/container/package/hello_docker\"\n\t\t  }]`)\n\t})\n\n\tctx := t.Context()\n\tpackages, _, err := client.Users.ListPackages(ctx, \"\", &PackageListOptions{PackageType: Ptr(\"container\"), Visibility: Ptr(\"private\")})\n\tif err != nil {\n\t\tt.Errorf(\"Users.Authenticated_ListPackages returned error: %v\", err)\n\t}\n\n\twant := []*Package{{\n\t\tID:           Ptr(int64(197)),\n\t\tName:         Ptr(\"hello_docker\"),\n\t\tPackageType:  Ptr(\"container\"),\n\t\tVersionCount: Ptr(int64(1)),\n\t\tVisibility:   Ptr(\"private\"),\n\t\tURL:          Ptr(\"https://api.github.com/orgs/github/packages/container/hello_docker\"),\n\t\tHTMLURL:      Ptr(\"https://github.com/orgs/github/packages/container/package/hello_docker\"),\n\t\tCreatedAt:    &Timestamp{referenceTime},\n\t\tUpdatedAt:    &Timestamp{referenceTime},\n\t}}\n\tif !cmp.Equal(packages, want) {\n\t\tt.Errorf(\"Users.Authenticated_ListPackages returned %+v, want %+v\", packages, want)\n\t}\n\n\tconst methodName = \"ListPackages\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Users.ListPackages(ctx, \"\\n\", &PackageListOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.ListPackages(ctx, \"\", &PackageListOptions{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_specifiedUser_ListPackages(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/packages\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"package_type\": \"container\", \"visibility\": \"public\"})\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"id\": 197,\n\t\t\t\"name\": \"hello_docker\",\n\t\t\t\"package_type\": \"container\",\n\t\t\t\"version_count\": 1,\n\t\t\t\"visibility\": \"public\",\n\t\t\t\"url\": \"https://api.github.com/orgs/github/packages/container/hello_docker\",\n\t\t\t\"created_at\": `+referenceTimeStr+`,\n\t\t\t\"updated_at\": `+referenceTimeStr+`,\n\t\t\t\"html_url\": \"https://github.com/orgs/github/packages/container/package/hello_docker\"\n\t\t  }]`)\n\t})\n\n\tctx := t.Context()\n\tpackages, _, err := client.Users.ListPackages(ctx, \"u\", &PackageListOptions{PackageType: Ptr(\"container\"), Visibility: Ptr(\"public\")})\n\tif err != nil {\n\t\tt.Errorf(\"Users.specifiedUser_ListPackages returned error: %v\", err)\n\t}\n\n\twant := []*Package{{\n\t\tID:           Ptr(int64(197)),\n\t\tName:         Ptr(\"hello_docker\"),\n\t\tPackageType:  Ptr(\"container\"),\n\t\tVersionCount: Ptr(int64(1)),\n\t\tVisibility:   Ptr(\"public\"),\n\t\tURL:          Ptr(\"https://api.github.com/orgs/github/packages/container/hello_docker\"),\n\t\tHTMLURL:      Ptr(\"https://github.com/orgs/github/packages/container/package/hello_docker\"),\n\t\tCreatedAt:    &Timestamp{referenceTime},\n\t\tUpdatedAt:    &Timestamp{referenceTime},\n\t}}\n\tif !cmp.Equal(packages, want) {\n\t\tt.Errorf(\"Users.specifiedUser_ListPackages returned %+v, want %+v\", packages, want)\n\t}\n\n\tconst methodName = \"ListPackages\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Users.ListPackages(ctx, \"\\n\", &PackageListOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.ListPackages(ctx, \"\", &PackageListOptions{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_specifiedUser_GetPackage(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/packages/container/hello%2fhello_docker\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\t_, err := io.WriteString(w, `{\n\t\t\t\"id\": 197,\n\t\t\t\"name\": \"hello/hello_docker\",\n\t\t\t\"package_type\": \"container\",\n\t\t\t\"version_count\": 1,\n\t\t\t\"visibility\": \"private\",\n\t\t\t\"url\": \"https://api.github.com/orgs/github/packages/container/hello%2Fhello_docker\",\n\t\t\t\"created_at\": `+referenceTimeStr+`,\n\t\t\t\"updated_at\": `+referenceTimeStr+`,\n\t\t\t\"html_url\": \"https://github.com/orgs/github/packages/container/package/hello%2Fhello_docker\"\n\t\t  }`)\n\t\tif err != nil {\n\t\t\tt.Fatal(\"Failed to write test response: \", err)\n\t\t}\n\t})\n\n\tctx := t.Context()\n\tpackages, _, err := client.Users.GetPackage(ctx, \"u\", \"container\", \"hello/hello_docker\")\n\tif err != nil {\n\t\tt.Errorf(\"Users.GetPackage returned error: %v\", err)\n\t}\n\n\twant := &Package{\n\t\tID:           Ptr(int64(197)),\n\t\tName:         Ptr(\"hello/hello_docker\"),\n\t\tPackageType:  Ptr(\"container\"),\n\t\tVersionCount: Ptr(int64(1)),\n\t\tVisibility:   Ptr(\"private\"),\n\t\tURL:          Ptr(\"https://api.github.com/orgs/github/packages/container/hello%2Fhello_docker\"),\n\t\tHTMLURL:      Ptr(\"https://github.com/orgs/github/packages/container/package/hello%2Fhello_docker\"),\n\t\tCreatedAt:    &Timestamp{referenceTime},\n\t\tUpdatedAt:    &Timestamp{referenceTime},\n\t}\n\tif !cmp.Equal(packages, want) {\n\t\tt.Errorf(\"Users.specifiedUser_GetPackage returned %+v, want %+v\", packages, want)\n\t}\n\tconst methodName = \"GetPackage\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Users.GetPackage(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.GetPackage(ctx, \"\", \"\", \"\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_Authenticated_GetPackage(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/packages/container/hello_docker\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\n\t\t\t\"id\": 197,\n\t\t\t\"name\": \"hello_docker\",\n\t\t\t\"package_type\": \"container\",\n\t\t\t\"version_count\": 1,\n\t\t\t\"visibility\": \"private\",\n\t\t\t\"url\": \"https://api.github.com/orgs/github/packages/container/hello_docker\",\n\t\t\t\"created_at\": `+referenceTimeStr+`,\n\t\t\t\"updated_at\": `+referenceTimeStr+`,\n\t\t\t\"html_url\": \"https://github.com/orgs/github/packages/container/package/hello_docker\"\n\t\t  }`)\n\t})\n\n\tctx := t.Context()\n\tpackages, _, err := client.Users.GetPackage(ctx, \"\", \"container\", \"hello_docker\")\n\tif err != nil {\n\t\tt.Errorf(\"Users.Authenticated_GetPackage returned error: %v\", err)\n\t}\n\n\twant := &Package{\n\t\tID:           Ptr(int64(197)),\n\t\tName:         Ptr(\"hello_docker\"),\n\t\tPackageType:  Ptr(\"container\"),\n\t\tVersionCount: Ptr(int64(1)),\n\t\tVisibility:   Ptr(\"private\"),\n\t\tURL:          Ptr(\"https://api.github.com/orgs/github/packages/container/hello_docker\"),\n\t\tHTMLURL:      Ptr(\"https://github.com/orgs/github/packages/container/package/hello_docker\"),\n\t\tCreatedAt:    &Timestamp{referenceTime},\n\t\tUpdatedAt:    &Timestamp{referenceTime},\n\t}\n\tif !cmp.Equal(packages, want) {\n\t\tt.Errorf(\"Users.Authenticated_GetPackage returned %+v, want %+v\", packages, want)\n\t}\n\n\tconst methodName = \"GetPackage\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Users.GetPackage(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.GetPackage(ctx, \"\", \"\", \"\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_Authenticated_DeletePackage(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/packages/container/hello_docker\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Users.DeletePackage(ctx, \"\", \"container\", \"hello_docker\")\n\tif err != nil {\n\t\tt.Errorf(\"Users.Authenticated_DeletePackage returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeletePackage\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Users.DeletePackage(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Users.DeletePackage(ctx, \"\", \"\", \"\")\n\t})\n}\n\nfunc TestUsersService_specifiedUser_DeletePackage(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/packages/container/hello_docker\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Users.DeletePackage(ctx, \"u\", \"container\", \"hello_docker\")\n\tif err != nil {\n\t\tt.Errorf(\"Users.specifiedUser_DeletePackage returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeletePackage\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Users.DeletePackage(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Users.DeletePackage(ctx, \"\", \"\", \"\")\n\t})\n}\n\nfunc TestUsersService_Authenticated_RestorePackage(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/packages/container/hello_docker/restore\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Users.RestorePackage(ctx, \"\", \"container\", \"hello_docker\")\n\tif err != nil {\n\t\tt.Errorf(\"Users.Authenticated_RestorePackage returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RestorePackage\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Users.RestorePackage(ctx, \"\\n\", \"\", \"\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Users.RestorePackage(ctx, \"\", \"container\", \"hello_docker\")\n\t})\n}\n\nfunc TestUsersService_specifiedUser_RestorePackage(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/packages/container/hello_docker/restore\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Users.RestorePackage(ctx, \"u\", \"container\", \"hello_docker\")\n\tif err != nil {\n\t\tt.Errorf(\"Users.specifiedUser_RestorePackage returned error: %v\", err)\n\t}\n\n\tconst methodName = \"RestorePackage\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Users.RestorePackage(ctx, \"\\n\", \"\", \"\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Users.RestorePackage(ctx, \"\", \"container\", \"hello_docker\")\n\t})\n}\n\nfunc TestUsersService_ListPackageVersions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tm := `{\n\t\t\"package_type\": \"container\",\n\t\t\"container\": {\n\t\t\t\"tags\": [\n\t\t\t\"latest\"\n\t\t\t]\n\t\t}\n\t}`\n\n\tmux.HandleFunc(\"/user/packages/container/hello_docker/versions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[\n\t\t\t{\n\t\t\t  \"id\": 45763,\n\t\t\t  \"name\": \"sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9\",\n\t\t\t  \"url\": \"https://api.github.com/users/octocat/packages/container/hello_docker/versions/45763\",\n\t\t\t  \"package_html_url\": \"https://github.com/users/octocat/packages/container/package/hello_docker\",\n\t\t\t  \"created_at\": `+referenceTimeStr+`,\n\t\t\t  \"updated_at\": `+referenceTimeStr+`,\n\t\t\t  \"html_url\": \"https://github.com/users/octocat/packages/container/hello_docker/45763\",\n\t\t\t  \"metadata\": `+m+`\n\t\t\t}]`)\n\t})\n\n\tctx := t.Context()\n\topts := &ListPackageVersionsOptions{\n\t\tListOptions: ListOptions{Page: 1, PerPage: 2},\n\t}\n\tpackages, _, err := client.Users.ListPackageVersions(ctx, \"container\", \"hello_docker\", opts)\n\tif err != nil {\n\t\tt.Errorf(\"Users.ListPackageVersions returned error: %v\", err)\n\t}\n\n\twant := []*PackageVersion{{\n\t\tID:             Ptr(int64(45763)),\n\t\tName:           Ptr(\"sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9\"),\n\t\tURL:            Ptr(\"https://api.github.com/users/octocat/packages/container/hello_docker/versions/45763\"),\n\t\tPackageHTMLURL: Ptr(\"https://github.com/users/octocat/packages/container/package/hello_docker\"),\n\t\tCreatedAt:      &Timestamp{referenceTime},\n\t\tUpdatedAt:      &Timestamp{referenceTime},\n\t\tHTMLURL:        Ptr(\"https://github.com/users/octocat/packages/container/hello_docker/45763\"),\n\t\tMetadata:       json.RawMessage(m),\n\t}}\n\tif !cmp.Equal(packages, want) {\n\t\tt.Errorf(\"Users.ListPackageVersions returned %+v, want %+v\", packages, want)\n\t}\n\n\tconst methodName = \"ListPackageVersions\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Users.ListPackageVersions(ctx, \"\\n\", \"\\n\", &ListPackageVersionsOptions{})\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.ListPackageVersions(ctx, \"\", \"\", &ListPackageVersionsOptions{})\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_ListUserPackageVersions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tm := `{\n\t\t\"package_type\": \"container\",\n\t\t\"container\": {\n\t\t\t\"tags\": [\n\t\t\t\"latest\"\n\t\t\t]\n\t\t}\n\t}`\n\n\tmux.HandleFunc(\"/users/u/packages/container/hello_docker/versions\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[\n\t\t\t{\n\t\t\t  \"id\": 45763,\n\t\t\t  \"name\": \"sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9\",\n\t\t\t  \"url\": \"https://api.github.com/users/octocat/packages/container/hello_docker/versions/45763\",\n\t\t\t  \"package_html_url\": \"https://github.com/users/octocat/packages/container/package/hello_docker\",\n\t\t\t  \"created_at\": `+referenceTimeStr+`,\n\t\t\t  \"updated_at\": `+referenceTimeStr+`,\n\t\t\t  \"html_url\": \"https://github.com/users/octocat/packages/container/hello_docker/45763\",\n\t\t\t  \"metadata\": `+m+`\n\t\t\t}]`)\n\t})\n\n\tctx := t.Context()\n\tpackages, _, err := client.Users.ListUserPackageVersions(ctx, \"u\", \"container\", \"hello_docker\")\n\tif err != nil {\n\t\tt.Errorf(\"Users.ListUserPackageVersions returned error: %v\", err)\n\t}\n\n\twant := []*PackageVersion{{\n\t\tID:             Ptr(int64(45763)),\n\t\tName:           Ptr(\"sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9\"),\n\t\tURL:            Ptr(\"https://api.github.com/users/octocat/packages/container/hello_docker/versions/45763\"),\n\t\tPackageHTMLURL: Ptr(\"https://github.com/users/octocat/packages/container/package/hello_docker\"),\n\t\tCreatedAt:      &Timestamp{referenceTime},\n\t\tUpdatedAt:      &Timestamp{referenceTime},\n\t\tHTMLURL:        Ptr(\"https://github.com/users/octocat/packages/container/hello_docker/45763\"),\n\t\tMetadata:       json.RawMessage(m),\n\t}}\n\tif !cmp.Equal(packages, want) {\n\t\tt.Errorf(\"Users.ListUserPackageVersions returned %+v, want %+v\", packages, want)\n\t}\n\n\tconst methodName = \"ListUserPackageVersions\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Users.ListUserPackageVersions(ctx, \"\\n\", \"\\n\", \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.ListUserPackageVersions(ctx, \"\", \"\", \"\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_Authenticated_PackageGetVersion(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tm := `{\n\t\t\"package_type\": \"container\",\n\t\t\"container\": {\n\t\t\"tags\": [\n\t\t\t\"latest\"\n\t\t]\n\t\t}\n\t}`\n\n\tmux.HandleFunc(\"/user/packages/container/hello_docker/versions/45763\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `\n\t\t\t{\n\t\t\t  \"id\": 45763,\n\t\t\t  \"name\": \"sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9\",\n\t\t\t  \"url\": \"https://api.github.com/users/octocat/packages/container/hello_docker/versions/45763\",\n\t\t\t  \"package_html_url\": \"https://github.com/users/octocat/packages/container/package/hello_docker\",\n\t\t\t  \"created_at\": `+referenceTimeStr+`,\n\t\t\t  \"updated_at\": `+referenceTimeStr+`,\n\t\t\t  \"html_url\": \"https://github.com/users/octocat/packages/container/hello_docker/45763\",\n\t\t\t  \"metadata\": `+m+`\n\t\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tpackages, _, err := client.Users.PackageGetVersion(ctx, \"\", \"container\", \"hello_docker\", 45763)\n\tif err != nil {\n\t\tt.Errorf(\"Users.PackageGetVersion returned error: %v\", err)\n\t}\n\n\twant := &PackageVersion{\n\t\tID:             Ptr(int64(45763)),\n\t\tName:           Ptr(\"sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9\"),\n\t\tURL:            Ptr(\"https://api.github.com/users/octocat/packages/container/hello_docker/versions/45763\"),\n\t\tPackageHTMLURL: Ptr(\"https://github.com/users/octocat/packages/container/package/hello_docker\"),\n\t\tCreatedAt:      &Timestamp{referenceTime},\n\t\tUpdatedAt:      &Timestamp{referenceTime},\n\t\tHTMLURL:        Ptr(\"https://github.com/users/octocat/packages/container/hello_docker/45763\"),\n\t\tMetadata:       json.RawMessage(m),\n\t}\n\tif !cmp.Equal(packages, want) {\n\t\tt.Errorf(\"Users.Authenticated_PackageGetVersion returned %+v, want %+v\", packages, want)\n\t}\n\n\tconst methodName = \"PackageGetVersion\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Users.PackageGetVersion(ctx, \"\\n\", \"\", \"\", 0)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.PackageGetVersion(ctx, \"\", \"\", \"\", 45763)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_specifiedUser_PackageGetVersion(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tm := `{\n\t\t\"package_type\": \"container\",\n\t\t\"container\": {\n\t\t\t\"tags\": [\n\t\t\t\"latest\"\n\t\t\t]\n\t\t}\n\t}`\n\n\tmux.HandleFunc(\"/users/u/packages/container/hello_docker/versions/45763\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `\n\t\t\t{\n\t\t\t  \"id\": 45763,\n\t\t\t  \"name\": \"sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9\",\n\t\t\t  \"url\": \"https://api.github.com/users/octocat/packages/container/hello_docker/versions/45763\",\n\t\t\t  \"package_html_url\": \"https://github.com/users/octocat/packages/container/package/hello_docker\",\n\t\t\t  \"created_at\": `+referenceTimeStr+`,\n\t\t\t  \"updated_at\": `+referenceTimeStr+`,\n\t\t\t  \"html_url\": \"https://github.com/users/octocat/packages/container/hello_docker/45763\",\n\t\t\t  \"metadata\": `+m+`\n\t\t\t}`)\n\t})\n\n\tctx := t.Context()\n\tpackages, _, err := client.Users.PackageGetVersion(ctx, \"u\", \"container\", \"hello_docker\", 45763)\n\tif err != nil {\n\t\tt.Errorf(\"Users.specifiedUser_PackageGetVersion returned error: %v\", err)\n\t}\n\n\twant := &PackageVersion{\n\t\tID:             Ptr(int64(45763)),\n\t\tName:           Ptr(\"sha256:08a44bab0bddaddd8837a8b381aebc2e4b933768b981685a9e088360af0d3dd9\"),\n\t\tURL:            Ptr(\"https://api.github.com/users/octocat/packages/container/hello_docker/versions/45763\"),\n\t\tPackageHTMLURL: Ptr(\"https://github.com/users/octocat/packages/container/package/hello_docker\"),\n\t\tCreatedAt:      &Timestamp{referenceTime},\n\t\tUpdatedAt:      &Timestamp{referenceTime},\n\t\tHTMLURL:        Ptr(\"https://github.com/users/octocat/packages/container/hello_docker/45763\"),\n\t\tMetadata:       json.RawMessage(m),\n\t}\n\tif !cmp.Equal(packages, want) {\n\t\tt.Errorf(\"Users.specifiedUser_PackageGetVersion returned %+v, want %+v\", packages, want)\n\t}\n\n\tconst methodName = \"PackageGetVersion\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Users.PackageGetVersion(ctx, \"\\n\", \"\", \"\", 0)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.PackageGetVersion(ctx, \"\", \"\", \"\", 45763)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_Authenticated_PackageDeleteVersion(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/packages/container/hello_docker/versions/45763\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Users.PackageDeleteVersion(ctx, \"\", \"container\", \"hello_docker\", 45763)\n\tif err != nil {\n\t\tt.Errorf(\"Users.Authenticated_PackageDeleteVersion returned error: %v\", err)\n\t}\n\n\tconst methodName = \"PackageDeleteVersion\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Users.PackageDeleteVersion(ctx, \"\\n\", \"\", \"\", 0)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Users.PackageDeleteVersion(ctx, \"\", \"\", \"\", 45763)\n\t})\n}\n\nfunc TestUsersService_specifiedUser_PackageDeleteVersion(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/packages/container/hello_docker/versions/45763\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Users.PackageDeleteVersion(ctx, \"u\", \"container\", \"hello_docker\", 45763)\n\tif err != nil {\n\t\tt.Errorf(\"Users.specifiedUser_PackageDeleteVersion returned error: %v\", err)\n\t}\n\n\tconst methodName = \"PackageDeleteVersion\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Users.PackageDeleteVersion(ctx, \"\\n\", \"\", \"\", 0)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Users.PackageDeleteVersion(ctx, \"\", \"\", \"\", 45763)\n\t})\n}\n\nfunc TestUsersService_Authenticated_PackageRestoreVersion(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/packages/container/hello_docker/versions/45763/restore\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Users.PackageRestoreVersion(ctx, \"\", \"container\", \"hello_docker\", 45763)\n\tif err != nil {\n\t\tt.Errorf(\"Users.Authenticated_PackageRestoreVersion returned error: %v\", err)\n\t}\n\n\tconst methodName = \"PackageRestoreVersion\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Users.PackageRestoreVersion(ctx, \"\\n\", \"\", \"\", 0)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Users.PackageRestoreVersion(ctx, \"\", \"\", \"\", 45763)\n\t})\n}\n\nfunc TestUsersService_specifiedUser_PackageRestoreVersion(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/packages/container/hello_docker/versions/45763/restore\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Users.PackageRestoreVersion(ctx, \"u\", \"container\", \"hello_docker\", 45763)\n\tif err != nil {\n\t\tt.Errorf(\"Users.specifiedUser_PackageRestoreVersion returned error: %v\", err)\n\t}\n\n\tconst methodName = \"PackageRestoreVersion\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Users.PackageRestoreVersion(ctx, \"\\n\", \"\", \"\", 0)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Users.PackageRestoreVersion(ctx, \"\", \"\", \"\", 45763)\n\t})\n}\n"
  },
  {
    "path": "github/users_social_accounts.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// SocialAccount represents a social account linked to a user.\ntype SocialAccount struct {\n\tProvider *string `json:\"provider,omitempty\"`\n\tURL      *string `json:\"url,omitempty\"`\n}\n\n// socialAccountsRequest represents the request body for adding or deleting social accounts.\ntype socialAccountsRequest struct {\n\tAccountURLs []string `json:\"account_urls\"`\n}\n\n// ListSocialAccounts lists all social accounts for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-the-authenticated-user\n//\n//meta:operation GET /user/social_accounts\nfunc (s *UsersService) ListSocialAccounts(ctx context.Context, opts *ListOptions) ([]*SocialAccount, *Response, error) {\n\tu := \"user/social_accounts\"\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar socialAccounts []*SocialAccount\n\tresp, err := s.client.Do(ctx, req, &socialAccounts)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn socialAccounts, resp, nil\n}\n\n// AddSocialAccounts adds social accounts for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/users/social-accounts#add-social-accounts-for-the-authenticated-user\n//\n//meta:operation POST /user/social_accounts\nfunc (s *UsersService) AddSocialAccounts(ctx context.Context, accountURLs []string) ([]*SocialAccount, *Response, error) {\n\tu := \"user/social_accounts\"\n\treq, err := s.client.NewRequest(\"POST\", u, &socialAccountsRequest{AccountURLs: accountURLs})\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar accounts []*SocialAccount\n\tresp, err := s.client.Do(ctx, req, &accounts)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn accounts, resp, nil\n}\n\n// DeleteSocialAccounts deletes social accounts for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/users/social-accounts#delete-social-accounts-for-the-authenticated-user\n//\n//meta:operation DELETE /user/social_accounts\nfunc (s *UsersService) DeleteSocialAccounts(ctx context.Context, accountURLs []string) (*Response, error) {\n\tu := \"user/social_accounts\"\n\treq, err := s.client.NewRequest(\"DELETE\", u, &socialAccountsRequest{AccountURLs: accountURLs})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n\n// ListUserSocialAccounts lists all social accounts for a user.\n//\n// GitHub API docs: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-a-user\n//\n//meta:operation GET /users/{username}/social_accounts\nfunc (s *UsersService) ListUserSocialAccounts(ctx context.Context, username string, opts *ListOptions) ([]*SocialAccount, *Response, error) {\n\tu := fmt.Sprintf(\"users/%v/social_accounts\", username)\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar addedAccounts []*SocialAccount\n\tresp, err := s.client.Do(ctx, req, &addedAccounts)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn addedAccounts, resp, nil\n}\n"
  },
  {
    "path": "github/users_social_accounts_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestUsersService_ListSocialAccounts(t *testing.T) {\n\tt.Parallel()\n\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/social_accounts\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"provider\": \"example\",\n\t\t\t\"url\": \"https://example.com\"\n\t\t}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\taccounts, _, err := client.Users.ListSocialAccounts(ctx, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Users.ListSocialAccounts returned error: %v\", err)\n\t}\n\n\twant := []*SocialAccount{{Provider: Ptr(\"example\"), URL: Ptr(\"https://example.com\")}}\n\tif !cmp.Equal(accounts, want) {\n\t\tt.Errorf(\"Users.ListSocialAccounts returned %#v, want %#v\", accounts, want)\n\t}\n\n\tconst methodName = \"ListSocialAccounts\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.ListSocialAccounts(ctx, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_AddSocialAccounts(t *testing.T) {\n\tt.Parallel()\n\n\tclient, mux, _ := setup(t)\n\n\tinput := []string{\"https://example.com\"}\n\n\tmux.HandleFunc(\"/user/social_accounts\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"POST\")\n\t\ttestBody(t, r, `{\"account_urls\":[\"https://example.com\"]}`+\"\\n\")\n\t\tfmt.Fprint(w, `[{\"provider\":\"example\",\"url\":\"https://example.com\"}]`)\n\t})\n\n\tctx := t.Context()\n\taccounts, _, err := client.Users.AddSocialAccounts(ctx, input)\n\tif err != nil {\n\t\tt.Errorf(\"Users.AddSocialAccounts returned error: %v\", err)\n\t}\n\n\twant := []*SocialAccount{\n\t\t{Provider: Ptr(\"example\"), URL: Ptr(\"https://example.com\")},\n\t}\n\tif !cmp.Equal(accounts, want) {\n\t\tt.Errorf(\"Users.AddSocialAccounts returned %#v, want %#v\", accounts, want)\n\t}\n\n\tconst methodName = \"AddSocialAccounts\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.AddSocialAccounts(ctx, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_DeleteSocialAccounts(t *testing.T) {\n\tt.Parallel()\n\n\tclient, mux, _ := setup(t)\n\n\tinput := []string{\"https://example.com\"}\n\n\tmux.HandleFunc(\"/user/social_accounts\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\ttestBody(t, r, `{\"account_urls\":[\"https://example.com\"]}`+\"\\n\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Users.DeleteSocialAccounts(ctx, input)\n\tif err != nil {\n\t\tt.Errorf(\"Users.DeleteSocialAccounts returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteSocialAccounts\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Users.DeleteSocialAccounts(ctx, input)\n\t})\n}\n\nfunc TestUsersService_ListUserSocialAccounts(t *testing.T) {\n\tt.Parallel()\n\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/social_accounts\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\n\t\t\t\"provider\": \"example\",\n\t\t\t\"url\": \"https://example.com\"\n\t\t}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\taccounts, _, err := client.Users.ListUserSocialAccounts(ctx, \"u\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Users.ListUserSocialAccounts returned error: %v\", err)\n\t}\n\n\twant := []*SocialAccount{{Provider: Ptr(\"example\"), URL: Ptr(\"https://example.com\")}}\n\tif !cmp.Equal(accounts, want) {\n\t\tt.Errorf(\"Users.ListUserSocialAccounts returned %#v, want %#v\", accounts, want)\n\t}\n\n\tconst methodName = \"ListUserSocialAccounts\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.ListUserSocialAccounts(ctx, \"u\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n"
  },
  {
    "path": "github/users_ssh_signing_keys.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"fmt\"\n)\n\n// SSHSigningKey represents a public SSH key used to sign git commits.\ntype SSHSigningKey struct {\n\tID        *int64     `json:\"id,omitempty\"`\n\tKey       *string    `json:\"key,omitempty\"`\n\tTitle     *string    `json:\"title,omitempty\"`\n\tCreatedAt *Timestamp `json:\"created_at,omitempty\"`\n}\n\nfunc (k SSHSigningKey) String() string {\n\treturn Stringify(k)\n}\n\n// ListSSHSigningKeys lists the SSH signing keys for a user. Passing an empty\n// username string will fetch SSH signing keys for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-a-user\n//\n// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-the-authenticated-user\n//\n//meta:operation GET /user/ssh_signing_keys\n//meta:operation GET /users/{username}/ssh_signing_keys\nfunc (s *UsersService) ListSSHSigningKeys(ctx context.Context, user string, opts *ListOptions) ([]*SSHSigningKey, *Response, error) {\n\tvar u string\n\tif user != \"\" {\n\t\tu = fmt.Sprintf(\"users/%v/ssh_signing_keys\", user)\n\t} else {\n\t\tu = \"user/ssh_signing_keys\"\n\t}\n\tu, err := addOptions(u, opts)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar keys []*SSHSigningKey\n\tresp, err := s.client.Do(ctx, req, &keys)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn keys, resp, nil\n}\n\n// GetSSHSigningKey fetches a single SSH signing key for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#get-an-ssh-signing-key-for-the-authenticated-user\n//\n//meta:operation GET /user/ssh_signing_keys/{ssh_signing_key_id}\nfunc (s *UsersService) GetSSHSigningKey(ctx context.Context, id int64) (*SSHSigningKey, *Response, error) {\n\tu := fmt.Sprintf(\"user/ssh_signing_keys/%v\", id)\n\n\treq, err := s.client.NewRequest(\"GET\", u, nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar key *SSHSigningKey\n\tresp, err := s.client.Do(ctx, req, &key)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn key, resp, nil\n}\n\n// CreateSSHSigningKey adds a SSH signing key for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#create-a-ssh-signing-key-for-the-authenticated-user\n//\n//meta:operation POST /user/ssh_signing_keys\nfunc (s *UsersService) CreateSSHSigningKey(ctx context.Context, key *Key) (*SSHSigningKey, *Response, error) {\n\tu := \"user/ssh_signing_keys\"\n\n\treq, err := s.client.NewRequest(\"POST\", u, key)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar k *SSHSigningKey\n\tresp, err := s.client.Do(ctx, req, &k)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn k, resp, nil\n}\n\n// DeleteSSHSigningKey deletes a SSH signing key for the authenticated user.\n//\n// GitHub API docs: https://docs.github.com/rest/users/ssh-signing-keys#delete-an-ssh-signing-key-for-the-authenticated-user\n//\n//meta:operation DELETE /user/ssh_signing_keys/{ssh_signing_key_id}\nfunc (s *UsersService) DeleteSSHSigningKey(ctx context.Context, id int64) (*Response, error) {\n\tu := fmt.Sprintf(\"user/ssh_signing_keys/%v\", id)\n\n\treq, err := s.client.NewRequest(\"DELETE\", u, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn s.client.Do(ctx, req, nil)\n}\n"
  },
  {
    "path": "github/users_ssh_signing_keys_test.go",
    "content": "// Copyright 2022 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestUsersService_ListSSHSigningKeys_authenticatedUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/ssh_signing_keys\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"page\": \"2\"})\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\topt := &ListOptions{Page: 2}\n\tctx := t.Context()\n\tkeys, _, err := client.Users.ListSSHSigningKeys(ctx, \"\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Users.ListSSHSigningKeys returned error: %v\", err)\n\t}\n\n\twant := []*SSHSigningKey{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(keys, want) {\n\t\tt.Errorf(\"Users.ListSSHSigningKeys returned %+v, want %+v\", keys, want)\n\t}\n\n\tconst methodName = \"ListSSHSigningKeys\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Users.ListSSHSigningKeys(ctx, \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.ListSSHSigningKeys(ctx, \"\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_ListSSHSigningKeys_specifiedUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/ssh_signing_keys\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"id\":1}]`)\n\t})\n\n\tctx := t.Context()\n\tkeys, _, err := client.Users.ListSSHSigningKeys(ctx, \"u\", nil)\n\tif err != nil {\n\t\tt.Errorf(\"Users.ListSSHSigningKeys returned error: %v\", err)\n\t}\n\n\twant := []*SSHSigningKey{{ID: Ptr(int64(1))}}\n\tif !cmp.Equal(keys, want) {\n\t\tt.Errorf(\"Users.ListSSHSigningKeys returned %+v, want %+v\", keys, want)\n\t}\n}\n\nfunc TestUsersService_ListSSHSigningKeys_invalidUser(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Users.ListSSHSigningKeys(ctx, \"%\", nil)\n\ttestURLParseError(t, err)\n}\n\nfunc TestUsersService_GetSSHSigningKey(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/ssh_signing_keys/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tkey, _, err := client.Users.GetSSHSigningKey(ctx, 1)\n\tif err != nil {\n\t\tt.Errorf(\"Users.GetSSHSigningKey returned error: %v\", err)\n\t}\n\n\twant := &SSHSigningKey{ID: Ptr(int64(1))}\n\tif !cmp.Equal(key, want) {\n\t\tt.Errorf(\"Users.GetSSHSigningKey returned %+v, want %+v\", key, want)\n\t}\n\n\tconst methodName = \"GetSSHSigningKey\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Users.GetSSHSigningKey(ctx, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.GetSSHSigningKey(ctx, 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_CreateSSHSigningKey(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &Key{Key: Ptr(\"k\"), Title: Ptr(\"t\")}\n\n\tmux.HandleFunc(\"/user/ssh_signing_keys\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *Key\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"POST\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tkey, _, err := client.Users.CreateSSHSigningKey(ctx, input)\n\tif err != nil {\n\t\tt.Errorf(\"Users.CreateSSHSigningKey returned error: %v\", err)\n\t}\n\n\twant := &SSHSigningKey{ID: Ptr(int64(1))}\n\tif !cmp.Equal(key, want) {\n\t\tt.Errorf(\"Users.CreateSSHSigningKey returned %+v, want %+v\", key, want)\n\t}\n\n\tconst methodName = \"CreateKey\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.CreateKey(ctx, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_DeleteSSHSigningKey(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/ssh_signing_keys/1\", func(_ http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t})\n\n\tctx := t.Context()\n\t_, err := client.Users.DeleteSSHSigningKey(ctx, 1)\n\tif err != nil {\n\t\tt.Errorf(\"Users.DeleteSSHSigningKey returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeleteSSHSigningKey\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Users.DeleteSSHSigningKey(ctx, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Users.DeleteSSHSigningKey(ctx, 1)\n\t})\n}\n\nfunc TestSSHSigningKey_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &SSHSigningKey{}, \"{}\")\n\n\tu := &Key{\n\t\tID:        Ptr(int64(1)),\n\t\tKey:       Ptr(\"abc\"),\n\t\tTitle:     Ptr(\"title\"),\n\t\tCreatedAt: &Timestamp{referenceTime},\n\t}\n\n\twant := `{\n\t\t\"id\": 1,\n\t\t\"key\": \"abc\",\n\t\t\"title\": \"title\",\n\t\t\"created_at\": ` + referenceTimeStr + `\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n"
  },
  {
    "path": "github/users_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage github\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n)\n\nfunc TestUser_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &User{}, \"{}\")\n\n\tu := &User{\n\t\tLogin:           Ptr(\"l\"),\n\t\tID:              Ptr(int64(1)),\n\t\tURL:             Ptr(\"u\"),\n\t\tAvatarURL:       Ptr(\"a\"),\n\t\tGravatarID:      Ptr(\"g\"),\n\t\tName:            Ptr(\"n\"),\n\t\tCompany:         Ptr(\"c\"),\n\t\tBlog:            Ptr(\"b\"),\n\t\tLocation:        Ptr(\"l\"),\n\t\tEmail:           Ptr(\"e\"),\n\t\tHireable:        Ptr(true),\n\t\tBio:             Ptr(\"b\"),\n\t\tTwitterUsername: Ptr(\"t\"),\n\t\tPublicRepos:     Ptr(1),\n\t\tFollowers:       Ptr(1),\n\t\tFollowing:       Ptr(1),\n\t\tCreatedAt:       &Timestamp{referenceTime},\n\t\tSuspendedAt:     &Timestamp{referenceTime},\n\t}\n\twant := `{\n\t\t\"login\": \"l\",\n\t\t\"id\": 1,\n\t\t\"avatar_url\": \"a\",\n\t\t\"gravatar_id\": \"g\",\n\t\t\"name\": \"n\",\n\t\t\"company\": \"c\",\n\t\t\"blog\": \"b\",\n\t\t\"location\": \"l\",\n\t\t\"email\": \"e\",\n\t\t\"hireable\": true,\n\t\t\"bio\": \"b\",\n\t\t\"twitter_username\": \"t\",\n\t\t\"public_repos\": 1,\n\t\t\"followers\": 1,\n\t\t\"following\": 1,\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\"url\": \"u\"\n\t}`\n\ttestJSONMarshal(t, u, want)\n\n\tu2 := &User{\n\t\tLogin:                   Ptr(\"testLogin\"),\n\t\tID:                      Ptr(int64(1)),\n\t\tNodeID:                  Ptr(\"testNode123\"),\n\t\tAvatarURL:               Ptr(\"https://www.example.com\"),\n\t\tHTMLURL:                 Ptr(\"https://www.example.com\"),\n\t\tGravatarID:              Ptr(\"testGravatar123\"),\n\t\tName:                    Ptr(\"myName\"),\n\t\tCompany:                 Ptr(\"testCompany\"),\n\t\tBlog:                    Ptr(\"test Blog\"),\n\t\tLocation:                Ptr(\"test location\"),\n\t\tEmail:                   Ptr(\"test@example.com\"),\n\t\tHireable:                Ptr(true),\n\t\tBio:                     Ptr(\"my good bio\"),\n\t\tTwitterUsername:         Ptr(\"https://www.example.com/test\"),\n\t\tPublicRepos:             Ptr(1),\n\t\tPublicGists:             Ptr(2),\n\t\tFollowers:               Ptr(100),\n\t\tFollowing:               Ptr(29),\n\t\tCreatedAt:               &Timestamp{referenceTime},\n\t\tUpdatedAt:               &Timestamp{referenceTime},\n\t\tSuspendedAt:             &Timestamp{referenceTime},\n\t\tType:                    Ptr(\"test type\"),\n\t\tSiteAdmin:               Ptr(false),\n\t\tTotalPrivateRepos:       Ptr(int64(2)),\n\t\tOwnedPrivateRepos:       Ptr(int64(1)),\n\t\tPrivateGists:            Ptr(1),\n\t\tDiskUsage:               Ptr(1),\n\t\tCollaborators:           Ptr(1),\n\t\tTwoFactorAuthentication: Ptr(false),\n\t\tPlan: &Plan{\n\t\t\tName:          Ptr(\"silver\"),\n\t\t\tSpace:         Ptr(1024),\n\t\t\tCollaborators: Ptr(10),\n\t\t\tPrivateRepos:  Ptr(int64(4)),\n\t\t\tFilledSeats:   Ptr(24),\n\t\t\tSeats:         Ptr(1),\n\t\t},\n\t\tLdapDn: Ptr(\"test ldap\"),\n\t}\n\n\twant2 := `{\n\t\t\"login\": \"testLogin\",\n\t\t\"id\": 1,\n\t\t\"node_id\":\"testNode123\",\n\t\t\"avatar_url\": \"https://www.example.com\",\n\t\t\"html_url\":\"https://www.example.com\",\n\t\t\"gravatar_id\": \"testGravatar123\",\n\t\t\"name\": \"myName\",\n\t\t\"company\": \"testCompany\",\n\t\t\"blog\": \"test Blog\",\n\t\t\"location\": \"test location\",\n\t\t\"email\": \"test@example.com\",\n\t\t\"hireable\": true,\n\t\t\"bio\": \"my good bio\",\n\t\t\"twitter_username\": \"https://www.example.com/test\",\n\t\t\"public_repos\": 1,\n\t\t\"public_gists\":2,\n\t\t\"followers\": 100,\n\t\t\"following\": 29,\n\t\t\"created_at\": ` + referenceTimeStr + `,\n\t\t\"suspended_at\": ` + referenceTimeStr + `,\n\t\t\"updated_at\": ` + referenceTimeStr + `,\n\t\t\"type\": \"test type\",\n\t\t\"site_admin\": false,\n\t\t\"total_private_repos\": 2,\n\t\t\"owned_private_repos\": 1,\n\t\t\"private_gists\": 1,\n\t\t\"disk_usage\": 1,\n\t\t\"collaborators\": 1,\n\t\t\"two_factor_authentication\": false,\n\t\t\"plan\": {\n\t\t\t\"name\": \"silver\",\n\t\t\t\"space\": 1024,\n\t\t\t\"collaborators\": 10,\n\t\t\t\"private_repos\": 4,\n\t\t\t\"filled_seats\": 24,\n\t\t\t\"seats\": 1\n\t\t},\n\t\t\"ldap_dn\": \"test ldap\"\n\t}`\n\ttestJSONMarshal(t, u2, want2)\n}\n\nfunc TestUsersService_Get_authenticatedUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tuser, _, err := client.Users.Get(ctx, \"\")\n\tif err != nil {\n\t\tt.Errorf(\"Users.Get returned error: %v\", err)\n\t}\n\n\twant := &User{ID: Ptr(int64(1))}\n\tif !cmp.Equal(user, want) {\n\t\tt.Errorf(\"Users.Get returned %+v, want %+v\", user, want)\n\t}\n\n\tconst methodName = \"Get\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Users.Get(ctx, \"\\n\")\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.Get(ctx, \"\")\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_Get_specifiedUser(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tuser, _, err := client.Users.Get(ctx, \"u\")\n\tif err != nil {\n\t\tt.Errorf(\"Users.Get returned error: %v\", err)\n\t}\n\n\twant := &User{ID: Ptr(int64(1))}\n\tif !cmp.Equal(user, want) {\n\t\tt.Errorf(\"Users.Get returned %+v, want %+v\", user, want)\n\t}\n}\n\nfunc TestUsersService_Get_invalidUser(t *testing.T) {\n\tt.Parallel()\n\tclient, _, _ := setup(t)\n\n\tctx := t.Context()\n\t_, _, err := client.Users.Get(ctx, \"%\")\n\ttestURLParseError(t, err)\n}\n\nfunc TestUsersService_GetByID(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tuser, _, err := client.Users.GetByID(ctx, 1)\n\tif err != nil {\n\t\tt.Fatalf(\"Users.GetByID returned error: %v\", err)\n\t}\n\n\twant := &User{ID: Ptr(int64(1))}\n\tif !cmp.Equal(user, want) {\n\t\tt.Errorf(\"Users.GetByID returned %+v, want %+v\", user, want)\n\t}\n\n\tconst methodName = \"GetByID\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Users.GetByID(ctx, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.GetByID(ctx, 1)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_Edit(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tinput := &User{Name: Ptr(\"n\")}\n\n\tmux.HandleFunc(\"/user\", func(w http.ResponseWriter, r *http.Request) {\n\t\tvar v *User\n\t\tassertNilError(t, json.NewDecoder(r.Body).Decode(&v))\n\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tif !cmp.Equal(v, input) {\n\t\t\tt.Errorf(\"Request body = %+v, want %+v\", v, input)\n\t\t}\n\n\t\tfmt.Fprint(w, `{\"id\":1}`)\n\t})\n\n\tctx := t.Context()\n\tuser, _, err := client.Users.Edit(ctx, input)\n\tif err != nil {\n\t\tt.Errorf(\"Users.Edit returned error: %v\", err)\n\t}\n\n\twant := &User{ID: Ptr(int64(1))}\n\tif !cmp.Equal(user, want) {\n\t\tt.Errorf(\"Users.Edit returned %+v, want %+v\", user, want)\n\t}\n\n\tconst methodName = \"Edit\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.Edit(ctx, input)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_GetHovercard(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users/u/hovercard\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"subject_type\": \"repository\", \"subject_id\": \"20180408\"})\n\t\tfmt.Fprint(w, `{\"contexts\": [{\"message\":\"Owns this repository\", \"octicon\": \"repo\"}]}`)\n\t})\n\n\topt := &HovercardOptions{SubjectType: \"repository\", SubjectID: \"20180408\"}\n\tctx := t.Context()\n\thovercard, _, err := client.Users.GetHovercard(ctx, \"u\", opt)\n\tif err != nil {\n\t\tt.Errorf(\"Users.GetHovercard returned error: %v\", err)\n\t}\n\n\twant := &Hovercard{Contexts: []*UserContext{{Message: Ptr(\"Owns this repository\"), Octicon: Ptr(\"repo\")}}}\n\tif !cmp.Equal(hovercard, want) {\n\t\tt.Errorf(\"Users.GetHovercard returned %+v, want %+v\", hovercard, want)\n\t}\n\n\tconst methodName = \"GetHovercard\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, _, err = client.Users.GetHovercard(ctx, \"\\n\", opt)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.GetHovercard(ctx, \"u\", opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_ListAll(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/users\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\"since\": \"1\", \"per_page\": \"30\"})\n\t\tfmt.Fprint(w, `[{\"id\":2}]`)\n\t})\n\n\topt := &UserListOptions{Since: 1, PerPage: 30}\n\tctx := t.Context()\n\tusers, _, err := client.Users.ListAll(ctx, opt)\n\tif err != nil {\n\t\tt.Errorf(\"Users.Get returned error: %v\", err)\n\t}\n\n\twant := []*User{{ID: Ptr(int64(2))}}\n\tif !cmp.Equal(users, want) {\n\t\tt.Errorf(\"Users.ListAll returned %+v, want %+v\", users, want)\n\t}\n\n\tconst methodName = \"ListAll\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.ListAll(ctx, opt)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_ListInvitations(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/repository_invitations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\tfmt.Fprint(w, `[{\"id\":1}, {\"id\":2}]`)\n\t})\n\n\tctx := t.Context()\n\tgot, _, err := client.Users.ListInvitations(ctx, nil)\n\tif err != nil {\n\t\tt.Errorf(\"Users.ListInvitations returned error: %v\", err)\n\t}\n\n\twant := []*RepositoryInvitation{{ID: Ptr(int64(1))}, {ID: Ptr(int64(2))}}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"Users.ListInvitations = %+v, want %+v\", got, want)\n\t}\n\n\tconst methodName = \"ListInvitations\"\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\tgot, resp, err := client.Users.ListInvitations(ctx, nil)\n\t\tif got != nil {\n\t\t\tt.Errorf(\"testNewRequestAndDoFailure %v = %#v, want nil\", methodName, got)\n\t\t}\n\t\treturn resp, err\n\t})\n}\n\nfunc TestUsersService_ListInvitations_withOptions(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/repository_invitations\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"GET\")\n\t\ttestFormValues(t, r, values{\n\t\t\t\"page\": \"2\",\n\t\t})\n\t\tfmt.Fprint(w, `[{\"id\":1}, {\"id\":2}]`)\n\t})\n\n\tctx := t.Context()\n\t_, _, err := client.Users.ListInvitations(ctx, &ListOptions{Page: 2})\n\tif err != nil {\n\t\tt.Errorf(\"Users.ListInvitations returned error: %v\", err)\n\t}\n}\n\nfunc TestUsersService_AcceptInvitation(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/repository_invitations/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"PATCH\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Users.AcceptInvitation(ctx, 1); err != nil {\n\t\tt.Errorf(\"Users.AcceptInvitation returned error: %v\", err)\n\t}\n\n\tconst methodName = \"AcceptInvitation\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Users.AcceptInvitation(ctx, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Users.AcceptInvitation(ctx, 1)\n\t})\n}\n\nfunc TestUsersService_DeclineInvitation(t *testing.T) {\n\tt.Parallel()\n\tclient, mux, _ := setup(t)\n\n\tmux.HandleFunc(\"/user/repository_invitations/1\", func(w http.ResponseWriter, r *http.Request) {\n\t\ttestMethod(t, r, \"DELETE\")\n\t\tw.WriteHeader(http.StatusNoContent)\n\t})\n\n\tctx := t.Context()\n\tif _, err := client.Users.DeclineInvitation(ctx, 1); err != nil {\n\t\tt.Errorf(\"Users.DeclineInvitation returned error: %v\", err)\n\t}\n\n\tconst methodName = \"DeclineInvitation\"\n\ttestBadOptions(t, methodName, func() (err error) {\n\t\t_, err = client.Users.DeclineInvitation(ctx, -1)\n\t\treturn err\n\t})\n\n\ttestNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {\n\t\treturn client.Users.DeclineInvitation(ctx, 1)\n\t})\n}\n\nfunc TestUserContext_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &UserContext{}, \"{}\")\n\n\tu := &UserContext{\n\t\tMessage: Ptr(\"message\"),\n\t\tOcticon: Ptr(\"message\"),\n\t}\n\n\twant := `{\n\t\t\"message\" : \"message\",\n\t\t\"octicon\" : \"message\"\n\t}`\n\n\ttestJSONMarshal(t, u, want)\n}\n\nfunc TestHovercard_Marshal(t *testing.T) {\n\tt.Parallel()\n\ttestJSONMarshal(t, &Hovercard{}, \"{}\")\n\n\th := &Hovercard{\n\t\tContexts: []*UserContext{\n\t\t\t{\n\t\t\t\tMessage: Ptr(\"someMessage\"),\n\t\t\t\tOcticon: Ptr(\"someOcticon\"),\n\t\t\t},\n\t\t},\n\t}\n\n\twant := `{\n\t\t\"contexts\" : [\n\t\t\t{\n\t\t\t\t\"message\" : \"someMessage\",\n\t\t\t\t\"octicon\" : \"someOcticon\"\n\t\t\t}\n\t\t]\n\t}`\n\n\ttestJSONMarshal(t, h, want)\n}\n"
  },
  {
    "path": "github/with_appengine.go",
    "content": "// Copyright 2017 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n//go:build appengine\n\n// This file provides glue for making github work on App Engine.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"net/http\"\n)\n\nfunc withContext(ctx context.Context, req *http.Request) *http.Request {\n\t// No-op because App Engine adds context to a request differently.\n\treturn req\n}\n"
  },
  {
    "path": "github/without_appengine.go",
    "content": "// Copyright 2017 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n//go:build !appengine\n\n// This file provides glue for making github work without App Engine.\n\npackage github\n\nimport (\n\t\"context\"\n\t\"net/http\"\n)\n\nfunc withContext(ctx context.Context, req *http.Request) *http.Request {\n\treturn req.WithContext(ctx)\n}\n"
  },
  {
    "path": "go.mod",
    "content": "module github.com/google/go-github/v84\n\ngo 1.25.0\n\nrequire (\n\tgithub.com/google/go-cmp v0.7.0\n\tgithub.com/google/go-querystring v1.2.0\n)\n"
  },
  {
    "path": "go.sum",
    "content": "github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/go-querystring v1.2.0 h1:yhqkPbu2/OH+V9BfpCVPZkNmUXhb2gBxJArfhIxNtP0=\ngithub.com/google/go-querystring v1.2.0/go.mod h1:8IFJqpSRITyJ8QhQ13bmbeMBDfmeEJZD5A0egEOmkqU=\n"
  },
  {
    "path": "openapi_operations.yaml",
    "content": "operations:\n  - name: POST /hub\n    documentation_url: https://docs.github.com/webhooks/about-webhooks-for-repositories#pubsubhubbub\n  - name: GET /organizations/{organization_id}\n  - name: GET /repos/{owner}/{repo}/import/issues\n    documentation_url: https://gist.github.com/jonmagic/5282384165e0f86ef105#check-status-of-multiple-issues\n  - name: POST /repos/{owner}/{repo}/import/issues\n    documentation_url: https://gist.github.com/jonmagic/5282384165e0f86ef105#start-an-issue-import\n  - name: GET /repos/{owner}/{repo}/import/issues/{issue_number}\n    documentation_url: https://gist.github.com/jonmagic/5282384165e0f86ef105#import-status-request\n  - name: GET /repositories/{repository_id}\n  - name: GET /repositories/{repository_id}/installation\noperation_overrides:\n  - name: GET /meta\n    documentation_url: https://docs.github.com/rest/meta/meta#get-github-meta-information\n  - name: DELETE /repos/{owner}/{repo}/pages\n    documentation_url: https://docs.github.com/rest/pages/pages#delete-a-github-pages-site\n  - name: GET /repos/{owner}/{repo}/pages\n    documentation_url: https://docs.github.com/rest/pages/pages#get-a-github-pages-site\n  - name: POST /repos/{owner}/{repo}/pages\n    documentation_url: https://docs.github.com/rest/pages/pages#create-a-github-pages-site\n  - name: PUT /repos/{owner}/{repo}/pages\n    documentation_url: https://docs.github.com/rest/pages/pages#update-information-about-a-github-pages-site\n  - name: GET /repos/{owner}/{repo}/pages/builds\n    documentation_url: https://docs.github.com/rest/pages/pages#list-github-pages-builds\n  - name: POST /repos/{owner}/{repo}/pages/builds\n    documentation_url: https://docs.github.com/rest/pages/pages#request-a-github-pages-build\n  - name: GET /repos/{owner}/{repo}/pages/builds/{build_id}\n    documentation_url: https://docs.github.com/rest/pages/pages#get-github-pages-build\nopenapi_commit: 4e819bd9aa9411232e1c34e7d1ffaaffc224e94b\nopenapi_operations:\n  - name: GET /\n    documentation_url: https://docs.github.com/rest/meta/meta#github-api-root\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /admin/hooks\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/global-webhooks#list-global-webhooks\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /admin/hooks\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/global-webhooks#create-a-global-webhook\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /admin/hooks/{hook_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/global-webhooks#delete-a-global-webhook\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /admin/hooks/{hook_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/global-webhooks#get-a-global-webhook\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /admin/hooks/{hook_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/global-webhooks#update-a-global-webhook\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /admin/hooks/{hook_id}/pings\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/global-webhooks#ping-a-global-webhook\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /admin/keys\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#list-public-keys\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /admin/keys/{key_ids}\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#delete-a-public-key\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /admin/ldap/teams/{team_id}/mapping\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /admin/ldap/teams/{team_id}/sync\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-team\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /admin/ldap/users/{username}/mapping\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /admin/ldap/users/{username}/sync\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-user\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /admin/organizations\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/orgs#create-an-organization\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /admin/organizations/{org}\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/orgs#update-an-organization-name\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /admin/pre-receive-environments\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/pre-receive-environments#list-pre-receive-environments\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /admin/pre-receive-environments\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/pre-receive-environments#create-a-pre-receive-environment\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /admin/pre-receive-environments/{pre_receive_environment_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/pre-receive-environments#delete-a-pre-receive-environment\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /admin/pre-receive-environments/{pre_receive_environment_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/pre-receive-environments#get-a-pre-receive-environment\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /admin/pre-receive-environments/{pre_receive_environment_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/pre-receive-environments#update-a-pre-receive-environment\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /admin/pre-receive-environments/{pre_receive_environment_id}/downloads\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/pre-receive-environments#start-a-pre-receive-environment-download\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /admin/pre-receive-environments/{pre_receive_environment_id}/downloads/latest\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/pre-receive-environments#get-the-download-status-for-a-pre-receive-environment\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /admin/pre-receive-hooks\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/pre-receive-hooks#list-pre-receive-hooks\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /admin/pre-receive-hooks\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/pre-receive-hooks#create-a-pre-receive-hook\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /admin/pre-receive-hooks/{pre_receive_hook_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/pre-receive-hooks#delete-a-pre-receive-hook\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /admin/pre-receive-hooks/{pre_receive_hook_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/pre-receive-hooks#get-a-pre-receive-hook\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /admin/pre-receive-hooks/{pre_receive_hook_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/pre-receive-hooks#update-a-pre-receive-hook\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /admin/tokens\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#list-personal-access-tokens\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /admin/tokens/{token_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#delete-a-personal-access-token\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /admin/users\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#create-a-user\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /admin/users/{username}\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#delete-a-user\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /admin/users/{username}\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#update-the-username-for-a-user\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /admin/users/{username}/authorizations\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#delete-an-impersonation-oauth-token\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /admin/users/{username}/authorizations\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#create-an-impersonation-oauth-token\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /advisories\n    documentation_url: https://docs.github.com/rest/security-advisories/global-advisories#list-global-security-advisories\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /advisories/{ghsa_id}\n    documentation_url: https://docs.github.com/rest/security-advisories/global-advisories#get-a-global-security-advisory\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /app\n    documentation_url: https://docs.github.com/rest/apps/apps#get-the-authenticated-app\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /app-manifests/{code}/conversions\n    documentation_url: https://docs.github.com/rest/apps/apps#create-a-github-app-from-a-manifest\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /app/hook/config\n    documentation_url: https://docs.github.com/rest/apps/webhooks#get-a-webhook-configuration-for-an-app\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /app/hook/config\n    documentation_url: https://docs.github.com/rest/apps/webhooks#update-a-webhook-configuration-for-an-app\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /app/hook/deliveries\n    documentation_url: https://docs.github.com/rest/apps/webhooks#list-deliveries-for-an-app-webhook\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /app/hook/deliveries/{delivery_id}\n    documentation_url: https://docs.github.com/rest/apps/webhooks#get-a-delivery-for-an-app-webhook\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /app/hook/deliveries/{delivery_id}/attempts\n    documentation_url: https://docs.github.com/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /app/installation-requests\n    documentation_url: https://docs.github.com/rest/apps/apps#list-installation-requests-for-the-authenticated-app\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /app/installations\n    documentation_url: https://docs.github.com/rest/apps/apps#list-installations-for-the-authenticated-app\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /app/installations/{installation_id}\n    documentation_url: https://docs.github.com/rest/apps/apps#delete-an-installation-for-the-authenticated-app\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /app/installations/{installation_id}\n    documentation_url: https://docs.github.com/rest/apps/apps#get-an-installation-for-the-authenticated-app\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /app/installations/{installation_id}/access_tokens\n    documentation_url: https://docs.github.com/rest/apps/apps#create-an-installation-access-token-for-an-app\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /app/installations/{installation_id}/suspended\n    documentation_url: https://docs.github.com/rest/apps/apps#unsuspend-an-app-installation\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /app/installations/{installation_id}/suspended\n    documentation_url: https://docs.github.com/rest/apps/apps#suspend-an-app-installation\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /applications/grants\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/oauth-authorizations/oauth-authorizations#list-your-grants\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /applications/grants/{grant_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/oauth-authorizations/oauth-authorizations#delete-a-grant\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /applications/grants/{grant_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/oauth-authorizations/oauth-authorizations#get-a-single-grant\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /applications/{client_id}/grant\n    documentation_url: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-authorization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /applications/{client_id}/grants/{access_token}\n    documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#revoke-a-grant-for-an-application\n    openapi_files:\n      - descriptions/ghes-3.3/ghes-3.3.json\n  - name: DELETE /applications/{client_id}/token\n    documentation_url: https://docs.github.com/rest/apps/oauth-applications#delete-an-app-token\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /applications/{client_id}/token\n    documentation_url: https://docs.github.com/rest/apps/oauth-applications#reset-a-token\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /applications/{client_id}/token\n    documentation_url: https://docs.github.com/rest/apps/oauth-applications#check-a-token\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /applications/{client_id}/token/scoped\n    documentation_url: https://docs.github.com/rest/apps/apps#create-a-scoped-access-token\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /applications/{client_id}/tokens/{access_token}\n    documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#revoke-an-authorization-for-an-application\n    openapi_files:\n      - descriptions/ghes-3.3/ghes-3.3.json\n  - name: GET /applications/{client_id}/tokens/{access_token}\n    documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#check-an-authorization\n    openapi_files:\n      - descriptions/ghes-3.3/ghes-3.3.json\n  - name: POST /applications/{client_id}/tokens/{access_token}\n    documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#reset-an-authorization\n    openapi_files:\n      - descriptions/ghes-3.3/ghes-3.3.json\n  - name: GET /apps/{app_slug}\n    documentation_url: https://docs.github.com/rest/apps/apps#get-an-app\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /assignments/{assignment_id}\n    documentation_url: https://docs.github.com/rest/classroom/classroom#get-an-assignment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /assignments/{assignment_id}/accepted_assignments\n    documentation_url: https://docs.github.com/rest/classroom/classroom#list-accepted-assignments-for-an-assignment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /assignments/{assignment_id}/grades\n    documentation_url: https://docs.github.com/rest/classroom/classroom#get-assignment-grades\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /authorizations\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/oauth-authorizations/oauth-authorizations#list-your-authorizations\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /authorizations\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/oauth-authorizations/oauth-authorizations#create-a-new-authorization\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /authorizations/clients/{client_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /authorizations/clients/{client_id}/{fingerprint}\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app-and-fingerprint\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /authorizations/{authorization_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/oauth-authorizations/oauth-authorizations#delete-an-authorization\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /authorizations/{authorization_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/oauth-authorizations/oauth-authorizations#get-a-single-authorization\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /authorizations/{authorization_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/oauth-authorizations/oauth-authorizations#update-an-existing-authorization\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /classrooms\n    documentation_url: https://docs.github.com/rest/classroom/classroom#list-classrooms\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /classrooms/{classroom_id}\n    documentation_url: https://docs.github.com/rest/classroom/classroom#get-a-classroom\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /classrooms/{classroom_id}/assignments\n    documentation_url: https://docs.github.com/rest/classroom/classroom#list-assignments-for-a-classroom\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /codes_of_conduct\n    documentation_url: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-all-codes-of-conduct\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /codes_of_conduct/{key}\n    documentation_url: https://docs.github.com/rest/codes-of-conduct/codes-of-conduct#get-a-code-of-conduct\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /credentials/revoke\n    documentation_url: https://docs.github.com/rest/credentials/revoke#revoke-a-list-of-credentials\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /emojis\n    documentation_url: https://docs.github.com/rest/emojis/emojis#get-emojis\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprise-installation/{enterprise_or_org}/server-statistics\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/admin-stats#get-github-enterprise-server-statistics\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: DELETE /enterprise/announcement\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/announcement#remove-the-global-announcement-banner\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprise/announcement\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/announcement#get-the-global-announcement-banner\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /enterprise/announcement\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/announcement#set-the-global-announcement-banner\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprise/settings/license\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/licensing#get-license-information\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprise/stats/all\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/admin-stats#get-all-statistics\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprise/stats/comments\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/admin-stats#get-comment-statistics\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprise/stats/gists\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/admin-stats#get-gist-statistics\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprise/stats/hooks\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/admin-stats#get-hooks-statistics\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprise/stats/issues\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/admin-stats#get-issue-statistics\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprise/stats/milestones\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/admin-stats#get-milestone-statistics\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprise/stats/orgs\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/admin-stats#get-organization-statistics\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprise/stats/pages\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/admin-stats#get-pages-statistics\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprise/stats/pulls\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/admin-stats#get-pull-request-statistics\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprise/stats/repos\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/admin-stats#get-repository-statistics\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprise/stats/security-products\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/admin-stats#get-security-products-statistics\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprise/stats/users\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/admin-stats#get-users-statistics\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /enterprises/{enterprise}/access-restrictions/disable\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/enterprises#disable-access-restrictions-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: POST /enterprises/{enterprise}/access-restrictions/enable\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/enterprises#enable-access-restrictions-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/actions/cache/retention-limit\n    documentation_url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-retention-limit-for-an-enterprise\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PUT /enterprises/{enterprise}/actions/cache/retention-limit\n    documentation_url: https://docs.github.com/rest/actions/cache#set-github-actions-cache-retention-limit-for-an-enterprise\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/actions/cache/storage-limit\n    documentation_url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-storage-limit-for-an-enterprise\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PUT /enterprises/{enterprise}/actions/cache/storage-limit\n    documentation_url: https://docs.github.com/rest/actions/cache#set-github-actions-cache-storage-limit-for-an-enterprise\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/actions/cache/usage\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/cache#get-github-actions-cache-usage-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/actions/cache/usage-policy\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/actions/cache#get-github-actions-cache-usage-policy-for-an-enterprise\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /enterprises/{enterprise}/actions/cache/usage-policy\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/actions/cache#set-github-actions-cache-usage-policy-for-an-enterprise\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/actions/hosted-runners\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/hosted-runners#list-github-hosted-runners-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: POST /enterprises/{enterprise}/actions/hosted-runners\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/hosted-runners#create-a-github-hosted-runner-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/actions/hosted-runners/images/custom\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/hosted-runners#list-custom-images-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: DELETE /enterprises/{enterprise}/actions/hosted-runners/images/custom/{image_definition_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/hosted-runners#delete-a-custom-image-from-the-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/actions/hosted-runners/images/custom/{image_definition_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/hosted-runners#get-an-enterprise-custom-image-definition-for-github-actions-hosted-runners\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/actions/hosted-runners/images/custom/{image_definition_id}/versions\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/hosted-runners#list-image-versions-of-a-custom-image-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: DELETE /enterprises/{enterprise}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/hosted-runners#delete-an-image-version-of-custom-image-from-the-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/hosted-runners#get-an-image-version-of-an-enterprise-custom-image-for-github-actions-hosted-runners\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/actions/hosted-runners/images/github-owned\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/hosted-runners#get-github-owned-images-for-github-hosted-runners-in-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/actions/hosted-runners/images/partner\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/hosted-runners#get-partner-images-for-github-hosted-runners-in-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/actions/hosted-runners/limits\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/hosted-runners#get-limits-on-github-hosted-runners-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/actions/hosted-runners/machine-sizes\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/hosted-runners#get-github-hosted-runners-machine-specs-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/actions/hosted-runners/platforms\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/hosted-runners#get-platforms-for-github-hosted-runners-in-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: DELETE /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/hosted-runners#delete-a-github-hosted-runner-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/hosted-runners#get-a-github-hosted-runner-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: PATCH /enterprises/{enterprise}/actions/hosted-runners/{hosted_runner_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/hosted-runners#update-a-github-hosted-runner-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: PUT /enterprises/{enterprise}/actions/oidc/customization/issuer\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/oidc#set-the-github-actions-oidc-custom-issuer-policy-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/actions/permissions\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-github-actions-permissions-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /enterprises/{enterprise}/actions/permissions\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-github-actions-permissions-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/actions/permissions/artifact-and-log-retention\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-artifact-and-log-retention-settings-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /enterprises/{enterprise}/actions/permissions/artifact-and-log-retention\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-artifact-and-log-retention-settings-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/actions/permissions/fork-pr-contributor-approval\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-fork-pr-contributor-approval-permissions-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /enterprises/{enterprise}/actions/permissions/fork-pr-contributor-approval\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-fork-pr-contributor-approval-permissions-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/actions/permissions/fork-pr-workflows-private-repos\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-private-repo-fork-pr-workflow-settings-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /enterprises/{enterprise}/actions/permissions/fork-pr-workflows-private-repos\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-private-repo-fork-pr-workflow-settings-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/actions/permissions/organizations\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#list-selected-organizations-enabled-for-github-actions-in-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /enterprises/{enterprise}/actions/permissions/organizations\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-selected-organizations-enabled-for-github-actions-in-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#disable-a-selected-organization-for-github-actions-in-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#enable-a-selected-organization-for-github-actions-in-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/actions/permissions/selected-actions\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /enterprises/{enterprise}/actions/permissions/selected-actions\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/actions/permissions/self-hosted-runners\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-self-hosted-runners-permissions-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /enterprises/{enterprise}/actions/permissions/self-hosted-runners\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-self-hosted-runners-permissions-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/actions/permissions/workflow\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#get-default-workflow-permissions-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /enterprises/{enterprise}/actions/permissions/workflow\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/permissions#set-default-workflow-permissions-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/actions/runner-groups\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /enterprises/{enterprise}/actions/runner-groups\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations\n    documentation_url: 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\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations\n    documentation_url: 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\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id}\n    documentation_url: 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\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id}\n    documentation_url: 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\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/actions/runners\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/actions/runners/downloads\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-runner-applications-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /enterprises/{enterprise}/actions/runners/generate-jitconfig\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /enterprises/{enterprise}/actions/runners/registration-token\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-a-registration-token-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /enterprises/{enterprise}/actions/runners/remove-token\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#create-a-remove-token-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /enterprises/{enterprise}/actions/runners/{runner_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/actions/runners/{runner_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/actions/runners/{runner_id}/labels\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /enterprises/{enterprise}/actions/runners/{runner_id}/labels\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /enterprises/{enterprise}/actions/runners/{runner_id}/labels\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /enterprises/{enterprise}/actions/runners/{runner_id}/labels/{name}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /enterprises/{enterprise}/announcement\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/enterprises#remove-announcement-banner-from-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/announcement\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/enterprises#get-announcement-banner-for-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: PATCH /enterprises/{enterprise}/announcement\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/enterprises#set-announcement-banner-for-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/apps/installable_organizations\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/organization-installations#get-enterprise-owned-organizations-that-can-have-github-apps-installed\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/apps/installable_organizations/{org}/accessible_repositories\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/organization-installations#get-repositories-belonging-to-an-enterprise-owned-organization\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/apps/organizations/{org}/installations\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/organization-installations#list-github-apps-installed-on-an-enterprise-owned-organization\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /enterprises/{enterprise}/apps/organizations/{org}/installations\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/organization-installations#install-a-github-app-on-an-enterprise-owned-organization\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /enterprises/{enterprise}/apps/organizations/{org}/installations/{installation_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/organization-installations#uninstall-a-github-app-from-an-enterprise-owned-organization\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/apps/organizations/{org}/installations/{installation_id}/repositories\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/organization-installations#get-the-repositories-accessible-to-a-given-github-app-installation\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /enterprises/{enterprise}/apps/organizations/{org}/installations/{installation_id}/repositories\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/organization-installations#toggle-installation-repository-access-between-selected-and-all-repositories\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /enterprises/{enterprise}/apps/organizations/{org}/installations/{installation_id}/repositories/add\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/organization-installations#grant-repository-access-to-an-organization-installation\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /enterprises/{enterprise}/apps/organizations/{org}/installations/{installation_id}/repositories/remove\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/organization-installations#remove-repository-access-from-an-organization-installation\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/audit-log\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#get-the-audit-log-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/audit-log/stream-key\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#get-the-audit-log-stream-key-for-encrypting-secrets\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/audit-log/streams\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#list-audit-log-stream-configurations-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /enterprises/{enterprise}/audit-log/streams\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#create-an-audit-log-streaming-configuration-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /enterprises/{enterprise}/audit-log/streams/{stream_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#delete-an-audit-log-streaming-configuration-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/audit-log/streams/{stream_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#list-one-audit-log-streaming-configuration-via-a-stream-id\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /enterprises/{enterprise}/audit-log/streams/{stream_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/audit-log#update-an-existing-audit-log-stream-configuration\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/bypass-requests/push-rules\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/bypass-requests#list-push-rule-bypass-requests-within-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/bypass-requests/secret-scanning\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning/delegated-bypass#list-bypass-requests-for-secret-scanning-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/code-scanning/alerts\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/code-security/configurations\n    documentation_url: https://docs.github.com/rest/code-security/configurations#get-code-security-configurations-for-an-enterprise\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /enterprises/{enterprise}/code-security/configurations\n    documentation_url: https://docs.github.com/rest/code-security/configurations#create-a-code-security-configuration-for-an-enterprise\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/code-security/configurations/defaults\n    documentation_url: https://docs.github.com/rest/code-security/configurations#get-default-code-security-configurations-for-an-enterprise\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}\n    documentation_url: https://docs.github.com/rest/code-security/configurations#delete-a-code-security-configuration-for-an-enterprise\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}\n    documentation_url: https://docs.github.com/rest/code-security/configurations#retrieve-a-code-security-configuration-of-an-enterprise\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}\n    documentation_url: https://docs.github.com/rest/code-security/configurations#update-a-custom-code-security-configuration-for-an-enterprise\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach\n    documentation_url: https://docs.github.com/rest/code-security/configurations#attach-an-enterprise-configuration-to-repositories\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults\n    documentation_url: https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-enterprise\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories\n    documentation_url: https://docs.github.com/rest/code-security/configurations#get-repositories-associated-with-an-enterprise-code-security-configuration\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/code_security_and_analysis\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#get-code-security-and-analysis-features-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /enterprises/{enterprise}/code_security_and_analysis\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#update-code-security-and-analysis-features-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/consumed-licenses\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/licensing#list-enterprise-consumed-licenses\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/copilot/billing/seats\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-user-management#list-all-copilot-seat-assignments-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: DELETE /enterprises/{enterprise}/copilot/billing/selected_enterprise_teams\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-user-management#remove-enterprise-teams-from-the-copilot-subscription-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: POST /enterprises/{enterprise}/copilot/billing/selected_enterprise_teams\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-user-management#add-enterprise-teams-to-the-copilot-subscription-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: DELETE /enterprises/{enterprise}/copilot/billing/selected_users\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-user-management#remove-users-from-the-copilot-subscription-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: POST /enterprises/{enterprise}/copilot/billing/selected_users\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-user-management#add-users-to-the-copilot-subscription-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/copilot/content_exclusion\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-content-exclusion-management#get-copilot-content-exclusion-rules-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: PUT /enterprises/{enterprise}/copilot/content_exclusion\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-content-exclusion-management#set-copilot-content-exclusion-rules-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/copilot/custom-agents\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-custom-agents#get-custom-agents-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: DELETE /enterprises/{enterprise}/copilot/custom-agents/source\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-custom-agents#delete-the-custom-agents-source-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/copilot/custom-agents/source\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-custom-agents#get-the-source-organization-for-custom-agents-in-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: PUT /enterprises/{enterprise}/copilot/custom-agents/source\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-custom-agents#set-the-source-organization-for-custom-agents-in-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/copilot/metrics\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/copilot/metrics/reports/enterprise-1-day\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-usage-metrics#get-copilot-enterprise-usage-metrics-for-a-specific-day\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/copilot/metrics/reports/enterprise-28-day/latest\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-usage-metrics#get-copilot-enterprise-usage-metrics\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/copilot/metrics/reports/users-1-day\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-usage-metrics#get-copilot-users-usage-metrics-for-a-specific-day\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/copilot/metrics/reports/users-28-day/latest\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-usage-metrics#get-copilot-users-usage-metrics\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/dependabot/alerts\n    documentation_url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-enterprise\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/enterprise-roles\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/enterprise-roles#get-all-enterprise-roles-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: DELETE /enterprises/{enterprise}/enterprise-roles/teams/{team_slug}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/enterprise-roles#remove-all-enterprise-roles-from-a-team\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: DELETE /enterprises/{enterprise}/enterprise-roles/teams/{team_slug}/{role_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/enterprise-roles#remove-an-enterprise-role-from-a-team\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: PUT /enterprises/{enterprise}/enterprise-roles/teams/{team_slug}/{role_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/enterprise-roles#assign-an-enterprise-role-to-a-team\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: DELETE /enterprises/{enterprise}/enterprise-roles/users/{username}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/enterprise-roles#remove-all-enterprise-roles-from-a-user\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: DELETE /enterprises/{enterprise}/enterprise-roles/users/{username}/{role_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/enterprise-roles#remove-enterprise-user-role-assignment\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: PUT /enterprises/{enterprise}/enterprise-roles/users/{username}/{role_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/enterprise-roles#assign-an-enterprise-role-to-an-enterprise-user\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/enterprise-roles/{role_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/enterprise-roles#get-an-enterprise-role\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/enterprise-roles/{role_id}/teams\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/enterprise-roles#list-teams-that-are-assigned-to-an-enterprise-role\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/enterprise-roles/{role_id}/users\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/enterprise-roles#list-users-that-are-assigned-to-an-enterprise-role\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/installation\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/apps/apps#get-an-enterprise-installation-for-the-authenticated-app\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/license-sync-status\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/licensing#get-a-license-sync-status\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/members/{username}/copilot\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-user-management#get-copilot-seat-assignment-details-for-an-enterprise-user\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/network-configurations\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/network-configurations#list-hosted-compute-network-configurations-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: POST /enterprises/{enterprise}/network-configurations\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/network-configurations#create-a-hosted-compute-network-configuration-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: DELETE /enterprises/{enterprise}/network-configurations/{network_configuration_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/network-configurations#delete-a-hosted-compute-network-configuration-from-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/network-configurations/{network_configuration_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/network-configurations#get-a-hosted-compute-network-configuration-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: PATCH /enterprises/{enterprise}/network-configurations/{network_configuration_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/network-configurations#update-a-hosted-compute-network-configuration-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/network-settings/{network_settings_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/network-configurations#get-a-hosted-compute-network-settings-resource-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/org-properties/schema\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/custom-properties-for-orgs#get-organization-custom-properties-schema-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: PATCH /enterprises/{enterprise}/org-properties/schema\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/custom-properties-for-orgs#create-or-update-organization-custom-property-definitions-on-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: DELETE /enterprises/{enterprise}/org-properties/schema/{custom_property_name}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/custom-properties-for-orgs#remove-an-organization-custom-property-definition-from-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/org-properties/schema/{custom_property_name}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/custom-properties-for-orgs#get-an-organization-custom-property-definition-from-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: PUT /enterprises/{enterprise}/org-properties/schema/{custom_property_name}\n    documentation_url: 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\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/org-properties/values\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/custom-properties-for-orgs#list-custom-property-values-for-organizations-in-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: PATCH /enterprises/{enterprise}/org-properties/values\n    documentation_url: 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\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/properties/schema\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/custom-properties#get-custom-properties-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /enterprises/{enterprise}/properties/schema\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/custom-properties#create-or-update-custom-properties-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /enterprises/{enterprise}/properties/schema/organizations/{org}/{custom_property_name}/promote\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/custom-properties#promote-a-custom-property-to-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /enterprises/{enterprise}/properties/schema/{custom_property_name}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/custom-properties#remove-a-custom-property-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/properties/schema/{custom_property_name}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/custom-properties#get-a-custom-property-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /enterprises/{enterprise}/properties/schema/{custom_property_name}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/custom-properties#create-or-update-a-custom-property-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /enterprises/{enterprise}/rulesets\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/rules#create-an-enterprise-repository-ruleset\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: DELETE /enterprises/{enterprise}/rulesets/{ruleset_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/rules#delete-an-enterprise-repository-ruleset\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/rulesets/{ruleset_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/rules#get-an-enterprise-repository-ruleset\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: PUT /enterprises/{enterprise}/rulesets/{ruleset_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/rules#update-an-enterprise-repository-ruleset\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/rulesets/{ruleset_id}/history\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/rules#get-enterprise-ruleset-history\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/rulesets/{ruleset_id}/history/{version_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/rules#get-enterprise-ruleset-version\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/secret-scanning/alerts\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/secret-scanning/pattern-configurations\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning/push-protection#list-enterprise-pattern-configurations\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /enterprises/{enterprise}/secret-scanning/pattern-configurations\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning/push-protection#update-enterprise-pattern-configurations\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/settings/billing/advanced-security\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/licensing#get-github-advanced-security-active-committers-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/settings/billing/budgets\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/billing/budgets#get-all-budgets\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: POST /enterprises/{enterprise}/settings/billing/budgets\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/billing/budgets#create-a-budget\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: DELETE /enterprises/{enterprise}/settings/billing/budgets/{budget_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/billing/budgets#delete-a-budget\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/settings/billing/budgets/{budget_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/billing/budgets#get-a-budget-by-id\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: PATCH /enterprises/{enterprise}/settings/billing/budgets/{budget_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/billing/budgets#update-a-budget\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/settings/billing/cost-centers\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/billing/cost-centers#get-all-cost-centers-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: POST /enterprises/{enterprise}/settings/billing/cost-centers\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/billing/cost-centers#create-a-new-cost-center\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: DELETE /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/billing/cost-centers#delete-a-cost-center\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/billing/cost-centers#get-a-cost-center-by-id\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: PATCH /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/billing/cost-centers#update-a-cost-center-name\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: DELETE /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}/resource\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/billing/cost-centers#remove-resources-from-a-cost-center\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: POST /enterprises/{enterprise}/settings/billing/cost-centers/{cost_center_id}/resource\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/billing/cost-centers#add-resources-to-a-cost-center\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/settings/billing/premium_request/usage\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/billing/usage#get-billing-premium-request-usage-report-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/settings/billing/reports\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/billing/usage-reports#list-usage-report-exports\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: POST /enterprises/{enterprise}/settings/billing/reports\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/billing/usage-reports#create-a-usage-report-export\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/settings/billing/reports/{report_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/billing/usage-reports#get-a-usage-report-export\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/settings/billing/usage\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/billing/usage#get-billing-usage-report-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/settings/billing/usage/summary\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/billing/usage#get-billing-usage-summary-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/team/{team_slug}/copilot/metrics\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-metrics#get-copilot-metrics-for-an-enterprise-team\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /enterprises/{enterprise}/teams\n    documentation_url: https://docs.github.com/rest/enterprise-teams/enterprise-teams#list-enterprise-teams\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /enterprises/{enterprise}/teams\n    documentation_url: https://docs.github.com/rest/enterprise-teams/enterprise-teams#create-an-enterprise-team\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships\n    documentation_url: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#list-members-in-an-enterprise-team\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add\n    documentation_url: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#bulk-add-team-members\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove\n    documentation_url: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#bulk-remove-team-members\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}\n    documentation_url: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#remove-team-membership\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}\n    documentation_url: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#get-enterprise-team-membership\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}\n    documentation_url: https://docs.github.com/rest/enterprise-teams/enterprise-team-members#add-team-member\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations\n    documentation_url: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations#get-organization-assignments\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/add\n    documentation_url: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations#add-organization-assignments\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove\n    documentation_url: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations#remove-organization-assignments\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}\n    documentation_url: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations#delete-an-organization-assignment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}\n    documentation_url: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations#get-organization-assignment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}\n    documentation_url: https://docs.github.com/rest/enterprise-teams/enterprise-team-organizations#add-an-organization-assignment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /enterprises/{enterprise}/teams/{team_slug}\n    documentation_url: https://docs.github.com/rest/enterprise-teams/enterprise-teams#delete-an-enterprise-team\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /enterprises/{enterprise}/teams/{team_slug}\n    documentation_url: https://docs.github.com/rest/enterprise-teams/enterprise-teams#get-an-enterprise-team\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /enterprises/{enterprise}/teams/{team_slug}\n    documentation_url: https://docs.github.com/rest/enterprise-teams/enterprise-teams#update-an-enterprise-team\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /enterprises/{enterprise}/{security_product}/{enablement}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/code-security-and-analysis#enable-or-disable-a-security-feature\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /events\n    documentation_url: https://docs.github.com/rest/activity/events#list-public-events\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /feeds\n    documentation_url: https://docs.github.com/rest/activity/feeds#get-feeds\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /gists\n    documentation_url: https://docs.github.com/rest/gists/gists#list-gists-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /gists\n    documentation_url: https://docs.github.com/rest/gists/gists#create-a-gist\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /gists/public\n    documentation_url: https://docs.github.com/rest/gists/gists#list-public-gists\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /gists/starred\n    documentation_url: https://docs.github.com/rest/gists/gists#list-starred-gists\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /gists/{gist_id}\n    documentation_url: https://docs.github.com/rest/gists/gists#delete-a-gist\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /gists/{gist_id}\n    documentation_url: https://docs.github.com/rest/gists/gists#get-a-gist\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /gists/{gist_id}\n    documentation_url: https://docs.github.com/rest/gists/gists#update-a-gist\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /gists/{gist_id}/comments\n    documentation_url: https://docs.github.com/rest/gists/comments#list-gist-comments\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /gists/{gist_id}/comments\n    documentation_url: https://docs.github.com/rest/gists/comments#create-a-gist-comment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /gists/{gist_id}/comments/{comment_id}\n    documentation_url: https://docs.github.com/rest/gists/comments#delete-a-gist-comment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /gists/{gist_id}/comments/{comment_id}\n    documentation_url: https://docs.github.com/rest/gists/comments#get-a-gist-comment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /gists/{gist_id}/comments/{comment_id}\n    documentation_url: https://docs.github.com/rest/gists/comments#update-a-gist-comment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /gists/{gist_id}/commits\n    documentation_url: https://docs.github.com/rest/gists/gists#list-gist-commits\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /gists/{gist_id}/forks\n    documentation_url: https://docs.github.com/rest/gists/gists#list-gist-forks\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /gists/{gist_id}/forks\n    documentation_url: https://docs.github.com/rest/gists/gists#fork-a-gist\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /gists/{gist_id}/star\n    documentation_url: https://docs.github.com/rest/gists/gists#unstar-a-gist\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /gists/{gist_id}/star\n    documentation_url: https://docs.github.com/rest/gists/gists#check-if-a-gist-is-starred\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /gists/{gist_id}/star\n    documentation_url: https://docs.github.com/rest/gists/gists#star-a-gist\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /gists/{gist_id}/{sha}\n    documentation_url: https://docs.github.com/rest/gists/gists#get-a-gist-revision\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /gitignore/templates\n    documentation_url: https://docs.github.com/rest/gitignore/gitignore#get-all-gitignore-templates\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /gitignore/templates/{name}\n    documentation_url: https://docs.github.com/rest/gitignore/gitignore#get-a-gitignore-template\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /installation/repositories\n    documentation_url: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-app-installation\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /installation/token\n    documentation_url: https://docs.github.com/rest/apps/installations#revoke-an-installation-access-token\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /issues\n    documentation_url: https://docs.github.com/rest/issues/issues#list-issues-assigned-to-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /licenses\n    documentation_url: https://docs.github.com/rest/licenses/licenses#get-all-commonly-used-licenses\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /licenses/{license}\n    documentation_url: https://docs.github.com/rest/licenses/licenses#get-a-license\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /manage/v1/access/ssh\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#delete-a-ssh-key\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /manage/v1/access/ssh\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-the-configured-ssh-keys\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /manage/v1/access/ssh\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#set-a-new-ssh-key\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /manage/v1/checks/system-requirements\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-the-system-requirement-check-results-for-configured-cluster-nodes\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /manage/v1/cluster/status\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-cluster-nodes\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /manage/v1/config/apply\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-the-status-of-a-ghe-config-apply-run\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /manage/v1/config/apply\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#trigger-a-ghe-config-apply-run\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /manage/v1/config/apply/events\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#list-events-from-ghe-config-apply\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /manage/v1/config/init\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#initialize-instance-configuration-with-license-and-password\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /manage/v1/config/license\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-the-enterprise-license-information\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /manage/v1/config/license\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#upload-an-enterprise-license\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /manage/v1/config/license/check\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#check-a-license\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /manage/v1/config/nodes\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /manage/v1/config/settings\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-the-ghes-settings\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /manage/v1/config/settings\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#set-settings\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /manage/v1/maintenance\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /manage/v1/maintenance\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /manage/v1/replication/status\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /manage/v1/version\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /markdown\n    documentation_url: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /markdown/raw\n    documentation_url: https://docs.github.com/rest/markdown/markdown#render-a-markdown-document-in-raw-mode\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /marketplace_listing/accounts/{account_id}\n    documentation_url: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /marketplace_listing/plans\n    documentation_url: https://docs.github.com/rest/apps/marketplace#list-plans\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /marketplace_listing/plans/{plan_id}/accounts\n    documentation_url: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /marketplace_listing/stubbed/accounts/{account_id}\n    documentation_url: https://docs.github.com/rest/apps/marketplace#get-a-subscription-plan-for-an-account-stubbed\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /marketplace_listing/stubbed/plans\n    documentation_url: https://docs.github.com/rest/apps/marketplace#list-plans-stubbed\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /marketplace_listing/stubbed/plans/{plan_id}/accounts\n    documentation_url: https://docs.github.com/rest/apps/marketplace#list-accounts-for-a-plan-stubbed\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /meta\n    documentation_url: https://docs.github.com/rest/meta/meta#get-apiname-meta-information\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /networks/{owner}/{repo}/events\n    documentation_url: https://docs.github.com/rest/activity/events#list-public-events-for-a-network-of-repositories\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /notifications\n    documentation_url: https://docs.github.com/rest/activity/notifications#list-notifications-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /notifications\n    documentation_url: https://docs.github.com/rest/activity/notifications#mark-notifications-as-read\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /notifications/threads/{thread_id}\n    documentation_url: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-done\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /notifications/threads/{thread_id}\n    documentation_url: https://docs.github.com/rest/activity/notifications#get-a-thread\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /notifications/threads/{thread_id}\n    documentation_url: https://docs.github.com/rest/activity/notifications#mark-a-thread-as-read\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /notifications/threads/{thread_id}/subscription\n    documentation_url: https://docs.github.com/rest/activity/notifications#delete-a-thread-subscription\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /notifications/threads/{thread_id}/subscription\n    documentation_url: https://docs.github.com/rest/activity/notifications#get-a-thread-subscription-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /notifications/threads/{thread_id}/subscription\n    documentation_url: https://docs.github.com/rest/activity/notifications#set-a-thread-subscription\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /octocat\n    documentation_url: https://docs.github.com/rest/meta/meta#get-octocat\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /organizations\n    documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /organizations/{organization_id}/custom_roles\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#closing-down---list-custom-repository-roles-in-an-organization\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /organizations/{org}/actions/cache/retention-limit\n    documentation_url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-retention-limit-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PUT /organizations/{org}/actions/cache/retention-limit\n    documentation_url: https://docs.github.com/rest/actions/cache#set-github-actions-cache-retention-limit-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /organizations/{org}/actions/cache/storage-limit\n    documentation_url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-storage-limit-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PUT /organizations/{org}/actions/cache/storage-limit\n    documentation_url: https://docs.github.com/rest/actions/cache#set-github-actions-cache-storage-limit-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /organizations/{org}/dependabot/repository-access\n    documentation_url: https://docs.github.com/rest/dependabot/repository-access#lists-the-repositories-dependabot-can-access-in-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /organizations/{org}/dependabot/repository-access\n    documentation_url: https://docs.github.com/rest/dependabot/repository-access#updates-dependabots-repository-access-list-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /organizations/{org}/dependabot/repository-access/default-level\n    documentation_url: https://docs.github.com/rest/dependabot/repository-access#set-the-default-repository-access-level-for-dependabot\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /organizations/{org}/org-properties/values\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-properties-for-orgs#get-all-custom-property-values-for-an-organization\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: PATCH /organizations/{org}/org-properties/values\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-properties-for-orgs#create-or-update-custom-property-values-for-an-organization\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /organizations/{org}/settings/billing/budgets\n    documentation_url: https://docs.github.com/rest/billing/budgets#get-all-budgets-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n  - name: DELETE /organizations/{org}/settings/billing/budgets/{budget_id}\n    documentation_url: https://docs.github.com/rest/billing/budgets#delete-a-budget-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n  - name: GET /organizations/{org}/settings/billing/budgets/{budget_id}\n    documentation_url: https://docs.github.com/rest/billing/budgets#get-a-budget-by-id-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n  - name: PATCH /organizations/{org}/settings/billing/budgets/{budget_id}\n    documentation_url: https://docs.github.com/rest/billing/budgets#update-a-budget-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n  - name: GET /organizations/{org}/settings/billing/premium_request/usage\n    documentation_url: https://docs.github.com/rest/billing/usage#get-billing-premium-request-usage-report-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n  - name: GET /organizations/{org}/settings/billing/usage\n    documentation_url: https://docs.github.com/rest/billing/usage#get-billing-usage-report-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n  - name: GET /organizations/{org}/settings/billing/usage/summary\n    documentation_url: https://docs.github.com/rest/billing/usage#get-billing-usage-summary-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n  - name: DELETE /orgs/{org}\n    documentation_url: https://docs.github.com/rest/orgs/orgs#delete-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}\n    documentation_url: https://docs.github.com/rest/orgs/orgs#get-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /orgs/{org}\n    documentation_url: https://docs.github.com/rest/orgs/orgs#update-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/actions/cache/usage\n    documentation_url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/actions/cache/usage-by-repository\n    documentation_url: https://docs.github.com/rest/actions/cache#list-repositories-with-github-actions-cache-usage-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/actions/hosted-runners\n    documentation_url: https://docs.github.com/rest/actions/hosted-runners#list-github-hosted-runners-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /orgs/{org}/actions/hosted-runners\n    documentation_url: https://docs.github.com/rest/actions/hosted-runners#create-a-github-hosted-runner-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/actions/hosted-runners/images/custom\n    documentation_url: https://docs.github.com/rest/actions/hosted-runners#list-custom-images-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}\n    documentation_url: https://docs.github.com/rest/actions/hosted-runners#delete-a-custom-image-from-the-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}\n    documentation_url: https://docs.github.com/rest/actions/hosted-runners#get-a-custom-image-definition-for-github-actions-hosted-runners\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions\n    documentation_url: https://docs.github.com/rest/actions/hosted-runners#list-image-versions-of-a-custom-image-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}\n    documentation_url: https://docs.github.com/rest/actions/hosted-runners#delete-an-image-version-of-custom-image-from-the-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}\n    documentation_url: https://docs.github.com/rest/actions/hosted-runners#get-an-image-version-of-a-custom-image-for-github-actions-hosted-runners\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/actions/hosted-runners/images/github-owned\n    documentation_url: https://docs.github.com/rest/actions/hosted-runners#get-github-owned-images-for-github-hosted-runners-in-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/actions/hosted-runners/images/partner\n    documentation_url: https://docs.github.com/rest/actions/hosted-runners#get-partner-images-for-github-hosted-runners-in-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/actions/hosted-runners/limits\n    documentation_url: https://docs.github.com/rest/actions/hosted-runners#get-limits-on-github-hosted-runners-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/actions/hosted-runners/machine-sizes\n    documentation_url: https://docs.github.com/rest/actions/hosted-runners#get-github-hosted-runners-machine-specs-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/actions/hosted-runners/platforms\n    documentation_url: https://docs.github.com/rest/actions/hosted-runners#get-platforms-for-github-hosted-runners-in-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}\n    documentation_url: https://docs.github.com/rest/actions/hosted-runners#delete-a-github-hosted-runner-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}\n    documentation_url: https://docs.github.com/rest/actions/hosted-runners#get-a-github-hosted-runner-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}\n    documentation_url: https://docs.github.com/rest/actions/hosted-runners#update-a-github-hosted-runner-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/actions/oidc/customization/sub\n    documentation_url: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/actions/oidc/customization/sub\n    documentation_url: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/actions/permissions\n    documentation_url: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/actions/permissions\n    documentation_url: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/actions/permissions/artifact-and-log-retention\n    documentation_url: https://docs.github.com/rest/actions/permissions#get-artifact-and-log-retention-settings-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/actions/permissions/artifact-and-log-retention\n    documentation_url: https://docs.github.com/rest/actions/permissions#set-artifact-and-log-retention-settings-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/actions/permissions/fork-pr-contributor-approval\n    documentation_url: https://docs.github.com/rest/actions/permissions#get-fork-pr-contributor-approval-permissions-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/actions/permissions/fork-pr-contributor-approval\n    documentation_url: https://docs.github.com/rest/actions/permissions#set-fork-pr-contributor-approval-permissions-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos\n    documentation_url: https://docs.github.com/rest/actions/permissions#get-private-repo-fork-pr-workflow-settings-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/actions/permissions/fork-pr-workflows-private-repos\n    documentation_url: https://docs.github.com/rest/actions/permissions#set-private-repo-fork-pr-workflow-settings-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/actions/permissions/repositories\n    documentation_url: https://docs.github.com/rest/actions/permissions#list-selected-repositories-enabled-for-github-actions-in-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/actions/permissions/repositories\n    documentation_url: https://docs.github.com/rest/actions/permissions#set-selected-repositories-enabled-for-github-actions-in-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}\n    documentation_url: https://docs.github.com/rest/actions/permissions#disable-a-selected-repository-for-github-actions-in-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/actions/permissions/repositories/{repository_id}\n    documentation_url: https://docs.github.com/rest/actions/permissions#enable-a-selected-repository-for-github-actions-in-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/actions/permissions/selected-actions\n    documentation_url: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/actions/permissions/selected-actions\n    documentation_url: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/actions/permissions/self-hosted-runners\n    documentation_url: https://docs.github.com/rest/actions/permissions#get-self-hosted-runners-settings-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/actions/permissions/self-hosted-runners\n    documentation_url: https://docs.github.com/rest/actions/permissions#set-self-hosted-runners-settings-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/actions/permissions/self-hosted-runners/repositories\n    documentation_url: https://docs.github.com/rest/actions/permissions#list-repositories-allowed-to-use-self-hosted-runners-in-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/actions/permissions/self-hosted-runners/repositories\n    documentation_url: https://docs.github.com/rest/actions/permissions#set-repositories-allowed-to-use-self-hosted-runners-in-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}\n    documentation_url: https://docs.github.com/rest/actions/permissions#remove-a-repository-from-the-list-of-repositories-allowed-to-use-self-hosted-runners-in-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/actions/permissions/self-hosted-runners/repositories/{repository_id}\n    documentation_url: https://docs.github.com/rest/actions/permissions#add-a-repository-to-the-list-of-repositories-allowed-to-use-self-hosted-runners-in-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/actions/permissions/workflow\n    documentation_url: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/actions/permissions/workflow\n    documentation_url: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/actions/runner-groups\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/actions/runner-groups\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id}\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /orgs/{org}/actions/runner-groups/{runner_group_id}\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-github-hosted-runners-in-a-group-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-repository-access-to-a-self-hosted-runner-group-in-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#set-repository-access-for-a-self-hosted-runner-group-in-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/actions/runners\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/actions/runners/downloads\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/actions/runners/generate-jitconfig\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/actions/runners/registration-token\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/actions/runners/remove-token\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/actions/runners/{runner_id}\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/actions/runners/{runner_id}\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/actions/runners/{runner_id}/labels\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/actions/runners/{runner_id}/labels\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/actions/runners/{runner_id}/labels\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/actions/runners/{runner_id}/labels\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/actions/secrets\n    documentation_url: https://docs.github.com/rest/actions/secrets#list-organization-secrets\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/actions/secrets/public-key\n    documentation_url: https://docs.github.com/rest/actions/secrets#get-an-organization-public-key\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/actions/secrets/{secret_name}\n    documentation_url: https://docs.github.com/rest/actions/secrets#delete-an-organization-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/actions/secrets/{secret_name}\n    documentation_url: https://docs.github.com/rest/actions/secrets#get-an-organization-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/actions/secrets/{secret_name}\n    documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/actions/secrets/{secret_name}/repositories\n    documentation_url: https://docs.github.com/rest/actions/secrets#list-selected-repositories-for-an-organization-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/actions/secrets/{secret_name}/repositories\n    documentation_url: https://docs.github.com/rest/actions/secrets#set-selected-repositories-for-an-organization-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\n    documentation_url: https://docs.github.com/rest/actions/secrets#remove-selected-repository-from-an-organization-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\n    documentation_url: https://docs.github.com/rest/actions/secrets#add-selected-repository-to-an-organization-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/actions/variables\n    documentation_url: https://docs.github.com/rest/actions/variables#list-organization-variables\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/actions/variables\n    documentation_url: https://docs.github.com/rest/actions/variables#create-an-organization-variable\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/actions/variables/{name}\n    documentation_url: https://docs.github.com/rest/actions/variables#delete-an-organization-variable\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/actions/variables/{name}\n    documentation_url: https://docs.github.com/rest/actions/variables#get-an-organization-variable\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /orgs/{org}/actions/variables/{name}\n    documentation_url: https://docs.github.com/rest/actions/variables#update-an-organization-variable\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/actions/variables/{name}/repositories\n    documentation_url: https://docs.github.com/rest/actions/variables#list-selected-repositories-for-an-organization-variable\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/actions/variables/{name}/repositories\n    documentation_url: https://docs.github.com/rest/actions/variables#set-selected-repositories-for-an-organization-variable\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}\n    documentation_url: https://docs.github.com/rest/actions/variables#remove-selected-repository-from-an-organization-variable\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}\n    documentation_url: https://docs.github.com/rest/actions/variables#add-selected-repository-to-an-organization-variable\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/announcement\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#remove-announcement-banner-from-organization\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/announcement\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#get-announcement-banner-for-organization\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /orgs/{org}/announcement\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/announcement-banners/organizations#set-announcement-banner-for-organization\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/artifacts/metadata/deployment-record\n    documentation_url: https://docs.github.com/rest/orgs/artifact-metadata#create-an-artifact-deployment-record\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /orgs/{org}/artifacts/metadata/deployment-record/cluster/{cluster}\n    documentation_url: https://docs.github.com/rest/orgs/artifact-metadata#set-cluster-deployment-records\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /orgs/{org}/artifacts/metadata/storage-record\n    documentation_url: https://docs.github.com/rest/orgs/artifact-metadata#create-artifact-metadata-storage-record\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/artifacts/{subject_digest}/metadata/deployment-records\n    documentation_url: https://docs.github.com/rest/orgs/artifact-metadata#list-artifact-deployment-records\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records\n    documentation_url: https://docs.github.com/rest/orgs/artifact-metadata#list-artifact-storage-records\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /orgs/{org}/attestations/bulk-list\n    documentation_url: https://docs.github.com/rest/orgs/attestations#list-attestations-by-bulk-subject-digests\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /orgs/{org}/attestations/delete-request\n    documentation_url: https://docs.github.com/rest/orgs/attestations#delete-attestations-in-bulk\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: DELETE /orgs/{org}/attestations/digest/{subject_digest}\n    documentation_url: https://docs.github.com/rest/orgs/attestations#delete-attestations-by-subject-digest\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/attestations/repositories\n    documentation_url: https://docs.github.com/rest/orgs/attestations#list-attestation-repositories\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: DELETE /orgs/{org}/attestations/{attestation_id}\n    documentation_url: https://docs.github.com/rest/orgs/attestations#delete-attestations-by-id\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/attestations/{subject_digest}\n    documentation_url: https://docs.github.com/rest/orgs/attestations#list-attestations\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/audit-log\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#get-the-audit-log-for-an-organization\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/blocks\n    documentation_url: https://docs.github.com/rest/orgs/blocking#list-users-blocked-by-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: DELETE /orgs/{org}/blocks/{username}\n    documentation_url: https://docs.github.com/rest/orgs/blocking#unblock-a-user-from-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/blocks/{username}\n    documentation_url: https://docs.github.com/rest/orgs/blocking#check-if-a-user-is-blocked-by-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PUT /orgs/{org}/blocks/{username}\n    documentation_url: https://docs.github.com/rest/orgs/blocking#block-a-user-from-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/bypass-requests/push-rules\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/bypass-requests#list-push-rule-bypass-requests-within-an-organization\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/bypass-requests/secret-scanning\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning/delegated-bypass#list-bypass-requests-for-secret-scanning-for-an-org\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/campaigns\n    documentation_url: https://docs.github.com/rest/campaigns/campaigns#list-campaigns-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /orgs/{org}/campaigns\n    documentation_url: https://docs.github.com/rest/campaigns/campaigns#create-a-campaign-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: DELETE /orgs/{org}/campaigns/{campaign_number}\n    documentation_url: https://docs.github.com/rest/campaigns/campaigns#delete-a-campaign-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/campaigns/{campaign_number}\n    documentation_url: https://docs.github.com/rest/campaigns/campaigns#get-a-campaign-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PATCH /orgs/{org}/campaigns/{campaign_number}\n    documentation_url: https://docs.github.com/rest/campaigns/campaigns#update-a-campaign\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/code-scanning/alerts\n    documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/code-security/configurations\n    documentation_url: https://docs.github.com/rest/code-security/configurations#get-code-security-configurations-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/code-security/configurations\n    documentation_url: https://docs.github.com/rest/code-security/configurations#create-a-code-security-configuration\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/code-security/configurations/defaults\n    documentation_url: https://docs.github.com/rest/code-security/configurations#get-default-code-security-configurations\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/code-security/configurations/detach\n    documentation_url: https://docs.github.com/rest/code-security/configurations#detach-configurations-from-repositories\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/code-security/configurations/{configuration_id}\n    documentation_url: https://docs.github.com/rest/code-security/configurations#delete-a-code-security-configuration\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/code-security/configurations/{configuration_id}\n    documentation_url: https://docs.github.com/rest/code-security/configurations#get-a-code-security-configuration\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /orgs/{org}/code-security/configurations/{configuration_id}\n    documentation_url: https://docs.github.com/rest/code-security/configurations#update-a-code-security-configuration\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/code-security/configurations/{configuration_id}/attach\n    documentation_url: https://docs.github.com/rest/code-security/configurations#attach-a-configuration-to-repositories\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults\n    documentation_url: https://docs.github.com/rest/code-security/configurations#set-a-code-security-configuration-as-a-default-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories\n    documentation_url: https://docs.github.com/rest/code-security/configurations#get-repositories-associated-with-a-code-security-configuration\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/codespaces\n    documentation_url: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-the-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PUT /orgs/{org}/codespaces/access\n    documentation_url: https://docs.github.com/rest/codespaces/organizations#manage-access-control-for-organization-codespaces\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: DELETE /orgs/{org}/codespaces/access/selected_users\n    documentation_url: https://docs.github.com/rest/codespaces/organizations#remove-users-from-codespaces-access-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /orgs/{org}/codespaces/access/selected_users\n    documentation_url: https://docs.github.com/rest/codespaces/organizations#add-users-to-codespaces-access-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/codespaces/secrets\n    documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#list-organization-secrets\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/codespaces/secrets/public-key\n    documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-public-key\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: DELETE /orgs/{org}/codespaces/secrets/{secret_name}\n    documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#delete-an-organization-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/codespaces/secrets/{secret_name}\n    documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#get-an-organization-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PUT /orgs/{org}/codespaces/secrets/{secret_name}\n    documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#create-or-update-an-organization-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories\n    documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#list-selected-repositories-for-an-organization-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories\n    documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#set-selected-repositories-for-an-organization-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}\n    documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#remove-selected-repository-from-an-organization-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}\n    documentation_url: https://docs.github.com/rest/codespaces/organization-secrets#add-selected-repository-to-an-organization-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/copilot/billing\n    documentation_url: https://docs.github.com/rest/copilot/copilot-user-management#get-copilot-seat-information-and-settings-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/copilot/billing/seats\n    documentation_url: https://docs.github.com/rest/copilot/copilot-user-management#list-all-copilot-seat-assignments-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: DELETE /orgs/{org}/copilot/billing/selected_teams\n    documentation_url: https://docs.github.com/rest/copilot/copilot-user-management#remove-teams-from-the-copilot-subscription-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /orgs/{org}/copilot/billing/selected_teams\n    documentation_url: https://docs.github.com/rest/copilot/copilot-user-management#add-teams-to-the-copilot-subscription-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: DELETE /orgs/{org}/copilot/billing/selected_users\n    documentation_url: https://docs.github.com/rest/copilot/copilot-user-management#remove-users-from-the-copilot-subscription-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /orgs/{org}/copilot/billing/selected_users\n    documentation_url: https://docs.github.com/rest/copilot/copilot-user-management#add-users-to-the-copilot-subscription-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/copilot/content_exclusion\n    documentation_url: https://docs.github.com/rest/copilot/copilot-content-exclusion-management#get-copilot-content-exclusion-rules-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PUT /orgs/{org}/copilot/content_exclusion\n    documentation_url: https://docs.github.com/rest/copilot/copilot-content-exclusion-management#set-copilot-content-exclusion-rules-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/copilot/metrics\n    documentation_url: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/copilot/metrics/reports/organization-1-day\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-usage-metrics#get-copilot-organization-usage-metrics-for-a-specific-day\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/copilot/metrics/reports/organization-28-day/latest\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-usage-metrics#get-copilot-organization-usage-metrics\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/copilot/metrics/reports/users-1-day\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-usage-metrics#get-copilot-organization-users-usage-metrics-for-a-specific-day\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/copilot/metrics/reports/users-28-day/latest\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/copilot/copilot-usage-metrics#get-copilot-organization-users-usage-metrics\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/credential-authorizations\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#list-saml-sso-authorizations-for-an-organization\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: DELETE /orgs/{org}/credential-authorizations/{credential_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/orgs#remove-a-saml-sso-authorization-for-an-organization\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/custom-repository-roles\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/custom-repository-roles\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#create-a-custom-repository-role\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/custom-repository-roles/{role_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#delete-a-custom-repository-role\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/custom-repository-roles/{role_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#get-a-custom-repository-role\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /orgs/{org}/custom-repository-roles/{role_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#update-a-custom-repository-role\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/custom_roles\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#closing-down---create-a-custom-role\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: DELETE /orgs/{org}/custom_roles/{role_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#closing-down---delete-a-custom-role\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/custom_roles/{role_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#closing-down---get-a-custom-role\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: PATCH /orgs/{org}/custom_roles/{role_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#closing-down---update-a-custom-role\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/dependabot/alerts\n    documentation_url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/dependabot/secrets\n    documentation_url: https://docs.github.com/rest/dependabot/secrets#list-organization-secrets\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/dependabot/secrets/public-key\n    documentation_url: https://docs.github.com/rest/dependabot/secrets#get-an-organization-public-key\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/dependabot/secrets/{secret_name}\n    documentation_url: https://docs.github.com/rest/dependabot/secrets#delete-an-organization-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/dependabot/secrets/{secret_name}\n    documentation_url: https://docs.github.com/rest/dependabot/secrets#get-an-organization-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/dependabot/secrets/{secret_name}\n    documentation_url: https://docs.github.com/rest/dependabot/secrets#create-or-update-an-organization-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories\n    documentation_url: https://docs.github.com/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories\n    documentation_url: https://docs.github.com/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}\n    documentation_url: https://docs.github.com/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}\n    documentation_url: https://docs.github.com/rest/dependabot/secrets#add-selected-repository-to-an-organization-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/dismissal-requests/code-scanning\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/code-scanning/alert-dismissal-requests#list-dismissal-requests-for-code-scanning-alerts-for-an-organization\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/dismissal-requests/dependabot\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/dependabot/alert-dismissal-requests#list-dismissal-requests-for-dependabot-alerts-for-an-organization\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/dismissal-requests/secret-scanning\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning/alert-dismissal-requests#list-alert-dismissal-requests-for-secret-scanning-for-an-org\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/docker/conflicts\n    documentation_url: https://docs.github.com/rest/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/events\n    documentation_url: https://docs.github.com/rest/activity/events#list-public-organization-events\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/external-group/{group_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#get-an-external-group\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/external-groups\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#list-external-groups-available-to-an-organization\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/failed_invitations\n    documentation_url: https://docs.github.com/rest/orgs/members#list-failed-organization-invitations\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/fine_grained_permissions\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#closing-down---list-fine-grained-permissions-for-an-organization\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/hooks\n    documentation_url: https://docs.github.com/rest/orgs/webhooks#list-organization-webhooks\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/hooks\n    documentation_url: https://docs.github.com/rest/orgs/webhooks#create-an-organization-webhook\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/hooks/{hook_id}\n    documentation_url: https://docs.github.com/rest/orgs/webhooks#delete-an-organization-webhook\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/hooks/{hook_id}\n    documentation_url: https://docs.github.com/rest/orgs/webhooks#get-an-organization-webhook\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /orgs/{org}/hooks/{hook_id}\n    documentation_url: https://docs.github.com/rest/orgs/webhooks#update-an-organization-webhook\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/hooks/{hook_id}/config\n    documentation_url: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /orgs/{org}/hooks/{hook_id}/config\n    documentation_url: https://docs.github.com/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/hooks/{hook_id}/deliveries\n    documentation_url: https://docs.github.com/rest/orgs/webhooks#list-deliveries-for-an-organization-webhook\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}\n    documentation_url: https://docs.github.com/rest/orgs/webhooks#get-a-webhook-delivery-for-an-organization-webhook\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts\n    documentation_url: https://docs.github.com/rest/orgs/webhooks#redeliver-a-delivery-for-an-organization-webhook\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/hooks/{hook_id}/pings\n    documentation_url: https://docs.github.com/rest/orgs/webhooks#ping-an-organization-webhook\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/insights/api/route-stats/{actor_type}/{actor_id}\n    documentation_url: https://docs.github.com/rest/orgs/api-insights#get-route-stats-by-actor\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/insights/api/subject-stats\n    documentation_url: https://docs.github.com/rest/orgs/api-insights#get-subject-stats\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/insights/api/summary-stats\n    documentation_url: https://docs.github.com/rest/orgs/api-insights#get-summary-stats\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/insights/api/summary-stats/users/{user_id}\n    documentation_url: https://docs.github.com/rest/orgs/api-insights#get-summary-stats-by-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/insights/api/summary-stats/{actor_type}/{actor_id}\n    documentation_url: https://docs.github.com/rest/orgs/api-insights#get-summary-stats-by-actor\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/insights/api/time-stats\n    documentation_url: https://docs.github.com/rest/orgs/api-insights#get-time-stats\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/insights/api/time-stats/users/{user_id}\n    documentation_url: https://docs.github.com/rest/orgs/api-insights#get-time-stats-by-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/insights/api/time-stats/{actor_type}/{actor_id}\n    documentation_url: https://docs.github.com/rest/orgs/api-insights#get-time-stats-by-actor\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/insights/api/user-stats/{user_id}\n    documentation_url: https://docs.github.com/rest/orgs/api-insights#get-user-stats\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/installation\n    documentation_url: https://docs.github.com/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/installations\n    documentation_url: https://docs.github.com/rest/orgs/orgs#list-app-installations-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/interaction-limits\n    documentation_url: https://docs.github.com/rest/interactions/orgs#remove-interaction-restrictions-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/interaction-limits\n    documentation_url: https://docs.github.com/rest/interactions/orgs#get-interaction-restrictions-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PUT /orgs/{org}/interaction-limits\n    documentation_url: https://docs.github.com/rest/interactions/orgs#set-interaction-restrictions-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/invitations\n    documentation_url: https://docs.github.com/rest/orgs/members#list-pending-organization-invitations\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /orgs/{org}/invitations\n    documentation_url: https://docs.github.com/rest/orgs/members#create-an-organization-invitation\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: DELETE /orgs/{org}/invitations/{invitation_id}\n    documentation_url: https://docs.github.com/rest/orgs/members#cancel-an-organization-invitation\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/invitations/{invitation_id}/teams\n    documentation_url: https://docs.github.com/rest/orgs/members#list-organization-invitation-teams\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/issue-fields\n    documentation_url: https://docs.github.com/rest/orgs/issue-fields#list-issue-fields-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /orgs/{org}/issue-fields\n    documentation_url: https://docs.github.com/rest/orgs/issue-fields#create-issue-field-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: DELETE /orgs/{org}/issue-fields/{issue_field_id}\n    documentation_url: https://docs.github.com/rest/orgs/issue-fields#delete-issue-field-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PATCH /orgs/{org}/issue-fields/{issue_field_id}\n    documentation_url: https://docs.github.com/rest/orgs/issue-fields#update-issue-field-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/issue-types\n    documentation_url: https://docs.github.com/rest/orgs/issue-types#list-issue-types-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /orgs/{org}/issue-types\n    documentation_url: https://docs.github.com/rest/orgs/issue-types#create-issue-type-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: DELETE /orgs/{org}/issue-types/{issue_type_id}\n    documentation_url: https://docs.github.com/rest/orgs/issue-types#delete-issue-type-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PUT /orgs/{org}/issue-types/{issue_type_id}\n    documentation_url: https://docs.github.com/rest/orgs/issue-types#update-issue-type-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/issues\n    documentation_url: https://docs.github.com/rest/issues/issues#list-organization-issues-assigned-to-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/members\n    documentation_url: https://docs.github.com/rest/orgs/members#list-organization-members\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/members/{username}\n    documentation_url: https://docs.github.com/rest/orgs/members#remove-an-organization-member\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/members/{username}\n    documentation_url: https://docs.github.com/rest/orgs/members#check-organization-membership-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/members/{username}/codespaces\n    documentation_url: https://docs.github.com/rest/codespaces/organizations#list-codespaces-for-a-user-in-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}\n    documentation_url: https://docs.github.com/rest/codespaces/organizations#delete-a-codespace-from-the-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop\n    documentation_url: https://docs.github.com/rest/codespaces/organizations#stop-a-codespace-for-an-organization-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/members/{username}/copilot\n    documentation_url: https://docs.github.com/rest/copilot/copilot-user-management#get-copilot-seat-assignment-details-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: DELETE /orgs/{org}/memberships/{username}\n    documentation_url: https://docs.github.com/rest/orgs/members#remove-organization-membership-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/memberships/{username}\n    documentation_url: https://docs.github.com/rest/orgs/members#get-organization-membership-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/memberships/{username}\n    documentation_url: https://docs.github.com/rest/orgs/members#set-organization-membership-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/migrations\n    documentation_url: https://docs.github.com/rest/migrations/orgs#list-organization-migrations\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/migrations\n    documentation_url: https://docs.github.com/rest/migrations/orgs#start-an-organization-migration\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/migrations/{migration_id}\n    documentation_url: https://docs.github.com/rest/migrations/orgs#get-an-organization-migration-status\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/migrations/{migration_id}/archive\n    documentation_url: https://docs.github.com/rest/migrations/orgs#delete-an-organization-migration-archive\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/migrations/{migration_id}/archive\n    documentation_url: https://docs.github.com/rest/migrations/orgs#download-an-organization-migration-archive\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock\n    documentation_url: https://docs.github.com/rest/migrations/orgs#unlock-an-organization-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/migrations/{migration_id}/repositories\n    documentation_url: https://docs.github.com/rest/migrations/orgs#list-repositories-in-an-organization-migration\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/organization-fine-grained-permissions\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/organization-roles#list-organization-fine-grained-permissions-for-an-organization\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/organization-roles\n    documentation_url: https://docs.github.com/rest/orgs/organization-roles#get-all-organization-roles-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/organization-roles\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/organization-roles#create-a-custom-organization-role\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/organization-roles/teams/{team_slug}\n    documentation_url: https://docs.github.com/rest/orgs/organization-roles#remove-all-organization-roles-for-a-team\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}\n    documentation_url: https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-team\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}\n    documentation_url: https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-team\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/organization-roles/users/{username}\n    documentation_url: https://docs.github.com/rest/orgs/organization-roles#remove-all-organization-roles-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}\n    documentation_url: https://docs.github.com/rest/orgs/organization-roles#remove-an-organization-role-from-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/organization-roles/users/{username}/{role_id}\n    documentation_url: https://docs.github.com/rest/orgs/organization-roles#assign-an-organization-role-to-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/organization-roles/{role_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/organization-roles#delete-a-custom-organization-role\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/organization-roles/{role_id}\n    documentation_url: https://docs.github.com/rest/orgs/organization-roles#get-an-organization-role\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /orgs/{org}/organization-roles/{role_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/organization-roles#update-a-custom-organization-role\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/organization-roles/{role_id}/teams\n    documentation_url: https://docs.github.com/rest/orgs/organization-roles#list-teams-that-are-assigned-to-an-organization-role\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/organization-roles/{role_id}/users\n    documentation_url: https://docs.github.com/rest/orgs/organization-roles#list-users-that-are-assigned-to-an-organization-role\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/outside_collaborators\n    documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#list-outside-collaborators-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/outside_collaborators/{username}\n    documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/outside_collaborators/{username}\n    documentation_url: https://docs.github.com/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/packages\n    documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/packages/{package_type}/{package_name}\n    documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/packages/{package_type}/{package_name}\n    documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/packages/{package_type}/{package_name}/restore\n    documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/packages/{package_type}/{package_name}/versions\n    documentation_url: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}\n    documentation_url: https://docs.github.com/rest/packages/packages#delete-package-version-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}\n    documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-version-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\n    documentation_url: https://docs.github.com/rest/packages/packages#restore-package-version-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/personal-access-token-requests\n    documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/personal-access-token-requests\n    documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#review-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/personal-access-token-requests/{pat_request_id}\n    documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories\n    documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-repositories-requested-to-be-accessed-by-a-fine-grained-personal-access-token\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/personal-access-tokens\n    documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-fine-grained-personal-access-tokens-with-access-to-organization-resources\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/personal-access-tokens\n    documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#update-the-access-to-organization-resources-via-fine-grained-personal-access-tokens\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/personal-access-tokens/{pat_id}\n    documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#update-the-access-a-fine-grained-personal-access-token-has-to-organization-resources\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories\n    documentation_url: https://docs.github.com/rest/orgs/personal-access-tokens#list-repositories-a-fine-grained-personal-access-token-has-access-to\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/pre-receive-hooks\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/org-pre-receive-hooks#list-pre-receive-hooks-for-an-organization\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/pre-receive-hooks/{pre_receive_hook_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/org-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-an-organization\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/pre-receive-hooks/{pre_receive_hook_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/org-pre-receive-hooks#get-a-pre-receive-hook-for-an-organization\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /orgs/{org}/pre-receive-hooks/{pre_receive_hook_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/org-pre-receive-hooks#update-pre-receive-hook-enforcement-for-an-organization\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/private-registries\n    documentation_url: https://docs.github.com/rest/private-registries/organization-configurations#list-private-registries-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/private-registries\n    documentation_url: https://docs.github.com/rest/private-registries/organization-configurations#create-a-private-registry-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/private-registries/public-key\n    documentation_url: https://docs.github.com/rest/private-registries/organization-configurations#get-private-registries-public-key-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/private-registries/{secret_name}\n    documentation_url: https://docs.github.com/rest/private-registries/organization-configurations#delete-a-private-registry-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/private-registries/{secret_name}\n    documentation_url: https://docs.github.com/rest/private-registries/organization-configurations#get-a-private-registry-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /orgs/{org}/private-registries/{secret_name}\n    documentation_url: https://docs.github.com/rest/private-registries/organization-configurations#update-a-private-registry-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/projects\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/projects-classic/projects#list-organization-projects\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: POST /orgs/{org}/projects\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/projects-classic/projects#create-an-organization-project\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: GET /orgs/{org}/projectsV2\n    documentation_url: https://docs.github.com/rest/projects/projects#list-projects-for-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/projectsV2/{project_number}\n    documentation_url: https://docs.github.com/rest/projects/projects#get-project-for-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/projectsV2/{project_number}/drafts\n    documentation_url: https://docs.github.com/rest/projects/drafts#create-draft-item-for-organization-owned-project\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/projectsV2/{project_number}/fields\n    documentation_url: https://docs.github.com/rest/projects/fields#list-project-fields-for-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/projectsV2/{project_number}/fields\n    documentation_url: https://docs.github.com/rest/projects/fields#add-a-field-to-an-organization-owned-project\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}\n    documentation_url: https://docs.github.com/rest/projects/fields#get-project-field-for-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/projectsV2/{project_number}/items\n    documentation_url: https://docs.github.com/rest/projects/items#list-items-for-an-organization-owned-project\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/projectsV2/{project_number}/items\n    documentation_url: https://docs.github.com/rest/projects/items#add-item-to-organization-owned-project\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}\n    documentation_url: https://docs.github.com/rest/projects/items#delete-project-item-for-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}\n    documentation_url: https://docs.github.com/rest/projects/items#get-an-item-for-an-organization-owned-project\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}\n    documentation_url: https://docs.github.com/rest/projects/items#update-project-item-for-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/projectsV2/{project_number}/views\n    documentation_url: https://docs.github.com/rest/projects/views#create-a-view-for-an-organization-owned-project\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/projectsV2/{project_number}/views/{view_number}/items\n    documentation_url: https://docs.github.com/rest/projects/items#list-items-for-an-organization-project-view\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/properties/schema\n    documentation_url: https://docs.github.com/rest/orgs/custom-properties#get-all-custom-properties-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /orgs/{org}/properties/schema\n    documentation_url: https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-properties-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/properties/schema/{custom_property_name}\n    documentation_url: https://docs.github.com/rest/orgs/custom-properties#remove-a-custom-property-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/properties/schema/{custom_property_name}\n    documentation_url: https://docs.github.com/rest/orgs/custom-properties#get-a-custom-property-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/properties/schema/{custom_property_name}\n    documentation_url: https://docs.github.com/rest/orgs/custom-properties#create-or-update-a-custom-property-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/properties/values\n    documentation_url: https://docs.github.com/rest/orgs/custom-properties#list-custom-property-values-for-organization-repositories\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /orgs/{org}/properties/values\n    documentation_url: https://docs.github.com/rest/orgs/custom-properties#create-or-update-custom-property-values-for-organization-repositories\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/public_members\n    documentation_url: https://docs.github.com/rest/orgs/members#list-public-organization-members\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/public_members/{username}\n    documentation_url: https://docs.github.com/rest/orgs/members#remove-public-organization-membership-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/public_members/{username}\n    documentation_url: https://docs.github.com/rest/orgs/members#check-public-organization-membership-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/public_members/{username}\n    documentation_url: https://docs.github.com/rest/orgs/members#set-public-organization-membership-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/repos\n    documentation_url: https://docs.github.com/rest/repos/repos#list-organization-repositories\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/repos\n    documentation_url: https://docs.github.com/rest/repos/repos#create-an-organization-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/repository-fine-grained-permissions\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/orgs/custom-roles#list-repository-fine-grained-permissions-for-an-organization\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/rulesets\n    documentation_url: https://docs.github.com/rest/orgs/rules#get-all-organization-repository-rulesets\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/rulesets\n    documentation_url: https://docs.github.com/rest/orgs/rules#create-an-organization-repository-ruleset\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/rulesets/rule-suites\n    documentation_url: https://docs.github.com/rest/orgs/rule-suites#list-organization-rule-suites\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}\n    documentation_url: https://docs.github.com/rest/orgs/rule-suites#get-an-organization-rule-suite\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/rulesets/{ruleset_id}\n    documentation_url: https://docs.github.com/rest/orgs/rules#delete-an-organization-repository-ruleset\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/rulesets/{ruleset_id}\n    documentation_url: https://docs.github.com/rest/orgs/rules#get-an-organization-repository-ruleset\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/rulesets/{ruleset_id}\n    documentation_url: https://docs.github.com/rest/orgs/rules#update-an-organization-repository-ruleset\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/rulesets/{ruleset_id}/history\n    documentation_url: https://docs.github.com/rest/orgs/rules#get-organization-ruleset-history\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}\n    documentation_url: https://docs.github.com/rest/orgs/rules#get-organization-ruleset-version\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/secret-scanning/alerts\n    documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/secret-scanning/pattern-configurations\n    documentation_url: https://docs.github.com/rest/secret-scanning/push-protection#list-organization-pattern-configurations\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /orgs/{org}/secret-scanning/pattern-configurations\n    documentation_url: https://docs.github.com/rest/secret-scanning/push-protection#update-organization-pattern-configurations\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/security-advisories\n    documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/security-managers\n    documentation_url: https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/security-managers/teams/{team_slug}\n    documentation_url: https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/security-managers/teams/{team_slug}\n    documentation_url: https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/settings/billing/advanced-security\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/billing/billing#get-github-advanced-security-active-committers-for-an-organization\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/settings/immutable-releases\n    documentation_url: https://docs.github.com/rest/orgs/orgs#get-immutable-releases-settings-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/settings/immutable-releases\n    documentation_url: https://docs.github.com/rest/orgs/orgs#set-immutable-releases-settings-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/settings/immutable-releases/repositories\n    documentation_url: https://docs.github.com/rest/orgs/orgs#list-selected-repositories-for-immutable-releases-enforcement\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/settings/immutable-releases/repositories\n    documentation_url: https://docs.github.com/rest/orgs/orgs#set-selected-repositories-for-immutable-releases-enforcement\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}\n    documentation_url: https://docs.github.com/rest/orgs/orgs#disable-a-selected-repository-for-immutable-releases-in-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}\n    documentation_url: https://docs.github.com/rest/orgs/orgs#enable-a-selected-repository-for-immutable-releases-in-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/settings/network-configurations\n    documentation_url: https://docs.github.com/rest/orgs/network-configurations#list-hosted-compute-network-configurations-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /orgs/{org}/settings/network-configurations\n    documentation_url: https://docs.github.com/rest/orgs/network-configurations#create-a-hosted-compute-network-configuration-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id}\n    documentation_url: https://docs.github.com/rest/orgs/network-configurations#delete-a-hosted-compute-network-configuration-from-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/settings/network-configurations/{network_configuration_id}\n    documentation_url: https://docs.github.com/rest/orgs/network-configurations#get-a-hosted-compute-network-configuration-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id}\n    documentation_url: https://docs.github.com/rest/orgs/network-configurations#update-a-hosted-compute-network-configuration-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/settings/network-settings/{network_settings_id}\n    documentation_url: https://docs.github.com/rest/orgs/network-configurations#get-a-hosted-compute-network-settings-resource-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/team-sync/groups\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-an-organization\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/team/{team_slug}/copilot/metrics\n    documentation_url: https://docs.github.com/rest/copilot/copilot-metrics#get-copilot-metrics-for-a-team\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/teams\n    documentation_url: https://docs.github.com/rest/teams/teams#list-teams\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/teams\n    documentation_url: https://docs.github.com/rest/teams/teams#create-a-team\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/teams/{team_slug}\n    documentation_url: https://docs.github.com/rest/teams/teams#delete-a-team\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/teams/{team_slug}\n    documentation_url: https://docs.github.com/rest/teams/teams#get-a-team-by-name\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /orgs/{org}/teams/{team_slug}\n    documentation_url: https://docs.github.com/rest/teams/teams#update-a-team\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/teams/{team_slug}/discussions\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/teams/discussions#list-discussions\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: POST /orgs/{org}/teams/{team_slug}/discussions\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/teams/discussions#create-a-discussion\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/teams/discussions#delete-a-discussion\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/teams/discussions#get-a-discussion\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/teams/discussions#update-a-discussion\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#list-discussion-comments\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#create-a-discussion-comment\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#delete-a-discussion-comment\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#get-a-discussion-comment\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#update-a-discussion-comment\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/reactions/reactions#delete-team-discussion-comment-reaction\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/reactions/reactions#list-reactions-for-a-team-discussion\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/reactions/reactions#create-reaction-for-a-team-discussion\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/reactions/reactions#delete-team-discussion-reaction\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: DELETE /orgs/{org}/teams/{team_slug}/external-groups\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#remove-the-connection-between-an-external-group-and-a-team\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/teams/{team_slug}/external-groups\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#list-a-connection-between-an-external-group-and-a-team\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /orgs/{org}/teams/{team_slug}/external-groups\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/external-groups#update-the-connection-between-an-external-group-and-a-team\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/teams/{team_slug}/invitations\n    documentation_url: https://docs.github.com/rest/teams/members#list-pending-team-invitations\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/teams/{team_slug}/members\n    documentation_url: https://docs.github.com/rest/teams/members#list-team-members\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}\n    documentation_url: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/teams/{team_slug}/memberships/{username}\n    documentation_url: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/teams/{team_slug}/memberships/{username}\n    documentation_url: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/teams/{team_slug}/projects\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/teams/teams#list-team-projects\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/teams/teams#remove-a-project-from-a-team\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: GET /orgs/{org}/teams/{team_slug}/projects/{project_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/teams/teams#check-team-permissions-for-a-project\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/teams/teams#add-or-update-team-project-permissions\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: GET /orgs/{org}/teams/{team_slug}/repos\n    documentation_url: https://docs.github.com/rest/teams/teams#list-team-repositories\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\n    documentation_url: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\n    documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\n    documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-a-team\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: PATCH /orgs/{org}/teams/{team_slug}/team-sync/group-mappings\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#create-or-update-idp-group-connections\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /orgs/{org}/teams/{team_slug}/teams\n    documentation_url: https://docs.github.com/rest/teams/teams#list-child-teams\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /orgs/{org}/{security_product}/{enablement}\n    documentation_url: https://docs.github.com/rest/orgs/orgs#enable-or-disable-a-security-feature-for-an-organization\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /projects/columns/cards/{card_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/projects-classic/cards#delete-a-project-card\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: GET /projects/columns/cards/{card_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/projects-classic/cards#get-a-project-card\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: PATCH /projects/columns/cards/{card_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/projects-classic/cards#update-an-existing-project-card\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: POST /projects/columns/cards/{card_id}/moves\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/projects-classic/cards#move-a-project-card\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: DELETE /projects/columns/{column_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/projects-classic/columns#delete-a-project-column\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: GET /projects/columns/{column_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/projects-classic/columns#get-a-project-column\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: PATCH /projects/columns/{column_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/projects-classic/columns#update-an-existing-project-column\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: GET /projects/columns/{column_id}/cards\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/projects-classic/cards#list-project-cards\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: POST /projects/columns/{column_id}/cards\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/projects-classic/cards#create-a-project-card\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: POST /projects/columns/{column_id}/moves\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/projects-classic/columns#move-a-project-column\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: DELETE /projects/{project_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/projects-classic/projects#delete-a-project\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: GET /projects/{project_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/projects-classic/projects#get-a-project\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: PATCH /projects/{project_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/projects-classic/projects#update-a-project\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: GET /projects/{project_id}/collaborators\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/projects-classic/collaborators#list-project-collaborators\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: DELETE /projects/{project_id}/collaborators/{username}\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/projects-classic/collaborators#remove-user-as-a-collaborator\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: PUT /projects/{project_id}/collaborators/{username}\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/projects-classic/collaborators#add-project-collaborator\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: GET /projects/{project_id}/collaborators/{username}/permission\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/projects-classic/collaborators#get-project-permission-for-a-user\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: GET /projects/{project_id}/columns\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/projects-classic/columns#list-project-columns\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: POST /projects/{project_id}/columns\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/projects-classic/columns#create-a-project-column\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: GET /rate_limit\n    documentation_url: https://docs.github.com/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /reactions/{reaction_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.4/rest/reference/reactions/#delete-a-reaction-legacy\n    openapi_files:\n      - descriptions/ghes-3.4/ghes-3.4.json\n  - name: DELETE /repos/{owner}/{repo}\n    documentation_url: https://docs.github.com/rest/repos/repos#delete-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}\n    documentation_url: https://docs.github.com/rest/repos/repos#get-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}\n    documentation_url: https://docs.github.com/rest/repos/repos#update-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/artifacts\n    documentation_url: https://docs.github.com/rest/actions/artifacts#list-artifacts-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\n    documentation_url: https://docs.github.com/rest/actions/artifacts#delete-an-artifact\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\n    documentation_url: https://docs.github.com/rest/actions/artifacts#get-an-artifact\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}\n    documentation_url: https://docs.github.com/rest/actions/artifacts#download-an-artifact\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/cache/retention-limit\n    documentation_url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-retention-limit-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PUT /repos/{owner}/{repo}/actions/cache/retention-limit\n    documentation_url: https://docs.github.com/rest/actions/cache#set-github-actions-cache-retention-limit-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/actions/cache/storage-limit\n    documentation_url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-storage-limit-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PUT /repos/{owner}/{repo}/actions/cache/storage-limit\n    documentation_url: https://docs.github.com/rest/actions/cache#set-github-actions-cache-storage-limit-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/actions/cache/usage\n    documentation_url: https://docs.github.com/rest/actions/cache#get-github-actions-cache-usage-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/cache/usage-policy\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/actions/cache#get-github-actions-cache-usage-policy-for-a-repository\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/actions/cache/usage-policy\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/actions/cache#set-github-actions-cache-usage-policy-for-a-repository\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/actions/caches\n    documentation_url: https://docs.github.com/rest/actions/cache#delete-github-actions-caches-for-a-repository-using-a-cache-key\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/caches\n    documentation_url: https://docs.github.com/rest/actions/cache#list-github-actions-caches-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}\n    documentation_url: https://docs.github.com/rest/actions/cache#delete-a-github-actions-cache-for-a-repository-using-a-cache-id\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/jobs/{job_id}\n    documentation_url: https://docs.github.com/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs\n    documentation_url: https://docs.github.com/rest/actions/workflow-jobs#download-job-logs-for-a-workflow-run\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun\n    documentation_url: https://docs.github.com/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/oidc/customization/sub\n    documentation_url: https://docs.github.com/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/actions/oidc/customization/sub\n    documentation_url: https://docs.github.com/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/organization-secrets\n    documentation_url: https://docs.github.com/rest/actions/secrets#list-repository-organization-secrets\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/organization-variables\n    documentation_url: https://docs.github.com/rest/actions/variables#list-repository-organization-variables\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/permissions\n    documentation_url: https://docs.github.com/rest/actions/permissions#get-github-actions-permissions-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/actions/permissions\n    documentation_url: https://docs.github.com/rest/actions/permissions#set-github-actions-permissions-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/permissions/access\n    documentation_url: https://docs.github.com/rest/actions/permissions#get-the-level-of-access-for-workflows-outside-of-the-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/actions/permissions/access\n    documentation_url: https://docs.github.com/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention\n    documentation_url: https://docs.github.com/rest/actions/permissions#get-artifact-and-log-retention-settings-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/actions/permissions/artifact-and-log-retention\n    documentation_url: https://docs.github.com/rest/actions/permissions#set-artifact-and-log-retention-settings-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval\n    documentation_url: https://docs.github.com/rest/actions/permissions#get-fork-pr-contributor-approval-permissions-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval\n    documentation_url: https://docs.github.com/rest/actions/permissions#set-fork-pr-contributor-approval-permissions-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos\n    documentation_url: https://docs.github.com/rest/actions/permissions#get-private-repo-fork-pr-workflow-settings-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/actions/permissions/fork-pr-workflows-private-repos\n    documentation_url: https://docs.github.com/rest/actions/permissions#set-private-repo-fork-pr-workflow-settings-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/permissions/selected-actions\n    documentation_url: https://docs.github.com/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/actions/permissions/selected-actions\n    documentation_url: https://docs.github.com/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/permissions/workflow\n    documentation_url: https://docs.github.com/rest/actions/permissions#get-default-workflow-permissions-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/actions/permissions/workflow\n    documentation_url: https://docs.github.com/rest/actions/permissions#set-default-workflow-permissions-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/runners\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/runners/downloads\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-runner-applications-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/actions/runners/registration-token\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-registration-token-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/actions/runners/remove-token\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#create-a-remove-token-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/runners/{runner_id}\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}\n    documentation_url: https://docs.github.com/rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/runs\n    documentation_url: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/actions/runs/{run_id}\n    documentation_url: https://docs.github.com/rest/actions/workflow-runs#delete-a-workflow-run\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}\n    documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals\n    documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-the-review-history-for-a-workflow-run\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve\n    documentation_url: https://docs.github.com/rest/actions/workflow-runs#approve-a-workflow-run-for-a-fork-pull-request\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\n    documentation_url: https://docs.github.com/rest/actions/artifacts#list-workflow-run-artifacts\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}\n    documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-a-workflow-run-attempt\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs\n    documentation_url: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run-attempt\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs\n    documentation_url: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-attempt-logs\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel\n    documentation_url: https://docs.github.com/rest/actions/workflow-runs#cancel-a-workflow-run\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule\n    documentation_url: https://docs.github.com/rest/actions/workflow-runs#review-custom-deployment-protection-rules-for-a-workflow-run\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel\n    documentation_url: https://docs.github.com/rest/actions/workflow-runs#force-cancel-a-workflow-run\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs\n    documentation_url: https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs\n    documentation_url: https://docs.github.com/rest/actions/workflow-runs#delete-workflow-run-logs\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs\n    documentation_url: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-logs\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments\n    documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-pending-deployments-for-a-workflow-run\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments\n    documentation_url: https://docs.github.com/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun\n    documentation_url: https://docs.github.com/rest/actions/workflow-runs#re-run-a-workflow\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs\n    documentation_url: https://docs.github.com/rest/actions/workflow-runs#re-run-failed-jobs-from-a-workflow-run\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing\n    documentation_url: https://docs.github.com/rest/actions/workflow-runs#get-workflow-run-usage\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/actions/secrets\n    documentation_url: https://docs.github.com/rest/actions/secrets#list-repository-secrets\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/secrets/public-key\n    documentation_url: https://docs.github.com/rest/actions/secrets#get-a-repository-public-key\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}\n    documentation_url: https://docs.github.com/rest/actions/secrets#delete-a-repository-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/secrets/{secret_name}\n    documentation_url: https://docs.github.com/rest/actions/secrets#get-a-repository-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}\n    documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-a-repository-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/variables\n    documentation_url: https://docs.github.com/rest/actions/variables#list-repository-variables\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/actions/variables\n    documentation_url: https://docs.github.com/rest/actions/variables#create-a-repository-variable\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/actions/variables/{name}\n    documentation_url: https://docs.github.com/rest/actions/variables#delete-a-repository-variable\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/variables/{name}\n    documentation_url: https://docs.github.com/rest/actions/variables#get-a-repository-variable\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/actions/variables/{name}\n    documentation_url: https://docs.github.com/rest/actions/variables#update-a-repository-variable\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/workflows\n    documentation_url: https://docs.github.com/rest/actions/workflows#list-repository-workflows\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}\n    documentation_url: https://docs.github.com/rest/actions/workflows#get-a-workflow\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable\n    documentation_url: https://docs.github.com/rest/actions/workflows#disable-a-workflow\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches\n    documentation_url: https://docs.github.com/rest/actions/workflows#create-a-workflow-dispatch-event\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable\n    documentation_url: https://docs.github.com/rest/actions/workflows#enable-a-workflow\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\n    documentation_url: https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing\n    documentation_url: https://docs.github.com/rest/actions/workflows#get-workflow-usage\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/activity\n    documentation_url: https://docs.github.com/rest/repos/repos#list-repository-activities\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/assignees\n    documentation_url: https://docs.github.com/rest/issues/assignees#list-assignees\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/assignees/{assignee}\n    documentation_url: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/attestations\n    documentation_url: https://docs.github.com/rest/repos/attestations#create-an-attestation\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/attestations/{subject_digest}\n    documentation_url: https://docs.github.com/rest/repos/attestations#list-attestations\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/autolinks\n    documentation_url: https://docs.github.com/rest/repos/autolinks#get-all-autolinks-of-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/autolinks\n    documentation_url: https://docs.github.com/rest/repos/autolinks#create-an-autolink-reference-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}\n    documentation_url: https://docs.github.com/rest/repos/autolinks#delete-an-autolink-reference-from-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/autolinks/{autolink_id}\n    documentation_url: https://docs.github.com/rest/repos/autolinks#get-an-autolink-reference-of-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/automated-security-fixes\n    documentation_url: https://docs.github.com/rest/repos/repos#disable-dependabot-security-updates\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/automated-security-fixes\n    documentation_url: https://docs.github.com/rest/repos/repos#check-if-dependabot-security-updates-are-enabled-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/automated-security-fixes\n    documentation_url: https://docs.github.com/rest/repos/repos#enable-dependabot-security-updates\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/branches\n    documentation_url: https://docs.github.com/rest/branches/branches#list-branches\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/branches/{branch}\n    documentation_url: https://docs.github.com/rest/branches/branches#get-a-branch\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-branch-protection\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/branches/{branch}/protection\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#get-branch-protection\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#update-branch-protection\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-admin-branch-protection\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#get-admin-branch-protection\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#set-admin-branch-protection\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-pull-request-review-protection\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#get-pull-request-review-protection\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#update-pull-request-review-protection\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-commit-signature-protection\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#get-commit-signature-protection\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#create-commit-signature-protection\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-status-check-protection\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#get-status-checks-protection\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#update-status-check-protection\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-status-check-contexts\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#get-all-status-check-contexts\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#add-status-check-contexts\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#set-status-check-contexts\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#delete-access-restrictions\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#get-access-restrictions\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-app-access-restrictions\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#add-app-access-restrictions\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#set-app-access-restrictions\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-team-access-restrictions\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#get-teams-with-access-to-the-protected-branch\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#add-team-access-restrictions\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#set-team-access-restrictions\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#remove-user-access-restrictions\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#get-users-with-access-to-the-protected-branch\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#add-user-access-restrictions\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\n    documentation_url: https://docs.github.com/rest/branches/branch-protection#set-user-access-restrictions\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/branches/{branch}/rename\n    documentation_url: https://docs.github.com/rest/branches/branches#rename-a-branch\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/bypass-requests/push-rules\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/bypass-requests#list-repository-push-rule-bypass-requests\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/bypass-requests/push-rules/{bypass_request_number}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/bypass-requests#get-a-repository-push-bypass-request\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/bypass-requests/secret-scanning\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning/delegated-bypass#list-bypass-requests-for-secret-scanning-for-a-repository\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/bypass-requests/secret-scanning/{bypass_request_number}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning/delegated-bypass#get-a-bypass-request-for-secret-scanning\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/bypass-requests/secret-scanning/{bypass_request_number}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning/delegated-bypass#review-a-bypass-request-for-secret-scanning\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/bypass-responses/secret-scanning/{bypass_response_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning/delegated-bypass#dismiss-a-response-on-a-bypass-request-for-secret-scanning\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/check-runs\n    documentation_url: https://docs.github.com/rest/checks/runs#create-a-check-run\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/check-runs/{check_run_id}\n    documentation_url: https://docs.github.com/rest/checks/runs#get-a-check-run\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}\n    documentation_url: https://docs.github.com/rest/checks/runs#update-a-check-run\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\n    documentation_url: https://docs.github.com/rest/checks/runs#list-check-run-annotations\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest\n    documentation_url: https://docs.github.com/rest/checks/runs#rerequest-a-check-run\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/check-suites\n    documentation_url: https://docs.github.com/rest/checks/suites#create-a-check-suite\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/check-suites/preferences\n    documentation_url: https://docs.github.com/rest/checks/suites#update-repository-preferences-for-check-suites\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/check-suites/{check_suite_id}\n    documentation_url: https://docs.github.com/rest/checks/suites#get-a-check-suite\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\n    documentation_url: https://docs.github.com/rest/checks/runs#list-check-runs-in-a-check-suite\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest\n    documentation_url: https://docs.github.com/rest/checks/suites#rerequest-a-check-suite\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/code-scanning/alerts\n    documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\n    documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-alert\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\n    documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-alert\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix\n    documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-the-status-of-an-autofix-for-a-code-scanning-alert\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix\n    documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#create-an-autofix-for-a-code-scanning-alert\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits\n    documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#commit-an-autofix-for-a-code-scanning-alert\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\n    documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-instances-of-a-code-scanning-alert\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/code-scanning/analyses\n    documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-code-scanning-analyses-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}\n    documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#delete-a-code-scanning-analysis-from-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}\n    documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/code-scanning/codeql/databases\n    documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#list-codeql-databases-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}\n    documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#delete-a-codeql-database\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}\n    documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-codeql-database-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses\n    documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#create-a-codeql-variant-analysis\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}\n    documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-the-summary-of-a-codeql-variant-analysis\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}/{repo_name}\n    documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-the-analysis-status-of-a-repository-in-a-codeql-variant-analysis\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/code-scanning/default-setup\n    documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-a-code-scanning-default-setup-configuration\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/code-scanning/default-setup\n    documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#update-a-code-scanning-default-setup-configuration\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/code-scanning/sarifs\n    documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#upload-an-analysis-as-sarif-data\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}\n    documentation_url: https://docs.github.com/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/code-security-configuration\n    documentation_url: https://docs.github.com/rest/code-security/configurations#get-the-code-security-configuration-associated-with-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/codeowners/errors\n    documentation_url: https://docs.github.com/rest/repos/repos#list-codeowners-errors\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/codespaces\n    documentation_url: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-in-a-repository-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /repos/{owner}/{repo}/codespaces\n    documentation_url: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-in-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/codespaces/devcontainers\n    documentation_url: https://docs.github.com/rest/codespaces/codespaces#list-devcontainer-configurations-in-a-repository-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/codespaces/machines\n    documentation_url: https://docs.github.com/rest/codespaces/machines#list-available-machine-types-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/codespaces/new\n    documentation_url: https://docs.github.com/rest/codespaces/codespaces#get-default-attributes-for-a-codespace\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/codespaces/permissions_check\n    documentation_url: https://docs.github.com/rest/codespaces/codespaces#check-if-permissions-defined-by-a-devcontainer-have-been-accepted-by-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/codespaces/secrets\n    documentation_url: https://docs.github.com/rest/codespaces/repository-secrets#list-repository-secrets\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/codespaces/secrets/public-key\n    documentation_url: https://docs.github.com/rest/codespaces/repository-secrets#get-a-repository-public-key\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}\n    documentation_url: https://docs.github.com/rest/codespaces/repository-secrets#delete-a-repository-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}\n    documentation_url: https://docs.github.com/rest/codespaces/repository-secrets#get-a-repository-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}\n    documentation_url: https://docs.github.com/rest/codespaces/repository-secrets#create-or-update-a-repository-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/collaborators\n    documentation_url: https://docs.github.com/rest/collaborators/collaborators#list-repository-collaborators\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/collaborators/{username}\n    documentation_url: https://docs.github.com/rest/collaborators/collaborators#remove-a-repository-collaborator\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/collaborators/{username}\n    documentation_url: https://docs.github.com/rest/collaborators/collaborators#check-if-a-user-is-a-repository-collaborator\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/collaborators/{username}\n    documentation_url: https://docs.github.com/rest/collaborators/collaborators#add-a-repository-collaborator\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/collaborators/{username}/permission\n    documentation_url: https://docs.github.com/rest/collaborators/collaborators#get-repository-permissions-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/comments\n    documentation_url: https://docs.github.com/rest/commits/comments#list-commit-comments-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/comments/{comment_id}\n    documentation_url: https://docs.github.com/rest/commits/comments#delete-a-commit-comment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/comments/{comment_id}\n    documentation_url: https://docs.github.com/rest/commits/comments#get-a-commit-comment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/comments/{comment_id}\n    documentation_url: https://docs.github.com/rest/commits/comments#update-a-commit-comment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/comments/{comment_id}/reactions\n    documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-commit-comment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/comments/{comment_id}/reactions\n    documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-commit-comment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}\n    documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-commit-comment-reaction\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/commits\n    documentation_url: https://docs.github.com/rest/commits/commits#list-commits\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head\n    documentation_url: https://docs.github.com/rest/commits/commits#list-branches-for-head-commit\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/commits/{commit_sha}/comments\n    documentation_url: https://docs.github.com/rest/commits/comments#list-commit-comments\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/commits/{commit_sha}/comments\n    documentation_url: https://docs.github.com/rest/commits/comments#create-a-commit-comment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls\n    documentation_url: https://docs.github.com/rest/commits/commits#list-pull-requests-associated-with-a-commit\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/commits/{ref}\n    documentation_url: https://docs.github.com/rest/commits/commits#get-a-commit\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/commits/{ref}/check-runs\n    documentation_url: https://docs.github.com/rest/checks/runs#list-check-runs-for-a-git-reference\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/commits/{ref}/check-suites\n    documentation_url: https://docs.github.com/rest/checks/suites#list-check-suites-for-a-git-reference\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/commits/{ref}/status\n    documentation_url: https://docs.github.com/rest/commits/statuses#get-the-combined-status-for-a-specific-reference\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/commits/{ref}/statuses\n    documentation_url: https://docs.github.com/rest/commits/statuses#list-commit-statuses-for-a-reference\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/community/profile\n    documentation_url: https://docs.github.com/rest/metrics/community#get-community-profile-metrics\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/compare/{basehead}\n    documentation_url: https://docs.github.com/rest/commits/commits#compare-two-commits\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments\n    documentation_url: https://docs.github.com/enterprise-server@3.3/rest/reference/apps#create-a-content-attachment\n    openapi_files:\n      - descriptions/ghes-3.3/ghes-3.3.json\n  - name: DELETE /repos/{owner}/{repo}/contents/{path}\n    documentation_url: https://docs.github.com/rest/repos/contents#delete-a-file\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/contents/{path}\n    documentation_url: https://docs.github.com/rest/repos/contents#get-repository-content\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/contents/{path}\n    documentation_url: https://docs.github.com/rest/repos/contents#create-or-update-file-contents\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/contributors\n    documentation_url: https://docs.github.com/rest/repos/repos#list-repository-contributors\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/dependabot/alerts\n    documentation_url: https://docs.github.com/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}\n    documentation_url: https://docs.github.com/rest/dependabot/alerts#get-a-dependabot-alert\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}\n    documentation_url: https://docs.github.com/rest/dependabot/alerts#update-a-dependabot-alert\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/dependabot/secrets\n    documentation_url: https://docs.github.com/rest/dependabot/secrets#list-repository-secrets\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/dependabot/secrets/public-key\n    documentation_url: https://docs.github.com/rest/dependabot/secrets#get-a-repository-public-key\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}\n    documentation_url: https://docs.github.com/rest/dependabot/secrets#delete-a-repository-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}\n    documentation_url: https://docs.github.com/rest/dependabot/secrets#get-a-repository-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}\n    documentation_url: https://docs.github.com/rest/dependabot/secrets#create-or-update-a-repository-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}\n    documentation_url: https://docs.github.com/rest/dependency-graph/dependency-review#get-a-diff-of-the-dependencies-between-commits\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/dependency-graph/sbom\n    documentation_url: https://docs.github.com/rest/dependency-graph/sboms#export-a-software-bill-of-materials-sbom-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/dependency-graph/snapshots\n    documentation_url: https://docs.github.com/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/deployments\n    documentation_url: https://docs.github.com/rest/deployments/deployments#list-deployments\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/deployments\n    documentation_url: https://docs.github.com/rest/deployments/deployments#create-a-deployment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/deployments/{deployment_id}\n    documentation_url: https://docs.github.com/rest/deployments/deployments#delete-a-deployment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/deployments/{deployment_id}\n    documentation_url: https://docs.github.com/rest/deployments/deployments#get-a-deployment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\n    documentation_url: https://docs.github.com/rest/deployments/statuses#list-deployment-statuses\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\n    documentation_url: https://docs.github.com/rest/deployments/statuses#create-a-deployment-status\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}\n    documentation_url: https://docs.github.com/rest/deployments/statuses#get-a-deployment-status\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/dismissal-requests/code-scanning\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/code-scanning/alert-dismissal-requests#list-dismissal-requests-for-code-scanning-alerts-for-a-repository\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/dismissal-requests/code-scanning/{alert_number}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/code-scanning/alert-dismissal-requests#get-a-dismissal-request-for-a-code-scanning-alert-for-a-repository\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/dismissal-requests/code-scanning/{alert_number}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/code-scanning/alert-dismissal-requests#review-a-dismissal-request-for-a-code-scanning-alert-for-a-repository\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/dismissal-requests/dependabot\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/dependabot/alert-dismissal-requests#list-dismissal-requests-for-dependabot-alerts-for-a-repository\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/dismissal-requests/dependabot/{alert_number}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/dependabot/alert-dismissal-requests#cancel-a-dismissal-request-for-a-dependabot-alert-for-a-repository\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/dismissal-requests/dependabot/{alert_number}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/dependabot/alert-dismissal-requests#get-a-dismissal-request-for-a-dependabot-alert-for-a-repository\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/dismissal-requests/dependabot/{alert_number}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/dependabot/alert-dismissal-requests#review-a-dismissal-request-for-a-dependabot-alert-for-a-repository\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/dismissal-requests/dependabot/{alert_number}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/dependabot/alert-dismissal-requests#create-a-dismissal-request-for-a-dependabot-alert-for-a-repository\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/dismissal-requests/secret-scanning\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning/alert-dismissal-requests#list-alert-dismissal-requests-for-secret-scanning-for-a-repository\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/dismissal-requests/secret-scanning/{alert_number}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning/alert-dismissal-requests#get-an-alert-dismissal-request-for-secret-scanning\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/dismissal-requests/secret-scanning/{alert_number}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/secret-scanning/alert-dismissal-requests#review-an-alert-dismissal-request-for-secret-scanning\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/dispatches\n    documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-dispatch-event\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/environments\n    documentation_url: https://docs.github.com/rest/deployments/environments#list-environments\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}\n    documentation_url: https://docs.github.com/rest/deployments/environments#delete-an-environment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/environments/{environment_name}\n    documentation_url: https://docs.github.com/rest/deployments/environments#get-an-environment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/environments/{environment_name}\n    documentation_url: https://docs.github.com/rest/deployments/environments#create-or-update-an-environment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies\n    documentation_url: https://docs.github.com/rest/deployments/branch-policies#list-deployment-branch-policies\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies\n    documentation_url: https://docs.github.com/rest/deployments/branch-policies#create-a-deployment-branch-policy\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}\n    documentation_url: https://docs.github.com/rest/deployments/branch-policies#delete-a-deployment-branch-policy\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}\n    documentation_url: https://docs.github.com/rest/deployments/branch-policies#get-a-deployment-branch-policy\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}\n    documentation_url: https://docs.github.com/rest/deployments/branch-policies#update-a-deployment-branch-policy\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules\n    documentation_url: https://docs.github.com/rest/deployments/protection-rules#get-all-deployment-protection-rules-for-an-environment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules\n    documentation_url: https://docs.github.com/rest/deployments/protection-rules#create-a-custom-deployment-protection-rule-on-an-environment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps\n    documentation_url: https://docs.github.com/rest/deployments/protection-rules#list-custom-deployment-rule-integrations-available-for-an-environment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}\n    documentation_url: https://docs.github.com/rest/deployments/protection-rules#disable-a-custom-protection-rule-for-an-environment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}\n    documentation_url: https://docs.github.com/rest/deployments/protection-rules#get-a-custom-deployment-protection-rule\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/environments/{environment_name}/secrets\n    documentation_url: https://docs.github.com/rest/actions/secrets#list-environment-secrets\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key\n    documentation_url: https://docs.github.com/rest/actions/secrets#get-an-environment-public-key\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}\n    documentation_url: https://docs.github.com/rest/actions/secrets#delete-an-environment-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}\n    documentation_url: https://docs.github.com/rest/actions/secrets#get-an-environment-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}\n    documentation_url: https://docs.github.com/rest/actions/secrets#create-or-update-an-environment-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/environments/{environment_name}/variables\n    documentation_url: https://docs.github.com/rest/actions/variables#list-environment-variables\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/environments/{environment_name}/variables\n    documentation_url: https://docs.github.com/rest/actions/variables#create-an-environment-variable\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}\n    documentation_url: https://docs.github.com/rest/actions/variables#delete-an-environment-variable\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}\n    documentation_url: https://docs.github.com/rest/actions/variables#get-an-environment-variable\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}\n    documentation_url: https://docs.github.com/rest/actions/variables#update-an-environment-variable\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/events\n    documentation_url: https://docs.github.com/rest/activity/events#list-repository-events\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/forks\n    documentation_url: https://docs.github.com/rest/repos/forks#list-forks\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/forks\n    documentation_url: https://docs.github.com/rest/repos/forks#create-a-fork\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/git/blobs\n    documentation_url: https://docs.github.com/rest/git/blobs#create-a-blob\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/git/blobs/{file_sha}\n    documentation_url: https://docs.github.com/rest/git/blobs#get-a-blob\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/git/commits\n    documentation_url: https://docs.github.com/rest/git/commits#create-a-commit\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/git/commits/{commit_sha}\n    documentation_url: https://docs.github.com/rest/git/commits#get-a-commit-object\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/git/matching-refs/{ref}\n    documentation_url: https://docs.github.com/rest/git/refs#list-matching-references\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/git/ref/{ref}\n    documentation_url: https://docs.github.com/rest/git/refs#get-a-reference\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/git/refs\n    documentation_url: https://docs.github.com/rest/git/refs#create-a-reference\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/git/refs/{ref}\n    documentation_url: https://docs.github.com/rest/git/refs#delete-a-reference\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/git/refs/{ref}\n    documentation_url: https://docs.github.com/rest/git/refs#update-a-reference\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/git/tags\n    documentation_url: https://docs.github.com/rest/git/tags#create-a-tag-object\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/git/tags/{tag_sha}\n    documentation_url: https://docs.github.com/rest/git/tags#get-a-tag\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/git/trees\n    documentation_url: https://docs.github.com/rest/git/trees#create-a-tree\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/git/trees/{tree_sha}\n    documentation_url: https://docs.github.com/rest/git/trees#get-a-tree\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/hooks\n    documentation_url: https://docs.github.com/rest/repos/webhooks#list-repository-webhooks\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/hooks\n    documentation_url: https://docs.github.com/rest/repos/webhooks#create-a-repository-webhook\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/hooks/{hook_id}\n    documentation_url: https://docs.github.com/rest/repos/webhooks#delete-a-repository-webhook\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/hooks/{hook_id}\n    documentation_url: https://docs.github.com/rest/repos/webhooks#get-a-repository-webhook\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/hooks/{hook_id}\n    documentation_url: https://docs.github.com/rest/repos/webhooks#update-a-repository-webhook\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/hooks/{hook_id}/config\n    documentation_url: https://docs.github.com/rest/repos/webhooks#get-a-webhook-configuration-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config\n    documentation_url: https://docs.github.com/rest/repos/webhooks#update-a-webhook-configuration-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries\n    documentation_url: https://docs.github.com/rest/repos/webhooks#list-deliveries-for-a-repository-webhook\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}\n    documentation_url: https://docs.github.com/rest/repos/webhooks#get-a-delivery-for-a-repository-webhook\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts\n    documentation_url: https://docs.github.com/rest/repos/webhooks#redeliver-a-delivery-for-a-repository-webhook\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/hooks/{hook_id}/pings\n    documentation_url: https://docs.github.com/rest/repos/webhooks#ping-a-repository-webhook\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/hooks/{hook_id}/tests\n    documentation_url: https://docs.github.com/rest/repos/webhooks#test-the-push-repository-webhook\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/immutable-releases\n    documentation_url: https://docs.github.com/rest/repos/repos#disable-immutable-releases\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/immutable-releases\n    documentation_url: https://docs.github.com/rest/repos/repos#check-if-immutable-releases-are-enabled-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/immutable-releases\n    documentation_url: https://docs.github.com/rest/repos/repos#enable-immutable-releases\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/import\n    documentation_url: https://docs.github.com/rest/migrations/source-imports#cancel-an-import\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/import\n    documentation_url: https://docs.github.com/rest/migrations/source-imports#get-an-import-status\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PATCH /repos/{owner}/{repo}/import\n    documentation_url: https://docs.github.com/rest/migrations/source-imports#update-an-import\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PUT /repos/{owner}/{repo}/import\n    documentation_url: https://docs.github.com/rest/migrations/source-imports#start-an-import\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/import/authors\n    documentation_url: https://docs.github.com/rest/migrations/source-imports#get-commit-authors\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PATCH /repos/{owner}/{repo}/import/authors/{author_id}\n    documentation_url: https://docs.github.com/rest/migrations/source-imports#map-a-commit-author\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/import/large_files\n    documentation_url: https://docs.github.com/rest/migrations/source-imports#get-large-files\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PATCH /repos/{owner}/{repo}/import/lfs\n    documentation_url: https://docs.github.com/rest/migrations/source-imports#update-git-lfs-preference\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/installation\n    documentation_url: https://docs.github.com/rest/apps/apps#get-a-repository-installation-for-the-authenticated-app\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/interaction-limits\n    documentation_url: https://docs.github.com/rest/interactions/repos#remove-interaction-restrictions-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/interaction-limits\n    documentation_url: https://docs.github.com/rest/interactions/repos#get-interaction-restrictions-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PUT /repos/{owner}/{repo}/interaction-limits\n    documentation_url: https://docs.github.com/rest/interactions/repos#set-interaction-restrictions-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/invitations\n    documentation_url: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/invitations/{invitation_id}\n    documentation_url: https://docs.github.com/rest/collaborators/invitations#delete-a-repository-invitation\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/invitations/{invitation_id}\n    documentation_url: https://docs.github.com/rest/collaborators/invitations#update-a-repository-invitation\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/issues\n    documentation_url: https://docs.github.com/rest/issues/issues#list-repository-issues\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/issues\n    documentation_url: https://docs.github.com/rest/issues/issues#create-an-issue\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/issues/comments\n    documentation_url: https://docs.github.com/rest/issues/comments#list-issue-comments-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}\n    documentation_url: https://docs.github.com/rest/issues/comments#delete-an-issue-comment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/issues/comments/{comment_id}\n    documentation_url: https://docs.github.com/rest/issues/comments#get-an-issue-comment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}\n    documentation_url: https://docs.github.com/rest/issues/comments#update-an-issue-comment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/pin\n    documentation_url: https://docs.github.com/rest/issues/comments#unpin-an-issue-comment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PUT /repos/{owner}/{repo}/issues/comments/{comment_id}/pin\n    documentation_url: https://docs.github.com/rest/issues/comments#pin-an-issue-comment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\n    documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue-comment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\n    documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue-comment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}\n    documentation_url: https://docs.github.com/rest/reactions/reactions#delete-an-issue-comment-reaction\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/issues/events\n    documentation_url: https://docs.github.com/rest/issues/events#list-issue-events-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/issues/events/{event_id}\n    documentation_url: https://docs.github.com/rest/issues/events#get-an-issue-event\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/issues/{issue_number}\n    documentation_url: https://docs.github.com/rest/issues/issues#get-an-issue\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/issues/{issue_number}\n    documentation_url: https://docs.github.com/rest/issues/issues#update-an-issue\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees\n    documentation_url: https://docs.github.com/rest/issues/assignees#remove-assignees-from-an-issue\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/issues/{issue_number}/assignees\n    documentation_url: https://docs.github.com/rest/issues/assignees#add-assignees-to-an-issue\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}\n    documentation_url: https://docs.github.com/rest/issues/assignees#check-if-a-user-can-be-assigned-to-a-issue\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/issues/{issue_number}/comments\n    documentation_url: https://docs.github.com/rest/issues/comments#list-issue-comments\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/issues/{issue_number}/comments\n    documentation_url: https://docs.github.com/rest/issues/comments#create-an-issue-comment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by\n    documentation_url: https://docs.github.com/rest/issues/issue-dependencies#list-dependencies-an-issue-is-blocked-by\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by\n    documentation_url: https://docs.github.com/rest/issues/issue-dependencies#add-a-dependency-an-issue-is-blocked-by\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}\n    documentation_url: https://docs.github.com/rest/issues/issue-dependencies#remove-dependency-an-issue-is-blocked-by\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking\n    documentation_url: https://docs.github.com/rest/issues/issue-dependencies#list-dependencies-an-issue-is-blocking\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/issues/{issue_number}/events\n    documentation_url: https://docs.github.com/rest/issues/events#list-issue-events\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/issues/{issue_number}/issue-field-values\n    documentation_url: https://docs.github.com/rest/issues/issue-field-values#list-issue-field-values-for-an-issue\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels\n    documentation_url: https://docs.github.com/rest/issues/labels#remove-all-labels-from-an-issue\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/issues/{issue_number}/labels\n    documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-an-issue\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/issues/{issue_number}/labels\n    documentation_url: https://docs.github.com/rest/issues/labels#add-labels-to-an-issue\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/issues/{issue_number}/labels\n    documentation_url: https://docs.github.com/rest/issues/labels#set-labels-for-an-issue\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}\n    documentation_url: https://docs.github.com/rest/issues/labels#remove-a-label-from-an-issue\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock\n    documentation_url: https://docs.github.com/rest/issues/issues#unlock-an-issue\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/issues/{issue_number}/lock\n    documentation_url: https://docs.github.com/rest/issues/issues#lock-an-issue\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/issues/{issue_number}/parent\n    documentation_url: https://docs.github.com/rest/issues/sub-issues#get-parent-issue\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/issues/{issue_number}/reactions\n    documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-an-issue\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/issues/{issue_number}/reactions\n    documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-an-issue\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}\n    documentation_url: https://docs.github.com/rest/reactions/reactions#delete-an-issue-reaction\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue\n    documentation_url: https://docs.github.com/rest/issues/sub-issues#remove-sub-issue\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues\n    documentation_url: https://docs.github.com/rest/issues/sub-issues#list-sub-issues\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues\n    documentation_url: https://docs.github.com/rest/issues/sub-issues#add-sub-issue\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority\n    documentation_url: https://docs.github.com/rest/issues/sub-issues#reprioritize-sub-issue\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/issues/{issue_number}/timeline\n    documentation_url: https://docs.github.com/rest/issues/timeline#list-timeline-events-for-an-issue\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/keys\n    documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#list-deploy-keys\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/keys\n    documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#create-a-deploy-key\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/keys/{key_id}\n    documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#delete-a-deploy-key\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/keys/{key_id}\n    documentation_url: https://docs.github.com/rest/deploy-keys/deploy-keys#get-a-deploy-key\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/labels\n    documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/labels\n    documentation_url: https://docs.github.com/rest/issues/labels#create-a-label\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/labels/{name}\n    documentation_url: https://docs.github.com/rest/issues/labels#delete-a-label\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/labels/{name}\n    documentation_url: https://docs.github.com/rest/issues/labels#get-a-label\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/labels/{name}\n    documentation_url: https://docs.github.com/rest/issues/labels#update-a-label\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/languages\n    documentation_url: https://docs.github.com/rest/repos/repos#list-repository-languages\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/lfs\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/lfs#disable-git-lfs-for-a-repository\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/lfs\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/repos/lfs#enable-git-lfs-for-a-repository\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/license\n    documentation_url: https://docs.github.com/rest/licenses/licenses#get-the-license-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/merge-upstream\n    documentation_url: https://docs.github.com/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/merges\n    documentation_url: https://docs.github.com/rest/branches/branches#merge-a-branch\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/milestones\n    documentation_url: https://docs.github.com/rest/issues/milestones#list-milestones\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/milestones\n    documentation_url: https://docs.github.com/rest/issues/milestones#create-a-milestone\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/milestones/{milestone_number}\n    documentation_url: https://docs.github.com/rest/issues/milestones#delete-a-milestone\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/milestones/{milestone_number}\n    documentation_url: https://docs.github.com/rest/issues/milestones#get-a-milestone\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/milestones/{milestone_number}\n    documentation_url: https://docs.github.com/rest/issues/milestones#update-a-milestone\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels\n    documentation_url: https://docs.github.com/rest/issues/labels#list-labels-for-issues-in-a-milestone\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/notifications\n    documentation_url: https://docs.github.com/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/notifications\n    documentation_url: https://docs.github.com/rest/activity/notifications#mark-repository-notifications-as-read\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/pages\n    documentation_url: https://docs.github.com/rest/pages/pages#delete-a-apiname-pages-site\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/pages\n    documentation_url: https://docs.github.com/rest/pages/pages#get-a-apiname-pages-site\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/pages\n    documentation_url: https://docs.github.com/rest/pages/pages#create-a-apiname-pages-site\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/pages\n    documentation_url: https://docs.github.com/rest/pages/pages#update-information-about-a-apiname-pages-site\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/pages/builds\n    documentation_url: https://docs.github.com/rest/pages/pages#list-apiname-pages-builds\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/pages/builds\n    documentation_url: https://docs.github.com/rest/pages/pages#request-a-apiname-pages-build\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/pages/builds/latest\n    documentation_url: https://docs.github.com/rest/pages/pages#get-latest-pages-build\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/pages/builds/{build_id}\n    documentation_url: https://docs.github.com/rest/pages/pages#get-apiname-pages-build\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/pages/deployment\n    documentation_url: https://docs.github.com/enterprise-server@3.7/rest/pages/pages#create-a-github-pages-deployment\n    openapi_files:\n      - descriptions/ghes-3.7/ghes-3.7.json\n  - name: POST /repos/{owner}/{repo}/pages/deployments\n    documentation_url: https://docs.github.com/rest/pages/pages#create-a-github-pages-deployment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}\n    documentation_url: https://docs.github.com/rest/pages/pages#get-the-status-of-a-github-pages-deployment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel\n    documentation_url: https://docs.github.com/rest/pages/pages#cancel-a-github-pages-deployment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/pages/health\n    documentation_url: https://docs.github.com/rest/pages/pages#get-a-dns-health-check-for-github-pages\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/pre-receive-hooks\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/pre-receive-hooks/{pre_receive_hook_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/private-vulnerability-reporting\n    documentation_url: https://docs.github.com/rest/repos/repos#disable-private-vulnerability-reporting-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/private-vulnerability-reporting\n    documentation_url: https://docs.github.com/rest/repos/repos#check-if-private-vulnerability-reporting-is-enabled-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PUT /repos/{owner}/{repo}/private-vulnerability-reporting\n    documentation_url: https://docs.github.com/rest/repos/repos#enable-private-vulnerability-reporting-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/projects\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/projects-classic/projects#list-repository-projects\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: POST /repos/{owner}/{repo}/projects\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/projects-classic/projects#create-a-repository-project\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: GET /repos/{owner}/{repo}/properties/values\n    documentation_url: https://docs.github.com/rest/repos/custom-properties#get-all-custom-property-values-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/properties/values\n    documentation_url: https://docs.github.com/rest/repos/custom-properties#create-or-update-custom-property-values-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/pulls\n    documentation_url: https://docs.github.com/rest/pulls/pulls#list-pull-requests\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/pulls\n    documentation_url: https://docs.github.com/rest/pulls/pulls#create-a-pull-request\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/pulls/comments\n    documentation_url: https://docs.github.com/rest/pulls/comments#list-review-comments-in-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}\n    documentation_url: https://docs.github.com/rest/pulls/comments#delete-a-review-comment-for-a-pull-request\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/pulls/comments/{comment_id}\n    documentation_url: https://docs.github.com/rest/pulls/comments#get-a-review-comment-for-a-pull-request\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}\n    documentation_url: https://docs.github.com/rest/pulls/comments#update-a-review-comment-for-a-pull-request\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\n    documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-pull-request-review-comment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\n    documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-pull-request-review-comment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}\n    documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-pull-request-comment-reaction\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/pulls/{pull_number}\n    documentation_url: https://docs.github.com/rest/pulls/pulls#get-a-pull-request\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/pulls/{pull_number}\n    documentation_url: https://docs.github.com/rest/pulls/pulls#update-a-pull-request\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces\n    documentation_url: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-from-a-pull-request\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/comments\n    documentation_url: https://docs.github.com/rest/pulls/comments#list-review-comments-on-a-pull-request\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/comments\n    documentation_url: https://docs.github.com/rest/pulls/comments#create-a-review-comment-for-a-pull-request\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies\n    documentation_url: https://docs.github.com/rest/pulls/comments#create-a-reply-for-a-review-comment\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/commits\n    documentation_url: https://docs.github.com/rest/pulls/pulls#list-commits-on-a-pull-request\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/files\n    documentation_url: https://docs.github.com/rest/pulls/pulls#list-pull-requests-files\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/merge\n    documentation_url: https://docs.github.com/rest/pulls/pulls#check-if-a-pull-request-has-been-merged\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge\n    documentation_url: https://docs.github.com/rest/pulls/pulls#merge-a-pull-request\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\n    documentation_url: https://docs.github.com/rest/pulls/review-requests#remove-requested-reviewers-from-a-pull-request\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\n    documentation_url: https://docs.github.com/rest/pulls/review-requests#get-all-requested-reviewers-for-a-pull-request\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\n    documentation_url: https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews\n    documentation_url: https://docs.github.com/rest/pulls/reviews#list-reviews-for-a-pull-request\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews\n    documentation_url: https://docs.github.com/rest/pulls/reviews#create-a-review-for-a-pull-request\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\n    documentation_url: https://docs.github.com/rest/pulls/reviews#delete-a-pending-review-for-a-pull-request\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\n    documentation_url: https://docs.github.com/rest/pulls/reviews#get-a-review-for-a-pull-request\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\n    documentation_url: https://docs.github.com/rest/pulls/reviews#update-a-review-for-a-pull-request\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\n    documentation_url: https://docs.github.com/rest/pulls/reviews#list-comments-for-a-pull-request-review\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals\n    documentation_url: https://docs.github.com/rest/pulls/reviews#dismiss-a-review-for-a-pull-request\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events\n    documentation_url: https://docs.github.com/rest/pulls/reviews#submit-a-review-for-a-pull-request\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch\n    documentation_url: https://docs.github.com/rest/pulls/pulls#update-a-pull-request-branch\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/readme\n    documentation_url: https://docs.github.com/rest/repos/contents#get-a-repository-readme\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/readme/{dir}\n    documentation_url: https://docs.github.com/rest/repos/contents#get-a-repository-readme-for-a-directory\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/releases\n    documentation_url: https://docs.github.com/rest/releases/releases#list-releases\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/releases\n    documentation_url: https://docs.github.com/rest/releases/releases#create-a-release\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}\n    documentation_url: https://docs.github.com/rest/releases/assets#delete-a-release-asset\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/releases/assets/{asset_id}\n    documentation_url: https://docs.github.com/rest/releases/assets#get-a-release-asset\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}\n    documentation_url: https://docs.github.com/rest/releases/assets#update-a-release-asset\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/releases/generate-notes\n    documentation_url: https://docs.github.com/rest/releases/releases#generate-release-notes-content-for-a-release\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/releases/latest\n    documentation_url: https://docs.github.com/rest/releases/releases#get-the-latest-release\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/releases/tags/{tag}\n    documentation_url: https://docs.github.com/rest/releases/releases#get-a-release-by-tag-name\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/releases/{release_id}\n    documentation_url: https://docs.github.com/rest/releases/releases#delete-a-release\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/releases/{release_id}\n    documentation_url: https://docs.github.com/rest/releases/releases#get-a-release\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/releases/{release_id}\n    documentation_url: https://docs.github.com/rest/releases/releases#update-a-release\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/releases/{release_id}/assets\n    documentation_url: https://docs.github.com/rest/releases/assets#list-release-assets\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/releases/{release_id}/assets\n    documentation_url: https://docs.github.com/rest/releases/assets#upload-a-release-asset\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/releases/{release_id}/reactions\n    documentation_url: https://docs.github.com/rest/reactions/reactions#list-reactions-for-a-release\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/releases/{release_id}/reactions\n    documentation_url: https://docs.github.com/rest/reactions/reactions#create-reaction-for-a-release\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}\n    documentation_url: https://docs.github.com/rest/reactions/reactions#delete-a-release-reaction\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/replicas/caches\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/repos/repos#list-repository-cache-replication-status\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/rules/branches/{branch}\n    documentation_url: https://docs.github.com/rest/repos/rules#get-rules-for-a-branch\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/rulesets\n    documentation_url: https://docs.github.com/rest/repos/rules#get-all-repository-rulesets\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/rulesets\n    documentation_url: https://docs.github.com/rest/repos/rules#create-a-repository-ruleset\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/rulesets/rule-suites\n    documentation_url: https://docs.github.com/rest/repos/rule-suites#list-repository-rule-suites\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}\n    documentation_url: https://docs.github.com/rest/repos/rule-suites#get-a-repository-rule-suite\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}\n    documentation_url: https://docs.github.com/rest/repos/rules#delete-a-repository-ruleset\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/rulesets/{ruleset_id}\n    documentation_url: https://docs.github.com/rest/repos/rules#get-a-repository-ruleset\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}\n    documentation_url: https://docs.github.com/rest/repos/rules#update-a-repository-ruleset\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history\n    documentation_url: https://docs.github.com/rest/repos/rules#get-repository-ruleset-history\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}\n    documentation_url: https://docs.github.com/rest/repos/rules#get-repository-ruleset-version\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/secret-scanning/alerts\n    documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\n    documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#get-a-secret-scanning-alert\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\n    documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#update-a-secret-scanning-alert\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations\n    documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#list-locations-for-a-secret-scanning-alert\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses\n    documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#create-a-push-protection-bypass\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/secret-scanning/scan-history\n    documentation_url: https://docs.github.com/rest/secret-scanning/secret-scanning#get-secret-scanning-scan-history-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/security-advisories\n    documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#list-repository-security-advisories\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /repos/{owner}/{repo}/security-advisories\n    documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#create-a-repository-security-advisory\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /repos/{owner}/{repo}/security-advisories/reports\n    documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#privately-report-a-security-vulnerability\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}\n    documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#get-a-repository-security-advisory\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}\n    documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#update-a-repository-security-advisory\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve\n    documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#request-a-cve-for-a-repository-security-advisory\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks\n    documentation_url: https://docs.github.com/rest/security-advisories/repository-advisories#create-a-temporary-private-fork\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/stargazers\n    documentation_url: https://docs.github.com/rest/activity/starring#list-stargazers\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/stats/code_frequency\n    documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-activity\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/stats/commit_activity\n    documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-last-year-of-commit-activity\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/stats/contributors\n    documentation_url: https://docs.github.com/rest/metrics/statistics#get-all-contributor-commit-activity\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/stats/participation\n    documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-weekly-commit-count\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/stats/punch_card\n    documentation_url: https://docs.github.com/rest/metrics/statistics#get-the-hourly-commit-count-for-each-day\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/statuses/{sha}\n    documentation_url: https://docs.github.com/rest/commits/statuses#create-a-commit-status\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/subscribers\n    documentation_url: https://docs.github.com/rest/activity/watching#list-watchers\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/subscription\n    documentation_url: https://docs.github.com/rest/activity/watching#delete-a-repository-subscription\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/subscription\n    documentation_url: https://docs.github.com/rest/activity/watching#get-a-repository-subscription\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/subscription\n    documentation_url: https://docs.github.com/rest/activity/watching#set-a-repository-subscription\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/tags\n    documentation_url: https://docs.github.com/rest/repos/repos#list-repository-tags\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/tags/protection\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/repos/tags#closing-down---list-tag-protection-states-for-a-repository\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{owner}/{repo}/tags/protection\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/repos/tags#closing-down---create-a-tag-protection-state-for-a-repository\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/tags/protection/{tag_protection_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/repos/tags#closing-down---delete-a-tag-protection-state-for-a-repository\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/tarball/{ref}\n    documentation_url: https://docs.github.com/rest/repos/contents#download-a-repository-archive-tar\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/teams\n    documentation_url: https://docs.github.com/rest/repos/repos#list-repository-teams\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/topics\n    documentation_url: https://docs.github.com/rest/repos/repos#get-all-repository-topics\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/topics\n    documentation_url: https://docs.github.com/rest/repos/repos#replace-all-repository-topics\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/traffic/clones\n    documentation_url: https://docs.github.com/rest/metrics/traffic#get-repository-clones\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/traffic/popular/paths\n    documentation_url: https://docs.github.com/rest/metrics/traffic#get-top-referral-paths\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/traffic/popular/referrers\n    documentation_url: https://docs.github.com/rest/metrics/traffic#get-top-referral-sources\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /repos/{owner}/{repo}/traffic/views\n    documentation_url: https://docs.github.com/rest/metrics/traffic#get-page-views\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /repos/{owner}/{repo}/transfer\n    documentation_url: https://docs.github.com/rest/repos/repos#transfer-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /repos/{owner}/{repo}/vulnerability-alerts\n    documentation_url: https://docs.github.com/rest/repos/repos#disable-vulnerability-alerts\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/vulnerability-alerts\n    documentation_url: https://docs.github.com/rest/repos/repos#check-if-vulnerability-alerts-are-enabled-for-a-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /repos/{owner}/{repo}/vulnerability-alerts\n    documentation_url: https://docs.github.com/rest/repos/repos#enable-vulnerability-alerts\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repos/{owner}/{repo}/zipball/{ref}\n    documentation_url: https://docs.github.com/rest/repos/contents#download-a-repository-archive-zip\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /repos/{template_owner}/{template_repo}/generate\n    documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-using-a-template\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repositories\n    documentation_url: https://docs.github.com/rest/repos/repos#list-public-repositories\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /repositories/{repository_id}/environments/{environment_name}/secrets\n    documentation_url: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#list-environment-secrets\n    openapi_files:\n      - descriptions/ghes-3.7/ghes-3.7.json\n  - name: GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key\n    documentation_url: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#get-an-environment-public-key\n    openapi_files:\n      - descriptions/ghes-3.7/ghes-3.7.json\n  - name: DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\n    documentation_url: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#delete-an-environment-secret\n    openapi_files:\n      - descriptions/ghes-3.7/ghes-3.7.json\n  - name: GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\n    documentation_url: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#get-an-environment-secret\n    openapi_files:\n      - descriptions/ghes-3.7/ghes-3.7.json\n  - name: PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\n    documentation_url: https://docs.github.com/enterprise-server@3.7/rest/actions/secrets#create-or-update-an-environment-secret\n    openapi_files:\n      - descriptions/ghes-3.7/ghes-3.7.json\n  - name: POST /repositories/{repository_id}/issues/{issue_number}/issue-field-values\n    documentation_url: https://docs.github.com/rest/issues/issue-field-values#add-issue-field-values-to-an-issue\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PUT /repositories/{repository_id}/issues/{issue_number}/issue-field-values\n    documentation_url: https://docs.github.com/rest/issues/issue-field-values#set-issue-field-values-for-an-issue\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: DELETE /repositories/{repository_id}/issues/{issue_number}/issue-field-values/{issue_field_id}\n    documentation_url: https://docs.github.com/rest/issues/issue-field-values#delete-an-issue-field-value-from-an-issue\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /scim/v2/Groups\n    documentation_url: https://docs.github.com/enterprise-server@3.7/rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise\n    openapi_files:\n      - descriptions/ghes-3.7/ghes-3.7.json\n  - name: POST /scim/v2/Groups\n    documentation_url: https://docs.github.com/enterprise-server@3.7/rest/enterprise-admin/scim#provision-a-scim-enterprise-group\n    openapi_files:\n      - descriptions/ghes-3.7/ghes-3.7.json\n  - name: DELETE /scim/v2/Groups/{scim_group_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.7/rest/enterprise-admin/scim#delete-a-scim-group-from-an-enterprise\n    openapi_files:\n      - descriptions/ghes-3.7/ghes-3.7.json\n  - name: GET /scim/v2/Groups/{scim_group_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.7/rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-group\n    openapi_files:\n      - descriptions/ghes-3.7/ghes-3.7.json\n  - name: PATCH /scim/v2/Groups/{scim_group_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.7/rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-group\n    openapi_files:\n      - descriptions/ghes-3.7/ghes-3.7.json\n  - name: PUT /scim/v2/Groups/{scim_group_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.7/rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-group\n    openapi_files:\n      - descriptions/ghes-3.7/ghes-3.7.json\n  - name: GET /scim/v2/Users\n    documentation_url: https://docs.github.com/enterprise-server@3.7/rest/enterprise-admin/scim#list-scim-provisioned-identities-for-an-enterprise\n    openapi_files:\n      - descriptions/ghes-3.7/ghes-3.7.json\n  - name: POST /scim/v2/Users\n    documentation_url: https://docs.github.com/enterprise-server@3.7/rest/enterprise-admin/scim#provision-a-scim-enterprise-user\n    openapi_files:\n      - descriptions/ghes-3.7/ghes-3.7.json\n  - name: DELETE /scim/v2/Users/{scim_user_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.7/rest/enterprise-admin/scim#delete-a-scim-user-from-an-enterprise\n    openapi_files:\n      - descriptions/ghes-3.7/ghes-3.7.json\n  - name: GET /scim/v2/Users/{scim_user_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.7/rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-user\n    openapi_files:\n      - descriptions/ghes-3.7/ghes-3.7.json\n  - name: PATCH /scim/v2/Users/{scim_user_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.7/rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-user\n    openapi_files:\n      - descriptions/ghes-3.7/ghes-3.7.json\n  - name: PUT /scim/v2/Users/{scim_user_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.7/rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-user\n    openapi_files:\n      - descriptions/ghes-3.7/ghes-3.7.json\n  - name: GET /scim/v2/enterprises/{enterprise}/Groups\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /scim/v2/enterprises/{enterprise}/Groups\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#provision-a-scim-enterprise-group\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#delete-a-scim-group-from-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-group\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-group\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-group\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /scim/v2/enterprises/{enterprise}/Users\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#list-scim-provisioned-identities-for-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /scim/v2/enterprises/{enterprise}/Users\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#provision-a-scim-enterprise-user\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#delete-a-scim-user-from-an-enterprise\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-user\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-user\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-user\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /scim/v2/organizations/{org}/Users\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#list-scim-provisioned-identities\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: POST /scim/v2/organizations/{org}/Users\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#provision-and-invite-a-scim-user\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: DELETE /scim/v2/organizations/{org}/Users/{scim_user_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#delete-a-scim-user-from-an-organization\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /scim/v2/organizations/{org}/Users/{scim_user_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#get-scim-provisioning-information-for-a-user\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: PATCH /scim/v2/organizations/{org}/Users/{scim_user_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#update-an-attribute-for-a-scim-user\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: PUT /scim/v2/organizations/{org}/Users/{scim_user_id}\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/scim/scim#update-a-provisioned-organization-membership\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /search/code\n    documentation_url: https://docs.github.com/rest/search/search#search-code\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /search/commits\n    documentation_url: https://docs.github.com/rest/search/search#search-commits\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /search/issues\n    documentation_url: https://docs.github.com/rest/search/search#search-issues-and-pull-requests\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /search/labels\n    documentation_url: https://docs.github.com/rest/search/search#search-labels\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /search/repositories\n    documentation_url: https://docs.github.com/rest/search/search#search-repositories\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /search/topics\n    documentation_url: https://docs.github.com/rest/search/search#search-topics\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /search/users\n    documentation_url: https://docs.github.com/rest/search/search#search-users\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /setup/api/configcheck\n    documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-the-configuration-status\n    openapi_files:\n      - descriptions/ghes-3.14/ghes-3.14.json\n  - name: POST /setup/api/configure\n    documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#start-a-configuration-process\n    openapi_files:\n      - descriptions/ghes-3.14/ghes-3.14.json\n  - name: GET /setup/api/maintenance\n    documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-the-maintenance-status\n    openapi_files:\n      - descriptions/ghes-3.14/ghes-3.14.json\n  - name: POST /setup/api/maintenance\n    documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#enable-or-disable-maintenance-mode\n    openapi_files:\n      - descriptions/ghes-3.14/ghes-3.14.json\n  - name: GET /setup/api/settings\n    documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-settings\n    openapi_files:\n      - descriptions/ghes-3.14/ghes-3.14.json\n  - name: PUT /setup/api/settings\n    documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#set-settings\n    openapi_files:\n      - descriptions/ghes-3.14/ghes-3.14.json\n  - name: DELETE /setup/api/settings/authorized-keys\n    documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#remove-an-authorized-ssh-key\n    openapi_files:\n      - descriptions/ghes-3.14/ghes-3.14.json\n  - name: GET /setup/api/settings/authorized-keys\n    documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-all-authorized-ssh-keys\n    openapi_files:\n      - descriptions/ghes-3.14/ghes-3.14.json\n  - name: POST /setup/api/settings/authorized-keys\n    documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#add-an-authorized-ssh-key\n    openapi_files:\n      - descriptions/ghes-3.14/ghes-3.14.json\n  - name: POST /setup/api/start\n    documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#create-a-github-license\n    openapi_files:\n      - descriptions/ghes-3.14/ghes-3.14.json\n  - name: POST /setup/api/upgrade\n    documentation_url: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#upgrade-a-license\n    openapi_files:\n      - descriptions/ghes-3.14/ghes-3.14.json\n  - name: DELETE /teams/{team_id}\n    documentation_url: https://docs.github.com/rest/teams/teams#delete-a-team-legacy\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /teams/{team_id}\n    documentation_url: https://docs.github.com/rest/teams/teams#get-a-team-legacy\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /teams/{team_id}\n    documentation_url: https://docs.github.com/rest/teams/teams#update-a-team-legacy\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /teams/{team_id}/discussions\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/teams/discussions#list-discussions-legacy\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: POST /teams/{team_id}/discussions\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/teams/discussions#create-a-discussion-legacy\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: DELETE /teams/{team_id}/discussions/{discussion_number}\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/teams/discussions#delete-a-discussion-legacy\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: GET /teams/{team_id}/discussions/{discussion_number}\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/teams/discussions#get-a-discussion-legacy\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: PATCH /teams/{team_id}/discussions/{discussion_number}\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/teams/discussions#update-a-discussion-legacy\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: GET /teams/{team_id}/discussions/{discussion_number}/comments\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#list-discussion-comments-legacy\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: POST /teams/{team_id}/discussions/{discussion_number}/comments\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#create-a-discussion-comment-legacy\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: DELETE /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#delete-a-discussion-comment-legacy\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#get-a-discussion-comment-legacy\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: PATCH /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/teams/discussion-comments#update-a-discussion-comment-legacy\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment-legacy\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: POST /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment-legacy\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: GET /teams/{team_id}/discussions/{discussion_number}/reactions\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/reactions/reactions#list-reactions-for-a-team-discussion-legacy\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: POST /teams/{team_id}/discussions/{discussion_number}/reactions\n    documentation_url: https://docs.github.com/enterprise-server@3.13/rest/reactions/reactions#create-reaction-for-a-team-discussion-legacy\n    openapi_files:\n      - descriptions/ghes-3.13/ghes-3.13.json\n  - name: GET /teams/{team_id}/invitations\n    documentation_url: https://docs.github.com/rest/teams/members#list-pending-team-invitations-legacy\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /teams/{team_id}/members\n    documentation_url: https://docs.github.com/rest/teams/members#list-team-members-legacy\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /teams/{team_id}/members/{username}\n    documentation_url: https://docs.github.com/rest/teams/members#remove-team-member-legacy\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /teams/{team_id}/members/{username}\n    documentation_url: https://docs.github.com/rest/teams/members#get-team-member-legacy\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /teams/{team_id}/members/{username}\n    documentation_url: https://docs.github.com/rest/teams/members#add-team-member-legacy\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /teams/{team_id}/memberships/{username}\n    documentation_url: https://docs.github.com/rest/teams/members#remove-team-membership-for-a-user-legacy\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /teams/{team_id}/memberships/{username}\n    documentation_url: https://docs.github.com/rest/teams/members#get-team-membership-for-a-user-legacy\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /teams/{team_id}/memberships/{username}\n    documentation_url: https://docs.github.com/rest/teams/members#add-or-update-team-membership-for-a-user-legacy\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /teams/{team_id}/projects\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/teams/teams#list-team-projects-legacy\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: DELETE /teams/{team_id}/projects/{project_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/teams/teams#remove-a-project-from-a-team-legacy\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: GET /teams/{team_id}/projects/{project_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/teams/teams#check-team-permissions-for-a-project-legacy\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: PUT /teams/{team_id}/projects/{project_id}\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/teams/teams#add-or-update-team-project-permissions-legacy\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: GET /teams/{team_id}/repos\n    documentation_url: https://docs.github.com/rest/teams/teams#list-team-repositories-legacy\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /teams/{team_id}/repos/{owner}/{repo}\n    documentation_url: https://docs.github.com/rest/teams/teams#remove-a-repository-from-a-team-legacy\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /teams/{team_id}/repos/{owner}/{repo}\n    documentation_url: https://docs.github.com/rest/teams/teams#check-team-permissions-for-a-repository-legacy\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /teams/{team_id}/repos/{owner}/{repo}\n    documentation_url: https://docs.github.com/rest/teams/teams#add-or-update-team-repository-permissions-legacy\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /teams/{team_id}/team-sync/group-mappings\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#list-idp-groups-for-a-team-legacy\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: PATCH /teams/{team_id}/team-sync/group-mappings\n    documentation_url: https://docs.github.com/enterprise-cloud@latest//rest/teams/team-sync#create-or-update-idp-group-connections-legacy\n    openapi_files:\n      - descriptions/ghec/ghec.json\n  - name: GET /teams/{team_id}/teams\n    documentation_url: https://docs.github.com/rest/teams/teams#list-child-teams-legacy\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user\n    documentation_url: https://docs.github.com/rest/users/users#get-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /user\n    documentation_url: https://docs.github.com/rest/users/users#update-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/blocks\n    documentation_url: https://docs.github.com/rest/users/blocking#list-users-blocked-by-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: DELETE /user/blocks/{username}\n    documentation_url: https://docs.github.com/rest/users/blocking#unblock-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /user/blocks/{username}\n    documentation_url: https://docs.github.com/rest/users/blocking#check-if-a-user-is-blocked-by-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PUT /user/blocks/{username}\n    documentation_url: https://docs.github.com/rest/users/blocking#block-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /user/codespaces\n    documentation_url: https://docs.github.com/rest/codespaces/codespaces#list-codespaces-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /user/codespaces\n    documentation_url: https://docs.github.com/rest/codespaces/codespaces#create-a-codespace-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /user/codespaces/secrets\n    documentation_url: https://docs.github.com/rest/codespaces/secrets#list-secrets-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /user/codespaces/secrets/public-key\n    documentation_url: https://docs.github.com/rest/codespaces/secrets#get-public-key-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: DELETE /user/codespaces/secrets/{secret_name}\n    documentation_url: https://docs.github.com/rest/codespaces/secrets#delete-a-secret-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /user/codespaces/secrets/{secret_name}\n    documentation_url: https://docs.github.com/rest/codespaces/secrets#get-a-secret-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PUT /user/codespaces/secrets/{secret_name}\n    documentation_url: https://docs.github.com/rest/codespaces/secrets#create-or-update-a-secret-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /user/codespaces/secrets/{secret_name}/repositories\n    documentation_url: https://docs.github.com/rest/codespaces/secrets#list-selected-repositories-for-a-user-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PUT /user/codespaces/secrets/{secret_name}/repositories\n    documentation_url: https://docs.github.com/rest/codespaces/secrets#set-selected-repositories-for-a-user-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}\n    documentation_url: https://docs.github.com/rest/codespaces/secrets#remove-a-selected-repository-from-a-user-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}\n    documentation_url: https://docs.github.com/rest/codespaces/secrets#add-a-selected-repository-to-a-user-secret\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: DELETE /user/codespaces/{codespace_name}\n    documentation_url: https://docs.github.com/rest/codespaces/codespaces#delete-a-codespace-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /user/codespaces/{codespace_name}\n    documentation_url: https://docs.github.com/rest/codespaces/codespaces#get-a-codespace-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PATCH /user/codespaces/{codespace_name}\n    documentation_url: https://docs.github.com/rest/codespaces/codespaces#update-a-codespace-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /user/codespaces/{codespace_name}/exports\n    documentation_url: https://docs.github.com/rest/codespaces/codespaces#export-a-codespace-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /user/codespaces/{codespace_name}/exports/{export_id}\n    documentation_url: https://docs.github.com/rest/codespaces/codespaces#get-details-about-a-codespace-export\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /user/codespaces/{codespace_name}/machines\n    documentation_url: https://docs.github.com/rest/codespaces/machines#list-machine-types-for-a-codespace\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /user/codespaces/{codespace_name}/publish\n    documentation_url: https://docs.github.com/rest/codespaces/codespaces#create-a-repository-from-an-unpublished-codespace\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /user/codespaces/{codespace_name}/start\n    documentation_url: https://docs.github.com/rest/codespaces/codespaces#start-a-codespace-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /user/codespaces/{codespace_name}/stop\n    documentation_url: https://docs.github.com/rest/codespaces/codespaces#stop-a-codespace-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /user/docker/conflicts\n    documentation_url: https://docs.github.com/rest/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /user/email/visibility\n    documentation_url: https://docs.github.com/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: DELETE /user/emails\n    documentation_url: https://docs.github.com/rest/users/emails#delete-an-email-address-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/emails\n    documentation_url: https://docs.github.com/rest/users/emails#list-email-addresses-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /user/emails\n    documentation_url: https://docs.github.com/rest/users/emails#add-an-email-address-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/followers\n    documentation_url: https://docs.github.com/rest/users/followers#list-followers-of-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/following\n    documentation_url: https://docs.github.com/rest/users/followers#list-the-people-the-authenticated-user-follows\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /user/following/{username}\n    documentation_url: https://docs.github.com/rest/users/followers#unfollow-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/following/{username}\n    documentation_url: https://docs.github.com/rest/users/followers#check-if-a-person-is-followed-by-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /user/following/{username}\n    documentation_url: https://docs.github.com/rest/users/followers#follow-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/gpg_keys\n    documentation_url: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /user/gpg_keys\n    documentation_url: https://docs.github.com/rest/users/gpg-keys#create-a-gpg-key-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /user/gpg_keys/{gpg_key_id}\n    documentation_url: https://docs.github.com/rest/users/gpg-keys#delete-a-gpg-key-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/gpg_keys/{gpg_key_id}\n    documentation_url: https://docs.github.com/rest/users/gpg-keys#get-a-gpg-key-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/installations\n    documentation_url: https://docs.github.com/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/installations/{installation_id}/repositories\n    documentation_url: https://docs.github.com/rest/apps/installations#list-repositories-accessible-to-the-user-access-token\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /user/installations/{installation_id}/repositories/{repository_id}\n    documentation_url: https://docs.github.com/rest/apps/installations#remove-a-repository-from-an-app-installation\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /user/installations/{installation_id}/repositories/{repository_id}\n    documentation_url: https://docs.github.com/rest/apps/installations#add-a-repository-to-an-app-installation\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /user/interaction-limits\n    documentation_url: https://docs.github.com/rest/interactions/user#remove-interaction-restrictions-from-your-public-repositories\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /user/interaction-limits\n    documentation_url: https://docs.github.com/rest/interactions/user#get-interaction-restrictions-for-your-public-repositories\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: PUT /user/interaction-limits\n    documentation_url: https://docs.github.com/rest/interactions/user#set-interaction-restrictions-for-your-public-repositories\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /user/issues\n    documentation_url: https://docs.github.com/rest/issues/issues#list-user-account-issues-assigned-to-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/keys\n    documentation_url: https://docs.github.com/rest/users/keys#list-public-ssh-keys-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /user/keys\n    documentation_url: https://docs.github.com/rest/users/keys#create-a-public-ssh-key-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /user/keys/{key_id}\n    documentation_url: https://docs.github.com/rest/users/keys#delete-a-public-ssh-key-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/keys/{key_id}\n    documentation_url: https://docs.github.com/rest/users/keys#get-a-public-ssh-key-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/marketplace_purchases\n    documentation_url: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /user/marketplace_purchases/stubbed\n    documentation_url: https://docs.github.com/rest/apps/marketplace#list-subscriptions-for-the-authenticated-user-stubbed\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /user/memberships/orgs\n    documentation_url: https://docs.github.com/rest/orgs/members#list-organization-memberships-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/memberships/orgs/{org}\n    documentation_url: https://docs.github.com/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /user/memberships/orgs/{org}\n    documentation_url: https://docs.github.com/rest/orgs/members#update-an-organization-membership-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/migrations\n    documentation_url: https://docs.github.com/rest/migrations/users#list-user-migrations\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /user/migrations\n    documentation_url: https://docs.github.com/rest/migrations/users#start-a-user-migration\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/migrations/{migration_id}\n    documentation_url: https://docs.github.com/rest/migrations/users#get-a-user-migration-status\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: DELETE /user/migrations/{migration_id}/archive\n    documentation_url: https://docs.github.com/rest/migrations/users#delete-a-user-migration-archive\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /user/migrations/{migration_id}/archive\n    documentation_url: https://docs.github.com/rest/migrations/users#download-a-user-migration-archive\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock\n    documentation_url: https://docs.github.com/rest/migrations/users#unlock-a-user-repository\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /user/migrations/{migration_id}/repositories\n    documentation_url: https://docs.github.com/rest/migrations/users#list-repositories-for-a-user-migration\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/orgs\n    documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/packages\n    documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-the-authenticated-users-namespace\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /user/packages/{package_type}/{package_name}\n    documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/packages/{package_type}/{package_name}\n    documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /user/packages/{package_type}/{package_name}/restore\n    documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/packages/{package_type}/{package_name}/versions\n    documentation_url: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}\n    documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-version-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}\n    documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-version-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\n    documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-version-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /user/projects\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/projects-classic/projects#create-a-user-project\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: GET /user/public_emails\n    documentation_url: https://docs.github.com/rest/users/emails#list-public-email-addresses-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/repos\n    documentation_url: https://docs.github.com/rest/repos/repos#list-repositories-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /user/repos\n    documentation_url: https://docs.github.com/rest/repos/repos#create-a-repository-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/repository_invitations\n    documentation_url: https://docs.github.com/rest/collaborators/invitations#list-repository-invitations-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /user/repository_invitations/{invitation_id}\n    documentation_url: https://docs.github.com/rest/collaborators/invitations#decline-a-repository-invitation\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /user/repository_invitations/{invitation_id}\n    documentation_url: https://docs.github.com/rest/collaborators/invitations#accept-a-repository-invitation\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /user/social_accounts\n    documentation_url: https://docs.github.com/rest/users/social-accounts#delete-social-accounts-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/social_accounts\n    documentation_url: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /user/social_accounts\n    documentation_url: https://docs.github.com/rest/users/social-accounts#add-social-accounts-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/ssh_signing_keys\n    documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /user/ssh_signing_keys\n    documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#create-a-ssh-signing-key-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /user/ssh_signing_keys/{ssh_signing_key_id}\n    documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#delete-an-ssh-signing-key-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/ssh_signing_keys/{ssh_signing_key_id}\n    documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#get-an-ssh-signing-key-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/starred\n    documentation_url: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /user/starred/{owner}/{repo}\n    documentation_url: https://docs.github.com/rest/activity/starring#unstar-a-repository-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/starred/{owner}/{repo}\n    documentation_url: https://docs.github.com/rest/activity/starring#check-if-a-repository-is-starred-by-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /user/starred/{owner}/{repo}\n    documentation_url: https://docs.github.com/rest/activity/starring#star-a-repository-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/subscriptions\n    documentation_url: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/teams\n    documentation_url: https://docs.github.com/rest/teams/teams#list-teams-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /user/{account_id}\n    documentation_url: https://docs.github.com/rest/users/users#get-a-user-using-their-id\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /user/{user_id}/projectsV2/{project_number}/drafts\n    documentation_url: https://docs.github.com/rest/projects/drafts#create-draft-item-for-user-owned-project\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users\n    documentation_url: https://docs.github.com/rest/users/users#list-users\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /users/{user_id}/projectsV2/{project_number}/views\n    documentation_url: https://docs.github.com/rest/projects/views#create-a-view-for-a-user-owned-project\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}\n    documentation_url: https://docs.github.com/rest/users/users#get-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /users/{username}/attestations/bulk-list\n    documentation_url: https://docs.github.com/rest/users/attestations#list-attestations-by-bulk-subject-digests\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: POST /users/{username}/attestations/delete-request\n    documentation_url: https://docs.github.com/rest/users/attestations#delete-attestations-in-bulk\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: DELETE /users/{username}/attestations/digest/{subject_digest}\n    documentation_url: https://docs.github.com/rest/users/attestations#delete-attestations-by-subject-digest\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: DELETE /users/{username}/attestations/{attestation_id}\n    documentation_url: https://docs.github.com/rest/users/attestations#delete-attestations-by-id\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /users/{username}/attestations/{subject_digest}\n    documentation_url: https://docs.github.com/rest/users/attestations#list-attestations\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /users/{username}/docker/conflicts\n    documentation_url: https://docs.github.com/rest/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/events\n    documentation_url: https://docs.github.com/rest/activity/events#list-events-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/events/orgs/{org}\n    documentation_url: https://docs.github.com/rest/activity/events#list-organization-events-for-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/events/public\n    documentation_url: https://docs.github.com/rest/activity/events#list-public-events-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/followers\n    documentation_url: https://docs.github.com/rest/users/followers#list-followers-of-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/following\n    documentation_url: https://docs.github.com/rest/users/followers#list-the-people-a-user-follows\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/following/{target_user}\n    documentation_url: https://docs.github.com/rest/users/followers#check-if-a-user-follows-another-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/gists\n    documentation_url: https://docs.github.com/rest/gists/gists#list-gists-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/gpg_keys\n    documentation_url: https://docs.github.com/rest/users/gpg-keys#list-gpg-keys-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/hovercard\n    documentation_url: https://docs.github.com/rest/users/users#get-contextual-information-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/installation\n    documentation_url: https://docs.github.com/rest/apps/apps#get-a-user-installation-for-the-authenticated-app\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/keys\n    documentation_url: https://docs.github.com/rest/users/keys#list-public-keys-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/orgs\n    documentation_url: https://docs.github.com/rest/orgs/orgs#list-organizations-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/packages\n    documentation_url: https://docs.github.com/rest/packages/packages#list-packages-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /users/{username}/packages/{package_type}/{package_name}\n    documentation_url: https://docs.github.com/rest/packages/packages#delete-a-package-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/packages/{package_type}/{package_name}\n    documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /users/{username}/packages/{package_type}/{package_name}/restore\n    documentation_url: https://docs.github.com/rest/packages/packages#restore-a-package-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/packages/{package_type}/{package_name}/versions\n    documentation_url: https://docs.github.com/rest/packages/packages#list-package-versions-for-a-package-owned-by-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}\n    documentation_url: https://docs.github.com/rest/packages/packages#delete-package-version-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}\n    documentation_url: https://docs.github.com/rest/packages/packages#get-a-package-version-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\n    documentation_url: https://docs.github.com/rest/packages/packages#restore-package-version-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/projects\n    documentation_url: https://docs.github.com/enterprise-server@3.16/rest/projects-classic/projects#list-user-projects\n    openapi_files:\n      - descriptions/ghes-3.16/ghes-3.16.json\n  - name: GET /users/{username}/projectsV2\n    documentation_url: https://docs.github.com/rest/projects/projects#list-projects-for-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/projectsV2/{project_number}\n    documentation_url: https://docs.github.com/rest/projects/projects#get-project-for-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/projectsV2/{project_number}/fields\n    documentation_url: https://docs.github.com/rest/projects/fields#list-project-fields-for-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /users/{username}/projectsV2/{project_number}/fields\n    documentation_url: https://docs.github.com/rest/projects/fields#add-field-to-user-owned-project\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/projectsV2/{project_number}/fields/{field_id}\n    documentation_url: https://docs.github.com/rest/projects/fields#get-project-field-for-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/projectsV2/{project_number}/items\n    documentation_url: https://docs.github.com/rest/projects/items#list-items-for-a-user-owned-project\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: POST /users/{username}/projectsV2/{project_number}/items\n    documentation_url: https://docs.github.com/rest/projects/items#add-item-to-user-owned-project\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}\n    documentation_url: https://docs.github.com/rest/projects/items#delete-project-item-for-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/projectsV2/{project_number}/items/{item_id}\n    documentation_url: https://docs.github.com/rest/projects/items#get-an-item-for-a-user-owned-project\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}\n    documentation_url: https://docs.github.com/rest/projects/items#update-project-item-for-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/projectsV2/{project_number}/views/{view_number}/items\n    documentation_url: https://docs.github.com/rest/projects/items#list-items-for-a-user-project-view\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/received_events\n    documentation_url: https://docs.github.com/rest/activity/events#list-events-received-by-the-authenticated-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/received_events/public\n    documentation_url: https://docs.github.com/rest/activity/events#list-public-events-received-by-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/repos\n    documentation_url: https://docs.github.com/rest/repos/repos#list-repositories-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/settings/billing/premium_request/usage\n    documentation_url: https://docs.github.com/rest/billing/usage#get-billing-premium-request-usage-report-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n  - name: GET /users/{username}/settings/billing/usage\n    documentation_url: https://docs.github.com/rest/billing/usage#get-billing-usage-report-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n  - name: GET /users/{username}/settings/billing/usage/summary\n    documentation_url: https://docs.github.com/rest/billing/usage#get-billing-usage-summary-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n  - name: DELETE /users/{username}/site_admin\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#demote-a-site-administrator\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /users/{username}/site_admin\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/social_accounts\n    documentation_url: https://docs.github.com/rest/users/social-accounts#list-social-accounts-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/ssh_signing_keys\n    documentation_url: https://docs.github.com/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/starred\n    documentation_url: https://docs.github.com/rest/activity/starring#list-repositories-starred-by-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /users/{username}/subscriptions\n    documentation_url: https://docs.github.com/rest/activity/watching#list-repositories-watched-by-a-user\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: DELETE /users/{username}/suspended\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#unsuspend-a-user\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: PUT /users/{username}/suspended\n    documentation_url: https://docs.github.com/enterprise-server@3.20/rest/enterprise-admin/users#suspend-a-user\n    openapi_files:\n      - descriptions/ghes-3.20/ghes-3.20.json\n  - name: GET /versions\n    documentation_url: https://docs.github.com/rest/meta/meta#get-all-api-versions\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n  - name: GET /zen\n    documentation_url: https://docs.github.com/rest/meta/meta#get-the-zen-of-github\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.20/ghes-3.20.json\n"
  },
  {
    "path": "otel/go.mod",
    "content": "module github.com/google/go-github/v84/otel\n\ngo 1.25.0\n\nrequire (\n\tgithub.com/google/go-github/v84 v84.0.0\n\tgo.opentelemetry.io/otel v1.42.0\n\tgo.opentelemetry.io/otel/metric v1.42.0\n\tgo.opentelemetry.io/otel/sdk v1.42.0\n\tgo.opentelemetry.io/otel/trace v1.42.0\n)\n\nrequire (\n\tgithub.com/cespare/xxhash/v2 v2.3.0 // indirect\n\tgithub.com/go-logr/logr v1.4.3 // indirect\n\tgithub.com/go-logr/stdr v1.2.2 // indirect\n\tgithub.com/google/go-querystring v1.2.0 // indirect\n\tgithub.com/google/uuid v1.6.0 // indirect\n\tgo.opentelemetry.io/auto/sdk v1.2.1 // indirect\n\tgolang.org/x/sys v0.41.0 // indirect\n)\n\nreplace github.com/google/go-github/v84 => ../\n"
  },
  {
    "path": "otel/go.sum",
    "content": "github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=\ngithub.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=\ngithub.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=\ngithub.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=\ngithub.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=\ngithub.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=\ngithub.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=\ngithub.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/go-querystring v1.2.0 h1:yhqkPbu2/OH+V9BfpCVPZkNmUXhb2gBxJArfhIxNtP0=\ngithub.com/google/go-querystring v1.2.0/go.mod h1:8IFJqpSRITyJ8QhQ13bmbeMBDfmeEJZD5A0egEOmkqU=\ngithub.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=\ngithub.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=\ngithub.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=\ngithub.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=\ngo.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=\ngo.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=\ngo.opentelemetry.io/otel v1.42.0 h1:lSQGzTgVR3+sgJDAU/7/ZMjN9Z+vUip7leaqBKy4sho=\ngo.opentelemetry.io/otel v1.42.0/go.mod h1:lJNsdRMxCUIWuMlVJWzecSMuNjE7dOYyWlqOXWkdqCc=\ngo.opentelemetry.io/otel/metric v1.42.0 h1:2jXG+3oZLNXEPfNmnpxKDeZsFI5o4J+nz6xUlaFdF/4=\ngo.opentelemetry.io/otel/metric v1.42.0/go.mod h1:RlUN/7vTU7Ao/diDkEpQpnz3/92J9ko05BIwxYa2SSI=\ngo.opentelemetry.io/otel/sdk v1.42.0 h1:LyC8+jqk6UJwdrI/8VydAq/hvkFKNHZVIWuslJXYsDo=\ngo.opentelemetry.io/otel/sdk v1.42.0/go.mod h1:rGHCAxd9DAph0joO4W6OPwxjNTYWghRWmkHuGbayMts=\ngo.opentelemetry.io/otel/sdk/metric v1.42.0 h1:D/1QR46Clz6ajyZ3G8SgNlTJKBdGp84q9RKCAZ3YGuA=\ngo.opentelemetry.io/otel/sdk/metric v1.42.0/go.mod h1:Ua6AAlDKdZ7tdvaQKfSmnFTdHx37+J4ba8MwVCYM5hc=\ngo.opentelemetry.io/otel/trace v1.42.0 h1:OUCgIPt+mzOnaUTpOQcBiM/PLQ/Op7oq6g4LenLmOYY=\ngo.opentelemetry.io/otel/trace v1.42.0/go.mod h1:f3K9S+IFqnumBkKhRJMeaZeNk9epyhnCmQh/EysQCdc=\ngo.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=\ngo.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=\ngolang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k=\ngolang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\n"
  },
  {
    "path": "otel/transport.go",
    "content": "// Copyright 2026 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package otel provides OpenTelemetry instrumentation for the go-github client.\npackage otel\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"strconv\"\n\n\t\"github.com/google/go-github/v84/github\"\n\t\"go.opentelemetry.io/otel\"\n\t\"go.opentelemetry.io/otel/attribute\"\n\t\"go.opentelemetry.io/otel/codes\"\n\t\"go.opentelemetry.io/otel/metric\"\n\t\"go.opentelemetry.io/otel/propagation\"\n\t\"go.opentelemetry.io/otel/trace\"\n)\n\nconst (\n\t// instrumentationName is the name of this instrumentation package.\n\tinstrumentationName = \"github.com/google/go-github/v84/otel\"\n)\n\n// Transport is an http.RoundTripper that instrument requests with OpenTelemetry.\ntype Transport struct {\n\tBase   http.RoundTripper\n\tTracer trace.Tracer\n\tMeter  metric.Meter\n}\n\n// NewTransport creates a new OpenTelemetry transport.\nfunc NewTransport(base http.RoundTripper, opts ...Option) *Transport {\n\tif base == nil {\n\t\tbase = http.DefaultTransport\n\t}\n\tt := &Transport{Base: base}\n\tfor _, opt := range opts {\n\t\topt(t)\n\t}\n\tif t.Tracer == nil {\n\t\tt.Tracer = otel.Tracer(instrumentationName)\n\t}\n\tif t.Meter == nil {\n\t\tt.Meter = otel.Meter(instrumentationName)\n\t}\n\treturn t\n}\n\n// RoundTrip implements http.RoundTripper.\nfunc (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) {\n\tctx := req.Context()\n\tspanName := fmt.Sprintf(\"github/%v\", req.Method)\n\t// Start Span\n\tctx, span := t.Tracer.Start(ctx, spanName, trace.WithSpanKind(trace.SpanKindClient))\n\tdefer span.End()\n\n\t// Inject Attributes\n\tspan.SetAttributes(\n\t\tattribute.String(\"http.method\", req.Method),\n\t\tattribute.String(\"http.url\", req.URL.String()),\n\t\tattribute.String(\"http.host\", req.URL.Host),\n\t)\n\n\t// Inject Propagation Headers\n\totel.GetTextMapPropagator().Inject(ctx, propagation.HeaderCarrier(req.Header))\n\n\t// Execute Request\n\tresp, err := t.Base.RoundTrip(req)\n\tif err != nil {\n\t\tspan.RecordError(err)\n\t\tspan.SetStatus(codes.Error, err.Error())\n\t\treturn nil, err\n\t}\n\n\t// Capture response attributes\n\tspan.SetAttributes(attribute.Int(\"http.status_code\", resp.StatusCode))\n\t// Capture GitHub Specifics\n\tif limit := resp.Header.Get(github.HeaderRateLimit); limit != \"\" {\n\t\tif v, err := strconv.Atoi(limit); err == nil {\n\t\t\tspan.SetAttributes(attribute.Int(\"github.rate_limit.limit\", v))\n\t\t}\n\t}\n\tif remaining := resp.Header.Get(github.HeaderRateRemaining); remaining != \"\" {\n\t\tif v, err := strconv.Atoi(remaining); err == nil {\n\t\t\tspan.SetAttributes(attribute.Int(\"github.rate_limit.remaining\", v))\n\t\t}\n\t}\n\tif reset := resp.Header.Get(github.HeaderRateReset); reset != \"\" {\n\t\tspan.SetAttributes(attribute.String(\"github.rate_limit.reset\", reset))\n\t}\n\tif reqID := resp.Header.Get(github.HeaderRequestID); reqID != \"\" {\n\t\tspan.SetAttributes(attribute.String(\"github.request_id\", reqID))\n\t}\n\tif resource := resp.Header.Get(github.HeaderRateResource); resource != \"\" {\n\t\tspan.SetAttributes(attribute.String(\"github.rate_limit.resource\", resource))\n\t}\n\n\tif resp.StatusCode >= 400 {\n\t\tspan.SetStatus(codes.Error, fmt.Sprintf(\"HTTP %v\", resp.StatusCode))\n\t} else {\n\t\tspan.SetStatus(codes.Ok, \"OK\")\n\t}\n\n\treturn resp, nil\n}\n\n// Option applies configuration to Transport.\ntype Option func(*Transport)\n\n// WithTracerProvider configures the TracerProvider.\nfunc WithTracerProvider(tp trace.TracerProvider) Option {\n\treturn func(t *Transport) {\n\t\tt.Tracer = tp.Tracer(instrumentationName)\n\t}\n}\n\n// WithMeterProvider configures the MeterProvider.\nfunc WithMeterProvider(mp metric.MeterProvider) Option {\n\treturn func(t *Transport) {\n\t\tt.Meter = mp.Meter(instrumentationName)\n\t}\n}\n"
  },
  {
    "path": "otel/transport_test.go",
    "content": "// Copyright 2026 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage otel\n\nimport (\n\t\"errors\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"testing\"\n\n\t\"go.opentelemetry.io/otel\"\n\t\"go.opentelemetry.io/otel/attribute\"\n\t\"go.opentelemetry.io/otel/codes\"\n\t\"go.opentelemetry.io/otel/sdk/trace\"\n\t\"go.opentelemetry.io/otel/sdk/trace/tracetest\"\n)\n\ntype mockTransport struct {\n\tResponse *http.Response\n\tErr      error\n}\n\nfunc (m *mockTransport) RoundTrip(_ *http.Request) (*http.Response, error) {\n\tif m.Err != nil {\n\t\treturn nil, m.Err\n\t}\n\t// Return valid response with injected headers\n\tif m.Response != nil {\n\t\treturn m.Response, nil\n\t}\n\treturn &http.Response{StatusCode: 200, Header: make(http.Header)}, nil\n}\n\nfunc TestNewTransport_Defaults(t *testing.T) {\n\tt.Parallel()\n\ttransport := NewTransport(nil)\n\tif transport.Base != http.DefaultTransport {\n\t\tt.Error(\"NewTransport(nil) should result in http.DefaultTransport\")\n\t}\n\tif transport.Tracer == nil {\n\t\tt.Error(\"NewTransport(nil) should set default Tracer\")\n\t}\n\tif transport.Meter == nil {\n\t\tt.Error(\"NewTransport(nil) should set default Meter\")\n\t}\n}\n\nfunc TestRoundTrip_Spans(t *testing.T) {\n\tt.Parallel()\n\t// Setup Trace Provider\n\texporter := tracetest.NewInMemoryExporter()\n\ttp := trace.NewTracerProvider(trace.WithSyncer(exporter))\n\n\t// Setup Headers\n\theaders := http.Header{}\n\theaders.Set(\"X-Ratelimit-Limit\", \"5000\")\n\theaders.Set(\"X-Ratelimit-Remaining\", \"4999\")\n\theaders.Set(\"X-Ratelimit-Reset\", \"1372700873\")\n\theaders.Set(\"X-Github-Request-Id\", \"1234-5678\")\n\theaders.Set(\"X-Ratelimit-Resource\", \"core\")\n\n\tmockResp := &http.Response{\n\t\tStatusCode: 200,\n\t\tHeader:     headers,\n\t}\n\n\ttransport := NewTransport(\n\t\t&mockTransport{Response: mockResp},\n\t\tWithTracerProvider(tp),\n\t)\n\n\treq := httptest.NewRequest(\"GET\", \"https://api.github.com/users/google\", nil)\n\tresp, err := transport.RoundTrip(req)\n\tif err != nil {\n\t\tt.Fatalf(\"RoundTrip failed: %v\", err)\n\t}\n\tif resp.StatusCode != http.StatusOK {\n\t\tt.Errorf(\"Expected status code 200, got %v\", resp.StatusCode)\n\t}\n\tspans := exporter.GetSpans()\n\tif len(spans) != 1 {\n\t\tt.Fatalf(\"Expected 1 span, got %d\", len(spans))\n\t}\n\tspan := spans[0]\n\n\t// Verify Name\n\tif span.Name != \"github/GET\" {\n\t\tt.Errorf(\"Expected span name 'github/GET', got '%v'\", span.Name)\n\t}\n\n\t// Verify Attributes\n\tattrs := make(map[attribute.Key]attribute.Value)\n\tfor _, a := range span.Attributes {\n\t\tattrs[a.Key] = a.Value\n\t}\n\n\texpectedStringAttrs := map[attribute.Key]string{\n\t\t\"http.method\":                \"GET\",\n\t\t\"http.url\":                   \"https://api.github.com/users/google\",\n\t\t\"http.host\":                  \"api.github.com\",\n\t\t\"github.rate_limit.reset\":    \"1372700873\",\n\t\t\"github.request_id\":          \"1234-5678\",\n\t\t\"github.rate_limit.resource\": \"core\",\n\t}\n\n\tfor k, v := range expectedStringAttrs {\n\t\tif got, ok := attrs[k]; !ok || got.AsString() != v {\n\t\t\tt.Errorf(\"Expected attr '%v' = '%v', got '%v'\", k, v, got)\n\t\t}\n\t}\n\n\texpectedIntAttrs := map[attribute.Key]int64{\n\t\t\"http.status_code\":            200,\n\t\t\"github.rate_limit.limit\":     5000,\n\t\t\"github.rate_limit.remaining\": 4999,\n\t}\n\n\tfor k, v := range expectedIntAttrs {\n\t\tif got, ok := attrs[k]; !ok || got.AsInt64() != v {\n\t\t\tt.Errorf(\"Expected attr '%v' = '%v', got '%v'\", k, v, got)\n\t\t}\n\t}\n}\n\nfunc TestRoundTrip_Error(t *testing.T) {\n\tt.Parallel()\n\texporter := tracetest.NewInMemoryExporter()\n\ttp := trace.NewTracerProvider(trace.WithSyncer(exporter))\n\n\tmockErr := errors.New(\"network failure\")\n\ttransport := NewTransport(\n\t\t&mockTransport{Err: mockErr},\n\t\tWithTracerProvider(tp),\n\t)\n\n\treq := httptest.NewRequest(\"POST\", \"https://api.github.com/repos/new\", nil)\n\t_, err := transport.RoundTrip(req)\n\n\tif !errors.Is(err, mockErr) {\n\t\tt.Errorf(\"Expected error '%v', got '%v'\", mockErr, err)\n\t}\n\n\tspans := exporter.GetSpans()\n\tif len(spans) != 1 {\n\t\tt.Fatalf(\"Expected 1 span, got %d\", len(spans))\n\t}\n\tspan := spans[0]\n\n\tif span.Status.Code != codes.Error {\n\t\tt.Errorf(\"Expected span status Error, got %v\", span.Status.Code)\n\t}\n\tif span.Status.Description != \"network failure\" {\n\t\tt.Errorf(\"Expected span description 'network failure', got '%v'\", span.Status.Description)\n\t}\n}\n\nfunc TestRoundTrip_HTTPError(t *testing.T) {\n\tt.Parallel()\n\texporter := tracetest.NewInMemoryExporter()\n\ttp := trace.NewTracerProvider(trace.WithSyncer(exporter))\n\n\tmockResp := &http.Response{\n\t\tStatusCode: 404,\n\t\tHeader:     make(http.Header),\n\t}\n\ttransport := NewTransport(\n\t\t&mockTransport{Response: mockResp},\n\t\tWithTracerProvider(tp),\n\t)\n\n\treq := httptest.NewRequest(\"DELETE\", \"https://api.github.com/user\", nil)\n\t_, err := transport.RoundTrip(req)\n\tif err != nil {\n\t\tt.Fatalf(\"Unexpected error: %v\", err)\n\t}\n\n\tspans := exporter.GetSpans()\n\tspan := spans[0]\n\n\tif span.Status.Code != codes.Error {\n\t\tt.Errorf(\"Expected span status Error, got %v\", span.Status.Code)\n\t}\n\tif span.Status.Description != \"HTTP 404\" {\n\t\tt.Errorf(\"Expected span description 'HTTP 404', got '%v'\", span.Status.Description)\n\t}\n}\n\nfunc TestWithMeterProvider(t *testing.T) {\n\tt.Parallel()\n\tmeter := otel.GetMeterProvider()\n\ttransport := NewTransport(nil, WithMeterProvider(meter))\n\tif transport.Meter == nil {\n\t\tt.Error(\"WithMeterProvider failed to set Meter\")\n\t}\n}\n"
  },
  {
    "path": "scrape/README.md",
    "content": "[![Go Reference](https://pkg.go.dev/badge/github.com/google/go-github/scrape.svg)](https://pkg.go.dev/github.com/google/go-github/scrape)\n\nThe scrape package provides an experimental client for accessing additional\nGitHub data via screen scraping.  It is designed to be a client of last resort\nfor data that cannot be retrieved via the REST or GraphQL APIs.\n\n# What should be added here\n\n**Add only what you need.**  Whereas the main go-github library attempts to\nimplement the entire GitHub REST API, there is little point in trying to do that\nhere.  Certainly, feel free to contribute patches to get data you actually\nneed, but I'd rather not try and provide exhaustive coverage of all GitHub data\nhere.\n\n**Add only what can't be accessed elsewhere.**  If the data can be retrieved\nthrough the REST or GraphQL API, use the appropriate libraries for that.\n\n**Prefer read-only access.**  For now, I'm only focusing on reading data. It\nmight be that writing works fine as well, but it is of course much riskier.\n\n# How to add methods\n\nSee [apps.go](apps.go) for examples of methods that access data.  Basically,\nfetch the contents of the page using `client.get`, and then use goquery to dig\ninto the markup on the page.  Prefer selectors that grab semantic ID or class\nnames, as they are more likely to be stable.\n"
  },
  {
    "path": "scrape/apps.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// apps.go contains functions for accessing data about applications installed\n// on a GitHub organization.\n\npackage scrape\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/PuerkitoBio/goquery\"\n\t\"github.com/google/go-github/v84/github\"\n)\n\n// AppRestrictionsEnabled returns whether the specified organization has\n// restricted third-party application access.\nfunc (c *Client) AppRestrictionsEnabled(org string) (bool, error) {\n\tdoc, err := c.get(\"/organizations/%v/settings/oauth_application_policy\", org)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\ts := doc.Find(\".oauth-application-allowlist svg\").First()\n\tif s.Length() == 0 {\n\t\treturn false, errors.New(\"unable to find expected markup\")\n\t}\n\n\tif s.HasClass(\"octicon-check\") {\n\t\treturn true, nil\n\t}\n\tif s.HasClass(\"octicon-alert\") {\n\t\treturn false, nil\n\t}\n\n\treturn false, errors.New(\"unable to find expected markup\")\n}\n\n// ListOAuthApps lists the reviewed OAuth Applications for the\n// specified organization (whether approved or denied).\nfunc (c *Client) ListOAuthApps(org string) ([]*OAuthApp, error) {\n\tdoc, err := c.get(\"/organizations/%v/settings/oauth_application_policy\", org)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar apps []*OAuthApp\n\tdoc.Find(\".oauth-application-allowlist ul > li\").Each(func(_ int, s *goquery.Selection) {\n\t\tvar app OAuthApp\n\t\tapp.Name = s.Find(\".request-info strong\").First().Text()\n\t\tapp.Description = s.Find(\".request-info .application-description\").Text()\n\n\t\tif editURL, ok := s.Find(\".request-indicator a.edit-link\").Attr(\"href\"); ok {\n\t\t\tapp.ID = intFromLastPathSegment(editURL)\n\t\t}\n\n\t\tif r := s.Find(\".request-indicator .requestor\"); r.Length() > 0 {\n\t\t\tapp.State = OAuthAppRequested\n\t\t\tapp.RequestedBy = r.Text()\n\t\t\tif editURL, ok := s.Find(\".request-indicator a\").Last().Attr(\"href\"); ok {\n\t\t\t\tapp.ID = intFromLastPathSegment(editURL)\n\t\t\t}\n\t\t} else if r := s.Find(\".request-indicator .approved-request\"); r.Length() > 0 {\n\t\t\tapp.State = OAuthAppApproved\n\t\t} else if r := s.Find(\".request-indicator .denied-request\"); r.Length() > 0 {\n\t\t\tapp.State = OAuthAppDenied\n\t\t}\n\t\tapps = append(apps, &app)\n\t})\n\n\treturn apps, nil\n}\n\nfunc intFromLastPathSegment(s string) int {\n\tseg := strings.Split(s, \"/\")\n\tif len(seg) > 0 {\n\t\ti, _ := strconv.Atoi(seg[len(seg)-1])\n\t\treturn i\n\t}\n\treturn 0\n}\n\n// OAuthAppReviewState indicates the current state of a requested OAuth Application.\ntype OAuthAppReviewState int\n\nconst (\n\t// OAuthAppRequested indicates access has been requested, but not reviewed.\n\tOAuthAppRequested OAuthAppReviewState = iota + 1\n\t// OAuthAppApproved indicates access has been approved.\n\tOAuthAppApproved\n\t// OAuthAppDenied indicates access has been denied.\n\tOAuthAppDenied\n)\n\n// OAuthApp represents an OAuth application that has been reviewed for access to organization data.\ntype OAuthApp struct {\n\tID          int\n\tName        string\n\tDescription string\n\tState       OAuthAppReviewState\n\tRequestedBy string\n}\n\n// AppManifest represents a GitHub App manifest, used for preconfiguring\n// GitHub App configuration.\n// c.f. https://docs.github.com/en/apps/sharing-github-apps/registering-a-github-app-from-a-manifest\ntype AppManifest struct {\n\t// The name of the GitHub App.\n\tName *string `json:\"name,omitempty\"`\n\t// Required. The homepage of your GitHub App.\n\tURL *string `json:\"url,omitempty\"`\n\t// The full URL(s) of the endpoint(s) to authenticate users via the GitHub App (Max: 10).\n\tCallbackURLs []string `json:\"callback_urls,omitempty\"`\n\t// Required. The configuration of the GitHub App's webhook.\n\tHookAttributes map[string]string `json:\"hook_attributes,omitempty\"`\n\t// The full URL to redirect to after the person installs the GitHub App.\n\tRedirectURL *string `json:\"redirect_url,omitempty\"`\n\t// A description of the GitHub App.\n\tDescription *string `json:\"description,omitempty\"`\n\t// Set to true when your GitHub App is available to the public or false when\n\t// it is only accessible to the owner of the app.\n\tPublic *bool `json:\"public,omitempty\"`\n\t// The list of events the GitHub App subscribes to.\n\tDefaultEvents []string `json:\"default_events,omitempty\"`\n\t// The set of permissions needed by the GitHub App.\n\tDefaultPermissions *github.InstallationPermissions `json:\"default_permissions,omitempty\"`\n}\n\n// CreateApp creates a new GitHub App with the given manifest configuration.\n// orgName is optional, and if provided, the App will be created within the specified organization.\nfunc (c *Client) CreateApp(m *AppManifest, orgName string) (*http.Response, error) {\n\turl := \"/settings/apps/new\"\n\n\tif orgName != \"\" {\n\t\turl = fmt.Sprintf(\"/organizations/%v/settings/apps/new\", orgName)\n\t}\n\n\tu, err := c.baseURL.Parse(url)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tbody, err := json.Marshal(map[string]*AppManifest{\"manifest\": m})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn c.Client.Post(u.String(), \"json\", bytes.NewReader(body))\n}\n"
  },
  {
    "path": "scrape/apps_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage scrape\n\nimport (\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n\t\"github.com/google/go-github/v84/github\"\n)\n\nfunc Test_AppRestrictionsEnabled(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tdescription string\n\t\ttestFile    string\n\t\torg         string\n\t\twant        bool\n\t}{\n\t\t{\n\t\t\tdescription: \"return true for enabled orgs\",\n\t\t\ttestFile:    \"access-restrictions-enabled.html\",\n\t\t\twant:        true,\n\t\t},\n\t\t{\n\t\t\tdescription: \"return false for disabled orgs\",\n\t\t\ttestFile:    \"access-restrictions-disabled.html\",\n\t\t\twant:        false,\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.description, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tclient, mux := setup(t)\n\n\t\t\tmux.HandleFunc(\"/organizations/o/settings/oauth_application_policy\", func(w http.ResponseWriter, _ *http.Request) {\n\t\t\t\tcopyTestFile(t, w, tt.testFile)\n\t\t\t})\n\n\t\t\tgot, err := client.AppRestrictionsEnabled(\"o\")\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"AppRestrictionsEnabled returned err: %v\", err)\n\t\t\t}\n\t\t\tif want := tt.want; got != want {\n\t\t\t\tt.Errorf(\"AppRestrictionsEnabled returned %t, want %t\", got, want)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc Test_ListOAuthApps(t *testing.T) {\n\tt.Parallel()\n\tclient, mux := setup(t)\n\n\tmux.HandleFunc(\"/organizations/e/settings/oauth_application_policy\", func(w http.ResponseWriter, _ *http.Request) {\n\t\tcopyTestFile(t, w, \"access-restrictions-enabled.html\")\n\t})\n\n\tgot, err := client.ListOAuthApps(\"e\")\n\tif err != nil {\n\t\tt.Fatalf(\"ListOAuthApps(e) returned err: %v\", err)\n\t}\n\twant := []*OAuthApp{\n\t\t{\n\t\t\tID:          22222,\n\t\t\tName:        \"Coveralls\",\n\t\t\tDescription: \"Test coverage history and statistics.\",\n\t\t\tState:       OAuthAppRequested,\n\t\t\tRequestedBy: \"willnorris\",\n\t\t},\n\t\t{\n\t\t\tID:    530107,\n\t\t\tName:  \"Google Cloud Platform\",\n\t\t\tState: OAuthAppApproved,\n\t\t},\n\t\t{\n\t\t\tID:          231424,\n\t\t\tName:        \"GitKraken\",\n\t\t\tDescription: \"An intuitive, cross-platform Git client that doesn't suck, built by @axosoft and made with @nodegit & @ElectronJS.\",\n\t\t\tState:       OAuthAppDenied,\n\t\t},\n\t}\n\tif !cmp.Equal(got, want) {\n\t\tt.Errorf(\"ListOAuthApps(o) returned %v, want %v\", got, want)\n\t}\n}\n\nfunc Test_CreateApp(t *testing.T) {\n\tt.Parallel()\n\tclient, mux := setup(t)\n\n\tmux.HandleFunc(\"/settings/apps/new\", func(w http.ResponseWriter, _ *http.Request) {\n\t\tw.WriteHeader(http.StatusCreated)\n\t})\n\n\tresp, err := client.CreateApp(&AppManifest{\n\t\tURL: github.Ptr(\"https://example.com\"),\n\t\tHookAttributes: map[string]string{\n\t\t\t\"url\": \"https://example.com/hook\",\n\t\t},\n\t}, \"\")\n\tif err != nil {\n\t\tt.Fatalf(\"CreateApp: %v\", err)\n\t}\n\tif got, want := resp.StatusCode, http.StatusCreated; got != want {\n\t\tt.Errorf(\"CreateApp returned status code %v, want %v\", got, want)\n\t}\n}\n\nfunc Test_CreateAppWithOrg(t *testing.T) {\n\tt.Parallel()\n\tclient, mux := setup(t)\n\n\tmux.HandleFunc(\"/organizations/example/apps/settings/new\", func(w http.ResponseWriter, _ *http.Request) {\n\t\tw.WriteHeader(http.StatusCreated)\n\t})\n\n\tif _, err := client.CreateApp(&AppManifest{\n\t\tURL: github.Ptr(\"https://example.com\"),\n\t\tHookAttributes: map[string]string{\n\t\t\t\"url\": \"https://example.com/hook\",\n\t\t},\n\t}, \"example\"); err != nil {\n\t\tt.Fatalf(\"CreateAppWithOrg: %v\", err)\n\t}\n}\n"
  },
  {
    "path": "scrape/example/scrape/main.go",
    "content": "// Copyright 2019 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// The scrape tool demonstrates use of the github.com/google/go-github/scrape\n// package to fetch data from GitHub.  The tool lists whether third-party app\n// restrictions are enabled for an organization, and lists information about\n// OAuth apps requested for the org.\npackage main\n\nimport (\n\t\"bufio\"\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strings\"\n\n\t\"github.com/google/go-github/scrape\"\n)\n\nvar (\n\tusername = flag.String(\"username\", \"\", \"github auth: username\")\n\tpassword = flag.String(\"password\", \"\", \"github auth: password\")\n\totpseed  = flag.String(\"otpseed\", \"\", \"github auth: otp seed\")\n\torg      = flag.String(\"org\", \"\", \"github org to get data for\")\n)\n\nfunc main() {\n\tflag.Parse()\n\n\t// prompt for password and otpseed in case the user didn't want to specify as flags\n\treader := bufio.NewReader(os.Stdin)\n\tif *password == \"\" {\n\t\tfmt.Print(\"password: \")\n\t\t*password, _ = reader.ReadString('\\n')\n\t\t*password = strings.TrimSpace(*password)\n\t}\n\tif *otpseed == \"\" {\n\t\tfmt.Print(\"OTP seed: \")\n\t\t*otpseed, _ = reader.ReadString('\\n')\n\t\t*otpseed = strings.TrimSpace(*otpseed)\n\t}\n\n\tclient := scrape.NewClient(nil)\n\n\tif err := client.Authenticate(*username, *password, *otpseed); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tenabled, err := client.AppRestrictionsEnabled(*org)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"App restrictions enabled for %q: %t\\n\", *org, enabled)\n\n\tapps, err := client.ListOAuthApps(*org)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"OAuth apps for %q: \\n\", *org)\n\tfor _, app := range apps {\n\t\tfmt.Printf(\"\\t%+v\\n\", app)\n\t}\n}\n"
  },
  {
    "path": "scrape/forms.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// forms.go contains logic for parsing and submitting HTML forms.  None of this\n// is specific to go-github in any way, and could easily be pulled out into a\n// general purpose scraping library in the future.\n\npackage scrape\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strings\"\n\n\t\"github.com/PuerkitoBio/goquery\"\n\t\"golang.org/x/net/html\"\n)\n\n// htmlForm represents the basic elements of an HTML Form.\ntype htmlForm struct {\n\t// Action is the URL where the form will be submitted\n\tAction string\n\t// Method is the HTTP method to use when submitting the form\n\tMethod string\n\t// Values contains form values to be submitted\n\tValues url.Values\n}\n\n// parseForms parses and returns all form elements beneath node.  Form values\n// include all input and textarea elements within the form. The values of radio\n// and checkbox inputs are included only if they are checked.\n//\n// In the future, we might want to allow a custom selector to be passed in to\n// further restrict what forms will be returned.\nfunc parseForms(node *html.Node) (forms []*htmlForm) {\n\tif node == nil {\n\t\treturn nil\n\t}\n\n\tdoc := goquery.NewDocumentFromNode(node)\n\tdoc.Find(\"form\").Each(func(_ int, s *goquery.Selection) {\n\t\tform := htmlForm{Values: url.Values{}}\n\t\tform.Action, _ = s.Attr(\"action\")\n\t\tform.Method, _ = s.Attr(\"method\")\n\n\t\ts.Find(\"input\").Each(func(_ int, s *goquery.Selection) {\n\t\t\tname, _ := s.Attr(\"name\")\n\t\t\tif name == \"\" {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\ttyp, _ := s.Attr(\"type\")\n\t\t\ttyp = strings.ToLower(typ)\n\t\t\t_, checked := s.Attr(\"checked\")\n\t\t\tif (typ == \"radio\" || typ == \"checkbox\") && !checked {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvalue, _ := s.Attr(\"value\")\n\t\t\tform.Values.Add(name, value)\n\t\t})\n\t\ts.Find(\"textarea\").Each(func(_ int, s *goquery.Selection) {\n\t\t\tname, _ := s.Attr(\"name\")\n\t\t\tif name == \"\" {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tvalue := s.Text()\n\t\t\tform.Values.Add(name, value)\n\t\t})\n\t\tforms = append(forms, &form)\n\t})\n\n\treturn forms\n}\n\n// fetchAndSubmitForm will fetch the page at urlStr, then parse and submit the first form found.\n// setValues will be called with the parsed form values, allowing the caller to set any custom\n// form values. Form submission will always use the POST method, regardless of the value of the\n// method attribute in the form.  The response from submitting the parsed form is returned.\nfunc fetchAndSubmitForm(client *http.Client, urlStr string, setValues func(url.Values)) (*http.Response, error) {\n\tresp, err := client.Get(urlStr)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error fetching url %q: %v\", urlStr, err)\n\t}\n\n\tdefer resp.Body.Close()\n\troot, err := html.Parse(resp.Body)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error parsing response: %v\", err)\n\t}\n\n\tforms := parseForms(root)\n\tif len(forms) == 0 {\n\t\treturn nil, fmt.Errorf(\"no forms found at %q\", urlStr)\n\t}\n\tform := forms[0]\n\n\tactionURL, err := url.Parse(form.Action)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error parsing form action URL %q: %v\", form.Action, err)\n\t}\n\tactionURL = resp.Request.URL.ResolveReference(actionURL)\n\n\t// allow caller to fill out the form\n\tif setValues != nil {\n\t\tsetValues(form.Values)\n\t}\n\n\tresp, err = client.PostForm(actionURL.String(), form.Values)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error posting form: %v\", err)\n\t}\n\n\treturn resp, nil\n}\n"
  },
  {
    "path": "scrape/forms_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage scrape\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n\t\"golang.org/x/net/html\"\n)\n\nfunc Test_ParseForms(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tdescription string\n\t\thtml        string\n\t\tforms       []*htmlForm\n\t}{\n\t\t{\"no forms\", `<html></html>`, nil},\n\t\t{\"empty form\", `<html><form></form></html>`, []*htmlForm{{Values: url.Values{}}}},\n\t\t{\n\t\t\t\"single form with one value\",\n\t\t\t`<html><form action=\"a\" method=\"m\"><input name=\"n1\" value=\"v1\"></form></html>`,\n\t\t\t[]*htmlForm{{Action: \"a\", Method: \"m\", Values: url.Values{\"n1\": {\"v1\"}}}},\n\t\t},\n\t\t{\n\t\t\t\"two forms\",\n\t\t\t`<html>\n\t\t\t  <form action=\"a1\" method=\"m1\"><input name=\"n1\" value=\"v1\"></form>\n\t\t\t  <form action=\"a2\" method=\"m2\"><input name=\"n2\" value=\"v2\"></form>\n\t\t\t</html>`,\n\t\t\t[]*htmlForm{\n\t\t\t\t{Action: \"a1\", Method: \"m1\", Values: url.Values{\"n1\": {\"v1\"}}},\n\t\t\t\t{Action: \"a2\", Method: \"m2\", Values: url.Values{\"n2\": {\"v2\"}}},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t\"form with radio buttons (none checked)\",\n\t\t\t`<html><form>\n\t\t\t   <input type=\"radio\" name=\"n1\" value=\"v1\">\n\t\t\t   <input type=\"radio\" name=\"n1\" value=\"v2\">\n\t\t\t   <input type=\"radio\" name=\"n1\" value=\"v3\">\n\t\t\t</form></html>`,\n\t\t\t[]*htmlForm{{Values: url.Values{}}},\n\t\t},\n\t\t{\n\t\t\t\"form with radio buttons\",\n\t\t\t`<html><form>\n\t\t\t   <input type=\"radio\" name=\"n1\" value=\"v1\">\n\t\t\t   <input type=\"radio\" name=\"n1\" value=\"v2\">\n\t\t\t   <input type=\"radio\" name=\"n1\" value=\"v3\" checked>\n\t\t\t</form></html>`,\n\t\t\t[]*htmlForm{{Values: url.Values{\"n1\": {\"v3\"}}}},\n\t\t},\n\t\t{\n\t\t\t\"form with checkboxes\",\n\t\t\t`<html><form>\n\t\t\t   <input type=\"checkbox\" name=\"n1\" value=\"v1\" checked>\n\t\t\t   <input type=\"checkbox\" name=\"n2\" value=\"v2\">\n\t\t\t   <input type=\"checkbox\" name=\"n3\" value=\"v3\" checked>\n\t\t\t</form></html>`,\n\t\t\t[]*htmlForm{{Values: url.Values{\"n1\": {\"v1\"}, \"n3\": {\"v3\"}}}},\n\t\t},\n\t\t{\n\t\t\t\"single form with textarea\",\n\t\t\t`<html><form><textarea name=\"n1\">v1</textarea></form></html>`,\n\t\t\t[]*htmlForm{{Values: url.Values{\"n1\": {\"v1\"}}}},\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.description, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tnode, err := html.Parse(strings.NewReader(tt.html))\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"error parsing html: %v\", err)\n\t\t\t}\n\t\t\tif got, want := parseForms(node), tt.forms; !cmp.Equal(got, want) {\n\t\t\t\tt.Errorf(\"parseForms(%q) returned %+v, want %+v\", tt.html, got, want)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc Test_FetchAndSubmitForm(t *testing.T) {\n\tt.Parallel()\n\tclient, mux := setup(t)\n\tvar submitted bool\n\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, _ *http.Request) {\n\t\tfmt.Fprint(w, `<html><form action=\"/submit\">\n\t\t  <input type=\"hidden\" name=\"hidden\" value=\"h\">\n\t\t  <input type=\"text\" name=\"name\">\n\t\t</form></html>`)\n\t})\n\tmux.HandleFunc(\"/submit\", func(_ http.ResponseWriter, r *http.Request) {\n\t\terr := r.ParseForm()\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"error parsing form: %v\", err)\n\t\t}\n\t\twant := url.Values{\"hidden\": {\"h\"}, \"name\": {\"n\"}}\n\t\tif got := r.Form; !cmp.Equal(got, want) {\n\t\t\tt.Errorf(\"submitted form contained values %v, want %v\", got, want)\n\t\t}\n\t\tsubmitted = true\n\t})\n\n\tsetValues := func(values url.Values) { values.Set(\"name\", \"n\") }\n\t_, err := fetchAndSubmitForm(client.Client, client.baseURL.String()+\"/\", setValues)\n\tif err != nil {\n\t\tt.Fatalf(\"fetchAndSubmitForm returned err: %v\", err)\n\t}\n\tif !submitted {\n\t\tt.Error(\"form was never submitted\")\n\t}\n}\n"
  },
  {
    "path": "scrape/go.mod",
    "content": "module github.com/google/go-github/scrape\n\ngo 1.25.0\n\nrequire (\n\tgithub.com/PuerkitoBio/goquery v1.12.0\n\tgithub.com/google/go-cmp v0.7.0\n\tgithub.com/google/go-github/v84 v84.0.0\n\tgithub.com/xlzd/gotp v0.1.0\n\tgolang.org/x/net v0.52.0\n)\n\nrequire (\n\tgithub.com/andybalholm/cascadia v1.3.3 // indirect\n\tgithub.com/google/go-querystring v1.2.0 // indirect\n)\n"
  },
  {
    "path": "scrape/go.sum",
    "content": "github.com/PuerkitoBio/goquery v1.12.0 h1:pAcL4g3WRXekcB9AU/y1mbKez2dbY2AajVhtkO8RIBo=\ngithub.com/PuerkitoBio/goquery v1.12.0/go.mod h1:802ej+gV2y7bbIhOIoPY5sT183ZW0YFofScC4q/hIpQ=\ngithub.com/andybalholm/cascadia v1.3.3 h1:AG2YHrzJIm4BZ19iwJ/DAua6Btl3IwJX+VI4kktS1LM=\ngithub.com/andybalholm/cascadia v1.3.3/go.mod h1:xNd9bqTn98Ln4DwST8/nG+H0yuB8Hmgu1YHNnWw0GeA=\ngithub.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/go-github/v84 v84.0.0 h1:I/0Xn5IuChMe8TdmI2bbim5nyhaRFJ7DEdzmD2w+yVA=\ngithub.com/google/go-github/v84 v84.0.0/go.mod h1:WwYL1z1ajRdlaPszjVu/47x1L0PXukJBn73xsiYrRRQ=\ngithub.com/google/go-querystring v1.2.0 h1:yhqkPbu2/OH+V9BfpCVPZkNmUXhb2gBxJArfhIxNtP0=\ngithub.com/google/go-querystring v1.2.0/go.mod h1:8IFJqpSRITyJ8QhQ13bmbeMBDfmeEJZD5A0egEOmkqU=\ngithub.com/xlzd/gotp v0.1.0 h1:37blvlKCh38s+fkem+fFh7sMnceltoIEBYTVXyoa5Po=\ngithub.com/xlzd/gotp v0.1.0/go.mod h1:ndLJ3JKzi3xLmUProq4LLxCuECL93dG9WASNLpHz8qg=\ngithub.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=\ngolang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=\ngolang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=\ngolang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=\ngolang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=\ngolang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=\ngolang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=\ngolang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=\ngolang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=\ngolang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=\ngolang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=\ngolang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=\ngolang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=\ngolang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=\ngolang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=\ngolang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=\ngolang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=\ngolang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=\ngolang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=\ngolang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=\ngolang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=\ngolang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0=\ngolang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw=\ngolang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=\ngolang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=\ngolang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=\ngolang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=\ngolang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=\ngolang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=\ngolang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=\ngolang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=\ngolang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=\ngolang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=\ngolang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=\ngolang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=\ngolang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=\ngolang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=\ngolang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=\ngolang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=\ngolang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=\ngolang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=\ngolang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=\ngolang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=\ngolang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=\ngolang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=\ngolang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=\ngolang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=\ngolang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=\ngolang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=\ngolang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=\ngolang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=\ngolang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=\ngolang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=\ngolang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=\ngolang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=\ngolang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=\ngolang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=\ngolang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\n"
  },
  {
    "path": "scrape/payment.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// apps.go contains functions for accessing data about applications installed\n// on a GitHub organization.\n\npackage scrape\n\nimport (\n\t\"strings\"\n\n\t\"github.com/PuerkitoBio/goquery\"\n)\n\n// OrgPaymentInformation returns payment information for the specified org.\nfunc (c *Client) OrgPaymentInformation(org string) (PaymentInformation, error) {\n\tvar info PaymentInformation\n\n\tdoc, err := c.get(\"/organizations/%v/settings/billing/payment_information\", org)\n\tif err != nil {\n\t\treturn info, err\n\t}\n\n\tdoc.Find(\"main h4.mb-1\").Each(func(_ int, s *goquery.Selection) {\n\t\tname := strings.TrimSpace(strings.ToLower(s.Text()))\n\t\tvalue := strings.Join(strings.Fields(strings.TrimSpace(s.NextFiltered(\"p\").Text())), \" \")\n\n\t\tswitch name {\n\t\tcase \"payment method\":\n\t\t\tinfo.PaymentMethod = value\n\t\tcase \"last payment\":\n\t\t\tinfo.LastPayment = value\n\t\tcase \"coupon\":\n\t\t\tinfo.Coupon = value\n\t\tcase \"extra information\":\n\t\t\tinfo.ExtraInformation = value\n\t\t}\n\t})\n\n\treturn info, nil\n}\n\n// PaymentInformation for an organization on a paid plan.\ntype PaymentInformation struct {\n\tPaymentMethod    string\n\tLastPayment      string\n\tCoupon           string\n\tExtraInformation string\n}\n"
  },
  {
    "path": "scrape/scrape.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package scrape provides a client for interacting with GitHub using screen\n// scraping.\n//\n// This is intended to be used as a supplement to the standard go-github\n// library to access data that is not currently exposed by either the official\n// REST or GraphQL APIs.\n//\n// Because of the nature of screen scraping, this package should be treated as\n// HIGHLY EXPERIMENTAL, and potentially unstable. We make no promises relating\n// to compatibility or stability of the exported API. Even though this package\n// is distributed as part of the go-github library, it is explicitly exempt\n// from any stability promises that my be implied by the library version\n// number.\npackage scrape\n\nimport (\n\t\"bytes\"\n\t\"encoding/gob\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\t\"net/http/cookiejar\"\n\t\"net/url\"\n\t\"strings\"\n\n\t\"github.com/PuerkitoBio/goquery\"\n\t\"github.com/xlzd/gotp\"\n\t\"golang.org/x/net/publicsuffix\"\n)\n\nvar defaultBaseURL = \"https://github.com/\"\n\n// Client is a GitHub scraping client.\ntype Client struct {\n\t*http.Client\n\n\t// base URL for github.com pages.  Exposed primarily for testing.  Also\n\t// used for saving and restoring cookies on the Client.\n\tbaseURL *url.URL\n}\n\n// NewClient constructs a new Client.  If transport is nil, a default transport is used.\nfunc NewClient(transport http.RoundTripper) *Client {\n\tjar, err := cookiejar.New(&cookiejar.Options{PublicSuffixList: publicsuffix.List})\n\tif err != nil {\n\t\tlog.Fatalf(\"error creating cookiejar: %v\", err)\n\t}\n\tbaseURL, _ := url.Parse(defaultBaseURL)\n\n\treturn &Client{\n\t\tClient: &http.Client{\n\t\t\tTransport: transport,\n\t\t\tJar:       jar,\n\t\t},\n\t\tbaseURL: baseURL,\n\t}\n}\n\n// SaveCookies returns an encoded form of the github.com cookies set on this\n// client.  If Authenticate() has been called, this should include the\n// github.com session cookie.  These cookies can be loaded onto a new client by\n// calling LoadCookies.\n//\n// GitHub session cookies are bearer tokens that are not tied to any particular\n// client, so should be treated with the same sensitivity as the account\n// credentials.\nfunc (c *Client) SaveCookies() ([]byte, error) {\n\tcookies := c.Client.Jar.Cookies(c.baseURL)\n\n\tvar b bytes.Buffer\n\terr := gob.NewEncoder(&b).Encode(cookies)\n\treturn b.Bytes(), err\n}\n\n// LoadCookies loads the provided cookies for github.com.\nfunc (c *Client) LoadCookies(v []byte) error {\n\tvar cookies []*http.Cookie\n\tr := bytes.NewReader(v)\n\terr := gob.NewDecoder(r).Decode(&cookies)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tc.Client.Jar.SetCookies(c.baseURL, cookies)\n\treturn nil\n}\n\n// get fetches a urlStr (a GitHub URL relative to the client's baseURL), and\n// returns the parsed response document.\nfunc (c *Client) get(urlStr string, a ...any) (*goquery.Document, error) {\n\tu, err := c.baseURL.Parse(fmt.Sprintf(urlStr, a...))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error parsing URL: %q: %v\", urlStr, err)\n\t}\n\n\tresp, err := c.Client.Get(u.String())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error fetching url %q: %v\", u, err)\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode == http.StatusNotFound {\n\t\treturn nil, fmt.Errorf(\"received %v response fetching URL %q\", resp.StatusCode, u)\n\t}\n\n\tdoc, err := goquery.NewDocumentFromReader(resp.Body)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error parsing response: %v\", err)\n\t}\n\n\treturn doc, nil\n}\n\n// Authenticate client to GitHub with the provided username, password, and if\n// two-factor auth is enabled for the account, otpseed.\n//\n// otpseed is the OTP Secret provided from GitHub as part of two-factor\n// application enrollment.  When registering the application, click the \"enter\n// this text code\" link on the QR Code page to see the raw OTP Secret.\nfunc (c *Client) Authenticate(username, password, otpseed string) error {\n\tsetPassword := func(values url.Values) {\n\t\tvalues.Set(\"login\", username)\n\t\tvalues.Set(\"password\", password)\n\t}\n\tresp, err := fetchAndSubmitForm(c.Client, \"https://github.com/login\", setPassword)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn fmt.Errorf(\"received %v response submitting login form\", resp.StatusCode)\n\t}\n\n\tif otpseed == \"\" {\n\t\treturn nil\n\t}\n\n\tsetOTP := func(values url.Values) {\n\t\totp := gotp.NewDefaultTOTP(strings.ToUpper(otpseed)).Now()\n\t\tvalues.Set(\"otp\", otp)\n\t}\n\tresp, err = fetchAndSubmitForm(c.Client, \"https://github.com/sessions/two-factor\", setOTP)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn fmt.Errorf(\"received %v response submitting otp form\", resp.StatusCode)\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "scrape/scrape_test.go",
    "content": "// Copyright 2013 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage scrape\n\nimport (\n\t\"io\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"net/url\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n)\n\n// set up a test HTTP server along with a scrape.Client that is configured to\n// talk to that test server. Tests should register handlers on the mux which\n// provide mock responses for the GitHub pages being tested.\nfunc setup(t *testing.T) (client *Client, mux *http.ServeMux) {\n\tt.Helper()\n\tmux = http.NewServeMux()\n\tserver := httptest.NewServer(mux)\n\n\tclient = NewClient(nil)\n\tclient.baseURL, _ = url.Parse(server.URL + \"/\")\n\n\tt.Cleanup(server.Close)\n\n\treturn client, mux\n}\n\nfunc copyTestFile(t *testing.T, w io.Writer, filename string) {\n\tt.Helper()\n\tf, err := os.Open(filepath.Join(\"testdata\", filename))\n\tif err != nil {\n\t\tt.Fatalf(\"unable to open test file: %v\", err)\n\t}\n\t_, err = io.Copy(w, f)\n\tif err != nil {\n\t\tt.Errorf(\"failure copying test file: %v\", err)\n\t}\n\terr = f.Close()\n\tif err != nil {\n\t\tt.Errorf(\"failure closing test file: %v\", err)\n\t}\n}\n"
  },
  {
    "path": "scrape/testdata/access-restrictions-disabled.html",
    "content": "<!-- fetched from https://github.com/organizations/google-test3/settings/oauth_application_policy on 2019-10-15\n     Some extraneous markup removed to keep the file size smaller -->\n<html lang=\"en\">\n  <body class=\"logged-in env-production min-width-lg\">\n\n  <div class=\"application-main \" data-commit-hovercards-enabled>\n      <main id=\"js-pjax-container\" data-pjax-container>\n\n<div itemscope itemtype=\"http://schema.org/Organization\">\n\n  <div class=\"container-lg px-3 d-flex\">\n\n    <div class=\"col-9\">\n\n  <div class=\"boxed-group oauth-application-allowlist \">\n    <h3>Third-party application access policy</h3>\n    <div class=\"boxed-group-inner\">\n        <p>\n          Policy: <strong>No restrictions</strong> <svg class=\"octicon octicon-alert\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path fill-rule=\"evenodd\" d=\"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z\"/></svg>\n        </p>\n        <p>\n          All applications authorized by organization members have access to <strong>google-test</strong>’s data.\n        </p>\n        <a class=\"btn\" href=\"/organizations/google-test/settings/oauth_application_policy/confirm\">Setup application access restrictions</a>\n      <p class=\"help\">\n        <svg class=\"octicon octicon-question\" viewBox=\"0 0 14 16\" version=\"1.1\" width=\"14\" height=\"16\" aria-hidden=\"true\"><path fill-rule=\"evenodd\" d=\"M6 10h2v2H6v-2zm4-3.5C10 8.64 8 9 8 9H6c0-.55.45-1 1-1h.5c.28 0 .5-.22.5-.5v-1c0-.28-.22-.5-.5-.5h-1c-.28 0-.5.22-.5.5V7H4c0-1.5 1.5-3 3-3s3 1 3 2.5zM7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7z\"/></svg>\n        When authorized, applications can act on behalf of organization members. Your access policy determines which applications can access data in your organization. <a href=\"https://help.github.com/articles/about-third-party-application-restrictions/\">Read more about third-party access and organizations.</a>\n      </p>\n    </div>\n  </div>\n\n    </div>\n  </div>\n</div>\n\n      </main>\n  </div>\n  </body>\n</html>\n"
  },
  {
    "path": "scrape/testdata/access-restrictions-enabled.html",
    "content": "<!-- fetched from https://github.com/organizations/google-test3/settings/oauth_application_policy on 2019-10-15\n     Some extraneous markup removed to keep the file size smaller -->\n<html lang=\"en\">\n  <body class=\"logged-in env-production min-width-lg\">\n\n  <div class=\"application-main \" data-commit-hovercards-enabled>\n      <main id=\"js-pjax-container\" data-pjax-container>\n\n\n\n<div itemscope itemtype=\"http://schema.org/Organization\">\n\n  <div class=\"container-lg px-3 d-flex\">\n\n    <div class=\"col-9\">\n\n  <div class=\"boxed-group oauth-application-allowlist is-selectable\">\n    <h3>Third-party application access policy</h3>\n    <div class=\"boxed-group-inner\">\n        <p>\n          Policy: <strong>Access restricted</strong> <svg class=\"octicon octicon-check\" viewBox=\"0 0 12 16\" version=\"1.1\" width=\"12\" height=\"16\" aria-hidden=\"true\"><path fill-rule=\"evenodd\" d=\"M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5L12 5z\"/></svg>\n        </p>\n        <p>\n          Only approved applications can access data in this organization. Applications owned by <strong>google-test</strong> always have access.\n        </p>\n\n<details\n  class=\"details-reset details-overlay details-overlay-dark lh-default text-gray-dark d-inline-block text-left\"\n  >\n  <summary\n      class=\"btn btn-danger\"\n\n\n\n\n      >\n\n    Remove restrictions\n  </summary>\n  <details-dialog\n    aria-label=\"Are you sure?\"\n    class=\"Box Box--overlay d-flex flex-column anim-fade-in fast \"\n\n    >\n    <div class=\"Box-header\">\n      <button class=\"Box-btn-octicon btn-octicon float-right\" type=\"button\" aria-label=\"Close dialog\" data-close-dialog>\n        <svg class=\"octicon octicon-x\" viewBox=\"0 0 12 16\" version=\"1.1\" width=\"12\" height=\"16\" aria-hidden=\"true\"><path fill-rule=\"evenodd\" d=\"M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48L7.48 8z\"/></svg>\n      </button>\n      <h3 class=\"Box-title \">Are you sure?</h3>\n    </div>\n\n          <div class=\"flash flash-full flash-warn\">\n            You’re about to remove all third-party application restrictions. Please read this carefully.\n          </div>\n          <div class=\"Box-body\">\n            <p>Removing third-party application restrictions will immediately give member authorized applications access to private data in the <strong>google-test</strong> organization.</p>\n            <p class=\"mb-0\">Please be sure you want to do this.</p>\n          </div>\n          <div class=\"Box-footer\">\n            <!-- '\"` --><!-- </textarea></xmp> --></option></form><form action=\"/orgs/google-test/application_access\" accept-charset=\"UTF-8\" method=\"post\"><input name=\"utf8\" type=\"hidden\" value=\"&#x2713;\" /><input type=\"hidden\" name=\"_method\" value=\"put\" /><input type=\"hidden\" name=\"authenticity_token\" value=\"S2KgMWzbT4gdPkJs7vxVqfwsObkhjk+bto0ulPixFALoIG2N9rlX7UhmoSm/H6uk9VIccrTHnr7WTBOFtlTogQ==\" />\n              <input type=\"hidden\" name=\"restrict_access\" id=\"restrict_access\" value=\"off\" class=\"form-control\" />\n              <button type=\"submit\" class=\"btn btn-block btn-danger\">\n                Yes, remove application restrictions\n              </button>\n</form>          </div>\n\n  </details-dialog>\n</details>\n          <ul class=\"boxed-group-list\">\n            <li>\n              <div class=\"float-right request-indicator\">\n                Approval requested by <a class=\"requestor\" href=\"/willnorris\">willnorris</a> &#8212;\n                <a href=\"/orgs/google-test/policies/applications/22222\">Review</a>\n              </div>\n              <img class=\"avatar float-left\" src=\"https://avatars3.githubusercontent.com/oa/22222?s=40&amp;u=90a5890234f8061be4c6c0b29b4fa7594f2ba2d7&amp;v=4\" height=\"20\" width=\"20\" alt=\"\" />\n              <span class=\"request-info js-details-container Details\">\n                <strong title=\"Coveralls\">Coveralls</strong> <span class=\"hidden-text-expander inline\"><button type=\"button\" class=\"ellipsis-expander js-details-target\" aria-expanded=\"false\">&hellip;</button></span> <span class=\"application-description\">Test coverage history and statistics.</span>\n              </span>\n            </li>\n            <li>\n              <span class=\"float-right request-indicator\">\n                <span class=\"approved-request\">\n                  <svg class=\"octicon octicon-check\" viewBox=\"0 0 12 16\" version=\"1.1\" width=\"12\" height=\"16\" aria-hidden=\"true\"><path fill-rule=\"evenodd\" d=\"M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5L12 5z\"/></svg> Approved</span> &#8212; <a class=\"edit-link\" href=\"/orgs/google-test/policies/applications/530107\">\n                    <svg aria-label=\"Update policy\" class=\"octicon octicon-pencil\" viewBox=\"0 0 14 16\" version=\"1.1\" width=\"14\" height=\"16\" role=\"img\"><path fill-rule=\"evenodd\" d=\"M0 12v3h3l8-8-3-3-8 8zm3 2H1v-2h1v1h1v1zm10.3-9.3L12 6 9 3l1.3-1.3a.996.996 0 0 1 1.41 0l1.59 1.59c.39.39.39 1.02 0 1.41z\"/></svg>\n</a>              </span>\n              <img class=\"avatar float-left\" src=\"https://avatars0.githubusercontent.com/oa/530107?s=40&amp;u=c2e8a853e3ef18a65cc0d3628cb3d1c12363ea90&amp;v=4\" height=\"20\" width=\"20\" alt=\"\" />\n              <span class=\"request-info js-details-container Details\">\n                <strong title=\"Google Cloud Platform\">Google Cloud Platform</strong>\n              </span>\n            </li>\n            <li>\n              <span class=\"float-right request-indicator\">\n                <span class=\"denied-request\">\n                  <svg class=\"octicon octicon-x\" viewBox=\"0 0 12 16\" version=\"1.1\" width=\"12\" height=\"16\" aria-hidden=\"true\"><path fill-rule=\"evenodd\" d=\"M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48L7.48 8z\"/></svg> Denied</span> &#8212; <a class=\"edit-link\" href=\"/orgs/google-test/policies/applications/231424\">\n                    <svg aria-label=\"Update policy\" class=\"octicon octicon-pencil\" viewBox=\"0 0 14 16\" version=\"1.1\" width=\"14\" height=\"16\" role=\"img\"><path fill-rule=\"evenodd\" d=\"M0 12v3h3l8-8-3-3-8 8zm3 2H1v-2h1v1h1v1zm10.3-9.3L12 6 9 3l1.3-1.3a.996.996 0 0 1 1.41 0l1.59 1.59c.39.39.39 1.02 0 1.41z\"/></svg>\n</a>              </span>\n              <img class=\"avatar float-left\" src=\"https://avatars2.githubusercontent.com/oa/231424?s=40&amp;u=136599829eeacb9107cf422a684d11c5757c0eee&amp;v=4\" height=\"20\" width=\"20\" alt=\"\" />\n              <span class=\"request-info js-details-container Details\">\n                <strong title=\"GitKraken\">GitKraken</strong> <span class=\"hidden-text-expander inline\"><button type=\"button\" class=\"ellipsis-expander js-details-target\" aria-expanded=\"false\">&hellip;</button></span> <span class=\"application-description\">An intuitive, cross-platform Git client that doesn&#39;t suck, built by @axosoft and made with @nodegit &amp; @ElectronJS.</span>\n              </span>\n            </li>\n          </ul>\n      <p class=\"help\">\n        <svg class=\"octicon octicon-question\" viewBox=\"0 0 14 16\" version=\"1.1\" width=\"14\" height=\"16\" aria-hidden=\"true\"><path fill-rule=\"evenodd\" d=\"M6 10h2v2H6v-2zm4-3.5C10 8.64 8 9 8 9H6c0-.55.45-1 1-1h.5c.28 0 .5-.22.5-.5v-1c0-.28-.22-.5-.5-.5h-1c-.28 0-.5.22-.5.5V7H4c0-1.5 1.5-3 3-3s3 1 3 2.5zM7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7z\"/></svg>\n        When authorized, applications can act on behalf of organization members. Your access policy determines which applications can access data in your organization. <a href=\"https://help.github.com/articles/about-third-party-application-restrictions/\">Read more about third-party access and organizations.</a>\n      </p>\n    </div>\n  </div>\n\n    </div>\n  </div>\n</div>\n\n      </main>\n  </div>\n  </body>\n</html>\n"
  },
  {
    "path": "script/fmt.sh",
    "content": "#!/bin/sh\n#/ script/fmt.sh runs formatting on all Go files in the project.\n#/ It uses custom golangci-lint to format the code.\n\nset -e\n\nCUSTOM_GCL=\"$(script/setup-custom-gcl.sh)\"\n\nCDPATH=\"\" cd -- \"$(dirname -- \"$0\")/..\"\n\nMOD_DIRS=\"$(git ls-files '*go.mod' | xargs dirname | sort)\"\n\nfor dir in $MOD_DIRS; do\n  (\n    cd \"$dir\"\n    \"$CUSTOM_GCL\" fmt\n  )\ndone\n"
  },
  {
    "path": "script/generate.sh",
    "content": "#!/bin/sh\n#/ `script/generate.sh` runs `go generate` on all modules in this repo.\n#/ It also runs `script/run-check-structfield-settings.sh -fix` to keep linter\n#/ exceptions in `.golangci.yml` up to date.\n#/ `script/generate.sh --check` checks that the generated files are up to date.\n\nset -e\n\nCDPATH=\"\" cd -- \"$(dirname -- \"$0\")/..\"\n\nif [ \"$1\" = \"--check\" ]; then\n  GENTEMP=\"$(mktemp -d)\"\n  git worktree add -q --detach \"$GENTEMP\"\n  trap 'git worktree remove -f \"$GENTEMP\"; rm -rf \"$GENTEMP\"' EXIT\n  git diff --name-only --diff-filter=D --no-renames HEAD | while read -r f; do\n    rm -f \"$GENTEMP/$f\"\n  done\n  git ls-files -com --exclude-standard | while read -r f; do\n    target=\"$GENTEMP/$f\"\n    mkdir -p \"$(dirname -- \"$target\")\"\n    cp \"$f\" \"$target\"\n  done\n  if [ -f \"$(pwd)\"/bin ]; then\n    ln -s \"$(pwd)\"/bin \"$GENTEMP\"/bin\n  fi\n  (\n    cd \"$GENTEMP\"\n    git add .\n    git -c user.name='bot' -c user.email='bot@localhost' -c commit.gpgsign=false commit -m \"generate\" -q --allow-empty\n    script/generate.sh\n    [ -z \"$(git status --porcelain)\" ] || {\n      msg=\"Generated files are out of date. Please run script/generate.sh and commit the results\"\n      if [ -n \"$GITHUB_ACTIONS\" ]; then\n        echo \"::error ::$msg\"\n      else\n        echo \"$msg\" 1>&2\n      fi\n      git diff\n      exit 1\n    }\n  )\n  exit 0\nfi\n\nMOD_DIRS=\"$(git ls-files '*go.mod' | xargs dirname | sort)\"\n\nfor dir in $MOD_DIRS; do\n  (\n    cd \"$dir\"\n    go generate ./...\n    go mod tidy\n  )\ndone\nscript/run-check-structfield-settings.sh -fix\n"
  },
  {
    "path": "script/lint.sh",
    "content": "#!/bin/sh\n#/ [ CHECK_GITHUB_OPENAPI=1 ] script/lint.sh runs linters and validates generated files.\n#/ When CHECK_GITHUB is set, it validates that openapi_operations.yaml is consistent with the\n#/ descriptions from github.com/github/rest-api-description.\n\nset -e\n\nCUSTOM_GCL=\"$(script/setup-custom-gcl.sh)\"\n\nCDPATH=\"\" cd -- \"$(dirname -- \"$0\")/..\"\n\nEXIT_CODE=0\n\n# Colors & Formatting\nGREEN='\\033[0;32m'\nRED='\\033[0;31m'\nYELLOW='\\033[0;33m'\nBOLD='\\033[1m'\nNC='\\033[0m'\n\nfail() {\n  EXIT_CODE=1\n}\n\nMOD_DIRS=\"$(git ls-files '*go.mod' | xargs dirname | sort -u)\"\n\n# Number of module lint jobs to run concurrently.\n# Override with LINT_JOBS, otherwise use detected CPU count.\n: \"${LINT_JOBS:=$(getconf _NPROCESSORS_ONLN 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4)}\"\n\nLINT_DIRS=\"$(printf '%s\\n' \"$MOD_DIRS\" | grep -v '^example/newreposecretwithlibsodium$')\"\n\nFAILED_COUNT=0\nLINT_FAILED=0\nRUNNING=0\nPIDS=\"\"\nDIRS_IN_FLIGHT=\"\"\n\nLOG_DIR=\"$(mktemp -d)\"\ntrap 'rm -rf \"$LOG_DIR\"' EXIT\n\n# --- Helper Functions ---\nprint_header() {\n  printf \"${BOLD}%s${NC}\\n\\n\" \"$1\"\n}\n\n\nwait_pids() {\n  i=1\n  for pid in $PIDS; do\n    # Identify the directory for this PID\n    dir=$(echo \"$DIRS_IN_FLIGHT\" | awk -v i=\"$i\" '{print $i}')\n    log_file=\"$LOG_DIR/$(echo \"$dir\" | tr '/' '_').log\"\n    \n    if wait \"$pid\"; then\n      printf \"${GREEN}✔ %-40s [ PASS ]${NC}\\n\" \"$dir\"\n    else\n      printf \"${RED}✘ %-40s [ FAIL ]${NC}\\n\" \"$dir\"\n      if [ -f \"$log_file\" ]; then\n        sed 's/^/    /' \"$log_file\"\n      fi\n      FAILED_COUNT=$((FAILED_COUNT + 1))\n      fail\n    fi\n    i=$((i + 1))\n  done\n  PIDS=\"\"\n  DIRS_IN_FLIGHT=\"\"\n  RUNNING=0\n}\n\nprint_header \"Linting modules\"\n\nfor dir in $LINT_DIRS; do\n  log_file=\"$LOG_DIR/$(echo \"$dir\" | tr '/' '_').log\"\n\n  # Run the linter in the background and redirect output to a log file\n  (cd \"$dir\" && \"$CUSTOM_GCL\" run --color always > \"$log_file\" 2>&1) &\n\n  PIDS=\"$PIDS $!\"\n  DIRS_IN_FLIGHT=\"$DIRS_IN_FLIGHT $dir\"\n  RUNNING=$((RUNNING + 1))\n\n  if [ \"$RUNNING\" -ge \"$LINT_JOBS\" ]; then\n    wait_pids\n  fi\ndone\n\nwait_pids\n\nif [ -n \"$CHECK_GITHUB_OPENAPI\" ]; then\n  print_header \"Validating openapi_operations.yaml\"\n  if script/metadata.sh update-openapi --validate; then\n    printf \"${GREEN}✔ openapi_operations.yaml is valid${NC}\\n\"\n  else\n    printf \"${RED}✘ openapi_operations.yaml validation failed${NC}\\n\"\n    fail\n  fi\nfi\n\nprint_header \"Validating generated files\"\nif script/generate.sh --check; then\n  printf \"${GREEN}✔ Generated files are up to date${NC}\\n\"\nelse\n  printf \"${RED}✘ Generated files out of sync${NC}\\n\"\n  fail\nfi\n\n# --- Final Summary ---\nprintf -- \"----------------------------\\n\"\nSUMMARY_COLOR=\"$GREEN\"\nif [ \"$FAILED_COUNT\" -gt 0 ]; then\n  SUMMARY_COLOR=\"$RED\"\nfi\n\nprintf \"%bLinting: issues found in %d module directories.%b\\n\" \"$SUMMARY_COLOR\" \"$FAILED_COUNT\" \"$NC\"\nprintf -- \"--------------------------------------------\\n\"\n\nexit \"$EXIT_CODE\"\n"
  },
  {
    "path": "script/metadata.sh",
    "content": "#!/bin/sh\n#/ script/metadata.sh runs ./tools/metadata in the repository root with the given arguments\n\nset -e\n\nCDPATH=\"\" cd -- \"$(dirname -- \"$0\")/..\"\nREPO_DIR=\"$(pwd)\"\n\n(\n  cd tools/metadata\n  go build -o \"$REPO_DIR\"/bin/metadata\n)\n\nexec bin/metadata \"$@\"\n"
  },
  {
    "path": "script/run-check-structfield-settings.sh",
    "content": "#!/bin/bash -e\ngo run -C tools/check-structfield-settings  . \"$@\"\n"
  },
  {
    "path": "script/setup-custom-gcl.sh",
    "content": "#!/bin/sh\n#/ script/setup-custom-gcl.sh ensures custom golangci-lint is installed.\n#/ It returns the path to the custom-gcl binary.\n\nset -e\n\nROOT_DIR=\"$(cd -- \"$(dirname -- \"$0\")/..\" > /dev/null 2>&1 && pwd -P)\"\nCUSTOM_GCL_CONFIG=\"$ROOT_DIR/.custom-gcl.yml\"\nGOLANGCI_LINT_VERSION=\"$(\n  sed -n 's/^[[:space:]]*version:[[:space:]]*//p' \"$CUSTOM_GCL_CONFIG\" \\\n  | sed '1{s/[[:space:]]*#.*$//;s/^\"//;s/\"$//;s/[[:space:]]*$//;p;};d'\n)\"\n\nif [ -z \"$GOLANGCI_LINT_VERSION\" ]; then\n  echo \"Error: could not determine golangci-lint version from $CUSTOM_GCL_CONFIG\" >&2\n  exit 1\nfi\n\nBIN=\"$ROOT_DIR/bin\"\n\nmkdir -p \"$BIN\"\n\n# install golangci-lint and custom-gcl in ./bin if they don't exist with the correct version\nif ! \"$BIN\"/custom-gcl version --short 2> /dev/null | grep -q \"$GOLANGCI_LINT_VERSION\"; then\n  curl -sSfL https://golangci-lint.run/install.sh | sh -s -- -b \"$BIN\" \"$GOLANGCI_LINT_VERSION\"\n  \"$BIN\"/golangci-lint custom --name custom-gcl --destination \"$BIN\"\nfi\n\necho \"$BIN/custom-gcl\"\n"
  },
  {
    "path": "script/test.sh",
    "content": "#!/bin/sh\n#/ script/test.sh runs tests on each go module in go-github. Arguments are passed to each go test invocation.\n#/ \"-race -covermode atomic ./...\" is used when no arguments are given.\n#/\n#/ When UPDATE_GOLDEN is set, all directories named \"golden\" are removed before running tests.\n\nset -e\n\nCDPATH=\"\" cd -- \"$(dirname -- \"$0\")/..\"\n\nif [ \"$#\" = \"0\" ]; then\n  set -- -race -covermode atomic ./...\nfi\n\nif [ -n \"$UPDATE_GOLDEN\" ]; then\n  find . -name golden -type d -exec rm -rf {} +\nfi\n\nMOD_DIRS=\"$(git ls-files '*go.mod' | xargs dirname | sort)\"\n\nfor dir in $MOD_DIRS; do\n  [ \"$dir\" = \"example/newreposecretwithlibsodium\" ] && continue\n  echo \"testing $dir\"\n  (\n    cd \"$dir\"\n    go test \"$@\"\n  ) || FAILED=1\ndone\n\nif [ -n \"$FAILED\" ]; then\n  exit 1\nfi\n"
  },
  {
    "path": "test/README.md",
    "content": "go-github tests\n===============\n\nThis directory contains additional test suites beyond the unit tests already in\n[../github](../github). Whereas the unit tests run very quickly (since they\ndon't make any network calls) and are run by Travis on every commit, the tests\nin this directory are only run manually.\n\nThe test packages are:\n\nintegration\n-----------\n\nThis will exercise the entire go-github library (or at least as much as is\npractical) against the live GitHub API. These tests will verify that the\nlibrary is properly coded against the actual behavior of the API, and will\n(hopefully) fail upon any incompatible change in the API.\n\nBecause these tests are running using live data, there is a much higher\nprobability of false positives in test failures due to network issues, test\ndata having been changed, etc.\n\nThese tests send real network traffic to the GitHub API and will exhaust the\ndefault unregistered rate limit (60 requests per hour) very quickly.\nAdditionally, in order to test the methods that modify data, a real OAuth token\nwill need to be present. While the tests will try to be well-behaved in terms\nof what data they modify, it is **strongly** recommended that these tests only\nbe run using a dedicated test account.\n\nRun tests using:\n\n    GITHUB_AUTH_TOKEN=XXX go test -v -tags=integration ./integration\n\nSome tests create repositories. By default, the new repositories will be owned\nby the user identified by the OAuth token. Set the `GITHUB_OWNER='<GH_OWNER>'`\nenvironment variable to specify a different owner, such as an organization.\n\nAdditionally there are a set of integration tests for the Authorizations API.\nThese tests require a GitHub user (username and password), and also that a\n[GitHub Application](https://github.com/settings/applications/new) (with\nattendant Client ID and Client Secret) be available. Then, to execute just the\nAuthorization tests:\n\n    GITHUB_USERNAME='<GH_USERNAME>' GITHUB_PASSWORD='<GH_PASSWORD>' GITHUB_CLIENT_ID='<CLIENT_ID>' GITHUB_CLIENT_SECRET='<CLIENT_SECRET>' go test -v -tags=integration -run=Authorizations ./integration\n\nIf some or all of these environment variables are not available, certain of the\nAuthorization integration tests will be skipped.\n\nfields\n------\n\nThis will identify the fields being returned by the live GitHub API that are\nnot currently being mapped into the relevant Go data type. Sometimes fields\nare deliberately not mapped, so the results of this tool should just be taken\nas a hint.\n\nThis test sends real network traffic to the GitHub API and will exhaust the\ndefault unregistered rate limit (60 requests per hour) very quickly.\nAdditionally, some data is only returned for authenticated API calls. Unlike\nthe integration tests above, these tests only read data, so it's less\nimperative that these be run using a dedicated test account (though you still\nreally should).\n\nRun the fields tool using:\n\n    GITHUB_AUTH_TOKEN=XXX go run ./fields/fields.go\n"
  },
  {
    "path": "test/fields/fields.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// This tool tests for the JSON mappings in the go-github data types. It will\n// identify fields that are returned by the live GitHub API, but that are not\n// currently mapped into a struct field of the relevant go-github type. This\n// helps to ensure that all relevant data returned by the API is being made\n// accessible, particularly new fields that are periodically (and sometimes\n// quietly) added to the API over time.\n//\n// These tests simply aid in identifying which fields aren't being mapped; it\n// is not necessarily true that every one of them should always be mapped.\n// Some fields may be undocumented for a reason, either because they aren't\n// actually used yet or should not be relied upon.\npackage main\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"flag\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"strings\"\n\n\t\"github.com/google/go-github/v84/github\"\n)\n\nvar (\n\tclient *github.Client\n\n\tskipURLs = flag.Bool(\"skip_urls\", false, \"skip url fields\")\n)\n\nfunc main() {\n\tflag.Parse()\n\n\ttoken := os.Getenv(\"GITHUB_AUTH_TOKEN\")\n\tif token == \"\" {\n\t\tfmt.Print(\"!!! No OAuth token. Some tests won't run. !!!\\n\\n\")\n\t\tclient = github.NewClient(nil)\n\t} else {\n\t\tclient = github.NewClient(nil).WithAuthToken(token)\n\t}\n\n\tfor _, tt := range []struct {\n\t\turl string\n\t\ttyp any\n\t}{\n\t\t{\"users/octocat\", &github.User{}},\n\t\t{\"user\", &github.User{}},\n\t\t{\"users/willnorris/keys\", &[]github.Key{}},\n\t\t{\"orgs/google-test\", &github.Organization{}},\n\t\t{\"repos/google/go-github\", &github.Repository{}},\n\t\t{\"repos/google/go-github/issues/1\", &github.Issue{}},\n\t\t{\"/gists/9257657\", &github.Gist{}},\n\t} {\n\t\terr := testType(tt.url, tt.typ)\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"error: %v\\n\", err)\n\t\t}\n\t}\n}\n\n// testType fetches the JSON resource at urlStr and compares its keys to the\n// struct fields of typ.\nfunc testType(urlStr string, typ any) error {\n\tslice := reflect.Indirect(reflect.ValueOf(typ)).Kind() == reflect.Slice\n\n\treq, err := client.NewRequest(\"GET\", urlStr, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// start with a json.RawMessage so we can decode multiple ways below\n\traw := new(json.RawMessage)\n\t_, err = client.Do(context.Background(), req, raw)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// unmarshal directly to a map\n\tvar m1 map[string]any\n\tif slice {\n\t\tvar s []map[string]any\n\t\terr = json.Unmarshal(*raw, &s)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tm1 = s[0]\n\t} else {\n\t\terr = json.Unmarshal(*raw, &m1)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// unmarshal to typ first, then re-marshal and unmarshal to a map\n\terr = json.Unmarshal(*raw, typ)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar byt []byte\n\tif slice {\n\t\t// use first item in slice\n\t\tv := reflect.Indirect(reflect.ValueOf(typ))\n\t\tbyt, err = json.Marshal(v.Index(0).Interface())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tbyt, err = json.Marshal(typ)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tvar m2 map[string]any\n\terr = json.Unmarshal(byt, &m2)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// now compare the two maps\n\tfor k, v := range m1 {\n\t\tif *skipURLs && strings.HasSuffix(k, \"_url\") {\n\t\t\tcontinue\n\t\t}\n\t\tif _, ok := m2[k]; !ok {\n\t\t\tfmt.Printf(\"%v missing field for key: %v (example value: %v)\\n\", reflect.TypeOf(typ), k, v)\n\t\t}\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "test/integration/activity_test.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n//go:build integration\n\npackage integration\n\nimport (\n\t\"testing\"\n\n\t\"github.com/google/go-github/v84/github\"\n)\n\nconst (\n\towner = \"google\"\n\trepo  = \"go-github\"\n)\n\nfunc TestActivity_Starring(t *testing.T) {\n\tstargazers, _, err := client.Activity.ListStargazers(t.Context(), owner, repo, nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Activity.ListStargazers returned error: %v\", err)\n\t}\n\n\tif len(stargazers) == 0 {\n\t\tt.Errorf(\"Activity.ListStargazers(%q, %q) returned no stargazers\", owner, repo)\n\t}\n\n\t// the rest of the tests requires auth\n\tskipIfMissingAuth(t)\n\n\t// first, check if already starred the target repository\n\tstar, _, err := client.Activity.IsStarred(t.Context(), owner, repo)\n\tif err != nil {\n\t\tt.Fatalf(\"Activity.IsStarred returned error: %v\", err)\n\t}\n\tif star {\n\t\tt.Fatalf(\"Already starring %v/%v. Please manually unstar it first.\", owner, repo)\n\t}\n\n\t// star the target repository\n\t_, err = client.Activity.Star(t.Context(), owner, repo)\n\tif err != nil {\n\t\tt.Fatalf(\"Activity.Star returned error: %v\", err)\n\t}\n\n\t// check again and verify starred\n\tstar, _, err = client.Activity.IsStarred(t.Context(), owner, repo)\n\tif err != nil {\n\t\tt.Fatalf(\"Activity.IsStarred returned error: %v\", err)\n\t}\n\tif !star {\n\t\tt.Fatalf(\"Not starred %v/%v after starring it.\", owner, repo)\n\t}\n\n\t// unstar\n\t_, err = client.Activity.Unstar(t.Context(), owner, repo)\n\tif err != nil {\n\t\tt.Fatalf(\"Activity.Unstar returned error: %v\", err)\n\t}\n\n\t// check again and verify not watching\n\tstar, _, err = client.Activity.IsStarred(t.Context(), owner, repo)\n\tif err != nil {\n\t\tt.Fatalf(\"Activity.IsStarred returned error: %v\", err)\n\t}\n\tif star {\n\t\tt.Fatalf(\"Still starred %v/%v after unstarring it.\", owner, repo)\n\t}\n}\n\nfunc deleteSubscription(t *testing.T) {\n\t// delete subscription\n\t_, err := client.Activity.DeleteRepositorySubscription(t.Context(), owner, repo)\n\tif err != nil {\n\t\tt.Fatalf(\"Activity.DeleteRepositorySubscription returned error: %v\", err)\n\t}\n\n\t// check again and verify not watching\n\tsub, _, err := client.Activity.GetRepositorySubscription(t.Context(), owner, repo)\n\tif err != nil {\n\t\tt.Fatalf(\"Activity.GetRepositorySubscription returned error: %v\", err)\n\t}\n\tif sub != nil {\n\t\tt.Fatalf(\"Still watching %v/%v after deleting subscription.\", owner, repo)\n\t}\n}\n\nfunc createSubscription(t *testing.T) {\n\t// watch the target repository\n\tsub := &github.Subscription{Subscribed: github.Ptr(true)}\n\t_, _, err := client.Activity.SetRepositorySubscription(t.Context(), owner, repo, sub)\n\tif err != nil {\n\t\tt.Fatalf(\"Activity.SetRepositorySubscription returned error: %v\", err)\n\t}\n\n\t// check again and verify watching\n\tsub, _, err = client.Activity.GetRepositorySubscription(t.Context(), owner, repo)\n\tif err != nil {\n\t\tt.Fatalf(\"Activity.GetRepositorySubscription returned error: %v\", err)\n\t}\n\tif sub == nil || !*sub.Subscribed {\n\t\tt.Fatalf(\"Not watching %v/%v after setting subscription.\", owner, repo)\n\t}\n}\n\nfunc TestActivity_Watching(t *testing.T) {\n\twatchers, _, err := client.Activity.ListWatchers(t.Context(), owner, repo, nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Activity.ListWatchers returned error: %v\", err)\n\t}\n\n\tif len(watchers) == 0 {\n\t\tt.Errorf(\"Activity.ListWatchers(%q, %q) returned no watchers\", owner, repo)\n\t}\n\n\t// the rest of the tests requires auth\n\tskipIfMissingAuth(t)\n\n\t// first, check if already watching the target repository\n\tsub, _, err := client.Activity.GetRepositorySubscription(t.Context(), owner, repo)\n\tif err != nil {\n\t\tt.Fatalf(\"Activity.GetRepositorySubscription returned error: %v\", err)\n\t}\n\n\tif sub != nil { // If already subscribing, delete then recreate subscription.\n\t\tdeleteSubscription(t)\n\t\tcreateSubscription(t)\n\t} else { // Otherwise, create subscription and then delete it.\n\t\tcreateSubscription(t)\n\t\tdeleteSubscription(t)\n\t}\n}\n"
  },
  {
    "path": "test/integration/audit_log_test.go",
    "content": "// Copyright 2021 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n//go:build integration\n\npackage integration\n\nimport (\n\t\"testing\"\n)\n\n// TestOrganizationAuditLog test that the client can read an org's audit log.\n// Note: Org must be part of an enterprise.\n// Test requires auth - set env var GITHUB_AUTH_TOKEN.\nfunc TestOrganizationAuditLog(t *testing.T) {\n\tskipIfMissingAuth(t)\n\n\torg := \"example_org\"\n\tentries, _, err := client.Organizations.GetAuditLog(t.Context(), org, nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Organizations.GetAuditLog returned error: %v\", err)\n\t}\n\n\tif len(entries) == 0 {\n\t\tt.Error(\"No AuditLog events returned for org\")\n\t}\n\n\tfor _, e := range entries {\n\t\tt.Log(e.GetAction(), e.GetActor(), e.GetTimestamp(), e.GetUser())\n\t}\n}\n"
  },
  {
    "path": "test/integration/authorizations_test.go",
    "content": "// Copyright 2016 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n//go:build integration\n\npackage integration\n\nimport (\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/google/go-github/v84/github\"\n)\n\nconst (\n\tmsgEnvMissing      = \"Skipping test because the required environment variable (%v) is not present.\"\n\tenvKeyClientID     = \"GITHUB_CLIENT_ID\"\n\tenvKeyClientSecret = \"GITHUB_CLIENT_SECRET\"\n\tenvKeyAccessToken  = \"GITHUB_ACCESS_TOKEN\"\n\tInvalidTokenValue  = \"iamnotacroken\"\n)\n\n// TestAuthorizationsAppOperations tests the application/token related operations, such\n// as creating, testing, resetting and revoking application OAuth tokens.\nfunc TestAuthorizationsAppOperations(t *testing.T) {\n\tappAuthenticatedClient := getOAuthAppClient(t)\n\n\t// We know these vars are set because getOAuthAppClient would have\n\t// skipped the test by now\n\tclientID := os.Getenv(envKeyClientID)\n\taccessToken := os.Getenv(envKeyAccessToken)\n\n\t// Verify the token\n\tappAuth, resp, err := appAuthenticatedClient.Authorizations.Check(t.Context(), clientID, accessToken)\n\tfailOnError(t, err)\n\tfailIfNotStatusCode(t, resp, 200)\n\n\t// Quick sanity check\n\tif *appAuth.Token != accessToken {\n\t\tt.Fatal(\"The returned auth/token does not match.\")\n\t}\n\n\t// Let's verify that we get a 404 for a nonexistent token\n\t_, resp, err = appAuthenticatedClient.Authorizations.Check(t.Context(), clientID, InvalidTokenValue)\n\tif err == nil {\n\t\tt.Fatal(\"An error should have been returned because of the invalid token.\")\n\t}\n\tfailIfNotStatusCode(t, resp, 404)\n\n\t// Let's reset the token\n\tresetAuth, resp, err := appAuthenticatedClient.Authorizations.Reset(t.Context(), clientID, accessToken)\n\tfailOnError(t, err)\n\tfailIfNotStatusCode(t, resp, 200)\n\n\t// Let's verify that we get a 404 for a nonexistent token\n\t_, resp, err = appAuthenticatedClient.Authorizations.Reset(t.Context(), clientID, InvalidTokenValue)\n\tif err == nil {\n\t\tt.Fatal(\"An error should have been returned because of the invalid token.\")\n\t}\n\tfailIfNotStatusCode(t, resp, 404)\n\n\t// Verify that the token has changed\n\tif *resetAuth.Token == accessToken {\n\t\tt.Fatal(\"The reset token should be different from the original.\")\n\t}\n\n\t// Verify that we do have a token value\n\tif *resetAuth.Token == \"\" {\n\t\tt.Fatal(\"A token value should have been returned.\")\n\t}\n\n\t// Verify that the original token is now invalid\n\t_, resp, err = appAuthenticatedClient.Authorizations.Check(t.Context(), clientID, accessToken)\n\tif err == nil {\n\t\tt.Fatal(\"The original token should be invalid.\")\n\t}\n\tfailIfNotStatusCode(t, resp, 404)\n\n\t// Check that the reset token is valid\n\t_, resp, err = appAuthenticatedClient.Authorizations.Check(t.Context(), clientID, *resetAuth.Token)\n\tfailOnError(t, err)\n\tfailIfNotStatusCode(t, resp, 200)\n\n\t// Let's revoke the token\n\tresp, err = appAuthenticatedClient.Authorizations.Revoke(t.Context(), clientID, *resetAuth.Token)\n\tfailOnError(t, err)\n\tfailIfNotStatusCode(t, resp, 204)\n\n\t// Sleep for two seconds... I've seen cases where the revocation appears not\n\t// to have take place immediately.\n\ttime.Sleep(time.Second * 2)\n\n\t// Now, the reset token should also be invalid\n\t_, resp, err = appAuthenticatedClient.Authorizations.Check(t.Context(), clientID, *resetAuth.Token)\n\tif err == nil {\n\t\tt.Fatal(\"The reset token should be invalid.\")\n\t}\n\tfailIfNotStatusCode(t, resp, 404)\n}\n\n// failOnError invokes t.Fatal() if err is present.\nfunc failOnError(t *testing.T, err error) {\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\n// failIfNotStatusCode invokes t.Fatal() if the response's status code doesn't match the expected code.\nfunc failIfNotStatusCode(t *testing.T, resp *github.Response, expectedCode int) {\n\tif resp.StatusCode != expectedCode {\n\t\tt.Fatalf(\"Expected HTTP status code [%v] but received [%v]\", expectedCode, resp.StatusCode)\n\t}\n}\n\n// getOAuthAppClient returns a GitHub client for authorization testing. The client\n// uses BasicAuth, but instead of username and password, it uses the client id\n// and client secret passed in via environment variables\n// (and will skip the calling test if those vars are not present). Certain API operations (check\n// an authorization; reset an authorization; revoke an authorization for an app)\n// require this authentication mechanism.\n//\n// See GitHub API docs: https://developer.com/v3/oauth_authorizations/#check-an-authorization\nfunc getOAuthAppClient(t *testing.T) *github.Client {\n\tusername, ok := os.LookupEnv(envKeyClientID)\n\tif !ok {\n\t\tt.Skipf(msgEnvMissing, envKeyClientID)\n\t}\n\n\tpassword, ok := os.LookupEnv(envKeyClientSecret)\n\tif !ok {\n\t\tt.Skipf(msgEnvMissing, envKeyClientSecret)\n\t}\n\n\ttp := github.BasicAuthTransport{\n\t\tUsername: strings.TrimSpace(username),\n\t\tPassword: strings.TrimSpace(password),\n\t}\n\n\treturn github.NewClient(tp.Client())\n}\n"
  },
  {
    "path": "test/integration/doc.go",
    "content": "// Copyright 2016 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package integration contains integration tests.\n//\n// These tests call the live GitHub API, and therefore require a little more\n// setup to run. See https://github.com/google/go-github/tree/master/test#integration\n// for more information.\npackage integration\n"
  },
  {
    "path": "test/integration/github_test.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n//go:build integration\n\npackage integration\n\nimport (\n\t\"fmt\"\n\t\"math/rand\"\n\t\"net/http\"\n\t\"os\"\n\t\"sync\"\n\t\"testing\"\n\n\t\"github.com/google/go-github/v84/github\"\n)\n\n// client is a github.Client with the default http.Client. It is authorized if auth is true.\n// auth indicates whether tests are being run with an OAuth token\n// that is defined in the GITHUB_AUTH_TOKEN environment variable.\nvar client, auth = sync.OnceValues(func() (*github.Client, bool) {\n\ttoken := os.Getenv(\"GITHUB_AUTH_TOKEN\")\n\tif token == \"\" {\n\t\treturn github.NewClient(nil), false\n\t}\n\treturn github.NewClient(nil).WithAuthToken(token), true\n})()\n\nfunc skipIfMissingAuth(t *testing.T) {\n\tif !auth {\n\t\tt.Skipf(\"No OAuth token - skipping portions of %v\\n\", t.Name())\n\t}\n}\n\nfunc createRandomTestRepository(t *testing.T, owner string, autoinit bool) *github.Repository {\n\tt.Helper()\n\n\t// determine the owner to use if one wasn't specified\n\tif owner == \"\" {\n\t\towner = os.Getenv(\"GITHUB_OWNER\")\n\t\tif owner == \"\" {\n\t\t\tme, _, err := client.Users.Get(t.Context(), \"\")\n\t\t\tif err != nil {\n\t\t\t\tt.Fatalf(\"Users.Get returned error: %v\", err)\n\t\t\t}\n\t\t\towner = *me.Login\n\t\t}\n\t}\n\n\t// create random repo name that does not currently exist\n\tvar repoName string\n\tfor {\n\t\trepoName = fmt.Sprintf(\"test-%v\", rand.Int())\n\t\t_, resp, err := client.Repositories.Get(t.Context(), owner, repoName)\n\t\tif err != nil {\n\t\t\tif resp.StatusCode == http.StatusNotFound {\n\t\t\t\t// found a nonexistent repo, perfect\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tt.Fatalf(\"Repositories.Get returned error: %v\", err)\n\t\t}\n\t}\n\n\t// create the repository\n\trepo, _, err := client.Repositories.Create(\n\t\tt.Context(),\n\t\towner,\n\t\t&github.Repository{\n\t\t\tName:     github.Ptr(repoName),\n\t\t\tAutoInit: github.Ptr(autoinit),\n\t\t},\n\t)\n\tif err != nil {\n\t\tt.Fatalf(\"Repositories.Create returned error: %v\", err)\n\t}\n\n\treturn repo\n}\n"
  },
  {
    "path": "test/integration/issues_test.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n//go:build integration\n\npackage integration\n\nimport (\n\t\"testing\"\n)\n\nfunc TestIssueEvents(t *testing.T) {\n\tevents, _, err := client.Issues.ListRepositoryEvents(t.Context(), \"google\", \"go-github\", nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Issues.ListRepositoryEvents returned error: %v\", err)\n\t}\n\n\tif len(events) == 0 {\n\t\tt.Error(\"ListRepositoryEvents returned no events\")\n\t}\n\n\tevents, _, err = client.Issues.ListIssueEvents(t.Context(), \"google\", \"go-github\", 1, nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Issues.ListIssueEvents returned error: %v\", err)\n\t}\n\n\tif len(events) == 0 {\n\t\tt.Error(\"ListIssueEvents returned no events\")\n\t}\n\n\tevent, _, err := client.Issues.GetEvent(t.Context(), \"google\", \"go-github\", *events[0].ID)\n\tif err != nil {\n\t\tt.Fatalf(\"Issues.GetEvent returned error: %v\", err)\n\t}\n\n\tif *event.URL != *events[0].URL {\n\t\tt.Fatalf(\"Issues.GetEvent returned event URL: %v, want %v\", *event.URL, *events[0].URL)\n\t}\n}\n"
  },
  {
    "path": "test/integration/licences_test.go",
    "content": "// Copyright 2026 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n//go:build integration\n\npackage integration\n\nimport (\n\t\"testing\"\n\n\t\"github.com/google/go-github/v84/github\"\n)\n\nfunc TestLicenses_ListIter(t *testing.T) {\n\topts := &github.ListLicensesOptions{\n\t\tFeatured: github.Ptr(true),\n\t\tListOptions: github.ListOptions{\n\t\t\tPage:    1,\n\t\t\tPerPage: 1,\n\t\t},\n\t}\n\n\tvar featuredLicensesCount int\n\tfor _, err := range client.Licenses.ListIter(t.Context(), opts) {\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"Licenses.ListIter returned error during iteration: %v\", err)\n\t\t}\n\t\tfeaturedLicensesCount++\n\t}\n\n\tif featuredLicensesCount < 2 {\n\t\tt.Errorf(\"Licenses.ListIter returned fewer than 2 featured licenses: %v\", featuredLicensesCount)\n\t}\n}\n"
  },
  {
    "path": "test/integration/misc_test.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n//go:build integration\n\npackage integration\n\nimport (\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestEmojis(t *testing.T) {\n\temoji, _, err := client.Emojis.List(t.Context())\n\tif err != nil {\n\t\tt.Fatalf(\"List returned error: %v\", err)\n\t}\n\n\tif len(emoji) == 0 {\n\t\tt.Error(\"List returned no emojis\")\n\t}\n\n\tif _, ok := emoji[\"+1\"]; !ok {\n\t\tt.Error(\"List missing '+1' emoji\")\n\t}\n}\n\nfunc TestAPIMeta(t *testing.T) {\n\tmeta, _, err := client.Meta.Get(t.Context())\n\tif err != nil {\n\t\tt.Fatalf(\"Get returned error: %v\", err)\n\t}\n\n\tif len(meta.Hooks) == 0 {\n\t\tt.Error(\"Get returned no hook addresses\")\n\t}\n\n\tif len(meta.Git) == 0 {\n\t\tt.Error(\"Get returned no git addresses\")\n\t}\n\n\tif *meta.VerifiablePasswordAuthentication {\n\t\tt.Error(\"APIMeta VerifiablePasswordAuthentication is true\")\n\t}\n}\n\nfunc TestRateLimits(t *testing.T) {\n\tlimits, _, err := client.RateLimit.Get(t.Context())\n\tif err != nil {\n\t\tt.Fatalf(\"RateLimits returned error: %v\", err)\n\t}\n\n\t// do some sanity checks\n\tif limits.Core.Limit == 0 {\n\t\tt.Error(\"RateLimits returned 0 core limit\")\n\t}\n\n\tif limits.Core.Limit < limits.Core.Remaining {\n\t\tt.Error(\"Core.Limits is less than Core.Remaining.\")\n\t}\n\n\tif limits.Core.Reset.Time.Before(time.Now().Add(-1 * time.Minute)) {\n\t\tt.Error(\"Core.Reset is more than 1 minute in the past; that doesn't seem right.\")\n\t}\n}\n"
  },
  {
    "path": "test/integration/pagination_test.go",
    "content": "// Copyright 2026 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n//go:build integration\n\npackage integration\n\nimport (\n\t\"testing\"\n\n\t\"github.com/google/go-github/v84/github\"\n)\n\nfunc TestSecurityAdvisories_ListGlobalSecurityAdvisories(t *testing.T) {\n\topt := &github.ListGlobalSecurityAdvisoriesOptions{\n\t\tListCursorOptions: github.ListCursorOptions{\n\t\t\tPerPage: 2,\n\t\t},\n\t}\n\tadvisories, resp, err := client.SecurityAdvisories.ListGlobalSecurityAdvisories(t.Context(), opt)\n\tif err != nil {\n\t\tt.Fatalf(\"ListGlobalSecurityAdvisories returned error: %v\", err)\n\t}\n\n\tif got, want := len(advisories), 2; got != want {\n\t\tt.Errorf(\"ListGlobalSecurityAdvisories returned %v advisories, want %v\", got, want)\n\t}\n\n\tif resp.After == \"\" {\n\t\tt.Error(\"ListGlobalSecurityAdvisories returned an empty 'after' cursor\")\n\t}\n\n\tif resp.Cursor != \"\" {\n\t\tt.Error(\"ListGlobalSecurityAdvisories returned a non-empty 'cursor' value\")\n\t}\n}\n"
  },
  {
    "path": "test/integration/projects_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n//go:build integration\n\npackage integration\n\nimport (\n\t\"os\"\n\t\"testing\"\n\n\t\"github.com/google/go-github/v84/github\"\n)\n\n// Integration tests for Projects V2 endpoints defined in github/projects.go.\n//\n// These tests are intentionally defensive. They only require minimal\n// environment variables identifying a target org and user. Project numbers are\n// discovered dynamically by first listing projects and selecting one. For item\n// CRUD operations, the test creates a temporary repository & issue (where\n// possible) and adds/removes that issue as a project item. If prerequisites\n// (auth, env vars, permissions, presence of at least one project) are missing,\n// the relevant sub-test is skipped so other integration tests can still run.\n//\n// Required / optional environment variables:\n//   GITHUB_AUTH_TOKEN                  (required for any of these tests to run)\n//   GITHUB_TEST_ORG                    (org login; required for org project tests)\n//   GITHUB_TEST_USER                   (user login; required for user project tests)\n//   GITHUB_TEST_REPO                   (repo name)\n\nfunc TestProjectsV2_Org(t *testing.T) {\n\tskipIfMissingAuth(t)\n\torg := os.Getenv(\"GITHUB_TEST_ORG\")\n\tif org == \"\" {\n\t\tt.Skip(\"GITHUB_TEST_ORG not set\")\n\t}\n\n\tctx := t.Context()\n\n\topts := &github.ListProjectsOptions{}\n\t// List projects for org; pick the first available project we can read.\n\tprojects, _, err := client.Projects.ListOrganizationProjects(ctx, org, opts)\n\tif err != nil {\n\t\t// If listing itself fails, abort this test.\n\t\tt.Fatalf(\"Projects.ListOrganizationProjects returned error: %v\", err)\n\t}\n\tif len(projects) == 0 {\n\t\tt.Skipf(\"no Projects V2 found for org %s\", org)\n\t}\n\tproject := projects[0]\n\tif project.Number == nil {\n\t\tt.Skip(\"selected org project has nil Number field\")\n\t}\n\tprojectNumber := *project.Number\n\n\t// Re-fetch via Get to exercise endpoint explicitly.\n\tproj, _, err := client.Projects.GetOrganizationProject(ctx, org, projectNumber)\n\tif err != nil {\n\t\t// Permission mismatch? Skip CRUD while still reporting failure would make the test fail;\n\t\t// we want correctness so treat as fatal here.\n\t\tt.Fatalf(\"Projects.GetOrganizationProject returned error: %v\", err)\n\t}\n\tif proj.Number == nil || *proj.Number != projectNumber {\n\t\tt.Fatalf(\"GetOrganizationProject returned unexpected project number: got %+v want %d\", proj.Number, projectNumber)\n\t}\n\n\t_, _, err = client.Projects.ListOrganizationProjectFields(ctx, org, projectNumber, nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Projects.ListOrganizationProjectFields returned error: %v. Fields listing might require extra permissions\", err)\n\t}\n}\n\nfunc TestProjectsV2_User(t *testing.T) {\n\tskipIfMissingAuth(t)\n\tuser := os.Getenv(\"GITHUB_TEST_USER\")\n\tif user == \"\" {\n\t\tt.Skip(\"GITHUB_TEST_USER not set\")\n\t}\n\n\tctx := t.Context()\n\topts := &github.ListProjectsOptions{}\n\tprojects, _, err := client.Projects.ListUserProjects(ctx, user, opts)\n\tif err != nil {\n\t\tt.Fatalf(\"Projects.ListUserProjects returned error: %v. This indicates API or permission issue\", err)\n\t}\n\tif len(projects) == 0 {\n\t\tt.Skipf(\"no Projects V2 found for user %s\", user)\n\t}\n\tproject := projects[0]\n\tif project.Number == nil {\n\t\tt.Skip(\"selected user project has nil Number field\")\n\t}\n\n\tproj, _, err := client.Projects.GetUserProject(ctx, user, *project.Number)\n\tif err != nil {\n\t\t// can't fetch specific project; treat as fatal\n\t\tt.Fatalf(\"Projects.GetUserProject returned error: %v\", err)\n\t}\n\tif proj.Number == nil || *proj.Number != *project.Number {\n\t\tt.Fatalf(\"GetUserProject returned unexpected project number: got %+v want %d\", proj.Number, *project.Number)\n\t}\n}\n"
  },
  {
    "path": "test/integration/pulls_test.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n//go:build integration\n\npackage integration\n\nimport (\n\t\"testing\"\n)\n\nfunc TestPullRequests_ListCommits(t *testing.T) {\n\tcommits, _, err := client.PullRequests.ListCommits(t.Context(), \"google\", \"go-github\", 2, nil)\n\tif err != nil {\n\t\tt.Fatalf(\"PullRequests.ListCommits() returned error: %v\", err)\n\t}\n\n\tif got, want := len(commits), 3; got != want {\n\t\tt.Fatalf(\"PullRequests.ListCommits() returned %v commits, want %v\", got, want)\n\t}\n\n\tif got, want := *commits[0].Author.Login, \"sqs\"; got != want {\n\t\tt.Fatalf(\"PullRequests.ListCommits()[0].Author.Login returned %v, want %v\", got, want)\n\t}\n}\n"
  },
  {
    "path": "test/integration/repos_test.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n//go:build integration\n\npackage integration\n\nimport (\n\t\"io\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n\t\"github.com/google/go-github/v84/github\"\n)\n\nfunc TestRepositories_CRUD(t *testing.T) {\n\tskipIfMissingAuth(t)\n\n\trepo := createRandomTestRepository(t, \"\", true)\n\n\t// update the repository description\n\trepo.Description = github.Ptr(\"description\")\n\trepo.DefaultBranch = nil // FIXME: this shouldn't be necessary\n\t_, _, err := client.Repositories.Edit(t.Context(), *repo.Owner.Login, *repo.Name, repo)\n\tif err != nil {\n\t\tt.Fatalf(\"Repositories.Edit() returned error: %v\", err)\n\t}\n\n\t// delete the repository\n\t_, err = client.Repositories.Delete(t.Context(), *repo.Owner.Login, *repo.Name)\n\tif err != nil {\n\t\tt.Fatalf(\"Repositories.Delete() returned error: %v\", err)\n\t}\n\n\t// verify that the repository was deleted\n\t_, resp, err := client.Repositories.Get(t.Context(), *repo.Owner.Login, *repo.Name)\n\tif err == nil {\n\t\tt.Fatal(\"Test repository still exists after deleting it.\")\n\t}\n\tif resp.StatusCode != http.StatusNotFound {\n\t\tt.Fatalf(\"Repositories.Get() returned error: %v\", err)\n\t}\n}\n\nfunc TestRepositories_BranchesTags(t *testing.T) {\n\t// branches\n\tbranches, _, err := client.Repositories.ListBranches(t.Context(), \"git\", \"git\", nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Repositories.ListBranches() returned error: %v\", err)\n\t}\n\n\tif len(branches) == 0 {\n\t\tt.Fatal(\"Repositories.ListBranches('git', 'git') returned no branches\")\n\t}\n\n\t_, _, err = client.Repositories.GetBranch(t.Context(), \"git\", \"git\", *branches[0].Name, 0)\n\tif err != nil {\n\t\tt.Fatalf(\"Repositories.GetBranch() returned error: %v\", err)\n\t}\n\n\t// tags\n\ttags, _, err := client.Repositories.ListTags(t.Context(), \"git\", \"git\", nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Repositories.ListTags() returned error: %v\", err)\n\t}\n\n\tif len(tags) == 0 {\n\t\tt.Fatal(\"Repositories.ListTags('git', 'git') returned no tags\")\n\t}\n}\n\nfunc TestRepositories_EditBranches(t *testing.T) {\n\tskipIfMissingAuth(t)\n\n\trepo := createRandomTestRepository(t, \"\", true)\n\n\tbranch, _, err := client.Repositories.GetBranch(t.Context(), *repo.Owner.Login, *repo.Name, \"master\", 0)\n\tif err != nil {\n\t\tt.Fatalf(\"Repositories.GetBranch() returned error: %v\", err)\n\t}\n\n\tif *branch.Protected {\n\t\tt.Fatalf(\"Branch %v of repo %v is already protected\", \"master\", *repo.Name)\n\t}\n\n\tprotectionRequest := &github.ProtectionRequest{\n\t\tRequiredStatusChecks: &github.RequiredStatusChecks{\n\t\t\tStrict:   true,\n\t\t\tContexts: &[]string{\"continuous-integration\"},\n\t\t},\n\t\tRequiredPullRequestReviews: &github.PullRequestReviewsEnforcementRequest{\n\t\t\tDismissStaleReviews: true,\n\t\t},\n\t\tEnforceAdmins: true,\n\t\t// TODO: Only organization repositories can have users and team restrictions.\n\t\t//       In order to be able to test these Restrictions, need to add support\n\t\t//       for creating temporary organization repositories.\n\t\tRestrictions:     nil,\n\t\tBlockCreations:   github.Ptr(false),\n\t\tLockBranch:       github.Ptr(false),\n\t\tAllowForkSyncing: github.Ptr(false),\n\t}\n\n\tprotection, _, err := client.Repositories.UpdateBranchProtection(t.Context(), *repo.Owner.Login, *repo.Name, \"master\", protectionRequest)\n\tif err != nil {\n\t\tt.Fatalf(\"Repositories.UpdateBranchProtection() returned error: %v\", err)\n\t}\n\n\twant := &github.Protection{\n\t\tRequiredStatusChecks: &github.RequiredStatusChecks{\n\t\t\tStrict:   true,\n\t\t\tContexts: &[]string{\"continuous-integration\"},\n\t\t},\n\t\tRequiredPullRequestReviews: &github.PullRequestReviewsEnforcement{\n\t\t\tDismissStaleReviews:          true,\n\t\t\tRequiredApprovingReviewCount: 0,\n\t\t},\n\t\tEnforceAdmins: &github.AdminEnforcement{\n\t\t\tURL:     github.Ptr(\"https://api.github.com/repos/\" + *repo.Owner.Login + \"/\" + *repo.Name + \"/branches/master/protection/enforce_admins\"),\n\t\t\tEnabled: true,\n\t\t},\n\t\tRestrictions: nil,\n\t\tBlockCreations: &github.BlockCreations{\n\t\t\tEnabled: github.Ptr(false),\n\t\t},\n\t\tLockBranch: &github.LockBranch{\n\t\t\tEnabled: github.Ptr(false),\n\t\t},\n\t\tAllowForkSyncing: &github.AllowForkSyncing{\n\t\t\tEnabled: github.Ptr(false),\n\t\t},\n\t}\n\tif !cmp.Equal(protection, want) {\n\t\tt.Errorf(\"Repositories.UpdateBranchProtection() returned %+v, want %+v\", protection, want)\n\t}\n\n\t_, err = client.Repositories.Delete(t.Context(), *repo.Owner.Login, *repo.Name)\n\tif err != nil {\n\t\tt.Fatalf(\"Repositories.Delete() returned error: %v\", err)\n\t}\n}\n\nfunc TestRepositories_ListByAuthenticatedUser(t *testing.T) {\n\tskipIfMissingAuth(t)\n\n\t_, _, err := client.Repositories.ListByAuthenticatedUser(t.Context(), nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Repositories.ListByAuthenticatedUser() returned error: %v\", err)\n\t}\n}\n\nfunc TestRepositories_ListByUser(t *testing.T) {\n\t_, _, err := client.Repositories.ListByUser(t.Context(), \"google\", nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Repositories.ListByUser('google') returned error: %v\", err)\n\t}\n\n\topt := github.RepositoryListByUserOptions{Sort: \"created\"}\n\trepos, _, err := client.Repositories.ListByUser(t.Context(), \"google\", &opt)\n\tif err != nil {\n\t\tt.Fatalf(\"Repositories.List('google') with Sort opt returned error: %v\", err)\n\t}\n\tfor i, repo := range repos {\n\t\tif i > 0 && (*repos[i-1].CreatedAt).Time.Before((*repo.CreatedAt).Time) {\n\t\t\tt.Fatal(\"Repositories.ListByUser('google') with default descending Sort returned incorrect order\")\n\t\t}\n\t}\n}\n\nfunc TestRepositories_DownloadReleaseAsset(t *testing.T) {\n\tskipIfMissingAuth(t)\n\n\trc, _, err := client.Repositories.DownloadReleaseAsset(t.Context(), \"andersjanmyr\", \"goose\", 484892, http.DefaultClient)\n\tif err != nil {\n\t\tt.Fatalf(\"Repositories.DownloadReleaseAsset(andersjanmyr, goose, 484892, true) returned error: %v\", err)\n\t}\n\tdefer func() { _ = rc.Close() }()\n\t_, err = io.Copy(io.Discard, rc)\n\tif err != nil {\n\t\tt.Fatalf(\"Repositories.DownloadReleaseAsset(andersjanmyr, goose, 484892, true) returned error: %v\", err)\n\t}\n}\n\nfunc TestRepositories_Autolinks(t *testing.T) {\n\tskipIfMissingAuth(t)\n\n\trepo := createRandomTestRepository(t, \"\", true)\n\n\topts := &github.AutolinkOptions{\n\t\tKeyPrefix:      github.Ptr(\"TICKET-\"),\n\t\tURLTemplate:    github.Ptr(\"https://example.com/TICKET?query=<num>\"),\n\t\tIsAlphanumeric: github.Ptr(false),\n\t}\n\n\tactionlink, _, err := client.Repositories.AddAutolink(t.Context(), *repo.Owner.Login, *repo.Name, opts)\n\tif err != nil {\n\t\tt.Fatalf(\"Repositories.AddAutolink() returned error: %v\", err)\n\t}\n\n\tif !cmp.Equal(actionlink.KeyPrefix, opts.KeyPrefix) ||\n\t\t!cmp.Equal(actionlink.URLTemplate, opts.URLTemplate) ||\n\t\t!cmp.Equal(actionlink.IsAlphanumeric, opts.IsAlphanumeric) {\n\t\tt.Errorf(\"Repositories.AddAutolink() returned %+v, want %+v\", actionlink, opts)\n\t}\n\n\t_, err = client.Repositories.Delete(t.Context(), *repo.Owner.Login, *repo.Name)\n\tif err != nil {\n\t\tt.Fatalf(\"Repositories.Delete() returned error: %v\", err)\n\t}\n}\n"
  },
  {
    "path": "test/integration/users_test.go",
    "content": "// Copyright 2014 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n//go:build integration\n\npackage integration\n\nimport (\n\t\"fmt\"\n\t\"math/rand\"\n\t\"testing\"\n\n\t\"github.com/google/go-github/v84/github\"\n)\n\nfunc TestUsers_Get(t *testing.T) {\n\t// list all users\n\tusers, _, err := client.Users.ListAll(t.Context(), nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Users.ListAll returned error: %v\", err)\n\t}\n\n\tif len(users) == 0 {\n\t\tt.Error(\"Users.ListAll returned no users\")\n\t}\n\n\t// mojombo is user #1\n\tif want := \"mojombo\"; want != *users[0].Login {\n\t\tt.Errorf(\"user[0].Login was %q, wanted %q\", *users[0].Login, want)\n\t}\n\n\t// get individual user\n\tu, _, err := client.Users.Get(t.Context(), \"octocat\")\n\tif err != nil {\n\t\tt.Fatalf(\"Users.Get('octocat') returned error: %v\", err)\n\t}\n\n\tif want := \"octocat\"; want != *u.Login {\n\t\tt.Errorf(\"user.Login was %q, wanted %q\", *u.Login, want)\n\t}\n\tif want := \"The Octocat\"; want != *u.Name {\n\t\tt.Errorf(\"user.Name was %q, wanted %q\", *u.Name, want)\n\t}\n}\n\nfunc TestUsers_Update(t *testing.T) {\n\tskipIfMissingAuth(t)\n\n\tu, _, err := client.Users.Get(t.Context(), \"\")\n\tif err != nil {\n\t\tt.Fatalf(\"Users.Get('') returned error: %v\", err)\n\t}\n\n\tif *u.Login == \"\" {\n\t\tt.Error(\"wanted non-empty values for user.Login\")\n\t}\n\n\t// save original location\n\tvar location string\n\tif u.Location != nil {\n\t\tlocation = *u.Location\n\t}\n\n\t// update location to test value\n\ttestLoc := fmt.Sprintf(\"test-%v\", rand.Int())\n\tu.Location = &testLoc\n\n\t_, _, err = client.Users.Edit(t.Context(), u)\n\tif err != nil {\n\t\tt.Fatalf(\"Users.Update returned error: %v\", err)\n\t}\n\n\t// refetch user and check location value\n\tu, _, err = client.Users.Get(t.Context(), \"\")\n\tif err != nil {\n\t\tt.Fatalf(\"Users.Get('') returned error: %v\", err)\n\t}\n\n\tif testLoc != *u.Location {\n\t\tt.Errorf(\"Users.Get('') has location: %v, want: %v\", *u.Location, testLoc)\n\t}\n\n\t// set location back to the original value\n\tu.Location = &location\n\t_, _, err = client.Users.Edit(t.Context(), u)\n\tif err != nil {\n\t\tt.Fatalf(\"Users.Edit returned error: %v\", err)\n\t}\n}\n\nfunc TestUsers_Emails(t *testing.T) {\n\tskipIfMissingAuth(t)\n\n\temails, _, err := client.Users.ListEmails(t.Context(), nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Users.ListEmails() returned error: %v\", err)\n\t}\n\n\t// create random address not currently in user's emails\n\tvar email string\nEmailLoop:\n\tfor {\n\t\temail = fmt.Sprintf(\"test-%v@example.com\", rand.Int())\n\t\tfor _, e := range emails {\n\t\t\tif e.Email != nil && *e.Email == email {\n\t\t\t\tcontinue EmailLoop\n\t\t\t}\n\t\t}\n\t\tbreak\n\t}\n\n\t// Add new address\n\t_, _, err = client.Users.AddEmails(t.Context(), []string{email})\n\tif err != nil {\n\t\tt.Fatalf(\"Users.AddEmails() returned error: %v\", err)\n\t}\n\n\t// List emails again and verify new email is present\n\temails, _, err = client.Users.ListEmails(t.Context(), nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Users.ListEmails() returned error: %v\", err)\n\t}\n\n\tvar found bool\n\tfor _, e := range emails {\n\t\tif e.Email != nil && *e.Email == email {\n\t\t\tfound = true\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif !found {\n\t\tt.Fatalf(\"Users.ListEmails() does not contain new address: %v\", email)\n\t}\n\n\t// Remove new address\n\t_, err = client.Users.DeleteEmails(t.Context(), []string{email})\n\tif err != nil {\n\t\tt.Fatalf(\"Users.DeleteEmails() returned error: %v\", err)\n\t}\n\n\t// List emails again and verify new email was removed\n\temails, _, err = client.Users.ListEmails(t.Context(), nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Users.ListEmails() returned error: %v\", err)\n\t}\n\n\tfor _, e := range emails {\n\t\tif e.Email != nil && *e.Email == email {\n\t\t\tt.Fatalf(\"Users.ListEmails() still contains address %v after removing it\", email)\n\t\t}\n\t}\n}\n\nfunc TestUsers_Keys(t *testing.T) {\n\tkeys, _, err := client.Users.ListKeys(t.Context(), \"willnorris\", nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Users.ListKeys('willnorris') returned error: %v\", err)\n\t}\n\n\tif len(keys) == 0 {\n\t\tt.Error(\"Users.ListKeys('willnorris') returned no keys\")\n\t}\n\n\t// the rest of the tests requires auth\n\tskipIfMissingAuth(t)\n\n\t// TODO: make this integration test work for any authenticated user.\n\tkeys, _, err = client.Users.ListKeys(t.Context(), \"\", nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Users.ListKeys('') returned error: %v\", err)\n\t}\n\n\t// ssh public key for testing (fingerprint: a7:22:ad:8c:36:9f:68:65:eb:ae:a1:e4:59:73:c1:76)\n\tkey := \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCy/RIqaMFj2wjkOEjx9EAU0ReLAIhodga82/feo5nnT9UUkHLbL9xrIavfdLHx28lD3xYgPfAoSicUMaAeNwuQhmuerr2c2LFGxzrdXP8pVsQ+Ol7y7OdmFPfe0KrzoZaLJs9aSiZ4VKyY4z5Se/k2UgcJTdgQVlLfw/P96aqCx8yUu94BiWqkDqYEvgWKRNHrTiIo1EXeVBCCcfgNZe1suFfNJUJSUU2T3EG2bpwBbSOCjE3FyH8+Lz3K3BOGzm3df8E7Regj9j4YIcD8cWJYO86jLJoGgQ0L5MSOq+ishNaHQXech22Ix03D1lVMjCvDT7S/C94Z1LzhI2lhvyff\"\n\tfor _, k := range keys {\n\t\tif k.Key != nil && *k.Key == key {\n\t\t\tt.Fatal(\"Test key already exists for user. Please manually remove it first.\")\n\t\t}\n\t}\n\n\t// Add new key\n\t_, _, err = client.Users.CreateKey(t.Context(), &github.Key{\n\t\tTitle: github.Ptr(\"go-github test key\"),\n\t\tKey:   github.Ptr(key),\n\t})\n\tif err != nil {\n\t\tt.Fatalf(\"Users.CreateKey() returned error: %v\", err)\n\t}\n\n\t// List keys again and verify new key is present\n\tkeys, _, err = client.Users.ListKeys(t.Context(), \"\", nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Users.ListKeys('') returned error: %v\", err)\n\t}\n\n\tvar id int64\n\tfor _, k := range keys {\n\t\tif k.Key != nil && *k.Key == key {\n\t\t\tid = *k.ID\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif id == 0 {\n\t\tt.Fatal(\"Users.ListKeys('') does not contain added test key\")\n\t}\n\n\t// Verify that fetching individual key works\n\tk, _, err := client.Users.GetKey(t.Context(), id)\n\tif err != nil {\n\t\tt.Fatalf(\"Users.GetKey(%q) returned error: %v\", id, err)\n\t}\n\tif *k.Key != key {\n\t\tt.Fatalf(\"Users.GetKey(%q) returned key %v, want %v\", id, *k.Key, key)\n\t}\n\n\t// Remove test key\n\t_, err = client.Users.DeleteKey(t.Context(), id)\n\tif err != nil {\n\t\tt.Fatalf(\"Users.DeleteKey(%v) returned error: %v\", id, err)\n\t}\n\n\t// List keys again and verify test key was removed\n\tkeys, _, err = client.Users.ListKeys(t.Context(), \"\", nil)\n\tif err != nil {\n\t\tt.Fatalf(\"Users.ListKeys('') returned error: %v\", err)\n\t}\n\n\tfor _, k := range keys {\n\t\tif k.Key != nil && *k.Key == key {\n\t\t\tt.Fatal(\"Users.ListKeys('') still contains test key after removing it\")\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "tools/check-structfield-settings/go.mod",
    "content": "module github.com/google/go-github/v84/tools/check-structfield-settings\n\ngo 1.25.0\n\nrequire (\n\tgithub.com/golangci/plugin-module-register v0.1.2\n\tgithub.com/google/go-github/v84/tools/structfield v0.0.0\n\tgo.yaml.in/yaml/v3 v3.0.4\n\tgolang.org/x/tools v0.43.0\n)\n\nrequire (\n\tgolang.org/x/mod v0.34.0 // indirect\n\tgolang.org/x/sync v0.20.0 // indirect\n)\n\n// Use version at HEAD, not the latest published.\nreplace github.com/google/go-github/v84/tools/structfield v0.0.0 => ../structfield\n"
  },
  {
    "path": "tools/check-structfield-settings/go.sum",
    "content": "github.com/golangci/plugin-module-register v0.1.2 h1:e5WM6PO6NIAEcij3B053CohVp3HIYbzSuP53UAYgOpg=\ngithub.com/golangci/plugin-module-register v0.1.2/go.mod h1:1+QGTsKBvAIvPvoY/os+G5eoqxWn70HYDm2uvUyGuVw=\ngithub.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=\ngithub.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=\ngo.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=\ngo.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=\ngolang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI=\ngolang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY=\ngolang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=\ngolang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=\ngolang.org/x/tools v0.43.0 h1:12BdW9CeB3Z+J/I/wj34VMl8X+fEXBxVR90JeMX5E7s=\ngolang.org/x/tools v0.43.0/go.mod h1:uHkMso649BX2cZK6+RpuIPXS3ho2hZo4FVwfoy1vIk0=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\n"
  },
  {
    "path": "tools/check-structfield-settings/main.go",
    "content": "// Copyright 2026 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// check-structfield-settings reads the settings for\n// the custom `structfield` linter in \".golangci.yml\" -\n// specifically, the \"allowed-tag-names\" and \"allowed-tag-types\"\n// exceptions, then scans the code repo to find all exceptions\n// that are no longer needed and reports a list.\npackage main\n\nimport (\n\t\"cmp\"\n\t\"errors\"\n\t\"flag\"\n\t\"fmt\"\n\t\"io/fs\"\n\t\"log\"\n\t\"maps\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"slices\"\n\t\"strings\"\n\n\t\"github.com/golangci/plugin-module-register/register\"\n\t\"github.com/google/go-github/v84/tools/structfield\"\n\t\"go.yaml.in/yaml/v3\"\n\t\"golang.org/x/tools/go/analysis\"\n\t\"golang.org/x/tools/go/analysis/checker\"\n\t\"golang.org/x/tools/go/packages\"\n)\n\nfunc init() {\n\tregister.Plugin(\"structfield\", structfield.New)\n}\n\nfunc main() {\n\tlog.SetFlags(0)\n\tconfigPath := flag.String(\"config\", \"\", \"path to .golangci.yml (defaults to searching up from cwd)\")\n\tpackagesFlag := flag.String(\"packages\", \"./...\", \"comma-separated list of package patterns to analyze\")\n\tincludeTests := flag.Bool(\"tests\", false, \"include test files in analysis\")\n\tfix := flag.Bool(\"fix\", false, \"remove obsolete exceptions and sort/dedupe lists in .golangci.yml\")\n\tflag.Parse()\n\n\tresolvedConfig, repoRoot, err := resolveConfig(*configPath)\n\tif err != nil {\n\t\tlog.Fatalf(\"config: %v\", err)\n\t}\n\n\tallowedNamesList, allowedTypesList, allowedNames, allowedTypes, err := readStructfieldSettings(resolvedConfig)\n\tif err != nil {\n\t\tlog.Fatalf(\"parse config: %v\", err)\n\t}\n\tif len(allowedNames) == 0 && len(allowedTypes) == 0 {\n\t\tlog.Fatalf(\"no structfield settings found in %s\", resolvedConfig)\n\t}\n\n\tduplicateNames := findDuplicates(allowedNamesList)\n\tduplicateTypes := findDuplicates(allowedTypesList)\n\n\tpatterns := strings.Split(*packagesFlag, \",\")\n\tfor i, pattern := range patterns {\n\t\tpatterns[i] = strings.TrimSpace(pattern)\n\t}\n\n\tusedNames, usedTypes, err := analyzeRepo(repoRoot, patterns, *includeTests, allowedNames, allowedTypes)\n\tif err != nil {\n\t\tlog.Fatalf(\"analyze: %v\", err)\n\t}\n\n\tobsoleteNames := diffKeys(allowedNames, usedNames)\n\tobsoleteTypes := diffKeys(allowedTypes, usedTypes)\n\n\tif len(obsoleteNames) == 0 && len(obsoleteTypes) == 0 && len(duplicateNames) == 0 && len(duplicateTypes) == 0 {\n\t\treturn\n\t}\n\n\tif *fix {\n\t\tif err := removeObsoleteExceptions(resolvedConfig, obsoleteNames, obsoleteTypes); err != nil {\n\t\t\tlog.Fatalf(\"fix: %v\", err)\n\t\t}\n\t\treturn\n\t}\n\n\tif len(obsoleteNames) > 0 {\n\t\tfmt.Println(\"Obsolete allowed-tag-names:\")\n\t\tfor _, name := range obsoleteNames {\n\t\t\tfmt.Printf(\"  - %v\\n\", name)\n\t\t}\n\t}\n\tif len(obsoleteTypes) > 0 {\n\t\tif len(obsoleteNames) > 0 {\n\t\t\tfmt.Println()\n\t\t}\n\t\tfmt.Println(\"Obsolete allowed-tag-types:\")\n\t\tfor _, name := range obsoleteTypes {\n\t\t\tfmt.Printf(\"  - %v\\n\", name)\n\t\t}\n\t}\n\tif len(duplicateNames) > 0 {\n\t\tif len(obsoleteNames) > 0 || len(obsoleteTypes) > 0 {\n\t\t\tfmt.Println()\n\t\t}\n\t\tfmt.Println(\"Duplicate allowed-tag-names:\")\n\t\tfor _, name := range sortedKeys(duplicateNames) {\n\t\t\tfmt.Printf(\"  - %v (%v)\\n\", name, duplicateNames[name])\n\t\t}\n\t}\n\tif len(duplicateTypes) > 0 {\n\t\tif len(obsoleteNames) > 0 || len(obsoleteTypes) > 0 || len(duplicateNames) > 0 {\n\t\t\tfmt.Println()\n\t\t}\n\t\tfmt.Println(\"Duplicate allowed-tag-types:\")\n\t\tfor _, name := range sortedKeys(duplicateTypes) {\n\t\t\tfmt.Printf(\"  - %v (%v)\\n\", name, duplicateTypes[name])\n\t\t}\n\t}\n}\n\ntype golangciConfig struct {\n\tLinters struct {\n\t\tSettings struct {\n\t\t\tCustom struct {\n\t\t\t\tStructfield struct {\n\t\t\t\t\tSettings struct {\n\t\t\t\t\t\tstructfield.Settings `yaml:\",inline\"`\n\t\t\t\t\t} `yaml:\"settings\"`\n\t\t\t\t} `yaml:\"structfield\"`\n\t\t\t} `yaml:\"custom\"`\n\t\t} `yaml:\"settings\"`\n\t} `yaml:\"linters\"`\n}\n\nfunc resolveConfig(configPath string) (string, string, error) {\n\tif configPath != \"\" {\n\t\tresolved, err := filepath.Abs(configPath)\n\t\tif err != nil {\n\t\t\treturn \"\", \"\", err\n\t\t}\n\t\trepoRoot := filepath.Dir(resolved)\n\t\treturn resolved, repoRoot, nil\n\t}\n\n\tcwd, err := os.Getwd()\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\n\tfor dir := cwd; ; dir = filepath.Dir(dir) {\n\t\tcandidate := filepath.Join(dir, \".golangci.yml\")\n\t\tif _, err := os.Stat(candidate); err == nil {\n\t\t\treturn candidate, dir, nil\n\t\t} else if !errors.Is(err, fs.ErrNotExist) {\n\t\t\treturn \"\", \"\", err\n\t\t}\n\n\t\tparent := filepath.Dir(dir)\n\t\tif parent == dir {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn \"\", \"\", errors.New(\"unable to locate .golangci.yml\")\n}\n\nfunc readStructfieldSettings(configPath string) ([]string, []string, map[string]bool, map[string]bool, error) {\n\tdata, err := os.ReadFile(configPath)\n\tif err != nil {\n\t\treturn nil, nil, nil, nil, err\n\t}\n\n\tvar cfg golangciConfig\n\tif err := yaml.Unmarshal(data, &cfg); err != nil {\n\t\treturn nil, nil, nil, nil, err\n\t}\n\n\tallowedNamesList := cfg.Linters.Settings.Custom.Structfield.Settings.AllowedTagNames\n\tallowedTypesList := cfg.Linters.Settings.Custom.Structfield.Settings.AllowedTagTypes\n\n\tallowedNames := make(map[string]bool)\n\tfor _, name := range allowedNamesList {\n\t\tallowedNames[name] = true\n\t}\n\n\tallowedTypes := make(map[string]bool)\n\tfor _, name := range allowedTypesList {\n\t\tallowedTypes[name] = true\n\t}\n\n\treturn allowedNamesList, allowedTypesList, allowedNames, allowedTypes, nil\n}\n\nfunc analyzeRepo(repoRoot string, patterns []string, includeTests bool, allowedNames, allowedTypes map[string]bool) (map[string]bool, map[string]bool, error) {\n\tplugin, err := structfield.New(nil)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tcreated, err := plugin.BuildAnalyzers()\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tif len(created) == 0 {\n\t\treturn nil, nil, errors.New(\"no analyzers returned by structfield\")\n\t}\n\tanalyzer := created[0]\n\n\tcfg := &packages.Config{\n\t\tMode:  packages.LoadAllSyntax,\n\t\tDir:   repoRoot,\n\t\tTests: includeTests,\n\t}\n\tpkgs, err := packages.Load(cfg, patterns...)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tif packages.PrintErrors(pkgs) > 0 {\n\t\treturn nil, nil, errors.New(\"package load errors\")\n\t}\n\n\tgraph, err := checker.Analyze([]*analysis.Analyzer{analyzer}, pkgs, &checker.Options{Sequential: true})\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tusedNames := make(map[string]bool)\n\tusedTypes := make(map[string]bool)\n\n\tfor act := range graph.All() {\n\t\tif !act.IsRoot || act.Analyzer != analyzer {\n\t\t\tcontinue\n\t\t}\n\t\tfor _, diag := range act.Diagnostics {\n\t\t\tmarkUsedException(diag.Message, allowedNames, allowedTypes, usedNames, usedTypes)\n\t\t}\n\t}\n\n\treturn usedNames, usedTypes, nil\n}\n\nvar (\n\tnameMismatchRE  = regexp.MustCompile(`^change Go field name \"([^\"]+)\" to \".*\" for .* tag \".*\" in struct \"([^\"]+)\"$`)\n\ttypeChangeRE    = regexp.MustCompile(`^change the \"([^\"]+)\" field type to \".*\" in the struct \"([^\"]+)\"`)\n\tfieldInStructRE = regexp.MustCompile(`^the \"([^\"]+)\" field in struct \"([^\"]+)\" .*`)\n)\n\nfunc markUsedException(msg string, allowedNames, allowedTypes, usedNames, usedTypes map[string]bool) {\n\tif match := nameMismatchRE.FindStringSubmatch(msg); match != nil {\n\t\tkey := match[2] + \".\" + match[1]\n\t\tif allowedNames[key] {\n\t\t\tusedNames[key] = true\n\t\t}\n\t\treturn\n\t}\n\n\tif match := typeChangeRE.FindStringSubmatch(msg); match != nil {\n\t\tkey := match[2] + \".\" + match[1]\n\t\tif allowedTypes[key] {\n\t\t\tusedTypes[key] = true\n\t\t}\n\t\treturn\n\t}\n\n\tif match := fieldInStructRE.FindStringSubmatch(msg); match != nil {\n\t\tkey := match[2] + \".\" + match[1]\n\t\tif allowedTypes[key] {\n\t\t\tusedTypes[key] = true\n\t\t}\n\t}\n}\n\nfunc diffKeys(all, used map[string]bool) []string {\n\tvar obsolete []string\n\tfor key := range all {\n\t\tif !used[key] {\n\t\t\tobsolete = append(obsolete, key)\n\t\t}\n\t}\n\treturn slices.Sorted(slices.Values(obsolete))\n}\n\nfunc findDuplicates(values []string) map[string]int {\n\tcounts := make(map[string]int)\n\tduplicates := make(map[string]int)\n\tfor _, value := range values {\n\t\tcounts[value]++\n\t\tif counts[value] > 1 {\n\t\t\tduplicates[value] = counts[value]\n\t\t}\n\t}\n\treturn duplicates\n}\n\nfunc sortedKeys(values map[string]int) []string {\n\treturn slices.Sorted(maps.Keys(values))\n}\n\nfunc removeObsoleteExceptions(configPath string, obsoleteNames, obsoleteTypes []string) error {\n\tdata, err := os.ReadFile(configPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfileInfo, statErr := os.Stat(configPath)\n\tfileMode := os.FileMode(0o644)\n\tif statErr == nil {\n\t\tfileMode = fileInfo.Mode()\n\t}\n\n\thasTrailingNewline := strings.HasSuffix(string(data), \"\\n\")\n\tlines := strings.Split(string(data), \"\\n\")\n\n\tobsoleteNamesSet := make(map[string]bool, len(obsoleteNames))\n\tfor _, name := range obsoleteNames {\n\t\tobsoleteNamesSet[name] = true\n\t}\n\tobsoleteTypesSet := make(map[string]bool, len(obsoleteTypes))\n\tfor _, name := range obsoleteTypes {\n\t\tobsoleteTypesSet[name] = true\n\t}\n\tseenNames := make(map[string]bool)\n\tseenTypes := make(map[string]bool)\n\tvar items []*listItem\n\n\tupdated := make([]string, 0, len(lines))\n\tsection := \"\"\n\n\tfor i := 0; i < len(lines); {\n\t\tline := lines[i]\n\t\ttrimmed := strings.TrimSpace(line)\n\n\t\tif section == \"\" {\n\t\t\tswitch {\n\t\t\tcase strings.HasPrefix(trimmed, \"allowed-tag-names:\"):\n\t\t\t\tsection = \"names\"\n\t\t\t\titems = items[:0]\n\t\t\t\tupdated = append(updated, line)\n\t\t\t\ti++\n\t\t\t\tcontinue\n\t\t\tcase strings.HasPrefix(trimmed, \"allowed-tag-types:\"):\n\t\t\t\tsection = \"types\"\n\t\t\t\titems = items[:0]\n\t\t\t\tupdated = append(updated, line)\n\t\t\t\ti++\n\t\t\t\tcontinue\n\t\t\tdefault:\n\t\t\t\tupdated = append(updated, line)\n\t\t\t\ti++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tif strings.HasPrefix(trimmed, \"- \") {\n\t\t\tvalue := strings.TrimSpace(trimmed[2:])\n\t\t\tif hash := strings.Index(value, \"#\"); hash >= 0 {\n\t\t\t\tvalue = strings.TrimSpace(value[:hash])\n\t\t\t}\n\t\t\tif section == \"names\" {\n\t\t\t\tif obsoleteNamesSet[value] || seenNames[value] {\n\t\t\t\t\ti++\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tseenNames[value] = true\n\t\t\t}\n\t\t\tif section == \"types\" {\n\t\t\t\tif obsoleteTypesSet[value] || seenTypes[value] {\n\t\t\t\t\ti++\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tseenTypes[value] = true\n\t\t\t}\n\t\t\titems = append(items, &listItem{value: value, line: line})\n\t\t\ti++\n\t\t\tcontinue\n\t\t}\n\n\t\tupdated = appendSortedItems(updated, items)\n\t\tsection = \"\"\n\t\titems = items[:0]\n\t\tcontinue\n\t}\n\n\tif section != \"\" {\n\t\tupdated = appendSortedItems(updated, items)\n\t}\n\n\tcontent := strings.Join(updated, \"\\n\")\n\tif hasTrailingNewline && !strings.HasSuffix(content, \"\\n\") {\n\t\tcontent += \"\\n\"\n\t}\n\n\treturn os.WriteFile(configPath, []byte(content), fileMode)\n}\n\ntype listItem struct {\n\tvalue string\n\tline  string\n}\n\nfunc appendSortedItems(lines []string, items []*listItem) []string {\n\tslices.SortFunc(items, func(a, b *listItem) int {\n\t\treturn cmp.Compare(a.value, b.value)\n\t})\n\tfor _, item := range items {\n\t\tlines = append(lines, item.line)\n\t}\n\treturn lines\n}\n"
  },
  {
    "path": "tools/extraneousnew/extraneousnew.go",
    "content": "// Copyright 2026 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package extraneousnew is a custom linter to be used by\n// golangci-lint to find instances where the Go code could\n// replace extraneous and problematic usage of `new` or `&SomeStruct{}`\n// with an initialized pointer in very specific instances.\n// It promotes the idiomatic Go concept that the zero-value is useful.\npackage extraneousnew\n\nimport (\n\t\"go/ast\"\n\t\"go/token\"\n\n\t\"github.com/golangci/plugin-module-register/register\"\n\t\"golang.org/x/tools/go/analysis\"\n)\n\nfunc init() {\n\tregister.Plugin(\"extraneousnew\", New)\n}\n\n// ExtraneousNewPlugin is a custom linter plugin for golangci-lint.\ntype ExtraneousNewPlugin struct {\n\tignoredMethods map[string]bool\n}\n\n// New returns an analysis.Analyzer to use with golangci-lint.\nfunc New(cfg any) (register.LinterPlugin, error) {\n\tignoredMethods := map[string]bool{}\n\tif cfg != nil {\n\t\tif data, ok := cfg.(map[string]any); ok {\n\t\t\tif ignored, ok := data[\"ignored-methods\"].([]any); ok {\n\t\t\t\tfor _, m := range ignored {\n\t\t\t\t\tif s, ok := m.(string); ok {\n\t\t\t\t\t\tignoredMethods[s] = true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn &ExtraneousNewPlugin{\n\t\tignoredMethods: ignoredMethods,\n\t}, nil\n}\n\n// BuildAnalyzers builds the analyzers for the ExtraneousNewPlugin.\nfunc (f *ExtraneousNewPlugin) BuildAnalyzers() ([]*analysis.Analyzer, error) {\n\treturn []*analysis.Analyzer{\n\t\t{\n\t\t\tName: \"extraneousnew\",\n\t\t\tDoc: `Reports problematic usage of 'new' or '&SomeStruct{}' when a\nmore idiomatic 'var' pointer would be more appropriate.\nIt encourages use of the idiomatic Go concept that the zero-value is useful.`,\n\t\t\tRun: func(pass *analysis.Pass) (any, error) {\n\t\t\t\treturn run(pass, f.ignoredMethods)\n\t\t\t},\n\t\t},\n\t}, nil\n}\n\n// GetLoadMode returns the load mode for the ExtraneousNewPlugin.\nfunc (f *ExtraneousNewPlugin) GetLoadMode() string {\n\treturn register.LoadModeSyntax\n}\n\nfunc run(pass *analysis.Pass, ignoredMethods map[string]bool) (any, error) {\n\tfor _, file := range pass.Files {\n\t\tast.Inspect(file, func(n ast.Node) bool {\n\t\t\tfn, ok := n.(*ast.FuncDecl)\n\t\t\tif !ok {\n\t\t\t\treturn true\n\t\t\t}\n\n\t\t\tif !fn.Name.IsExported() {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\t// Check if method should be ignored.\n\t\t\tif fn.Recv != nil && len(fn.Recv.List) > 0 {\n\t\t\t\tvar recvName string\n\t\t\t\trecvType := fn.Recv.List[0].Type\n\t\t\t\tif star, ok := recvType.(*ast.StarExpr); ok {\n\t\t\t\t\trecvType = star.X\n\t\t\t\t}\n\t\t\t\tif ident, ok := recvType.(*ast.Ident); ok {\n\t\t\t\t\trecvName = ident.Name\n\t\t\t\t}\n\n\t\t\t\tif recvName != \"\" {\n\t\t\t\t\tfullName := recvName + \".\" + fn.Name.Name\n\t\t\t\t\tif ignoredMethods[fullName] {\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif fn.Body != nil {\n\t\t\t\tinspectAllBlocks(pass, fn.Body)\n\t\t\t}\n\t\t\treturn true\n\t\t})\n\t}\n\treturn nil, nil\n}\n\nfunc inspectAllBlocks(pass *analysis.Pass, root ast.Node) {\n\tast.Inspect(root, func(n ast.Node) bool {\n\t\tblock, ok := n.(*ast.BlockStmt)\n\t\tif !ok {\n\t\t\treturn true\n\t\t}\n\t\tinspectBlock(pass, block)\n\t\treturn true\n\t})\n}\n\nfunc inspectBlock(pass *analysis.Pass, block *ast.BlockStmt) {\n\t// Track pointers that are currently nil.\n\tnilPointers := make(map[string]*ast.Ident)\n\n\tfor i, stmt := range block.List {\n\t\t// 1. Check for `var v *T` or `var v *struct{...}`\n\t\tif decl, ok := stmt.(*ast.DeclStmt); ok {\n\t\t\tif gen, ok := decl.Decl.(*ast.GenDecl); ok && gen.Tok == token.VAR {\n\t\t\t\tfor _, spec := range gen.Specs {\n\t\t\t\t\tif vSpec, ok := spec.(*ast.ValueSpec); ok {\n\t\t\t\t\t\tif _, ok := vSpec.Type.(*ast.StarExpr); ok && len(vSpec.Values) == 0 {\n\t\t\t\t\t\t\tfor _, name := range vSpec.Names {\n\t\t\t\t\t\t\t\tnilPointers[name.Name] = name\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// 2. Check for `v = new(T)` or `v := new(T)`\n\t\tvar assignLHS *ast.Ident\n\t\tvar isNewT bool\n\t\tvar typeName string\n\n\t\tif assign, ok := stmt.(*ast.AssignStmt); ok && len(assign.Lhs) == 1 && len(assign.Rhs) == 1 {\n\t\t\tif lhs, ok := assign.Lhs[0].(*ast.Ident); ok {\n\t\t\t\tassignLHS = lhs\n\t\t\t\t// Any assignment to v means it's no longer a \"nil pointer\" for our simple tracking.\n\t\t\t\tdelete(nilPointers, lhs.Name)\n\n\t\t\t\t// Check for v := new(T) or v := &T{}\n\t\t\t\tif call, ok := assign.Rhs[0].(*ast.CallExpr); ok {\n\t\t\t\t\tif fun, ok := call.Fun.(*ast.Ident); ok && fun.Name == \"new\" && len(call.Args) == 1 {\n\t\t\t\t\t\tisNewT = true\n\t\t\t\t\t\tif typeIdent, ok := call.Args[0].(*ast.Ident); ok {\n\t\t\t\t\t\t\ttypeName = typeIdent.Name\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif unary, ok := assign.Rhs[0].(*ast.UnaryExpr); ok && unary.Op == token.AND {\n\t\t\t\t\tif composite, ok := unary.X.(*ast.CompositeLit); ok && len(composite.Elts) == 0 {\n\t\t\t\t\t\tisNewT = true\n\t\t\t\t\t\tif typeIdent, ok := composite.Type.(*ast.Ident); ok {\n\t\t\t\t\t\t\ttypeName = typeIdent.Name\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif isNewT && assignLHS != nil {\n\t\t\tlookAhead(pass, block, i, assignLHS, typeName)\n\t\t\tcontinue\n\t\t}\n\n\t\t// If it's a regular assignment (possibly with multiple variables), it might initialize a nil pointer.\n\t\tif assign, ok := stmt.(*ast.AssignStmt); ok {\n\t\t\tfor _, lhs := range assign.Lhs {\n\t\t\t\tif ident, ok := lhs.(*ast.Ident); ok {\n\t\t\t\t\tdelete(nilPointers, ident.Name)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// 3. Check if a nil pointer is passed to Do/Decode.\n\t\tast.Inspect(stmt, func(n ast.Node) bool {\n\t\t\tcall, ok := n.(*ast.CallExpr)\n\t\t\tif !ok {\n\t\t\t\treturn true\n\t\t\t}\n\n\t\t\tfnName := getFunctionName(call.Fun)\n\t\t\tif fnName == \"\" {\n\t\t\t\treturn true\n\t\t\t}\n\n\t\t\tvar targetArg ast.Expr\n\t\t\tif fnName == \"Do\" && len(call.Args) == 3 {\n\t\t\t\ttargetArg = call.Args[2]\n\t\t\t} else if fnName == \"Decode\" && len(call.Args) == 1 {\n\t\t\t\ttargetArg = call.Args[0]\n\t\t\t}\n\n\t\t\tif targetArg != nil {\n\t\t\t\tif ident, ok := targetArg.(*ast.Ident); ok {\n\t\t\t\t\tif _, isNil := nilPointers[ident.Name]; isNil {\n\t\t\t\t\t\tpass.Reportf(ident.Pos(), \"pass '&%v' instead\", ident.Name)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true\n\t\t})\n\t}\n}\n\nfunc getFunctionName(expr ast.Expr) string {\n\tswitch f := expr.(type) {\n\tcase *ast.SelectorExpr:\n\t\treturn f.Sel.Name\n\tcase *ast.Ident:\n\t\treturn f.Name\n\t}\n\treturn \"\"\n}\n\nfunc lookAhead(pass *analysis.Pass, block *ast.BlockStmt, startIndex int, lhsIdent *ast.Ident, typeName string) {\n\tvar foundProperUse bool\n\tvar foundOtherUse bool\n\n\tfor j := startIndex + 1; j < len(block.List); j++ {\n\t\tnextStmt := block.List[j]\n\t\tast.Inspect(nextStmt, func(un ast.Node) bool {\n\t\t\tif foundProperUse || foundOtherUse {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\t// Check if lhsIdent is used here.\n\t\t\tident, ok := un.(*ast.Ident)\n\t\t\tif !ok || ident.Name != lhsIdent.Name {\n\t\t\t\treturn true\n\t\t\t}\n\n\t\t\t// Found a use of lhsIdent. Is it the target argument in a call to Do or Decode?\n\t\t\tisSafe := false\n\t\t\tast.Inspect(nextStmt, func(n ast.Node) bool {\n\t\t\t\tcall, ok := n.(*ast.CallExpr)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\n\t\t\t\tfnName := getFunctionName(call.Fun)\n\t\t\t\tvar targetArg ast.Expr\n\t\t\t\tif fnName == \"Do\" && len(call.Args) == 3 {\n\t\t\t\t\ttargetArg = call.Args[2]\n\t\t\t\t} else if fnName == \"Decode\" && len(call.Args) == 1 {\n\t\t\t\t\ttargetArg = call.Args[0]\n\t\t\t\t}\n\n\t\t\t\tif targetArg != nil {\n\t\t\t\t\tif isIdentOrAddressOfIdent(targetArg, lhsIdent.Name) {\n\t\t\t\t\t\tisSafe = true\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true\n\t\t\t})\n\n\t\t\tif isSafe {\n\t\t\t\tif typeName != \"\" {\n\t\t\t\t\tpass.Reportf(ident.Pos(), \"use 'var %v *%v' and pass '&%v' instead\", lhsIdent.Name, typeName, lhsIdent.Name)\n\t\t\t\t} else {\n\t\t\t\t\tpass.Reportf(ident.Pos(), \"use 'var %v *T' and pass '&%v' instead\", lhsIdent.Name, lhsIdent.Name)\n\t\t\t\t}\n\t\t\t\tfoundProperUse = true\n\t\t\t} else {\n\t\t\t\tfoundOtherUse = true\n\t\t\t}\n\t\t\treturn false\n\t\t})\n\t\tif foundProperUse || foundOtherUse {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\nfunc isIdentOrAddressOfIdent(expr ast.Expr, name string) bool {\n\tif ident, ok := expr.(*ast.Ident); ok {\n\t\treturn ident.Name == name\n\t}\n\tif unary, ok := expr.(*ast.UnaryExpr); ok && unary.Op == token.AND {\n\t\tif ident, ok := unary.X.(*ast.Ident); ok {\n\t\t\treturn ident.Name == name\n\t\t}\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "tools/extraneousnew/extraneousnew_test.go",
    "content": "// Copyright 2026 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage extraneousnew\n\nimport (\n\t\"testing\"\n\n\t\"golang.org/x/tools/go/analysis/analysistest\"\n)\n\nfunc TestRun(t *testing.T) {\n\tt.Parallel()\n\ttestdata := analysistest.TestData()\n\tplugin, _ := New(map[string]any{\n\t\t\"ignored-methods\": []any{\n\t\t\t\"Receiver.MethodNameToIgnore\",\n\t\t},\n\t})\n\tanalyzers, _ := plugin.BuildAnalyzers()\n\tanalysistest.Run(t, testdata, analyzers[0], \"has-warnings\", \"no-warnings\")\n}\n"
  },
  {
    "path": "tools/extraneousnew/go.mod",
    "content": "module github.com/google/go-github/v84/tools/extraneousnew\n\ngo 1.25.0\n\nrequire (\n\tgithub.com/golangci/plugin-module-register v0.1.2\n\tgolang.org/x/tools v0.43.0\n)\n\nrequire (\n\tgolang.org/x/mod v0.34.0 // indirect\n\tgolang.org/x/sync v0.20.0 // indirect\n)\n"
  },
  {
    "path": "tools/extraneousnew/go.sum",
    "content": "github.com/golangci/plugin-module-register v0.1.2 h1:e5WM6PO6NIAEcij3B053CohVp3HIYbzSuP53UAYgOpg=\ngithub.com/golangci/plugin-module-register v0.1.2/go.mod h1:1+QGTsKBvAIvPvoY/os+G5eoqxWn70HYDm2uvUyGuVw=\ngithub.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=\ngithub.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=\ngolang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI=\ngolang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY=\ngolang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=\ngolang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=\ngolang.org/x/tools v0.43.0 h1:12BdW9CeB3Z+J/I/wj34VMl8X+fEXBxVR90JeMX5E7s=\ngolang.org/x/tools v0.43.0/go.mod h1:uHkMso649BX2cZK6+RpuIPXS3ho2hZo4FVwfoy1vIk0=\n"
  },
  {
    "path": "tools/extraneousnew/testdata/src/has-warnings/main.go",
    "content": "// Copyright 2026 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage main\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"net/http\"\n\t\"testing\"\n)\n\ntype T struct {\n\tField string\n}\n\ntype Client struct{}\n\nfunc (c *Client) Do(ctx context.Context, req any, v any) (any, error) {\n\treturn nil, nil\n}\n\ntype Service struct {\n\tclient *Client\n}\n\nfunc assertNilError(t *testing.T, err error) {}\n\nfunc (s *Service) TestMethod(ctx context.Context, req any, r *http.Request, t *testing.T) {\n\tv1 := new(T)\n\ts.client.Do(ctx, req, v1) // want \"use 'var v1 [*]T' and pass '&v1' instead\"\n\n\tv2 := &T{}\n\ts.client.Do(ctx, req, v2) // want \"use 'var v2 [*]T' and pass '&v2' instead\"\n\n\tv3 := new(T)\n\tjson.NewDecoder(r.Body).Decode(v3) // want \"use 'var v3 [*]T' and pass '&v3' instead\"\n\n\tv4 := &T{}\n\tjson.NewDecoder(r.Body).Decode(v4) // want \"use 'var v4 [*]T' and pass '&v4' instead\"\n\n\tv5 := &T{}\n\ts.client.Do(ctx, req, &v5) // want \"use 'var v5 [*]T' and pass '&v5' instead\"\n\n\tv6 := new(T)\n\tassertNilError(t, json.NewDecoder(r.Body).Decode(v6)) // want \"use 'var v6 [*]T' and pass '&v6' instead\"\n\n\tv7 := &T{Field: \"something\"}\n\ts.client.Do(ctx, req, v7) // No warning\n\n\tvar v8 *T\n\tv8 = new(T)\n\ts.client.Do(ctx, req, v8) // want \"use 'var v8 [*]T' and pass '&v8' instead\"\n\n\t// Multiple assignments in same block\n\tv9 := new(T)\n\tv10 := new(T)\n\ts.client.Do(ctx, req, v9)  // want \"use 'var v9 [*]T' and pass '&v9' instead\"\n\ts.client.Do(ctx, req, v10) // want \"use 'var v10 [*]T' and pass '&v10' instead\"\n\n\t// Anonymous struct\n\tv11 := new(struct {\n\t\tF string\n\t})\n\ts.client.Do(ctx, req, v11) // want \"use 'var v11 [*]T' and pass '&v11' instead\"\n\n\t// Anonymous struct\n\tvar v12 *struct {\n\t\tF string\n\t}\n\ts.client.Do(ctx, req, v12) // want \"pass '&v12' instead\"\n\n\tvar v13 *T\n\ts.client.Do(ctx, req, v13) // want \"pass '&v13' instead\"\n}\n"
  },
  {
    "path": "tools/extraneousnew/testdata/src/no-warnings/main.go",
    "content": "// Copyright 2026 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage main\n\nimport (\n\t\"context\"\n)\n\ntype T struct {\n\tField string\n}\n\ntype Client struct{}\n\nfunc (c *Client) Do(ctx context.Context, req any, v any) (any, error) {\n\treturn nil, nil\n}\n\ntype Receiver struct {\n\tclient *Client\n}\n\nfunc (s *Receiver) TestMethod(ctx context.Context, req any) {\n\t// Proper usage: var pointer and pass &v\n\tvar v1 *T\n\ts.client.Do(ctx, req, &v1)\n\n\t// Literal with fields\n\tv2 := &T{Field: \"something\"}\n\ts.client.Do(ctx, req, v2)\n\n\t// new(T) but used for something else first\n\tv3 := new(T)\n\tv3.Field = \"set\"\n\ts.client.Do(ctx, req, v3)\n\n\t// Anonymous struct\n\tvar v11 *struct {\n\t\tF string\n\t}\n\ts.client.Do(ctx, req, &v11)\n}\n\nfunc (s *Receiver) MethodNameToIgnore(ctx context.Context, req any) {\n\tv := new(T)\n\ts.client.Do(ctx, req, v)\n}\n\nfunc (s *Receiver) unexportedMethod(ctx context.Context, req any) {\n\tv := new(T)\n\ts.client.Do(ctx, req, v) // Should be ignored because unexported.\n}\n"
  },
  {
    "path": "tools/fmtpercentv/fmtpercentv.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package fmtpercentv is a custom linter to be used by\n// golangci-lint to find instances of `%d` or `%s` in\n// format strings when `%v` would be more consistent.\npackage fmtpercentv\n\nimport (\n\t\"go/ast\"\n\t\"go/token\"\n\t\"strings\"\n\n\t\"github.com/golangci/plugin-module-register/register\"\n\t\"golang.org/x/tools/go/analysis\"\n)\n\nfunc init() {\n\tregister.Plugin(\"fmtpercentv\", New)\n}\n\n// FmtPercentVPlugin is a custom linter plugin for golangci-lint.\ntype FmtPercentVPlugin struct{}\n\n// New returns an analysis.Analyzer to use with golangci-lint.\nfunc New(_ any) (register.LinterPlugin, error) {\n\treturn &FmtPercentVPlugin{}, nil\n}\n\n// BuildAnalyzers builds the analyzers for the FmtPercentVPlugin.\nfunc (f *FmtPercentVPlugin) BuildAnalyzers() ([]*analysis.Analyzer, error) {\n\treturn []*analysis.Analyzer{\n\t\t{\n\t\t\tName: \"fmtpercentv\",\n\t\t\tDoc:  \"Reports usage of %d or %s in format strings.\",\n\t\t\tRun:  run,\n\t\t},\n\t}, nil\n}\n\n// GetLoadMode returns the load mode for the FmtPercentVPlugin.\nfunc (f *FmtPercentVPlugin) GetLoadMode() string {\n\treturn register.LoadModeSyntax\n}\n\nfunc run(pass *analysis.Pass) (any, error) {\n\tfor _, file := range pass.Files {\n\t\tast.Inspect(file, func(n ast.Node) bool {\n\t\t\tif n == nil {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\tif t, ok := n.(*ast.CallExpr); ok {\n\t\t\t\tcheckCallExpr(t, t.Pos(), pass)\n\t\t\t}\n\n\t\t\treturn true\n\t\t})\n\t}\n\treturn nil, nil\n}\n\nfunc checkCallExpr(expr *ast.CallExpr, tokenPos token.Pos, pass *analysis.Pass) {\n\tfun, ok := expr.Fun.(*ast.SelectorExpr)\n\tif !ok {\n\t\treturn\n\t}\n\tfunX, ok := fun.X.(*ast.Ident)\n\tif !ok {\n\t\treturn\n\t}\n\tif funX.Name != \"fmt\" && funX.Name != \"t\" {\n\t\treturn\n\t}\n\tif fun.Sel.Name != \"Sprintf\" && fun.Sel.Name != \"Printf\" && fun.Sel.Name != \"Fprintf\" && fun.Sel.Name != \"Errorf\" {\n\t\treturn\n\t}\n\tfmtStrBasicLit, ok := expr.Args[0].(*ast.BasicLit)\n\tif !ok {\n\t\treturn\n\t}\n\tfmtStr := fmtStrBasicLit.Value\n\thasD := strings.Contains(fmtStr, \"%d\")\n\thasS := strings.Contains(fmtStr, \"%s\")\n\tswitch {\n\tcase hasD && hasS:\n\t\tpass.Reportf(tokenPos, \"use %%v instead of %%s and %%d\")\n\tcase hasD:\n\t\tpass.Reportf(tokenPos, \"use %%v instead of %%d\")\n\tcase hasS:\n\t\tpass.Reportf(tokenPos, \"use %%v instead of %%s\")\n\t}\n}\n"
  },
  {
    "path": "tools/fmtpercentv/fmtpercentv_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage fmtpercentv\n\nimport (\n\t\"testing\"\n\n\t\"golang.org/x/tools/go/analysis/analysistest\"\n)\n\nfunc TestRun(t *testing.T) {\n\tt.Parallel()\n\ttestdata := analysistest.TestData()\n\tplugin, _ := New(nil)\n\tanalyzers, _ := plugin.BuildAnalyzers()\n\tanalysistest.Run(t, testdata, analyzers[0], \"has-warnings\", \"no-warnings\")\n}\n"
  },
  {
    "path": "tools/fmtpercentv/go.mod",
    "content": "module tools/fmtpercentv\n\ngo 1.25.0\n\nrequire (\n\tgithub.com/golangci/plugin-module-register v0.1.2\n\tgolang.org/x/tools v0.43.0\n)\n\nrequire (\n\tgolang.org/x/mod v0.34.0 // indirect\n\tgolang.org/x/sync v0.20.0 // indirect\n)\n"
  },
  {
    "path": "tools/fmtpercentv/go.sum",
    "content": "github.com/golangci/plugin-module-register v0.1.2 h1:e5WM6PO6NIAEcij3B053CohVp3HIYbzSuP53UAYgOpg=\ngithub.com/golangci/plugin-module-register v0.1.2/go.mod h1:1+QGTsKBvAIvPvoY/os+G5eoqxWn70HYDm2uvUyGuVw=\ngithub.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=\ngithub.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=\ngolang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI=\ngolang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY=\ngolang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=\ngolang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=\ngolang.org/x/tools v0.43.0 h1:12BdW9CeB3Z+J/I/wj34VMl8X+fEXBxVR90JeMX5E7s=\ngolang.org/x/tools v0.43.0/go.mod h1:uHkMso649BX2cZK6+RpuIPXS3ho2hZo4FVwfoy1vIk0=\n"
  },
  {
    "path": "tools/fmtpercentv/testdata/src/has-warnings/main.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\t_ = fmt.Sprintf(\"some/%d/url\", 1)          // want `use %v instead of %d`\n\t_ = fmt.Sprintf(\"some/%s/url\", \"yo\")       // want `use %v instead of %s`\n\t_ = fmt.Sprintf(\"some/%s/%d/url\", \"yo\", 1) // want `use %v instead of %s and %d`\n\t_ = fmt.Sprintf(\"some/%d/%s/url\", 1, \"yo\") // want `use %v instead of %s and %d`\n\tfmt.Printf(\"some %d\", 1)                   // want `use %v instead of %d`\n\tfmt.Printf(\"some %s\", \"thing\")             // want `use %v instead of %s`\n}\n"
  },
  {
    "path": "tools/fmtpercentv/testdata/src/no-warnings/main.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\t_ = fmt.Sprintf(\"some/%v/url\", 1) // Should not be flagged\n\tfmt.Printf(\"some %v\", 1)          // Should not be flagged\n\tfmt.Printf(\"some %v\", \"thing\")    // Should not be flagged\n}\n"
  },
  {
    "path": "tools/gen-release-notes/main.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// gen-release-notes calls `git` to determine what the prior release was, (e.g. \"v76.0.0\")\n// then calls `git` again to find out what changes were made since then.\n//\n// Finally, it writes the release notes to stdout, summarizing the\n// breaking and non-breaking changes since that release.\n//\n// Usage:\n//\n//\tgo run tools/gen-release-notes/main.go [--tag v76.0.0]\npackage main\n\nimport (\n\t\"bytes\"\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"os/exec\"\n\t\"regexp\"\n\t\"strings\"\n)\n\nvar (\n\tsinceTag = flag.String(\"tag\", \"\", \"List all changes since this tag (e.g. 'v76.0.0')\")\n\n\tdescriptionRE = regexp.MustCompile(`^\\* (.*?\\((#[^\\)]+)\\))`)\n\treleaseTagRE  = regexp.MustCompile(`[^a-zA-Z0-9.\\-_]+`)\n)\n\nfunc main() {\n\tlog.SetFlags(0)\n\tflag.Parse()\n\n\tpriorRelease := *sinceTag\n\tif priorRelease == \"\" {\n\t\tpriorRelease = getPriorRelease()\n\t\tlog.Printf(\"Prior release: %v\", priorRelease)\n\t}\n\n\tnewChanges := newChangesSinceRelease(priorRelease)\n\n\treleaseNotes := genReleaseNotes(newChanges)\n\tfmt.Printf(\"%v%v\", releaseNotes, \"\\n\")\n\n\tlog.Print(\"Done.\")\n}\n\nfunc genReleaseNotes(text string) string {\n\tallLines := splitIntoPRs(text)\n\tfullBreakingLines, fullNonBreakingLines := splitBreakingLines(allLines)\n\trefBreakingLines, refNonBreakingLines := genRefLines(fullBreakingLines, fullNonBreakingLines)\n\n\treturn fmt.Sprintf(releaseNotesFmt,\n\t\tstrings.Join(fullBreakingLines, \"\\n\"),\n\t\tstrings.Join(fullNonBreakingLines, \"\\n\"),\n\t\tstrings.Join(refBreakingLines, \"\\n\"),\n\t\tstrings.Join(refNonBreakingLines, \"\\n\"))\n}\n\nfunc splitIntoPRs(text string) []string {\n\tparts := strings.Split(\"\\n\"+text, \"\\ncommit \")\n\tif len(parts) < 2 {\n\t\tlog.Fatal(\"unable to find PRs\")\n\t}\n\tprs := make([]string, 0, len(parts)-1)\n\tfor _, part := range parts {\n\t\tif part == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tlines := strings.Split(part, \"\\n\")\n\t\tif len(lines) < 5 { // commit, Author:, Date:, blank, msg\n\t\t\tcontinue\n\t\t}\n\t\tvar newPR []string\n\t\tfor _, line := range lines[1:] {\n\t\t\tline = strings.TrimSpace(line)\n\t\t\tif line == \"\" || strings.HasPrefix(line, \"Author: \") || strings.HasPrefix(line, \"Date: \") {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif len(newPR) == 0 {\n\t\t\t\tnewPR = append(newPR, \"* \"+line)\n\t\t\t} else {\n\t\t\t\tnewPR = append(newPR, \"  \"+line)\n\t\t\t}\n\t\t}\n\t\tprs = append(prs, strings.Join(newPR, \"\\n\"))\n\t}\n\treturn prs\n}\n\nfunc splitBreakingLines(allLines []string) (breaking, nonBreaking []string) {\n\tfor _, pr := range allLines {\n\t\tif strings.Contains(pr, \"!: \") {\n\t\t\tbreaking = append(breaking, pr)\n\t\t} else {\n\t\t\tnonBreaking = append(nonBreaking, pr)\n\t\t}\n\t}\n\treturn breaking, nonBreaking\n}\n\nfunc genRefLines(breaking, nonBreaking []string) (ref, refNon []string) {\n\tfor _, pr := range breaking {\n\t\tm := descriptionRE.FindStringSubmatch(pr)\n\t\tif len(m) == 3 {\n\t\t\tref = append(ref, strings.Replace(pr, m[1], m[2], 1))\n\t\t}\n\t}\n\tfor _, pr := range nonBreaking {\n\t\tm := descriptionRE.FindStringSubmatch(pr)\n\t\tif len(m) == 3 {\n\t\t\trefNon = append(refNon, strings.Replace(pr, m[1], m[2], 1))\n\t\t}\n\t}\n\treturn ref, refNon\n}\n\nfunc runCommand(cmdArgs []string) string {\n\tcmd := exec.Command(cmdArgs[0], cmdArgs[1:]...) //nolint:gosec\n\tvar out bytes.Buffer\n\tcmd.Stdout = &out\n\tcmd.Stderr = os.Stderr\n\n\tlog.Printf(\"Running command: %v\", strings.Join(cmdArgs, \" \"))\n\tif err := cmd.Run(); err != nil {\n\t\tlog.Fatalf(\"command failed: %v\", err)\n\t}\n\n\treturn strings.TrimSpace(out.String())\n}\n\nfunc newChangesSinceRelease(priorRelease string) string {\n\tpriorRelease = releaseTagRE.ReplaceAllString(priorRelease, \"\")\n\tcmdArgs := []string{\"git\", \"log\", priorRelease + \"..\", \"--no-color\"}\n\treturn runCommand(cmdArgs)\n}\n\nfunc getPriorRelease() string {\n\tcmdArgs := []string{\"git\", \"describe\", \"--tags\", \"--abbrev=0\"}\n\treturn runCommand(cmdArgs)\n}\n\nconst releaseNotesFmt = `\nThis release contains the following breaking API changes:\n\n%v\n\n...and the following additional changes:\n\n%v\n\n&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&\n\nThis release contains the following breaking API changes:\n\n%v\n\n...and the following additional changes:\n\n%v\n`\n"
  },
  {
    "path": "tools/go.mod",
    "content": "module tools\n\ngo 1.25.0\n\nrequire (\n\tgithub.com/alecthomas/kong v1.14.0\n\tgithub.com/getkin/kin-openapi v0.134.0\n\tgithub.com/google/go-cmp v0.7.0\n\tgithub.com/google/go-github/v84 v84.0.0\n\tgo.yaml.in/yaml/v3 v3.0.4\n\tgolang.org/x/sync v0.20.0\n)\n\nrequire (\n\tgithub.com/go-openapi/jsonpointer v0.21.0 // indirect\n\tgithub.com/go-openapi/swag v0.23.0 // indirect\n\tgithub.com/go-test/deep v1.1.1 // indirect\n\tgithub.com/google/go-querystring v1.2.0 // indirect\n\tgithub.com/josharian/intern v1.0.0 // indirect\n\tgithub.com/mailru/easyjson v0.7.7 // indirect\n\tgithub.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect\n\tgithub.com/oasdiff/yaml v0.0.0-20260313112342-a3ea61cb4d4c // indirect\n\tgithub.com/oasdiff/yaml3 v0.0.0-20260224194419-61cd415a242b // indirect\n\tgithub.com/perimeterx/marshmallow v1.1.5 // indirect\n\tgithub.com/woodsbury/decimal128 v1.3.0 // indirect\n\tgopkg.in/yaml.v3 v3.0.1 // indirect\n)\n\n// Use version at HEAD, not the latest published.\nreplace github.com/google/go-github/v84 => ../\n"
  },
  {
    "path": "tools/go.sum",
    "content": "github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0=\ngithub.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k=\ngithub.com/alecthomas/kong v1.14.0 h1:gFgEUZWu2ZmZ+UhyZ1bDhuutbKN1nTtJTwh19Wsn21s=\ngithub.com/alecthomas/kong v1.14.0/go.mod h1:wrlbXem1CWqUV5Vbmss5ISYhsVPkBb1Yo7YKJghju2I=\ngithub.com/alecthomas/repr v0.5.2 h1:SU73FTI9D1P5UNtvseffFSGmdNci/O6RsqzeXJtP0Qs=\ngithub.com/alecthomas/repr v0.5.2/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=\ngithub.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/getkin/kin-openapi v0.134.0 h1:/L5+1+kfe6dXh8Ot/wqiTgUkjOIEJiC0bbYVziHB8rU=\ngithub.com/getkin/kin-openapi v0.134.0/go.mod h1:wK6ZLG/VgoETO9pcLJ/VmAtIcl/DNlMayNTb716EUxE=\ngithub.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ=\ngithub.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY=\ngithub.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE=\ngithub.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=\ngithub.com/go-test/deep v1.1.1 h1:0r/53hagsehfO4bzD2Pgr/+RgHqhmf+k1Bpse2cTu1U=\ngithub.com/go-test/deep v1.1.1/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=\ngithub.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/go-querystring v1.2.0 h1:yhqkPbu2/OH+V9BfpCVPZkNmUXhb2gBxJArfhIxNtP0=\ngithub.com/google/go-querystring v1.2.0/go.mod h1:8IFJqpSRITyJ8QhQ13bmbeMBDfmeEJZD5A0egEOmkqU=\ngithub.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=\ngithub.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=\ngithub.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=\ngithub.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=\ngithub.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=\ngithub.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=\ngithub.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=\ngithub.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=\ngithub.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=\ngithub.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=\ngithub.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=\ngithub.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=\ngithub.com/oasdiff/yaml v0.0.0-20260313112342-a3ea61cb4d4c h1:7ACFcSaQsrWtrH4WHHfUqE1C+f8r2uv8KGaW0jTNjus=\ngithub.com/oasdiff/yaml v0.0.0-20260313112342-a3ea61cb4d4c/go.mod h1:JKox4Gszkxt57kj27u7rvi7IFoIULvCZHUsBTUmQM/s=\ngithub.com/oasdiff/yaml3 v0.0.0-20260224194419-61cd415a242b h1:vivRhVUAa9t1q0Db4ZmezBP8pWQWnXHFokZj0AOea2g=\ngithub.com/oasdiff/yaml3 v0.0.0-20260224194419-61cd415a242b/go.mod h1:y5+oSEHCPT/DGrS++Wc/479ERge0zTFxaF8PbGKcg2o=\ngithub.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s=\ngithub.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw=\ngithub.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=\ngithub.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=\ngithub.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=\ngithub.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=\ngithub.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0=\ngithub.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY=\ngithub.com/woodsbury/decimal128 v1.3.0 h1:8pffMNWIlC0O5vbyHWFZAt5yWvWcrHA+3ovIIjVWss0=\ngithub.com/woodsbury/decimal128 v1.3.0/go.mod h1:C5UTmyTjW3JftjUFzOVhC20BEQa2a4ZKOB5I6Zjb+ds=\ngo.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=\ngo.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=\ngolang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=\ngolang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=\ngopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\n"
  },
  {
    "path": "tools/metadata/main.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// metadata is a command-line tool used to check and update this repo.\n// See CONTRIBUTING.md for details.\npackage main\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/alecthomas/kong\"\n\t\"github.com/google/go-github/v84/github\"\n)\n\nvar helpVars = kong.Vars{\n\t\"update_openapi_help\": `\nUpdate openapi_operations.yaml from OpenAPI descriptions in github.com/github/rest-api-description at the given git ref.\n`,\n\n\t\"update_go_help\": `\nUpdate go source code to be consistent with openapi_operations.yaml.\n - Adds and updates \"// GitHub API docs:\" comments for service methods.\n - Updates \"//meta:operation\" comments to use canonical operation names.\n - Updates formatting of \"//meta:operation\" comments to make sure there isn't a space between the \"//\" and the \"meta\".\n - Formats modified files with the equivalent of \"go fmt\".\n`,\n\n\t\"format_help\": `Format white space in openapi_operations.yaml and sort its operations.`,\n\t\"unused_help\": `List operations in openapi_operations.yaml that aren't used by any service methods.`,\n\n\t\"working_dir_help\": `Working directory. Should be the root of the go-github repository.`,\n\t\"openapi_ref_help\": `Git ref to pull OpenAPI descriptions from.`,\n\n\t\"openapi_validate_help\": `\nInstead of updating, make sure that the operations in openapi_operations.yaml's \"openapi_operations\" field are\nconsistent with the SHA listed in \"openapi_commit\". This is run in CI as a convenience so that reviewers can trust\nchanges to openapi_operations.yaml.\n`,\n\n\t\"output_json_help\": `Output JSON.`,\n}\n\ntype rootCmd struct {\n\tUpdateOpenAPI updateOpenAPICmd `kong:\"cmd,name=update-openapi,help=${update_openapi_help}\"`\n\tUpdateGo      updateGoCmd      `kong:\"cmd,help=${update_go_help}\"`\n\tFormat        formatCmd        `kong:\"cmd,help=${format_help}\"`\n\tUnused        unusedCmd        `kong:\"cmd,help=${unused_help}\"`\n\n\tWorkingDir string `kong:\"short=C,default=.,help=${working_dir_help}\"`\n\n\t// for testing\n\tGithubURL string `kong:\"hidden,default='https://api.github.com'\"`\n}\n\nfunc (c *rootCmd) opsFile() (string, *operationsFile, error) {\n\tfilename := filepath.Join(c.WorkingDir, \"openapi_operations.yaml\")\n\topsFile, err := loadOperationsFile(filename)\n\tif err != nil {\n\t\treturn \"\", nil, err\n\t}\n\treturn filename, opsFile, nil\n}\n\nfunc githubClient(apiURL string) (*github.Client, error) {\n\ttoken := os.Getenv(\"GITHUB_TOKEN\")\n\tif token == \"\" {\n\t\treturn nil, errors.New(\"GITHUB_TOKEN environment variable must be set to a GitHub personal access token with the public_repo scope\")\n\t}\n\treturn github.NewClient(nil).WithAuthToken(token).WithEnterpriseURLs(apiURL, \"\")\n}\n\ntype updateOpenAPICmd struct {\n\tRef            string `kong:\"default=main,help=${openapi_ref_help}\"`\n\tValidateGithub bool   `kong:\"name=validate,help=${openapi_validate_help}\"`\n}\n\nfunc (c *updateOpenAPICmd) Run(root *rootCmd) error {\n\tctx := context.Background()\n\tif c.ValidateGithub && c.Ref != \"main\" {\n\t\treturn errors.New(\"--validate and --ref are mutually exclusive\")\n\t}\n\tfilename, opsFile, err := root.opsFile()\n\tif err != nil {\n\t\treturn err\n\t}\n\torigOps := make([]*operation, len(opsFile.OpenapiOps))\n\tcopy(origOps, opsFile.OpenapiOps)\n\tfor i := range origOps {\n\t\torigOps[i] = origOps[i].clone()\n\t}\n\tclient, err := githubClient(root.GithubURL)\n\tif err != nil {\n\t\treturn err\n\t}\n\tref := c.Ref\n\tif c.ValidateGithub {\n\t\tref = opsFile.GitCommit\n\t\tif ref == \"\" {\n\t\t\treturn errors.New(\"openapi_operations.yaml does not have an openapi_commit field\")\n\t\t}\n\t}\n\terr = opsFile.updateFromGithub(ctx, client, ref)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !c.ValidateGithub {\n\t\treturn opsFile.saveFile(filename)\n\t}\n\tif !operationsEqual(origOps, opsFile.OpenapiOps) {\n\t\treturn errors.New(\"openapi_operations.yaml does not match the OpenAPI descriptions in github.com/github/rest-api-description\")\n\t}\n\treturn nil\n}\n\ntype formatCmd struct{}\n\nfunc (c *formatCmd) Run(root *rootCmd) error {\n\tfilename, opsFile, err := root.opsFile()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn opsFile.saveFile(filename)\n}\n\ntype updateGoCmd struct{}\n\nfunc (c *updateGoCmd) Run(root *rootCmd) error {\n\t_, opsFile, err := root.opsFile()\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = updateDocs(opsFile, filepath.Join(root.WorkingDir, \"github\"))\n\treturn err\n}\n\ntype unusedCmd struct {\n\tJSON bool `kong:\"help=${output_json_help}\"`\n}\n\nfunc (c *unusedCmd) Run(root *rootCmd, k *kong.Context) error {\n\t_, opsFile, err := root.opsFile()\n\tif err != nil {\n\t\treturn err\n\t}\n\tunused, err := unusedOps(opsFile, filepath.Join(root.WorkingDir, \"github\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\tif c.JSON {\n\t\tenc := json.NewEncoder(k.Stdout)\n\t\tenc.SetIndent(\"\", \"  \")\n\t\treturn enc.Encode(unused)\n\t}\n\tfmt.Fprintf(k.Stdout, \"Found %v unused operations\\n\", len(unused))\n\tif len(unused) == 0 {\n\t\treturn nil\n\t}\n\tfmt.Fprintln(k.Stdout, \"\")\n\tfor _, op := range unused {\n\t\tfmt.Fprintln(k.Stdout, op.Name)\n\t\tif op.DocumentationURL != \"\" {\n\t\t\tfmt.Fprintf(k.Stdout, \"doc:     %v\\n\", op.DocumentationURL)\n\t\t}\n\t\tfmt.Fprintln(k.Stdout, \"\")\n\t}\n\treturn nil\n}\n\nfunc main() {\n\terr := run(os.Args[1:], nil)\n\tif err != nil {\n\t\tfmt.Fprintln(os.Stderr, err)\n\t\tos.Exit(1)\n\t}\n}\n\nfunc run(args []string, opts []kong.Option) error {\n\tvar cmd rootCmd\n\tparser, err := kong.New(&cmd, append(opts, helpVars)...)\n\tif err != nil {\n\t\treturn err\n\t}\n\tk, err := parser.Parse(args)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn k.Run()\n}\n"
  },
  {
    "path": "tools/metadata/main_test.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/fs\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"net/url\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/alecthomas/kong\"\n\t\"github.com/getkin/kin-openapi/openapi3\"\n\t\"github.com/google/go-cmp/cmp\"\n\t\"github.com/google/go-github/v84/github\"\n)\n\nfunc TestUpdateGo(t *testing.T) {\n\tt.Parallel()\n\tt.Run(\"valid\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tres := runTest(t, \"testdata/update-go/valid\", \"update-go\")\n\t\tres.assertOutput(\"\", \"\")\n\t\tres.assertNoErr()\n\t\tres.checkGolden()\n\t})\n\n\tt.Run(\"invalid\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tres := runTest(t, \"testdata/update-go/invalid\", \"update-go\")\n\t\tres.assertOutput(\"\", \"\")\n\t\tres.assertErr(`\nno operations defined for AService.NoOperation\nno operations defined for AService.NoComment\nambiguous operation \"GET /ambiguous/{}\" could match any of: [GET /ambiguous/{id} GET /ambiguous/{name}]\ncould not find operation \"GET /missing/{id}\" in openapi_operations.yaml\nduplicate operation: GET /a/{a_id}\n`)\n\t\tres.checkGolden()\n\t})\n}\n\nfunc TestUnused(t *testing.T) {\n\tt.Parallel()\n\tres := runTest(t, \"testdata/unused\", \"unused\")\n\tres.assertOutput(`\nFound 3 unused operations\n\nGET /a/{a_id}\ndoc:     https://docs.github.com/rest/a/a#overridden-get-a\n\nPOST /a/{a_id}\ndoc:     https://docs.github.com/rest/a/a#update-a\n\nGET /undocumented/{undocumented_id}\n`, \"\")\n}\n\n//nolint:paralleltest // cannot use t.Parallel() when helper calls t.Setenv\nfunc TestUpdateOpenAPI(t *testing.T) {\n\ttestServer := newTestServer(t, \"main\", map[string]any{\n\t\t\"api.github.com/api.github.com.json\": openapi3.T{\n\t\t\tPaths: openapi3.NewPaths(\n\t\t\t\topenapi3.WithPath(\"/a/{a_id}\", &openapi3.PathItem{\n\t\t\t\t\tGet: &openapi3.Operation{\n\t\t\t\t\t\tExternalDocs: &openapi3.ExternalDocs{\n\t\t\t\t\t\t\tURL: \"https://docs.github.com/rest/reference/a\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t})),\n\t\t},\n\t\t\"ghec/ghec.json\": openapi3.T{\n\t\t\tPaths: openapi3.NewPaths(\n\t\t\t\topenapi3.WithPath(\"/a/b/{a_id}\", &openapi3.PathItem{\n\t\t\t\t\tGet: &openapi3.Operation{\n\t\t\t\t\t\tExternalDocs: &openapi3.ExternalDocs{\n\t\t\t\t\t\t\tURL: \"https://docs.github.com/rest/reference/a\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t})),\n\t\t},\n\t\t\"ghes-3.9/ghes-3.9.json\": openapi3.T{\n\t\t\tPaths: openapi3.NewPaths(\n\t\t\t\topenapi3.WithPath(\"/a/b/{a_id}\", &openapi3.PathItem{\n\t\t\t\t\tGet: &openapi3.Operation{\n\t\t\t\t\t\tExternalDocs: &openapi3.ExternalDocs{\n\t\t\t\t\t\t\tURL: \"https://docs.github.com/rest/reference/a\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t})),\n\t\t},\n\t\t\"ghes-3.10/ghes-3.10.json\": openapi3.T{\n\t\t\tPaths: openapi3.NewPaths(\n\t\t\t\topenapi3.WithPath(\"/a/b/{a_id}\", &openapi3.PathItem{\n\t\t\t\t\tGet: &openapi3.Operation{\n\t\t\t\t\t\tExternalDocs: &openapi3.ExternalDocs{\n\t\t\t\t\t\t\tURL: \"https://docs.github.com/rest/reference/a\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t})),\n\t\t},\n\t\t\"ghes-2.22/ghes-2.22.json\": openapi3.T{\n\t\t\tPaths: openapi3.NewPaths(\n\t\t\t\topenapi3.WithPath(\"/a/b/{a_id}\", &openapi3.PathItem{\n\t\t\t\t\tGet: &openapi3.Operation{\n\t\t\t\t\t\tExternalDocs: &openapi3.ExternalDocs{\n\t\t\t\t\t\t\tURL: \"https://docs.github.com/rest/reference/a\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t})),\n\t\t},\n\t})\n\n\tres := runTest(t, \"testdata/update-openapi\", \"update-openapi\", \"--github-url\", testServer.URL)\n\tres.assertOutput(\"\", \"\")\n\tres.assertNoErr()\n\tres.checkGolden()\n}\n\nfunc TestFormat(t *testing.T) {\n\tt.Parallel()\n\tres := runTest(t, \"testdata/format\", \"format\")\n\tres.assertOutput(\"\", \"\")\n\tres.assertNoErr()\n\tres.checkGolden()\n}\n\nfunc updateGoldenDir(t *testing.T, origDir, resultDir, goldenDir string) {\n\tt.Helper()\n\tif os.Getenv(\"UPDATE_GOLDEN\") == \"\" {\n\t\treturn\n\t}\n\tassertNilError(t, os.RemoveAll(goldenDir))\n\tassertNilError(t, filepath.WalkDir(resultDir, func(path string, d fs.DirEntry, err error) error {\n\t\tif err != nil || d.IsDir() {\n\t\t\treturn err\n\t\t}\n\t\trelName := mustRel(t, resultDir, path)\n\t\torigName := filepath.Join(origDir, relName)\n\t\t_, err = os.Stat(origName)\n\t\tif err != nil {\n\t\t\tif os.IsNotExist(err) {\n\t\t\t\terr = os.MkdirAll(filepath.Dir(filepath.Join(goldenDir, relName)), d.Type())\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\treturn copyFile(path, filepath.Join(goldenDir, relName))\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t\tresContent, err := os.ReadFile(path)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\torigContent, err := os.ReadFile(origName)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif bytes.Equal(resContent, origContent) {\n\t\t\treturn nil\n\t\t}\n\t\treturn copyFile(path, filepath.Join(goldenDir, relName))\n\t}))\n}\n\nfunc checkGoldenDir(t *testing.T, origDir, resultDir, goldenDir string) {\n\tt.Helper()\n\tgolden := true\n\tt.Cleanup(func() {\n\t\tt.Helper()\n\t\tif !golden {\n\t\t\tt.Log(\"To regenerate golden files run `UPDATE_GOLDEN=1 script/test.sh`\")\n\t\t}\n\t})\n\tupdateGoldenDir(t, origDir, resultDir, goldenDir)\n\tchecked := map[string]bool{}\n\t_, err := os.Stat(goldenDir)\n\tif err == nil {\n\t\tassertNilError(t, filepath.Walk(goldenDir, func(wantPath string, info fs.FileInfo, err error) error {\n\t\t\trelPath := mustRel(t, goldenDir, wantPath)\n\t\t\tif err != nil || info.IsDir() {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif !assertEqualFiles(t, wantPath, filepath.Join(resultDir, relPath)) {\n\t\t\t\tgolden = false\n\t\t\t}\n\t\t\tchecked[relPath] = true\n\t\t\treturn nil\n\t\t}))\n\t}\n\tassertNilError(t, filepath.Walk(origDir, func(wantPath string, info fs.FileInfo, err error) error {\n\t\trelPath := mustRel(t, origDir, wantPath)\n\t\tif err != nil || info.IsDir() || checked[relPath] {\n\t\t\treturn err\n\t\t}\n\t\tif !assertEqualFiles(t, wantPath, filepath.Join(resultDir, relPath)) {\n\t\t\tgolden = false\n\t\t}\n\t\tchecked[relPath] = true\n\t\treturn nil\n\t}))\n\tassertNilError(t, filepath.Walk(resultDir, func(resultPath string, info fs.FileInfo, err error) error {\n\t\trelPath := mustRel(t, resultDir, resultPath)\n\t\tif err != nil || info.IsDir() || checked[relPath] {\n\t\t\treturn err\n\t\t}\n\t\tgolden = false\n\t\treturn fmt.Errorf(\"found unexpected file:\\n%v\", relPath)\n\t}))\n}\n\nfunc mustRel(t *testing.T, base, target string) string {\n\tt.Helper()\n\trel, err := filepath.Rel(base, target)\n\tassertNilError(t, err)\n\treturn rel\n}\n\nfunc copyDir(t *testing.T, dst, src string) error {\n\tfmt.Println(\"dst\", dst)\n\tdst, err := filepath.Abs(dst)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn filepath.Walk(src, func(srcPath string, info fs.FileInfo, err error) error {\n\t\tif err != nil || info.IsDir() {\n\t\t\treturn err\n\t\t}\n\t\tdstPath := filepath.Join(dst, mustRel(t, src, srcPath))\n\t\terr = copyFile(srcPath, dstPath)\n\t\treturn err\n\t})\n}\n\nfunc copyFile(src, dst string) (errOut error) {\n\tsrcDirStat, err := os.Stat(filepath.Dir(src))\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = os.MkdirAll(filepath.Dir(dst), srcDirStat.Mode())\n\tif err != nil {\n\t\treturn err\n\t}\n\tdstFile, err := os.Create(dst)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\te := dstFile.Close()\n\t\tif errOut == nil {\n\t\t\terrOut = e\n\t\t}\n\t}()\n\tsrcFile, err := os.Open(src)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\te := srcFile.Close()\n\t\tif errOut == nil {\n\t\t\terrOut = e\n\t\t}\n\t}()\n\t_, err = io.Copy(dstFile, srcFile)\n\treturn err\n}\n\ntype testRun struct {\n\tt       *testing.T\n\tworkDir string\n\tsrcDir  string\n\tstdOut  bytes.Buffer\n\tstdErr  bytes.Buffer\n\terr     error\n}\n\nfunc (r testRun) checkGolden() {\n\tr.t.Helper()\n\tcheckGoldenDir(r.t, r.srcDir, r.workDir, filepath.Join(\"testdata\", \"golden\", r.t.Name()))\n}\n\nfunc (r testRun) assertOutput(stdout, stderr string) {\n\tr.t.Helper()\n\tassertEqualStrings(r.t, strings.TrimSpace(stdout), strings.TrimSpace(r.stdOut.String()))\n\tassertEqualStrings(r.t, strings.TrimSpace(stderr), strings.TrimSpace(r.stdErr.String()))\n}\n\nfunc (r testRun) assertNoErr() {\n\tr.t.Helper()\n\tassertNilError(r.t, r.err)\n}\n\nfunc (r testRun) assertErr(want string) {\n\tr.t.Helper()\n\tif r.err == nil {\n\t\tr.t.Error(\"expected error\")\n\t\treturn\n\t}\n\tif strings.TrimSpace(r.err.Error()) != strings.TrimSpace(want) {\n\t\tr.t.Errorf(\"unexpected error:\\nwant:\\n%v\\ngot:\\n%v\", want, r.err.Error())\n\t}\n}\n\nfunc runTest(t *testing.T, srcDir string, args ...string) testRun {\n\tt.Helper()\n\tsrcDir = filepath.FromSlash(srcDir)\n\tres := testRun{\n\t\tt:       t,\n\t\tworkDir: t.TempDir(),\n\t\tsrcDir:  srcDir,\n\t}\n\terr := copyDir(t, res.workDir, srcDir)\n\tif err != nil {\n\t\tt.Error(err)\n\t\treturn res\n\t}\n\tres.err = run(\n\t\tappend(args, \"-C\", res.workDir),\n\t\t[]kong.Option{kong.Writers(&res.stdOut, &res.stdErr)},\n\t)\n\treturn res\n}\n\nfunc newTestServer(t *testing.T, ref string, files map[string]any) *httptest.Server {\n\tt.Helper()\n\tjsonHandler := func(wantQuery url.Values, val any) http.HandlerFunc {\n\t\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\t\tgotQuery := r.URL.Query()\n\t\t\tqueryDiff := cmp.Diff(wantQuery, gotQuery)\n\t\t\tif queryDiff != \"\" {\n\t\t\t\tt.Errorf(\"query mismatch for %v (-want +got):\\n%v\", r.URL.Path, queryDiff)\n\t\t\t}\n\t\t\tw.WriteHeader(200)\n\t\t\terr := json.NewEncoder(w).Encode(val)\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t}\n\t}\n\trepoPath := \"/api/v3/repos/github/rest-api-description\"\n\temptyQuery := url.Values{}\n\trefQuery := url.Values{\"ref\": []string{ref}}\n\tmux := http.NewServeMux()\n\tserver := httptest.NewServer(mux)\n\tmux.HandleFunc(\n\t\tpath.Join(repoPath, \"commits\", ref),\n\t\tjsonHandler(emptyQuery, &github.RepositoryCommit{SHA: github.Ptr(\"s\")}),\n\t)\n\tvar descriptionsContent []*github.RepositoryContent\n\tfor name, content := range files {\n\t\tdescriptionsContent = append(descriptionsContent, &github.RepositoryContent{\n\t\t\tName: github.Ptr(path.Base(path.Dir(name))),\n\t\t})\n\t\tmux.HandleFunc(\n\t\t\tpath.Join(repoPath, \"contents/descriptions\", path.Dir(name)),\n\t\t\tjsonHandler(refQuery, []*github.RepositoryContent{\n\t\t\t\t{\n\t\t\t\t\tName:        github.Ptr(path.Base(name)),\n\t\t\t\t\tDownloadURL: github.Ptr(server.URL + \"/dl/\" + name),\n\t\t\t\t},\n\t\t\t}),\n\t\t)\n\t\tmux.HandleFunc(\n\t\t\tpath.Join(\"/dl\", name),\n\t\t\tjsonHandler(emptyQuery, content),\n\t\t)\n\t}\n\tmux.HandleFunc(\n\t\tpath.Join(repoPath, \"contents/descriptions\"),\n\t\tjsonHandler(refQuery, descriptionsContent),\n\t)\n\tt.Cleanup(server.Close)\n\tt.Setenv(\"GITHUB_TOKEN\", \"fake token\")\n\treturn server\n}\n\nfunc assertEqualStrings(t *testing.T, want, got string) {\n\tt.Helper()\n\tdiff := cmp.Diff(want, got)\n\tif diff != \"\" {\n\t\tt.Error(diff)\n\t}\n}\n\nfunc assertEqualFiles(t *testing.T, want, got string) bool {\n\tt.Helper()\n\twantBytes, err := os.ReadFile(want)\n\tif !assertNilError(t, err) {\n\t\treturn false\n\t}\n\twantBytes = bytes.ReplaceAll(wantBytes, []byte(\"\\r\\n\"), []byte(\"\\n\"))\n\tgotBytes, err := os.ReadFile(got)\n\tif !assertNilError(t, err) {\n\t\treturn false\n\t}\n\tgotBytes = bytes.ReplaceAll(gotBytes, []byte(\"\\r\\n\"), []byte(\"\\n\"))\n\tif !bytes.Equal(wantBytes, gotBytes) {\n\t\tdiff := cmp.Diff(string(wantBytes), string(gotBytes))\n\t\tt.Errorf(\"files %q and %q differ: %v\", want, got, diff)\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc assertNilError(t *testing.T, err error) bool {\n\tt.Helper()\n\tif err != nil {\n\t\tt.Error(err)\n\t\treturn false\n\t}\n\treturn true\n}\n"
  },
  {
    "path": "tools/metadata/metadata.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage main\n\nimport (\n\t\"bytes\"\n\t\"cmp\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"go/ast\"\n\t\"go/format\"\n\t\"go/parser\"\n\t\"go/printer\"\n\t\"go/token\"\n\t\"maps\"\n\t\"net/url\"\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"slices\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"github.com/google/go-github/v84/github\"\n\t\"go.yaml.in/yaml/v3\"\n)\n\ntype operation struct {\n\tName             string   `yaml:\"name,omitempty\" json:\"name,omitempty\"`\n\tDocumentationURL string   `yaml:\"documentation_url,omitempty\" json:\"documentation_url,omitempty\"`\n\tOpenAPIFiles     []string `yaml:\"openapi_files,omitempty\" json:\"openapi_files,omitempty\"`\n}\n\nfunc (o *operation) equal(other *operation) bool {\n\tif o.Name != other.Name || o.DocumentationURL != other.DocumentationURL {\n\t\treturn false\n\t}\n\tif len(o.OpenAPIFiles) != len(other.OpenAPIFiles) {\n\t\treturn false\n\t}\n\tfor i := range o.OpenAPIFiles {\n\t\tif o.OpenAPIFiles[i] != other.OpenAPIFiles[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc (o *operation) clone() *operation {\n\treturn &operation{\n\t\tName:             o.Name,\n\t\tDocumentationURL: o.DocumentationURL,\n\t\tOpenAPIFiles:     append([]string{}, o.OpenAPIFiles...),\n\t}\n}\n\nfunc operationsEqual(a, b []*operation) bool {\n\tif len(a) != len(b) {\n\t\treturn false\n\t}\n\tfor i := range a {\n\t\tif !a[i].equal(b[i]) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc sortOperations(ops []*operation) {\n\tslices.SortFunc(ops, func(a, b *operation) int {\n\t\tleftVerb, leftURL := parseOpName(a.Name)\n\t\trightVerb, rightURL := parseOpName(b.Name)\n\t\treturn cmp.Or(cmp.Compare(leftURL, rightURL), cmp.Compare(leftVerb, rightVerb))\n\t})\n}\n\n// normalizeOpPath returns an endpoint with all templated path parameters replaced with *.\nfunc normalizeOpPath(opPath string) string {\n\tif !strings.ContainsAny(opPath, \"{%\") {\n\t\treturn opPath\n\t}\n\tsegments := strings.Split(opPath, \"/\")\n\tfor i, segment := range segments {\n\t\tif len(segment) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif segment[0] == '{' || segment[0] == '%' {\n\t\t\tsegments[i] = \"*\"\n\t\t}\n\t}\n\treturn strings.Join(segments, \"/\")\n}\n\nfunc normalizedOpName(name string) string {\n\tverb, u := parseOpName(name)\n\treturn strings.TrimSpace(verb + \" \" + normalizeOpPath(u))\n}\n\n// matches something like \"GET /some/path\".\nvar opNameRe = regexp.MustCompile(`(?i)(\\S+)(?:\\s+(\\S.*))?`)\n\nfunc parseOpName(id string) (verb, url string) {\n\tmatch := opNameRe.FindStringSubmatch(id)\n\tif match == nil {\n\t\treturn \"\", \"\"\n\t}\n\tu := strings.TrimSpace(match[2])\n\tif !strings.HasPrefix(u, \"/\") {\n\t\tu = \"/\" + u\n\t}\n\treturn strings.ToUpper(match[1]), u\n}\n\ntype operationsFile struct {\n\tManualOps   []*operation `yaml:\"operations,omitempty\"`\n\tOverrideOps []*operation `yaml:\"operation_overrides,omitempty\"`\n\tGitCommit   string       `yaml:\"openapi_commit,omitempty\"`\n\tOpenapiOps  []*operation `yaml:\"openapi_operations,omitempty\"`\n\n\tmu          sync.Mutex\n\tresolvedOps map[string]*operation\n}\n\nfunc (m *operationsFile) resolve() {\n\tm.mu.Lock()\n\tdefer m.mu.Unlock()\n\tif m.resolvedOps != nil {\n\t\treturn\n\t}\n\tm.resolvedOps = map[string]*operation{}\n\tfor _, op := range m.OpenapiOps {\n\t\tm.resolvedOps[op.Name] = op.clone()\n\t}\n\tfor _, op := range m.ManualOps {\n\t\tm.resolvedOps[op.Name] = op.clone()\n\t}\n\tfor _, override := range m.OverrideOps {\n\t\t_, ok := m.resolvedOps[override.Name]\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\toverride = override.clone()\n\t\tif override.DocumentationURL != \"\" {\n\t\t\tm.resolvedOps[override.Name].DocumentationURL = override.DocumentationURL\n\t\t}\n\t\tif len(override.OpenAPIFiles) > 0 {\n\t\t\tm.resolvedOps[override.Name].OpenAPIFiles = override.OpenAPIFiles\n\t\t}\n\t}\n}\n\nfunc (m *operationsFile) saveFile(filename string) (errOut error) {\n\tsortOperations(m.ManualOps)\n\tsortOperations(m.OverrideOps)\n\tsortOperations(m.OpenapiOps)\n\tf, err := os.Create(filename)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\te := f.Close()\n\t\tif errOut == nil {\n\t\t\terrOut = e\n\t\t}\n\t}()\n\tenc := yaml.NewEncoder(f)\n\tenc.SetIndent(2)\n\tdefer func() {\n\t\te := enc.Close()\n\t\tif errOut == nil {\n\t\t\terrOut = e\n\t\t}\n\t}()\n\treturn enc.Encode(m)\n}\n\nfunc (m *operationsFile) updateFromGithub(ctx context.Context, client *github.Client, ref string) error {\n\tcommit, resp, err := client.Repositories.GetCommit(ctx, descriptionsOwnerName, descriptionsRepoName, ref, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif resp.StatusCode != 200 {\n\t\treturn fmt.Errorf(\"unexpected status code: %v\", resp.Status)\n\t}\n\tops, err := getOpsFromGithub(ctx, client, ref)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !operationsEqual(m.OpenapiOps, ops) {\n\t\tm.OpenapiOps = ops\n\t\tm.GitCommit = commit.GetSHA()\n\t}\n\treturn nil\n}\n\nfunc loadOperationsFile(filename string) (*operationsFile, error) {\n\tb, err := os.ReadFile(filename)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar opsFile operationsFile\n\terr = yaml.Unmarshal(b, &opsFile)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &opsFile, nil\n}\n\nfunc addOperation(ops []*operation, filename, opName, docURL string) []*operation {\n\tfor _, op := range ops {\n\t\tif opName != op.Name {\n\t\t\tcontinue\n\t\t}\n\t\tif len(op.OpenAPIFiles) == 0 {\n\t\t\top.OpenAPIFiles = append(op.OpenAPIFiles, filename)\n\t\t\top.DocumentationURL = docURL\n\t\t\treturn ops\n\t\t}\n\t\t// just append to files, but only add the first ghes file\n\t\tif !strings.Contains(filename, \"/ghes\") {\n\t\t\top.OpenAPIFiles = append(op.OpenAPIFiles, filename)\n\t\t\treturn ops\n\t\t}\n\t\tfor _, f := range op.OpenAPIFiles {\n\t\t\tif strings.Contains(f, \"/ghes\") {\n\t\t\t\treturn ops\n\t\t\t}\n\t\t}\n\t\top.OpenAPIFiles = append(op.OpenAPIFiles, filename)\n\t\treturn ops\n\t}\n\treturn append(ops, &operation{\n\t\tName:             opName,\n\t\tOpenAPIFiles:     []string{filename},\n\t\tDocumentationURL: docURL,\n\t})\n}\n\nfunc unusedOps(opsFile *operationsFile, dir string) ([]*operation, error) {\n\tvar usedOps map[string]bool\n\terr := visitServiceMethods(dir, false, func(_ string, fn *ast.FuncDecl, cmap ast.CommentMap) error {\n\t\tops, err := methodOps(opsFile, cmap, fn)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor _, op := range ops {\n\t\t\tif usedOps == nil {\n\t\t\t\tusedOps = map[string]bool{}\n\t\t\t}\n\t\t\tusedOps[op.Name] = true\n\t\t}\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar result []*operation\n\topsFile.resolve()\n\tfor opName, op := range opsFile.resolvedOps {\n\t\tif !usedOps[opName] {\n\t\t\tresult = append(result, op)\n\t\t}\n\t}\n\tsortOperations(result)\n\treturn result, nil\n}\n\nfunc updateDocsVisitor(opsFile *operationsFile) nodeVisitor {\n\treturn func(serviceMethod string, fn *ast.FuncDecl, cmap ast.CommentMap) error {\n\t\tlinksMap := map[string]struct{}{}\n\t\tundocMap := map[string]bool{}\n\n\t\tops, err := methodOps(opsFile, cmap, fn)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif len(ops) == 0 {\n\t\t\treturn fmt.Errorf(\"no operations defined for %v\", serviceMethod)\n\t\t}\n\n\t\tfor _, op := range ops {\n\t\t\tif op.DocumentationURL == \"\" {\n\t\t\t\tundocMap[op.Name] = true\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tlinksMap[op.DocumentationURL] = struct{}{}\n\t\t}\n\t\tundocumentedOps := slices.Sorted(maps.Keys(undocMap))\n\n\t\t// Find the group that comes before the function\n\t\tvar group *ast.CommentGroup\n\t\tfor _, g := range cmap[fn] {\n\t\t\tif g.End() == fn.Pos()-1 {\n\t\t\t\tgroup = g\n\t\t\t}\n\t\t}\n\n\t\t// If there is no group, create one\n\t\tif group == nil {\n\t\t\tgroup = &ast.CommentGroup{\n\t\t\t\tList: []*ast.Comment{{Text: \"//\", Slash: fn.Pos() - 1}},\n\t\t\t}\n\t\t\tcmap[fn] = append(cmap[fn], group)\n\t\t}\n\n\t\torigList := group.List\n\t\tgroup.List = nil\n\t\tfor _, comment := range origList {\n\t\t\tif metaOpRe.MatchString(comment.Text) ||\n\t\t\t\tdocLineRE.MatchString(comment.Text) ||\n\t\t\t\tundocRE.MatchString(comment.Text) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tgroup.List = append(group.List, comment)\n\t\t}\n\n\t\t// add an empty line before adding doc links\n\t\tgroup.List = append(group.List, &ast.Comment{Text: \"//\"})\n\n\t\tdocLinks := slices.Sorted(maps.Keys(linksMap))\n\t\tfor i, dl := range docLinks {\n\t\t\tgroup.List = append(\n\t\t\t\tgroup.List,\n\t\t\t\t&ast.Comment{\n\t\t\t\t\tText: \"// GitHub API docs: \" + cleanURLPath(dl),\n\t\t\t\t},\n\t\t\t)\n\t\t\tif i < len(docLinks)-1 {\n\t\t\t\t// add empty line between doc links\n\t\t\t\tgroup.List = append(group.List, &ast.Comment{Text: \"//\"})\n\t\t\t}\n\t\t}\n\t\t_, methodName, _ := strings.Cut(serviceMethod, \".\")\n\t\tfor _, opName := range undocumentedOps {\n\t\t\tline := fmt.Sprintf(\"// Note: %v uses the undocumented GitHub API endpoint %q.\", methodName, opName)\n\t\t\tgroup.List = append(group.List, &ast.Comment{Text: line})\n\t\t}\n\t\tfor _, op := range ops {\n\t\t\tgroup.List = append(group.List, &ast.Comment{\n\t\t\t\tText: fmt.Sprintf(\"//meta:operation %v\", op.Name),\n\t\t\t})\n\t\t}\n\t\tgroup.List[0].Slash = fn.Pos() - 1\n\t\tfor i := 1; i < len(group.List); i++ {\n\t\t\tgroup.List[i].Slash = token.NoPos\n\t\t}\n\t\treturn nil\n\t}\n}\n\n// updateDocs updates the code comments in dir with doc urls from metadata.\nfunc updateDocs(opsFile *operationsFile, dir string) error {\n\treturn visitServiceMethods(dir, true, updateDocsVisitor(opsFile))\n}\n\ntype nodeVisitor func(serviceMethod string, fn *ast.FuncDecl, cmap ast.CommentMap) error\n\n// visitServiceMethods runs visit on the ast.Node of every service method in dir. When writeFiles is true it will\n// save any changes back to the original file.\nfunc visitServiceMethods(dir string, writeFiles bool, visit nodeVisitor) error {\n\tdirEntries, err := os.ReadDir(dir)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, dirEntry := range dirEntries {\n\t\tfilename := filepath.Join(dir, dirEntry.Name())\n\t\tif dirEntry.IsDir() ||\n\t\t\t!strings.HasSuffix(filename, \".go\") ||\n\t\t\tstrings.HasSuffix(filename, \"_test.go\") {\n\t\t\tcontinue\n\t\t}\n\t\terr = errors.Join(err, visitFileMethods(writeFiles, filename, visit))\n\t}\n\treturn err\n}\n\nfunc visitFileMethods(updateFile bool, filename string, visit nodeVisitor) error {\n\tcontent, err := os.ReadFile(filename)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcontent = bytes.ReplaceAll(content, []byte(\"\\r\\n\"), []byte(\"\\n\"))\n\n\tfset := token.NewFileSet()\n\tfileNode, err := parser.ParseFile(fset, \"\", content, parser.ParseComments)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcmap := ast.NewCommentMap(fset, fileNode, fileNode.Comments)\n\n\tast.Inspect(fileNode, func(n ast.Node) bool {\n\t\tfn, ok := n.(*ast.FuncDecl)\n\t\tif !ok {\n\t\t\treturn true\n\t\t}\n\t\tserviceMethod := nodeServiceMethod(fn)\n\t\tif serviceMethod == \"\" {\n\t\t\treturn true\n\t\t}\n\t\te := visit(serviceMethod, fn, cmap)\n\t\terr = errors.Join(err, e)\n\t\treturn true\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !updateFile {\n\t\treturn nil\n\t}\n\tfileNode.Comments = cmap.Filter(fileNode).Comments()\n\tvar buf bytes.Buffer\n\terr = printer.Fprint(&buf, fset, fileNode)\n\tif err != nil {\n\t\treturn err\n\t}\n\tupdatedContent, err := format.Source(buf.Bytes())\n\tif err != nil {\n\t\treturn err\n\t}\n\tif bytes.Equal(content, updatedContent) {\n\t\treturn nil\n\t}\n\treturn os.WriteFile(filename, updatedContent, 0o600)\n}\n\nvar (\n\tmetaOpRe  = regexp.MustCompile(`(?i)\\s*//\\s*meta:operation\\s+(\\S.+)`)\n\tundocRE   = regexp.MustCompile(`(?i)\\s*//\\s*Note:\\s+\\S.+ uses the undocumented GitHub API endpoint`)\n\tdocLineRE = regexp.MustCompile(`(?i)\\s*//\\s*GitHub\\s+API\\s+docs:`)\n)\n\n// methodOps parses a method's comments for //meta:operation lines and returns the corresponding operations.\nfunc methodOps(opsFile *operationsFile, cmap ast.CommentMap, fn *ast.FuncDecl) ([]*operation, error) {\n\tvar ops []*operation\n\tvar err error\n\tseen := map[string]bool{}\n\tfor _, g := range cmap[fn] {\n\t\tfor _, c := range g.List {\n\t\t\tmatch := metaOpRe.FindStringSubmatch(c.Text)\n\t\t\tif match == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\topName := strings.TrimSpace(match[1])\n\t\t\topsFile.resolve()\n\t\t\tvar found []*operation\n\t\t\tnorm := normalizedOpName(opName)\n\t\t\tfor n := range opsFile.resolvedOps {\n\t\t\t\tif normalizedOpName(n) == norm {\n\t\t\t\t\tfound = append(found, opsFile.resolvedOps[n])\n\t\t\t\t}\n\t\t\t}\n\t\t\tswitch len(found) {\n\t\t\tcase 0:\n\t\t\t\terr = errors.Join(err, fmt.Errorf(\"could not find operation %q in openapi_operations.yaml\", opName))\n\t\t\tcase 1:\n\t\t\t\tname := found[0].Name\n\t\t\t\tif seen[name] {\n\t\t\t\t\terr = errors.Join(err, fmt.Errorf(\"duplicate operation: %v\", name))\n\t\t\t\t}\n\t\t\t\tseen[name] = true\n\t\t\t\tops = append(ops, found[0])\n\t\t\tdefault:\n\t\t\t\tvar foundNames []string\n\t\t\t\tfor _, op := range found {\n\t\t\t\t\tfoundNames = append(foundNames, op.Name)\n\t\t\t\t}\n\t\t\t\tslices.Sort(foundNames)\n\t\t\t\terr = errors.Join(err, fmt.Errorf(\"ambiguous operation %q could match any of: %v\", opName, foundNames))\n\t\t\t}\n\t\t}\n\t}\n\tsortOperations(ops)\n\treturn ops, err\n}\n\n// cleanURLPath runs path.Clean on the url path. This is to remove the unsightly double slashes from some\n// of the urls in github's openapi descriptions.\nfunc cleanURLPath(docURL string) string {\n\tu, err := url.Parse(docURL)\n\tif err != nil {\n\t\treturn docURL\n\t}\n\tu.Path = path.Clean(u.Path)\n\treturn u.String()\n}\n\n// nodeServiceMethod returns the name of the service method represented by fn, or \"\" if fn is not a service method.\n// Name is in the form of \"Receiver.Function\", for example \"IssuesService.Create\".\nfunc nodeServiceMethod(fn *ast.FuncDecl) string {\n\tif fn.Recv == nil || len(fn.Recv.List) != 1 {\n\t\treturn \"\"\n\t}\n\trecv := fn.Recv.List[0]\n\tse, ok := recv.Type.(*ast.StarExpr)\n\tif !ok {\n\t\treturn \"\"\n\t}\n\tid, ok := se.X.(*ast.Ident)\n\tif !ok {\n\t\treturn \"\"\n\t}\n\n\t// We only want exported methods on exported types where the type name ends in \"Service\".\n\tif !id.IsExported() || !fn.Name.IsExported() || !strings.HasSuffix(id.Name, \"Service\") {\n\t\treturn \"\"\n\t}\n\n\t// Skip generated Iterator methods.\n\tif strings.HasSuffix(fn.Name.Name, \"Iter\") {\n\t\treturn \"\"\n\t}\n\n\tserviceMethod := id.Name + \".\" + fn.Name.Name\n\tif skipServiceMethod[serviceMethod] {\n\t\treturn \"\"\n\t}\n\n\treturn serviceMethod\n}\n\n// See: https://github.com/google/go-github/issues/3894\nvar skipServiceMethod = map[string]bool{\n\t\"BillingService.GetOrganizationPackagesBilling\": true,\n\t\"BillingService.GetOrganizationStorageBilling\":  true,\n\t\"BillingService.GetPackagesBilling\":             true,\n\t\"BillingService.GetStorageBilling\":              true,\n}\n"
  },
  {
    "path": "tools/metadata/metadata_test.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage main\n\nimport (\n\t\"testing\"\n)\n\nfunc Test_normalizedOpName(t *testing.T) {\n\tt.Parallel()\n\tfor _, td := range []struct {\n\t\tname string\n\t\twant string\n\t}{\n\t\t{name: \"\", want: \"\"},\n\t\t{name: \"get /foo/{id}\", want: \"GET /foo/*\"},\n\t\t{name: \"get foo\", want: \"GET /foo\"},\n\t} {\n\t\tt.Run(td.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tgot := normalizedOpName(td.name)\n\t\t\tif got != td.want {\n\t\t\t\tt.Errorf(\"normalizedOpName() = %v, want %v\", got, td.want)\n\t\t\t}\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "tools/metadata/openapi.go",
    "content": "// Copyright 2023 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage main\n\nimport (\n\t\"cmp\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"regexp\"\n\t\"slices\"\n\t\"strconv\"\n\n\t\"github.com/getkin/kin-openapi/openapi3\"\n\t\"github.com/google/go-github/v84/github\"\n\t\"golang.org/x/sync/errgroup\"\n)\n\nconst (\n\tdescriptionsOwnerName = \"github\"\n\tdescriptionsRepoName  = \"rest-api-description\"\n\tdescriptionsPath      = \"descriptions\"\n)\n\ntype openapiFile struct {\n\tdescription  *openapi3.T\n\tfilename     string\n\tplan         string\n\tplanIdx      int\n\treleaseMajor int\n\treleaseMinor int\n}\n\nfunc getOpsFromGithub(ctx context.Context, client *github.Client, gitRef string) ([]*operation, error) {\n\tdescs, err := getDescriptions(ctx, client, gitRef)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar ops []*operation\n\tfor _, desc := range descs {\n\t\tfor p, pathItem := range desc.description.Paths.Map() {\n\t\t\tfor method, op := range pathItem.Operations() {\n\t\t\t\tdocURL := \"\"\n\t\t\t\tif op.ExternalDocs != nil {\n\t\t\t\t\tdocURL = op.ExternalDocs.URL\n\t\t\t\t}\n\t\t\t\tops = addOperation(ops, desc.filename, method+\" \"+p, docURL)\n\t\t\t}\n\t\t}\n\t}\n\tsortOperations(ops)\n\treturn ops, nil\n}\n\nfunc (o *openapiFile) loadDescription(ctx context.Context, client *github.Client, gitRef string) error {\n\tcontents, resp, err := client.Repositories.DownloadContents(\n\t\tctx,\n\t\tdescriptionsOwnerName,\n\t\tdescriptionsRepoName,\n\t\to.filename,\n\t\t&github.RepositoryContentGetOptions{Ref: gitRef},\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif resp.StatusCode != 200 {\n\t\treturn fmt.Errorf(\"unexpected status code: %v\", resp.Status)\n\t}\n\tb, err := io.ReadAll(contents)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = contents.Close()\n\tif err != nil {\n\t\treturn err\n\t}\n\to.description, err = openapi3.NewLoader().LoadFromData(b)\n\treturn err\n}\n\nvar dirPatterns = []*regexp.Regexp{\n\tregexp.MustCompile(`^(?P<plan>api\\.github\\.com)(-(?P<major>\\d+)\\.(?P<minor>\\d+))?$`),\n\tregexp.MustCompile(`^(?P<plan>ghec)(-(?P<major>\\d+)\\.(?P<minor>\\d+))?$`),\n\tregexp.MustCompile(`^(?P<plan>ghes)(-(?P<major>\\d+)\\.(?P<minor>\\d+))?$`),\n}\n\n// getDescriptions loads OpenapiFiles for all the OpenAPI 3.0 description files in github/rest-api-description.\n// This assumes that all directories in \"descriptions/\" contain OpenAPI 3.0 description files with the same\n// name as the directory (plus the \".json\" extension). For example, \"descriptions/api.github.com/api.github.com.json\".\n// Results are sorted by these rules:\n//   - Directories that don't match any of the patterns in dirPatterns are removed.\n//   - Directories are sorted by the pattern that matched in the same order they appear in dirPatterns.\n//   - Directories are then sorted by major and minor version in descending order.\nfunc getDescriptions(ctx context.Context, client *github.Client, gitRef string) ([]*openapiFile, error) {\n\t_, dir, resp, err := client.Repositories.GetContents(\n\t\tctx,\n\t\tdescriptionsOwnerName,\n\t\tdescriptionsRepoName,\n\t\tdescriptionsPath,\n\t\t&github.RepositoryContentGetOptions{Ref: gitRef},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif resp.StatusCode != 200 {\n\t\treturn nil, fmt.Errorf(\"unexpected status code: %v\", resp.Status)\n\t}\n\tfiles := make([]*openapiFile, 0, len(dir))\n\tfor _, d := range dir {\n\t\tfor i, pattern := range dirPatterns {\n\t\t\tm := pattern.FindStringSubmatch(d.GetName())\n\t\t\tif m == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfile := openapiFile{\n\t\t\t\tfilename: fmt.Sprintf(\"descriptions/%v/%v.json\", d.GetName(), d.GetName()),\n\t\t\t\tplan:     m[pattern.SubexpIndex(\"plan\")],\n\t\t\t\tplanIdx:  i,\n\t\t\t}\n\t\t\trawMajor := m[pattern.SubexpIndex(\"major\")]\n\t\t\tif rawMajor != \"\" {\n\t\t\t\tfile.releaseMajor, err = strconv.Atoi(rawMajor)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t}\n\t\t\trawMinor := m[pattern.SubexpIndex(\"minor\")]\n\t\t\tif rawMinor != \"\" {\n\t\t\t\tfile.releaseMinor, err = strconv.Atoi(rawMinor)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t}\n\t\t\tif file.plan == \"ghes\" && file.releaseMajor < 3 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfiles = append(files, &file)\n\t\t\tbreak\n\t\t}\n\t}\n\tslices.SortFunc(files, func(a, b *openapiFile) int {\n\t\t// sort by the following rules:\n\t\t//   - planIdx ascending\n\t\t//   - releaseMajor descending\n\t\t//   - releaseMinor descending\n\t\treturn cmp.Or(\n\t\t\tcmp.Compare(a.planIdx, b.planIdx),\n\t\t\tcmp.Compare(b.releaseMajor, a.releaseMajor),\n\t\t\tcmp.Compare(b.releaseMinor, a.releaseMinor),\n\t\t)\n\t})\n\tg, ctx := errgroup.WithContext(ctx)\n\tfor _, file := range files {\n\t\tf := file\n\t\tg.Go(func() error {\n\t\t\treturn f.loadDescription(ctx, client, gitRef)\n\t\t})\n\t}\n\terr = g.Wait()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn files, nil\n}\n"
  },
  {
    "path": "tools/metadata/testdata/format/openapi_operations.yaml",
    "content": "\noperations:\n  - name: POST /a/{a_id}\n    documentation_url: https://docs.github.com/rest/a/a#update-a\nopenapi_operations:\n  - name: GET /a/{a_id}\n    documentation_url: https://docs.github.com/rest/a/a#get-a\n  - name: GET /undocumented/{undocumented_id}\n\noperation_overrides:\n  - name: GET /a/{a_id_noncanonical2} # this comment will disappear\n    documentation_url: https://docs.github.com/rest/a/a#overridden-get-a\n  - name: GET /fake/{a_id}\n    documentation_url: https://docs.github.com/rest/a/a#overridden-get-a\n\nopenapi_commit: b8dafbe912a3be421d21346faa2b29bf15e6f84d\n"
  },
  {
    "path": "tools/metadata/testdata/golden/TestFormat/openapi_operations.yaml",
    "content": "operations:\n  - name: POST /a/{a_id}\n    documentation_url: https://docs.github.com/rest/a/a#update-a\noperation_overrides:\n  - name: GET /a/{a_id_noncanonical2}\n    documentation_url: https://docs.github.com/rest/a/a#overridden-get-a\n  - name: GET /fake/{a_id}\n    documentation_url: https://docs.github.com/rest/a/a#overridden-get-a\nopenapi_commit: b8dafbe912a3be421d21346faa2b29bf15e6f84d\nopenapi_operations:\n  - name: GET /a/{a_id}\n    documentation_url: https://docs.github.com/rest/a/a#get-a\n  - name: GET /undocumented/{undocumented_id}\n"
  },
  {
    "path": "tools/metadata/testdata/golden/TestUpdateGo/valid/github/a.go",
    "content": "package github\n\ntype AService struct{}\n\n// Get gets an A\n//\n// GitHub API docs: https://docs.github.com/rest/a/a#overridden-get-a\n//\n//meta:operation GET /a/{a_id}\nfunc (s *AService) Get() {}\n\n// Undocumented uses an undocumented operation\n//\n// Note: Undocumented uses the undocumented GitHub API endpoint \"GET /undocumented/{undocumented_id}\".\n//\n//meta:operation GET /undocumented/{undocumented_id}\nfunc (s *AService) Undocumented() {}\n\n// OutdatedLinks has links that are outdated or wrong\n//\n// GitHub API docs: https://docs.github.com/rest/a/a#update-a\n//\n//meta:operation POST /a/{a_id}\nfunc (s *AService) OutdatedLinks() {}\n\n// GitHub API docs: https://docs.github.com/rest/a/a#overridden-get-a\n//\n//meta:operation GET /a/{a_id}\nfunc (s *AService) Uncommented() {}\n\n// Get gets a user.\n//\n// GitHub API docs: https://docs.github.com/rest/users/users#get-a-user\n//\n// GitHub API docs: https://docs.github.com/rest/users/users#get-the-authenticated-user\n//\n//meta:operation GET /user\n//meta:operation GET /users/{username}\nfunc (s *AService) Get(user string) {}\n\nfunc (s *AService) unexported() {}\n\nfunc NotAMethod() {}\n\ntype internalService struct{}\n\nfunc (i *internalService) Get() {}\n"
  },
  {
    "path": "tools/metadata/testdata/golden/TestUpdateOpenAPI/openapi_operations.yaml",
    "content": "operations:\n  - name: GET /a/{a_id}\n    documentation_url: https://docs.github.com/rest/a/a#get-a\nopenapi_commit: s\nopenapi_operations:\n  - name: GET /a/b/{a_id}\n    documentation_url: https://docs.github.com/rest/reference/a\n    openapi_files:\n      - descriptions/ghec/ghec.json\n      - descriptions/ghes-3.10/ghes-3.10.json\n  - name: GET /a/{a_id}\n    documentation_url: https://docs.github.com/rest/reference/a\n    openapi_files:\n      - descriptions/api.github.com/api.github.com.json\n"
  },
  {
    "path": "tools/metadata/testdata/unused/github/a.go",
    "content": "package github\n\ntype AService struct{}\n\n// PostABC\n//\n//meta:operation POST /a/b/c/{a_id}\nfunc (a *AService) PostABC() {}\n"
  },
  {
    "path": "tools/metadata/testdata/unused/openapi_operations.yaml",
    "content": "openapi_commit: b8dafbe912a3be421d21346faa2b29bf15e6f84d\noperations:\n  - name: POST /a/{a_id}\n    documentation_url: https://docs.github.com/rest/a/a#update-a\nopenapi_operations:\n  - name: POST /a/b/c/{a_id}\n    documentation_url: https://docs.github.com/rest/a/b/c#update-a\n  - name: GET /a/{a_id}\n    documentation_url: https://docs.github.com/rest/a/a#get-a\n  - name: GET /undocumented/{undocumented_id}\noperation_overrides:\n  - name: GET /a/{a_id}\n    documentation_url: https://docs.github.com/rest/a/a#overridden-get-a\n  - name: GET /fake/{a_id}\n    documentation_url: https://docs.github.com/rest/a/a#overridden-get-a\n"
  },
  {
    "path": "tools/metadata/testdata/update-go/invalid/github/a.go",
    "content": "package github\n\ntype AService struct{}\n\n// NoOperation has no operation\nfunc (*AService) NoOperation() {}\n\nfunc (*AService) NoComment() {}\n\n// Ambiguous has an operation that could resolve to multiple operations\n//\n//meta:operation GET /ambiguous/{}\nfunc (*AService) Ambiguous() {}\n\n// MissingOperation has an operation that is missing from the OpenAPI spec\n//\n//meta:operation GET /missing/{id}\nfunc (*AService) MissingOperation() {}\n\n// DuplicateOperations has duplicate operations\n//\n//meta:operation GET /a/{a_id}\n//meta:operation POST /a/{a_id}\n//meta:operation GET /a/{a_id}\nfunc (*AService) DuplicateOperations() {}\n"
  },
  {
    "path": "tools/metadata/testdata/update-go/invalid/openapi_operations.yaml",
    "content": "operations:\n  - name: POST /a/{a_id}\n    documentation_url: https://docs.github.com/rest/a/a#update-a\nopenapi_operations:\n  - name: GET /ambiguous/{id}\n    documentation_url: https://docs.github.com/rest/ambiguous/\n  - name: GET /ambiguous/{name}\n    documentation_url: https://docs.github.com/rest/ambiguous/\n  - name: GET /undocumented/{undocumented_id}\n  - name: GET /a/{a_id}\n    documentation_url: https://docs.github.com/rest/a/a#get-a\noperation_overrides:\n  - name: GET /a/{a_id}\n    documentation_url: https://docs.github.com/rest/a/a#overridden-get-a\n  - name: GET /fake/{a_id}\n    documentation_url: https://docs.github.com/rest/a/a#overridden-get-a\n"
  },
  {
    "path": "tools/metadata/testdata/update-go/valid/github/a.go",
    "content": "package github\n\ntype AService struct{}\n\n// Get gets an A\n//\n//meta:operation GET /a/{non-canonical-id}\nfunc (s *AService) Get() {}\n\n// Undocumented uses an undocumented operation\n//\n//meta:operation GET /undocumented/{undocumented_id}\nfunc (s *AService) Undocumented() {}\n\n// OutdatedLinks has links that are outdated or wrong\n//\n// GitHub API docs: https://docs.github.com/rest/a/a#get-a\n// GitHub API docs: https://example.com\n// Note: Undocumented uses the undocumented GitHub API endpoint \"GET /undocumented/{undocumented_id}\".\n//\n//meta:operation post a/{a_id}\nfunc (s *AService) OutdatedLinks() {}\n\n//meta:operation GET /a/{a_id}\nfunc (s *AService) Uncommented() {}\n\n// Get gets a user.\n//\n//meta:operation GET /user\n//meta:operation GET /users/{username}\nfunc (s *AService) Get(user string) {}\n\nfunc (s *AService) unexported() {}\n\nfunc NotAMethod() {}\n\ntype internalService struct{}\n\nfunc (i *internalService) Get() {}\n"
  },
  {
    "path": "tools/metadata/testdata/update-go/valid/github/ignoreme.txt",
    "content": ""
  },
  {
    "path": "tools/metadata/testdata/update-go/valid/openapi_operations.yaml",
    "content": "openapi_commit: b8dafbe912a3be421d21346faa2b29bf15e6f84d\noperations:\n  - name: POST /a/{a_id}\n    documentation_url: https://docs.github.com/rest/a/a#update-a\nopenapi_operations:\n  - name: GET /a/{a_id}\n    documentation_url: https://docs.github.com/rest/a/a#get-a\n  - name: GET /undocumented/{undocumented_id}\n  - name: GET /user\n    documentation_url: https://docs.github.com/rest/users/users#get-a-user\n  - name: GET /users/{username}\n    documentation_url: https://docs.github.com/rest/users/users#get-the-authenticated-user\noperation_overrides:\n  - name: GET /a/{a_id}\n    documentation_url: https://docs.github.com/rest/a/a#overridden-get-a\n  - name: GET /fake/{a_id}\n    documentation_url: https://docs.github.com/rest/a/a#overridden-get-a\n"
  },
  {
    "path": "tools/metadata/testdata/update-openapi/openapi_operations.yaml",
    "content": "operations:\n  - name: GET /a/{a_id}\n    documentation_url: https://docs.github.com/rest/a/a#get-a\nopenapi_commit: s\n"
  },
  {
    "path": "tools/sliceofpointers/go.mod",
    "content": "module tools/sliceofpointers\n\ngo 1.25.0\n\nrequire (\n\tgithub.com/golangci/plugin-module-register v0.1.2\n\tgolang.org/x/tools v0.43.0\n)\n\nrequire (\n\tgolang.org/x/mod v0.34.0 // indirect\n\tgolang.org/x/sync v0.20.0 // indirect\n)\n"
  },
  {
    "path": "tools/sliceofpointers/go.sum",
    "content": "github.com/golangci/plugin-module-register v0.1.2 h1:e5WM6PO6NIAEcij3B053CohVp3HIYbzSuP53UAYgOpg=\ngithub.com/golangci/plugin-module-register v0.1.2/go.mod h1:1+QGTsKBvAIvPvoY/os+G5eoqxWn70HYDm2uvUyGuVw=\ngithub.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=\ngithub.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=\ngolang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI=\ngolang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY=\ngolang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=\ngolang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=\ngolang.org/x/tools v0.43.0 h1:12BdW9CeB3Z+J/I/wj34VMl8X+fEXBxVR90JeMX5E7s=\ngolang.org/x/tools v0.43.0/go.mod h1:uHkMso649BX2cZK6+RpuIPXS3ho2hZo4FVwfoy1vIk0=\n"
  },
  {
    "path": "tools/sliceofpointers/sliceofpointers.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package sliceofpointers is a custom linter to be used by\n// golangci-lint to find instances of `[]*string` and\n// slices of structs without pointers and report them.\n// See: https://github.com/google/go-github/issues/180\npackage sliceofpointers\n\nimport (\n\t\"go/ast\"\n\t\"go/token\"\n\n\t\"github.com/golangci/plugin-module-register/register\"\n\t\"golang.org/x/tools/go/analysis\"\n)\n\nfunc init() {\n\tregister.Plugin(\"sliceofpointers\", New)\n}\n\n// SliceOfPointersPlugin is a custom linter plugin for golangci-lint.\ntype SliceOfPointersPlugin struct{}\n\n// New returns an analysis.Analyzer to use with golangci-lint.\nfunc New(_ any) (register.LinterPlugin, error) {\n\treturn &SliceOfPointersPlugin{}, nil\n}\n\n// BuildAnalyzers builds the analyzers for the SliceOfPointersPlugin.\nfunc (f *SliceOfPointersPlugin) BuildAnalyzers() ([]*analysis.Analyzer, error) {\n\treturn []*analysis.Analyzer{\n\t\t{\n\t\t\tName: \"sliceofpointers\",\n\t\t\tDoc:  \"Reports usage of []*string and slices of structs without pointers.\",\n\t\t\tRun:  run,\n\t\t},\n\t}, nil\n}\n\n// GetLoadMode returns the load mode for the SliceOfPointersPlugin.\nfunc (f *SliceOfPointersPlugin) GetLoadMode() string {\n\treturn register.LoadModeSyntax\n}\n\nfunc run(pass *analysis.Pass) (any, error) {\n\tfor _, file := range pass.Files {\n\t\tast.Inspect(file, func(n ast.Node) bool {\n\t\t\tif n == nil {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\tif t, ok := n.(*ast.ArrayType); ok {\n\t\t\t\tcheckArrayType(t, t.Pos(), pass)\n\t\t\t}\n\n\t\t\treturn true\n\t\t})\n\t}\n\treturn nil, nil\n}\n\nfunc checkArrayType(arrType *ast.ArrayType, tokenPos token.Pos, pass *analysis.Pass) {\n\tif starExpr, ok := arrType.Elt.(*ast.StarExpr); ok {\n\t\tif ident, ok := starExpr.X.(*ast.Ident); ok && ident.Name == \"string\" {\n\t\t\tconst msg = \"use []string instead of []*string\"\n\t\t\tpass.Reportf(tokenPos, msg)\n\t\t}\n\t} else if ident, ok := arrType.Elt.(*ast.Ident); ok && ident.Obj != nil {\n\t\tif _, ok := ident.Obj.Decl.(*ast.TypeSpec).Type.(*ast.StructType); ok {\n\t\t\tpass.Reportf(tokenPos, \"use []*%v instead of []%[1]v\", ident.Name)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "tools/sliceofpointers/sliceofpointers_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage sliceofpointers\n\nimport (\n\t\"testing\"\n\n\t\"golang.org/x/tools/go/analysis/analysistest\"\n)\n\nfunc TestRun(t *testing.T) {\n\tt.Parallel()\n\ttestdata := analysistest.TestData()\n\tplugin, _ := New(nil)\n\tanalyzers, _ := plugin.BuildAnalyzers()\n\tanalysistest.Run(t, testdata, analyzers[0], \"has-warnings\", \"no-warnings\")\n}\n"
  },
  {
    "path": "tools/sliceofpointers/testdata/src/has-warnings/main.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage main\n\ntype Example struct {\n\tStrings []*string `json:\"strings,omitempty\"` // want `use \\[\\]string instead of \\[\\]\\*string`\n\tThings  []Thing   `json:\"things,omitempty\"`  // want `use \\[\\]\\*Thing instead of \\[\\]Thing`\n}\n\ntype Thing struct {\n}\n\nfunc main() {\n\tslice1 := []*string{} // want `use \\[\\]string instead of \\[\\]\\*string`\n\t_ = slice1\n\tslice2 := []Thing{} // want `use \\[\\]\\*Thing instead of \\[\\]Thing`\n\t_ = slice2\n}\n"
  },
  {
    "path": "tools/sliceofpointers/testdata/src/no-warnings/main.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage main\n\ntype Example struct {\n\tStrings []string `json:\"strings,omitempty\"` // Should not be flagged\n\tThings  []*Thing `json:\"things,omitempty\"`  // Should not be flagged\n}\n\ntype Thing struct {\n}\n\nfunc main() {\n\tslice1 := []string{} // Should not be flagged\n\t_ = slice1\n\tslice2 := []*Thing{} // Should not be flagged\n\t_ = slice2\n}\n"
  },
  {
    "path": "tools/structfield/go.mod",
    "content": "module github.com/google/go-github/v84/tools/structfield\n\ngo 1.25.0\n\nrequire (\n\tgithub.com/golangci/plugin-module-register v0.1.2\n\tgolang.org/x/tools v0.43.0\n)\n\nrequire (\n\tgolang.org/x/mod v0.34.0 // indirect\n\tgolang.org/x/sync v0.20.0 // indirect\n)\n"
  },
  {
    "path": "tools/structfield/go.sum",
    "content": "github.com/golangci/plugin-module-register v0.1.2 h1:e5WM6PO6NIAEcij3B053CohVp3HIYbzSuP53UAYgOpg=\ngithub.com/golangci/plugin-module-register v0.1.2/go.mod h1:1+QGTsKBvAIvPvoY/os+G5eoqxWn70HYDm2uvUyGuVw=\ngithub.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=\ngithub.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=\ngolang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI=\ngolang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY=\ngolang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=\ngolang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=\ngolang.org/x/tools v0.43.0 h1:12BdW9CeB3Z+J/I/wj34VMl8X+fEXBxVR90JeMX5E7s=\ngolang.org/x/tools v0.43.0/go.mod h1:uHkMso649BX2cZK6+RpuIPXS3ho2hZo4FVwfoy1vIk0=\n"
  },
  {
    "path": "tools/structfield/structfield.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// Package structfield is a custom linter to be used by\n// golangci-lint to find instances where the Go field name\n// of a struct does not match the JSON or URL tag name.\n// It honors idiomatic Go initialisms and handles the\n// special case of `Github` vs `GitHub` as agreed upon\n// by the original author of the repo.\n// It also checks that fields with \"omitempty\" tags are reference types\n// for `json` struct tags and value types for `url` struct tags.\npackage structfield\n\nimport (\n\t\"fmt\"\n\t\"go/ast\"\n\t\"go/token\"\n\t\"go/types\"\n\t\"log\"\n\t\"reflect\"\n\t\"regexp\"\n\t\"strings\"\n\n\t\"github.com/golangci/plugin-module-register/register\"\n\t\"golang.org/x/tools/go/analysis\"\n)\n\nfunc init() {\n\tregister.Plugin(\"structfield\", New)\n}\n\n// StructFieldPlugin is a custom linter plugin for golangci-lint.\ntype StructFieldPlugin struct {\n\tallowedTagNames map[string]bool\n\tallowedTagTypes map[string]bool\n}\n\n// Settings is the configuration for the structfield linter.\ntype Settings struct {\n\tAllowedTagNames []string `json:\"allowed-tag-names\" yaml:\"allowed-tag-names\"`\n\tAllowedTagTypes []string `json:\"allowed-tag-types\" yaml:\"allowed-tag-types\"`\n}\n\n// New returns an analysis.Analyzer to use with golangci-lint.\nfunc New(cfg any) (register.LinterPlugin, error) {\n\tallowedTagNames := map[string]bool{}\n\tallowedTagTypes := map[string]bool{}\n\n\tif cfg != nil {\n\t\tif settingsMap, ok := cfg.(map[string]any); ok {\n\t\t\tif exceptionsRaw, ok := settingsMap[\"allowed-tag-names\"]; ok {\n\t\t\t\tif exceptionsList, ok := exceptionsRaw.([]any); ok {\n\t\t\t\t\tfor _, item := range exceptionsList {\n\t\t\t\t\t\tif exception, ok := item.(string); ok {\n\t\t\t\t\t\t\tallowedTagNames[exception] = true\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif exceptionsRaw, ok := settingsMap[\"allowed-tag-types\"]; ok {\n\t\t\t\tif exceptionsList, ok := exceptionsRaw.([]any); ok {\n\t\t\t\t\tfor _, item := range exceptionsList {\n\t\t\t\t\t\tif exception, ok := item.(string); ok {\n\t\t\t\t\t\t\tallowedTagTypes[exception] = true\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn &StructFieldPlugin{\n\t\tallowedTagNames: allowedTagNames,\n\t\tallowedTagTypes: allowedTagTypes,\n\t}, nil\n}\n\n// BuildAnalyzers builds the analyzers for the StructFieldPlugin.\nfunc (f *StructFieldPlugin) BuildAnalyzers() ([]*analysis.Analyzer, error) {\n\treturn []*analysis.Analyzer{\n\t\t{\n\t\t\tName: \"structfield\",\n\t\t\tDoc: `Reports mismatches between Go field and JSON or URL tag names and types.\nNote that the JSON or URL tag name is the source-of-truth and the Go field name needs to match it.\nIf the \"json\" tag contains \"omitempty\", then the Go field must be a reference type.\nIf the \"url\" tag contains \"omitempty\", then the Go field must be a value type (unless it is a timestamp).`,\n\t\t\tRun: func(pass *analysis.Pass) (any, error) {\n\t\t\t\treturn run(pass, f.allowedTagNames, f.allowedTagTypes)\n\t\t\t},\n\t\t},\n\t}, nil\n}\n\n// GetLoadMode returns the load mode for the StructFieldPlugin.\nfunc (f *StructFieldPlugin) GetLoadMode() string {\n\treturn register.LoadModeSyntax\n}\n\nfunc run(pass *analysis.Pass, allowedTagNames, allowedTagTypes map[string]bool) (any, error) {\n\tfor _, file := range pass.Files {\n\t\tast.Inspect(file, func(n ast.Node) bool {\n\t\t\tif n == nil {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\tt, ok := n.(*ast.TypeSpec)\n\t\t\tif !ok {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tstructType, ok := t.Type.(*ast.StructType)\n\t\t\tif !ok {\n\t\t\t\treturn true\n\t\t\t}\n\n\t\t\t// Check only exported\n\t\t\tif !ast.IsExported(t.Name.Name) {\n\t\t\t\treturn true\n\t\t\t}\n\n\t\t\tfor _, field := range structType.Fields.List {\n\t\t\t\tif field.Tag == nil || len(field.Names) == 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tprocessStructField(t.Name.Name, field, pass, allowedTagNames, allowedTagTypes)\n\t\t\t}\n\n\t\t\treturn true\n\t\t})\n\t}\n\treturn nil, nil\n}\n\nfunc processStructField(structName string, field *ast.Field, pass *analysis.Pass, allowedTagNames, allowedTagTypes map[string]bool) {\n\tgoField := field.Names[0]\n\ttagValue := strings.Trim(field.Tag.Value, \"`\")\n\tstructTag := reflect.StructTag(tagValue)\n\n\tprocessTag(structName, goField, field, structTag, \"json\", pass, allowedTagNames, allowedTagTypes)\n\tprocessTag(structName, goField, field, structTag, \"url\", pass, allowedTagNames, allowedTagTypes)\n}\n\nfunc processTag(structName string, goField *ast.Ident, field *ast.Field, structTag reflect.StructTag, tagType string, pass *analysis.Pass, allowedTagNames, allowedTagTypes map[string]bool) {\n\ttagName, ok := structTag.Lookup(tagType)\n\tif !ok || tagName == \"-\" {\n\t\treturn\n\t}\n\n\thasOmitEmpty := strings.Contains(tagName, \",omitempty\")\n\thasOmitZero := strings.Contains(tagName, \",omitzero\")\n\n\tif hasOmitEmpty || hasOmitZero {\n\t\tcheckGoFieldType(structName, goField.Name, tagType, field, field.Pos(), pass, allowedTagTypes, hasOmitEmpty, hasOmitZero)\n\t\ttagName = strings.ReplaceAll(tagName, \",omitzero\", \"\")\n\t\ttagName = strings.ReplaceAll(tagName, \",omitempty\", \"\")\n\t}\n\tif tagType == \"url\" {\n\t\ttagName = strings.ReplaceAll(tagName, \",comma\", \"\")\n\t}\n\tcheckGoFieldName(structName, goField.Name, tagType, tagName, goField.Pos(), pass, allowedTagNames)\n}\n\nfunc checkAndReportInvalidTypesForOmitzero(structName, tagType, goFieldName string, fieldType ast.Expr, tokenPos token.Pos, pass *analysis.Pass) bool {\n\tswitch ft := fieldType.(type) {\n\tcase *ast.StarExpr:\n\t\t// Check for *[]T where T is builtin - should be []T\n\t\tif arrType, ok := ft.X.(*ast.ArrayType); ok {\n\t\t\tif ident, ok := arrType.Elt.(*ast.Ident); ok && isBuiltinType(ident.Name) {\n\t\t\t\tconst msg = \"change the %q field type to %q in the struct %q\"\n\t\t\t\tpass.Reportf(tokenPos, msg, goFieldName, \"[]\"+ident.Name, structName)\n\t\t\t} else if starExpr, ok := arrType.Elt.(*ast.StarExpr); ok {\n\t\t\t\t// Check for *[]*T - should be []*T\n\t\t\t\tif ident, ok := starExpr.X.(*ast.Ident); ok {\n\t\t\t\t\tconst msg = \"change the %q field type to %q in the struct %q\"\n\t\t\t\t\tpass.Reportf(tokenPos, msg, goFieldName, \"[]*\"+ident.Name, structName)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcheckStructArrayType(structName, goFieldName, arrType, tokenPos, pass)\n\t\t\t}\n\t\t\treturn true\n\t\t}\n\t\t// Check for *int and other pointers to builtin types\n\t\tif ident, ok := ft.X.(*ast.Ident); ok {\n\t\t\tif isBuiltinType(ident.Name) {\n\t\t\t\tconst msg = `the %q field in struct %q uses \"omitzero\" with a primitive type; remove \"omitzero\" and use only \"omitempty\" for pointer primitive types\"`\n\t\t\t\tpass.Reportf(tokenPos, msg, goFieldName, structName)\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\t// Check for *map - should be map\n\t\tif _, ok := ft.X.(*ast.MapType); ok {\n\t\t\tconst msg = \"change the %q field type to %q in the struct %q\"\n\t\t\tpass.Reportf(tokenPos, msg, goFieldName, exprToString(ft.X), structName)\n\t\t\treturn true\n\t\t}\n\t\treturn true\n\tcase *ast.MapType:\n\t\treturn true\n\tcase *ast.ArrayType:\n\t\tif tagType == \"url\" {\n\t\t\tconst msg = \"the %q field in struct %q uses unsupported omitzero tag for URL tags\"\n\t\t\tpass.Reportf(tokenPos, msg, goFieldName, structName)\n\t\t\treturn true\n\t\t}\n\t\tcheckStructArrayType(structName, goFieldName, ft, tokenPos, pass)\n\t\treturn true\n\tcase *ast.Ident:\n\t\tif obj := pass.TypesInfo.ObjectOf(ft); obj != nil {\n\t\t\tswitch obj.Type().Underlying().(type) {\n\t\t\tcase *types.Struct:\n\t\t\t\t// For Struct - should be *Struct\n\t\t\t\tconst msg = \"change the %q field type to %q in the struct %q\"\n\t\t\t\tpass.Reportf(tokenPos, msg, goFieldName, \"*\"+ft.Name, structName)\n\t\t\t\treturn true\n\t\t\tcase *types.Basic:\n\t\t\t\tif tagType == \"url\" {\n\t\t\t\t\tconst msg = \"the %q field in struct %q uses unsupported omitzero tag for URL tags\"\n\t\t\t\t\tpass.Reportf(tokenPos, msg, goFieldName, structName)\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\t// For Builtin - should not to be used with omitzero\n\t\t\t\tconst msg = `the %q field in struct %q uses \"omitzero\" with a primitive type; remove \"omitzero\", as it is only allowed with structs, maps, and slices`\n\t\t\t\tpass.Reportf(tokenPos, msg, goFieldName, structName)\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\tcase *ast.SelectorExpr:\n\t\treturn true\n\tdefault:\n\t\tlog.Fatalf(\"unhandled type: %T\", ft)\n\t}\n\treturn false\n}\n\nfunc checkGoFieldName(structName, goFieldName, tagType, tagName string, tokenPos token.Pos, pass *analysis.Pass, allowedNames map[string]bool) {\n\tfullName := structName + \".\" + goFieldName\n\tif allowedNames[fullName] {\n\t\treturn\n\t}\n\n\twant, alternate := tagNameToPascal(tagName)\n\tif goFieldName != want && goFieldName != alternate {\n\t\tconst msg = \"change Go field name %q to %q for %v tag %q in struct %q\"\n\t\tpass.Reportf(tokenPos, msg, goFieldName, want, tagType, tagName, structName)\n\t}\n}\n\nfunc checkGoFieldType(structName, goFieldName, tagType string, field *ast.Field, tokenPos token.Pos, pass *analysis.Pass, allowedTypes map[string]bool, omitempty, omitzero bool) {\n\tif allowedTypes[structName+\".\"+goFieldName] {\n\t\treturn\n\t}\n\tswitch {\n\tcase omitzero:\n\t\tskipOmitzero := checkAndReportInvalidTypesForOmitzero(structName, tagType, goFieldName, field.Type, tokenPos, pass)\n\t\tif !skipOmitzero {\n\t\t\tconst msg = `the %q field in struct %q uses \"omitzero\"; remove \"omitzero\", as it is only allowed with structs, maps, and slices`\n\t\t\tpass.Reportf(tokenPos, msg, goFieldName, structName)\n\t\t}\n\n\tcase omitempty:\n\t\tif newFieldType, ok := checkAndReportInvalidTypes(structName, tagType, goFieldName, field.Type, tokenPos, pass); !ok {\n\t\t\tconst msg = `change the %q field type to %q in the struct %q because its %v tag uses \"omitempty\"`\n\t\t\tpass.Reportf(tokenPos, msg, goFieldName, newFieldType, structName, tagType)\n\t\t}\n\t}\n}\n\nfunc checkAndReportInvalidTypes(structName, tagType, goFieldName string, fieldType ast.Expr, tokenPos token.Pos, pass *analysis.Pass) (newFieldType string, ok bool) {\n\tswitch ft := fieldType.(type) {\n\tcase *ast.StarExpr:\n\t\t// Check for *[]T where T is builtin - should be []T\n\t\tif arrType, ok := ft.X.(*ast.ArrayType); ok {\n\t\t\tif ident, ok := arrType.Elt.(*ast.Ident); ok && isBuiltinType(ident.Name) {\n\t\t\t\tconst msg = \"change the %q field type to %q in the struct %q\"\n\t\t\t\tpass.Reportf(tokenPos, msg, goFieldName, \"[]\"+ident.Name, structName)\n\t\t\t} else if starExpr, ok := arrType.Elt.(*ast.StarExpr); ok {\n\t\t\t\t// Check for *[]*T - should be []*T\n\t\t\t\tif ident, ok := starExpr.X.(*ast.Ident); ok {\n\t\t\t\t\tconst msg = \"change the %q field type to %q in the struct %q\"\n\t\t\t\t\tpass.Reportf(tokenPos, msg, goFieldName, \"[]*\"+ident.Name, structName)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcheckStructArrayType(structName, goFieldName, arrType, tokenPos, pass)\n\t\t\t}\n\t\t}\n\t\t// Check for *map - should be map\n\t\tif _, ok := ft.X.(*ast.MapType); ok {\n\t\t\tconst msg = \"change the %q field type to %q in the struct %q\"\n\t\t\tpass.Reportf(tokenPos, msg, goFieldName, exprToString(ft.X), structName)\n\t\t}\n\t\tif ident, ok := ft.X.(*ast.Ident); ok && tagType == \"url\" && isBuiltinType(ident.Name) {\n\t\t\t// Remove the pointer for primitives in url tags\n\t\t\treturn ident.Name, false\n\t\t}\n\t\treturn \"\", true\n\tcase *ast.MapType:\n\t\treturn \"\", true\n\tcase *ast.ArrayType:\n\t\tcheckStructArrayType(structName, goFieldName, ft, tokenPos, pass)\n\t\treturn \"\", true\n\tcase *ast.SelectorExpr:\n\t\t// Check for json.RawMessage\n\t\tif ident, ok := ft.X.(*ast.Ident); ok && ident.Name == \"json\" && ft.Sel.Name == \"RawMessage\" {\n\t\t\treturn \"\", true\n\t\t}\n\tcase *ast.Ident:\n\t\t// Check for `any` type\n\t\tif ft.Name == \"any\" {\n\t\t\treturn \"\", true\n\t\t}\n\t\tif tagType == \"url\" && isBuiltinType(ft.Name) {\n\t\t\treturn \"\", true\n\t\t}\n\tdefault:\n\t\tlog.Fatalf(\"unhandled type: %T\", ft)\n\t}\n\n\tnewFieldType = \"*\" + exprToString(fieldType)\n\treturn newFieldType, false\n}\n\nfunc checkStructArrayType(structName, goFieldName string, arrType *ast.ArrayType, tokenPos token.Pos, pass *analysis.Pass) {\n\tif starExpr, ok := arrType.Elt.(*ast.StarExpr); ok {\n\t\tif ident, ok := starExpr.X.(*ast.Ident); ok && isBuiltinType(ident.Name) {\n\t\t\tconst msg = \"change the %q field type to %q in the struct %q\"\n\t\t\tpass.Reportf(tokenPos, msg, goFieldName, \"[]\"+ident.Name, structName)\n\t\t}\n\t\treturn\n\t}\n\n\tif ident, ok := arrType.Elt.(*ast.Ident); ok && ident.Obj != nil {\n\t\tif _, ok := ident.Obj.Decl.(*ast.TypeSpec).Type.(*ast.StructType); ok {\n\t\t\tconst msg = \"change the %q field type to %q in the struct %q\"\n\t\t\tpass.Reportf(tokenPos, msg, goFieldName, \"[]*\"+ident.Name, structName)\n\t\t}\n\t}\n}\n\nfunc isBuiltinType(typeName string) bool {\n\treturn types.Universe.Lookup(typeName) != nil\n}\n\nfunc exprToString(e ast.Expr) string {\n\tswitch t := e.(type) {\n\tcase *ast.Ident:\n\t\treturn t.Name\n\tcase *ast.SelectorExpr:\n\t\treturn exprToString(t.X) + \".\" + t.Sel.Name\n\tcase *ast.MapType:\n\t\treturn \"map[\" + exprToString(t.Key) + \"]\" + exprToString(t.Value)\n\tdefault:\n\t\treturn fmt.Sprintf(\"%T\", e)\n\t}\n}\n\nfunc splitTag(jsonTagName string) []string {\n\tjsonTagName = strings.TrimPrefix(jsonTagName, \"$\")\n\n\tif strings.Contains(jsonTagName, \"_\") {\n\t\treturn strings.Split(jsonTagName, \"_\")\n\t}\n\n\tif strings.Contains(jsonTagName, \"-\") {\n\t\treturn strings.Split(jsonTagName, \"-\")\n\t}\n\n\tif strings.ToLower(jsonTagName) == jsonTagName { // single word\n\t\treturn []string{jsonTagName}\n\t}\n\n\ts := camelCaseRE.ReplaceAllString(jsonTagName, \"$1 $2\")\n\tparts := strings.Fields(s)\n\tfor i, part := range parts {\n\t\tparts[i] = strings.ToLower(part)\n\t}\n\n\treturn parts\n}\n\nvar camelCaseRE = regexp.MustCompile(`([a-z0-9])([A-Z])`)\n\nfunc tagNameToPascal(tagName string) (want, alternate string) {\n\tparts := splitTag(tagName)\n\talt := make([]string, len(parts))\n\tfor i, part := range parts {\n\t\talt[i] = part\n\t\tif part == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tupper := strings.ToUpper(part)\n\t\tif initialisms[upper] {\n\t\t\tparts[i] = upper\n\t\t\talt[i] = upper\n\t\t} else if specialCase, ok := specialCases[upper]; ok {\n\t\t\tparts[i] = specialCase\n\t\t\talt[i] = specialCase\n\t\t} else if possibleAlternate, ok := possibleAlternates[upper]; ok {\n\t\t\tparts[i] = possibleAlternate\n\t\t\talt[i] = strings.ToUpper(part[:1]) + part[1:]\n\t\t} else {\n\t\t\tparts[i] = strings.ToUpper(part[:1]) + part[1:]\n\t\t\talt[i] = parts[i]\n\t\t}\n\t}\n\treturn strings.Join(parts, \"\"), strings.Join(alt, \"\")\n}\n\n// Common Go initialisms that should be all caps.\nvar initialisms = map[string]bool{\n\t\"API\": true, \"ASCII\": true,\n\t\"CAA\": true, \"CAS\": true, \"CNAME\": true, \"CPU\": true,\n\t\"CSS\": true, \"CWE\": true, \"CVE\": true, \"CVSS\": true,\n\t\"DN\": true, \"DNS\": true,\n\t\"EOF\": true, \"EPSS\": true,\n\t\"GB\": true, \"GHSA\": true, \"GPG\": true, \"GUID\": true,\n\t\"HTML\": true, \"HTTP\": true, \"HTTPS\": true,\n\t\"ID\": true, \"IDE\": true, \"IDP\": true, \"IP\": true, \"JIT\": true,\n\t\"JSON\": true,\n\t\"LDAP\": true, \"LFS\": true, \"LHS\": true,\n\t\"MD5\": true, \"MS\": true, \"MX\": true,\n\t\"NPM\": true, \"NTP\": true, \"NVD\": true,\n\t\"OID\": true, \"OS\": true,\n\t\"PEM\": true, \"PR\": true, \"QPS\": true,\n\t\"RAM\": true, \"RHS\": true, \"RPC\": true,\n\t\"SAML\": true, \"SAS\": true, \"SBOM\": true, \"SCIM\": true,\n\t\"SHA\": true, \"SHA1\": true, \"SHA256\": true,\n\t\"SKU\": true, \"SLA\": true, \"SMTP\": true, \"SNMP\": true,\n\t\"SPDX\": true, \"SPDXID\": true, \"SQL\": true, \"SSH\": true,\n\t\"SSL\": true, \"SSO\": true, \"SVN\": true,\n\t\"TCP\": true, \"TFVC\": true, \"TLS\": true, \"TTL\": true,\n\t\"UDP\": true, \"UI\": true, \"UID\": true, \"UUID\": true,\n\t\"URI\": true, \"URL\": true, \"UTF8\": true,\n\t\"VCF\": true, \"VCS\": true, \"VM\": true,\n\t\"XML\": true, \"XMPP\": true, \"XSRF\": true, \"XSS\": true,\n}\n\nvar specialCases = map[string]string{\n\t\"CPUS\":    \"CPUs\",\n\t\"CWES\":    \"CWEs\",\n\t\"GRAPHQL\": \"GraphQL\",\n\t\"HREF\":    \"HRef\",\n\t\"IDS\":     \"IDs\",\n\t\"IPS\":     \"IPs\",\n\t\"OAUTH\":   \"OAuth\",\n\t\"OPENAPI\": \"OpenAPI\",\n\t\"URLS\":    \"URLs\",\n}\n\nvar possibleAlternates = map[string]string{\n\t\"ORGANIZATION\":  \"Org\",\n\t\"ORGANIZATIONS\": \"Orgs\",\n\t\"REPOSITORY\":    \"Repo\",\n\t\"REPOSITORIES\":  \"Repos\",\n}\n"
  },
  {
    "path": "tools/structfield/structfield_test.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage structfield\n\nimport (\n\t\"testing\"\n\n\t\"golang.org/x/tools/go/analysis/analysistest\"\n)\n\nfunc TestRun(t *testing.T) {\n\tt.Parallel()\n\ttestdata := analysistest.TestData()\n\tplugin, _ := New(map[string]any{\n\t\t\"allowed-tag-names\": []any{\n\t\t\t\"JSONFieldName.Query\",\n\t\t\t\"URLFieldName.Query\",\n\t\t},\n\t\t\"allowed-tag-types\": []any{\n\t\t\t\"JSONFieldType.Exception\",\n\t\t\t\"URLFieldType.Exception\",\n\t\t},\n\t})\n\tanalyzers, _ := plugin.BuildAnalyzers()\n\tanalysistest.Run(t, testdata, analyzers[0], \"has-warnings\", \"no-warnings\")\n}\n"
  },
  {
    "path": "tools/structfield/testdata/src/has-warnings/main.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage main\n\ntype JSONFieldName struct {\n\tGitHubThing      string  `json:\"github_thing\"`               // want `change Go field name \"GitHubThing\" to \"GithubThing\" for json tag \"github_thing\" in struct \"JSONFieldName\"`\n\tId               *string `json:\"id,omitempty\"`               // want `change Go field name \"Id\" to \"ID\" for json tag \"id\" in struct \"JSONFieldName\"`\n\tstrings          *string `json:\"strings,omitempty\"`          // want `change Go field name \"strings\" to \"Strings\" for json tag \"strings\" in struct \"JSONFieldName\"`\n\tcamelcaseexample *int    `json:\"camelCaseExample,omitempty\"` // want `change Go field name \"camelcaseexample\" to \"CamelCaseExample\" for json tag \"camelCaseExample\" in struct \"JSONFieldName\"`\n\tDollarRef        string  `json:\"$ref\"`                       // want `change Go field name \"DollarRef\" to \"Ref\" for json tag \"\\$ref\" in struct \"JSONFieldName\"`\n}\n\ntype JSONFieldType struct {\n\tString                         string             `json:\"string,omitempty\"`                              // want `change the \"String\" field type to \"\\*string\" in the struct \"JSONFieldType\" because its json tag uses \"omitempty\"`\n\tSliceOfStringPointers          []*string          `json:\"slice_of_string_pointers,omitempty\"`            // want `change the \"SliceOfStringPointers\" field type to \"\\[\\]string\" in the struct \"JSONFieldType\"`\n\tPointerToSliceOfStrings        *[]string          `json:\"pointer_to_slice_of_strings,omitempty\"`         // want `change the \"PointerToSliceOfStrings\" field type to \"\\[\\]string\" in the struct \"JSONFieldType\"`\n\tSliceOfStructs                 []Struct           `json:\"slice_of_structs,omitempty\"`                    // want `change the \"SliceOfStructs\" field type to \"\\[\\]\\*Struct\" in the struct \"JSONFieldType\"`\n\tPointerToSliceOfStructs        *[]Struct          `json:\"pointer_to_slice_of_structs,omitempty\"`         // want `change the \"PointerToSliceOfStructs\" field type to \"\\[\\]\\*Struct\" in the struct \"JSONFieldType\"`\n\tPointerToSliceOfPointerStructs *[]*Struct         `json:\"pointer_to_slice_of_pointer_structs,omitempty\"` // want `change the \"PointerToSliceOfPointerStructs\" field type to \"\\[\\]\\*Struct\" in the struct \"JSONFieldType\"`\n\tPointerToMap                   *map[string]string `json:\"pointer_to_map,omitempty\"`                      // want `change the \"PointerToMap\" field type to \"map\\[string\\]string\" in the struct \"JSONFieldType\"`\n\tSliceOfInts                    []*int             `json:\"slice_of_ints,omitempty\"`                       // want `change the \"SliceOfInts\" field type to \"\\[\\]int\" in the struct \"JSONFieldType\"`\n\n\tCount                              int                `json:\"count,omitzero\"`                                    // want `the \"Count\" field in struct \"JSONFieldType\" uses \"omitzero\" with a primitive type; remove \"omitzero\", as it is only allowed with structs, maps, and slices`\n\tSize                               *int               `json:\"size,omitzero\"`                                     // want `the \"Size\" field in struct \"JSONFieldType\" uses \"omitzero\" with a primitive type; remove \"omitzero\" and use only \"omitempty\" for pointer primitive types`\n\tPointerToSliceOfStringsZero        *[]string          `json:\"pointer_to_slice_of_strings_zero,omitzero\"`         // want `change the \"PointerToSliceOfStringsZero\" field type to \"\\[\\]string\" in the struct \"JSONFieldType\"`\n\tPointerToSliceOfStructsZero        *[]Struct          `json:\"pointer_to_slice_of_structs_zero,omitzero\"`         // want `change the \"PointerToSliceOfStructsZero\" field type to \"\\[\\]\\*Struct\" in the struct \"JSONFieldType\"`\n\tPointerToSliceOfPointerStructsZero *[]*Struct         `json:\"pointer_to_slice_of_pointer_structs_zero,omitzero\"` // want `change the \"PointerToSliceOfPointerStructsZero\" field type to \"\\[\\]\\*Struct\" in the struct \"JSONFieldType\"`\n\tPointerSliceInt                    *[]int             `json:\"pointer_slice_int,omitzero\"`                        // want `change the \"PointerSliceInt\" field type to \"\\[\\]int\" in the struct \"JSONFieldType\"`\n\tAnyZero                            any                `json:\"any_zero,omitzero\"`                                 // want `the \"AnyZero\" field in struct \"JSONFieldType\" uses \"omitzero\"; remove \"omitzero\", as it is only allowed with structs, maps, and slices`\n\tStringPointerSlice                 []*string          `json:\"string_pointer_slice,omitzero\"`                     // want `change the \"StringPointerSlice\" field type to \"\\[\\]string\" in the struct \"JSONFieldType\"`\n\tPointerToMapZero                   *map[string]string `json:\"pointer__to_map_zero,omitzero\"`                     // want `change the \"PointerToMapZero\" field type to \"map\\[string\\]string\" in the struct \"JSONFieldType\"`\n\tSliceOfStructsZero                 []Struct           `json:\"slice_of_structs_zero,omitzero\"`                    // want `change the \"SliceOfStructsZero\" field type to \"\\[\\]\\*Struct\" in the struct \"JSONFieldType\"`\n\tStructZero                         Struct             `json:\"struct_zero,omitzero\"`                              // want `change the \"StructZero\" field type to \"\\*Struct\" in the struct \"JSONFieldType\"`\n\n\tAnyBoth              any     `json:\"any_both,omitempty,omitzero\"`                // want `the \"AnyBoth\" field in struct \"JSONFieldType\" uses \"omitzero\"; remove \"omitzero\", as it is only allowed with structs, maps, and slices`\n\tNonPointerStructBoth Struct  `json:\"non_pointer_struct_both,omitempty,omitzero\"` // want `change the \"NonPointerStructBoth\" field type to \"\\*Struct\" in the struct \"JSONFieldType\"`\n\tPointerStringBoth    *string `json:\"pointer_string_both,omitempty,omitzero\"`     // want `the \"PointerStringBoth\" field in struct \"JSONFieldType\" uses \"omitzero\" with a primitive type; remove \"omitzero\" and use only \"omitempty\" for pointer primitive types`\n\tStructZeroBoth       Struct  `json:\"struct_zero_both,omitempty,omitzero\"`        // want `change the \"StructZeroBoth\" field type to \"\\*Struct\" in the struct \"JSONFieldType\"`\n}\n\ntype Struct struct{}\n\ntype URLFieldName struct {\n\tGitHubThing string `url:\"github_thing\"` // want `change Go field name \"GitHubThing\" to \"GithubThing\" for url tag \"github_thing\" in struct \"URLFieldName\"`\n}\n\ntype URLFieldType struct {\n\tPage          *string `url:\"page,omitempty\"`          // want `change the \"Page\" field type to \"string\" in the struct \"URLFieldType\" because its url tag uses \"omitempty\"`\n\tPerPage       *int    `url:\"per_page,omitempty\"`      // want `change the \"PerPage\" field type to \"int\" in the struct \"URLFieldType\" because its url tag uses \"omitempty\"`\n\tParticipating *bool   `url:\"participating,omitempty\"` // want `change the \"Participating\" field type to \"bool\" in the struct \"URLFieldType\" because its url tag uses \"omitempty\"`\n\n\tPerPageZeros []int `url:\"per_page_zeros,omitzero\"`          // want `the \"PerPageZeros\" field in struct \"URLFieldType\" uses unsupported omitzero tag for URL tags`\n\tPerPageBoth  int   `url:\"per_page_both,omitempty,omitzero\"` // want `the \"PerPageBoth\" field in struct \"URLFieldType\" uses unsupported omitzero tag for URL tags`\n}\n"
  },
  {
    "path": "tools/structfield/testdata/src/no-warnings/main.go",
    "content": "// Copyright 2025 The go-github AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"time\"\n)\n\ntype JSONFieldName struct {\n\tGithubThing string  `json:\"github_thing\"`\n\tID          *string `json:\"id,omitempty\"`\n\tStrings     *string `json:\"strings,omitempty\"`\n\tRef         *string `json:\"$ref,omitempty\"`\n\tQuery       string  `json:\"q\"`\n}\n\ntype JSONFieldType struct {\n\tWithoutTag string\n\n\tID                    *string           `json:\"id,omitempty\"`\n\tHookAttributes        map[string]string `json:\"hook_attributes,omitempty\"`\n\tInputs                json.RawMessage   `json:\"inputs,omitempty\"`\n\tException             string            `json:\"exception,omitempty\"`\n\tValue                 any               `json:\"value,omitempty\"`\n\tSliceOfPointerStructs []*Struct         `json:\"slice_of_pointer_structs,omitempty\"`\n\n\tSliceOfStrings            []string       `json:\"slice_of_strings,omitzero\"`\n\tMapOfStringToInt          map[string]int `json:\"map_of_string_to_int,omitzero\"`\n\tPointerStructField        *Struct        `json:\"pointer_struct_field,omitzero\"`\n\tSliceOfPointerStructsZero []*Struct      `json:\"slice_of_pointer_structs_zero,omitzero\"`\n\n\tSliceOfStringsBoth        []string       `json:\"slice_of_strings_both,omitzero,omitempty\"`\n\tMapOfStringToIntBoth      map[string]int `json:\"map_of_string_to_int_both,omitzero,omitempty\"`\n\tSliceOfPointerStructsBoth []*Struct      `json:\"slice_of_pointer_structs_both,omitzero,omitempty\"`\n\tStructFieldBoth           *Struct        `json:\"struct_field_both,omitzero,omitempty\"`\n}\n\ntype URLFieldName struct {\n\tID    string `url:\"id,omitempty\"`\n\tQuery string `url:\"q\"`\n}\n\ntype URLFieldType struct {\n\tPage      string     `url:\"page,omitempty\"`\n\tPerPage   int        `url:\"per_page,omitempty\"`\n\tLabels    []string   `url:\"labels,omitempty,comma\"`\n\tSince     *time.Time `url:\"since,omitempty\"`\n\tSince2    time.Time  `url:\"since2,omitzero\"`\n\tFields    []int64    `url:\"fields,omitempty,comma\"`\n\tException string     `url:\"exception,omitempty\"`\n}\n\ntype Struct struct{}\n"
  }
]